Skip to content

Generative TestClaim categories lane — formalize wishlist + dispatch non-tautological generators (per smart-lynx-142 framing 2026-05-22) - #3557

Closed
briansrls wants to merge 48 commits into
mainfrom
session/quiet-moth-603
Closed

briansrls wants to merge 48 commits into
mainfrom
session/quiet-moth-603

Conversation

@briansrls

@briansrls briansrls commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Formalizes the T-19 generative TestClaim wishlist and tautology discipline in docs/design-testgen-generative-categories.md, mapped through the canonical TestgenConcept arms rather than a second category authority.

Implements the first non-LBE generator slice by adding testgen_emit_algebra_law_claim, a generated Nat algebra-law corpus with three sample rows, and structural guards that pin the LBE receipts, algebra-law samples, and pending generator wishlist. The algebra-law helper now rejects tautological lhs == rhs sides before emitting EqualsClaim.

P5 Receipt

P5 Mechanism (b): this expands the existing SG-0-registered hand-Rust closeout harness src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs without adding a new census path. The matching INVARIANTS.md §SG-0 row is updated in this PR to name the new interim ratchets: t19_language_behavior_equivalence_generated_claims_parse, t19_algebra_law_generated_claims_parse_and_use_testgen_emit, t19_non_tautological_generator_wishlist_parse_and_pins_dispatch_rows, and t19_language_behavior_equivalence_run_test_claim_receipts_present. Dissolution remains the existing T-19/T-20/T-22 trigger: replace this host parse-surface ratchet with .dag TestClaim rows or generated harness coverage.

Test plan

  • python3 scripts/check_t19_testgen_activation.py — passed
  • cargo fmt --all --check — passed
  • cargo test -p v3-compiler --test integration -- v4_test_bootstrap_infra_closeout_test::t19_algebra_law_generated_claims_parse_and_use_testgen_emit v4_test_bootstrap_infra_closeout_test::t19_non_tautological_generator_wishlist_parse_and_pins_dispatch_rows v4_test_bootstrap_infra_closeout_test::t19_language_behavior_equivalence_generated_claims_parse — passed via BuildBuddy

Dispatch

Created follow-on dashboard work items for witness-validity, coproduct-exhaustiveness, idempotent-operation, and refinement-preservation generators under this session.

@briansrls
briansrls marked this pull request as ready for review May 22, 2026 02:21

@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: e2fdd4a7 · Trigger: schedule
  • Thinking: 308s wall

BLOCKING (3)

Root Cause

  • src/v4/lens/testgen.dag non-tautology evidence lives in prose/fixture naming instead of the generator boundary → carry an oracle/witness/falsification input in the helper or reject structurally identical sides before returning Accepted.
  • src/v4/test/claim/generated/testgen_category_wishlist.dag oracle-basis evidence was introduced as a standalone category sum without a bound disposition → either dissolve it into the canonical generator/witness carrier or add the in-file disposition tag with a concrete gate and trigger.
  • docs/design-testgen-generative-categories.md the wishlist taxonomy was changed in prose without mapping it to or changing the closed TestgenConcept coproduct → align the plan with the canonical arms or land a same-PR TestgenConcept update with a dissolution receipt.

⚠️ The PR needs the generator boundary and category model tightened before merge.

