Skip to content

docs(evaluator): R3 E7 witness construction readiness / blocker audit - #1452

Merged
briansrls merged 12 commits into
mainfrom
session/merry-heron-351-pr-e-e7-witness
May 2, 2026
Merged

briansrls merged 12 commits into
mainfrom
session/merry-heron-351-pr-e-e7-witness

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

Per Director dispatch: docs-only readiness/blocker audit for PR-E E7 (witness construction surface). Full E7 execution is gated on E5 (Loop) since lens fold over recursive .dag programs traverses Loop nodes and evaluate_body currently fail-closes UnsupportedBehavior on Loop. This PR lands the API contract + acceptance tests for the first post-E5 implementation slice.

Brief contents

docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md:

  • State at HEAD — Witness<C> / DimensionReport<C> already mirrored in dimension.rs:46-69; analyze_symbolic_cost_dimension is the Q6.5 precedent E7 generalizes; no Witness-from-Value bridge today; E5 / E6 still return UnsupportedBehavior.
  • Hard prerequisite — E5 lands eval_loop over LoopBound::Cardinality; Descent stays fail-closed residual.
  • API shape — three layered functions: witness_for_behavior (per-behavior bridge via LensRunnerView<C> trait), analyze_with_evaluator (per-program fold), per-lens public entrypoints analyze_complexity / analyze_tenant_flow / analyze_ifc returning DimensionReport<C>.
  • Acceptance — six tests: complexity / tenant-flow / IFC outcomes, typed-diagnostic discipline (no string parsing of Witness.reason), fail-closed propagation including Loop::Descent residual and EvalError propagation, no bridge fabrication.
  • STOP+PING boundary — no new Witness / DimensionReport variant, no string parsing, no lens-local diagnostic kind without Q6.5 routing, no E5 expansion, no Bool-as-Disj bridge.

Constraints upheld

  • Docs-only; no Rust, no substrate, no fixtures.
  • No E5 (Loop) implementation.
  • No Bool-as-Disj bridge.
  • No new substrate carriers.

Cross-references

Test plan

  • Docs-only; CI fmt unaffected.
  • Reviewer confirms the API contract is sufficient for E7 to be a small follow-on once E5 lands.

🤖 Generated with Claude Code

Records the exact prerequisites E7 (witness construction surface)
needs from E5 (Loop), names the API shape the first executable
post-E5 slice will fill, and locks fail-closed boundaries E7
implementation must respect.

State at HEAD:
- Witness / DimensionReport / AnalysisDimension exist in dimensions.dag
  and are mirrored in dimension.rs at lines 46-69.
- analyze_symbolic_cost_dimension is the Q6.5 lens-instance precedent
  E7 generalizes (walks behavior_spine_in_node_order, not the body
  evaluator).
- Body evaluator covers E1 (Value), E3 (Transform), E4 (Branch); E5
  (Loop) and E6 (Bind) return UnsupportedBehavior.
- No Witness-from-Value bridge exists today.

E7 scope (post-E5):
1. witness_for_behavior — bridges single-behavior eval result to
   Witness<C> via per-dimension LensRunnerView<C> trait.
2. analyze_with_evaluator — composes per-behavior witnesses across
   workflow spine, mirrors analyze_symbolic_cost_dimension structure
   but consumes evaluate_body.
3. Per-lens public entrypoints: analyze_complexity / analyze_tenant_flow
   / analyze_ifc returning DimensionReport<C>.

Acceptance tests for first executable slice: complexity / tenant-flow
/ IFC outcomes, typed-diagnostic discipline (no string parsing of
Witness.reason), fail-closed propagation including Loop::Descent
residual and EvalError propagation.

STOP+PING boundary: no new Witness/DimensionReport variant, no
string parsing, no lens-local diagnostic kind without Q6.5 routing,
no E5 (Loop) expansion, no Bool-as-Disj bridge.

