Skip to content

feat(minimal): write the store rule from min secret set with fixed-token presets (T39) - #2577

Merged
norrietaylor merged 11 commits into
mainfrom
agent/2325-write-the-store-rule-from-min-secret-set-with-fi
Oct 26, 2026
Merged

norrietaylor merged 11 commits into
mainfrom
agent/2325-write-the-store-rule-from-min-secret-set-with-fi

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T39 — Write the store rule from min secret set, with fixed-token presets

slice: S3
kind: task
covers: BEP-079
size: L
est: 280 code, 600 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: an unknown preset prints "There is no preset named . Known presets: anthropic, anthropic-api-key, cloudflare, linear, sentry." on stderr, pinned by secret_set_unknown_preset_lists_known_ones
observability: one info log line per rule written naming the identifier and upstream, never the value
layers:
- cli:
- crates/minimal/src/cli.rs: --upstream, --header, --prefix, --basic-auth, --preset and --yes on min secret set
- crates/minimal/src/cmd/secret.rs: presets, the rule check before the value is read, the change prompt, the partial-failure restore
- crates/minimal/src/config.rs: writes one [secret-store-rules] rule to the user-level config.toml
test: cargo nextest run -p minimal secret_set_writes_user_level_store_rule
test: cargo nextest run -p minimal secret_set_writes_no_project_or_org_config
test: cargo nextest run -p minimal secret_set_presets_resolve_to_their_rules
test: cargo nextest run -p minimal secret_set_unknown_preset_lists_known_ones
test: cargo nextest run -p minimal secret_set_refuses_deny_set_rule_before_reading_value
test: cargo nextest run -p minimal secret_set_shows_rule_change_and_asks
test: cargo nextest run -p minimal secret_set_rule_change_without_tty_needs_yes
test: cargo nextest run -p minimal secret_set_yes_replaces_rule_without_asking
test: cargo nextest run -p minimal secret_set_partial_failure_restores_both
test: cargo nextest run -p minimal secret_set_without_rule_flags_leaves_rule_unchanged
produces: none
consumes: none
proof: min secret set claude --preset anthropic stores the key and writes its rule to the user-level configuration.
depends on:
- blocked by #2280
- blocked by #2287

Proof

min secret set claude --preset anthropic stores the key in the keychain and writes [secret-store-rules.claude] with upstream api.anthropic.com, header Authorization and prefix "Bearer " to the user-level config.toml. Other lines of the file stay as they are. --upstream with --header/--prefix or --basic-auth writes a custom rule in the same way.

Notes from the agent: The ten test: lines ran as one nextest invocation with all ten filters, and all ten passed. The existing secret and config tests also pass (32 passed). Design: the rule is written first and the item second. When the store refuses the item, config.toml is put back byte for byte, or removed when it did not exist before. With this order, the old keychain value never needs to be read back. When the rule write fails, the item is not touched. A 'terminal attached' means the value source is a terminal. A piped value or --no-input with a different rule therefore needs --yes. As BEP-079 says, the written rule has no consent action. So replacing a rule with a hand-set action = "ask" or "deny" drops that action. The change prompt shows 'consent: ask' becoming 'consent: none', but --yes drops it without a prompt. A reviewer can decide whether to keep a hand-set action. write_store_rule refuses a config.toml that sets secret-store-rules as an inline table, and the partial-failure test uses that refusal. The file is replaced through a temp file and a rename, so a config.toml that is a symbolic link becomes a regular file. The unknown-preset message is copied from the task. It states the situation and lists the names, but it gives no command to run. I did not run just clippy-strict or the whole crate's suite.

Tests

line exit tail
cargo nextest run -p minimal secret_set_writes_user_level_store_rule 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-8404... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimal secret_set_writes_no_project_or_org_config 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-323e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_presets_resolve_to_their_rules 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-abaf... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_unknown_preset_lists_known_ones 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-48e3... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_refuses_deny_set_rule_before_reading_value 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-7267... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_shows_rule_change_and_asks 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-f55b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling mlog v0.0.1 (/workbench/crates/mlog) Compiling minimal-clie
cargo nextest run -p minimal secret_set_rule_change_without_tty_needs_yes 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-1695... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_yes_replaces_rule_without_asking 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-121b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_partial_failure_restores_both 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-5842... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_without_rule_flags_leaves_rule_unchanged 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-c18c... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify

min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-41c0...
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking switch v0.0.1 (/workbench/crates/switch)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking check v0.0.1 (/workbench/crates/check)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Closes #2325

min secret set takes --upstream with --header/--prefix or --basic-auth,
or --preset (anthropic, anthropic-api-key, cloudflare, linear, sentry),
and writes the [secret-store-rules] rule for the item to the user-level
config.toml, with no consent action (BEP-079).

The rule is checked against the deny set, and a change to a different
rule is confirmed on the terminal or needs --yes, before the value is
read. The rule is written first and the item second. When the store
refuses the item, config.toml is put back as it was.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 18a8b6be-0653-455a-9ae7-3dc846656414

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry

minimal-foundry Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at 06a638915864.

Address the comments on the diff.

Clobber: not checked in git history. If that was not intentional, restore the earlier change.

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONFIRM · the full ruling

This change makes host-store min secret set take --upstream and write a [secret-store-rules] rule, as BEP-079 asks. The design of record says the opposite. architecture.md line 513 says that for a host store, set takes no upstream and registers nothing, and that --upstream is refused for a host store. The code is otherwise in the right place, and it refuses the deny set before it reads the value. This PR cannot settle a conflict between the spec and the design, so the ruling is CONFIRM with one escalation. The task waits for a decision on gominimal/arch: amend line 513, or drop BEP-079 from the spec.

Ruled at 1279c03 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimal/src/cli.rs Resolved
Comment thread crates/minimal/src/cmd/secret.rs Resolved

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 3 findings, 3 inline.

Panel: 1 of 3 personas ran (correctness); did not complete: security, supply-chain.

Comment thread crates/minimal/src/cmd/secret.rs Resolved
Comment thread crates/minimal/src/cmd/secret.rs Resolved
Comment thread crates/minimal/src/cmd/secret.rs Resolved
The restore after a failed store write now puts config.toml back only
when it still holds the bytes the rule write left, and writes through a
symlinked config.toml to its target. The rule-read failure names the
config file, and the no-confirm refusal no longer claims there is no
terminal when --no-input is the cause.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 2 findings, 2 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimal/src/cmd/secret.rs Resolved
Comment thread crates/minimal/src/cmd/secret.rs Resolved

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONFIRM · the full ruling

This change does what spec 24 BEP-079 asks. The rule goes only to the user-level config.toml. The deny set is checked before the value is read, and the rule carries no consent action. But architecture.md line 509 gives --upstream and --inject to --store gatehouse only. Line 513 says a host-store set "takes no upstream and registers nothing". The spec and the design disagree, and this change cannot amend the design. I escalate the question to the arch owner, and the task waits for that decision. No code change is asked now.

Ruled at 9aa6c48 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimal/src/cli.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 9aa6c48fc983.

