Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/briefs/r3-v-pattern-a-tc1-v1-worker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# R3 Pattern-A — TC1 first executable slice (V1) Worker Brief

**Status:** **HELD** — **Director η non-vacuity (Branch B)** 2026-05-06 ([gunbc#828](https://github.com/gunb-ai/gunbc/issues/828)). **Q-Reification CLEARED 2026-05-07** ([Option A ratified](https://github.com/gunb-ai/gunbc/pull/2096), `Dag` IS the reflected program; no separate carrier). **Q-PAFS Path A** remains **ACCEPTED** (PR [#1824](https://github.com/gunb-ai/gunbc/pull/1824) merge record on `main`). **V1 (`tc1_eta_equivalence_executable`) unpairs** from Evaluator **E3 Option 3** narrow **argument-opaque** representative slice for **TC1 acceptance** — that shape yields **vacuous** `BinaryDimensionReportEquals` (constant `DimensionReport<C>`); it cannot honestly close the gate against [`r3-v-tc1-eta-equivalence-deeper-analysis.md`](r3-v-tc1-eta-equivalence-deeper-analysis.md) §What TC1 Asserts + §Strict-Fire Extension Surface. **Resume dispatch** only after lens fold consumes `Dag` via `.dag` body authority through Evaluator (real lens-over-Dag fold, non-vacuous η obligation) **or** Director-visible §1.8 / program-plan semantics revision (explicit "plumbing-only" TC1 milestone — **not** ratified 2026-05-06). **Q-Reification gate is cleared**; remaining hold is Branch B η non-vacuity only.
**Status:** **HELD on Branch B η-non-vacuity** — Director η non-vacuity (Branch B) 2026-05-06 ([gunbc#828](https://github.com/gunb-ai/gunbc/issues/828)). **Scaffold landed at [PR #2184](https://github.com/gunb-ai/gunbc/pull/2184) with NotYetImplemented sentinel pending E3.c upgrade** per Director (C-modified) ratification at [gunbc#828](https://github.com/gunb-ai/gunbc/issues/828) on 2026-05-07; consumer wiring (η-pair callables + `BinaryDimensionReportEquals` predicate + integration test) cleanly authored under Option 3 hard bars (no `lens_apply` / `eval_substrate_reify` / `reflect_behavior` imports). Sentinel assertion is fail-closed-by-construction — actual implementation that runs WILL fail the NotYetImplemented assertion when Evaluator E3.c ([#1970](https://github.com/gunb-ai/gunbc/issues/1970)) lands, forcing fixture upgrade. §1.8 #11 stays **DECLARED** until E3.c merges and assertion upgrades; flip then is DECLARED → CONSUMER_LANDED → PASSING in one move. Original (pre-scaffold) HELD framing follows. **Q-Reification CLEARED 2026-05-07** ([Option A ratified](https://github.com/gunb-ai/gunbc/pull/2096), `Dag` IS the reflected program; no separate carrier). **Q-PAFS Path A** remains **ACCEPTED** (PR [#1824](https://github.com/gunb-ai/gunbc/pull/1824) merge record on `main`). **V1 (`tc1_eta_equivalence_executable`) unpairs** from Evaluator **E3 Option 3** narrow **argument-opaque** representative slice for **TC1 acceptance** — that shape yields **vacuous** `BinaryDimensionReportEquals` (constant `DimensionReport<C>`); it cannot honestly close the gate against [`r3-v-tc1-eta-equivalence-deeper-analysis.md`](r3-v-tc1-eta-equivalence-deeper-analysis.md) §What TC1 Asserts + §Strict-Fire Extension Surface. **Resume dispatch** only after lens fold consumes `Dag` via `.dag` body authority through Evaluator (real lens-over-Dag fold, non-vacuous η obligation) **or** Director-visible §1.8 / program-plan semantics revision (explicit "plumbing-only" TC1 milestone — **not** ratified 2026-05-06). **Q-Reification gate is cleared**; remaining hold is Branch B η non-vacuity only.

**Parent:** [`docs/briefs/r3-verification-manager.md`](r3-verification-manager.md) — absorbed formal-grounding / Pattern-A cluster (not a fourth lane; see [`docs/r3-structure.md`](../r3-structure.md) §"Manager structure").

Expand Down
2 changes: 1 addition & 1 deletion docs/r3-program-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ This principle is NOT a separate lane; it's a per-lane gate-shape requirement ap
| 8 | `sg0_non_test_zero` | state-check | T-LensProducer-Retirement | DECLARED | SG-0 EXPECTED_HAND_AUTHORED_NON_TEST count = 0 |
| 9 | `l4_emit_eval_match` | structural-fold | T-V-L4-L7-Direct | DECLARED (skeleton/staged per Verification Mgr poke-hole) | per-program emit ↔ eval algebraic equality |
| 10 | `l7_algebraic_laws_witnessed` | alg-law-witness | T-V-L4-L7-Direct | DECLARED (skeleton/staged) | exhaustive per-(algebra, inhabitant, law) coverage |
| 11 | `tc1_eta_equivalence_executable` | DimensionReport-typed | T-V-L4-L7-Direct | DECLARED (NEW 2026-05-06) | runtime prereq: G1.a static-rep OR G1.b generic + eta relation |
| 11 | `tc1_eta_equivalence_executable` | DimensionReport-typed | T-V-L4-L7-Direct | DECLARED (NEW 2026-05-06; scaffold authored PR #2184 with NotYetImplemented sentinel per Director (C-modified) ratification at #828; assertion upgrades on Evaluator E3.c (#1970) merge → flips DECLARED → CONSUMER_LANDED → PASSING in one move) | runtime prereq: G1.a static-rep OR G1.b generic + eta relation |
| 12 | `tc2_church_rosser_executable` | DimensionReport-typed | T-V-L4-L7-Direct | DECLARED (NEW 2026-05-06) | runtime prereq: second strategy/input order + strategy-keyed report |
| 13 | `tc3_pattern_a_second_mover_executable` | DimensionReport-typed | T-V-L4-L7-Direct | DECLARED (NEW 2026-05-06) | runtime prereq: Descent execution proof (E5) + eval-step producer |
| 14 | `rust_dag_isomorphism_executable` | Dag-iso | T-V-L4-L7-Direct | DECLARED (NEW 2026-05-06) | runtime prereq: shape-report producers |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// std.tc1_substrate_lens_eta_equivalence_strict_fire — TC1 V1 first slice (Pattern-A / E6-G1.a).
//
// Authority chain (Director ratifications, current as of 2026-05-07):
// - Q-PAFS Path A ACCEPTED 2026-05-06 (PR #1824 merge record on `main`).
// - Q-Reification Option A ratified 2026-05-07 (PR #2096): `Dag` IS the reflected program.
// - Substrate Mgr Gate A patches MERGED 2026-05-07 (PR #2079, commit 0e8724bc).
// - V1 dispatch unblocked by Verification Mgr (wise-bear-525, #2075) per Director cascade
// UNHOLD signal at gunbc#828 #issuecomment-4394467134.
//
// Differences vs `tc1_substrate_lens_eta_equivalence_deferred.dag`:
// - Canonical TestClaim name `tc1_eta_equivalence_executable` per `r3-program-plan.md` §1.8 #11
// (deferred fixture's claim name is the R2 research-receipt form, not the §1.8 gate name).
// - Adds the η-pair callables `eta_subject_f` / `eta_subject_f_eta` at source level — η-equivalent
// pair `f` and `lambda x. apply(f, [x])` per TC1 statement (`r3-v-tc1-eta-equivalence-deeper-
// analysis.md` §"What TC1 Asserts"). Both compute the same `Int` value structurally.
// - Predicate stays `BinaryDimensionReportEquals` (Pattern-A consumer envelope; unified
// surface ratified at gunbc#828).
//
// Runner status today: `BinaryDimensionReportEquals` shape-only — `eval_binary_dimension_report_
// equals_shape` (in `src/v3/compiler/src/test_runner.rs`) returns `NotYetImplemented` with the
// "structural shape is valid for ... runner evaluation waits for generic DimensionReport<C>
// production/evaluation substrate" reason. Per Director (C-modified) ratification at gunbc#828
// 2026-05-07: §1.8 gate #11 status STAYS DECLARED on this scaffold landing — the
// NotYetImplemented sentinel is fail-closed-by-construction (an actual implementation that runs
// WILL fail the assertion when Evaluator E3.c lands, forcing fixture upgrade). Status flips
// DECLARED → CONSUMER_LANDED → PASSING in one move on E3.c (gunbc#1970) merge.
//
// Hard bars (E6-G1.a Option 3 caveat #1853): no `lens_apply` / `eval_substrate_reify` /
// `reflect_behavior` imports. Carrier shape is the ratified Q-Reification Option A `Dag`-as-
// carrier (Verification consumes; does not introduce).

module std.tc1_substrate_lens_eta_equivalence_strict_fire

import std.dimensions { DimensionReport }
import std.verification {
BinaryDimensionReportEquals,
TestClaim,
TestSuite
}

// Carrier for the TC1 eta-equivalence observation. Stays opaque at this slice — the carrier
// identity is what BinaryDimensionReportEquals normalizes on (left/right must agree).
type Tc1EtaLensObservation {}

// η-pair callables — both compute the same `Int` value. `eta_subject_f_eta` is the η-expanded
// form `lambda x. apply(eta_subject_f, [x])`; the lens-fold-over-`Dag` of either should yield
// equal `DimensionReport<Tc1EtaLensObservation>` values once Evaluator E3.c lands the
// substrate-fact projection path. These declarations make the η-pair source-visible (Mgr/
// reviewer can read non-vacuity intent off the .dag) even though runtime fold isn't wired
// at this slice.
fn eta_subject_f(x: Int) -> Int = x + 1
fn eta_subject_f_eta(x: Int) -> Int = eta_subject_f(x)

// Typed report refs — the unified `BinaryDimensionReportEquals` consumer envelope reads
// these as `DeclarationRef`s and validates carrier-equivalence today. Fold-output wiring
// is Evaluator-side per #1970 cross-Mgr split.
type tc1_subject_f_report = DimensionReport<Tc1EtaLensObservation>
type tc1_subject_eta_expanded_report = DimensionReport<Tc1EtaLensObservation>

// §1.8 gate #11 canonical TestClaim name. Predicate uses the unified `BinaryDimensionReport
// Equals` shape; the eta pair is declared above as `eta_subject_f` / `eta_subject_f_eta` for
// source-visible η-pair witness — the runtime fold-application is Evaluator-side authority.
data tc1_eta_equivalence_executable_claim: TestClaim = {
name: "tc1_eta_equivalence_executable",
source: "// TC1 V1 strict-fire — eta-equivalent .dag programs declared in fixture module;\n// runtime lens-fold-over-Dag gated on Evaluator E3.c (gunbc#1970).\nlet _: Int = 0\n",
file_name: "tc1_eta_equivalence_executable.v3",
predicate: BinaryDimensionReportEquals(
tc1_subject_f_report,
tc1_subject_eta_expanded_report
),
requires: []
}

data tc1_substrate_lens_eta_equivalence_strict_fire_suite: TestSuite = {
name: "tc1_substrate_lens_eta_equivalence_strict_fire_suite",
claims: [tc1_eta_equivalence_executable_claim]
}
2 changes: 2 additions & 0 deletions src/v3/compiler/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ mod t_pb_b_1_dag_runner_test;
mod t_pb_b_brief_d_fixture_smoke_test;
#[path = "integration/tc1_substrate_lens_eta_equivalence_deferred_test.rs"]
mod tc1_substrate_lens_eta_equivalence_deferred_test;
#[path = "integration/tc1_substrate_lens_eta_equivalence_strict_fire_test.rs"]
mod tc1_substrate_lens_eta_equivalence_strict_fire_test;
#[path = "integration/tc3_strong_normalization_deferred_test.rs"]
mod tc3_strong_normalization_deferred_test;
#[path = "integration/test_runner_test.rs"]
Expand Down
3 changes: 3 additions & 0 deletions src/v3/compiler/tests/integration/sg0_census_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
// direction ratified for #1179, comment 4341788769; mechanical checklist c4341800724;
// cycle-5 merge hygiene gunb-ai/gunbc#1142 c4341940508).
"src/v3/compiler/tests/integration/tc1_substrate_lens_eta_equivalence_deferred_test.rs",
// TC1 V1 strict-fire — §1.8 gate #11 (`tc1_eta_equivalence_executable`); Q-PAFS Path A
// (E6-G1.a static representative) per Director ratification cascade 2026-05-06/07.
"src/v3/compiler/tests/integration/tc1_substrate_lens_eta_equivalence_strict_fire_test.rs",
"src/v3/compiler/tests/integration/tc3_strong_normalization_deferred_test.rs",
"src/v3/compiler/tests/integration/test_runner_test.rs",
"src/v3/compiler/tests/integration/thesis_parallelism_test.rs",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//! **Layer:** integration
//!
//! TC1 substrate lens eta-equivalence — strict-fire executable form (§1.8 gate #11).
//!
//! V1 first slice per Pattern-A / E6-G1.a (Q-PAFS Path A ACCEPTED 2026-05-06; Q-Reification
//! Option A ratified 2026-05-07 in PR #2096; Substrate Gate A merged 2026-05-07 in PR #2079).
//! Cross-Mgr split per Evaluator E3.c (gunbc#1970): Verification authors the .dag-side η-pair +
//! lens consumer envelope; Evaluator wires lens-fold-over-`Dag` substrate-fact projection.
//!
//! Today's runner returns `NotYetImplemented` with the canonical "structural shape is valid"
//! reason (`eval_binary_dimension_report_equals_shape` in `src/v3/compiler/src/test_runner.rs`).
//! Per Director (C-modified) ratification at gunbc#828 2026-05-07: §1.8 gate #11 status STAYS
//! DECLARED on this scaffold landing; the NotYetImplemented sentinel is fail-closed-by-
//! construction (any actual implementation that runs WILL fail this assertion when E3.c lands,
//! forcing fixture upgrade). Status flips DECLARED → CONSUMER_LANDED → PASSING in one move on
//! Evaluator E3.c (gunbc#1970) merge + assertion upgrade.

use v3_compiler::compile_to_dag;
use v3_compiler::test_runner::{ClaimResult, TestRunner};
use v3_compiler::CompileError;

const FIXTURE_SOURCE: &str =
include_str!("../fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag");
const FIXTURE_PATH: &str =
"src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag";
const SUITE_NAME: &str = "tc1_substrate_lens_eta_equivalence_strict_fire_suite";

#[test]
fn tc1_strict_fire_suite_has_canonical_executable_claim_with_valid_binary_shape() {
let dag = match compile_to_dag(FIXTURE_SOURCE, FIXTURE_PATH) {
Ok(dag) => {
assert!(
dag.diagnostics().is_empty(),
"{FIXTURE_PATH}: expected empty module diagnostics, got {:?}",
dag.diagnostics().iter().collect::<Vec<_>>()
);
dag
}
Err(CompileError::Semantic(dag)) => panic!(
"{FIXTURE_PATH} should lower without module diagnostics. Got `Err(Semantic)`: {:?}",
dag.diagnostics().iter().collect::<Vec<_>>()
),
Err(other) => panic!("unexpected compile error for {FIXTURE_PATH}: {other:?}"),
};

let results = TestRunner::new(&dag).run_suite(SUITE_NAME);
assert_eq!(results.len(), 1, "strict-fire suite has exactly one claim");
assert_eq!(
results[0].claim_name, "tc1_eta_equivalence_executable",
"claim name must be the §1.8 #11 canonical gate name"
);
// Today: shape-valid NotYetImplemented (runner waits on Evaluator E3.c / gunbc#1970).
// When E3.c lands, this assertion flips from NotYetImplemented to Pass — that is the
// §1.8 #11 CONSUMER_LANDED → PASSING transition without further fixture edits.
assert!(
matches!(
&results[0].result,
ClaimResult::NotYetImplemented(reason)
if reason.contains("BinaryDimensionReportEquals")
&& reason.contains("structural shape is valid")
),
"expected BinaryDimensionReportEquals shape-valid NotYetImplemented, got {:?}",
results[0].result
);
}

// INVARIANTS P1 / P5 — checkable receipt: this integration crate must not build if the cited
// worker brief is missing from the worktree.
const _: &str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../../docs/briefs/r3-v-pattern-a-tc1-v1-worker.md"

This comment was marked as resolved.

));
Loading