Skip to content

Publish a signed line index, and ask it what is newer - #233

Merged
avrabe merged 1 commit into
mainfrom
feat/line-index-gate
Oct 1, 2026
Merged

avrabe merged 1 commit into
mainfrom
feat/line-index-gate

Conversation

@avrabe

@avrabe avrabe commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

The check that could not fire

REQ-INDEXAUTH-001 has been verified, implemented and tested since
2026-09-06, and its own no-publisher-2026-09-06 field says what was
missing:

A fetch path with no publisher is a check that cannot fire.

No realm has ever published a line index. Re-measured today:
ghcr.io/pulseengine/layers serves 21 layer tags and zero line-index-*.
So every consumer-side guarantee resting on the index — omission detection,
rollback reporting, varve outdated — was reasoning about a document nobody
had written.

This publishes one, and is the first exercise of that publisher anywhere.

What the gate does

tools/systest/line-index.sh:

  1. deposits two layers and pushes both into a pinned zot with oras, through
    the recipe varve docs attach-index documents;
  2. signs an index naming both and pushes it under line-index-2026.10;
  3. pins a project on the older layer;
  4. asks varve outdated what is newer.
{
  "answerable": true,
  "pinned": "2026.10.0",
  "newer": [{"layer": "2026.10.1", "digest": "sha256:44710f9b…", "channel": "rolling"}],
  "index_counter": 1,
  "realm": "systest"
}

The pin file and store directory are checked afterwards to be untouched —
those are what a bad answer would have changed (clause 4).

Four controls, because every failure here is quiet

control must
no index, realm does not declare one answer "cannot answer", never "nothing newer"
realm declared an index and has none refuse, naming the realm (clause 5/6 — failing open lets an attacker delete the index)
index signed by a key that is not the realm root refuse — else the document is decoration
index names a layer the registry will not serve refuse by name — the hiding clause 3 exists for

The gate itself was negative-controlled: newer_than stubbed to return nothing
turned it red on the positive assertion, with the mutation confirmed present in
the rebuilt binary before the verdict was read.

Two things the gate corrected about itself

Both would have made it pass for the wrong reason.

  • The first control ran against a realm declaring signed-index = true, where
    a missing index is correctly an error rather than "cannot answer". The
    two declarations are now both exercised rather than conflated — the declaring
    case became a control of its own.
  • The realm's trust root was computed here as a sha256 of the public-half file,
    which is a different number from the one keygen prints. A realm pinned
    to the wrong root would have made the impostor control meaningless. The
    fingerprint is now read from keygen's own output.

Two extractions into lib.sh

A second gate needed them, and a second copy is a second thing to keep in step:

  • the pinned zot/oras download-and-checksum block, whose pins are precisely
    the part that must not drift;
  • systest_push_layout — one copy of the push recipe varve docs deploy
    documents, now driven twice by this gate and once by oci-roundtrip.sh.

Traceability

REQ-LAYERDIFF-001 reaches verified, which makes every artifact in
v0.40.0's scope verified
: REQ-LIBCSTATED-001, VER-LIBCSTATED-001,
REQ-LAYERDIFF-001, VER-LAYERDIFF-001.

Local gates: fmt, clippy -D warnings, rivet validate PASS, trace-gate OK,
cargo test --workspace exit 0 — 35 suites, 0 failures. The new gate passes
end to end locally against a real registry.

Still not true of production

No real realm publishes an index. This proves the publish recipe and the
consumer path work together; it does not make varve outdated useful against
the live registry. That remains pulseengine-layers#6 — whose own blocker merged
2026-09-07 — and it is now de-risked, because the recipe has been executed
rather than only written down.

🤖 Generated with Claude Code

https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu

REQ-INDEXAUTH-001 has been verified, implemented and tested since 2026-09-06,
and its own `no-publisher-2026-09-06` field says what was missing: "a fetch
path with no publisher is a check that cannot fire." No realm has ever
published a line index — re-measured 2026-10-01, ghcr.io/pulseengine/layers
serves 21 layer tags and zero `line-index-*`. So every consumer-side guarantee
resting on the index was reasoning about a document nobody had written, and
`varve outdated` could only ever answer "cannot answer".

This publishes one. `tools/systest/line-index.sh` deposits two layers, pushes
both into a pinned zot with oras through the recipe `varve docs attach-index`
documents, signs an index naming both, pins a project on the OLDER, and asks
`varve outdated` what is newer. It reports 2026.10.1 over the pinned
2026.10.0, carrying the digest the index signed — and the pin file and store
directory are checked AFTERWARDS to be untouched, because those are what a bad
answer would have changed (clause 4).

FOUR CONTROLS, because every failure here is quiet:

  * no index, against a realm that does not declare one -> "cannot answer",
    never "nothing newer". Collapsing those two is the one failure a consumer
    cannot detect, and it is why a tag listing is refused outright.
  * a realm that DECLARED an index and has none -> refused BY NAME. Failing
    open would let an attacker simply delete the index (clause 5/6).
  * an index signed by a key that is not the realm root -> refused. Without
    this the document is decoration.
  * an index naming a layer the registry will not serve -> refused BY NAME.
    That is the hiding clause 3 exists for.

The gate was negative-controlled: `newer_than` stubbed to return nothing turned
it red on the positive assertion, with the mutation confirmed present in the
rebuilt binary before the verdict was read.

TWO THINGS THE GATE CORRECTED ABOUT ITSELF, both of which would have made it
pass for the wrong reason. The first control ran against a realm declaring
`signed-index = true`, where a missing index is correctly an ERROR rather than
"cannot answer" — the two declarations are now both exercised instead of
conflated, and the declaring case is a fifth check rather than a confusion. And
the realm's trust root was computed here as a sha256 of the public-half file,
which is a DIFFERENT number from the one `keygen` prints; a realm pinned to the
wrong root would have made the impostor control pass for the wrong reason. The
fingerprint is now read from keygen's own output.

TWO EXTRACTIONS INTO lib.sh, because a second gate needed them and a second
copy is a second thing to keep in step:

  * the pinned zot/oras download-and-checksum block, whose pins are precisely
    the part that must not drift;
  * `systest_push_layout`, the push recipe itself — ONE copy of the jq that
    `varve docs deploy` documents, now driven twice by this gate and once by
    oci-roundtrip.sh.

WHAT IS STILL NOT TRUE OF PRODUCTION: no real realm publishes an index. This
proves the publish recipe and the consumer path work together; it does not make
`varve outdated` useful against the live registry. That remains
pulseengine-layers#6, whose own blocker merged 2026-09-07 — and it is now
de-risked, because the recipe has been executed rather than only written down.

REQ-LAYERDIFF-001 reaches `verified`, which makes every artifact in v0.40.0's
scope verified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
@avrabe
avrabe enabled auto-merge (squash) October 1, 2026 19:28
@avrabe
avrabe merged commit 79ff3ee into main Oct 1, 2026
32 checks passed
@avrabe
avrabe deleted the feat/line-index-gate branch October 1, 2026 20:59
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.

1 participant