Skip to content

Secrets: plain-file store shared with the /secret mod; remove the Keychain helper (#66) - #68

Merged
SSFSKIM merged 20 commits into
mainfrom
feat/file-secrets
Oct 7, 2026
Merged

SSFSKIM merged 20 commits into
mainfrom
feat/file-secrets

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #66

Replaces the Keychain-backed secret store with the plain-file store of the /secret mod (hooks/mods/secrets.tsx):
~/.config/claude-secrets/<KEY> (file 0600, directory 0700, KEY [A-Za-z_][A-Za-z0-9_]*), the same code path on macOS
and Linux. The trusted-side {{secret:KEY}} substitution is unchanged in shape; only the reader changed. The Swift
helper, the broker, their build/test scripts and doctor rows are removed (net about −2,500 lines). Also closes the
ground of #14 (nothing left to sign) and #59 (replaced).

  • src/secrets/store.mjs: reads only a regular file owned by the user with mode exactly 0600 (opened O_NOFOLLOW|O_NONBLOCK,
    checked on the descriptor), bounded, UTF-8, exactly one trailing newline dropped, empty refused; every refusal a
    value-free classified code (secret_insecure_mode, secret_not_regular_file, secret_wrong_owner, secret_empty, …).
  • cua secrets set <KEY>: masked raw-mode prompt, typed twice, refused without a terminal; help points at /secret KEY.
  • Linux has secrets: secrets_unsupported_platform is gone; the Linux sky shape type_text {window, text} is eligible.
  • Doctor: secrets.store (directory present, 0700, files 0600) replaces secrets.helper/secrets.signing.
  • Sandbox: measured that node_repl's scoped profile can deny a root, but it denies the trusted worker too, so no deny
    entry; README and host notes say a cell can read the store under every mode (Decision Log 2026-10-07).
  • Spec: Decision Log entry, M14, Surprises, Outcomes in docs/doperpowers/specs/2026-10-02-standalone-cua-design.md;
    execution report docs/doperpowers/specs/2026-10-07-file-secrets-execution-report.md.
  • main (the plugin bundle, e607f2c) is merged in.

Validation Evidence

Claim Command Result
Suite green, macOS npm test 705 tests, 704 pass, 1 Linux-only skip, 0 fail
Suite green, Linux VM (arm64) npm test on cua-linux 705 tests, 667 pass, 38 darwin-only skips, 0 fail
The mod's own tests still pass bash tests/mods/run-mods-tests.sh 20 pass, 0 fail
macOS local substitution into TextEdit, value nowhere in the stream accept-native.mjs --live-secrets --live-textedit --secret-key CUA_TEST_SECRET --secret-home <tmp> in a temporary CUA_HOME UI delivery PASS: document = marker + value by SHA-256 inside the cell; transcript and stderr clean before and after; probe-secrets.mjs 34/34 PASS
Through the remote agent on the Mac mini (relay) scripts/accept/remote-secret.mjs --config ~/.config/cua-relay/mini.mcp.json …, key set over ssh -tt in the mini's store every step PASS; value 0 times in 23 relay events and in 0 files of the mini's CUA_HOME; key removed, mini back on main
Linux VM substitution scripts/accept/linux-secret.mjs --key CUA_TEST_SECRET --app zenity PASS: zenity printed exactly the value on OK; no leak
Linux gedit (recorded) … --app gedit substituted type_text reaches the helper and gedit crashes, exactly as plain typeText does (#51); fixed secret_input_failed, no leak
Read-deny binds the trusted worker temporary profile entry {"path":…,"access":"none"} cell EPERM, trusted worker EPERM

Details: docs/evidence/2026-10-07-file-secrets-acceptance.md. accept-native's overall verdict reads BLOCKED for
reasons that predate this change (a Linux-only skip; a clean clone without ws), logged in tech-debt-tracker.md.

Confusions

  • The vendor sky service finds the native helper's socket under os.homedir() ($HOME), so on macOS a whole
    cua serve under a scratch $HOME has no native helper; the fixtures use scripts/accept/serve-with-store.mjs
    (store from the scratch home, runtime with the real home). Production is unaffected.
  • The /secret mod moved into this repo on main while the branch was open; wording was updated on merge.

Residue

  • Interrupted secret fixtures leave a temporary store home. A SIGINT/SIGTERM skips the finally that removes a
    cua-* home holding a generated sentinel under $TMPDIR. A signal handler or a sweep at the next run would close it
    (tech-debt entry).
  • accept-native cannot read PASS on a healthy macOS checkout. It counts the one Linux-only skip as missing
    coverage, and its clean clone skips the ws tests. Expected-skip list plus npm ci in the clone (tech-debt entry).
  • A relay client credential stored with /secret appears in secrets_list. cua remote enroll --json names a
    clientSecretKey for the client to keep in the same store; since Secrets: plain-file store shared with the doperpowers /secret mod; remove the Keychain helper #66 that key is listed and could be typed as
    {{secret:…}} like any other. Whether such keys should be hidden from secrets_list (a name prefix, say) is a
    product call.

SSFSKIM added 20 commits October 6, 2026 18:33
…ead; remove the Keychain helper, broker and build scripts; Linux type_text shape; secrets.store doctor row; host notes rule
The live fixtures no longer use the removed Keychain helper, broker or pty driver.
scripts/accept/secret-seed.mjs creates a temporary $HOME, stores a generated value
through `cua secrets set` typed at a pty (`script`), and removes key and home;
scripts/accept/serve-with-store.mjs runs the production server with HOME set to that
home for its store while the runtime launch, Chrome facts and readiness listing keep
the account's real home (the vendor finds the native socket under os.homedir()).

accept-native: --live-keychain becomes --live-secrets; optional --secret-key KEY
[--secret-home DIR] for a caller-stored key; item 1 and the clean clone run npm test
only; item 6 exercises set/list/remove in a temporary store; the signing gate and the
helper suites are gone; package contents no longer expect native/keychain.
probe-secrets: store unreadable replaces broker unavailable. accept-chrome: seeds into
a temporary store. verify.mjs: no broker child check.
…ompt, Linux shapes and launch, doctor secrets.store, serve on a temporary HOME
C2 matrix row renamed to the browser suite's "store refusals" title, with a test that
every matrix title exists in that suite; --secret-home resolved to an existing absolute
path; a caller's value checked (8+ characters, one line) before it becomes a leak
fingerprint; doctor's secrets.store (the account's own store) informational in item 3;
serve-fake-sky-target refuses an account HOME; removeStoreHome removes only a cua-*
home directly in the temporary directory; probe-secrets cleanup cannot throw out of
finally; item 6 header and cleanup detail say what they check.
…eadback compared by hash inside the cell, leak scan
…value never crosses the MCP stream; the transcript is scanned again after it
…ends it), sky tests pin their platform's shape
… relay, the Linux VM) and the spec's Surprises
…hich hung when stdin EOF followed the command's exit
…citation hook, cua-remote skill) into feat/file-secrets; the /secret mod is the plugin's now
…h-debt entries (interrupted fixtures, accept-native's BLOCKED verdict)
…xtures require a fingerprintable value; secrets.store informational in C5; README list wording
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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.

Secrets: plain-file store shared with the doperpowers /secret mod; remove the Keychain helper

1 participant