Repository navigation
Commit 672e26f
authored
fix: retain sanitized drift evidence across retries (#510)
## Problem and behavior
The post-merge drift run
[37893558052](https://github.com/CopilotKit/aimock/actions/runs/37893558052)
retained only the final report. Successful/skipped assertions and
earlier retry failures were unavailable for diagnosing provider
outcomes.
This change writes a unique sanitized evidence sidecar for every
collector invocation, including failure paths, and uploads every sidecar
with the existing final report. It records assertion identities/statuses
plus strictly allowlisted provider metadata where the installed Vitest
reporter authenticates the originating test or suite. Missing,
ambiguous, malformed, wrong-context, and stderr markers cannot certify a
native provider outcome. Failed assertions retain precedence. Raw
provider bodies, arbitrary text, and secrets are excluded; identity
redaction runs before clipping.
The collector launches the candidate-installed Vitest directly and
receives context over a private in-memory reporter channel. Existing
grading, exit codes, provider contracts, schedule, permissions,
versions, and release behavior are unchanged. The Unreleased changelog
documents evidence retention.
## Real local RED/GREEN proof
All reproduction fixtures exercised the actual collector CLI, installed
Vitest subprocess, reporter channel, and finalized JSON sidecars
offline; these are metadata-consumer tests, not new native-provider
acceptance.
- Assertion retention: original collector with the final identical test
selection failed 5 cases (exit 1); corrected collector passed the same 5
(exit 0). Two real invocations produced distinct sidecars, preserving
pass/skip/failure identities and earlier attempts. Failure-finalization
and write-error controls also passed.
- Provider metadata: each adapter's real collector/Vitest fixture failed
before its projection and passed afterward, including native target,
native non-trigger, local/captured, wrong-context, unknown-field, and
failed-assertion controls where applicable.
- Vertex privacy mutation: the original assertion allowed a sidecar
containing the actual fixture canary (test exit 0). With only the
assertion corrected, the identical leak mutation failed at that
assertion (exit 1); the unmutated collector passed (exit 0).
- Stream-origin mutation: forcing the actual reporter to label stderr as
stdout initially survived 3 tests. The added valid native-context stderr
marker made that mutant fail (1 failed, 2 passed); the correct reporter
passed all 3. Independent boundary confirmation repeated the rejection
and restoration through actual Vitest.
- Upload selection: the original workflow path selected only the final
report; the corrected path selected that report and both actual
invocation sidecars. Independent offline execution of the pinned upload
consumer accepted the three-file set and preserved relative paths. This
does not claim hosted upload execution.
Representative terminal output from the actual proof runs:
```text
Retention original: Tests 5 failed | 292 skipped; exit 1
Retention corrected: Tests 5 passed | 292 skipped; exit 0
Vertex mutant, old assertion: Vitest exit 0; actual fixture canary leaked true
Vertex mutant, corrected assertion: Tests 1 failed | 315 skipped; exit 1
Vertex unmutated candidate: Tests 1 passed | 315 skipped; exit 0
Independent stream mutant: Tests 1 failed | 1 passed | 314 skipped
Independent restored reporter: Tests 1 passed | 315 skipped
Final combined corrected cases: Tests 2 passed | 314 skipped; exit 0
```
## Validation and limits
- Full affected collector/workflow integration: 341 tests passed, zero
skipped/unhandled/RPC errors. The final two test-only corrections passed
together; unchanged full-suite proof was reused rather than represented
as a fresh rerun.
- Formatting and lint passed for changed files. Explicit production,
test-tree, and scripts TypeScript checks passed. Full package build
passed.
- Structural workflow lint passed. Full actionlint retains the identical
pre-existing SC2086 informational diagnostic; no new workflow diagnostic
was introduced.
- Independent review covered all seven required roles and both runtime
boundaries; mandatory findings were corrected and confirmed. Two
inherited main-report grading defects remain separate backlog items;
this change retains their failed evidence but does not fix their
grading.
- Two signed commits preserve the exact reviewed tree. No version was
changed and no release or additional provider run was performed. CI is
still required after push before merge readiness can be claimed.6 files changed
Lines changed: 2348 additions & 30 deletions
File tree
- .github/workflows
- scripts
- src/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
395 | 397 | | |
396 | 398 | | |
397 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments