refactor(interaction): move the moving-target decision policy into the runtime gate
Summary
Follow-up to #3538 (owner comment 6145734277). The moving-target baseline stays in contracts, and the policy moves to its only consumer.
- Baseline stays cross-layer.
MovingTargetBaselinenow sits inpackages/contracts/src/runtime-contract.ts, next toCommandSessionRecord.movingTargetBaseline. Daemon core (session-state.ts,deferred-interaction-outcome.ts) imports it from there, still as a type-only import. - Policy moves.
MOVING_TARGET_GATE_WINDOW_MS,MOVING_TARGET_GATE_SAMPLE_GAP_MS, theMovingTargetGateDecisionunion andmovingTargetGateDecisionmove intosrc/commands/interaction/runtime/moving-target-gate.ts. The gate is their only consumer; a grep ofpackages,srcandscriptsfound no other importer of a policy symbol. - Tests move unchanged. The 7 decision tests move into
moving-target-gate.test.ts, the gate's mirror test file. - Removed:
- the
./moving-target-gatesubpath inpackages/contracts/package.json @agent-device/contracts/moving-target-gateinscripts/layering/contracts-exports.snapshot.jsonpackages/contracts/src/moving-target-gate{,.test}.ts
- the
No behavior change. 10 files, +208/−241. No fallow baseline referenced the old path.
This PR also deletes the stale replay-maestro-backend.ts APPROVED_OVER_CEILING row. That deletion is the follow-up #3623 left for the next PR off main.
Validation
pnpm check:affected --run at ea0db1646 passed. A package manifest changed, so it ran the full check set, including format, lint, typecheck, layering, fallow, build, package, integration-node, macos-coverage, vitest-related, production-exports and the compat suites. The eager-closure budgets do not grow.
The earlier run at e7701ae3f failed only on the stale approval row, which this PR now deletes. A cold review found nothing, and both cubic findings (header wording) are fixed in b478e8a61.