feat: Grammar unlocks — verb table, Disambiguator trait, Quantum mode, Animal Farm harness#283
Conversation
…ce + 144-cell verb table
…m mode + Animal Farm harness
… + quantum_mode + PhaseTag fix - Re-exported VerbFamily, VerbRoleTable, SlotPrior, default_table from grammar/mod.rs - Re-exported Disambiguatable, GeneralizedResult, disambiguate_general - Added pub mod trajectory_audit + pub mod quantum_mode in deepnsm/lib.rs - Fixed PhaseTag from_angle/to_angle: u128::MAX as f32 was overflowing to infinity, producing NaN on round-trip. Switched to f64 intermediate and use only the low 64 bits (high 64 reserved for future precision)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f1745969f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pub fn pi() -> Self { | ||
| PhaseTag(u128::MAX / 2) | ||
| } |
There was a problem hiding this comment.
Encode π using the same low-64-bit phase representation
PhaseTag::pi() currently sets the full tag to u128::MAX / 2, but to_angle() only decodes the low 64 bits; that low half is all 1s for u128::MAX / 2, so PhaseTag::pi().to_angle() yields approximately 2π instead of π. Any caller using pi() as a canonical opposite-phase constant will get the wrong angle and phase comparisons will be skewed. This should be encoded via the same low-half scheme as from_angle (e.g., half of u64::MAX in the low 64 bits).
Useful? React with 👍 / 👎.
7d7b722
into
claude/grammar-fixes-r2-2026-04-29
…26-04-29 Re-land #283 unlocks (Quantum, Disambiguator, verb_table, animal-farm harness) — orphaned by merge order
- Fix 4× `#[deprecated(since = "next")]` invalid semver in context_chain.rs — drop `since` field (G3 refactor artifact) - Fix `actor.role <= u8::MAX` tautological comparison in lance_membrane.rs:768 — replace with meaningful `< 32` guard - Document Wave-1 LOC audit in EPIPHANIES.md: recovery (#275-#283) = +8,728; Wave 1 (#300-#306) = +3,156; combined = +11,807; zero LOC lost from G1 rebase cargo fmt --check: clean cargo clippy (4 crates): warnings only, 0 errors https://claude.ai/code/session_01NYGrxVopyszZYgLBxe4hgj
Summary
Implements epiphanies E3, E4, E5, E7, E8 from PR #279 outlook review. Stacks on
claude/grammar-fixes-r2-2026-04-29.VerbFamily(12 families: Becomes..Dissolves) ×Tense(12) = 144 cells. Each cell holdsSlotPrior(TEKAMOLO slot expectations).default_table()seeds Becomes → temporal+modal high, Causes → kausal high. Parsing reduces to table lookup + truth aggregation.TrajectoryHash = [u64; 256](16384-bit semantic hash).Trajectory::binarize(),audit_hash_u64(),trajectory_distance(). Cross-PR bridge: DeepNSM trajectory replacesstatement_hash: u64in audit log.Disambiguatabletrait +disambiguate_general<T>()free function. Domain-agnostic: same machinery for coreference, RLS predicate selection, triplet completion, style dispatch.EpiphanyPrediction,GroundTruthBeat,HarnessMetrics(precision, recall, arc-shift F1, direction accuracy).evaluate()function. 4 tests including perfect-confirmation and no-match cases.PhaseTag(u128)withfrom_angle/to_angle/distance(Hamming on 128 bits).HolographicMode { SinglePhase, PerRole }. Crystal vs Quantum is a knob, not a separate stack.nars: { primary: X }), whitespace-aware#comment stripping,TekamoloSlot::Instrumentvariant (no longer silently mapped to Modal).AwarenessSnapshot+snapshot()/restore()round-trip for cross-session persistence.frequency == 0.5).Stats
Test plan
cargo check -p lance-graph-contract— greencargo check --manifest-path crates/deepnsm/Cargo.toml— greencargo test -p lance-graph-contract --lib— 302 passedcargo test --manifest-path crates/deepnsm/Cargo.toml --lib— 76 passedcargo test --manifest-path crates/deepnsm/Cargo.toml --test animal_farm_harness— 4 passedhttps://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh