Skip to content

chore(memory): the assert-or-label rule, and the gate/cache split - #506

Merged
sandstream merged 1 commit into
mainfrom
chore/shared-mem-assert-and-cache
Aug 20, 2026
Merged

sandstream merged 1 commit into
mainfrom
chore/shared-mem-assert-and-cache

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Two appends to the curated shared tier (.kit/shared/memory.jsonl) from the tool-verification arc — 2ca60e (decision) and 15128e (convention), area cli.

Why these two

Both are the reasoning behind #500 / #501 / #503, and the diffs of those PRs record the mechanism rather than the argument.

2ca60e — report a fact ⇒ assert it, or label the output. kit makes three kinds of statement: a measurement (vercel 53.1.1), an assertion (matches what the repo declared), and a verdict (✓). Every defect in the arc was a verdict that referred to something other than the measurement, while the reader took them as the same thing:

surface measured what ✓ actually meant
latest pin the installed version the binary answered --version
cli-lock.json nothing — recorded a guessed installer a key with that name exists
identity which account the CLI is no verdict at all — the reader supplies one, and an agent always does

Two branches, both required: compare against a declaration when you can (git.email and gcloud.account already did; vercel.user did not, which was the gap), and label unknown / skip with the reason when you cannot. Unknown is not failure — unknown must be visible, and kit already has the vocabulary.

It generalises past versions: anything whose completeness depends on the caller's authority or on a lookup that may not have run — a scanner without a token, a registry offline, a listing filtered by a role, and a verdict whose oracle can only see one working tree (#470, the same defect one level up).

15128e — a gate never calls the network. This is the resolution of a genuine conflict between two of kit's own rules: no false green wants verification against the registry; the gate must stay fast and offline-safe wants no outbound call. A gate that calls out becomes slow, flaky, skipped, and false-green the moment a call fails and the code shrugs.

The design splits who fills the cache from who reads it: an explicit user-initiated command fills (kit tools list --latest), the gate reads only and prints not looked up yet — run … when it is cold. Two details carry the honesty: a failed lookup is not cached (a flaky network must not become a day-long policy), and air-gap gets a different reason string from cache-cold, because "we did not call" and "we have not looked yet" are different facts for the reader.

Written down because the next verification that wants to live in a gate should answer three questions instead of one — who fills, who reads, what do we say when it is cold — and because #503's deferred role lookups are supposed to reuse this rather than grow a second version of it.

Verification

  • kit memory verify → 36 entries, 36 trusted, 0 bad-sig, 0 untrusted, 0 unsigned
  • append-only: no existing entry edited or removed (diff is 2 insertions(+))
  • no customer names, paths, or session metadata — this repo is public

🤖 Generated with Claude Code

Two entries from the tool-verification arc (#500, #501, #503), both reasoning
that git records only as an outcome.

- decision: a command that reports a fact must assert it against a declaration,
  or label the output unknown/skip with the reason. The measured defect was a
  verdict that referred to something other than the measurement — a `latest` pin
  whose green meant "answered --version", a lock whose green meant "a key with
  that name exists", and an identity printed with no verdict at all, which makes
  the reader supply one. Generalises to anything whose completeness depends on
  the caller's authority or on a lookup that may not have run.

- convention: a gate never calls the network. It reads a cache; an explicit
  command fills it; a cold cache says so. This is the resolution of no-false-green
  versus the-gate-must-be-fast, and it is what #503's role lookups should reuse
  rather than build a second time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 9bd2586 into main Aug 20, 2026
19 checks passed
@sandstream
sandstream deleted the chore/shared-mem-assert-and-cache branch August 20, 2026 14:14
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