Repository navigation
feat(minimal): check store rules at box creation and ask once per item (T54) - #2552
norrietaylor merged 4 commits into
Conversation
Box creation now reads the secret-store rules through the fail-closed reader and judges every store reference the box spec declares. A reference with no rule, a rule upstream outside the egress, and a deny rule each refuse the creation with exit 3. An ask rule asks on a terminal and denies without one. One info line names each reference checked and its outcome.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Reviewed: 1 finding, none blocking at Address the comments on the diff. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to Gatehouse §6.10 line 849. Box creation refuses a store reference with exit 3 when no rule names it, when its rule denies it, or when the rule's upstream is outside the box's egress. An ask rule asks on a terminal and denies without one or with --no-input. The check runs on the client before the daemon starts, which is where line 1118 puts store consent. The accepted rules do not reach the proxy registration yet. That work stays with #2524, which owns the store-handle mint at creation.
Ruled at 5e28d6b against gominimal/arch@109541a48c31 by claude-opus-5-5.
Log each refusal reason in place of marking every reference refused. Escape control characters in the grant, item and upstream names that the ask prompt prints, because they come from minimal.toml.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The compare changes only the store-reference log line and the ask question. The log now records each actual refusal, and not every reference as refused. The question escapes control characters in names that come from the project. Both changes keep the consent gate of §6.10 line 849, and the gate is now stronger. The PASS on 5e28d6ba stands for this head.
Ruled at 4198340 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
A box spec that references a host-store secret is refused at creation with exit 3 when no rule matches or the rule's upstream is outside the box's egress. An ask rule prompts on a terminal, with control characters in the names escaped, and denies without a terminal. Notes from the agent: Revise round 1: both review findings fixed in create.rs. cargo clippy -p minimal --all-targets reports no warnings in the minimal crate. The warnings it prints are in minimald and minimald-rpc, which this task does not touch. |
|
/revise Round 2 of #2552, on one review finding opened at 4198340. No round is in flight. Arch's PASS at 5e28d6b stands for this head, and the accepted rules reaching the proxy registration stays with #2524.
One commit, Conventional Commits subject, body lines at most 100 characters. Generated by Claude Code |
…tore-rule-checks-from-box-creation-and
accept_store_references asked about each `ask` reference as it reached it, so a later reference with no rule or a `deny` rule could refuse the creation after the person answered y. It also asked twice about one item used by two grants. Now every no-rule, deny and no-terminal check runs first. Then the command asks once per distinct item, and the question names every grant that reads it. Tests pin both cases.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This push runs every refusal before the first question, and asks once for each item. Gatehouse §6.10 line 849 says an ask rule needs a terminal and is denied without one. The design does not set the order of the questions. Every refusal still fails closed, so BEP-034, BEP-035 and BEP-036 still conform. The rules hand-off to the registration stays interim under #2524.
Ruled at 2033409 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
Round 2 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
A box spec that references a host-store secret is refused at creation when no rule matches, a rule denies, or the rule's upstream is outside the box's egress. All of these refusals now come before any question. An ask rule prompts once per distinct item on a terminal, and denies without one. Notes from the agent: Revise round 2: commit 2033409. The two new cases (a deny after an ask asks nothing, and one item under two grants is asked once) are in ask_rule_without_a_terminal_denies, so its test line pins them. When the person declines an item that two grants share, the refusal names the first grant. The question names all of the grants. I did not resolve the thread, because the reviewer decides that. clippy -p minimal --all-targets shows no warnings in minimal. The warnings it shows are in minimald and minimald-rpc, which this change does not touch. |
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter approval at 2033409: every merge gate passes at this head (arch PASS at 2033409, zero open threads, every lane aggregator green including ci-macos-success). Squash title feat(minimal): check store rules at box creation and ask once per item (T54) and the squashed message pass commitlint. The hand-off of accepted rules to the proxy registration is a stated residual owned by #2524. Queued for squash merge.
Generated by Claude Code
T54 — Call the store-rule checks from box creation and expansion
slice: S9
kind: task
covers: BEP-034, BEP-035, BEP-036
size: M
est: 240 code, 220 tests
executor: agent
difficulty: needs care
model: standard
diagnostics: a refused store reference exits 3 with the rule and the reason on stderr; an
askrule without a terminal prints the denialobservability: one info log line per creation naming the store references checked and their outcome
layers:
- create:
- crates/minimal/src/cmd/boxes/create.rs: reads the rules through
read_client_config_and_store_rules, callscheck_store_referencesfor every host-store reference the spec declares andstore_consentforaskrules, and passes the accepted rules to the proxy registration- crates/minimal/src/config.rs:
read_client_configno longer drops the rules on the creation pathtest: cargo nextest run -p minimal store_reference_without_rule_is_refused_at_creation
test: cargo nextest run -p minimal store_rule_outside_egress_exits_3
test: cargo nextest run -p minimal ask_rule_without_a_terminal_denies
produces: none
consumes:
- crates/boxes/src/core/bep.rs
proof: A box spec that references a host-store secret is refused at creation when no rule matches or the rule's upstream is outside the box's egress, and an ask rule prompts on a terminal and denies without one.
depends on:
- blocked by T13
- blocked by T25
Proof
min session createrefuses a box spec with a host-store secret before anything is created. It refuses with exit 3 when no [secret-store-rules] rule names the item, when the rule's upstream is outside the box's egress (the message names the missing host), or when the rule denies it. An ask rule asks a y/N question on a terminal. Without a terminal, or with --no-input, the command asks nothing and denies the secret.Notes from the agent: The task asks for the accepted rules to go to the proxy registration. That part is not done. The registration (
ControlClient::register_box,GrantBox,mint_and_registerin crates/minimal/src/mint.rs) takes no rules, and mint.rs is not in this task's layers. Store-handle minting is also still interim (#2524).check_store_grantsreturns the accepted rules, andactivate_boxholds them as_accepted_store_ruleswith a comment. The registration already carries the box's egress, and the check proves that every accepted rule's upstream is inside that egress. The next task that mints store handles must pass the rules intoGrantBox. A reference with no rule, a deny rule, an ask without a terminal and a declined ask each use a newGrantNotDeliveredvariant. main.rs already mapsGrantNotDeliveredto exit 3, so main.rs did not change. config.rs getsstore_module_hostsandstore_deny_set, so that config reading and creation use one deny set. It also gets a doc note onread_client_config. Creation reads the rules only when the spec declares a store reference. So an unreadable organization config fails only those boxes, and other boxes do not fail. The info log is one line per creation, 'checked the box's store references', with each reference and its outcome. Also ran:cargo nextest run -p minimal config:: activation_steps, 8 passed. just clippy-strict was not run.Tests
cargo nextest run -p minimal store_reference_without_rule_is_refused_at_creationcargo nextest run -p minimal store_rule_outside_egress_exits_3cargo nextest run -p minimal ask_rule_without_a_terminal_deniesVerify
min task run agent-verifyexited 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.Residuals
ControlClient::register_boxandGrantBoxtake no rules, andcrates/minimal/src/mint.rsis outside T54's layers. Sign store handles under the client's one local key from a host-keychain ClientKeyStore (Gatehouse §6.10 line 842) #2524 owns that hand-off with the store-handle mint at creation (arch ruling at 2033409).Closes #2535
Generated by Claude Code