docs: slim interactive replay ADR to a decision record

Merged
TH
3h ago
+1306-1474

Summary

Slims ADR 0012 to a decision record, the same way #4277 and #4279 slimmed ADRs 0007 and 0004.
Size: 97,254 B → 16,844 B. The ADR keeps no file paths, so no stale path citation remains. It names owners instead.
Decision numbers 1–6 and rule labels R1–R7 stay the same, so code citations still resolve.

Contracts that only 0012 held now live with their owners (5 new docs, 6 files touched):

  • packages/ad-script/docs/target-annotation.md: target-v1/targets-v1 format, bounds, record-time write, the six verification paths, and #1269/#1280/#1349.
  • packages/replay-port/docs/replay-divergence.md: suggestion ranking, screen capture scope (#1264), repairHint mapping (R3), and the launch-race retry (#1385).
  • packages/ad-replay/docs/divergence-and-resume.md: wire fields, level ceilings, redaction, overflow, surfaces, resume ordinals, watermark, and plan digest.
  • packages/daemon/docs/replay-repair-transaction.md: R1–R7, the state machine, publication, tombstone, and observation exclusion (#1271).
  • packages/command-runtime/docs/resolution-disclosure.md: resolution shapes and the six matrix cells.

Each doc keeps its part of the old decision 5 coverage inventory.
The ADR stays above the 8 KB aim. The remaining text is six decisions, their reasons, rejected alternatives, and open gaps.
The diff exceeds the 2,500-line cap because it moves contracts to owner docs and includes a migration ledger.
Part of #4205.

Validation

Head ce49ed1c4ab8e3523b09c34d35d9133057444c5f. Docs only, so runtime and device tests do not apply.

  • pnpm check:affected --run --head ce49ed1c4a: passed, exactCommit=true, 0 checks selected.
  • pnpm format, node --experimental-strip-types scripts/check-doc-prose.ts, and pnpm check:doc-links: passed at this head.
  • A source search of all 293 backticked identifier tokens found only allowRecord absent; it names a rejected hypothetical argument.
  • Review corrections document two implementation gaps: native-ref can report exact after label recovery, and an escape-heavy target annotation can remain oversized after rect removal. No runtime code changed.
  • Hosted checks and review remain separate from local validation.

The ledger below describes the original move. The review correction qualifies its earlier claims about overwrite, bounds, and native-ref disclosure.

Migration ledger

Abbreviations: TA = ad-script target-annotation, RD = replay-port replay-divergence, DR = ad-replay divergence-and-resume, RT = daemon replay-repair-transaction, RDis = command-runtime resolution-disclosure.

Old sectionOutcomeOwner or reason
Status: amendment list, deferred benchmarkKeptStatus
Status: implementation record and migration plan pointerDeletedGit history
Rules at a glanceKept (merged)Each rule is now a Decision paragraph
Decision 1: no rewrite; candidate machinery feeds suggestionsKeptDecision 1
Decision 1: ranking total order, dedup, levelsMovedRD "Suggestions" (from the earlier worker's draft)
Decision 1: "one model turn" reasonKeptRationale
Decision 1: audit item (a)DeletedHistory; Context keeps "could not rescue renames"
Decision 2: structural collapse, rejection, pre-action diagnostics, label fallback, direct-iOS ruleKept (short)Decision 2
Decision 2: exact shapes, native-ref, matrix cells, executed-dispatch rule, Layer-3 coverageMovedRDis
Decision 3: tiers, no rect identity, six paths, writer-parser invariant, additive format, bindingKept (short)Decision 3
Decision 3: payload example, field order, normalization, bounds, local identity, ancestry, record-time write, parser, verification pathsMovedTA
#1567 dual-endpoint evidenceKept (short) + movedDecision 3; TA "Format"
#1269, #1280, #1349, #1398 amendmentsKept (one line each) + movedDecision 3; TA sections
#1269/#1280 measured cases (android:id/title, linearlayout row, RN FlatList)DeletedExamples; the platform-neutral rules stay
#1349 live Android validation noteDeletedHistory; the polling rule stays
#1385 launch-race retryKept (one line) + movedDecision 3; RD "Pre-dispatch capture retry"
Decision 4: structured error, kinds, screen invariant, ceilings, surfaces, resume loopKept (short)Decision 4
Decision 4: field list, matchCount presence, repairHint transport, screen forms, bounds table, redaction, overflow, surfaces, ADR 0014 partial frame, ordinals, alternateFrom, empty tail, watermark, digest, allowed vs repairSessionHeld, preflightMovedDR
#1264 capture scope and ref selectionKept (invariant) + movedDecision 4; RD "Screen capture scope"
Decision 5 inventoryMovedEach owner's "Required coverage" section; ADR keeps the gate
Decision 5 benchmark harness path (~/.agent-device-bench/…)DeletedExternal path; the deferred arm stays as an open gap
Decision 6: hand-edit measurementKept (one line)Rejected alternatives
Decision 6: core mechanism, sub-flows, R1–R7, teardown, terminal close, digest, activation, state machine, publication, scope, tombstoneKept (short) + movedDecision 6; RT
Decision 6: R3 mapping table and fail-safesMovedRD "Repair hint computation"
Decision 6: earlier publish-lock designKeptRejected alternatives
Decision 6: removed publishOverwriteAtomically, #1235DeletedHistory
#1271 stage 2 observation exclusionKept (short) + movedDecision 6; RT "Observation exclusion"
#1271 wave-3 E3 measurementDeletedHistory; the provenance rule and its reason stay
#1271 position-inference and policy-argument alternativesKeptRejected alternatives; RT keeps the helper split
ConsequencesKeptConsequences
Alternatives consideredKept, renamed "Rejected alternatives"No link targets the old heading
Context and evidence at acceptanceDeleted (short Context kept)Historical audit with stale paths; Context keeps the three gaps
Wording drift

Old ADR → new text. Modality, scope, defaults, and numbers only.

  1. RDis: "ADR 0011's matrix must add a resolutionDisclosure guarantee" → "has". The row exists in the guarantee matrix, so the instruction became a statement of fact.
  2. Decision 3: "The pre-dispatch verification capture bounds-retries …" → "retries … with a bounded delay budget". RD keeps the 7 delays and 12 s budget unchanged.
  3. Decision 3: the writer's "unverifiable" downgrade is stated for the bounds case only. TA keeps the other two causes, the self-check and the #1398 echo.
  4. Decision 4: "Entered text is never serialized. Native .ad replay replaces expanded variable values with <var:NAME> in human-readable divergence fields." DR keeps the full scope, including machine-readable fields that never get substring replacement.
  5. Decision 6: R1–R7 are one-line summaries. RT keeps the full normative text, including every MUST.
  6. Decision 6 R7: "armed replay must fail before step 1" keeps "must".
  7. RT: the flows/login.ad example became login.ad. The sibling rule is unchanged.
  8. RT: "This follows existing saveScript handling in session-lifecycle/internal/session-close.ts" became "the existing session-close saveScript handling". It names the owner, not the path.
  9. RD: the #1233/#1256 references on chrome filtering were dropped. The collectSettleChromeRefs rule is unchanged.
  10. TA: "Step 5's record-time self-check" → "The record-time self-check". The numbered step is in the same doc.
  11. Context: the audit narrative is shortened to three gaps. No decision depended on the deleted pointers.

No exception or scope was widened.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.