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
packages/gittensory-mcp/bin/gittensory-mcp.js's gittensory_feasibility_gate tool (~lines 1191-1202) takes claimStatus as a caller-supplied string, so the pure feasibility calculator is never actually connected to real local claim state. packages/gittensory-miner/lib/claim-ledger.js already tracks real claim state locally and can supply this directly when a local AMS install is present.
Dependencies
None — independently shippable. This does not require the AMS MCP scaffold issue in this same batch, since gittensory_feasibility_gate lives in the already-existing packages/gittensory-mcp package, not the new gittensory-miner-mcp server. It also does not depend on the new list_claims MCP tool in this same batch — this issue reads packages/gittensory-miner/lib/claim-ledger.js directly. Real claim-conflict resolution authority remains entirely in #4848's maintainer-only path; this issue must not duplicate or override that logic.
Requirements
In packages/gittensory-mcp/bin/gittensory-mcp.js's gittensory_feasibility_gate tool (~lines 1191-1202), detect whether a local AMS install is present (i.e., claim-ledger.js state is available for the caller/repo/issue in question).
When a local AMS install is detected, read the caller's own claim status directly from packages/gittensory-miner/lib/claim-ledger.js instead of trusting the caller-supplied claimStatus string.
When no local AMS install is detected, fall back to today's caller-supplied-string behavior, unchanged.
Do not change the feasibility calculator's own decision logic in any way — this issue only changes where claimStatus is sourced from, never how it's evaluated.
The tool's output must remain non-blocking/advisory-only: it must not gain any new ability to block, cancel, or override a claim or attempt. Real claim-conflict authority stays entirely in Wire claim-conflict resolution end-to-end #4848's maintainer-only path; this tool only informs the caller, it never enforces.
Must not touch governor or attempt state in any way — this change is read-only against claim-ledger.js; no new write paths are introduced.
Deliverables / Acceptance Criteria
gittensory_feasibility_gate reads claimStatus from claim-ledger.js when a local AMS install is detected
Fallback to caller-supplied string preserved and tested for the no-local-install case
No change to the feasibility calculator's decision logic (diff scoped to input sourcing only)
No write access added to claim-ledger.js from this tool — read-only confirmed
Output remains advisory-only; no new blocking/override capability added
Docs/comment updated in gittensory-mcp.js noting this tool is advisory-only and carries no claim-conflict authority
Test Coverage Requirements
This PR must ship with full test coverage for every changed line and branch — the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. Add: (1) unit tests covering both the local-AMS-install-detected branch (claimStatus sourced from claim-ledger.js) and the no-local-install branch (falls back to caller-supplied string), including the calculator's success and failure paths in each, (2) an invariant test asserting gittensory_feasibility_gate's output is advisory-only and never mutates claim-ledger state or governor/attempt state in either branch, and (3) a regression test reproducing today's bug — a caller-supplied claimStatus that contradicts real local claim-ledger state — asserting the tool now prefers ledger-backed truth when a local install is present.
Codecov visibility note:packages/gittensory-miner/**, apps/gittensory-miner-ui/**, and apps/gittensory-miner-extension/** currently sit entirely outside vitest's coverage.include glob, so codecov/patch cannot measure changes there yet — closing that gap is exactly what #4864 and #4865 (in this same milestone) do. Any part of this change under packages/gittensory-engine/src/** or the repo's own src/** remains fully Codecov-instrumented as usual. Either way, this does not lower the bar: treat the 100%-including-invariants-and-regression target above as the enforced house standard regardless of what Codecov can currently see, and it becomes gate-enforced for real once #4864/#4865 ship.
Expected Outcome
A caller invoking gittensory_feasibility_gate against a machine with a local AMS install gets an accurate, ledger-backed claimStatus automatically instead of relying on a possibly-stale or spoofable caller-supplied string, while claim-conflict enforcement authority stays exclusively with #4848's maintainer-only path.
Links & Resources
packages/gittensory-mcp/bin/gittensory-mcp.js (~lines 1191-1202) — the tool being wired
packages/gittensory-miner/lib/claim-ledger.js — the real local claim state to read from
Context
packages/gittensory-mcp/bin/gittensory-mcp.js's
gittensory_feasibility_gatetool (~lines 1191-1202) takesclaimStatusas a caller-supplied string, so the pure feasibility calculator is never actually connected to real local claim state. packages/gittensory-miner/lib/claim-ledger.js already tracks real claim state locally and can supply this directly when a local AMS install is present.Dependencies
None — independently shippable. This does not require the AMS MCP scaffold issue in this same batch, since
gittensory_feasibility_gatelives in the already-existing packages/gittensory-mcp package, not the new gittensory-miner-mcp server. It also does not depend on the newlist_claimsMCP tool in this same batch — this issue reads packages/gittensory-miner/lib/claim-ledger.js directly. Real claim-conflict resolution authority remains entirely in #4848's maintainer-only path; this issue must not duplicate or override that logic.Requirements
gittensory_feasibility_gatetool (~lines 1191-1202), detect whether a local AMS install is present (i.e., claim-ledger.js state is available for the caller/repo/issue in question).claimStatusstring.claimStatusis sourced from, never how it's evaluated.Deliverables / Acceptance Criteria
gittensory_feasibility_gatereadsclaimStatusfrom claim-ledger.js when a local AMS install is detectedTest Coverage Requirements
This PR must ship with full test coverage for every changed line and branch — the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. Add: (1) unit tests covering both the local-AMS-install-detected branch (claimStatus sourced from claim-ledger.js) and the no-local-install branch (falls back to caller-supplied string), including the calculator's success and failure paths in each, (2) an invariant test asserting
gittensory_feasibility_gate's output is advisory-only and never mutates claim-ledger state or governor/attempt state in either branch, and (3) a regression test reproducing today's bug — a caller-suppliedclaimStatusthat contradicts real local claim-ledger state — asserting the tool now prefers ledger-backed truth when a local install is present.Codecov visibility note:
packages/gittensory-miner/**,apps/gittensory-miner-ui/**, andapps/gittensory-miner-extension/**currently sit entirely outside vitest'scoverage.includeglob, socodecov/patchcannot measure changes there yet — closing that gap is exactly what #4864 and #4865 (in this same milestone) do. Any part of this change underpackages/gittensory-engine/src/**or the repo's ownsrc/**remains fully Codecov-instrumented as usual. Either way, this does not lower the bar: treat the 100%-including-invariants-and-regression target above as the enforced house standard regardless of what Codecov can currently see, and it becomes gate-enforced for real once #4864/#4865 ship.Expected Outcome
A caller invoking
gittensory_feasibility_gateagainst a machine with a local AMS install gets an accurate, ledger-backedclaimStatusautomatically instead of relying on a possibly-stale or spoofable caller-supplied string, while claim-conflict enforcement authority stays exclusively with #4848's maintainer-only path.Links & Resources