Startup: each verb opens only the secret files that it uses #33

Closed
opened 2026-11-13 10:42:34 +00:00 by svc-agent-writer · 2 comments

Parent: #6. Records: ADR 0006 (docs/adr/0006-retention-deletion-and-forget.md) for the tombstone salt, SECURITY.md, and the table "Which verb opens which secret file" in README.md.

What to build

After #31, the api does not open the Feeder token file. Two more reads have no use:

  • sync opens auth.read_token_file and auth.evidence_token_file when the config holds [auth]. It never uses a token.
  • api opens store.tombstone_salt_file. It never uses the salt.

Give every secret file a closed set of verbs that open it, in the same form as FEEDER_TOKEN_VERBS. A verb outside the set never opens the file. check keeps every file, because its job is to validate them.

The write-token refusal does not change. Every verb still lists the directory of every secret file that the config names.

Acceptance criteria

  • A test proves that sync does not open an auth token file. The config holds [auth], the files are absent, and sync --once still starts.
  • A test proves that api does not open the tombstone salt file.
  • A test proves that check still refuses each secret file that is absent, too short or open to another user, with a code and a location.
  • The README table is built from the code constants, and a test compares the two.
  • SECURITY.md states the rule in one sentence.

Blocked by

Filed under: operator word "Go" sha256:6cc8519b9158

Parent: #6. Records: ADR 0006 (`docs/adr/0006-retention-deletion-and-forget.md`) for the tombstone salt, `SECURITY.md`, and the table "Which verb opens which secret file" in `README.md`. ## What to build After #31, the api does not open the Feeder token file. Two more reads have no use: - `sync` opens `auth.read_token_file` and `auth.evidence_token_file` when the config holds `[auth]`. It never uses a token. - `api` opens `store.tombstone_salt_file`. It never uses the salt. Give every secret file a closed set of verbs that open it, in the same form as `FEEDER_TOKEN_VERBS`. A verb outside the set never opens the file. `check` keeps every file, because its job is to validate them. The write-token refusal does not change. Every verb still lists the directory of every secret file that the config names. ## Acceptance criteria - A test proves that `sync` does not open an auth token file. The config holds `[auth]`, the files are absent, and `sync --once` still starts. - A test proves that `api` does not open the tombstone salt file. - A test proves that `check` still refuses each secret file that is absent, too short or open to another user, with a code and a location. - The README table is built from the code constants, and a test compares the two. - `SECURITY.md` states the rule in one sentence. ## Blocked by - #31 Filed under: operator word "Go" sha256:6cc8519b9158
Collaborator

⏸ SVD architect gate: dev/messages-mind-mcp#33 startup-each-verb-opens-only-the-secret-files-that-it-uses

Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity standard · dispatch effort medium

Run: 20261113T120736Z-6f02d4f2