line exit tail
cargo nextest run -p minimal secret_set_writes_user_level_store_rule 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-ef77... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimal secret_set_writes_no_project_or_org_config 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-2d29... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_presets_resolve_to_their_rules 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-f8b7... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_unknown_preset_lists_known_ones 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-1ae8... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling mlog v0.0.1 (/workbench/crates/mlog) Compiling minimal-clie
cargo nextest run -p minimal secret_set_refuses_deny_set_rule_before_reading_value 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-3549... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_shows_rule_change_and_asks 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-98e4... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_rule_change_without_tty_needs_yes 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-c0e2... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_yes_replaces_rule_without_asking 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-68e6... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_partial_failure_restores_both 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-e8a5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_without_rule_flags_leaves_rule_unchanged 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-ff02... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-ea4d...
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking args v0.0.1 (/workbench/crates/args)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking switch v0.0.1 (/workbench/crates/switch)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/cli.rs:1269: BEP-079 in this task requires --upstream on min secret set. The finding is an escalation of a spec-against-design conflict for a person to decide on gominimal/arch, and it asks for no change until then. The line is unchanged.
  • 👎 invalid — crates/minimal/src/cmd/secret.rs:316: BEP-079 asks for the whole rule for the id to be replaced, after the change prompt or with --yes. The finding is an escalation to the design owner and asks for no change in this pull request. The code is unchanged.
  • 👍 valid — crates/minimal/src/cmd/secret.rs: restore_config now restores only when config.toml still holds the bytes the rule write left, and otherwise leaves the file and reports it. Writes and restores go through a symlink to its target. Two new tests cover this.
  • 👍 valid — PRRT_kwDOPdfcxM6wDl4b: plan_rule now reports 'min secret set stored nothing: it did not read the rules in '. (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — PRRT_kwDOPdfcxM6wDl4k: The refusal now says the command cannot ask you to confirm the new rule, which is true for --no-input too. It still names --yes. The test asserts the new text. (not posted on the thread: not an open thread on the pull request)

min secret set claude --preset anthropic stores the key and writes its rule to the user-level config.toml. If the store write fails, the rule restore keeps a symlinked config.toml as a link, and it does not overwrite an edit made after the rule write.

Notes from the agent: Revise round 1. Threads PRRT_kwDOPdfcxM6wDlvk and PRRT_kwDOPdfcxM6wDlvo are escalations of a conflict between the spec and the design (BEP-079 against architecture.md). The bot asks for no change until a person decides on gominimal/arch, so the code is unchanged for them. The no-confirm refusal now says 'it cannot ask you to confirm the new rule'. No spec text pins it. I also ran cargo nextest run -p minimal secret one time: 29 passed. I did not run just clippy-strict.

Copy link
Copy Markdown
Member

/revise

Round 2 of #2577, on the arch escalation at 9aa6c48 and two review findings. No round is in flight. The epic owner decided on 2026-10-26 that spec 24 BEP-079 wins over architecture.md lines 509 and 513. gominimal/arch#145 amends the design. So keep --upstream, the inject flags and the rule write as they are.

  1. Findings 4371881769 (MEDIUM) and 4371881775 (MEDIUM, security): in plan_rule in crates/minimal/src/cmd/secret.rs, a new rule must not silently drop consent settings. When a rule for <id> already exists, keep its action and its store unless a flag sets them. set never writes an action of its own. Show the change in the prompt. With --yes, print one line that names the rule and what changes, then write it.
  2. Add tests: an existing action = "deny" and an existing store survive set --yes with new upstream flags, and the printed line names the change.
  3. Reply on threads 4371818511, 4371818516 and 4371886538: the owner chose the spec, and gominimal/arch#145 amends architecture.md 508–509 and 513. Resolve them. Reply on and resolve the two findings above once the commit fixes them.

Keep to crates/minimal/src/cmd/secret.rs and its tests. One commit, Conventional Commits subject, every body line at most 72 characters.


Generated by Claude Code

When a rule for the id exists, the rule that set writes now keeps the
current action and store, because no flag sets them. A hand-set deny
or ask is no longer dropped. With --yes, set prints one line on stderr
that names the rule, the file and the fields that change.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimal/src/cmd/secret.rs Resolved

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONFIRM · the full ruling

BEP-079 tells host-store min secret set to take --upstream and write the [secret-store-rules] rule. architecture.md line 513 says a host-store set "takes no upstream and registers nothing". Line 509 gives the authority flags only to --store gatehouse. The design is the record, and only the arch owner can change it. I escalate the question and give no ruling until the owner decides. The rest of the change agrees with Gatehouse §6.10 line 849.

Ruled at 9cb8839 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimal/src/cli.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note, pushed as 9cb88395f020.

line exit tail
cargo nextest run -p minimal secret_set_writes_user_level_store_rule 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-243b... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimal secret_set_writes_no_project_or_org_config 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-5c34... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_presets_resolve_to_their_rules 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-c442... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_unknown_preset_lists_known_ones 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-524e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_refuses_deny_set_rule_before_reading_value 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-5fd8... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_shows_rule_change_and_asks 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-3ab0... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_rule_change_without_tty_needs_yes 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-b9e5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_yes_replaces_rule_without_asking 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-eaec... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_partial_failure_restores_both 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-4506... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_without_rule_flags_leaves_rule_unchanged 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-48fc... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

re/compose.rs:402:8
    |
402 | pub fn deferring_env() -> StoredEnv {
    |        ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/secret.rs:242: plan_rule now copies the current rule's action and store into the new rule, so the prompt and the write keep a hand-set ask or deny.
  • 👍 valid — PRRT_kwDOPdfcxM6wDvyX: With --yes the new rule keeps the current action and store, and set prints one stderr line that names the rule, the file and the changed fields. Test: secret_set_yes_replaces_rule_without_asking_keeps_consent_and_store. (not posted on the thread: not an open thread on the pull request)
  • 👎 invalid — crates/minimal/src/cli.rs:1269: The epic owner decided on 2026-10-26 that spec 24 BEP-079 wins. gominimal/arch#145 amends architecture.md 508-509 and 513, so --upstream on the host store stays.
  • 👍 valid — crates/minimal/src/cmd/secret.rs:318: The new rule now keeps the current action and store when a rule for the id exists, so a hand-set deny no longer becomes the default consent.

min secret set claude --preset anthropic stores the key and writes its rule to the user-level config.toml. When a rule for claude already exists, the written rule keeps its hand-set action and store. With --yes, one line on stderr names the rule, the file and the fields that change.

Notes from the agent: Revise round 2. plan_rule now copies the current rule's action and store into the new rule, because no flag sets them. The change prompt shows the kept consent. With --yes, set prints one stderr line: min secret set replaces the rule for <id> in <path>: upstream A becomes B, and injection X becomes Y. The line goes through a new notice writer on RuleTarget (stderr in cmd_secret_set), so the test can read it. It prints just before the rule write, after the value is read. Two existing tests now expect the kept ask. One new test covers a kept deny and store, and the printed line. The whole change is in crates/minimal/src/cmd/secret.rs, in one commit. Directive item 3 asks to resolve threads. This session cannot resolve threads, and the reviewer decides that. Thread 4371818511 keeps its earlier invalid verdict, because the owner chose BEP-079 and gominimal/arch#145 amends architecture.md 508-509 and 513. Thread 4371818516 changes to valid, because this commit keeps the action. Also ran cargo nextest run -p minimal secret: 30 passed. Did not run just ci or clippy-strict.

@norrietaylor norrietaylor changed the title T39 — Write the store rule from min secret set, with fixed-token presets feat(minimal): write the store rule from min secret set with fixed-token presets (T39) Oct 26, 2026

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babysitter approval at 9cb8839: every merge gate passes at this head (arch PASS at 9cb8839, zero open threads, every lane aggregator green). Squash title feat(minimal): write the store rule from min secret set with fixed-token presets (T39) and the squashed message pass commitlint. Queued for squash merge.


Generated by Claude Code

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONFIRM · the full ruling

This change does what spec 24 BEP-079 asks. The design of record refuses it. architecture.md line 513 says that for a host store, set takes no upstream and registers nothing. It also refuses --upstream and --inject for a host store. No code edit can settle this, so I file an escalation for the arch owner. The task waits for that decision. Where the design does speak, the rest of the change conforms: the user-level file only, the deny set before the value, and no value in the log.

Ruled at 130a9fd against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimal/src/cli.rs
conflicts_with = "preset",
requires = "form"
)]
pub upstream: Vec<String>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BEP-079 · This flag gives host-store min secret set an upstream. architecture.md line 513 says: "for a host store, set takes no upstream and registers nothing". Spec 24 BEP-079 asks for the flag. The escalation asks the arch owner to decide. Do not change this line until the owner decides.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed — not addressed: No change this round. The task covers BEP-079, and BEP-079 asks for --upstream on host-store min secret set. The thread itself says to keep this line until the arch owner decides the conflict with architecture.md line 513.

