Skip to content

recipes: audit finds they measure on a scalar proxy → wire the 3 real tenants (A9 24 loci + SPO + qualia)#780

Merged
AdaWorldAPI merged 4 commits into
mainfrom
claude/x265-x266-plans-review-h9osnl
Jul 21, 2026
Merged

recipes: audit finds they measure on a scalar proxy → wire the 3 real tenants (A9 24 loci + SPO + qualia)#780
AdaWorldAPI merged 4 commits into
mainfrom
claude/x265-x266-plans-review-h9osnl

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Root cause (the audit answers "do the 34 recipes measure what they claim?")

recipe_claim_audit exercises the real shipped recipe_kernels::kernel(id) on a positive vs control ctx, two measured axes:

Verdict: the recipe compositions are sound; the dominant weakness is substrate-side — the wiring, not the recipes.

The wiring (closes the gap)

  • causal_witness::CausalWitnessFacet — the A9 "24 edges": a reading of the 12-byte content-blind register as 24 signed i4 loci (G24N4), each a context pointer (∈[−8,+7], 0=unbound) into the ±8 Markov window. The third ClassView reading of the same register feat(P4): autopoiesis-triangle wiring on the SoA/ractor carrier (Bricks 1-2) #729 shipped two of (FROZEN 12×u8, Orchestration 6×(8:8)) — a reading, no stored bytes, envelope-safe. 16 named loci + 8 reserved-empty (never padded).
  • recipe_substrate::SubstrateView — projects SPO + witness + qualia into the recipe input. Qualia is ADDITIVE + STAKES-only (temperature, never a logical marker); logic + causality ← SPO + the 24 witness edges (the cause is Locus::Kausal, not a qualia); a missing tenant emits NaN/empty (the NaN-disqualifier signal).
  • recipe_dispatch — the 34 as a rung-ordered, NaN-gated causal ladder keyed by NARS inference type (deduction / induction=fanout / abduction / revision / counterfactual). Thinking is a causal act: the ladder is a causal chain; each step logs its triggering cause (Versuchsleitereffekt = observer effect); dispatch is a deterministic Schrödinger collapse; a NaN required input is an unmeasurable conjugate (skipped, not read off noise); the N≤√d/4 bundle bound is the Heisenberg-shaped uncertainty relation.

Evidence

  • 3 contract modules + 3 probes; +18 tests → 970 green, clippy clean, fmt clean.
  • All example gates green: recipe_claim_audit, loci_recipe_relevance (the 24×34 relevance matrix), recipe_ladder_over_substrate (the whole wiring end-to-end).
  • Additive, zero-dep, nothing existing touched.

Board hygiene

E-RECIPE-SUBSTRATE-WIRING-1 (EPIPHANIES), LATEST_STATE contract inventory (3 modules), STATUS_BOARD D-REC-WIRE-1.

Open / follow-ups (operator gates)

  • pair_similarity is a documented zero-dep stand-in for the ndarray 256×256 CAM-PQ table (ndarray-side follow-up).
  • External validation anchors (operator-provided, out of current repo scope, flagged for a future add_repo + benchmark probe): AdaWorldAPI/NARS-Swift (inference-rule oracle for the deduction/induction/abduction/revision/counterfactual map) and MME-Reasoning (arXiv 2505.21327 — the reasoning benchmark test bed).
  • rs-graph-llm orchestration over SoA mailbox delegate ownership consumes this ladder (next layer).

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added causal-witness data support for tracking relationships, contradictions, quorum, and antecedents.
    • Added substrate-aware recipe evaluation using SPO, witness, and qualia signals.
    • Added ordered dispatch for 34 recipes with inference classification and rung progression.
    • Added reliability checks that skip recipes when required inputs are missing or undefined.
    • Added examples and audits for recipe relevance, substrate coverage, and causal-ladder behavior.
  • Documentation

    • Updated project boards with the new recipe-audit deliverable, findings, and contract inventory.

… tenants

