feat/provenance-node-floor #84

Merged
clawdie merged 7 commits from feat/provenance-node-floor into main 2026-11-20 00:49:49 +01:00
Owner
No description provided.
`check-okf.sh` enumerated markdown with a bare `find`, so it also walked
gitignored working trees (`tmp/`, caches, other agents' report checkouts).
On this checkout that produced 131 failures across 258 scratch documents and
zero failures in tracked content, which made the gate unusable exactly where
it matters: as a pre-build check on the FreeBSD build host.

Resolve the file list from git instead — tracked markdown plus
untracked-but-not-ignored markdown — and keep the plain `find` only for
non-git checkouts. A brand-new, uncommitted doc is still checked; ignored
scratch is not part of the repository surface.

Before: PASS 192 / FAIL 131 (all under tmp/).
After:  PASS 65 / FAIL 0.

Sam & Pi <hello@clawdie.si>
Upstream moved in zot, herdr and pi-subagents while the 0.15.1 line was
being finished, and the manifest could not say what a rebuild actually
picked up:

- `pi_version` was recorded, `pi-subagents` was not, even though both float
  on `@latest` in packages/npm-globals.txt.
- `node_version` was unrecorded, so a Pi install onto a Node without
  `module.enableCompileCache` fails only when someone runs `pi`. That is the
  failure mode observed on debby with Node 20.19.2 (pi --version aborts;
  Node 24 returns 1.5.2).
- `zot_commit` comes from the staged source checkout, while the binary that
  runs in the image is owned by the `zot-agent` package, which can lag the
  pin. The divergence was invisible.

Changes:

- build.sh records `pi_subagents_version` (derived from the bundled tarball,
  like `pi_version`), `node_version` and `zot_pkg_version` (queried from the
  assembled image via pkg-static, the same pattern already used for
  `pkg check -s zot-agent`). `zot_pkg_version` is null unless
  ZOT_FROM_PKG=YES, since a host-built binary has no package to query.
- scripts/check-pi-node-floor.sh compares Pi's own `engines.node` floor from
  its package.json against the image's node24 version. Contract: 0 satisfies,
  1 below floor (build fails), 2 cannot determine (loud warning, never a
  silent pass). No Node version is hard-coded in the build.
- docs/RELEASE-BUILD-RUNBOOK.md documents the four fields, why two float, and
  why a package version that predates `zot_commit` means the pin is not what
  shipped.

Tests: tests/check-pi-node-floor-test.sh (17 checks: floors, ranges,
`*`, port suffixes, unparsable input, invalid JSON, build wiring),
tests/build-manifest-provenance-test.sh (17 checks: emitter keys appear once,
each has a derivation, runbook documents them). Both wired into
scripts/ci-checks.sh; full ./scripts/ci-checks.sh passes.

Sam & Pi <hello@clawdie.si>
Option 2 scope revision on feat/provenance-node-floor after Zot review:
- Remove scripts/check-pi-node-floor.sh and tests/check-pi-node-floor-test.sh
  from build.sh and scripts/ci-checks.sh so no build gate claims Node semver
  compatibility it cannot prove.
- Derive pi_version and pi_subagents_version in write_build_manifest() from
  installed package.json inside ${MOUNT_POINT} via read_installed_npm_pkg_version,
  falling back to "unknown" on missing, symlinked, malformed, name-mismatched,
  or unsafe-character metadata instead of reading the first cached .tgz filename.
- Keep existing node_version, zot_pkg_version, zot_bin_sha256, and check-okf.sh
  behavior intact; update docs/RELEASE-BUILD-RUNBOOK.md and add behavioral
  unit tests in tests/build-manifest-provenance-test.sh.
Tighten provenance docs, tests, and OKF git scan locally:
- docs/RELEASE-BUILD-RUNBOOK.md & build.sh: fix 3-vs-4 field count, correct
  zot_commit (rev-parse --short=12) vs zot_version (git describe), distinguish
  source checkout availability from shipped binary (zot_pkg_version /
  zot_bin_sha256), require investigating unexpected unknown/null fields, do not
  infer ancestry from label ordering alone, and separate pkg-DB node24 version
  from actual executed runtime / startup smoke test (pi --version).
- tests/build-manifest-provenance-test.sh: extract full write_build_manifest()
  across nested functions and heredocs, scope all checks to write_build_manifest(),
  add positive pi-subagents reader test, and add behavioral JSON emission tests
  with stale .tgz decoys and staged zot binary SHA-256 verification.
- scripts/check-okf.sh & tests/check-okf-scan-test.sh: use git ls-files -z with
  tr '\000' '\n' and [ -f ] existence filtering so Unicode, quotes, backslashes,
  and tabs are not C-quoted and deleted tracked files are skipped; wire targeted
  temp-git regression test into scripts/ci-checks.sh.
Address ZOT-FOLLOWUP-416273f locally:
- scripts/check-okf.sh: buffer git ls-files -z output and fail closed with a
  generic error (no raw filename printed) if any markdown filename contains an
  embedded newline before converting NUL delimiters to newlines.
- tests/check-okf-scan-test.sh: pass --strict on all check-okf.sh invocations
  and add a negative fixture test verifying fail-closed exit and non-leakage
  of an embedded-newline filename.
docs(runbook): replace 'smoke test' wording with 'startup verification'
All checks were successful
format-check / gates (pull_request) Successful in 2m27s
3871e3eede
Align docs/RELEASE-BUILD-RUNBOOK.md with commit 378c873 (SMOKE->VERIFY rename
and jargon sweep), replacing the 'startup smoke test' phrasing introduced in
416273f with 'basic startup verification' / 'startup check'.
clawdie deleted branch feat/provenance-node-floor 2026-11-20 00:49:49 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/clawdie-iso!84
No description provided.