mut target: Option<RuleTarget<'_>>,
) -> anyhow::Result<()> {
refuse_set_args(args)?;
let rule = requested_rule(args)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BEP-079 · Here set turns its flags into a [secret-store-rules] rule and writes it. Line 513 of the design keeps registration out of host-store set. The ordering is correct: the deny set check, then the value, then the store, then the restore. The open question is only whether set may write the rule at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed — not addressed: No change this round. BEP-079, which this task covers, requires set to write the [secret-store-rules] rule. The thread agrees the ordering is correct and leaves only the design conflict with line 513 for the arch owner to decide.

The merge from main added an entry field to
StoreRuleRefusal::MinimalInfrastructure. Name the entry when the
upstream is a name under it.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment on lines +652 to +675
let snapshot = match &mut write {
None => None,
Some((path, rule, line, notice)) => {
if let Some(line) = line {
writeln!(notice, "{line}")?;
}
let snapshot =
crate::config::write_store_rule(path, &args.id, rule).with_context(|| {
format!(
"min secret set stored nothing: it did not write the rule for {} to {}",
args.id,
path.display()
)
})?;
tracing::info!(
id = %args.id,
upstream = %rule.upstream.join(", "),
file = %path.display(),
"secret-store rule written"
);
Some((*path, snapshot))
}
};
if let Err(e) = store.set(&args.id, &value, proxy) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW · security · confidence 0.50 · in run_set_with_rule

The new rule is written to config.toml before store.set replaces the item. If the process is killed or interrupted between the two steps, the rule is not restored. The old keychain value then stays bound to the new upstream. The restore only runs when store.set returns an error. The old value can then reach an upstream it was never meant for. Write the item first and the rule second, or document and test this window.

What the reviewer checked

secret.rs:652 write_store_rule(...) runs, then secret.rs:675 if let Err(e) = store.set(...); restore_config is called only inside that Err branch.

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/cmd/secret.rs
Lines:      652-675
Category:   security
Severity:   low (reviewer confidence 0.50)

Finding:
The new rule is written to config.toml before `store.set` replaces the item. If the process is killed or interrupted between the two steps, the rule is not restored. The old keychain value then stays bound to the new upstream. The restore only runs when `store.set` returns an error. The old value can then reach an upstream it was never meant for. Write the item first and the rule second, or document and test this window.

First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.

👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 06a638915864: The window is real, and the run_set_with_rule doc comment now describes it. The order stays rule first, item second. SecretStore cannot read a value back, so an item replaced first cannot be restored when the rule write fails. A kill between the two steps cannot run any restore code, and no unit test can cover it.

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONFIRM · the full ruling

Spec 24 BEP-079 makes min secret set take --upstream, --header, --prefix, --basic-auth and --preset for a host store, and write a [secret-store-rules] rule. architecture.md line 513 says the opposite: for a host store, set takes no upstream and registers nothing, and the deposit flags are refused for a host store. The code follows the spec, and it does that carefully. But only the design owner can settle the conflict between the spec and the design. A change to the code cannot settle it. This head changes only one refusal message, so the ruling stays CONFIRM, as on the four earlier heads. An escalation asks the owner to amend line 513 or to remove BEP-079.

Ruled at 55a132c against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimal/src/cli.rs
conflicts_with = "preset",
requires = "form"
)]
pub upstream: Vec<String>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BEP-079 · This flag lets a host-store min secret set take an upstream. architecture.md line 513 says: "for a host store, set takes no upstream and registers nothing". It also refuses --upstream and --inject for a host store. Spec 24 BEP-079 requires this flag, so the spec and the design disagree. The escalation asks the owner to decide.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed — not addressed: Spec 24 BEP-079 requires --upstream on min secret set, and this task covers BEP-079. The disagreement with architecture.md line 513 is with the owner as an escalation. This line stays as it is until the owner decides. If the design wins, the change goes in the spec and architecture.md, outside this task's layers.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a failed check suite, pushed as 55a132c7baf9.

