Commit graph

902 commits

Author SHA1 Message Date
Shay
c0cc8c40c4 fix(tests): isolate 4th polluter victim caught in live -n auto run
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Successful in 11m38s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 1h39m15s
tests/test_teaching_queue.py::test_read_only_invariant hardcoded
`project_root / "engine_state"` (the real shared dir) in its read-only-
invariant snapshot, instead of reading `engine_state._DEFAULT_DIR` (the
root-conftest autouse fixture's per-test isolated dir). Same bug pattern
as test_workbench_replay.py::test_replay_leaves_no_trace, and this one
was caught red-handed: a full `-n auto` fast-lane run failed with
"Directory .../engine_state was mutated!" and passed cleanly in serial
isolation, the exact order-dependent-flake signature this wave hunts.

The other three snapshotted dirs (teaching/proposals, packs,
contemplation/runs) have no equivalent per-test isolation idiom in the
repo yet and are left as-is — this test's own hitl-queue commands don't
write to them, so they were not implicated in the observed failure.
2026-07-15 16:46:08 -07:00
Shay
531d4aa0d1 fix(tests): isolate three xdist polluter clusters blocking -n auto default
Hunt for the -n auto fast-lane polluters flagged in docs/testing-lanes.md
("Follow-up: xdist by default"). Three root causes, all shared-repo-path
writers with no per-test isolation, following the #782 monkeypatch idiom:

1. tests/test_workbench_replay.py::test_replay_leaves_no_trace hardcoded
   `Path("engine_state")` (the real shared dir) instead of reading
   `engine_state._DEFAULT_DIR`, which the root-conftest autouse fixture
   already redirects per-test. It was a victim, not a polluter: any
   concurrent worker writing the real dir made this snapshot-diff flake.
   Fixed by reading `engine_state._DEFAULT_DIR` dynamically.

2. evals/gsm8k_math/train_sample/v1/runner.py hardcoded its report.json
   output to the committed repo path with no override. Two test files
   (test_rat1_end_to_end_admission.py, test_wave_a_multiplicative_
   aggregation_injector.py; 4 tests total) spawn it as a subprocess and
   read the same file back — a write race under -n auto, and a confirmed
   downstream victim (test_gsm8k_sealed_attempt_scout.py::
   test_report_json_mtime_unchanged_by_scout_import asserts the file's
   mtime is stable). Added an optional CORE_GSM8K_TRAIN_SAMPLE_REPORT_PATH
   env override (default unchanged) and pointed the 4 call sites at
   tmp_path.

3. core/cli.py's `_DEMO_RESULTS_DIR` (evals/forward_semantic_control/
   results/) is written, glob-scanned, and index.json-rebuilt by ~11 tests
   across tests/test_cli_demo.py's TestDemoSubcommand and TestDemoPreambles
   classes. Added an autouse fixture monkeypatching `cli._DEMO_RESULTS_DIR`
   to a per-test tmp dir. This also unmasked a latent order-dependent
   coupling: test_demo_list_results_indexes_reports and
   test_demo_list_results_json_well_formed never wrote their own report,
   relying on a sibling test's leftover file in the shared dir (silently
   correct only because pytest ran the file in declaration order). Made
   both self-contained.

No assertion weakening, no test deletion, no global autouse fixture masking
real bugs. All three fixes preserve the real (non-test) default behavior
byte-for-byte when unpatched/env-unset.

Verification: 8x targeted -n 8 loop over the 7 affected files (before and
after) did not force-reproduce the underlying race live (narrow timing
window, small-scale run) — confirmation is source-level (hardcoded shared
paths bypassing the established isolation idiom) plus the prior documented
flake for test_replay_leaves_no_trace in docs/testing-lanes.md. Full
fast-lane -n auto run recorded in the PR description.
2026-07-15 16:46:08 -07:00
Shay
dddd85cfca fix(tests): clear pre-existing full-suite reds (INV-21 pins + rotor_power)
All checks were successful
smoke / smoke (-m "not quarantine") (pull_request) Successful in 7m11s
lane-shas / verify pinned lane SHAs (pull_request) Successful in 25m7s
Five fast-lane failures on main made the full suite dishonest.

- Refresh INV-21 allowlist pins in demo tests for holographic_vault (ADR-0241)
- Skip non-powerable (mixed-parity) rotor_power calls in generate recall and
  session anchor pull instead of crashing the cognitive path
- Align session_anchor_pull fixture to grade-1 field parity
- Ledger: docs/analysis/full-suite-reds-ledger-2026-07.md

[Verification]: targeted 10 passed; lane SHAs 9/9; smoke 175 passed
2026-07-15 15:39:09 -07:00
Shay
301742a38a feat(physics): chiral orientation sign-gate — sgn(Q)=const fail-closed (ADR-0241 §2.4C)
All checks were successful
lane-shas / verify pinned lane SHAs (pull_request) Successful in 17m17s
smoke / smoke (-m "not quarantine") (pull_request) Successful in 5m8s
Builds the one missing safeguard from the 4-blueprint integration audit:
the mirror-inversion protection (core_ha §5.2: sgn(∫⟨ψ I₅ ψ̃⟩₀) = const).
The chiral charge was a verified non-vacuous READOUT, but goldtether took
abs(), discarding the sign — orientation was measured, never enforced.

- core/physics/chiral_gate.py: ChiralOrientationGate latches sgn(Q) on the
  first non-vacuous reading (|Q| >= 0.1 floor); a materially re-emerging
  flip raises ChiralOrientationError (fail-closed; a sign flip is
  unreachable under rotor transport, so it evidences corruption).
  Even field-states stay vacuous — no orientation fabricated, no #19
  revival; the gate is behaviorally inert on today's serve path.
