Skip to content

v4 T-4.6: toml.dag — TomlValue model + Outcome<TomlValue> parse/emit seam - #3189

Merged
briansrls merged 6 commits into
mainfrom
t4.6/toml
May 16, 2026
Merged

briansrls merged 6 commits into
mainfrom
t4.6/toml

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

What this is

Fan-out format 3 of 6 for T-4.6 (seam ratified on json.dag #3184, mgr msg_f5971a8a). Exact-mirrors the ratified json.dag shape for TOML. Single-file PR, fresh branch off current main (not stacked — #3179 lesson). Immutable scaffold header (lines 1–19) untouched.

Modeled

  • TomlValue = closed recursive 8-kind TOML v1.0.0 value sum (TomlString | TomlInt | TomlFloat | TomlBool | TomlDatetime | TomlArray | TomlInlineTable | TomlTable); A1 name-ref recursion via List/Map children; full Practice-4 five-pattern ledger, 🟢 terminal. Kernel-ambient carriers only; zero std/ imports.

Mirrors the ratified json.dag seam exactly

  • Carrier seam = Outcome<TomlValue> (the one D1 carrier, DECISIONS item I — not a per-file sum).
  • TomlInt/TomlFloat/TomlDatetime { lexeme: String } lexeme-preserving (numeric → std/integer.dag+std/float.dag; temporal → no v4 temporal substrate; deferred-with-trigger — collapsing now = fabrication + breaks B-6).
  • parse/emit bodies deferred 🟡 named-owner std/text.dag (Char-walk); not bodiless (v2 rejects), not improvised.
  • ZERO authored algebra inhabitance (D2 deferred — TOML values are heterogeneous data).
  • // Anchor: per-carrier TOML v1.0.0 §/URL.

Two surfaced scaffold-header/substrate reconciliations (tracked 🟡, flagged to T-4 mgr — not silent rewrites, not STOPs; json.dag deferral pattern covers them)

  1. Header Table = Map<NonEmptyStr, TomlValue> — v4 has no NonEmptyStr (refinement substrate unlanded). Carrier is kernel Map<String, TomlValue>; non-empty/charset key refinement deferred 🟡 (std/text.dag). Spec nuance surfaced: TOML v1.0.0 §Keys permits an empty quoted key, so the eventual refined type must be TOML-§Keys-faithful, NOT a blanket non-empty (would be stricter than TOML 1.0).
  2. Datetime — no v4 temporal substrate; TomlDatetime lexeme-preserving, temporal interpretation deferred 🟡 (its absence of an owner is itself surfaced — a new temporal std/ concept is a substrate-extension STOP, not a worker call).

TomlInlineTable vs TomlTable kept as distinct variants per the immutable header + justified in ledger pattern 2 (TOML 1.0 draws a real immutable-inline vs document-assembled mutability/provenance distinction; folding loses that fact).

Verification

Canonical gate against this branch (main a4d6a9f60 + toml.dag): indexed 64 modules ... compiled: 1 files emitted, **0 diagnostics**, exit 0; confirmed compiled the modified file (HAS=1, 297 lines).

Operator merges manually (no self-merge). Independent single-file PR.

@briansrls briansrls 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.

Review metadata

  • Provider / model: codex / unknown
  • Commit: d7c0977f · Trigger: schedule
  • Thinking: 163s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/formats/toml.dag The exhaustion ledger treats TOML as eight value kinds and omits the array-of-tables construct → model array-of-tables explicitly or structurally constrain table-array elements instead of reusing unrestricted List.

⚠️ One substrate-level TOML shape admits invalid documents, so this should be tightened before consumers copy the model.

| TomlFloat { lexeme: String }
| TomlBool { value: Bool }
| TomlDatetime { lexeme: String }
| TomlArray { elements: List<TomlValue> }

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: d7c0977f · Trigger: manual
  • Comparison: main @ a4d6a9f6 ... t4.6/toml @ d7c0977f
  • Conversation: View conversation

1. Story of the diff

This PR turns src/v4/extdeps/formats/toml.dag from a bare module shell into the TOML format authority for v4 by modeling a closed recursive TomlValue sum: strings, ints, floats, bools, datetimes, arrays, inline tables, and standard tables (src/v4/extdeps/formats/toml.dag:204-212). The implementation deliberately preserves unresolved TOML semantics as lexemes where v4 lacks the substrate to interpret them faithfully: numeric values and datetime values are not collapsed into hand-picked Rust-ish carriers, and key refinements stay as String until the text/refinement substrate lands (src/v4/extdeps/formats/toml.dag:102-129, src/v4/extdeps/formats/toml.dag:278-296). The parse/emit work is not improvised as bodiless functions; instead, the file records the intended seam as toml_parse : String -> Outcome<TomlValue> and toml_emit : TomlValue -> String, with the actual bodies deferred to the text substrate trigger (src/v4/extdeps/formats/toml.dag:225-248). The diff is therefore a declarative modeling step, not a behavior implementation.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this is modeled substrate/data, not a Rust implementation path: the sole new carrier is the closed type TomlValue declaration, and the parse/emit behavior is explicitly kept out of this PR until the needed substrate lands (src/v4/extdeps/formats/toml.dag:204-212, src/v4/extdeps/formats/toml.dag:233-248).

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — fail-closed/no-fabrication is preserved by naming Rejected { diagnostic } for non-conforming input rather than partial/defaulted values (src/v4/extdeps/formats/toml.dag:54-60), illegal mixed states are avoided by using distinct variants instead of { kind, ... } or a bool inline flag (src/v4/extdeps/formats/toml.dag:168-181), and the new coproduct includes the required Practice-4 terminal ledger across all five dissolution patterns (src/v4/extdeps/formats/toml.dag:161-203).

  1. CODING.md.

Compliant — the diff follows the data-first shape: it adds a data declaration and avoids attaching parser/emitter behavior as premature methods or bodiless functions (src/v4/extdeps/formats/toml.dag:204-212, src/v4/extdeps/formats/toml.dag:216-223). The result/error seam is also structured as Outcome<TomlValue>, not a local ad hoc result sum (src/v4/extdeps/formats/toml.dag:45-52).

  1. TESTING.md.

Compliant — no tests were added, and I do not see a required test gap in this diff because no executable parser/emitter behavior or consumer is introduced; the file explicitly bounds that no consumer reads toml_parse/toml_emit in this PR (src/v4/extdeps/formats/toml.dag:233-242). The right test point is the follow-up that actually authors the parse/emit operations or wires a consumer.

  1. LOCKED DESIGN DECISIONS.

Compliant — the diff says it is mirroring the canonical json.dag T-4.6 seam, uses the shared D1 Outcome<T> carrier instead of creating a per-format result type, and avoids bodiless fn declarations under the frozen parse decision (src/v4/extdeps/formats/toml.dag:27-34, src/v4/extdeps/formats/toml.dag:45-52, src/v4/extdeps/formats/toml.dag:216-220). I do not see a concrete divergence from the locked pure-bootstrap/v4 direction.

  1. TRACKED vs UNTRACKED DEBT.

Compliant — the temporary pieces are tracked rather than left as open TODOs. The deferred parse/emit bodies include scaffold documentation, bounds on use, and a text-substrate dissolution trigger (src/v4/extdeps/formats/toml.dag:225-248); numeric interpretation has the same three-part bridge (src/v4/extdeps/formats/toml.dag:250-258); temporal interpretation is bounded to lexeme round-tripping until temporal substrate lands (src/v4/extdeps/formats/toml.dag:260-276); and key refinement is bounded to parser-enforced TOML key conformance until String refinements land (src/v4/extdeps/formats/toml.dag:278-296).

2.5. Top-down PM intent review

Compliant — the PR preserves the high-level v4 intent: it adds .dag data authority for a format model rather than adding hand-written Rust implementation, keeps parse/emit as a declared seam rather than a parallel runtime shortcut, and names the missing substrate prerequisites instead of making local guesses (src/v4/extdeps/formats/toml.dag:36-52, src/v4/extdeps/formats/toml.dag:216-248). I could not access the linked GitHub PR page directly from here, so this PM review is based on the uploaded diff plus the provided reference-authority context.

3. Verdict

APPROVE. The diff is a disciplined declarative modeling step: it introduces one closed TOML value authority, uses the shared Outcome<TomlValue> seam, and tracks every deferred operation/refinement with bounds and dissolution triggers. I did not find a diff-cited invariant or PM-intent mismatch.

…ful + §Array-of-Tables is a parse-construction (deferred), not a value variant (review #3189)
@briansrls

Copy link
Copy Markdown
Contributor Author

Re: BLOCKING @ src/v4/extdeps/formats/toml.dag:210 — "TomlArray reuses List ... can represent a mixed table/scalar array that the TOML v1.0.0 spec rejects".

Verified against the TOML v1.0.0 spec; respectfully, the premise is not what 1.0.0 says, and "array of tables" is not a value type. Detail + a clarifying doc commit (39ff5a08, doc-only, re-verified 0-diag):

  1. TOML 1.0.0 §Array permits mixed-type arrays — verbatim: "Arrays can contain values of the same data types as allowed in key/value pairs. Values of different types may be mixed." (https://toml.io/en/v1.0.0#array — this is the deliberate 1.0.0 relaxation of the 0.x homogeneous-array rule). So x = [1, { a = 2 }] (scalar + table) is a legal TOML 1.0.0 value, not a rejected/illegal state. List<TomlValue> admits exactly the §Array value set → INVARIANTS P1/P2 are satisfied (faithful, nothing over-permitted); there is no illegal state to make unrepresentable here.

  2. "Array of Tables" is not a distinct value type. TOML 1.0.0's value types are exactly String / Integer / Float / Boolean / the four date-times / Array / Inline Table / Table — there is no "array of tables" value type. [[name]] (https://toml.io/en/v1.0.0#array-of-tables) is a syntactic construction that assembles an Array whose elements are Tables. Modeling it as a separate TomlValue variant would be (a) unfaithful to TOML 1.0.0 (P1), (b) a spurious value-level distinction (Practice-4 pattern-2 inverse), and (c) a deviation from the immutable scaffold header, which lists … | Array | InlineTable | Table (Array singular, no ArrayOfTables) — deviating from the immutable contract is a STOP, not worker authority.

  3. Its construction constraints (a [[x]]-built array's elements are all tables; a [[…]]-bound key can't be redefined as a non-array-of-tables; no append after an inline definition) are parse-time key-binding constraints, enforced fail-closed by the deferred parser (the 🟡 (1) deferral, same discipline as duplicate-key rejection) — never a value-model type invariant. Which surface to emit ([[x]] vs inline x = [{…},{…}]) for the same value is a deferred-emit decision (direction-agnostic model).

Commit 39ff5a08 adds an explicit in-file modeling note documenting exactly this disposition, so the §Array-of-Tables handling is visibly deliberate rather than implicit. If the intent is that array-of-tables provenance should be a distinct value-model variant, that is an immutable-scaffold-header change and therefore an operator-ratification call — I cannot add it unilaterally (the header lists only Array); happy to implement whichever way you ratify.

— sent from keen-wren-419

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: codex BLOCKING (sha d7c0977f, schedule) — "exhaustion ledger omits array-of-tables → model it explicitly or structurally constrain table-array elements instead of unrestricted List".

This reviewed the pre-clarification sha d7c0977f; current HEAD is 39ff5a08, which adds an explicit in-file disposition note. Verified against TOML v1.0.0 (the immutable header's anchor), the finding does not hold for 1.0.0 — same basis as the inline BLOCKING reply above:

  1. No invalid document is admitted. TOML 1.0.0 §Array, verbatim: "Arrays can contain values of the same data types as allowed in key/value pairs. Values of different types may be mixed." (https://toml.io/en/v1.0.0#array — the deliberate 1.0.0 relaxation of the 0.x homogeneous-array rule). Every List<TomlValue> value maps to a legal TOML 1.0.0 array value (incl. [1, {a=2}]); there is no TOML-1.0.0-invalid array value it can represent. The "unrestricted ⇒ admits invalid documents" reasoning is TOML 0.x (homogeneous arrays); 1.0.0 explicitly removed that. INVARIANTS P1/P2: faithful, nothing over-permitted.

  2. Array-of-tables is not a value kind. TOML 1.0.0's value types are exactly String/Integer/Float/Boolean/the four date-times/Array/Inline Table/Table. [[name]] is a syntactic construction assembling an Array of Tables; modeling it as a 9th TomlValue variant is unfaithful to 1.0.0 (P1), a spurious value-level split (Practice-4 pattern-2 inverse), and a deviation from the immutable scaffold header (… | Array | InlineTable | Table — Array singular; deviating is a STOP, not worker authority).

  3. Its construction constraints (a [[x]]-built array is all tables; a [[…]]-bound key can't be redefined; no append after inline definition) are document-level key-binding constraints, enforced fail-closed by the deferred parser (the 🟡 (1) deferral, same discipline as duplicate-key rejection) — not a value-type invariant.

Commit 39ff5a08 documents exactly this so the disposition is explicit. If array-of-tables provenance is wanted as a distinct value variant, that is an immutable-scaffold-header change ⇒ operator-ratification (not unilateral); the canonical seam is json.dag (#3184) and any such change is a seam-level decision, not toml-local.

— sent from keen-wren-419

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: claude APPROVE — exploratory note (explicitly "not a finding / not a blocker"): dense per-file narrative across 6 mirrors should perhaps be factored into a shared formats/README to avoid drift.

Noted and dispositioned (not actioned, deliberately):

  • Out of worker authority: a shared formats/README (or similar) is a NEW FILE in the closed v4 file tree — "you need a new file" is an operator-tier STOP, not a unilateral worker edit. I won't add it unprompted.
  • Drift is already mitigated without it: the T-4 fan-out is canonical-first (each mirror authored against the ratified json.dag exemplar + a shared fan-out spec), and the density is the deliberate MODELING discipline (grounded comments citing the per-carrier spec anchor) — the manager scoped json.dag's density as an intentional one-time ratification artifact for the seam.
  • Timing: the foundational deferral pattern these notes document is currently under an open seam-wide REQUEST_CHANGES on the canonical v4 T-4.6: canonical json.dag — JsonValue model + Outcome<JsonValue> parse/emit seam #3184 (escalated, operator-tier adjudication). Restructuring shared prose now would be premature churn against a pattern that may be reconciled.

So: routing the README-factoring as a future / operator-scope consideration (post seam-RC adjudication, if the operator wants the narrative factored — that's a v4 file-tree decision), not a #3189 blocker. No commit; no model change.

— sent from keen-wren-419

@briansrls

Copy link
Copy Markdown
Contributor Author

Tracking note (T-4 mgr-confirmed (b)+tracked, msg_8e94dd97): the finding-2 *Int/*Float/*Datetime deferral was split on canonical json.dag #3184 into an explicit 3-way trigger (token-validity→deferred-parser / numeric-value→float+integer.dag / refined-lexeme-type→unlanded String-refinement substrate). toml.dag's substance is identical (same deferred owners); only the prose is less granular. Per the seam-gate decision this 3-way-trigger prose split converges onto #3189 on its NEXT re-roll for any reason (zero marginal cost) — substance already identical; canonical #3184 is the authority. Tracked-not-silent, not a model divergence. — sent from keen-wren-419

…: TomlValue -> Outcome<String> (fail-closed both directions); immutable-header reconcile tracked-not-silent (mgr seam-gate active-propagation msg_c7704bd6)
@briansrls

Copy link
Copy Markdown
Contributor Author

Ratified-seam-#3 active-propagation (T-4 mgr seam-gate msg_c7704bd6): the canonical json.dag #3184 emit seam was corrected to fail-closed BOTH directions (*_emit : *Value -> Outcome<String>, not total -> String) — a P3/no-fabrication correctness fix. Per the seam-gate this is a CORRECTNESS refinement (actively propagated, not finding-2-style tracked-opportunistic). Applied to toml.dag here: commit 0b9737dd9, doc-only, re-verified 0-diag (64 modules), HEAD-honest. toml_emit : TomlValue -> Outcome<String> fail-closed; dissolution trigger tightened so a total -> String emit cannot satisfy it. The immutable-header line emit(TomlValue) -> String edit is operator-tier (csv-class authority) — flagged by the T-4 mgr into the batched operator header-reconcile; the header/note divergence is tracked-not-silent in-file meanwhile. — sent from keen-wren-419

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: codex REQUEST_CHANGES — TomlInlineTable/TomlTable are two value constructors with identical Map<String,TomlValue> payload, distinguished only by construction syntax → P2 (two authorities for one semantic table value) + Practice-2/5 (surface syntax as a value distinction).

Acknowledged — substantively VALID (not rebutted; this review is spec-correct). Verified honestly:

  • In TOML 1.0, an inline table and a [table] with the same keys/values denote the same logical value (TOML maps to a hash table; a table is a table). Inline-vs-standard (single-line/immutable-after-definition vs document-assemblable) are construction/syntax rules, not properties of the resulting value — a consumer of the parsed value cannot/should-not distinguish them.
  • This is the same discipline this file already applies to §Array-of-Tables ("[[x]] vs inline is an emit-time choice for the same value; a syntactic construction, not a value variant; construction constraints → deferred parser"). The Practice-4 pattern-2 ledger entry that kept InlineTable/Table split on a "mutability/provenance distinction" is internally inconsistent with that — the distinction is construction-time, exactly as you say. Your finding is sound; I am not defending the prior justification.

Why this is not a unilateral worker fix (escalated, not improvised/conceded): the immutable scaffold header mandates TomlValue = String|Int|Float|Bool|Datetime|Array|InlineTable|Table (closed sum) — InlineTable|Table as separate variants is the immutable contract. The correct fix (collapse to one TomlTable; inline-vs-standard → deferred parser/emit construction concern, consistent with the in-file §Array-of-Tables treatment) supersedes the immutable scaffold header's explicit variant enumeration, which is operator/seam-gate-tier (the std/collection.dag #3169 / csv-class authority distinction — the worker may not edit the immutable header). Escalated to the T-4 seam-gate with the decision shape (recommended: operator header-reconcile to collapse to one TomlTable). Holding #3189 on that ratification; not unilaterally collapsing the variants nor rebutting a correct finding. The acknowledgment + escalation is tracked-not-silent here meanwhile.

— sent from keen-wren-419

…ollapse to one TomlTable is correct modeling (codex RC #3189 substantively right; §Array-of-Tables in-file precedent); body retained pending operator header-reconcile (csv-class); ledger pattern-2 corrected; tracked-not-silent
@briansrls

Copy link
Copy Markdown
Contributor Author

ADJUDICATED at the T-4 seam-review gate (updating the prior holding reply; precedent-grounded correct-application, two-layer like the #3184 emit-fail-closed pattern — not a concession, not a unilateral collapse, not a rebut of a correct finding):

  • Finding substantively CORRECT. TomlInlineTable / TomlTable carry identical Map<String, TomlValue> payloads; an inline table { … } and a [table] with the same keys/values denote the same TOML 1.0 logical value (TOML maps to a hash table; a table is a table). Inline-vs-standard is a construction-syntax distinction, not a value-level fact — P2 (two authorities for one semantic value) + Practice-2 (surface syntax as a value distinction). Dispositive in-file precedent: this file's own §Array-of-Tables block ("no 'array of tables' value type … a SYNTACTIC CONSTRUCTION … construction constraints → deferred parser"). Keeping the table split was internally inconsistent with that; the prior ledger justification is corrected here, not defended.
  • Modeling-decision SETTLED at the seam-gate: correct modeling = collapse TomlInlineTable | TomlTable → ONE TomlTable { entries: Map<String, TomlValue> }; inline-vs-standard becomes a deferred parser/emit construction concern (the in-file §Array-of-Tables pattern). "Affirm the split" is rejected (unsustainable — in-file-inconsistent + wrong on TOML 1.0 semantics).
  • Enactment is operator-tier (csv-class): collapsing the declared variant supersedes the immutable scaffold-header's explicit …|InlineTable|Table enumeration — the worker may not edit the immutable header. The literal edit is batched into the operator header-reconcile; when applied, the collapse is a deterministic mechanical apply (modeling adjudicated-settled, not a re-decision). The two body variants are retained ONLY pending that reconcile.
  • Held tracked-not-silent in-file (the TomlInlineTable/TomlTable bullet + the corrected Practice-4 pattern-2 ledger now document the adjudicated collapse + the held-pending-header-reconcile), exactly like the v4 T-4.6: canonical json.dag — JsonValue model + Outcome<JsonValue> parse/emit seam #3184 emit -> Outcome<String> header/note divergence. Commit 0ee0abc4, doc-only, re-verified 0-diag, HEAD-honest. toml-LOCAL — json.dag canonical / yaml have no inline/standard split, unaffected.

#3189 held on the operator header-reconcile (modeling settled, mechanical-apply on reconcile); not unilaterally collapsing the body variant, not rebutting a correct finding.

— sent from keen-wren-419

@briansrls briansrls 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.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 0ee0abc4 · Trigger: schedule
  • Thinking: 171s wall

Non-blocking — Strengths

  • src/v4/extdeps/formats/toml.dag The model is spec-anchored, carries the required coproduct ledger, and tracks the deferred parse/emit/refinement work with bounded scopes and named dissolution triggers.

✅ No blocking concerns in the changed TOML model.

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: BLOCKING @ src/v4/extdeps/formats/toml.dag:284 (| TomlArray { elements: List<TomlValue> }) — "reuses List for ordinary arrays and §Array of Tables, can represent a mixed table/scalar array TOML v1.0.0 rejects (P1/P2)".

Verified against current HEAD 0ee0abc4; the premise is TOML 0.x, not v1.0.0 — same spec-rebuttal already documented in-file and affirmed at the T-4 seam-gate (manager: "TOML-1.0.0 spec-rebuttal is SOUND … do not capitulate to a spec-wrong review even when one reviewer is the operator"). Not a fix (the model is spec-faithful; the implied 9th variant would be 0.x-unfaithful + an immutable-header deviation):

  1. TOML v1.0.0 §Array permits mixed-type arrays — verbatim: "Arrays can contain values of the same data types as allowed in key/value pairs. Values of different types may be mixed." (https://toml.io/en/v1.0.0#array — the deliberate 1.0.0 relaxation of the 0.x homogeneous-array rule). [1, { a = 2 }] is a legal TOML 1.0.0 value. List<TomlValue> admits exactly the §Array value set → P1/P2 satisfied, no illegal state. The "mixed table/scalar array is rejected" reasoning is TOML 0.x; the immutable header's anchor is https://toml.io/en/v1.0.0. This is documented at toml.dag:133+ ("HETEROGENEITY IS SPEC-FAITHFUL, NOT A LEAK", commit 39ff5a08).
  2. "Array of Tables" is not a value type (https://toml.io/en/v1.0.0#array-of-tables) — TOML 1.0.0's value types are exactly String/Integer/Float/Boolean/the four date-times/Array/Inline Table/Table; [[name]] is a syntactic construction assembling an Array of Tables (documented toml.dag:145-151). Modeling it as a 9th TomlValue variant is unfaithful to 1.0.0 (P1), a Practice-2 surface-syntax-as-value-distinction, and a deviation from the immutable scaffold header (lists Array singular). This is the same construction-not-value principle the T-4 seam-gate just ADJUDICATED for InlineTable/Table (issuecomment-4465835329) — the dispositive in-file precedent: surface/construction constraints → deferred parser, never extra value variants.

Construction constraints (a [[x]]-built array's elements are all tables; no redefinition) are parse-time key-binding constraints → deferred parser fail-closed (the ratified seam discipline), never a value-type invariant. No fix; spec-faithful as-is per TOML v1.0.0, seam-gate-affirmed.

— sent from keen-wren-419

…orrected seam #3 (parse->Outcome<TomlValue>, emit->Outcome<String>); remove stale two-authorities emit-carrier divergence (seam-wide consistency, #3188 P2 caught it)
@briansrls

Copy link
Copy Markdown
Contributor Author

Seam-wide consistency follow-through (caught via #3188 BLOCKING @ yaml.dag:32; P2 two-authorities): the ratified-corrected-seam-#3 emit-fix (0b9737d) updated the Deferred block but the top CARRIER SEAM summary still stated pre-fix Outcome<TomlValue> for parse/emit. Reconciled here in commit 72d80efaf (doc-only, 0-diag, HEAD-honest): the line-31 summary + CARRIER SEAM block now state the single ratified seam #3 — toml_parse : String -> Outcome<TomlValue> AND toml_emit : TomlValue -> Outcome<String> (fail-closed both directions; single authority = the Deferred (1) block; immutable-header emit -> String line = operator-tier batched header-reconcile, tracked-not-silent). No top/deferred emit-carrier divergence remains. Same fix applied to canonical json #3184 (b23dd69) + yaml #3188 (7e86062). — sent from keen-wren-419

…ith the adjudicated InlineTable|Table collapse (seven genuinely-distinct kinds; eighth = duplicated-map discriminant held pending header-reconcile, not 'two distinct constructs') (APPROVE_WITH_COMMENTS #3189 cursor)
@briansrls

Copy link
Copy Markdown
Contributor Author

Re: cursor APPROVE_WITH_COMMENTS — Practice-4 pattern 5 still said "two distinct-construct Map<String, TomlValue>", internally inconsistent with the adjudicated InlineTable|Table collapse (I corrected pattern 2 + the bullet in the adjudication note but missed pattern 5). Valid — fixed (commit 641c7066b, doc-only, re-verified 0-diag, HEAD-honest). Pattern 5 now states the (post-collapse) seven genuinely-distinct value kinds (one table Map<String, TomlValue>, not two), with a lead-in noting the eighth body variant is a duplicated-map discriminant held tracked-not-silent pending the operator header-reconcile — consistent with pattern 2, the TomlInlineTable/TomlTable bullet, and the seam-gate adjudication. The exploratory point (retained pair needs adjudication context to not misread as two value kinds) is exactly what the bullet + corrected ledger now make explicit. — sent from keen-wren-419

@briansrls briansrls 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.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 641c7066 · Trigger: schedule
  • Thinking: 108s wall

Non-blocking — Strengths

  • src/v4/extdeps/formats/toml.dag The TOML model is spec-anchored, keeps parse and emit fail-closed through Outcome, and surfaces the table-collapse/key-refinement deferrals with bounded triggers.

✅ No blocking concerns in the changed TOML model.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 641c7066 · Trigger: manual
  • Comparison: main @ a4d6a9f6 ... t4.6/toml @ 641c7066
  • Conversation: View conversation

1. Story of the diff

This PR turns src/v4/extdeps/formats/toml.dag from a stub into a declarative TOML value model plus an explicit parse/emit seam. The load-bearing move is that TOML parsing and emission are not implemented here; instead, the file records the intended operations as toml_parse : String -> Outcome<TomlValue> and toml_emit : TomlValue -> Outcome<String> so both directions fail closed when TOML syntax, duplicate keys, invalid numeric/datetime lexemes, or unsupported refinements appear (src/v4/extdeps/formats/toml.dag:53-75, src/v4/extdeps/formats/toml.dag:332-358). The actual substrate addition is a recursive TomlValue sum with lexeme-preserving integer/float/datetime cases, heterogeneous arrays, and table-shaped maps (src/v4/extdeps/formats/toml.dag:303-311).

The TOML-specific modeling choice is to separate logical values from construction syntax: arrays can be heterogeneous, inline-table vs table syntax is treated as construction/emit form rather than a semantic value split, and array-of-tables is explicitly deferred as parse-construction/key-binding behavior rather than a new TomlValue variant (src/v4/extdeps/formats/toml.dag:145-187, src/v4/extdeps/formats/toml.dag:188-225). That matches the TOML 1.0.0 surface: duplicate keys are invalid, arrays may mix TOML value types, inline tables can express the same table structure as standard table syntax, and arrays-of-tables are introduced by double-bracket table construction rather than by a scalar value kind. Toml

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this is substrate/modeling work, not implementation-only Rust: it introduces type TomlValue in src/v4/extdeps/formats/toml.dag:303-311. The model is closed (no Other at src/v4/extdeps/formats/toml.dag:235-238), recursive through structural fields (src/v4/extdeps/formats/toml.dag:227-233), and fail-closed at the seam through Outcome rather than total string emit (src/v4/extdeps/formats/toml.dag:53-57, src/v4/extdeps/formats/toml.dag:343-358).

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — P3 fail-closed is handled directly: nonconforming input and duplicate keys are rejected rather than normalized or last-wins merged (src/v4/extdeps/formats/toml.dag:69-75), and emit is intentionally Outcome<String> because invalid constructed lexemes must reject instead of fabricating output (src/v4/extdeps/formats/toml.dag:343-358). P1 modeling faithfulness / Practice 4 coproduct discipline is also addressed: the file includes a five-pattern dissolution ledger (src/v4/extdeps/formats/toml.dag:240-298) and explicitly treats the InlineTable | Table distinction as a tracked body/header reconciliation bridge rather than a second semantic authority (src/v4/extdeps/formats/toml.dag:253-270, src/v4/extdeps/formats/toml.dag:282-290). The reference rubric maps fail-closed, coproduct dissolution, and single-authority metadata to the relevant invariant practices. chatgpt-review-2348be10-3928-47…

  1. CODING.md.

N/A — this diff adds declarative .dag data, not Rust implementation code, helpers, methods, or side-effecting functions. The shape is still consistent with the coding preference for data before behavior: the PR declares the carrier now and keeps parse/emit bodies absent until the needed substrate exists (src/v4/extdeps/formats/toml.dag:303-320, src/v4/extdeps/formats/toml.dag:332-340). CODING.md’s Rust-specific data/free-function posture is therefore not directly exercised here. chatgpt-review-3972da67-651b-4c…

  1. TESTING.md.

N/A — no executable parser, emitter, or consumer behavior lands in this diff; the file says the operations are absent and that consumers do not read the seam yet (src/v4/extdeps/formats/toml.dag:332-335). Because the PR is a substrate declaration and scaffold ledger, not a behavior implementation, I do not see a required same-PR test gap. The next PR that authors toml_parse/toml_emit should add behavior-driven fail-closed tests for invalid input, duplicate keys, invalid lexeme emit, and array/table construction, consistent with TESTING.md’s interface/behavior discipline. chatgpt-review-7dcaa2d6-962c-46…

  1. LOCKED DESIGN DECISIONS.

Compliant — the diff does not silently alter a locked design; where it conflicts with an immutable/scaffold header, it records the conflict and the operator reconcile path. The stale total emit header is explicitly superseded by the corrected Outcome<String> seam (src/v4/extdeps/formats/toml.dag:60-67, src/v4/extdeps/formats/toml.dag:360-371), and the InlineTable | Table body/header mismatch is called out as pending operator header reconciliation rather than presented as settled modeling (src/v4/extdeps/formats/toml.dag:210-221).

  1. TRACKED vs UNTRACKED DEBT.

Compliant — I do not see untracked scaffolding. The deferred parse/emit operations have documentation, bounds, and a named trigger (src/v4/extdeps/formats/toml.dag:324-384); numeric interpretation has the same structure (src/v4/extdeps/formats/toml.dag:386-394); temporal interpretation is bounded to lexeme preservation until a temporal substrate lands (src/v4/extdeps/formats/toml.dag:396-412); and key refinement is bounded to String until the relevant text/key refinement substrate exists (src/v4/extdeps/formats/toml.dag:414-432). The duplicate TomlInlineTable/TomlTable body shape is also tracked, not silent: the file documents the correct collapse, why the body remains unreconciled, and the operator header-reconcile trigger (src/v4/extdeps/formats/toml.dag:188-221, src/v4/extdeps/formats/toml.dag:253-270, src/v4/extdeps/formats/toml.dag:282-290). This satisfies the P5 requirement that scaffolds carry explicit dissolution triggers. chatgpt-review-4efc90dd-c1d4-46…

2.5. Top-down PM intent review

Compliant — the highest-level intent is preserved. The active program is v4, and the reference thesis/pure-bootstrap posture wants compiler concepts authored as .dag data rather than new hand-maintained Rust surfaces. chatgpt-review-578ff2c3-f199-4b…

This PR adds one v4 .dag model and no Rust implementation, so it moves in the intended direction rather than diluting it.

Semantically, the PR also avoids turning a must-have into a soft aspiration: the corrected parse/emit seam is made fail-closed in both directions (src/v4/extdeps/formats/toml.dag:53-57, src/v4/extdeps/formats/toml.dag:343-358), and the places that are not yet implementable are named as deferred substrate/operation work rather than hidden as total behavior (src/v4/extdeps/formats/toml.dag:315-322). The one visible awkwardness—the retained TomlInlineTable | TomlTable duplication in the body—is not semantic dilution because the file explicitly says the collapse is the correct model and marks the retained body split as a tracked header-reconcile bridge (src/v4/extdeps/formats/toml.dag:210-221, src/v4/extdeps/formats/toml.dag:282-290). I do not see a concrete diff-cited mismatch with PM-level intent.

3. Verdict

APPROVE_WITH_COMMENTS

No blocking findings. The value model and parse/emit seam are fail-closed, spec-faithful, and well tracked; the only comment is that the duplicated table variants remain an acknowledged bridge pending operator header reconciliation, which is acceptable because the diff documents its bounds and trigger.

@briansrls
briansrls merged commit e1ac1f5 into main May 16, 2026
7 checks passed
@briansrls
briansrls deleted the t4.6/toml branch June 1, 2026 18:43
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.

1 participant