Repository navigation
fix(cipher): authenticated write-read round-trip probe; cipher-memory-smoke uses it - #3463
Conversation
…-smoke uses it
cipher_preflight proves the endpoint answers and accepts the bearer, and
cipher_identity proves which agent_id writes will carry, but nothing
stored a record and read it back. The only write->read check,
cipher-memory-smoke, could not pass under token enforcement: it sent no
Authorization header (401) and wrote as agentId "cipher-memory-smoke",
which no bearer resolves to (403 from assertAgentId).
New pmoves/tools/cipher_roundtrip_probe.py: POST /api/memory, GET
/api/memory/{id} (content must match), GET /api/memory/search scoped to
the agent (must return the record), DELETE (skip with --keep). Bearer is
read from cipher_preflight.layered_environ() by variable name, never
argv; agentId is what auth.ts accepts for that bearer
(cipher_identity.classify_token). Redirects are refused via the
preflight opener. Exit codes match cipher_preflight: 0 ok, 1 findings,
3 could not measure. --require-vector keeps the smoke's embedding_id /
score checks.
Revives the still-missing part of 7b0cf6d from #3078 (its one-shot
cipher_roundtrip_probe.py, generalised to main's preflight/identity
design).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 7 files / VERIFIED 122 / DRIFTED 9 / UNDECIDED 29 / digest 627ef9675679 Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
…ip probe The vector-path guard read the cipher-memory-smoke recipe text for embedding_id / "score" / agentId. The recipe now delegates to tools/cipher_roundtrip_probe.py --require-vector, so the "score" check moved into the probe and the guard went red (python-tests, the one new failure vs baseline). The guard now ignores @# comment lines (prose about a check is not the check -- the old recipe comments alone satisfied the embedding_id assertion), and when the recipe invokes the probe it requires --require-vector and asserts the checks in the probe source. Controls: main's Makefile passes, this branch passes, this branch with the flag stripped fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016aNs4pigYBVLWd7VqZNHsQ
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest b575a8d4429d Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f73648655c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cipher_preflight.layered_environ() lays env.shared over the process env
(cipher_preflight.py:275-289, env[key] = value for every file key), and
env.shared carries the node bootstrap CIPHER_API_TOKEN. Inside a launched
session that clobbered the per-agent token claude-pmoves.sh deliberately
re-binds AFTER loading env.shared ("CIPHER TOKEN BIND"), so the probe
tested writes as 'bootstrap' instead of the session identity.
_process_session_wins() mirrors the launcher's precedence: a non-empty
bearer already in the process wins, and the identity variables travel
with it; env.shared only fills a gap. Tests use fixture env files only.
Both new tests fail against the previous probe (checked in a throwaway
worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4pigYBVLWd7VqZNHsQ
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest 0e0245730567 Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest 4d273bf04d21 Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest f8e7d26d4d53 Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
Re-anchor after three register-row appends on main (#3439, #3463, #3444) left the PR BEHIND; ort auto-merges, no lane file touched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
Summary
Supersedes the cipher/fleet part of #3078 (
chore/cli-prereq-preflight, stale since Sep 21). #3078 is left open.cipher_preflightchecks that the endpoint answers and accepts the bearer.cipher_identitychecks which agent_id writes will carry. Neither one stores a record and reads it back. The only write-then-read check,make -C pmoves cipher-memory-smoke, could not pass under token enforcement for two reasons:Authorizationheader, so the server returned 401;cipher-memory-smoke, which no bearer resolves to, soassertAgentIdreturned 403.This PR adds
pmoves/tools/cipher_roundtrip_probe.py, which runs these steps:POST /api/memoryGET /api/memory/{id}: the content must match what was writtenGET /api/memory/search, scoped to the agent: the record must come backDELETE(skipped with--keep)How it authenticates:
cipher_preflight.layered_environ(), the same environment the session sees. It is looked up by variable name and never passed on argv.cipher_identity.classify_token). A bootstrap token writes asbootstrap. A minted token writes asPMOVES_RESOLVED_IDENTITY; if that is unset the probe exits 3 instead of guessing.Exit codes match the preflight: 0 = ok, 1 = findings, 3 = could not measure.
cipher-memory-smokenow runs the probe with--require-vector, so it keeps its embedding_id and score checks.Per source commit (from
chore/cli-prereq-preflight)7b0cf6d4eround-trip probe + authenticated smokecrush, a Z890 restore narrative andlocalhost. Replaced with a general probe built on main's preflight and identity design.7b0cf6d4epreflight Bearerpmoves/tools/cipher_preflight.py:353_resolve_headersreads the rosterheaders;layered_environis at:2307b0cf6d4eqdrant MSYS path fixpmoves/Makefile:4179,:42127b0cf6d4eCIPHER_BIND"${CIPHER_BIND:-127.0.0.1}:..."(docker-compose.yml:4249,docker-compose.agents.yml:977); documented in.claude/context/cipher.md:36. The env-example line belongs to the env-pipeline lane and was not ported.7b0cf6d4eSKILL.md rewritecipher_identity. Better done as a separate docs PR.fd087cf31cipher-api Supabase key + Neo4jdocker-compose.agents.yml:942(CIPHER_DB_SERVICE_KEYlineage),:965-968NEO4J_URI/USER/PASSWORD; same indocker-compose.ymlcipher-api blockfd087cf31Pmoves-cipher gitlink6a0eeba2dagent-zero cipher MCP authdocker-compose.yml:3725/docker-compose.agents.yml:142sendAuthorization: Bearer ${CIPHER_API_TOKEN}over streamable-http. The source'sCIPHER_AGENTZERO_TOKENvariable does not exist anywhere on main.542270669TS_4090pmoves/scripts/tailscale-node-ips.sh:57(pmoves-4090),deploy/provision/claude-pmoves.ps1:530542270669mcp.json cipher-local note.claude/mcp.jsonis generated frompmoves/config/mcp_inventory.json. Main's model is thatCIPHER_BINDis a per-node operator decision (CLAUDE.md, PATTERNS.md:248). The source's "Z890 publishes since 2026-09-09" depends on the node and is not a roster fact.0ada1e52cSPARK identityclaude_spark/spark-claude(pmoves/configs/node-vocabulary.yaml:74-77,agent_registry.yaml:238, signing card ...0014).spark-kimicovers Crush on SPARK (identity_vocabulary.yaml:256). Minting a newcrush_sparkcard and glyph is Archon's lane.0ada1e52c.vscode git watcher"git.autofetch": truefrom #1540 (.vscode/settings.json:67).3d1421e10,849b764d7,36a9b89d6gitlink bumpsNo protected files were touched, and no road is needed.
Test evidence
uv run --with pytest --with pyyaml python -m pytest pmoves/tests/tools/test_cipher_roundtrip_probe.py pmoves/tests/tools/test_cipher_preflight.py pmoves/tests/tools/test_cipher_identity.py -q: 114 passed.The new tests run against an in-process fake cipher that enforces auth.ts/memory-routes rules (401 without a bearer, 403 on an agent mismatch). A guard makes any real-network access fail the test. They never read the real env.shared.
Mutation checks: each behaviour was reverted on its own, and the suite failed every time:
The files were restored byte-identical afterwards (checked with
cmp).python pmoves/tools/windows_encoding_ratchet.py: exit 0.Not run against the live cipher service, by design.
🤖 Generated with Claude Code