test: frozen replay-compat corpus with expected verdicts (#1417) - #1436
test: frozen replay-compat corpus with expected verdicts (#1417)#1436devin-ai-integration[bot] wants to merge 5 commits into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Size Report
Startup median (7 runs, lower is better):
Top changed chunks: no changes in the largest emitted chunks. |
|
Two blocking guardrail gaps remain. (1) The “frozen, released” claim is not mechanically protected: corpus.test.ts only regex-checks recordedBy and repeats it in free-form source/file strings. It does not prove the tag is released or that the checked-in script still matches its historical source, so a future PR could rewrite both the frozen script and metadata while the gate stays green. Pin a released-tag/source-blob identity or digest per entry and verify the current corpus bytes against it. (2) The test reconstructs the parse boundary in the wrong order: it calls readReplayScriptMetadata before parseReplayScriptDetailed, while production parseReplayInput composes them in the reverse order. Multi-fault scripts can therefore assert a different code/hint than replay actually surfaces, and changes to the real composition boundary are unguarded. Exercise parseReplayInput(script, undefined) instead. Exact-head Coverage is also red on the inherited ios-system-ui benchmark gap, so this head is not ready. |
aca0972 to
9e5a56f
Compare
Both addressed in 9e5a56f; branch is also rebased onto (1) Identity is pinned, not asserted. The free-form
The "was this tag actually cut" half needs git, so it lives in Tamper check: appending one line to a corpus script now fails (2) Parse boundary. The test now calls Gates: On Coverage: the |
|
|
Re-review at head 9e5a56f: the parse-order issue is fixed, but one P1 provenance blocker remains. The historical verifier only checks entries while they remain kind mined. A mined corpus script can be edited, reclassified as derived, and given a matching digest in the same editable manifest; the verifier then skips it and the unit hash check accepts the new bytes. Lock provenance kind mechanically by corpus area (at minimum integration/examples must remain mined), add a negative reclassification test, and run check:replay-compat in a full-history CI job. The current green checks do not invoke that verifier. Once that provenance boundary is enforced, the shipped parseReplayInput path and action-before-metadata ordering look correct. |
Fixed in 2e80e27 (+ docs commit). The reclassification escape is closed at the rule level, not by convention:
const CORPUS_AREA_PROVENANCE_KIND = { integration: 'mined', examples: 'mined', docs: 'derived' };
requiredProvenanceKind('scripts/examples/gesture-lab.v0.16.8.ad'); // 'mined'
findProvenanceKindViolations(entries); // '…must stay "mined" … keep the released blob id instead'
CI now invokes the verifier. New Green locally: Coverage's |
|
Re-review at head c1b4af5: clean readiness verdict. The remaining provenance blocker is fixed: integration/examples corpus areas are mechanically locked to mined provenance, unknown areas fail closed, mined-to-derived reclassification has a negative test, and the full-history Replay-Compat Provenance CI job re-derives released blobs with tags. Corpus assertions still use production parseReplayInput in the correct action-before-metadata order. The PR is mergeable/CLEAN and all checks, including provenance, Coverage, and Integration Tests, pass. Marked ready-for-human. |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… parseReplayInput Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… in CI Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
c1b4af5 to
aba1270
Compare
Reviewer feedback on #1436: the mechanism earns its place, the dataset did not. Drop the 30 corpus entries whose bytes repeat a syntactic form or a migration refusal another entry already witnesses (platform twins and adjacent-release re-recordings), leaving 22 deliberate entries; make note required and state per entry which form or refusal it is the sole witness of. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Re-review at 09a0557: clean and ready for human review.\n\nThe 22-entry corpus retains every #1417 required parser surface and all retired-gesture migration refusals; removed fixtures are platform/adjacent-release duplicates. Required per-entry notes and the 30-entry cap make future additions deliberate. Provenance protections remain intact (area-kind lock, byte/digest pins, and full-history released-blob verification).\n\nValidated: focused corpus unit suite (51/51), local provenance verification, and the reviewed-head CI suite including Replay-Compat Provenance, Coverage, Integration Tests, Typecheck, Lint/Format, Fallow, and affected-check selector. Merge state: CLEAN. |
Summary
Closes #1417 (umbrella #1412 Track A). A frozen
.adcorpus of scripts released versions wrote, each paired with the verdict today's parser owes it, gated inunit-core.test/replay-compat/manifest.tsis the whole contract:corpus.test.tsasserts each verdict through productionparseReplayInput(script, undefined)— the same composition, in the same action-before-metadata order, thatreplay/testhit — so a multi-fault script reports the code/hint replay really surfaces.Freezing is mechanical, not asserted in prose:
minedbytes must hash to the pinned git blob id (sha1("blob <len>\0" + bytes)), an id obtainable only from the released content, so "edit the script until the parser agrees" cannot pass as a corpus update;derivedbytes (scripts/docs/, forms the release's grammar wrote that no shipped.adcarries) are SHA-256-pinned.provenance-rules.tsfixes the kind by corpus area (integration/examples→mined,docs→derived, unknown area throws), closing the loophole where an edited mined script is relabelledderived, re-pinned by digest, and skipped by the history verifier. Negative test included.pnpm check:replay-compatre-derives every mined id viagit rev-parse <tag>:<path>and validates every cited tag againstgit tag --list. It needs full history, so it runs in a dedicatedReplay-Compat Provenancejob (fetch-depth: 0) and is selected bypnpm check:affectedfor anytest/replay-compat/change.Coverage spans the surfaces #1417 named: pre-removal gesture forms (#1393 swipe/fling/rotate/
gesture swipedurationMs),${VAR}/quoting/--record-asprojections, wait + landmark forms (#1349),target-v1annotations, and context-header variants including the fail-fast on a conflicting key.Pruned per review. This is a parser-compat suite, not a device matrix, so the initial 52-entry dataset is down to 22: an entry must be the sole witness of a shipped syntactic form or of a distinct migration refusal. Platform twins and adjacent-release re-recordings that differ only in coordinates/labels are gone (all iOS-simulator/macOS/linux mirrors of Android flows, the iOS copies of
checkout-form/gesture-lab, and duplicatefling durationMswitnesses).noteis now a required field naming what each entry witnesses,README.mddocuments the selection rule, and the test caps the corpus at 30 so regrowth has to be deliberate.Gate cost: 51 tests, ~30ms in
unit-core.Link to Devin session: https://app.devin.ai/sessions/3340a872ac584fea82e03800f512c215
Requested by: @thymikee