Held because: CLEAN but 2 open risk(s) (2 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. Is a comparison test enough to meet 'the README table is built from the code constants', or must a generator (script or make target) write the table? The spec leans to the test alone, because the issue adds 'and a test compares the two'. A generator would add a file and change the Makefile, which is outside the written set. [decision]
  2. The sync._run guard for secrets.salt is None reuses the CLI secret-error line (secret=error code=secret-missing at=store.tombstone_salt_file, exit 2) on a path the CLI cannot reach; it exists to narrow the type for mypy strict. Is this acceptable, or should Secrets keep salt: bytes and the api get a separate Secrets type (a wider change)? [decision]

Change: Mirror FEEDER_TOKEN_VERBS (startup.py:15) and its gated read (startup.py:73-77). Add these Final[frozenset[Verb]] sets: KEY_FILE_VERBS (all verbs), TOMBSTONE_SALT_VERBS {check, sync}, AUTH_TOKEN_VERBS {check, api}. Add VERBS and a SECRET_FILE_VERBS mapping keyed by config location. Gate the salt read (line 60) and the auth block (line 62) on verb in <set>. Widen Secrets.salt to bytes | None and keep repr=False. Leave refuse_write_token_files unchanged. In sync._run (sync.py:248), add a mypy-narrowing guard: secret=error code=secret-missing at=store.tombstone_salt_file, exit 2. Rebuild the README table from SECRET_FILE_VERBS and replace the doc test at test_config_cli.py:651-657 with a full-table render comparison. Add a one-sentence rule to SECURITY.md. Write new tests that mirror the os.open spy test at test_config_cli.py:539-571 and the sync --once fake at :665-680.

Files: src/messages_mind_mcp/startup.py · src/messages_mind_mcp/sync.py · tests/test_config_cli.py · README.md · SECURITY.md

Decision: accept the 2 open risk(s) above and dispatch this spec (svd:go), or park (svd:skip) / re-spec (svd:respec)?

Your call (when this issue is held at the gate via svd:hold):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-startup-each-verb-opens-only-the-secret-files-that-it-uses.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-startup-each-verb-opens-only-the-secret-files-that-it-uses.md

### ⏸ SVD architect gate: dev/messages-mind-mcp#33 startup-each-verb-opens-only-the-secret-files-that-it-uses **Status:** CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity `standard` · dispatch effort `medium` **Run:** `20261113T120736Z-6f02d4f2` **Held because:** CLEAN but 2 open risk(s) (2 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Is a comparison test enough to meet 'the README table is built from the code constants', or must a generator (script or make target) write the table? The spec leans to the test alone, because the issue adds 'and a test compares the two'. A generator would add a file and change the Makefile, which is outside the written set. [decision] 2. The sync._run guard for `secrets.salt is None` reuses the CLI secret-error line (`secret=error code=secret-missing at=store.tombstone_salt_file`, exit 2) on a path the CLI cannot reach; it exists to narrow the type for mypy strict. Is this acceptable, or should Secrets keep salt: bytes and the api get a separate Secrets type (a wider change)? [decision] **Change:** Mirror FEEDER_TOKEN_VERBS (startup.py:15) and its gated read (startup.py:73-77). Add these Final[frozenset[Verb]] sets: KEY_FILE_VERBS (all verbs), TOMBSTONE_SALT_VERBS {check, sync}, AUTH_TOKEN_VERBS {check, api}. Add VERBS and a SECRET_FILE_VERBS mapping keyed by config location. Gate the salt read (line 60) and the auth block (line 62) on `verb in <set>`. Widen Secrets.salt to `bytes | None` and keep repr=False. Leave refuse_write_token_files unchanged. In sync._run (sync.py:248), add a mypy-narrowing guard: `secret=error code=secret-missing at=store.tombstone_salt_file`, exit 2. Rebuild the README table from SECRET_FILE_VERBS and replace the doc test at test_config_cli.py:651-657 with a full-table render comparison. Add a one-sentence rule to SECURITY.md. Write new tests that mirror the os.open spy test at test_config_cli.py:539-571 and the sync --once fake at :665-680. **Files:** `src/messages_mind_mcp/startup.py` · `src/messages_mind_mcp/sync.py` · `tests/test_config_cli.py` · `README.md` · `SECURITY.md` **Decision:** accept the 2 open risk(s) above and dispatch this spec (`svd:go`), or park (`svd:skip`) / re-spec (`svd:respec`)? **Your call** (when this issue is held at the gate via `svd:hold`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-startup-each-verb-opens-only-the-secret-files-that-it-uses.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-startup-each-verb-opens-only-the-secret-files-that-it-uses.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/messages-mind-mcp#33 startup-each-verb-opens-only-the-secret-files-that-it-uses completed integration verify.

  • PR: #41
  • Branch: feat/svd-dev-messages-mind-mcp-33-startup-each-verb-opens-onl-7d15c115
  • Commit: 269ae7734e
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/75/pipeline/18/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: Remote CI ci/woodpecker/pr/validation was still pending when this verdict was taken; the runner re-polls it.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261113T124005Z-7d15c115 --confirm-merge)
spec-verify-dispatch Half B for dev/messages-mind-mcp#33 startup-each-verb-opens-only-the-secret-files-that-it-uses completed integration verify. - PR: https://git.groupthink.asia/dev/messages-mind-mcp/pulls/41 - Branch: feat/svd-dev-messages-mind-mcp-33-startup-each-verb-opens-onl-7d15c115 - Commit: 269ae7734e8de8a7bde9f201d94798618c2569e7 - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/75/pipeline/18/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: Remote CI ci/woodpecker/pr/validation was still pending when this verdict was taken; the runner re-polls it. - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261113T124005Z-7d15c115 --confirm-merge`)
svc-svd-writer 2026-11-13 12:50:03 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
dev/messages-mind-mcp#33
No description provided.