Secret errors name the config key of the file that failed #92

Closed
opened 2026-11-05 00:47:09 +00:00 by svc-svd-writer · 2 comments
Collaborator

Problem

When peoplemind check, sync or api cannot read a store or auth secret file, it prints secret=error code=<code> and exits 2. The line does not name the file. Source secrets already print source=<name> first, so only the store salt and the auth tokens give no location.

Seen live on rc.11 (2026-11-05). peoplemind check in the api container printed secret=error code=secret-unreadable. The failed file was the tombstone salt, which the prepare init container gives only to sync (README, Kubernetes section). The cause could be found only by reading cli.py.

Change

Add the config key of the failed file to the line, in the same at= form that config=error already uses (cli.py:98):

  • secret=error code=<code> at=store.tombstone_salt_file, from the salt read at cli.py:114.
  • secret=error code=<code> at=auth.read_token_file or at=auth.write_token_file, from Tokens.load at cli.py:105. The caller must know which of the two failed, so Tokens.load (auth.py) needs to report the key with the error, for example through ConfigError.locations.
  • The source=<name> secret=error code=<code> lines stay as they are.

The line gives the config key only. It never prints the file path or any part of the file.

In the README Kubernetes section, add one sentence: run peoplemind check in the sync container, because check reads the tombstone salt.

Acceptance criteria

  • tests/test_config_cli.py::test_check_bad_salt_file_exits_2 expects secret=error code=<code> at=store.tombstone_salt_file\n for both cases.
  • tests/test_config_cli.py::test_api_bad_token_exits_2 expects secret=error code=secret-unreadable at=auth.read_token_file\n.
  • A new test with a valid read token and a missing write token expects at=auth.write_token_file.
  • No output line holds a secret path or secret bytes.
  • make check passes.

Out of scope

  • The split of secrets between the api and sync containers. It is by design (README; ADR 0001).
  • The source= lines, the error codes, and the exit codes.

Context

  • Found during the #90 post-deploy check on rc.11 (#90 comment 33092).
  • Primary files: src/people_mind_mcp/cli.py, src/people_mind_mcp/auth.py, tests/test_config_cli.py, README.md.
  • An enhancement after 0.1.0. It is not a #10 gate item.

Filed under: operator word "file it" sha256:f61c822d8f15

## Problem When `peoplemind check`, `sync` or `api` cannot read a store or auth secret file, it prints `secret=error code=<code>` and exits 2. The line does not name the file. Source secrets already print `source=<name>` first, so only the store salt and the auth tokens give no location. Seen live on rc.11 (2026-11-05). `peoplemind check` in the `api` container printed `secret=error code=secret-unreadable`. The failed file was the tombstone salt, which the `prepare` init container gives only to `sync` (README, Kubernetes section). The cause could be found only by reading `cli.py`. ## Change Add the config key of the failed file to the line, in the same `at=` form that `config=error` already uses (`cli.py:98`): - `secret=error code=<code> at=store.tombstone_salt_file`, from the salt read at `cli.py:114`. - `secret=error code=<code> at=auth.read_token_file` or `at=auth.write_token_file`, from `Tokens.load` at `cli.py:105`. The caller must know which of the two failed, so `Tokens.load` (`auth.py`) needs to report the key with the error, for example through `ConfigError.locations`. - The `source=<name> secret=error code=<code>` lines stay as they are. The line gives the config key only. It never prints the file path or any part of the file. In the README Kubernetes section, add one sentence: run `peoplemind check` in the `sync` container, because `check` reads the tombstone salt. ## Acceptance criteria - `tests/test_config_cli.py::test_check_bad_salt_file_exits_2` expects `secret=error code=<code> at=store.tombstone_salt_file\n` for both cases. - `tests/test_config_cli.py::test_api_bad_token_exits_2` expects `secret=error code=secret-unreadable at=auth.read_token_file\n`. - A new test with a valid read token and a missing write token expects `at=auth.write_token_file`. - No output line holds a secret path or secret bytes. - `make check` passes. ## Out of scope - The split of secrets between the `api` and `sync` containers. It is by design (README; ADR 0001). - The `source=` lines, the error codes, and the exit codes. ## Context - Found during the #90 post-deploy check on rc.11 (#90 comment 33092). - Primary files: `src/people_mind_mcp/cli.py`, `src/people_mind_mcp/auth.py`, `tests/test_config_cli.py`, `README.md`. - An enhancement after 0.1.0. It is not a #10 gate item. Filed under: operator word "file it" sha256:f61c822d8f15
Author
Collaborator

⏸ SVD architect gate: dev/people-mind-mcp#92 secret-errors-name-the-config-key-of-the-file-that-failed

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: 20261105T040526Z-984bdd36

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

