Repository navigation
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.rssecret_grants()builds each grant from the §6.3.2 key set only, not from the entry's own keys. Write the[secrets]entry name asenv, and do not writenameorvalue. A brokered (github:*or audience) grant carriesenv,scopesandmode(when set or filled), and nosource. Asource = "store"reference carriesenv,source,store,id,upstreamas a list of authorities, andinject. Updateprojection_is_the_6_3_2_field_setandexpansion_fills_token_mode_quic443_steering_before_digest(which looks up grants byname) to assert this exact key set. - C2:
crates/mfile/src/expand.rswrite_store_authorities()writesupstreamas an array of the rule's authorities (upstream = ["registry.npmjs.org"]), not as the table{ hosts = [...] }. Change the fixturestore_secret()incrates/minimald/src/box_manager/tests.rsto the same shape, and changestore_reference_upstream_and_inject_written_into_specto assert it. - C3:
crates/mfile/src/expand.rsexpand()refuses, with anErrorthat the client reports as exit 3 and that names the secret and the key, anysource = "store"entry for which a layer setsupstreamorinject. Run this check beforewrite_store_authorities(), and remove thegrant.remove("upstream")/grant.remove("inject")drop fromwrite_store_authorities(). Change theSTORE_FILEcase instore_reference_upstream_and_inject_written_into_specto expect the refusal. - C4:
crates/mfile/src/projection.rsingress_ports()projects each admitted port as its port number ([8080]), not as a{ port, proto }object. Updateprojection_is_the_6_3_2_field_setto assert the list of integers. - C5:
crates/mfile/src/projection.rsproject()projectsnestingas exactly the five boundsallowed,max_depth,types,providersanddynamic_providersfrom the spec's[nesting], and drops any other key of that table, in place ofJson::of_tomlof the whole table. Add a case toprojection_is_the_6_3_2_field_setthat 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.rssends a v0mfile::spec::BoxSpecand never callsExpansion::projectionorBoxConfig::set_client_projection_digest. ItsLayersnever setsstore_rules. The issue covers three edits: send the expanded spec, fillLayers::store_rulesfromread_client_config_and_store_rules, and setset_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.