8000 T15 — Read the type tables as box entries by minimal-foundry[bot] · Pull Request #3091 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T15 — Read the type tables as box entries - #3091

Merged
agent-137 merged 2 commits into
mainfrom
agent/2409-read-the-type-tables-as-box-entries
Nov 6, 2026
Merged

agent-137 merged 2 commits into
mainfrom
agent/2409-read-the-type-tables-as-box-entries

Conversation

@minimal-foundry
@minimal-foundry minimal-foundry Bot commented Nov 6, 2026 •
Copy link
Copy Markdown
Contributor

T15 — Read the type tables as box entries

slice: S4
kind: task
covers: BOX-007, BOX-046
size: M
est: 220 code, 180 tests
executor: agent
difficulty: routine
model: standard
diagnostics: error names entry and rule
observability: none: parsing emits only the error
layers:
- entries:
- crates/mfile/src/entry.rs (new): type tables as entries
- crates/mfile/src/lib.rs: mod line
- crates/mfile/src/error.rs: invalid-name error
test: cargo nextest run -p mfile self_as_name_is_exit3
test: cargo nextest run -p mfile type_noun_tables_are_boxes_sugar
test: cargo nextest run -p mfile entry_name_invalid_exit3_names_entry
produces:
- crates/mfile/src/entry.rs
consumes: none
proof: Type tables read as box entries; self is refused.
depends on:
- blocked by #2407

Proof

mfile::entry::read_entries reads [sessions.], [tasks.], [agents.] and [services.] as [boxes.] entries with type session, task, agent or service. An entry named self, a name that is not a lowercase DNS label, or a name used twice in the file fails with Error::InvalidEntryName. Its exit_code() is 3, and its message names the entry header, for example "entry [sessions.self] in minimal.toml: self is reserved and cannot name an entry. Rename the entry."

