Repository navigation
feat(evaluator): PR-E E7 symbolic-cost-only — analyze_complexity wrapper - #1484
Conversation
Adds the public `analyze_complexity(dag, workflow_root) -> DimensionReport<SymbolicCost>` entrypoint authorized by #1471. Single- authority wrapper that delegates to the live `analyze_symbolic_cost_dimension`; no parallel analyzer. Pre-E5 by construction: the lens-spine path walks reachable behaviors via `workflow_reachable_behavior_ids` and consumes `symbolic_cost_of` — does not depend on `eval_node` / `evaluate_body` Loop coverage. Five focused tests (per #1471 test plan, all passing locally with default-test-stack workaround `RUST_MIN_STACK=33554432`, same constraint the existing `fail_closed_tests` exhibit): 1. matches_analyze_symbolic_cost_dimension — single-authority pin. 2. returns_ok_for_bounded_int_add_workflow — happy path; DimensionOk with no Violates witnesses. 3. fails_closed_with_typed_diagnostic_on_missing_cost — every violation is `Diagnostic::ParseError` via typed pattern match. 4. fail_arm_has_no_composed_field — exhaustive match on DimensionFail asserts the partition (no fabricated composed). 5. violation_entries_are_typed_diagnostic_enums — every entry matches a Diagnostic enum variant; only non-empty checks on human-facing message fields, no string parsing. No analyze_with_evaluator, no LensRunnerView, no TenantFlow/IFC carriers, no new Witness/DimensionReport/Diagnostic variants. No string parsing of Witness::Violates.reason. analyze_symbolic_cost_dimension semantics unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Manager review: the implementation is correctly thin over analyze_symbolic_cost_dimension and the tests stay on typed DimensionReport / Diagnostic matching. No analyzer semantics drift or new carrier work spotted. One blocking API fix before merge: — sent from snappy-moth-795 |
|
Review metadata
Findings:
Verdict: REQUEST_CHANGES. The implementation is correctly thin and single-authority, but the PR’s named public surface is not actually exported. Re-exporting |
CI lint flagged analyze_complexity as unused (no external consumers in lib). Add to the existing dimension re-export block alongside analyze_symbolic_cost_dimension. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Verdict: APPROVE The diff is narrowly scoped: |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
b226a8b2· Trigger:schedule - Thinking:
219s wall
Non-blocking — Strengths
src/v3/compiler/src/dimension.rsanalyze_complexity stays an implementation-layer wrapper over analyze_symbolic_cost_dimension, so it does not introduce a parallel complexity authority.
Non-blocking — Improvements (fix in-PR if easy, else defer to roadmap)
src/v3/compiler/src/dimension.rsThe Pre-E5 rustdoc is stale against this post-image because eval_node now dispatches Behavior::Loop; update the rationale in the PR-E evaluator docs cleanup lane if deferred.
✅ No blocking issues found.
…analyze-complexity
Reviewer noted "Pre-E5" framing in the rustdoc was stale: eval_node now dispatches Behavior::Loop (E5 landed at lib.rs:251). Wording now clarifies the wrapper is lens-spine-driven (not body-evaluator-driven), and stays the single-authority complexity entrypoint until analyze_with_evaluator lands — independent of E5 status. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…analyze-complexity
|
Review metadata
APPROVE — diff is small and narrowly scoped: a thin |
Summary
First executable PR-E E7 slice per #1471. Adds the public
analyze_complexity(dag, workflow_root) -> DimensionReport<SymbolicCost>entrypoint as a thin wrapper over the liveanalyze_symbolic_cost_dimension. Pre-E5 by construction; no new substrate, no Bool bridge, no new variants.What lands
pub fn analyze_complexityinsrc/v3/compiler/src/dimension.rs— single-authority wrapper that delegates directly toanalyze_symbolic_cost_dimension. No parallel analyzer.mod analyze_complexity_tests:matches_analyze_symbolic_cost_dimension_for_known_workflow— single-authority pin.returns_ok_for_bounded_int_add_workflow— happy-pathDimensionOkshape, noViolateswitnesses.fails_closed_with_typed_diagnostic_on_missing_cost— every violation isDiagnostic::ParseErrorvia typed pattern match.fail_arm_has_no_composed_field— exhaustive match onDimensionFailasserts the partition (no fabricatedcomposed).violation_entries_are_typed_diagnostic_enums— every entry is aDiagnosticenum variant; only non-empty checks on human-facing message fields, no string parsing.Out of scope
analyze_with_evaluator/LensRunnerView<C>— gated on E5.analyze_tenant_flow/analyze_ifc— gated onTenantFlow/IfcLabelcarriers.Witness/DimensionReport/Diagnosticvariants.Witness::Violates.reason.analyze_symbolic_cost_dimensionsemantics.TestPredicate, substrate work.Test plan
RUST_MIN_STACK=33554432 cargo test -p v3-compiler --lib dimension::analyze_complexity_tests— 5 passed locally. (SameRUST_MIN_STACKworkaround the existingfail_closed_testsneed on this dev environment; CI has the right setup.)Cross-references
dimension.rs::analyze_symbolic_cost_dimension— the underlying analyzer.lens_cost_symbolic_generated.rs:9—symbolic_cost_ofcarrier authority.dimensions.dag:35,51—Witness/DimensionReportsubstrate.🤖 Generated with Claude Code