Open risks:

  1. tokens-equal (auth.py:49) fails because the read and write tokens are equal, not because one file could not be read, and the issue names only the per-file keys. Should the line print (a) at=auth.read_token_file,auth.write_token_file (the lean), (b) at=auth.write_token_file, or (c) no at=? Choosing (b) or (c) changes only that one raise and the expected output of test_api_equal_tokens_names_both_keys. [decision]
  2. No baseline was measured at spec time because the sandbox denied the repo .venv. Dispatch must run make check on pristine 93df63e before editing, then run it again after the change and confirm it is green. It must also confirm that uv run python3 -m pytest tests/test_config_cli.py tests/test_auth.py tests/test_carddav.py -q passes, with test_auth.py and test_carddav.py unedited. [verification]

Change: Copy the config=error … at={','.join(exc.locations)} line at cli.py:98. In auth.py, make every ConfigError raised by Tokens.load (lines 44-50) carry its config key in ConfigError.locations. Do this either by giving _read_token a key parameter or by wrapping each call site, re-raising with ConfigError(exc.code, [key]) from None. The keys are "auth.read_token_file" and "auth.write_token_file". For tokens-equal, the lean gives both keys. Keep the code unchanged so that str(exc) is still the code. In cli.py, change line 107 to print at={','.join(exc.locations)}. Change line 116 to print the literal at=store.tombstone_salt_file. Leave read_secret_file and the source= lines (cli.py:125-131) untouched. Update the expected output in test_check_bad_salt_file_exits_2 and test_api_bad_token_exits_2, and add tests for a missing write token and for equal tokens. Each of these tests asserts that no path or token appears in the output. Add one sentence to README.md:152 telling operators to run peoplemind check in the sync container.

Files: src/people_mind_mcp/auth.py · src/people_mind_mcp/cli.py · tests/test_config_cli.py · README.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-05-secret-errors-name-the-config-key-of-the-file-that-failed.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-05-secret-errors-name-the-config-key-of-the-file-that-failed.md

### ⏸ SVD architect gate: dev/people-mind-mcp#92 secret-errors-name-the-config-key-of-the-file-that-failed **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:** `20261105T040526Z-984bdd36` **Held because:** CLEAN but 2 open risk(s) (1 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. tokens-equal (auth.py:49) fails because the read and write tokens are equal, not because one file could not be read, and the issue names only the per-file keys. Should the line print (a) at=auth.read_token_file,auth.write_token_file (the lean), (b) at=auth.write_token_file, or (c) no at=? Choosing (b) or (c) changes only that one raise and the expected output of test_api_equal_tokens_names_both_keys. [decision] 2. No baseline was measured at spec time because the sandbox denied the repo .venv. Dispatch must run `make check` on pristine 93df63e before editing, then run it again after the change and confirm it is green. It must also confirm that `uv run python3 -m pytest tests/test_config_cli.py tests/test_auth.py tests/test_carddav.py -q` passes, with test_auth.py and test_carddav.py unedited. [verification] **Change:** Copy the `config=error … at={','.join(exc.locations)}` line at cli.py:98. In auth.py, make every ConfigError raised by Tokens.load (lines 44-50) carry its config key in ConfigError.locations. Do this either by giving _read_token a `key` parameter or by wrapping each call site, re-raising with ConfigError(exc.code, [key]) from None. The keys are "auth.read_token_file" and "auth.write_token_file". For tokens-equal, the lean gives both keys. Keep the code unchanged so that str(exc) is still the code. In cli.py, change line 107 to print `at={','.join(exc.locations)}`. Change line 116 to print the literal `at=store.tombstone_salt_file`. Leave read_secret_file and the source= lines (cli.py:125-131) untouched. Update the expected output in test_check_bad_salt_file_exits_2 and test_api_bad_token_exits_2, and add tests for a missing write token and for equal tokens. Each of these tests asserts that no path or token appears in the output. Add one sentence to README.md:152 telling operators to run `peoplemind check` in the sync container. **Files:** `src/people_mind_mcp/auth.py` · `src/people_mind_mcp/cli.py` · `tests/test_config_cli.py` · `README.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-05-secret-errors-name-the-config-key-of-the-file-that-failed.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-05-secret-errors-name-the-config-key-of-the-file-that-failed.md`</sub>
Author
Collaborator

spec-verify-dispatch Half B for dev/people-mind-mcp#92 secret-errors-name-the-config-key-of-the-file-that-failed completed integration verify.

  • PR: #95
  • Branch: feat/svd-dev-people-mind-mcp-92-secret-errors-name-the-config-dc1df5f2
  • Commit: 2b97c5f564
  • 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/73/pipeline/64/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261105T042222Z-dc1df5f2 --confirm-merge)
spec-verify-dispatch Half B for dev/people-mind-mcp#92 secret-errors-name-the-config-key-of-the-file-that-failed completed integration verify. - PR: https://git.groupthink.asia/dev/people-mind-mcp/pulls/95 - Branch: feat/svd-dev-people-mind-mcp-92-secret-errors-name-the-config-dc1df5f2 - Commit: 2b97c5f564997355fbda599f6704581e90f5318e - 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/73/pipeline/64/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261105T042222Z-dc1df5f2 --confirm-merge`)
svc-svd-writer 2026-11-05 04:35:09 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Sign in to join this conversation.
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
dev/people-mind-mcp#92
No description provided.