recipe_claim_audit exercises the REAL shipped recipe_kernels: 28/34 recipes
measure/realize their claim on the ThoughtCtx proxy (2 INERT bugs CAS/ETD,
4 CONSTANT input-independent ARE/ZCF/ICR/HKF), but 34/34 read ONLY the scalar
proxy basis — none touch the SPO/CAM-PQ/Markov/qualia organ they name. The
dominant weakness is substrate-wiring, not recipe composition.

Wire the three real tenants into the recipe input:
- causal_witness::CausalWitnessFacet — A9 "24 edges": a reading of the 12-byte
  content-blind register as 24 signed i4 loci (G24N4), each a context pointer
  into the ±8 Markov window. The THIRD ClassView reading of the same register
  #729 shipped two of (FROZEN 12xu8 + Orchestration 6x(8:8)); no stored bytes.
- recipe_substrate::SubstrateView — projects SPO + witness + qualia into the
  recipe input. Qualia is ADDITIVE + STAKES-only (temperature, never logic);
  causality is the witness KAUSAL edge, not a qualia; a missing tenant emits
  NaN/empty (the NaN-disqualifier signal).
- recipe_dispatch — the 34 as a rung-ordered, NaN-gated causal ladder keyed by
  NARS inference type (deduction/induction/abduction/revision/counterfactual).
  Thinking is a causal act: the ladder is a causal chain, each step logs its
  triggering cause (Versuchsleitereffekt = observer effect), dispatch is a
  deterministic Schroedinger collapse, a NaN input is an unmeasurable conjugate.

3 modules + 3 probes (recipe_claim_audit, loci_recipe_relevance,
recipe_ladder_over_substrate — all gates green), +18 tests -> 970 green,
clippy clean. Additive, zero-dep, nothing existing touched. Board hygiene:
E-RECIPE-SUBSTRATE-WIRING-1, LATEST_STATE, STATUS_BOARD D-REC-WIRE-1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3RyLEbuNSHxxB3NTTrGki
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@AdaWorldAPI, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ac87797-17ff-4e3e-bce9-45b577a6413a

📥 Commits

Reviewing files that changed from the base of the PR and between ecc97c0 and 8ce96b0.

📒 Files selected for processing (2)
  • .claude/board/EPIPHANIES.md
  • crates/lance-graph-contract/src/recipe_dispatch.rs
📝 Walkthrough

Walkthrough

Adds a packed causal-witness facet, substrate-to-ThoughtCtx projection, rung-ordered recipe dispatch with NaN gating, and executable audits covering recipe behavior, locus relevance, qualia isolation, and tenant absence.

Changes

Recipe substrate wiring

