Repository navigation
T47 — Give a project with no session entry an implicit default - #3103
Conversation
When no entry has the session type or a type rooted at session, and no entry is named default, implicit_default_entry gives an empty-bodied [sessions.default] entry. Its expansion comes from the other layers, and the expansion report marks it implicit (BOX-165, BOX-161).
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: no findings at Nothing to do. Clobber: none seen in the diff. Security The change adds a pure function and a bool field. It has no I/O, parsing of new input, auth path or secret. No caller uses it yet. Not checked: build and tests. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The implicit default entry conforms to architecture.md line 1178. The blocking rule, the empty body and the implicit mark are correct. The expanded spec of the implicit entry has no type key. box.toml line 27 and architecture.md line 1240 put type in every spec and projection. The PR body defers this to a later task with no issue. The design does not say which layer sets type here, so this ruling escalates that question. Do C1: name the deferral as a residual that links the arch issue.
Ruled at 5384989 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
agent-137
left a comment
There was a problem hiding this comment.
Reviewed against T47's plan block. Only the two planned files change. implicit_default_entry gives an implicit [sessions.default] only when no entry has the session type, directly or through its built-in root, and no entry is named default (BOX-165); ExpansionReport.implicit marks it outside the spec bytes (BOX-161). The three planned tests are present and cover each blocking case. The spec's missing type is a recorded residual on gominimal/arch#170, per arch C1; the caller must refuse an unknown type before trusting this function (BCLI-071).
T47 — Give a project with no session entry an implicit default
slice: S4
kind: task
covers: BOX-165, BOX-161
size: M
est: 140 code, 180 tests
executor: agent
difficulty: routine
model: standard
diagnostics: report marks entry implicit
observability: none: a pure function with a report
layers:
- default-entry:
- crates/mfile/src/entry.rs: implicit default entry
- crates/mfile/src/expand.rs: expands, marks implicit
test: cargo nextest run -p mfile no_session_entry_expands_implicit_default_session
test: cargo nextest run -p mfile non_session_default_entry_blocks_implicit_default
test: cargo nextest run -p mfile implicit_default_entry_reported_as_implicit
produces: none
consumes:
- crates/mfile/src/expand.rs
- crates/mfile/src/entry.rs
proof: A project without a session entry starts a default session.
depends on:
- blocked by #2410
- blocked by #2409
Proof
A project with no session entry, or with no minimal.toml at all, now gets an implicit [sessions.default] entry from mfile::entry::implicit_default_entry. It expands from the project's [upstream], type defaults, [defaults] and [defaults.session] layers, and its expansion report has implicit = true. No caller uses it yet, so no CLI command starts that default session on this branch.
Notes from the agent: API: implicit_default_entry(entries, builtin_root) takes a closure that gives a type's built-in root, because mfile has no type-chain resolution. A built-in type is its own root. BoxEntry gets a new field
implicit: bool, and ExpansionReport getsimplicit: bool. The expander sets the second from the first. The implicit entry has an empty body, so its expanded spec has notypekey. Atypekey needs an Entry-layer origin, and BOX-165 says the entry has no entry layer of its own. The entry's box_type is still Some("session"). See Residuals below for the spec's missingtype. The proof is true at the library level only. The CLI still needs a caller that uses this entry when no entry is named.Tests
cargo nextest run -p mfile no_session_entry_expands_implicit_default_sessioncargo nextest run -p mfile non_session_default_entry_blocks_implicit_defaultcargo nextest run -p mfile implicit_default_entry_reported_as_implicitVerify
min task run agent-verifypassed ([tasks.verify]).Residuals
typekey (the test atcrates/mfile/src/expand.rs:1344pins an empty spec for a missing file). Which BOX-064 layer setstype = "session"for an implicit[sessions.default]is a design question: https://github.com/gominimal/arch/issues/170 (arch ruling 1026, C1). No code change until the layer is decided.Closes #2412