- goldtether_residual now feeds the SIGNED charge to the gate; the
  residual term keeps magnitude-only semantics byte-identical (pinned).
- Docs: integration-plan missing-piece row -> BUILT; fidelity ledger §12
  gains the failable pin row.

TDD RED->GREEN. [Verification]: smoke suite passed locally (141s, 175
passed); gate suite 7 passed; goldtether-consumer regression 99 passed.
2026-07-15 13:35:08 -07:00
Shay
25772154ff fix(cli): smoke suite parity with the CI smoke gate (audio sensorium lane)
All checks were successful
lane-shas / verify pinned lane SHAs (pull_request) Successful in 17m7s
smoke / smoke (-m "not quarantine") (pull_request) Successful in 23m40s
The CLI 'smoke' suite omitted tests/test_audio_*.py (6 files) that the
.github/workflows/smoke.yml PR gate runs — so the new AGENTS.md local-first
pre-push gate ('core test --suite smoke') was silently narrower than CI
(108 vs 175 tests). Adds the audio lane explicitly and pins parity:
test_cli_smoke_suite_covers_ci_smoke_gate parses the workflow's tests/
paths (globs expanded) and fails if the CLI tuple ever lags the CI gate.

[Verification]: CI-identical smoke file set passed locally (134s, 175
passed); tests/test_cli_test_suites.py 10 passed incl. the new pin.
2026-07-15 13:14:06 -07:00
Shay
c8160cacba fix(physics): close A-04 transitive serve breach — lazy Tier-2 barrel exports + process-level guard
Importing chat.runtime transitively loaded 5 off-serving modules
(wave_manifold, holographic_vault, fibonacci_search, multi_scale_energy,
wave_energy_boundary) through the core/physics package barrel — falsifying
the 'serve path not wired' acceptance row while the direct-AST A-04 pin
stayed green.

Reconciliation (ruled 2026-07-15): one substrate, two tiers.
- T1 sanctioned serve substrate: wave_manifold (goldtether/surprise/
  biography delegate to it) — stays eager, removed from the A-04 ban list.
- T2 off-serving (holographic_vault, fibonacci_search, wave_energy_boundary,
  multi_scale_energy): converted to PEP 562 lazy __getattr__ exports so the
  serve process never loads them; 'from core.physics import X' still works
  for off-serving callers. TYPE_CHECKING block keeps static analysis intact.
- New tests/test_serve_quarantine_transitive.py enforces the process-level
  invariant via a clean-interpreter sys.modules probe (RED against the old
  barrel, GREEN now).