Layer / File(s) Summary
Causal witness contract
crates/lance-graph-contract/src/causal_witness.rs, crates/lance-graph-contract/src/lib.rs
Adds a 12-byte, 24-locus CausalWitnessFacet with signed-nibble access, named loci, resolution, agreement logic, and tests.
Substrate projection
crates/lance-graph-contract/src/recipe_substrate.rs
Derives logical markers from SPO and witness facets, applies qualia only to temperature, and projects grounded or NaN-gated values into ThoughtCtx.
Rung-ordered causal dispatch
crates/lance-graph-contract/src/recipe_dispatch.rs
Maps 34 recipes to inference types and rungs, orders the ladder, records RecipeStep results, and disqualifies recipes with undefined required inputs.
End-to-end ladder example
crates/lance-graph-contract/examples/recipe_ladder_over_substrate.rs
Exercises grounded tenants, qualia swaps, tenant removal, rung ordering, witness causality, and NaN disqualification.
Recipe audit and relevance probes
crates/lance-graph-contract/examples/recipe_claim_audit.rs, crates/lance-graph-contract/examples/loci_recipe_relevance.rs, .claude/board/*
Adds recipe claim classifications, organ wiring reporting, a 24×34 locus relevance matrix, validation gates, and board entries.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SubstrateView
  participant ThoughtCtx
  participant recipe_dispatch
  participant recipe_kernels
  SubstrateView->>ThoughtCtx: project SPO, witness, and qualia markers
  ThoughtCtx->>recipe_dispatch: provide recipe inputs
  recipe_dispatch->>recipe_kernels: inspect required fields
  recipe_kernels-->>recipe_dispatch: return required masks
  recipe_dispatch-->>ThoughtCtx: return rung-ordered RecipeStep results
Loading

Possibly related PRs

Poem

A rabbit hops through rungs in line,
With witness bytes in neat design.
Qualia warms, but does not steer,
NaNs make missing paths clear.
Recipes leap, audits glow—
Hoppy contracts, ready to go! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the audit finding and the addition of three real substrate tenants, which are the main changes in the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_077abd3e-167b-4ef5-8fdd-700581960bf1)

claude added 2 commits July 21, 2026 12:37
… reasoning, Pei Wang/NARS)

arXiv 2511.08392 is the formal frame recipe_dispatch instantiates — a RecipeStep
is one proof-carrying step (inference=rule, trigger=premises, nan_disqualifier=
the verification gate). Adds MME-Reasoning arXiv id + taxonomy to the anchors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3RyLEbuNSHxxB3NTTrGki
…SCM ladder)

arXiv 2206.15475 formalizes the structural-causal-model ladder the witness edges
instantiate: SCM structure = Locus::Kausal, intervention = Pearl rung-2,
counterfactual = rung-3 = RecipeInference::Counterfactual (ICR #31).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3RyLEbuNSHxxB3NTTrGki
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review July 21, 2026 12:46
…s, one catalogue

66f5a73 measured select_tactic's reachability (8/34, Infrastructure never wins,
ICR #31 shadowed by RCR #4). The ladder is the complementary mode, not a
replacement: selector = foveated saccade (one tactic per surprise cycle),
ladder = systematic sweep (all 34 in rung order, NaN-gated) — the three
measured gaps close by mode composition, not selector retuning. Cross-ref in
the module doc.

Board: E-LADDER-UNSHADOWS-SELECTOR-1 (the mode-composition finding) +
E-THINKING-SKILLS-ARE-RUNG-4-MACROS-1 (cc-thinking-skills = rung-4 macro
catalogue over the rung-3 recipes; mapped pairs + the unmapped expansion
surface; the 34 stays operator-locked).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3RyLEbuNSHxxB3NTTrGki
@AdaWorldAPI
AdaWorldAPI merged commit 8a00988 into main Jul 21, 2026
3 of 4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ecc97c0a77

ℹ️ 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".

Comment on lines +245 to +246
let disq = nan_disqualifier(ctx, id);
let trigger = kernel(id).map(|k| k.requires().len()).unwrap_or(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor tactic gates in the ladder

When ctx.sd is in FLOW (sd < SD_FLOW), Gate-bucket recipes such as TCP are skipped by Tactic::run, but ladder() only checks nan_disqualifier and records disqualified_by: None, so callers see those recipes as firing even though the actual kernel gate would reject them. This makes the new dispatch map disagree with the shipped execution semantics for any FLOW context; incorporate kernel(id).gate(ctx) (or a separate skipped state) before reporting a recipe as fired.

Useful? React with 👍 / 👎.

Comment on lines +106 to +109
let sw = (pair_similarity(self.spo.subject, self.spo.ew_subject)
+ pair_similarity(self.spo.predicate, self.spo.ew_predicate)
+ pair_similarity(self.spo.object, self.spo.ew_object))
/ 3.0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not score missing SPO as perfect agreement

When the SPO tenant is absent (SpoFacet::default()) but a quorum or contradiction witness edge is bound, project() treats confidence as grounded and calls this method; the all-zero default SPO then compares each semantic rail to an all-zero witness rail and pair_similarity returns 1.0 for all three pairs. That turns a missing SPO tenant into a strong confidence signal instead of an undefined/neutral one, so recipes requiring Confidence can fire on fabricated evidence; skip or neutralize the SPO agreement term unless spo_present() is true.

Useful? React with 👍 / 👎.

AdaWorldAPI pushed a commit that referenced this pull request Jul 21, 2026
LATEST_STATE shipped-PRs row + PR_ARC_INVENTORY prepend (Added/Locked/
Deferred/Docs/Confidence) + STATUS_BOARD D-REC-WIRE-1 -> Shipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3RyLEbuNSHxxB3NTTrGki

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
crates/lance-graph-contract/examples/recipe_ladder_over_substrate.rs (1)

87-92: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use a distinct peer witness here agreement_count(row.witness) is self-comparison, so it always returns the full locus count. If this is meant to demonstrate quorum agreement, pass a separate witness instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/lance-graph-contract/examples/recipe_ladder_over_substrate.rs` around
lines 87 - 92, Update the example’s agreement-count demonstration in the
println! block to pass a distinct peer witness rather than row.witness itself.
Obtain or construct the intended comparison witness from the surrounding
recipe-ladder example, and preserve the existing output while ensuring
agreement_count compares two different witnesses.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/lance-graph-contract/examples/recipe_claim_audit.rs`:
- Around line 673-689: Replace the hardcoded proxy_only value in the aggregate
section with a count derived from each recipe kernel’s requires() contract. For
every RECIPES entry, resolve its kernel and count it only when all required
fields belong to the 8-field ThoughtField scalar basis, then use that measured
count in the existing Axis B output.

In `@crates/lance-graph-contract/src/recipe_substrate.rs`:
- Around line 98-121: Update logical_confidence() to detect an absent/default
SPO facet before calculating pairwise agreement, using the existing SPO presence
semantics such as spo_present(). Return zero confidence for ungrounded SPO while
preserving the current quorum, contradiction, and agreement formula for grounded
SPO.

---

Nitpick comments:
In `@crates/lance-graph-contract/examples/recipe_ladder_over_substrate.rs`:
- Around line 87-92: Update the example’s agreement-count demonstration in the
println! block to pass a distinct peer witness rather than row.witness itself.
Obtain or construct the intended comparison witness from the surrounding
recipe-ladder example, and preserve the existing output while ensuring
agreement_count compares two different witnesses.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63f1be12-42ff-4c4c-aca5-7f6376c68559

📥 Commits

Reviewing files that changed from the base of the PR and between 3515f7f and ecc97c0.

📒 Files selected for processing (10)
  • .claude/board/EPIPHANIES.md
  • .claude/board/LATEST_STATE.md
  • .claude/board/STATUS_BOARD.md
  • crates/lance-graph-contract/examples/loci_recipe_relevance.rs
  • crates/lance-graph-contract/examples/recipe_claim_audit.rs
  • crates/lance-graph-contract/examples/recipe_ladder_over_substrate.rs
  • crates/lance-graph-contract/src/causal_witness.rs
  • crates/lance-graph-contract/src/lib.rs
  • crates/lance-graph-contract/src/recipe_dispatch.rs
  • crates/lance-graph-contract/src/recipe_substrate.rs

Comment on lines +673 to +689
// ── aggregate ──
let recipe_weak = n_inert + n_constant;
let proxy_only = 34; // structural: every kernel's requires() is in the 8-scalar basis
println!("\n── aggregate ──");
println!(
" Axis A: {} MEASURES + {} REALIZES = {} sound on the proxy; {} recipe-WEAK ({} INERT + {} CONSTANT)",
n_measures,
n_realizes,
n_measures + n_realizes,
recipe_weak,
n_inert,
n_constant
);
println!(
" Axis B: {}/34 kernels consume ONLY the ThoughtField scalar proxy basis — 0 consume a real organ",
proxy_only
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Axis B is asserted, not measured. The module doc bills Axis B as "measured, structural," but proxy_only is a hardcoded 34 and the only related gate (G4) merely checks that ORGAN_SHIPS maps all 34 ids — nothing inspects each kernel's requires() to confirm it draws solely from the 8-field scalar basis. The headline printed to the operator ("34/34 kernels consume ONLY the ThoughtField scalar proxy basis") is therefore an unverified constant. Since requires() is already the gate contract used elsewhere, deriving this from the kernels would make the claim self-substantiating.

Sketch: derive Axis B instead of hardcoding
// count kernels whose requires() is a subset of the scalar ThoughtField basis
let proxy_only = RECIPES
    .iter()
    .filter(|r| /* every field in kernel(r.id).requires() is a ThoughtField scalar */ true)
    .count();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/lance-graph-contract/examples/recipe_claim_audit.rs` around lines 673
- 689, Replace the hardcoded proxy_only value in the aggregate section with a
count derived from each recipe kernel’s requires() contract. For every RECIPES
entry, resolve its kernel and count it only when all required fields belong to
the 8-field ThoughtField scalar basis, then use that measured count in the
existing Axis B output.

Comment on lines +98 to +121
/// **Logical confidence** — from the SPO tenant + witness edges ONLY (no
/// qualia). Rises when a **quorum** (agreeing) peer is bound and when the
/// semantic triple agrees with its episodic witness; the contradiction edge
/// pulls it down.
#[must_use]
pub fn logical_confidence(&self) -> f32 {
// SPO semantic ↔ episodic-witness agreement (real: does the triple's
// meaning match what was witnessed).
let sw = (pair_similarity(self.spo.subject, self.spo.ew_subject)
+ pair_similarity(self.spo.predicate, self.spo.ew_predicate)
+ pair_similarity(self.spo.object, self.spo.ew_object))
/ 3.0;
let quorum = if self.witness.is_bound(Locus::Quorum) {
0.2
} else {
0.0
};
let contra = if self.witness.is_bound(Locus::Contradiction) {
0.2
} else {
0.0
};
(0.5 * sw + 0.3 + quorum - contra).clamp(0.0, 1.0)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

logical_confidence() reads default (absent) SPO as "perfect agreement."

When spo is SpoFacet::default() (all-zero, meaning "no SPO tenant"), subject == ew_subject == predicate == ew_predicate == object == ew_object == (0,0), so pair_similarity returns 1.0 for all three pairs and sw = 1.0 — the formula then reports ≈0.8 confidence for a row with no real SPO grounding at all. project() correctly gates this today via conf_grounded, but this public method returns a misleading high score to any caller that invokes it directly without checking spo_present() first.

🛡️ Proposed fix: guard the direct accessor too
     pub fn logical_confidence(&self) -> f32 {
+        if !self.spo_present() {
+            // No real SPO tenant: don't let the all-zero-agrees-with-all-zero
+            // artifact of `pair_similarity` masquerade as grounded agreement.
+            let quorum = if self.witness.is_bound(Locus::Quorum) { 0.2 } else { 0.0 };
+            let contra = if self.witness.is_bound(Locus::Contradiction) { 0.2 } else { 0.0 };
+            return (0.3 + quorum - contra).clamp(0.0, 1.0);
+        }
         // SPO semantic ↔ episodic-witness agreement (real: does the triple's
         // meaning match what was witnessed).
         let sw = (pair_similarity(self.spo.subject, self.spo.ew_subject)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// **Logical confidence** — from the SPO tenant + witness edges ONLY (no
/// qualia). Rises when a **quorum** (agreeing) peer is bound and when the
/// semantic triple agrees with its episodic witness; the contradiction edge
/// pulls it down.
#[must_use]
pub fn logical_confidence(&self) -> f32 {
// SPO semantic ↔ episodic-witness agreement (real: does the triple's
// meaning match what was witnessed).
let sw = (pair_similarity(self.spo.subject, self.spo.ew_subject)
+ pair_similarity(self.spo.predicate, self.spo.ew_predicate)
+ pair_similarity(self.spo.object, self.spo.ew_object))
/ 3.0;
let quorum = if self.witness.is_bound(Locus::Quorum) {
0.2
} else {
0.0
};
let contra = if self.witness.is_bound(Locus::Contradiction) {
0.2
} else {
0.0
};
(0.5 * sw + 0.3 + quorum - contra).clamp(0.0, 1.0)
}
/// **Logical confidence** — from the SPO tenant + witness edges ONLY (no
/// qualia). Rises when a **quorum** (agreeing) peer is bound and when the
/// semantic triple agrees with its episodic witness; the contradiction edge
/// pulls it down.
#[must_use]
pub fn logical_confidence(&self) -> f32 {
if !self.spo_present() {
// No real SPO tenant: don't let the all-zero-agrees-with-all-zero
// artifact of `pair_similarity` masquerade as grounded agreement.
let quorum = if self.witness.is_bound(Locus::Quorum) {
0.2
} else {
0.0
};
let contra = if self.witness.is_bound(Locus::Contradiction) {
0.2
} else {
0.0
};
return (0.3 + quorum - contra).clamp(0.0, 1.0);
}
// SPO semantic ↔ episodic-witness agreement (real: does the triple's
// meaning match what was witnessed).
let sw = (pair_similarity(self.spo.subject, self.spo.ew_subject)
pair_similarity(self.spo.predicate, self.spo.ew_predicate)
pair_similarity(self.spo.object, self.spo.ew_object))
/ 3.0;
let quorum = if self.witness.is_bound(Locus::Quorum) {
0.2
} else {
0.0
};
let contra = if self.witness.is_bound(Locus::Contradiction) {
0.2
} else {
0.0
};
(0.5 * sw + 0.3 + quorum - contra).clamp(0.0, 1.0)
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/lance-graph-contract/src/recipe_substrate.rs` around lines 98 - 121,
Update logical_confidence() to detect an absent/default SPO facet before
calculating pairwise agreement, using the existing SPO presence semantics such
as spo_present(). Return zero confidence for ungrounded SPO while preserving the
current quorum, contradiction, and agreement formula for grounded SPO.

