diff --git a/.claude/board/AGENT_LOG.md b/.claude/board/AGENT_LOG.md index 67b4b1488..31b23b002 100644 --- a/.claude/board/AGENT_LOG.md +++ b/.claude/board/AGENT_LOG.md @@ -1,3 +1,11 @@ +## 2026-07-17 — D-TSC-1b style-table agreement probe + D-TRI-2 NO-GO scoping — measurement, shipped + +- **Task:** the next unblocked slice after #711. Scoped D-TRI-2 (12-step ↔ 12-family agreement) → **NO-GO, mint-blocked** (both vectors are codebook views of the unbuilt minted register — one Opus scoping agent, file:line evidence). Pivoted to the genuinely-unblocked cousin: measure the 3 shipped 12-family param tables' agreement with the `jc::reliability` battery (closes the loop on #709/#710). +- **Fleet:** 1 Opus scoping agent (D-TRI-2 GO/NO-GO + alternative) → 1 Sonnet worker (transcribe 3 tables faithfully + author the jc example + run). Main thread verified transcription against all three sources (A/B/C + `FieldModulation::default`) and re-ran the probe. +- **Deliverable:** `crates/jc/examples/style_table_agreement.rs` (+ `[[example]]` in `crates/jc/Cargo.toml`). Runs ICC(2,1)/ICC(3,1)/Cronbach α/pairwise Pearson-Spearman per shared dim (resonance/fan_out/exploration) in all-12 and 7-explicit modes; pre-registered ICC bands (0.75/0.50); exit-0 (DISTINCT is a valid finding, never a build failure). +- **Measured verdict:** A(`UNIFIED_STYLES`)≡B(thinking-engine `StyleParams`) PERFECT (r=ρ=1.0 — M9-dedup confirmed); planner C's 7 explicit families IDENTITY (ICC 0.90–0.98); ONLY the 5 planner `default_modulation` fallbacks drift (all-12 ICC 0.71 AMBIGUOUS) → TD-PLANNER-STYLE-DEFAULT-DRIFT-1 (fill the 5 arms from canonical). Retires numeric half of O5. +- **Board:** EPIPHANIES `E-D-TRI-2-MINT-BLOCKED-1` (NO-GO + measured verdict); STATUS_BOARD `D-TSC-1b` row; TECH_DEBT `TD-PLANNER-STYLE-DEFAULT-DRIFT-1`; triangle plan §6 D-TRI-2 annotation. Branch `claude/review-claude-board-files-nhqgx1`; PR pending. NOTE `D-TSC-1b` id chosen to avoid collision with the pre-existing OGAR-mint `D-TSC-2`. + ## 2026-07-17 — D-MBX-A6-P3b output-overhaul carrier (StrategyOutcome on PlanInput) — planner-internal, shipped - **Task:** retire the `StyleStrategy::plan()` dead-store `_reliability` onto an honest carrier (the D-MBX-A6 output overhaul), the next unblocked plateau after P5a (jc battery, #709/#710). diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index 111855d1c..382cbb5d7 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,16 @@ +## 2026-07-17 — E-D-TRI-2-MINT-BLOCKED-1 — D-TRI-2's two 12-vectors are BOTH codebook views of the unbuilt minted register; the probe is not runnable pre-mint. The genuinely-unblocked cousin is measuring the THREE shipped 12-family param tables' agreement (D-TSC-1b, RUN) + +**Status:** SHIPPED (D-TSC-1b probe `crates/jc/examples/style_table_agreement.rs`, exit-0, transcription spot-checked against all three sources). The D-TRI-2 NO-GO is scoping-only (no code); the unblocked cousin was BUILT + RUN with a measured verdict (below). (`D-TSC-1b` — the D-TSC-1 dedup MEASURED; distinct from the pre-existing `D-TSC-2` = OGAR cognition-domain mint.) Uses the merged `jc::reliability` battery (#709/#710). + +**Measured verdict (D-TSC-1b, this run — point estimates, hand-tuned ICC bands, not Jirak-calibrated):** +- **Table A (`UNIFIED_STYLES`) ≡ Table B (thinking-engine `StyleParams`): PERFECTLY identical** — Pearson & Spearman = 1.0000 on all three dims in both modes. `UNIFIED_STYLES` fused the thinking-engine params by construction (engine_bridge.rs:520-526 doc), so this confirms the M9-dedup: the two are one table in two homes, zero drift. +- **Planner Table C, 7 explicitly-calibrated families (Mode B): IDENTITY on all three dims** — ICC(2,1) 0.9326 (resonance) / 0.9038 (fan_out) / 0.9756 (exploration). Where the planner author wrote a real arm, it agrees strongly with the canonical A/B. +- **The ONLY drift is the planner's 5 `default_modulation` fallback families** (`convergent`, `systematic`, `divergent`, `diffuse`, `peripheral` → flat `(0.7, 6, 0.3)`): folding them in (Mode A, all-12) drops ICC(2,1) to 0.7134 (resonance) / 0.7126 (fan_out) = **AMBIGUOUS**, 0.8719 (exploration) = IDENTITY. Those 5 families are extreme in A/B (e.g. `peripheral` = 0.20/20/0.60, `divergent` = 0.40/10/0.70) but flattened to the default in C. **Actionable fix (TD, not this PR):** fill the 5 missing planner `default_modulation` arms from the canonical A/B table (or have the planner read `StyleFamily::params()` directly), retiring the divergence — the concrete D-TSC-1 dedup follow-through, and the numeric half of open census question O5. + +- **NO-GO for D-TRI-2 as written** ("12-step ↔ 12-family agreement, jc battery over real shader cycles", plan §6 `:346`). Both vectors are, by the plan's own §4 construction, two ClassView-codebook readings of the SAME 12-slot palette256 register — the minted `FrozenStyle`/`LearnedStyle`/`ExploreStyle` tenant (12×u8), which is LAYOUT-GATED behind the batched mint (D-TRI-1, DESIGN-only, no bytes land). Evidence (shipped code): `StepMask` is a `u64` *selection bitmask*, not a scalar 12-vector (`contract/step_mask.rs:40`); `StyleFamily` is a 12-*label* enum + `ALL` (`contract/style_family.rs:31,:61`) but the driver selects ONE family/cycle, never a 12-score vector (`cognitive-shader-driver/driver.rs:261,:279`); `UNIFIED_STYLES` is a compile-time constant (zero cross-cycle variance, `engine_bridge.rs:545`); the 12-step↔12-family positional correspondence is itself a property of the unbuilt tenant (plan `:287-291,:308-310`). ⇒ no populated, per-cycle-varying, positionally-aligned data exists. Building a fixture would measure invented data (measurement-before-synthesis / Rule-23 violation). +- **The unblocked cousin (BUILT + RUN as D-TSC-1b — verdict above):** three shipped, populated per-family param tables over the same 12 families share dimensions (`resonance_threshold`, `fan_out`, `exploration`) and have NEVER been measured for agreement — the exact D-TSC-1 "five style tables diverged silently because nobody measured" failure mode, and open census question O5 (`persona-vs-rung-ladder.md`). The tables: `UNIFIED_STYLES` (`cognitive-shader-driver/src/engine_bridge.rs:545`, 12-complete), thinking-engine `StyleParams` (`crates/thinking-engine/src/cognitive_stack.rs:55-141`, 12-complete), planner `FieldModulation::default_modulation` (`lance-graph-planner/src/thinking/style.rs:74-142`, **7 of 12 explicit, 5 fall to `default()`**). Probe = jc over [12 families as subjects × 3 tables as raters] per shared dimension: `icc(Icc2_1)` (absolute agreement — same value?) + `icc(Icc3_1)` (consistency) + pairwise `pearson`/`spearman` + `cronbach_alpha`. **Subtleties the impl MUST handle:** (a) the three tables use DIFFERENT family orderings — align by the canonical `StyleFamily` ordinal (`UNIFIED_STYLES` alignment is pinned by `unified_styles_align_with_style_family`; confirm thinking-engine's keying); (b) the planner's 5 default-filled rows bias agreement upward — run BOTH "all-12 with planner-defaults" AND "7 planner-explicit only" and report both. Point estimates only (I-NOISE-FLOOR-JIRAK — significance is `jc::jirak`'s job); thresholds pre-registered + labeled hand-tuned; **"distinct constructs" is a PASS/record outcome, never a build failure** (same discipline D-TRI-2 pre-registered). Home: a `jc` example (transcribe the 3 tables with per-value `// SOURCE: file:line` provenance — jc cannot dep the three crates, so faithful transcription + spot-check against source is the fidelity gate). +- Cross-ref `E-JC-IS-NOT-A-METRIC-BATTERY-1` (the battery this consumes), `D-TSC-1` (the dedup this measures), plan `triangle-tenants-gestalt-separation-v1.md:346` (D-TRI-2 blocked pending D-TRI-1 mint). + ## 2026-07-17 — E-STRATEGY-OUTCOME-CARRIER-1 — the planner's dead-store `_reliability` is retired onto an honest `PlanInput.outcome` carrier; StyleStrategy surfaces reliability + a *bootstrap* intended KanbanMove (D-MBX-A6 output overhaul, planner-internal slice) **Status:** SHIPPED (plateau D-MBX-A6-P3b; `crates/lance-graph-planner`, 216 lib + 4 probe tests green, clippy `-D warnings` exit 0). Partially closes the "emit edge" the 2026-05-30 de-theatred entry deferred — this is the SURFACE (carrier + intent), not the emit (owner-consume) and not the OQ-11.7 five-phase cutover. diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index 10f68ed0c..a7726ead7 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -88,6 +88,7 @@ Plan: `.claude/plans/temporal-markov-and-style-classes-v1.md`. Rulings: E-MARKOV | D-MTS-4 | M4 cutover target sharpened: MailboxSoA + temporal stream + palette tenants | driver | Queued | rides M4 parity gate | | D-MTS-5 | Pythagorean-comma vertical-quorum probe (comma-offset vs aligned pyramid; coprime-walk quantization per D-QUANTGATE; Jirak significance) | shader/ndarray | **Measured GREEN 2026-07-10** | `perturbation-sim/examples/comma_quorum.rs`, all pre-registered gates PASS: comma N_eff 11.00/12 vs strict 1.00 / unit 2.49 / rational 3.92; replay bit-identical any order; fresh level-12 +0.83 witnesses at max\|ρ\|=0.156; 82 KB touched vs ~69 GB dense. Bonus measured boundary: N_eff(comma) = min(L, spectral participation) — run #1 FAIL 3.24 kept in the chronicle. See E-COMMA-QUORUM-MEASURED-1 | | D-TSC-1 | M9 ThinkingStyle dedup (5+ copies → contract taxonomy) | workspace | **Shipped 2026-07-10** (first 5+3 council run: spec v1→v2→v3 ratified; `contract::style_family::StyleFamily` + `default_runbook()`/`family()`; FIVE divergent tables replaced — E-FIVE-STYLE-TABLES-1; G1 grep = 1 enum + 3 deprecated aliases; 1549 tests green across 4 crates) | UNBLOCKS D-TSC-2..4 + StepMask catalogue (M9 gate); behavior changes documented + G7-pinned | +| D-TSC-1b | D-TSC-1 dedup MEASURED: `jc::reliability` agreement probe over the 3 shipped 12-family param tables (`UNIFIED_STYLES` / thinking-engine `StyleParams` / planner `FieldModulation`) — the D-TRI-2 mint-free cousin | jc example + workspace | **In PR** | `crates/jc/examples/style_table_agreement.rs`; A≡B perfect (M9 confirmed); planner 7-explicit IDENTITY; only the 5 planner `default_modulation` fallbacks drift (Mode A ICC 0.71 AMBIGUOUS) → TD to fill them from canonical; retires numeric half of O5. E-D-TRI-2-MINT-BLOCKED-1 | | D-TTV-1 | Thinking-related tenants → V3 value-tenant substrate (keep old CausalEdge64 as perturbation baseline) | driver/contract | Queued | E-THINKING-TENANTS-V3-1; envelope-auditor gated; batched mints only | | D-MTS-6 | Smaller-CausalEdge64 × comma awareness curve vs old-CE64 baseline (find the knee: how many stored bits the comma reconstruction replaces before awareness degrades) | shader/perturbation-sim | **Measured GREEN 2026-07-10** | `perturbation-sim/examples/comma_awareness.rs`, all pre-registered gates PASS: **k\*=1** (2 explicit truth bits/edge vs baseline 16) matches all three awareness proxies; aligned control needs k\*=4; the comma lattice buys ≈3.4 effective bits ≈ log₂(12); replay bit-identical; run-#1 G1 mis-registration diagnosed (max flip margin 1.7e-5 = boundary noise) — see E-COMMA-AWARENESS-MEASURED-1. **D-MTS-6b** (driver-integrated fixture) gates any real CE64 shrink | | D-TSC-2 | Batched cognition-domain mint in OGAR (+ classify_form reconciliation if 0xFFFF) | OGAR | Queued (blocked by D-TSC-1) | never solo; COUNT_FUSE | diff --git a/.claude/board/TECH_DEBT.md b/.claude/board/TECH_DEBT.md index 05b69d016..5de0c584b 100644 --- a/.claude/board/TECH_DEBT.md +++ b/.claude/board/TECH_DEBT.md @@ -1,5 +1,9 @@ # Technical Debt Log — Open + Paid (double-entry, append-only) +## TD-PLANNER-STYLE-DEFAULT-DRIFT-1 — the planner's 5 uncalibrated `default_modulation` families are the sole measured divergence from the canonical style tables (2026-07-17, surfaced by D-TSC-1b) + +**Surfaced by the D-TSC-1b agreement probe** (`crates/jc/examples/style_table_agreement.rs`). Measured with `jc::reliability`: the driver `UNIFIED_STYLES` and thinking-engine `StyleParams` tables are byte-identical (A≡B, Pearson/Spearman = 1.0), and the planner `FieldModulation::default_modulation`'s **7 explicitly-written families agree with them at IDENTITY level** (ICC(2,1) 0.90–0.98). The ONLY divergence: the 5 families the planner leaves to `_ => FieldModulation::default()` — `convergent`, `systematic`, `divergent`, `diffuse`, `peripheral` — all get the flat `(resonance 0.7, fan_out 6, exploration 0.3)` default, but those families are extreme in the canonical tables (e.g. `peripheral` = 0.20/20/0.60, `divergent` = 0.40/10/0.70). Folding them in drops all-12 ICC(2,1) to 0.71 (resonance) / 0.71 (fan_out) = AMBIGUOUS. **PAYOFF:** add the 5 missing explicit arms to `default_modulation` (`lance-graph-planner/src/thinking/style.rs:74-142`) sourced from `StyleFamily`'s canonical params — or have the planner read `StyleFamily::params()` / `UNIFIED_STYLES` directly instead of a local partial table (the true M9-dedup close). Retires the numeric half of open census question O5 (`persona-vs-rung-ladder.md`). Not paid here — D-TSC-1b is measurement-only (probe, no behavior change); this is the follow-through it revealed. + ## TD-THINKING-ENGINE-EXCLUDED-DEBT-1 — thinking-engine (excluded, off-CI) carries ~40 pre-existing clippy lints + test-compile failures (2026-07-17) **Surfaced during P3** (rung dedup). thinking-engine is a workspace-EXCLUDED crate (root Cargo.toml `exclude`), so no CI/clippy gate runs on it — it has accumulated ~40 `clippy -D warnings` lints (loop-index, `map_or` simplify, too-many-args, missing-Default; all in modules P3 never touched — e.g. `cognitive_stack.rs:242` MetaCognition::new, `world_model.rs:154` from_engine_state) and at least one test-compile break (`DualResult` missing `convergence_signed`/`convergence_unsigned` fields, a stale test). The **lib builds clean**; only `--tests` and `clippy -D warnings` fail. Correlates with E-RUNG-ASCENT-WIRED-1's finding that the whole crate is orphaned from the production spine (only bridge_gate→callcenter + dto→driver[feature] are external wires). PAYOFF: gated on the P4 ancestry-consolidation decision (wire the gems into the spine → then it earns a CI slot and the debt gets paid; or retire the orphaned cluster). Not paid in P3 (out of scope; excluded crate). diff --git a/.claude/plans/triangle-tenants-gestalt-separation-v1.md b/.claude/plans/triangle-tenants-gestalt-separation-v1.md index 4c6ccb4c6..c3b2a2422 100644 --- a/.claude/plans/triangle-tenants-gestalt-separation-v1.md +++ b/.claude/plans/triangle-tenants-gestalt-separation-v1.md @@ -343,7 +343,7 @@ the template every one of these tenants instantiates. | D-id | Probe | Gate | |---|---|---| | D-TRI-1 | Triangle tenant spec through the envelope-auditor (T1–T6 per lane) behind the batched mint | LAYOUT-GATED verdict; zero ENVELOPE_LAYOUT_VERSION change (additive lanes) | -| D-TRI-2 | 12-step ↔ 12-family agreement: jc battery over real shader cycles (ICC, Pearson/Spearman per position, Cronbach α of each 12-vector as a scale) | pre-registered thresholds BEFORE the run; collapse only on measured identity; distinct-constructs is a PASS outcome too | +| D-TRI-2 | 12-step ↔ 12-family agreement: jc battery over real shader cycles (ICC, Pearson/Spearman per position, Cronbach α of each 12-vector as a scale) | pre-registered thresholds BEFORE the run; collapse only on measured identity; distinct-constructs is a PASS outcome too — **⊘ BLOCKED pre-mint (2026-07-17, `E-D-TRI-2-MINT-BLOCKED-1`): both 12-vectors are codebook views of the unbuilt minted register (D-TRI-1). Runs only AFTER the batched mint. The mint-free cousin — 3 shipped 12-family param tables' agreement — RAN as D-TSC-1b (`crates/jc/examples/style_table_agreement.rs`): A≡B perfect, planner 7-explicit IDENTITY, only the 5 planner defaults drift (→ TD-PLANNER-STYLE-DEFAULT-DRIFT-1).** | | D-TRI-3 | Nail→hammer dispatch: object-resonance → atom retrieval vs the inverted baseline on a labeled fixture | retrieval accuracy + the structural check that no inverted read path exists | | D-TRI-4 | Chess↔thinking transfer: the four metrics between chess-learned and thinking-learned trajectories | unification gate; until green, quarantine stands | | D-TRI-5 | Emulation ≠ resonance: counterfactual-goalstate emulation vs a resonance-only baseline on opponent move prediction (builds on D-SF-OPPONENT-1/3, which measured opponent-model inference as the bottleneck) | pre-registered accuracy margin; a null result demotes §2a's apex claim to [H], never silently | diff --git a/crates/jc/Cargo.toml b/crates/jc/Cargo.toml index 7eeb47f6e..c2127277d 100644 --- a/crates/jc/Cargo.toml +++ b/crates/jc/Cargo.toml @@ -60,3 +60,6 @@ name = "splat_perturbationslernen" [[example]] name = "ontology_locality_probe" + +[[example]] +name = "style_table_agreement" diff --git a/crates/jc/examples/style_table_agreement.rs b/crates/jc/examples/style_table_agreement.rs new file mode 100644 index 000000000..44af499d0 --- /dev/null +++ b/crates/jc/examples/style_table_agreement.rs @@ -0,0 +1,262 @@ +//! Style-table agreement probe — do the three shipped 12-family +//! style-parameter tables measure the SAME construct? +//! +//! Run: `cargo run --manifest-path crates/jc/Cargo.toml --example style_table_agreement` +//! +//! # The three tables +//! +//! - **Table A (driver)** — `cognitive-shader-driver::engine_bridge::UNIFIED_STYLES` +//! // SOURCE: crates/cognitive-shader-driver/src/engine_bridge.rs:545-726 +//! Ordinal-aligned to `StyleFamily::ALL` (pinned by the crate's own test +//! `unified_styles_align_with_style_family`, engine_bridge.rs:778-787). +//! - **Table B (engine)** — `thinking-engine::cognitive_stack::EngineStyleExt::params` +//! // SOURCE: crates/thinking-engine/src/cognitive_stack.rs:55-142 +//! Keyed by `StyleFamily` match arms; re-ordered here to `StyleFamily::ALL` +//! ordinal order by matching variant name (the match arms in the source are +//! NOT in ordinal order). +//! - **Table C (planner)** — `lance-graph-planner::thinking::style::PlannerStyleExt::default_modulation` +//! // SOURCE: crates/lance-graph-planner/src/thinking/style.rs:74-142 (7 explicit +//! arms) + `FieldModulation::default()` at style.rs:165-177 (5 fallback families: +//! convergent, systematic, divergent, diffuse, peripheral — all get the SAME +//! default (0.7, 6, 0.3), which is a distinct value from any of their real +//! per-family calibrations in Tables A/B). +//! +//! All three tables share three overlapping dimensions: `resonance_threshold`, +//! `fan_out` (cast to `f64`), and `exploration`. This probe treats the 12 (or +//! 7) `StyleFamily` variants as SUBJECTS and the 3 tables as RATERS, and asks +//! via `jc::reliability`'s merged battery (ICC / Cronbach α / Pearson / +//! Spearman) whether the three raters agree. +//! +//! # Two modes, because the planner's defaults distort agreement +//! +//! - **Mode A — all-12**: every `StyleFamily` variant, including the 5 the +//! planner defaults (`FieldModulation::default()`). Those 5 get an +//! IDENTICAL default triple (0.7, 6, 0.3) in Table C regardless of what the +//! family actually is, so this mode mixes real per-family disagreement (the +//! 7 explicit families) with default-vs-calibrated noise (the other 5). +//! - **Mode B — 7-explicit-only**: drop the 5 defaulted families, leaving the +//! 7 the planner author actually wrote an arm for (deliberate, analytical, +//! creative, exploratory, focused, intuitive, metacognitive). This is the +//! fairer test of whether Table C's real calibration agrees with A/B. +//! +//! **Measured direction (this run, not assumed):** Mode A's ICC(2,1) came out +//! LOWER than Mode B's on all three dimensions (e.g. resonance_threshold: +//! 0.7134 all-12 vs 0.9326 7-explicit) — the 5 defaulted families' values +//! diverge sharply from their real A/B calibrations (e.g. divergent/ +//! peripheral are extreme in A/B but flattened to the default in C), so +//! folding them in adds disagreement rather than inflating it. Do not assume +//! the direction ahead of running this — it depends on how far the default +//! sits from the true per-family spread, which is exactly why both modes are +//! reported side by side instead of asserting one a priori. +//! +//! # Pre-registered verdict thresholds (hand-tuned, NOT Jirak-derived) +//! +//! Per dimension, using `ICC(2,1)` (two-way random, absolute agreement — +//! Shrout & Fleiss 1979): +//! - `ICC(2,1) >= 0.75` → **IDENTITY** (the tables agree closely) +//! - `ICC(2,1) < 0.50` → **DISTINCT** (the tables measure different things) +//! - otherwise → **AMBIGUOUS** +//! +//! These cutoffs are point-estimate, hand-tuned convention (the same 0.5/0.75 +//! bands commonly used for "poor/moderate/good" ICC bands in the reliability +//! literature), NOT derived from `jc::jirak`'s weak-dependence bound. Per +//! `I-NOISE-FLOOR-JIRAK` (`lance-graph/CLAUDE.md`), significance calibration +//! for THESE 12/7-subject samples is a separate job this probe does not do — +//! it reports point estimates only. **DISTINCT is a valid, useful finding, +//! not a failure of the probe** — if Table C's own defaults diverge from the +//! calibrated per-family values in A/B, that is exactly the kind of +//! type-duplication drift `docs/TYPE_DUPLICATION_MAP.md` already flags for +//! `ThinkingStyle` (4 copies, contract canonical, not yet fully adopted). +//! +//! This example never panics or asserts on the measured outcome — it always +//! exits 0. The reliability battery's `Option` values are printed as +//! `None` when undefined (e.g. zero variance in a column) rather than +//! unwrapped. + +use jc::reliability::{cronbach_alpha, icc, pearson, spearman, IccForm}; + +/// One row per `StyleFamily` variant, in `StyleFamily::ALL` ordinal order: +/// (name, resonance_threshold, fan_out as f64, exploration). +type StyleRow = (&'static str, f64, f64, f64); + +/// Table A — driver `UNIFIED_STYLES`. +// SOURCE: crates/cognitive-shader-driver/src/engine_bridge.rs:545-726 +const TABLE_A_DRIVER: [StyleRow; 12] = [ + ("deliberate", 0.70, 7.0, 0.20), + ("analytical", 0.85, 3.0, 0.05), + ("convergent", 0.75, 4.0, 0.10), + ("systematic", 0.70, 5.0, 0.10), + ("creative", 0.35, 12.0, 0.80), + ("divergent", 0.40, 10.0, 0.70), + ("exploratory", 0.30, 15.0, 0.90), + ("focused", 0.90, 1.0, 0.00), + ("diffuse", 0.45, 8.0, 0.40), + ("peripheral", 0.20, 20.0, 0.60), + ("intuitive", 0.50, 3.0, 0.30), + ("metacognitive", 0.50, 5.0, 0.30), +]; + +/// Table B — thinking-engine `StyleParams` (re-keyed to `StyleFamily::ALL` +/// ordinal order by matching variant name; the source match arms are not in +/// ordinal order). +// SOURCE: crates/thinking-engine/src/cognitive_stack.rs:55-142 +const TABLE_B_ENGINE: [StyleRow; 12] = [ + ("deliberate", 0.70, 7.0, 0.20), + ("analytical", 0.85, 3.0, 0.05), + ("convergent", 0.75, 4.0, 0.10), + ("systematic", 0.70, 5.0, 0.10), + ("creative", 0.35, 12.0, 0.80), + ("divergent", 0.40, 10.0, 0.70), + ("exploratory", 0.30, 15.0, 0.90), + ("focused", 0.90, 1.0, 0.00), + ("diffuse", 0.45, 8.0, 0.40), + ("peripheral", 0.20, 20.0, 0.60), + ("intuitive", 0.50, 3.0, 0.30), + ("metacognitive", 0.50, 5.0, 0.30), +]; + +/// Table C — planner `FieldModulation` (7 explicit arms + `default()` for the +/// other 5). Rows marked `// default` are `FieldModulation::default()` +/// (0.7, 6, 0.3) at style.rs:165-177, NOT a per-family calibration. +// SOURCE: crates/lance-graph-planner/src/thinking/style.rs:74-142 (explicit) + +// crates/lance-graph-planner/src/thinking/style.rs:165-177 (default) +const TABLE_C_PLANNER: [StyleRow; 12] = [ + ("deliberate", 0.75, 6.0, 0.20), + ("analytical", 0.85, 4.0, 0.10), + ("convergent", 0.70, 6.0, 0.30), // default + ("systematic", 0.70, 6.0, 0.30), // default + ("creative", 0.50, 12.0, 0.80), + ("divergent", 0.70, 6.0, 0.30), // default + ("exploratory", 0.30, 20.0, 1.00), + ("focused", 0.90, 2.0, 0.05), + ("diffuse", 0.70, 6.0, 0.30), // default + ("peripheral", 0.70, 6.0, 0.30), // default + ("intuitive", 0.60, 8.0, 0.40), + ("metacognitive", 0.70, 8.0, 0.50), +]; + +/// Whether the planner wrote an explicit `default_modulation()` arm for this +/// `StyleFamily::ALL`-ordinal family, vs falling through to `_ => +/// FieldModulation::default()`. +const PLANNER_HAS_EXPLICIT: [bool; 12] = [ + true, true, false, false, true, false, true, true, false, false, true, true, +]; + +fn fmt_opt(v: Option) -> String { + match v { + Some(x) => format!("{x:.4}"), + None => "None".to_string(), + } +} + +fn verdict(icc21: Option) -> &'static str { + match icc21 { + Some(v) if v >= 0.75 => "IDENTITY", + Some(v) if v < 0.50 => "DISTINCT", + Some(_) => "AMBIGUOUS", + None => "UNDEFINED (ICC None — likely zero variance in a column)", + } +} + +/// Select the column (resonance / fan_out / exploration) from a table, +/// restricted to the given row indices. +fn column(table: &[StyleRow; 12], indices: &[usize], which: usize) -> Vec { + indices + .iter() + .map(|&i| match which { + 0 => table[i].1, + 1 => table[i].2, + _ => table[i].3, + }) + .collect() +} + +/// Run the merged reliability battery for one dimension across the three +/// tables, restricted to `indices`, and print the results. +fn report_dimension(dim_name: &str, indices: &[usize], which: usize) { + let col_a = column(&TABLE_A_DRIVER, indices, which); + let col_b = column(&TABLE_B_ENGINE, indices, which); + let col_c = column(&TABLE_C_PLANNER, indices, which); + + let n = col_a.len(); + let ratings: Vec> = (0..n) + .map(|i| vec![col_a[i], col_b[i], col_c[i]]) + .collect(); + let icc21 = icc(&ratings, IccForm::Icc2_1); + let icc31 = icc(&ratings, IccForm::Icc3_1); + + let items = vec![col_a.clone(), col_b.clone(), col_c.clone()]; + let alpha = cronbach_alpha(&items); + + let p_ab = pearson(&col_a, &col_b); + let p_ac = pearson(&col_a, &col_c); + let p_bc = pearson(&col_b, &col_c); + let s_ab = spearman(&col_a, &col_b); + let s_ac = spearman(&col_a, &col_c); + let s_bc = spearman(&col_b, &col_c); + + println!("--- Dimension: {dim_name} (n={n} families) ---"); + println!(" ICC(2,1) absolute-agreement : {}", fmt_opt(icc21)); + println!(" ICC(3,1) consistency : {}", fmt_opt(icc31)); + println!(" Cronbach α (3-item scale) : {}", fmt_opt(alpha)); + println!(" Pearson r A(driver)–B(engine) : {}", fmt_opt(p_ab)); + println!(" Pearson r A(driver)–C(planner) : {}", fmt_opt(p_ac)); + println!(" Pearson r B(engine)–C(planner) : {}", fmt_opt(p_bc)); + println!(" Spearman ρ A(driver)–B(engine) : {}", fmt_opt(s_ab)); + println!(" Spearman ρ A(driver)–C(planner) : {}", fmt_opt(s_ac)); + println!(" Spearman ρ B(engine)–C(planner) : {}", fmt_opt(s_bc)); + println!(" Verdict (ICC(2,1) vs 0.75/0.50) : {}", verdict(icc21)); + println!(); +} + +fn main() { + println!("═══ Style-table agreement probe (D-TRI-2/4/5-adjacent) ═══"); + println!(); + println!("Three shipped 12-family style-parameter tables, checked for agreement"); + println!("via jc::reliability (ICC/Cronbach α/Pearson/Spearman). Point estimates"); + println!("only — NOT Jirak-derived significance (I-NOISE-FLOOR-JIRAK is a separate"); + println!("job). Verdict thresholds are hand-tuned + pre-registered:"); + println!(" ICC(2,1) >= 0.75 → IDENTITY ICC(2,1) < 0.50 → DISTINCT else → AMBIGUOUS"); + println!("DISTINCT is a valid finding, not a failure of this probe."); + println!(); + + println!("Table A (driver) = cognitive-shader-driver::engine_bridge::UNIFIED_STYLES"); + println!("Table B (engine) = thinking-engine::cognitive_stack StyleParams"); + println!("Table C (planner) = lance-graph-planner::thinking::style FieldModulation"); + println!(" (7 explicit arms + FieldModulation::default() for the"); + println!(" other 5: convergent, systematic, divergent, diffuse,"); + println!(" peripheral)"); + println!(); + for (i, row) in TABLE_A_DRIVER.iter().enumerate() { + let explicit = if PLANNER_HAS_EXPLICIT[i] { + "explicit" + } else { + "DEFAULT" + }; + println!( + " [{i:>2}] {:<14} A=({:.2},{:>4.0},{:.2}) B=({:.2},{:>4.0},{:.2}) C=({:.2},{:>4.0},{:.2}) [{explicit}]", + row.0, + row.1, row.2, row.3, + TABLE_B_ENGINE[i].1, TABLE_B_ENGINE[i].2, TABLE_B_ENGINE[i].3, + TABLE_C_PLANNER[i].1, TABLE_C_PLANNER[i].2, TABLE_C_PLANNER[i].3, + ); + } + println!(); + + let all_12: Vec = (0..12).collect(); + let seven_explicit: Vec = (0..12).filter(|&i| PLANNER_HAS_EXPLICIT[i]).collect(); + + println!("╔══ MODE A — all-12 (planner's 5 fallback families use FieldModulation::default) ══╗"); + println!(); + report_dimension("resonance_threshold", &all_12, 0); + report_dimension("fan_out", &all_12, 1); + report_dimension("exploration", &all_12, 2); + + println!("╔══ MODE B — 7-explicit-only (drop the 5 planner-default families) ══╗"); + println!(); + report_dimension("resonance_threshold", &seven_explicit, 0); + report_dimension("fan_out", &seven_explicit, 1); + report_dimension("exploration", &seven_explicit, 2); + + println!("═══ Done. Exit 0 regardless of verdicts above (no panics/asserts on outcome). ═══"); +}