Notes from the agent: The new module is a library function only. No caller uses read_entries yet, so no command prints the new error today. A later task (the expander, T16 / #2410) must call it. mfile errors had no exit codes before this change. I added Error::exit_code() -> Option, which gives Some(3) for InvalidEntryName and None for every other variant. Callers must map it to the process exit. Design choices that the spec leaves open: (1) a sugar table sets its noun's type: it can repeat that type ([sessions.x] type = "session"), any other string type in it fails with exit 3 (EntryNameRule::TypeMismatch), and a type that is not a string fails with exit 3 in every table (EntryNameRule::TypeNotString). A custom type goes in [boxes.<name>]. (Corrected after round 2; the earlier wording said a custom type in a sugar table stays as written.) (2) A [boxes.] entry with no type reads with box_type None. Nothing refu 8000 ses it here. (3) [agents.] and [services.] entries are read and keep EntryTable::Agents / Services. The per-entry refusal is BOX-063, which this task does not cover. (4) DNS-safe means 1 to 63 of a-z, 0-9 and '-', with no hyphen first or last. Uppercase is refused. (5) For a duplicate, the error names the later entry and the earlier one, with tables read in the order boxes, sessions, tasks, agents, services. lib.rs also re-exports EntryNameRule beside Error, on the same line as the mod line. Nothing outside the layers changed.

Tests

line exit tail
cargo nextest run -p mfile self_as_name_is_exit3 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-0926... 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 client-config v0.0.1 (/wo
cargo nextest run -p mfile type_noun_tables_are_boxes_sugar 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-28da... Finished 'test' profile [unoptimized] target(s) in 0.37s ──────────── Nextest run ID 81db02f0-442c-4d7f-ba13-adb8c111d17b with nextest profile: default Starting 1 test across 1
cargo nextest run -p mfile entry_name_invalid_exit3_names_entry 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-e0e1... Finished 'test' profile [unoptimized] target(s) in 0.36s ──────────── Nextest run ID c249373d-fcda-4cc1-90aa-7842b5a519e3 with nextest profile: default Starting 1 test across 1

Verify

min task run agent-verify passed ([tasks.verify]).

Closes #2409

[sessions|tasks|agents|services.<name>] read as [boxes.<name>] with the
matching type (BOX-046). An entry name that is self, not DNS-safe, or
not unique in the file fails with exit 3 naming the entry (BOX-007).
@coderabbitai
coderabbitai Bot commented Nov 6, 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: a7f3ddb0-0310-4c5a-9a99-6ae4437a3507

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

@minimal-foundry
minimal-foundry Bot commented Nov 6, 2026 •
Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at f73d528d3679.

Address the comments on the diff.

Clobber: none: the diff only adds 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: CONDITIONS · 1 condition · the full ruling

The name rules for BOX-007 and BOX-046 conform, and mfile is the right owner. One deviation remains. read_entries keeps an explicit type key in a sugar table, so [sessions.x] type = "task" reads as a task. Line 1176 of architecture.md says [agents.reviewer] is exactly [boxes.reviewer] with type = "agent". C1 refuses a sugar type that is not the noun, with exit 3, and changes the test that pins rust-dev.

Ruled at 293255b against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/mfile/src/entry.rs Resolved
Comment thread crates/mfile/src/entry.rs Resolved
Comment thread crates/mfile/src/entry.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 — 1 finding, 1 inline.

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

Comment thread crates/mfile/src/entry.rs Resolved
A type-noun table sets its noun's type. A different type, or a type
that is not a string, now fails with exit 3 and names the entry.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p mfile self_as_name_is_exit3 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-07ba... 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 client-config v0.0.1 (/wo
cargo nextest run -p mfile type_noun_tables_are_boxes_sugar 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-9089... Finished 'test' profile [unoptimized] target(s) in 0.43s ──────────── Nextest run ID c8180855-d8d9-48c7-bba8-511287a3bab1 with nextest profile: default Starting 1 test across 1
cargo nextest run -p mfile entry_name_invalid_exit3_names_entry 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-9b47... Finished 'test' profile [unoptimized] target(s) in 0.31s ──────────── Nextest run ID f8ac06cc-ae94-41ec-a9ff-8914fc103cea with nextest profile: default Starting 1 test across 1

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — crates/mfile/src/entry.rs: read_entries now calls entry_type: a sugar table accepts only its noun's type, and any other string or a non-string type fails with InvalidEntryName (exit 3).
  • 👍 valid — crates/mfile/src/entry.rs: Module doc now says a sugar table sets its noun's type, any other type exits 3, and a non-string type exits 3 in every table.
  • 👍 valid — crates/mfile/src/entry.rs: Removed [sessions.custom] type = "rust-dev". Added cases: type = "task" and "rust-dev" in [sessions.x] exit 3, type = 5 exits 3 in every table, and type = "session" in [sessions.same] reads.
  • 👍 valid — crates/mfile/src/entry.rs: A non-string type now fails with exit 3 in every table, [boxes.*] included, with a message that names the entry and the type key.

minimal.toml type tables ([sessions.x], [tasks.x], [agents.x], [services.x]) read as [boxes.x] entries with the noun's type. An entry named self fails with exit 3 and names the entry. A sugar table with a different type, or any entry with a non-string type, now also fails with exit 3 and names the entry.

Notes from the agent: Revise round 1. Two new EntryNameRule variants (TypeNotString, TypeMismatch) carry the type refusals through Error::InvalidEntryName, as the review asked. That variant name now covers more than names. A rename is left for a later change. The arch review cites line 1176 of architecture.md, but docs/architecture.md has 251 lines on this branch. The fix follows BOX-046 ('with the matching type') instead.

@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: PASS · the full ruling

This head conforms. A sugar table now always carries its noun's type, as architecture.md line 1176 says: [agents.reviewer] is exactly [boxes.reviewer] with type = "agent". A different or non-string type fails with exit 3 and names the entry. The self, DNS-label and uniqueness rules from the earlier head stay as they were. Nothing calls read_entries yet. T16 (#2410) wires it to a command.

Ruled at f73d528 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

@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/mfile/src/entry.rs Resolved
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on the runtime's review findings: the coder changed nothing. This round changes no code. The design note from round 1 is out of date and this note replaces it. The rule for a type-noun table is now: the table sets the type of its noun. It can repeat that type, for example [sessions.x] type = "session". Any other string type in it, for example [sessions.x] type = "rust-dev" or type = "task", fails with exit 3 (EntryNameRule::TypeMismatch). A type that is not a string fails with exit 3 in every table (EntryNameRule::TypeNotString). A [boxes.] table keeps the string type it writes. A custom type therefore goes in [boxes.], not in a type-noun table. Round 2 (commit f73d528) made this change on the earlier review threads, which cite architecture.md line 1176. The module doc of crates/mfile/src/entry.rs and the test type_noun_tables_are_boxes_sugar already state and pin this rule. The later expander task must build on this rule.

Review threads the coder judged:

  • 👎 invalid — crates/mfile/src/entry.rs:178: The code is correct, and the PR note was out of date. Round 2 made the refusal on purpose, after the earlier threads cited architecture.md line 1176: a sugar table is exactly [boxes.] with its noun's type. The module doc and the test type_noun_tables_are_boxes_sugar state the same rule. A cust

@agent-137 agent-137 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.

Reviewed f73d528 against T15's plan block. Only the three planned files change (entry.rs new, error.rs, lib.rs). read_entries reads [boxes.*] and the four type-noun tables as box entries; self, non-DNS-safe names and duplicates fail with InvalidEntryName (exit 3, naming the entry by its header); a sugar table may repeat its noun's type, another string type fails with TypeMismatch and a non-string with TypeNotString (arch C1). The three planned tests are present (self_as_name_is_exit3, type_noun_tables_are_boxes_sugar, entry_name_invalid_exit3_names_entry). Each message states the problem and one fix. Arch PASS, required lanes green.

@agent-137
agent-137 added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit f0a3f01 Nov 6, 2026
36 checks passed
@agent-137
agent-137 deleted the agent/2409-read-the-type-tables-as-box-entries branch November 6, 2026 16:33
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.

T15 — Read the type tables as box entries

1 participant

0