AdaWorldAPI added a commit that referenced this pull request Jul 21, 2026
…w-h9osnl

board: post-merge hygiene for #780 (LATEST_STATE row + PR_ARC prepend + D-REC-WIRE-1 → Shipped)
AdaWorldAPI pushed a commit that referenced this pull request Jul 21, 2026
…e dispatch (Maslow carry + prune, organ-derived rung)

Closes #780's Axis-B gap on the DISPATCH path. #780 wired the organs into the
ctx (SubstrateView) but the dispatch gate stayed on the 8-field scalar proxy.
recipe_loci is the missing half: a dispatch gate keyed to the live
CausalWitnessFacet 24 loci.

- required_loci(id): each recipe's consumed Locus dimensions, grounded in the
  recipe's own recipes.rs::substrate string.
- loci_disqualifier / reachable: per-specific-dimension gate (never a popcount) —
  a recipe fires only when every required dimension is BOUND.
- locus_rung / loci_rung / loci_dispatch_order: the ORDER is organ-derived too —
  a recipe is as deep as its deepest required dimension (ICR #31 → Counterfactual
  apex because Kausal/Contradiction ARE apex dimensions), replacing the static
  Tier+inference table (kept as a documented cross-check).
- carried_awareness: lower-rung groundings read UP the Maslow climb, monotone,
  never re-derived (the anti-exponential-rediscovery property; #777).
- active_after_prune: higher thinking subsumes lower-related (strict dimension
  superset) and drops it from active dispatch.

Complements the two shipped reach-doors (A style-fan / B select_tactic) which
gate on style/mechanism/scalar and never read the organ. Additive, zero-dep,
nothing existing touched. 11 module tests + examples/recipe_loci_walk.rs with 4
measured gates (selector 7/34, organ 34/34 grounded, carry monotone, prune
fires + apex survives). Board: E-RECIPE-LOCI-ORGAN-GATE-1, LATEST_STATE
inventory, STATUS_BOARD D-REC-LOCI-1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD
AdaWorldAPI pushed a commit that referenced this pull request Jul 21, 2026
…#783 = CONVERGENT

E-RECIPE-LOCI-CONVERGENCE-1: recipe_loci is the organ-gated dispatch half that
pairs with my organ-input half; witness_fabric→recipe_loci is a clean
producer→consumer chain. One MEASURED tension: two rung definitions (organ-depth
vs inference-cost) dispatch 38% of recipe-pairs in a different order (both agree
ICR#31 apex). No hard collision. Recommends 3 small wiring follow-ups.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3RyLEbuNSHxxB3NTTrGki
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.

2 participants