refactor(interaction): move the moving-target decision policy into the runtime gate

Merged
TH
1d ago
+208-241

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. MovingTargetBaseline now sits in packages/contracts/src/runtime-contract.ts, next to CommandSessionRecord.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, the MovingTargetGateDecision union and movingTargetGateDecision move into src/commands/interaction/runtime/moving-target-gate.ts. The gate is their only consumer; a grep of packages, src and scripts found 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-gate subpath in packages/contracts/package.json
    • @agent-device/contracts/moving-target-gate in scripts/layering/contracts-exports.snapshot.json
    • packages/contracts/src/moving-target-gate{,.test}.ts

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.