FFFF Merge remote-tracking branch 'origin/main' into agent/2430-project-the-spec-and-digest-it-the-same-way-in-c · gominimal/minimal@beeeae4 · GitHub
[go: up one dir, main page]

Skip to content

Merge remote-tracking branch 'origin/main' into agent/2430-project-th…

Minimal Arch / arch-review failed Nov 13, 2026 in 0s

CONDITIONS

Governs (arch 15b603e6. The checkout has no arch-map.md, so I found the sections by search.) Gatehouse §6.3.2 lines 649–672: the client and the node each compute the Box Spec projection, a fixed record that is JCS-canonicalised and digested with SHA-256 and base64url. Line 657 gives ingress_ports as port numbers. Line 663 gives nesting as five bounds. Lines 664–668 give secret_grants as env/scopes/mode for a brokered grant, and as env/source/store/id/upstream (a list)/inject for a store reference. Architecture box.toml lines 200–208: expansion writes upstream and inject as a list and a table. An entry that sets either one is a validation error (exit 3). Gatehouse §6.2 line 580: the spec is unchanged when the host later enrolls (BOX-142).

Ruling. The parts in the daemon conform. minimald recomputes the digest from the spec it receives and removes a client-sent projection_digest.daemon. It stores both digests in the record attrs, and it names both on the box.create span and in the log. The JCS writer, the digest encoding, the egress field mapping and leaving out allow_protocols conform. The projection record does not match §6.3.2. A verifier built to §6.3.2 digests a different record, so redemption fails closed. That is the reason the BOX spec (line 689) gives for using §6.3.2's names. C1, C2, C4 and C5 fix the shape. C3 replaces the silent drop of a project-written upstream/inject with the design's exit-3 refusal (fail closed). C6 files the client half. The plan's layers exclude crates/minimal, and the client still sends a v0 BoxSpec with no digest. So BOX-071's "in both the client and the daemon" holds only in the shared mfile function today, and the work needs an owner.

Fills. The agent fills the token mode, quic443 and steering inside project(), not in the spec bytes. BOX-071's sub-requirement says "fill, before the projection is canonicalised", and the client and the daemon fill the same values. So I do not make the fill location a condition. If an architecture reader takes §6.3.2's "filled during expansion" to mean the stored spec, raise that on the next round.

Precedent. No ruling in the ledger is on this PR or on the projection, so this ruling departs from none.

Not checked. I did not compile or run the tests, as the instructions require. I did not check whether TypeFacts::of_spec (client) and spec_type_root (daemon) agree on every spec, or whether the v0 BoxSpec the daemon receives today projects the same as the client's expanded spec will. That is BOX-072's work. Both need a build or the client wiring. The Verify step in the PR body timed out (minenv_run_forwards_stdin_to_the_task). That is outside this ruling.

Conditions

  • C1: crates/mfile/src/projection.rs secret_grants() builds each grant from the §6.3.2 key set only, not from the entry's own keys. Write the [secrets] entry name as env, and do not write name or value. A brokered (github:* or audience) grant carries env, scopes and mode (when set or filled), and no source. A source = "store" reference carries env, source, store, id, upstream as a list of authorities, and inject. Update projection_is_the_6_3_2_field_set and expansion_fills_token_mode_quic443_steering_before_digest (which looks up grants by name) to assert this exact key set.
  • C2: crates/mfile/src/expand.rs write_store_authorities() writes upstream as an array of the rule's authorities (upstream = ["registry.npmjs.org"]), not as the table { hosts = [...] }. Change the fixture store_secret() in crates/minimald/src/box_manager/tests.rs to the same shape, and change store_reference_upstream_and_inject_written_into_spec to assert it.
  • C3: crates/mfile/src/expand.rs expand() refuses, with an Error that the client reports as exit 3 and that names the secret and the key, any source = "store" entry for which a layer sets upstream or inject. Run this check before write_store_authorities(), and remove the grant.remove("upstream") / grant.remove("inject") drop from write_store_authorities(). Change the STORE_FILE case in store_reference_upstream_and_inject_written_into_spec to expect the refusal.
  • C4: crates/mfile/src/projection.rs ingress_ports() projects each admitted port as its port number ([8080]), not as a { port, proto } object. Update projection_is_the_6_3_2_field_set to assert the list of integers.
  • C5: crates/mfile/src/projection.rs project() projects nesting as exactly the five bounds allowed, max_depth, types, providers and dynamic_providers from the spec's [nesting], and drops any other key of that table, in place of Json::of_toml of the whole table. Add a case to projection_is_the_6_3_2_field_set that shows an extra [nesting] key leaves the digest unchanged.
  • C6: Add a residual with a linked gominimal/minimal issue to the PR body for the client half of BOX-071, which this task's layers leave undone. crates/minimal/src/cmd/boxes/create.rs sends a v0 mfile::spec::BoxSpec and never calls Expansion::projection or BoxConfig::set_client_projection_digest. Its Layers never sets store_rules. The issue covers three edits: send the expanded spec, fill Layers::store_rules from read_client_config_and_store_rules, and set set_client_projection_digest(expansion.projection(&resolved).digest()) on the create.

Ruled at beeeae4 against gominimal/arch@15b603e6afb8 by claude-opus-5-5; arch_rulings 1230, job 52f8ae73-ac05-4dad-9dfc-5b1e0c64b21f.

0