done-done-axi 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -446,6 +446,9 @@ function closeRun(repo, cfg, rec, log) {
446
446
  return { code: reason ? FAIL : PASS, result, reason };
447
447
  }
448
448
  async function cmdRun(argv) {
449
+ const literal = argv.find((a) => /\$\{?DONE_DONE_EVIDENCE_ROOT\b/.test(a));
450
+ if (literal)
451
+ throw new UsageError(`the argument ${JSON.stringify(literal)} holds the literal text $DONE_DONE_EVIDENCE_ROOT: the shell did not expand it (single quotes?), so it would name a folder with that name. Use the env var inside the script, or double quotes`);
449
452
  const dash = argv.indexOf('--');
450
453
  const { values, positionals } = parseArgs({
451
454
  args: dash < 0 ? argv : argv.slice(0, dash),
@@ -741,12 +744,14 @@ async function runCheck(argv, run) {
741
744
  findings.push({ level: 'inconclusive', why: `${name}: not in any done-done run record, so it is not tied to a commit` });
742
745
  continue;
743
746
  }
744
- // Records from before runs had their own folders can both claim one file; never guess which run wrote it.
745
- if (claims.length > 1) {
747
+ // Identical bytes (a deterministic capture) are claimed by every run that wrote them; a run at the current commit is enough.
748
+ // With none, records from before runs had their own folders can both claim one file; never guess which run wrote it.
749
+ const atNow = claims.filter((r) => r.commit === now.commit);
750
+ if (!atNow.length && claims.length > 1) {
746
751
  findings.push({ level: 'inconclusive', why: `${name}: claimed by more than one run (${claims.map((r) => r.run_id).join(', ')}), so it is not tied to one commit` });
747
752
  continue;
748
753
  }
749
- const rec = claims[0];
754
+ const rec = (atNow.length ? atNow : claims).reduce((a, b) => (b.started_at > a.started_at ? b : a));
750
755
  // Only a capture tied to a run record can reach the judge, so a stray cited file is never sent.
751
756
  const c = { name, bytes, sha256: hash, media: v };
752
757
  if (v.status === 'ok' && !record && pair)
package/docs/reference.md CHANGED
@@ -286,7 +286,7 @@ evidence: <paths of the evidence files, or "not proven: <cause>">
286
286
 
287
287
  A plain check is never a verdict on its own. A cited file that fails one of these checks, or a Checks block that breaks a form rule, stops the check before its judge is asked: it exits 2 with every cause in `error` and the next command in `help`, and gives no result. A check with no cited capture the judge reads (only video or other files, or none from a done-done run) stops the same way, before the judge is asked.
288
288
 
289
- Files that are in no run record give an inconclusive result when another cited capture is one the judge reads: nothing ties them to a commit. So does a file that more than one run record claims (possible only with records from before each run had its own folder). A file whose path is named in a run record but whose bytes no longer match fails as `changed after run <run-id>` (exit 2, before the judge), not inconclusive: the path ties it to that run, so editing it after the run is tampering, not untied evidence.
289
+ Files that are in no run record give an inconclusive result when another cited capture is one the judge reads: nothing ties them to a commit. So does a file that more than one run record claims when none of those runs is at the current commit (possible only with records from before each run had its own folder). Byte-identical captures from several runs are fine when one of those runs is at the current commit: that run ties the file to the commit. A file whose path is named in a run record but whose bytes no longer match fails as `changed after run <run-id>` (exit 2, before the judge), not inconclusive: the path ties it to that run, so editing it after the run is tampering, not untied evidence.
290
290
 
291
291
  `evidence: not proven: <cause>` stops the check before its judge is asked, always: exit 2, no result, no receipt. `checks.not_proven` is gone: a config that still sets it is a config error (exit 2) that says to delete the line.
292
292
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "done-done-axi",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Proof that the real product works before a task is called done: commit-bound evidence runs and evidence checks.",
6
6
  "type": "module",