Skip to content

fix: distinguish invalid snapshot ages from stale evidence - #418

Merged
StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-343-snapshot-age-input
Oct 16, 2026
Merged

StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-343-snapshot-age-input

Conversation

@StepenkoAnatoli

@StepenkoAnatoli StepenkoAnatoli commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Invalid snapshot-age values now produce a usage error (exit 2) in researcher-release validate, and INPUT-SNAPSHOT-MAX-AGE / INCOMPLETE from the release and snapshot library boundaries. SNAPSHOT-STALE remains reserved for a real snapshot older than a valid finite, non-negative allowance, including a zero allowance.

Fixes #343.

what changed

Researcher-release validates snapshot-max-age-ms before resolving or reading evidence. The release and snapshot facades classify a non-finite, negative or nonnumeric allowance as INPUT-SNAPSHOT-MAX-AGE / INCOMPLETE. Added CLI and facade regressions and updated the architecture map, changelog and inventory.

why

Fixes #343. NaN or a negative allowance was reported as stale snapshot evidence; a valid package could instead pass if it had no snapshot to judge. Input errors now remain input errors, while a finite non-negative allowance retains real freshness checks.

what it touched

research-kit/bin/researcher-release.mjs, research-kit/lib/release-validator.mjs, research-kit/test/release-validator.test.mjs, docs/ARCHITECTURE.md, CHANGELOG.md and research-kit/README.md. The error uses the existing input-error reduction, with no new flag, schema or publication behavior.

what you verified

verified: the added regressions were red on the base (14 passed, 2 failed) and the focused release-validator group passed after the fix (16 passed, 0 failed). verified: the normal git commit gate ran the full staged offline suite and allowed commit a3bbfd8. The local gate permits unavailable capabilities under ADR-0108 and discards their detailed totals. verified: all seven required CI jobs passed for head a3bbfd8aa418bfb5f77cfc200e11c06b595d1bd9 in offline-suite run #777. The completed Node 24 log reports 1,847 passed, 0 failed in 199.3s.

what you got wrong and fixed

mistake: the initial facade fixture omitted its artifact record. where: release-validator.test.mjs's invalid-age regression. impact: it could not prove the package passes with a valid allowance; no delivered behavior affected. cause: setup wrote only registry and roles. fix: write the valid envelope and assert baseline PASS. verified: initial focused group passed 16 tests; verified: the full normal commit gate passed with the strengthened baseline PASS assertion.

what changed
Researcher-release validates snapshot-max-age-ms before resolving or reading evidence. The release and snapshot facades classify a non-finite, negative or nonnumeric allowance as INPUT-SNAPSHOT-MAX-AGE / INCOMPLETE. Added CLI and facade regressions and updated the architecture map, changelog and inventory.

why
Fixes #343. NaN or a negative allowance was reported as stale snapshot evidence; a valid package could instead pass if it had no snapshot to judge. Input errors now remain input errors, while a finite non-negative allowance retains real freshness checks.

what it touched
research-kit/bin/researcher-release.mjs, research-kit/lib/release-validator.mjs, research-kit/test/release-validator.test.mjs, docs/ARCHITECTURE.md, CHANGELOG.md and research-kit/README.md. The error uses the existing input-error reduction, with no new flag, schema or publication behavior.

what you verified
verified: the added regressions were red on the base (14 passed, 2 failed) and the focused release-validator group passed after the fix (16 passed, 0 failed). expected: the strengthened valid-package fixture and full offline suite will run through the normal commit gate; final results accompany the PR.

what you got wrong and fixed
mistake: the initial facade fixture named an artifact in its registry but did not write that record.
where: research-kit/test/release-validator.test.mjs, invalid snapshot-age facade regression.
impact: the initial fixture could not prove that the same package passes with a valid allowance; no shipped validator behavior was affected.
cause: fixture setup wrote the registry and role roster but omitted the artifact file.
fix: wrote the valid envelope and added a baseline PASS assertion before exercising invalid allowances.
verified: the initial focused group passed 16 tests; expected: the normal commit gate covers the strengthened final fixture and full suite.
@StepenkoAnatoli
StepenkoAnatoli merged commit a332996 into main Oct 16, 2026
7 checks passed
@StepenkoAnatoli
StepenkoAnatoli deleted the fix/issue-343-snapshot-age-input branch October 17, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--snapshot-max-age-ms with a non-numeric value fails the package as SNAPSHOT-STALE 'older than the allowed NaNms'

1 participant