You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depends on the discovery-index API contract (sibling Phase 6 issue) for its request shape — file both, but the contract should land first or alongside.
packages/gittensory-miner/lib/claim-ledger.js already implements soft-claims, but its header comment is explicit about the boundary this issue extends past: "The database only lives on this machine; this module never uploads, syncs, or phones home" (claim-ledger.js:8-9), and "sibling miners claiming the same issue are resolved elsewhere via isDuplicateClusterWinnerByClaim from @jsonbored/gittensory-engine (#3355)" (claim-ledger.js:81-83) — that adjudication function resolves collisions after the fact, by observing which PR/comment publicly landed first; it has no way to know about another miner's claim before both have already started work. This issue is the piece that closes that gap: a pure, client-side builder that turns a local claim (already recorded via claimIssue/recordClaim in claim-ledger.js) into the request payload a miner would send to the hosted discovery-index (sibling issue) to softly announce/reserve an issue across the fleet before starting, reducing collisions instead of only detecting them afterward.
Scoped as a "request builder," not a network client: this issue produces a typed, pure function that reads the local claim-ledger shape and returns a request payload matching the discovery-index contract — it does not need to perform the actual HTTP call (that's for whichever issue wires the hosted plane's client into the miner runtime, likely downstream of #4250 actually existing).
Deliverables
A pure buildSoftClaimRequest(claim, context)-style function (in @jsonbored/gittensory-engine, consistent with the discovery-index contract's location) that maps a local claim record's shape (packages/gittensory-miner/lib/claim-ledger.js's rowToClaim output, :59-68: repoFullName, issueNumber, claimedAt, status, note) onto the discovery-index contract's soft-claim request shape.
No network call inside this function — pure input/output, unit-testable without a server.
Handle the local ledger's three claim statuses (active, released, expired, claim-ledger.js:12) explicitly — only an active claim should ever produce an outbound "claim" request; released/expired claims should either be rejected by the builder or produce an explicit "release" request variant, whichever the discovery-index contract defines.
Unit tests under test/unit/, following test/unit/miner-claim-ledger.test.ts's existing fixtures for claim shapes.
Sibling Phase 6 issue: feat(miner-discovery-plane): define the public-data-only discovery-index API contract — the request shape this builder targets; hard dependency.
Depends on the discovery-index API contract (sibling Phase 6 issue) for its request shape — file both, but the contract should land first or alongside.
packages/gittensory-miner/lib/claim-ledger.jsalready implements soft-claims, but its header comment is explicit about the boundary this issue extends past: "The database only lives on this machine; this module never uploads, syncs, or phones home" (claim-ledger.js:8-9), and "sibling miners claiming the same issue are resolved elsewhere viaisDuplicateClusterWinnerByClaimfrom@jsonbored/gittensory-engine(#3355)" (claim-ledger.js:81-83) — that adjudication function resolves collisions after the fact, by observing which PR/comment publicly landed first; it has no way to know about another miner's claim before both have already started work. This issue is the piece that closes that gap: a pure, client-side builder that turns a local claim (already recorded viaclaimIssue/recordClaiminclaim-ledger.js) into the request payload a miner would send to the hosted discovery-index (sibling issue) to softly announce/reserve an issue across the fleet before starting, reducing collisions instead of only detecting them afterward.Scoped as a "request builder," not a network client: this issue produces a typed, pure function that reads the local claim-ledger shape and returns a request payload matching the discovery-index contract — it does not need to perform the actual HTTP call (that's for whichever issue wires the hosted plane's client into the miner runtime, likely downstream of #4250 actually existing).
Deliverables
buildSoftClaimRequest(claim, context)-style function (in@jsonbored/gittensory-engine, consistent with the discovery-index contract's location) that maps a local claim record's shape (packages/gittensory-miner/lib/claim-ledger.js'srowToClaimoutput,:59-68:repoFullName,issueNumber,claimedAt,status,note) onto the discovery-index contract's soft-claim request shape.active,released,expired,claim-ledger.js:12) explicitly — only anactiveclaim should ever produce an outbound "claim" request;released/expiredclaims should either be rejected by the builder or produce an explicit "release" request variant, whichever the discovery-index contract defines.test/unit/, followingtest/unit/miner-claim-ledger.test.ts's existing fixtures for claim shapes.References
packages/gittensory-miner/lib/claim-ledger.js:6-10(header comment on the never-phones-home boundary this issue extends past),:12(CLAIM_STATUSES),:59-68(rowToClaim, the local claim shape to build the request from),:81-83(theisDuplicateClusterWinnerByClaim/Doc comment explicitly noting this table is a LOCAL bookkeeping primitive only and does NOT itself decide who "wins" a contested issue — that adjudication (reusingisDuplicateClusterWinnerByClaimfrom@jsonbored/gittensory-engine) is out of scope for this foundation-phase issue. #3355 reference for the after-the-fact adjudication this complements).feat(miner-discovery-plane): define the public-data-only discovery-index API contract— the request shape this builder targets; hard dependency.feat(discovery-plane): stand up the hosted discovery-index server) — "Cross-fleet soft-claim dedup logic (server-side half of the client's soft-claim request builder)" is listed there as a deliverable, i.e. feat(discovery-plane): stand up the hosted discovery-index server #4250 already names this exact client-side piece as its counterpart.