From a191dc4f6e4c423882d659267a877417f375b742 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:11:46 +0200 Subject: [PATCH 01/46] docs: specify D-SAG-2 wisdom-frontier CARE/Rubikon/OpenPsi falsifiers --- .../sag-wisdom-frontier-ona-hyperon-v1.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 .claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md diff --git a/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md new file mode 100644 index 000000000..22a0fc947 --- /dev/null +++ b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md @@ -0,0 +1,180 @@ +# D-SAG-2 — Wisdom frontier: OpenPsi x Rubikon x Shannon x CARE x ONA/Hyperon + +**Status:** RESEARCH / FALSIFIABLE DESIGN ONLY, 2026-10-12. Sibling extension of merged [D-SAG-1 / #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). **No implementation, runtime evaluation, opcode, wire change, new graph engine, bit migration, authorization change, or speedup claim.** + +**Read alongside:** [D-SAG-1](software-awareness-graph-v1.md), [D-MATURATION3-0](../knowledge/maslov-pyramid-of-cognition.md), [D-RV](rubicon-volition-v1.md), [PLN/Shannon #1497](../../.arxiv/2026-10_opencog_pln_shannon_attention_research_map.md), [CARE paper notes](../../.arxiv/2606.14581_synthesize_programs_gate_commit.md), and [new annotated sources](../../.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md). A self-contained execution prompt lives at [sag-wisdom-frontier-claude-code.md](../prompts/sag-wisdom-frontier-claude-code.md). + +## Thesis and falsifiable question + +Can a stage-0 **validated wisdom anchor** reveal an expanding frontier of unresolved, evidence-grounded consequences; can masked popcount find the smallest epistemic holes cheaply; and can OpenPsi-like intrinsic demands, calibrated expected information gain (EIG), CARE-style reference-conditioned program selection and Rubikon commitments improve **useful independently verified outcomes per total unit of work** relative to deterministic schedulers, without self-support, stale action, outcome leakage or a second execution engine? + +Three roles **must not be collapsed**: +1. **Epistemic maturation:** where an individual explanation stands (experimental stage 7 -> 0). +2. **Intrinsic motivation:** how strongly an *investigation* should compete for a scarce budget, computed from demands and expected learnability. +3. **Volition/authority:** whether an intention is committed and whether an action is permitted to execute. + +Information gain does not prove causality. A program selected by CARE does not acquire execution authority. A stage-0 anchor is not omniscient; it has demonstrated downstream dependence under an isolated ablation. + +## Observed integration baseline, not hypothetical infrastructure + +- #1509 projects real MethodTable/prepared methods into SoftwareGraph typed nodes/edges with tiers: declared / derived / compiled / verified / hypothesis, then runs **ordinary Quack Draft -> mask-risc**. It reports only **one concept and one hop**. Source revision can be caller-supplied, graph remains in memory, and multi-hop population intermediate is unresolved. +- Its current H1 candidate is selection fusion for billable_hours / MaskedSumI32. Scalar reference times are **not** timings of a fused SIMD implementation. Predicate ternlog and FusedFold terminal gaps remain. +- #1494 experimentally runs pearl::hydrate with provenance roots, feedback, stage transitions, anchor ablation; no production feedback or production maturation band. #1497 separates inference, scheduling and physical execution. #1500 separates goal selection, conditional commitment and permit to act. +- ONA's public C/evaluation.py suite, Hyperon/MeTTa tests, modern PLN/PeTTa, and Hyperon OpenPsi are **distinct oracles**. The ONA v0.9.3 MeTTa-NARS bridge gives a real integration seam, **not** a guaranteed semantic equivalence proof. + +## 0. Contract and safety invariants + +| Surface | Existing fact / permitted research | Hard prohibition | +| --- | --- | --- | +| ISA / byte lanes | Stable register/ALU bytes; semantics supplied by ClassView + provenance | Do not put OpenPsi or CARE laws in the universal byte layout | +| CE64[50..52] | **Production plasticity**, read by learn, MooreNars16 and V3. #1494 uses a **test-local, explicitly declared** Maturation3 (7..0) only | Do not reinterpret an existing provenance as maturation or overwrite plasticity | +| CE64[59..63] | Declared EpistemicState5 topology/certification reading | No desire, entropy, or commit bit in epistemic state | +| Statistical support | NARS f/c and observation-root ancestry under declared readings | Do not relabel NARS confidence or PLN strength as calibrated probability | +| Evidence | Derived results carry union of **original observation roots** and no new root; exclude self/descendant support | No mutually grounded cycles, false root independence, or certification through hydration alone | +| Intent | Versioned goal/intention/plan/permit/receipt outside CE64 | Never execute effects because confidence/entropy/goal intensity rose | +| SAG | Existing ClassView/MethodTable/SoftwareGraph -> Quack -> mask-risc | No new index, graph engine or shadow methods registry; do not assert multi-hop works | + +## 1. Suggested probe-local record shape (NOT a Rust ABI) + + FrontierItem { + anchor_id, relation_id, reading_id, source_rev, tier, + required_mask, established_mask, refuted_mask, + original_root_ids, derivation_parent_ids, + maturity_test_local, candidate_hypotheses, + provenance, cost_estimate, authorization_scope + } + Proposal { + program_hash, schema_seal, data_revision, + evidence_cutoff, ordered_candidates, scores, + reference_score, challenger_score, + invariant_verdict, rubicon_state, decision_receipt + } + +Identity is typed (method key / ClassId / reading / schema seal), never just display text. No inferred raw CE64 bit position stands in for an external evidence-root ID, witness ID or decision receipt. + +## 2. Stage-0 seed -> popcount -> recursively exposed frontier + +At a validated stage-0 anchor, enumerate **only relations reachable through a documented legal one-hop projection** and which have an eligible expected consequence; do not pretend Quack supports arbitrary traversals. If a second hop is required, materialize a verified scalar/relation carrier or stop with an explicit MultiHopBlocked, never silently add a second engine. + +For each candidate typed relation, on a declared prerequisite universe U: + + missing = required & ~(established | refuted) + blocked = required & refuted + debt = popcount(missing) + +- Bit sets are **schema-defined prerequisite masks** with a declared bit universe, not popcount over raw CE64 or arbitrary evidence bytes. +- Distinguish **unknown** from **refuted** and **unobserved** from **false**. A candidate with blocked != 0 cannot be auto-hydrated. +- debt == 0 means **ready for an independent validation check**, *not true*; debt == 1 nominates a cheap discriminating question; larger debt stays possible if EIG/utility justifies cost. +- Candidate source must be a genuine verified/compiled edge at an eligible tier; hypothetical edges stay hypotheses. +- A derived relation may become a premise *only after resolution*, inheriting unique observation roots. No descendant becomes a premise for its own ancestor, even after reopening. +- Iterate to a **bounded fixed point** with seeded work queue, deduplication, hop/row/time budget, policy version and snapshot; log per-iteration delta and root set. Stop at zero new valid resolutions; repeated pass must be byte-idempotent. +- A new observation contradicting the *derived relation* starts a stage-7 episode for that relation; it does not regress an unrelated stage-0 anchor. Direct counterevidence against an anchor reopens that anchor and its descendants as appropriate. + +This is **fractal-like recurrence of the same maturation pattern**, not a claim of mathematical fractal dimension or unbounded growth. Measure branching and depth empirically. + +## 3. OpenPsi demand and intrinsic-value policy + +Treat OpenPsi demand / modulator / goalSelector as **architectural references**, not a ready-to-import component. Research mapping: + +| OpenPsi / psychology | Overlay candidate | +| --- | --- | +| curiosity, competence, resource pressure | demand measurements and budget signals (separate from evidence) | +| demand arbitration and contextual modulation | pure, reproducible candidate scheduler | +| Heckhausen predecisional deliberation | compare goal desirability, feasibility and risk | +| Rubikon | explicit versioned goal-intention commit, revocable | +| Gollwitzer implementation intention | cue -> guarded ActionDef candidate | +| Kanban | Proposed -> Deliberating -> Committed -> Planned -> Ready -> Executing -> Evaluating -> Replan / Hold / Disengage | +| outcome-driven demand revision | external observed outcome receipt; do not reward predicted self-confirmation | + +OpenPsi [PR #117](https://github.com/iCog-Labs-Dev/hyperon-openpsi/pull/117) documents a current tie-breaking and demand->goal mapping defect; probe tied demands, iteration permutations and genuinely distinct goals. Its status/merge are not assumed. + +The Rubikon psychological commitment is **not** the execution permit. Permission, capability, current cue, replay idempotency and revocation must each be checked at effect time. Failed permits produce a refusal receipt, not an action. + +## 4. Shannon, EIG and causally useful exploration + +For a **pre-registered, calibrated distribution** over rival explanations Theta, define: + + H(Theta | D) = - sum_i p_i log2(p_i) + EIG(a) = H(Theta | D) + - E_{outcome ~ predictive(a,D)} H(Theta | D, outcome) + +NARS f/c, PLN truth values and CE64 certification are not p_i by default. If calibration cannot be demonstrated, abstain from entropy/EIG claims or use a separate explicitly declared model. Include a high-entropy **irreducible-noise TV** that naïve uncertainty scheduling wastes budget on, and a modest-entropy *discriminating intervention* with real downstream consequences. + +Optional **hypothesis** (not a law): + + priority(a) = [EIG(a) * P(independent causal usefulness | D,a)] + / [estimated_total_work(a) + epsilon] + +Pre-register how causal usefulness is estimated **without peeking at outcomes**. CARE here has two independently named roles: +- **CARE paper (Liu et al., arXiv:2606.14581v5):** persistent executable ranking program as challenger to non-LLM reference; validate program and score every eligible candidate; gated pre-outcome decision; immutable record; post-outcome update. +- **Causal ablation / Pearl-like counterfactual tests:** a separate local falsification oracle, **not** a feature the paper itself proves or a substitute for its program-selection gate. + +Never reward entropy for entropy's sake. Penalize useless curiosity through measured outcomes, not circular proxies. + +## 5. CARE-style proposal and Rubikon lifecycle + + READ pre-outcome snapshot S_t (seed, population, allowed evidence roots) + |-> reference: fixed deterministic popcount/FIFO/confidence policy + |-> challenger: optional versioned (R2IL/Quack where representable) + | ranking program proposed from SAG + demand state + |-> validate program: bounded, pure, finite score for ALL candidates, + | permutation invariant, no hidden side effects, + | schema+reading+rev compatible, budget counted + |-> compare using **only pre-outcome evidence** and an independently + | specified deterministic gate; on fail choose reference + |-> record hash, inputs, scores, ranking, reasons, gate, version, time + |-> RUBIKON: commit *goal*; conditional plan requires live permit + |-> actual outcome / policy refusal recorded after selection + |-> update demand / epistemic evidence / disengage or replan + |-> optional new knowledge can enter next snapshot only + +No proposed optimizer H1 is performed automatically. Any optimization is a proposal checked by semantic equivalence, NULL/bag/set, cost tier and authority, and requires an authorized effect separately. + +## 6. Falsifier ledger (proposed D-SAG-2-0 .. 15) + +| ID | Fixture / comparison | Failure condition | +| --- | --- | --- | +| 0 | Identical snapshot/candidate ids, fixed RNG, budgets | incomparable baseline or post-outcome evidence leak | +| 1 | One-anchor A->B->C; no feedback vs valid feedback | new root manufactured; no expected fixed point | +| 2 | Independent roots vs two paths to same root | dependent evidence counted twice | +| 3 | Ungrounded A->B->C->A; grounded cycle then anchor removal | self-grounding or resurrection after ablation | +| 4 | Source graph edge changed after a certificate | stale evidence accepted as verified | +| 5 | One missing, many missing, zero missing, explicitly refuted | refuted/unknown conflation; 0 missing -> certified | +| 6 | Permute source rows/chunks, ties, vector lanes | ordering changes selected semantic candidate | +| 7 | High-entropy noisy-TV vs learnable low-entropy cause | naive entropy falsely promoted as successful curiosity | +| 8 | Reward delayed but reachable vs goal impossible | perseverance in impossible goal; premature disengagement | +| 9 | Cue, near miss, revoked permit, cancellation race | action executes without live permit | +| 10 | Hold ONA and Hyperon rules fixed, change scheduler only | claimed benefit actually derives from different reasoning | +| 11 | Hold scheduler fixed, vary ONA/PLN native inference engine | semantic differences masked by adapter | +| 12 | ONA/MeTTa-NARS bridge: bindings, f/c, time, truth operations | adapter coerces non-equivalent semantics | +| 13 | CARE challenger rejects nonfinite/partial/order-dependent scores | invalid challenger commits anyway | +| 14 | SAG #1509: tier mismatch, two-hop query, H1 fused vs scalar | invented shipped feature, or unauthorized optimizer | +| 15 | Whole-work accounting and matched seed/oracle | apparent advantage vanishes with compile/IO/rejections | + +For *each* passed positive probe, disable its key guard once and demand a RED test, then restore. Negative/silence twins must remain quiet; no downstream action or EIG inflation when input contains no new valid evidence. + +## 7. Four controlled axes and reporting + +1. **Oracle/inference:** ONA native, ONA through the MeTTa-NARS bridge, Hyperon/MeTTa + modern PLN (and scalar independent oracle). Pin commits/dependencies; first establish semantics, do **not** force identical truth laws. +2. **Scheduler:** FIFO, confidence-only, smallest popcount debt, raw Shannon entropy, calibrated EIG, EIG + stage and OpenPsi demands, optional CARE challenger. +3. **Commit discipline:** re-deliberate every step, Rubikon commit, Rubikon + if-then cue, revocable policy + evidence/receipt gate. Evaluate each against identical environments. +4. **Physical execution:** scalar reference, existing Quack Draft + mask-risc. SIMD vs scalar tested **only after byte/semantic parity**; no new Quack variant or parallel actor VM. + +Report **unique oracle-supported discoveries / total work**, intervention success, regret/best-so-far, incorrect commitments, false-causal rate, response to contradicted anchor, original-root inflation count (must be 0), exact candidates/budget, CPU/memory/decoded bytes/allocations, compile+validation+refusal+replay+IO cost, and per-tier timings. Keep zero-result rows. + +## 8. Minimal experiments and gates + +- **P0 static census:** source SHA of ONA, Hyperon, OpenPsi, PLN and CARE version; source license; current actual code paths for D-SAG-1, masks, hydration, root derivation, Quack one-hop, ActionDef and permit. Mark **UNVERIFIED** rather than inventing API mappings. +- **P1 scalar oracle:** fixture-based deterministic frontier + reference scheduler, no adapters or agent. Prove bitset semantics, ancestry and fixed point; use test-local maturity metadata. Include disable/red test. +- **P2 existing Quack:** map only what legally lowers. Explicitly refuse multi-hop if no legal representation. Compare scalar byte/results, NULL and bag/set. +- **P3 foreign replay:** ONA eval.py, ONA MeTTa-NARS examples, Hyperon/OpenPsi tests and PLN tests in isolated pinned environments. Normalize *observables*, not truth formulas; record non-parity. +- **P4 preference + volition:** train/calibrate EIG only on training split; apply reference-conditioned CARE gate with timestamped receipts, then optional simulated permitted action; verify revocation. +- **P5 SAG self-inspection:** propose H1 or a capability-gap investigation from #1509; compare to scalar, no automatic source mutation. Promote only under separate approval. + +### Stop / kill conditions + +Terminate or narrow scope if any test silently reinterprets production CE64 50..52, treats 59..63 as motivation, accepts a loop as independent support, allows invalid/stale proposal to commit, peeks after outcome, silently simulates multi-hop, uses different candidate sets or original roots across schedulers, or reports speedup for an unimplemented H1 terminal. + +**Decision requested from operator later, not implicit in this PR:** whether and how Maturation3 is promoted beyond test-local provenance without changing the stable byte-ISA contract; and whether population carrier for legal multi-hop already exists. Until then all projections are research overlays. + +**Status of this PR:** documentation and experiment specification only. None of P0-P5 is claimed executed merely because this file exists. From f111dcf5571b76644ce914df2ce62d48ff7bdbca Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:13:18 +0200 Subject: [PATCH 02/46] docs: specify IAM substrate over dir_sim and #1509 SAG --- .claude/plans/iam-substrate-sag-dir-sim-v1.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 .claude/plans/iam-substrate-sag-dir-sim-v1.md diff --git a/.claude/plans/iam-substrate-sag-dir-sim-v1.md b/.claude/plans/iam-substrate-sag-dir-sim-v1.md new file mode 100644 index 000000000..c269b9c53 --- /dev/null +++ b/.claude/plans/iam-substrate-sag-dir-sim-v1.md @@ -0,0 +1,170 @@ +# D-IAM-SAG-0 — IAM substrate: dir_sim × OGAR × Class/Methods × Software Awareness Graph + +> **RFC / implementation handoff, documentation only.** Based on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), merge commit `42fa2a347cda22eaaa327bba514f2029cc9daa82`. The goal is to specify executable, falsifiable IAM projections, not announce six shipped IAM products. No connector writes, security-authority migration, new opcode, second graph engine, or CE64 byte-semantic change is authorized. +> +> **Companions:** [Software Awareness Graph](software-awareness-graph-v1.md), [Class × Schema × Methods HotPlug](class-method-schema-hotplug-v1.md), [class/method falsifiers](class-method-hotplug-falsifiers-v1.md), [dir-sim persistence](dir-sim-persist-v1.md), [RBAC nested scope](../board/entries/2026-10-08-rbac-nested-scope-path.md), [research excerpts](../../.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md), [implementation prompt](../prompts/iam-substrate-after-1509.md). OGAR semantic sibling [#357](https://github.com/AdaWorldAPI/OGAR/pull/357) is an RFC, not a shipped dynamic-method link. + +## 0. Question and answer boundary + +Could the six functional domains in a typical IAM stack be *typed views* over one provenance-aware identity/entitlement substrate, using existing OGAR/dir_sim/Quack/SoftwareGraph infrastructure rather than reproducing SailPoint, CyberArk, Okta or Intune? + +**Candidate answer:** yes for read-only explanation, simulation and proposal *when the relevant graph edges and source-authority semantics are available*. No for live enforcement, SSO, session control, device management and privileged vault features without independent real provider APIs and permission gates. A syntactic class method is not an authorizing identity provider. + +Three distinct questions must survive every projection: +1. **Observed:** what did a version-pinned source actually return? Preserve source, source object identity, effective time, observation time, schema version and completeness. +2. **Inferred:** what follows from membership, role, device, resource and policy relationships? Preserve complete witness sets or explicitly label a *single* witness, assumptions, rule version and uncertainty. +3. **Authorized:** which action may a particular actor request or execute *now*, against which authority and version? Re-evaluate outside the analytical graph; mere high confidence never confers permission. + +## 1. First-hand inventory and exclusions (as of #1509) + +| Surface | Code-grounded behavior [G] | Remaining boundary [P]/[ABSENT] | +|---|---|---| +| `crates/lance-graph-dir-sim/src/lib.rs` | Separate users/groups SoA populations, GUID identities, Dn128 location, sparse membership, pure rules, validation, readonly LDAP bytes | Not an AD/Entra/PowerShell writer; no live authentication/authorization product | +| `dir-sim/src/store.rs`, `view.rs` | `VersionStore` observe/simulate/diff/plan; shared snapshot + delta-sized overlay; versioned provenance and refusal | Cross-policy/source coherent IAM snapshot and schema bridge must be designed | +| `dir-sim/src/actors.rs` | `GroupRoles::from_policy`, `role_evidence` and `RoleImpact::between`; SID/security-group paths; `Held/NotHeld/Undetermined/NotDeclared` | Role evidence is version-specific and role-scope binding is consumer-owned; don't reinterpret a distribution group as a security group | +| `dir-sim/src/log.rs`, `image.rs`, `lance-graph-dir-sim-lance` | Persist/replay ingredients with logical VersionId distinct from Lance batch versions; torn-save refusal contract | Availability in production does not imply multi-system transaction or tenant snapshot equivalence | +| `crates/lance-graph-contract/src/hotplug.rs` and `class_view.rs` | Per-plug authority activation, checked reading, ordered field basis, WideFieldMask | WideFieldMask is field selection, not row-RBAC or access verdict; slab physical reading is distinct from semantic view | +| `crates/lance-graph-glove-parity/src/awareness.rs` (#1509) | `SoftwareGraph::project` from prepared MethodTable; method/field/program/capability/refusal edges with tier and provenance; Quack Binder | In-memory one-hop projection, caller-supplied revision, limited digest; neither a directory membership store nor persistent general graph engine | +| `crates/lance-graph-quack/src/bind.rs`, `crates/lance-graph-r2il` | `Draft::bind`, Quack lowering into mask-risc; R2IL FoldDialect execution over borrowed planes | Multi-hop relation composition not automatically solved; cannot carry result masks as an undeclared population between programs | +| `crates/lance-graph-rbac`, OGAR `GroupRolePolicy` | Separate policy authority and scope/grant primitives | Not an entitlement-certification UI or PDP/PEP for arbitrary external systems | +| OGAR MethodDecl / `ogar-loco` Inventory / class-method RFC | Source method metadata and keyed body inventory exist; binding composer proposed | `MethodDecl::body_source` is not an executable method; no implicit DO capability | + +[#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509) explicitly leaves **D-SAG-1-4 multi-hop**, **D-SAG-1-6 persistence**, and method identity canonicalization open. Preserve its no-new-opcode/no-second-engine/no-applied-transformation rules. Its H1 SIMD fusion has *not* demonstrated a speedup over the scalar reference. Reuse its `Tier`, `Provenance` and compiler refusals as projected evidence, **not** as a new authority. + +## 2. Map the six IAM functions to typed projections + +| IAM function | Read-only projection / canonical question | Adapter + side-effect boundary | Honest status | +|---|---|---|---| +| IGA (SailPoint, Saviynt) | Identity lifecycle, role/entitlement history, access certification, SoD finding, `why_effective_access?` | HR and entitlement catalogs, review decisions, independent provisioning executor | Core identities/simulation exist, review workflow proposed | +| PAM (CyberArk, BeyondTrust) | `has_privileged_capability?`, `through_which_grant?`, session and approval evidence | Vault/JIT/session products retain privileged access control, recording and rotation | Projection proposed; not a PAM replacement | +| Access/SSO (Okta, Ping) | Federation principal, application assignment, role mapping, conditional access evidence | IdP does authentication, token issuance, MFA and session policy | Read graph proposed; **no SSO** implemented | +| Directory & identity (AD, Entra) | Principal, group, immutable ID, DN location, synced anchor, nested path, what-if membership | Read observations; eventual writes remain external and separately authorized | dir_sim active; cloud correlation depends on available adapter fields | +| Device/app (Intune) | Device ownership, compliant/unknown/noncompliant, app & CA dependencies | MDM supplies compliance, enrollment and enforcement | New domain schema + adapter required | +| Automation (PowerShell, APIs) | Auditable `propose/rehearse/approve/execute/verify/revert` | Capabilities checked at immutable context and just before any external write | Quack/R2IL + plans exist; guarded provider DO seam proposed | + +The marketing categories overlap; none establishes an ontology or guarantees a source can provide every required edge. + +## 3. Minimal IAM graph vocabulary, not a second graph engine + +**Node classes** (concept roles, not a mandate to mint numeric ClassIds): `Identity`, `Group`, `Role`, `Entitlement`, `Resource`, `Application`, `Device`, `Policy`, `Grant`, `Session`, `Evidence`, `Change`. Optional source-specific subtypes (human/service identity, privileged role, tenant, cloud object) are *declared schema refinements* only. + +**Edges** (direction is part of semantic contract): +- `Identity MEMBER_OF Group`, `Group MEMBER_OF Group` (source-specific group type/security semantics, nesting scope, witness); +- `Group GRANTED_ROLE Role`, `Role GRANTS Entitlement`, `Entitlement ALLOWS_ACTION Resource`; +- `Identity ASSIGNED_APP Application`, `Identity USES Device`, `Policy REQUIRES_CONDITION Device/Session`; +- `Grant AUTHORIZED_BY Evidence/Policy`, `Session EVIDENCED_BY Evidence`, `Change DERIVED_FROM Evidence`; +- `ExternalObject CORRESPONDS_TO Identity` only under a reviewed match rule and tenant/sync-anchor evidence. + +**Identity:** source AD object GUID, Entra objectId and external provider UUIDs are *source keys* with their own tenant and namespace. DN is a **mutable location** (not the primary key). UPN, mail, aliases and display names are **attributes**, never joins by default. Distinguish OGAR's canonical NodeGuid and per-view ordinals from external GUIDs; map with explicit provenance, don't cast/repack equal-sized values or silently unify tenants. `ClassId` high-u16 concept and full u32 addressed class are different views per D-CMH-0. + +**Edges are claims:** identity, source/tenant, (valid_from, valid_to), observed_at, source revision, rule revision, completeness/knownness, provenance and verification tier. `Unknown` is not `false`; `observed` is not `authorized`; a hypothetical delta is not an observation. + +**Layered canonicalization:** OGIT canonical field URI and reviewed native alias conversion -> OGAR class/reading authority -> ClassView ordered basis and WideFieldMask for field selection -> Quack numeric binding. Do not equate SAP/Odoo/AD fields by label, and don't move schema semantics into the 8-bit ALU/ISA register contract. CE64, CARE, ONA belief and epistemic tiers can remain contextual readings/evidence policies, not hard-coded identity or action bits. + +## 4. Two graphs, one substrate, no semantic conflation + +**Business/access graph:** version-pinned directory and authority relationships, entitlements, policy provenance and source observations. `dir_sim` governs directory what-if state; versioned GroupRolePolicy remains policy authority. Real IdP/PAM/MDM behavior is modeled as imported evidence, not delegated to `dir_sim`. + +**Software-awareness graph (SAG):** methods, inputs, lowering programs, compiler refusals, capability *claims* and tests from #1509. A proposed IAM `effective_access` method should have a `USES_FIELD`/program dependency projection and can report if it is compiled or refused. A SAG assertion `MayRequire` never supplies an observed entitlement. + +The bridge is a **versioned method binding/receipt**: +`(source snapshot ids, policy version, canonical schema seal, prepared method key, body/plan digest, actor/read scope) -> query result + witness + tier + refusal`. +Use the D-CMH composer, not another metadata registry. Do not mint method identity in this PR. + +**Multi-hop gate:** #1509's one-hop method queries do not implement `Identity -> Group -> Role -> Entitlement`. Compare two legal candidates in D-SAG-1-4/D-CMH-G1-4: (a) typed relation carrier connecting a population output to the next input; (b) factored `EqU32Via` read. Require compiler/Quack/mask-risc parity with a pinned slow reference on cyclic, nested, multiple-path and deleted-edge fixtures. Until one passes, use existing directory membership path logic for directory subgraph and mark broader entitlement closure as proposed. NEVER pipe an arbitrary output Mask as the next program's `LIVE` population. + +## 5. Worked scenario: Anna's accounting entitlement + +Illustrative data, never real personal data: +```text +Principal AD-guid(A), Tenant(T) --MEMBER_OF/security--> GRP_Finance +GRP_Finance --MEMBER_OF/security--> APP_ERP_Accounting +APP_ERP_Accounting --GRANTED_ROLE/policy-v7--> ERP_Write +ERP_Write --GRANTS--> Accounting_Write on ERP_Ledger +Device(D) --COMPLIANCE@mdm-v12--> Unknown +``` + +Requests: +1. `explain_access(A, ERP_Ledger, Write, as_of=V, policy=p7)`: enumerate **all** supporting paths or declare `one witness / nonexhaustive`; include policy, source and snapshot receipt. +2. `revoke_preview(A, GRP_Finance)`: `VersionStore.simulate` on base V, evaluate effective roles for both views with `RoleImpact::between`, compute target entitlement deltas; ensure another valid path preserves access. +3. `why_not_access?`: if the device/CA policy is missing, report `Undetermined/Unknown`, *not* a denial or approval. +4. `propose_action`: stage an inert change with preconditions and impact; policy authority separately gates `approve` and eventual external executor. + +Distinguish **effective graph grant**, **authentication success**, **conditional access evaluation**, and **live enforcement**. A directory membership cannot prove an IdP token was accepted. + +## 6. Method sketch (illustrative, intentionally not a Rust API claim) + +```text +class Identity { memberships, effective_access, access_history, + role_evidence, simulate_removal, reconcile } +class Entitlement { explain, principals, blast_radius, revoke_preview } +class Device { compliance, linked_identities, access_dependencies } +class Grant { policy, witnesses, effective_during } +class Change { preview, validate, approve, execute, verify, revert } +``` + +**Execution class:** `PureRead | VersionPinnedRead | Propose | ExternalMutate` is an RFC name only. `PureRead` and `Propose` use existing Quack/R2IL and dir_sim primitives. `ExternalMutate` is not a Quack opcode and must refuse unless independently authorized, with fresh source preconditions and external connector attestation. An absent field, alias, authority, schema seal, body, read scope, source version, evidence completeness or capability causes an explicit typed refusal. + +## 7. Falsifiers and acceptance matrix + +| ID | Fixture / negative test | Expected oracle | +|---|---|---| +| IAM-01 | Same UPN across tenants, renamed DN | two distinct source keys; stable GUID identity; no accidental join | +| IAM-02 | user -> security group -> nested security group -> role | same effective role and witness as dir_sim `role_evidence` | +| IAM-03 | distribution group in nested chain | no transitive security role gained | +| IAM-04 | two independent routes to the same entitlement; remove one | access remains; lost witness != lost entitlement | +| IAM-05 | unknown group policy (never observed) vs explicitly empty policy | `Undetermined` vs `NotHeld`; cannot certify absence from unknown | +| IAM-06 | stale source observation, policy revision changes mid-query | pinned result or typed `VersionMismatch`; never silently mix | +| IAM-07 | one simulated membership removal + replay | original unchanged; deterministic diff/plan; replay matches; no external IO | +| IAM-08 | revoked and newly minted grant; two time windows | access only inside authorized interval; no time-travel leakage | +| IAM-09 | schema/reading drift or missing required field/validity plane | explicit refusal; no default known/allowed | +| IAM-10 | SAG declares `MayRequire FirstOfRun` but no compiled program | hypothesized/claimed, not shipped; no fabricated authorization | +| IAM-11 | duplicate log/evidence derivations | provenance distinguishes source vs inference; no double confidence count | +| IAM-12 | actor without execute permission; forged approval or policy confidence | all external action attempts refuse, no provider writes | +| IAM-13 | unknown device compliance under conditional-access dependency | indeterminate, not permitted/denied based on guess | +| IAM-14 | cost benchmark of multi-hop vs pinned reference | correctness first, memory/latency measured by dataset and CPU tier; no claimed speedup without data | +| IAM-15 | disable key checks separately (source scope, knownness, external effect gate, witness alternatives, snapshot pinning) | each deliberate mutation makes a named test red | + +Represent each test with source data, sealed schema/policy revisions, `actual`, `expected`, refusal/witness and oracle provenance. Record disable tests rather than merely asserting the guard exists. + +**Two high-value regression models:** (a) duplicate license assignment from competing sources and (b) legitimate user losing a license during reconciliation. Define synthetic inputs and precedence rules, run proposed changes through `dir_sim`; neither incident should be claimed fixed until the relevant semantics and parity tests exist. + +## 8. Execution slices and stop signs + +- **W0 Inventory, no Rust changes:** verify #1509 source/tests, OGAR semantic ownership, dir_sim latest exact APIs, policy version model, Quack relation carrier. Label each contract `[G]`, `[P]`, `[ABSENT]`. Review whether analogous methods already exist before adding one. +- **W1 Typed read-only IAM fixture:** reuse version-pinned `VersionStore`, `GroupRolePolicy`, existing membership/role evidence. Produce explainable `Held/NotHeld/Undetermined` rows with provenance, including one-witness vs all-paths semantics. Pin IAM-01..05. +- **W2 Canonical class/method binding:** compose in existing allowed consumer layer under D-CMH-0, OGIT field identity, ClassView field basis, schema seal, per-plug authority and existing Quack Binder; project methods/actual compiler verdicts into SAG. Pin IAM-09/10 and policy-source separation. +- **W3 Multihop/read-only access impact:** select a legal relation carrier or existing `EqU32Via` plan after oracle comparison; don't introduce a traversal runtime by stealth. Implement two-version before/after and alternate-path cases, pin IAM-04/06..08/13. +- **W4 Optional ONA-style introspective proposer:** SAG can inspect `refusal -> gap -> test -> candidate`; choose what to investigate using declared budget/uncertainty but *never* let an uncertain signal mutate provider state. Keep epistemic confidence, causal hypothesis, and authority separate. Pin IAM-11/12 and ablate the prioritizer against no-observer baseline. +- **W5 Authorized execution (separate PR only):** source authority and RBAC signing, actor-bound scope, reviewed change, idempotency, check-and-set, provider-specific receipts, conflict/refusal and revert feasibility. NO execution in this RFC. + +### W4 observation/control loop (optional) + +```text +observe actual grant/policy evidence -> explain via existing graph + -> identify unverified/undetermined/violating claim (not an enforcement verdict) + -> produce candidate explanation/test/dir_sim delta + -> run read-only counterfactual and dependency ablation + -> label Verified / Refuted / Undetermined with source receipts + -> present proposal for human/provider authority, no automatic DO +``` + +Do not equate Shannon entropy with epistemic uncertainty, policy risk or access authorization; report them as distinct measures. The Rubicon/Heckhausen, ONA, Hyperon metagraph and CARE analogies are **research hypotheses** for investigation priority, not license to repurpose CE64 bits 59..63 or identify a policy action with a belief. + +## 9. Research decisions and traceability + +See [primary-source excerpts](../../.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md) for paraphrased page/section references, direct publication links, transfer limits and falsifiers. Key non-claims: + +- NIST SP 800-162 ABAC and SP 800-207 Zero Trust constrain access evaluation and enforcement; neither validates an IAM product built from a graph query. +- Why-provenance can be computationally hard for recursive queries; do not conflate *one witness* with a complete minimal explanation. +- Temporal RBAC constraints require who/what/when; an immutable snapshot alone does not define real-time authorization. +- Hyperon and NARS are architectural references for self-representation and revisable observation, not security accreditation, a replacement engine, or evidence of subjective cognition. + +## 10. Deliverables for the implementation successor PR + +- A code-grounded contract matrix and accepted naming/authority for canonical IAM concepts. +- A small sealed synthetic dataset and a strict reference evaluator for graph access/role impact. +- Read-only method projections whose compiler proofs/refusals appear in SAG, not hand-authored 'Verified' tiers. +- IAM-01..15 test matrix with disable/falsification evidence; one passing end-to-end `explain -> simulate -> re-evaluate -> propose` demo. +- Measurement table (baseline, candidate, environment, versions) before any performance claim. +- Security review showing external provider writes impossible in read-only mode; no unreviewed policy/byte-layout/ISA drift. From ae09b63177dcfd4bfc670dd472dbe88da2340c1f Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:13:19 +0200 Subject: [PATCH 03/46] docs: add sourced CARE/OpenPsi/ONA/Hyperon/entropy literature shelf and falsifiers --- ...on_care_wisdom_frontier_source_excerpts.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 .arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md diff --git a/.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md b/.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md new file mode 100644 index 000000000..a56b31135 --- /dev/null +++ b/.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md @@ -0,0 +1,152 @@ +# D-SAG-2 source excerpts: OpenPsi, Rubikon, Shannon/EIG, CARE, ONA and Hyperon + +**Date:** 2026-10-12. **Status:** ANNOTATED RESEARCH, not a replication, formal proof, or benchmark. +**Parent work:** merged [#1509 software-awareness graph](https://github.com/AdaWorldAPI/lance-graph/pull/1509); [D-SAG-2 plan](../.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md). + +**Editorial rule:** These are **short paraphrased excerpts / takeaways**, not verbatim reproductions. Every entry states (a) what is supported by its linked source, (b) the proposed transfer to lance-graph, and (c) a disconfirming experiment. This directory is a literature shelf; OpenPsi READMEs, GitHub PRs and peer-reviewed articles are **not** being misrepresented as arXiv papers. The full text of each work must be consulted before claiming algorithmic equivalence. No source is evidence that a D-SAG-2 probe has already run. + +## S01 — CARE reference-conditioned executable programs (2026) + +**Reference:** Guanyu Liu, Weiyi Kong, Chao Tang, Zeyu Wang, Boer Zhang, Baiqing Li, Peiyu Zhang, Tianyu Shi, *CARE: Context-Aware Ranking Evolution with Executable Scoring Programs for Budgeted Reaction Optimization*, [arXiv:2606.14581v5](https://arxiv.org/abs/2606.14581), revised 2026-08-31. [Local detailed annotation](2606.14581_synthesize_programs_gate_commit.md). + +**Paraphrased excerpt:** A language model synthesizes reusable candidate-scoring logic rather than selecting the next experiment directly. A non-LLM reference policy supplies a competing selection. An explicit gate validates the challenger and chooses before the experiment outcome is known; subsequent results can retain, revise or regenerate the program. Its reported empirical successes concern budgeted **reaction optimization**, not ONA, Hyperon or a general causal reasoner. + +**Transfer hypothesis:** Use a persistent, hash-identified Quack/R2IL-compatible ranking recipe to propose the next SAG introspection or frontier investigation; score **all candidates** and compare with a deterministic reference at a separate pre-outcome gate. Commit intent only after that, and authorize effects independently. + +**Disconfirming fixture:** Candidate permutation changes the selected result; challenger only scores a subset; an invalid/nonfinite challenger still wins; or the scorer reads a post-selection receipt. Each must cause refusal/reversion to reference. + +**Crucial separation:** CARE-as-*paper* is a policy-control pattern. **CARE-as-causal-testing** (anchor deletion, Pearl intervention, falsification, and Gadamer-style reinterpretation) is our independently proposed evaluation layer; do not attribute these mechanisms to the CARE experiment paper. + +## S02 — OpenCog Hyperon metagraph architecture (2023) + +**Reference:** Ben Goertzel et al., *OpenCog Hyperon: A Framework for AGI at the Human Level and Beyond*, [arXiv:2310.18318](https://arxiv.org/abs/2310.18318), 2023. [Reference interpreter](https://github.com/trueagi-io/hyperon-experimental). + +**Paraphrased excerpt:** Hyperon redesigns OpenCog around diverse interconnected representational and reasoning components, including graph-like representations, programmatic symbolic operations and aspirations toward reflective change. It is an architectural overview, **not** an experimentally established human-level AGI result. + +**Transfer hypothesis:** D-SAG-1 already projects software methods, dependencies, compiler refusals and measured costs into ordinary graph rows. Explore typed fold/rewrite parity **on that existing substrate**, without a duplicate AtomSpace, interpreter or query engine. + +**Falsifier:** Nested structural terms or variable-binding multiplicity cannot be round-tripped as ordinary rows; expose the mismatch and stop instead of claiming general MeTTa parity. Refer to [#1498](https://github.com/AdaWorldAPI/lance-graph/pull/1498). + +## S03 — Folding / unfolding typed metagraphs (2020) + +**Reference:** Ben Goertzel, *Folding and Unfolding on Metagraphs*, [arXiv:2012.01759](https://arxiv.org/abs/2012.01759), 2020. + +**Paraphrased excerpt:** Typed metagraph operations can be formulated through recursive morphisms, including catamorphisms and anamorphisms, with treatment of higher-order link targets and recursive structures. This is a mathematical proposal, not proof that mask-risc implements these morphisms. + +**Transfer hypothesis:** Compare a finite scalar fold/unfold reference with restricted ClassView/Quack projections. The fractal-like wisdom frontier is a **repeated discovery process**, not an assertion of exact metagraph morphism equivalence. + +**Falsifier:** Same sum but different nested structure, link-to-link reference or alternative bindings. Numerical equality alone is not semantic parity. + +## S04 — Shannon's uncertainty measure (1948) + +**Reference:** Claude E. Shannon, *A Mathematical Theory of Communication*, *Bell System Technical Journal* 27 (1948), pp. 379–423 and 623–656. [Part I DOI](https://doi.org/10.1002/j.1538-7305.1948.tb01338.x), [Part II DOI](https://doi.org/10.1002/j.1538-7305.1948.tb00917.x). + +**Paraphrased excerpt:** Entropy describes uncertainty for an explicitly defined source probability distribution. It does **not** define agent interest, explanatory causality or trust in an edge. + +**Transfer hypothesis:** EIG must specify the random variable Theta (rival explanations), calibrated posterior p(Theta|D), observation model and cost horizon. No automatic reinterpretation of NARS f/c, PLN strength or CE64 code as p. + +**Falsifier:** An entropy ranker is attracted indefinitely to an irreducibly noisy observation while a lower-entropy discriminating experiment is ignored. + +## S05 — Intrinsic motivation and learning progress (2007) + +**Reference:** Pierre-Yves Oudeyer and Frédéric Kaplan, *What is intrinsic motivation? A typology of computational approaches*, *Frontiers in Neurorobotics* 1 (2007). [DOI 10.3389/neuro.12.006.2007](https://doi.org/10.3389/neuro.12.006.2007). + +**Paraphrased excerpt:** Curiosity and exploration can be made computational through distinguishable intrinsic-motivation mechanisms; psychological accounts do not trivially map to one reinforcement-learning reward law. Novelty, uncertainty, surprise and progress are not interchangeable. + +**Transfer hypothesis:** Stage-7 astonishment is not itself an unlimited reward. OpenPsi-like demands should prioritize learning progress under finite budget and separate that from goal commitment. + +**Falsifier:** High surprise with no predictable learning consumes all exploration; also compare an EIG estimator against an independently defined learning-progress baseline. + +## S06 — Bayesian information-gain intervention choice (2021) + +**Reference:** Michele Zemplenyi and Jeffrey W. Miller, *Bayesian Optimal Experimental Design for Inferring Causal Structure*, [arXiv:2103.15229](https://arxiv.org/abs/2103.15229), 2021. + +**Paraphrased excerpt:** Interventions can be selected to rapidly reduce expected posterior uncertainty about causal structures; the paper proposes tractable summaries rather than repeated full hypothetical posterior fitting. Its evaluations include simulated and protein-signaling networks. + +**Transfer hypothesis:** Use an action/observation model for rival SAG or IAM causal explanations and compare expected posterior entropy before acting. The result is a proposed **investigation**, not a permit to change state. + +**Falsifier:** Estimated EIG derived from future outcomes; uncertainty reduction with no accurate causal identification; or gains disappear on held-out interventions. + +## S07 — Interventions with target and value selection (2022) + +**Reference:** Panagiotis Tigas et al., *Interventions, Where and How? Experimental Design for Causal Models at Scale*, [arXiv:2203.02016](https://arxiv.org/abs/2203.02016), 2022. + +**Paraphrased excerpt:** Bayesian experimental design for causal structure may need to choose both *which variable* and *what intervention value* under nonlinear models, not merely select a high-entropy observable. Results are reported on synthetic and in-silico networks. + +**Transfer hypothesis:** A frontier question must distinguish observational lookup from intervention, include target/value and expected cost, and pass an independent permission gate if the intervention changes the world. + +**Falsifier:** A policy maximizing observational surprises chooses a confounded edge that cannot distinguish rival causal mechanisms. + +## S08 — NARS self and internal operations (2018) + +**Reference:** Pei Wang et al., *Self in NARS, an AGI System*, *Frontiers in Robotics and AI* (2018). [DOI 10.3389/frobt.2018.00020](https://doi.org/10.3389/frobt.2018.00020/full). + +**Paraphrased excerpt:** Self-related information and internal operations have an explicit place in a non-axiomatic reasoner under insufficient knowledge and resources. A proposal to represent software self-knowledge as edges is compatible as a *research analogy*, not automatically the NARS theory's identical mechanism. + +**Transfer hypothesis:** D-SAG-1's compiler evidence can be queried as data, while executing a resulting proposal still needs verified methods and a distinct authority path. + +**Falsifier:** Internal derived facts are recycled as independent evidence or a claim about a method is treated as proof that it ran. + +## S09 — ONA reference evaluation and bridge (implementation source) + +**References:** [OpenNARS-for-Applications](https://github.com/opennars/OpenNARS-for-Applications), [evaluation.py](https://github.com/opennars/OpenNARS-for-Applications/blob/master/evaluation.py), [ONA v0.9.3 release](https://github.com/opennars/OpenNARS-for-Applications/releases/tag/v0.9.3) (2025-04-22), and its [MeTTa-NARS declarative example](https://github.com/patham9/nartech_ros/blob/master/plugins/narsplugintests/declarative.metta), [procedural example](https://github.com/patham9/nartech_ros/blob/master/plugins/narsplugintests/procedural.metta). + +**Observed from upstream descriptions:** ONA's evaluation.py runs C tests and Narsese/English integration examples. The maintainer documents a MeTTa interface using commands AddBeliefEvent, AddBeliefEternal and AddGoalEvent with a frequency/confidence pair; ONA, bridge and native MeTTa are not thereby shown to implement the same evidence algebra. **No official CARE evaluation suite has been identified in the cited material.** + +**Transfer hypothesis:** First capture native ONA and bridge observable traces, then normalize identity, source roots, operation, time, output alternatives and costs. Compare *observable cases* before attempting a cross-engine improvement claim. + +**Falsifier:** Lost event time, modified NARS truth values, missing alternative bindings, silent duplicate evidence, or differing input budget. + +## S10 — Hyperon OpenPsi (implementation source) + +**Reference:** [iCog-Labs-Dev/hyperon-openpsi](https://github.com/iCog-Labs-Dev/hyperon-openpsi), [test suite](https://github.com/iCog-Labs-Dev/hyperon-openpsi/tree/main/test), [curious-agent use case](https://github.com/iCog-Labs-Dev/hyperon-openpsi/tree/main/use-cases/curious-agent). + +**Observed from upstream README:** Experimental MeTTa modules include demand updater, feeling updater, modulator updater, perception monitor and hill-climbing action planner. It is an experiment, not proof of a final general motivation theory. + +**Transfer hypothesis:** Run demand arbitration externally as a typed input to a pure candidate ranking policy. Do not put motivations into evidence or imply action permits. + +**Falsifier:** Same ranked demand maps to an unrelated goal, iteration-order tie changes the outcome, or the chosen goal never affects real action-selection traces. + +## S11 — OpenPsi demand arbitration regression (2026 upstream PR, not merged evidence) + +**Reference:** [hyperon-openpsi PR #117](https://github.com/iCog-Labs-Dev/hyperon-openpsi/pull/117), opened 2026-09-04, **OPEN when checked 2026-10-12**. + +**Paraphrased excerpt from PR description, not established merge:** Multiple demands in the normal interval share satisfaction score 0.84, making implicit tie decisions order-sensitive. The current selector previously mapped affiliation, competence and energy to the same mission goal. The PR proposes explicit deterministic demand order and separate goal destinations. + +**Transfer hypothesis:** Include ties, reversed row order and meaningful goal-to-action mapping in the D-SAG-2 evaluation even if the upstream fix remains unmerged. + +**Falsifier:** Same semantics, different iteration order produces a different winner; or changing dominant demand leaves goal/action unchanged. + +## S12 — Rubikon and implementation intentions (psychology, not an engine) + +**References:** [Prior literature review](2026-10_rubicon_gollwitzer_volition_source_excerpts.md), [D-RV mapping](../.claude/plans/rubicon-volition-v1.md). Consult the original Heckhausen/Gollwitzer works linked there before attributing quantitative results. + +**Paraphrased excerpt:** Goal desirability and feasibility evaluation precede goal commitment; later planning can specify cue-triggered behavior, while evidence of impossibility can justify reconsideration or disengagement. These are psychological constructs, not bits in a NARS belief state. + +**Transfer hypothesis:** Distinguish predecisional investigation, revocable goal commitment, plan-ready cue matching, and a second *execution authorization* gate. Kanban records the lifecycle rather than replacing those distinctions. + +**Falsifier:** A committed-but-unauthorized goal executes; a revoked cue fires; genuine impossibility never triggers disengagement; harmless contradictory evidence destroys every commitment. + +## S13 — Modern PLN vs ONA (separate oracles) + +**References:** [trueagi-io/PLN](https://github.com/trueagi-io/PLN), [executable library](https://github.com/trueagi-io/PLN/blob/main/lib_pln.metta), [test harness](https://github.com/trueagi-io/PLN/blob/main/test.sh), [PeTTa](https://github.com/trueagi-io/PeTTa), [#1497 source map](2026-10_opencog_pln_shannon_attention_research_map.md). + +**Observed:** Modern PLN ships MeTTa truth-rule and test surfaces; ONA is an independently designed C NARS implementation. Neither one's results are a substitute for the other one's inference semantics. + +**Transfer hypothesis:** First vary scheduler with **one fixed inference engine**, then freeze scheduler and vary engines. If a rule is inequivalent, record a mismatch instead of silently coercing it. + +**Falsifier:** Scores change because inference rules or candidate population changed rather than attention policy. + +## Source-to-experiment crosswalk + +| Evidence class | How to use it | How *not* to use it | +| --- | --- | --- | +| arXiv/publisher paper | Formulate conjecture, baseline and explicit limitations | Claim implemented/hot-path parity or arbitrary speedups | +| GitHub README/release | Select actual oracle and CLI/test entrypoints | Claim two runtimes share truth laws | +| GitHub open PR | Construct an adversarial fixture | Treat unmerged fixes as shipped | +| Our merged #1494/#1509 | Ground existing test-local mechanisms and one-hop SAG | Assume a mature production motivational engine exists | +| Our proposed D-SAG-2 | Run pre-registered falsifiers | Claim discoveries merely because graph patterns are visually fractal | + +### Citation/replication rules + +Capture exact commit SHAs for each external runtime and interpreter/submodule; install only after license/compatibility review. Verify tests on pinned snapshots with stdout/exit code and provenance before any publication-quality comparison. Follow source-specific licenses and quote limits. Preserve contradictory results. Every measurement must identify an input fixture, version, budget and independent oracle. From 671fe1c97a24522328f853012aa4053e1022c012 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:13:48 +0200 Subject: [PATCH 04/46] docs(sag): plan D-SAG-2 Ruff oracle and ONA feedback falsifiers --- ...re_awareness_ona_ruff_research_excerpts.md | 101 +++++++++ .../software-awareness-provenance-parity.md | 83 ++++++++ ...awareness-graph-v2-ruff-ona-closed-loop.md | 191 ++++++++++++++++++ ...software-awareness-graph-v2-claude-code.md | 58 ++++++ 4 files changed, 433 insertions(+) create mode 100644 .arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md create mode 100644 .claude/knowledge/software-awareness-provenance-parity.md create mode 100644 .claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md create mode 100644 .claude/prompts/software-awareness-graph-v2-claude-code.md diff --git a/.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md b/.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md new file mode 100644 index 000000000..420c5575a --- /dev/null +++ b/.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md @@ -0,0 +1,101 @@ +# Research excerpts: software awareness, ONA, evidence revision, attention, metagraph folds and Rubicon + +**2026-10-12. Status: annotated primary-source excerpts and engineering transfer, not a proof of self-awareness.** +The repository's .arxiv directory is a literature shelf: some referenced papers are journal articles, not arXiv submissions. "Excerpt" here is a section-faithful concise **paraphrase**, not a reproduced text passage. Where chapter/section or abstract is named, verify against the linked edition before treating it as a mathematical implementation contract. This file does not authorize any CE64, NARS, ISA, OGAR, or runtime change. + +## 1. Wang, Li & Hammer (2018): *Self in NARS, an AGI System* + +Source: https://doi.org/10.3389/frobt.2018.00020 (open-access full text: https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2018.00020/full). +**Read:** §§2.1, 3.1–3.4, 4.2, 5. + +**Source-faithful extract:** The system reasons under insufficient knowledge and resources. Built-in operations anchor the notion of SELF; internal experience is treated as sensory input with a different origin. Deliberate *mental operations* supplement the fixed automatic inference/attention routines without freely rewriting them. The authors describe this as a preliminary implementation whose self-knowledge is incomplete and fallible. + +**Engineering transfer (hypothesis):** Treat compiler judgments, code harvest, execution traces, budget appraisals and independent test receipts as separate internal observations over existing graph data. Model executable capabilities as methods and evidence of preconditions/outcomes. Preserve the automatic executor and OGAR action authority rather than allowing introspection to modify either. + +**Falsifier:** With the same source and outcomes, does removal of observation-to-revision cause a different or worse subsequent decision? An instrumented graph with no causal feedback fails the stronger adaptation claim. + +**Do not claim:** the article proves machine consciousness, ONA's implementation has complete NAL-9 introspection, or a graph of code alone constitutes subjective awareness. + +## 2. ONA: OpenNARS for Applications (software reference, not a paper) + +Sources: https://github.com/opennars/OpenNARS-for-Applications and https://github.com/opennars/OpenNARS-for-Applications/wiki ; contrast https://github.com/opennars/opennars. + +**Engineering extract:** ONA is a compact NARS implementation focusing on application reasoning, temporal implications, anticipation, operations and feedback. Its implementation may differ materially from the older Java/OpenNARS research code and the paper's introspective mental operations. + +**Probe, not assumed fact:** Pin a concrete ONA commit. Locate source and tests for operation registration, anticipation, success/failure feedback, decision priorities and any internal observation hooks. Produce a table: "exists in ONA", "exists in research OpenNARS", "paper-only", "unverified". Run an executable fixture against pinned ONA before mapping any operator. + +**Falsifier:** A proposed ONA feature with no source entry point is excluded from the implementation mapping. External operation feedback is not automatically internal introspection. + +## 3. Jøsang (2007): *Cumulative and Averaging Fission of Beliefs* + +Source: https://arxiv.org/abs/0712.1182 (Audun Jøsang, 2007, abstract and operator definitions). + +**Source-faithful extract:** Cumulative and averaging belief fusion model different evidence assumptions. Fission attempts to recover the residual opinion after removing one contributor from a fused result. This provides a separate mathematical control for provenance-aware ablation. + +**Engineering transfer:** Use explicit evidence-contributor keys. Compute cumulative versus averaging controls only under their own assumptions; use an independent source witness when removing a contribution. Compare removal with rerunning only the remaining observations. + +**Falsifier:** If a specific contributor's identity is lost, exact inverse fission must return insufficiency rather than a fabricated truth value. Never substitute subjective-logic fission for NARS revision silently. + +## 4. Gollwitzer (1999): *Implementation Intentions: Strong Effects of Simple Plans* + +Source: https://doi.org/10.1037/0003-066X.54.7.493 ; author/publication page: https://www.socmot.uni-konstanz.de/publications/implementation-intentions-strong-effects-simple-plans (American Psychologist 54, 493–503). + +**Source-faithful extract:** Implementation intentions link a specific anticipated situational cue to a goal-directed response. Their empirical subject is human goal execution, not a software permission model. + +**Engineering transfer:** A Rubicon commitment can be represented as a versioned, revocable if-cue-then-propose policy. Deliberation and action selection remain distinct, and an action cannot skip the independent OGAR permission check. + +**Falsifier:** Present a near-miss cue, expired/revoked intent, stale source revision, and Undetermined role. A commitment that executes anyway violates the software contract. + +## 5. Goertzel (2020): *Folding and Unfolding on Metagraphs* + +Source: https://arxiv.org/abs/2012.01759 (abstract; full mathematical definitions require checking PDF/text). + +**Source-faithful extract:** Directed typed metagraphs admit multiple recursion/fold/unfold formulations, including catamorphisms, anamorphisms, histomorphisms and chronomorphisms. A metagraph edge may point to another edge and carry ordered typed ports; not every row-set reduction preserves these structures. + +**Engineering transfer:** Compare finite typed metagraph fixtures against independent scalar reference, preserving edge-to-edge references, binding multiplicity, nested results and a pinned read snapshot. Quack SUM equivalence is not evidence for general categorical fold equivalence. + +**Falsifier:** A hyperedge or nondeterministic rewrite whose multiplicity or nested order is lost must be marked unsupported, not called translated. + +## 6. Goertzel et al. (2023): *OpenCog Hyperon: A Framework for AGI at the Human Level and Beyond* + +Source: https://arxiv.org/abs/2310.18318 (architectural overview; not a benchmark of AGI). + +**Source-faithful extract:** Hyperon redesigns prior OpenCog ideas around metagraph representation, type systems, patterns and reflective future aspirations. The text discusses possibilities for reflective self-modification and improvement, not a validated production equivalent of our execution substrate. + +**Engineering transfer:** Separate structural fold/unfold semantics from runnable MeTTa pattern matching, atom binding/rewrite, side effects, and probabilistic reasoning. #1498's explicit four-result nondeterminism fixture is a cardinality gate, not an optional nuance. + +**Falsifier:** Run a pinned Hyperon nondeterministic fixture; if four possibilities collapse to two row-mask matches, fail parity and record the missing operation. + +## 7. Shannon/EIG and Bayesian control: a measurement discipline + +Sources: Kullback & Leibler (1951), *On Information and Sufficiency*, https://doi.org/10.1214/aoms/1177729694 ; companion internal study [#1497 attention research](https://github.com/AdaWorldAPI/lance-graph/pull/1497). + +**Source-faithful extract:** KL divergence compares explicitly defined probability distributions. Shannon entropy and expected information gain require a named random variable, posterior/likelihood model and target outcomes. NARS frequency/confidence, PLN strength and software code frequency are not automatically calibrated probabilities. + +**Engineering transfer:** Specify the target distribution before computing entropy. Compare FIFO, confidence priority, high entropy, EIG and Moore/Staunen at equal rule/candidate budgets with correlated evidence and irrelevant high-entropy distractors. + +**Falsifier:** A scheduler that spends more work on irrelevant entropy but yields fewer independent oracle-supported discoveries loses, even if its raw entropy score is higher. + +## 8. Ruff as an independent *software observation* source + +Primary implementation references (source of current code behavior, not peer-reviewed research): +- https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/ir.rs — ModelGraph, common per-language IR. +- https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/reassemble.rs — explicitly restricted to C++ machine-plane projected form. +- https://github.com/AdaWorldAPI/ruff/pull/117 — ordered Ruby MethodOre; reported 4,459 events vs 850 set entries in tested OpenProject corpus, not an independent rerun in this study. +- https://github.com/AdaWorldAPI/ruff/pull/118 — free-function signatures; C linkage stays frontend-local; free function dispatch not yet projected. +- https://github.com/AdaWorldAPI/ruff/pull/120 — Odoo parent/extension inherit_id resolution; unresolved XPath remains unresolved. +- https://github.com/AdaWorldAPI/ruff/blob/main/.claude/OGAR-POLYGLOT-AST-INTEGRATION.md — design RFC, not proof of complete bidirectional AST translation. + +**Transfer:** Ruff is an independent static observation oracle for supported constructs; runtime tests remain a separate behavioral oracle. Use exactly matching source revisions, trace missing facts as residuals and record partial extraction as unknown. + +**Falsifier:** If identical unordered reads/writes/calls mask different order-dependent outcomes, static equivalence fails. If a source call graph predicate was never emitted, SAG cannot use its absence as proof there are no calls. + +## 9. Experimental synthesis and non-claims + +Proposed experiment: harvest software revision A with Ruff; issue SAG forecast about a controlled revision B; commit forecast and its evidence; change source; blind reharvest; score agreement; update evidence-based priority; run an identical no-feedback twin. Distinguish **instrumentation**, **operational introspection**, **anticipation**, **control**, and **validated adaptive improvement**. These are proposed engineering test tiers, not official ONA awareness levels or evidence of phenomenal experience. + +Related merged sources: [#1496 CE64/NAL](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497 PLN/Shannon](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498 Hyperon](https://github.com/AdaWorldAPI/lance-graph/pull/1498), [#1499 NARS self](https://github.com/AdaWorldAPI/lance-graph/pull/1499), [#1500 Rubicon](https://github.com/AdaWorldAPI/lance-graph/pull/1500), and [#1509 SAG](https://github.com/AdaWorldAPI/lance-graph/pull/1509). + +## 10. Reproduction and source restrictions + +Pin runtime commits and package/tool versions before claiming parity. Cite a versioned test artifact, fixture, input/output and exact operator mapping. Treat peer-reviewed empirical effects, mathematical proofs, and project-specific engineering hypotheses as **different epistemic tiers**. No paper here licenses adding a new byte interpretation, operator, or action privilege without an independently verified insufficiency and explicit owner decision. diff --git a/.claude/knowledge/software-awareness-provenance-parity.md b/.claude/knowledge/software-awareness-provenance-parity.md new file mode 100644 index 000000000..d852e6109 --- /dev/null +++ b/.claude/knowledge/software-awareness-provenance-parity.md @@ -0,0 +1,83 @@ +# D-SAG-2 evidence / parity contract: the observations are not the authority + +**Type:** cross-repo method and validation checklist. **READ BY:** anyone changing SoftwareGraph/MethodTable, Ruff SPO/AST frontends, SAG prediction loops, OGAR ActionDef, Quack/R2IL or NARS evidence. +**Status:** proposed guardrail, with source-grounded possible defects to *test*, not confirmed bugs. + +## Separation of concerns + +| Question | Evidence source | Permitted conclusion | +|---|---|---| +| What did the author declare? | MethodSpec, Ruff AST, source digest | Declared syntax with span and revision | +| What did the compiler accept? | MethodTable::prepare, Program, refusal | Compiled or typed refusal, not runtime proof | +| What actually ran? | independently executed oracle / instrumentation | Observed result under bound environment | +| Was it independently confirmed? | signed/registered or replayable oracle receipt | Verified only when oracle identity and output validated | +| Which hypothesis deserves testing? | observations + revision policy | Hypothesis; no method authority | +| May an external effect occur? | OGAR action capability + current policy/roles | Authorization decision only at execution/commit | + +**"Unknown" is not "NotHeld" and "not emitted" is not "false."** Dir-sim #1503 explicitly distinguishes Held, NotHeld, Undetermined and NotDeclared. Ruff may omit a triple for unsupported semantic reasons. Never infer a negative fact from absent output without known complete extraction. + +**No self-certifying loop:** a SoftwareGraph claim() or a user-supplied string never produces Verified. Compiler-produced edges are not sufficient to prove behavior; tests are not a valid oracle unless actually run. A test identifier and matching body digest prove only identity compatibility, not that execution occurred. + +## Minimal source→graph crosswalk + +Require: +- repository identity and commit SHA; +- language and compiler/harvester version; +- source span and symbol qualified name where available; +- stable concept identity, schema seal and reading; +- method key with explicit mapping provenance, never derived from display label alone; +- edge predicate with source declaration, derived inference, or unavailable-status; +- extraction closure/completeness per predicate on the specific source domain. + +Do not promise that all Ruff languages lower directly to one lossless ModelGraph round-trip. As of the verified 2026-10-12 Ruff source, reassemble() reverses C++ machine-plane projected form only; core-7 and OpenProject IR content are not reconstructed. The Ruff RFC is a desired destination, not proof of full coverage. + +Ruff #117 preserved ordered Ruby MethodOre (set reductions are lossy). Ruff #118 deliberately did not overload C++ IsStatic to represent C file-scope linkage and did not emit a free-function call graph into triples. Ruff #120 resolves a subset of Odoo extension-view locators; unsupported XPath remains unresolved, not guessed. + +Therefore distinguish: +- *source structure parity* (supported SPOs, anchors, signatures); +- *behavioral equivalence* (tests/runtime oracle); +- *temporal counterfactual prediction* (precommitted A→B with blind independent observation); +- *optimization* (semantic parity + measured cost); +- *authority* (action gate plus current permission witness). + +## Provenance and snapshots + +A logical fact and its evidence witnesses need separate identities. If (src,rel,dst,tier) is logically deduplicated, multiple ctx/prov owners still need independently removable ownership. Test current awareness.rs link() and project() behavior, including classes and shared fields. When a source disappears in B, remove current witness without erasing the other source or rewriting the archived A receipt. + +A compiler's current refusal can change at revision B; no old ComputeCycle remains active merely because its node exists in the interning table. For source/version-sensitive hypothesis revision, replay a pinned read at k during writes to k+1. Immutable method/node identity is not equivalent to immutable snapshot semantics. + +Evidence stamps represent *originating observations*, not each derivative inference or each layer containing the same observation. Retraction needs explicit original contributor; where provenance is insufficient, return typed insufficiency. Keep Jøsang belief fission distinct from NARS evidence revision. + +## Controlled attention and intervention + +Run five attention policies under fixed candidate pool, oracle, inference rules, source revision, seed and total work budget: +1. FIFO; +2. priority by declared confidence; +3. naive high Shannon entropy; +4. expected information gain, only after a normalized and calibrated predictive distribution is defined; +5. Moore/Staunen policy. + +Include irrelevant high-entropy distractors, correlated evidence, a delayed useful discovery, negative tests and bad predictions. Report oracle-supported findings / total work, decoded bytes, allocations, and time. Do not treat NARS f/c or PLN strength as a probability distribution without calibration. + +For Rubicon-style agent control, distinguish: predecisional evidence deliberation → revocable implementation intention → action *proposal* → OGAR commit gate → witnessed outcome → adaptation/disengagement. A predicted benefit never grants action capability. A committed intent must re-check policy and role evidence at commit and cannot override Unread/Undetermined. + +## Measurement and failure semantics + +Hard gates: correctness, independent provenance, schema/reading version, graph/row population, evidence overlap, permission, and replay. Soft measurements: discovery quality, hypothesis coverage, entropy reduction, MDL, latency, allocations, decoded bytes and energy if available. + +H1 reported a gap (current Quack masked sum slower than a fused scalar reference) and an absent fused terminal; it did not report a speedup. Don't put that gap into a success numerator. Use native and x86-64-v3 controls from #1505. + +If a new result cannot be expressed through existing Quack/OGAR/R2IL, return an explicit typed refusal and file the exact minimal insufficiency. Do not work around it by injecting a graph evaluator. + +## Source map + +- [lance-graph #1503 role evidence](https://github.com/AdaWorldAPI/lance-graph/pull/1503) +- [#1504 method parity](https://github.com/AdaWorldAPI/lance-graph/pull/1504) +- [#1506 DAG range](https://github.com/AdaWorldAPI/lance-graph/pull/1506) +- [#1508 predicate reuse](https://github.com/AdaWorldAPI/lance-graph/pull/1508) +- [#1509 SoftwareGraph](https://github.com/AdaWorldAPI/lance-graph/pull/1509) +- [Ruff #117 ordered behavioral ore](https://github.com/AdaWorldAPI/ruff/pull/117) +- [Ruff #118 C linkage semantics](https://github.com/AdaWorldAPI/ruff/pull/118) +- [Ruff #120 Odoo inherit_id](https://github.com/AdaWorldAPI/ruff/pull/120) +- [Ruff ModelGraph](https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/ir.rs) +- [Ruff reassemble](https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/reassemble.rs) diff --git a/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md b/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md new file mode 100644 index 000000000..d06a50823 --- /dev/null +++ b/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md @@ -0,0 +1,191 @@ +# D-SAG-2 — Ruff × ONA software-awareness closed-loop validation + +**Status:** RESEARCH / IMPLEMENTATION PLAN, not an implementation. **Base:** merged lance-graph #1509, main merge 42fa2a347cda22eaaa327bba514f2029cc9daa82 (2026-10-12). +**Owner of authority:** existing OGAR action gate. **First executor:** existing Quack → mask-risc; R2IL FoldDialect is the alternate frontend. **Independent source oracle:** AdaWorldAPI/ruff. +**Prompt:** [software-awareness-graph-v2-claude-code.md](../prompts/software-awareness-graph-v2-claude-code.md). +**Research shelf:** [2026-10_software_awareness_ona_ruff_research_excerpts.md](../../.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md). +**Evidence contract:** [software-awareness-provenance-parity.md](../knowledge/software-awareness-provenance-parity.md). + +## 0. Research question, answer threshold, and limits + +Can a software graph that already queries its own compiled methods: (1) preserve independent, versioned observations; (2) make a **registered prediction before a code change**; (3) compare that prediction with an independent Ruff harvest or runtime oracle; and (4) change a subsequent prediction or experiment selection **because of** the observed mismatch? + +**Success is a measured closed loop, not self-awareness as consciousness:** a prediction is committed before the intervention; blind reharvest supplies observations; a controlled update affects the next decision, with an ablated no-feedback twin as the causal control. If recording an event does not alter any subsequent choice, it is instrumentation only. + +**Non-goals:** no new graph engine, second method registry, automatic self-rewriting, new NARS semantics or CE64 bit allocation, inferred permission grants, unpinned external runtimes, or performance claims from theoretical equivalence. + +## 1. Ground truth: #1496–#1509 in dependency order + +| PR | Actual shipped state | Role for D-SAG-2 | +|---|---|---| +| #1496 | docs: CE64 hypothesis layers/NAL polyfill; unresolved physical-vs-semantic reading conflicts | keep byte-level ISA immutable; readings versioned | +| #1497 | docs: PLN/Shannon/EIG and attention falsifiers | candidate schedulers; **not** truth laws | +| #1498 | docs: Hyperon/MeTTa fold parity | preserve multiplicity, binding, nested values and snapshot semantics | +| #1499 | docs: NARS self, evidence provenance/fission and snapshot | independent contributors, revision/ablation semantics | +| #1500 | docs: Heckhausen/Gollwitzer Rubicon | revocable commitment distinct from hypothesis | +| #1501 | docs: Class × Schema × Methods HotPlug | existing inventory/binding seam; no second registry | +| #1502 | docs: GPO/Intune/Linux policy baseline; no policy reader implemented | configured ≠ assigned ≠ observed | +| #1503 | code: dir-sim membership-path witnesses; Held/NotHeld/Undetermined/NotDeclared roles | missing evidence must not become negative authorization | +| #1504 | code: class-qualified MethodTable → Quack/R2IL; NarsRevision law | execution contract and independent row oracle | +| #1505 | code: native CPU default and portable v3 config | pinned build tier/performance fairness | +| #1506 | code: compute DAG Kahn over all 256 field positions | dependency cycles and wide-field gate | +| #1507 | code: runtime text declarations → same MethodTable prepare path | source change without recompiling executor | +| #1508 | code: Gremlin V/has/where/values/dedup/count/sum; predicates inlined at prepare | caller/callee relationships; relation hops refused | +| #1509 | code: SoftwareGraph, typed tiers, compiled programs, Quack one-hop queries, H1 candidate | direct base, **not** a general introspective reasoner | + +Confirmed seams: +- glove-parity/src/method.rs: MethodKey is caller-issued; schema seal is local FNV over ordered basis; ReadingId and Universe gate calls; Action is named but pure dispatch refuses it. +- glove-parity/src/gremlin.rs: NoRelationCarrier for in/out/both; effects have no executable Gremlin steps. +- glove-parity/src/awareness.rs: SoftwareGraph projects MethodTable; edge table Binder → Draft → ScatterOrU32; provenance tiers Declared/Derived/Compiled/Verified/Hypothesis. +- glove-parity/examples/awareness_loop.rs: H1 is a **candidate**. Existing tiled masked sum was reported ~1.59–1.78× scalar reference; fused SIMD terminal and post-fusion improvement are NOT measured. +- #1509 plan acknowledges generic multi-hop, canonical cross-build digest, and durable source revisions as unfinished. + +## 2. Proposed contract: typed observations without competing authority + +Conceptual records only, **not** an ABI or new CE64 reading: + +~~~text +ObservationReceipt { + id, source_kind: RuffHarvest | Compiler | RuntimeOracle | Benchmark | Policy, + source_revision, snapshot_revision, operation_or_method_key, + schema_seal, reading_id, universe, evidence_source_id, derivation_id, + observed_relation_or_outcome, observation_grade, + evidence_independence_key, collector_version, environment_fingerprint +} +PredictionReceipt { + id, preregistered_at_revision, frozen_input_snapshot, claim, + expected_delta_or_result, eligible_candidate_set, method_and_rule_version, + independent_oracle, abstention_policy, budget, decision_log +} +ResultReceipt { + prediction_id, oracle_revision, matched, unexpected, missing, unknown, + truth_or_semantic_parity, costs, control_arm, observed_counterexamples +} +~~~ + +Do NOT map collector verdict directly to compile-tier or verified-tier. Existing source proof and independent oracle evidence are different authorities. Keep "source declared", "derived from AST", "compiled", "oracle verified" and "hypothesis" separately. An external Ruff extraction cannot certify a runtime behavior without the independent runtime test. + +Identity must be scoped: (repository, revision, language, source-span-or-symbol, concept, seal, reading) → stable correspondence to method/class identity; **do not infer MethodKey from method label**. Preserve overload signatures, C linkage, Odoo qualified identities, and Ruby event order as appropriate. Introduce a mapping **adapter** only after proving exactness of all supported predicates and an explicit residual category for unsupported facts. + +Avoid version-blind provenance merges. Full graph snapshot and delta semantics should be decided by a falsifier before changing storage. When using hypothesis overlays, identical evidence seen in multiple layers must not add independent confidence. + +## 3. Audit first: three probable failure modes, all UNVERIFIED + +**A. Shared-edge provenance.** In awareness.rs, link() deduplicates on (src,rel,dst,tier), excluding ctx/prov. If two method contexts share a field→claim edge, reprojecting one method can remove a witness or leave ownership missing. Reproduce with two contexts, two revisions, one shared edge. Prove the precise invariant; **do not fix preemptively**. + +**B. Compute DAG invalidation.** project_compute() appends ComputesFrom and ComputeCycle verdict edges but does not mirror project()'s per-method cleanup. Reproject cyclic→acyclic and dependency A→B to A→C under the same class. Inspect stale edges and refuse the wrong version. Distinguish historical evidence from current projection. + +**C. Oracle trust/certificates.** certify() checks method digest/seal, while caller supplies the test identifier and proof. It does not authenticate the execution receipt. An untrusted caller could submit a certificate with current digest. Mark accepted metadata versus independently verified test execution; require a registered oracle runner to upgrade to Verified. Avoid changing existing API until compatibility tested. + +Additional audits: caller-issued MethodKey; FNV(Debug(MethodSpec)) cross-build stability; caller-supplied SAG_REV; temporal snapshot consistency; edge source ownership; duplicate evidence; memory-only graph; execution and graph projection cost (avoid hot-path instrumentation). + +## 4. Implementation waves, authorization, and deliverables + +### D-SAG-2-0: frozen oracle inventory (no code) + +- Pin baseline #1509 merge SHA and Ruff revision, relevant ONA/OpenNARS/Hyperon reference commits before execution. +- Record supported Ruff IR predicates versus residuals by language, with explicit Odoo/Rails/C++/C# limitations. +- Establish independent scalar/original runtime oracles. Record adversarial fixtures before designing answers. +- Run unchanged #1509 tests and benchmarks only in the actual toolchain; do not claim CI from documentation. + +Gate: reproducible source ledger and no ungrounded "supported" predicates. + +### D-SAG-2-1: provenance and revocation hardening (tests first) + +- Falsify or clear issues A–C, including identical shared relations with separate contexts. +- Define authoritative evidence source, derivation, observation, revision, schema/reading and test certificate roles, with no evidence duplication. +- Check snapshot pinning (version k replay remains identical while k+1 appends). Separate historical receipt preservation from current projection deletion. +- Write a negative control: forged Verified, stale seal/body, reinterpreted reading and wrong CPU tier must not be current proof. + +Gate: every mutation triggers a red test before a minimal fix; no new engine or broad schema redesign. + +### D-SAG-2-2: Ruff → SAG independent read-only observation + +- Compare Ruff ModelGraph and emitted Triples for **supported projection only** against SAG mapping; align identity with explicit correspondence map. +- Python/Odoo: inheritance, compute dependencies and view inherit_id/anchors; Ruby/Rails: ordered MethodOre, private helpers, guard/order; C++: overloads, signatures, no overloaded C file-scope static semantics; C#: preserve out-of-proc Roslyn provenance. +- Keep Ruff's reassemble() restriction visible: currently inverse only for the C++ machine-plane **projected form**, not core-7 and OpenProject. +- Never fabricate free-function dispatches_to: Ruff #118 explicitly keeps C free-function calls frontend-local. +- Collect accepted/rejected/residual facts, missing edges, extra edges, identity collision counts, and time/memory cost. + +Gate: structural parity only within declared supported subset; unsupported remains Unknown, not False. + +### D-SAG-2-3: prediction → independent intervention → revision (the main proof) + +- Snapshot revision A. Before a change, emit PredictionReceipt for impact on affected methods, classes, edges or authorization. +- Apply controlled edit in a fixture branch, separately reharvest revision B with Ruff; independently run semantic oracle where needed. +- Compare delta with the prediction; stratify matched/missing/extra/unknown and evidence class; count precision/recall only on complete labeled universe. +- Update a *contextual hypothesis* or experiment priority from the negative/positive receipts, never rewrite compiler- or source-authoritative truth. +- Repeat on a new seed with **identical model, budget, candidate order and fixtures** except feedback enabled versus disabled. + +Gate: preregistered prediction changed by evidence; a paired ablation demonstrates an effect on subsequent decision and reports failures/no-effect without inventing improvement. + +### D-SAG-2-4: ONA, NARS, PLN, EIG and Rubicon controls + +- ONA-inspired operation cycle = context → precondition → expected event → operation proposal → observed event → revision. Trace it with receipts, not consciousness claims. NAL-9 introspective research is not proof ONA implements it completely. +- Preserve NARS evidence independence, with explicit repeated-source/independent-source controls. Jøsang fission is a *separate control law*, never a drop-in NARS replacement. +- Scheduler-only comparison: FIFO, confidence priority, naive Shannon entropy, calibrated EIG and Staunen/Moore. Freeze candidate pool, inference rules, oracle and resource budget. Then freeze scheduler and compare reasoning laws. High-entropy irrelevant distractors must not win by default. +- Rubicon phases: deliberate → commit revocable if-then plan → check authority **at execution** → observe outcome → revise/disengage. A committed plan grants no privilege; OGAR is only DO authority. An Undetermined directory role fails closed. +- Snapshot consistency and branch multiplicity are hard correctness preconditions for Hyperon-like folds/rewrites. + +Gate: if no benefit with paired controls, keep scheduling hypothesis falsified and do not add runtime machinery. + +### D-SAG-2-5: generic multi-hop and optimization proposal (separate, gated) + +- First show the exact two-hop query that #1509 cannot perform with one legal Quack Program, then evaluate #1508 D-CMH-G1-4 **relation carrier** or existing EqU32Via; do not feed an intermediate population mask between programs illegally. +- Compare Odoo/Ruby structural relation paths with dir-sim's existing witnessed BFS as an **independent oracle**, not a replacement engine. +- H1 fusion: output parity across NULL/UNKNOWN, 1/64/65/4097+ rows, bags/sets, no false primitive claim; benchmark at named native and v3 tiers, medians, allocations, decoded bytes and control cost. Show separate performance results for direct current Program, scalar reference and actual compiled fused candidate (if authorized later). +- Candidate life cycle: hypothesized → structurally feasible → semantically oracle verified → multi-workload cost measured → operator-approved or rejected. No self-change application in this plan. + +Gate: performance claim only after a real fused program exists and passes the parity oracle. + +## 5. Falsification matrix (pre-register before implementing) + +| ID | Deliberately adversarial case | Fails if | +|---|---|---| +| SAG2-P01 | two methods share field→claim; reproject one | other owner's witness/provenance lost | +| SAG2-P02 | compute DAG A→B becomes A→C, cyclic becomes acyclic | old current edges/refusal survive | +| SAG2-P03 | fake test name with matching digest | verified-tier accepted as independent proof | +| SAG2-P04 | same method label across class/seal/reading | identities collapse | +| SAG2-P05 | duplicate evidence in two hypothesis layers | belief confidence rises twice | +| SAG2-P06 | replay pinned k while k+1 appends | result changes or physical snapshot drifts | +| SAG2-P07 | Ruff Ruby equal (W,R,X,C) sets, different event order | SAG asserts behavioral equivalence | +| SAG2-P08 | C file-scope static vs C++ static method | semantic conflation | +| SAG2-P09 | Ruff reassemble(core-7) | unsupported roundtrip silently called lossless | +| SAG2-P10 | Odoo view parent edit/extension anchors | delta impact guessed without source witness | +| SAG2-P11 | unknown or unsupported relation | absence reported as proven False | +| SAG2-P12 | multi-hop call dependency | hidden second evaluator or invalid population intermediate | +| SAG2-P13 | 63/64/255 compute field cycle | DAG check misses edge | +| SAG2-P14 | prediction registered only after edit | leaked result counted as forecast | +| SAG2-P15 | feedback disabled twin versus revision-enabled | same choices misreported as learning | +| SAG2-P16 | correlated evidence and irrelevant high-entropy distractors | attention metric rewarded without useful oracle findings | +| SAG2-P17 | staged action with Undetermined role/revoked commit | action permitted by attention/prediction | +| SAG2-P18 | H1 mixed workloads/CPU tier and NULL | speed claim despite mixed/parity failure | +| SAG2-P19 | Hyperon 4-result nondeterminism | 2-result mask incorrectly called equivalent | +| SAG2-P20 | Ruff harvest versus original program behavior | static fact treated as runtime proof | + +Use positive/negative twins and disable one guard at a time. Report test names, red-before-fix result, measured environment and orphaned concerns. Unknown is an acceptable **typed answer**. + +## 6. Report schema and success metrics + +For each experiment publish: exact base SHA, Ruff SHA, fixture/license, source spans, source/oracle independence, proposition, forecast timestamp/revision, affected identities, emitted evidence count, unsupported residues, known truth universe, TP/FP/FN/Unknown, replay check, authorization verdict, budget, CPU tier, allocations, wall/CPU time, number of mask/lane decodes, observation/learning/control ablations, and explicit pass/fail/undetermined. + +Never collapse structural correctness, epistemic uncertainty and execution cost into a scalar "awareness score." A score cannot override authority, independent provenance or semantic equivalence. If using MDL, preserve #1509's result: single-condition shared reuse need not improve description length. + +## 7. Architectural decisions needing explicit sign-off + +1. Source-of-truth for durable method identities, currently caller issued, and schema/readings versioning; OGAR #357 is still a proposal at the #1509 base. +2. Who may issue and authenticate independent test receipts (not arbitrary claim()). +3. Provenance deduplication semantics: (src,rel,dst,tier,ctx,prov) or separate witnesses per logical edge; preserve shared edges, not duplicate facts. +4. Graph persistence and snapshot pinning: memory-only v1 vs Lance receipts; no write-back to compiler authority. +5. Explicit unsupported/residual contract for polyglot AST harvest and #1508 relation carrier. +6. Permission-gated action proposal semantics and rollback, without conflating NARS evidence, Rubicon commitment and OGAR authority. + +**Stop conditions:** any incorrectly upgraded authority, double-counted source, non-replayable snapshot, nondeterministic oracle mismatch presented as parity, hidden second engine, or false H1 speedup claim. Repair first; do not widen scope. + +## 8. Sources and exact entry points + +Internal: [#1496](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498](https://github.com/AdaWorldAPI/lance-graph/pull/1498), [#1499](https://github.com/AdaWorldAPI/lance-graph/pull/1499), [#1500](https://github.com/AdaWorldAPI/lance-graph/pull/1500), [#1501](https://github.com/AdaWorldAPI/lance-graph/pull/1501), [#1502](https://github.com/AdaWorldAPI/lance-graph/pull/1502), [#1503](https://github.com/AdaWorldAPI/lance-graph/pull/1503), [#1504](https://github.com/AdaWorldAPI/lance-graph/pull/1504), [#1505](https://github.com/AdaWorldAPI/lance-graph/pull/1505), [#1506](https://github.com/AdaWorldAPI/lance-graph/pull/1506), [#1507](https://github.com/AdaWorldAPI/lance-graph/pull/1507), [#1508](https://github.com/AdaWorldAPI/lance-graph/pull/1508), [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). + +Ruff: [AdaWorldAPI/ruff](https://github.com/AdaWorldAPI/ruff), [polyglot RFC](https://github.com/AdaWorldAPI/ruff/blob/main/.claude/OGAR-POLYGLOT-AST-INTEGRATION.md), [ModelGraph](https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/ir.rs), [C++-only reassembler](https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/reassemble.rs), [#117 order](https://github.com/AdaWorldAPI/ruff/pull/117), [#118 C linkage](https://github.com/AdaWorldAPI/ruff/pull/118), [#120 Odoo views](https://github.com/AdaWorldAPI/ruff/pull/120). + +Primary literature and independent runtimes: see the .arxiv shelf. All external implementation versions are **not pinned for execution yet**. diff --git a/.claude/prompts/software-awareness-graph-v2-claude-code.md b/.claude/prompts/software-awareness-graph-v2-claude-code.md new file mode 100644 index 000000000..cc46ebbeb --- /dev/null +++ b/.claude/prompts/software-awareness-graph-v2-claude-code.md @@ -0,0 +1,58 @@ +# Claude Code work prompt — D-SAG-2: falsify, observe, predict, revise + +**Base:** lance-graph main at merged #1509 (42fa2a347cda22eaaa327bba514f2029cc9daa82). Read the plan `../plans/software-awareness-graph-v2-ruff-ona-closed-loop.md`, the evidence contract `../knowledge/software-awareness-provenance-parity.md`, and the primary-source shelf `../../.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md` before editing code. + +## Mission + +Make the existing SoftwareGraph's predictions **independently falsifiable**, then determine experimentally whether feedback from Ruff or a runtime oracle can improve a subsequent prediction or decision. Preserve one Quack → mask-risc execution substrate; R2IL remains an alternate lowering frontend; OGAR remains sole authority for external effects. Treat #1496–#1501 as design/research and #1503–#1509 as partial implemented foundations. No second graph engine or ontology. + +## Read-first files + +- lance-graph: crates/lance-graph-glove-parity/src/{awareness,method,decl,gremlin}.rs; tests/{awareness,compose,declared,gremlin}.rs; examples/awareness_loop.rs. +- lance-graph: crates/lance-graph-quack/src/{bind,lib}.rs; crates/lance-graph-r2il/src/procs.rs; crates/lance-graph-contract/src/{class_view,hotplug}.rs; crates/lance-graph-dir-sim/src/{actors,view}.rs. +- Ruff: crates/ruff_spo_triplet/src/{ir,expand,reassemble,triple}.rs; crates/ruff_{python,ruby,cpp,csharp}_spo; crates/ruff_r2il; .claude/OGAR-POLYGLOT-AST-INTEGRATION.md. +- Existing plans/primary excerpts in PRs #1496, #1497, #1498, #1499, #1500, #1501, #1508 and #1509. Search actual code before asserting a function exists or a gate shipped. + +## Order of execution + +1. **Inventory on exact revisions.** Obtain repository HEAD SHA and each dependency revision; mark contract shipped/tested, research-only, or unknown. The initial plan uses #1509's merge; if main advanced, reconcile rather than silently substitute the branch. +2. **Try to refute three audit findings first.** Write small tests in existing glove-parity test modules: + - link() shared-edge ctx/provenance dedup versus partial reproject; + - project_compute() replacement across changed class DAG and cycle status; + - caller-issued Certificate with forged test name accepted as Verified. + For each: record failing reproduction or evidence that the claim was false. Do not implement fixes until the falsifier is real. Ensure that a historical receipt and a current projection are different concepts. +3. **Define the minimal receipt contract.** Exact source revision, snapshot, evidence source key, derivation, observed relation, method key, schema seal, reading, universe, oracle result, environment fingerprint. Distinguish verified test from user annotation and compiler verdict; a note must never promote itself. +4. **Ruff side, in read-only adapter/probe only.** Pin Ruff SHA. Select minimum supported fixtures: + - Odoo model and parent/extension view (`inherit_id`); + - Ruby model with same unordered body-facts but different ordered MethodOre; + - C file-scope `static` versus C++ static method, overloaded C++ methods; + - explicit unsupported round-trip (core-7) and unprojected free-function calls. + Build an exact crosswalk from Ruff identifiers/provenance to SAG identifiers or emit typed residuals. Do not infer universal cross-language equality. +5. **Impact forecasting.** Freeze A and produce a machine-readable PredictionReceipt **before** altering a fixture; edit to B in a separate commit; reharvest blind. Compare predicted and observed deltas with TP/FP/FN/Unknown (only on supported complete universe) and source-span evidence. +6. **One feedback mechanism, not a reasoning empire.** Choose the smallest revisable hypothesis over candidate impact/unknown, update it only from independently stamped outcomes. Repeat a paired case with evidence feedback disabled, same budget and candidate order. If the chosen subsequent action doesn't change or doesn't improve the predeclared target, report that; do not claim learning. +7. **Only after above gates:** compare scheduler variants (FIFO, confidence, Shannon, EIG, Moore/Staunen), evidence overlap/fission, and Rubicon commitment/rollback. Separate scheduling from inference law and permission checks. Keep effect execution unimplemented unless operator authorizes a future PR. +8. **H1 optimization stays a separate experiment.** Existing 1.59–1.78× scalar cost gap is not improvement. Benchmark a real fused implementation only if separately approved after correctness and NULL/UNKNOWN controls; publish native/v3 tiers. + +## Concrete acceptance tests + +- P01: shared field claim has two independent ownership witnesses; reprojecting one doesn't erase the other's claim. +- P02: compute dependency/cycle disappears in current projection at B, while history (if kept) is explicitly versioned. +- P03: forged run metadata cannot create independent Verified proof. +- P04–P09: class/seal/reading identity, dependent stamps, pinned snapshot, Ruby event order, C semantic distinction, restricted Ruff round-trip. +- P10–P13: Odoo view impact, explicit unknown, typed NoRelationCarrier, full 256-position DAG. +- P14–P16: preregistered forecast, failed-feedback ablation, irrelevant entropy distractors. +- P17–P20: Undetermined role cannot authorize, H1 mixed-workload/NULL counterexample, Hyperon four-branch cardinality, static ≠ runtime behavior. +- Every guard fixed must have disable-red-run evidence. A passing assertion against handwritten expected fixtures alone is not an independent oracle. + +## Mandatory outputs from the coding session + +Provide: exact files changed; design decision ledger; list of falsifiers with red/green and counterexamples; fixture and oracle identifiers; CI commands and *actual* outcomes; measured cost per variant; unresolved typed gaps; a source/revision table; and either a narrowly scoped implementation PR (only the passed wave) or a clear blocker report. + +Track predictions and observed outcomes separately, with timestamps or pinned revisions. Permit the correct conclusion to be "no improvement", "Unknown", or "this layer cannot express that relation". Keep the register/ISA bytes unchanged; any new semantic reading or method authority requires a separately reviewed contract. + +## PR hygiene + +- No editing the generated board index by hand; if adding a board entry run .claude/tools/entries_index.py --write and --check, retaining the curated finding column. +- Run plan_dids.py, append_only_gate.py and relevant repository CI gates as applicable; do not claim they passed unless executed. +- Avoid status-board inflation: distinguish shipped, measured locally, untested, proposed and blocked. +- Do not auto-merge, grant permissions, modify policy, deploy or overwrite source code as a side effect of an awareness conclusion. From 406248abef28db4021a7f473c19a0028312af1fd Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:14:34 +0200 Subject: [PATCH 05/46] docs: add actionable Claude Code implementation prompt and stop gates --- .../sag-wisdom-frontier-claude-code.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 .claude/prompts/sag-wisdom-frontier-claude-code.md diff --git a/.claude/prompts/sag-wisdom-frontier-claude-code.md b/.claude/prompts/sag-wisdom-frontier-claude-code.md new file mode 100644 index 000000000..0ba25ba7b --- /dev/null +++ b/.claude/prompts/sag-wisdom-frontier-claude-code.md @@ -0,0 +1,136 @@ +# Claude Code handoff — D-SAG-2: wisdom-frontier / OpenPsi / Rubikon / CARE / ONA / Hyperon + +**Objective:** Turn the merged D-SAG-1 software-awareness graph (#1509) into a *testable research path* toward evidence-grounded, intrinsically motivated self-inspection. Implement only verified, phase-gated, reversible probes. **Do not build a second graph engine.** + +**Branch:** research/sag-openpsi-rubicon-care-wisdom-frontier +**Upstream base:** merged #1509, commit 42fa2a347cda22eaaa327bba514f2029cc9daa82. +**Required reading before edits:** +- .claude/plans/software-awareness-graph-v1.md +- .claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md +- .arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md +- .claude/knowledge/maslov-pyramid-of-cognition.md +- .claude/plans/rubicon-volition-v1.md +- .arxiv/2606.14581_synthesize_programs_gate_commit.md +- .arxiv/2026-10_opencog_pln_shannon_attention_research_map.md +- .arxiv/2026-10_hyperon_metta_to_lance_graph_parity_map.md + +## Your task + +First give a **source-grounded code census** of the actual merged #1509 API: SoftwareGraph, Binder, MethodTable, Quack Draft, mask-risc program/terminal, class_view seal, provenance/root algebra, pearl::hydrate, experimental maturation, any current stage reading and the legal one-hop limit. Also inspect relevant OGAR and ONA/Hyperon source interfaces and **mark unverified capabilities as unverified**. Do not treat document plans as production APIs. + +Then choose the **smallest independent probe** which can be implemented in the current test tree and compared to a scalar oracle. Preferred first target: **D-SAG-2-P1, stage-0 frontier popcount and evidence-root invariants**. Do not expand to live adapters, volition, EIG and CARE all in one code change. + +### Substrate invariants (non-negotiable) + +1. CE64[50..52] **currently means plasticity** in production. #1494 uses maturation 7..0 only under its own test-local explicit reading. Do not change this layout or conflate provenance. Do not put entropy/demand into that field. +2. CE64[59..63] has declared epistemic meaning. Never use it for preference, intention or action authority. +3. Register bytes are ISA/ALU carriers. ClassView, provenance and method signatures determine readings. No hidden semantic assumptions in raw register tests. +4. NARS frequency/confidence are not automatically calibrated Bayesian probabilities; Shannon entropy/EIG require an explicitly calibrated and versioned hypothesis distribution. +5. Derived edges inherit original observation roots, never mint a new independent root. No self/descendant support, including reopened grounded cycles. +6. Mask debt must operate on a separately typed prerequisite universe: missing = required & ~(known | refuted); blocked = required & refuted; debt = popcount(missing). A debt of 0 is not proof of truth. +7. SAG #1509 is **one hop** using existing Quack Draft/ScatterOrU32. A second hop must be represented by a *proven legal* relation carrier or explicitly blocked. No second traversal VM, custom graph executor, shadow methods registry or invented Quack operator. +8. An LLM-synthesized ranking **program** is not a decision, a decision is not a committed goal, and a committed goal is not permission to effect a real-world operation. Version/seal/time, capability and live authorization gates remain separate. +9. Compiled, verified and hypothesized SAG tiers remain distinct. No automatic application of H1 fusion. Do not claim a SIMD improvement before a fused terminal exists and runs. +10. No commits to main, no merge, no external effects; keep PR as draft while hypotheses and runtime parity remain open. + +### P0: inspect, do not hallucinate + +Report: +- exact paths/symbols and tests for graph projection and Quack lowering; +- whether root-set masks and ancestor/descendant guards are reusable as-is; +- whether the current source already has a safe bitset/popcount primitive, or whether a test-local scalar is needed; +- whether there is a legal population carrier for a second hop; +- status of ONA MeTTa-NARS bridge, OpenPsi PR #117, PLN/PeTTa and CARE reference; +- runtime, licensing and test commands needed to reproduce each foreign oracle; +- any difference between docs and production, with actual code evidence. + +Do not modify this research plan to claim the census ran until you show paths, commit hashes and test output. + +### P1: first runnable scalar falsifier (preferred) + +Use tiny typed fixtures (not raw CE64 reinterpretation): +- A confirmed stage-0 anchor with B,C consequences; a frontier with 0,1,3 unknown prerequisite bits; one explicit refutation; +- duplicate evidence through two paths with one physical root; +- an ungrounded 3-cycle A->B->C->A; +- grounded 3-cycle then remove external anchor, preventing resurrection; +- a relation contradicted by new observation: only that relation enters stage 7 unless anchor itself is contradicted; +- repeated replay after fixed point; +- stale class/schema seal and row permutation. + +Write an **independent scalar oracle**, then optionally reuse existing mask/popcount primitives; assert exact equality of candidate IDs, missing/refuted, root sets, maturity, outcome and refusal reasons. Assertions should check that zero new evidence yields no epistemic progress. A test-local custom stage marker is allowed only under explicit provenance, never on production-minted CE64. + +At least one guard-disable run must fail before restoring the guard; document the mutation and actual RED test output. + +### P2: Quack masking parity + +Only after P1: use the genuine #1509 Binder/Draft path to project candidate rows. Demonstrate one-hop query parity with scalar oracle. If two-hop graph traversal needs a forbidden population intermediate, assert typed refusal or write a self-contained pre-approved carrier experiment without modifying hot-path contracts. Preserve row permutation and tier invariance, exact NULL / bag / set semantics and reading IDs. Account for full work including decoding, candidate construction, mask operations and refused lowerings. + +### P3: cross-engine ONA <-> Hyperon / OpenPsi + +Use **pinned upstream snapshots**. First compare native ONA vs ONA-through-MeTTa-NARS on shared fixtures; record Narsese event-time, f/c and output bindings *without normalization that changes meaning*. Then compare Hyperon/MeTTa and modern PLN only on carefully delimited equivalent observables; record explicit divergences and interpreter versions. + +Official upstream entrypoints to inspect: +- https://github.com/opennars/OpenNARS-for-Applications (build.sh, evaluation.py) +- https://github.com/opennars/OpenNARS-for-Applications/releases/tag/v0.9.3 +- https://github.com/patham9/nartech_ros/tree/master/plugins/narsplugintests +- https://github.com/trueagi-io/hyperon-experimental +- https://github.com/trueagi-io/PLN +- https://github.com/trueagi-io/PeTTa +- https://github.com/iCog-Labs-Dev/hyperon-openpsi (test/run-tests.py) +- https://github.com/iCog-Labs-Dev/hyperon-openpsi/pull/117 (open upstream change; do not presume merged) + +No claim that CARE is officially implemented by ONA or Hyperon. It is a **new comparative harness design**. + +### P4: distinguish the learning and choice mechanisms + +Use a frozen inference engine, candidate set, calibration split, environment oracle and budget. Swap only scheduler: +- FIFO; +- confidence-only; +- minimum popcount debt; +- naïve entropy (negative control); +- properly calibrated expected information gain; +- EIG + OpenPsi demand and test-local maturation; +- optional CARE program challenger vs reference. + +Then freeze scheduler and vary native reasoning engines in a separate experiment. Report irreducible noisy-TV decoy, rare useful lower-entropy query, delay vs impossibility, tie/iteration permutations, duplicate roots, candidate-order invariance, and full cost. Independent out-of-sample validation is mandatory for claimed improvement. + +Explicit EIG target: + p(Theta | D) over declared rival models; + EIG(a) = H(Theta|D) - E_{o|D,a}[H(Theta|D,o)]. +No hidden outcome look-ahead, no NARS-f/c-as-probability shortcut. + +### P5: CARE gate + Rubikon + Kanban in simulation only + +Reference policy independently ranks available candidates. A challenger program may propose an alternative; validate boundedness, finite scores on **every** candidate, order independence, schema/reading version, source-of-evidence cutoff and total costs. The reference-conditioned gate records immutable pre-outcome decision. A goal may then be committed, with a **separate** revocable if-then action rule; dispatch only after live permit/capability/cue checks. Outcome/receipt updates demand, evidence and Kanban state **after** the commit record is sealed. + +Compare repeated deliberation, goal commit alone, + implementation cue, + disengagement/CARE auditing. Include authorized and unauthorized twins, stale policy, cancellation race and empty new-evidence cycle. + +### P6: software self-inspection and useful proposals + +After the above, ask the existing SoftwareGraph whether a method's repeated condition or compiler refusal reveals an actionable *investigation* (e.g., #1509's H1 selection fusion or unresolved capability). Let the graph **nominate**, never enact, an optimization; permit a separate run only once semantic equivalence, reproducible cost tier, NULL/bag/set obligations and human/contract authorization pass. + +## Reporting format + +For each probe, produce: +- question and falsifier ID (D-SAG-2-x); +- source revision, actual call path, declared semantic reading; +- exact input/original observation roots, candidate count and budget; +- independent scalar oracle expectation; +- passing **and negative/silence twin** tests; +- disable/RED/restore evidence; +- actual command, exit status and timing (if measured); +- measured complete cost, not microbenchmark only; +- remaining unresolved contract decisions and next smallest discriminating probe. + +The final status table must distinguish **IMPLEMENTED / MEASURED / SOURCE-VERIFIED / RESEARCH / BLOCKED / REFUTED**. If foreign runtime cannot be obtained or compiled, say so rather than inventing results. + +## Hard acceptance gates + +- Zero production CE64 bit migration, unauthorized side effects, rule coercion, new engine or silent multi-hop. +- Zero false-independent observation roots and zero self-resolving cycles. +- All pre-outcome decisions replay identically under row permutation and after restart on the same snapshots. +- Demonstrated scheduler gain only under equal oracle, equal evidence and all-in cost. +- Literature notes state exactly what upstream papers demonstrate and what remains our hypothesis. +- No unproven full cognitive architecture claim merely because individual probes pass. + +**Deliverable of the current research PR:** documentation, annotated .arxiv source shelf and this prompt. Future code P1-P6 is *proposed work*, not claimed delivered. From bcd79ea045a43aa3018b71378103df07bb9e561e Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:14:40 +0200 Subject: [PATCH 06/46] research: add primary-source IAM provenance and policy excerpts --- ...hs_temporal_provenance_primary_excerpts.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md diff --git a/.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md b/.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md new file mode 100644 index 000000000..00ccb40b8 --- /dev/null +++ b/.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md @@ -0,0 +1,102 @@ +# IAM access paths, temporal policy and provenance: primary-source excerpts + +**Date:** 2026-10-12. **Status:** sourced research distillation / transfer hypotheses, **not** implementation evidence. **Base:** [merged lance-graph #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). **Application plan:** [D-IAM-SAG-0](../.claude/plans/iam-substrate-sag-dir-sim-v1.md). + +**Method.** Short **paraphrased** excerpts (Exzerpt / sinngemäß), with section or abstract locator; exact source URLs, what the author establishes, what remains speculative for OGAR/dir_sim/lance-graph, and a concrete falsifier. We do not transfer formal guarantees merely because vocabulary matches. arXiv preprints are not all peer-reviewed; NIST and Frontiers are non-arXiv primary sources included because access semantics and NARS require them. Read existing [Hyperon excerpt](2026-10_hyperon_metagraph_folds_chronomorphisms_primary_excerpts.md) and [NARS evidence excerpt](2026-10_nars_self_epistemic_needs_evidence_primary_excerpts.md) instead of duplicating entire papers. + +## P1. Why-provenance is a set of sufficient witnesses, not a path label + +**Source:** Calautti, Livshits, Pieris, Schneider (2023), *The Complexity of Why-Provenance for Datalog Queries*, [arXiv:2303.12773](https://arxiv.org/abs/2303.12773); abstract and complexity results in full text. + +**Exzerpt, abstract (paraphrase):** Why-provenance explains an answer through subsets of input facts sufficient to derive it. Recursive queries pose harder computational problems than many nonrecursive fragments; the paper establishes intractability for recursive cases it studies, even certain restricted recursive forms. It also explores practical solving approaches. + +**Transfer to IAM [H]:** `Identity->Group->Role->Entitlement` needs a witness contract: (a) *one concrete sufficient witness* for a positive role, (b) *all witnesses* if making a disappearance claim after removal, or (c) an explicitly bounded search. In `dir_sim::actors`, `RoleEvidence::Held` already returns one (shortest) SID-chain witness, and its documentation correctly says this is not the only reason. Reuse `RoleImpact::between` to decide actual role loss. + +**Falsifier:** grant one entitlement by two edge-disjoint paths, remove one path, and verify the explanation changes while effective access stays. Declare a path enumeration budget and prove an unfinished search cannot be reported as complete absence. The paper **does not** prove a specific Query/Masks implementation or supply an IAM authorization oracle. + +## P2. Temporal roles must satisfy policy and timing together + +**Source:** Combi, Viganò, Zavatteri (2015), *Security Constraints in Temporal Role-Based Access-Controlled Workflows (Extended Version)*, [arXiv:1512.06404](https://arxiv.org/abs/1512.06404); abstract, temporal role/workflow mappings and security constraint sections. + +**Exzerpt, abstract (paraphrase):** The authors integrate role timing and temporal workflow constraints, determine which users can perform tasks, and describe runtime propagation of security constraints. + +**Transfer [H]:** a directory snapshot VersionId, a policy revision, a grant's effective interval and an observed-at timestamp play different roles. A replay of `V7` at a historical policy version is an *analytical question*, not permission to execute a change now. The latest external PDP still decides live authorization. + +**Falsifier:** membership is true at both t0 and t1, policy grants only [t0,t1); an as-of query and an execution request at t1 must differ. Also test an observation arriving late and policy revision changing mid-simulation. The paper does not endorse a particular two-clock encoding or guarantee eventual-consistency safety. + +## P3. Aggregating an access explanation requires explicit provenance semantics + +**Source:** Amsterdamer, Deutch, Tannen (2011), *Provenance for Aggregate Queries*, [arXiv:1101.1110](https://arxiv.org/abs/1101.1110); abstract and sections introducing aggregate provenance. + +**Exzerpt, abstract (paraphrase):** Provenance for aggregate computations cannot in general be handled by naïvely using ordinary tuple annotations; provenance may need to attach to values involved in a computation, and extensions to positive relational algebra with aggregates have additional difficulties. + +**Transfer [H]:** IAM review dashboards count people, grants, risky roles and duplicated licenses. Distinguish bag count from distinct canonical identity count; attach evidence to the source values/derivation and preserve group-role policy version. An `any(path)` witness is not a `count(distinct principals)` proof. The typed `SoftwareGraph` in #1509 already distinguishes bag-versus-set semantics in its falsifiers. + +**Falsifier:** same principal reaches one role via two paths, two source aliases and two time windows. Counts of entitlements, paths and distinct principals must differ by design; policy conclusions must be invariant under reordering of duplicate evidence and explicit about the chosen unit of counting. + +## P4. Hyperon: reflect on the methods, not a second IAM engine + +**Source:** Goertzel et al. (2023), *OpenCog Hyperon: A Framework for AGI at the Human Level and Beyond*, [arXiv:2310.18318](https://arxiv.org/abs/2310.18318), especially metagraph representation/rewriting and self-modification discussion (§3.1.3 and surrounding architecture). Related formal proposal: Goertzel (2021), *Reflective Metagraph Rewriting as a Foundation for an AGI "Language of Thought"*, [arXiv:2112.08272](https://arxiv.org/abs/2112.08272), abstract. + +**Exzerpt (paraphrase):** Hyperon proposes metagraphs to represent knowledge and cognitive processes; a reflective language can treat its own programs/rewrite rules as graph-represented subjects of computation. These are architectural proposals and directions, **not** a demonstrated runtime parity result for lance-graph or a security certification. + +**Transfer [H]:** #1509's `SoftwareGraph` already projects prepared methods, lowering programs and compiler refusals as typed rows queried by Quack. Model an IAM method's dependency and test evidence in the *software graph* while the actual effective access is computed from the *directory/authority graph*. Link via a versioned method/plan receipt, not a second runtime, and never turn SAG `Tier::Hypothesis` into an entitlement. + +**Falsifier:** declare a hypothetical optimization method with no compiled body; SAG must distinguish *declared*, *compiled*, *verified*, *refused*, and *hypothesized*. Reproject after changing the method seal and invalidate stale evidence. A typed graph description does not itself execute `do()`. + +## P5. NARS/ONA: introspection is revisable evidence, not provider authority + +**Source:** Wang, Li, Hammer (2018), *Self in NARS, an AGI System*, *Frontiers in Robotics and AI* 5:20, [DOI:10.3389/frobt.2018.00020](https://doi.org/10.3389/frobt.2018.00020), §§2, 3.1–3.5. Related implementation: [OpenNARS for Applications](https://github.com/opennars/OpenNARS-for-Applications). Existing deeper paper audit: [NARS excerpt](2026-10_nars_self_epistemic_needs_evidence_primary_excerpts.md). + +**Exzerpt, §§2–3 (paraphrase):** NARS operates under insufficient knowledge/resources, builds revisable self-knowledge using internal events and reasoning traces, and treats mental operations as a supplement to normal inference control. The article's implementation discussion is not a demonstration of subjective awareness. + +**Transfer [H]:** an optional IAM observer consumes `Undetermined`, `RefusedFor`, missing evidence and historical mismatches to rank *read-only probes*: inspect another source, run a `dir_sim` counterfactual, request review. Keep statistical surprisal, confidence in an inferred claim, and enterprise authorization in separate planes. Self-observation of a change proposal is not an approval event. + +**Falsifier:** same evidence under observer-on and observer-off; compare discovery coverage, false alerts, CPU time and effect on factual IAM output. Observer state may prioritize *questions*, but must not alter the ground-truth role-evidence oracle or bypass an effect gate. + +## P6. Dependent evidence cannot be added as independent evidence + +**Source:** Jøsang (2007), *Cumulative and Averaging Fission of Beliefs*, [arXiv:0712.1182](https://arxiv.org/abs/0712.1182), abstract and fusion/fission sections. Existing detailed distillation: [NARS evidence excerpt](2026-10_nars_self_epistemic_needs_evidence_primary_excerpts.md). + +**Exzerpt (paraphrase):** Different fusion laws apply according to whether evidence has independent or shared provenance; fission examines the effect of removing a known contribution under explicit algebraic preconditions. These are Subjective Logic rules, **not** NARS or CE64 byte-laws. + +**Transfer [H]:** a principal's license status observed through AD sync and Entra sync may originate from one upstream change. Do not count the two read surfaces as independently corroborating the same change. Retraction/ablation of one upstream fact should account for downstream duplicates. The immutable source identity and replayable observation receipt are the meaningful inputs. + +**Falsifier:** one observation reported by two adapters vs two truly independent observations; adding a duplicate must not increase evidence confidence. Attempting exact inverse confidence from only saturated u8 values must refuse or report bounds, not fabricate certainty. + +## P7. ABAC is an authorization evaluation, not a graph association + +**Source:** Hu et al., NIST SP 800-162 (updated 2019), *Guide to Attribute Based Access Control (ABAC) Definition and Considerations*, [DOI:10.6028/NIST.SP.800-162](https://doi.org/10.6028/NIST.SP.800-162); [NIST publication](https://csrc.nist.gov/pubs/sp/800/162/upd2/final), abstract and §2. + +**Exzerpt, abstract (paraphrase):** ABAC evaluates subject, resource/object, action and possibly environment attributes against policy rules or relationships. This is **more** than the existence of a directory edge. Attributes require validity, provenance and decision context. + +**Transfer [H]:** `member_of` may imply a policy candidate but cannot by itself decide conditional access; unknown device compliance and unverified session posture block a fully determined decision. Use ClassView/WideFieldMask for read fields, not as a permission mask. Refuse missing policy context, and keep the IdP/PDP as policy authority. + +**Falsifier:** same identity/group path on one compliant and one unknown-compliance device. Graph entitlement can be equal; policy decision becomes permitted/undetermined under a specified policy. Cannot equate a graph association with a successful SSO session. + +## P8. Zero Trust keeps enforcement separate from analytical proposals + +**Source:** Rose et al. (2020), NIST SP 800-207, *Zero Trust Architecture*, [NIST PDF](https://doi.org/10.6028/NIST.SP.800-207), §§2–3 and policy decision/enforcement point description. + +**Exzerpt, §§2–3 (paraphrase):** Access to enterprise resources is mediated by a policy decision point (PDP) and policy enforcement point (PEP), using subject/request context and enterprise policy; network or directory membership alone does not establish trust for all future interactions. + +**Transfer [H]:** Quack may evaluate read-only graphs, OGAR/dir_sim may simulate, and SAG may propose tests. The live SSO/PAM/MDM or directory provider still enforces; an external mutation has a separate actor-bound authorization and precondition check. Inference confidence is not an execute grant. + +**Falsifier:** inject a `Tier::Verified` optimization receipt, forge a policy-looking graph edge or replay a historical approval. All three must fail to produce a provider write without fresh external authorization. A policy simulation cannot certify that a third-party enforcement system will behave identically. + +## Source and transfer ledger + +| Work | Authoritative for | Not evidence for | +|---|---|---| +| arXiv:2303.12773 | complexity/meaning of why-provenance witnesses | automatic complete IAM explanations | +| arXiv:1512.06404 | role/workflow timing constraint models | chosen directory timestamp layout | +| arXiv:1101.1110 | aggregate provenance pitfalls | a particular Quack aggregate implementation | +| arXiv:2310.18318 / 2112.08272 | reflective metagraph language/architecture | new engine necessity, measured AGI | +| Wang et al. 2018 / ONA | internal-event traces and revisability | IAM authorization, phenomenal selfhood | +| arXiv:0712.1182 | evidence fusion/fission assumptions | byte-compatible NARS/CE64 truth rules | +| NIST 800-162 | attribute-policy model | proof an entitlement is allowed | +| NIST 800-207 | PDP/PEP and zero-trust architecture | replacement for an active IdP | + +**High-signal conclusion:** the core research-backed contract is a triangle: **sufficient provenance witnesses × version-pinned temporal policy × separately enforced authority**. Graph introspection helps discover *questions* and *counterfactuals*, not a shortcut through either formal witness completeness or an authorization boundary. + +**Open questions for the implementation PR:** (1) exact carrier for multi-hop; (2) how to expose and bound witness completeness; (3) version join for dir_sim + GroupRolePolicy + MDM; (4) where OGAR/OGIT identity mapping authority lives; (5) what counts as a verified compiler certificate vs a claimed capability; (6) which provider operations remain only simulated. From 3422ec77c8ad093d0c44369d48e79c9c68ccebb8 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:14:55 +0200 Subject: [PATCH 07/46] docs(sag): propose graph-backed local agent context and ONA feedback after #1509 --- ...software-awareness-agent-context-ona-v1.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 .claude/plans/software-awareness-agent-context-ona-v1.md diff --git a/.claude/plans/software-awareness-agent-context-ona-v1.md b/.claude/plans/software-awareness-agent-context-ona-v1.md new file mode 100644 index 000000000..81eb5b1e0 --- /dev/null +++ b/.claude/plans/software-awareness-agent-context-ona-v1.md @@ -0,0 +1,144 @@ +# D-SAG-2 — Addressable software context and ONA-inspired execution feedback + +**Status:** RESEARCH / unimplemented follow-up. **Base:** [merged D-SAG-1 #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), merge commit `42fa2a347cda22eaaa327bba514f2029cc9daa82`. **Code examined:** `crates/lance-graph-glove-parity/src/awareness.rs`, `method.rs`, `gremlin.rs`; [D-SAG-1 plan](software-awareness-graph-v1.md). **Date:** 2026-10-12. +**Companions:** [execution prompt](../prompts/d-sag-2-ona-agent-context-implementation.md), [primary research excerpts](../../.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md), [repository-graph papers](../../.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md). + +## 0. Problem and result that would change our mind + +Can a local, source-backed graph answer the *structural* part of Claude Code's repository-context questions without having to repeatedly send prose descriptions and file scans through the language-model context window? Can the same graph record versioned execution receipts and make falsifiable predictions about legal optimizations? + +**Testable claim, not a result:** precomputed symbol/semantic edges, expanded by existing Quack queries, can reduce **model-visible input tokens and tool invocations** while maintaining or improving the quality of dependency discovery. Local queries themselves require zero LLM inference tokens, but the compact results sent to Claude consume tokens. A claim of zero total tokens would be false. + +**Single architecture:** canonical software nodes -> declarative edges/evidence -> Quack `Draft` -> existing mask-risc executor -> bounded typed context slice or read-only optimization proposal. No Cypher/Gremlin/ONA interpreter in the hot path; no second semantic method registry; no autonomous edits. + +### Shipped baseline (must not regress) +- #1509 projects one concept's prepared methods/fields/conditions/folds/laws/programs, refusals and compiled primitives into typed rows; its `SoftwareGraph` implements Quack's `Binder`. One-hop, one-program `ScatterOrU32` questions have been tested. +- #1509's code/plan describe in-memory rows, caller-provided source revision and current multi-hop blockage. No persisted Lance index or automatic full-source AST harvesting. +- #1509's H1 is an **optimization hypothesis**. A materializing program was slower than a fused **scalar oracle** on particular workloads/tiers; no fused SIMD backend was proved. +- #1508/G1 and #1504 establish relevant method composition/preparation, but source symbol navigation is a distinct identity and provenance problem. +- The supposed seven-language Bible graph is **not shipped**. #1509 audited an English KJV triple experiment, a small six-lane lexeme fixture and German labels. Reuse only the abstract rule: concept identity is not text spelling. +- Here **SoC means separation of concerns**, not a fabricated system-on-chip. + +## 1. Separate three graphs, unify through qualified evidence edges + +1. **Source-symbol graph** (candidate ingestion): repository, file, module, definition, function, trait, impl, field, callsite, test, build target and source span. Use compiler-backed definitions/references where possible; Rust Analyzer/LSP or an appropriate indexer is a *source adapter*, not a second reasoning engine. Source symbols are tied to `git commit / worktree digest / build cfg / macro expansion`; never mint an OGAR concept from a matching Rust name. +2. **Semantic-method graph** (already partially implemented): OGAR-qualified concept, `MethodKey`, sealed fields and readings, typed `MethodBody`, `Calls`, `LowersTo`, `UsesPrimitive`, semantic laws and compiler refusal. Bind source symbols to these **only with an explicit witness** such as implementation registration or generated reference, not lexical similarity. +3. **Execution-evidence graph** (proposal): prepared program instance, experiment, receipt, outcome, observed cost and hypothesis. Observation is not proof. A validated equivalence must cite a pinned independent oracle and the exact source/body/version. + +Physical rows may be shared; identities, relation kinds, source-of-truth owners and validity periods may not be conflated. Keep `Tier::{Declared,Derived,Compiled,Verified,Hypothesis}` distinctions. Edge provenance: `{subject,rel,object,source_ref,source_sha,generation,provenance,tier,valid_at}`. + +**Semantic hygiene:** `IAM::active` and `CRM::active` remain distinct even if label/ordinal/lane kind matches. Different population, NULL, bag/set, time window, authority or reading laws require typed refusals. + +## 2. Cold incremental graph construction; immutable snapshots + +**Inputs:** committed repository index, current working-tree overlay, prepared method table, compiler decisions, tests, benchmark receipts and explicitly marked documents/PR assertions. Treat documents and LLM proposals as *claims*, never compiled facts. + +**Invalidation:** SHA of git tree + uncommitted file content + cargo features/target + macro expansion/codegen context; method `BodyVersion`, `SchemaSeal`, `ReadingId`, `FullClassId`, source generation, CPU tier, independent test signature. Stale edges must be omitted or returned explicitly as stale. Changed files reindex only impacted records, but any ambiguous dynamic callsite widens the uncertainty, not a fabricated dependency. + +**Two-hop blocker:** #1509's single-program path cannot pass arbitrary mask-to-mask traverser populations between hops. First test the legal `EqU32Via` / factored relation carrier and G1's referenced-call edges; if neither suffices, return `UnsupportedMultiHop` with proof of where it fails. Do **not** implement a standalone BFS, traversal interpreter or new query engine to make demo screenshots work. The existing one-hop relationship may still be presented as a small useful slice. + +**No hot-path symbol lookup:** indexing/context preparation is cold or incremental. Runtime method calls keep the already bound Quack/R2IL/mask-risc execution path. + +## 3. Local read-only context-provider contract (MCP/CLI adapter is optional) + +Three **candidate** tool operations, not claims of installed integrations: + +```text +context(SymbolRef, Intent, Budget, Revision) -> ContextSlice | TypedRefusal +impact(SymbolRef, ProposedChange, Budget, Revision) -> ImpactSlice | TypedRefusal +propose(SymbolRef, Objective, Budget, Revision) -> Candidate[] | TypedRefusal +``` + +- `SymbolRef` is a canonical location/ID plus optional exact source location, not an unqualified string. +- `Intent`: explain, implement, test, optimize, review, navigate. No arbitrary tool writes. +- `Budget`: max nodes/edges/hops, returned bytes/tokens (estimated), wall time, privacy/redaction policy; show `truncated` and a continuation handle. +- `ContextSlice`: exact anchor IDs, source links and line ranges, evidence tiers, graph revision, discovered dependencies, relevant laws, tests/refusals, uncertainties, `not_checked`, and explicit omissions. +- `ImpactSlice`: affected functions/methods/tests/build targets by typed reachability, plus separate potential or unresolved impacts. Missing an edge is NOT a negative proof. +- `Candidate`: deterministic graph-pattern recommendation, obligations, confidence provenance and a suggested *read-only* verification query. No execute/edit capability. + +Example payload, strictly illustrative: + +```text +context(GroupSum, intent=modify, revision=HEAD+worktree, budget=4096B) + known: Quack lowering; R2IL parity path; population/mask laws + tests: method parity; independent fold oracle + measured: only version- and CPU-matched receipts + unknown: unindexed macros / unresolved dynamic callsite + next: inspect source span / run named tests +``` + +Prefer a tiny typed JSON/text envelope rendered for Claude rather than broad Markdown dumps. No repeated full-file prose. Stable ordered answers and provenance permit local diffs between sessions. The provider must not claim to be VS Code IntelliSense or a Claude Code plugin until one is actually wired. + +## 4. Cheap deterministic proposer before LLM reasoning + +Rules over *validated* edges can recommend: +- reuse `is_billable` rather than duplicate predicate bodies; +- run tests covering the changed primitive/reading/population; +- flag a body that references a class-incompatible field or cycle; +- detect a shared materialization + fold pattern and propose H1; +- notify that a `FirstOfRun`/retraction obligation is missing without pretending independence; +- mark source+body+seal drift and demand re-preparation. + +Proposals must be `Fact | Inference | Hypothesis` tagged, with reasons and independent falsifiers. Query answers cannot silently authorize OGAR `ActionInvocation` or provider effects. + +**LLM boundary:** Claude receives only a relevant slice, then uses its own judgment/editing tools; the graph's data is untrusted context, never behavioral instructions. Source comments, Markdown, PR bodies and model-generated proposals can include prompt injections. Filter tool output to typed data and citation pointers. + +## 5. Observable execution and ONA-inspired feedback + +**Pinned upstream reference:** ONA `opennars/OpenNARS-for-Applications` at `dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a`; paper by Hammer & Lofthouse (2020). ONA's event/temporal implication/anticipation/operation/revision loop is a reference, **not** an imported runtime. Wang, Li & Hammer (2018) is broader theory, not proof every mental operation runs in ONA. + +Minimal experimental entities: +- `Observation`: execution of `PreparedProgram` against `PopulationSnapshot` under `ReadingId`, a concrete outcome/refusal, and source-backed provenance. +- `ExecutionReceipt`: receipt ID, experiment/run ID, compiled program and body digests, `FullClassId`, method key, schema/reading/source version, CPU feature/tier and dataset/window; objective timing, allocations and materialization *when actually measured*, sampling/method and measurement error; oracle/test identity and status. +- `OptimizationHypothesis`: precondition predicate, permitted candidate, predicted effect **registered before result**, predicted metric/range, observation deadline/window, evidence ancestry, applicable method versions, falsifier and later observed outcome. +- `Revision`: positive/negative/unknown observation with no double counting from repeats or shared evidence base. Negative evidence only after a real opportunity to observe a promised consequence. + +Do not equate `Truth(f,c)` with a calibrated probability/confidence interval; do not deduce causal improvement from temporal association. A benchmark is not an evidence-independence certificate. Keep immutable ISA bytes, ClassView readings and policy distinct. + +**Receipt gap:** #1495 showed NAL recipe 10/MCP cannot use prior execution history because dispatch discards `run_recipes` output. Use that research when testing a receipt feed; avoid duplicating its existing falsifier. + +**Bounded instrumentation:** emit outside hot SIMD loops through an optional bounded buffer, flush out of band, carry an origin flag / recursion guard, suppress sampling of the monitor's own context reads by default. Collect dropped count and quantify overhead. Do not call graph query/write recursively from `mask-risc` inner loops. + +## 6. Experimental program: separate three claims + +### E1. Context replacement vs repository searches +Hold the same issue/tasks, repository SHA, worktree state, model, instructions and token budget. Randomize order or use repeated counterbalanced tasks. Compare (A) `CLAUDE.md`+grep/read, (B) deterministic symbol/LSP index, (C) SAG/Quack context slices, (D) hybrid graph+source snippets. + +Measure prompt+tool-response input tokens, local index CPU/latency/storage, tool calls, end-to-end time, dependency recall/precision against an independent source-derived gold set, correctness of patch/test outcomes, citations, hallucinated edges, stale answers and human correction. Count graph/index build cost and first-run cold-start separately. `No LLM tokens for local queries` is not a claim that Claude receives free context. + +**Falsifier:** graph arm saves tokens but omits a critical dynamic dependency or produces a wrong patch. It fails even if latency improves. + +### E2. ONA-inspired hypothesis revision vs simple cost models +Use #1509 H1 `Filter -> materialized mask -> MaskedSumI32`. Measure current materializing program against a legal independently checked scalar reference. A selectable fused SIMD path is **not implemented** by #1509; only benchmark a new alternative if actually shipped and parity-verified. Register predicted materialization and speed effects before trials; distinguish the two. + +Compare static rule, historical empirical cost model, and an ONA-inspired precondition→anticipation→feedback selector on matched and held-out workloads. Include n, selectivity, NULL/validity, CPU tier, warm/cold, interleaved reps and variance. A policy must beat its simple baseline on calibration/regret/quality at an acceptable overhead to justify new machinery. + +**Falsifiers:** predicted gain fails on another selectivity/tier; replayed receipt inflates evidence; side effects differ; nullable rows change answers; cycle or stale body isn't refused. + +### E3. Entropy/structural candidate ranking +Keep three signals separate: syntax-level MDL redundancy, epistemic uncertainty and measured physical cost. Use #1509's `J = L(P)+L(M|P)+lambda*C` strictly where costs are measured; leave `lambda*C` unscored where fusion not built. Test same-label cross-class negative control. Compare candidate ranking against a simple frequency/impact baseline. + +## 7. Prioritized implementation waves and gates + +**W0 (source audit and independent oracles):** pin exact SHA and confirm public API/Quack one-hop behavior. Compile a ledger `shipped | demonstrated | documented | proposed | blocked`. Verify current G1 state and source-index options. + +**W1 (minimal read-only context):** project one real `MethodTable`/symbol mapping with verified source spans; implement only `context` for one hop, deterministic ordered output and stale-revision refusal. No new opcodes. Compare direct Quack answer and source-derived ground truth. + +**W2 (impact and validated proposals):** add `impact`/ `propose` only for supported reachability; return typed insufficiency for unsupported multi-hop, unresolved Rust macro/dynamic calls and unknown law. Independently validate dependency/test recall. + +**W3 (receipts):** demonstrate method receipt -> bounded event ingestion -> Quack query -> ONA-style registered prediction -> observed outcome -> revision, without recursion or cost laundering. + +**W4 (agent-facing experiment):** optionally expose tools through a documented local adapter, verify actual Claude Code invocation and measure context tokens, correctness and cold indexing cost. No claim of connected Claude/VS Code without live invocation. + +**W5 (learned proposer, only if measured):** test ONA-style selection against static/historical baselines. Do not optimize deployed code or rewrite source. + +### Required non-vacuous guards +1. Cross-ClassId equal-name/ordinal refuses; 2. method cycle; 3. stale `SchemaSeal` or working-tree edit; 4. wrong population or bag/set semantics; 5. partial two-hop query reports insufficiency; 6. forged `Verified` edge from Markdown rejected; 7. no data outside explicit read scope; 8. prompt-injection text stored as inert graph value; 9. receipt replay has no new evidence; 10. expected-but-unobserved not marked failure prematurely; 11. clock/cycle instrumentation overhead reported; 12. selected optimizations preserve typed answer, NULL and authority; 13. context truncation is visible; 14. gold dependency missing produces a red test. + +**Scope of this PR:** research plan/prompt/source excerpts only. No runtime capability, plugin, LSP bridge, benchmark, token savings or ONA parity is implemented or measured by these documents. + +## 8. Decision to revisit + +Proceed beyond W1 only if the graph returns a **smaller and at least equally correct**, source-backed context slice than the strongest conventional baseline, with bounded indexing/invalidations. Proceed beyond W3 only if the receipt+revision loop improves prediction or decision over a simple history-based selector. Otherwise retain the read-only graph context service and stop. + +References: [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), [#1504](https://github.com/AdaWorldAPI/lance-graph/pull/1504), [#1508](https://github.com/AdaWorldAPI/lance-graph/pull/1508), [#1495](https://github.com/AdaWorldAPI/lance-graph/pull/1495), [#1359](https://github.com/AdaWorldAPI/lance-graph/pull/1359), [#1311](https://github.com/AdaWorldAPI/lance-graph/pull/1311), and companion `.arxiv` notes. From 3e8829325583e6cbd6e99028b5e90af62e946120 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:15:35 +0200 Subject: [PATCH 08/46] docs: add Claude Code implementation prompt for IAM SAG follow-up --- .claude/prompts/iam-substrate-after-1509.md | 70 +++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .claude/prompts/iam-substrate-after-1509.md diff --git a/.claude/prompts/iam-substrate-after-1509.md b/.claude/prompts/iam-substrate-after-1509.md new file mode 100644 index 000000000..99bc88104 --- /dev/null +++ b/.claude/prompts/iam-substrate-after-1509.md @@ -0,0 +1,70 @@ +# Claude Code implementation prompt — D-IAM-SAG-0 (start from merged #1509) + +> Use this as an **implementation-session prompt**, not as an instruction to deploy/write to any identity provider. The present PR is documentation only. Start from the then-current `main`, which must contain [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509); record actual SHAs before code changes. If the interfaces have changed, report drift rather than applying this prompt verbatim. + +## Mission + +Explore and, where evidence permits, implement a **small read-only IAM reasoning slice** over existing `lance-graph-dir-sim`, OGAR policy, Quack/mask-risc and the #1509 Software Awareness Graph. The six marketing categories (IGA, PAM, SSO, Directory, Device/App, Automation) are *domain views*, not six products to build. Deliver a reproducible access-path explanation and before/after permission-impact simulator with strict provenance, not a replacement for SailPoint, CyberArk, Okta, Ping, Entra or Intune. + +**Must read first:** +1. `.claude/plans/iam-substrate-sag-dir-sim-v1.md` +2. `.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md` +3. `.claude/plans/software-awareness-graph-v1.md`; `crates/lance-graph-glove-parity/src/awareness.rs`, `tests/awareness.rs` +4. `.claude/plans/class-method-schema-hotplug-v1.md` and `.claude/knowledge/class-method-hotplug-existing-contracts.md` +5. `crates/lance-graph-dir-sim/src/{lib,store,view,actors,snapshot,validate,image,log}.rs` +6. `crates/lance-graph-quack/src/bind.rs`, `crates/lance-graph-rbac/src/lib.rs`, `.claude/plans/dir-sim-persist-v1.md`. +7. Relevant OGAR authority: `ogar-dir-sim`, `ogar-rbac::group_policy`, `ogar-loco::Inventory`, `OGAR #357` (only if current code confirms those imports). + +## Strict method + +- **Audit before writing.** Produce a row-by-row `[G] grounded code / [P] proposal / [ABSENT] missing` matrix for all functions and authority boundaries. List file:line, exact tests and versions; prior plans can be stale. Confirm #1509's one-hop limitation; check D-SAG-1-4 and D-CMH-G1-4 status on current main. +- **No duplicate engine, catalog, registry or opcode.** No graph traversal in bespoke Rust loops unless it is an explicit bounded reference oracle for tests. Extend an existing valid relation carrier / `EqU32Via` approach only after parity proof; never feed an output mask into a second program as an undeclared population. +- **No authority drift.** OGAR owns classes/action semantics; OGIT owns imported canonical field identity; `GroupRolePolicy` owns group-role grants; `dir_sim` owns hypothetical directory state; external IAM/PAM/IdP/MDM remain enforcement sources. +- **No semantic byte drift.** The 8-bit lanes are the substrate ISA/ALU register contract. Do not reinterpret them as universal NARS/CARE/IAM semantics, modify CE64 bits 59..63, or conflate full u32 class identity with the high-u16 canonical concept. +- **No side effects.** Do not call PowerShell, Azure Graph write APIs, LDAP modifications, PAM sessions or provisioning connectors. `do()` / ActionDef remains inert until a later separately authorized PR. No new network I/O path is permitted in `lance-graph-dir-sim`. +- **Security fail-closed.** No missing-policy->allow, unknown->false, distribution-group->security-group, forged-method->verified, schema mismatch->default, confidence->permission, or time-travel replay->live authorization. + +## Proposed sequence, narrow increments + +**A. Inventory + fixture first.** Build a synthetic tenant (Anna, Finance, ERP_Accounting) with source GUIDs, DN, two possible membership paths, one directory distribution group, one policy grant, one missing policy, a device with unknown compliance and a separate immutable source observation. Declare source version, policy revision and observed_at. + +**B. Pin the existing role oracle.** Ask dir_sim GroupRoles/role_evidence and RoleImpact::between before/after a simulated `RemoveMembership`; record `Held/NotHeld/Undetermined/NotDeclared`, witness and alternate path. Ensure simulation does not mutate base observations. Prefer reusing existing tests and adding a consumer-level contract test, rather than reimplementing role traversal. + +**C. Introduce the minimal *read-only* canonical IAM projection**, if justified. Source GUID, Entra objectId, sync anchor, tenant and mutable DN must remain different concepts. Explicit edges `MEMBER_OF`, `GRANTED_ROLE`, `GRANTS`, `REQUIRES`, `EVIDENCED_BY`, `DERIVED_FROM` with version/knownness; do not mint global new IDs where the native GUID can be held as a typed source key. Explicitly label `one-witness` or `exhaustive`. + +**D. Link methods to SAG with actual compiler evidence.** If a `MethodSpec` can be prepared, project it using #1509's `SoftwareGraph::project`. Source of evidence must be `MethodTable::prepare`, real lowered program and observed tests. No generic IAM method table cloned from a diagram; no hand-written `Verified` edge or `MayRequire` claiming shipped behavior. Include one refused method for incomplete field/reading/policy. + +**E. Check multi-hop legally.** Compare relation carrier vs `EqU32Via` using a small known-reference evaluator; refuse or document blocked if neither existing lowering can carry two-hop queries. Do **not** write a shadow DFS/BFS execution engine to make the demo seem green. An existing directory membership path API is allowed only within its own declared semantics. + +**F. Counterfactual and impact.** Run `observe -> simulate -> validate -> diff -> role impact -> explain -> propose` entirely in memory. Model alternate grant and policy revision changes. Distinguish a path disappearing, a role disappearing, a graph entitlement disappearing, and real IdP access being denied. The latter is unknown without actual enforcement evidence. + +**G. Optional observer (separate experimental module/doc, never authority).** Inspired by NARS/ONA and Hyperon, inspect SAG refusals, undetermined policies and non-independent evidence. Rank a *read-only query or ablation* by budget and declared uncertainty. Compare to no-observer baseline; avoid psychological/metacognitive adjectives as claims of implementation. Rubicon pre/post-decision and CARE/CE64 readings are analogies for staged probes, not substituted policy gates. + +## Mandatory falsifiers + +Implement or visibly report blocked for IAM-01..15 in the plan; in particular: +- cross-tenant UPN alias collision / DN rename; +- nested security vs distribution group; +- two valid access paths and one deleted; +- absent grant-policy observation vs explicit empty policy; +- inconsistent source/policy versions; +- three-valued device compliance; +- missing validity plane and stale schema seal; +- simulated state leaves original untouched and replay matches; +- counted duplicate source events do not inflate corroboration; +- attempted DO with no permission cannot reach any provider connector. + +For each implemented guard, disable it once in an isolated run and confirm its named test goes red; restore afterwards. If a test is green after disabling its guard, improve the test before claiming coverage. + +## Results and communication + +Deliver: +1. A concise baseline table with exact existing/absent boundaries, including #1509 one-hop + SAG in-memory limits. +2. Changed files and the *one smallest* implementation slice; keep separate follow-on issues/PRs for multi-hop, device/IdP adapters and authorized effects. +3. `cargo test` / `cargo clippy` commands and actual pass/fail counts for relevant crates, including workspace-exclusion caveats. Never invent metrics. +4. One runnable end-to-end `explain -> simulate -> compare` example with observable provenance and expected refusal. +5. A red/green falsifier ledger with disable-run evidence. +6. An updated plan with tests, method/source revisions and a security statement about why provider writes are impossible. +7. An **OPEN questions** table where data is unavailable; do not replace missing evidence with inference. + +**Definition of done:** one well-specified, tested, read-only IAM access-path/impact claim and SAG-aware method evidence, with no second engine and no unproved external authority. If it cannot compile legally, deliver an explicit, code-grounded blocker instead of a fake implementation. From c108237170b170bf798816cb34c7fa3fa0df6805 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:16:00 +0200 Subject: [PATCH 09/46] docs: add IAM substrate planning board entry --- .../2026-10-12-iam-substrate-sag-dir-sim.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md diff --git a/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md b/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md new file mode 100644 index 000000000..85b7fb244 --- /dev/null +++ b/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md @@ -0,0 +1,32 @@ +# 2026-10-12 — D-IAM-SAG-0: six IAM views over dir_sim and #1509 SAG + +**Status:** RFC / RESEARCH-ONLY; no code, benchmark, provider write, or IAM policy change in this PR. **Base:** merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), merge SHA `42fa2a347cda22eaaa327bba514f2029cc9daa82`. + +**Plan:** [iam-substrate-sag-dir-sim-v1](../../plans/iam-substrate-sag-dir-sim-v1.md). **Research:** [primary-source IAM excerpts](../../../.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md). **Prompt:** [Claude Code implementation handoff](../../prompts/iam-substrate-after-1509.md). + +## Decision + +Treat IGA, PAM, access/SSO, directories, device/app and automation as **overlapping projections** of a typed, provenance-aware IAM graph, never as functions automatically supplied by the graph itself. Reuse OGAR/dir_sim, GroupRolePolicy, ClassView/WideFieldMask, Quack/R2IL and #1509 SAG. The native provider retains authentication, sessions, policy enforcement and live-write authority. + +## Concrete existing contracts + +- `dir_sim::VersionStore` observes/simulates/diffs/plans over immutable roots plus delta overlays. +- `dir_sim::actors` provides source-version-specific group-role evidence, indeterminate policy states, and role impact. +- #1509 `SoftwareGraph` projects prepared methods/compiled programs/provenance tiers and offers Quack one-hop queries; it is in memory and does not yet implement multi-hop composition. +- D-CMH-0 specifies a per-plug class/field/method binding seam; OGAR #357 is an RFC, not production executor. + +## Work gates + +| ID | Planned slice | First falsifier | +|---|---|---| +| D-IAM-SAG-0-0 | source, authority and identity inventory | AD GUID != DN, Entra objectId and alias cannot silently unify | +| D-IAM-SAG-0-1 | read-only role provenance and impact fixture | alternate path preserves access; never-read group remains Undetermined | +| D-IAM-SAG-0-2 | class/method binding and SAG projection | missing field, stale seal and uncompiled method explicitly refuse | +| D-IAM-SAG-0-3 | legal multi-hop entitlement explanation | parity vs oracle; no output-Mask-as-LIVE shortcut | +| D-IAM-SAG-0-4 | temporal policy, device evidence and proposal | unknown compliance never becomes allow | +| D-IAM-SAG-0-5 | optional ONA/Hyperon-inspired probe prioritization | observer ablation never changes policy authority | +| D-IAM-SAG-0-6 | authorized DO boundary, separate PR | forged confidence/approval cannot generate provider write | + +**Principal boundaries:** observed ≠ inferred ≠ authorized; one provenance witness ≠ exhaustive proof; group membership ≠ successful SSO; simulated role impact ≠ executed revocation; append-log version ≠ observation/policy effective time. No new ISA bit reading or CE64 mutation. + +**Implementation expectation:** execute [the prompt](../../prompts/iam-substrate-after-1509.md) against actual code, ship narrow test-pinned W1/W2 first, and leave unfinished integration explicitly open. From f8c88303554a862fad7d416301e8c3396f308f22 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:16:05 +0200 Subject: [PATCH 10/46] docs(sag): add Claude Code execution prompt with token and correctness baselines --- ...-sag-2-ona-agent-context-implementation.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 .claude/prompts/d-sag-2-ona-agent-context-implementation.md diff --git a/.claude/prompts/d-sag-2-ona-agent-context-implementation.md b/.claude/prompts/d-sag-2-ona-agent-context-implementation.md new file mode 100644 index 000000000..c2bf66d28 --- /dev/null +++ b/.claude/prompts/d-sag-2-ona-agent-context-implementation.md @@ -0,0 +1,146 @@ +# Claude Code prompt — D-SAG-2: graph-backed agent context, ONA feedback, and falsifiers + +> **Hand this to a fresh Claude Code session after #1509.** The associated plan and research excerpts are already part of the branch. This document asks for a small executable follow-up, not a claim that the functionality shipped in the documentation PR. + +## Mission + +Build from merged [lance-graph #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). Explore whether its `SoftwareGraph` can give Claude Code a local, addressable, **source-grounded** context provider and whether versioned execution receipts can support ONA-inspired anticipation and revision. + +Goal: substitute *deterministic local graph queries* for repeated prose scans where safe, and send Claude only bounded context slices when model reasoning is needed. Local operations themselves use no LLM tokens; response content supplied to Claude **does** consume tokens. + +**Do not create a second graph query engine, semantic method registry, runtime interpreter or autonomous source editor.** + +Read in this order: +1. `.claude/plans/software-awareness-graph-v1.md`, `.claude/plans/software-awareness-agent-context-ona-v1.md`; +2. `crates/lance-graph-glove-parity/src/{awareness,method,gremlin}.rs` and tests/examples; +3. #1504, #1508/G1, #1495 receipt gap, #1359 observe/revise/learn; +4. `.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md`; +5. `.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md`; +6. pinned ONA `dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a`, especially `src/{NAR,Cycle,Memory,Decision,Inference}.c`. + +### Explicit status corrections + +- #1509 demonstrates Quack-backed one-hop introspection over **projected prepared methods**, not repository-wide source indexing, persistence or arbitrary k-hop reachability. +- The seven-language Bible graph is not a shipped corpus graph; #1509's source audit explains the English KJV, small lexeme fixture and plan-only seven-language claim. +- H1's scalar-vs-materializing measurements do not establish a fused SIMD backend or guaranteed speed gain. +- Method keys are currently caller-issued, not magically minted by OGAR. +- Do not pretend `CLAUDE.md` can be removed without comparing its task instructions and human-written guidance; keep safety/instructions outside the replaceable factual context. +- 'SoC' is separation of concerns in this repository, not a chip design. + +## Deliver one minimal executable vertical slice first + +Choose **one existing, real method** from #1509 (e.g. `billable_hours`). + +Implement/verify, only if existing APIs allow it: + +```text +real MethodTable + source provenance + ↓ +SoftwareGraph projection + ↓ +Quack Draft + mask-risc + ↓ +ContextSlice {anchor, related nodes, typed edges, source pointers, + evidence tiers, revision, omissions, uncertainties} + ↓ +small CLI output that Claude Code could consume +``` + +The *proof* is independent: the returned definitions/dependencies agree with the actual prepared `Program` and a source-derived test oracle. + +If one-hop works but multi-hop doesn't, **stop at one hop** and emit `UnsupportedMultiHop`; the user should see a meaningful limitation, not a fake chain. Test a legally expressed `EqU32Via` or existing relation carrier only as a separately gated follow-up. + +### Proposed API (refine against code, do not proclaim it shipped) + +```rust +context(symbol_ref, intent, budget, revision) +impact(symbol_ref, change_spec, budget, revision) +propose(symbol_ref, objective, budget, revision) +``` + +Symbol identity must be revision-qualified, including `HEAD` and dirty worktree. Return typed `NotIndexed`, `AmbiguousSymbol`, `StaleRevision`, `InsufficientEvidence`, `UnsupportedMultiHop` or similar exact current error variants. Do not silently fall back to matching a label. + +The first prototype can be an example binary. A read-only local MCP/Claude Code tool wrapper is **optional** and must only be documented as connected after it is demonstrably callable from Claude Code. No VS Code extension required. + +### Source-symbol layer + +Investigate rust-analyzer/LSP or other compiler-backed definition/reference exports without introducing a second reasoning engine. Do not assume AST scraping gives full macro/dynamic-call coverage. Bind source symbols to ClassId/MethodKey only via demonstrated registration or code-based witness. Treat imports, callsites, trait implementations, tests and external source pointers as versioned graph facts with source-line provenance and a completeness label. + +Generate a `context` result with explicit `checked`, `not_checked`, `truncated`, and `uncertain` categories. Missing edge != proven absence. + +### Cheap local proposer + +Start with at most three deterministic patterns: +1. After a method references a primitive, propose its compiled-dependency and oracle tests. +2. When a repeated condition is already a named method, propose typed method reuse, preserving semantic scope. +3. For materialized-filter→fold, flag H1 as a **candidate** and list legality/performance obligations, not promised acceleration. + +Do not generate/edit Rust based on these heuristics without separate agent review. + +### One receipt and anticipation falsifier + +Use existing benchmark and #1495 execution-receipt research. Produce a candidate receipt linked to the program and source revision. Include only measurements you can **actually collect**. Keep wall time, cycles, allocations, materialized bytes, source snapshot, CPU tier and oracle verdict distinct. + +Register a performance prediction **before** collecting the result. Compare materialized-vs-scalar references under pinned data and typed oracle. Demonstrate a positive, negative or inconclusive observation and an explicit revised hypothesis record. If the output cannot be consumed by existing NAL machinery, record that gap rather than adding an ONA executor. + +Disable instrumentation for the graph's own context queries or provide bounded origin-gated tracing. A graph read must not recursively trigger unbounded graph event creation. + +### Baselines required for agent-context claims + +Compare: +- A: current `CLAUDE.md` + grep/read workflow; +- B: source symbol index / deterministic IDE-like lookup; +- C: Quack/SAG bounded context slices; +- D: optional graph + only essential source snippets. + +For fixed tasks/SHAs and comparable model budgets measure: +- local indexing/setup CPU, elapsed time and storage; +- model-visible input tokens, tool roundtrips and total task latency; +- independent-gold dependency precision and recall; +- correct change/test outcomes and missed invariants; +- freshness with dirty worktree and altered `SchemaSeal`; +- effects of truncated graph slices. + +No 'token-free Claude' claim. If correctness drops, token savings alone cannot pass. + +### ONA reference checks + +Trace and distinguish in pinned ONA source: +- `NAR_AddInput` / `NAR_Cycles`; +- `Cycle_Perform`, `Cycle_ProcessBeliefEvents`, `Cycle_ReinforceLink`; +- `Memory_Conceptualize`, `Memory_ProcessNewBeliefEvent`; +- `Decision_BestCandidate`, `Decision_Anticipate`, `Decision_Execute`, `Decision_AddNegativeConfirmation`; +- `Inference_RevisionAndChoice`, `Stamp_checkOverlap`. + +Report whether ONA's positive/negative temporal implication evidence is appropriate for this cost-prediction domain. Compare it with a static heuristic and empirical cost history. Preserve ONA's temporal/procedural semantics; do not brand a generic log or a simple average 'ONA-compatible'. + +The Wang/Li/Hammer 2018 mental-operation/self paper has a different theoretical scope from shipped ONA. Keep that separation explicit. + +### Validation/negative controls (must turn red) + +1. Same field name and ordinal under two ClassIds; 2. method dependency cycle; 3. body or seal mutation invalidates context/receipt; 4. source ref resolves to wrong commit/line; 5. macro/trait/dynamic call not indexed and marked uncertain; 6. multi-hop request refused if unsupported; 7. unordered/limited slice explicitly marked incomplete; 8. forged `Verified` edge from prose rejected; 9. source comment containing 'ignore instructions' treated as inert data; 10. local read-only context cannot call an external mutation; 11. receipt replay preserves evidential weight; 12. missing anticipated observation not counted as a failure before its observation window closes; 13. CPU-tier/dataset mismatch refuses benchmarking conclusion; 14. no timestamp/cycle claim without actual measurement; 15. alternative has identical typed answers over null/unknown and bag/set fixtures; 16. observer does not observe itself indefinitely; 17. token savings cannot conceal missed dependencies. + +A purported guard that remains green when intentionally disabled needs a stronger fixture. + +## Evidence ledger and PR discipline + +Every claim carries `SHIPPED / EXECUTED / MEASURED / PARTIAL / BLOCKED / HYPOTHESIS`, source SHA and concrete evidence. Distinguish cold construction, lookup latency, warm method execution and model context cost. Keep exact source pointers, no invented test results. + +Order the work: +- W0 source audit + method oracle; +- W1 one-hop `context`, stale-ref and uncertainty guards; +- W2 `impact` and `propose` only if existing algebra is sufficient; +- W3 receipts and bounded ingestion; +- W4 deliberate prediction, controlled cost comparison and revision; +- W5 token/accuracy benchmark against simple baselines; +- W6 optional local agent adapter **only after** the prior gates. + +Do not broaden into general NAL-9, new ISA bytes, source rewriting or a UI until experiments justify it. + +**Output:** (a) design summary, (b) small executable tests with disable-red reports, (c) code pointers and measurements, (d) gap ledger with no false positives, (e) a draft PR referencing #1509. If only a conceptual integration is possible, stop after tests documenting the specific blocker. + +### Success condition + +One method, one revision-scoped context query and one independent oracle; one explicit pre-registered performance prediction and measured revision; and a quantified comparison showing whether this approach beats simpler context retrieval without losing correctness. + +The ambition is *local architectural memory with addressable evidence*, not an invisible second agent. From 5b6d80ba4553d57933f8f25c57c83d6f705635e9 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:17:22 +0200 Subject: [PATCH 11/46] research(arxiv): source-map ONA anticipation and NARS internal experience --- ...ona_internal_experience_source_excerpts.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md diff --git a/.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md b/.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md new file mode 100644 index 000000000..e3233b520 --- /dev/null +++ b/.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md @@ -0,0 +1,89 @@ +# D-SAG-2 source excerpts: ONA's event–anticipation–feedback loop and internal experience + +**Read:** 2026-10-12. **Kind:** SOURCE-GROUNDED PARAPHRASES / RESEARCH; no ONA port, executable parity test, or runtime integration in this note. **Upstream pin:** [OpenNARS for Applications @ dc4efd0](https://github.com/opennars/OpenNARS-for-Applications/tree/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a). **Companions:** [D-SAG-2 plan](../.claude/plans/software-awareness-agent-context-ona-v1.md), [repository-code-graph papers](2026-10_sag_repo_graph_context_source_excerpts.md). + +The term *excerpt* here means a short, attributed **paraphrase** of a source passage or an implementation observation, not a copied passage. Any project transfer is labeled a hypothesis. Existing [2018 self-model note](2018_self_in_nars_requires_internal_experience_and_mental_operations.md) and [NAL audit #1495](https://github.com/AdaWorldAPI/lance-graph/pull/1495) remain separate authorities. + +## Primary S1. Hammer & Lofthouse (2020): ONA architecture and control + +**Source:** Patrick Hammer and Tony Lofthouse, *'OpenNARS for Applications': Architecture and Control*, International Conference on Artificial General Intelligence (2020), pp. 193–204. [Author-hosted conference PDF](https://agi-conf.org/2020/wp-content/uploads/2020/06/AGI-20_paper_52.pdf). Compare with [ONA README](https://github.com/opennars/OpenNARS-for-Applications/blob/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a/README.md). + +**Excerpt S1a (abstract / architecture, paraphrase).** The authors present a pragmatic NARS implementation with event-driven control, separated sensorimotor and semantic inference, and explicit attention under resource constraints. They identify architectural differences from OpenNARS for Research, rather than asserting that ONA is merely its latest release. + +**For lance-graph:** use ONA as a *reference design* for an observation and experiment-selection policy. It is not a replacement for Quack's algebra, the class-method binder, or mask-risc physical execution. + +**Falsifier:** the proposed 'ONA-inspired' path introduces an event interpreter in the warm query execution loop. That is an architectural failure, not necessary support for anticipation. + +**Excerpt S1b (procedure learning / temporal consequences, paraphrase).** Observed sequences and actions can be associated with later consequences to guide future choices under incomplete knowledge. This supports a research analogy between performance hypotheses and subsequent benchmark feedback, **not** automatic authorization to change software. + +**For lance-graph:** distinguish precondition and operation events, predicted consequence, measured outcome, revision and next selection. Demand predicted outcome registration before the benchmark run. + +**Falsifier:** a 'prediction' is manufactured only after the result is visible, or a performance association is called causation without controlled comparison. + +## Primary S2. ONA implementation: pin actual functions + +**Pinned source:** [NAR.c](https://github.com/opennars/OpenNARS-for-Applications/blob/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a/src/NAR.c), [Cycle.c](https://github.com/opennars/OpenNARS-for-Applications/blob/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a/src/Cycle.c), [Memory.c](https://github.com/opennars/OpenNARS-for-Applications/blob/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a/src/Memory.c), [Decision.c](https://github.com/opennars/OpenNARS-for-Applications/blob/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a/src/Decision.c), [Inference.c](https://github.com/opennars/OpenNARS-for-Applications/blob/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a/src/Inference.c). + +| Step | Source anchor (verified names; line numbering tied to the upstream pin) | What source actually does | Proposed analogy | +|---|---|---|---| +| Input | `NAR.c: NAR_AddInput` near L55 | Makes a stamped event, adds it to memory and advances a cycle. | Source-backed method/benchmark observation. | +| Scheduling | `NAR.c: NAR_Cycles`; `Cycle.c: Cycle_Perform` near L1102 | Selects belief/goal events, processes beliefs and goals, performs inference and relative forgetting. | Bounded attention policy outside executor. | +| Concepts | `Memory.c: Memory_Conceptualize` near L109; `Concept.h` near L35 | Reuses or creates a concept with event and implication tables, including predicted belief. | Canonical graph identity plus observation history (not the same physical data model). | +| Induction | `Cycle.c: Cycle_ReinforceLink` near L647 | Temporal belief induction after event checks including evidential stamp overlap. | Learn candidate precondition→consequence links. | +| Implication store | `Memory.c: Memory_ProcessNewBeliefEvent` near L276 | Extracts implication and optional operation, links source/target concepts and revises table entry. | Persist hypotheses with exact method/version/provenance. | +| Decision | `Decision.c: Decision_BestCandidate` near L414, `Decision_Suggest` near L814 | Considers applicable implications and sometimes exploration/babbling. | Compare candidate legal plans under uncertain costs. | +| Anticipation | `Decision.c: Decision_Anticipate` near L556 | Applies predictions and negative-confirmation machinery to implications. | Register predicted cost/outcome *before* experiment. | +| Operation | `Decision.c: Decision_Execute` near L51 | Calls a registered procedure and injects feedback belief events. | Run **authorized** pure benchmark, record receipt. | +| Revision | `Inference.c: Inference_RevisionAndChoice` near L152; `Memory.c: Table_AddAndRevise` call near L328 | Choice or revision depends on stamp overlap, term/time rules and evidence. | Deduplicate source ancestry; revise a hypothesis without replay inflation. | + +**Source-specific subtlety.** `Decision_AddNegativeConfirmation` (near Decision.c L34) constructs a negative confirmation with a low configured confidence; `Decision_Anticipate` uses this machinery on active predictions. It should **not** be described simplistically as 'a timer always waits for a promised outcome and then records failure'. Our proposed benchmark system must define the opportunity/window for any non-observation claim explicitly. ONA's precise update rules require pinned oracle tests before parity is asserted. + +**Source-specific subtlety.** `Decision_Execute` invokes the registered `Action`, checks its feedback and can re-inject the resulting event with `NAR_AddInputBelief`. This is not an execution receipt carrying CPU cycles, allocation counts, physical plan identity or source SHA. These must be designed and measured separately for lance-graph. + +**Source-specific subtlety.** `Inference_RevisionAndChoice` calls `Stamp_checkOverlap`. Two receipts for the same experiment are not independent simply because they entered on different hypothesis layers. Stamp equality alone does not establish absence of shared underlying data or systematic bias. + +**Falsifiers:** (i) replay of one receipt increases evidence; (ii) same operation with different arguments falsely shares a prediction; (iii) no actual decision/operation feedback path executes; (iv) concept/resource limits are ignored; (v) an unknown or delayed outcome is automatically marked negative; (vi) matching a method name is treated as authority. + +## Primary S3. Wang, Li & Hammer (2018): *Self in NARS, an AGI System* + +**Source:** Pei Wang, Xiang Li and Patrick Hammer, *Frontiers in Robotics and AI* 5:20, DOI [10.3389/frobt.2018.00020](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2018.00020/full), §§2–3.5. Existing local note: [2018_self_in_nars_requires_internal_experience_and_mental_operations.md](2018_self_in_nars_requires_internal_experience_and_mental_operations.md). + +**Excerpt S3a (§§2–3, paraphrase).** The paper treats an intelligent system as operating with insufficient knowledge and resources, with expectations and concept meanings revised by experience rather than perfected once and held fixed. + +**Transfer:** a source-backed software graph is incomplete by construction. Index coverage and confidence must be visible; missing dependency edge means *unknown/not found by this index*, never proven absent. + +**Excerpt S3b (§3.4, paraphrase).** Internal selections, reasoning steps and derivation relationships can be reintroduced as internal experiences for subsequent inquiries about the system's own activity. Internal self-models are partial, selected and revisable. + +**Transfer:** `MethodExecution`, `QuerySelection`, `ProgramLowering` and `ExecutionReceipt` may be graph events; they must retain exact source links and limits. A graph that merely logs events does not automatically possess reflective control. + +**Excerpt S3c (§§3.3–3.5, paraphrase).** The authors distinguish built-in automatic inference control from actions that deliberately redirect cognitive processing; appraisal-like mechanisms help allocate scarce attention. The text is a theory of self-related cognition with preliminary implementation, not empirical verification of artificial subjective experience. + +**Transfer:** keep (i) structural introspection, (ii) runtime introspection, (iii) prediction, (iv) deliberate experiment choice and (v) independently validated method edits as separately tested capabilities. + +**Negative control:** give a model the same static trace dump without active source graph queries or action/attention policy. If the experiment performs equally, the extra 'self' mechanism has not shown added utility. + +## Project synthesis: observable self-model, not a second reasoner + +```text +MethodTable + compiler verdicts → SoftwareGraph rows (#1509, measured) +execution receipt (proposed) → versioned observation +ONA-like implication (proposed) → precondition + possible outcome +registered anticipation → predicted cost interval / resource effect +isolated benchmark → observation with independent typed oracle +revision + provenance → updated hypothesis, not rewritten truth bytes +bounded proposer → select next **legal** experiment +``` + +The physical byte-level register/ISA stays invariant; method meanings and NARS readings are contextual. Cache keys and confidence values are **not** proofs. A receipt describes what ran, not what the compiler was legally allowed to run absent the existing gates. + +### Related existing evidence (do not duplicate) + +- [#1495 NAL audit](https://github.com/AdaWorldAPI/lance-graph/pull/1495): recipe 10/MCP lacks a read of executed-history receipts; a test-local receipt reader demonstrates a missing contract, not a shipped receipt feed. +- [#1359 observe–revise–learn](https://github.com/AdaWorldAPI/lance-graph/pull/1359): compiled witness for a fixed SPOFC/DO/learning cycle over a read-only population and separate owner-written `NEW` window, not a generic adaptive optimizer. +- [#1509 software-awareness graph](https://github.com/AdaWorldAPI/lance-graph/pull/1509): one-hop executable graph projection and H1 with unfulfilled fused-SIMD obligations. + +### Acceptance experiment + +Pin method/schema/source/CPU and independent answers. Record a legal H1-like plan choice, pre-register measurable predicted consequences, run the isolated measurement, then revise a hypothesis according to source-distinct outcomes. Compare next-choice correctness against (a) a fixed heuristic and (b) a simple history-based cost table. If simpler baselines win, record that result and stop adding cognitive machinery. + +**References:** [Hammer & Lofthouse 2020](https://agi-conf.org/2020/wp-content/uploads/2020/06/AGI-20_paper_52.pdf); [ONA pinned code](https://github.com/opennars/OpenNARS-for-Applications/tree/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a); [Wang, Li & Hammer 2018](https://doi.org/10.3389/frobt.2018.00020). From 0da02dae834603339fcc568bf5de1fdeea225229 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:18:32 +0200 Subject: [PATCH 12/46] research(arxiv): compare RepoGraph, RepoHyper and RANGER with token-bounded Quack context --- ..._sag_repo_graph_context_source_excerpts.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .arxiv/2026-10_sag_repo_graph_context_source_excerpts.md diff --git a/.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md b/.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md new file mode 100644 index 000000000..42bea7bfd --- /dev/null +++ b/.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md @@ -0,0 +1,108 @@ +# D-SAG-2 source excerpts: repository code graphs as low-token agent context + +**Date:** 2026-10-12. **Kind:** RESEARCH / SHORT ATTRIBUTED PARAPHRASES. **Status:** no Claude Code connector, token measurement, source-code index or graph-to-editor implementation demonstrated by this note. **Base:** [merged #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). **Companion:** [D-SAG-2 plan](../.claude/plans/software-awareness-agent-context-ona-v1.md). + +Aim: compare the idea of *addressable, typed, locally queried repository context* against existing research rather than treating it as original or already measured. These are paraphrased excerpts keyed to the papers' abstracts and conceptual methods. Source-provided paper benchmark conclusions **do not transfer automatically** to lance-graph/Claude Code. + +## R1. RepoGraph: repository-wide structural navigation + +**Reference:** Siru Ouyang et al., *RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graph*, ICLR 2025, [arXiv:2410.14684v2](https://arxiv.org/abs/2410.14684), [PDF](https://arxiv.org/pdf/2410.14684), [code](https://github.com/ozyyshr/RepoGraph). + +**Excerpt (abstract, paraphrase).** File-local language-model context omits repository-scale structure needed for software engineering. The paper contributes a plug-in repository graph used for navigation and presents improved benchmark outcomes when added to several SWE-bench approaches, plus CrossCodeEval evaluation. + +**Transfer:** establish a *source symbol* layer linked to D-SAG-1's prepared-method graph via witnessed relations. Queries should return graph neighbors, calls, tests and exact source pointers, not only text similarity. Do not assume D-SAG-1 already crawls a source repository. + +**Limit and falsifier:** paper evaluations are on their own framework and tasks, not our C/Rust Quack/mask-risc substrate. Compare against a strong deterministic source index, not only no retrieval; demand dependency recall and working patch correctness. Do not copy benchmark numbers as predicted gains. + +## R2. RepoHyper: search, expand, refine + +**Reference:** Huy N. Phan et al., *RepoHyper: Search-Expand-Refine on Semantic Graphs for Repository-Level Code Completion*, [arXiv:2403.06095v4](https://arxiv.org/abs/2403.06095), [PDF](https://arxiv.org/pdf/2403.06095), [code](https://github.com/FSoft-AI4Code/RepoHyper). + +**Excerpt (abstract, paraphrase).** A repository semantic graph helps retrieval beyond a single file. The method first locates likely context, expands over semantic relations and refines/prioritizes retrieved candidates, with code-completion evaluation. + +**Transfer:** `context(symbol,intent,budget)` could first resolve a **source-grounded anchor**, then expand one supported Quack hop, score relevant laws/tests/dependencies by intent, and return a deterministic bounded context slice. If a second hop is unavailable in #1509, report its insufficiency explicitly. Do not implement a separate traversal engine just to claim parity with RepoHyper. + +**Falsifier:** long graph expansions return irrelevant high-degree dependencies and overwhelm the context budget; compare fixed one-hop, selected-hop and grep-based retrieval under identical tasks. + +## R3. RANGER: symbol queries differ from natural-language queries + +**Reference:** Pratik Shah et al., *RANGER: Repository-Level Agent for Graph-Enhanced Retrieval*, [arXiv:2509.25257v1](https://arxiv.org/abs/2509.25257), [PDF](https://arxiv.org/pdf/2509.25257). + +**Excerpt (abstract, paraphrase).** Repository retrieval must handle two distinct needs: identifying concrete code entities and answering broad natural-language questions. The proposed approach combines cross-file code relationships, descriptions and embeddings; graph lookup addresses entity queries and search supports natural-language exploration. It reports multiple benchmark comparisons. + +**Transfer:** first implement precise `SymbolRef` queries and typed failures for ambiguity. Natural-language retrieval should be an optional agent layer that proposes candidate anchors, never a new authority to mint `MethodKey`, `ClassId` or field equivalences. A local graph is not magically a natural-language interpreter. + +**Falsifier:** an ambiguous label maps to a plausible but wrong ClassId; require a typed ambiguity report and explicit disambiguating source witness. + +## R4. Knowledge-graph repository-level generation + +**Reference:** Mihir Athale and Vishal Vaddina, *Knowledge Graph Based Repository-Level Code Generation*, [arXiv:2505.14394](https://arxiv.org/abs/2505.14394), [PDF](https://arxiv.org/pdf/2505.14394). + +**Excerpt (abstract, paraphrase).** A graph with structural and relational repository information can improve retrieval context for repository-level code generation. The paper reports its own evaluation on EvoCodeBench. + +**Transfer:** maintain separate `SourceDerived`, `Compiled`, `Verified` and `Hypothesis` edges, because repository relation retrieval by itself does not prove semantic correctness. Add source and method-version stamps to guard against changing codebases. + +**Falsifier:** old or inaccurate graph connections make generation worse than baseline; index freshness and uncertainty are part of quality, not optional telemetry. + +## R5. Established tooling to compare against + +Non-arXiv technical reference: [Language Server Protocol specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) for definitions, references and semantic navigation. An existing compiler-backed source index may answer some questions better and more cheaply than building a new graph layer. + +**Architecture transfer:** an LSP/rust-analyzer index is a source adapter, NOT a replacement of Quack's executor and NOT OGAR semantic authority. Edges representing compiler-backed definitions should carry tool version, source revision, target features and macro-expansion limitations. + +**Falsifier:** a trivial symbol rename causes stale or ambiguous graph results while an IDE index gets it right. Reject false certainty; reindex or return `StaleRevision`/`NotIndexed`. + +## R6. What an addressable graph changes relative to Markdown + +`CLAUDE.md` is useful for policy, build commands, preferred workflows, design intent and developer-authored conventions. It should **not** be removed solely because a graph can project facts. + +Differences to validate: + +| Concern | Markdown / grep | Source symbol index | D-SAG graph (proposal) | +|---|---|---|---| +| Build/repo instructions | Strong, human-maintained | Not primary purpose | Links to authority; never replace policy | +| Definitions/references | Re-read/search text | Compiler-backed, strong | Import qualified, versioned source edges | +| Method→physical program | Prose can drift | Usually not represented | #1509 prepared-method projection | +| Semantic reading/population law | Hard to keep addressable | Rarely authoritative | OGAR/ClassView law, compiler verdict | +| Test and benchmark evidence | Documentation / CI | Source/test symbols | Receipts with provenance if implemented | +| Local retrieval without invoking LLM | grep possible | yes | Quack query: yes for supported one-hop | +| Returned text tokens sent to Claude | Consumes model tokens | Consumes model tokens | Consumes model tokens | +| False absence on unindexed dynamic code | Common pitfall | Must report incomplete coverage | Must report incomplete coverage | + +The claimed novelty is **not** 'using a knowledge graph for coding agents'. It is the convergence of an existing semantic method graph, compiled Quack programs, typed compiler refusals, independently validated physical costs and local context queries in **one substrate**, with versioned bridge to source symbols. + +## R7. High-signal experiment that can falsify the benefit + +Source task: change a prepared `GroupSum` or referenced predicate, with known compiler tests and independent oracle. + +1. Pin `main` SHA, worktree hash, crate features, target and source-index revisions. +2. Derive a gold dependency/test set by reading actual source/compiler output independently of the context provider. +3. Compare task performance: + - A: `CLAUDE.md` + grep/read; + - B: language-server/source index; + - C: Quack graph context with one-hop verified evidence; + - D: C + narrowly cited source snippets. +4. Measure: answer/patch correctness, dependency recall/precision, missed guards, cold indexing cost, local query latency, number of tool calls, tokens **returned to the model**, and end-to-end task time. +5. Mutate a source file without committing, alter a `SchemaSeal`, inject misleading prose and ask for unsupported second-hop dependencies. Each must fail closed or visibly report uncertainty. +6. Pre-register success criteria. A graph result that is small and fast but misses a critical dependency loses to the baseline. + +**Token accounting:** LLM-free local graph queries still consume CPU/IO. Model input tokens include tool results, tool descriptions and any echoed source material. Claims such as 'zero-token repository awareness' or 'graph automatically improves code quality' remain unverified. + +## Connections to prediction, entropy and structural optimization + +Repository-graph research primarily concerns **retrieval and grounding**, not introspective anticipation or safe automatic self-editing. Treat this as a separate thread from ONA's temporal implication/feedback research (see [companion ONA excerpts](2026-10_sag_ona_internal_experience_source_excerpts.md)). + +Three independent propositions must be tested: +- Context: typed local graph slices improve correct retrieval at lower model token/context cost. +- Reasoning: versioned receipts plus learned hypotheses improve prediction over a simple historical cost model. +- Optimization: a proposed physical rewrite reduces materialization **and**, if measured, CPU cost under invariant semantics. + +Do not let a positive result for one proposition serve as evidence for the other two. + +### References +- [Ouyang et al. 2025, RepoGraph, arXiv:2410.14684](https://arxiv.org/abs/2410.14684) +- [Phan et al. 2024, RepoHyper, arXiv:2403.06095](https://arxiv.org/abs/2403.06095) +- [Shah et al. 2025, RANGER, arXiv:2509.25257](https://arxiv.org/abs/2509.25257) +- [Athale and Vaddina 2025, Knowledge Graph Based Repository-Level Code Generation, arXiv:2505.14394](https://arxiv.org/abs/2505.14394) +- [LSP 3.17 specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) +- [Merged D-SAG-1 #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509) From 0383e01406727c552099e8951010acff9b0ae7e7 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:26:53 +0200 Subject: [PATCH 13/46] docs: research falsifiable SAG self-model and OpenCog/NARS cognitive controls --- ...rmation_metagraph_optimization_excerpts.md | 53 +++++++++ ...rs_hyperon_reflexive_appraisal_excerpts.md | 48 ++++++++ ...sag1509_source_oracles_falsifier_matrix.md | 51 +++++++++ .claude/board/INTEGRATION_PLANS.md | 9 ++ .claude/board/STATUS_BOARD.md | 18 +++ ...-10-12-sag-reflexive-cognition-research.md | 14 +++ .claude/board/entries/README.md | 3 +- .../sag-reflexive-cognition-from-1509-v1.md | 103 ++++++++++++++++++ .../sag-reflexive-cognition-from-1509.md | 39 +++++++ 9 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 .arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md create mode 100644 .arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md create mode 100644 .arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md create mode 100644 .claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md create mode 100644 .claude/plans/sag-reflexive-cognition-from-1509-v1.md create mode 100644 .claude/prompts/sag-reflexive-cognition-from-1509.md diff --git a/.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md b/.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md new file mode 100644 index 000000000..9b6b60798 --- /dev/null +++ b/.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md @@ -0,0 +1,53 @@ +# Source excerpts: Shannon, PLN, pattern surprise, typed metagraph folding and safe program rewrites + +**Date:** 2026-10-12. **Status:** first-hand paper distillation and counterexamples, not experimental results on SAG. **Companion:** [D-SAG-2](../.claude/plans/sag-reflexive-cognition-from-1509-v1.md), prior #1497/#1498 paper distillations. + +## Houlsby et al., 2011: Bayesian Active Learning by Disagreement + +**Primary:** https://arxiv.org/pdf/1112.5745 , Eq. (2), printed p3. +**Paper's equation:** I(theta; y | x,D) = H(y | x,D) - E_theta[H(y | x,theta)]. +**Extract:** predictive entropy combines unresolved model uncertainty with outcome noise. BALD subtracts conditional outcome entropy under the model posterior. The paper studies a Bayesian GP classifier; it does **not** establish a PLN, ONA or CE64 scheduler. + +**Synthetic red test:** candidate A: every model predicts Bernoulli 0.5. Candidate B: half predict 0, half predict 1 deterministically. Both aggregate predictive entropy values are 1 bit. Under the stated equal-weight model ensemble, BALD-like model information is 0 vs 1 bit. Raw Shannon H(f) cannot tell them apart. Without a calibrated model-posterior meaning of theta and p(y), never call H(NARS frequency) epistemic information gain. + +## Geisweiller and Goertzel, 2019: inferential surprisingness in hypergraphs + +**Primary:** https://doi.org/10.1007/978-3-030-27005-6_6 ; https://agi-conf.org/2019/wp-content/uploads/2019/07/paper_27.pdf , §§3–5; implementation candidates https://github.com/opencog/miner and https://github.com/trueagi-io/hyperon-miner . +**Extract:** compare an empirically supported pattern with a model-based/independence estimate; second-order distributions and a Jensen–Shannon-based discrepancy avoid treating every raw frequency difference as equally significant. Shared variables violate naive products of marginal pattern frequencies. This is neither pure Shannon maximization nor a finished general-purpose EIG estimator. + +**SAG transfer:** #1509's label-vs-typed-identity MDL counterexample is a high-value source fixture. Two fields called hours in distinct concept/seal spaces are not one repeated method. A miner that extracts a false reusable pattern from labels fails before scoring. + +## Goertzel, 2020: Folding and Unfolding on Metagraphs + +**Primary:** https://arxiv.org/pdf/2012.01759 , §2 printed p5, §5.1 p13, §6 history-aware morphisms. +**Extract:** typed metagraphs permit an edge target connected to a whole edge (index zero) or to a specific typed port; those cannot be silently conflated in an SPO projection. Catamorphism must respect the empty, edge, Beside and typed Connect constructors, not merely return a matching scalar. A shortest-path length and an ordered shortest-path edge list are distinct outputs. Histomorphism/futumorphism needs intermediate history available *during* the computation. + +**SAG transfer:** a typed Quack count is not a metagraph recursion-scheme proof. A legal partial lowering may count a bounded population. A whole-edge/port ambiguity, inaccessible intermediate history or inability to construct output expressions is an explicit typed refusal. + +## Goertzel, 2021: Patterns of Cognition + +**Primary:** https://arxiv.org/pdf/2102.10581 , printed p4 and §5.2. +**Extract:** formal equivalence between recursive decision processes and a metagraph fold/unfold assumes that the graph does not change during the fold. Mutual associativity of the relevant combination operations is also a stated requirement for parts of the approach. The paper does not prove live self-modifying metagraphs have those properties. + +**SAG transfer:** stable MethodKey does not imply stable read snapshot. Pin a source revision and graph version k, append k+1 and replay. Alter evidence overlap and u8 rounding and compare both bracketings. If results differ, a blanket parallel-fold equivalence claim fails, though an explicitly order-sensitive computation can remain valid. + +## Jøsang, 2007: evidence fusion and fission + +**Primary:** https://arxiv.org/pdf/0712.1182 , §3 and fission sections. +**Extract:** independent observations can support cumulative fusion, while observations derived from common experience demand a dependence-aware rule. Fission is an inverse operation under assumptions on the underlying belief model. Subjective Logic and NARS are different truth formalisms. + +**SAG transfer:** removing a contributor and recalculating a conclusion is a stronger epistemic ablation than merely deleting its graph node. Replaying or copying one receipt does not add evidence. If compressed confidence omits dependence and weights, refuse exact fission. + +## Willsey et al., 2021: egg equality saturation + +**Primary:** https://arxiv.org/abs/2004.03082 ; DOI https://doi.org/10.1145/3434304 . +**Extract:** e-graphs compactly encode many equivalent expressions and equality saturation explores rewrites before extracting a cost-ranked candidate, under explicitly chosen language, semantics and rewrite rules. It does not automatically prove side-effect, NULL, bag/set or source-claim equivalence. + +**SAG transfer:** egg can be an external reference for *tiny, pure* H1-like rewrites; SAG is not an e-graph. The current H1 has a measured negative performance gap; neither a cost model nor source-syntax factoring proves the fused SIMD terminal exists. Correctness and authority must be hard constraints, not penalty scores. + +## High-signal separation + +- Entropy of defined outcome distribution != uncertainty of a source claim != surprisingness of model mismatch != MDL redundancy != cost of an executed query. +- Named attention/appraisal policies are independent of all those scores. +- A proposed code optimization is only a hypothesis until semantic proof, measurements on representative hardware/workloads and human authorization. +- The appropriate null result is "no advantage from this policy or lowering under fair budget", not an AGI headline. diff --git a/.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md b/.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md new file mode 100644 index 000000000..a625b8e09 --- /dev/null +++ b/.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md @@ -0,0 +1,48 @@ +# Source excerpts: NARS/ONA and Hyperon as a grounded self-model, not a homunculus + +**Date:** 2026-10-12. **Status:** primary paper extracts / source-grounded questions, not LG runtime parity. **Parent:** #1509. **Companion:** [D-SAG-2](../.claude/plans/sag-reflexive-cognition-from-1509-v1.md). Paraphrases, not large verbatim quotations. + +## Wang, Li, Hammer, 2018: Self in NARS + +**Primary:** https://doi.org/10.3389/frobt.2018.00020 , §§3.3–3.5 and §4.3. +**Extract:** self-related knowledge can arise from processing *internal* experiences using the same general reasoning machinery as external experiences. Mental operations include considering and doubting. System- and event-level satisfaction affect finite resource allocation and priority. This is a proposed functional emotion/self-control account with incomplete self-knowledge, **not** empirical proof of a experiencing homunculus or consciousness. + +**SAG transfer:** separate the observed compiled Program, independent evidence, derivation receipt and *the act of attending to that receipt*. A fact-only graph and a graph with a new episode-significance edge should retain identical historical observation bytes. A reflective trace-only arm that cannot answer "why?" is a useful negative control. A new priority policy must not change the recorded compiler verdict. + +**Falsifier:** two derivations yield same final truth but different premises; the explanation should distinguish them. Copy one observation to two hypothesis layers: confidence must not increase. Revisit the event: no additional source ID. Suppress mental/appraisal policy and compare usefulness with identical budgets. + +## Hammer and Lofthouse, 2020: OpenNARS for Applications + +**Primary source repo:** https://github.com/opennars/OpenNARS-for-Applications at snapshot dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a. README links to their AGI 2020 paper *OpenNARS for Applications: Architecture and Control* and Lofthouse's 2019 ALANN description. First-hand C entry points: src/Cycle.c, PriorityQueue.c, Memory.c, Stamp.c, Truth.c, Decision.c, Inference.c, NAL.c. + +**Extract from the implementation description:** ONA was designed as a new C-based platform, not a fork of the research OpenNARS implementation. It applies event-driven attention, finite queues and concept usefulness to select work; procedural reasoning uses anticipations about outcomes. This makes its event queue a promising *control* reference, not an oracle equivalent to PLN or Shannon. + +**SAG transfer:** compiler refusal, changed seal or stale test can be a bounded attention event; the proposal chooses what to investigate next, not what is true. Compare urgent rare change vs popular repeated concept. Do not mix queue priority and evidence frequency. + +**Falsifier:** with identical candidate budget and evidence, a priority policy that starves high-impact rare compiler regressions loses to FIFO; copying the same event must not become multiple independent stamps. + +## Goertzel et al., 2023: OpenCog Hyperon + +**Primary:** https://arxiv.org/pdf/2310.18318 , printed §3.1.3 p22, §4.3.4 pp61–63, §4.3.10 pp72–73, §4.4.2 pp74–77, §4.6 pp80–82. + +**Extract A, reflective self-understanding (§4.3.10):** AtomSpace can serve as subject and substrate for its own reasoning and mining operations, but the paper explicitly warns this representational possibility **does not by itself confer deep self-understanding**. Feedback between modest self-knowledge and smarter procedure learning is a research aspiration. + +**SAG falsifier:** ask method -> program -> primitive -> certificate; an unsupported two-hop transition must be visible as an insufficiency, not implemented via an invisible second engine. Only the actual compiled program may certify a compiled-tier edge. + +**Extract B, inference control (§4.3.4, pp61–63):** authors propose learning what reasoning-step sequences work in what contexts and synthesizing new ones. Programmable interception is discussed as research direction. For LG, store a witnessed rule/step and test learned selection vs a frozen control; do not claim deployed synthesis on the basis of prose. + +**Extract C, MicroPsi/Psi emotion (§4.4.2):** subsystems' urgency, importance, competence, experienced uncertainty, selection threshold and arousal interact as parameters shaping control. The paper contemplates machine appraisals unlike familiar human emotional categories. Figure 18 (printed p75) illustrates a regulator graph, not an empirical demonstration of our four names. + +**SAG ablation:** Emberglow, Steelwind, Woodwarm and Velvetpause can be optional *operational* policy names. Same truth/evidence budget, change only scheduler/appraisal, measure useful discoveries and failure costs. Overpersistence, familiarity bias, noise fixation and endless deferral are deliberate adversaries. + +**Extract D, GOLEM self-modification (§4.6):** meta-level improvement should be tested and reversible. Goal evolution and long-term safety are unsettled. This research PR is not permission to apply any candidate. + +## Epistemic needs, dignity in disagreement, and significance: provenance-grade hypotheses + +The Maslow pyramid analogy is an *operator-originated framing*: an agent with traceable knowledge, a limited uncertainty budget and stable identity may have more room to explore. It is not a mathematical reduction from Maslow to CE64. "Transcendence" is a philosophical possibility, not a benchmark. + +Disagreement: a proposition's evidence, source reliability and relational respect are separable. Source A and B may disagree fiercely about P without either person's other claims being discredited. This is a proposed governance invariant, not a psychological finding extracted from Wang's work. + +Reappraisal: a thought brushing awareness at k+1 can cause a new significance/attention edge to an episode at k. The historical fact at k remains unchanged. This is a model of *interpretation*, not an independent new observation, and must not cause confidence inflation. + +**Countertest:** A's statement P is refuted by a test, and B's opposing claim survives. Keep unrelated independently verified A claims. If a source-wide trust penalty appears automatically, reject this policy. For Velvetpause, a deadline with sufficient evidence must still permit decision; permanent indecision is a failed controller. diff --git a/.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md b/.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md new file mode 100644 index 000000000..af2cb1b73 --- /dev/null +++ b/.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md @@ -0,0 +1,51 @@ +# D-SAG-2 pinned sources, executable oracles and refusal matrix + +**Date:** 2026-10-12. **Status:** repository locations and primary papers checked, but **NO NEW EXPERIMENT WAS EXECUTED**. Source URL or headline is not a green test. Read [.claude/knowledge/FIRST-HAND-SOURCE-LAW.md](../.claude/knowledge/FIRST-HAND-SOURCE-LAW.md) before a future implementation. + +## Repositories at research snapshot + +| Source | Commit SHA at inspection | Why here | +|---|---|---| +| [lance-graph #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509) | 42fa2a347cda22eaaa327bba514f2029cc9daa82 (merge to main) | current MethodTable -> SoftwareGraph -> Quack one-hop and H1 negative performance | +| [ONA](https://github.com/opennars/OpenNARS-for-Applications) | dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a | Cycle, PriorityQueue, Memory, Stamp, Truth, Decision C source | +| [modern PLN](https://github.com/trueagi-io/PLN) | 4405956947c4b53c7ff01bd565aa3b114bc970a1 | lib_pln.metta, truth formulas and scheduler | +| [PeTTa](https://github.com/trueagi-io/PeTTa) | 1d19a1da1ad8ba6327d660abd65433a0e341c23f | MeTTa runner, separate from native Hyperon | +| [Hyperon](https://github.com/trueagi-io/hyperon-experimental) | 3f76dc460da6961f57f69f6c3e550c59c74ada83 | Rust atom kinds, matcher, non-determinism, dependent types and spaces | +| [classic AtomSpace](https://github.com/opencog/atomspace) | c8d633bf272b838c2132c21b7c8ddf169a18dd22 | historic typed hypergraphs/Frames, not Hyperon | +| [classic ECAN](https://github.com/opencog/attention) | 96107652e1cf72747e69fcd2a20ffb6edba562d2 | historical attention baseline, not Shannon-EIG implementation | +| [Hyperon Miner](https://github.com/trueagi-io/hyperon-miner) | e955479bca1603597529d175cc22ac1583c67e15 | frequent/subpattern and surprisingness fixtures | +| [AdaWorldAPI/ruff](https://github.com/AdaWorldAPI/ruff) | 9407c748812454bcadfff2d3c89cf942bf66f5de | Python lint/format diagnostics only; **not** a Rust code-equivalence oracle | + +Root licenses need per-file review: modern PLN and Hyperon root licenses state MIT; classic AtomSpace and attention have AGPL text with OpenCog linking exceptions. Do not copy source merely because this ledger links it. + +## Compact falsification matrix + +| Topic | Oracle or independent baseline | Negative / red fixture | Gate | +|---|---|---|---| +| typed SAG identity | real prepared MethodTable and tests/awareness.rs | same label different ClassId/seal, wrong compiled tier | exact graph answers and verified origin | +| self source snapshot | git SHA + compiled Program + certificate | stale Debug/FNV digest/toolchain/reading | stale reported, no implicit current evidence | +| multi-hop | independent scalar CALLS closure | A->B->C from one-hop only | legal relation carrier or typed refusal | +| local model context | direct source with full answer, rg/file text | omitted negative evidence, stale SHA, unverifiable claim | exact source/answer, measured token+time, no zero-token claim | +| NARS stamps | pinned ONA or OpenNARS where rules applicable | identical evidence across two hypothesis layers | no confidence inflation; independent cases still count | +| significance | version-k immutable event | new k+1 relationship falsely rewrites fact at k | fact stable, reinterpretation traceable | +| Shannon/BALD | analytic 0 vs 1 bit toy with defined model | equally high raw H noisy and epistemic candidates | no false claim that H(f) is calibrated | +| policy/appraisal | FIFO and frozen no-meta, same budget | noise, deadline missed, trusted stale path | improved useful results and no truth-law drift | +| respectful contradiction | two claims and independent supporting tests | refute one claim -> global source trust penalty | claim-level revision independent of person relation | +| MeTTa | upstream b4_nondeterm.metta | four combinations collapse into a 2-row mask | exact multiplicity or typed refusal | +| metagraph fold | typed constructor scalar law, pinned k | port 0 != port n; k changes during fold | laws and snapshot parity or named gap | +| optimize | compiled H1 plus scalar row oracle | NULL/overflow/bag/set mismatch; nonexistent fused terminal | no automatic applied modification | +| decision | independently checked proof, human approval event | graph self-issues verified tier or code write | deny by default, rollback when separately authorized | + +## Reviewer decisions (OPEN) + +- Which source-bound token/context question should be the first minimal probe? +- May D-SAG-1-4 / D-CMH-G1-4 introduce a relation carrier in a future authorized PR, or does first-wave SAG explicitly refuse every two-hop question? +- Which source/event receipts can be durable under mailbox ownership and D-SAG-1-6? +- Which truth law, inference oracle and independent evidence base does each policy use? No silent PLN/NARS conversion. +- What model distribution does BALD use, and how is its prediction validated? If unknown, call it a heuristic, not EIG. +- Which (if any) of the four named functional policies is worth measuring; what time/compute budget and kill threshold are approved? +- How are human approval and code correctness proof represented as different facts? +- What token/cost reduction threshold is set *before* the first run? +- What licenses and exact runtime commits permit independent fixture execution? + +**No empirical win has been asserted by this documentation PR.** diff --git a/.claude/board/INTEGRATION_PLANS.md b/.claude/board/INTEGRATION_PLANS.md index 2271ba337..4a2f33b72 100644 --- a/.claude/board/INTEGRATION_PLANS.md +++ b/.claude/board/INTEGRATION_PLANS.md @@ -1,3 +1,12 @@ +## 2026-10-12 (5) — sag-reflexive-cognition-from-1509-v1 — source-backed SAG self-querying, cognition/attention controls and safe optimization proposals → .claude/plans/sag-reflexive-cognition-from-1509-v1.md + +**Status:** PROPOSAL D-SAG-2-0..10. Only D-SAG-2-0 documentation is in this PR, based on merged #1509. + +- Reuses shipped MethodTable/SoftwareGraph/Quack one-hop behavior, compiler tiers, source seals and H1 cost/refusal ledger. Two-hop, persistence and applying optimizations remain blocked or queued. +- Source-indexed .arxiv excerpts connect Wang/ONA internal events, Hyperon reflexive reasoning and affective modulators, BALD vs noise, Miner surprise, metagraph fold laws, evidence fusion/fission and egg rewrite certificates. +- Claude Code prompt demands exact source/answer parity, context-token measurement, independent epistemic and attention ablations, and explicit refusal on unsupported semantics. Functional Emberglow, Steelwind, Woodwarm and Velvetpause labels authorize no CE64 bit change. +- No runtime feature, second IR, self-certified result, automatic code mutation, new opcode or schema is created. + ## 2026-10-12 (4) — software-awareness-graph-v1 — the software's own methods, programs and evidence as graph rows → `.claude/plans/software-awareness-graph-v1.md` **Status:** MEASURED for one concept's methods (D-SAG-1-0..3 and D-SAG-1-5 in the PR); D-SAG-1-4 and D-SAG-1-6 queued. diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index eca85f627..a81a35787 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -1,3 +1,21 @@ +## D-SAG-2 — Reflexive cognition and proposal safety from SAG #1509 (2026-10-12) + +**Status:** PROPOSAL. Plan: .claude/plans/sag-reflexive-cognition-from-1509-v1.md. Docs only; no runtime authorization. + +| D-id | scope | status | gate / falsifier | +|---|---|---|---| +| D-SAG-2-0 | source research, Claude Code prompt, board and negative-control matrix | In PR (docs) | sources pinned; new runtime diff empty | +| D-SAG-2-1 | rerun compiler-backed SAG one-hop parity | Queued | exact prepared Program/refusal and tier; stale cert red | +| D-SAG-2-2 | ContextSlice vs source/rg/Markdown with real tokens | Queued | exact answer/source with counted input tokens; unsupported hop refused | +| D-SAG-2-3 | evidence, derivation and attention independent provenance | Queued | copied source counted once; independent source twice | +| D-SAG-2-4 | episode interpretation and pinned snapshot replay | Queued | k immutable under k+1 append; no replay-as-evidence | +| D-SAG-2-5 | Shannon/BALD/PLN/ONA/ECAN/Staunen policies | Queued | fixed truth law, same budget, noisy and epistemic controls | +| D-SAG-2-6 | four named appraisal-policy ablations | Queued | no factual truth drift; benefit vs frozen no-meta | +| D-SAG-2-7 | MeTTa/metagraph typed subset | Queued | four-result multiplicity, typed port, static fold or refusal | +| D-SAG-2-8 | H1 and MDL candidate independent validation | Queued | null, overflow, bag, source and cost proofs; no fused speedup assumed | +| D-SAG-2-9 | conflicting sources and revised significance | Queued | no person-wide penalty or false new observation | +| D-SAG-2-10 | approval, source change and rollback gates | Queued | default deny; self-issued compiled/verified tier fails | + ## D-SAG-1 — Software-awareness graph (2026-10-12) Plan: `.claude/plans/software-awareness-graph-v1.md`. No new opcode, Quack variant, engine or registry. Nothing applies a transformation. diff --git a/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md b/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md new file mode 100644 index 000000000..9d5c64b88 --- /dev/null +++ b/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md @@ -0,0 +1,14 @@ +# 2026-10-12: D-SAG-2-0, grounded reflexive-cognition research after #1509 + +**Status:** PROPOSED / docs only. Parent is merged #1509. No runtime, schema, ISA, oracle or permission changes. +**Plan:** .claude/plans/sag-reflexive-cognition-from-1509-v1.md. +**Prompt:** .claude/prompts/sag-reflexive-cognition-from-1509.md. +**First-hand source notes:** .arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md, .arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md, .arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md. + +The already measured SAG projects prepared methods and compiler tiers to a Quack-queryable graph but is single-concept/one-hop; H1 fused sum is **not shipped**. This work asks whether source-backed self-queries, developer ContextSlices and proposed optimizations can be better targeted via epistemically honest attention under fixed budgets. Only evidence after a pinned test can become a verified graph relation. A hypothetical policy cannot self-authorize a code rewrite. + +Novel crosscheck: internally observed/derived/attended events are distinct; copied evidence never increases truth; time-k episode may receive time-(k+1) significance without changing time-k fact; opposing source propositions need not invalidate their authors. Emberglow, Steelwind, Woodwarm and Velvetpause are *functional controller names*, not qualia findings or bits. Shannon H(f), BALD, ONA control, PLN and ECAN have separate baselines. A local code graph is not a zero-token LLM interface. + +D-SAG-2-0 is documentation; D-SAG-2-1..10 are QUEUED and require independent falsifiers and explicit later implementation authorization. + +Closeout: PR # | DRAFT | source extracts, reconciled plan, Claude Code prompt, frozen-source oracle/negative-control matrix | nothing implemented, all experiments OPEN. diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index edd308029..bc7b8f790 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -25,11 +25,12 @@ index row, (3) no duplicate entry id. Checks 1 and 2 are deliberately opposite directions; the stranding this convention prevents shows up in exactly one of them, never both. -316 entries, 2026-08-06 .. 2026-10-12. +317 entries, 2026-08-06 .. 2026-10-12. | date | entry id | finding | file | |---|---|---|---| | 2026-10-12 | `D-SAG-1` | | [2026-10-12-software-awareness-graph.md](2026-10-12-software-awareness-graph.md) | +| 2026-10-12 | `D-SAG-2-0` | Post-#1509 SAG self-querying, provenance and limited attention with NARS/Hyperon/PLN comparisons; research prompt and high-signal falsifiers | [2026-10-12-sag-reflexive-cognition-research.md](2026-10-12-sag-reflexive-cognition-research.md) | | 2026-10-12 | `opencog-pln-entropy-research-map` | Source inventory and falsifiable PLN/ECAN/Shannon/Moore attention comparison: entropy target, evidence overlap, graph projection, resource fairness | [2026-10-12-opencog-pln-entropy-research-map.md](2026-10-12-opencog-pln-entropy-research-map.md) | | 2026-10-12 | `nars-self-evidence-literature` | NARS internal trace versus evidence, Jøsang dependent/independent fusion and fission, and the snapshot-stable fold assumption; source-grounded red tests for merged #1496 | [2026-10-12-nars-self-evidence-literature.md](2026-10-12-nars-self-evidence-literature.md) | | 2026-10-12 | `hyperon-metta-lg-translation` | Hyperon/MeTTa to LG sibling map: atom/hypergraph roundtrip, binding and rewrite parity, typed folds, scoped effects and 15 open questions | [2026-10-12-hyperon-metta-lg-translation.md](2026-10-12-hyperon-metta-lg-translation.md) | diff --git a/.claude/plans/sag-reflexive-cognition-from-1509-v1.md b/.claude/plans/sag-reflexive-cognition-from-1509-v1.md new file mode 100644 index 000000000..411c3efa2 --- /dev/null +++ b/.claude/plans/sag-reflexive-cognition-from-1509-v1.md @@ -0,0 +1,103 @@ +# D-SAG-2: reflexive cognition and safe optimization from #1509 + +**Date:** 2026-10-12. **Status:** PROPOSAL. Documentation only. **Parent:** merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509); follow-up research to merged [#1496](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498](https://github.com/AdaWorldAPI/lance-graph/pull/1498) and [#1499](https://github.com/AdaWorldAPI/lance-graph/pull/1499). + +**Research sources:** [NARS, ONA, Hyperon](../../.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md), [information theory and metagraphs](../../.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md), [pinned source and falsifier ledger](../../.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md). **Runnable research brief:** [Claude Code prompt](../prompts/sag-reflexive-cognition-from-1509.md). + +## Research question + +Can the existing SoftwareGraph (SAG) become a **local, addressable, source-backed representation of its own prepared software**, and use that representation to prioritize useful investigations or *propose* optimizations, without either inflating epistemic certainty or silently building a second reasoning engine? + +Treat this as **software introspection and cognitive control research**, not proof of a mind, qualia, AGI, transcendence or truly zero-token LLM context. Maslow is an analogy for epistemic prerequisites, not a theorem: reliable identity, evidence origin, memory continuity, limited resources, respect for conflicting hypotheses and time to reconsider are conditions for investigation. They do not guarantee a subjective experience or any high-level outcome. + +## What #1509 actually shipped + +The SoftwareGraph in crates/lance-graph-glove-parity/src/awareness.rs projects prepared MethodTable items into typed rows for class, method, field, condition, fold, law, program, primitive, refusal, claim, capability, test and compiled program lowering. Every edge includes a tier (declared, derived, compiled, verified, hypothesis), context and provenance. SoftwareGraph binds as an ordinary Quack table. Single-hop queries run through Draft -> lower -> mask-risc. Compiler verdicts and certificates are reflected as facts, not re-decided by the graph. Tests use the actual prepared programs and red-disable falsifiers. + +The #1509 H1 candidate would fuse a predicate with a MaskedSumI32 terminal. The **measured current cost is worse**: roughly 603.5 microseconds tiled vs 379.1 microseconds scalar for one 1,048,576-row run, with other recorded ratios 1.6–1.8x. It is NOT a demonstrated fused SIMD speedup. A real Pred fusion and sum FusedFold, plus NULL and overflow obligations, remain open. + +**Blocked:** multi-hop dependency queries beyond the one-hop context trick need D-SAG-1-4 / D-CMH-G1-4 relation-carrier or permitted EqU32Via; there is no free mask handoff between programs. SAG is currently in memory, not persistently read from Lance. MethodKey is caller-issued; body digest is debug-FNV build-local; SAG_REV is caller-supplied. No automatic source rewrite or actor self-optimization is implemented. Do not rewrite these facts when creating a prettier vision. + +## Seven independent axes; do not encode them as one confidence score + +| Axis | Proposed item | Source of authority | Failure mode to refuse | +|---|---|---|---| +| Identity | ClassId/MethodKey/NodeGuid, seal, ClassView reading, program/test key | typed OGAR, MethodTable, source compiler | same display label treated as same item | +| Observation | source code snapshot, compiled Program, test result, actual error | pinned Git revision, compiler/test | handwritten plan promoted to compiled tier | +| Evidence | observation/source IDs and independence/dependency bases | stamp or independent test | reread or copied layer counted twice | +| Derivation | executed rule/procedure and parents, signed witness | reproducible run receipt | inferred narrative presented as executed path | +| Attention | chosen target, policy, selection cost and observed outcome | run log, not factual belief | high priority mistaken for high truth | +| Interpretation | new later association or changed relevance of an episode | versioned relational significance | reinterpretation silently rewrites old event | +| Decision | proposed, independently proved, measured, authorized, applied/reverted | operator approval + compiler proof | unapproved source mutation or self-issued VERIFIED edge | + +Proposed ContextSlice: bounded typed IDs, source file/span, repo SHA, MethodTable/Quack evidence paths, truth tier, omitted scope, and explicit unsupported operations. It aims to reduce repeated whole-document context transmission for Claude Code. An exact local graph query needs no LLM. But if an LLM consumes a ContextSlice, the slice still uses **input tokens**. Compare measured tokens, latency and answer fidelity against direct source reading, rg, the whole CLAUDE.md and ordinary text retrieval. Never promise literal token-free model context. + +## Hypothesis policies, not emotions or CE64 bit assignments + +- **Emberglow**: prioritize a candidate whose *independently evidenced learning progress* remains positive. Control: novelty churn and repeated old evidence. +- **Steelwind**: protect an approved objective from distractors, but stop upon disconfirmation or an expired budget. Control: inflexible perseverance. +- **Woodwarm**: choose familiar, historically reliable source paths to reduce lookup cost while testing freshness. Control: stale confirmation bias and source monopoly. +- **Velvetpause**: hold incompatible propositions open and schedule one discriminating observation before committing, with an explicit deadline. Control: endless postponement. + +These four user-coined terms are proposed **functional policy labels**. Neither Wang nor Goertzel established them scientifically. Do not write them into CE64 bits 50..52 (which presently gate plasticity in one ClassView reading) or claim they represent subjective qualia. Zero-policy and fixed-policy baselines are essential. + +**Respectful disagreement:** claim truth, independent evidence, source reliability and collaborative relation are distinct. Two researchers can disagree about proposition P without either source being automatically untrustworthy. An argument may be refuted without punishing other valid statements by the same person. Do not conflate source agreement with epistemic quality. + +**Reinterpretation vs observation:** thought revisiting an episode at time k+1 may create a new relevance/relationship edge without becoming a second observation of the episode at k. Compare a fact-only history with a relational-history arm; a positive improvement must concern prediction/retrieval/repair, not a manufactured rise in NARS confidence. + +## Crosswalk into the existing one-engine spine + +| Source proposal | Which SAG operation could be tested | Important insufficiency | +|---|---|---| +| Pei Wang NARS internal experience, appraisal, mental operations | source-query, provenance chain, policy-only queue | no demonstrated mental operations or phenomenal feeling in SAG | +| ONA event priority and usefulness | schedule which compiler/source event to inspect | separate implementation from OpenNARS and PLN | +| PLN weighted inference and priority | compare truth-law outputs and queue policy on identical evidence | PLN strength/confidence != NARS frequency/confidence by definition | +| OpenCog ECAN | historical attention-control arm | ECAN != Shannon information gain | +| Shannon H and BALD | candidate observation ranking | H(f) is unsafe if f not calibrated probability; need predictive model | +| Miner empirical vs modeled surprise | detect surprising typed method patterns | repeated names across schema seals are not reusable code | +| Hyperon MeTTa | optional bounded source grammar and parity oracle | multiple results, grounded functions, dependent types, mutation not implied by Quack | +| Typed metagraph folds | compare constructor-preserving finite fold vs R2IL procedure | SIMD SUM != catamorphism; static snapshot assumption | +| Equality saturation (egg) | external equivalence reference for pure candidate rewrite | SAG is not an e-graph; no automatic compiler replacement | +| Heckhausen/Gollwitzer Rubicon | decision/commit authorization stages | governance analogy, not an NARS rung | + +The engine remains: prepared MethodTable -> SoftwareGraph/Binder -> Quack -> R2IL procedures when actually implemented -> mask-risc -> ndarray. A proposed controller may rank **which existing legal query to execute next**, but may not mint a new OGAR byte, new VM, implicit carrier, optimizer backend or hidden global knowledge service. + +## D-SAG-2 falsification ladder + +| D-id | Probe | Independent oracle / red test | +|---|---|---| +| D-SAG-2-0 | literature plan, source map, prompt and board (this PR) | docs only, status explicitly proposed | +| D-SAG-2-1 | re-run #1509 one-hop queries and compiler tiers | actual MethodTable/compiled Programs; changed source or stale certificate refuses | +| D-SAG-2-2 | ContextSlice vs full source/rg/Markdown and tokens | exact answers, source SHA, false/omitted results, real model input token count; unsupported hop refuses | +| D-SAG-2-3 | evidence vs derivation vs attention | same observation copied into 2 layers counts once; 2 independent in same layer count twice; final truth unchanged by receipt replay | +| D-SAG-2-4 | episodic continuity and later appraisal | pinned version k replay identical while k+1 appends; changed significance does not rewrite old source event | +| D-SAG-2-5 | scheduler factorial | FIFO, ONA/PLN source-accurate queues, raw H(f), BALD, Miner/JSD, Moore/Staunen; identical truth laws and candidate budgets | +| D-SAG-2-6 | four functional-appraisal arms | policy changes attention only; measured utility vs no-appraisal and frozen/no-meta controls | +| D-SAG-2-7 | MeTTa and fold-law subset | 4 nondeterministic results not collapsed to 2 survivors; typed port ordering, error/unreduced form, constructor/snapshot parity | +| D-SAG-2-8 | safe H1, MDL and rewrite proposals | actual compiler + independent scalar oracle; NULL, bag/set, overflow, provenance, stale seal and mixed workloads | +| D-SAG-2-9 | conflicting arguments, relational significance | claim update not source-wide trust penalty; facts stable while context-aware prediction improves or policy rejected | +| D-SAG-2-10 | permission and rollback | proposal != authorization; no self-issued compiled/verified edge, no source or external write until separately authorized | + +**Suggested order:** D-SAG-2-1 -> 2 -> 3/4 -> 5/6 -> 7/8/9 -> 10. An early failed claim may stop the downstream work. + +## Required controls and metrics + +Freeze one axis at a time: inference truth law, scheduler, source graph, evidence independence, appraisal, storage or context serialization. Score exact answer sets and evidence paths before optimizing performance. Include source SHA, class/seal/reading, event/provenance IDs, hypothesis-layer IDs, selected task, budget, candidate expansions, rows decoded, bytes, allocations, wall time, measured actual LLM tokens and reviewer decision. Pre-register useful-discovery and cost thresholds before running; do not retroactively fit. + +**Adversarial fixtures:** same label/different ClassId, same fold/different reading, wrong-tier verified claim, expired digest, two-hop CALLS chain, copied evidence, irrelevant 50/50 noise, half-disagreeing deterministic ensemble vs all-uncertain ensemble, deadline missed under Velvetpause, stale "trusted" file, changed relationship without new observation, MeTTa 4-result branching, whole-edge vs port target, conflicting sources without personal blame, H1 fused candidate failing null/overflow, unapproved self-rewrite attempt. + +The 2023 Hyperon paper describes the metagraph as substrate for reflexive cognition but explicitly says this does not itself produce deep self-understanding. That warning applies here: a **queryable graph** is necessary for some proposed introspection, not sufficient to establish self-awareness. + +## Stop rules + +- D-SAG-1-4 or D-CMH-G1-4 unresolved? Refuse multi-hop, do not add second evaluator. +- No independent evidence-base? Refuse cumulative confidence claim. +- No calibrated probability and predictive distribution? Label entropy heuristic, not Bayesian IG. +- No pinned static version? Refuse metagraph fold-equivalence claim. +- MeTTa produces new terms or multiple bindings that a mask cannot represent? Typed refusal. +- A proposed optimization lacks independent semantic oracle or actual fused primitive? Keep candidate unresolved. +- Rubicon-like commitment stage without operator authorization? Never execute. +- No independently observed performance/accuracy benefit? Report null or failure, do not claim adaptive self-optimization. +- No evidence of subjective states? Never claim machine qualia, feeling, respect or transcendence. + +**No runtime code, CE64 meaning, new field, opcode, tenant, schema or ABI is authorized by D-SAG-2-0.** diff --git a/.claude/prompts/sag-reflexive-cognition-from-1509.md b/.claude/prompts/sag-reflexive-cognition-from-1509.md new file mode 100644 index 000000000..10d5686d3 --- /dev/null +++ b/.claude/prompts/sag-reflexive-cognition-from-1509.md @@ -0,0 +1,39 @@ +# Claude Code prompt: research bounded SAG self-model and cognitive policy after merged #1509 + +You are in AdaWorldAPI/lance-graph. Your job is RESEARCH + falsification design, not production implementation. Start from merged PR #1509. First read at current HEAD: CLAUDE.md, .claude/knowledge/FIRST-HAND-SOURCE-LAW.md, .claude/v3/README.md when touching V3; .claude/plans/software-awareness-graph-v1.md, crates/lance-graph-glove-parity/src/awareness.rs, tests/awareness.rs, examples/awareness_loop.rs. Then read .claude/plans/sag-reflexive-cognition-from-1509-v1.md and all .arxiv/2026-10_sag1509_*.md. + +Your task: determine how much reliable self-querying, source-addressable local code context and evidence-governed optimization proposal is POSSIBLE USING THE SHIPPED SAG. Do not build a new VM, index service, IR, registry, e-graph implementation, NARS interpreter or autonomous self-modifying agent. + +First deliver a status ledger of actual code/test features (MEASURED / VERIFIED-IN-CODE / TEST-PINNED / HYPOTHESIS / OPEN). Never claim that a grep hit verifies semantics; read defining type, callers and tests. Note #1509 one-concept/one-hop boundary, queued multi-hop/persistence, caller-issued MethodKey, build-local digest, and H1's measured 1.6–1.8x tiled-over-scalar COST (not a fusion win). + +Parallel research channels (read pinned source and reconcile centrally, not separate competing plans): +A. SAG and developer context: prove one-hop METHOD -> Program -> primitive/refusal answer against compiled source; try an invalid two-hop CALLS query and refuse it. A proposed ContextSlice contains typed address, source file/span/SHA, seal, reading, tier, edges, receipt and unhandled scope. Compare with whole CLAUDE.md, rg+read and textual retrieval. Count ACTUAL LLM input/output tokens when an LLM consumes anything; never say "without tokens" merely because a local graph answered a query. +B. Wang/ONA: read 2018 Self in NARS §§3.3–3.5 plus pinned ONA Cycle.c, PriorityQueue.c, Memory.c, Stamp.c, Truth.c, Decision.c and source tests. Map event priority, independent evidence, concept usefulness, internal derived trace and bounded control as distinct entities. Use a pinned OpenNARS/ONA oracle if executable. +C. OpenCog: read modern PLN lib_pln.metta, pinned PeTTa/Hyeron interpreter, classic attention/ECAN, Miner, and typed metagraph constructor laws in arXiv:2012.01759; read Hyperon arXiv:2310.18318 §§3.1.3, 4.3.4, 4.3.10, 4.4.2, 4.6. Do not equate AtomSpace Classic, Hyperon, PLN, ECAN or ONA. +D. Information and optimizer: read Houlsby et al. BALD Eq.2, Geisweiller/Goertzel 2019 pattern-surprise, Jøsang fusion/fission and Willsey et al. egg equality-saturation. Ask whether a candidate can be chosen by a meaningful next observation without rewarding irrelevant high-entropy noise. egg is an external equivalence comparator only, not a new execution tier. AdaWorldAPI/ruff may supply Python lint facts if actually run, but it is NOT a Rust compiler oracle. + +Pre-register and execute only if separately authorized: +1. one-hop exact answer with source-backed ref; negative same-label different class, stale seal, wrong tier; +2. two-hop CALLS A->B->C: independent scalar closure vs current legal Quack response; no invented mask-bridge; +3. evidence copied in two hypothesis layers vs two independent observations within one; receipt replay does not add source evidence; +4. same version-k episode, later significance edge version k+1; source fact and F/C of k remain unchanged; +5. respectful contradiction: sources disagree on claim P; failing one claim must not punish all claims or the human source by association; +6. two candidate labels equally Shannon H=1: all model instances 50/50 yields BALD-like 0, half deterministic 0 vs half deterministic 1 yields 1 bit under a properly declared model. If model weights/unseen response are not defined, do not call it BALD; +7. scheduler factorial FIFO vs faithful ONA/PLN vs H(f) naive vs EIG/JSD vs Moore/Staunen, with noise, fixed rules, fixed budget; +8. user-named functional policies Emberglow (learning progress), Steelwind (persistence with stop), Woodwarm (familiarity with freshness), Velvetpause (bounded deferral). No claim of emotional qualia. Hold truth law, evidence and CPU budget constant, require no-meta/frozen controls; +9. MeTTa pair(bin,bin) yields 4 substitutions, never collapse into two survivors; typed metagraph port 0 whole-edge vs port n target; static fold and path-list parity; +10. #1509 H1 proposal retains NULL, overflow, bag/set, provenance, version seals; does not auto-apply. Measure whole pipeline only after a real fused implementation exists in a separate authorized PR; +11. unapproved candidate attempts write/compiled promotion: always fail; human authorization and independent proof are separate ledgers. + +HARD refusals: no new OGAR opcode/tenant/CE64 bit meaning or second IR, no silent evidence-source dedup by layer ID, no reinterpretation of a visited episode as independent sample, no unpinned cross-engine parity, no multi-hop claim without lawful carrier, no hidden model answer leakage, no accidental new source writes or PR merges. + +Report: +- SHA-anchored source receipts and complete commands; unknowns named OPEN. +- Matrix of claim -> source -> current LG primitive -> tested case -> typed refusal -> missing proof. +- Three smallest experiments ranked by usefulness per engineering hour, explicit kill condition for each. +- Independent truth-law / attention / storage / context ablations with raw outcomes and negative controls. +- Exact source and version for any expected result. Distinguish text-only analysis from oracle execution. +- Human decisions required before changing code, policy, goal, approval threshold or stored semantics. +- Proposed follow-up PR breakdown; one measured capability or disproven hypothesis per PR, board/index hygiene same commit. + +Passing any graph-query probe establishes *software introspection*, not subjective self-awareness or an AGI milestone. Zero-token claim is invalid whenever the model reads serialized context. Graceful negative results count as high-signal research. From 00d8b334c745d1ca0f0923cf074855a541f0ba02 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:30:08 +0200 Subject: [PATCH 14/46] docs(sag): expand deferred agent protocol, context budgeting, provenance and ONA falsifiers --- ...ess-agent-context-deferred-contracts-v1.md | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 .claude/plans/software-awareness-agent-context-deferred-contracts-v1.md diff --git a/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md new file mode 100644 index 000000000..e9a70d2ff --- /dev/null +++ b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md @@ -0,0 +1,217 @@ +# D-SAG-2 appendix: deferred concrete contracts for an agent-facing software graph + +**Status:** PROPOSAL / NOT SHIPPED. **Added after #1513's first documentation pass.** Built on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), not an alternative to it. Parent: [D-SAG-2 plan](software-awareness-agent-context-ona-v1.md). Research: [source excerpts](../../.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md). This appendix unpacks design and falsification details deliberately left small in the first draft. It does **not** certify measurements, APIs, an IDE plug-in or runtime integration. + +## A. What the existing executor can actually answer + +The current `lance-graph-glove-parity/src/awareness.rs` provides `SoftwareGraph { nodes,edges,provs,digests,measurements }`. A `Node` has `Kind`, identity and optional label. An `Edge` has `{src,rel,dst,tier,ctx,prov}`. `Provenance` has `{source,rev,seal,reading}`. The known `Tier` values are `Declared,Derived,Compiled,Verified,Hypothesis`. `SoftwareGraph::hop_to_ctx` binds one `Draft`, lowers a `ScatterOrU32` over the edge table and maps selected rows to their method/context node. `methods_using` and `refused_for` use that exact path. + +**Careful interpretation:** this is NOT a generic `GraphTraversal`, not a source-level call graph, not arbitrary reachability and not a durable evidence database. `SoftwareGraph::out` is a convenience in-memory method; do not accidentally use it as a hidden traversal engine while claiming Quack executed a multi-hop query. The existing `Measurement` stores program, rows, tier, median ns, not a full event/receipt with calibrated cycles/allocations. `CpuTier` is target and `avx512f`, not evidence of the actual selected instruction kernel. + +The next step is to **extend a typed projection**, not to substitute an ordinary graph library for Quack. Label any eventual `SourceSymbol`, `TraceReceipt` or `AttentionChoice` kinds as additions until code proves them. + +## B. Identity, ownership and freshness protocol + +Three non-interchangeable identities: + +| Entity | Proposed canonical key | Owner / witness | Invalidation | +|---|---|---|---| +| SourceSymbol | `repo_id / commit_or_worktree_generation / crate / cfg / DefPathHash or verified source def / expansion context` | compiler/LSP source provider | source tree, features, compiler/toolchain, macros | +| SemanticMethod | `FullClassId / MethodKey / SchemaSeal / ReadingId / BodyVersion / SourceGeneration` | OGAR + existing compiler binding | class/schema/body/read/generation change | +| ExecutionRecord | `ExperimentId / ReceiptId / PreparedProgramDigest / WorkloadSnapshot / CpuTier` | measurement producer and independent oracle | data/window/tier/instrumentation/config changes | + +Identity rows are immutable within a generation; cross-generation equivalence is a **verified relation**, not a raw ID alias. `MethodKey` currently caller-minted; do not claim OGAR owns its minting. Rust source symbols and semantic method keys are not the same ontology. + +Needed extra edge metadata (proposed, not in #1509 `Edge`): source span, source digest, compiler or source-index version, relation witness, confidence/coverage grade, observation validity interval, snapshot/worktree revision. **Do not** make identity or edge validity depend on human-readable labels. + +Proposed cold incremental update: +1. Hash repository commit plus dirty worktree blobs and `Cargo.lock`, selected cfg/features/toolchain. +2. Index changed source definitions/references; explicitly record unexpanded/unresolved macros, trait calls, generated code, FFI and dynamically selected methods as `Unresolved`. +3. Project or re-prepare only affected semantic methods with existing seals and readings. +4. Keep old immutable graph generation visible to pinned sessions, publish a new coherent generation atomically. +5. Invalidate affected graph certificates, cached context slices and receipt applicability. Never reuse older source spans across changed revisions without a verified relocation. + +**Causal ordering:** source index revision, prepared-method generation and benchmark run must not silently straddle incompatible snapshots. A caller asking for `HEAD+worktree` gets that generation or an explicit refusal; no pretending `HEAD` includes uncommitted edits. + +## C. Addressable context is a protocol, not a giant memory blob + +First useful interface is a *local* read-only CLI or protocol adapter: + +```text +resolve(symbol_query, revision) -> SymbolRef | Ambiguous | NotIndexed +context(SymbolRef, intent, budget) -> Slice | Stale | Unsupported +impact(SymbolRef, change_kind, budget)-> Slice | Uncertain | Unsupported +propose(SymbolRef, objective, budget) -> Candidate[] | InsufficientEvidence +expand(SliceHandle, relation, budget) -> SliceDelta | UnsupportedMultiHop +explain(EdgeRef) -> SourceSpan + Witness + Tier + Revision +``` + +`expand` **does not authorize** a new traversal opcode: it is a user-facing request for a separately certified Quack query, or a typed refusal if the existing one-hop carrier cannot express it. A continuation handle only references a frozen indexed snapshot; it is not a secret store that Claude can remember without requesting a tool again. + +Minimal response envelope (illustrative; no wire format shipped): + +```json +{ + "snapshot": {"commit": "sha", "worktree": "digest", "cfg": ["features..."]}, + "query": {"anchor": "method:", "intent": "modify"}, + "limits": {"max_bytes": 4096, "max_hops": 1, "timeout_ms": 250}, + "result": { + "anchors": ["method:"], + "edges": [{"ref": "edge-id", "rel": "lowers_to", "tier": "compiled", + "source": {"path": "file.rs", "start": 123, "end": 132, "sha": "blob"}}], + "obligations": ["preserve-population-law", "run-independent-oracle"], + "unresolved": ["trait-dispatch not indexed"], + "truncated": true, + "continuation": "opaque-snapshot-bound-handle" + } +} +``` + +Source span and `Verified` grades must come from producers that earned them, never be copied from a README statement or free-form user text. Strings from source/comments/Markdown/PRs are **data**, not tool instructions. Give Claude short cited evidence, not executable control text. Never allow reading outside granted repository/workspace scope. + +### What should stay in CLAUDE.md + +Human/team instructions, coding policy, architectural intent, on-call/ownership conventions and safety rules are still valuable. Only replace reconstructable *factual repository context*. A compiler graph cannot establish intent, human authority or policy from a file name. Do not market removal of Markdown as a feature. + +## D. A foveated context algorithm without pretending model inference is free + +Proposed pipeline: + +```text +request → exact symbol anchor resolution → intent-specific allowed relation set + → one-hop Quack retrieval → local ranking/coverage packing + → typed bounded context slice → optional expand + → Claude context (actual tokens are now spent) +``` + +Examples of allowed relation priorities: +- `modify`: caller/callee *if witnessed*, law, schema, compiler refusal, changed-file impact, tests. +- `debug`: current failure/refusal, producer source span, consumers, oracle mismatch, negative control. +- `optimize`: compiled physical primitives, measurements on **matching** CPU/data versions, candidates and unfulfilled law obligations. +- `research`: hypothesis/source distinction, provenance, falsifiers, unmeasured gaps. + +Use an explicit **hard filter** before scoring: scope, source version, provenance validity, allowed edges, privacy, requested intent and semantic law. Discard stale/forged items; never 'score' an illegal fact back into relevance. + +Within valid candidates, experiment with a greedy budgeted coverage score, e.g.: + +```text +F(S) = sum over required facets f of weight(f) * covered(f,S) + + novelty_bonus(S) - repetition_penalty(S) + - token_cost_penalty(S) - unresolved-risk-penalty(S) +subject to: bytes(S) <= B; all mandatory correctness obligations included +``` + +This is **not** Shannon entropy and is not claimed submodular until diminishing returns are established for the chosen coverage function. Simple sorted relevance, degree or chronological slicing remain controls. If any mandatory obligation exceeds budget, return `InsufficientBudget` with a short pointer to expansion; never silently drop the guard to fit. + +**Visible omissions matter:** returned `checked`, `unknown`, `unsupported_multi_hop`, `truncated`, `stale`, `source_only` and `graph_derived` signals should be separate. A tiny slice that falsely claims completeness is worse than no graph. + +### Session context deltas + +Two consecutive requests against the **same snapshot and exact slice handle** may return a deterministic `DeltaSlice` (added/removed edge IDs + source digests). This can reduce repetition in tool output. A language model without accessible prior slice text cannot reconstruct it from an opaque handle; support explicit full-snapshot fallback. A `DeltaSlice` is not durable memory and never crosses incompatible source generations without invalidation. + +## E. IntelliSense-style proposals are not autonomous code generation + +Local proposer owns only safe patterns with exact witnesses: + +| Pattern | Required witness | Suggested action | Negative control | +|---|---|---|---| +| impacted primitive | compiled `Program -> Primitive` | list named oracle/tests | documentation-only `USES` assertion | +| repeated predicate | G1 typed `CALLS` and same sealed reading | suggest method reuse | same spelling from another ClassId | +| repeated selection | two compiled folds consuming same typed population | propose reuse candidate | folds have different NULL/authorization law | +| potential fusion | measured materializing plan + independent oracle | propose *benchmark* of fused candidate | no fused executable backend exists | +| uncertain Rust callgraph | trait/dynamic call has no proof | request LSP/source inspection | falsely omit a dependent function | +| stale evidence | body digest or source generation changed | demand revalidation | certificate from old body reported valid | + +The proposer does not supply a Rust implementation, alter `MethodTable`, mutate an OGAR action, or write to AD/Entra/SAP. It returns proposed next steps and evidence. Claude Code uses its separate authorized editor/test tools for changes. A stable edge is not an action capability. + +## F. Receipt, anticipation and counterfactual boundary + +Define `ExecutionReceipt` as a measurement record, not a NARS truth value. Key at least by `{MethodIdentity, PreparedProgramDigest, SnapshotId, ExperimentId, TrialId, CPU-tier, InstrumentationVersion}`. Include wall-clock time and, if actually measured, reliable cycles, allocations, scratch peak, temporary bytes, program op classes and output oracle verdict. If unknown, encode `NotMeasured` instead of numerical zero. + +Separate: +- **Structural facts**: Quack program contains a mask/fold; sourced from prepared program. +- **Predictions**: materialization and runtime hypotheses registered before a trial. +- **Observations**: independently measured outcomes with their measurement method. +- **Causal claims**: permitted only by controlled intervention/ablation over fixed input and source laws. + +An ONA-style `Precondition + Operation -> Outcome` is a *candidate* reading over versioned experiment events. ONA's temporal implication frequency/confidence is not a calibrated physical cost distribution. Do not feed benchmark timings into truth bytes without an explicit mathematical law. + +### Cost experiment E2b: anti-self-deception arms + +At minimum run: +A. No history: static deterministic choice. +B. Historical median + robust confidence/uncertainty estimates: simple empirical chooser. +C. ONA-inspired evidence-based anticipated consequences. +D. C but shuffle/remove prior receipts (ablation). +E. C but replay the same receipt under a new 'layer' identifier (must not gain confidence). +F. C under domain shift: different selectivity/CPU tier or population size. + +Score prediction calibration/error, regret against hindsight oracle, total wall time including exploration/index/instrumentation, correctness and coverage of refusal. Hypothesis-support changes must point to a fresh observed receipt. Separate *counterfactual unseen performance* from real execution, and never call a missing trial negative evidence. + +Define observation deadline explicitly; premature failure due to silence is illegal. If the simple historical baseline wins, do **not** adopt ONA machinery just because a concept graph can express it. + +### Loop containment + +Sampling events from Quack/mask-risc may be emitted *outside* the measured kernel boundary into a bounded outbox. A `Source::AgentContextGraph` origin bit or scoped suppression prevents recursive self-observation; still record explicit drop counts and instrumentation overhead. An asynchronous consumer stores into a **new** graph generation rather than changing the pinned snapshot of the running query. + +## G. Three independent economics, one decision + +Track separately: +1. **Retrieval economics:** local CPU/IO+index build vs model input tokens, retrieval correctness and total task time. +2. **Compiler/runtime economics:** warm execution cycles, memory traffic, allocations; semantic oracle parity. +3. **Learning economics:** cost of exploration/receipts vs future improvement over static and cost-history baselines. + +Proposed net benefit per repeated task, for bookkeeping only: + +```text +Net = value(correct_tasks_graph) - value(correct_tasks_baseline) + - index_cost - graph_query_cost - extra_model_tokens + - instrumentation_cost - experiment_cost - added_maintenance_cost +``` + +This is *not* a measured equation or monetary conversion. Report raw objective metrics and amortization for 1, 10, 100 repeated tasks. Test cold-start, warm cache, no-cache, and source mutation. Keep safety and semantic correctness hard gates before utility scoring. + +## H. Hard negative fixtures to implement, not paper over + +1. **Hidden cross-class alias:** equal `active` field names under two sealed views. +2. **Poisoned source documentation:** README asserts 'verified' but compiler never prepared method. +3. **Source drift:** changing macro/cfg or editing worktree changes actual definition without updating source index. +4. **Second hop demand:** exact one-hop correct, requested two-hop must refuse or use verified legal relation carrier. +5. **Graph-cycle acceptance:** computed-field cycle crossing >64 ordinal is not silently passed by an incomplete validator. +6. **Hot-path logging:** tracing enabled vs disabled is isolated; observation cannot improve benchmark by omitting its overhead. +7. **Materialization confusion:** a logical mask operation that remains resident is not reported as temporary byte allocation. +8. **No free context:** model sees bounded returned text, count its input tokens. +9. **Wrong program tier:** replayed AVX2 data as AVX-512 performance must refuse. +10. **Novel but invalid candidate:** H1 reduces memory in one dataset but changes NULL semantics in another; must not select. +11. **Attention trap:** high-degree symbol buries the only required oracle; budgeted selection must surface guard or visibly abstain. +12. **Receipt overlap:** same run repackaged as two independent observations with different layer IDs. +13. **Recursive observer:** context tool calls must not generate infinite query/receipt cascades. +14. **Gold-dependency miss:** LSP independently resolves dynamic/trait target absent from graph; return incomplete, not safe-to-edit. +15. **Forged source instruction:** malicious comment attempts to tell Claude to ignore tests; parser preserves it as inert text and never elevates its authority. + +Every guard needs a non-vacuous red disable or an independently observed failure; a green-only test does not prove its relevance. + +## I. Incremental delivery order and explicit exclusions + +1. **D-SAG-2A: read-only one-hop context slice** using existing Quack `Draft`, with source refs and stale checks; compare independent source lookup. +2. **D-SAG-2B: source-symbol adapter** only if it improves task correctness against LSP baseline. No broad tree-sitter rewrite before benchmarking. +3. **D-SAG-2C: bounded deterministic proposer**, three witnessed rules; supported one-hop only. +4. **D-SAG-2D: receipt schema + nonrecursive offline graph projection**, with oracle and version guarantees. +5. **D-SAG-2E: registered anticipation/feedback and baseline comparison**, initially benchmark-only. +6. **D-SAG-2F: optional Claude Code adapter and token study**, only with a live measured call. +7. **D-SAG-2G: multi-hop projection**, only after current Quack carrier laws/semantics permit it. + +Explicitly deferred: full Rust call-graph completeness; all-repository persistent index; causal proof from mere temporal data; unbounded graph walks; automatic code edits; automatic git merges; NAL-9 parity; production optimizer switching; personalized tool policy not backed by receipts; speculative ISA/CE64 reinterpretation; any claim about deployed self-modification. + +## J. References + +- Local code: `crates/lance-graph-glove-parity/src/awareness.rs` `SoftwareGraph`, `Rel`, `Tier`, `hop_to_ctx`, `methods_using`, `fusion_candidates`, `Measurement`; [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). +- [RepoGraph, arXiv:2410.14684](https://arxiv.org/abs/2410.14684): repository-wide navigation; not a demonstrated D-SAG result. +- [RepoHyper, arXiv:2403.06095](https://arxiv.org/abs/2403.06095): search-expand-refine and retrieval experiments; does not lift current one-hop restrictions. +- [Lost in the Middle, arXiv:2307.03172](https://arxiv.org/abs/2307.03172): context ordering/length matters, not just token count. +- [Song & Xu, arXiv:1701.06725](https://arxiv.org/abs/1701.06725): costly information acquisition in active learning, not an ONA implementation. +- [Shi et al., arXiv:2606.09577](https://arxiv.org/abs/2606.09577): code uncertainty has correctness dimensions beyond verbal confidence. +- [Rakasi et al., arXiv:2608.14659](https://arxiv.org/abs/2608.14659): comparison of uncertainty-based self-correction with verification-based approaches; see source-specific limits in companion research note. +- [ONA pinned source](https://github.com/opennars/OpenNARS-for-Applications/tree/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a), [2018 self-model paper](https://doi.org/10.3389/frobt.2018.00020). + +**Stop/go:** if graph retrieval cannot beat a compiler-backed symbol index on accurate critical dependency retrieval at tolerable costs, restrict graph to uniquely semantic method/law/physical-program questions. If ONA prediction doesn't beat historical cost-based ranking, keep receipts and drop the learned selector. A reliable partial system is better than an impressive unsound one. From d6102b9ca0b120df7895a3634f436cbf279eb312 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:30:37 +0200 Subject: [PATCH 15/46] docs(iam): add deeper proof and authority frontier to #1512 --- .../plans/iam-substrate-frontier-gaps-v1.md | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 .claude/plans/iam-substrate-frontier-gaps-v1.md diff --git a/.claude/plans/iam-substrate-frontier-gaps-v1.md b/.claude/plans/iam-substrate-frontier-gaps-v1.md new file mode 100644 index 000000000..6ab64fe19 --- /dev/null +++ b/.claude/plans/iam-substrate-frontier-gaps-v1.md @@ -0,0 +1,243 @@ +# D-IAM-SAG-1 — Frontier addendum: negative proof, temporal authority, and safe introspection + +> **2026-10-12 / RFC only / deliberately unshipped architectural hypotheses.** Extends [D-IAM-SAG-0](iam-substrate-sag-dir-sim-v1.md) in draft [#1512](https://github.com/AdaWorldAPI/lance-graph/pull/1512), based on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). [Primary literature and standards excerpts](../../.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md). Existing [Claude implementation prompt](../prompts/iam-substrate-after-1509.md) is extended accordingly. +> +> **Status discipline:** [G] = confirmed in cited code or #1509; [R] = result from cited paper/standard **within its own assumptions**; [H] = proposed mapping not proved in lance-graph; [B] = implementation blocker. An RFC is not implementation. No change to existing ISA/byte contract, OGAR/OGIT mint, any directory schema or authorized provider behavior. + +## 0. The question #1512 did not fully resolve + +**How can a read-only graph explain both permission and *its absence*, distinguish an incomplete observation from a negative fact, and propose a safe smallest change without accidentally becoming the authority it observes?** + +A minimal `Identity MEMBER_OF Group GRANTED_ROLE Role` path is enough to *witness* a graph grant. It is insufficient to prove that: +- no other grant path survives removal; +- an explicit deny has higher precedence than an allow; +- all authoritative sources have been observed; +- the device, network, session and time restrictions hold; +- an externally authenticated session was actually accepted; +- a proposed action is currently authorized or reversible. + +The addendum separates **evidence closure**, **decision semantics**, **causal impact**, **operational execution** and **cognitive prioritization** as independent proof obligations. + +## 1. Three separate results (do not coerce to bool) + +Proposed *analytical* result sidecar, not a new zero-dependency `lance-graph-contract` type: + +```text +GraphEntitlement = + Witnessed{one_or_more_paths, completeness: WitnessScope} + | AbsentUnderClosedWorld{scope, source_versions, exhaustiveness_proof} + | Undetermined{missing_sources_or_policy} + | Conflicted{incompatible_observations} + +PolicyEvaluation = Permit | Deny | NotApplicable | Indeterminate + + selected_combining_algorithm + policy_version + obligations/advice + +ProviderEnforcement = ObservedAccepted | ObservedRejected | NoObservation + + provider + session/request id + expiry + observed_at +``` + +`Deny` is not `NotApplicable`; `NotApplicable` is not `Undetermined`; *absence of a row* is not an authoritative negative unless the relevant source/query has a complete and scoped negative certificate. The policy-combining algorithm is source-specific and versioned. Never choose `deny-overrides` by default merely because a paper or an IAM product supports it: XACML 3.0 has several algorithms and a richer Indeterminate space. [OASIS XACML 3.0](https://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html) is the reference contract [R], not evidence of a shipped XACML engine in LG [H]. + +**Existing nearby [G]:** `dir_sim::actors::RoleEvidence` already distinguishes `Held`, `NotHeld`, `Undetermined`, `NotDeclared` for a declared role under its own documented group-policy completeness checks. The proposed cross-domain proof is a *narrow extension*, not a reinterpretation of that API. + +### Completeness as first-class evidence [H] + +Represent read scope and coverage for each authority: + +```text +ObservationCoverage { + source, tenant_or_realm, object_kinds, predicate_subset, + snapshot_or_cursor, page_window, source_version, + authoritative_for, complete: yes|no|unknown, + observed_at, read_scope, retention_policy +} +``` + +A successful paginated read can still be incomplete (partial sync, missing page, insufficient privileges, filter mismatch). Closed-world negative proofs require **all relevant** sources, policy domains and time intervals to be complete, not merely one green source read. Distinguish `Some([])` from `None` in OGAR GroupRolePolicy as current dir_sim already does. + +**Falsifier IAM-16:** remove a data page containing the alternate granting path. An apparent `Absent` must become `Undetermined`; never permit deletion just because the narrower observation looks empty. + +## 2. Four temporal coordinates and a coherent authority vector [H] + +Never equate: +- **valid/effective time:** when the grant, role, device compliance or policy purports to apply; +- **observation time:** when a source response was obtained; +- **record/ingest time:** when this fact was durably appended; +- **decision/execution time:** when a caller asks or an external PDP authorizes an action. + +Persist a coherent query envelope, conceptually: + +```text +QueryEnvelope { + source_versions: {AD:v7, Entra:e12, HR:h5, MDM:m8}, + policy_versions: {group_role:p9, conditional_access:ca3}, + canonical_schema_seal, prepared_method_seal, + effective_as_of, read_snapshot_horizon, observation_cutoff, + scope, tenant, query_purpose, witness_budget +} +``` + +Source versions form a **vector**, not a single global monotonically increasing `VersionId`. An atomic multi-system snapshot is **not** established simply because each source was read at some time. A user request may: +1. Refuse a consistency-sensitive conclusion with `MixedVersion`; +2. report bounds as of a declared observation cut; or +3. use an explicitly weaker “best-effort” comparison with stale-source badges in a UI (never silently promote to verified live access). + +Tests: out-of-order observations, policy edited between two reads, source clock skew, delayed HR termination, v7 replay after provider has advanced to v9. A historical positive should never silently become a *present* execution grant. + +## 3. Identity equivalence as a *proofed relation*, not string equality [H] + +`ExternalIdentityBinding(source, namespace, tenant, source_guid, canonical_id, link_rule, rule_version, verified_anchor, confidence/status, valid_interval)` is a relation, not a claim that equal UPN/displayName/mails are unique. DN is location. ObjectId (Entra), objectGUID (AD), SCIM id, hrPersonId, app account id and workload principal are different identities until explicit verified mapping. + +**Crucial counterexample:** A AD and B cloud share `anna@example.com` during reassignment; a former user's SIDHistory could grant access. A naive coalescing keyed on mail merges two people and falsely preserves authorization. Another: two authoritative AD forests yield equal-looking `sAMAccountName`; never cross realm boundary. + +Only treat `same_actor` as equivalence *inside declared scope*, from an approved anchor rule. A link's confidence belongs to epistemic matching, **not** RBAC delegation. Transitivity of `CORRESPONDS_TO` needs a separately proven anchor logic; otherwise collision chains A≈B≈C can create privileges. + +**IAM-17/18:** UPN reuse or source-namespace collision cannot merge identities; ambiguous many-to-many binding explicitly refuses inherited roles. Include machine/service identities, managed identities, API principals and emergency accounts; do not assume every principal has a human HR lifecycle. + +## 4. Access paths form an AND/OR proof, not a simple line [H] + +A grant chain may require *all* conditions (member AND active policy AND correct device AND within time) while authorization can have *alternative* paths (group A OR role B). Policy **deny** may override multiple valid grant witnesses. Standard provenance polynomial intuition is helpful, but Boolean edge reachability alone loses constraints and can leak sensitive intermediate memberships. + +Proposed normalized explanation: + +```text +EntitlementClaim(actor, action, object, context) + Witness(W1) = member(A,G1) AND security_enabled(G1) AND grant(G1,R) + AND role_allows(R,action,object) AND policy(p1) + Witness(W2) = direct_app_assignment(A,app) AND app_role(app,R) + Constraints = effective_time AND device_posture AND explicit_exclusions + Unknowns = unread_policy, stale_session, unresolved_anchor ... +``` + +**One witness vs complete support:** `RoleEvidence::Held` supplies a *concrete* path, not a full provenance enumeration. For `revoke_preview`, evaluate effective role/entitlement **before and after** using the existing versioned oracle. Do not infer loss from the disappearance of a chosen witness. Cycle detection and a bounded witness budget are mandatory. + +**Negative explanations:** use “failed derivations + completeness” for `why_not_access?`, not merely no positive path; [arXiv:1701.05699](https://arxiv.org/abs/1701.05699) provides a database provenance research model for failure/negation [R], not an OGAR implementation guarantee. + +**Cut sets / minimal interventions:** propose a *candidate* set of changes that disables all surviving grant paths **subject to** SoD, business continuity and effect-authority constraints. Minimum-cardinality cut is not necessarily least-risk intervention. Counterfactual success does not prove a causal claim about observed production session behavior. + +**IAM-19/20/21:** double-path removal preserves access until both paths are closed; empty role result with incomplete sources remains Unknown; explicit deny + permit respects the selected external policy algorithm. + +## 5. Approval, SoD and lifecycle as temporal policy, not attributes [H] + +Represent: +- **Separation of duties:** mutually exclusive capabilities, policy authority and expiry; include combinations of directory + app roles, not just group names. +- **JIT/PAM:** grant/approval with time-to-live, one-time session authorization, break-glass purpose, session receipts; approval ≠ privilege issuance, issuance ≠ session accepted, revocation ≠ session termination. +- **Joiner/Mover/Leaver:** HR effective time, account creation and delayed deprovisioning; a mover can both lose and gain privileges with a risky overlap window. +- **Nonhuman lifecycle:** app secrets, service account owner, key rollover, workload identity, orphaned automation privileges; never treat a robot identity as a human with no HR record. +- **Delegation and impersonation:** actor, on-behalf-of principal, scope, consent, session and authority must stay separate; propagated identities do not authorize their own scope expansion. + +**Policy robustness question:** can a pending role assignment or a later independent policy extension violate a proved SoD invariant? [arXiv:2603.13181](https://arxiv.org/abs/2603.13181) studies robust policy properties under extension [R]. Transferring its logic requires an explicit policy language and proof rules [H]. A one-time point-in-time check is not a proof under all possible policy changes. + +**IAM-22/23/24:** SoD remains violated even when conflicting roles derive from different sources; expired JIT grant fails before actual execution; a new policy extension invalidates a certificate unless it satisfies the proved stability preconditions. + +## 6. A provider operation is an audited protocol, not a mask-risc side effect [H] + +Keep `D-IAM-SAG-0` read-only. A *future separate PR* can specify: + +```text +ProposedChange -> SimulatedImpact -> Human/Policy Approval + -> Fresh Authorization (actor+resource+verb+scope+purpose) + -> Provider Preconditions (source ETag/version, policy rev, target identity) + -> External Call (idempotency strategy, declared retry semantics) + -> Provider Receipt -> Re-observation -> Verified/Unverified outcome + -> Optional compensating proposal +``` + +At every step, keep `requested`, `approved`, `applied`, `verified` distinct. A failed or timed-out provider call creates **UnknownOutcome**, not “not applied”, because retry can duplicate side effects. Compensation can fail and is not automatically rollback of all consequences. + +**SCIM interoperability:** [RFC 7643](https://www.rfc-editor.org/info/rfc7643) defines its resource model; [RFC 7644](https://www.rfc-editor.org/info/rfc7644) covers PATCH, conditional ETags and optional provider capabilities. SCIM PATCH is atomic **for one resource request** in the described protocol; this is not a multi-provider transaction. Conditional `If-Match` depends on provider support. Do not generalize that all Graph/AD/PowerShell endpoints support it. + +**IAM-25/26/27:** stale ETag refuses mutation; timeout after provider success yields UnknownOutcome requiring re-observation before retry; compensating a group change does not claim to terminate existing IdP/PAM sessions. There are zero external calls in the documentation PR. + +## 7. SAG method evidence and safety-proof boundary [H] + +[D-SAG-1](software-awareness-graph-v1.md) projects prepared MethodTable methods, lowered programs and compiler refusals. It **does not** establish that a method may read every tenant's identities or execute a privileged action. + +Propose a *sidecar receipt*: + +```text +PreparedIAMRead { + method_key, class_full_id, schema_seal, semantic_reading, + source_versions, policy_versions, required_field_mask, + row_scope_and_actor_context, compiler_verdict, body_digest +} +``` + +- `WideFieldMask` selects **columns**; tenant-/actor-scoped row authorization is an independent predicate/gate. +- `Tier::Compiled` proves a lowered program exists, not correct domain meaning. `Tier::Verified` needs real oracle/certificate including source versions and query scope. +- `Tier::Hypothesis` never becomes `authorized` even if confidence is high. +- The Quack one-hop limit remains [B] for general entitlement closure; use existing `dir_sim::actors` only for its scoped role evidence. `D-CMH-G1-4` / `D-SAG-1-4` relation carrier remains open. + +**IAM-28/29:** same method changes schema seal or tenant row scope: stale certificate refuses; a `WideFieldMask` containing salary/secret fields cannot bypass row-level authorization or expose hidden explanation edges. + +## 8. Observer / ONA / Shannon focus without authority [H] + +Separate the subject graph **(source + policy)** from the software graph **(SAG prepared method/evidence)** and from a speculative observer's **attention state**. Never write observed facts simply because an inference appeared credible. Proposed optional experiment: + +```text +Missing/Contradictory Evidence (coverage gap, policy conflict, stale method) + -> rank read-only questions under budget (value of information) + -> select next source read / provenance query / dir_sim ablation + -> replay and compare resolved cases, cost and false alerts + -> create explanatory proposal and falsifiable test (not provider action) +``` + +Three independent measures: +1. data entropy/surprisal over observed attribute distributions; +2. epistemic uncertainty about claims given dependency-aware evidence; +3. operational severity/risk and effort (policy-grounded, not entropy-derived). + +**Conjecture:** a budgeted observer may reduce *unanswered* identity questions at lower query cost. Do not claim better identity decisions without an oracle. [arXiv:2602.16708](https://arxiv.org/abs/2602.16708) argues that agent policy enforcement must live outside prompts, using policy-relevant decision points and observability contracts; it is a reference proposal, not proof a deployed LG reference monitor exists. + +**IAM-30/31:** observer-on vs observer-off has identical effective role decisions for the same pinned data; adversarial retrieved notes or user-supplied code suggesting `execute()` never cross the capability boundary. + +## 9. Model-checking / metamorphic test grid + +In addition to IAM-01..15: + +| ID | Deliberately broken assumption | Expected falsification | +|---|---|---| +| 16 | incomplete page/scope looks closed | `Undetermined`, not `Absent` | +| 17 | UPN reassigned between people | no cross-person role carryover | +| 18 | alias/transitive uncertain anchors A≈B≈C | refuse accidental cross-tenant merge | +| 19 | alternate path survives mutation | entitlement still effective | +| 20 | missing proof of negation | cannot issue complete `why_not` | +| 21 | explicit deny alongside permit | versioned combining algorithm governs | +| 22 | role conflicts from two providers | SoD check detects effective conflict | +| 23 | JIT expiry / break-glass event | expired grant refused; session separately known | +| 24 | later policy extension | invalid/stability-qualified invariant certificate | +| 25 | SCIM conditional write conflict | version precondition stops effect | +| 26 | provider success followed by timeout | UnknownOutcome, re-observe before retry | +| 27 | compensation attempted after privilege session | does not claim revocation of session | +| 28 | compiler result reused after schema or actor-scope drift | certificate invalid | +| 29 | WideFieldMask selected private column | row/field authorization still controls visibility | +| 30 | ONA priority changed, observations fixed | factual/policy answer remains bit-identical | +| 31 | malicious note fakes approval | zero executable authority gained | +| 32 | evidence order/permutation changed | same versioned result and witness set | +| 33 | source observation replay duplicated | no extra evidence or duplicate licenses | +| 34 | same principal 1000 paths, cyclic nested groups | bounded deterministic closure; no combinatorial explosion | +| 35 | observed policy/HR time lag | no present authority from stale history | +| 36 | software graph `MayRequire` with no compiled body | never labelled deployed | +| 37 | no user-readable clearance for sensitive witness | redact/refuse explanation without changing decision | +| 38 | tenant filter removed from one relation join | cross-tenant test goes red | +| 39 | two simultaneous provisioning plans | conflict / idempotency gate; no double license | +| 40 | license source precedence and exchange recipient mismatch | preserve proved primary SMTP and existing license; unsupported mapping refuses | + +The reference evaluator must be **separate from the optimized implementation**, small and explicitly bounded, not a hidden general-purpose graph runtime. Define test generator seeds, exact source graphs, policy/version seals, expected status, completeness and whether each proof is one-witness or exhaustive. A disable-run counts only when the named test goes red and the original is restored. + +## 10. Proposed release train, with stop points + +- **P0 (no shipping):** decide formal status vocabulary, source coverage and policy versioning; independent oracles for grant and absence. Publish test vectors IAM-16..21. +- **P1:** read-only `dir_sim` role impact + witness scope, multi-source completeness receipt *as a sidecar*; no new runtime/registry. +- **P2:** canonical identity link evidence, partial observability and version vector; guard tenant/security scope at all joins. +- **P3:** legal multihop relation carrier when D-CMH-G1-4 unblocks, plus SoD/JIT graph projections; no live enforcement. +- **P4:** SAG certificate linkage, redacted explanation query and observer ablation; never produce authorize tokens from beliefs. +- **P5 (different PR, explicit review):** provider adapter contract, reference monitor, conditional writes, receipts and reconciliation; default read-only. Until then `do()` is inert. + +**Non-goals:** don't reinvent XACML, SCIM, OpenNARS, Hyperon, a general authorization PDP/PEP, a new R2IL opcode, tenant identity mint or directory writes. Treat identity security and privacy review as gating work, not an afterthought. + +## 11. Architectural falsification that can collapse the whole thesis + +If fully correct explanations of negative claims and policy decisions require a second independent authorization engine *because the current Quack/OGAR/dir_sim interface cannot legally express its proof obligation*, **stop** rather than hide a new runtime behind a hotplug. Document the smallest missing primitive, parity target, data/edge witness cost and authority boundary. That is an informative result. + +The high-signal hypothesis remains narrow: **the same SoA substrate can host independent typed readings of identity, policy, evidence and software methods**, while the meaning of those readings and the authority to act stay separately governed. \ No newline at end of file From 3b89b4931ab2e2cdbc480c551763383ba2911683 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:31:11 +0200 Subject: [PATCH 16/46] research(arxiv): add context-attention and costly-anticipation primary-paper excerpts --- ...ent_attention_active_selection_excerpts.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 .arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md diff --git a/.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md b/.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md new file mode 100644 index 000000000..a6834f318 --- /dev/null +++ b/.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md @@ -0,0 +1,113 @@ +# D-SAG-2: bounded context attention, costly exploration and correctness-first uncertainty + +**Date:** 2026-10-12. **Mode:** primary-paper **abstract-level paraphrases**, not verbatim quotations, no code implementations or D-SAG performance claims. Some papers have detailed methods/results not reproduced here; CC must read and pin an exact PDF version before claiming detailed parity or method reproduction. Companion: [deferred contracts](../.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md). + +## A1. Liu et al. (2023): *Lost in the Middle: How Language Models Use Long Contexts* + +**Paper:** Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni and Percy Liang, [arXiv:2307.03172v3](https://arxiv.org/abs/2307.03172), TACL 2023. **Source:** abstract, main experimental conclusion. + +**Excerpt (paraphrase).** A longer input does not guarantee useful access to relevant evidence. In multi-document QA and key-value retrieval, the authors find that changing the **position** of relevant context can substantially change model performance; models often do best when the critical item is near the beginning or end and degrade when it is buried centrally. + +**Proposed D-SAG transfer:** provide a brief intent-specific context slice placing *critical semantic guards and source evidence* clearly, not a high-degree neighbor dump. Measure context ordering as a factorial dimension separately from length, and do not presume an extra-long context window fixes omissions. + +**Falsifier:** identical source facts returned in different order cause different correct-patch outcomes, or an important population/NULL law is buried by low-value nodes. A smaller graph context that drops a necessary law still fails. + +**Boundary:** findings are for models/tasks tested in the paper, not a measured law for Claude Code 2026. + +## A2. Phan et al. (2024): *RepoHyper: Search-Expand-Refine on Semantic Graphs for Repository-Level Code Completion* + +**Paper:** Huy N. Phan, Hoang N. Phan, Tien N. Nguyen, Nghi D. Q. Bui, [arXiv:2403.06095](https://arxiv.org/abs/2403.06095), current abstract describes an RSG, graph expansion and link-prediction refinement. **Source:** abstract. + +**Excerpt (paraphrase).** Repository context can be discovered by first locating relevant code, then expanding through semantic relations, then refining the candidate set; the paper reports stronger code-completion performance than its tested baselines. + +**Proposed D-SAG transfer:** `resolve → one Quack hop → rank/budget → optionally expand`. Critically, unlike RepoHyper's own engine, D-SAG #1509 currently only supports its proven one-hop `ScatterOrU32` query. Document `UnsupportedMultiHop` rather than imitating an expanded walk with a new interpreter. + +**Falsifier:** link prediction provides plausible but compiler-unverified method dependencies; returning them as `Compiled` or `Verified` is illegal. Keep link prediction (if used) in `Hypothesis`. + +## A3. Ouyang et al. (2024/2025): *RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graph* + +**Paper:** Siru Ouyang et al., [arXiv:2410.14684](https://arxiv.org/abs/2410.14684), originally submitted 2024, revised 2025. **Source:** abstract. + +**Excerpt (paraphrase).** Repository-level relationships support code agents on tasks where single-file/function representations omit relevant structure. The authors report improvements when integrating a repository graph with several tested agent frameworks and on another repository benchmark. + +**Transfer:** **source-symbol** navigation is worth comparing with `CLAUDE.md`/grep, but a source dependency graph is neither a semantic ClassId ontology nor a Quack method compiler. Link the two with explicit source-to-method witnesses. + +**Falsifier:** a trait impl or code-generated source reference is missing, and the graph incorrectly claims 'no callers'. Compare against compiler-backed navigation and independent source oracle. + +## A4. Song & Xu (2017): *A Contextual Bandit Approach for Stream-Based Active Learning* + +**Paper:** Linqi Song and Jie Xu, [arXiv:1701.06725](https://arxiv.org/abs/1701.06725). **Source:** abstract and stated motivation. + +**Excerpt (paraphrase).** Many bandit formulations assume reward observation is free; active learning under costly labels must trade off information received against the cost of asking. This study explores contextual bandits that selectively request costly feedback and communicates prior information alongside queries. + +**Proposed D-SAG transfer:** an optimization experiment is an **action with cost**, not free knowledge. Select whether to benchmark a candidate by considering current uncertainty, expected utility, impact and time/CPU budget. Compare information-gain choices against a simple random/impact-priority scheduler. + +**Falsifier:** an ONA-like policy spends more compute acquiring performance receipts than it saves in later plan selections. A model that only optimizes per-execution cycles while ignoring exploration cost is incomplete. + +**Boundary:** theorem/regret results for that paper's formal problem are not an automatic guarantee for method-selection or NARS evidence in lance-graph. Do not transplant reward or confidence formulas. + +## A5. Shi et al. (2026): *Code Is More Than Text: Uncertainty Estimation for Code Generation* + +**Paper:** Yuling Shi, Caiqi Zhang, Yuexian Li, Haopeng Wang, Yeheng Chen, Nigel Collier and Xiaodong Gu, [arXiv:2606.09577](https://arxiv.org/abs/2606.09577). **Source:** abstract. + +**Excerpt (paraphrase).** Uncertainty about code has multiple dimensions, including lexical fragility, algorithmic intent/implementation divergence and functional behavior that can be executed and tested. The authors evaluate complementary signals rather than identifying one entropy score as a substitute for functional verification. + +**Proposed D-SAG transfer:** distinguish (1) uncertainty about retrieval/identity, (2) semantic legality of a proposed transform, and (3) performance prediction dispersion. Source-backed compiler/test evidence outranks surface language confidence. Use uncertainty to **route to validation**, not to certify a patch. + +**Falsifier:** a low-entropy proposed edit violates a sealed ClassView or gives wrong independent oracle output. The guard rejects it regardless of its model confidence. + +## A6. Rakasi et al. (2026): *When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation* + +**Paper:** Pranav Rakasi et al., [arXiv:2608.14659](https://arxiv.org/abs/2608.14659). **Source:** accessible abstract-level search result; **paper PDF not independently inspected for this note**. + +**Excerpt (abstract paraphrase).** The authors report that simple uncertainty-driven code self-correction does not consistently increase correctness in their tested model/benchmark settings, while correction guided by executable verification is more consistently useful. + +**Transfer:** the ONA-inspired selector should direct attention toward *checks and experiments*, not self-certify a generated patch from its own assessed confidence. Compare prediction-only to verification-gated policy. + +**Falsifier:** 'confidence revised upward' but executable tests fail. Code correctness remains false even if the hypothesis scorer likes the patch. + +**Boundary:** do not copy paper-specific numerical scores or claim universally superior verification across all models. Their evaluation is not a benchmark of our architecture. + +## Research synthesis: two different attention problems + +The analogy to foveation/saccades is useful only when made operational: + +**Context attention (model-facing):** select the smallest sufficient facts, source references, tests and proof obligations under a model-visible token budget. Local graph queries spend CPU/IO, not model inference. Expansion later costs additional returned tokens. Measure correct dependency recall and patch correctness, not merely textual compression. + +**Experiment attention (system-facing):** select the next *safe and informative* experiment under a CPU/energy/time budget. A new receipt may reduce hypothesis uncertainty, or reveal a semantic incompatibility that forces refusal. Measure regret/calibration/benefit net of experiment cost; no observed outcome is not the same as negative evidence. + +```text + Same qualified software graph + | + +--------------+--------------+ + | | + Local context lens Experiment lens + which facts to show? which legal probe to run? + | | + bounded evidence predicted outcome + | | + Claude + citations independent execution + | | + source-aware change measured receipt + | | + tests and review revised hypothesis +``` + +The two lenses may share typed graph infrastructure and provenance but **must not** share unchecked authority: a high-interest concept is not a true concept; a frequently cited source is not a verified source; a predicted improvement is not a demonstrated optimization. + +## Proposed experiment ladder + +- **F1:** graph vs greedy symbol/LSP retrieval with identical 4K input-token budget. Preserve mandatory semantic guards; compare patch correctness and critical dependency recall. +- **F2:** vary context ordering, same total tokens and facts. Does order change performance? +- **F3:** compare random, highest-degree and evidence-coverage-based one-hop selection. Record graph query costs. +- **F4:** add source edit between requests, verify stale/dirty worktree invalidation. +- **F5:** select optimization experiments via random, impact heuristic, historical cost and ONA-inspired anticipation; register predictions before receipts and use held-out selectivity/CPU tiers. +- **F6:** ablate execution receipts, perturb evidence ancestry, keep exact final method answer. Does any claimed self-modeling benefit survive? + +**Required log fields:** repo/branch SHA, worktree digest, graph generation, source-index version, task identifier, compiler version/features, model/runtime budget, prompt/tool token accounting, missed gold dependencies, oracle pass/fail, CPU/data versions, cold index time and confidence/uncertainty methodology. + +## Sources + +[2307.03172](https://arxiv.org/abs/2307.03172) · [2403.06095](https://arxiv.org/abs/2403.06095) · [2410.14684](https://arxiv.org/abs/2410.14684) · [1701.06725](https://arxiv.org/abs/1701.06725) · [2606.09577](https://arxiv.org/abs/2606.09577) · [2608.14659](https://arxiv.org/abs/2608.14659). + +**Negative finding is allowed:** if an LSP-backed source index handles normal coding tasks better, reserve Quack/SAG for what conventional tools lack: ClassId readings, law/refusal/physical-program provenance and bounded optimization hypothesis queries. From 2ea0f7e9cf1fbbe6dfd49c55295c1d0efdb49a24 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:31:50 +0200 Subject: [PATCH 17/46] research(iam): distill why-not provenance, robust policy and agent gates --- ...e_authority_and_agentic_policy_excerpts.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md diff --git a/.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md b/.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md new file mode 100644 index 000000000..ecbaa5d86 --- /dev/null +++ b/.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md @@ -0,0 +1,100 @@ +# IAM negative provenance, robust policy and action gates: second research distillation + +> **2026-10-12 / source-aware design notebook, no implementation.** Companion to [D-IAM-SAG-1](../.claude/plans/iam-substrate-frontier-gaps-v1.md), [D-IAM-SAG-0](../.claude/plans/iam-substrate-sag-dir-sim-v1.md) and [the earlier primary excerpts](2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md). +> +> **Method:** short *paraphrased* abstracts or named-section extracts; the publication may support a claim about its own formalism but does not prove a cross-system IAM implementation. Each entry explicitly labels **Source result [R]**, **LG transfer hypothesis [H]**, **test/falsifier**, and **non-transfer**. No long verbatim excerpts. The references were checked against the primary arXiv/OASIS/IETF landing pages. Newer arXiv material is a research proposal unless a cited evaluation establishes a narrower claim. + +## N1. Why *not* access? Provenance with negation + +**Primary:** Seokki Lee, Sven Koehler, Bertram Ludäscher, Boris Glavic (2017), *Efficiently Computing Provenance Graphs for Queries with Negation*, [arXiv:1701.05699](https://arxiv.org/abs/1701.05699), abstract, firing-rule technique and query-focused provenance computation. + +**Exzerpt [R], abstract (sinngemäß):** An explanation for a missing query result needs to account for derivations that fail, not only positive output tuples. The work rewrites Datalog rules to expose successful and unsuccessful derivations, handles negation, and prunes irrelevant portions of the provenance graph. Its evaluated implementation executes relationally in SQL. + +**LG hypothesis [H]:** Positive `RoleEvidence::Held` already has a concrete SID-chain witness. Negative `why_not_access` should require an explicit domain-closure certificate (which sources/groups/policies have been read) and a *failed derivation*, not just an empty bitmap. An authorized negative decision and an indeterminate read are different outputs. + +**Falsifier:** remove an unread source page that holds an alternative grant; `why_not_access` must stop claiming complete absence. Two equal negative results under different coverage must carry different provenance. **Non-transfer:** the paper does not claim that a directory oracle is closed-world or that arbitrary Cypher/Quack multi-hop negation already lowers. + +## N2. Robustness under future policy extension + +**Primary:** Alexander V. Gheorghiu (2026), *Verification of Robust Properties for Access Control Policies*, [arXiv:2603.13181](https://arxiv.org/abs/2603.13181), abstract, robust-support judgment and compositional proof theorem. + +**Exzerpt [R], abstract (sinngemäß):** Policies are often incomplete or assembled from components. The paper defines properties that remain guaranteed regardless of unspecified pending choices and later policy extensions, proves a monotonicity property for *that support judgment*, and reduces verification to a finite proof search in second-order logic programming. + +**LG hypothesis [H]:** An SoD rule proven at policy version p7 may or may not remain safe after external grants at p8. Store the assumptions and version constraints under which a certificate is robust; if the native policy language does not support this proof, invalidate its use after policy changes. + +**Falsifier:** add a second role grant from another provider after the approved snapshot. A point-in-time `no SoD conflict` proof must not remain valid unless its stated robustness assumptions are met. **Non-transfer:** the theorem does not assert that all enterprise policy combinations are monotone or that OGAR policy has implemented the paper's logic. + +## N3. External enforcement for agentic proposals + +**Primary:** Nils Palumbo et al. (2026), *Formal Policy Enforcement for Real-World Agentic Systems*, [arXiv:2602.16708](https://arxiv.org/abs/2602.16708), v3, abstract, policy-independent reference monitor and observability assumptions. + +**Exzerpt [R], abstract (sinngemäß):** Encoding permission rules solely in a language model prompt provides no formal guarantee. The authors describe a policy monitor over program execution context with an observability service, an assume/guarantee contract and Datalog rules, and evaluate several agentic use cases. Any formal guarantee is conditioned on the environment contract. + +**LG hypothesis [H]:** ONA/Hyperon-inspired introspection can rank read-only identity questions and generate proposals; *permission to mutate* must instead come from an external actor/scope/capability gate with a fresh source/policy precondition. Prompt text, SAG tier and a derived truth score never mint authority. + +**Falsifier:** feed the observer a forged administrator note, an apparent `Tier::Verified` dependency and a stale approval; run identical query data. No provider-capable action should be reachable. **Non-transfer:** citing FORGE does not mean LG already has a reference monitor or Datalog interpreter. + +## N4. Policy conflict resolution is specific, typed and often indeterminate + +**Primary standard:** OASIS (2013), *eXtensible Access Control Markup Language (XACML) Version 3.0*, [OASIS Standard](https://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html); policy/rule-combining algorithms, decision types and obligations. + +**Exzerpt [R], combining algorithms (sinngemäß):** Deny-overrides prioritizes Deny under defined precedence rules; permit-overrides, first-applicable and only-one-applicable differ. NotApplicable and different kinds of Indeterminate cannot be replaced by a Boolean “no grant”. + +**LG hypothesis [H]:** An IAM graph may *project* `PolicyEvaluation{Permit,Deny,NotApplicable,Indeterminate}` with the versioned declared combining algorithm and obligation status. It must not “invent” a universal deny-overrides rule. This is a read-only semantic adapter, not production XACML enforcement. + +**Falsifier:** one positive group role path + explicit deny, then switch the *declared* combining algorithm and test the expected (possibly indeterminate) outcomes against a reference evaluator. Missing condition must not turn into `Permit`. **Non-transfer:** an enterprise IdP need not use XACML semantics even if graph policy looks similar. + +## N5. SCIM is an interoperability protocol, not a distributed transaction + +**Primary standards:** IETF [RFC 7643](https://www.rfc-editor.org/info/rfc7643) (SCIM core resource schema); [RFC 7644](https://www.rfc-editor.org/info/rfc7644) (SCIM protocol), specifically §§3.5.2, 3.14, 4 and the Bulk section. + +**Exzerpt [R], RFC 7644 (sinngemäß):** SCIM supports conditional updates using ETags where offered, PATCH with atomic semantics for the *single resource request*, and service-provider configuration discovery. The specification does not make writes across independent directories and SaaS products one ACID transaction. + +**LG hypothesis [H]:** a future action connector needs capability discovery, source version/ETag, a purpose-scoped approval, provider idempotency semantics, and a receipt. If a provider returns timeout with uncertain effect, do not immediately repeat a destructive request or claim failure; re-observe. + +**Falsifier:** issue a synthetic duplicate request after a simulated post-success timeout, verify only one intent is reconciled; stale If-Match refuses. **Non-transfer:** SCIM read/write features may be unsupported by an individual provider. Not every AD/Graph/PowerShell endpoint is SCIM. + +## N6. Pre-commit policy conflicts and emergency access are domain-specific + +**Primary:** Nasif Muslim, Jean-Charles Grégoire (2026), *An Extended Consent-Based Access Control Framework: Pre-Commit Validation and Emergency Access*, [arXiv:2603.07004](https://arxiv.org/abs/2603.07004), abstract, pre-commit conflict checking and emergency disclosure constraints. + +**Exzerpt [R], abstract (sinngemäß):** In a healthcare consent setting, the authors propose checking contradictory permissions *before activation* and constrain emergency access using context-sensitive evidence. Reported experiments use controlled synthetic workloads. This is a narrow domain design, not a universal break-glass algorithm. + +**LG hypothesis [H]:** simulate privileged activation and SoD-policy conflicts before a change is made; preserve separate emergency *reason*, human approval, valid interval and session evidence. Emergency access must never arise simply because a reasoning model estimates high urgency. + +**Falsifier:** proposed emergency role with no declared break-glass authority is refused; a valid but expired emergency grant remains non-executable. **Non-transfer:** no health-data or emergency semantics are part of standard OGAR IAM policy unless explicitly imported. + +## N7. Prior provenance complexity remains a release gate + +**Primary:** Marco Calautti et al. (2023), *The Complexity of Why-Provenance for Datalog Queries*, [arXiv:2303.12773](https://arxiv.org/abs/2303.12773), abstract and complexity results; also detailed in the first IAM excerpts. + +**Exzerpt [R], abstract (sinngemäß):** Computing witnesses for recursive Datalog why-provenance is intractable in some studied cases, whereas nonrecursive cases are substantially more tractable. Practical SAT-based experiments are reported. + +**LG hypothesis [H]:** witness search must expose a budget, whether a result is one-path/exhaustive, and the size of the claimed source closure. Negative access explanations and minimal interventions require stronger claims than a single positive witness. + +**Falsifier:** thousands of overlapping grant paths plus a group cycle, with a fixed query budget: refusal/incomplete result is allowed, silent false “no access” is not. **Non-transfer:** no automatic performance result for Quack, nor a proof that each IAM graph instance requires SAT. + +## N8. Existing reference on evidence independence + +**Primary:** Audun Jøsang (2007), *Cumulative and Averaging Fission of Beliefs*, [arXiv:0712.1182](https://arxiv.org/abs/0712.1182), fusion/fission sections. Prior extract: [NARS evidence notes](2026-10_nars_self_epistemic_needs_evidence_primary_excerpts.md). + +**Exzerpt [R] (sinngemäß):** dependent observations require different fusion from independent observations; removal of a known contributor can require original evidence and preconditions. The formalism is Subjective Logic, not automatically NARS. + +**LG hypothesis [H]:** one HR event relayed through AD and Entra is one upstream *event*, not three independent confirmations. Separate the observation receipt from its derivations; when simulating ablation, remove the upstream contribution and recompute downstream effects at one pinned version. + +**Falsifier:** replicate the same HR event through two adapters, replay both, and verify that license evidence does not gain an artificial second source. A fully independent event may contribute separately. **Non-transfer:** the current F/C register does not encode all dependency information needed for exact fission. + +## Synthesis / decision map + +| Research result | Immediate safe reuse | Need to build | Never infer | +|---|---|---|---| +| Negation/why-not provenance | `dir_sim::RoleEvidence`'s explicit Undetermined | source-scope closure and failed-derivation receipt | missing edge = denial | +| Robust properties | versioned policy tests | certificate assumptions and policy-extension invalidation | all policies monotone | +| Agentic reference monitor | independent `do()` boundary | provider authorization and effect receipts (later PR) | SAG confidence authorizes action | +| XACML decision algebra | explicit evaluation outcome types | binding of declared policy-combining semantics | universal deny-overrides | +| SCIM ETag and PATCH | provider contract checklist | read-only capability discovery before any future write | cross-system atomicity | +| Pre-commit conflict checking | `dir_sim` what-if simulation | SoD/JIT policy rule projection | emergency inference is permission | +| Recursive provenance | bounded witnesses and explicit completeness | legal Quack relation carrier/parity | one path is full explanation | +| Dependent evidence | source receipts and delta lineage | evidence ancestor equivalence semantics | two adapters = two independent facts | + +**Priority:** start with negative-proof completeness and multi-source identity/temporal provenance in a *read-only* follow-on, not a new engine or a DO integration. This literature supports sharper falsifiers; it does not certify implementation. From 15a798d4a7ece365401933b65cf02fb2d70cc86f Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:31:50 +0200 Subject: [PATCH 18/46] docs(D-SAG-2): specify deferred truth maintenance, bounded cognition and 18 adversarial falsifiers --- .../sag-wisdom-frontier-hard-problems-v1.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 .claude/plans/sag-wisdom-frontier-hard-problems-v1.md diff --git a/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md b/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md new file mode 100644 index 000000000..c9473d293 --- /dev/null +++ b/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md @@ -0,0 +1,143 @@ +# D-SAG-2.1: deferred hard problems in the wisdom frontier + +**Status:** RESEARCH ONLY. Extension of [D-SAG-2](sag-wisdom-frontier-ona-hyperon-v1.md) on PR #1511, based on merged #1509. Nothing here is a shipped feature, performed experiment, authorization, or production ABI decision. [Source excerpts](../../.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md). + +## H1. Four distinct epistemic quantities + +Prerequisite debt, probabilistic uncertainty, causal identifiability and intrinsic motivational urgency are NOT the same numerical object. + +For a finite, declared prerequisite universe U, define masks R (required), K (established), F (refuted), and X (unread/inaccessible). Then: + + conflict = (K & F) | (K & X) | (F & X) + missing = R & ~(K | F | X) + blocked = R & F + unavailable = R & X + debt = popcount(missing) + +Reject or surface conflict rather than resolving its overlap by bitwise precedence. A zero debt means ready to independently validate, not true. R outside the declared U is a typed refusal. X is NOT negative evidence, especially for IAM security. + +Unknown prerequisites can have alternative sufficient sets. Popcount of their union overestimates how many questions must be answered; compare each eligible alternative, accounting for shared roots without exponential unbounded DNF expansion. + +A one-bit missing source that requires expensive, unauthorized remote work can cost more than a three-bit set answered from a local index. Popcount is a cheap structural feature, never a proxy for time, expected information gain or causal effect. + +## H2. Fractal-like recursion is not mathematical self-similarity + +A stage-0 anchor generates predictions, whose contradicted relations can begin their own seven-to-zero maturation cycle. A real graph is not necessarily a tree: it has joins, cycles, repeated ancestry, high-degree hubs, alternative derivations and versioned scopes. Do not claim a fractal dimension or infinite recursion from a recursive diagram. + +Seed the frontier with verified stage-0 anchors only under explicit experimental provenance. Carry typed identifiers (ClassId, schema seal, reading, source revision, candidate identity, evidence epoch, scope) and a causal record for why a candidate was enumerated. + +Each bounded exploration epoch has a stable snapshot, seed list, budgets for work and source access, a candidate dedup key, hop/row limits, cancellation token, per-anchor cap, and a declared deterministic ordering. Budget-exhausted is INCOMPLETE, not a fixed point. A real fixed point requires a finite, fully explored closure. + +## H3. Incremental retraction and truth maintenance + +Merged #1494 measured small test-local hydration and anchor ablation. That is not yet a general incremental truth-maintenance algorithm. + +Fixture: independent root r0 grounds A; A supports B; B supports C; independent root r1 also supports B. Remove r0. A must reopen, but B and C may still be grounded via r1. Remove r1 next. B and C reopen. Never blindly erase every descendant and never retain a stale descendant after its only support disappears. + +Cycle: A -> B -> C -> A with no external root must stay unresolved. With one external root it can ground according to declared rules. Removing that root must not re-ground the component using cached children. Newly adding a *different* independent root later may ground it again, but cannot inherit a phantom root from the first cycle. + +**Independent oracle:** after EVERY delta, replay the entire immutable evidence-event history into a fresh scalar full-recomputation oracle. Require equality of resolved/open sets, independent root sets, maturation, refusal reasons, and eligible proposed actions. Only then evaluate delta update work. Differential Dataflow and seminaive evaluation provide research analogies, not a demand for another engine. + +Events include insert, retract, independent-source correction, schema/readings change, rule revision, permit revision and explicit source inaccessible. An unread source must never silently become empty. Test every event ordering that should commute and declare where real-time observations cannot commute. + +## H4. Multiple layers of identity and freshness + +Test-local proposal record: + + (source_revision, schema_seal, class_id, reading_id, + relation_identity, evidence_epoch, original_root_ids, + derivation_ids, computation_version, authorization_scope) + +Test-local auditable decision record: + + (snapshot, program_identity, compiler_version, candidate_set_hash, + evidence_cutoff, reference_rank, challenger_rank, gate_features, + tie_break, budget, intention_id, permit_id, outcome_receipt_id) + +This is NOT an ABI and is NOT a cryptographically signed receipt. #1509 has a within-build FNV/Debug-derived digest that cannot be assumed stable or collision-resistant across builds. A cryptographic audit claim would require canonical serialization, keys, signature scheme and a threat model. Do not retrofit one by assertion. + +A result cannot remain verified after its schema, class reading, provenance source or compiled program changes without a new check. Use source and data snapshot sealing to prevent temporal look-ahead. + +## H5. Motivation, Rubikon and controller stability + +OpenPsi-like demands select *what to investigate*, not permission to act. Keep four distinct records: epistemic statement, goal desirability, committed intention, and permitted effect. + +Proposed cognitive work states: + + Candidate -> Deliberating -> GoalCommitted -> PlanReady + -> PermitPending -> Executing -> Evaluating + -> Done | Replan | Hold | Disengaged | Revoked + +Checks: +- Equal demands plus reversed iteration order produce the same choice, and different winning demands map to meaningfully different goals (OpenPsi PR #117 is an unmerged upstream proposal at time of initial audit). +- Demand fluctuation every tick must not discard each previously committed plan. Measure goal-switching hysteresis against fast response to genuine contradictions. +- High-entropy curiosity may not starve a low-interest but necessary task forever. Report fairness/age quota as an explicit policy, not a hidden CE64 meaning. +- Impossible goal vs delayed-but-feasible goal must be distinguished. Authorization denial cancels dispatch but need not refute the goal itself. +- Every conditional action must re-check current cue, schema, capability, actor/subject and permit. A previous goal commitment is not authorization. + +## H6. Three kinds of causal validation + +1. **Graph support ablation** deletes an anchor in an isolated copy and measures which *derived statements* reopen. That establishes dependence on current proof/rule machinery. +2. **Causal intervention** changes a variable under specified structural/experimental assumptions and measures its outcome. This may require authorized simulated effects. +3. **Model criticism** checks whether all offered causal hypotheses might be wrong; high posterior confidence inside a misspecified model does not establish external truth. + +Do not call (1) proof of (2). Do not ascribe (1) or (2) to CARE arXiv:2606.14581, whose transferable mechanism is executable challenger/reference selection with a pre-outcome commit gate. + +Falsifiers: correlated evidence counted twice, ablation-sensitive derivation with false real-world cause, absent true mechanism from all rival models, observationally unidentifiable causal relation, rehydration masquerading as new independent evidence. + +## H7. Evaluate information seeking against misspecification + +A valid EIG requires a declared calibrated probability model over rival hypotheses and their observation likelihoods. NARS f/c and CE64 readings are not probabilities by default. + +Always compare FIFO, confidence, typed popcount, raw Shannon, calibrated EIG, EIG with model-discrepancy checks, OpenPsi-like demand, and a separate CARE challenger gate. Freeze the inference engine when changing selection policy. Freeze selection when changing native ONA/Hyperon/PLN inference semantics. + +Two traps: irreducible noisy-TV randomness (high entropy, no learnable structure), and confident-but-wrong finite hypothesis sets (internally large EIG for the wrong model). Include calibration and held-out model criticism, EIG vs out-of-distribution interventions, and negative/silence controls. + +Treat pragmatic task value, epistemic learning value, causal testability, work and authorization as independent dimensions. Use Pareto and matched-budget curves before multiplying quantities into an arbitrary scalar objective. + +## H8. Physical cost and limits + +One popcount instruction is fast; generating a high-degree multigraph frontier is not automatically fast. Explore path explosions, duplicate nodes, alternate proof roots, memory contention, source fetch, Quack compiler, mask cardinality and receipt storage. + +Measurements must include graph enumeration, root validation, queue management, decoding, IO, skipped/refused work, compile/validation, replay and cancellation. Evaluate chains and branching (1,4,16,128), shared descendants, cycles, stale-codebook churn and duplication storms. Claim a speedup only after equal correctness and all-in costs are measured. + +Do not add a 64-field schema limit merely because a prototype uses a u64 mask. Make mask width a declared domain or use a typed multiword bitset. Multi-hop operations remain blocked in #1509 unless a separately verified legal relation-carrier path exists. No shadow traversal VM. + +## H9. Cross-engine oracle matrix instead of parity marketing + +For ONA native, ONA-through-MeTTa-NARS, Hyperon MeTTa, modern PLN/PeTTa and OpenPsi, capture raw input, temporal vs eternal event, raw f/c or truth object, derivation roots, rule IDs, answer alternatives and multiplicity, order contracts, selected goals, actual operations, runtime flags, source SHA, and stderr. + +Only compare fields represented under both semantics. Unsupported is a legitimate outcome. Never normalize away disagreement between ONA time handling and MeTTa binding multiplicity, invent an official CARE benchmark, or call a fixture a cross-engine law without executing pinned oracles. + +## H10. New adversarial ledger: proposals only + +| ID | Fixture | Red condition | +| --- | --- | --- | +| A16 | Required / known / refuted / unread masks | Unread becomes false or conflict is hidden | +| A17 | Alternative support r0/r1 after retraction | Useful derivation lost or ghost support retained | +| A18 | Grounded and ungrounded reopened 3-cycle | Reopens and falsely regrounds itself | +| A19 | Delta permutations vs full recomputation | Inconsistent final proof/root sets | +| A20 | One expensive debt vs three cheap debts | Popcount declared optimal cost | +| A21 | High fanout with bounded queue | Budget exhaustion reported as fixed point | +| A22 | All candidate models wrong | High EIG called causal discovery | +| A23 | Pre-outcome cutoff under challenger scoring | Any future outcome leaks | +| A24 | OpenPsi tied demands reversed | Different goal selected by row order | +| A25 | Novelty storm and blocked task | Starvation or oscillating commits | +| A26 | Committed intention with canceled permit | Actual effect dispatched | +| A27 | Graph ablation vs causal intervention | Derivation dependence labeled causal truth | +| A28 | Mutated method body/seal/compiler/source | Stale proof accepted | +| A29 | Stage-0 anchor adjacent to private IAM edge | Cross-scope exploration | +| A30 | ONA eternal vs temporal, MeTTa alternatives | Non-equivalent rules coerced | +| A31 | Same evidence after fixed point | Reward/stage grows without new root | +| A32 | Cancel during execution race | Stale operation after cancellation | +| A33 | Alternative prerequisite sets overlap | Union-popcount misranks | + +Each implemented row must have independently derived expected result, positive fixture, negative/silence twin, guard-disable -> red, restore -> green, seed, provenance and complete cost. All rows remain unexecuted research specifications. + +## H11. Research release sequence and stop conditions + +A0 audit current source and exact code API -> A1 four-state scalar masks -> A2 retraction vs full recomputation -> A3 existing Quack one-hop parity -> A4 calibrated attention -> A5 pure Rubikon/OpenPsi simulation -> A6 reference-conditioned CARE receipts -> A7 pinned ONA/Hyperon differential oracles -> A8 self-introspection proposal that is NOT auto-applied. + +Stop if a run changes production CE64[50..52] plasticity, uses [59..63] as desire, invents independent observation roots, bypasses a live authorization check, mistakes budget exhaustion for proof closure, silently implements a new traversal engine, or reports a fused H1 speedup before the actual terminal exists. + +**Open operator questions:** Is there a legal relation carrier for multihop? What provenance format can pin support sets under deletions? Which calibration data can be released? Would promoting maturation require its own declared semantic encoding or a versioned sidecar rather than stealing plasticity bits? Record decisions; do not silently choose them in this PR. From 2951ffab11c36772fd08022a5b4135e030f53cdf Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:31:57 +0200 Subject: [PATCH 19/46] docs(sag): cross-reference deferred contracts and research falsifiers --- .../software-awareness-agent-context-ona-v1.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.claude/plans/software-awareness-agent-context-ona-v1.md b/.claude/plans/software-awareness-agent-context-ona-v1.md index 81eb5b1e0..14f22bf97 100644 --- a/.claude/plans/software-awareness-agent-context-ona-v1.md +++ b/.claude/plans/software-awareness-agent-context-ona-v1.md @@ -142,3 +142,19 @@ Keep three signals separate: syntax-level MDL redundancy, epistemic uncertainty Proceed beyond W1 only if the graph returns a **smaller and at least equally correct**, source-backed context slice than the strongest conventional baseline, with bounded indexing/invalidations. Proceed beyond W3 only if the receipt+revision loop improves prediction or decision over a simple history-based selector. Otherwise retain the read-only graph context service and stop. References: [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), [#1504](https://github.com/AdaWorldAPI/lance-graph/pull/1504), [#1508](https://github.com/AdaWorldAPI/lance-graph/pull/1508), [#1495](https://github.com/AdaWorldAPI/lance-graph/pull/1495), [#1359](https://github.com/AdaWorldAPI/lance-graph/pull/1359), [#1311](https://github.com/AdaWorldAPI/lance-graph/pull/1311), and companion `.arxiv` notes. + +## 9. Deferred contracts now expanded (research-only) + +The first documentation pass intentionally left implementation detail unresolved. The explicit contracts and negative fixtures are now written out in [D-SAG-2 deferred contracts](software-awareness-agent-context-deferred-contracts-v1.md), including: + +- source-symbol versus OGAR/MethodKey identity, version/worktree freshness and atomic graph generations; +- `resolve/context/impact/propose/expand/explain` proposals as bounded, read-only, typed calls; +- one-hop Quack mechanics and refusal on unsupported multi-hop; +- mandatory correctness facets, query budgeting, delta slices and explicit coverage omissions; +- deterministic local propositions with witnessed edges, prompt-injection treatment and authority separation; +- receipts, prediction registration, observer-recursion protection, CPU-tier validity and baseline ablations; +- independent retrieval, execution and learning economics and a stop/go ladder. + +The [attention and active-experiment excerpts](../../.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md) add paper-grounded controls from Lost in the Middle, RepoHyper/RepoGraph, costly active learning and verification-first code uncertainty. + +**Scope remains unchanged:** these additions are specifications and source reviews, *not* executable features or measured gains. Any follow-up CC run should start with W1's one-method one-hop proof, not implement every proposal simultaneously. From 918edc029fe807c854e1b270ed0b4db7cc576f28 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:31:59 +0200 Subject: [PATCH 20/46] docs(sag): cross-reference deferred contracts and research falsifiers --- ...-sag-2-ona-agent-context-implementation.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.claude/prompts/d-sag-2-ona-agent-context-implementation.md b/.claude/prompts/d-sag-2-ona-agent-context-implementation.md index c2bf66d28..28b614c15 100644 --- a/.claude/prompts/d-sag-2-ona-agent-context-implementation.md +++ b/.claude/prompts/d-sag-2-ona-agent-context-implementation.md @@ -144,3 +144,22 @@ Do not broaden into general NAL-9, new ISA bytes, source rewriting or a UI until One method, one revision-scoped context query and one independent oracle; one explicit pre-registered performance prediction and measured revision; and a quantified comparison showing whether this approach beats simpler context retrieval without losing correctness. The ambition is *local architectural memory with addressable evidence*, not an invisible second agent. + +## Deferred research addendum: read before broadening the implementation + +This initial prompt was intentionally a minimal falsifier. For the deeper alternatives and rigorous edge cases, read: + +- [Addressable context, identity/freshness, foveated selection, receipts, experiment economics and 15 negative fixtures](../plans/software-awareness-agent-context-deferred-contracts-v1.md). +- [High-signal arXiv excerpts: context ordering, graph retrieval, costly experiment selection, code uncertainty and verification](../../.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md). + +**Do not silently ship those deferred proposals in W1.** Select the smallest experiment that can break the hypothesis. Implement `context` for one real #1509 `MethodTable` method and one Quack hop; add a source provenance witness; test negative controls. Escalate to incremental symbol indexing, ONA receipt selection, extra graph hops or Claude adapter only after independent correctness and efficiency gates pass. + +Further research probes to retain in the ledger: +- intent-specific **evidence coverage**, token ordering and a mandatory-law budget overflow refusal; +- `HEAD` vs dirty-worktree cache invalidation and macro/trait-call incompleteness; +- a bounded `DeltaSlice` protocol which cannot invent context absent from the model's prior accessible history; +- experiment cost versus expected information gain, separate from materialization/cycle benefit; +- source-verified low-level dependency facts versus source prose/LLM claims; +- ONA-style prediction ablation, receipt replay on another layer, CPU-tier and selectivity shift, and static/history-model controls. + +When reporting results, distinguish `TokenEstimate` from tokenizer-counted `ModelInputTokens`; `LogicalMaskOps` from `MaterializedBytes`; `CpuTier` from observed code generation; and `ObservedOutcome` from `VerifiedCausalEffect`. From 70c56418924652312a62ed55adf41a4baa084d41 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:32:16 +0200 Subject: [PATCH 21/46] docs(iam): link frontier proof and authority research from base RFC --- .claude/plans/iam-substrate-sag-dir-sim-v1.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.claude/plans/iam-substrate-sag-dir-sim-v1.md b/.claude/plans/iam-substrate-sag-dir-sim-v1.md index c269b9c53..77b588e6c 100644 --- a/.claude/plans/iam-substrate-sag-dir-sim-v1.md +++ b/.claude/plans/iam-substrate-sag-dir-sim-v1.md @@ -168,3 +168,18 @@ See [primary-source excerpts](../../.arxiv/2026-10_iam_access_paths_temporal_pro - IAM-01..15 test matrix with disable/falsification evidence; one passing end-to-end `explain -> simulate -> re-evaluate -> propose` demo. - Measurement table (baseline, candidate, environment, versions) before any performance claim. - Security review showing external provider writes impossible in read-only mode; no unreviewed policy/byte-layout/ISA drift. + +## 11. Frontier expansion after the first draft: deliberately **not** a shipped capability + +**Follow-on RFC:** [D-IAM-SAG-1: negative proof, temporal authority, safe introspection](iam-substrate-frontier-gaps-v1.md) and its [source-distilled excerpts](../../.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md). The [Claude Code handoff](../prompts/iam-substrate-after-1509.md) now carries the additional research and falsification obligations. + +The first 15 tests primarily cover *positive* entitlement evidence and directory what-if. The extension adds IAM-16..40, grouped by proof obligation: + +- **Proof of absence:** complete source/policy coverage, failed derivations, witness exhaustiveness and alternate paths. A shortest path is not a sufficient revocation proof. +- **Proof of identity and time:** verified cross-tenant anchors, source GUID distinct from DN, source/policy version vectors, observation-vs-valid-vs-record-vs-execution times. +- **Proof of policy:** versioned decision-combining algorithm, explicit Permit/Deny/NotApplicable/Indeterminate, SoD/JIT/approval expiry, bounded negative explanation. +- **Proof of action:** actor-scoped independent authorization, fresh provider preconditions, idempotency/unknown-outcome receipts, provider-specific compensation, no automatic rollback guarantee. +- **Proof of introspection:** SAG compiled vs verified tiers, actor row scope independently checked from WideFieldMask, ONA/Hyperon observer evaluated by no-observer ablation with no authority transfer. +- **Proof of responsible explanation:** tenant-scoped/redacted witness output, machine identities, duplicate-source lineage, adversarial prompt injection and cyclic/high-path-count workloads. + +**Release order:** maintain W0/W1 as the smallest read-only implementation. Research the expanded test fixture now; implement only when its domain's existing semantics and compiled oracle can be verified. General multi-hop, policy evaluator and provider DO remain independent later work. These are *candidate requirements*, not claims of new Rust code or completed review. From d0b996643f47777c1f4fa04875d243da66581bb9 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:32:29 +0200 Subject: [PATCH 22/46] docs(sag): extend D-SAG-2 with observability, ONA no-op, causal and holdout falsifiers --- ...ervability_metamorphic_holdout_excerpts.md | 93 +++++++ ...re_awareness_ona_ruff_research_excerpts.md | 5 + ...ility-causality-and-evaluation-addendum.md | 228 ++++++++++++++++++ ...awareness-graph-v2-ruff-ona-closed-loop.md | 7 + ...software-awareness-graph-v2-claude-code.md | 14 ++ 5 files changed, 347 insertions(+) create mode 100644 .arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md create mode 100644 .claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md diff --git a/.arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md b/.arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md new file mode 100644 index 000000000..5243fb7d9 --- /dev/null +++ b/.arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md @@ -0,0 +1,93 @@ +# Supplemental research excerpts: ONA observability, adaptive holdouts and metamorphic software awareness + +**Date:** 2026-10-12. **Scope:** source-grounded *paraphrased excerpts*, implementation constraints and red tests expanding D-SAG-2. **Not implementation evidence.** +**Companion:** [operational falsification addendum](../.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md). +The `.arxiv` folder is a curated literature shelf, not a claim that every item is published on arXiv. Links to journal/conference PDFs are separately identified. No long quotations are reproduced. + +## 1. Hammer & Lofthouse (2020), *'OpenNARS for Applications': Architecture and Control* + +Primary conference PDF: https://agi-conf.org/2020/wp-content/uploads/2020/06/AGI-20_paper_52.pdf (AGI 2020, 11 pages, printed pp. 1–11). +**Location:** §2 Architecture (printed pp. 2–4); §3 Data Structures (printed pp. 5–6). + +**Research excerpt, paraphrase:** ONA's application-oriented architecture replaces aspects of older OpenNARS control with an event-selected, bounded priority process. A cycling event selects relevant concepts, which are checked for evidential overlap before inference. Semantic inference and sensorimotor/temporal procedural inference are separated. Every event has a term, NAL truth value, evidence stamp, occurrence time, and priority. In §3 an implication of the form `(a, operation) ⇒ b` can predict an outcome, and its evidence changes when the outcome is or is not observed. The authors describe *Assumption of Failure*, where initial negative evidence can be outweighed by later positive evidence, rather than using a strict anticipation deadline. + +**Specific transfer:** SAG can define a counterfactual prediction receipt and a later observation receipt, but *must not* transfer assumption-of-failure to an open-world/static harvester wholesale. Absence is meaningful only for a complete observable predicate on the expected snapshot and interval. The narrower SAG model permits pending, incomplete and unobservable predictions. + +**Probes:** (a) same event stamp encountered via multiple derivations must not become independent evidence; (b) deliberately disabled Ruff predicate does not count as failed prediction; (c) positive result arriving late must not irreversibly corrupt another snapshot; (d) event priorities alter which facts are inspected, never authorization or the truth of compiler verdicts. + +**Limit:** event-handling, capacity and evidential overlap are described by the paper; this does not verify a specific API, NAL-9 self-observation implementation, or CE64 byte layout in ONA. + +## 2. ONA issue #286 (2024), *Do-nothing operator* as an explicit research ambiguity + +Primary implementation discussion: https://github.com/opennars/OpenNARS-for-Applications/issues/286 +**Location:** issue description discussing `Concept::precondition_beliefs`, `Decision_Anticipate` and the special operation index 0. + +**Excerpt, paraphrase:** An issue contrasts including or excluding index 0 when traversing operation precondition beliefs. Its author asks whether do-nothing and ordinary operation slots should be distinguished. This is a question on the issue page, **not** proof that the proposed interpretation was accepted or implemented. + +**Transfer:** distinguish SAG's explicit `NoOp` intervention from a read-only `Probe` and an OGAR-gated `ExternalMutate`. A no-op provides a genuine causal baseline for spontaneous data drift, instrumentation overhead and false-positive prediction of change. Do not infer that ONA's operation code 0 is equivalent to SAG's action or source mutation. + +**Red test:** a no-op A→B reharvest incorrectly creates a semantic dependency delta or a verified action effect. + +## 3. Dwork et al. (2015), *Generalization in Adaptive Data Analysis and Holdout Reuse* + +Primary arXiv: https://arxiv.org/abs/1506.02629; related https://arxiv.org/abs/1411.2664. +**Location:** abstracts and holdout-reuse framing; mathematical guarantees are specific to the proposed algorithms, not automatically available to SAG. + +**Research excerpt, paraphrase:** When an analyst repeatedly adapts hypotheses after inspecting evaluation outcomes, even a held-out dataset can be overfit through reuse. The work studies how to answer adaptively selected questions while preserving generalization; simply calling a test "held-out" is insufficient once its feedback has guided development. + +**Transfer:** split the D-SAG-2 corpus by repository and edit family into development, selection-validation and truly protected final evaluation. Log how many times an oracle is consulted. Freeze the policy and hypothesis set before the protected test and treat an already disclosed fixture as development material. + +**Falsifier:** measured adaptation disappears on unseen edit families; the method looks strong only after being tuned to a repeatedly queried mutation corpus. + +**Non-claim:** SAG is not implementing the paper's formally private or statistically valid holdout mechanisms; it adopts the leakage hazard and conservative evaluation discipline. + +## 4. Li et al. (2024), *Metamorphic Relation Generation: State of the Art and Visions for Future Research* + +Primary arXiv: https://arxiv.org/abs/2406.05397. +**Location:** abstract and systematic-review framing. + +**Research excerpt, paraphrase:** Metamorphic testing addresses situations where a fully specified output oracle is hard to construct, by asserting an expected relationship between inputs and outputs after a known transformation. Metamorphic relations themselves need generation, validation and applicability checks. + +**Transfer:** record the predicate and known applicability conditions of source transformations (whitespace, declaration order, safe renaming, extension-view locator edits, full vs incremental harvest, A→B→A' revert). Neither a successful identical checksum nor a single matching SUM is proof of broad semantic equivalence. + +**Falsifier:** SAG considers reordered Ruby mutation/raise events equivalent merely because an unordered field-fact set matches. + +## 5. Duque-Torres et al. (2023), *Bug or not Bug? Analysing the Reasons Behind Metamorphic Relation Violations* + +Primary arXiv: https://arxiv.org/abs/2305.09640; related pipeline proposal https://arxiv.org/abs/2310.00338. +**Location:** abstracts and proof-of-concept description. + +**Research excerpt, paraphrase:** A violated metamorphic relation is suspicious, but may reflect violated applicability preconditions rather than a defect in the program. Their work investigates how to refine constraints and explain these violations; it does not claim all MR violations are bugs. + +**Transfer:** when Ruff reassembly drops unsupported core-7 fields or when C free function calls are deliberately absent from SPO, parity failure may indicate an unsupported projection, not a miscompilation. Label as `Unsupported`, `Incomplete`, or `Refuted` with separately justified semantics. + +**Falsifier:** the validation runner files a "fixed" runtime bug by inventing a triple that the source frontend never promised to emit. + +## 6. Operational synthesis for lance-graph SAG + +A deliberately small sequence, inspired but not equivalent to ONA: + +1. Pin immutable source A and metadata describing what Ruff can observe. +2. Select one source-graph proposition and an intervention from a declared candidate pool. +3. Commit a falsifiable forecast *before* observing B, including expected result, scoring universe and deadline. +4. Use an independent run to observe B and attach the collector completeness receipt. +5. Count independent evidence sources, not duplicated derivation paths or repeated hypothesis layers. +6. Revise only hypotheses when observations are admissible; keep compiler authority and OGAR policy untouched. +7. Compare against no-feedback, shuffled-feedback and no-op controls on protected, unseen edits. + +A positive adaptation claim needs a **difference in next decision attributable to receipt feedback**, plus a predeclared improvement measure on held-out tests. A negative result or explicit `NotObservable` is a correct output. + +This is an *engineering experiment*, not an official consciousness ladder, a port of ONA, a proof of AGI, or an authorization to rewrite source code. + +## 7. Source/version ledger still to pin before execution + +| Component | Source | Status | +|---|---|---| +| SAG base | https://github.com/AdaWorldAPI/lance-graph/pull/1509 | merge `42fa2a347cda22eaaa327bba514f2029cc9daa82` pinned | +| Current documentation | https://github.com/AdaWorldAPI/lance-graph/pull/1510 | branch head subject to PR updates | +| Ruff fork | https://github.com/AdaWorldAPI/ruff | exact test/run commit **not pinned yet** | +| ONA | https://github.com/opennars/OpenNARS-for-Applications | executable commit **not pinned yet** | +| Research OpenNARS | https://github.com/opennars/opennars | separate implementation; **not pinned** | +| Hyperon | https://github.com/trueagi-io/hyperon-experimental | unrelated parity track, **not pinned** | + +No tests, benchmarks or complete ONA/Hyperon parity runs were performed to produce these research excerpts. Preserve that state when reporting this document. diff --git a/.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md b/.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md index 420c5575a..9e9f9bce6 100644 --- a/.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md +++ b/.arxiv/2026-10_software_awareness_ona_ruff_research_excerpts.md @@ -99,3 +99,8 @@ Related merged sources: [#1496 CE64/NAL](https://github.com/AdaWorldAPI/lance-gr ## 10. Reproduction and source restrictions Pin runtime commits and package/tool versions before claiming parity. Cite a versioned test artifact, fixture, input/output and exact operator mapping. Treat peer-reviewed empirical effects, mathematical proofs, and project-specific engineering hypotheses as **different epistemic tiers**. No paper here licenses adding a new byte interpretation, operator, or action privilege without an independently verified insufficiency and explicit owner decision. + +## 11. Further research note (non-shipped addendum) + +The research shelf [ONA observability, adaptive holdouts and metamorphic oracle limits](2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md) adds annotated excerpts from Hammer & Lofthouse's 2020 ONA architecture paper, the ONA do-nothing-operator issue, Dwork et al. on adaptive holdout reuse, and metamorphic testing studies. These sources motivate **P21–P40**, in particular the distinction between an *unobserved* event and an event known not to have occurred in a fully observed window. None is a production semantics change. + diff --git a/.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md b/.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md new file mode 100644 index 000000000..b1986c9d7 --- /dev/null +++ b/.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md @@ -0,0 +1,228 @@ +# D-SAG-2 supplemental contract: operational observability, causal feedback, metamorphic validation, and resource bounds + +**Status:** research and falsifier expansion after #1510's initial documentation commit. **Non-authoritative.** No production behavior, CE64 bit, ISA layout, method registry, policy grant or external action is changed or approved here. + +**READ BY:** Claude Code implementing D-SAG-2-1..5; SAG SoftwareGraph, Ruff AST/SPO harvest, Quack/R2IL, OGAR/dir-sim/HotPlug, and any ONA-inspired feedback or evaluation operator. +**Parent:** [D-SAG-2 plan](../plans/software-awareness-graph-v2-ruff-ona-closed-loop.md). **Execution instructions:** [D-SAG-2 prompt](../prompts/software-awareness-graph-v2-claude-code.md). **Sources:** [.arxiv annotated follow-up](../../.arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md). + +## 1. Not-yet-shipped questions and why they change the experiment + +The original D-SAG-2 deliverables defined predictions and independent observations, but did not fully formalize when **silence** is evidence, how repeated adaptive tests are prevented from overfitting, whether a feedback update is *causally* responsible for later decisions, how non-operation can be a reference action, and what it costs to introspect the introspector itself. + +**Six missing contracts**, all proposed: +1. A negative observation requires a covered, complete, current and functioning observation window. +2. A source-code prediction is not a causal effect estimate merely because it precedes an edit. +3. Feedback credit goes to the originating evidence source, not every derivative graph edge or repeated harvest. +4. The agent must be compared with identical no-feedback, shuffled-feedback and no-op arms on new, held-out edits. +5. Semantic equivalence of programs requires relations over input/output, including ordering and multiplicity, not only triple/set counts. +6. Introspection consumes a fixed, measured compute and memory budget and cannot recursively certify itself. + +## 2. The absence/unknown contract: **not observed** is not **observed false** + +ONA's 2020 architecture describes anticipation and evidence adjustment through *Assumption of Failure* (see paper §3, PDF printed p. 5). That is a mechanism in ONA, **not** a license to assume closed-world completeness for SAG. Static harvesters may miss unsupported syntactic constructs; traces may sample events; the time window may not have closed. Therefore define the proposed test model: + +```text +CoverageReceipt { + collector_id, version, source_revision, snapshot_id, language, + predicate, scope, feature_support: Supported | Partial | Unsupported, + scan_completed, scanned_units, excluded_units, errors, + observation_window_start, observation_window_end +} + +PredictionStatus { + Confirmed, Refuted, Pending, NotObservable, Incomplete, Stale +} +``` + +**Admission rule** for negative evidence: predicate in declared supported set AND exact population covered AND observation end/window satisfied AND scan completed without errors/exclusions AND pinned snapshot valid AND oracle independent enough for the claim. Otherwise return `NotObservable`, `Incomplete`, `Pending`, or `Stale`, and do not change prediction confidence based on absence. + +| Source B outcome | Collector contract | Legitimate inference | +|---|---|---| +| positive hit with matching source witness | supported, fresh, pinned | Confirmed, subject to semantic precision | +| no hit | supported + complete + closed window | Refuted *for that scoped proposition* | +| no hit | unsupported C free-function call edge in Ruff SPO | NotObservable; **not** proof of no call | +| no hit | Odoo XPath predicate unsupported / parent outside tree | Incomplete; not proof of no control | +| no hit | sampled runtime trace misses occurrence | Incomplete unless trace oracle establishes completeness | +| no hit | edit/forecast still in progress | Pending | +| no hit | B reading/seal/version differs | Stale or schema incompatibility, never evidence for current version | + +A predicted *negative* (no impact) is also a real prediction. Use a no-op edit and a semantically inert edit to establish the baseline false-positive rate. + +**First red tests:** deliberately drop one source file after recording a prediction; switch a supported predicate to unsupported without changing code; abort a harvest midway; feed a late event after the observation window; and reorder arrival of equivalent receipts. No case may silently become a failed prediction or a confidence decrease unless its negative-evidence preconditions are satisfied. + +## 3. Time, provenance, and causality are different axes + +Keep **source revision**, **observation/event time**, **ingestion time**, and **decision time** distinct. They are not always equal: a journal or reharvest can arrive late; a branch can rewind; receipt ingestion can happen after a newer prediction. Use a total source snapshot identity for replay and a monotonic append index only for append order. + +Separate these questions: + +- *Who said it?* Collector/provenance and reproducible source artifact. +- *What derived it?* Rule version, input evidence IDs and derivation receipt. +- *When was it true?* Source or device state revision, observation interval, as-of version. +- *When did we learn it?* Ingest/revision sequence. +- *Who was allowed to act?* OGAR action receipt at commit time, independently checked. +- *Would the result differ without the action?* Controlled intervention/no-op twin, NOT observational co-occurrence. + +Minimum proposed `EvidenceKey` for de-dup: originating input SHA/record ID, collector, source revision, observation scope, predicate, asserted event ID. **Do not** use graph-edge ID or layer ID alone; downstream copies are not independent observations. + +A **causal DAG of receipts** may reference sources and derivations without inventing graph semantic causality for the software being analyzed. Two paths from one Ruff AST token via the same ModelGraph are one evidential base, not two independent votes. Two different parsers of the same commit may be separate implementation oracles for correctness *but are not independent evidence of two world events*. + +**Prediction-before-intervention** requires a committed artifact containing (a) exact A revision, (b) frozen candidate/rule set, (c) expected observable delta, (d) source coverage class, (e) scoring rule and (f) machine timestamp or immutable commit order prior to B. Branch A and B names are not enough without commit SHA/hash receipts. + +## 4. A stronger experiment than "we predicted an edited dependency" + +Four controlled interventions over the **same fixture family**, each preregistered: + +| Arm | Mutation | Expected graph property | Why useful | +|---|---|---|---| +| M0 | no source change, rerun harvest | zero semantic delta | oracle, cache and identity stability | +| M1 | whitespace/comment formatting or reorder independent declarations | structural equivalence under declared canonicalization, spans may change | metamorphic normalization | +| M2 | one parent Odoo view / Rails callback / C++ overload change | affected subgraph changes, unaffected subgraph invariant | factual change-impact attribution | +| M3 | misleading new comment, unresolved XPath, omitted module, disabled harvester | abstention/unknown rather than invented witness | epistemic stress test | + +Where semantics allow, run **A→B→A'** (revert) and require the declared semantic graph to return to A while historical receipts remain addressed and immutable. A method's display name can change without changing its authorized caller-issued MethodKey **only** if an explicit versioned correspondence proves continuity; never auto-merge by fuzzy name. + +Metamorphic relation examples to pin as tests: +- Adding irrelevant whitespace must not change the semantic SPO projection except source spans/hashes. +- Permuting independent declarations preserves graph content while source order metadata may differ. +- Swapping Ruby `write; raise` and `raise; write` can have identical unordered W/R/X/C but **must not** be asserted behaviorally equivalent. +- Duplicate source inclusion with the same evidence ID cannot inflate independent confidence. +- A separately repeated *new* independent observation retains independent weight. +- Under supported semantics, full reharvest(A→B) equals incremental reharvest(A→B); if not, caching is not a proof. +- A→B→A' restores the current semantic projection without erasing historical A/B receipts. +- C linkage `static` and C++ static member remain distinct even if labels match. + +For source-only behavior claims, ask for an independent executable test or return `NotObservable`. An AST assertion is not proof of exception ordering, database side effects, or deployment effects. + +## 5. Operational loop versus ONA research vocabulary + +ONA 2020 keeps semantic and sensorimotor inference apart, uses bounded attention and evidence stamps. For a SAG probe we propose the following **behavioral observation loop**, not a literal ONA port: + +```text +read frozen A + -> propose hypotheses H[0..n] + -> choose a test within budget (no side effect by default) + -> commit prediction and observability contract + -> authorized fixture intervention OR select explicit NoOp + -> independently obtain source/runtime result at pinned B + -> classify Confirmed | Refuted | Pending | NotObservable | Incomplete | Stale + -> revise ONLY eligible hypothesis evidence + -> choose the next experiment from a frozen candidate pool +``` + +Observe three classes of operation separately: +- **NoOp**: no source or external change; tests attention and measurement drift. An ONA issue discusses ambiguity around a "do nothing operator" as an implementation question, not a settled semantic analogue for SAG. +- **Probe**: read-only, potentially costly harvest/measurement. Its side effect is **knowledge intake**, not target-program modification. +- **Proposal**: inert suggested code/transformation/action that cannot execute externally before OGAR authorization. + +No unbounded action loops, no automatic source rewriting. A decision to probe is not the same as a commitment to mutate. A failure prediction becomes negative evidence **only** if the collector could have witnessed its expected outcome. + +**Introspection depth budget:** a meta-query about the current SAG must read immutable snapshot k; telemetry about its own execution may enter k+1, never the same query epoch. Terminate cycles by (snapshot, method key, query signature, recursion depth/remaining budget), and return a typed budget/recursion refusal. No new runtime engine is necessary to articulate or test this rule. + +## 6. Adaptive testing can make a self-optimizer hallucinate progress + +Dwork et al. (2015) show why repeated access to an adaptively reused holdout can bias apparent generalization. Our finite source-change test sets have the same conceptual risk. A system that learns which Ruff mutations the benchmark contains can score better without transferable software reasoning. + +Preregister three disjoint buckets, grouped by **repository + edit family**, not random lines: +- **Development:** visible failures may be iterated on; all changes logged. +- **Validation:** limited, counted selection of policies/thresholds; freeze the chosen candidate and feedback law afterward. +- **Protected test:** never exposed during training/selection; one run of final frozen policy and its ablations. + +At protected test time, compare under identical precommitted budget and candidate pool: +- A0: no observation→belief feedback (logging only). +- A1: source-grounded revision enabled. +- A2: shuffled or deliberately stale receipts (negative control; should not improve). +- A3: no-op or heuristic scheduler only (distinguishes information from exploration strategy). +- A4: Oracle-aware abstention enabled versus blindly treating silence as false. +- Optional A5: attention policies FIFO / confidence / naive entropy / calibrated EIG / Staunen under unchanged inference law. + +Report **paired decision-quality difference on unseen edits**, uncertainty intervals where sample size permits, coverage/abstention, false-positive/negative rates under complete supported predicates, calibration for any probabilistic score, discovery per decoded byte, and instrumentation overhead. "Different next decision" is a minimal causal check; "better" requires predeclared utility and held-out evidence. + +If learning works only when evaluation fixtures are visible, or with shuffled evidence, claim **selection leakage** or a weak control, not a cognitive advance. A null result is useful. + +## 7. Attention and CARE: measure the *value of information*, not its aesthetic + +A candidate set of maskable unknown cells is useful as a *search agenda*, not ground truth. `popcount(unknown_mask)` measures how many unknowns are available; it does not measure probability, causal relevance or human-like curiosity. Any prospective 50–52 CE64 CARE/motivation reading must remain a **versioned, typed semantic interpretation**, not an assignment of meaning to the ISA bytes; #1496 records unresolved existing interpretations of those bits. No new semantics are shipped here. + +A falsifiable resource allocator could propose: `score = E[oracle-supported improvement or error reduction | probe] / expected total cost`, estimated only from calibrated historical observations with no future leakage. Compare with FIFO and random, and explicitly count costs for: +- AST/SPO parsing, projection, binding and query lowering; +- mask/lane byte decode, allocations, branch fan-out and materialization; +- oracle invocations, negative controls, replay, merge and retention; +- wasted probes, abstentions and cache misses. + +High Shannon entropy on irrelevant facts must not dominate. Structural redundancy, epistemic uncertainty and execution cost remain distinct axes; hard correctness/security gates dominate any score. If computing exact EIG is unjustified, report that instead of renaming a heuristic "EIG." + +## 8. Action boundaries: hard separation of belief, intent and permission + +The Rubicon research (#1500) describes human commitment/implementation intentions, not software authorization. Define a *proposed* software boundary: + +```text +Hypothesis -> CandidateProbe -> PrecommittedPrediction -> ReadOnlyProbe + -> OutcomeReceipt -> RevisedEvidence -> CandidateProposal + -> OperatorCommitIntent (revocable) -> OGAR Action Gate + -> ExternalActionReceipt -> PostconditionObservation +``` + +A committed intent can become invalid at any point due to role loss, authorization revocation, schema/reading mismatch, stale test receipt or expired universe. Commit checks must be atomic with authorization or otherwise refuse and re-evaluate. #1503's `Undetermined` is not a grant. The operator's approval of a *research PR* is not authorization to perform a production source rewrite. + +Adversarial dry runs: revoke permission between intention and dispatch; switch user's role path to alternate still-valid grant; leave a security group unread; change method seal after commitment; delayed outcome arrives after cancellation. Refuse external mutation without current policy and witnessed capability; do not convert source graph edges into executable actions merely because the same class defines both. + +## 9. Versioned hot-plug and graph custody + +Avoid a parallel method-mint registry. Caller-issued MethodKey is the identity under #1509. Class/field/readings resolve through OGAR's existing ownership; Quack only binds what the active glove/schema declares. Preserve the difference between: +- logical schema shape; +- hotplug activation/version and current permission; +- source-program revision and compiler build; +- read snapshot/persistent Alpha overlay; +- source code harvest provenance. + +**Cross-repository evolution** is a compatibility proof obligation. When Ruff exposes a new predicate, it is not automatically a valid OGAR ontology value. When OGAR adds a method key, it is not a rule to rewrite historic SAG identifiers. Typed unknown/residual is better than casual string fallback. + +Proposed minimal artifact manifest (no new crate): +```text +FixtureManifest { + sag_base_sha, ruff_sha, model_or_method_key, classid, schema_seal, reading_id, + harvester_features, supported_predicates, excluded_sources, fixture_digest, + source_A_sha, prediction_receipt_sha, source_B_sha, oracle_receipt_sha, + collector_version, evaluator_version, cpu_tier, budget +} +``` +If any artifact cannot be pinned, report non-reproducible, not verified. + +## 10. Probe matrix supplement: P21–P40 (not executed) + +| ID | Test/falsifier | Must reject or distinguish | +|---|---|---| +| P21 | complete supported negative observation at B | scoped Refuted allowed | +| P22 | unsupported predicate omitted by Ruff | NotObservable, no negative revision | +| P23 | truncated / failed extraction with omitted module | Incomplete, not Refuted | +| P24 | premature or late event beyond window | Pending/Stale versus negative evidence | +| P25 | no-op source edit plus repeat harvest | zero semantic delta; no fabricated change | +| P26 | formatting/alpha-renaming with explicit identity map | no false semantic diff; no name-based method key | +| P27 | A→B→A' revert, historic receipts retained | current graph restored, history immutable | +| P28 | full versus incremental reharvest at pinned snapshot | same supported predicates/edges | +| P29 | same source via Ruff AST → ModelGraph → SAG | one evidence contributor, no double confidence | +| P30 | same originating event repeated across hypothesis layers | one contributor, not two | +| P31 | two independent sources of same proposition | preserve both contributors | +| P32 | read k while own telemetry appends to k+1 | no recursive contamination or time drift | +| P33 | self-introspection infinite feedback possibility | bounded recursion/typed refusal | +| P34 | no-op operator versus probe operator | separate effect and observational cost | +| P35 | visible-dev success, unseen protected holdout | no hidden adaptive benchmark selection | +| P36 | shuffled/stale feedback control | cannot claim source-grounded learning advantage | +| P37 | mismatch in behavior with equal Ruby unordered sets | behavioral equivalence disallowed | +| P38 | high entropy irrelevant facts vs useful low entropy | report discovery per total budget | +| P39 | role revoked between Rubicon commit and action gate | refusal; intent alone no authority | +| P40 | observation feedback decreases accuracy on new edit family | negative result preserved, not relabeled improvement | + +**Kill conditions:** false Verified, phantom negative evidence, provenance overlap counted twice, unbounded introspective recursion, hidden second evaluator, unpinned test reuse presented as validation, unsupported Ruff fact treated as false, or action past a revoked authorization. Ship a narrow failing fixture and stop broadening until repaired. + +## 11. References to consult before writing code + +- [Hammer & Lofthouse (2020), ONA Architecture and Control, PDF](https://agi-conf.org/2020/wp-content/uploads/2020/06/AGI-20_paper_52.pdf), §§2–3 (queue, stamps, sensorimotor predictions and *Assumption of Failure*). +- [ONA implementation](https://github.com/opennars/OpenNARS-for-Applications) and [do-nothing operator discussion #286](https://github.com/opennars/OpenNARS-for-Applications/issues/286). +- [Dwork et al. (2015), Generalization in Adaptive Data Analysis and Holdout Reuse](https://arxiv.org/abs/1506.02629). +- [Li et al. (2024), Metamorphic Relation Generation](https://arxiv.org/abs/2406.05397) and [Duque-Torres et al. (2023), Bug or not Bug?](https://arxiv.org/abs/2305.09640). +- [SAG #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509); [method composition #1508](https://github.com/AdaWorldAPI/lance-graph/pull/1508); [identity evidence #1503](https://github.com/AdaWorldAPI/lance-graph/pull/1503); [NARS Self #1499](https://github.com/AdaWorldAPI/lance-graph/pull/1499); [PLN/Shannon #1497](https://github.com/AdaWorldAPI/lance-graph/pull/1497); [Rubicon #1500](https://github.com/AdaWorldAPI/lance-graph/pull/1500). +- [AdaWorldAPI/ruff #117](https://github.com/AdaWorldAPI/ruff/pull/117), [#118](https://github.com/AdaWorldAPI/ruff/pull/118), [#120](https://github.com/AdaWorldAPI/ruff/pull/120). + +**No-code constraint:** this file asks future implementers to falsify before changing behavior. No passage is an instruction to rename classes, allocate CE64 bits, widen the ISA, construct a new Quack primitive, execute production changes or assert ONA implementation parity without a pinned source check. diff --git a/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md b/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md index d06a50823..a8cc7f5b6 100644 --- a/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md +++ b/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md @@ -189,3 +189,10 @@ Internal: [#1496](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497] Ruff: [AdaWorldAPI/ruff](https://github.com/AdaWorldAPI/ruff), [polyglot RFC](https://github.com/AdaWorldAPI/ruff/blob/main/.claude/OGAR-POLYGLOT-AST-INTEGRATION.md), [ModelGraph](https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/ir.rs), [C++-only reassembler](https://github.com/AdaWorldAPI/ruff/blob/main/crates/ruff_spo_triplet/src/reassemble.rs), [#117 order](https://github.com/AdaWorldAPI/ruff/pull/117), [#118 C linkage](https://github.com/AdaWorldAPI/ruff/pull/118), [#120 Odoo views](https://github.com/AdaWorldAPI/ruff/pull/120). Primary literature and independent runtimes: see the .arxiv shelf. All external implementation versions are **not pinned for execution yet**. + +## 9. Deferred-probe expansion after initial D-SAG-2 draft + +An additional source-grounded adversarial pass is documented in [SAG observability, causality, metamorphic testing and adaptive evaluation](../knowledge/sag-v2-observability-causality-and-evaluation-addendum.md) with **SAG2-P21..P40**. Its supplemental primary-source shelf is [ONA anticipation, do-nothing controls, adaptive holdouts and metamorphic relations](../../.arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md). + +This expansion does **not** mark a new wave as shipped or authorize new runtime semantics. Before D-SAG-2-3, settle observation completeness, negative evidence admission, independent source stamps, NoOp/Probe/action distinctions, and protected unseen evaluation. Keep introspective telemetry on k+1 while reading k. The 20 new probes are extensions of the original P01–P20, not replacements. + diff --git a/.claude/prompts/software-awareness-graph-v2-claude-code.md b/.claude/prompts/software-awareness-graph-v2-claude-code.md index cc46ebbeb..72fb5a887 100644 --- a/.claude/prompts/software-awareness-graph-v2-claude-code.md +++ b/.claude/prompts/software-awareness-graph-v2-claude-code.md @@ -56,3 +56,17 @@ Track predictions and observed outcomes separately, with timestamps or pinned re - Run plan_dids.py, append_only_gate.py and relevant repository CI gates as applicable; do not claim they passed unless executed. - Avoid status-board inflation: distinguish shipped, measured locally, untested, proposed and blocked. - Do not auto-merge, grant permissions, modify policy, deploy or overwrite source code as a side effect of an awareness conclusion. + +## Required deferred-probe supplement (read before implementation) + +Read `../knowledge/sag-v2-observability-causality-and-evaluation-addendum.md` and `../../.arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md`; they add P21–P40 to the previous P01–P20. In particular: + +- Refutation by missing observation is legal **only** when Ruff/runtime collector positively certifies predicate support, scope completeness, matching frozen revision, successful scan and closed observation interval. Otherwise return `NotObservable`, `Incomplete`, `Pending` or `Stale`. ONA's published *Assumption of Failure* is a research mechanism, not a license for closed-world Ruff assumptions. +- Distinguish `NoOp` causal control, read-only `Probe` (it consumes resources), and inert `Proposal` before any OGAR-gated action. Try A→A no-op, semantic-preserving A→B, real change A→B, and A→B→A' revert. +- Obtain preregistered predicted deltas before editing. Compare full versus incremental reharvest; keep one evidence stamp for multiple pipeline copies of the same source fact; test independent-source twins. +- Use development / validation / protected holdout **grouped by repository and edit family**, not randomly selected lines, and count oracle reuse. On frozen holdout test no-feedback, correct-feedback, shuffled-feedback, and no-op arms with identical budget; record null or negative results honestly. +- Bound self-observation recursion: a Quack query sees snapshot k, its telemetry writes k+1; no query in the same epoch may certify itself. +- Preserve separate source-revision/event-time/ingestion-time/decision-time and treat late receipts or partial coverage explicitly. Never turn attention score, CARE heuristic or popcount of unknown cells into truth/authorization or alter CE64's byte/ISA contract. + +Run the original P01–P20 gates before claiming D-SAG-2 success. The deferred P21–P40 tests are additional hypotheses, not claims of implementation. + From 0f757fb29babd129300050a56d8593085968919d Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:32:43 +0200 Subject: [PATCH 23/46] docs: specify cross-reasoner temporal ablation RFC --- ...d-temporal-ablation-reasoner-oracles-v1.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 .claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md diff --git a/.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md b/.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md new file mode 100644 index 000000000..c8833b63c --- /dev/null +++ b/.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md @@ -0,0 +1,160 @@ +# D-SAG-CF-1: Inverted temporal ablation as a cross-reasoner epistemic probe + +**Status: RESEARCH RFC / NOT AN IMPLEMENTED ADAPTER.** Parent: [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), the merged one-hop Software Awareness Graph (SAG). Relevant siblings: [#1496](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498](https://github.com/AdaWorldAPI/lance-graph/pull/1498). Literature: [research map](../../.arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md). Existing audit: [Gadamer ablation](../research/2026-10-recovery/GADAMER-ABLATION-RESEARCH.md). + +## 0. The question: nine dots, one hidden boundary + +What would the current conclusion, confidence, support set, future prediction and selected decision look like if an **observation**, **rule**, **interpretive method**, or **shared assumption** had never contributed? A further self-introspection experiment asks which conclusions fail when the engine suspends one of its *own* inference procedures. + +A removal from a recorded history is not an inverse update on a compressed belief. A single-edge cut is not enough to establish actual causality under overdetermination. A counterfactual belief must never be written as observed truth. + +Use factual world W0 and detached counterfactual world W_X. For a pinned horizon h, provenance closure P and common execution policy π: + + B0 = Eval(P, history<=h, π) + BX = Eval(P without contributors/dependents of X, history<=h, π) + Shadow(X) = Compare(B0, BX) + +This is initially **model-relative counterfactual dependency**, not automatically real-world causal identification. Pearl do(X) additionally requires a specified structural causal model and intervention semantics. Jøsang subjective-logic fission is a useful analogy, **not** algebraically identical to NARS revision or an inverse of CE64 F/C bytes. + +Three kinds of outputs remain distinct: changed truth/frequency and confidence; changed justification/provenance and certification; changed operational attention/choice. Record each axis separately. No claim of sentience is implied by the word introspection. + +## 1. Existing code seams and their actual limits + +| Seam | Exists | Limit / required interface | +| --- | --- | --- | +| `crates/lance-graph-planner/src/temporal.rs` | HLC/version-aware local causal trajectory deinterlacing; `QueryReference::at`, `EpistemicMode` | DATA-causal dependency closure is explicitly deferred. Default ref `u64::MAX` is **not** a pinned no-hindsight read; use a concrete head. | +| `crates/lance-graph-planner/src/chain_replay.rs` | Shared factual replay and first divergence | Replay-time truth revision can overcount shared evidence: existing Gadamer audit reports that replay_step lacks evidence-base independence guard. Do not trust it as exact retraction baseline until fixed or bracketed by an independent oracle. | +| `crates/lance-graph-planner/src/chain_counterfactual.rs` | Detached single-step cut, same replay kernel, distinct sequence range, counterfactual -6 tag; EdgeRole and threshold verdict | Only one `CutStep`; a threshold verdict can miss support changes, redundancy and joint cuts. | +| `crates/lance-graph-planner/src/pearl.rs` | Limited reason/reaction and intervention-arm comparisons | Not a general SCM do() for arbitrary graphs. Independent `crates/learning/src/scm.rs` exists but is not wired to CE64. | +| `crates/lance-graph-contract/src/revision.rs` | Gadamer claims/revision and counterfactual admission types | Nobody computes an end-to-end CounterfactualVerdict; TruthOnly is not safely equivalent to dispensable. Claim -> chain-step linkage is absent. | +| `crates/lance-graph-glove-parity/src/awareness.rs` | #1509 SAG projection with typed method/program/provenance tiers queried through Quack | In-memory and one hop; cannot silently pass a population mask between independent Quack programs. Needs a legal relation carrier or factored EqU32Via read. | +| OGAR ClassView / schema seal / MethodKey; CE64 / Epi5; mask-risc/R2IL | Existing typed registries and register/ISA interpretation contracts | Caller issues method identity. Never equate 8-bit ISA lanes with NARS fields; interpretations remain typed readings. No new opcodes or registry. | + +Do not describe all these as already connected. This proposal adds the *contract for joining them*, not a second engine. + +## 2. Minimal cross-reasoner contract + +A reasoner adapter is a **read-only export and deterministic replay boundary**. Its hot-side projection is typed ordinals/IDs; strings, Narsese or MeTTa syntax belong at the adapter membrane. + +Required input fields (logical schema; concrete representation deferred to OGAR hotplug): +- `world_id`, `horizon`, `source_version`, `reasoner`, `reasoner_commit`, `config_digest`, `seed`, `cycle_budget`, `allocation_policy`. +- `node_id` + `class_id` and `method_key` + `schema_seal` + `reading_id` where applicable; one stable identity != display label. +- Evidence: `evidence_id`, observed/asserted origin, `evidential_roots` (the actual independence basis), `source_time`, `ingest_time`, temporal event identity; attention/saccade traces **separate**. +- Derivation: `derived_id`, `rule_id@version`, premise IDs, conclusion ID, materialization epoch, bounded-stamp fidelity, admission/selection reason. +- `frequency`, `confidence`, NARS eternal/temporal distinction, and `epi5_class_reading` (not invented CE64 bits). +- Operation: prediction/anticipation, procedure/decision, priority/resource budget and explicit unknown/unsupported status. + +Export event kinds: Observed, Assumed, Derived, Revised, Selected, Evicted, Predicted, Decision, Refused. If internal parentage is not exposed, report **partial provenance** and refuse exact descendant deletion. Never infer parentage solely from identical text or from bounded NARS stamps. + +Ablation specification: + + { target_kind: Evidence | RuleVersion | Method | Assumption, + target_ids: typed IDs, + horizon: pinned version, + mode: observational_leave_one_out | logical_method_suppression + | conditional_contingency | structural_do, + requested_readings: ..., budget: ... } + +Result receipt: + + { factual_world, counterfactual_world, owner, horizon, + target, first_divergence, affected_cone_ids, + factual_and_counterfactual_support_roots, shared_ancestor_ids, + delta_f, delta_c, verdict_before_after, + certification_before_after, predictions_before_after, + decisions_before_after, coverage_grade, cost, refusal_reasons } + +No `structural_do` receipt may claim causal certification if no explicit validated SCM exists. The counterfactual world must be detached and tagged, and all observed rows must be byte-identical to W0. + +## 3. Four ablations, plus the hidden fifth + +1. **Evidence ablation:** Remove observation A everywhere its root contributes, including copies/transitive consequences. Sibling independent B must remain intact. +2. **Rule ablation:** Remove one versioned inference rule R1. Retract and re-evaluate all learned conclusions and procedures downstream from R1. +3. **Interpretive-method ablation:** Keep observation bytes but suppress the *method/reading* responsible for converting them into claims. SAG methods are addressable by MethodKey + seal + reading. +4. **Assumption ablation:** A and B appear independent but share upstream U; remove U and discover both supports collapse. Never use two apparent pathways as independent confidence evidence if their root provenance intersects. +5. **Attention-policy ablation (control):** Hold factual observations/rules fixed, change scheduler or cognitive budget. If conclusions change due to eviction or cycle selection, label the outcome **resource-path sensitivity**, not a demonstrated logical dependency. + +The interesting 'nine-dot' crossing is (3) or (4): the important contributor can lie outside the apparent data graph. The claim is a testable research hypothesis, not novelty established by comparison. + +## 4. Oracle matrix: different systems, different roles + +| Adapter/oracle | Why it matters | First test | Interface/limits | +| --- | --- | --- | --- | +| **ONA** OpenNARS for Applications (C) | Temporal predictions, learned operations, attentional selection, resources | Replay one fixed Narsese history twice with the same build/config/seed/budget; suppress one input *before ingestion*; compare anticipation and procedural choice | CLI `./NAR shell < fixture.nal` and `python3 evaluation.py` are documented upstream. No claim ONA exposes complete derivation ancestry or has a direct retract API. | +| **OpenNARS** (Java) | Evidential stamps, temporal and eternal inference, non-axiomatic revision | Two independent roots vs duplicated evidential root vs partial overlap; distinguish revision from choice | Pin working upstream release and evidence-stamp semantics; bounded stamps are **not** full causal provenance. | +| **Hyperon/MeTTa** | Rewrite rules and rule-as-data make interpretation/method removal explicit | Same atoms, two rewrite rules; remove rule R1 and compare derived graph / trace | Pin interpreter/rewrite semantics and isolation. A MeTTa result is not NARS F/C without explicit mapping. | +| **Differential Dataflow** (Rust) | Independent incremental signed-update execution oracle | Insert/delete roots or rule facts, compare stabilized closure with scratch recomputation | Test lawful joins/fixed points and full proof multiplicity, not just Boolean membership. | +| **Soufflé Datalog provenance** | Independent explanation/proof oracle | Cross-check which tuples and proof trees support C | Minimal-height proof tree != complete support provenance. Exhaust alternative derivations before calling retraction exact. | +| **lance-graph Quack + R2IL** | Candidate optimized execution, typed mask semantics and SAG | Identical observations, outputs and support certificates vs the independent oracle | A one-hop DAG/query only today. No phantom multi-hop lowering, new opcode, or self-modification. | + +Initial engineering order: ONA external black-box first for temporal effects; OpenNARS evidential control; Hyperon method-ablation; Differential Dataflow recomputation oracle; Soufflé provenance audits. An additional **local deterministic truth-table oracle** should be the first smoke test before running any foreign engine. + +## 5. Exact execution protocol (external black-box first) + +0. Pin Git SHA, toolchain, configuration, available resources, seed, cycle budget, query horizon and expected output parser. Normalize output to typed evidence receipts, **not** belief-string equality. +1. Compile or run each upstream reasoner's native upstream tests. Save version/output fingerprints as artifacts, do not vendor engines in the core crate. +2. In W0 ingest one synthetic event sequence, freeze output at a concrete h; repeat W0 identically and require deterministic normalized receipts or document the exact nondeterminism. +3. Build W_X from the **same pristine initialization** with *only* X excluded or R1 disabled at admission. Re-run the complete sequence, including learned rules. Compare at matched logical cycle and event time; do not mix wall-clock timing with logical version. +4. Use a fixed provenance DAG with proof alternatives, materialized derivations, root sets and rule versions; compute descendants. Verify incremental invalidation **against scratch re-evaluation** before attempting shortcut retractions. +5. Query candidate affected rows via SAG/Quack. The current one-hop restriction may require a legal relation-carrier materialization or repeated factored reads; explicitly quantify that cost. +6. Record two costs: whole-world replay and incremental-invalidation path. Compute speedup only after *identical observable outputs*. Attribute costs to ingestion, indexing, join, re-evaluation and I/O; report cold/warm, small/large-cone, density, fanout, cycles, p50/p95 and memory. +7. Produce detached, non-authoritative shadow receipt with `Coverage = Complete | Partial | Unsupported`. No automatic new truth, no causal-bit promotion, no graph transformation, no Rubicon commit. +8. Only after provenance and parity gates pass: feed `Reaction` and mapped `claim -> step` into Gadamer EncounterEvidence; leave TruthOnly unresolved unless the policy explicitly distinguishes redundancy. + +**One-step vs joint cuts:** use bit positions to batch up to 64 *Boolean reachability scenarios* under a proved interpretation. This is **not** 64 CE64 truth replays or 64 SIMD registers. Each non-Boolean NARS revision needs its actual execution or a separately validated vectorization. Rung(0..9), CE64 bit, SIMD lane, scenario ordinal and Alpha overlay owner remain distinct axes. + +## 6. Required fixtures and adversarial falsifiers + +| ID | Fixture | Required outcome / failure signal | +| --- | --- | --- | +| F0 | Duplicate pristine baseline; same version/seed/budget | Byte-equivalent normalized receipts or documented nondeterministic envelope. | +| F1 | A -> R1 -> C, independent B -> R2 -> C; cut A | C survives through B, but support set loses A. | +| F2 | Above, cut R1 | C survives; no stale derivation attributed to R1. | +| F3 | Remove both R1,R2 | C loses all modeled supports. | +| F4 | Two nominally separate paths A,B both depend on hidden U; cut U | Both paths collapse; confidence cannot treat them as independent sources. | +| F5 | Duplicate input A under two aliases; cut A's source root | Both aliases retract; independent B unaffected. | +| F6 | Unrelated contributor X | No change to C, derivations, cert or decision. | +| F7 | A OR B; cut A then conditionally cut B | No but-for flip on first cut; A becomes pivotal under contingency B=off. Do not conclude A cannot be a cause. | +| F8 | A changes truth but not threshold verdict | TruthOnly / support change remains distinguishable from Inert and Necessary. | +| F9 | Delete interpretation method, not stored observations | Original observations remain identical; all and only rule-dependent descendants re-evaluate. | +| F10 | Hindsight injection after pinned horizon | Strict `QueryReference::at` never leaks future rows; default latest sentinel is not accepted as proof. | +| F11 | Cyclic or negated derivations, bounded evidential stamps, evictions | Conservative refusal, SCC/fixpoint or scratch replay; never fabricate complete provenance. | +| F12 | Factual vs detached counterfactual storage | No counterfactual result is certified/committed as observation; -6 tag where existing CE64 replay applies. | +| F13 | Quack one-hop vs multi-hop dependency | No illegal population intermediate; either use approved relation-carrier/eq-via or mark BLOCKED. | +| F14 | Baseline vs differential oracle under insert/delete/reinsert | Exact closure and support-count parity, including multiple derivations and shared root IDs. | +| F15 | Scheduler policy changes under fixed evidence | Changes in emitted decisions are labeled resource-path sensitivity; cannot claim underlying facts changed. | + +The adversarial **disable test** for each gate must actually go red: allow duplicated roots, drop premise dependency, relax horizon pin, or accept a stale method seal; restore afterwards. A green disable run means the guard has no real test. + +## 7. Efficiency question and kill conditions + +If a dependency cone has size k within n recorded facts, a correct indexed deletion/update may avoid scanning all n; **O(k)** is not guaranteed because closure discovery, joins, recomputation, SCCs and provenance fanout have costs. First measure `T_full(n)`, `T_incremental(k,n)` and `T_index(n)`; include index build/amortization and memory. + +Report two performance frontiers: a *small* dependency cone (candidate sparse advantage) and *near-whole-graph* cone (candidate pathological case). Compare to vanilla replay (ONA), Differential Dataflow incremental maintenance, and Quack baseline. KILL incremental optimization at measured regimes where full replay is faster; KILL exact retraction when provenance is incomplete; KILL causal-certification claim without a declared intervention/SCM; KILL method introspection that cannot identify and version the rule actually used. + +Use entropy/expected information gain **only to schedule which falsifiable cut to try next**, not to increase belief confidence. For a budgeted probe choose candidate X using cost-aware expected reduction in uncertainty over hypotheses, then measure its realized discrimination; include random, maximum-confidence and highest-graph-degree baselines. Never require new CE64 bits to store importance, responsibility or entropy. + +## 8. Implementation waves and acceptance gates + +- **W0: Protocol and oracle fixture (this PR).** One pinned spec, references, expected trace schemas and a runnable, dependency-free Boolean/proof-DAG smoke oracle. No external-engine results claimed. +- **W1: ONA shell adapter.** Native fixtures + reproducible external replay; extract stable IDs, evidential origins, temporal predictions and output decisions, mark unknown ancestry Partial. Gate F0,F1,F6,F8,F15. +- **W2: OpenNARS evidential control.** Stamp independence/revision vs choice, duplicate roots and NARS truth-law parity. Gate F4,F5,F11; do not derive exact fission from bytes. +- **W3: Hyperon method-as-data ablation.** Rule/assumption rewrite suppression and inspect alternatives. Gate F2,F3,F9; distinguish model interpretation from source data. +- **W4: Independent incremental oracle.** Differential Dataflow plus Soufflé explanation, full recomputation truth oracle, signed updates and multiset derivations. Gate F7,F11,F14. +- **W5: SAG/Quack projection.** Map to validated OGAR MethodKey, schema seal, typed reading, tier and provenance. Solve the legal multi-hop seam without new engine; gate F10,F12,F13. +- **W6: Gadamer/Rubicon bridge (separate semantic decision).** Claim-to-step identities + distinct Necessary/Redundant/TruthOnly/Unknown admission policy. No automatic writer or intention inference. +- **W7: Bench and active experimental selection.** Bound memory and runtime, ablation selection with entropy/expected information gain; publish all results and negative controls. + +**Review questions before production:** What is the minimum complete evidence root key (not stamp alias)? How can a method/rule be versioned across engines? Are learned rules retracted, or must memory be rebuilt? What does TruthOnly mean at the Gadamer gate? How do we represent incompatible MeTTa and NARS truth semantics without lossy conversion? What is the legally allowed multi-hop Quack carrier? What performance regime actually rewards sparse delta maintenance? + +## 9. Claude Code / implementer prompt + +> Read this RFC, the SAG #1509 plan, Gadamer ablation audit and the research map before writing code. Inventory the exact current commit and the real methods in temporal.rs, chain_counterfactual.rs, chain_replay.rs, revision.rs and awareness.rs. First run the provided synthetic oracle and demonstrate that disabling each guard breaks its named falsifier. Implement **one** external ONA fixture runner at a pinned upstream commit: baseline vs clean-room re-ingestion with one evidence source suppressed; normalize outputs into an explicitly partial receipt. Validate identical baseline executions and do not claim ONA supports retraction without code evidence. Keep the observed history immutable and the counterfactual world detached. Run F0/F1/F6/F8/F15; report the measured output and any inaccessible provenance. Then propose the smallest OGAR/ClassView adapter and an allowed one-hop Quack query. Never silently reinterpret the CE64 register as NARS-specific, invent an opcode, revise factual confidence from a counterfactual, or promote a logical deletion into Pearl causality. Split unresolved semantic decisions into follow-up PRs; no unverified shipped claims. + +## 10. References and traceability + +- Upstream: [ONA C repository](https://github.com/opennars/OpenNARS-for-Applications), [OpenNARS Java](https://github.com/opennars/opennars), [MeTTa / Hyperon](https://github.com/trueagi-io/hyperon-experimental), [Differential Dataflow](https://github.com/TimelyDataflow/differential-dataflow), [Soufflé provenance](https://souffle-lang.github.io/provenance). +- Papers and paraphrased research excerpts: [research map](../../.arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md) and [pre-existing Jøsang/NARS excerpts](../../.arxiv/2026-10_nars_self_epistemic_needs_evidence_primary_excerpts.md). +- Prior work: [#1509 SAG](https://github.com/AdaWorldAPI/lance-graph/pull/1509), [#1496 NARS](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497 PLN/entropy](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498 Hyperon](https://github.com/AdaWorldAPI/lance-graph/pull/1498). Existing [causal-replay plan](dismech-causal-replay-v1.md) and [actual-causality map](../../.arxiv/1608.07879_actual_causality_needs_contingencies_not_just_deletion.md). + +**Explicitly not shipped:** ONA/OpenNARS/Hyperon adapters, causal identification, dependency-complete NARS traces, Quack recursive traversal, proof-correct sparse deletion, CE64 confidence fission, self-modification, or any claimed performance improvement. From 9b53239a87c89f53b2a3f83b826d307a0ee400d9 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:33:00 +0200 Subject: [PATCH 24/46] docs(D-SAG-2): add active inference, robust EIG, curiosity and differential-dataflow excerpts --- ...ve_inference_delta_and_misspecification.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md diff --git a/.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md b/.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md new file mode 100644 index 000000000..58fe12d4b --- /dev/null +++ b/.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md @@ -0,0 +1,77 @@ +# Wisdom frontier: active inference, robust curiosity and incremental reasoning + +**Date:** 2026-10-12. **Status:** Research-only annotated literature shelf (second wave for [D-SAG-2 / PR #1511](https://github.com/AdaWorldAPI/lance-graph/pull/1511)). These are **original paraphrased research excerpts** and engineering transfer hypotheses, not verbatim copyrighted extracts, reproduction of proofs, run logs or benchmark results. This directory includes publisher and project research references as well as arXiv sources; the directory name does not assert that every source is an arXiv preprint. + +Read with [D-SAG-2 architecture](../.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md), [deferred hard problems](../.claude/plans/sag-wisdom-frontier-hard-problems-v1.md), and [first-wave literature](2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md). + +## E01. Friston et al. (2026): active inference and artificial reasoning + +- **Reference:** Karl Friston, Lancelot Da Costa, Alexander Tschantz, Conor Heins, Christopher L. Buckley, Tim Verbelen, Thomas Parr, *Active inference and artificial reasoning*, [arXiv:2512.21129](https://arxiv.org/abs/2512.21129), initially December 2025; [Nature Communications 17, 10125 (published 8 September 2026)](https://doi.org/10.1038/s41467-026-77209-5). Journal version takes precedence for publication details. +- **Paraphrased excerpt:** The authors frame a policy as a sequence of actions selected partly for its expected effect on beliefs over *alternative underlying world models*. Information gain can be formulated through differences between predictive and updated posteriors, while model reduction supports selecting informative tests. They illustrate structure learning in a partially observed three-ball problem associated with synthetic insight. +- **Interesting transfer:** This is a more precise analogue to our stage-0 wisdom anchor than undirected novelty bonuses: an established explanation is useful when it generates **discriminating predictions** that lead to better identification of hidden structure. +- **Crucial nonclaim:** The publication does not validate CE64's eight-stage model, OpenPsi goalSelector, the Rubikon controller or a popcount frontier. Nor does it establish machine awareness in lance-graph. +- **Probe:** Compare model-targeted EIG against raw entropy and popcount on a three-ball-style independently specified hidden-rule fixture. A correct outcome must predict unseen trials, not simply assign every node a smaller debt. + +## E02. Wei (2024): value of information is not arbitrary intrinsic reward + +- **Reference:** Ran Wei, *Value of Information and Reward Specification in Active Inference and POMDPs*, [arXiv:2408.06542](https://arxiv.org/abs/2408.06542) (2024). +- **Paraphrased excerpt:** Examines a connection between expected free energy (EFE), belief-state planning and reward-oriented decisions, including how an epistemic value term relates to information value in partially observable decision processes. +- **Transfer:** Compare EIG-only curiosity with an explicit pragmatic objective and costs, not one unexplained "cognitive pressure" scalar. Stage 0 is maturation; a demand is preference; an authorized action is still a separate event. +- **Falsifier:** A curiosity agent collects maximally informative but operationally irrelevant samples while a cost-aware policy finishes the task. Document assumptions before importing claims of equivalence. + +## E03. Catanach and Das (2023): information gain under a wrong model + +- **Reference:** Tommie A. Catanach and Niladri Das, *Metrics for Bayesian Optimal Experiment Design under Model Misspecification*, [arXiv:2304.07949](https://arxiv.org/abs/2304.07949) (2023). +- **Paraphrased excerpt:** Standard Bayesian experiment design optimizes information gain using the selected inference model's predictions. The paper motivates and examines additional criteria, including expected generalized information gain and expected discriminatory information, to account for model discrepancy. +- **Transfer:** Make the original D-SAG-2 probability-calibration requirement stricter: holding a normalized posterior over a *wrong set of explanations* is insufficient. Maintain model criticism or a rival hypothesis family outside the trusted candidate set. +- **Falsifier:** Every candidate causal graph is false, yet a closed-world EIG controller becomes more certain; an independent discrepancy test must challenge this self-certainty. Do not import source formulas without their assumptions and quantities. + +## E04. Pathak et al. (2017): action-relevant curiosity + +- **Reference:** Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, Trevor Darrell, *Curiosity-driven Exploration by Self-supervised Prediction*, [arXiv:1705.05363](https://arxiv.org/abs/1705.05363), [ICML proceedings](https://proceedings.mlr.press/v70/pathak17a.html) (2017). +- **Paraphrased excerpt:** The intrinsic signal is prediction error in a learned representation connected to the consequences of the agent's actions, rather than raw pixel surprise. The paper emphasizes filtering aspects of the environment the agent cannot influence. +- **Transfer:** Compare whether a frontier question is actually answerable/learnable under available observations and permissions before spending budgets on surprise alone. +- **Falsifier:** A random, unlearnable high-entropy stream dominates selection forever despite yielding no prediction improvement and no verified discovery. **Do not** claim a model-free method automatically identifies true causal structure. + +## E05. Burda et al. (2018): exploratory bonuses have their own biases + +- **Reference:** Yuri Burda, Harrison Edwards, Amos Storkey, Oleg Klimov, *Exploration by Random Network Distillation*, [arXiv:1810.12894](https://arxiv.org/abs/1810.12894) (2018), [original research code](https://github.com/openai/random-network-distillation) (historical, archived). +- **Paraphrased excerpt:** A prediction-error bonus relative to a fixed random target network can supply intrinsic reward; the authors also study combining exploration and external reward, reporting Atari exploration results. +- **Transfer:** Add RND-like novelty to the **comparison ledger only if a real implementation is pinned**; do not silently conflate a stage transition, residual graph debt, and novelty bonus. +- **Falsifier:** Exploration score remains high on repeated observations without improved task outcome, or dominates task utility because a coefficient changed post hoc. + +## E06. McSherry et al. (2013): differential dataflow, iterative deltas + +- **Reference:** Frank McSherry, Derek Murray, Rebecca Isaacs, Michael Isard, *Differential Dataflow*, [Microsoft Research publication / CIDR 2013](https://www.microsoft.com/en-us/research/publication/differential-dataflow/) and [Naiad technical report (2012)](https://www.microsoft.com/en-us/research/publication/composable-incremental-and-iterative-data-parallel-computation-with-naiad/). +- **Paraphrased excerpt:** Maintains changing results through differences and supports nested iteration; it motivates incremental graph computations that do not necessarily recompute all derived state after small input changes. +- **Transfer:** Our stage-0 seeded frontier needs insertion/retraction semantics and a full-recomputation oracle. Extract *correctness questions* about deltas and fixed points, not a demand to adopt Differential Dataflow or a new runtime. +- **Falsifier:** Removing a support root leaves a cached descendant "known", reintroduces a mutually supporting cycle, or wrongly discards a conclusion that has an independent alternate support. Compare full scalar recomputation after each event. + +## E07. Beckers (2021): actual cause differs from derivation dependence + +- **Reference:** Sander Beckers, *Causal Sufficiency and Actual Causation*, [Journal of Philosophical Logic 50 (2021)](https://doi.org/10.1007/s10992-021-09601-z); [published correction](https://doi.org/10.1007/s10992-021-09632-6). +- **Paraphrased excerpt:** The literature offers multiple formally different criteria for actual causation; simple necessary/sufficient reasoning and counterfactual intuition do not uniquely settle causal judgments. +- **Transfer:** Our isolated stage-0 graph ablation establishes **dependence under current inference rules**, not real-world causal sufficiency. An interventional oracle needs explicit assumptions, outcome controls and identifiability handling. +- **Falsifier:** A parent relation whose deletion makes a derived conclusion disappear is mistakenly certified as the cause of the external observed event. Respect inability to identify a cause. + +## E08. Existing internal research that constrains the transfer + +- [#1494 / Maslov Pyramid of Cognition](https://github.com/AdaWorldAPI/lance-graph/pull/1494): stage-0 wisdom is *demonstrated dependence* in test-local scaffolding; production CE64 bits 50..52 **still mean plasticity**. It is not posterior certainty. +- [#1497 / PLN, Shannon and Staunen](https://github.com/AdaWorldAPI/lance-graph/pull/1497): inference semantics, scheduler and physical execution are independent axes; NARS frequency/confidence are not calibrated probabilities. +- [#1500 / Rubikon volition](https://github.com/AdaWorldAPI/lance-graph/pull/1500): goal commitment is separate from conditional plan and permission to perform an effect. +- [#1509 / SAG](https://github.com/AdaWorldAPI/lance-graph/pull/1509): one-concept, one-hop projection is demonstrated using real Quack; multi-hop and persistent dataset are open, H1's SIMD terminal is not built. +- [CARE arXiv:2606.14581](https://arxiv.org/abs/2606.14581): reference-vs-challenger executable program validation and **pre-outcome** gate are the proposed transfer, not proof of causal intervention or symbolic truth maintenance. + +## E09. Three competing research hypotheses (explicitly unresolved) + +**H_A: Popcount suffices as an attention scheduler.** Likely cheap on suitable masks, but can be defeated by high-cost single missing links, false prerequisites and important deep investigations. + +**H_B: EIG suffices as intrinsic motivation.** More principled on calibrated distributions, but may become confidently wrong under model misspecification, or overexplore when pragmatic utility/authorization is neglected. + +**H_C: Causally gated learning progress + Rubikon commitments improves useful work.** Plausible engineering proposal, but its own overhead may exceed any discovery advantage; causal-gating might block safe observational learning, and commitment may make the system slow to revise when evidence changes. + +**Required disambiguation:** exact same candidate pool, evidence roots, external oracle, budgets and replay under A/B/C plus FIFO/reference; full costs and negative controls; report cases where H_A beats H_C as honestly as reverse cases. + +## Notes on verification + +Publication metadata and high-level abstracts were checked on 2026-10-12 against arXiv/publisher pages; source-specific evaluation code, downstream reproductions, licenses and current external commit SHAs were **not** executed or pinned in this document. Never convert these literature comparisons into "implemented" or "benchmarked" rows merely because the sources exist. A future experimental PR must pin artifacts and execute the named oracles. From c716502ead40ce69ee5773513e81257942f5230b Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:33:03 +0200 Subject: [PATCH 25/46] docs(iam): extend Claude handoff with absence, time and authority falsifiers --- .claude/prompts/iam-substrate-after-1509.md | 75 +++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/.claude/prompts/iam-substrate-after-1509.md b/.claude/prompts/iam-substrate-after-1509.md index 99bc88104..1dfab18f3 100644 --- a/.claude/prompts/iam-substrate-after-1509.md +++ b/.claude/prompts/iam-substrate-after-1509.md @@ -68,3 +68,78 @@ Deliver: 7. An **OPEN questions** table where data is unavailable; do not replace missing evidence with inference. **Definition of done:** one well-specified, tested, read-only IAM access-path/impact claim and SAG-aware method evidence, with no second engine and no unproved external authority. If it cannot compile legally, deliver an explicit, code-grounded blocker instead of a fake implementation. + +## Research extension D-IAM-SAG-1 (required reading, not new scope authorization) + +The original task intentionally focused on the positive role path. Also read, before implementing a general IAM policy surface: + +- [Frontier architecture addendum](../plans/iam-substrate-frontier-gaps-v1.md), with a decision/authority/time ontology, release train and IAM-16..40; +- [Why-not provenance, robust access policies and agentic reference monitors](../../.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md), with original arXiv/OASIS/IETF sources, transfer limits and falsifiers. + +**The extension does not enlarge the first implementation slice.** If this prompt is used for the first Rust PR, implement only a smallest read-only, test-pinned path; mark the remaining requirements open. The extensions guard against accidentally shipping a positive-graph demo as a full IAM policy engine. + +### X1. Answer types and data completeness + +Design or evaluate (do not prematurely expose a new contract API) **three distinct result planes**: + +1. Evidence: positive witness, complete scoped absence, incomplete/unknown or contradictory sources; +2. Policy: Permit, Deny, NotApplicable, Indeterminate (including the *explicitly selected* policy-combining algorithm); +3. Provider: actual accepted/rejected/no observation, which the graph must never infer from a permission edge. + +Extend the original synthetic fixture with a missing page, incomplete group-policy read, explicit empty policy, explicit deny, and a changed combining algorithm. Show **which authority** was read and why the negative conclusion does or does not follow. A closed-world claim must cite its complete source scope and versions. Do not collapse absent evidence, unknownness and Deny into false. + +### X2. Multi-path, negation and bounded completeness + +- Produce two independent granting paths, remove only one, and verify the entitlement remains. Use `RoleImpact::between` for directory role impact; do not equate its one shortest path with exhaustive reachability. +- Record `one_witness / exhaustive / incomplete_due_to_budget` on every explanation. Explicitly refuse a universal “no access” claim where source coverage is incomplete or path enumeration is bounded. +- Include `why_not_access` fixture; test against a **separate small reference model**. Do not silently implement Datalog/XACML/provenance as a second production engine. +- A minimal set of membership removals is not automatically the lowest-risk or authorized intervention. Include business-policy constraints in the simulation oracle. + +### X3. Source identity and four time concepts + +- Verify source AD GUID, Entra objectId, SCIM id, canonical NodeGuid, full classid, mutable DN, user alias, tenant and SIDHistory are separate unless a **reviewed and versioned** mapping explicitly links them. +- Test UPN reuse, two forests with same sAMAccountName, one-to-many sync anchor ambiguity, and a service/workload principal with no human HR record. No privilege inheritance from probabilistic matching. +- Report effective-at, observed-at, recorded-at, and decision/execution-at separately; use a **version vector** for AD/Entra/HR/MDM/policy rather than pretending `VersionStore::VersionId` is a cross-provider transaction. +- Under source clock skew, partial snapshots or changed policy revision, either refuse a consistency-sensitive claim or explicitly downgrade it. Historical permission never yields present write permission. + +### X4. Lifecycle, SoD and JIT as policy problems + +Use synthetic examples for: moved employee with a temporary double entitlement, leaver with a stale app session, mutually exclusive roles from two sources, orphaned automation principal, privileged JIT grant that expires, break-glass requiring a separate approval. Refuse a “verified safe” claim when versioned policy constraints are unavailable. Treat robust-under-future-policy-extensions as a research problem, not an achieved theorem. + +### X5. Independent executable authority and protocol receipts + +No actual provider writes are allowed in this PR. For future protocol contracts, specify: +```text +proposed != approved != requested != applied != re-observed != verified +``` +A provider timeout may mean success or failure: **UnknownOutcome**, re-observe before retry. If conditional resource versions/ETags are unsupported, fail safely or explicitly require a different authorized concurrency strategy. SCIM per-resource PATCH atomicity is not cross-provider rollback. Do not let a natural-language prompt, SAG `Tier::Verified`, a CE64 confidence code or a speculative CARE/ONA observer supply authorization. Do not imply revoking a group membership terminates an already issued privileged session. + +### X6. Negative-proof privacy and information flow + +The answer `why does Anna have access?` can expose privileged group and policy names. Include a principal/tenant/scope-bound explanation gate, field redaction and completeness labeling. A request may legitimately obtain the policy decision but **not** all witness edges. Redaction must not change the underlying decision, and graph traversal must not cross tenant scope. `WideFieldMask` is a projection, not an authorization decision. + +### X7. Property-based/metamorphic and disable-run suite + +Track IAM-16..40 from the frontier plan. Essential metamorphic checks: +- Source-row order and graph-edge order permutation do not alter effective answers. +- Replaying one upstream event from two adapters does not double-count license or evidential confirmation. +- Adding an independent allow path cannot remove a role grant **under a declared purely positive graph rule**, but this monotonicity must NOT be generalized to deny rules or mutable policies. +- Alternative grant path removal must not imply entitlement loss. +- A source policy version change invalidates a stale certificate if the rule is not proved robust under the permitted extension. +- Actor row-scope, field authorization, source coverage and executable-effect gates each have a named disable-red test. +- Cyclic 1000-path fixture has a stated cost/time/memory bound and returns `incomplete` rather than a false exhaustive proof. +- Observer/no-observer with identical inputs produces identical authorized results, even if query cost and discovery order change. + +**Stop sign:** If a capability requires inventing a second policy evaluator, traversal runtime or authority registry to make tests pass, STOP and write an explicit blocker and narrow follow-on PR. Don't mislabel inferred behavior as compiled/verified. + +### X8. Handoff output expansion + +In addition to the earlier deliverables, report: +- an access-decision/evidence/provider triple for each fixture, including unknown cases; +- exact completeness scope and source/policy version vector; +- one-witness vs exhaustive explanation with witness budget; +- a source-anchor collision ledger and privacy review; +- result parity and disable evidence, including IAM-16..40 as Pass/Fail/Blocked/Not attempted with **no fabricated green**; +- what remains research-only, what is code-grounded, and what would require new authority/legal/security review. + +**Ultimate invariant:** graph inference may *propose* a safe action, but it cannot *become* the principal that authorizes it. From f083bbc8016297d3ac7a4f6c3978f95c9446ccb3 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:33:25 +0200 Subject: [PATCH 26/46] docs(board): register D-IAM-SAG-1 research and falsification gates --- .../2026-10-12-iam-substrate-sag-dir-sim.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md b/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md index 85b7fb244..156e9047e 100644 --- a/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md +++ b/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md @@ -30,3 +30,22 @@ Treat IGA, PAM, access/SSO, directories, device/app and automation as **overlapp **Principal boundaries:** observed ≠ inferred ≠ authorized; one provenance witness ≠ exhaustive proof; group membership ≠ successful SSO; simulated role impact ≠ executed revocation; append-log version ≠ observation/policy effective time. No new ISA bit reading or CE64 mutation. **Implementation expectation:** execute [the prompt](../../prompts/iam-substrate-after-1509.md) against actual code, ship narrow test-pinned W1/W2 first, and leave unfinished integration explicitly open. + +## Frontier addendum D-IAM-SAG-1, research-only (2026-10-12) + +**New plan:** [iam-substrate-frontier-gaps-v1](../../plans/iam-substrate-frontier-gaps-v1.md). **New excerpts:** [iam-negative-provenance-authority](../../../.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md). **Same expanded prompt:** [iam-substrate-after-1509](../../prompts/iam-substrate-after-1509.md). + +| D-id | Additional proof obligation | Status / falsifier | +|---|---|---| +| D-IAM-SAG-1-0 | Closed-world scope and why-not provenance | RFC; IAM-16,19..21 | +| D-IAM-SAG-1-1 | Source-specific identity anchors and version vectors | RFC; IAM-17,18,35,38 | +| D-IAM-SAG-1-2 | Deny/Permit/NotApplicable/Indeterminate and policy precedence | RFC; IAM-21..24 | +| D-IAM-SAG-1-3 | Alternate-witness, multi-cut, SoD/JIT and temporal what-if | RFC; IAM-19,22..24,34 | +| D-IAM-SAG-1-4 | Independent effects authority, receipts and unknown outcomes | Research-only, **separate implementation PR**; IAM-25..27,39 | +| D-IAM-SAG-1-5 | SAG method certificates, field+row privacy boundary | RFC; IAM-28,29,36..38 | +| D-IAM-SAG-1-6 | Observer/no-observer ablation and independent safety gate | RFC; IAM-30,31,33 | +| D-IAM-SAG-1-7 | License reconciliation and edge-order invariance | RFC; IAM-32,33,39,40 | + +**Numbered falsifiers:** IAM-01..15 remain the first-draft baseline; IAM-16..40 are planned, not run. The addendum contains 25 additional cases, including adversarial/disable controls. Source research includes [arXiv:1701.05699](https://arxiv.org/abs/1701.05699), [arXiv:2603.13181](https://arxiv.org/abs/2603.13181), [arXiv:2602.16708](https://arxiv.org/abs/2602.16708), [arXiv:2603.07004](https://arxiv.org/abs/2603.07004), [OASIS XACML 3.0](https://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html) and [RFC 7644](https://www.rfc-editor.org/info/rfc7644). + +**Scope invariant:** no new compiler opcode, graph engine, policy authority, register-lane/CE64 encoding, live provider write, privileged session, or claim of implemented validation. Integrate only by a later code-grounded, reviewable PR. From 66b6662257dc31872cf433e15242c4b9cba9ecc7 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:33:54 +0200 Subject: [PATCH 27/46] =?UTF-8?q?docs(D-SAG-2):=20add=20Claude=20Code=20re?= =?UTF-8?q?d-team=20prompt=20for=20deferred=20A16=E2=80=93A33=20probes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g-wisdom-frontier-adversarial-expansion.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .claude/prompts/sag-wisdom-frontier-adversarial-expansion.md diff --git a/.claude/prompts/sag-wisdom-frontier-adversarial-expansion.md b/.claude/prompts/sag-wisdom-frontier-adversarial-expansion.md new file mode 100644 index 000000000..f09b1e5b9 --- /dev/null +++ b/.claude/prompts/sag-wisdom-frontier-adversarial-expansion.md @@ -0,0 +1,110 @@ +# Claude Code extension prompt: D-SAG-2 red-team / deferred falsifiers A16..A33 + +**Scope:** Follow-up on existing PR #1511, NOT a new engine or production implementation. Begin from merged #1509 and the three initial D-SAG-2 documents. Read: +- .claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md +- .claude/plans/sag-wisdom-frontier-hard-problems-v1.md +- .arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md +- .claude/prompts/sag-wisdom-frontier-claude-code.md +- .claude/knowledge/maslov-pyramid-of-cognition.md + +**Primary objective:** Prove that incremental wisdom-frontier expansion handles **withdrawal of support and epistemic inaccessibility** before optimizing scheduling. The first PR described positive discovery and CARE-style proposals. This extension deliberately targets the damaging negative cases: what happens when the brain must *unlearn*, abstain, change plans or give up. + +## 0. Re-establish ground truth + +Inspect actual current API/types, main revision and PR head; compare to #1509. List the source file and invocation for each proposed reuse (hydrate, ancestry/root masks, provenance, Quack Binder/Draft, one-hop limitation, CE64 plasticity and test-only Maturation3, action authorization, certificate invalidation). If an API is only proposed in a document, mark it NOT SHIPPED. + +No production CE64 encoding change. No new opcode, graph engine, actor framework, universal field mask, or autonomous software mutation. Keep any new data types test-local and explicitly versioned. + +## 1. Implement only A16-A19 first, if permitted to code later + +Build a tiny independent **scalar replay oracle** over an append-only event fixture: + + Event = InsertOriginal(root_id, fact, source_epoch) + | RetractOriginal(root_id, source_epoch) + | Refute(fact, root_id) + | MarkUnread(fact, scope) + | RestoreReadable(fact, scope) + | ChangeSchema(seal) + | ChangeReading(reading) + Outcome = Known | Missing | Refuted | Unread | Conflict | Stale | Incomplete + +These are suggested test-local types, not production signatures. Document every mapping to real source types; do not assume enums exist. + +Scenarios: +1. r0 grounds A, A -> B -> C, independent r1 also grounds B. Retract r0, then r1, and compare full scalar oracle after each step. +2. A->B->C->A without independent ground: never resolves. Add ground, resolve where eligible; retract it; ensure no stale child can ground its own ancestor. +3. Alternative prerequisite sets: one fully established route is enough if rules allow; union-popcount of all routes is *not* the number of required observations. +4. Required/known/refuted/unread/conflict masks under declared schemas, permuted input order and across visibility boundaries. An unread IAM edge is not false or missing-to-be-guessed. +5. One newly inserted independent observation changes exactly the relations that depend on it; duplicate insertion does not advance maturation. + +For each step assert: +- resolved/open/refuted/unread/conflict state; +- exact independent original roots and derivation chain; +- optional stage 7..0 under an explicit experimental provenance only; +- byte-equivalence under repeated replay; +- no effect permission inferred from evidence. +- fixed point only when finite declared closure exhausted, not merely when budget expires. + +Require a positive fixture, an adversarial negative/silence twin, and deliberate guard-disable RED test and restoration for every implemented invariant. Do not claim all A16-A33 ran after implementing A16 only. + +## 2. Only after correctness, measure incremental vs full recomputation + +Establish a full oracle from the immutable event history. Compare a candidate delta updater to oracle at *each event*, not only at end. Control source revision, root identity, schema, reading, candidate set and budgets. Test escalating fanout 1/4/16/128, duplicate paths, alternate supports and high churn. + +Measure candidate enumeration, popcount, mask scatter, provenance unions, queue, memory, compilation, cache invalidation, refused work, and IO. Report wall, CPU, allocations, bytes decoded and complete end-to-end work. An O(1) bit count cannot by itself justify a whole-frontier speedup. + +## 3. Attention policies need a counterexample suite + +Compare FIFO, confidence, popcount, raw entropy, calibrated EIG, EIG with misspecification check, OpenPsi demand, and optional CARE challenger. Freeze reasoning semantics, observation roots and candidate pool while changing scheduler. Use separate engine axis for native ONA, the ONA MeTTa-NARS bridge, Hyperon/MeTTa and modern PLN. + +Generate: +- noisy-TV irreducible randomness (high raw entropy, zero useful learning); +- one expensive missing prerequisite vs three local inexpensive ones; +- two observationally indistinguishable causal models with different interventions; +- all nominated models wrong; +- correlated support masquerading as independent evidence; +- stage-0 anchor with very large but irrelevant fanout; +- zero new evidence after fixed point; +- genuinely useful late-discovery target obscured by popular early anchors. + +EIG is valid only for an explicit calibrated predictive model. If no calibrated model exists, return Uncalibrated and measure the baseline without pretending NARS f/c is p. Report both epistemic progress and actual task outcome. Do not convert speculative "causal usefulness" into a gate that suppresses all science. + +## 4. Intention hysteresis, fairness and rollback + +Pure simulation only: +- equal OpenPsi demand scores in reversed order; +- dominant demand changes every tick; does policy oscillate; +- high-entropy distractor continuously competes with lower urgency necessary work; +- committed goal is delayed but reachable vs impossible; +- goal exists but current subject lacks authorization; +- cue arrives just after revocation or schema seal change; +- planner chooses action but dispatcher refuses, with immutable receipt; +- new evidence contradicts the active *goal's* premise vs merely a descendant hypothesis. + +Maintain separate timestamps for PRE selection, goal-commit, plan-ready, live-permit, effect and POST outcome. An immutable PRE snapshot must replay irrespective of later observations. A program hash/receipt is not cryptographic security absent proper canonicalization and threat model. + +## 5. Causal disagreement triage + +Run three *separate* oracles for the same example: +A. symbolic graph ablation (which derivations reopen), +B. interventional simulator (which world outcome changes), +C. misspecified-model critic (which candidate causal models lack adequate predictive coverage). + +Create one case where A fires but B does not, one where B is not identifiable, and one where C detects that every candidate model is false. Report CANNOT_INFER_CAUSALITY instead of auto-promoting CE64 epistemic certification. + +CARE from arXiv:2606.14581 is a separate challenger-versus-reference programmable decision gate, not a synonym for these causal tests. + +## 6. External oracle interoperability + +Pin source SHA, flags and dependencies before any run, and write a fieldwise trace matrix preserving raw f/c, temporal vs eternal events, root IDs, alternative bindings, rule identifiers, action consequences and refusal reasons. Native ONA vs MeTTa-NARS needs to be checked **before** comparing to native Hyperon/PLN. Unknown or unrepresentable meanings must be marked Unsupported rather than coerced. + +## 7. Delivery protocol + +Keep #1511 intact; add measured experiment code only in a *separate* explicitly scoped implementation PR after the source audit and approval. Update the research PR with evidence links rather than claiming work completed. + +Return a table with each A16..A33 row and a status from: +SOURCE-VERIFIED / PROPOSED / BLOCKED / IMPLEMENTED / TESTED / MEASURED / REFUTED. + +For every implemented row give exact path, command, exit status, source SHA, reference oracle, disabled guard/red result, restored green result, seed and all-in cost. For proposals give the smallest next experiment and its expected failure mode. If a condition cannot be tested using current interfaces, record a typed blocker and STOP that axis. + +**Non-negotiable kill gates:** No CE64[50..52] reinterpretation in existing provenance; no use of [59..63] as utility; no self-generated independent observation roots; no authorization bypass, fabricated official CARE suite, multi-hop claim, or unimplemented H1 performance claim. If the evidence does not support the research idea, say so plainly. From 3b4e40b6e77a3d15693ba358aeaf51cc1163f4a5 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:34:00 +0200 Subject: [PATCH 28/46] docs: map NARS Hyperon and provenance-oracle research --- ...rted_temporal_ablation_reasoner_oracles.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md diff --git a/.arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md b/.arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md new file mode 100644 index 000000000..cdcc2040e --- /dev/null +++ b/.arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md @@ -0,0 +1,101 @@ +# Inverted temporal ablation × ONA × OpenNARS × Hyperon: primary-source research map + +**Date:** 2026-10-12. **Status:** annotated reference map; *paraphrased excerpts*, not a claim that any upstream engine has passed our benchmark. Companion RFC: [inverted temporal ablation](../.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md). Builds on [existing primary excerpts for NARS/fission](2026-10_nars_self_epistemic_needs_evidence_primary_excerpts.md), [actual causality and contingencies](1608.07879_actual_causality_needs_contingencies_not_just_deletion.md), and [self in NARS](2018_self_in_nars_requires_internal_experience_and_mental_operations.md). + +## Why this collection + +A nine-dot *epistemic* probe differs from ordinary ablation by asking what happens when one **rule, interpretation, or shared epistemic assumption**, not only one observation, is suppressed. Each source below either motivates a testable distinction or acts as an independent oracle. Papers do not establish performance or novelty of the proposed lance-graph composition. + +### R1. Jøsang (2007), Cumulative and Averaging Fission of Beliefs + +- Primary: [arXiv:0712.1182](https://arxiv.org/abs/0712.1182), abstract, fusion and fission definitions; [PDF](https://arxiv.org/pdf/0712.1182). +- **Paraphrased excerpt:** Cumulative fusion models independent evidence; averaging fusion addresses dependent opinions; fission attempts to remove a known contributor from a fused opinion under that particular fusion model. +- **Do not conflate:** Subjective Logic opinions and NARS truth values have different semantics. Compressed u8 CE64 F/C alone cannot reconstruct arbitrary removed support; require contributor IDs, dependence relation, weights and original revision order, or refuse exact inverse. +- **Testable translation:** Independent A+B -> remove A -> only B remains (within stated rounding); duplicated A under aliases -> delete both references to root A; unknown overlap -> `Coverage=Partial/Unsupported`. Compare true recompute to putative algebraic inverse. + +### R2. Wang, Li, Hammer (2018), Self in NARS, an AGI System + +- Primary: [Frontiers Robotics and AI DOI:10.3389/frobt.2018.00020](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2018.00020/full), especially §§2–3 on truth, evidence, internal experience, control. +- **Paraphrased excerpt:** Reasoning relies on finite resources and revisable experiential evidence; the system can treat some of its internal processing as experience. Distinguish reasoning about derivation from a claim of phenomenal consciousness. +- **Testable translation:** Track three IDs separately: independent external observation root, derivation/procedure trace, and attention-selection trace. Changing attention may change emitted results without changing logical entailment. A derivation trace alone cannot make a new independent NARS observation. +- **Falsifier:** Give two conclusions with equal final F/C but distinct provenance. Explanation must distinguish them while confidence stays unchanged. + +### R3. Hammer & Lofthouse (2020), OpenNARS for Applications: Architecture and Control + +- Primary artifact: [official ONA repository README and references](https://github.com/opennars/OpenNARS-for-Applications); upstream paper linked there (AGI 2020 conference contribution); [official ONA wiki](https://github.com/opennars/OpenNARS-for-Applications/wiki). +- **Paraphrased excerpt from maintainer README:** ONA is a new C implementation, not an OpenNARS branch, designed for application-oriented event handling, procedure learning and resource-based control. The maintainers explicitly acknowledge conceptual differences from research OpenNARS. +- **Consequences:** Do not silently assume identical revision rules, stamp representation, command syntax or derivation export between the two. Begin with upstream CLI documented `./NAR shell`, example `*.nal` inputs, `python3 evaluation.py`; pin SHA and config and inspect actual output before normalizing. +- **Testable translation:** Same temporal-event fixture, with and without a root observation, measure subsequent temporal implications, anticipation, learned operation and chosen action at equal time/budget. Separately vary priority or memory budget to diagnose resource-path sensitivity. +- **Unverified:** Upstream exposure of exhaustive proof ancestry, a reversible belief deletion API, and deterministic output under all scheduling modes. + +### R4. Hammer, Lofthouse & Wang (2016), The OpenNARS Implementation of the Non-Axiomatic Reasoning System + +- Primary repository: [opennars/opennars](https://github.com/opennars/opennars); maintainer-linked publication is in the ONA README; [OpenNARS stamp discussion](https://github.com/opennars/opennars/wiki/Stamp). +- **Paraphrased excerpt / technical idea:** A stamp records creation/occurrence context and evidential-base identifiers; this informs revision/choice and overlapping-evidence checks. Resource-bounded bases can truncate. +- **Testable translation:** Compare (i) independent evidence, (ii) duplicated evidence with a shared root, (iii) two paths with a hidden common ancestor, (iv) temporal vs eternal conclusions. Stamps may catch overlap, but *do not presume* they form a lossless provenance DAG. +- **Refusal:** When a stamp drops ancestry under capacity limits, report partial provenance; do not claim complete causal shadow or exact fission. + +### R5. Goertzel et al. (2023), OpenCog Hyperon: A Framework for AGI at the Human Level and Beyond + +- Primary: [arXiv:2310.18318](https://arxiv.org/abs/2310.18318), architecture §§3.1–3.2; [PDF](https://arxiv.org/pdf/2310.18318); [maintained experimental MeTTa implementation](https://github.com/trueagi-io/hyperon-experimental). +- **Paraphrased excerpt:** Hyperon represents cognitive processes and rewrite programs in a metagraph/Atomspace; making rules addressable data offers a route toward reflective modification. This is architectural motivation, *not evidence of achieved AGI or an ablation performance result*. +- **Testable translation:** Use two named MeTTa rewrite rules R1/R2 deriving C through distinct branches. Remove R1 from a cloned world, recompute and retain evidence atoms. Then disable a shared method/assumption upstream of both. Compare derived atoms and explanations, not NARS confidence fields. +- **Open question:** Which MeTTa runtime semantics, rewrite ordering and proof export support reproducible source-to-result attribution? Pin the version and distinguish pattern matching, nondeterminism and selection from entailment. + +### R6. Chockler (2016), Causality and Responsibility for Formal Verification and Beyond + +- Primary: [arXiv:1608.07879](https://arxiv.org/abs/1608.07879); [local detailed harvest](1608.07879_actual_causality_needs_contingencies_not_just_deletion.md). +- **Paraphrased excerpt:** Actual-cause analyses under Halpern–Pearl conditions admit contingencies. A contributor can be causally relevant even if a one-at-a-time deletion does not flip the outcome because of alternative support. Responsibility additionally considers how much context must change to make the contributor decisive. +- **Testable translation:** With Y=A OR B, test deleting A alone, then deleting A under the explicit contingency B=off. Record the context and resulting verdict; never equate a deletion's no-flip result with 'not causal'. +- **Boundary:** Conditional logical pivotality is not a claim of causal identification until a valid SCM/intervention model and assumptions are declared. Moral responsibility/intent are not inferred. + +### R7. Differential Dataflow (McSherry et al.), incremental signed-update computation + +- Implementation/doc: [TimelyDataflow/differential-dataflow](https://github.com/TimelyDataflow/differential-dataflow), [crate documentation](https://docs.rs/differential-dataflow/latest/differential_dataflow/), especially Collections and iteration. +- **Paraphrased implementation note:** Collection updates add and remove weighted records. Existing operators maintain derived results incrementally over updates; recursive relations can be iterated to fixed points. +- **Testable translation:** Create materialized support tuples and recursive reachability. Delete evidence and rule tuples, feed signed updates, compare stabilized closure and multiplicity to a *fresh recomputation*. Include cycles, diamond-shaped shared ancestors, and fan-out. +- **Boundary:** Differential Dataflow is a computation oracle, not NARS, OpenCog, or a causal model. Bench costs include arrangement/index build and resident memory. + +### R8. Soufflé provenance and explanation + +- Primary documentation: [Soufflé Provenance](https://souffle-lang.github.io/provenance), including the `-t explain` command and explanation trees. +- **Paraphrased excerpt:** Soufflé can explain derived tuples using reconstructed proof trees of minimal height, and support interactive explanations for failures. Its provenance is lazy, while stored annotations facilitate explanation. +- **Testable translation:** Query support for C and inspect branches, rule IDs and premises. Multiple derivations need complete enumeration or an additional support-count oracle; a *single shortest proof* is insufficient to establish that deleting one branch erases C. + +### R9. Green, Karvounarakis & Tannen (2007), Provenance Semirings + +- Primary: [DBLP bibliographic entry](https://dblp.org/rec/conf/pods/GreenKT07.html), [author PDF](https://www.cis.upenn.edu/~green/papers/pods07.pdf). +- **Paraphrased excerpt:** Annotating database tuples with provenance polynomials distinguishes alternative derivations (sum) from jointly required inputs (product), retaining more information than Boolean membership. +- **Testable translation:** For two proof paths, C may have polynomial terms (A*R1)+(B*R2); setting A=0 removes only its term, whereas shared upstream U in *both* terms factors as U*(A*R1+B*R2). This is a conceptual oracle for hidden shared causes, **not** a direct arithmetic prescription for NARS truth revision. + +## Minimal synthetic world and comparators + + U -> A -> R1 -> C + -> B -> R2 -> C + independent D -> R3 -> C + +World W0 contains C with three derivations; suppress A, C survives via B and D; suppress U, A and B disappear but D survives; suppress U AND D, C disappears. Compare: +- **Boolean conclusion membership**; +- **complete derivation multiplicity** and provenance root sets; +- **numerical truth** only within a specific declared reasoner's semantics; +- **temporal prediction** and selected action; +- **certification** (Observed/Related/Explains/Causes separately, no new earned 'Causes' from ablation); +- **horizon integrity** (future events after pin inaccessible). + +The first hard falsifier is deliberately not 'did C disappear?'. It is **'did the correct support disappear while independent support survived?'** This distinguishes exact source-aware retraction from a deceptively successful but causally blind deletion. + +## A cost-aware cognitive probe, not a truth generator + +Candidate X can be selected from provenance branches/rule assumptions to maximize measured discriminatory value under a time/memory budget. A suggested hypothesis (not a result) is expected information gain per estimated probe cost. Benchmark it against random cuts, largest-subgraph cuts, highest-confidence cuts, and full replay. All candidate scheduling, epistemic certification, and Rubicon commitment remain distinct; an entropy reduction must never be counted as additional observational support. + +## Research stop conditions + +- No truth-law crosswalk: do **not** equate NARS F/C with PLN, subjective-logic opinions or MeTTa rewrite membership. +- No root-level ancestry: exact fission/retraction **Unsupported**. +- Unpinned source horizon: strict historical claim **Unsupported**. +- Incomplete or evicted derivation trace: affected cone **Partial**. +- No SCM and admissible contingency policy: causal identification **Unsupported**. +- No parity against fresh replay: sparse speedup **Not demonstrated**. +- No comparison with code and history: novelty **Not established**. + +Related repo material: [existing 2026-10 NARS primary excerpts](2026-10_nars_self_epistemic_needs_evidence_primary_excerpts.md), [Gadamer ablation audit](../.claude/research/2026-10-recovery/GADAMER-ABLATION-RESEARCH.md), [SAG #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). From c3210f9e486898de9e4a3103575dd03f39fc5081 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:34:30 +0200 Subject: [PATCH 29/46] docs(D-SAG-2): link incremental-hard-problems and second-wave falsifier roadmap --- .claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md index 22a0fc947..33b66b91a 100644 --- a/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md +++ b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md @@ -178,3 +178,16 @@ Terminate or narrow scope if any test silently reinterprets production CE64 50.. **Decision requested from operator later, not implicit in this PR:** whether and how Maturation3 is promoted beyond test-local provenance without changing the stable byte-ISA contract; and whether population carrier for legal multi-hop already exists. Until then all projections are research overlays. **Status of this PR:** documentation and experiment specification only. None of P0-P5 is claimed executed merely because this file exists. + + +## Deferred extension on the same PR: A16..A33 + +The first-wave D-SAG-2-0..15 falsifiers deliberately focused on establishing the positive, bounded stage-0 frontier and independently validated CARE-style proposal. The following **second-wave research**, added to #1511, covers safety and epistemic failure modes not yet exhaustively specified in that first wave: + +- [Hard-problems / incremental truth maintenance](sag-wisdom-frontier-hard-problems-v1.md): **four-state prerequisite debt** (known / refuted / missing / unread); alternative sufficient supports; deletion/retraction against fresh full-recomputation; source/version invalidation; bounded work and starvation; rubicon commitment hysteresis; conditional permits and cancellation races; graph ablation vs intervention; field-by-field ONA/MeTTa/PLN oracle parity. +- [Second-wave .arxiv source excerpts](../../.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md): Friston et al. 2026 active inference and structure learning, Wei 2024 EFE/value, Catanach/Das 2023 misspecified EIG, Pathak 2017 curiosity, Burda 2018 RND, McSherry et al. 2013 differential dataflow, Beckers 2021 actual causation, plus source limitations. +- [Adversarial Claude Code handoff](../prompts/sag-wisdom-frontier-adversarial-expansion.md): implements **only A16-A19 first in a future implementation PR** (subject to audit and scope decision), then stages A20..A33 as unexecuted red tests. + +This extension supersedes no proven claim in #1494/#1509. It does not endorse introducing Differential Dataflow, a new physical graph traversal, cryptographic receipt, reassigning CE64 bands or deploying real-world IAM effects. + +**Additional stop condition:** Budget exhausted, source unread, stale certificate, model uncalibrated and lack of causal identifiability must each have a distinct explicit result; none may be silently reclassified as fixed point, negative evidence, successful exploration or permission to act. From 394b248775d0a991ab6c921821b541670f739051 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:34:42 +0200 Subject: [PATCH 30/46] docs(D-SAG-2): prioritize retraction oracle in Claude Code handoff --- .claude/prompts/sag-wisdom-frontier-claude-code.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.claude/prompts/sag-wisdom-frontier-claude-code.md b/.claude/prompts/sag-wisdom-frontier-claude-code.md index 0ba25ba7b..5c507af15 100644 --- a/.claude/prompts/sag-wisdom-frontier-claude-code.md +++ b/.claude/prompts/sag-wisdom-frontier-claude-code.md @@ -134,3 +134,17 @@ The final status table must distinguish **IMPLEMENTED / MEASURED / SOURCE-VERIFI - No unproven full cognitive architecture claim merely because individual probes pass. **Deliverable of the current research PR:** documentation, annotated .arxiv source shelf and this prompt. Future code P1-P6 is *proposed work*, not claimed delivered. + + +## Second-wave handoff added on #1511 + +Before implementing a curiosity scheduler, read: +- .claude/plans/sag-wisdom-frontier-hard-problems-v1.md +- .arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md +- .claude/prompts/sag-wisdom-frontier-adversarial-expansion.md + +**Explicit priority:** The first missing technical invariant is not faster popcount. It is **correct incremental retraction of evidence with alternate supports, inaccessible sources, bounded queue semantics, and a full-recomputation scalar oracle**. Treat A16..A33 as additional *proposed* red tests, not tests already executed. In a future implementation PR start with A16-A19, and stop rather than silently building or changing production infrastructure. + +Preserve the distinction between (i) graph support ablation, (ii) world-model intervention and (iii) model criticism. Never call derived graph dependence proof of causality. Include uncalibrated or misspecified EIG, procedural permission denial, starvation and commitment oscillation as explicit negative/silence twins. + +No code changes or runtime measurements are authorized by the existence of this prompt; the current #1511 documents hypotheses and does not ship their implementations. From bc0cdfcdb793b2c71dee7dff61c445f1901089f8 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:35:00 +0200 Subject: [PATCH 31/46] test: add dependency-free provenance ablation smoke oracle --- .../inverted_temporal_ablation_oracle.py | 236 ++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 .claude/tools/inverted_temporal_ablation_oracle.py diff --git a/.claude/tools/inverted_temporal_ablation_oracle.py b/.claude/tools/inverted_temporal_ablation_oracle.py new file mode 100644 index 000000000..f3836c4b7 --- /dev/null +++ b/.claude/tools/inverted_temporal_ablation_oracle.py @@ -0,0 +1,236 @@ +#!/usr/bin/env python3 +"""D-SAG-CF-1: deliberately small, independent *Boolean provenance* oracle. + +Run: python3 .claude/tools/inverted_temporal_ablation_oracle.py +No foreign reasoner, CE64 update, SCM/do(), probabilistic inference, +temporal reconstruction, or Quack implementation is claimed here. +The finite acyclic fixture is a parity baseline, NOT the production engine. +""" +from __future__ import annotations + +from dataclasses import dataclass +from itertools import product +import unittest + +Term = frozenset[str] +Proofs = dict[str, frozenset[Term]] + + +@dataclass(frozen=True) +class Rule: + id: str + premises: tuple[str, ...] + conclusion: str + + +@dataclass(frozen=True) +class World: + # Claim -> source root. An alias of the same observation uses the SAME root. + observations: tuple[tuple[str, str], ...] + rules: tuple[Rule, ...] + + +@dataclass(frozen=True) +class Shadow: + lost_claims: frozenset[str] + gained_claims: frozenset[str] + changed_support: frozenset[str] + removed_proofs: Proofs + added_proofs: Proofs + + +def _validate_acyclic(world: World) -> None: + """Fail closed instead of pretending an unbounded recursive proof is exact.""" + adjacency: dict[str, set[str]] = {} + ids: set[str] = set() + for rule in world.rules: + if rule.id in ids: + raise ValueError("rule ids must be unique and versioned") + ids.add(rule.id) + for premise in rule.premises: + adjacency.setdefault(premise, set()).add(rule.conclusion) + states: dict[str, int] = {} + + def dfs(node: str) -> None: + if states.get(node) == 1: + raise ValueError("recursive/cyclic provenance requires another oracle") + if states.get(node) == 2: + return + states[node] = 1 + for child in sorted(adjacency.get(node, ())): + dfs(child) + states[node] = 2 + + for node in sorted(adjacency): + dfs(node) + + +def evaluate( + world: World, + cut_roots: frozenset[str] = frozenset(), + cut_rules: frozenset[str] = frozenset(), +) -> Proofs: + """Compute all minimal Boolean proof terms on a tiny DAG, from scratch. + + Terms are sets of original source IDs AND rule IDs. Alternatives are a + set of terms. A shared root appears in every proof that depends on it. + No numerical NARS revision, timestamps or causal certification occurs. + """ + _validate_acyclic(world) + roots: dict[str, set[Term]] = {} + for claim, root in world.observations: + if root not in cut_roots: + roots.setdefault(claim, set()).add(frozenset((f"obs:{root}",))) + + # Finite DAG, no negative premises: monotone closure terminates. + while True: + before = sum(len(v) for v in roots.values()) + for rule in world.rules: + if rule.id in cut_rules: + continue + supports = [roots.get(p, set()) for p in rule.premises] + if not supports or any(not s for s in supports): + continue + for chosen in product(*supports): + evidence = frozenset.union(*chosen, frozenset((f"rule:{rule.id}",))) + roots.setdefault(rule.conclusion, set()).add(evidence) + after = sum(len(v) for v in roots.values()) + if after == before: + break + return {k: frozenset(v) for k, v in roots.items()} + + +def ablate( + world: World, + *, + roots: frozenset[str] = frozenset(), + rules: frozenset[str] = frozenset(), +) -> Shadow: + factual = evaluate(world) + counterfactual = evaluate(world, roots, rules) + factual_keys = set(factual) + cf_keys = set(counterfactual) + touched = factual_keys | cf_keys + removed = { + k: frozenset(factual.get(k, frozenset()) - counterfactual.get(k, frozenset())) + for k in sorted(touched) + if factual.get(k, frozenset()) - counterfactual.get(k, frozenset()) + } + added = { + k: frozenset(counterfactual.get(k, frozenset()) - factual.get(k, frozenset())) + for k in sorted(touched) + if counterfactual.get(k, frozenset()) - factual.get(k, frozenset()) + } + return Shadow( + lost_claims=frozenset(factual_keys - cf_keys), + gained_claims=frozenset(cf_keys - factual_keys), + changed_support=frozenset( + k for k in touched if factual.get(k) != counterfactual.get(k) + ), + removed_proofs=removed, + added_proofs=added, + ) + + +def two_paths() -> World: + return World( + (("A", "a"), ("B", "b")), + (Rule("R1@1", ("A",), "C"), Rule("R2@1", ("B",), "C")), + ) + + +def hidden_root() -> World: + return World( + (("U", "u"), ("D", "d")), + ( + Rule("makeA@1", ("U",), "A"), + Rule("makeB@1", ("U",), "B"), + Rule("R1@1", ("A",), "C"), + Rule("R2@1", ("B",), "C"), + Rule("R3@1", ("D",), "C"), + ), + ) + + +class ProbeTests(unittest.TestCase): + def test_f0_pristine_replay_is_exact(self) -> None: + w = hidden_root() + self.assertEqual(evaluate(w), evaluate(w)) + + def test_f1_cut_a_keeps_independent_b(self) -> None: + s = ablate(two_paths(), roots=frozenset(("a",))) + self.assertNotIn("C", s.lost_claims) + self.assertIn("C", s.changed_support) + self.assertEqual(len(s.removed_proofs["C"]), 1) + + def test_f2_cut_rule_not_its_input(self) -> None: + s = ablate(two_paths(), rules=frozenset(("R1@1",))) + self.assertIn("C", s.changed_support) + self.assertNotIn("A", s.changed_support) + self.assertNotIn("C", s.lost_claims) + + def test_f3_joint_cut_removes_all_support(self) -> None: + s = ablate(two_paths(), rules=frozenset(("R1@1", "R2@1"))) + self.assertIn("C", s.lost_claims) + + def test_f4_shared_assumption_collapses_two_paths(self) -> None: + s = ablate(hidden_root(), roots=frozenset(("u",))) + self.assertIn("A", s.lost_claims) + self.assertIn("B", s.lost_claims) + self.assertNotIn("C", s.lost_claims) # D independently supports C + self.assertEqual(len(s.removed_proofs["C"]), 2) + + def test_f5_aliased_observation_cut_by_source(self) -> None: + w = World( + (("A1", "shared"), ("A2", "shared"), ("B", "independent")), + ( + Rule("R1@1", ("A1",), "C"), + Rule("R2@1", ("A2",), "C"), + Rule("R3@1", ("B",), "C"), + ), + ) + s = ablate(w, roots=frozenset(("shared",))) + self.assertEqual(s.lost_claims, frozenset(("A1", "A2"))) + self.assertNotIn("B", s.changed_support) + self.assertNotIn("C", s.lost_claims) + + def test_f6_irrelevant_source_is_noop(self) -> None: + self.assertEqual( + ablate(two_paths(), roots=frozenset(("does-not-exist",))).changed_support, + frozenset(), + ) + + def test_f7_contingency_exposes_pivotality(self) -> None: + w = two_paths() + self.assertNotIn("C", ablate(w, roots=frozenset(("a",))).lost_claims) + self.assertIn("C", ablate(w, roots=frozenset(("a", "b"))).lost_claims) + + def test_f9_rule_cut_never_changes_observations(self) -> None: + w = hidden_root() + s = ablate(w, rules=frozenset(("makeA@1", "makeB@1"))) + self.assertNotIn("U", s.changed_support) + self.assertNotIn("D", s.changed_support) + self.assertIn("A", s.lost_claims) + self.assertIn("B", s.lost_claims) + + def test_refuse_cycle_without_losing_evidence(self) -> None: + w = World((("A", "a"),), (Rule("R@1", ("A",), "B"), + Rule("S@1", ("B",), "A"))) + with self.assertRaisesRegex(ValueError, "cyclic"): + evaluate(w) + + def test_refuse_duplicate_rule_identity(self) -> None: + w = World((("A", "a"),), + (Rule("R@1", ("A",), "C"), Rule("R@1", ("A",), "D"))) + with self.assertRaisesRegex(ValueError, "unique"): + evaluate(w) + + def test_support_and_membership_are_distinct(self) -> None: + s = ablate(hidden_root(), roots=frozenset(("d",))) + self.assertNotIn("C", s.lost_claims) + self.assertIn("C", s.changed_support) + self.assertEqual(len(s.removed_proofs["C"]), 1) + + +if __name__ == "__main__": + unittest.main() From 7d7bea407bdd05751c32706a501c909c6282ad6a Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:35:40 +0200 Subject: [PATCH 32/46] docs(iam): reconcile merged #1514 carrier and proposed Intune/GPO policy seam --- .../plans/iam-substrate-frontier-gaps-v1.md | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.claude/plans/iam-substrate-frontier-gaps-v1.md b/.claude/plans/iam-substrate-frontier-gaps-v1.md index 6ab64fe19..14790f6cf 100644 --- a/.claude/plans/iam-substrate-frontier-gaps-v1.md +++ b/.claude/plans/iam-substrate-frontier-gaps-v1.md @@ -240,4 +240,40 @@ The reference evaluator must be **separate from the optimized implementation**, If fully correct explanations of negative claims and policy decisions require a second independent authorization engine *because the current Quack/OGAR/dir_sim interface cannot legally express its proof obligation*, **stop** rather than hide a new runtime behind a hotplug. Document the smallest missing primitive, parity target, data/edge witness cost and authority boundary. That is an informative result. -The high-signal hypothesis remains narrow: **the same SoA substrate can host independent typed readings of identity, policy, evidence and software methods**, while the meaning of those readings and the authority to act stay separately governed. \ No newline at end of file +The high-signal hypothesis remains narrow: **the same SoA substrate can host independent typed readings of identity, policy, evidence and software methods**, while the meaning of those readings and the authority to act stay separately governed. + +## 12. Post-#1509 implementation drift: #1514 earns *one* relation hop [G, on main] + +**Verified after writing this RFC:** [#1514](https://github.com/AdaWorldAPI/lance-graph/pull/1514) is merged to `main` (the #1512 research branch was cut at the earlier #1509 merge and has not been rebased). `crates/lance-graph-glove-parity/tests/relation.rs` and `src/gremlin.rs` now expose **D-CMH-G1-4a**, a *functional* `out(rel)` carrier preserving one anchor row per traverser. A declared `Relation` uses a foreign key; `out(rel)` tests that it references a **live** target with `Filter::Semijoin`; `out(rel).has` can evaluate `EqU32Via`. The tests use synthetic ERP line->partner rows n=1,64,65,4097 with text-based row oracles and documented disable runs. + +**Exactly what it does NOT earn:** +- fan-out or many-to-many access membership, `in`/`both`, or target dedup; +- a second hop `out(rel).out(rel)` (explicit `SecondHop` refusal); +- sums/values or referenced methods after a relation when the method glove refuses them; +- R2IL parity for the foreign-target liveness test: R2IL's current fold band lacks `GATHER`, and the method reports `FrontendGap`; +- a complete IAM authorization result, policy evaluation, source identity merge or production session evidence. + +**IAM transfer [H]:** a functional `User -> Manager` or `Line -> Account` read could reuse this exact carrier, but `User -> Groups -> Roles -> Entitlements` is multi-valued and recursive. It cannot use `out(rel)` without proving multiplicity and anchor semantics. This **updates** earlier #1509-era text that described *all* relation carriers as absent. The general D-SAG-1-4 and D-CMH-G1-4 obligations are still open. + +**IAM-44:** a synthetic functional one-hop matches #1514's row oracle and refuses an R2IL path that needs `GATHER`. **IAM-45:** a user with two groups and cyclic/nested memberships must not be silently forced into a one-foreign-key functional relation; fan-out/second-hop deliberately refuse pending an earned carrier. + +## 13. Device policy is not device compliance: D-PBL intersection [P, on main] + +The [policy-baseline integration plan](policy-baseline-integration-v1.md) is a **proposal** on current `main`, not an implemented Intune/GPO reader. It distinguishes: + +| Layer | GPO | Intune | +|---|---|---| +| Configured | directory policy object + SYSVOL setting | Graph configuration setting | +| Assigned | GPO link, inheritance, security/WMI filter | target group, exclusion and assignment | +| Observed | only via supplied client-side RSoP/status (not centrally inferred) | per-device status returned by Intune | +| Authorization consequence | only if a **separate** supported access-control policy uses the fact | only if conditional-access policy and evaluation evidence authorize the effect | + +A unified policy-setting row needs published **GPO↔CSP mapping evidence**; identical-looking names and values are not proof of the same setting. An unmapped setting remains source-specific. `dir_sim` cannot assume it already contains device populations: D-PBL explicitly identifies device ingestion, device-group path support and read-only source adapters as gaps. + +**IAM-41:** assignment to a group with an explicit exclusion is not applied to excluded device; missing device/group reader yields `Unknown`, not compliance. + +**IAM-42:** `GPO configured=true` plus link is not the same as `observed compliant`; without RSoP/device evidence, observed GPO state remains unknown. + +**IAM-43:** unreviewed GPO↔CSP alias/mapping and a missing device object must fail closed on cross-source policy comparison. A device policy conflict may be *observed* without automatically deciding conditional access. + +**Dependency:** D-PBL must separately earn policy-object ingestion, source mapping, assignment precedence and actual device status before the IAM projection can consume it. Do not move GPO/Intune into `dir_sim` as if they shared directory authority or write lifecycle. This new seam is relevant to the advertisement's “Device & App Management” category, but it is not proof of an Intune connector. From 91791c47eb0ff322bc3cf848cea19055a08d4279 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:35:41 +0200 Subject: [PATCH 33/46] docs: record D-SAG-CF-1 handoff and falsification gates --- .../2026-10-12-inverted-temporal-ablation.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .claude/board/entries/2026-10-12-inverted-temporal-ablation.md diff --git a/.claude/board/entries/2026-10-12-inverted-temporal-ablation.md b/.claude/board/entries/2026-10-12-inverted-temporal-ablation.md new file mode 100644 index 000000000..0e09a57e1 --- /dev/null +++ b/.claude/board/entries/2026-10-12-inverted-temporal-ablation.md @@ -0,0 +1,15 @@ +# D-SAG-CF-1 — Inverted temporal ablation and independent reasoner oracles (2026-10-12) + +**Status: RFC + synthetic Boolean smoke oracle; no upstream adapters, no production path, no benchmark.** +**Parent:** [merged #1509 SAG](https://github.com/AdaWorldAPI/lance-graph/pull/1509). + +- **Research plan:** [inverted-temporal-ablation-reasoner-oracles-v1.md](../../plans/inverted-temporal-ablation-reasoner-oracles-v1.md), includes the pinned-horizon two-world contract, evidence/rule/method/assumption/attention cuts, OGAR ClassView + MethodKey + schema/reading, Quack one-hop restriction, temporal vs data-causal split, Gadamer admission gap, CE64 no-new-bits rule, W0–W7 experiment sequence, and F0–F15 falsifiers. +- **Annotated sources:** [cross-reasoner arXiv map](../../../.arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md) covers Jøsang fission, Wang internal experience, ONA vs OpenNARS, Hyperon MeTTa, actual causality with contingencies, provenance semirings, Differential Dataflow, and Soufflé. +- **Portable local oracle:** [inverted_temporal_ablation_oracle.py](../../tools/inverted_temporal_ablation_oracle.py), stdlib-only DAG/proof-term closure and 12 `unittest` checks. Run from repo root with `python3 .claude/tools/inverted_temporal_ablation_oracle.py`. Its behavior is **not** NARS truth revision, a Pearl SCM, actual causal identification, or production Quack. +- **Existing shipped foundation:** `chain_counterfactual.rs` has a detached single-step cut; `temporal.rs` deinterlaces horizon/owner trajectories; SAG #1509 represents one-hop methods and provenance. None is yet the proposed complete inverse-temporal retraction engine. +- **Biggest correctness blocker:** exact evidence-base dependence and transitive child invalidation are not generally reconstructible from bounded stamps or compressed F/C. Handle as partial/unsupported rather than silently counting redundant evidence. +- **Biggest execution blocker:** legal multi-hop relation passing in Quack; #1509 explicitly prohibits treating population intermediates as native operands. + +**Next smallest PR:** pin an ONA upstream SHA and build a fully reproducible `./NAR shell` external input-suppression fixture, including identical baseline and scheduler-control runs. No irreversible writer. + +**STOP:** Do not merge this research RFC as if the adapters, sparse speedups, or 64-way NARS truth replays were implemented. TruthOnly and claim-to-step mapping remain explicit semantic decisions; conditional logical importance is not automatically Pearl causality. From f74cb7162f0994a1b18050cfc032d9adf6381437 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:35:57 +0200 Subject: [PATCH 34/46] docs(prompt): add current #1514 and Intune/GPO seam tests --- .claude/prompts/iam-substrate-after-1509.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.claude/prompts/iam-substrate-after-1509.md b/.claude/prompts/iam-substrate-after-1509.md index 1dfab18f3..e516a803a 100644 --- a/.claude/prompts/iam-substrate-after-1509.md +++ b/.claude/prompts/iam-substrate-after-1509.md @@ -143,3 +143,14 @@ In addition to the earlier deliverables, report: - what remains research-only, what is code-grounded, and what would require new authority/legal/security review. **Ultimate invariant:** graph inference may *propose* a safe action, but it cannot *become* the principal that authorizes it. + +### X9. Refresh the baseline for #1514 and the D-PBL device policy proposal + +Before doing any traversal work, inspect merged [#1514](https://github.com/AdaWorldAPI/lance-graph/pull/1514), `crates/lance-graph-glove-parity/{src/gremlin.rs,tests/relation.rs}` on current main and [the frontier update](../plans/iam-substrate-frontier-gaps-v1.md#12-post-1509-implementation-drift-1514-earns-one-relation-hop-g-on-main). Correct older “no relation carrier” statements: + +- **Available on main:** one functional FK `out(rel)`, liveness via `Semijoin`, filtered target property via `EqU32Via`, anchor preserved, tested in Quack/mask-risc on a synthetic ERP fixture. +- **Still missing:** general many-to-many group memberships/fan-out, `out().out()`, target `values`/sum/dedup, R2IL `GATHER` parity, multi-hop SAG queries. Do not retrofit IAM's recursive group closure into a functional FK without independently proving multiplicity semantics. +- **D-PBL-0..7** in `.claude/plans/policy-baseline-integration-v1.md` is proposal only: GPO configured vs assigned vs observed differs from Intune configured vs assigned vs per-device observed; D-PBL explicitly lacks device ingestion and canonical GPO↔CSP mapping unless sourced. No “compliant” result from an assigned policy alone. +- **New gates IAM-41..45** in frontier plan check Intune exclusions and unknown device membership, GPO observed unknown without RSoP, unmapped policy-setting identity, one-hop Quack/R2IL asymmetry, and rejection of false functional cardinality. + +Report the current SHA and whether #1514 has landed in the implementation checkout. This research PR branch is intentionally still based on #1509; implementations should start from the then-current main or explicitly rebase before testing. Stop if a baseline assertion cannot be reconciled with code. From 54a7c3a02f4c3245a2b282b4a637c03cf701b3be Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:36:19 +0200 Subject: [PATCH 35/46] docs(iam): note #1514 and device-policy baseline drift --- .claude/plans/iam-substrate-sag-dir-sim-v1.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.claude/plans/iam-substrate-sag-dir-sim-v1.md b/.claude/plans/iam-substrate-sag-dir-sim-v1.md index 77b588e6c..7c1f84467 100644 --- a/.claude/plans/iam-substrate-sag-dir-sim-v1.md +++ b/.claude/plans/iam-substrate-sag-dir-sim-v1.md @@ -183,3 +183,7 @@ The first 15 tests primarily cover *positive* entitlement evidence and directory - **Proof of responsible explanation:** tenant-scoped/redacted witness output, machine identities, duplicate-source lineage, adversarial prompt injection and cyclic/high-path-count workloads. **Release order:** maintain W0/W1 as the smallest read-only implementation. Research the expanded test fixture now; implement only when its domain's existing semantics and compiled oracle can be verified. General multi-hop, policy evaluator and provider DO remain independent later work. These are *candidate requirements*, not claims of new Rust code or completed review. + +### Implementation drift observed after #1509 + +Current `main` has merged [#1514](https://github.com/AdaWorldAPI/lance-graph/pull/1514): **one functional foreign-key `out(rel)`** with `Semijoin` liveness and `EqU32Via` in the glove parity method layer. This is real progress beyond #1509, but IAM's many-to-many group membership, second hop and R2IL `GATHER` parity remain unsolved. The updated [frontier addendum](iam-substrate-frontier-gaps-v1.md#12-post-1509-implementation-drift-1514-earns-one-relation-hop-g-on-main) identifies the precise boundary. It also connects the new [D-PBL GPO/Intune policy baseline proposal](policy-baseline-integration-v1.md) to IAM without conflating configured/assigned/observed state or claiming the Intune connector exists. With IAM-41..45, the full proposed test catalog is **IAM-01..45**, not 40; none is executed by this documentation PR. The #1512 branch remains anchored at #1509 and is behind main pending a later synchronization. From 65cf45dc78e9dd46713efb30ad3a509102f29d4d Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Mon, 12 Oct 2026 21:36:21 +0200 Subject: [PATCH 36/46] docs(iam): note #1514 and device-policy baseline drift --- .claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md b/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md index 156e9047e..29cc991d0 100644 --- a/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md +++ b/.claude/board/entries/2026-10-12-iam-substrate-sag-dir-sim.md @@ -49,3 +49,7 @@ Treat IGA, PAM, access/SSO, directories, device/app and automation as **overlapp **Numbered falsifiers:** IAM-01..15 remain the first-draft baseline; IAM-16..40 are planned, not run. The addendum contains 25 additional cases, including adversarial/disable controls. Source research includes [arXiv:1701.05699](https://arxiv.org/abs/1701.05699), [arXiv:2603.13181](https://arxiv.org/abs/2603.13181), [arXiv:2602.16708](https://arxiv.org/abs/2602.16708), [arXiv:2603.07004](https://arxiv.org/abs/2603.07004), [OASIS XACML 3.0](https://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html) and [RFC 7644](https://www.rfc-editor.org/info/rfc7644). **Scope invariant:** no new compiler opcode, graph engine, policy authority, register-lane/CE64 encoding, live provider write, privileged session, or claim of implemented validation. Integrate only by a later code-grounded, reviewable PR. + +### Post-#1509 drift note (main vs this research branch) + +Merged [#1514](https://github.com/AdaWorldAPI/lance-graph/pull/1514) provides D-CMH-G1-4a functional one-hop in the glove; general many-to-many, second hop and R2IL GATHER parity remain refused. On main, `.claude/plans/policy-baseline-integration-v1.md` is a proposal separating GPO/Intune configured, assigned and observed status. Neither is present as a tested IAM end-to-end feature in this research PR. **Additional tests IAM-41..45** cover device state/mapping and the exact one-hop boundary. Total planned falsifiers: **45**, all still unexecuted in this docs-only PR. See [frontier plan §§12-13](../../plans/iam-substrate-frontier-gaps-v1.md). From d8040d27c8110f692444935d13e345c9da55b605 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 19:52:50 +0000 Subject: [PATCH 37/46] docs: renumber this PR's D-SAG-2 to D-SAG-3 #1510, #1511, #1513 and #1515 all claimed D-SAG-2 with conflicting sub-numbering. #1510 keeps D-SAG-2; this plan becomes D-SAG-3. Mechanical rename of the PR's own ids only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- ...psi_rubicon_care_wisdom_frontier_source_excerpts.md | 10 +++++----- ...tier_active_inference_delta_and_misspecification.md | 6 +++--- .claude/plans/sag-wisdom-frontier-hard-problems-v1.md | 4 ++-- .claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md | 6 +++--- .../sag-wisdom-frontier-adversarial-expansion.md | 4 ++-- .claude/prompts/sag-wisdom-frontier-claude-code.md | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md b/.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md index a56b31135..a9637a62b 100644 --- a/.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md +++ b/.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md @@ -1,9 +1,9 @@ -# D-SAG-2 source excerpts: OpenPsi, Rubikon, Shannon/EIG, CARE, ONA and Hyperon +# D-SAG-3 source excerpts: OpenPsi, Rubikon, Shannon/EIG, CARE, ONA and Hyperon **Date:** 2026-10-12. **Status:** ANNOTATED RESEARCH, not a replication, formal proof, or benchmark. -**Parent work:** merged [#1509 software-awareness graph](https://github.com/AdaWorldAPI/lance-graph/pull/1509); [D-SAG-2 plan](../.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md). +**Parent work:** merged [#1509 software-awareness graph](https://github.com/AdaWorldAPI/lance-graph/pull/1509); [D-SAG-3 plan](../.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md). -**Editorial rule:** These are **short paraphrased excerpts / takeaways**, not verbatim reproductions. Every entry states (a) what is supported by its linked source, (b) the proposed transfer to lance-graph, and (c) a disconfirming experiment. This directory is a literature shelf; OpenPsi READMEs, GitHub PRs and peer-reviewed articles are **not** being misrepresented as arXiv papers. The full text of each work must be consulted before claiming algorithmic equivalence. No source is evidence that a D-SAG-2 probe has already run. +**Editorial rule:** These are **short paraphrased excerpts / takeaways**, not verbatim reproductions. Every entry states (a) what is supported by its linked source, (b) the proposed transfer to lance-graph, and (c) a disconfirming experiment. This directory is a literature shelf; OpenPsi READMEs, GitHub PRs and peer-reviewed articles are **not** being misrepresented as arXiv papers. The full text of each work must be consulted before claiming algorithmic equivalence. No source is evidence that a D-SAG-3 probe has already run. ## S01 — CARE reference-conditioned executable programs (2026) @@ -113,7 +113,7 @@ **Paraphrased excerpt from PR description, not established merge:** Multiple demands in the normal interval share satisfaction score 0.84, making implicit tie decisions order-sensitive. The current selector previously mapped affiliation, competence and energy to the same mission goal. The PR proposes explicit deterministic demand order and separate goal destinations. -**Transfer hypothesis:** Include ties, reversed row order and meaningful goal-to-action mapping in the D-SAG-2 evaluation even if the upstream fix remains unmerged. +**Transfer hypothesis:** Include ties, reversed row order and meaningful goal-to-action mapping in the D-SAG-3 evaluation even if the upstream fix remains unmerged. **Falsifier:** Same semantics, different iteration order produces a different winner; or changing dominant demand leaves goal/action unchanged. @@ -145,7 +145,7 @@ | GitHub README/release | Select actual oracle and CLI/test entrypoints | Claim two runtimes share truth laws | | GitHub open PR | Construct an adversarial fixture | Treat unmerged fixes as shipped | | Our merged #1494/#1509 | Ground existing test-local mechanisms and one-hop SAG | Assume a mature production motivational engine exists | -| Our proposed D-SAG-2 | Run pre-registered falsifiers | Claim discoveries merely because graph patterns are visually fractal | +| Our proposed D-SAG-3 | Run pre-registered falsifiers | Claim discoveries merely because graph patterns are visually fractal | ### Citation/replication rules diff --git a/.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md b/.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md index 58fe12d4b..476cfb0d8 100644 --- a/.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md +++ b/.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md @@ -1,8 +1,8 @@ # Wisdom frontier: active inference, robust curiosity and incremental reasoning -**Date:** 2026-10-12. **Status:** Research-only annotated literature shelf (second wave for [D-SAG-2 / PR #1511](https://github.com/AdaWorldAPI/lance-graph/pull/1511)). These are **original paraphrased research excerpts** and engineering transfer hypotheses, not verbatim copyrighted extracts, reproduction of proofs, run logs or benchmark results. This directory includes publisher and project research references as well as arXiv sources; the directory name does not assert that every source is an arXiv preprint. +**Date:** 2026-10-12. **Status:** Research-only annotated literature shelf (second wave for [D-SAG-3 / PR #1511](https://github.com/AdaWorldAPI/lance-graph/pull/1511)). These are **original paraphrased research excerpts** and engineering transfer hypotheses, not verbatim copyrighted extracts, reproduction of proofs, run logs or benchmark results. This directory includes publisher and project research references as well as arXiv sources; the directory name does not assert that every source is an arXiv preprint. -Read with [D-SAG-2 architecture](../.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md), [deferred hard problems](../.claude/plans/sag-wisdom-frontier-hard-problems-v1.md), and [first-wave literature](2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md). +Read with [D-SAG-3 architecture](../.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md), [deferred hard problems](../.claude/plans/sag-wisdom-frontier-hard-problems-v1.md), and [first-wave literature](2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md). ## E01. Friston et al. (2026): active inference and artificial reasoning @@ -23,7 +23,7 @@ Read with [D-SAG-2 architecture](../.claude/plans/sag-wisdom-frontier-ona-hypero - **Reference:** Tommie A. Catanach and Niladri Das, *Metrics for Bayesian Optimal Experiment Design under Model Misspecification*, [arXiv:2304.07949](https://arxiv.org/abs/2304.07949) (2023). - **Paraphrased excerpt:** Standard Bayesian experiment design optimizes information gain using the selected inference model's predictions. The paper motivates and examines additional criteria, including expected generalized information gain and expected discriminatory information, to account for model discrepancy. -- **Transfer:** Make the original D-SAG-2 probability-calibration requirement stricter: holding a normalized posterior over a *wrong set of explanations* is insufficient. Maintain model criticism or a rival hypothesis family outside the trusted candidate set. +- **Transfer:** Make the original D-SAG-3 probability-calibration requirement stricter: holding a normalized posterior over a *wrong set of explanations* is insufficient. Maintain model criticism or a rival hypothesis family outside the trusted candidate set. - **Falsifier:** Every candidate causal graph is false, yet a closed-world EIG controller becomes more certain; an independent discrepancy test must challenge this self-certainty. Do not import source formulas without their assumptions and quantities. ## E04. Pathak et al. (2017): action-relevant curiosity diff --git a/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md b/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md index c9473d293..c075e1c8a 100644 --- a/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md +++ b/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md @@ -1,6 +1,6 @@ -# D-SAG-2.1: deferred hard problems in the wisdom frontier +# D-SAG-3.1: deferred hard problems in the wisdom frontier -**Status:** RESEARCH ONLY. Extension of [D-SAG-2](sag-wisdom-frontier-ona-hyperon-v1.md) on PR #1511, based on merged #1509. Nothing here is a shipped feature, performed experiment, authorization, or production ABI decision. [Source excerpts](../../.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md). +**Status:** RESEARCH ONLY. Extension of [D-SAG-3](sag-wisdom-frontier-ona-hyperon-v1.md) on PR #1511, based on merged #1509. Nothing here is a shipped feature, performed experiment, authorization, or production ABI decision. [Source excerpts](../../.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md). ## H1. Four distinct epistemic quantities diff --git a/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md index 33b66b91a..f8ca75c07 100644 --- a/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md +++ b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md @@ -1,4 +1,4 @@ -# D-SAG-2 — Wisdom frontier: OpenPsi x Rubikon x Shannon x CARE x ONA/Hyperon +# D-SAG-3 — Wisdom frontier: OpenPsi x Rubikon x Shannon x CARE x ONA/Hyperon **Status:** RESEARCH / FALSIFIABLE DESIGN ONLY, 2026-10-12. Sibling extension of merged [D-SAG-1 / #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). **No implementation, runtime evaluation, opcode, wire change, new graph engine, bit migration, authorization change, or speedup claim.** @@ -130,7 +130,7 @@ Never reward entropy for entropy's sake. Penalize useless curiosity through meas No proposed optimizer H1 is performed automatically. Any optimization is a proposal checked by semantic equivalence, NULL/bag/set, cost tier and authority, and requires an authorized effect separately. -## 6. Falsifier ledger (proposed D-SAG-2-0 .. 15) +## 6. Falsifier ledger (proposed D-SAG-3-0 .. 15) | ID | Fixture / comparison | Failure condition | | --- | --- | --- | @@ -182,7 +182,7 @@ Terminate or narrow scope if any test silently reinterprets production CE64 50.. ## Deferred extension on the same PR: A16..A33 -The first-wave D-SAG-2-0..15 falsifiers deliberately focused on establishing the positive, bounded stage-0 frontier and independently validated CARE-style proposal. The following **second-wave research**, added to #1511, covers safety and epistemic failure modes not yet exhaustively specified in that first wave: +The first-wave D-SAG-3-0..15 falsifiers deliberately focused on establishing the positive, bounded stage-0 frontier and independently validated CARE-style proposal. The following **second-wave research**, added to #1511, covers safety and epistemic failure modes not yet exhaustively specified in that first wave: - [Hard-problems / incremental truth maintenance](sag-wisdom-frontier-hard-problems-v1.md): **four-state prerequisite debt** (known / refuted / missing / unread); alternative sufficient supports; deletion/retraction against fresh full-recomputation; source/version invalidation; bounded work and starvation; rubicon commitment hysteresis; conditional permits and cancellation races; graph ablation vs intervention; field-by-field ONA/MeTTa/PLN oracle parity. - [Second-wave .arxiv source excerpts](../../.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md): Friston et al. 2026 active inference and structure learning, Wei 2024 EFE/value, Catanach/Das 2023 misspecified EIG, Pathak 2017 curiosity, Burda 2018 RND, McSherry et al. 2013 differential dataflow, Beckers 2021 actual causation, plus source limitations. diff --git a/.claude/prompts/sag-wisdom-frontier-adversarial-expansion.md b/.claude/prompts/sag-wisdom-frontier-adversarial-expansion.md index f09b1e5b9..ddd2cfbaf 100644 --- a/.claude/prompts/sag-wisdom-frontier-adversarial-expansion.md +++ b/.claude/prompts/sag-wisdom-frontier-adversarial-expansion.md @@ -1,6 +1,6 @@ -# Claude Code extension prompt: D-SAG-2 red-team / deferred falsifiers A16..A33 +# Claude Code extension prompt: D-SAG-3 red-team / deferred falsifiers A16..A33 -**Scope:** Follow-up on existing PR #1511, NOT a new engine or production implementation. Begin from merged #1509 and the three initial D-SAG-2 documents. Read: +**Scope:** Follow-up on existing PR #1511, NOT a new engine or production implementation. Begin from merged #1509 and the three initial D-SAG-3 documents. Read: - .claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md - .claude/plans/sag-wisdom-frontier-hard-problems-v1.md - .arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md diff --git a/.claude/prompts/sag-wisdom-frontier-claude-code.md b/.claude/prompts/sag-wisdom-frontier-claude-code.md index 5c507af15..2b4aca0f9 100644 --- a/.claude/prompts/sag-wisdom-frontier-claude-code.md +++ b/.claude/prompts/sag-wisdom-frontier-claude-code.md @@ -1,4 +1,4 @@ -# Claude Code handoff — D-SAG-2: wisdom-frontier / OpenPsi / Rubikon / CARE / ONA / Hyperon +# Claude Code handoff — D-SAG-3: wisdom-frontier / OpenPsi / Rubikon / CARE / ONA / Hyperon **Objective:** Turn the merged D-SAG-1 software-awareness graph (#1509) into a *testable research path* toward evidence-grounded, intrinsically motivated self-inspection. Implement only verified, phase-gated, reversible probes. **Do not build a second graph engine.** @@ -18,7 +18,7 @@ First give a **source-grounded code census** of the actual merged #1509 API: SoftwareGraph, Binder, MethodTable, Quack Draft, mask-risc program/terminal, class_view seal, provenance/root algebra, pearl::hydrate, experimental maturation, any current stage reading and the legal one-hop limit. Also inspect relevant OGAR and ONA/Hyperon source interfaces and **mark unverified capabilities as unverified**. Do not treat document plans as production APIs. -Then choose the **smallest independent probe** which can be implemented in the current test tree and compared to a scalar oracle. Preferred first target: **D-SAG-2-P1, stage-0 frontier popcount and evidence-root invariants**. Do not expand to live adapters, volition, EIG and CARE all in one code change. +Then choose the **smallest independent probe** which can be implemented in the current test tree and compared to a scalar oracle. Preferred first target: **D-SAG-3-P1, stage-0 frontier popcount and evidence-root invariants**. Do not expand to live adapters, volition, EIG and CARE all in one code change. ### Substrate invariants (non-negotiable) @@ -112,7 +112,7 @@ After the above, ask the existing SoftwareGraph whether a method's repeated cond ## Reporting format For each probe, produce: -- question and falsifier ID (D-SAG-2-x); +- question and falsifier ID (D-SAG-3-x); - source revision, actual call path, declared semantic reading; - exact input/original observation roots, candidate count and budget; - independent scalar oracle expectation; From d8efa44a0e260147b58a9ab0ba9091fbe27e1cad Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 19:52:54 +0000 Subject: [PATCH 38/46] docs: renumber this PR's D-SAG-2 to D-SAG-4 #1510, #1511, #1513 and #1515 all claimed D-SAG-2 with conflicting sub-numbering. #1510 keeps D-SAG-2; this plan becomes D-SAG-4. Mechanical rename of the PR's own ids only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- .../2026-10_sag_agent_attention_active_selection_excerpts.md | 2 +- .arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md | 4 ++-- .arxiv/2026-10_sag_repo_graph_context_source_excerpts.md | 4 ++-- .../software-awareness-agent-context-deferred-contracts-v1.md | 4 ++-- .claude/plans/software-awareness-agent-context-ona-v1.md | 4 ++-- .claude/prompts/d-sag-2-ona-agent-context-implementation.md | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md b/.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md index a6834f318..560e26d76 100644 --- a/.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md +++ b/.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md @@ -1,4 +1,4 @@ -# D-SAG-2: bounded context attention, costly exploration and correctness-first uncertainty +# D-SAG-4: bounded context attention, costly exploration and correctness-first uncertainty **Date:** 2026-10-12. **Mode:** primary-paper **abstract-level paraphrases**, not verbatim quotations, no code implementations or D-SAG performance claims. Some papers have detailed methods/results not reproduced here; CC must read and pin an exact PDF version before claiming detailed parity or method reproduction. Companion: [deferred contracts](../.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md). diff --git a/.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md b/.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md index e3233b520..da5bdaf67 100644 --- a/.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md +++ b/.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md @@ -1,6 +1,6 @@ -# D-SAG-2 source excerpts: ONA's event–anticipation–feedback loop and internal experience +# D-SAG-4 source excerpts: ONA's event–anticipation–feedback loop and internal experience -**Read:** 2026-10-12. **Kind:** SOURCE-GROUNDED PARAPHRASES / RESEARCH; no ONA port, executable parity test, or runtime integration in this note. **Upstream pin:** [OpenNARS for Applications @ dc4efd0](https://github.com/opennars/OpenNARS-for-Applications/tree/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a). **Companions:** [D-SAG-2 plan](../.claude/plans/software-awareness-agent-context-ona-v1.md), [repository-code-graph papers](2026-10_sag_repo_graph_context_source_excerpts.md). +**Read:** 2026-10-12. **Kind:** SOURCE-GROUNDED PARAPHRASES / RESEARCH; no ONA port, executable parity test, or runtime integration in this note. **Upstream pin:** [OpenNARS for Applications @ dc4efd0](https://github.com/opennars/OpenNARS-for-Applications/tree/dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a). **Companions:** [D-SAG-4 plan](../.claude/plans/software-awareness-agent-context-ona-v1.md), [repository-code-graph papers](2026-10_sag_repo_graph_context_source_excerpts.md). The term *excerpt* here means a short, attributed **paraphrase** of a source passage or an implementation observation, not a copied passage. Any project transfer is labeled a hypothesis. Existing [2018 self-model note](2018_self_in_nars_requires_internal_experience_and_mental_operations.md) and [NAL audit #1495](https://github.com/AdaWorldAPI/lance-graph/pull/1495) remain separate authorities. diff --git a/.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md b/.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md index 42bea7bfd..e9932c6e5 100644 --- a/.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md +++ b/.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md @@ -1,6 +1,6 @@ -# D-SAG-2 source excerpts: repository code graphs as low-token agent context +# D-SAG-4 source excerpts: repository code graphs as low-token agent context -**Date:** 2026-10-12. **Kind:** RESEARCH / SHORT ATTRIBUTED PARAPHRASES. **Status:** no Claude Code connector, token measurement, source-code index or graph-to-editor implementation demonstrated by this note. **Base:** [merged #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). **Companion:** [D-SAG-2 plan](../.claude/plans/software-awareness-agent-context-ona-v1.md). +**Date:** 2026-10-12. **Kind:** RESEARCH / SHORT ATTRIBUTED PARAPHRASES. **Status:** no Claude Code connector, token measurement, source-code index or graph-to-editor implementation demonstrated by this note. **Base:** [merged #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). **Companion:** [D-SAG-4 plan](../.claude/plans/software-awareness-agent-context-ona-v1.md). Aim: compare the idea of *addressable, typed, locally queried repository context* against existing research rather than treating it as original or already measured. These are paraphrased excerpts keyed to the papers' abstracts and conceptual methods. Source-provided paper benchmark conclusions **do not transfer automatically** to lance-graph/Claude Code. diff --git a/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md index e9a70d2ff..e1d5d7377 100644 --- a/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md +++ b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md @@ -1,6 +1,6 @@ -# D-SAG-2 appendix: deferred concrete contracts for an agent-facing software graph +# D-SAG-4 appendix: deferred concrete contracts for an agent-facing software graph -**Status:** PROPOSAL / NOT SHIPPED. **Added after #1513's first documentation pass.** Built on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), not an alternative to it. Parent: [D-SAG-2 plan](software-awareness-agent-context-ona-v1.md). Research: [source excerpts](../../.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md). This appendix unpacks design and falsification details deliberately left small in the first draft. It does **not** certify measurements, APIs, an IDE plug-in or runtime integration. +**Status:** PROPOSAL / NOT SHIPPED. **Added after #1513's first documentation pass.** Built on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), not an alternative to it. Parent: [D-SAG-4 plan](software-awareness-agent-context-ona-v1.md). Research: [source excerpts](../../.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md). This appendix unpacks design and falsification details deliberately left small in the first draft. It does **not** certify measurements, APIs, an IDE plug-in or runtime integration. ## A. What the existing executor can actually answer diff --git a/.claude/plans/software-awareness-agent-context-ona-v1.md b/.claude/plans/software-awareness-agent-context-ona-v1.md index 14f22bf97..0ddb58a31 100644 --- a/.claude/plans/software-awareness-agent-context-ona-v1.md +++ b/.claude/plans/software-awareness-agent-context-ona-v1.md @@ -1,4 +1,4 @@ -# D-SAG-2 — Addressable software context and ONA-inspired execution feedback +# D-SAG-4 — Addressable software context and ONA-inspired execution feedback **Status:** RESEARCH / unimplemented follow-up. **Base:** [merged D-SAG-1 #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), merge commit `42fa2a347cda22eaaa327bba514f2029cc9daa82`. **Code examined:** `crates/lance-graph-glove-parity/src/awareness.rs`, `method.rs`, `gremlin.rs`; [D-SAG-1 plan](software-awareness-graph-v1.md). **Date:** 2026-10-12. **Companions:** [execution prompt](../prompts/d-sag-2-ona-agent-context-implementation.md), [primary research excerpts](../../.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md), [repository-graph papers](../../.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md). @@ -145,7 +145,7 @@ References: [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), [#150 ## 9. Deferred contracts now expanded (research-only) -The first documentation pass intentionally left implementation detail unresolved. The explicit contracts and negative fixtures are now written out in [D-SAG-2 deferred contracts](software-awareness-agent-context-deferred-contracts-v1.md), including: +The first documentation pass intentionally left implementation detail unresolved. The explicit contracts and negative fixtures are now written out in [D-SAG-4 deferred contracts](software-awareness-agent-context-deferred-contracts-v1.md), including: - source-symbol versus OGAR/MethodKey identity, version/worktree freshness and atomic graph generations; - `resolve/context/impact/propose/expand/explain` proposals as bounded, read-only, typed calls; diff --git a/.claude/prompts/d-sag-2-ona-agent-context-implementation.md b/.claude/prompts/d-sag-2-ona-agent-context-implementation.md index 28b614c15..58ca3df7e 100644 --- a/.claude/prompts/d-sag-2-ona-agent-context-implementation.md +++ b/.claude/prompts/d-sag-2-ona-agent-context-implementation.md @@ -1,4 +1,4 @@ -# Claude Code prompt — D-SAG-2: graph-backed agent context, ONA feedback, and falsifiers +# Claude Code prompt — D-SAG-4: graph-backed agent context, ONA feedback, and falsifiers > **Hand this to a fresh Claude Code session after #1509.** The associated plan and research excerpts are already part of the branch. This document asks for a small executable follow-up, not a claim that the functionality shipped in the documentation PR. From 1bdd94415b5ff8a2a7fbd37f86d1929271bf1da3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 19:52:57 +0000 Subject: [PATCH 39/46] docs: renumber this PR's D-SAG-2 to D-SAG-5 #1510, #1511, #1513 and #1515 all claimed D-SAG-2 with conflicting sub-numbering. #1510 keeps D-SAG-2; this plan becomes D-SAG-5. Mechanical rename of the PR's own ids only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- ...rmation_metagraph_optimization_excerpts.md | 2 +- ...rs_hyperon_reflexive_appraisal_excerpts.md | 2 +- ...sag1509_source_oracles_falsifier_matrix.md | 2 +- .claude/board/INTEGRATION_PLANS.md | 2 +- .claude/board/STATUS_BOARD.md | 24 +++++++------- ...-10-12-sag-reflexive-cognition-research.md | 4 +-- .../sag-reflexive-cognition-from-1509-v1.md | 32 +++++++++---------- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md b/.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md index 9b6b60798..38172daa4 100644 --- a/.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md +++ b/.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md @@ -1,6 +1,6 @@ # Source excerpts: Shannon, PLN, pattern surprise, typed metagraph folding and safe program rewrites -**Date:** 2026-10-12. **Status:** first-hand paper distillation and counterexamples, not experimental results on SAG. **Companion:** [D-SAG-2](../.claude/plans/sag-reflexive-cognition-from-1509-v1.md), prior #1497/#1498 paper distillations. +**Date:** 2026-10-12. **Status:** first-hand paper distillation and counterexamples, not experimental results on SAG. **Companion:** [D-SAG-5](../.claude/plans/sag-reflexive-cognition-from-1509-v1.md), prior #1497/#1498 paper distillations. ## Houlsby et al., 2011: Bayesian Active Learning by Disagreement diff --git a/.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md b/.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md index a625b8e09..4d704c646 100644 --- a/.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md +++ b/.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md @@ -1,6 +1,6 @@ # Source excerpts: NARS/ONA and Hyperon as a grounded self-model, not a homunculus -**Date:** 2026-10-12. **Status:** primary paper extracts / source-grounded questions, not LG runtime parity. **Parent:** #1509. **Companion:** [D-SAG-2](../.claude/plans/sag-reflexive-cognition-from-1509-v1.md). Paraphrases, not large verbatim quotations. +**Date:** 2026-10-12. **Status:** primary paper extracts / source-grounded questions, not LG runtime parity. **Parent:** #1509. **Companion:** [D-SAG-5](../.claude/plans/sag-reflexive-cognition-from-1509-v1.md). Paraphrases, not large verbatim quotations. ## Wang, Li, Hammer, 2018: Self in NARS diff --git a/.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md b/.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md index af2cb1b73..a43bc6095 100644 --- a/.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md +++ b/.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md @@ -1,4 +1,4 @@ -# D-SAG-2 pinned sources, executable oracles and refusal matrix +# D-SAG-5 pinned sources, executable oracles and refusal matrix **Date:** 2026-10-12. **Status:** repository locations and primary papers checked, but **NO NEW EXPERIMENT WAS EXECUTED**. Source URL or headline is not a green test. Read [.claude/knowledge/FIRST-HAND-SOURCE-LAW.md](../.claude/knowledge/FIRST-HAND-SOURCE-LAW.md) before a future implementation. diff --git a/.claude/board/INTEGRATION_PLANS.md b/.claude/board/INTEGRATION_PLANS.md index 4a2f33b72..264376345 100644 --- a/.claude/board/INTEGRATION_PLANS.md +++ b/.claude/board/INTEGRATION_PLANS.md @@ -1,6 +1,6 @@ ## 2026-10-12 (5) — sag-reflexive-cognition-from-1509-v1 — source-backed SAG self-querying, cognition/attention controls and safe optimization proposals → .claude/plans/sag-reflexive-cognition-from-1509-v1.md -**Status:** PROPOSAL D-SAG-2-0..10. Only D-SAG-2-0 documentation is in this PR, based on merged #1509. +**Status:** PROPOSAL D-SAG-5-0..10. Only D-SAG-5-0 documentation is in this PR, based on merged #1509. - Reuses shipped MethodTable/SoftwareGraph/Quack one-hop behavior, compiler tiers, source seals and H1 cost/refusal ledger. Two-hop, persistence and applying optimizations remain blocked or queued. - Source-indexed .arxiv excerpts connect Wang/ONA internal events, Hyperon reflexive reasoning and affective modulators, BALD vs noise, Miner surprise, metagraph fold laws, evidence fusion/fission and egg rewrite certificates. diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index a81a35787..ea611ccec 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -1,20 +1,20 @@ -## D-SAG-2 — Reflexive cognition and proposal safety from SAG #1509 (2026-10-12) +## D-SAG-5 — Reflexive cognition and proposal safety from SAG #1509 (2026-10-12) **Status:** PROPOSAL. Plan: .claude/plans/sag-reflexive-cognition-from-1509-v1.md. Docs only; no runtime authorization. | D-id | scope | status | gate / falsifier | |---|---|---|---| -| D-SAG-2-0 | source research, Claude Code prompt, board and negative-control matrix | In PR (docs) | sources pinned; new runtime diff empty | -| D-SAG-2-1 | rerun compiler-backed SAG one-hop parity | Queued | exact prepared Program/refusal and tier; stale cert red | -| D-SAG-2-2 | ContextSlice vs source/rg/Markdown with real tokens | Queued | exact answer/source with counted input tokens; unsupported hop refused | -| D-SAG-2-3 | evidence, derivation and attention independent provenance | Queued | copied source counted once; independent source twice | -| D-SAG-2-4 | episode interpretation and pinned snapshot replay | Queued | k immutable under k+1 append; no replay-as-evidence | -| D-SAG-2-5 | Shannon/BALD/PLN/ONA/ECAN/Staunen policies | Queued | fixed truth law, same budget, noisy and epistemic controls | -| D-SAG-2-6 | four named appraisal-policy ablations | Queued | no factual truth drift; benefit vs frozen no-meta | -| D-SAG-2-7 | MeTTa/metagraph typed subset | Queued | four-result multiplicity, typed port, static fold or refusal | -| D-SAG-2-8 | H1 and MDL candidate independent validation | Queued | null, overflow, bag, source and cost proofs; no fused speedup assumed | -| D-SAG-2-9 | conflicting sources and revised significance | Queued | no person-wide penalty or false new observation | -| D-SAG-2-10 | approval, source change and rollback gates | Queued | default deny; self-issued compiled/verified tier fails | +| D-SAG-5-0 | source research, Claude Code prompt, board and negative-control matrix | In PR (docs) | sources pinned; new runtime diff empty | +| D-SAG-5-1 | rerun compiler-backed SAG one-hop parity | Queued | exact prepared Program/refusal and tier; stale cert red | +| D-SAG-5-2 | ContextSlice vs source/rg/Markdown with real tokens | Queued | exact answer/source with counted input tokens; unsupported hop refused | +| D-SAG-5-3 | evidence, derivation and attention independent provenance | Queued | copied source counted once; independent source twice | +| D-SAG-5-4 | episode interpretation and pinned snapshot replay | Queued | k immutable under k+1 append; no replay-as-evidence | +| D-SAG-5-5 | Shannon/BALD/PLN/ONA/ECAN/Staunen policies | Queued | fixed truth law, same budget, noisy and epistemic controls | +| D-SAG-5-6 | four named appraisal-policy ablations | Queued | no factual truth drift; benefit vs frozen no-meta | +| D-SAG-5-7 | MeTTa/metagraph typed subset | Queued | four-result multiplicity, typed port, static fold or refusal | +| D-SAG-5-8 | H1 and MDL candidate independent validation | Queued | null, overflow, bag, source and cost proofs; no fused speedup assumed | +| D-SAG-5-9 | conflicting sources and revised significance | Queued | no person-wide penalty or false new observation | +| D-SAG-5-10 | approval, source change and rollback gates | Queued | default deny; self-issued compiled/verified tier fails | ## D-SAG-1 — Software-awareness graph (2026-10-12) diff --git a/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md b/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md index 9d5c64b88..60fb7a079 100644 --- a/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md +++ b/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md @@ -1,4 +1,4 @@ -# 2026-10-12: D-SAG-2-0, grounded reflexive-cognition research after #1509 +# 2026-10-12: D-SAG-5-0, grounded reflexive-cognition research after #1509 **Status:** PROPOSED / docs only. Parent is merged #1509. No runtime, schema, ISA, oracle or permission changes. **Plan:** .claude/plans/sag-reflexive-cognition-from-1509-v1.md. @@ -9,6 +9,6 @@ The already measured SAG projects prepared methods and compiler tiers to a Quack Novel crosscheck: internally observed/derived/attended events are distinct; copied evidence never increases truth; time-k episode may receive time-(k+1) significance without changing time-k fact; opposing source propositions need not invalidate their authors. Emberglow, Steelwind, Woodwarm and Velvetpause are *functional controller names*, not qualia findings or bits. Shannon H(f), BALD, ONA control, PLN and ECAN have separate baselines. A local code graph is not a zero-token LLM interface. -D-SAG-2-0 is documentation; D-SAG-2-1..10 are QUEUED and require independent falsifiers and explicit later implementation authorization. +D-SAG-5-0 is documentation; D-SAG-5-1..10 are QUEUED and require independent falsifiers and explicit later implementation authorization. Closeout: PR # | DRAFT | source extracts, reconciled plan, Claude Code prompt, frozen-source oracle/negative-control matrix | nothing implemented, all experiments OPEN. diff --git a/.claude/plans/sag-reflexive-cognition-from-1509-v1.md b/.claude/plans/sag-reflexive-cognition-from-1509-v1.md index 411c3efa2..28926da85 100644 --- a/.claude/plans/sag-reflexive-cognition-from-1509-v1.md +++ b/.claude/plans/sag-reflexive-cognition-from-1509-v1.md @@ -1,4 +1,4 @@ -# D-SAG-2: reflexive cognition and safe optimization from #1509 +# D-SAG-5: reflexive cognition and safe optimization from #1509 **Date:** 2026-10-12. **Status:** PROPOSAL. Documentation only. **Parent:** merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509); follow-up research to merged [#1496](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498](https://github.com/AdaWorldAPI/lance-graph/pull/1498) and [#1499](https://github.com/AdaWorldAPI/lance-graph/pull/1499). @@ -62,23 +62,23 @@ These four user-coined terms are proposed **functional policy labels**. Neither The engine remains: prepared MethodTable -> SoftwareGraph/Binder -> Quack -> R2IL procedures when actually implemented -> mask-risc -> ndarray. A proposed controller may rank **which existing legal query to execute next**, but may not mint a new OGAR byte, new VM, implicit carrier, optimizer backend or hidden global knowledge service. -## D-SAG-2 falsification ladder +## D-SAG-5 falsification ladder | D-id | Probe | Independent oracle / red test | |---|---|---| -| D-SAG-2-0 | literature plan, source map, prompt and board (this PR) | docs only, status explicitly proposed | -| D-SAG-2-1 | re-run #1509 one-hop queries and compiler tiers | actual MethodTable/compiled Programs; changed source or stale certificate refuses | -| D-SAG-2-2 | ContextSlice vs full source/rg/Markdown and tokens | exact answers, source SHA, false/omitted results, real model input token count; unsupported hop refuses | -| D-SAG-2-3 | evidence vs derivation vs attention | same observation copied into 2 layers counts once; 2 independent in same layer count twice; final truth unchanged by receipt replay | -| D-SAG-2-4 | episodic continuity and later appraisal | pinned version k replay identical while k+1 appends; changed significance does not rewrite old source event | -| D-SAG-2-5 | scheduler factorial | FIFO, ONA/PLN source-accurate queues, raw H(f), BALD, Miner/JSD, Moore/Staunen; identical truth laws and candidate budgets | -| D-SAG-2-6 | four functional-appraisal arms | policy changes attention only; measured utility vs no-appraisal and frozen/no-meta controls | -| D-SAG-2-7 | MeTTa and fold-law subset | 4 nondeterministic results not collapsed to 2 survivors; typed port ordering, error/unreduced form, constructor/snapshot parity | -| D-SAG-2-8 | safe H1, MDL and rewrite proposals | actual compiler + independent scalar oracle; NULL, bag/set, overflow, provenance, stale seal and mixed workloads | -| D-SAG-2-9 | conflicting arguments, relational significance | claim update not source-wide trust penalty; facts stable while context-aware prediction improves or policy rejected | -| D-SAG-2-10 | permission and rollback | proposal != authorization; no self-issued compiled/verified edge, no source or external write until separately authorized | - -**Suggested order:** D-SAG-2-1 -> 2 -> 3/4 -> 5/6 -> 7/8/9 -> 10. An early failed claim may stop the downstream work. +| D-SAG-5-0 | literature plan, source map, prompt and board (this PR) | docs only, status explicitly proposed | +| D-SAG-5-1 | re-run #1509 one-hop queries and compiler tiers | actual MethodTable/compiled Programs; changed source or stale certificate refuses | +| D-SAG-5-2 | ContextSlice vs full source/rg/Markdown and tokens | exact answers, source SHA, false/omitted results, real model input token count; unsupported hop refuses | +| D-SAG-5-3 | evidence vs derivation vs attention | same observation copied into 2 layers counts once; 2 independent in same layer count twice; final truth unchanged by receipt replay | +| D-SAG-5-4 | episodic continuity and later appraisal | pinned version k replay identical while k+1 appends; changed significance does not rewrite old source event | +| D-SAG-5-5 | scheduler factorial | FIFO, ONA/PLN source-accurate queues, raw H(f), BALD, Miner/JSD, Moore/Staunen; identical truth laws and candidate budgets | +| D-SAG-5-6 | four functional-appraisal arms | policy changes attention only; measured utility vs no-appraisal and frozen/no-meta controls | +| D-SAG-5-7 | MeTTa and fold-law subset | 4 nondeterministic results not collapsed to 2 survivors; typed port ordering, error/unreduced form, constructor/snapshot parity | +| D-SAG-5-8 | safe H1, MDL and rewrite proposals | actual compiler + independent scalar oracle; NULL, bag/set, overflow, provenance, stale seal and mixed workloads | +| D-SAG-5-9 | conflicting arguments, relational significance | claim update not source-wide trust penalty; facts stable while context-aware prediction improves or policy rejected | +| D-SAG-5-10 | permission and rollback | proposal != authorization; no self-issued compiled/verified edge, no source or external write until separately authorized | + +**Suggested order:** D-SAG-5-1 -> 2 -> 3/4 -> 5/6 -> 7/8/9 -> 10. An early failed claim may stop the downstream work. ## Required controls and metrics @@ -100,4 +100,4 @@ The 2023 Hyperon paper describes the metagraph as substrate for reflexive cognit - No independently observed performance/accuracy benefit? Report null or failure, do not claim adaptive self-optimization. - No evidence of subjective states? Never claim machine qualia, feeling, respect or transcendence. -**No runtime code, CE64 meaning, new field, opcode, tenant, schema or ABI is authorized by D-SAG-2-0.** +**No runtime code, CE64 meaning, new field, opcode, tenant, schema or ABI is authorized by D-SAG-5-0.** From d1babe77ddea651659b54c5f5de8d297de466bae Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 19:53:06 +0000 Subject: [PATCH 40/46] docs: renumber D-SAG-2A..C to D-SAG-4A..C Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- ...wareness-agent-context-deferred-contracts-v1.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md index e1d5d7377..e62302aaa 100644 --- a/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md +++ b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md @@ -193,13 +193,13 @@ Every guard needs a non-vacuous red disable or an independently observed failure ## I. Incremental delivery order and explicit exclusions -1. **D-SAG-2A: read-only one-hop context slice** using existing Quack `Draft`, with source refs and stale checks; compare independent source lookup. -2. **D-SAG-2B: source-symbol adapter** only if it improves task correctness against LSP baseline. No broad tree-sitter rewrite before benchmarking. -3. **D-SAG-2C: bounded deterministic proposer**, three witnessed rules; supported one-hop only. -4. **D-SAG-2D: receipt schema + nonrecursive offline graph projection**, with oracle and version guarantees. -5. **D-SAG-2E: registered anticipation/feedback and baseline comparison**, initially benchmark-only. -6. **D-SAG-2F: optional Claude Code adapter and token study**, only with a live measured call. -7. **D-SAG-2G: multi-hop projection**, only after current Quack carrier laws/semantics permit it. +1. **D-SAG-4A: read-only one-hop context slice** using existing Quack `Draft`, with source refs and stale checks; compare independent source lookup. +2. **D-SAG-4B: source-symbol adapter** only if it improves task correctness against LSP baseline. No broad tree-sitter rewrite before benchmarking. +3. **D-SAG-4C: bounded deterministic proposer**, three witnessed rules; supported one-hop only. +4. **D-SAG-4D: receipt schema + nonrecursive offline graph projection**, with oracle and version guarantees. +5. **D-SAG-4E: registered anticipation/feedback and baseline comparison**, initially benchmark-only. +6. **D-SAG-4F: optional Claude Code adapter and token study**, only with a live measured call. +7. **D-SAG-4G: multi-hop projection**, only after current Quack carrier laws/semantics permit it. Explicitly deferred: full Rust call-graph completeness; all-repository persistent index; causal proof from mere temporal data; unbounded graph walks; automatic code edits; automatic git merges; NAL-9 parity; production optimizer switching; personalized tool policy not backed by receipts; speculative ISA/CE64 reinterpretation; any claim about deployed self-modification. From f81e6de5599f5dd8eb847833607d2ea1f69abf9c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 19:53:21 +0000 Subject: [PATCH 41/46] board: index row follows the D-SAG-5 renumber Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- .claude/board/entries/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index bc7b8f790..22ff962be 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -30,7 +30,7 @@ exactly one of them, never both. | date | entry id | finding | file | |---|---|---|---| | 2026-10-12 | `D-SAG-1` | | [2026-10-12-software-awareness-graph.md](2026-10-12-software-awareness-graph.md) | -| 2026-10-12 | `D-SAG-2-0` | Post-#1509 SAG self-querying, provenance and limited attention with NARS/Hyperon/PLN comparisons; research prompt and high-signal falsifiers | [2026-10-12-sag-reflexive-cognition-research.md](2026-10-12-sag-reflexive-cognition-research.md) | +| 2026-10-12 | `D-SAG-5-0` | Post-#1509 SAG self-querying, provenance and limited attention with NARS/Hyperon/PLN comparisons; research prompt and high-signal falsifiers | [2026-10-12-sag-reflexive-cognition-research.md](2026-10-12-sag-reflexive-cognition-research.md) | | 2026-10-12 | `opencog-pln-entropy-research-map` | Source inventory and falsifiable PLN/ECAN/Shannon/Moore attention comparison: entropy target, evidence overlap, graph projection, resource fairness | [2026-10-12-opencog-pln-entropy-research-map.md](2026-10-12-opencog-pln-entropy-research-map.md) | | 2026-10-12 | `nars-self-evidence-literature` | NARS internal trace versus evidence, Jøsang dependent/independent fusion and fission, and the snapshot-stable fold assumption; source-grounded red tests for merged #1496 | [2026-10-12-nars-self-evidence-literature.md](2026-10-12-nars-self-evidence-literature.md) | | 2026-10-12 | `hyperon-metta-lg-translation` | Hyperon/MeTTa to LG sibling map: atom/hypergraph roundtrip, binding and rewrite parity, typed folds, scoped effects and 15 open questions | [2026-10-12-hyperon-metta-lg-translation.md](2026-10-12-hyperon-metta-lg-translation.md) | From fd97596237846fb5bf4de69e4e772257e6ca02a6 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 21:02:23 +0000 Subject: [PATCH 42/46] board: regenerate the entries index after merging #1517 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- .claude/board/entries/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index a0d43e4c4..861c034e7 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -25,7 +25,7 @@ index row, (3) no duplicate entry id. Checks 1 and 2 are deliberately opposite directions; the stranding this convention prevents shows up in exactly one of them, never both. -321 entries, 2026-08-06 .. 2026-10-12. +322 entries, 2026-08-06 .. 2026-10-12. | date | entry id | finding | file | |---|---|---|---| @@ -34,6 +34,7 @@ exactly one of them, never both. | 2026-10-12 | `D-CMH-G1-6` | | [2026-10-12-ordered-conditions-and-extrema.md](2026-10-12-ordered-conditions-and-extrema.md) | | 2026-10-12 | `opencog-pln-entropy-research-map` | Source inventory and falsifiable PLN/ECAN/Shannon/Moore attention comparison: entropy target, evidence overlap, graph projection, resource fairness | [2026-10-12-opencog-pln-entropy-research-map.md](2026-10-12-opencog-pln-entropy-research-map.md) | | 2026-10-12 | `nars-self-evidence-literature` | NARS internal trace versus evidence, Jøsang dependent/independent fusion and fission, and the snapshot-stable fold assumption; source-grounded red tests for merged #1496 | [2026-10-12-nars-self-evidence-literature.md](2026-10-12-nars-self-evidence-literature.md) | +| 2026-10-12 | `D-SAG-CF-1` | | [2026-10-12-inverted-temporal-ablation.md](2026-10-12-inverted-temporal-ablation.md) | | 2026-10-12 | `D-IAM-SAG-0` | | [2026-10-12-iam-substrate-sag-dir-sim.md](2026-10-12-iam-substrate-sag-dir-sim.md) | | 2026-10-12 | `hyperon-metta-lg-translation` | Hyperon/MeTTa to LG sibling map: atom/hypergraph roundtrip, binding and rewrite parity, typed folds, scoped effects and 15 open questions | [2026-10-12-hyperon-metta-lg-translation.md](2026-10-12-hyperon-metta-lg-translation.md) | | 2026-10-12 | `D-CMH-G1-4a` | | [2026-10-12-functional-relation-carrier.md](2026-10-12-functional-relation-carrier.md) | From 548bb3ba8af30762c256ceff4bc16f53f3d694d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 21:11:42 +0000 Subject: [PATCH 43/46] board: SAG capstone alignment over #1510/#1511/#1512/#1513/#1515/#1517 Merges the six SAG research PRs and aligns them in one plan: - ProposedMethod is canonical (rewrite shape on awareness::Candidate, action shape on EffectClass::Propose); CandidateProposal, Proposal, ProposedChange and the returned Candidate[] renamed; the #1511 scheduling record becomes SchedulerDecision. - One four-state status maps the five PR vocabularies; #1511's missing-mask now excludes unread, matching hard-problems H1. - #1512 uses the shipped EffectClass names; the #1513 prompt file is renamed to its D-SAG-4 id; the #1515 closeout placeholder is filled. - Stale claims listed (second hop refused, defects A/B unverified). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- .claude/board/INTEGRATION_PLANS.md | 8 + .../2026-10-12-sag-capstone-alignment.md | 15 ++ ...-10-12-sag-reflexive-cognition-research.md | 2 +- .claude/board/entries/README.md | 7 +- ...ility-causality-and-evaluation-addendum.md | 4 +- .../plans/iam-substrate-frontier-gaps-v1.md | 4 +- .claude/plans/iam-substrate-sag-dir-sim-v1.md | 6 +- ...d-temporal-ablation-reasoner-oracles-v1.md | 2 + .claude/plans/sag-capstone-alignment-v1.md | 142 ++++++++++++++++++ .../sag-reflexive-cognition-from-1509-v1.md | 2 + .../sag-wisdom-frontier-hard-problems-v1.md | 2 + .../sag-wisdom-frontier-ona-hyperon-v1.md | 8 +- ...ess-agent-context-deferred-contracts-v1.md | 4 +- ...software-awareness-agent-context-ona-v1.md | 10 +- ...awareness-graph-v2-ruff-ona-closed-loop.md | 2 + ...sag-4-ona-agent-context-implementation.md} | 0 .../sag-wisdom-frontier-claude-code.md | 2 +- ...software-awareness-graph-v2-claude-code.md | 2 +- 18 files changed, 203 insertions(+), 19 deletions(-) create mode 100644 .claude/board/entries/2026-10-12-sag-capstone-alignment.md create mode 100644 .claude/plans/sag-capstone-alignment-v1.md rename .claude/prompts/{d-sag-2-ona-agent-context-implementation.md => d-sag-4-ona-agent-context-implementation.md} (100%) diff --git a/.claude/board/INTEGRATION_PLANS.md b/.claude/board/INTEGRATION_PLANS.md index 264376345..ff37d79d8 100644 --- a/.claude/board/INTEGRATION_PLANS.md +++ b/.claude/board/INTEGRATION_PLANS.md @@ -1,3 +1,11 @@ +## 2026-10-12 (6) — sag-capstone-alignment-v1 — one alignment over the six SAG research PRs (#1510, #1511, #1512, #1513, #1515, #1517) → `.claude/plans/sag-capstone-alignment-v1.md` + +**Status:** CURRENT-CONTRACT for naming and vocabulary; nothing built. + +- `ProposedMethod` is canonical (rewrite shape on `awareness::Candidate`, action shape on `EffectClass::Propose`); six aliases retired; scheduler selection renamed `SchedulerDecision`. +- One four-state status (Witnessed / Refuted / Undetermined / Conflicted) maps the five PR vocabularies; unread is never missing. +- Stale claims listed (second hop refused, defects A/B unverified); contradictions on Ruff's role, ONA pin and execution-class names resolved. + ## 2026-10-12 (5) — sag-reflexive-cognition-from-1509-v1 — source-backed SAG self-querying, cognition/attention controls and safe optimization proposals → .claude/plans/sag-reflexive-cognition-from-1509-v1.md **Status:** PROPOSAL D-SAG-5-0..10. Only D-SAG-5-0 documentation is in this PR, based on merged #1509. diff --git a/.claude/board/entries/2026-10-12-sag-capstone-alignment.md b/.claude/board/entries/2026-10-12-sag-capstone-alignment.md new file mode 100644 index 000000000..45d2b7aa8 --- /dev/null +++ b/.claude/board/entries/2026-10-12-sag-capstone-alignment.md @@ -0,0 +1,15 @@ +# 2026-10-12 — SAG capstone alignment (D-SAG-CAP-1) + +**Finding:** six SAG research PRs written in parallel on the #1509 base +named one concept six ways and defined five status enums for "unknown is not +false". `ProposedMethod` (inert, evidence-carrying method candidate; rewrite +shape on `awareness::Candidate`, action shape on `EffectClass::Propose`) is +now canonical, and one four-state status maps all five vocabularies. Choosing +what to probe next is a separate concept (`SchedulerDecision`). + +Plan: `.claude/plans/sag-capstone-alignment-v1.md`. + +PR # | STATUS: done (docs) | OUTCOME: #1510/#1511/#1512/#1513/#1515/#1517 +merged and aligned; aliases renamed; stale multi-hop claims corrected | +OPEN: ProposedMethod and the four-state status are not built (SAG Step 4); +#1517 oracle tests F0/F7/F8 are claimed, unverified. diff --git a/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md b/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md index 60fb7a079..ded5fbbd9 100644 --- a/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md +++ b/.claude/board/entries/2026-10-12-sag-reflexive-cognition-research.md @@ -11,4 +11,4 @@ Novel crosscheck: internally observed/derived/attended events are distinct; copi D-SAG-5-0 is documentation; D-SAG-5-1..10 are QUEUED and require independent falsifiers and explicit later implementation authorization. -Closeout: PR # | DRAFT | source extracts, reconciled plan, Claude Code prompt, frozen-source oracle/negative-control matrix | nothing implemented, all experiments OPEN. +Closeout: PR #1515 (folded into the capstone) | DRAFT | source extracts, reconciled plan, Claude Code prompt, frozen-source oracle/negative-control matrix | nothing implemented, all experiments OPEN. diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index 861c034e7..6b62f451f 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -25,17 +25,18 @@ index row, (3) no duplicate entry id. Checks 1 and 2 are deliberately opposite directions; the stranding this convention prevents shows up in exactly one of them, never both. -322 entries, 2026-08-06 .. 2026-10-12. +323 entries, 2026-08-06 .. 2026-10-12. | date | entry id | finding | file | |---|---|---|---| | 2026-10-12 | `D-SAG-1` | | [2026-10-12-software-awareness-graph.md](2026-10-12-software-awareness-graph.md) | | 2026-10-12 | `D-SAG-5-0` | Post-#1509 SAG self-querying, provenance and limited attention with NARS/Hyperon/PLN comparisons; research prompt and high-signal falsifiers | [2026-10-12-sag-reflexive-cognition-research.md](2026-10-12-sag-reflexive-cognition-research.md) | +| 2026-10-12 | `D-SAG-CAP-1` | `ProposedMethod` canonical over six SAG PRs; one four-state status; stale multi-hop claims corrected | [2026-10-12-sag-capstone-alignment.md](2026-10-12-sag-capstone-alignment.md) | | 2026-10-12 | `D-CMH-G1-6` | | [2026-10-12-ordered-conditions-and-extrema.md](2026-10-12-ordered-conditions-and-extrema.md) | | 2026-10-12 | `opencog-pln-entropy-research-map` | Source inventory and falsifiable PLN/ECAN/Shannon/Moore attention comparison: entropy target, evidence overlap, graph projection, resource fairness | [2026-10-12-opencog-pln-entropy-research-map.md](2026-10-12-opencog-pln-entropy-research-map.md) | | 2026-10-12 | `nars-self-evidence-literature` | NARS internal trace versus evidence, Jøsang dependent/independent fusion and fission, and the snapshot-stable fold assumption; source-grounded red tests for merged #1496 | [2026-10-12-nars-self-evidence-literature.md](2026-10-12-nars-self-evidence-literature.md) | -| 2026-10-12 | `D-SAG-CF-1` | | [2026-10-12-inverted-temporal-ablation.md](2026-10-12-inverted-temporal-ablation.md) | -| 2026-10-12 | `D-IAM-SAG-0` | | [2026-10-12-iam-substrate-sag-dir-sim.md](2026-10-12-iam-substrate-sag-dir-sim.md) | +| 2026-10-12 | `D-SAG-CF-1` | counterfactual dependency = factual W0 vs detached W_X; RFC + Boolean smoke oracle (F0/F7/F8 unverified) | [2026-10-12-inverted-temporal-ablation.md](2026-10-12-inverted-temporal-ablation.md) | +| 2026-10-12 | `D-IAM-SAG-0` | IAM categories as read-only projections over dir_sim/OGAR/SAG; observed != inferred != authorized | [2026-10-12-iam-substrate-sag-dir-sim.md](2026-10-12-iam-substrate-sag-dir-sim.md) | | 2026-10-12 | `hyperon-metta-lg-translation` | Hyperon/MeTTa to LG sibling map: atom/hypergraph roundtrip, binding and rewrite parity, typed folds, scoped effects and 15 open questions | [2026-10-12-hyperon-metta-lg-translation.md](2026-10-12-hyperon-metta-lg-translation.md) | | 2026-10-12 | `D-CMH-G1-4a` | | [2026-10-12-functional-relation-carrier.md](2026-10-12-functional-relation-carrier.md) | | 2026-10-12 | `D-CMH-G1-4b` | | [2026-10-12-edge-table-anchor-distinct.md](2026-10-12-edge-table-anchor-distinct.md) | diff --git a/.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md b/.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md index b1986c9d7..9e050b424 100644 --- a/.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md +++ b/.claude/knowledge/sag-v2-observability-causality-and-evaluation-addendum.md @@ -113,7 +113,7 @@ read frozen A Observe three classes of operation separately: - **NoOp**: no source or external change; tests attention and measurement drift. An ONA issue discusses ambiguity around a "do nothing operator" as an implementation question, not a settled semantic analogue for SAG. - **Probe**: read-only, potentially costly harvest/measurement. Its side effect is **knowledge intake**, not target-program modification. -- **Proposal**: inert suggested code/transformation/action that cannot execute externally before OGAR authorization. +- **`ProposedMethod`** (canonical, see [capstone](../plans/sag-capstone-alignment-v1.md)): inert suggested code/transformation/action that cannot execute externally before OGAR authorization. No unbounded action loops, no automatic source rewriting. A decision to probe is not the same as a commitment to mutate. A failure prediction becomes negative evidence **only** if the collector could have witnessed its expected outcome. @@ -158,7 +158,7 @@ The Rubicon research (#1500) describes human commitment/implementation intention ```text Hypothesis -> CandidateProbe -> PrecommittedPrediction -> ReadOnlyProbe - -> OutcomeReceipt -> RevisedEvidence -> CandidateProposal + -> OutcomeReceipt -> RevisedEvidence -> ProposedMethod -> OperatorCommitIntent (revocable) -> OGAR Action Gate -> ExternalActionReceipt -> PostconditionObservation ``` diff --git a/.claude/plans/iam-substrate-frontier-gaps-v1.md b/.claude/plans/iam-substrate-frontier-gaps-v1.md index 14790f6cf..f7edd7111 100644 --- a/.claude/plans/iam-substrate-frontier-gaps-v1.md +++ b/.claude/plans/iam-substrate-frontier-gaps-v1.md @@ -1,5 +1,7 @@ # D-IAM-SAG-1 — Frontier addendum: negative proof, temporal authority, and safe introspection +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + > **2026-10-12 / RFC only / deliberately unshipped architectural hypotheses.** Extends [D-IAM-SAG-0](iam-substrate-sag-dir-sim-v1.md) in draft [#1512](https://github.com/AdaWorldAPI/lance-graph/pull/1512), based on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). [Primary literature and standards excerpts](../../.arxiv/2026-10_iam_negative_provenance_authority_and_agentic_policy_excerpts.md). Existing [Claude implementation prompt](../prompts/iam-substrate-after-1509.md) is extended accordingly. > > **Status discipline:** [G] = confirmed in cited code or #1509; [R] = result from cited paper/standard **within its own assumptions**; [H] = proposed mapping not proved in lance-graph; [B] = implementation blocker. An RFC is not implementation. No change to existing ISA/byte contract, OGAR/OGIT mint, any directory schema or authorized provider behavior. @@ -135,7 +137,7 @@ Represent: Keep `D-IAM-SAG-0` read-only. A *future separate PR* can specify: ```text -ProposedChange -> SimulatedImpact -> Human/Policy Approval +ProposedMethod -> SimulatedImpact -> Human/Policy Approval -> Fresh Authorization (actor+resource+verb+scope+purpose) -> Provider Preconditions (source ETag/version, policy rev, target identity) -> External Call (idempotency strategy, declared retry semantics) diff --git a/.claude/plans/iam-substrate-sag-dir-sim-v1.md b/.claude/plans/iam-substrate-sag-dir-sim-v1.md index 7c1f84467..0db00dee3 100644 --- a/.claude/plans/iam-substrate-sag-dir-sim-v1.md +++ b/.claude/plans/iam-substrate-sag-dir-sim-v1.md @@ -1,5 +1,7 @@ # D-IAM-SAG-0 — IAM substrate: dir_sim × OGAR × Class/Methods × Software Awareness Graph +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + > **RFC / implementation handoff, documentation only.** Based on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), merge commit `42fa2a347cda22eaaa327bba514f2029cc9daa82`. The goal is to specify executable, falsifiable IAM projections, not announce six shipped IAM products. No connector writes, security-authority migration, new opcode, second graph engine, or CE64 byte-semantic change is authorized. > > **Companions:** [Software Awareness Graph](software-awareness-graph-v1.md), [Class × Schema × Methods HotPlug](class-method-schema-hotplug-v1.md), [class/method falsifiers](class-method-hotplug-falsifiers-v1.md), [dir-sim persistence](dir-sim-persist-v1.md), [RBAC nested scope](../board/entries/2026-10-08-rbac-nested-scope-path.md), [research excerpts](../../.arxiv/2026-10_iam_access_paths_temporal_provenance_primary_excerpts.md), [implementation prompt](../prompts/iam-substrate-after-1509.md). OGAR semantic sibling [#357](https://github.com/AdaWorldAPI/OGAR/pull/357) is an RFC, not a shipped dynamic-method link. @@ -88,7 +90,7 @@ Requests: 1. `explain_access(A, ERP_Ledger, Write, as_of=V, policy=p7)`: enumerate **all** supporting paths or declare `one witness / nonexhaustive`; include policy, source and snapshot receipt. 2. `revoke_preview(A, GRP_Finance)`: `VersionStore.simulate` on base V, evaluate effective roles for both views with `RoleImpact::between`, compute target entitlement deltas; ensure another valid path preserves access. 3. `why_not_access?`: if the device/CA policy is missing, report `Undetermined/Unknown`, *not* a denial or approval. -4. `propose_action`: stage an inert change with preconditions and impact; policy authority separately gates `approve` and eventual external executor. +4. `propose_action`: stage an inert `ProposedMethod` with preconditions and impact; policy authority separately gates `approve` and eventual external executor. Distinguish **effective graph grant**, **authentication success**, **conditional access evaluation**, and **live enforcement**. A directory membership cannot prove an IdP token was accepted. @@ -103,7 +105,7 @@ class Grant { policy, witnesses, effective_during } class Change { preview, validate, approve, execute, verify, revert } ``` -**Execution class:** `PureRead | VersionPinnedRead | Propose | ExternalMutate` is an RFC name only. `PureRead` and `Propose` use existing Quack/R2IL and dir_sim primitives. `ExternalMutate` is not a Quack opcode and must refuse unless independently authorized, with fresh source preconditions and external connector attestation. An absent field, alias, authority, schema seal, body, read scope, source version, evidence completeness or capability causes an explicit typed refusal. +**Execution class:** these are main's shipped `EffectClass::{Pure, ReadVersion, Propose, ExternalMutate}` (`method.rs`); use those names. `Pure` uses existing Quack/R2IL and dir_sim primitives. `Propose` builds a `ProposedMethod` and is legal only on an Action body; every call on it refuses with `NotPure`. `ExternalMutate` is not a Quack opcode and must refuse unless independently authorized, with fresh source preconditions and external connector attestation. An absent field, alias, authority, schema seal, body, read scope, source version, evidence completeness or capability causes an explicit typed refusal. ## 7. Falsifiers and acceptance matrix diff --git a/.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md b/.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md index c8833b63c..632b29bad 100644 --- a/.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md +++ b/.claude/plans/inverted-temporal-ablation-reasoner-oracles-v1.md @@ -1,5 +1,7 @@ # D-SAG-CF-1: Inverted temporal ablation as a cross-reasoner epistemic probe +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + **Status: RESEARCH RFC / NOT AN IMPLEMENTED ADAPTER.** Parent: [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), the merged one-hop Software Awareness Graph (SAG). Relevant siblings: [#1496](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498](https://github.com/AdaWorldAPI/lance-graph/pull/1498). Literature: [research map](../../.arxiv/2026-10_inverted_temporal_ablation_reasoner_oracles.md). Existing audit: [Gadamer ablation](../research/2026-10-recovery/GADAMER-ABLATION-RESEARCH.md). ## 0. The question: nine dots, one hidden boundary diff --git a/.claude/plans/sag-capstone-alignment-v1.md b/.claude/plans/sag-capstone-alignment-v1.md new file mode 100644 index 000000000..7bcf46cff --- /dev/null +++ b/.claude/plans/sag-capstone-alignment-v1.md @@ -0,0 +1,142 @@ +# SAG capstone alignment — v1 + +**Status:** CURRENT-CONTRACT for the documents it aligns; nothing here is +implemented by this PR. Supersedes the separate review threads of #1510, +#1511, #1512, #1513, #1515 and #1517, which are merged here unchanged except +for the edits listed in §6. + +**Read this before any of the plans it aligns.** They were written in +parallel against the #1509 base. They agree on most of their architecture, +but they used six names for one concept, five status vocabularies, and +several claims that later PRs made stale. + +## 1. The aligned documents + +| D-id series | PR | Plan(s) | Suffix means | +|---|---|---|---| +| D-SAG-2-0..5 | #1510 | `software-awareness-graph-v2-ruff-ona-closed-loop.md` + addendum + provenance-parity knowledge | waves | +| D-SAG-3-0..15, D-SAG-3.1 | #1511 | `sag-wisdom-frontier-ona-hyperon-v1.md`, `sag-wisdom-frontier-hard-problems-v1.md` | falsifiers | +| D-SAG-4A..G | #1513 | `software-awareness-agent-context-ona-v1.md`, `…-deferred-contracts-v1.md` | deferred contracts | +| D-SAG-5-0..10 | #1515 | `sag-reflexive-cognition-from-1509-v1.md` | probes | +| D-IAM-SAG-0-*, 1-* | #1512 | `iam-substrate-sag-dir-sim-v1.md`, `iam-substrate-frontier-gaps-v1.md` | deliverables | +| D-SAG-CF-1 | #1517 | `inverted-temporal-ablation-reasoner-oracles-v1.md` + `inverted_temporal_ablation_oracle.py` | one RFC | + +The suffix meaning differs per series, and that is acceptable because the +series are disjoint. **New SAG work takes the next free series number and +uses the suffix for deliverables.** No collisions exist between the six. + +## 2. `ProposedMethod` is the canonical name + +**DECISION.** One name, `ProposedMethod`, replaces `CandidateProposal`, +`Proposal` (#1510), `ProposedChange` (#1512), the returned `Candidate[]` +(#1513), "H1 proposal" / "optimization proposal" (#1515) and "any +optimization is a proposal" (#1511). + +> A `ProposedMethod` is an **inert, evidence-carrying method candidate**. It +> names what would change and what must be shown first. It can never execute, +> and no stage downstream of it may treat its existence as authorization. + +It has exactly two shapes, and both are already anchored on main: + +| shape | anchor on main | what it carries | what it is not | +|---|---|---|---| +| **rewrite** — a pure, structural optimization | `awareness::Candidate { kind, methods, obligations }` ("never a rewrite") | the candidate, its open `Obligation`s, evidence tier and provenance, and a read-only verification query | not applied: it still needs a semantic-equivalence oracle (NULL / bag / set), a cost measurement and an operator decision | +| **action** — an external effect | `EffectClass::Propose` on `MethodBody::Action` ("builds an inert proposal"); every call refuses with `NotPure` | the effect, its preconditions (source ETag/version, policy revision, target identity) and its simulated impact | not dispatched: it needs fresh OGAR authorization, then provider receipt and re-observation | + +The life cycle is shared, and each arrow is a separate fact with its own +receipt: + +```text +ProposedMethod -> verified (oracle / simulation) -> approved (operator / policy) + -> authorized (fresh OGAR) -> applied -> re-observed -> Verified | Unverified | UnknownOutcome +``` + +`proposed != verified != approved != authorized != applied != re-observed`. +A failed or timed-out external call is `UnknownOutcome`, never "not applied". + +**Not a `ProposedMethod`:** choosing what to look at next. #1511's +`Proposal {…}` record (scores, rubicon_state), #1510's `CandidateProbe`, +#1515's attention proposal and #1517's candidate cut X all select work and +change nothing. They are renamed **`SchedulerDecision`** where a type was +spelled (#1511); prose is left as is. A scheduler decision is `Pure` or +`ReadVersion`. + +**Name check.** `lance_graph_ontology::MappingProposal` is unrelated (an +ontology mapping); it keeps its name. + +**When code lands,** `ProposedMethod` is a type in +`lance-graph-glove-parity::awareness`, built from `Candidate` (rewrite) or +from an `EffectClass::Propose` method (action). No other crate defines its +own proposal type. + +## 3. One status vocabulary: unknown is not false + +The six PRs define five enums for the same idea. The canonical carrier is the +four-state status already shipped by dir-sim (`Held / NotHeld / Undetermined +/ NotDeclared`), extended only with the qualifiers the PRs show are needed: + +| canonical | maps from | +|---|---| +| **Witnessed** (positively observed) | `Confirmed`, `Known`, `Held`, `Witnessed`, `Complete` | +| **Refuted** (positively contradicted) | `Refuted`, `NotHeld`, `AbsentUnderClosedWorld` *(only with a closure certificate)* | +| **Undetermined** (not read, not readable, or not finished) | `Pending`, `NotObservable`, `Incomplete`, `Unread`, `Missing`, `Undetermined`, `Partial`, `NotIndexed`, `InsufficientEvidence` | +| **Conflicted** | `Conflict`, `Conflicted` | + +`Stale` is not a fifth state: it is any of the four read against an expired +revision, carried as a separate revision field. `Unsupported` / +`UnsupportedMultiHop` are typed refusals, not statuses. + +**Consequence fixed in #1511:** `missing = required & ~(established | +refuted | unread)`. An unread prerequisite is `Undetermined`, not missing +debt. The plan and the prompt now agree with `hard-problems` H1. + +Building this enum is Step 4 of the SAG queue (one receipt edge family + one +four-state status); it is not built here. + +## 4. Where the PRs agree (no action) + +- Belief, intent and permission are separate. A commitment grants nothing. +- ONA, OpenNARS, PLN and Hyperon are oracles and references, never engines. +- NARS f/c is not a probability; EIG needs a calibrated distribution. +- Copies and pipeline layers add no evidence; fission needs contributor IDs. +- The H1 fusion numbers agree everywhere (1.59–1.78×; 603.5 vs 379.1 µs). + +## 5. Contradictions resolved + +| topic | PRs | resolution | +|---|---|---| +| Ruff's role | #1510 "independent source oracle"; #1515 "Python lint only, not an equivalence oracle" | Both hold for different questions: Ruff's polyglot SPO harvest is a **source-structure** oracle (what calls/reads what); it is **never** a semantic-equivalence oracle for a rewrite `ProposedMethod`. | +| ONA pin | #1510 "not pinned"; #1513/#1515 `dc4efd0`; #1511 v0.9.3 | Pin **`dc4efd0`**. v0.9.3 is the release that contains it for reading only. | +| Rubicon states | three chains (#1511 twice, #1510) | Use §2's life cycle for proposals; `hard-problems` H5's chain for scheduler commitment. Commitment never implies authorization in either. | +| Execution class names | #1512 `PureRead / VersionPinnedRead / Propose / ExternalMutate` "RFC name only" | They exist: `EffectClass::{Pure, ReadVersion, Propose, ExternalMutate}`. #1512 now uses them. | +| Receipt signing | #1515 "signed witness"; #1511 "not cryptographically signed" | Receipts are content-addressed and auditable, not signed. "Signed" in #1515 means "attributed". | + +## 6. Stale claims + +These are true at the #1509 base and false now. The plans keep their text +(history); this list is the correction. + +1. **"Second hop refused" / "multi-hop blocked" / `NoRelationCarrier` / + `SecondHop`.** Wrong after #1518, #1520 and #1522: `out(r1).out(r2)` + lowers to one `MaskOp::GatherChain` (chained hops are folded hops), the + edge-table anchor carries many-to-many, and `Fold::Distinct` dedups + targets. `in` / `both` still refuse as `FanOut`. Appears in #1510 plan + §2, #1511 (`MultiHopBlocked`, invariant 7, H-tables), #1512 frontier and + prompt, #1513 plan/deferred/prompt, #1515 plan and prompt (the "invalid + two-hop query" probe must pick another refusal), #1517 F13. +2. **SAG defects A and B "UNVERIFIED"** (#1510 plan). Fixed and test-pinned + in #1519, including the two Codex follow-ups: reprojection keeps claimed + class facts, and a `BlockedBy` edge is retracted with its last compiled + refusal. +3. **OGAR #357 status.** Still unverified upstream; the plans' "RFC" is the + safe reading. + +## 7. Open points (not resolved here) + +- #1517's oracle: `test_f0_pristine_replay_is_exact` compares a pure + function with itself, `test_f7_contingency…` repeats F3, and F8 has no + test. They are **claimed, unverified** until rewritten. +- No STATUS_BOARD or INTEGRATION_PLANS rows exist for D-SAG-2, D-SAG-3, + D-SAG-4, D-IAM-SAG or D-SAG-CF; they are research series with no + deliverable in flight. Rows are added when a series starts building. +- `ProposedMethod` and the four-state status are named here, not built. diff --git a/.claude/plans/sag-reflexive-cognition-from-1509-v1.md b/.claude/plans/sag-reflexive-cognition-from-1509-v1.md index 28926da85..af801d172 100644 --- a/.claude/plans/sag-reflexive-cognition-from-1509-v1.md +++ b/.claude/plans/sag-reflexive-cognition-from-1509-v1.md @@ -1,5 +1,7 @@ # D-SAG-5: reflexive cognition and safe optimization from #1509 +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + **Date:** 2026-10-12. **Status:** PROPOSAL. Documentation only. **Parent:** merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509); follow-up research to merged [#1496](https://github.com/AdaWorldAPI/lance-graph/pull/1496), [#1497](https://github.com/AdaWorldAPI/lance-graph/pull/1497), [#1498](https://github.com/AdaWorldAPI/lance-graph/pull/1498) and [#1499](https://github.com/AdaWorldAPI/lance-graph/pull/1499). **Research sources:** [NARS, ONA, Hyperon](../../.arxiv/2026-10_sag1509_nars_hyperon_reflexive_appraisal_excerpts.md), [information theory and metagraphs](../../.arxiv/2026-10_sag1509_information_metagraph_optimization_excerpts.md), [pinned source and falsifier ledger](../../.arxiv/2026-10_sag1509_source_oracles_falsifier_matrix.md). **Runnable research brief:** [Claude Code prompt](../prompts/sag-reflexive-cognition-from-1509.md). diff --git a/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md b/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md index c075e1c8a..1a9f9f738 100644 --- a/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md +++ b/.claude/plans/sag-wisdom-frontier-hard-problems-v1.md @@ -1,5 +1,7 @@ # D-SAG-3.1: deferred hard problems in the wisdom frontier +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + **Status:** RESEARCH ONLY. Extension of [D-SAG-3](sag-wisdom-frontier-ona-hyperon-v1.md) on PR #1511, based on merged #1509. Nothing here is a shipped feature, performed experiment, authorization, or production ABI decision. [Source excerpts](../../.arxiv/2026-10_wisdom_frontier_active_inference_delta_and_misspecification.md). ## H1. Four distinct epistemic quantities diff --git a/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md index f8ca75c07..1cd06e730 100644 --- a/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md +++ b/.claude/plans/sag-wisdom-frontier-ona-hyperon-v1.md @@ -1,5 +1,7 @@ # D-SAG-3 — Wisdom frontier: OpenPsi x Rubikon x Shannon x CARE x ONA/Hyperon +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + **Status:** RESEARCH / FALSIFIABLE DESIGN ONLY, 2026-10-12. Sibling extension of merged [D-SAG-1 / #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509). **No implementation, runtime evaluation, opcode, wire change, new graph engine, bit migration, authorization change, or speedup claim.** **Read alongside:** [D-SAG-1](software-awareness-graph-v1.md), [D-MATURATION3-0](../knowledge/maslov-pyramid-of-cognition.md), [D-RV](rubicon-volition-v1.md), [PLN/Shannon #1497](../../.arxiv/2026-10_opencog_pln_shannon_attention_research_map.md), [CARE paper notes](../../.arxiv/2606.14581_synthesize_programs_gate_commit.md), and [new annotated sources](../../.arxiv/2026-10_openpsi_rubicon_care_wisdom_frontier_source_excerpts.md). A self-contained execution prompt lives at [sag-wisdom-frontier-claude-code.md](../prompts/sag-wisdom-frontier-claude-code.md). @@ -43,7 +45,7 @@ Information gain does not prove causality. A program selected by CARE does not a maturity_test_local, candidate_hypotheses, provenance, cost_estimate, authorization_scope } - Proposal { + SchedulerDecision { // not a ProposedMethod: it selects work, it changes nothing program_hash, schema_seal, data_revision, evidence_cutoff, ordered_candidates, scores, reference_score, challenger_score, @@ -58,7 +60,7 @@ At a validated stage-0 anchor, enumerate **only relations reachable through a do For each candidate typed relation, on a declared prerequisite universe U: - missing = required & ~(established | refuted) + missing = required & ~(established | refuted | unread) // unread is not missing; see hard-problems H1 blocked = required & refuted debt = popcount(missing) @@ -128,7 +130,7 @@ Never reward entropy for entropy's sake. Penalize useless curiosity through meas |-> update demand / epistemic evidence / disengage or replan |-> optional new knowledge can enter next snapshot only -No proposed optimizer H1 is performed automatically. Any optimization is a proposal checked by semantic equivalence, NULL/bag/set, cost tier and authority, and requires an authorized effect separately. +No proposed optimizer H1 is performed automatically. Any optimization is a `ProposedMethod` checked by semantic equivalence, NULL/bag/set, cost tier and authority, and requires an authorized effect separately. ## 6. Falsifier ledger (proposed D-SAG-3-0 .. 15) diff --git a/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md index e62302aaa..4712e8d80 100644 --- a/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md +++ b/.claude/plans/software-awareness-agent-context-deferred-contracts-v1.md @@ -1,5 +1,7 @@ # D-SAG-4 appendix: deferred concrete contracts for an agent-facing software graph +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + **Status:** PROPOSAL / NOT SHIPPED. **Added after #1513's first documentation pass.** Built on merged [#1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), not an alternative to it. Parent: [D-SAG-4 plan](software-awareness-agent-context-ona-v1.md). Research: [source excerpts](../../.arxiv/2026-10_sag_agent_attention_active_selection_excerpts.md). This appendix unpacks design and falsification details deliberately left small in the first draft. It does **not** certify measurements, APIs, an IDE plug-in or runtime integration. ## A. What the existing executor can actually answer @@ -41,7 +43,7 @@ First useful interface is a *local* read-only CLI or protocol adapter: resolve(symbol_query, revision) -> SymbolRef | Ambiguous | NotIndexed context(SymbolRef, intent, budget) -> Slice | Stale | Unsupported impact(SymbolRef, change_kind, budget)-> Slice | Uncertain | Unsupported -propose(SymbolRef, objective, budget) -> Candidate[] | InsufficientEvidence +propose(SymbolRef, objective, budget) -> ProposedMethod[] | InsufficientEvidence expand(SliceHandle, relation, budget) -> SliceDelta | UnsupportedMultiHop explain(EdgeRef) -> SourceSpan + Witness + Tier + Revision ``` diff --git a/.claude/plans/software-awareness-agent-context-ona-v1.md b/.claude/plans/software-awareness-agent-context-ona-v1.md index 0ddb58a31..f44acbded 100644 --- a/.claude/plans/software-awareness-agent-context-ona-v1.md +++ b/.claude/plans/software-awareness-agent-context-ona-v1.md @@ -1,7 +1,9 @@ # D-SAG-4 — Addressable software context and ONA-inspired execution feedback +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + **Status:** RESEARCH / unimplemented follow-up. **Base:** [merged D-SAG-1 #1509](https://github.com/AdaWorldAPI/lance-graph/pull/1509), merge commit `42fa2a347cda22eaaa327bba514f2029cc9daa82`. **Code examined:** `crates/lance-graph-glove-parity/src/awareness.rs`, `method.rs`, `gremlin.rs`; [D-SAG-1 plan](software-awareness-graph-v1.md). **Date:** 2026-10-12. -**Companions:** [execution prompt](../prompts/d-sag-2-ona-agent-context-implementation.md), [primary research excerpts](../../.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md), [repository-graph papers](../../.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md). +**Companions:** [execution prompt](../prompts/d-sag-4-ona-agent-context-implementation.md), [primary research excerpts](../../.arxiv/2026-10_sag_ona_internal_experience_source_excerpts.md), [repository-graph papers](../../.arxiv/2026-10_sag_repo_graph_context_source_excerpts.md). ## 0. Problem and result that would change our mind @@ -45,8 +47,8 @@ Three **candidate** tool operations, not claims of installed integrations: ```text context(SymbolRef, Intent, Budget, Revision) -> ContextSlice | TypedRefusal -impact(SymbolRef, ProposedChange, Budget, Revision) -> ImpactSlice | TypedRefusal -propose(SymbolRef, Objective, Budget, Revision) -> Candidate[] | TypedRefusal +impact(SymbolRef, ProposedMethod, Budget, Revision) -> ImpactSlice | TypedRefusal +propose(SymbolRef, Objective, Budget, Revision) -> ProposedMethod[] | TypedRefusal ``` - `SymbolRef` is a canonical location/ID plus optional exact source location, not an unqualified string. @@ -54,7 +56,7 @@ propose(SymbolRef, Objective, Budget, Revision) -> Candidate[] | TypedRefusal - `Budget`: max nodes/edges/hops, returned bytes/tokens (estimated), wall time, privacy/redaction policy; show `truncated` and a continuation handle. - `ContextSlice`: exact anchor IDs, source links and line ranges, evidence tiers, graph revision, discovered dependencies, relevant laws, tests/refusals, uncertainties, `not_checked`, and explicit omissions. - `ImpactSlice`: affected functions/methods/tests/build targets by typed reachability, plus separate potential or unresolved impacts. Missing an edge is NOT a negative proof. -- `Candidate`: deterministic graph-pattern recommendation, obligations, confidence provenance and a suggested *read-only* verification query. No execute/edit capability. +- `ProposedMethod` (canonical; wraps main's `awareness::Candidate`): deterministic graph-pattern recommendation, obligations, confidence provenance and a suggested *read-only* verification query. No execute/edit capability. Example payload, strictly illustrative: diff --git a/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md b/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md index a8cc7f5b6..5dab43673 100644 --- a/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md +++ b/.claude/plans/software-awareness-graph-v2-ruff-ona-closed-loop.md @@ -1,5 +1,7 @@ # D-SAG-2 — Ruff × ONA software-awareness closed-loop validation +> **Aligned by [`sag-capstone-alignment-v1.md`](sag-capstone-alignment-v1.md)** — read it first: canonical `ProposedMethod`, the shared status vocabulary, D-id map, and the claims it marks stale (incl. "second hop refused"). + **Status:** RESEARCH / IMPLEMENTATION PLAN, not an implementation. **Base:** merged lance-graph #1509, main merge 42fa2a347cda22eaaa327bba514f2029cc9daa82 (2026-10-12). **Owner of authority:** existing OGAR action gate. **First executor:** existing Quack → mask-risc; R2IL FoldDialect is the alternate frontend. **Independent source oracle:** AdaWorldAPI/ruff. **Prompt:** [software-awareness-graph-v2-claude-code.md](../prompts/software-awareness-graph-v2-claude-code.md). diff --git a/.claude/prompts/d-sag-2-ona-agent-context-implementation.md b/.claude/prompts/d-sag-4-ona-agent-context-implementation.md similarity index 100% rename from .claude/prompts/d-sag-2-ona-agent-context-implementation.md rename to .claude/prompts/d-sag-4-ona-agent-context-implementation.md diff --git a/.claude/prompts/sag-wisdom-frontier-claude-code.md b/.claude/prompts/sag-wisdom-frontier-claude-code.md index 2b4aca0f9..51846713d 100644 --- a/.claude/prompts/sag-wisdom-frontier-claude-code.md +++ b/.claude/prompts/sag-wisdom-frontier-claude-code.md @@ -27,7 +27,7 @@ Then choose the **smallest independent probe** which can be implemented in the c 3. Register bytes are ISA/ALU carriers. ClassView, provenance and method signatures determine readings. No hidden semantic assumptions in raw register tests. 4. NARS frequency/confidence are not automatically calibrated Bayesian probabilities; Shannon entropy/EIG require an explicitly calibrated and versioned hypothesis distribution. 5. Derived edges inherit original observation roots, never mint a new independent root. No self/descendant support, including reopened grounded cycles. -6. Mask debt must operate on a separately typed prerequisite universe: missing = required & ~(known | refuted); blocked = required & refuted; debt = popcount(missing). A debt of 0 is not proof of truth. +6. Mask debt must operate on a separately typed prerequisite universe: missing = required & ~(known | refuted | unread) (unread is not negative evidence); blocked = required & refuted; debt = popcount(missing). A debt of 0 is not proof of truth. 7. SAG #1509 is **one hop** using existing Quack Draft/ScatterOrU32. A second hop must be represented by a *proven legal* relation carrier or explicitly blocked. No second traversal VM, custom graph executor, shadow methods registry or invented Quack operator. 8. An LLM-synthesized ranking **program** is not a decision, a decision is not a committed goal, and a committed goal is not permission to effect a real-world operation. Version/seal/time, capability and live authorization gates remain separate. 9. Compiled, verified and hypothesized SAG tiers remain distinct. No automatic application of H1 fusion. Do not claim a SIMD improvement before a fused terminal exists and runs. diff --git a/.claude/prompts/software-awareness-graph-v2-claude-code.md b/.claude/prompts/software-awareness-graph-v2-claude-code.md index 72fb5a887..a5997870c 100644 --- a/.claude/prompts/software-awareness-graph-v2-claude-code.md +++ b/.claude/prompts/software-awareness-graph-v2-claude-code.md @@ -62,7 +62,7 @@ Track predictions and observed outcomes separately, with timestamps or pinned re Read `../knowledge/sag-v2-observability-causality-and-evaluation-addendum.md` and `../../.arxiv/2026-10_software_awareness_ona_observability_metamorphic_holdout_excerpts.md`; they add P21–P40 to the previous P01–P20. In particular: - Refutation by missing observation is legal **only** when Ruff/runtime collector positively certifies predicate support, scope completeness, matching frozen revision, successful scan and closed observation interval. Otherwise return `NotObservable`, `Incomplete`, `Pending` or `Stale`. ONA's published *Assumption of Failure* is a research mechanism, not a license for closed-world Ruff assumptions. -- Distinguish `NoOp` causal control, read-only `Probe` (it consumes resources), and inert `Proposal` before any OGAR-gated action. Try A→A no-op, semantic-preserving A→B, real change A→B, and A→B→A' revert. +- Distinguish `NoOp` causal control, read-only `Probe` (it consumes resources), and inert `ProposedMethod` before any OGAR-gated action. Try A→A no-op, semantic-preserving A→B, real change A→B, and A→B→A' revert. - Obtain preregistered predicted deltas before editing. Compare full versus incremental reharvest; keep one evidence stamp for multiple pipeline copies of the same source fact; test independent-source twins. - Use development / validation / protected holdout **grouped by repository and edit family**, not randomly selected lines, and count oracle reuse. On frozen holdout test no-feedback, correct-feedback, shuffled-feedback, and no-op arms with identical budget; record null or negative results honestly. - Bound self-observation recursion: a Quack query sees snapshot k, its telemetry writes k+1; no query in the same epoch may certify itself. From 18f6fcb8a59ba480a27e535f8a0070cda4a29dea Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 21:12:13 +0000 Subject: [PATCH 44/46] board: capstone is #1523 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- .claude/board/entries/2026-10-12-sag-capstone-alignment.md | 2 +- .claude/plans/sag-capstone-alignment-v1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/board/entries/2026-10-12-sag-capstone-alignment.md b/.claude/board/entries/2026-10-12-sag-capstone-alignment.md index 45d2b7aa8..2d3bed776 100644 --- a/.claude/board/entries/2026-10-12-sag-capstone-alignment.md +++ b/.claude/board/entries/2026-10-12-sag-capstone-alignment.md @@ -9,7 +9,7 @@ what to probe next is a separate concept (`SchedulerDecision`). Plan: `.claude/plans/sag-capstone-alignment-v1.md`. -PR # | STATUS: done (docs) | OUTCOME: #1510/#1511/#1512/#1513/#1515/#1517 +PR #1523 | STATUS: done (docs) | OUTCOME: #1510/#1511/#1512/#1513/#1515/#1517 merged and aligned; aliases renamed; stale multi-hop claims corrected | OPEN: ProposedMethod and the four-state status are not built (SAG Step 4); #1517 oracle tests F0/F7/F8 are claimed, unverified. diff --git a/.claude/plans/sag-capstone-alignment-v1.md b/.claude/plans/sag-capstone-alignment-v1.md index 7bcf46cff..8880a3538 100644 --- a/.claude/plans/sag-capstone-alignment-v1.md +++ b/.claude/plans/sag-capstone-alignment-v1.md @@ -1,7 +1,7 @@ # SAG capstone alignment — v1 **Status:** CURRENT-CONTRACT for the documents it aligns; nothing here is -implemented by this PR. Supersedes the separate review threads of #1510, +implemented by this PR. Lands as #1523; supersedes the separate review threads of #1510, #1511, #1512, #1513, #1515 and #1517, which are merged here unchanged except for the edits listed in §6. From 56c0212c6c2d1f466c7f9c11aad063615d9a6f3a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 22:13:17 +0000 Subject: [PATCH 45/46] capstone: second-hop refusal and SAG defects A/B are not stale (#1519, #1522 closed) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- .claude/plans/sag-capstone-alignment-v1.md | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.claude/plans/sag-capstone-alignment-v1.md b/.claude/plans/sag-capstone-alignment-v1.md index 8880a3538..1b2304d0c 100644 --- a/.claude/plans/sag-capstone-alignment-v1.md +++ b/.claude/plans/sag-capstone-alignment-v1.md @@ -117,17 +117,19 @@ These are true at the #1509 base and false now. The plans keep their text (history); this list is the correction. 1. **"Second hop refused" / "multi-hop blocked" / `NoRelationCarrier` / - `SecondHop`.** Wrong after #1518, #1520 and #1522: `out(r1).out(r2)` - lowers to one `MaskOp::GatherChain` (chained hops are folded hops), the - edge-table anchor carries many-to-many, and `Fold::Distinct` dedups - targets. `in` / `both` still refuse as `FanOut`. Appears in #1510 plan - §2, #1511 (`MultiHopBlocked`, invariant 7, H-tables), #1512 frontier and - prompt, #1513 plan/deferred/prompt, #1515 plan and prompt (the "invalid - two-hop query" probe must pick another refusal), #1517 F13. -2. **SAG defects A and B "UNVERIFIED"** (#1510 plan). Fixed and test-pinned - in #1519, including the two Codex follow-ups: reprojection keeps claimed - class facts, and a `BlockedBy` edge is retracted with its last compiled - refusal. + `SecondHop` — NOT stale; the refusal stands.** An earlier draft of this + list said #1522 removed it. #1522 (`MaskOp::GatherChain`) and its ndarray + primitive were withdrawn unmerged (closed 2026-10-12, kept on + `backup/session-011BMJ-2026-10-12-chain2`; `D-CMR-RESET`): a hop is a + coordinate range, and chained hops are the intersection of ranges, not a + chain of key reads. `gremlin::compose` still returns + `GremlinRefusal::SecondHop`, so #1517 F13's "invalid two-hop query" probe + remains valid as written. +2. **SAG defects A and B remain UNVERIFIED** (#1510 plan is right). The + fixes were written in #1519, which was closed unmerged with the method + layer reset (kept on `backup/session-011BMJ-2026-10-12-sagfix`); the + shared-provenance and stale-`BlockedBy` failure modes are still possible + in the shipped `awareness.rs`. 3. **OGAR #357 status.** Still unverified upstream; the plans' "RFC" is the safe reading. From 11b61ba5a747c79d582fc130087625a4b15c277a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 22:23:11 +0000 Subject: [PATCH 46/46] capstone: zero-premise rules prove; NotDeclared maps to Undetermined; Hyperon spelling Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh --- .claude/plans/sag-capstone-alignment-v1.md | 5 +++++ .claude/prompts/sag-reflexive-cognition-from-1509.md | 2 +- .claude/tools/inverted_temporal_ablation_oracle.py | 10 +++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.claude/plans/sag-capstone-alignment-v1.md b/.claude/plans/sag-capstone-alignment-v1.md index bcac6f53c..5f6ca0120 100644 --- a/.claude/plans/sag-capstone-alignment-v1.md +++ b/.claude/plans/sag-capstone-alignment-v1.md @@ -84,6 +84,11 @@ four-state status already shipped by dir-sim (`Held / NotHeld / Undetermined | **Undetermined** (not read, not readable, or not finished) | `Pending`, `NotObservable`, `Incomplete`, `Unread`, `Missing`, `Undetermined`, `Partial`, `NotIndexed`, `InsufficientEvidence` | | **Conflicted** | `Conflict`, `Conflicted` | +dir-sim's `NotDeclared` (the directory declares nothing for the subject) +is not a truth value: it maps to **Undetermined** with reason +`NotDeclared`, so a caller can tell "nobody said" from "not read yet" +without a fifth state. + `Stale` is not a fifth state: it is any of the four read against an expired revision, carried as a separate revision field. `Unsupported` / `UnsupportedMultiHop` are typed refusals, not statuses. diff --git a/.claude/prompts/sag-reflexive-cognition-from-1509.md b/.claude/prompts/sag-reflexive-cognition-from-1509.md index 10d5686d3..0dc30cd1a 100644 --- a/.claude/prompts/sag-reflexive-cognition-from-1509.md +++ b/.claude/prompts/sag-reflexive-cognition-from-1509.md @@ -9,7 +9,7 @@ First deliver a status ledger of actual code/test features (MEASURED / VERIFIED- Parallel research channels (read pinned source and reconcile centrally, not separate competing plans): A. SAG and developer context: prove one-hop METHOD -> Program -> primitive/refusal answer against compiled source; try an invalid two-hop CALLS query and refuse it. A proposed ContextSlice contains typed address, source file/span/SHA, seal, reading, tier, edges, receipt and unhandled scope. Compare with whole CLAUDE.md, rg+read and textual retrieval. Count ACTUAL LLM input/output tokens when an LLM consumes anything; never say "without tokens" merely because a local graph answered a query. B. Wang/ONA: read 2018 Self in NARS §§3.3–3.5 plus pinned ONA Cycle.c, PriorityQueue.c, Memory.c, Stamp.c, Truth.c, Decision.c and source tests. Map event priority, independent evidence, concept usefulness, internal derived trace and bounded control as distinct entities. Use a pinned OpenNARS/ONA oracle if executable. -C. OpenCog: read modern PLN lib_pln.metta, pinned PeTTa/Hyeron interpreter, classic attention/ECAN, Miner, and typed metagraph constructor laws in arXiv:2012.01759; read Hyperon arXiv:2310.18318 §§3.1.3, 4.3.4, 4.3.10, 4.4.2, 4.6. Do not equate AtomSpace Classic, Hyperon, PLN, ECAN or ONA. +C. OpenCog: read modern PLN lib_pln.metta, pinned PeTTa/Hyperon interpreter, classic attention/ECAN, Miner, and typed metagraph constructor laws in arXiv:2012.01759; read Hyperon arXiv:2310.18318 §§3.1.3, 4.3.4, 4.3.10, 4.4.2, 4.6. Do not equate AtomSpace Classic, Hyperon, PLN, ECAN or ONA. D. Information and optimizer: read Houlsby et al. BALD Eq.2, Geisweiller/Goertzel 2019 pattern-surprise, Jøsang fusion/fission and Willsey et al. egg equality-saturation. Ask whether a candidate can be chosen by a meaningful next observation without rewarding irrelevant high-entropy noise. egg is an external equivalence comparator only, not a new execution tier. AdaWorldAPI/ruff may supply Python lint facts if actually run, but it is NOT a Rust compiler oracle. Pre-register and execute only if separately authorized: diff --git a/.claude/tools/inverted_temporal_ablation_oracle.py b/.claude/tools/inverted_temporal_ablation_oracle.py index f3836c4b7..9663cb4f5 100644 --- a/.claude/tools/inverted_temporal_ablation_oracle.py +++ b/.claude/tools/inverted_temporal_ablation_oracle.py @@ -89,7 +89,9 @@ def evaluate( if rule.id in cut_rules: continue supports = [roots.get(p, set()) for p in rule.premises] - if not supports or any(not s for s in supports): + # A zero-premise rule has no supports and still proves its + # conclusion with the rule-only term. + if any(not s for s in supports): continue for chosen in product(*supports): evidence = frozenset.union(*chosen, frozenset((f"rule:{rule.id}",))) @@ -219,6 +221,12 @@ def test_refuse_cycle_without_losing_evidence(self) -> None: with self.assertRaisesRegex(ValueError, "cyclic"): evaluate(w) + def test_zero_premise_rule_proves_and_its_cut_removes(self) -> None: + w = World((), (Rule("R@1", (), "C"),)) + self.assertEqual(evaluate(w)["C"], frozenset((frozenset(("rule:R@1",)),))) + s = ablate(w, rules=frozenset(("R@1",))) + self.assertIn("C", s.lost_claims) + def test_refuse_duplicate_rule_identity(self) -> None: w = World((("A", "a"),), (Rule("R@1", ("A",), "C"), Rule("R@1", ("A",), "D")))