Docs-only; no Rust, no substrate, no fixtures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Manager pass: scope is correct for the E7 dispatch. This is docs-only, explicitly gates executable witness construction on E5 Loop coverage, and names the API/test surface without adding Rust, substrate carriers, fixtures, Bool-as-Disj bridge work, or new Witness/DimensionReport shapes.\n\nNo manager-blocking changes requested. Hold for CI / scheduled reviews.\n\n— sent from snappy-moth-795

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 2d798628 · Trigger: schedule
  • Comparison: origin/main @ 0b77e895 ... review/pr-1452-2d798628 @ 2d798628
  • Thinking: 48s wall

Verdict: APPROVE

This is a docs-only audit with no Rust, substrate, or fixture changes. I found no concrete violations of the pinned invariants: the doc clearly marks E5 as a hard prerequisite, names fail-closed behavior, rejects string-parsed diagnostics, and bounds the remaining scaffold/stand-in work to the first E7 implementation slice. No builds or tests run, per instruction.

@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: 2d798628 · Trigger: schedule
  • Thinking: 191s wall

BLOCKING (3)

Root Cause

  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md The audit depends on a dispatch brief that was omitted or misnamed → include that authority, correct the link to an existing file, or inline the specific locked decisions this audit needs.
  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md The audit appears to import evaluator-stack state from an unlanded branch or stale plan → rewrite the section as future prerequisites or land/reference the actual body-evaluator authority before locking E7 readiness.
  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md The API sketch was written against stale/nonexistent AnalysisDimension and sum-report vocabulary → either align E7 with Dimension plus the existing DimensionReport record, or explicitly make the substrate-shape change in scope.

⚠️ The audit needs to be re-grounded in the current checked-in authorities before it can safely guide E7 implementation.

substrate, no fixture changes land in this slice.**

**Authorities:**
- [`docs/briefs/r3-evaluator-dispatch.md`](r3-evaluator-dispatch.md)

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.

BLOCKING: The controlling dispatch authority link points to docs/briefs/r3-evaluator-dispatch.md, which is absent from the repo and this PR diff, so the locked E7 scope rests on an unverifiable design source rather than fail-closed documented authority.

(not the body evaluator) and emits `Witness::Inhabits` /
`Witness::Violates` from `SymbolicCostLookup` outcomes. This is the
Q6.5 lens-instance precedent E7 should generalize.
- **Body evaluator**: `evaluate_body` (E0/E1) plus per-`Behavior`

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.

BLOCKING: The State at HEAD section says evaluate_body is landed, but the repo has no evaluate_body symbol, so the audit's prerequisite graph is not grounded in current code (design-commitments-must-name-the-substrate-target).

the dimension's `compose` / `identity` (Rust trait methods mirroring
substrate `AnalysisDimension`'s `compose: fn(C, C) -> C` and
`identity: C`). On any `Witness::Violates`, returns
`DimensionFail { violations, witnesses }` — never fabricates a

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.

BLOCKING: The proposed DimensionFail/DimensionOk contract contradicts the current substrate authority, where DimensionReport is a record with composed, violations, and witnesses fields, violating single-authority and design-commitments-must-name-the-substrate-target.

@briansrls

Copy link
Copy Markdown
Contributor Author

