⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
packages/loopover-engine/src/ams-policy-spec.ts:411-412 exports AMS_POLICY_SPEC_FILENAMES = [".loopover-ams.yml", ".github/loopover-ams.yml", ".loopover-ams.json", ".github/loopover-ams.json"], explicitly claiming first-match-wins discovery "mirroring MINER_GOAL_SPEC_FILENAMES". But the actual consumer, packages/loopover-miner/lib/ams-policy.ts, hardcodes a single filename (.loopover-ams.yml) resolved only via the operator config dir -- it never imports the constant, has no fallback chain, and doesn't support the .github/ or .json variants the constant documents as valid. An operator using either alternate path silently gets defaults with no warning. Confirmed dead via grep: referenced only in its own declaration, the barrel export, and a test asserting just the literal array -- no discovery-behavior test exists (unlike MinerGoalSpec's dedicated test).
Requirements
Either (a) delete the misleading constant and its "mirrors MINER_GOAL_SPEC_FILENAMES" comment if AMS policy is deliberately meant to be operator-local-only, not repo-discovered, or (b) wire packages/loopover-miner/lib/ams-policy.ts to actually use the documented discovery order via a real discovery helper (mirroring discoverMinerGoalSpecPath's tested implementation). Pick one and make the code and the documentation agree -- do not leave the mismatch in place. Prefer option (b) unless there's a concrete reason AMS policy must stay operator-local (state that reason in the PR if you choose (a)).
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-engine/**/packages/loopover-miner/** -- 99%+ patch coverage on whichever path is chosen.
Expected Outcome
The documented AMS policy discovery order and the real resolver's behavior agree -- either both support the 4-path fallback, or neither claims to.
Links & Resources
packages/loopover-engine/src/ams-policy-spec.ts:411-412
packages/loopover-miner/lib/ams-policy.ts
Context
packages/loopover-engine/src/ams-policy-spec.ts:411-412exportsAMS_POLICY_SPEC_FILENAMES = [".loopover-ams.yml", ".github/loopover-ams.yml", ".loopover-ams.json", ".github/loopover-ams.json"], explicitly claiming first-match-wins discovery "mirroringMINER_GOAL_SPEC_FILENAMES". But the actual consumer,packages/loopover-miner/lib/ams-policy.ts, hardcodes a single filename (.loopover-ams.yml) resolved only via the operator config dir -- it never imports the constant, has no fallback chain, and doesn't support the.github/or.jsonvariants the constant documents as valid. An operator using either alternate path silently gets defaults with no warning. Confirmed dead via grep: referenced only in its own declaration, the barrel export, and a test asserting just the literal array -- no discovery-behavior test exists (unlikeMinerGoalSpec's dedicated test).Requirements
Either (a) delete the misleading constant and its "mirrors MINER_GOAL_SPEC_FILENAMES" comment if AMS policy is deliberately meant to be operator-local-only, not repo-discovered, or (b) wire
packages/loopover-miner/lib/ams-policy.tsto actually use the documented discovery order via a real discovery helper (mirroringdiscoverMinerGoalSpecPath's tested implementation). Pick one and make the code and the documentation agree -- do not leave the mismatch in place. Prefer option (b) unless there's a concrete reason AMS policy must stay operator-local (state that reason in the PR if you choose (a)).Deliverables
AMS_POLICY_SPEC_FILENAMESand its doc comment are deleted (withams-policy.tsunchanged), orams-policy.tsis wired to use the documented 4-path discovery order via a new discovery helper mirroringdiscoverMinerGoalSpecPathMinerGoalSpec's dedicated test, covering all four filename variantsAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-engine/**/packages/loopover-miner/**-- 99%+ patch coverage on whichever path is chosen.Expected Outcome
The documented AMS policy discovery order and the real resolver's behavior agree -- either both support the 4-path fallback, or neither claims to.
Links & Resources
packages/loopover-engine/src/ams-policy-spec.ts:411-412packages/loopover-miner/lib/ams-policy.ts