Evidence: docs/research/adr-0241-0242-adversarial-and-fidelity-findings.md
(Finding #2). 179 affected tests green.
2026-07-15 12:48:45 -07:00
Shay
44f7258b16 fix(algebra): P11a physics hot paths via algebra.backend (Rust-ready)
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Successful in 5m57s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 1h43m22s
Stop wave/Third-Door physics from bypassing native dispatch:

- Route geometric_product / versor_apply / versor_condition / cga_inner
  through algebra.backend in wave_manifold, goldtether, trajectory,
  dynamic_manifold, surprise, holographic_vault, atlas_packing,
  biography, self_authorship.
- Backend: dtype-aware Rust use — f32 workloads use core_rs; f64 wave
  residual pins keep Python SOT until f64 GP parity exists. Coerce
  arrays for PyO3 bindings; fail soft to Python.
- AST hygiene pin: tests/test_physics_backend_dispatch_hygiene.py
- Docs: RUST.md, runtime_contracts, fidelity (ADR-0235 / UMA hygiene).

Verified: wave + cohesion suites green default and CORE_BACKEND=rust
(with core_rs built). MLX still exploratory off-serve.
2026-07-14 21:08:02 -07:00
Shay
db6430ed4e feat(adr-0242): macro-phase V2–V5 + sensorium feed (Drive gap close)
Parallel implementation of remaining Drive ADR-0242 vectors on PR #38:

D3 V2 — multi_scale_energy: E_n(t)=E0·exp(-age/(F_n·τ0)), dyadic baseline,
        comparative helpers; not production FieldEnergyOperator default.
D5 V4 — fibonacci_word_schedule: W0=B,W1=A,W_{n+1}=W_n W_{n-1}; telemetry only.
D6 V5 — algebra/topological_reasoning quarantine + production AST pin.
D7    — sensorium_wave_feed: packet→ψ, superpose, ρ via WaveManifold only.

Serve quarantine extended for all new modules. Fidelity + ADR-0242 +
runtime_contracts honesty pass. Suite: 118 related tests green.

Single macro-phase commit per plan policy (no micro-PRs).
2026-07-14 21:08:02 -07:00
Shay
bbd3b6678f feat(adr-0242): Drive V1 cert discipline + doc align five vectors
Close the gap between cohesion packing/search and Drive ADR-0242:

D0 — Expand ADR-0242 to five-vector + sovereignty thesis (title matches Drive).
D8 — Land docs/analysis/fibonacci_applications_in_core_substrate.md.
D1 — FibonacciSearchCertificate | OptimizationFailure (never bare float);
     content-addressed cert_id; dual-run stable digest.
D2 — propose_kappa_from_search / goldtether.propose_kappa_line_search;
     failure → baseline κ=1.0 (no state mutation).
D4 — ALLOCATOR_VERSION golden_angle_v1 + layout descriptor.

Fidelity §12 honest: V1/V3 green; V2 table-only; V4/V5 staged.
2026-07-14 21:08:02 -07:00
Shay
9d543f6a9c docs(governance): P12 cohesion close — contracts, checklist, ready-for-accept
ADR-0241 cohesion package P12 (governance):
- runtime_contracts: off-serve quarantine, holographic SPECULATIVE/COHERENT,
  hypothesis vs evidence reconstruct, crystallization, entity suite pins.
- docs/audit/adr_0241_cohesion_acceptance_checklist.md maps C0–C8 → tests.
- ADRs remain Proposed + ready for Joshua acceptance (no self-Accept).
- Fidelity §12 honesty: P0–P10 green; human Accepted is the gate.
- tests/test_adr_0241_governance_p12.py pins inventory + status honesty.

CLAIMS.md Tier-2 lanes unchanged (I-01…I-05 are suite pins, not lane SHAs).
2026-07-14 21:08:02 -07:00
Shay
f123e0ea75 feat(wave): P10 Trace B energy boundary + multi-scale Fibonacci τ
Land ADR-0241 cohesion package P10:
- core/physics/wave_energy_boundary.py wires WaveManifold unitary residual
  into energy profiles and trajectory energy gates (no free-floating residual).
- fibonacci_tau_schedule: τ_n = F_n · τ_0 constants table + recency bands.
- crystallization_for_holographic_seal: E0–E1 + closed residual may
  SPECULATIVE-seal; dirty residual or hot classes refuse.
- Public fibonacci_number; serve quarantine includes wave_energy_boundary.
- Fidelity + ADR-0241 status updated.

Lane: pytest tests/test_adr_0241_wave_energy_boundary.py
      tests/test_adr_0242_fibonacci.py tests/test_energy.py
      tests/test_third_door_cohesion.py → green.
2026-07-14 21:08:02 -07:00
Shay
aa86f1ae35 feat(wave): P9 Trace A contemplation → SPECULATIVE holographic seal
Land ADR-0241 cohesion package P9:
- core/contemplation/wave_seam.py seals standing-wave modes only via
  HolographicVaultStore.seal_mode (SPECULATIVE); no seal_mode_reviewed,
  no direct VaultStore.store (INV-21).
- FindingKind.RESONANT_MODE_CANDIDATE + ContemplationFinding for teaching
  review corridor.
- reconstruct_as_hypothesis (full spectrum) vs reconstruct_as_evidence
  (min_status=COHERENT only; SPECULATIVE cannot masquerade).
- HolographicVaultStore.resonant_reconstruct with status filter.
- Serve quarantine extended to wave_seam; fidelity + ADR-0241 status.

Lane: pytest tests/test_adr_0241_wave_contemplation_seam.py
      tests/test_adr_0241_holographic_vault.py
      tests/test_third_door_cohesion.py → 38 passed.
2026-07-14 21:08:02 -07:00
Shay
7f6c497a21 fix(ci): path-stable env deltas so lane SHA pins stop thrashing
All checks were successful
smoke / smoke (-m "not quarantine") (pull_request) Successful in 14m5s
lane-shas / verify pinned lane SHAs (pull_request) Successful in 25m23s
Root cause of demo_composition pin thrash was not cancelled CI runs:
verify_no_global_state_mutation dumped full env_subset before/after
tuples into the lane report, embedding CORE_ENGINE_STATE_DIR temp
paths (and any ambient CORE_* host values). Each hermetic run then
produced a different report SHA.

Fix for good:
- Report key-level env deltas only (+/- / changed), with path-like
  CORE_* values redacted to <path> in the message text.
- Detection still uses raw snapshots (mutations are not ignored).
- Hermetic CORE_ENGINE_STATE_DIR for demo_composition and all
  verify_lane_shas invocations.
- Dual-run-stable re-pin: demo_composition e2ba2314…,
  public_demo 7d8ba0db… (matches CI-observed soft-budget SHA).
- Drop dead CORE_SHOWCASE_SKIP_BUDGET workflow env (soft is default).
- Tests pin the delta format and hermetic-path stability.

Lane: python scripts/verify_lane_shas.py → 9/9 match.
2026-07-14 17:41:04 -07:00
Shay
ed54f8d7a3 feat(wave): non-vacuous chiral spinor charge path (ADR-0241 P8)
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Has been cancelled
lane-shas / verify pinned lane SHAs (pull_request) Has been cancelled
- Implemented design (A) for P8: odd-capable mixed-parity spinor packets
  produce a strictly non-vacuous and informative chiral charge
  Q = <ψ I_5 ~ψ>_0 that measures correlation between the even and odd-dual parts.
- Proved via TDD that Q is non-vacuous on mixed-parity spinors and strictly
  conserved under left unitary rotor multiplication.
- Updated wave_manifold.py docstrings to clarify that while Q is structurally
  vacuous for even field-states (retiring #19), it is fully functional for
  general spinors.
- Flipped W4 in the fidelity scorecard to GREEN and updated ADR-0241.
2026-07-14 14:42:54 -07:00
Shay
09285882e5 chore(wave): demote true Clifford polar and prove ill-posedness (ADR-0241 P7)
- Proved that analytical Clifford polar C_AB = B~A is mathematically ill-posed
  for multi-grade 32-vector fields, as ~C C is not a scalar.
- Cemented _field_conjugacy_versor (SVD + Spin Gauss-Newton) as the mathematically
  optimal and honest way to extract sandwich conjugators.
- Updated ADR-0241 to demote the polar claim and favor the thin wrap.
- Updated third-door-blueprint-fidelity.md to flip W3 to GREEN (honest demotion).
- Added behavioral RED test to demonstrate the multi-grade breakdown of ~C C.
2026-07-14 14:32:12 -07:00
Shay
3086e9a4d9 feat(adr-0242): Golden-Angle atlas packing + Fibonacci section search
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Has been cancelled
lane-shas / verify pinned lane SHAs (pull_request) Has been cancelled
Integrate Gemini ADR-0242 implementation with adversarial hardening:
CGA null-point separation pin (d_min=0.12), fail-closed Fibonacci search
with fixed budget and unimodality checks, serve quarantine still held,
ADR-0242 Proposed (not pre-accepted), fidelity ledger flip to green.
2026-07-14 14:24:53 -07:00
Shay
0489b6a98a feat(adr-0241): cohesion substrate — vault ABI, reconstruct, I-01…I-05 suite
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Has been cancelled
smoke / smoke (-m "not quarantine") (pull_request) Successful in 14m5s
Land entity-cohesion foundation for ADR-0241 mastery: public VaultStore
get_versor/get_entry ABI (drop private _versors in holographic vault),
resonant_reconstruct + phase_correlation on WaveManifold, cohesion master
plan + Phase 0/serve quarantine suite, fidelity honesty pass, and Gemini
handoff brief for ADR-0242 atlas packing + Fibonacci search.
2026-07-14 14:09:00 -07:00
Shay
7952026a5d feat(adr-0241): GREEN holographic vault — VaultStore-backed standing-wave spectrum
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 1h42m2s
smoke / smoke (-m "not quarantine") (pull_request) Successful in 29m15s
Implement HolographicVaultStore seal/load/resonant_recall on VaultStore.store
(INV-21 allowlist). SPECULATIVE default; COHERENT only via authorized review
seal. Restart reconstruction-over-storage; empty spectrum refuses confabulation;
closure/drift gate on seal. WaveManifold energy for lock-in. Ledger W5 green.
2026-07-13 22:05:26 -07:00
Shay
afae8a870a test(adr-0241): RED holographic vault — durable standing-wave spectrum, speculative writes, exact-recall reconstruction, restart lock-in
Stub HolographicVaultStore (NotImplemented) + behavioral contract for SPECULATIVE
seal, authorized COHERENT seal, empty-spectrum refuse, restart load/recall,
min_status filter, INV-21 allowlist discipline, no approx-neighbor imports.
2026-07-13 21:58:44 -07:00
Shay
db924550fc feat(third-door): #21 trajectory invariants + ADR-DAG embedding (Python)
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Successful in 5m54s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 44m23s
Geometry-first Python authorities for the last Third-Door blueprint gaps:
- trajectory_invariants: relative holonomy, divergence integral, energy
  boundary, zero-fabrication refusals (R&D §2.2)
- core/adr/validator: SHA-256→bivector Ψ(M), simple project, master blade,
  proposal drift (R&D §2.4); not a parallel GeometricDelta ABI validator
Ledger rows 7–8 green; optional Rust Ring-1 port deferred.
2026-07-13 21:51:42 -07:00
Shay
11e7b71d57 test(goldtether): RED #18 bootstrap/prune (proof gate + principal-axis mode)
Add GoldPromotionProof, expand promote/prune signatures, promotion_eligible
stub, and behavioral suite for residual/closure gates, require_proof,
principal_axes prune, and SERVE containment. Intentionally incomplete:
principal_axes and eligibility raise NotImplementedError; dirty promote
still admitted — RED until GREEN.
2026-07-13 21:38:25 -07:00
Shay
e124d83bfa fix(algebra): rotor_power smoke — α≈0 identity + simple B² float-dust tol
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Successful in 5m55s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 1h43m35s
Smoke reds came from (1) denormal stream weights powering non-simple splits
and (2) invariant-split factors with B² higher residual in 1e-6..1e-3 dust
band raising fail-closed. Early R^0→I / R^1→R; raise simple B² higher tol
to 1e-3 with named constant. Pins multiplane transition + near-zero alpha.
2026-07-13 21:29:33 -07:00
Shay
932b5d481f feat(third-door): Slice-3 wave ledger close + multi-pair conjugacy + resonant recall
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Failing after 5m35s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 20m8s
Finalize ADR-0241 branch contract: multi-pair Procrustes thin-wraps
wave_field_conjugacy; standing-wave registry + resonant_recall; biography
registers trajectory modes; ledger W1–W6 green with explicit deferred items
(durable holographic vault, #18 bootstrap/prune, Rust/MLX). Hygiene pin for
absent core_ha package.
2026-07-13 21:12:17 -07:00
Shay
541257f81d feat(third-door): Slice-2 wave subsumption (surprise/Procrustes/GoldTether/biography)
Collapse parallel residual/projection paths into WaveManifold:
- surprise 32-vec residual → compute_spectral_leakage
- single non-null Procrustes pair → wave_analogical_polar
- coherence_residual / GoldTether drift → measure_unitary_residual
- biography integrate → unitary lock-in + holonomy_encode
Null-point Kabsch retained. Discovery wiring unchanged (no teaching import).
2026-07-13 21:08:22 -07:00
Shay
51f674d154 test(adr-0241): RED wave_manifold tests (unitary step, spectral leakage, polar, chiral)
Hard-import contract for core.physics.wave_manifold — collection fails until
Slice 1 GREEN. Pins sandwich vs left-spinor transport, metric leakage,
polar recovery, chiral conservation, determinism, no teaching import.
2026-07-13 20:56:56 -07:00
Shay
995f4fc3b8 feat(third-door): wire high surprise to DiscoveryCandidate (#20 follow-up)
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 15m37s
smoke / smoke (-m "not quarantine") (pull_request) Failing after 22m54s
- Physics dual operators set discovery_eligible (γ=0.35); is_discovery_eligible
  pure predicate; no teaching/vault imports in core.physics.surprise.
- teaching.discovery: trigger high_surprise; candidate_from_surprise_dual +
  emit_surprise_discovery (opt-in sink, proposal-only unreviewed, domain=math).
- Boundary tests: threshold gates, determinism, no VaultStore, no teaching import
  in physics. Ledger §6 notes wiring surface (issue #30).

Does not self-install; contemplation consumes via existing DiscoveryCandidateSink.
2026-07-13 17:25:17 -07:00
Shay
2050b77ab2 feat(third-door): real Cartan–Iwasawa null-point peel + full Kabsch-conformal Procrustes (#16 #17)
- Cartan: recover_dilation → peel D → recover_translation → peel T;
  Spin remainder for non-similarities; strict close (no seed-to-rotor);
  recon residual fallback. Flips fidelity xfail.
- Procrustes: full 5-D Kabsch on null-point clouds; field conjugacy via
  raw sandwich + Spin GN; delete word_transition_rotor averaging path.
  Non-vacuous harness fixture.
- rotor_power: null-bivector power (a+B)^α = a^α + α a^{α-1} B so
  translators no longer silently zero under dual-slerp.
- Ledger scorecard: #2 and #3🟢; #4 remains 🟡 (bootstrap deferred).

549 passed (fidelity + ADR-0239 + null_point + 0240 + rotor_power).
2026-07-13 17:07:42 -07:00
Shay
26270ed846 feat(algebra): null-point recovery primitives + frozen CGA null constants
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Failing after 59s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 32s
Shared CGA substrate for the #17 conformal-Procrustes/Kabsch and #16
Cartan-Iwasawa decompositions. Adds algebra/null_point.py and hoists the two
conformal null directions to frozen module constants.

algebra/cga.py
  - Add frozen read-only f64 N_O / N_INF constants: the same vectors
    embed_point builds inline (origin embeds to N_O; N_INF is fixed by every
    Euclidean isometry), so the null-point primitives share one exact sign
    definition instead of re-deriving it per call site.
  - Fix header-docstring sign typo: n_o = 0.5*(e5 - e4), not 0.5*(e4 - e5).
    embed_point was already correct; only the module header disagreed.

algebra/null_point.py (new)
  - dilator(scale), translator(a): CGA similarity constructors; both
    round-trip through the recoverers.
  - recover_dilation(V) -> (scale, D): reads V n_inf rev(V), weight-normalised
    so recovery is invariant to a non-unit versor weight (verified vs V -> kV).
  - recover_translation(V) -> (a, T): reads V n_o rev(V), projective
    dehomogenisation.
  - NullPointRecoveryError carries machine-readable reason codes.
  - Fail-closed symmetric similarity gate (_require_similarity): BOTH recoverers
    now reject non-versors (not_a_versor) and non-similarities (not_similarity,
    e.g. transversions). Closes an asymmetry where recover_translation silently
    accepted a transversion / non-versor and returned a plausible translation,
    violating the module's own wrong=0 contract.
  - Orientation-reversing (reflection / det=-1) versors are refused by
    recover_dilation with a distinct reason improper_versor, kept separate from
    degenerate_scale; recover_translation still accepts them (the origin image is
    well defined). conformal_procrustes strips reflections upstream, so this is a
    documented boundary, not a silent one.
  - Default tol=1e-9 documented: matches f64-exact recovery of a cleanly
    assembled versor (~1e-14 round-trip); noisy/SVD callers must pass a wider tol.

tests/test_null_point_primitives.py (new): 33 tests - null-cone/pairing
invariants, constant immutability, constructor round-trips, composed T.D.R peel,
versor-weight invariance, and the full fail-closed matrix (transversion,
non-versor, inversion, reflection asymmetry, non-positive scale, bad vector).

Invariant protected: wrong=0 - no recovery returns a silently wrong value on a
degenerate / non-versor / non-similarity input. Validation: 33/33 new pass;
88 passed / 1 xfailed across the CGA substrate + physics Procrustes consumers
(dynamic_manifold, surprise, versor closure, rotor, holonomy).

Hardened via a 3-lens adversarial verification (soundness / sign-convention /
consumer-contract, each executing counterexample versors, every finding
skeptic-verified): 2 CONFIRMED findings fixed (asymmetric validation gap;
reflection reason conflation); tol-tightness resolved by documentation rather
than a guard-weakening default change.
2026-07-12 16:28:19 -07:00
Shay
efa84002cd feat(third-door): exact metric-orthogonal surprise projection + reconciled polarity (#20)
Finding #20 (Super-Blueprint §3.2). surprise_residual was Euclidean Gram-Schmidt
on flat 32-coefficient vectors — metric-blind (it ignored the (+,+,+,+,-)
signature and the blade grade structure), so "inside the admissible span" was
judged by the wrong geometry.

Operator math (core/physics/surprise.py):
- Exact metric-orthogonal projection: solve the normal equations G c = r
  (G_ij = cga_inner(b_i,b_j), r_i = cga_inner(b_i,x)) via lstsq, under cga_inner
  (32-vec) / eta (5-vec).
- Fail-closed (typed SurpriseResidualError) on a metric-degenerate span, keyed on
  rank(G) < rank(B) — a null direction with no reciprocal (lone n_o). Refines the
  literal "rank(G) < k": mere linear dependence among non-null columns is admitted
  (lstsq projects onto the span), so a redundant live basis [1, source] and the
  non-degenerate pair {n_o, n_inf} are admitted; only a lone n_o is refused. The
  disclosure names the Gram null-space direction (not just zero-diagonal columns).
- Reconciled productivity polarity: productive_transfer = low Procrustes AND low
  surprise (was `sur_norm >= 0.0`, always true). High surprise routes to discovery
  (split follow-up). Corrects the ledger's transfer/discovery conflation.

Adversarial verification (3 independent lenses) found, and this fixes:
- HIGH soundness hole: sur_norm was the reversion pseudo-norm, which VANISHES on
  a nonzero metric-null residual (the n_o/n_inf light cone) -> false-zero surprise
  -> an out-of-span light-cone probe was wrongly admitted as in-span. Now the
  DEFINITE (Euclidean) norm of the residual: the projection stays metric-exact,
  the magnitude is 0 iff nothing is unexplained.
- HIGH regression: the analogical-transfer harness called surprise_residual
  OUTSIDE its try/except, so a degenerate source crashed the whole run. Now
  guarded: records a refused case and continues.
- grade-support `allowed` -> exact-nonzero (removes a spurious-leak edge under
  coefficient amplification of sub-tolerance grade dust).

DiscoveryCandidate wiring into the contemplation loop is split to its own
follow-up (a distinct cross-cutting surface). Off-serving (nothing in
serving/runtime imports core.physics.*). Tests: 15 behavioral tests
(metric-vs-Euclidean divergence, null-cone regression, null refusal +
combination-degenerate disclosure, 5-vector branch, polarity); 139-test physics
sweep green; ruff clean.
2026-07-12 15:27:20 -07:00
Shay
b652a627ba refactor(third-door): retire vacuous §3.3 grade-5 pseudoscalar gate (#19)
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Failing after 58s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 4m23s
The Super-Blueprint §3.3 "grade-5 pseudoscalar alignment anchor" is
mathematically vacuous in odd-dimensional Cl(4,1) and cannot be built as
specified (3-agent R&D convergence — Opus/Grok/Terra — ratified):

- I₅ is central in odd dim → V·I₅·Ṽ = ±I₅ for every versor; orientation is
  invariant by construction (nothing to block).
- Field-state versors are even → F[31] ≡ 0; the gated ⟨F·F̃⟩₅ = 0 for the
  source and target of every transition. The gate compares 0 == 0.
- The "even-versor parity gate" repair is equally vacuous (even subalgebra is
  closed under the sandwich; odd-grade mass ≡ 0 on the sanctioned path).

Removes the namesake rather than leaving it masking an absence:
- Delete _PSEUDOSCALAR_IDX + all F[31] reads (dead `ps` history element and
  CoherenceResidual.pseudoscalar — both structural zeros).
- Rename telemetry channel pseudoscalar_floor → autonomy_floor (it was always
  self.floor, the earned-autonomy ceiling).
- Bump telemetry schema goldtether_coherence_v1 → v2 (shape changed).

The integrity-anchor role is subsumed by versor closure + GoldTether harmonized
residual (#24) + biography/identity holonomy. Ledger §5 rewritten with the
vacuity proof, subsumption, and the reusable "would this gate ever fire on the
sanctioned construction path?" meta-criterion.

No serving/runtime path touched (core.physics.* is off-serving). Tests: 33 pass
/ 1 xfail (Cartan #2) across goldtether + fidelity + miner + transfer suites;
ruff clean.
2026-07-12 13:07:17 -07:00
Shay
fe278a4b26 feat(third-door): GoldTether harmonized residual + α=Φ(R) constraint control (ADR-0238 §2.3)
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 2s
smoke / smoke (-m "not quarantine") (pull_request) Failing after 45s
Implements the ADR-0238 §2.3 / R&D-Revised §2.3 machinery the skeleton omitted
(fidelity finding #4, issue #18):

- Gold-invariant set 𝓘_gold seeded with the primal {identity, n_o, n_inf}
  (R&D §5 bootstrapping seeds), so the geometric term never degenerates at
  cold start.
- goldtether_residual: scale-harmonized R = w·(drift/ε) + (1−w)·(min‖F−I‖/‖F‖),
  both terms scaled to [0, O(1)] so neither masks the other — the exact defect
  §2.3 exists to fix. The raw coherence_residual stays the fail-closed closure
  gate; this is the alignment signal that drives α.
- alpha_constraint = Φ(R_gt; r_floor, r_critical): the smooth-step constraint
  weight, composed with the earned-autonomy ceiling (α_floor = 1 − autonomy)
  and serve-pinned-to-1. supervised_transition rides the exact geodesic (#23).
- promote/prune gold-set hooks (caller-gated; the ADR-0092 replay-verified
  promotion pipeline + principal-axis decay are deferred, per issue #18).

Reconciliation (design): the earned-autonomy ramp (lifetime trust ceiling) and
α=Φ(R) (per-transition blend) compose at two timescales rather than compete —
earned autonomy floors α, Φ(R) modulates within it, serve is never autonomous.
All existing GoldTether behavior/tests preserved; fail-closed + serve-never-
autonomous intact.
2026-07-12 10:59:48 -07:00
Shay
1646250b69 chore: drop xfail from test_supervised_blend on PR 15
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Failing after 4s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 18s
2026-07-12 10:47:55 -07:00
Shay
4fc29eb6ff Merge remote-tracking branch 'forgejo/main' into my_temp_branch 2026-07-12 10:47:20 -07:00
Shay
57512c22c0 feat(algebra): exact fractional powers of non-simple rotors (invariant split)
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 33s
smoke / smoke (-m "not quarantine") (pull_request) Failing after 54s
rotor_power previously returned the IDENTITY for any non-simple rotor — an
approximation where exactness was available (Pillar II, Semantic Rigor) that
silently collapsed geodesic interpolation (slerp / supervised blend) to a
no-op while closure stayed green. Replace the identity-fallback with the
invariant (bivector) decomposition: a general Cl(4,1) rotor factors into two
commuting simple rotors R = R1 R2, so R^a = R1^a R2^a exactly, each via the
existing simple closed form, with a dedicated closed form for the isoclinic
(coincident-plane) case. Built from the geometric product alone — no scipy,
no GA library (Pillar III, Third Door); exact f64 on the existing product
table (Pillar I, Mechanical Sympathy).

- Simple path is byte-identical (0.0 delta); 66 existing algebra tests pass.
- tests/test_rotor_power_general.py pins R^1=R, (R^.5)^2=R, R^a R^b=R^(a+b),
  R^0=1, closure, isoclinic, and replay determinism across every plane type
  incl e5 boosts (441 pass), to machine precision (<= 6.5e-10).

This is the substrate cause of the Third-Door blend degeneration (fidelity
finding #1, issues #16/#18): with a real rotor_power, supervised_blend and
dual_correction_slerp now interpolate monotonically and land on target. Once
merged, the ADR-0239 blend xfail on #15 flips green.
2026-07-12 09:52:07 -07:00
Shay
f176956630 test(third-door): blueprint-fidelity ledger for findings #1-2 (xfail)
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Failing after 1s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 10s
Composed-versor tests the ADR-0239 suite never exercises. Two spec-property
tests xfail (strict) citing Super-Blueprint §2.2 / R&D-Revised §2.3; two
characterization tests lock the current degenerate behaviour so a future fix
is forced to update them.

- supervised_blend: no-op for interior alpha on composed (non-simple) versors
- cartan_iwasawa_factorize: raises 'factor R not closed' on composed versors
2026-07-11 22:55:15 -07:00
Shay
896e90a92b fix(third-door): align with perfected package contracts from Downloads artifacts (refs #10 #11 #12 #13)
Some checks failed
smoke / smoke (-m "not quarantine") (pull_request) Failing after 1m1s
lane-shas / verify pinned lane SHAs (pull_request) Failing after 47s
Source artifacts from the multi-model landing package (README + Super-Blueprint
+ ADR-0238/0239/0240 + goldtether/dynamic_manifold/surprise) are now the
contractual surface, implemented on the live algebra/* kernel:

- GoldTetherMonitor.residual/update/may_relax_hitl/force_reset/autonomy
- signature_aware_pca (5×K, null-safe), conformal_procrustes, cartan_iwasawa_extract
- surprise_residual (Minkowski) + dual_procrustes_surprise audit dict

Package stubs (core.algebra.backend placeholders, scipy, identity-only
Procrustes) are replaced with dual-corrected Cl(4,1) operators. ADRs match
package decision language; docs/adr remains canonical with decisions redirects.

34/34 Third-Door tests + 7/7 ADR-0199 arena regression green.
2026-07-11 22:05:02 -07:00
Shay
e6b635c6aa test: Third-Door replay, closure, analogical transfer harness (refs #10 #13)
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 1m13s
smoke / smoke (-m "not quarantine") (pull_request) Failing after 1m43s
40 tests covering ADR-0238/0239/0240: practice vs serve bands, floor decay,
signature PCA null classification, Procrustes residual, surprise dual,
biography holonomy order-sensitivity, temporal NOT_YET, miner SPECULATIVE-
only, fixture transfer wrong=0.
2026-07-11 22:01:13 -07:00
Shay
629bc16382 fix(vault): isolate DeltaStore frontier from caller aliasing (ADR-0026.1)
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 1m26s
smoke / smoke (-m "not quarantine") (pull_request) Successful in 49m39s
DeltaStore.frontier returned the live internal set. A delta built with
parents=store.frontier aliased it, so insert's frontier maintenance
(add + difference_update) emptied the frontier on every insert and
rewrote every stored delta's parents to {} — the CRDT causal chain
degenerated into all-roots. Sopher's bridge now copies on its side
(sopher ADR-0026.1 §2.1); this is the recommended CORE-side defense in
depth: frontier hands out snapshots, and insert copies delta.parents
into the event envelope.

Regression-tested with the exact aliasing pattern (3-delta chain keeps
one head and stable per-delta parents).
2026-07-11 02:16:57 -07:00
Shay
c69096b2c0 feat(abi): Implement GeometricDelta ABI, validator, delta store, and documentation 2026-07-11 02:16:57 -07:00
Shay
2a3f7ad125 feat: retire fraction_decrease prose regex — bind dilation from frame scale
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Has been cancelled
smoke / smoke (-m "not quarantine") (pull_request) Has been cancelled
The post-CGA / ProblemFrame pivot comes to fruition: geometric dilation for
fraction_decrease is built from the bound scale role's GroundedScalar
(exact Fraction from kernel slash_fraction / pack numerics), not from a
local "decrease to N/M of" regex on evidence spans.

- Remove _build_fraction_decrease_payload_and_bind (legacy overfitting path)
- Add _fraction_decrease_scale_binding + _versor_binding_from_scale_value
- assess_fraction_decrease attaches VersorBindings when runnable
- assess_geometric_proposals uses frame scale only for fraction_decrease
- compose fallback prefers obligation-complete contracts with bindings
- Guard test: contracts source must not reintroduce the prose regex

Invariants: construction-boundary CGA only; versor_condition < 1e-6;
no new derivation-organ prose parser.
2026-07-08 20:09:49 -07:00
Shay
268a754c00 fix: fold Gemini CGA/fraction_decrease compatibility into deck PR
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Has been cancelled
smoke / smoke (-m "not quarantine") (pull_request) Has been cancelled
Port load-bearing fixes from Gemini worktree (Projects/core draft) onto
forgejo deck branch — reviewed and cleaned for invariants:

- fraction_decrease: optional contract with geometric proposal fallback;
  multi slash-fraction hazard refuse
- parse_and_solve: 9-decimal answer presentation boundary only (matches
  derivation verify uniqueness quantum; not algebra drift repair)
- proportional_decrease family asserts: serving_allowed after Gate A2k
- ADR-0184 S4b: re-pin equivalence corpus 937 → 1087

Not folded: local core-rs uv install (env-only), obsolete 3lang draft
from Gemini tree, double-rounding wrapper noise.
2026-07-08 20:00:51 -07:00
Shay
640dbe8fd7 feat: close 3-lang depth deck — same-turn roots, capability pins, public_demo budget
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Has been cancelled
smoke / smoke (-m "not quarantine") (pull_request) Has been cancelled
Complete residual work after PR #2/#3 merge:
- Same-turn he/grc depth via resolve_token_depths before PropGraph build
- Capability suite (he/grc exemplars, result fields, construction, dilation)
- public_demo: 60s reference budget, soft runtime case (hard raise opt-in)
- Pack-first geometric scale for fraction dilation; legacy N/M retained
- Re-pin public_demo SHA; lane-shas 9/9 green

Invariants: exact pack lookup, immutability, versor by construction, no
prior-turn dependency for first-contact he/grc root canonicalization.
2026-07-08 19:15:34 -07:00
Shay
0188af46c0 fix(3lang-depth): remove is_fully_grounded gate from depth enrichment so result always gets node_depths/gau for 3-lang; fix fixture to use combined packs + explicit skip docs; add runtime docstrings for contract; update draft md evidence
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 2m29s
smoke / smoke (-m "not quarantine") (pull_request) Failing after 4h41m33s
- Fixes skeptic gaps on empty fields in some smokes and fixture mismatch.
- Targeted tests green post-fix.
- Fresh captures have required non-empty data + documented skips.
2026-07-08 08:02:01 -07:00
Shay
5d9e2d0748 test+feat: marker/fixture for depth packs; top-level node_depths+graph_anti_unify on CognitiveTurnResult; docstrings+pr draft; verifs captured
- Addresses review items + goal plan acceptance.
- Real tests committed driving shipped pipeline+result.
- All per verification plan + checklist.
2026-07-08 07:54:53 -07:00
Shay
0dbcd63d63 feat: 3lang depth PropGraph unification - phase refinements, wiring, tests + session pickup cleanups/governance
- Complete depth canonical, pack resolver DEPTH_PACKS, pipeline attrs+node_depths+graph_anti, contemplate/pass_manager/contracts propagation (immutable).
- Polish anti_unifier, tests (oov, construction, percent), runtime/chat integration.
- Governance: AGENTS.md updates, docs/README/handoff_template, skills bootstrap, retire handoff.
- Leaves pickup seeds (NEW_SESSION_PROMPT, plan.md, compact) for continuity.
- Spine tests green, 3lang depth visible in ctx for he.

Refs: plan.md, 2026-07-06-compact.md
2026-07-08 07:07:11 -07:00
Shay
29284fae2a feat: implement phases 1-5 3-lang depth unification (antiunif root, default depth, contemplation prop, graph helper)
- root_normalize + depths in anti_unifier/derive/recognize for AC1
- default enrichment no flag for AC2
- depth to pass_manager + assess for AC3
- graph_anti_unify helper for AC4
- direct tests + verif per plan
Aligned with exact recall, immutability, cognitive spine path.
2026-07-06 09:37:38 -07:00
Shay
c1e723f185 feat: integrate 3-core-language depth into PropositionGraph spine for bidirectional unification
- Add LexicalResolution dataclass + resolve_entry() in chat/pack_resolver.py
  that returns language, root, morphology_id, gloss, semantic_domains from
  he/grc/en packs (lru-cached, first-match, full depth support).

- Extend GraphNode (generate/graph_planner.py) with optional language/root/
  morphology_id fields (defaults preserve all call sites). Update as_dict()
  to include them conditionally. ground_graph() now propagates depth.

- Generalize enrichment in core/cognition/pipeline.py:
  - Per-subject resolution map using depth packs.
  - Enrich all matching nodes before ground (subject→node map).
  - Pass depth alongside recalled_words to ground_graph().

- Consume depth on articulation side:
  - realize_semantic() and render_semantic() now accept/use language+root
    for etymological/Logos framing on Hebrew/Greek nodes (e.g. "אמת (Hebrew
    root: א-מ-ן) is defined as..."). English unchanged.

- Enrich oov_geometric_context with node_depths for future geometric
  anti-unification using roots.

- Extend recognition/connector.py to forward depth from EpistemicNode
  paths into GraphNode.

- Add full Hebrew turn test under realizer_grounded_authority flag.
- Update related tests (semantic realizer, OOV context, surface resolution).
- Cleaned legacy type() hack immediately on discovery (hard-stop rule).

All targeted tests green (52+ in slices), broad relevant suite 581 passed.
Invariants preserved: versor only at owned boundaries, exact recall,
immutable updates, no new legacy parsers. 3 pillars upheld.

Work continues tomorrow from this checkpoint.
2026-07-06 09:01:43 -07:00
Shay
be467a934f Fix admissibility exemplars data and test script for geometric engine updates 2026-07-04 15:25:45 -07:00
Shay
f6c1f01a13 Lane 4: Registry Consolidation (language_packs to packs) 2026-07-04 15:11:28 -07:00
Shay
c0cd44307a fix(tests): preserve environment in formation subprocess tests to ensure xdist hermeticity 2026-07-03 17:11:57 -07:00