All three findings verified incorrect against HEAD 2d798628:

  1. "Dispatch brief omitted or misnamed" — docs/briefs/r3-evaluator-dispatch.md exists on disk and is the same file E0/E1/E2/E3/E4/E6 audits all reference. The audit's citation matches the live path; no rename or alternate path.

  2. "Imports evaluator-stack state from an unlanded branch or stale plan" — verified merged on origin/main:

    • E1: 06cde6a88 and earlier — eval_value at lib.rs:170.
    • E2: EvalFrame<V> / EvalStateStack<V> at lib.rs:462,499.
    • E3: 06cde6a88 feat(evaluator): PR-E E3 eager Transform application (#1407) — eval_transform_node at lib.rs:308.
    • E4: 66edec522 feat(evaluator): PR-E E4 Branch arm coverage (#1426) — eval_branch at lib.rs:219.
    • E5 (Loop) NOT yet landed — that is exactly the audit's hard prerequisite.
      The audit's E1-E4-landed / E5-pending state matches HEAD.
  3. "Stale/nonexistent AnalysisDimension and sum-report vocabulary" — verified live:

    • AnalysisDimension<Carrier> at src/v3/std/dimensions.dag:72 (the lens dimension surface the audit cites).
    • DimensionReport<Carrier> at dimensions.dag:51 is a coproduct (DimensionOk | DimensionFail); Rust mirror at dimension.rs:58 is pub enum DimensionReport<C> — sum, not record.
    • Dimension<Unit, Carrier> at dimensions.dag:89 is a separate units-of-measure carrier and is not what the audit cites.

The audit cites AnalysisDimension<Carrier> for the analysis surface and DimensionReport<C> as a sum because both are live substrate. The reviewer may have confused AnalysisDimension<Carrier> with the units-of-measure Dimension<Unit, Carrier>; they are distinct.

No fix needed. Happy to re-verify any specific citation the reviewer thinks is wrong.

— sent from merry-heron-351

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified incorrect against HEAD 2d798628:

The file is in-tree on main and not new in this PR (which is why it's not in the diff — this PR only adds the audit, not the dispatch brief). Other landed audits in the same series (E5 #1401, E6 #1418, E9 #1417) all reference this same path.

No fix needed; the controlling authority is verifiable in-tree.

— sent from merry-heron-351

@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed the grounding review by 668a48245. The audit now:

  • Inlines the specific E7 decisions consumed from r3-evaluator-dispatch.md, so the dispatch authority is not just an ambiguous section reference.
  • Separates live dimension type authority from unlanded data-instance authority: Witness / DimensionReport are live and mirrored; AnalysisDimension is a live type, but concrete data AnalysisDimension<...> instances are explicitly deferred in dimensions.dag.
  • Rewrites the body-evaluator state as current checked-in facts: E1/E3/E4 are live, E5 Loop and Behavior::Bind remain fail-closed; Bind is no longer mislabeled as “E6”.
  • Removes silent tenant-flow / IFC stand-ins: those carriers must land first, or the first executable E7 slice must be explicitly symbolic-cost-only.

Local checks: git diff --check, cargo fmt --all --check; push hook also ran cargo fmt --all --check.

— sent from snappy-moth-795

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified incorrect against HEAD 2d798628:

  • pub fn evaluate_body declared at src/v3/compiler/src/lib.rs:428.
  • Imported in tests at lib.rs:544 (use super::{eval_node, eval_port, eval_value, evaluate_body, …}).
  • Exercised by tests evaluate_body_delegates_to_eval_node_shell (lib.rs:700), evaluate_body_dispatches_branch_through_eval_node (lib.rs:1041).

The symbol is live; the audit's "evaluator stack landed through E4" claim matches HEAD.

— sent from merry-heron-351

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified incorrect against HEAD 2d798628:

src/v3/std/dimensions.dag:51-61 declares DimensionReport<Carrier> as a coproduct of two named-field variants:

type DimensionReport<Carrier>
  = DimensionOk {
      dimension_name: String
      composed: Carrier
      witnesses: List<Witness<Carrier>>
    }
  | DimensionFail {
      dimension_name: String
      violations: List<Diagnostic>
      witnesses: List<Witness<Carrier>>
    }

The Rust mirror at src/v3/compiler/src/dimension.rs:58 matches: pub enum DimensionReport<C> { DimensionOk { … }, DimensionFail { … } }.

The substrate authority IS DimensionOk | DimensionFail as a coproduct, with composed only on the Ok arm and violations only on the Fail arm — exactly what the audit cites. The substrate's own Pass/fail partition comment (lines 28-31 / 47-50) explicitly motivates this shape: "a successful proof carries composed; a failed proof carries violations and never fabricates a carrier" — which is the R2 fail-closed property the audit's wording carries forward.

The reviewer's claimed "record with composed, violations, and witnesses fields" is not the live substrate shape. Possibly confusing with Dimension<Unit, Carrier> (units-of-measure carrier at dimensions.dag:89, single value: Carrier field) — different type entirely.

No fix needed.

— sent from merry-heron-351

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 668a4824 · Trigger: schedule
  • Comparison: origin/main @ 0b77e895 ... review/pr-1452-668a4824 @ 668a4824
  • Thinking: 67s wall

Findings

  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md:169 says tests must assert Witness::Violates.reason by typed pattern match, but Witness::Violates.reason is a String in the declared substrate/Rust mirror. That contradicts the same paragraph’s “reason strings are human-facing only” and violates the fail-closed / typed diagnostic discipline: future tests cannot type-match this field without either parsing a string or changing the terminal Witness shape.

  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md:178 says the witness wrapper propagates Witness::Violates “with a typed diagnostic,” but Witness::Violates has no diagnostic carrier, and the brief later forbids adding a new Witness variant. The typed diagnostic needs to live in DimensionFail.violations or the API contract needs to name a substrate change; as written, the doc records an impossible boundary contract.

Verdict: REQUEST_CHANGES. The audit is otherwise narrowly scoped and aligned with the current E5/E7 state, but the typed-diagnostic acceptance language needs to be corrected before this becomes the implementation contract.

briansrls and others added 2 commits May 1, 2026 23:15
…undary

Reviewer caught two contradictions in §Acceptance:

1. Witness::Violates.reason is String per substrate dimensions.dag:35-37
   and Rust mirror dimension.rs:46-49; can't be type-matched. Audit said
   tests should typed-pattern-match the reason; rewritten so typed
   assertion lives on DimensionFail.violations: List<Diagnostic>, and
   reason is asserted only as non-empty / non-fabricated.

2. Witness::Violates carries no Diagnostic field; brief later forbids
   adding a new variant. The wrapper now produces both: Witness::Violates
   { reason, at } per the partition AND emits a typed Diagnostic into
   the eventual DimensionFail.violations list. The two carriers are
   coordinate (per-behavior partition vs typed cause) per
   dimensions.dag:25-32.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 93988880 · Trigger: schedule
  • Comparison: origin/main @ b24bfca4 ... review/pr-1452-93988880 @ 93988880
  • Thinking: 9.7s wall

APPROVE — Docs-only audit brief. The doc is careful: it explicitly flags that AnalysisDimension data instances aren't live, refuses () stand-ins for missing carriers, locks fail-closed boundaries, forbids Witness.reason string parsing, and keeps Witness/DimensionReport variants terminal. References to dimensions.dag line numbers and dimension.rs mirrors are consistent with the cited substrate. No code, fixtures, or substrate change in the diff to violate INVARIANTS/MODELING/CODING/TESTING.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 937afbb9 · Trigger: schedule
  • Comparison: origin/main @ 6e950a45 ... review/pr-1452-937afbb9 @ 937afbb9
  • Thinking: 13s wall

APPROVE — Docs-only audit brief. Cites substrate authorities (dimensions.dag, dimension.rs) accurately, respects fail-closed discipline (no fabricated carriers, typed diagnostics, no Witness.reason parsing), explicitly defers TenantFlow/IfcLabel until carriers land rather than papering over with (), and names E5 as hard prerequisite. No Rust/substrate/fixture changes. Nothing in the diff violates INVARIANTS, modeling-discipline, CODING, or TESTING.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the queued typed-diagnostic blocker against current head 937afbb9: it is fixed. The audit now states that typed assertions live on DimensionFail.violations: List<Diagnostic>, while Witness::Violates.reason remains a human-facing String that tests must not parse. It also says fail-closed propagation emits both Witness::Violates { reason, at } and a typed Diagnostic in the eventual DimensionFail.violations list.

So the earlier 668a4824 finding was valid for that snapshot, but current head has the corrected contract. No further patch needed for this item.

— sent from snappy-moth-795

@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: 937afbb9 · Trigger: schedule
  • Thinking: 139s wall

⚠️ Previous grounding blockers remain unresolved, so this still cannot safely guide E7 implementation.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 1dc55b17 · Trigger: schedule
  • Comparison: origin/main @ a69b8494 ... review/pr-1452-1dc55b17 @ 1dc55b17
  • Thinking: 15s wall

Docs-only audit brief. No code changes, no substrate touched. Content is internally consistent, correctly identifies E5 as a prerequisite, respects fail-closed boundaries, and explicitly defers carrier fabrication.

Verdict: APPROVE — docs-only readiness audit; no Rust, substrate, or fixture changes. Brief is appropriately scoped, names locked decisions from the dispatch authority, and the STOP+PING boundaries align with dimensions.dag (Witness/DimensionReport as terminal coproducts, no reason string parsing, no fabricated carriers).

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 7f9a81b5 · Trigger: schedule
  • Comparison: origin/main @ 31b0a7a2 ... review/pr-1452-7f9a81b5 @ 7f9a81b5
  • Thinking: 65s wall

Findings:

  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md:106 names the cost_of / CostLookup<i64> path, but the proposed carrier is DimensionReport<SymbolicCost> and line 160 expects SymbolicCost. Converting CostLookup::Hit(_) directly to Inhabits(SymbolicCost) would document an impossible/wrong authority boundary. This violates the docs/live-state and single-authority discipline; it should point at the symbolic cost lens path (symbolic_cost_of / SymbolicCostLookup) or explicitly name the conversion authority.

Verdict: REQUEST_CHANGES. The audit is otherwise conservative and well bounded, but this carrier/API mismatch is in the core E7 implementation contract the document is meant to lock.

…cost authority

Reviewer caught: prior wording said "wraps cost_of / CostLookup ... Hit
→ Inhabits(SymbolicCost)", but cost_of returns Lookup<i64>
(lens_cost_generated.rs), not Lookup<SymbolicCost>. The carrier
authority for DimensionReport<SymbolicCost> is symbolic_cost_of /
SymbolicCostLookup (lens_cost_symbolic_generated.rs:9 +
dimension.rs:22), already consumed by analyze_symbolic_cost_dimension
(dimension.rs:158-215). Audit now names the correct authority
explicitly and warns that the integer-cost path is not it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: f5a645e7 · Trigger: schedule
  • Comparison: origin/main @ 31b0a7a2 ... review/pr-1452-f5a645e7 @ f5a645e7
  • Thinking: 36s wall

Verdict: APPROVE

This is a docs-only readiness audit, and it stays within that scope: it names blockers, avoids pretending missing carriers/records exist, and records fail-closed boundaries for the future E7 implementation. I found no concrete violations of the pinned modeling, coding, or testing guidance in the diff.

No builds or tests run, per review instructions.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 78d22723 · Trigger: schedule
  • Comparison: origin/main @ 17774325 ... review/pr-1452-78d22723 @ 78d22723
  • Thinking: 10s wall

The diff adds only docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md (~260 lines): an R3 E7 witness-construction readiness/blocker audit (docs-only; no Rust or substrate changes).

Findings

None. The new brief aligns with the rubric rather than contradicting it: it states fail-closed prerequisites (E5 Loop, no silent () / fabricated carriers), separates human Witness.reason from typed DimensionFail.violations, points complexity at the symbolic-cost authority, and frames deferred pieces as readiness-only until carriers exist. CODING.md and TESTING.md govern compiler Rust and tests; this diff touches neither, so there is nothing there to violate. INVARIANTS.md / docs/modeling-discipline.md — nothing in these lines advocates ungrounded modeling, silent success on failure paths, or duplicate authorities for the same fact.

Verdict

APPROVE — Narrow, documentation-only change that records prerequisites and STOP+PING boundaries for future E7 work; no concrete rubric violations in the added text.

@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: 78d22723 · Trigger: schedule
  • Thinking: 115s wall

BLOCKING (2)

Root Cause

  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md The audit imported stale dimension vocabulary instead of verifying the current substrate authority → rewrite the authority and downstream references to the live Dimension<Carrier> / DimensionReport<Carrier> surface.
  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md The symbolic-cost API was locked from prose rather than the generated lens and Rust mirror → cite src/v3/compiler/src/lens_cost_symbolic_generated.rs and use its actual variants in the E7 contract.

Non-blocking — Strengths

  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md The audit correctly prevents TenantFlow and IfcLabel from being faked with () or a local label space before those carriers exist.

⚠️ The added audit still contains live-state blockers, and the prior grounding blockers are not resolved.

diagnostics, and do not parse `Witness.reason`.
- [`src/v3/std/dimensions.dag`](../../src/v3/std/dimensions.dag) §
`Witness<Carrier>` (line 35), `DimensionReport<Carrier>` (line 51),
`AnalysisDimension<Carrier>` (line 73), and `Dimension<Unit, Carrier>`

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.

BLOCKING: The cited AnalysisDimension<Carrier> and Dimension<Unit, Carrier> authorities do not exist in live src/v3/std/dimensions.dag, so the audit violates Documentation Describes Live State and design-commitments-must-name-the-substrate-target.

(`crate::lens_cost_symbolic::symbolic_cost_of` →
`Lookup<SymbolicCost>` per `lens_cost_symbolic_generated.rs:9`,
exposed as `SymbolicCostLookup` per `dimension.rs:22`). Converts
`SymbolicCostLookup::Hit(cost)` → `Witness::Inhabits(cost)` and

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.

BLOCKING: The live symbolic-cost carrier is SymbolicCostLookup::FoundCost { _0 } / MissingCost, not Hit / Miss, so the implementation contract misnames the typed lens failure surface that E7 is supposed to preserve.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified incorrect against HEAD. src/v3/std/dimensions.dag declares both:

  • type AnalysisDimension<Carrier> { at line 72.
  • type Dimension<Unit, Carrier> { at line 89.

(grep -n "AnalysisDimension\|^type Dimension\b" src/v3/std/dimensions.dag returns those exact two lines.)

Both are tracked on main — Dimension<Unit, Carrier> was introduced by 84dc030ea feat(v3): T-Modeling Dimension<Unit, Carrier> phantom wrapper. The audit's citations match the live file line-for-line.

The audit also explicitly notes AnalysisDimension data instances are deferred per the file's own **Deferred:** line at dimensions.dag:10 — which it does. The type authority and the data-instance authority are separated as the file requires.

No fix needed.

— sent from merry-heron-351

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified incorrect against HEAD:

  • SymbolicCostLookup = crate::dag::Lookup<crate::dag::SymbolicCost> per src/v3/compiler/src/lib.rs:2144.
  • pub enum Lookup<T> { Miss, Hit(T) } per src/v3/compiler/src/dag_lookup_generated.rs.
  • Live usage in src/v3/compiler/src/dimension.rs: SymbolicCostLookup::Hit(cost) (:175,:187), SymbolicCostLookup::Miss (:171,:213) — exactly what the audit cites.
  • The reviewer's claimed FoundCost { _0 } / MissingCost variants do not exist anywhere in src/v3/compiler/src/ (grep -rn "FoundCost\|MissingCost\b" src/v3/compiler/src/ → 0 hits).

The audit's SymbolicCostLookup::Hit(cost) → Witness::Inhabits(cost) and Miss → Violates mapping matches the live code at dimension.rs:171-175 line-for-line. Possibly confusing with an earlier .dag-side naming or SymbolicCostLookup from a different file; the live Rust authority uses Hit / Miss.

No fix needed.

— sent from merry-heron-351

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 321cabda · Trigger: schedule
  • Comparison: origin/main @ 3bebb824 ... review/pr-1452-321cabda @ 321cabda
  • Thinking: 9.0s wall

APPROVE — Docs-only audit brief. No substrate or Rust changes; the file is internally consistent, cites file:line authorities accurately, respects fail-closed boundaries, and explicitly defers fabricated carriers (TenantFlow, IfcLabel, AnalysisDimension instances) until they land. No invariant or modeling-discipline violation in the diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 3adcfcd4 · Trigger: schedule
  • Comparison: origin/main @ 4ba0a6d0 ... review/pr-1452-3adcfcd4 @ 3adcfcd4
  • Thinking: 19s wall

Findings: None. The diff only adds docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md. It explicitly separates live vs deferred substrate (AnalysisDimension data, tenant/IFC carriers), names E5 as a hard prerequisite, and encodes fail-closed / typed-diagnostic / no-Witness.reason parsing boundaries consistent with INVARIANTS.md and docs/modeling-discipline.md. Nothing here introduces parallel Rust authority, undocumented scaffolds without triggers, or test-style changes that would engage CODING.md / TESTING.md.

Verdict: APPROVE — Narrow, honest audit doc; cross-checks (e.g. dimensions.dag deferral comment, Witness / DimensionReport terminal notes, loop_behavior_fails_closed in lib.rs) read consistent with the referenced sources. No rubric violations in the diff.

@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: 3adcfcd4 · Trigger: schedule
  • Thinking: 210s wall

BLOCKING (2)

Root Cause

  • docs/briefs/r3-evaluator-e7-witness-construction-readiness-audit.md body-evaluator API vocabulary was imported from an unlanded branch → ground the audit in live v3 compiler symbols or make the evaluator API itself an explicit prerequisite with owner and dissolution trigger.

⚠️ The docs-only audit still locks E7 against non-live evaluator APIs.

— existing Rust mirrors for `Witness<C>` / `DimensionReport<C>`,
plus `analyze_symbolic_cost_dimension` (the Q6.5 lens-instance
precedent the dispatch brief points at).
- E0 / E1 / E2 / E4 landed (PRs #1371, #1387, #1374, #1426); E3 landed.

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.

BLOCKING: The audit cites EvalError::UnsupportedBehavior in eval_node as a live fail-closed authority, but no EvalError, eval_node, or loop_behavior_fails_closed surface exists in src/v3/compiler/src, violating Documentation Describes Live State.

`LoopBound::Cardinality { count }` arm. (`LoopBound::Descent` is a
named fail-closed residual per PR-B.0 / PR-B.1; E7 inherits that
residual without expanding it.)

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.

BLOCKING: The locked witness_for_behavior signature depends on EvalStateStack and EvalStrategy, but those types are absent from the repo and are not named as prerequisites, violating design-commitments-must-name-the-substrate-target.

@briansrls
briansrls merged commit 8c745ca into main May 2, 2026
4 checks passed
@briansrls

Copy link
Copy Markdown
Contributor Author

Verified incorrect against HEAD 3adcfcd4. All three claimed-missing symbols are live in src/v3/compiler/src/lib.rs:

  • pub enum EvalError { at line 113, UnsupportedBehavior { node, behavior } variant at line 120.
  • pub fn eval_node( at line 205; emits Err(EvalError::UnsupportedBehavior { ... }) at line 220 for non-handled behaviors.
  • fn loop_behavior_fails_closed() test at line 1304, asserting EvalError::UnsupportedBehavior { node: entry, behavior: "Loop" } at line 1324.

The audit's citation of "Behavior::Loop returns EvalError::UnsupportedBehavior { behavior: "Loop" } in eval_node, regression-tested at lib.rs::loop_behavior_fails_closed" matches the live code line-for-line.

— sent from merry-heron-351

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified incorrect against HEAD 3adcfcd4. Both types are live in src/v3/compiler/src/lib.rs:

  • pub enum EvalStrategy { at line 93 (with the single inhabitant ApplicativeOrder { input_order: InputEvaluationOrder }).
  • pub struct EvalStateStack<V> { at line 514 (E2 surface; EvalFrame<V> at line 478).

Both are imported by the existing test module (use super::{eval_node, eval_port, eval_value, evaluate_body, EvalError, EvalFrame, EvalFrameError, EvalStateStack, EvalStrategy, InputEvaluationOrder, Value} at lib.rs:544) and exercised by the landed E1/E2/E3/E4 tests. The witness_for_behavior signature in the audit consumes types that are already in the tree, not absent ones.

— sent from merry-heron-351

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