line exit tail
cargo nextest run -p minimal secret_set_writes_user_level_store_rule 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-0426... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimal secret_set_writes_no_project_or_org_config 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-1c3b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_presets_resolve_to_their_rules 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-7899... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_unknown_preset_lists_known_ones 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-f274... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_refuses_deny_set_rule_before_reading_value 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-8dbf... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_shows_rule_change_and_asks 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-7c8f... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_rule_change_without_tty_needs_yes 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-ed1c... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_yes_replaces_rule_without_asking 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-d8c5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_partial_failure_restores_both 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-a8e6... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_without_rule_flags_leaves_rule_unchanged 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-045b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

re/compose.rs:402:8
    |
402 | pub fn deferring_env() -> StoredEnv {
    |        ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/cli.rs:1269: No change this round. The task covers BEP-079, and BEP-079 asks for --upstream on host-store min secret set. The thread itself says to keep this line until the arch owner decides the conflict with architecture.md line 513.
  • 👎 invalid — crates/minimal/src/cmd/secret.rs:602: No change this round. BEP-079, which this task covers, requires set to write the [secret-store-rules] rule. The thread agrees the ordering is correct and leaves only the design conflict with line 513 for the arch owner to decide.

min secret set claude --preset anthropic stores the key and writes its rule to the user-level config.toml. The branch compiles again after the merge from main.

Notes from the agent: The failing checks had one cause. The merge from main (T55) added an entry field to StoreRuleRefusal::MinimalInfrastructure, so the match in check_new_rule did not compile. The match now handles the field. When the upstream is a name under a deny-set entry, the refusal names the entry: " is under , and a secret can never be sent to or a name under it. Run the command again with another --upstream." cargo clippy -p minimal --all-targets is clean on Linux. The macOS (zoned) log also showed an unused_mut warning in the minimal lib, but the excerpt does not give its line, and Linux clippy does not report it. It is a warning, not the failure. I did not run just clippy-strict.

…store-rule-from-min-secret-set-with-fi

# Conflicts:
#	crates/minimal/src/cmd/secret.rs
The rule is written before the item because the store cannot read a
value back, so only the rule file can be restored. A kill between the
two steps leaves the old item under the new rule. Review finding
4374026712.

Copy link
Copy Markdown
Member

/revise

Round 3 of #2577, on a merge conflict at 55a132c. No round is in flight. #2581 (T62) landed on main and moved min secret to one proxy-binary resolver (resolve_proxy over bep::store::proxy_binary_on_path), so crates/minimal/src/cmd/secret.rs now conflicts in its imports.

  1. Merge main into this branch.
  2. In crates/minimal/src/cmd/secret.rs, resolve the two import lines as main's lines plus this PR's StoreRuleRefusal:
    • use bep::store::{HostStore, NATIVE_STORE, ProxyLookupError, SecretStore, StoreError, valid_id};
    • use boxes::core::bep::{StoreAction, StoreRuleConfig, StoreRuleRefusal, StoreRules};
      This PR does not call proxy_binary_path, so drop it from the import. Keep everything else this PR changes.
  3. Change no other behaviour. Run the bep and minimal tests this PR names, and clippy on both crates.

Generated by Claude Code

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #2325. Your note is kept and goes into the next round here, which starts when that coder finishes.

Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet.

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONFIRM · the full ruling

This change does what spec BEP-079 asks. That spec line conflicts with the design of record. architecture.md line 513 says a host-store set takes no upstream and registers nothing. It refuses --upstream and --inject for a host store (owner ruling gominimal/arch#70). This change adds those flags and --preset to a host-store set, and writes the rule. A code change cannot settle this, so the ruling stays CONFIRM and the question goes to an arch issue. The last compare (a main merge and a doc comment) does not change the question.

Ruled at 06a6389 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimal/src/cli.rs
conflicts_with = "preset",
requires = "form"
)]
pub upstream: Vec<String>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BEP-079 · This flag gives a host-store min secret set an upstream. architecture.md line 513 says a host-store set takes no upstream and registers nothing. It refuses --upstream for a host store (gominimal/arch#70). BEP-079 asks for this flag, so the conflict is escalated for an owner decision.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed — not addressed: Same finding as the earlier threads on this line. BEP-079, the requirement this task covers, asks for --upstream on min secret set. The conflict with architecture.md line 513 is with the arch owner (gominimal/arch#70). This line stays as it is until the owner decides.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment on lines +543 to +546
/// Review finding 4374026712: this leaves one window. If the process is
/// killed after the rule write and before `store.set` returns, no restore
/// runs. The old item then stays under the new rule until the next `set`
/// or `rm`. The window is the duration of one store call. The command

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW · security · confidence 0.50 · in run_set_with_rule

The rule is written before store.set. If the process dies between the two, the old secret stays in the store under the new rule. The new rule can name a different upstream, so the old secret can go to a host the user no longer expects. The doc comment admits this window. Think about a restore on the next run, or a marker that blocks use of the item until set finishes.

What the reviewer checked

run_set_with_rule doc: 'If the process is killed after the rule write and before store.set returns, no restore runs. The old item then stays under the new rule'

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/cmd/secret.rs
Lines:      543-546
Category:   security
Severity:   low (reviewer confidence 0.50)

Finding:
The rule is written before `store.set`. If the process dies between the two, the old secret stays in the store under the new rule. The new rule can name a different upstream, so the old secret can go to a host the user no longer expects. The doc comment admits this window. Think about a restore on the next run, or a marker that blocks use of the item until `set` finishes.

First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.

👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed — not addressed: The order is deliberate, and the doc comment at secret.rs:539-547 records it. SecretStore cannot read a value back, so the rule is the only one of the two writes that can be put back. A recovery marker needs a store-side state in bep, and that is outside this task's layers. This round's directive also forbids behaviour changes. The window is one store call, and the command exits without printing an identifier.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

A merge of main before round 4, not counted against the cap (1 of 3), pushed as 06a638915864.

Resolved conflicts in: crates/minimal/src/cmd/secret.rs

line exit tail
cargo nextest run -p minimal secret_set_writes_user_level_store_rule 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-655d... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc
cargo nextest run -p minimal secret_set_writes_no_project_or_org_config 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-6bcb... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_presets_resolve_to_their_rules 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-c1aa... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_unknown_preset_lists_known_ones 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-db74... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_refuses_deny_set_rule_before_reading_value 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-fd3f... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_shows_rule_change_and_asks 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-c6d5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_rule_change_without_tty_needs_yes 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-c4b0... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_yes_replaces_rule_without_asking 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-75f2... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_partial_failure_restores_both 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-8d22... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal secret_set_without_rule_flags_leaves_rule_unchanged 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-0a7a... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

re/compose.rs:402:8
    |
402 | pub fn deferring_env() -> StoredEnv {
    |        ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/secret.rs:633: The window is real, and the run_set_with_rule doc comment now describes it. The order stays rule first, item second. SecretStore cannot read a value back, so an item replaced first cannot be restored when the rule write fails. A kill between the two steps cannot run any restore code, and no unit tes
  • 👎 invalid — crates/minimal/src/cli.rs:1269: Spec 24 BEP-079 requires --upstream on min secret set, and this task covers BEP-079. The disagreement with architecture.md line 513 is with the owner as an escalation. This line stays as it is until the owner decides. If the design wins, the change goes in the spec and architecture.md, outside this

min secret set claude --preset anthropic stores the key and writes its rule to the user-level config.toml. The branch now merges cleanly with main.

Notes from the agent: Conflict round. The only conflict was the use lines in crates/minimal/src/cmd/secret.rs. The resolution keeps main's ProxyLookupError import and this branch's StoreRuleRefusal import. It drops the unused proxy_binary_path import, because resolve_proxy now calls bep::store::proxy_binary_on_path. cargo clippy -p minimal --all-targets is clean. A second commit documents the interrupt window that thread 4374026712 names. It changes no code.

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Own review at 06a6389: the new head is a merge of main, which takes main's resolver imports after #2581, plus a doc comment on the rule-then-item order and its interrupt window. Behaviour is unchanged since 55a132c. The arch CONFIRM is the question the owner ruled in gominimal/arch#145 (spec wins).


Generated by Claude Code

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on a /revise note: the coder changed nothing. every commit this round put on the branch above 06a6389 is a merge of the base branch, so it carries no work of its own

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/cli.rs:1269: Same finding as the earlier threads on this line. BEP-079, the requirement this task covers, asks for --upstream on min secret set. The conflict with architecture.md line 513 is with the arch owner (gominimal/arch#70). This line stays as it is until the owner decides.
  • 👎 invalid — crates/minimal/src/cmd/secret.rs:546: The order is deliberate, and the doc comment at secret.rs:539-547 records it. SecretStore cannot read a value back, so the rule is the only one of the two writes that can be put back. A recovery marker needs a store-side state in bep, and that is outside this task's layers. This round's directive al

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 78e2a51 Oct 26, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2325-write-the-store-rule-from-min-secret-set-with-fi branch October 26, 2026 08:34
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.

T39 — Write the store rule from min secret set, with fixed-token presets

1 participant