Comment thread src/v4/lens/testgen.dag Outdated
rhs: Node,
classification: TestClassification
) -> Outcome<TestClaim> {
Accepted {

This comment was marked as resolved.

import v4.test.claim.manual.connective_anchors { stub_empty_conj }


type TestgenOracleBasis

This comment was marked as resolved.

- a structural test or script guard proving the rows are generated through the category emission helper;
- an explicit tautology-skip path, preferably represented as a negative fixture or count witness.

Recommended order: witness validity, coproduct exhaustiveness, idempotent operation conformance, refinement preservation. Algebra-law broadening from the Nat sample to all algebra carriers can proceed in parallel with those category workers.

This comment was marked as resolved.

@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: 1aae1697 · Trigger: schedule
  • Thinking: 273s wall

BLOCKING (1)

Root Cause

  • src/v4/lens/testgen.dag AlgebraLaw generation is modeled as loose lhs/rhs Nodes rather than a canonical AlgebraLawSubject plus witness/fixture input → make the helper consume the canonical law subject/witness carrier or import/reuse the existing Nat law-subject rows when building generated samples.

⚠️ One grounding issue remains in the new AlgebraLaw generated corpus.

data algebra_law_generated_operation_field: Symbol = algebra_law_generated_operation_field
data algebra_law_generated_left_field: Symbol = algebra_law_generated_left_field
data algebra_law_generated_right_field: Symbol = algebra_law_generated_right_field
data t19_generated_nat_add_op: Symbol = t19_generated_nat_add_op

This comment was marked as resolved.

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.

Verified against current HEAD 104512b. This finding was valid on the older revision, but is already addressed now: src/v4/test/claim/generated/algebra_law_conformance.dag no longer declares t19_generated_nat_add_op, t19_generated_nat_mul_op, or t19_generated_nat_*_value symbols. The corpus imports nat_algebra_law_subject_symbol_add_operation, nat_algebra_law_subject_symbol_mul_operation, and the Nat value symbols from v4.std.nat, and the sample builders consume those canonical symbols. The remaining t19_generated_nat_add/t19_generated_nat_mul names are helper functions for expression-node construction, not independent operation authorities. — sent from still-raven-873

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 1aae1697 · Trigger: manual
  • Comparison: main @ 6052cf66 ... session/quiet-moth-603 @ 1aae1697
  • Conversation: View conversation

1. Story of the diff

This PR expands the T-19 generative TestClaim lane from a single shipped LanguageBehaviorEquivalence slice into a broader category framework. It adds a design note that defines which TestgenConcept arms may generate non-tautological claims, introduces a generated wishlist corpus with oracle-basis rows for the remaining arms, and adds an AlgebraLaw emission helper plus a first generated Nat algebra-law corpus. The closeout Rust ratchet and activation script are extended to parse these new .dag files and pin expected wiring/counts, while the Java and Lean language models switch from free_monoid_fold to the shared fold_list import/call surface. The load-bearing path is: docs/design-testgen-generative-categories.md defines the non-tautology contract, src/v4/lens/testgen.dag exposes the generator helper, src/v4/test/claim/generated/*.dag materializes generated claim rows, and src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs plus scripts/check_t19_testgen_activation.py ratchet the surface.

2. Invariant categories

1. LAYER MODEL — substrate vs implementation

Finding — src/v4/lens/testgen.dag:425-430: illegal algebra-law claim state remains representable. This is not pure file-scoped Rust; it is the v4 .dag testgen model that downstream generated TestClaim data consumes. The PR’s own category contract says AlgebraLaw claims come from data carrier: Algebra<T> rows and law symbols, with an independent law witness or falsifying fixture as the non-tautology basis (docs/design-testgen-generative-categories.md:22). But the new generator boundary accepts only anchor, label, arbitrary lhs: Node, arbitrary rhs: Node, and classification (src/v4/lens/testgen.dag:425-430). That means a caller can manufacture an AlgebraLaw EqualsClaim without carrying the algebra carrier, law symbol, subject, or witness that makes it a generated structural claim. Fix by making the generator boundary carry the scheduled AlgebraLawSubject/law identity plus the independent witness or fixture, and fail closed when those are absent.

2. INVARIANTS.md + modeling-discipline.md

Finding — src/v4/test/claim/generated/algebra_law_conformance.dag:29-37: Modeling Faithfulness / Boundary Discipline violation. The design says the AlgebraLaw generated claim normalizes a law expression to an independently declared expected witness (docs/design-testgen-generative-categories.md:22) and says the landed Nat rows keep the generated source side and expected-law witness side separate (docs/design-testgen-generative-categories.md:34). The new corpus instead authors local symbols for operation fields, local Nat operations, and local Nat values (src/v4/test/claim/generated/algebra_law_conformance.dag:29-37), then builds claims from those local constructors (src/v4/test/claim/generated/algebra_law_conformance.dag:92-120). The file header claims it consumes v4.test.claim.algebra_laws.nat_semiring (src/v4/test/claim/generated/algebra_law_conformance.dag:4), but no such import or law-witness consumption exists in the imports at src/v4/test/claim/generated/algebra_law_conformance.dag:10-25. This turns the “generated from existing substrate facts” lane into a parallel local fixture authority for algebra laws. The correction is to consume the canonical Nat algebra/law witness rows, or explicitly model a named negative/expected fixture basis as the source of the witness rather than rebuilding the law surface locally.

3. CODING.md

Compliant. The Rust-side changes are confined to the existing integration ratchet and script: the new helper between is a small free function (src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs:409-419), and the production code path is .dag data rather than new object/method-heavy Rust. The coding issue is not style; it is the model boundary above.

4. TESTING.md

Finding — src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs:50-82: the new ratchet locks the weak contract instead of the intended behavior. The test checks that testgen_emit_algebra_law_claim exists, that it rejects lhs == rhs, and that the generated file contains three named rows and concrete Nat expressions. It does not check the high-risk property this PR claims to formalize: that AlgebraLaw generated rows are sourced from algebra/law substrate rows plus an independent witness or fixture. As written, the test would still pass if every generated algebra-law claim were built from ad hoc local symbols and arbitrary lhs/rhs pairs, which is exactly the gap introduced at src/v4/test/claim/generated/algebra_law_conformance.dag:29-37 and src/v4/lens/testgen.dag:425-430. Update the ratchet to assert the generated corpus imports/consumes the canonical law subject/witness source, or at least that the generator helper requires and propagates a typed oracle basis.

5. LOCKED DESIGN DECISIONS

Compliant. The PR does not add a new hand-authored Rust path or a new bootstrap/runtime direction. The generated artifacts stay under .dag TestClaim data, which is aligned with the zero-residual testing direction in THESIS/Pure Bootstrap. The problem above is not a locked-design divergence from “tests as data”; it is that the new data is not yet grounded in the declared AlgebraLaw authority it claims to generate from.

6. TRACKED vs UNTRACKED DEBT

Compliant for the wishlist scaffold; not the source of the blocking issue. The new wishlist coproduct is explicitly marked and bounded: TestgenOracleBasis carries a 🟡 coproduct dissolution tag with feature:T19-GENERATOR-ORACLE-BASIS, a binding id, and a dissolve-on condition (src/v4/test/claim/generated/testgen_category_wishlist.dag:53-60). That is a tracked bridge. The blocking AlgebraLaw issue is not an untracked TODO/scaffold; it is a missing authority carrier on the generator boundary and generated corpus.

2.5. Top-down PM intent review

Finding. The highest-level intent is that Tier-3 verification is structurally derived from TestClaim declarations, not hand-maintained behavioral assertions; THESIS says the Tier-3 surface is generated from structural TestClaim declarations and that tests are data (THESIS.md:97-99, THESIS.md:254-264). The PR’s own brief sharpens that for this lane: a generated claim must add evidence not proven by the scheduling row alone (docs/design-testgen-generative-categories.md:9-13), and the AlgebraLaw row must use algebra/law source rows plus an independent witness or fixture (docs/design-testgen-generative-categories.md:22). The implementation dilutes that PM intent by making testgen_emit_algebra_law_claim accept arbitrary lhs/rhs Nodes with only a syntactic non-equality guard (src/v4/lens/testgen.dag:425-443) and by building the Nat corpus out of local operation/value symbols instead of the claimed Nat law authority (src/v4/test/claim/generated/algebra_law_conformance.dag:29-37, src/v4/test/claim/generated/algebra_law_conformance.dag:92-120). A worker following this shape faithfully would generate non-tautological-looking equality claims that are not demonstrably generated from the substrate facts the lane exists to exercise.

3. Verdict

REQUEST_CHANGES

The PR is directionally right and the wishlist scaffold is well-tracked, but the new AlgebraLaw generator boundary and corpus do not yet enforce the non-tautological, substrate-derived authority that the PR’s own design document requires. Fixing that before merge avoids committing the T-19 lane to a weak helper shape that future generated categories would copy.

briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026
@briansrls
briansrls force-pushed the session/quiet-moth-603 branch from a2bac01 to 9f29b56 Compare May 23, 2026 23:20
@briansrls

briansrls commented May 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Verified the two older codex api-review findings against the rebased branch. The first non-tautology/wishlist/category-model cluster is addressed in the current code: algebra-law generation rejects structurally identical sides at the helper boundary, src/v4/test/claim/generated/testgen_category_wishlist.dag carries the in-file dissolution tag, and docs/design-testgen-generative-categories.md maps wishlist examples back to the closed TestgenConcept arms. The remaining AlgebraLaw boundary finding was valid; I pushed 3ecfb43 plus fmt commit bf9d6c9, adding AlgebraLawSubject to testgen_emit_algebra_law_claim and passing the canonical Nat algebra/law symbols from the generated corpus. — sent from still-raven-873

@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: a2bac012 · Trigger: schedule
  • Thinking: 321s wall

BLOCKING (2)

Root Cause

  • src/v4/test/claim/generated/testgen_category_wishlist.dag wishlist rows hand-build Generator values instead of using the canonical Generator shape that carries claim kind → add kind to every row or route construction through a helper that derives the complete Generator from a claim/anchor.
  • INVARIANTS.md P5 closeout receipt was updated independently from the canonical TestgenConcept dispatch surface → make the receipt’s arm count derive from or match the closed TestgenConcept authority before landing.

⚠️ Two new consistency issues remain in the generated wishlist/receipt surface.



fn wishlist_type_construction_generator() -> Generator<TestgenConcept> {
Generator {

This comment was marked as resolved.

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.

Verified against current HEAD 104512b. This is already addressed now: Generator declares kind: TestClaimCoproductVariant in src/v4/lens/testgen.dag, and every Generator literal in src/v4/test/claim/generated/testgen_category_wishlist.dag carries a concrete kind field (Compiles, Equals, Diagnostic, RoundTrip as appropriate). The line-88 constructor now starts with kind: TestClaimCompilesClaimVariant. — sent from still-raven-873

Comment thread INVARIANTS.md
| `src/v3/compiler/tests/integration/v4_extdeps_file_system_dag_smoke_test.rs` | **TASKS.md** T-4.5 / Wave-2-C2 (`src/v4/extdeps/file_system.dag` — external file-system resource + modeled read/write effects; Practice 11 companion: no `import v4.std.node`, no `NodeFileBinding`; POSIX substrate exports retained for `posix.dag` / `testgen.dag`). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `file_system.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe. **Interim ratchet:** `v4_extdeps_file_system_dag_tokenizes_and_parses` plus Practice-11 companion tests (parse-surface import/type bans, POSIX-grounded `FilePath`, per-operation receipt record shapes, Wave-2 `ModeledFileEffects.file_read`/`file_write` arrow signatures + legacy `FileSystemOperations` / request-carrier coexistence). |
| `src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs` | **TASKS.md** T-21 + T-24 Wave-0 (`src/v4/workflow/ci.dag` — `ci_select_from_*` under canonical `v4.workflow.ci`; `affected_set_rerun_nodes` → `List<TestClaim>`; narrow = identity-aware subtree frontier in `verification.dag`; fail-closed = full roster; `src/v4/test/claim/workflow/affected_set_ci_runner.dag` structural receipts). **Tracked substrate bridge:** `verification.dag` `test_claim_ci_selection_fail_closed` carries 🟡 gated Practice-10 predicate-dissolution mark (dissolve when `ci_select` consumes `TestClaimCacheKey` from `05_eval`). **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when Node-level TestClaim CI selection is exercised only by `.dag` `TestClaim` rows / generated harness / host runner without this parse probe (full wire: edit-locus + `TestClaimExerciseSurface` + `ci.yml` — follow-on A/B/C). **Interim ratchet:** `v4_workflow_ci_dag_tokenizes_and_parses`; `v4_workflow_ci_test_claim_selection_entrypoints`; `v4_workflow_affected_set_ci_runner_claim_*` — tokenize+parse + import/entrypoint wiring receipts. |
| `src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs` | **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** **T-19** (`src/v4/lens/testgen.dag`) + **T-20** (`src/v4/workflow/bootstrap.dag`) + **T-22** (`src/v4/compiler/05_eval.dag` DiagnosticAssert execution / `eval_rejected_assert_kind_deferred` dissolution; witnesses in `src/v4/test/claim/manual/diagnostic_assert_eval.dag`). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the closeout ratchet; T-22 expansion in this PR updates this row (same path — no new census line). **Dissolution:** remove when the T-19/T-20/T-22 closeout checks are expressed as `.dag` `TestClaim` rows or generated harness coverage without this host parse-surface ratchet. **Interim ratchet:** `t19_testgen_concept_surface_stays_closed_and_classified` checks the closed testgen scheduling arms and the `Generator` claim kind / anchor / classification / slot field set; `t19_language_behavior_equivalence_generated_claims_parse` / `t19_language_behavior_equivalence_run_test_claim_receipts_present` pin the LBE generator slice; `t19_idempotent_operation_generated_claims_parse_and_pin_emission` pins the idempotent-operation generator slice (`src/v4/std/effects.dag` canonical `IdempotentShape`/`EffectShape` witnesses + `idempotent_operation_witness_node`; outside the six-way `TestgenConcept` coproduct; label-only skip); `t19_manual_manifest_matches_claim_anchor_discriminants` checks manual claim anchors join to the manifest by `T19ManualAnchorKey`; `t19_claim_corpus_has_no_direct_manual_anchor_assignments` scans `src/v4/test/claim/**/*.dag` so `TestClaim.t19_anchor` literals cannot bypass `t19_manual_claim_anchor(...)` after the `T19ClaimAnchorKey` split; `t19_coproduct_exhaustiveness_generated_claim_parse_and_witnesses_present` checks the generated coproduct-exhaustiveness corpus parses, derives the invalid `Node` and generated claim anchor from one `T19GeneratedCoproductExhaustiveness` source, uses canonical `node_locus`, and schedules the generated `DiagnosticExhaustiveness` claim under `T19GeneratedClaimAnchor`; `t20_bootstrap_plan_keeps_self_hosting_chain_as_data` checks the seed/self0/self1/fixpt bootstrap chain is encoded as `CompileStage` / `BootstrapPlan` data; `t22_diagnostic_assert_eval_witnesses_parse` checks `diagnostic_assert_eval.dag` parses; `t22_eval_diagnostic_assert_not_deferred_in_substrate` checks `05_eval.dag` no longer contains `eval_rejected_assert_kind_deferred`, executes `DiagnosticAssert`, and routes `run_test_claim` through `aggregate_verdicts`. |
| `src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs` | **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** **T-19** (`src/v4/lens/testgen.dag`) + **T-20** (`src/v4/workflow/bootstrap.dag`) + **T-22** (`src/v4/compiler/05_eval.dag` DiagnosticAssert execution / `eval_rejected_assert_kind_deferred` dissolution; witnesses in `src/v4/test/claim/manual/diagnostic_assert_eval.dag`). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the closeout ratchet; T-19/T-22 expansion in this PR updates this row (same path — no new census line). **Dissolution:** remove when the T-19/T-20/T-22 closeout checks are expressed as `.dag` `TestClaim` rows or generated harness coverage without this host parse-surface ratchet. **Interim ratchet:** `t19_testgen_concept_surface_stays_closed_and_classified` checks the closed testgen scheduling arms and the `Generator` claim kind / anchor / classification / slot field set; `t19_language_behavior_equivalence_generated_claims_parse` / `t19_language_behavior_equivalence_run_test_claim_receipts_present` pin the LBE generator slice; `t19_algebra_law_generated_claims_parse_and_use_testgen_emit` pins `src/v4/test/claim/generated/algebra_law_conformance.dag` routing through `testgen_emit_algebra_law_claim` with tautological-side rejection; `t19_non_tautological_generator_wishlist_parse_and_pins_dispatch_rows` pins `src/v4/test/claim/generated/testgen_category_wishlist.dag` pending/dispatched generator-category rows; `t19_idempotent_operation_generated_claims_parse_and_pin_emission` pins the idempotent-operation generator slice (`src/v4/std/effects.dag` canonical `IdempotentShape`/`EffectShape` witnesses + `idempotent_operation_witness_node`; outside the seven-way `TestgenConcept` coproduct; label-only skip); `t19_manual_manifest_matches_claim_anchor_discriminants` checks manual claim anchors join to the manifest by `T19ManualAnchorKey`; `t19_claim_corpus_has_no_direct_manual_anchor_assignments` scans `src/v4/test/claim/**/*.dag` so `TestClaim.t19_anchor` literals cannot bypass `t19_manual_claim_anchor(...)` after the `T19ClaimAnchorKey` split; `t19_coproduct_exhaustiveness_generated_claim_parse_and_witnesses_present` checks the generated coproduct-exhaustiveness corpus parses, derives the invalid `Node` and generated claim anchor from one `T19GeneratedCoproductExhaustiveness` source, uses canonical `node_locus`, and schedules the generated `DiagnosticExhaustiveness` claim under `T19GeneratedClaimAnchor`; `t20_bootstrap_plan_keeps_self_hosting_chain_as_data` checks the seed/self0/self1/fixpt bootstrap chain is encoded as `CompileStage` / `BootstrapPlan` data; `t22_diagnostic_assert_eval_witnesses_parse` checks `diagnostic_assert_eval.dag` parses; `t22_eval_diagnostic_assert_not_deferred_in_substrate` checks `05_eval.dag` no longer contains `eval_rejected_assert_kind_deferred`, executes `DiagnosticAssert`, and routes `run_test_claim` through `aggregate_verdicts`. |

This comment was marked as resolved.

briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026
briansrls added a commit that referenced this pull request May 23, 2026

@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: d24fbb41 · Trigger: schedule
  • Thinking: 304s wall

✅ The current diff resolves the prior review concerns and I do not see a new blocking issue.

@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: 104512bd · Trigger: schedule
  • Thinking: 276s wall

BLOCKING (1)

Root Cause

  • docs/design-testgen-generative-categories.md The design marks AlgebraLaw as a landed slice while the wishlist status model only moves LBE to dispatched → move the AlgebraLaw row to dispatched or explicitly scope it as a distinct broadening obligation, then update the count witnesses and guards.

⚠️ One blocking dispatch-ledger drift remains.

dispatch_key: t19_wishlist_type_construction_dispatch,
},
TestgenWishlistRow {
generator: wishlist_algebra_law_generator(),

This comment was marked as resolved.

briansrls added a commit that referenced this pull request May 24, 2026
briansrls added a commit that referenced this pull request May 24, 2026
briansrls added a commit that referenced this pull request May 24, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current HEAD 960657c. This P5 finding is already satisfied: the PR body contains a dedicated ## P5 Receipt naming the expanded src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs ratchets and the dissolution trigger, and the diff updates the matching INVARIANTS.md SG-0 row for that exact path to include the new T-19 ratchets. No new SG-0 census path is introduced; this is an expansion of an existing registered hand-Rust closeout harness with the receipt kept in the planning artifact. — sent from still-raven-873

@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: 960657c4 · Trigger: schedule
  • Thinking: 333s wall

BLOCKING (2)

Root Cause

  • src/v4/lens/testgen.dag ManualAnchorKey to AlgebraLawSubject has no single checked projection → factor one AlgebraLawCase authority and have both the generator projection and emitter consume it.
  • src/v4/lens/testgen.dag DiagnosticExhaustiveness gained subject data without an emitter API change → pass DiagnosticExhaustivenessSubject into testgen_emit_coproduct_exhaustiveness_claim or remove the field until it has a consumer.

⚠️ Two new substrate authority gaps need to be closed before merge.

Comment thread src/v4/lens/testgen.dag
}


fn algebra_law_manual_claim_case(anchor: ManualAnchorKey) -> Outcome<AlgebraLawCase> {

This comment was marked as resolved.

Comment thread src/v4/lens/testgen.dag
type AlgebraLawCase { anchor: ClaimAnchorKey, subject: AlgebraLawSubject }


type DiagnosticExhaustivenessSubject { reason: Symbol }

This comment was marked as resolved.

@briansrls

briansrls commented May 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Verified against current HEAD 960657c. This is already addressed: testgen_emit_algebra_law_claim no longer takes AlgebraLawSubject as an independent parameter. Its signature accepts only anchor, label, lhs, rhs, and classification; it then calls algebra_law_manual_claim_case(anchor: anchor) and emits terms using law_case.subject, so the anchor and subject are resolved through one checked AlgebraLawCase carrier before constructing the EqualsClaim. — sent from still-raven-873

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 15b9aa34 · Trigger: manual
  • Comparison: main @ f6b54afa ... session/quiet-moth-603 @ 15b9aa34
  • Conversation: View conversation

1. Story of the diff

This PR advances T-19 test generation from “manual anchors plus ad hoc category notes” toward an explicit non-tautological TestClaim generation lane. It adds a design note for which TestgenConcept arms can produce useful generated claims, extends Generator with claim-kind metadata, adds an AlgebraLaw generator helper that rejects identical lhs == rhs inputs, and lands a first generated Nat algebra-law corpus in src/v4/test/claim/generated/algebra_law_conformance.dag. It also threads a concrete diagnostic subject through the coproduct-exhaustiveness generator, adds a wishlist/dispatch ledger in .dag data, and expands the Rust/script ratchets so those new surfaces stay parseable and visibly wired. Separately, the MVP-1 shell gate now uses a unique temp output directory by default and reports cargo run failures explicitly.

2. Invariant categories

1. LAYER MODEL — Finding

src/v4/test/claim/generated/testgen_category_wishlist.dag:202 keeps DiagnosticExhaustiveness in the pending wishlist:

generator: wishlist_diagnostic_exhaustiveness_generator(),

But this same diff has the DiagnosticExhaustiveness coproduct-exhaustiveness generator and generated corpus already wired: src/v4/lens/testgen.dag:1370 declares fn testgen_scheduled_coproduct_exhaustiveness_generators() -> List<Generator<TestgenConcept>>, and src/v4/test/claim/generated/coproduct_exhaustiveness.dag:41 calls testgen_emit_coproduct_exhaustiveness_claim(...). Because this is v4 .dag modeling data, not an implementation-only helper, the pending/dispatched state is substrate-adjacent authority. Keeping a landed generator in the pending lane creates a parallel representation of the same category state.

2. INVARIANTS.md + modeling-discipline.md — Finding

Boundary Discipline / single authority: the PR introduces a dispatch ledger, but the ledger contradicts the generated TestClaim surface it is supposed to summarize. src/v4/test/claim/generated/testgen_category_wishlist.dag:202 says the diagnostic-exhaustiveness generator is pending, while src/v4/test/claim/generated/coproduct_exhaustiveness.dag:40-41 exposes a generated coproduct-exhaustiveness claim through testgen_emit_coproduct_exhaustiveness_claim. Either move this category into the dispatched list, or rename/scope the pending row to a distinct not-yet-landed DiagnosticExhaustiveness slice with a concrete remaining trigger.

3. CODING.md — Compliant

The Rust changes are test-ratchet updates rather than production compiler logic, and the shell change is fail-closed: scripts/v4-mvp1-e2e-gate.sh:53-65 creates a unique output directory when none is supplied, while scripts/v4-mvp1-e2e-gate.sh:158-164 captures cargo run status and exits with the real failure code instead of falling through to the receipt grep.

4. TESTING.md — Finding

The new tests/scripts currently ratchet the stale dispatch state instead of catching it. src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs:157 requires "generator: wishlist_diagnostic_exhaustiveness_generator()" in the pending wishlist, and scripts/check_t19_testgen_activation.py:308-324 enforces four pending rows and only three dispatched rows. Since src/v4/test/claim/generated/coproduct_exhaustiveness.dag:40-41 already provides a generated DiagnosticExhaustiveness corpus slice, these ratchets would make CI preserve the wrong planning state.

5. LOCKED DESIGN DECISIONS — N/A

No locked design decision is directly changed. The zero-floor / tests-as-data direction is preserved by adding .dag TestClaim corpus data rather than new production Rust authority.

6. TRACKED vs UNTRACKED DEBT — Finding

src/v4/test/claim/generated/testgen_category_wishlist.dag:202 is a stale bridge entry: it marks a category as pending without naming what remains pending after the coproduct-exhaustiveness generated corpus has landed. The TestgenOracleBasis bridge itself is tracked at src/v4/test/claim/generated/testgen_category_wishlist.dag:63-64 and src/v4/TASKS.md:871, but the specific DiagnosticExhaustiveness row needs the same clarity: either dispatched now, or bounded to a different unlanded diagnostic generator with a named dissolve-on-arrival condition.

2.5. Top-down PM intent review

Finding. The PR’s PM-level intent is to formalize the generator wishlist and dispatch non-tautological generators; however, the new plan tells the next worker to land DiagnosticExhaustiveness coproduct-exhaustiveness next at docs/design-testgen-generative-categories.md:64, while the implementation already has that slice scheduled and emitted at src/v4/lens/testgen.dag:1370 and src/v4/test/claim/generated/coproduct_exhaustiveness.dag:40-41. A worker following the new design/wishlist faithfully would duplicate or re-open already-landed work instead of moving to the true remaining category gap.

3. Verdict

REQUEST_CHANGES. The substantive implementation direction is good, especially the non-tautological AlgebraLaw helper and .dag corpus, but the new wishlist/dispatch ledger is currently false for DiagnosticExhaustiveness and the tests lock that false state in. Reclassify or precisely scope that row before merge.

@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: 15b9aa34 · Trigger: schedule
  • Thinking: 340s wall

BLOCKING (1)

Root Cause

  • src/v4/test/claim/generated/testgen_category_wishlist.dag dispatched wishlist rows construct Generator metadata independently from the emitted/scheduled generator helpers → derive dispatched rows from those helpers or make the ledger carry only non-authoritative dispatch keys/oracle receipts.

⚠️ One dispatched wishlist row has already drifted from the canonical emitted generator metadata.

classification: TestClassification { tier: Tier2, layer: Unit },
anchor: manual_claim_anchor(anchor: ManualAnchorAbsent),
slot: DiagnosticExhaustiveness {
subject: DiagnosticExhaustivenessSubject {

This comment was marked as resolved.

@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: 0109f769 · Trigger: schedule
  • Thinking: 209s wall

BLOCKING (1)

Root Cause

  • src/v4/lens/testgen.dag testgen_emit_algebra_law_claim needs both the emitted ClaimAnchorKey and derived AlgebraLawSubject → keep ManualAnchorKey as the single authority and derive manual_claim_anchor(anchor) plus AlgebraLawSubject at the emission site, or replace AlgebraLawCase with a closed law-specific carrier that cannot pair arbitrary fields.

⚠️ One substrate record reintroduces an anchor/subject mismatch state that should be removed before this lands.

Comment thread src/v4/lens/testgen.dag
type AlgebraLawSubject { algebra: Symbol, inhabitant: Symbol, law: Symbol }


type AlgebraLawCase { anchor: ClaimAnchorKey, subject: AlgebraLawSubject }

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: AlgebraLawCase stores anchor and subject as independent fields even though the subject must be derived from the manual algebra-law anchor, so mismatched law cases remain representable and violate Illegal States Unrepresentable/API-level enforcement.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 0109f769 · Trigger: manual
  • Comparison: main @ 738a4551 ... session/quiet-moth-603 @ 0109f769
  • Conversation: View conversation

1. Story of the diff

This PR tightens the T-19 “generated TestClaim categories” lane by turning the non-tautology framing into a concrete planning and generation surface. It adds a design note defining which TestgenConcept arms can produce useful generated claims, expands src/v4/lens/testgen.dag so generators carry the emitted TestClaim kind explicitly, and adds an AlgebraLaw generator helper that rejects lhs == rhs before producing an EqualsClaim (src/v4/lens/testgen.dag:673, src/v4/lens/testgen.dag:680). It then adds two generated corpora: Nat algebra-law conformance rows in src/v4/test/claim/generated/algebra_law_conformance.dag and a wishlist/dispatch ledger in src/v4/test/claim/generated/testgen_category_wishlist.dag, with Rust and Python ratchets updated to keep those surfaces parse-visible and structurally pinned. The shell change is separate but sensible: MVP-1 e2e output now uses a unique default directory and reports cargo run failures explicitly (scripts/v4-mvp1-e2e-gate.sh:59, scripts/v4-mvp1-e2e-gate.sh:158).

2. Invariant categories

  1. LAYER MODEL — Finding. src/v4/lens/testgen.dag:396 adds data t19_coproduct_exhaustiveness_missing_variant: Symbol = t19_coproduct_exhaustiveness_missing_variant while the same file already has data coproduct_exhaustiveness_missing_variant: Symbol = coproduct_exhaustiveness_missing_variant at src/v4/lens/testgen.dag:385. This is not implementation-only Rust; it is modeled TestClaim diagnostic data. The PR then routes the new DiagnosticExhaustivenessSubject.reason through the new symbol (src/v4/lens/testgen.dag:1380, src/v4/lens/testgen.dag:1392, src/v4/lens/testgen.dag:1404, src/v4/lens/testgen.dag:1416), creating two authorities for the same “coproduct exhaustiveness missing variant” diagnostic reason. Fix by reusing the existing symbol, or by explicitly replacing/renaming the old authority atomically.
  2. INVARIANTS.md + modeling-discipline.md — Finding. src/v4/lens/testgen.dag:175 introduces type AlgebraLawCase { anchor: ClaimAnchorKey, subject: AlgebraLawSubject }, and the constructor path fills both fields from the same manual anchor lookup at src/v4/lens/testgen.dag:715-716. That record admits an illegal state: an anchor for one algebra-law claim can be paired with the subject for another. This violates illegal-states-unrepresentable / single-authority discipline. The helper can return Outcome<AlgebraLawSubject> and construct manual_claim_anchor(anchor: anchor) at the EqualsClaim site instead of carrying a pair that can drift.
  3. CODING.md — Compliant. The changed scripts keep the new logic small and explicit: _forbid_substrings is a narrow helper with a structured failure path (scripts/check_t19_testgen_activation.py:51), and the MVP-1 gate now captures and reports cargo run’s actual exit status instead of letting command-substitution failure obscure the output (scripts/v4-mvp1-e2e-gate.sh:155-163).
  4. TESTING.md — Compliant. The diff adds targeted ratchets at the right level for the currently staged .dag surfaces: t19_algebra_law_generated_claims_parse_and_use_testgen_emit pins the new AlgebraLaw generator/corpus connection (src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs:72), t19_non_tautological_generator_wishlist_parse_and_pins_dispatch_rows pins the wishlist rows (src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs:143), and the Generator.kind field is asserted structurally (src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs:491).
  5. LOCKED DESIGN DECISIONS — N/A. The PR does not alter a locked design doc or change the Pure Bootstrap / zero-residual target; it records T-19 bridge follow-ups in src/v4/TASKS.md rather than redefining locked architecture.
  6. TRACKED vs UNTRACKED DEBT — Finding. The explicit bridges are mostly tracked correctly: TestgenOracleBasis has a yellow tag, bound task, owner, and dissolve-on-arrival trigger (src/v4/test/claim/generated/testgen_category_wishlist.dag:66), the Nat expression-node bridge has the same shape (src/v4/test/claim/generated/algebra_law_conformance.dag:43), and the hand-rolled TestClaim variant projector is tagged as a predicate-dissolution interim (src/v4/std/verification.dag:177). The new t19_coproduct_exhaustiveness_missing_variant symbol at src/v4/lens/testgen.dag:396 is the exception: if it is a bridge, it has no tag/bounds/trigger; if it is permanent, it duplicates the existing reason at src/v4/lens/testgen.dag:385.

2.5. Top-down PM intent review

Compliant. The PM-level intent is preserved: the new design rule says generated claims must add evidence beyond the scheduling row, and the implementation enforces the first concrete AlgebraLaw guard by rejecting identical lhs/rhs terms before emitting an EqualsClaim (docs/design-testgen-generative-categories.md:9-12, src/v4/lens/testgen.dag:680). The new AlgebraLaw corpus also moves away from operation/value mirror symbols and records the remaining Nat expression encoding as a bounded bridge (src/v4/test/claim/generated/algebra_law_conformance.dag:43, src/v4/TASKS.md:872). The findings above are single-authority/modeling repairs, not a semantic retreat from the non-tautological generator plan.

3. Verdict

REQUEST_CHANGES

The PR’s direction is sound, and the added ratchets show the T-19 lane is being advanced deliberately. I would not merge it until the duplicate coproduct-exhaustiveness reason symbol is collapsed to one authority and AlgebraLawCase stops carrying an anchor/subject pair that can represent mismatches.

@briansrls

Copy link
Copy Markdown
Contributor Author

Superseded by consolidated PR #3636 (consolidated/correctness-sweep). All changes from this branch are included; DiagnosticExhaustivenessSubject conflict resolved in favour of HEAD's omitted_variant design from T-19 #3561.

@briansrls briansrls closed this May 25, 2026
briansrls added a commit that referenced this pull request May 25, 2026
Consolidates session/quiet-moth-603 into consolidated/correctness-sweep.

Changes from PR #3557:
- src/v4/lens/testgen.dag: add AlgebraLawCase type + algebra_law_manual_claim_case
  helper, testgen_emit_algebra_law_claim, add algebra_law_subject_for_manual_anchor
  (subset not already on main), add Generator.kind field
- src/v4/test/claim/generated/algebra_law_conformance.dag: new generated corpus of
  Nat algebra law TestClaims (law_nat_add_left_identity, add_associativity,
  mul_annihilator)
- src/v4/test/claim/generated/testgen_category_wishlist.dag: new dispatch ledger
  (3 pending + 4 dispatched non-tautological generator categories; TestgenOracleBasis
  type, dissolve-on-arrival)
- docs/design-testgen-generative-categories.md: design doc for non-tautological
  generator categories
- src/v4/std/verification.dag: add test_claim_coproduct_variant function
- src/v3/compiler/tests/integration/v4_lens_testgen_dag_smoke_test.rs: expanded
  smoke receipts
- src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs: new
  assertions for wishlist + algebra law case helpers
- src/v4/TASKS.md: T-19 follow-up task entries
- scripts/check_t19_testgen_activation.py: testgen activation check script
- INVARIANTS.md: updated smoke-test receipt row for testgen
- scripts/v4-mvp1-e2e-gate.sh: cargo run exit-status fix

Conflict resolution: DiagnosticExhaustiveness variant shape conflict resolved in
favour of HEAD (omitted_variant: TestClaimCoproductVariant from T-19 #3561).
Branch's DiagnosticExhaustivenessSubject type removed; coproduct_exhaustiveness.dag
and testgen_category_wishlist.dag updated to use HEAD's omitted_variant shape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 25, 2026
…iler pipeline correctness (#3636)

* squash-merge PR #3557: Generative TestClaim categories lane

Consolidates session/quiet-moth-603 into consolidated/correctness-sweep.

Changes from PR #3557:
- src/v4/lens/testgen.dag: add AlgebraLawCase type + algebra_law_manual_claim_case
  helper, testgen_emit_algebra_law_claim, add algebra_law_subject_for_manual_anchor
  (subset not already on main), add Generator.kind field
- src/v4/test/claim/generated/algebra_law_conformance.dag: new generated corpus of
  Nat algebra law TestClaims (law_nat_add_left_identity, add_associativity,
  mul_annihilator)
- src/v4/test/claim/generated/testgen_category_wishlist.dag: new dispatch ledger
  (3 pending + 4 dispatched non-tautological generator categories; TestgenOracleBasis
  type, dissolve-on-arrival)
- docs/design-testgen-generative-categories.md: design doc for non-tautological
  generator categories
- src/v4/std/verification.dag: add test_claim_coproduct_variant function
- src/v3/compiler/tests/integration/v4_lens_testgen_dag_smoke_test.rs: expanded
  smoke receipts
- src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs: new
  assertions for wishlist + algebra law case helpers
- src/v4/TASKS.md: T-19 follow-up task entries
- scripts/check_t19_testgen_activation.py: testgen activation check script
- INVARIANTS.md: updated smoke-test receipt row for testgen
- scripts/v4-mvp1-e2e-gate.sh: cargo run exit-status fix

Conflict resolution: DiagnosticExhaustiveness variant shape conflict resolved in
favour of HEAD (omitted_variant: TestClaimCoproductVariant from T-19 #3561).
Branch's DiagnosticExhaustivenessSubject type removed; coproduct_exhaustiveness.dag
and testgen_category_wishlist.dag updated to use HEAD's omitted_variant shape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* squash-merge PR #3587: compiler pipeline correctness sweep

Consolidates session/deep-bear-704 into consolidated/correctness-sweep.

AI-5 InferredFacts illegal-state dissolution:
- src/v4/compiler/04_infer.dag: InferredFacts restructured from
  {resolved_type, inhabits, descent, canonical} to {grounding: CanonicalGrounding,
  descent}; new gate fn canonical_grounding_admits_infer_facts; new accessors
  inferred_facts_resolved_type/algebra_ref/canonical_witness/descent;
  inferred_facts_from_grounding returns Outcome<InferredFacts>
- src/v4/std/constraints.dag: CanonicalGrounding as sole production path

AI-7 TestClaimCacheKey restructuring:
- src/v4/compiler/05_eval.dag: TestClaimCacheKey<T> carries hash_staging:
  TestClaimCacheKeyStagingPlaceholder; import non_empty from v4.std.algebra

AI-13 SurfaceSugarKind scaffold marker upgrades:
- src/v4/compiler/03_normalize.dag, 00_compile.dag: updated scaffold markers

AI-14 LexPattern/GrammarExpr parallel ASTs:
- src/v4/compiler/01_tokenize.dag: scaffold comments updated to HEAD standard

AI-15/R1-2 translate source gap, R1-3 constraints singleton-MVP,
R1-4 Lens apply_lens stub, R1-5 eval loop:
- src/v4/compiler/06_translate.dag, 02_parse.dag: updates
- src/v4/test/claim/lens_common/infer_fixture.dag: removes algebra_witness_symbol
  and canonical_evidence_symbol params; adds claim_canonical_grounding,
  claim_inferred_facts_witness, claim_inferred_facts_from_nodes

Conflict resolution: eval conflicts resolved in favour of HEAD (T-22 Wave 2
#3611 is more complete); 01_tokenize.dag comment conflicts took HEAD's dissolution
markers; 04_infer.dag took branch's explanatory comment for InferredFacts shape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: remove unused non_empty import from 05_eval.dag

* fix: restore coproduct_exhaustiveness_missing_variant check (revert stale DiagnosticExhaustivenessSubject strings)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: drop stale t19_ prefix from wishlist check needle (symbol renamed in HEAD design)

* fix: update coproduct_exhaustiveness check needles to omitted_variant design

* fix: update 05_eval.dag to new InferredFacts API; drop t19_ prefix from algebra_law_anchor_mismatch

- Replace dissolved inferred_facts_resolved_type_matches/inhabitance_well_grounded/canonical_well_grounded calls in eval_runtime_value_acceptance_witness with inferred_facts_resolved_type equality check and canonical_grounding_admits_infer_facts (new 04_infer.dag API)
- Declare algebra_law_anchor_mismatch symbol and replace undefined t19_algebra_law_anchor_mismatch reference in testgen.dag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: enforce InferredFactsEntry node==grounding.node invariant; add T-19 AlgebraLaw receipt to TASKS.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* WIP: PM May 22

* fix: add facts.grounding.node == node guard in inferred_facts_for_eval

Eval consumption point must verify the map hit is for the correct node.
`canonical_grounding_admits_infer_facts` only checks grounding internal
consistency; it does not guard against a map returning facts whose
grounding.node diverges from the lookup key.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: add P5 receipt for T-19 AlgebraLaw expansion in INVARIANTS.md SG-0 table

Per INVARIANTS.md P5 Mechanism (b): expanded hand-Rust under src/v3/ requires
a checkable receipt. The AlgebraLaw Nat corpus assertions in
v4_test_bootstrap_infra_closeout_test.rs land in this PR; the deferral
lane is TASKS.md §T-19 (algebra_law_conformance.dag corpus) + ROADMAP.md
Nine lanes row T-PB-B.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: make facts_map_from_entries fail-closed via Outcome

Previously, facts_map_from_entries silently dropped InferredFactsEntry
items where entry.node != entry.facts.grounding.node. This compensated
for the free constructibility of InferredFactsEntry (P2 boundary gap)
without surfacing the violation diagnostically.

Now: the fold rejects with infer_canonical_grounding_incoherent_diagnostic
on any invariant-violating entry, and infer() threads the Outcome.
admitted_inferred_facts_entry remains the primary enforcement point;
facts_map_from_entries is the secondary fail-closed gate that makes
invariant violations visible as Rejected rather than silent drops.

Addresses codex RC on bc16ae7: InferredFactsEntry remained freely
constructible and map construction compensated with a nondiagnostic filter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: replace bare [] with typed helper in facts_map_from_entries

The v4 compiler cannot infer the element type of [] when it appears
as a record field value inside Accepted { value: [], ... }. Introduce
empty_inferred_facts_entry_list() -> List<InferredFactsEntry> (matching
the existing empty_edge_list / empty_canonical_symbol_set pattern) and
use it as the fold init.

Fixes Lens-CI semantic compile failure on d1299ea.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: add P5 receipt for PR #3636 anchor-strip + AlgebraLaw subject helper guard in INVARIANTS.md

- Updates Generator field name from t19_anchor to anchor in existing ratchet description
- Appends PR #3636 same-file receipt: renamed tests, new kind/anchor assertions,
  assert_six_algebra_law_subject_paths_in_testgen, forbidden nat_algebra_law_subject_symbol_*
  checks, and generalized generator_field_ty / between helpers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: update stale T19-prefix type names in INVARIANTS.md testgen row

- Rename test fn refs: t19_anchor_field_is_manual_key → anchor_field_is_claim_anchor_key,
  concept_projection_matches_claim_t19_anchor → _claim_anchor,
  generator_carries_claim_kind_and_classification → _classification_and_anchor
- Update description: T19ManualAnchorKey → ManualAnchorKey, Generator.t19_anchor → Generator.anchor,
  T19ClaimAnchorKey → ClaimAnchorKey, TestClaim.t19_anchor → TestClaim.anchor,
  T19ManualClaimAnchor → ManualClaimAnchor, T19ManualAnchorAbsent → ManualAnchorAbsent,
  T19GeneratedClaimAnchor → GeneratedClaimAnchor
- Update inline carrier description: Generator.t19_anchor: T19ClaimAnchorKey → Generator.anchor: ClaimAnchorKey

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* WIP: PM May 22

* fix: strip stale T19 names from closeout + testgen INVARIANTS rows (cursor RC #17566)

Line 374 (v4_test_bootstrap_infra_closeout_test.rs): update 7 test fn names
(t19_testgen_concept_surface_stays_closed_and_classified → testgen_..., etc.) and
6 type names (T19ManualAnchorKey → ManualAnchorKey, TestClaim.t19_anchor → .anchor,
t19_manual_claim_anchor → manual_claim_anchor, T19GeneratedCoproductExhaustiveness,
T19GeneratedClaimAnchor, T19ClaimAnchorKey).

Line 383 (v4_lens_testgen_dag_smoke_test.rs): simplify PR #3636 receipt section to
remove all from→to rename references; receipt now describes current ratchet state only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(04_infer): adapt merge-conflict resolution to our InferredFacts struct layout

The merge of main (PR #3646) erroneously took code that references
`facts.inhabits.algebra` and `inferred_facts_canonical_grounding_coherent`,
both of which belong to main's refactored InferredFacts struct. Our branch
carries `InferredFacts { grounding, descent }`, so the guards must use
`inferred_facts_algebra_ref(facts: facts).algebra` and
`canonical_grounding_admits_infer_facts(grounding: facts.grounding)` instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* WIP: PM May 22

* WIP: PM May 22

* WIP: PM May 22

* WIP: PM May 22

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@briansrls
briansrls deleted the session/quiet-moth-603 branch June 1, 2026 18:42
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