[MACHINE-SPIRIT 6/8] Retrieval and symbolic attention: bounded projection, graph search, relevance, embeddings as sensors, working-memory control #395

Closed
opened 2026-09-08 01:29:18 +00:00 by nsaspy · 5 comments
Owner

Parent: #397
Related: #176 #219 #381 #396
Downstream: symbolic-memory#6 #7 #9 #10

Distinct research mandate

Treat attention/relevance as the primary problem: how a huge symbolic world model becomes a tiny task-relevant working set without losing rules, counterevidence, scope, provenance, source independence, coverage semantics or replayability.

Depth 6 status — DESIGN-COMPLETE, IMPLEMENTATION-UNPROVEN

All four required subpasses are durably preserved in this issue's comments.

A — TAPS: COMPLETE

Typed Attention & Projection Substrate separates hard semantic admission + mandatory dependency/support closure from soft relevance/candidate ranking. It introduces exact-cut projections, cheap exact/structural-first discovery, typed working-set residency, and independent support_closure versus search_coverage.

B — OATH-TAPS: COMPLETE

Obligation-Aware Threat-Hardened TAPS corrects the discovery-side attack surface. Risk-sensitive queries create explicit support/opposition/defeater/freshness/identity/independent-origin obligations. Rankers operate inside those lanes; no retrieved defeater does not mean no defeater exists. Hits are revalidated against canonical #402 state and source copies collapse into dependence components before corroboration/diversity.

C — MOSAIC-TAPS: COMPLETE

Mediated Obligation-Safe Attention & Interoperability Contracts defines versioned Retrieval Semantic Contracts (RSCs) for heterogeneous exact/graph/BM25/vector/case/remote/SPARQL/web backends. Backend result envelopes interoperate without pretending scores are comparable. Query translation is loss-aware. #381 owns typed composition (union, cascade, fallback, intersect, join, refine, corroborate, oppose, freshen). Remote query egress is a separate authority check.

D — RACE-TAPS: COMPLETE

Replayable Adaptive Conformance Executor for TAPS makes A/B/C computational.

QueryIR + profile + authority + exact SAFIRE cut
        ↓
OATH typed obligation DAG
        ↓
RSC capability/source matching
        ↓
fixed logical retrieval/composition plan
        ↓
memoized physical alternatives
exact/index/graph/BM25/ANN/remote
joins/cascades/fallbacks/pushdowns
        ↓
bounded async execution
+ explicit conformance-preserving physical revisions
        ↓
canonical cut revalidation
        ↓
source-dependence + reversible identity reconciliation
        ↓
deterministic soft fusion
        ↓
mandatory semantic closure
        ↓
projection + gaps + replay/conformance receipt

D hard decisions

  1. Logical plan != physical plan. #381 fixes obligation/composition semantics. Physical planning can reorder/select compatible implementations but cannot drop obligations or weaken hard constraints silently.
  2. Hybrid static/adaptive execution. Cascades-style memoized physical planning is the base; Eddy-style adaptation is permitted only beneath a fixed semantic contract through explicit plan-revision receipts.
  3. Statistics are operational only. Latency/cardinality/selectivity/cache/ANN-recall statistics may affect physical choice but never warrant, trust or source independence.
  4. Bound optimizer complexity. Memoized DP/Cascades search only for small plan regions; larger joins use explicit bounded greedy/bind/semi-join profiles. No global-optimality claim.
  5. Filtered ANN semantics are explicit. Distinguish exact/native prefilter, native filtered ANN with measured recall profile, postfilter-only and unsupported. ANN(top-k) -> postfilter cannot claim exhaustive filtered coverage.
  6. Adaptive revision cannot alter epistemic obligations. A slow opposition source may be replaced by a contract-compatible implementation or produce a partial/timeout gap; it cannot silently disappear.
  7. Async arrival order is non-semantic. Normalize candidates by stable obligation/backend/generation/page/rank/record identities and fuse at deterministic barriers/threshold conditions.
  8. Cancellation/backpressure are structural. Bound calls/pages/candidates/bytes/work/wall/in-flight state. Late replies after cancellation are discarded and cannot affect results.
  9. Pagination is generation-aware. Snapshot/index generation belongs in cursor identity; mixed-generation pages are stale/best-effort lineage, not one exact scan.
  10. Fusion remains soft. RRF is a deterministic rank-fusion default only; Fagin/TA early stopping is valid only when its monotone aggregation and access assumptions are explicitly satisfied.
  11. Cache fingerprints are semantic/dependency complete. Include QueryIR, obligation/composition plan, exact cut, context/profile, authority/egress generations, RSC/translator/backend/index/embedding generations, identity/dependence/freshness generations, fusion/budget/executor versions.
  12. Dependency-directed invalidation. Recompute only affected subplans; propagation may stop when the normalized interface candidate+coverage digest is unchanged.
  13. Incremental machinery is optional. Direct delta/generation invalidation first; DBSP/differential-style incrementalization only when measured workloads justify it. No second universal dataflow runtime.
  14. Replay classes are explicit. Retained remote response replay may be exact; deterministic local reexecution requires identical generations; a live remote requery is a new observation lineage.
  15. Zero-model known retrieval. Supported symbolic/heterogeneous retrieval conformance must run with providers disabled and model_calls = 0.

Conformance direction

The #403D comment records 44 falsifiable fixtures covering RSC pruning, filtered-ANN coverage, generation invalidation, adaptive revision, timeouts, egress denial, async permutation determinism, cancellation/late replies, snapshot-safe pagination, byte/page/work bounds, mandatory closure, graph/dependency explosions, bind joins, identity/source dependence, corrupt index hits, cold/warm/rebuilt and incremental/full equivalence, retained-response replay, remote-requery lineage, guarantee laundering, TA precondition rejection and heterogeneous zero-model execution. Million/billion-record throughput/latency thresholds must come from actual backend benchmarks rather than design prose.

Reconciled Depth-6 architecture

A: TAPS
   hard admission + closure vs soft relevance
        ↓
B: OATH-TAPS
   adversarial obligation lanes + selection integrity
        ↓
C: MOSAIC-TAPS
   heterogeneous RSCs + loss-aware composition
        ↓
D: RACE-TAPS
   bounded physical planning/adaptation + deterministic replay/conformance

Repository ownership

  • prolog-rlm: #381 obligation/strategy semantics, RSC schema/validation, logical/physical/revision receipt contract, deterministic normalization/fusion semantics, #396 in-memory projection equivalence, #395 conformance.
  • symbolic-memory: durable semantic indexes/cursors, exact SAFIRE cuts/generations, cache/index lifecycle, large-corpus benchmarks/failure injection, source-dependence and identity generations, bounded native/MCP receipts.
  • #219 adapters: primitive backend mechanics and backend-specific RSC measurements.
  • existing runtime: concurrency/cancellation. No second scheduler.

Unresolved implementation questions

  • first statistics/cost schema and telemetry retention;
  • DP-vs-greedy/bind-join thresholds;
  • empirical exact/lexical/graph/ANN cascade thresholds;
  • first filtered-ANN backend and recall benchmark methodology;
  • memo/optimizer module placement;
  • optional DBSP/differential adoption threshold;
  • remote response-artifact retention/privacy policy;
  • benchmark-derived page/byte/concurrency defaults;
  • best-effort semantics for external engines without stable snapshots.

Completion statement

Depth 6 A/B/C/D is design-complete only. No implementation, scale, or Machine Spirit acceptance is claimed.

Exact next research work: Depth 7 / #404A — meta-reasoning / bounded self-improvement foundations.

Do not start #404B/C/D until #404A is durably complete.

Refs #397 #381 #395 #396 #219 #400 #401 #402 and downstream symbolic-memory#6/#7/#9/#10.

Parent: #397 Related: #176 #219 #381 #396 Downstream: symbolic-memory#6 #7 #9 #10 ## Distinct research mandate Treat attention/relevance as the primary problem: how a huge symbolic world model becomes a tiny task-relevant working set without losing rules, counterevidence, scope, provenance, source independence, coverage semantics or replayability. ## Depth 6 status — DESIGN-COMPLETE, IMPLEMENTATION-UNPROVEN All four required subpasses are durably preserved in this issue's comments. ### A — TAPS: COMPLETE **Typed Attention & Projection Substrate** separates hard semantic admission + mandatory dependency/support closure from soft relevance/candidate ranking. It introduces exact-cut projections, cheap exact/structural-first discovery, typed working-set residency, and independent `support_closure` versus `search_coverage`. ### B — OATH-TAPS: COMPLETE **Obligation-Aware Threat-Hardened TAPS** corrects the discovery-side attack surface. Risk-sensitive queries create explicit support/opposition/defeater/freshness/identity/independent-origin obligations. Rankers operate inside those lanes; no retrieved defeater does not mean no defeater exists. Hits are revalidated against canonical #402 state and source copies collapse into dependence components before corroboration/diversity. ### C — MOSAIC-TAPS: COMPLETE **Mediated Obligation-Safe Attention & Interoperability Contracts** defines versioned Retrieval Semantic Contracts (RSCs) for heterogeneous exact/graph/BM25/vector/case/remote/SPARQL/web backends. Backend result envelopes interoperate without pretending scores are comparable. Query translation is loss-aware. #381 owns typed composition (`union`, `cascade`, `fallback`, `intersect`, `join`, `refine`, `corroborate`, `oppose`, `freshen`). Remote query egress is a separate authority check. ### D — RACE-TAPS: COMPLETE **Replayable Adaptive Conformance Executor for TAPS** makes A/B/C computational. ```text QueryIR + profile + authority + exact SAFIRE cut ↓ OATH typed obligation DAG ↓ RSC capability/source matching ↓ fixed logical retrieval/composition plan ↓ memoized physical alternatives exact/index/graph/BM25/ANN/remote joins/cascades/fallbacks/pushdowns ↓ bounded async execution + explicit conformance-preserving physical revisions ↓ canonical cut revalidation ↓ source-dependence + reversible identity reconciliation ↓ deterministic soft fusion ↓ mandatory semantic closure ↓ projection + gaps + replay/conformance receipt ``` #### D hard decisions 1. **Logical plan != physical plan.** #381 fixes obligation/composition semantics. Physical planning can reorder/select compatible implementations but cannot drop obligations or weaken hard constraints silently. 2. **Hybrid static/adaptive execution.** Cascades-style memoized physical planning is the base; Eddy-style adaptation is permitted only beneath a fixed semantic contract through explicit plan-revision receipts. 3. **Statistics are operational only.** Latency/cardinality/selectivity/cache/ANN-recall statistics may affect physical choice but never warrant, trust or source independence. 4. **Bound optimizer complexity.** Memoized DP/Cascades search only for small plan regions; larger joins use explicit bounded greedy/bind/semi-join profiles. No global-optimality claim. 5. **Filtered ANN semantics are explicit.** Distinguish exact/native prefilter, native filtered ANN with measured recall profile, postfilter-only and unsupported. `ANN(top-k) -> postfilter` cannot claim exhaustive filtered coverage. 6. **Adaptive revision cannot alter epistemic obligations.** A slow opposition source may be replaced by a contract-compatible implementation or produce a partial/timeout gap; it cannot silently disappear. 7. **Async arrival order is non-semantic.** Normalize candidates by stable obligation/backend/generation/page/rank/record identities and fuse at deterministic barriers/threshold conditions. 8. **Cancellation/backpressure are structural.** Bound calls/pages/candidates/bytes/work/wall/in-flight state. Late replies after cancellation are discarded and cannot affect results. 9. **Pagination is generation-aware.** Snapshot/index generation belongs in cursor identity; mixed-generation pages are stale/best-effort lineage, not one exact scan. 10. **Fusion remains soft.** RRF is a deterministic rank-fusion default only; Fagin/TA early stopping is valid only when its monotone aggregation and access assumptions are explicitly satisfied. 11. **Cache fingerprints are semantic/dependency complete.** Include QueryIR, obligation/composition plan, exact cut, context/profile, authority/egress generations, RSC/translator/backend/index/embedding generations, identity/dependence/freshness generations, fusion/budget/executor versions. 12. **Dependency-directed invalidation.** Recompute only affected subplans; propagation may stop when the normalized interface candidate+coverage digest is unchanged. 13. **Incremental machinery is optional.** Direct delta/generation invalidation first; DBSP/differential-style incrementalization only when measured workloads justify it. No second universal dataflow runtime. 14. **Replay classes are explicit.** Retained remote response replay may be exact; deterministic local reexecution requires identical generations; a live remote requery is a new observation lineage. 15. **Zero-model known retrieval.** Supported symbolic/heterogeneous retrieval conformance must run with providers disabled and `model_calls = 0`. ## Conformance direction The #403D comment records 44 falsifiable fixtures covering RSC pruning, filtered-ANN coverage, generation invalidation, adaptive revision, timeouts, egress denial, async permutation determinism, cancellation/late replies, snapshot-safe pagination, byte/page/work bounds, mandatory closure, graph/dependency explosions, bind joins, identity/source dependence, corrupt index hits, cold/warm/rebuilt and incremental/full equivalence, retained-response replay, remote-requery lineage, guarantee laundering, TA precondition rejection and heterogeneous zero-model execution. Million/billion-record throughput/latency thresholds must come from actual backend benchmarks rather than design prose. ## Reconciled Depth-6 architecture ```text A: TAPS hard admission + closure vs soft relevance ↓ B: OATH-TAPS adversarial obligation lanes + selection integrity ↓ C: MOSAIC-TAPS heterogeneous RSCs + loss-aware composition ↓ D: RACE-TAPS bounded physical planning/adaptation + deterministic replay/conformance ``` ## Repository ownership - **prolog-rlm:** #381 obligation/strategy semantics, RSC schema/validation, logical/physical/revision receipt contract, deterministic normalization/fusion semantics, #396 in-memory projection equivalence, #395 conformance. - **symbolic-memory:** durable semantic indexes/cursors, exact SAFIRE cuts/generations, cache/index lifecycle, large-corpus benchmarks/failure injection, source-dependence and identity generations, bounded native/MCP receipts. - **#219 adapters:** primitive backend mechanics and backend-specific RSC measurements. - **existing runtime:** concurrency/cancellation. No second scheduler. ## Unresolved implementation questions - first statistics/cost schema and telemetry retention; - DP-vs-greedy/bind-join thresholds; - empirical exact/lexical/graph/ANN cascade thresholds; - first filtered-ANN backend and recall benchmark methodology; - memo/optimizer module placement; - optional DBSP/differential adoption threshold; - remote response-artifact retention/privacy policy; - benchmark-derived page/byte/concurrency defaults; - best-effort semantics for external engines without stable snapshots. ## Completion statement Depth 6 A/B/C/D is **design-complete only**. No implementation, scale, or Machine Spirit acceptance is claimed. **Exact next research work: Depth 7 / #404A — meta-reasoning / bounded self-improvement foundations.** Do not start #404B/C/D until #404A is durably complete. Refs #397 #381 #395 #396 #219 #400 #401 #402 and downstream symbolic-memory#6/#7/#9/#10.
Author
Owner

Machine Spirit program progression

Depth 5 / #402 A-B-C-D is now durably design-complete and reconciled; #402 is closed for design completion only.

Exact next research subpass: #403A — foundations / representative retrieval/attention formalisms only.

Do not execute #403B/C/D in the same run. A should compare symbolic relevance/attention foundations across graph/query planning, spreading activation/working memory, dependency closure, exact lexical/structural retrieval, case retrieval, embeddings as non-authoritative sensors, and bounded projection/completeness-risk semantics. #402/SAFIRE supplies exact cuts/freshness and scalable cursors; #403 must not redesign persistence.

## Machine Spirit program progression Depth 5 / #402 A-B-C-D is now durably design-complete and reconciled; #402 is closed for design completion only. **Exact next research subpass: #403A — foundations / representative retrieval/attention formalisms only.** Do not execute #403B/C/D in the same run. A should compare symbolic relevance/attention foundations across graph/query planning, spreading activation/working memory, dependency closure, exact lexical/structural retrieval, case retrieval, embeddings as non-authoritative sensors, and bounded projection/completeness-risk semantics. #402/SAFIRE supplies exact cuts/freshness and scalable cursors; #403 must not redesign persistence.
Author
Owner

Machine Spirit #403A — foundations / representative formalisms

Status: A COMPLETE. This is the foundations pass only. B is next; C/D and #404 remain blocked.

Research questions / scope

  1. How should a query/goal over a million+ semantic records identify a small working set without silently losing premises, rules, counterevidence, temporal/epistemic scope, or provenance?
  2. Which relevance mechanisms have semantic guarantees versus only heuristic recall value?
  3. How should exact/structural, lexical, graph, case, and embedding retrieval cooperate while keeping retrieval score separate from warrant/truth/authority?
  4. What does a bounded projection need to report so downstream reasoning knows whether the returned slice is proof-complete, search-complete, or merely heuristic?
  5. How should working-memory eviction/re-entry behave without mutating durable memory or creating another scheduler?

This pass consumes #392/#394/#400 epistemic dependency semantics, #401 procedural semantics, #402 SAFIRE cuts/freshness, #381 retrieval expert, #396 package projection, #176 prompt compiler, and symbolic-memory #7/#9. It deliberately does not redesign semantic parsing or persistence.

Primary sources / representative mechanisms

  • Bancilhon, Maier, Sagiv & Ullman, “Magic Sets and Other Strange Ways to Implement Logic Programs”, PODS 1986. Goal-directed rule rewriting restricts bottom-up inference to facts/rules relevant to the query while retaining bulk-join evaluation. DOI: https://doi.org/10.1145/6012.15399
  • Collins & Loftus, “A spreading-activation theory of semantic processing”, Psychological Review 82(6), 1975. Activation spreads through semantic links with graded distance/strength; useful as an associative attention mechanism, not a logical entailment guarantee. DOI: https://doi.org/10.1037/0033-295X.82.6.407
  • Robertson & Zaragoza, “The Probabilistic Relevance Framework: BM25 and Beyond”, 2009. BM25-family ranking supplies a strong sparse lexical candidate generator and supports structured/non-text features, but ranking probability/relevance is not semantic warrant. DOI: https://doi.org/10.1561/1500000019
  • Carbonell & Goldstein, “The Use of MMR, Diversity-Based Reranking…”, SIGIR 1998. MMR explicitly trades query relevance against redundancy/novelty, useful for bounded evidence diversity after hard semantic constraints. DOI: https://doi.org/10.1145/290941.291025
  • Aamodt & Plaza, “Case-Based Reasoning: Foundational Issues…”, AI Communications 7(1), 1994. Retrieval is one stage of a retrieve/reuse/revise/retain cycle; case similarity does not establish applicability or truth. DOI: https://doi.org/10.3233/AIC-1994-7104
  • Karpukhin et al., Dense Passage Retrieval, 2020. Learned dual-encoder dense retrieval demonstrates strong semantic candidate recall, but remains a learned candidate-ranking mechanism. https://arxiv.org/abs/2004.04906
  • Gutiérrez et al., HippoRAG, NeurIPS 2024. Combines query/entity seeds, a knowledge graph and Personalized PageRank for single-step multi-hop associative retrieval; strong modern evidence that graph propagation can recover nonlocal evidence. https://arxiv.org/abs/2405.14831
  • Edge et al., GraphRAG, 2024/2025. Hierarchical graph/community retrieval improves corpus-wide/global sensemaking, but its pre-generated LLM summaries are inappropriate as Machine Spirit’s authoritative semantic substrate. https://arxiv.org/abs/2404.16130

Current-system comparison

Current rlm_conversation_warm.pl already has a useful precursor: warm artifacts are ranked by typed signals (pinned, direct_reference, active_task, unresolved, dependency, entity, topic, retrieval, recency), pinned can make a context unit mandatory, and a context-budget solver chooses representation fidelity. But this is conversation-summary ranking: it does not establish semantic dependency closure, counterevidence closure, query-search completeness, or a distinction between a soft score and a mandatory proof dependency.

#176’s prompt compiler already performs bounded evidence-driven selection/dependency closure for provider-visible prompt units and keeps model visibility distinct from runtime authority. #403A should generalize the attention contract, not create another prompt compiler or scheduler.

#400’s Epistemic Query Plan established demanded theory slicing before expensive reasoning; #401D did the same for procedural execution. #403A therefore makes demand-before-materialization the retrieval default too.

Candidate architectures

Candidate 1 — Query-directed logical slice (Magic-Set / backward dependency closure)

Normalize the goal, seed matching heads/entities/procedures/constraints, walk rule/justification/procedure dependencies backward, then evaluate only the demanded slice.

Strengths: strongest semantic story; exact on admitted finite fragments; naturally carries premises/rules/provenance; good for zero-model known queries.

Weaknesses: broad/underspecified questions may demand huge closures; lexical mismatch can prevent a useful seed; alternative-justification/provenance hypergraphs can explode.

Candidate 2 — Associative activation graph

Seed entities/relations/query concepts, spread bounded typed activation through semantic/identity/provenance/case links, rank the frontier, optionally use PPR-style propagation.

Strengths: excellent bridge discovery and multi-hop association; naturally supports graded working-memory attention and cheap re-entry.

Weaknesses: no proof-completeness guarantee; high-degree hubs can dominate; edge weights are policy/heuristic choices; must never become inference or source trust.

Candidate 3 — Cascaded hybrid IR

Exact/identifier/structural lookup -> BM25/lexical -> case similarity -> ANN/vector -> optional learned/model query expansion, with MMR/source-dependence-aware diversification.

Strengths: robust to naming/paraphrase mismatch; efficient mature indexes; good fallback for incomplete symbolic links.

Weaknesses: top-k truncation can omit required premises/counterevidence; dense similarity is non-authoritative; learned rankers complicate deterministic replay; document-centric retrieval does not understand rule/procedure closure by itself.

Candidate 4 — Global graph/community summarization

Precompute communities/summaries and retrieve those for broad/global questions.

Rejected as canonical substrate. It is useful as an optional sensor for global-sensemaking candidates, but generated summaries are lossy, expensive to invalidate, and cannot replace #392 records/justifications/provenance.

Preferred design — TAPS: Typed Attention & Projection Substrate

TAPS combines the candidates without flattening their guarantees:

normalized goal + context + epistemic profile + exact SAFIRE cut
        ↓
HARD ADMISSION FILTER
namespace/read authority/time/scenario/profile/freshness
        ↓
SEED DISCOVERY CASCADE
exact ID/symbol/type/head/procedure/constraint
→ structural/lexical/case
→ graph activation
→ vector/learned candidates only for unresolved gaps
        ↓
MANDATORY SEMANTIC CLOSURE
rules/premises/guards/justifications/counterevidence/
identity mappings/profile assumptions/provenance refs
        ↓
SOFT BUDGETED PERIPHERY
relevance + novelty + source-dependence + recency + cost
        ↓
bounded typed working set + explicit frontier/gaps/receipt
        ↓
#394/#400 reasoning or #401 execution
        ↓
source expansion only on demand and read-authorized

The architectural invariant is:

candidate relevance != semantic premise
retrieval score      != warrant/truth
ranking              != trust
included             != entailed
omitted              != false
similar              != same entity
retrievable action   != executable authority

Two independent completeness dimensions

A single complete=true is unsafe. Projection receipts must distinguish at least:

support_closure:
  closed | partial | resource_limited | stale

search_coverage:
  exhaustive_for_declared_fragment
  bounded_structural
  heuristic
  partial_backend
  unknown

support_closure=closed means every returned derived result/candidate proof has its required admitted rule/premise/assumption/counterevidence dependencies available for the selected profile. It does not mean no other relevant answer exists.

search_coverage=heuristic explicitly says top-k/activation/vector retrieval may have missed alternative answers. This prevents the classic RAG bug where a self-contained top-k answer is mistaken for an exhaustive knowledge-base answer.

Typed API sketch

attention_project(+Goal,
                  +Context,
                  +EpistemicProfile,
                  +Cut,
                  +Budget,
                  +Options,
                  -Outcome).

attention_projection(
    projection_id(Id),
    seeds(SeedRefs),
    mandatory(MandatoryRefs),
    peripheral(PeripheralRefs),
    frontier(FrontierRefs),
    gaps(Gaps),
    support_closure(SupportClosure),
    search_coverage(SearchCoverage),
    generations(Generations),
    strategy_receipt(StrategyReceipt),
    provenance(ProvenanceRefs)).

attention_candidate(
    record(RecordRef),
    discovered_by(Strategy),
    hard_status(Admissibility),
    rank_features(Features),
    dependencies(DependencyRefs),
    source_component(SourceComponent)).

rank_features remain inspectable components rather than one magical global confidence number.

Working-memory contract

Working memory is derived transient state, not another memory store:

  • pinned: query/root obligations or explicit host pins; cannot be evicted while live.
  • mandatory: semantic dependencies needed for an admitted result/procedure/guard; eviction must first evict the dependent result or mark its closure partial.
  • resident: useful ranked periphery.
  • frontier_only: compact reference/gap marker pointing back to durable storage.
  • evicted: absent from current projection but addressable by stable record ref and eligible to re-enter when goal/evidence changes.

Eviction never retracts durable knowledge. Re-entry is ordinary retrieval against the same exact cut/generations (or a clearly newer cut if caller opts into freshness).

Complexity / scaling

  • Exact hash/B-tree indexes: approximately O(1) or O(log N + k), backend dependent.
  • Explicit dependency closure: O(V_q + E_q) in the visited query slice, worst-case O(V+E); recursion may require fixed-point evaluation.
  • Bounded spreading/PPR-style activation: proportional to visited frontier/iterations; it is explicitly budgeted and heuristic.
  • BM25: cost follows traversed postings; excellent cheap lexical fallback.
  • ANN/vector: empirical sublinear candidate search but approximate recall; never required for exact known-symbol queries.
  • Provenance/alternative justifications can grow combinatorially; keep shared DAG/hypergraph structure and expand explanations on demand rather than copying all proof trees into prompt context.
  • Never apply top-k truncation before mandatory dependency/support closure. Budget negotiation may drop a candidate conclusion, but must not silently keep the conclusion while dropping its required premises.

Epistemic / provenance implications

Retrieval runs over an exact #402 cut and explicit #400 epistemic profile. Counterevidence and live defeaters are first-class dependencies for contested results. Source-dependence components from #400C prevent ten copies of one origin from dominating diversity ranking. Provenance may remain compact refs until explanation/source expansion, but every selected record remains traceable.

A projection can therefore honestly say:

answer candidate A: support-closed
alternative search: heuristic only
counterevidence: included
source dependence: 2 independent origins

Safety / authority implications

  • Read authority filters run before candidate scoring and before provenance/source expansion.
  • Similarity/activation cannot widen namespace access.
  • Retrieved policy/procedure/action terms remain inert semantic knowledge and never grant runtime capability.
  • Rank score does not inherit source trust; source trust does not become probability.
  • Model query expansion, if enabled, is a traced candidate-generator only and cannot synthesize authoritative evidence.
  • Adversarial text cannot pin itself into working memory or declare itself mandatory; pin/admission comes from trusted host/query semantics.

Adversarial review / failure cases

  1. Exact query has a known symbolic proof but vector index is unavailable: exact path succeeds with zero model/vector dependency.
  2. Top lexical hit states P but a low-ranked rule exception defeats P: mandatory dependency/defeater closure includes the exception.
  3. Ten duplicate mirrors of one source outrank one independent contrary source: source-dependence-aware diversity keeps the contrary component visible.
  4. High-degree ontology hub absorbs spreading activation: typed edge weights/hop budgets and exact seed constraints prevent hub rank from becoming semantic truth.
  5. Embedding-near entities are distinct people: similarity proposes candidates only; #10 identity evidence controls joins.
  6. Historical fact matches perfectly but query asks current state: hard temporal admission excludes it as current premise while history remains expandable.
  7. Source provenance is unreadable to caller: semantic result can expose an authorized opaque provenance ref without leaking source text.
  8. Budget cannot fit one candidate plus its mandatory dependency closure: drop/mark that candidate rather than emitting a dangling conclusion.
  9. Recursive rule closure reaches budget: return support_closure=resource_limited, not false/unknown-by-absence.
  10. Working-memory eviction removes a premise still needed by an active result: dependent result becomes nonresident/partial too; no dangling proof.
  11. Learned reranker order changes after model upgrade: exact semantic results remain stable; receipt records ranker/version and deterministic tie-breaks.
  12. Broad “what themes exist?” query has no exhaustive symbolic target: report heuristic/global-sensemaking coverage rather than fake completeness.

Rejected alternatives

  • Vector-first universal retrieval: weak on exact IDs/rules, approximate, difficult to replay, no dependency guarantees.
  • One global relevance scalar: collapses hard admissibility, semantic dependency, trust, freshness, novelty and similarity into an uninterpretable number.
  • Whole connected-component closure: safe but frequently destroys boundedness; demanded typed closure is required instead.
  • Prompt-only attention: too late; relevance must be useful for zero-model symbolic reasoning and non-LLM clients.
  • Materialize one permanent “working memory”: duplicates #402 and creates stale authority. Working sets are disposable projections.

Falsifiable #403A conformance fixtures

  1. exact identifier beats vector path; model_calls=0;
  2. direct fact projection excludes unrelated million-record corpus;
  3. returned derived result includes its rule + premises;
  4. default result includes live exception/defeater dependencies;
  5. explicit counterevidence survives ranking;
  6. historical/current scope filter;
  7. scenario isolation;
  8. source-dependence diversity;
  9. same surface name / distinct entity isolation;
  10. exact identity mapping joins when explicitly admitted;
  11. lexical paraphrase recovery;
  12. vector candidate recovers synonym gap but cannot assert identity;
  13. vector backend unavailable still permits exact/structural query;
  14. graph activation finds two-hop relevant record;
  15. hub activation does not confer warrant;
  16. top-k before closure is rejected;
  17. too-large mandatory closure yields structural/resource limit;
  18. support-closed + search-heuristic statuses coexist;
  19. source expansion obeys read authority;
  20. unreadable provenance text cannot leak through explanation;
  21. working-memory eviction never mutates ledger;
  22. evicted record re-enters by stable ref;
  23. same cut/options yields deterministic projection fingerprint/tie ordering;
  24. changed cut/freshness generation invalidates stale projection;
  25. case similarity retrieves precedent but does not bypass applicability guards;
  26. MMR/diversity cannot remove mandatory counterevidence;
  27. broad/global query reports heuristic coverage;
  28. prompt compiler receives only projection records selected after hard semantic closure;
  29. direct #396 in-memory package projection and symbolic-memory-backed projection obey the same receipt semantics;
  30. known symbolic query after restart executes with model_calls=0.

Concrete canonical handoffs

  • #381 Retrieval Expert: owns strategy choice/gap pursuit. Add TAPS distinction between hard admission + mandatory support closure versus soft candidate ranking; its output should carry support_closure, search_coverage, frontier/gaps and strategy receipt.
  • #396 semantic_projection: package-local operation should implement the same TAPS contract over an in-memory compiled package; it must not require symbolic-memory, embeddings, or a model.
  • #176 prompt compiler: consume TAPS projections as provider-visible knowledge/context units; prompt packing cannot silently sever semantic mandatory dependencies. Keep model visibility != runtime authority.
  • symbolic-memory #7: world-model query/projection owns durable-store-backed TAPS execution over an exact cut; expose support closure separately from search coverage.
  • symbolic-memory #9: MCP/native transport preserves projection receipt/frontier/gaps/completeness dimensions and source-expansion authority; no flattening to prose/top-k chunks.
  • #395: add attention/projection conformance lane so material semantic loss from retrieval is distinguishable from compiler semantic loss.

Unresolved questions reserved for #403B/C/D

  • B: adversarial query poisoning, hub attacks, stale/high-trust distractors, ranking gaming, conflict suppression, pathological recursive closure, negative-information retrieval, calibration of completeness risk, learned-ranker nondeterminism.
  • C: federation across multiple stores/theories/retrievers/identity namespaces and non-flattening composition of heterogeneous retrieval guarantees.
  • D: executable indexes, incremental invalidation, exact cache keys, algorithms/data structures, latency/memory bounds, deterministic replay and large-scale conformance.

Completion decision: #403A is coherent enough to mark complete. This is design completion only; no implementation/Machine Spirit acceptance is claimed.

## Machine Spirit #403A — foundations / representative formalisms **Status:** A COMPLETE. This is the foundations pass only. **B is next; C/D and #404 remain blocked.** ### Research questions / scope 1. How should a query/goal over a million+ semantic records identify a small working set without silently losing premises, rules, counterevidence, temporal/epistemic scope, or provenance? 2. Which relevance mechanisms have semantic guarantees versus only heuristic recall value? 3. How should exact/structural, lexical, graph, case, and embedding retrieval cooperate while keeping retrieval score separate from warrant/truth/authority? 4. What does a bounded projection need to report so downstream reasoning knows whether the returned slice is proof-complete, search-complete, or merely heuristic? 5. How should working-memory eviction/re-entry behave without mutating durable memory or creating another scheduler? This pass consumes #392/#394/#400 epistemic dependency semantics, #401 procedural semantics, #402 SAFIRE cuts/freshness, #381 retrieval expert, #396 package projection, #176 prompt compiler, and symbolic-memory #7/#9. It deliberately does **not** redesign semantic parsing or persistence. ### Primary sources / representative mechanisms - Bancilhon, Maier, Sagiv & Ullman, **“Magic Sets and Other Strange Ways to Implement Logic Programs”**, PODS 1986. Goal-directed rule rewriting restricts bottom-up inference to facts/rules relevant to the query while retaining bulk-join evaluation. DOI: https://doi.org/10.1145/6012.15399 - Collins & Loftus, **“A spreading-activation theory of semantic processing”**, Psychological Review 82(6), 1975. Activation spreads through semantic links with graded distance/strength; useful as an associative *attention* mechanism, not a logical entailment guarantee. DOI: https://doi.org/10.1037/0033-295X.82.6.407 - Robertson & Zaragoza, **“The Probabilistic Relevance Framework: BM25 and Beyond”**, 2009. BM25-family ranking supplies a strong sparse lexical candidate generator and supports structured/non-text features, but ranking probability/relevance is not semantic warrant. DOI: https://doi.org/10.1561/1500000019 - Carbonell & Goldstein, **“The Use of MMR, Diversity-Based Reranking…”**, SIGIR 1998. MMR explicitly trades query relevance against redundancy/novelty, useful for bounded evidence diversity after hard semantic constraints. DOI: https://doi.org/10.1145/290941.291025 - Aamodt & Plaza, **“Case-Based Reasoning: Foundational Issues…”**, AI Communications 7(1), 1994. Retrieval is one stage of a retrieve/reuse/revise/retain cycle; case similarity does not establish applicability or truth. DOI: https://doi.org/10.3233/AIC-1994-7104 - Karpukhin et al., **Dense Passage Retrieval**, 2020. Learned dual-encoder dense retrieval demonstrates strong semantic candidate recall, but remains a learned candidate-ranking mechanism. https://arxiv.org/abs/2004.04906 - Gutiérrez et al., **HippoRAG**, NeurIPS 2024. Combines query/entity seeds, a knowledge graph and Personalized PageRank for single-step multi-hop associative retrieval; strong modern evidence that graph propagation can recover nonlocal evidence. https://arxiv.org/abs/2405.14831 - Edge et al., **GraphRAG**, 2024/2025. Hierarchical graph/community retrieval improves corpus-wide/global sensemaking, but its pre-generated LLM summaries are inappropriate as Machine Spirit’s authoritative semantic substrate. https://arxiv.org/abs/2404.16130 ### Current-system comparison Current `rlm_conversation_warm.pl` already has a useful precursor: warm artifacts are ranked by typed signals (`pinned`, `direct_reference`, `active_task`, `unresolved`, `dependency`, `entity`, `topic`, `retrieval`, `recency`), `pinned` can make a context unit mandatory, and a context-budget solver chooses representation fidelity. But this is conversation-summary ranking: it does **not** establish semantic dependency closure, counterevidence closure, query-search completeness, or a distinction between a soft score and a mandatory proof dependency. #176’s prompt compiler already performs bounded evidence-driven selection/dependency closure for provider-visible prompt units and keeps model visibility distinct from runtime authority. #403A should generalize the *attention contract*, not create another prompt compiler or scheduler. #400’s Epistemic Query Plan established demanded theory slicing before expensive reasoning; #401D did the same for procedural execution. #403A therefore makes **demand-before-materialization** the retrieval default too. ### Candidate architectures #### Candidate 1 — Query-directed logical slice (Magic-Set / backward dependency closure) Normalize the goal, seed matching heads/entities/procedures/constraints, walk rule/justification/procedure dependencies backward, then evaluate only the demanded slice. **Strengths:** strongest semantic story; exact on admitted finite fragments; naturally carries premises/rules/provenance; good for zero-model known queries. **Weaknesses:** broad/underspecified questions may demand huge closures; lexical mismatch can prevent a useful seed; alternative-justification/provenance hypergraphs can explode. #### Candidate 2 — Associative activation graph Seed entities/relations/query concepts, spread bounded typed activation through semantic/identity/provenance/case links, rank the frontier, optionally use PPR-style propagation. **Strengths:** excellent bridge discovery and multi-hop association; naturally supports graded working-memory attention and cheap re-entry. **Weaknesses:** no proof-completeness guarantee; high-degree hubs can dominate; edge weights are policy/heuristic choices; must never become inference or source trust. #### Candidate 3 — Cascaded hybrid IR Exact/identifier/structural lookup -> BM25/lexical -> case similarity -> ANN/vector -> optional learned/model query expansion, with MMR/source-dependence-aware diversification. **Strengths:** robust to naming/paraphrase mismatch; efficient mature indexes; good fallback for incomplete symbolic links. **Weaknesses:** top-k truncation can omit required premises/counterevidence; dense similarity is non-authoritative; learned rankers complicate deterministic replay; document-centric retrieval does not understand rule/procedure closure by itself. #### Candidate 4 — Global graph/community summarization Precompute communities/summaries and retrieve those for broad/global questions. **Rejected as canonical substrate.** It is useful as an optional *sensor* for global-sensemaking candidates, but generated summaries are lossy, expensive to invalidate, and cannot replace #392 records/justifications/provenance. ### Preferred design — TAPS: Typed Attention & Projection Substrate TAPS combines the candidates without flattening their guarantees: ```text normalized goal + context + epistemic profile + exact SAFIRE cut ↓ HARD ADMISSION FILTER namespace/read authority/time/scenario/profile/freshness ↓ SEED DISCOVERY CASCADE exact ID/symbol/type/head/procedure/constraint → structural/lexical/case → graph activation → vector/learned candidates only for unresolved gaps ↓ MANDATORY SEMANTIC CLOSURE rules/premises/guards/justifications/counterevidence/ identity mappings/profile assumptions/provenance refs ↓ SOFT BUDGETED PERIPHERY relevance + novelty + source-dependence + recency + cost ↓ bounded typed working set + explicit frontier/gaps/receipt ↓ #394/#400 reasoning or #401 execution ↓ source expansion only on demand and read-authorized ``` The architectural invariant is: ```text candidate relevance != semantic premise retrieval score != warrant/truth ranking != trust included != entailed omitted != false similar != same entity retrievable action != executable authority ``` ### Two independent completeness dimensions A single `complete=true` is unsafe. Projection receipts must distinguish at least: ```text support_closure: closed | partial | resource_limited | stale search_coverage: exhaustive_for_declared_fragment bounded_structural heuristic partial_backend unknown ``` `support_closure=closed` means every *returned derived result/candidate proof* has its required admitted rule/premise/assumption/counterevidence dependencies available for the selected profile. It does **not** mean no other relevant answer exists. `search_coverage=heuristic` explicitly says top-k/activation/vector retrieval may have missed alternative answers. This prevents the classic RAG bug where a self-contained top-k answer is mistaken for an exhaustive knowledge-base answer. ### Typed API sketch ```prolog attention_project(+Goal, +Context, +EpistemicProfile, +Cut, +Budget, +Options, -Outcome). attention_projection( projection_id(Id), seeds(SeedRefs), mandatory(MandatoryRefs), peripheral(PeripheralRefs), frontier(FrontierRefs), gaps(Gaps), support_closure(SupportClosure), search_coverage(SearchCoverage), generations(Generations), strategy_receipt(StrategyReceipt), provenance(ProvenanceRefs)). attention_candidate( record(RecordRef), discovered_by(Strategy), hard_status(Admissibility), rank_features(Features), dependencies(DependencyRefs), source_component(SourceComponent)). ``` `rank_features` remain inspectable components rather than one magical global confidence number. ### Working-memory contract Working memory is **derived transient state**, not another memory store: - `pinned`: query/root obligations or explicit host pins; cannot be evicted while live. - `mandatory`: semantic dependencies needed for an admitted result/procedure/guard; eviction must first evict the dependent result or mark its closure partial. - `resident`: useful ranked periphery. - `frontier_only`: compact reference/gap marker pointing back to durable storage. - `evicted`: absent from current projection but addressable by stable record ref and eligible to re-enter when goal/evidence changes. Eviction never retracts durable knowledge. Re-entry is ordinary retrieval against the same exact cut/generations (or a clearly newer cut if caller opts into freshness). ### Complexity / scaling - Exact hash/B-tree indexes: approximately O(1) or O(log N + k), backend dependent. - Explicit dependency closure: O(V_q + E_q) in the visited query slice, worst-case O(V+E); recursion may require fixed-point evaluation. - Bounded spreading/PPR-style activation: proportional to visited frontier/iterations; it is explicitly budgeted and heuristic. - BM25: cost follows traversed postings; excellent cheap lexical fallback. - ANN/vector: empirical sublinear candidate search but approximate recall; never required for exact known-symbol queries. - Provenance/alternative justifications can grow combinatorially; keep shared DAG/hypergraph structure and expand explanations on demand rather than copying all proof trees into prompt context. - **Never apply top-k truncation before mandatory dependency/support closure.** Budget negotiation may drop a candidate conclusion, but must not silently keep the conclusion while dropping its required premises. ### Epistemic / provenance implications Retrieval runs over an exact #402 cut and explicit #400 epistemic profile. Counterevidence and live defeaters are first-class dependencies for contested results. Source-dependence components from #400C prevent ten copies of one origin from dominating diversity ranking. Provenance may remain compact refs until explanation/source expansion, but every selected record remains traceable. A projection can therefore honestly say: ```text answer candidate A: support-closed alternative search: heuristic only counterevidence: included source dependence: 2 independent origins ``` ### Safety / authority implications - Read authority filters run before candidate scoring and before provenance/source expansion. - Similarity/activation cannot widen namespace access. - Retrieved policy/procedure/action terms remain inert semantic knowledge and never grant runtime capability. - Rank score does not inherit source trust; source trust does not become probability. - Model query expansion, if enabled, is a traced candidate-generator only and cannot synthesize authoritative evidence. - Adversarial text cannot pin itself into working memory or declare itself mandatory; pin/admission comes from trusted host/query semantics. ### Adversarial review / failure cases 1. Exact query has a known symbolic proof but vector index is unavailable: exact path succeeds with **zero model/vector dependency**. 2. Top lexical hit states P but a low-ranked rule exception defeats P: mandatory dependency/defeater closure includes the exception. 3. Ten duplicate mirrors of one source outrank one independent contrary source: source-dependence-aware diversity keeps the contrary component visible. 4. High-degree ontology hub absorbs spreading activation: typed edge weights/hop budgets and exact seed constraints prevent hub rank from becoming semantic truth. 5. Embedding-near entities are distinct people: similarity proposes candidates only; #10 identity evidence controls joins. 6. Historical fact matches perfectly but query asks current state: hard temporal admission excludes it as current premise while history remains expandable. 7. Source provenance is unreadable to caller: semantic result can expose an authorized opaque provenance ref without leaking source text. 8. Budget cannot fit one candidate plus its mandatory dependency closure: drop/mark that candidate rather than emitting a dangling conclusion. 9. Recursive rule closure reaches budget: return `support_closure=resource_limited`, not false/unknown-by-absence. 10. Working-memory eviction removes a premise still needed by an active result: dependent result becomes nonresident/partial too; no dangling proof. 11. Learned reranker order changes after model upgrade: exact semantic results remain stable; receipt records ranker/version and deterministic tie-breaks. 12. Broad “what themes exist?” query has no exhaustive symbolic target: report heuristic/global-sensemaking coverage rather than fake completeness. ### Rejected alternatives - **Vector-first universal retrieval:** weak on exact IDs/rules, approximate, difficult to replay, no dependency guarantees. - **One global relevance scalar:** collapses hard admissibility, semantic dependency, trust, freshness, novelty and similarity into an uninterpretable number. - **Whole connected-component closure:** safe but frequently destroys boundedness; demanded typed closure is required instead. - **Prompt-only attention:** too late; relevance must be useful for zero-model symbolic reasoning and non-LLM clients. - **Materialize one permanent “working memory”:** duplicates #402 and creates stale authority. Working sets are disposable projections. ### Falsifiable #403A conformance fixtures 1. exact identifier beats vector path; `model_calls=0`; 2. direct fact projection excludes unrelated million-record corpus; 3. returned derived result includes its rule + premises; 4. default result includes live exception/defeater dependencies; 5. explicit counterevidence survives ranking; 6. historical/current scope filter; 7. scenario isolation; 8. source-dependence diversity; 9. same surface name / distinct entity isolation; 10. exact identity mapping joins when explicitly admitted; 11. lexical paraphrase recovery; 12. vector candidate recovers synonym gap but cannot assert identity; 13. vector backend unavailable still permits exact/structural query; 14. graph activation finds two-hop relevant record; 15. hub activation does not confer warrant; 16. top-k before closure is rejected; 17. too-large mandatory closure yields structural/resource limit; 18. support-closed + search-heuristic statuses coexist; 19. source expansion obeys read authority; 20. unreadable provenance text cannot leak through explanation; 21. working-memory eviction never mutates ledger; 22. evicted record re-enters by stable ref; 23. same cut/options yields deterministic projection fingerprint/tie ordering; 24. changed cut/freshness generation invalidates stale projection; 25. case similarity retrieves precedent but does not bypass applicability guards; 26. MMR/diversity cannot remove mandatory counterevidence; 27. broad/global query reports heuristic coverage; 28. prompt compiler receives only projection records selected after hard semantic closure; 29. direct #396 in-memory package projection and symbolic-memory-backed projection obey the same receipt semantics; 30. known symbolic query after restart executes with `model_calls=0`. ### Concrete canonical handoffs - **#381 Retrieval Expert:** owns strategy choice/gap pursuit. Add TAPS distinction between hard admission + mandatory support closure versus soft candidate ranking; its output should carry `support_closure`, `search_coverage`, frontier/gaps and strategy receipt. - **#396 semantic_projection:** package-local operation should implement the same TAPS contract over an in-memory compiled package; it must not require symbolic-memory, embeddings, or a model. - **#176 prompt compiler:** consume TAPS projections as provider-visible knowledge/context units; prompt packing cannot silently sever semantic mandatory dependencies. Keep `model visibility != runtime authority`. - **symbolic-memory #7:** world-model query/projection owns durable-store-backed TAPS execution over an exact cut; expose support closure separately from search coverage. - **symbolic-memory #9:** MCP/native transport preserves projection receipt/frontier/gaps/completeness dimensions and source-expansion authority; no flattening to prose/top-k chunks. - **#395:** add attention/projection conformance lane so material semantic loss from retrieval is distinguishable from compiler semantic loss. ### Unresolved questions reserved for #403B/C/D - B: adversarial query poisoning, hub attacks, stale/high-trust distractors, ranking gaming, conflict suppression, pathological recursive closure, negative-information retrieval, calibration of completeness risk, learned-ranker nondeterminism. - C: federation across multiple stores/theories/retrievers/identity namespaces and non-flattening composition of heterogeneous retrieval guarantees. - D: executable indexes, incremental invalidation, exact cache keys, algorithms/data structures, latency/memory bounds, deterministic replay and large-scale conformance. **Completion decision:** #403A is coherent enough to mark complete. This is design completion only; no implementation/Machine Spirit acceptance is claimed.
Author
Owner

Machine Spirit #403B — semantic/adversarial deepening

Status: B COMPLETE. A remains complete; C is next. Do not start D or #404.

Scope / research questions

This pass attacks #403A/TAPS as an attention-control system rather than as an ordinary IR stack.

Questions:

  1. Can an adversary manipulate what Machine Spirit considers without falsifying any individual stored fact?
  2. How do corpus poisoning, lexical stuffing, embedding attacks, graph hubs, duplicate-origin amplification, stale evidence, malicious metadata and prompt injection interact with TAPS's seed/rank/closure pipeline?
  3. How can retrieval explicitly seek counterevidence, exceptions, defeaters, fresher replacements and identity-disambiguating evidence instead of assuming the first candidate set is epistemically representative?
  4. Which parts of retrieval are allowed to be heuristic, and which must be revalidated against the exact #402/SAFIRE cut before reasoning or action support?
  5. How should a bounded system fail when an adversary creates a dependency/closure bomb or starves the budget with many high-scoring candidates?

Primary evidence

Current research makes the attack model concrete:

  • Zou, Geng, Wang & Jia, PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models, USENIX Security 2025. Five malicious texts per target question in a database of millions produced about 90% attack success in their evaluated setting; evaluated defenses remained insufficient. https://www.usenix.org/conference/usenixsecurity25/presentation/zou-poisonedrag
  • Su, Nakov & Cardie, Corpus Poisoning via Approximate Greedy Gradient Descent, Findings of ACL 2025. AGGD constructs adversarial passages for dense retrievers and generalizes to unseen queries/domains; on ANCE it improves attack success over HotFlip by 15.24 and 17.44 percentage points on NQ/MS-MARCO respectively. https://aclanthology.org/2025.findings-acl.222/
  • Greshake et al., Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection, AISec 2023. Retrieved untrusted data can carry instructions that steer an LLM-integrated application's behavior; retrieval therefore creates a data/instruction boundary problem, not just a relevance problem. https://doi.org/10.1145/3605764.3623985
  • Gyöngyi, Garcia-Molina & Pedersen, Combating Web Spam with TrustRank, VLDB 2004. Classic evidence that ranking/link structures are strategic surfaces: adversaries can manufacture ranking signals, while seed-based trust propagation is useful only under assumptions about seed quality and graph locality. https://www.vldb.org/conf/2004/RS15P3.PDF
  • Jung et al., CamoDocs, 2026 preprint. Demonstrates that poisoning can deliberately avoid obvious query-overlap artifacts, weakening simplistic lexical/query-overlap filters. https://arxiv.org/abs/2608.28389
  • Huang et al., VerTox, 2026 preprint. Current evidence that LLM-generated poisoning can target modern neural ranking systems and produce fluent, deceptive documents that rank above target material. https://arxiv.org/abs/2609.01325
  • Liu et al., RobustMask, 2025 preprint. Certified top-k robustness is possible only under an explicit perturbation model/assumptions; this is useful as a backend-specific guarantee, not a universal semantic defense. https://arxiv.org/abs/2512.23307

These sources do not justify adopting any one RAG defense as Machine Spirit architecture. They establish the stronger premise: rankable corpora and learned retrievers are adversarial surfaces, and heuristics cannot be promoted into truth/completeness guarantees.

Attack on #403A assumptions

TAPS's A-level split remains correct:

hard admission + mandatory semantic closure
    !=
soft relevance ranking

But A leaves a hidden weakness: mandatory closure only protects a candidate after the system has selected/discovered it. An attacker can instead manipulate candidate exposure so that an important contrary candidate is never selected.

Therefore:

support-closed(selected result)
    !=
selection was epistemically representative

and:

no retrieved defeater
    !=
no defeater exists

This is the core B correction.

Candidate architectures

Candidate B1 — filter-first trusted retrieval

Run spam/poisoning/trust detectors before ranking, reject suspicious candidates, then use ordinary TAPS.

Useful: cheap, composable, can remove obvious poison.

Rejected as canonical defense: no detector is complete; attacks can mimic benign language; trust propagation can suppress novel legitimate evidence; a false-negative poison still controls exposure. A classifier score is another sensor, not an authority oracle.

Candidate B2 — redundant multi-retriever consensus

Run exact, lexical, graph and dense retrievers independently and admit candidates only when multiple channels agree.

Useful: catches some single-backend manipulation and provides disagreement signals.

Rejected as sufficient: correlated indexes/corpora fail together; rare but true evidence may appear in one channel only; consensus can amplify copied origins; “three retrievers found it” is not three independent sources.

Candidate B3 — obligation-driven adversarial exposure

Treat retrieval as a set of typed evidence obligations, not one ranked list. Query semantics/profile determine which opposing/freshness/identity/provenance lanes must be attempted. Rankers propose candidates inside those lanes; they do not decide whether the lane exists.

Selected.

Preferred design — OATH-TAPS

OATH-TAPS: Obligation-Aware Threat-Hardened Typed Attention & Projection Substrate.

trusted normalized Goal/QueryIR
 + Context + EpistemicProfile + exact SAFIRE cut
 + Attention/Risk Profile
             ↓
TRUSTED QUERY CONTROL
raw user/source text cannot set pin/mandatory/trust/authority/freshness policy
             ↓
HARD ADMISSION
read authority / namespace / scenario / time / profile / exact-cut freshness
             ↓
MULTI-LANE EXPOSURE
support candidates
counterevidence / explicit-negation candidates
exception / defeater / undercutter candidates
freshness / supersession / invalidation candidates
identity-disambiguation / different-from candidates
source-independence / original-origin candidates
             ↓
canonical ledger/cut revalidation
 + source-dependence collapse
 + sensor-disagreement recording
             ↓
MANDATORY SEMANTIC CLOSURE
premises/rules/guards/justifications/counterevidence/
assumptions/identity mappings/provenance
             ↓
SOFT BOUNDED PERIPHERY
rank / novelty / recency / cost / diversity
             ↓
working set + typed gaps + adversarial-exposure receipt

New hard distinction: exposure != warrant

Add these invariants:

ranked highly                    != independently supported
not retrieved                    != absent
retrieval consensus              != source independence
source count                     != origin count
signed/authenticated source      != proposition truth
trust score                      != relevance or warrant
index presence                   != canonical ledger presence
index freshness                  != canonical-cut freshness
poison suspicion                 != semantic false
raw query instruction            != attention policy
source metadata says "pinned"    != host pin
source says "trusted"            != trusted source

Retrieval obligations

Conceptual records:

attention_obligation(
    obligation_id(Id),
    kind(Kind),
    query(QueryRef),
    scope(Scope),
    trigger(Trigger),
    required_coverage(Coverage),
    budget(Budget),
    status(Status),
    evidence(EvidenceRefs)).

attention_exposure_receipt(
    support_search(SupportStatus),
    opposition_search(OppositionStatus),
    freshness_search(FreshnessStatus),
    identity_search(IdentityStatus),
    source_independence(SourceStatus),
    sensor_disagreement(Disagreement),
    canonical_revalidation(Revalidation),
    gaps(Gaps)).

Candidate obligation kinds include:

seek_support
seek_refutation
seek_exception_or_defeater
seek_fresher_state
seek_identity_counterexample
seek_independent_origin
seek_missing_prerequisite

These are retrieval obligations, not claims that contrary evidence exists.

Risk/profile-triggered obligations

Do not pay maximal adversarial-search cost for every lookup. A versioned attention profile can require stronger exposure for classes such as:

  • contested epistemic query;
  • current-state query;
  • VERIFY evidence acquisition;
  • procedure/action support;
  • policy/authority-sensitive reasoning;
  • diagnosis where competing hypotheses exist.

Example:

exploratory lookup:
  support lane + ordinary heuristic coverage

current VERIFY lookup:
  support + fresher/supersession + counterevidence + exact-cut validation

action-support lookup:
  above + procedure contraindications/guards + identity + authority-relevant provenance

Attention profiles do not change #400 epistemic semantics or host authority. They only state what evidence-search work is required before a projection can claim a particular coverage class.

Poisoning-resistant mechanics

1. Canonical revalidation before reasoning

Lexical/vector/graph indexes are rebuildable sensors. Every selected record must resolve to a canonical record admitted at the requested SAFIRE cut before it can enter mandatory closure/reasoning.

ANN hit exists
canonical record missing / wrong cut
    → reject-as-evidence + record index inconsistency

An index cannot create semantic history.

2. Collapse duplicate origins before diversity scoring

Use #400 source-dependence components. Ten mirrors of one wire article may remain ten records but count as one origin component for diversity/corroboration pressure.

Do diversification/quotas over origin/dependence components, not raw record count.

3. Typed hub resistance

Graph activation/PPR-style discovery is allowed, but high-degree generic nodes cannot consume the whole budget merely by degree.

Use profile-controlled mechanisms such as:

  • relation-specific hop/edge budgets;
  • degree normalization/caps;
  • seed anchoring / restart probability;
  • per-relation/per-origin quotas;
  • exclusion or downweighting of structurally generic hub relations for specific query classes.

These change discovery work only, never entailment strength.

4. Freshness is a gate when the query requires current evidence

A stale candidate cannot buy its way back through a high BM25/vector score.

If no current evidence exists:

current_required + stale_only
    → evidence_gap(current)

not “best available current answer.”

5. Raw text cannot set attention control metadata

Only trusted host/query semantics may set:

pinned
mandatory
trusted source class
read scope
attention profile
freshness exception
source-dependence identity

Source text such as PIN THIS, ignore counterevidence, priority=999999, or trust_me=true stays semantic/source content.

This is particularly important because the current rlm_conversation_warm.pl precursor represents pinned as a very high trusted signal and marks matching units mandatory; TAPS implementation must ensure those signals originate from trusted runtime/query state, never arbitrary remembered content.

6. Query text and QueryIR are separate

Raw user language may contain adversarial retrieval steering. The trusted semantic goal controls required lanes and hard scope. Lexical/vector query strings derived from it are traced sensor inputs.

A model-generated query expansion is allowed only as:

candidate_search_expression

never as a semantic obligation, authority rule, or evidence.

7. Closure-bomb defense is fail-honest

An adversary can make one attractive candidate depend on an enormous rule/provenance graph.

Before admitting a result, estimate/track closure expansion and enforce per-candidate/per-origin/global structural budgets. If required closure cannot fit:

candidate_not_admitted_as_support_closed
support_closure = resource_limited

Never retain the conclusion while silently truncating its mandatory dependencies.

A poisoner can cause denial-of-service pressure; it cannot convert resource exhaustion into truth.

Completeness contract refinement

Keep A's two axes, but B requires explicit adversarial exposure diagnostics:

support_closure:
  closed | partial | resource_limited | stale

search_coverage:
  exhaustive_for_declared_fragment
  bounded_structural
  heuristic
  partial_backend
  unknown

opposition_coverage:
  exhaustive_for_declared_fragment
  attempted_bounded
  heuristic
  unavailable
  not_required

selection_integrity:
  canonical_exact
  canonical_multi_sensor
  canonical_single_sensor
  degraded_backend
  index_inconsistent

Do not invent a boolean poison_free=true; in open/adversarial corpora that is generally not provable.

Complexity / performance

  • Canonical revalidation adds roughly one indexed canonical lookup per selected candidate: backend-dependent O(log N + k) or equivalent batched point/range lookup.
  • Source-dependence collapse can use existing dependence IDs/indexes; grouping k candidates is O(k) expected with indexed component IDs.
  • Opposition/freshness/identity lanes multiply retrieval work by the number of triggered obligation classes, not by corpus size directly; risk profiles keep this bounded.
  • Typed graph activation remains proportional to visited edges/iterations under explicit per-relation/frontier budgets.
  • Closure bombs remain worst-case O(V+E) in the reachable semantic dependency slice; B does not make that tractable by lying. It adds early cost accounting and structured refusal.
  • Multi-sensor redundancy is additive in selected backend costs; it is optional evidence about exposure, not a mandatory all-query tax.
  • Learned/certified ranking defenses may be plugged in as backend capabilities; any guarantee must name the exact perturbation/threat model and cannot upgrade semantic warrant.

Epistemic / provenance implications

OATH-TAPS composes directly with #400:

  • opposition lanes retrieve explicit negative support, rebuttals, underminers, undercutters and invalidators without deciding their defeat semantics;
  • source dependence prevents copy farms from manufacturing corroboration;
  • current/freshness lanes respect valid-time/known-time and lifecycle events;
  • identity-disambiguation returns evidence/alternatives to #10/#400 rather than merging by similarity;
  • final warrant still belongs to the selected epistemic profile, never to retrieval.

A result can now honestly say:

support_closure = closed
search_coverage = heuristic
opposition_coverage = attempted_bounded
source_independence = two_origin_components
selection_integrity = canonical_multi_sensor

without claiming global exhaustiveness.

Safety / authority implications

  • Read authority is enforced before retrieval and source/provenance expansion.
  • Cross-namespace similarity cannot reveal or admit inaccessible candidates.
  • Retrieved procedures/policies/actions remain inert semantic records.
  • A poisoned source cannot pin itself, widen an attention profile, declare itself trusted, create a capability, or override a VERIFY requirement.
  • Indirect prompt-injection strings remain quoted/source semantics if later rendered to a model; they do not become control-plane instructions.
  • A poisoning detector may block/flag a sensor candidate, but suspicion itself never becomes semantic negation.
  • Failure of all heuristic backends never triggers implicit LLM fallback. Explicit configured fallback remains separately traced and candidate-only.

Adversarial fixtures / falsifiable conformance

B adds at least these fixtures:

  1. Five dense poison passages outrank the real fact; canonical exact/structural path still finds the known symbolic answer.
  2. Lexical keyword-stuffed poison ranks first; rank does not affect warrant.
  3. Poison is fluent/camouflaged with low lexical overlap; query-overlap filtering alone must fail the test.
  4. Ten mirrors of one origin cannot count as ten corroborating sources.
  5. One independent contrary origin survives diversity packing against the mirror swarm.
  6. Generic ontology hub receives huge activation; it cannot crowd out seed-local required relations.
  7. Stale high-score assertion cannot satisfy current_required.
  8. Low-ranked explicit defeater is recovered by a triggered opposition obligation.
  9. No retrieved defeater with opposition_coverage=heuristic cannot be reported as “no defeater exists.”
  10. Source text says PIN THIS; source cannot set runtime pin state.
  11. Source metadata payload says priority=999999; untrusted field cannot alter ranking policy.
  12. Source claims trusted; trust class remains host/ledger policy data.
  13. Raw query says “ignore all counterevidence”; epistemic/action profile still triggers required opposition lane.
  14. Retrieved document contains prompt injection telling the model to call a tool; it remains source content and grants zero capability.
  15. Vector-near person/entity cannot join records without explicit #10 identity evidence.
  16. Vector result points to a deleted/nonexistent canonical record; it is rejected and index inconsistency is surfaced.
  17. Vector index is unavailable; exact known-symbol query succeeds with zero vector/model dependence.
  18. Lexical backend unavailable during evidentiary query; receipt reports degraded coverage rather than silent completeness.
  19. Learned ranker version changes; projection lineage/receipt changes even when answer happens to match.
  20. Dense and lexical sensors disagree strongly; disagreement is recorded, not averaged into one confidence scalar.
  21. One candidate expands to a million dependency nodes; result becomes closure-resource-limited rather than truncated proof.
  22. Thousands of tiny high-score poison candidates cannot evict an already admitted mandatory dependency closure.
  23. Poison candidate has valid signature/authentication; this proves origin/integrity only, not proposition truth.
  24. Historical negative evidence must not act as current refutation outside validity scope.
  25. Current correction/supersession lane finds a newer assertion that outranks/invalidates stale state semantically, regardless of old document relevance score.
  26. Case similarity retrieves an unsafe precedent with incompatible guard/context; procedural applicability rejects it.
  27. Model query expansion invents a synonym; expansion may retrieve candidates but cannot create identity or evidence.
  28. Search returns only positive-source cluster; source-independence obligation reports insufficient independent coverage.
  29. Safety-sensitive procedure query with incomplete contraindication/guard retrieval cannot claim action-ready coverage.
  30. VERIFY evidence acquisition cannot accept heuristic-only stale evidence when its evidence policy requires current exact/independent evidence.
  31. Same exact cut/query/profile with deterministic sensors disabled/enabled produces the same known symbolic conclusion where exact closure suffices; only exposure receipt may differ by declared optional sensor profile.
  32. Poisoning detection budget exhausts; status is resource_limited/degraded, never poison_free.
  33. Cross-namespace poisoned embedding neighbor is filtered before scoring/expansion and leaks no metadata.
  34. Providers disabled: all exact compiled-semantic OATH-TAPS fixtures requiring no generative fallback complete with model_calls = 0.

Concrete canonical deltas

#381 Retrieval / Evidence Expert

Add responsibility for typed retrieval obligations and adversarial exposure receipts. Strategy selection must be able to issue explicit support/opposition/freshness/identity/source-independence subsearches. Backend agreement is not source corroboration. Retrieval Expert may report poisoning/sensor disagreement, but cannot decide epistemic truth.

#396 semantic_projection

Pure in-memory package projection should implement the same control split: trusted QueryIR/profile determines obligations; soft candidate sensors cannot set mandatory/pin state; projection reports opposition coverage and canonical/package membership validation.

#395 conformance

Add a retrieval/attention adversarial lane distinguishing:

semantic compiler loss
retrieval exposure loss
support-closure loss
opposition suppression
source-copy amplification
freshness-selection failure
identity-near-merge failure
control-metadata injection

Do not hide these in generic answer accuracy.

symbolic-memory #7/#9

memory_semantic_projection should expose opposition/freshness/source-independence/selection-integrity receipts and gaps. MCP/native transport must preserve these fields instead of flattening a bounded projection into prose/top-k chunks.

symbolic-memory #6/#10

Use durable source-dependence and identity/mapping lineage as retrieval inputs. Similarity remains a candidate sensor; dependence/identity decisions remain provenance-bearing semantic knowledge.

Rejected alternatives

  • One global trust/relevance score: rejected; trust, relevance, provenance, confidence and warrant are different dimensions.
  • Allowlist-only retrieval: rejected as default; robust for narrow deployments but destroys open-world discovery and can freeze stale authority assumptions.
  • LLM judge every candidate: rejected; expensive, attackable by indirect injection, non-deterministic, and violates zero-model known paths.
  • Top-k diversification alone: rejected; diversity does not guarantee opposition/defeater discovery.
  • Retriever consensus = truth: rejected; correlated sensors and shared poisoned corpus can agree.
  • Poison classifier = semantic false: rejected; classifier errors must not manufacture negative knowledge.
  • Expand every query adversarially to exhaustion: rejected; impossible at scale. Obligation/risk profiles make stronger search explicit and bounded.

Unresolved for C / D

Preserve for later subpasses:

  • interoperability of obligation/coverage contracts across external search engines, vector stores, graph stores, remote ledgers and local symbolic indexes (#403C);
  • how to compare backend-specific robustness/certification claims without flattening threat models (#403C);
  • exact index layout, cached obligation plans, incremental invalidation and ranker/version fingerprints (#403D);
  • empirical thresholds for hub caps, source-component quotas and closure-cost admission (#403D);
  • adversarial benchmarking at million/billion-record scale and deterministic failure injection (#403D);
  • whether any backend-specific certified ranking primitive is worth shipping in v1 (#403D).

Completion statement

#403B is design-complete only. OATH-TAPS hardens TAPS by making candidate exposure inspectable and obligation-driven; it does not claim poisoned corpora are solved, implementation exists, or Machine Spirit acceptance is met.

Exact next subpass: #403C — composition / heterogeneity / interoperability.

Refs #397 #400 #402 #381 #392 #394 #395 #396 and downstream lost-rob0t/symbolic-memory#6/#7/#9/#10.

## Machine Spirit #403B — semantic/adversarial deepening **Status: B COMPLETE. A remains complete; C is next. Do not start D or #404.** ### Scope / research questions This pass attacks #403A/TAPS as an *attention-control* system rather than as an ordinary IR stack. Questions: 1. Can an adversary manipulate what Machine Spirit considers without falsifying any individual stored fact? 2. How do corpus poisoning, lexical stuffing, embedding attacks, graph hubs, duplicate-origin amplification, stale evidence, malicious metadata and prompt injection interact with TAPS's seed/rank/closure pipeline? 3. How can retrieval explicitly seek **counterevidence, exceptions, defeaters, fresher replacements and identity-disambiguating evidence** instead of assuming the first candidate set is epistemically representative? 4. Which parts of retrieval are allowed to be heuristic, and which must be revalidated against the exact #402/SAFIRE cut before reasoning or action support? 5. How should a bounded system fail when an adversary creates a dependency/closure bomb or starves the budget with many high-scoring candidates? ### Primary evidence Current research makes the attack model concrete: - Zou, Geng, Wang & Jia, **PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models**, USENIX Security 2025. Five malicious texts per target question in a database of millions produced about **90% attack success** in their evaluated setting; evaluated defenses remained insufficient. https://www.usenix.org/conference/usenixsecurity25/presentation/zou-poisonedrag - Su, Nakov & Cardie, **Corpus Poisoning via Approximate Greedy Gradient Descent**, Findings of ACL 2025. AGGD constructs adversarial passages for dense retrievers and generalizes to unseen queries/domains; on ANCE it improves attack success over HotFlip by 15.24 and 17.44 percentage points on NQ/MS-MARCO respectively. https://aclanthology.org/2025.findings-acl.222/ - Greshake et al., **Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection**, AISec 2023. Retrieved untrusted data can carry instructions that steer an LLM-integrated application's behavior; retrieval therefore creates a data/instruction boundary problem, not just a relevance problem. https://doi.org/10.1145/3605764.3623985 - Gyöngyi, Garcia-Molina & Pedersen, **Combating Web Spam with TrustRank**, VLDB 2004. Classic evidence that ranking/link structures are strategic surfaces: adversaries can manufacture ranking signals, while seed-based trust propagation is useful only under assumptions about seed quality and graph locality. https://www.vldb.org/conf/2004/RS15P3.PDF - Jung et al., **CamoDocs**, 2026 preprint. Demonstrates that poisoning can deliberately avoid obvious query-overlap artifacts, weakening simplistic lexical/query-overlap filters. https://arxiv.org/abs/2608.28389 - Huang et al., **VerTox**, 2026 preprint. Current evidence that LLM-generated poisoning can target modern neural ranking systems and produce fluent, deceptive documents that rank above target material. https://arxiv.org/abs/2609.01325 - Liu et al., **RobustMask**, 2025 preprint. Certified top-k robustness is possible only under an explicit perturbation model/assumptions; this is useful as a *backend-specific guarantee*, not a universal semantic defense. https://arxiv.org/abs/2512.23307 These sources do **not** justify adopting any one RAG defense as Machine Spirit architecture. They establish the stronger premise: rankable corpora and learned retrievers are adversarial surfaces, and heuristics cannot be promoted into truth/completeness guarantees. ### Attack on #403A assumptions TAPS's A-level split remains correct: ```text hard admission + mandatory semantic closure != soft relevance ranking ``` But A leaves a hidden weakness: **mandatory closure only protects a candidate after the system has selected/discovered it.** An attacker can instead manipulate *candidate exposure* so that an important contrary candidate is never selected. Therefore: ```text support-closed(selected result) != selection was epistemically representative ``` and: ```text no retrieved defeater != no defeater exists ``` This is the core B correction. ## Candidate architectures ### Candidate B1 — filter-first trusted retrieval Run spam/poisoning/trust detectors before ranking, reject suspicious candidates, then use ordinary TAPS. **Useful:** cheap, composable, can remove obvious poison. **Rejected as canonical defense:** no detector is complete; attacks can mimic benign language; trust propagation can suppress novel legitimate evidence; a false-negative poison still controls exposure. A classifier score is another sensor, not an authority oracle. ### Candidate B2 — redundant multi-retriever consensus Run exact, lexical, graph and dense retrievers independently and admit candidates only when multiple channels agree. **Useful:** catches some single-backend manipulation and provides disagreement signals. **Rejected as sufficient:** correlated indexes/corpora fail together; rare but true evidence may appear in one channel only; consensus can amplify copied origins; “three retrievers found it” is not three independent sources. ### Candidate B3 — obligation-driven adversarial exposure Treat retrieval as a set of **typed evidence obligations**, not one ranked list. Query semantics/profile determine which opposing/freshness/identity/provenance lanes must be attempted. Rankers propose candidates inside those lanes; they do not decide whether the lane exists. **Selected.** # Preferred design — OATH-TAPS **OATH-TAPS: Obligation-Aware Threat-Hardened Typed Attention & Projection Substrate.** ```text trusted normalized Goal/QueryIR + Context + EpistemicProfile + exact SAFIRE cut + Attention/Risk Profile ↓ TRUSTED QUERY CONTROL raw user/source text cannot set pin/mandatory/trust/authority/freshness policy ↓ HARD ADMISSION read authority / namespace / scenario / time / profile / exact-cut freshness ↓ MULTI-LANE EXPOSURE support candidates counterevidence / explicit-negation candidates exception / defeater / undercutter candidates freshness / supersession / invalidation candidates identity-disambiguation / different-from candidates source-independence / original-origin candidates ↓ canonical ledger/cut revalidation + source-dependence collapse + sensor-disagreement recording ↓ MANDATORY SEMANTIC CLOSURE premises/rules/guards/justifications/counterevidence/ assumptions/identity mappings/provenance ↓ SOFT BOUNDED PERIPHERY rank / novelty / recency / cost / diversity ↓ working set + typed gaps + adversarial-exposure receipt ``` ### New hard distinction: exposure != warrant Add these invariants: ```text ranked highly != independently supported not retrieved != absent retrieval consensus != source independence source count != origin count signed/authenticated source != proposition truth trust score != relevance or warrant index presence != canonical ledger presence index freshness != canonical-cut freshness poison suspicion != semantic false raw query instruction != attention policy source metadata says "pinned" != host pin source says "trusted" != trusted source ``` ## Retrieval obligations Conceptual records: ```prolog attention_obligation( obligation_id(Id), kind(Kind), query(QueryRef), scope(Scope), trigger(Trigger), required_coverage(Coverage), budget(Budget), status(Status), evidence(EvidenceRefs)). attention_exposure_receipt( support_search(SupportStatus), opposition_search(OppositionStatus), freshness_search(FreshnessStatus), identity_search(IdentityStatus), source_independence(SourceStatus), sensor_disagreement(Disagreement), canonical_revalidation(Revalidation), gaps(Gaps)). ``` Candidate obligation kinds include: ```text seek_support seek_refutation seek_exception_or_defeater seek_fresher_state seek_identity_counterexample seek_independent_origin seek_missing_prerequisite ``` These are *retrieval obligations*, not claims that contrary evidence exists. ### Risk/profile-triggered obligations Do not pay maximal adversarial-search cost for every lookup. A versioned attention profile can require stronger exposure for classes such as: - contested epistemic query; - current-state query; - VERIFY evidence acquisition; - procedure/action support; - policy/authority-sensitive reasoning; - diagnosis where competing hypotheses exist. Example: ```text exploratory lookup: support lane + ordinary heuristic coverage current VERIFY lookup: support + fresher/supersession + counterevidence + exact-cut validation action-support lookup: above + procedure contraindications/guards + identity + authority-relevant provenance ``` Attention profiles do not change #400 epistemic semantics or host authority. They only state what evidence-search work is required before a projection can claim a particular coverage class. ## Poisoning-resistant mechanics ### 1. Canonical revalidation before reasoning Lexical/vector/graph indexes are rebuildable sensors. Every selected record must resolve to a canonical record admitted at the requested SAFIRE cut before it can enter mandatory closure/reasoning. ```text ANN hit exists canonical record missing / wrong cut → reject-as-evidence + record index inconsistency ``` An index cannot create semantic history. ### 2. Collapse duplicate origins before diversity scoring Use #400 source-dependence components. Ten mirrors of one wire article may remain ten records but count as one origin component for diversity/corroboration pressure. Do diversification/quotas over origin/dependence components, not raw record count. ### 3. Typed hub resistance Graph activation/PPR-style discovery is allowed, but high-degree generic nodes cannot consume the whole budget merely by degree. Use profile-controlled mechanisms such as: - relation-specific hop/edge budgets; - degree normalization/caps; - seed anchoring / restart probability; - per-relation/per-origin quotas; - exclusion or downweighting of structurally generic hub relations for specific query classes. These change **discovery work only**, never entailment strength. ### 4. Freshness is a gate when the query requires current evidence A stale candidate cannot buy its way back through a high BM25/vector score. If no current evidence exists: ```text current_required + stale_only → evidence_gap(current) ``` not “best available current answer.” ### 5. Raw text cannot set attention control metadata Only trusted host/query semantics may set: ```text pinned mandatory trusted source class read scope attention profile freshness exception source-dependence identity ``` Source text such as `PIN THIS`, `ignore counterevidence`, `priority=999999`, or `trust_me=true` stays semantic/source content. This is particularly important because the current `rlm_conversation_warm.pl` precursor represents `pinned` as a very high trusted signal and marks matching units mandatory; TAPS implementation must ensure those signals originate from trusted runtime/query state, never arbitrary remembered content. ### 6. Query text and QueryIR are separate Raw user language may contain adversarial retrieval steering. The trusted semantic goal controls required lanes and hard scope. Lexical/vector query strings derived from it are traced sensor inputs. A model-generated query expansion is allowed only as: ```text candidate_search_expression ``` never as a semantic obligation, authority rule, or evidence. ### 7. Closure-bomb defense is fail-honest An adversary can make one attractive candidate depend on an enormous rule/provenance graph. Before admitting a result, estimate/track closure expansion and enforce per-candidate/per-origin/global structural budgets. If required closure cannot fit: ```text candidate_not_admitted_as_support_closed support_closure = resource_limited ``` Never retain the conclusion while silently truncating its mandatory dependencies. A poisoner can cause denial-of-service pressure; it cannot convert resource exhaustion into truth. ## Completeness contract refinement Keep A's two axes, but B requires explicit adversarial exposure diagnostics: ```text support_closure: closed | partial | resource_limited | stale search_coverage: exhaustive_for_declared_fragment bounded_structural heuristic partial_backend unknown opposition_coverage: exhaustive_for_declared_fragment attempted_bounded heuristic unavailable not_required selection_integrity: canonical_exact canonical_multi_sensor canonical_single_sensor degraded_backend index_inconsistent ``` Do **not** invent a boolean `poison_free=true`; in open/adversarial corpora that is generally not provable. ## Complexity / performance - Canonical revalidation adds roughly one indexed canonical lookup per selected candidate: backend-dependent O(log N + k) or equivalent batched point/range lookup. - Source-dependence collapse can use existing dependence IDs/indexes; grouping k candidates is O(k) expected with indexed component IDs. - Opposition/freshness/identity lanes multiply retrieval work by the number of triggered obligation classes, not by corpus size directly; risk profiles keep this bounded. - Typed graph activation remains proportional to visited edges/iterations under explicit per-relation/frontier budgets. - Closure bombs remain worst-case O(V+E) in the reachable semantic dependency slice; B does not make that tractable by lying. It adds early cost accounting and structured refusal. - Multi-sensor redundancy is additive in selected backend costs; it is optional evidence about exposure, not a mandatory all-query tax. - Learned/certified ranking defenses may be plugged in as backend capabilities; any guarantee must name the exact perturbation/threat model and cannot upgrade semantic warrant. ## Epistemic / provenance implications OATH-TAPS composes directly with #400: - opposition lanes retrieve explicit negative support, rebuttals, underminers, undercutters and invalidators without deciding their defeat semantics; - source dependence prevents copy farms from manufacturing corroboration; - current/freshness lanes respect valid-time/known-time and lifecycle events; - identity-disambiguation returns evidence/alternatives to #10/#400 rather than merging by similarity; - final warrant still belongs to the selected epistemic profile, never to retrieval. A result can now honestly say: ```text support_closure = closed search_coverage = heuristic opposition_coverage = attempted_bounded source_independence = two_origin_components selection_integrity = canonical_multi_sensor ``` without claiming global exhaustiveness. ## Safety / authority implications - Read authority is enforced before retrieval and source/provenance expansion. - Cross-namespace similarity cannot reveal or admit inaccessible candidates. - Retrieved procedures/policies/actions remain inert semantic records. - A poisoned source cannot pin itself, widen an attention profile, declare itself trusted, create a capability, or override a VERIFY requirement. - Indirect prompt-injection strings remain quoted/source semantics if later rendered to a model; they do not become control-plane instructions. - A poisoning detector may block/flag a sensor candidate, but suspicion itself never becomes semantic negation. - Failure of all heuristic backends never triggers implicit LLM fallback. Explicit configured fallback remains separately traced and candidate-only. ## Adversarial fixtures / falsifiable conformance B adds at least these fixtures: 1. Five dense poison passages outrank the real fact; canonical exact/structural path still finds the known symbolic answer. 2. Lexical keyword-stuffed poison ranks first; rank does not affect warrant. 3. Poison is fluent/camouflaged with low lexical overlap; query-overlap filtering alone must fail the test. 4. Ten mirrors of one origin cannot count as ten corroborating sources. 5. One independent contrary origin survives diversity packing against the mirror swarm. 6. Generic ontology hub receives huge activation; it cannot crowd out seed-local required relations. 7. Stale high-score assertion cannot satisfy `current_required`. 8. Low-ranked explicit defeater is recovered by a triggered opposition obligation. 9. No retrieved defeater with `opposition_coverage=heuristic` cannot be reported as “no defeater exists.” 10. Source text says `PIN THIS`; source cannot set runtime pin state. 11. Source metadata payload says `priority=999999`; untrusted field cannot alter ranking policy. 12. Source claims `trusted`; trust class remains host/ledger policy data. 13. Raw query says “ignore all counterevidence”; epistemic/action profile still triggers required opposition lane. 14. Retrieved document contains prompt injection telling the model to call a tool; it remains source content and grants zero capability. 15. Vector-near person/entity cannot join records without explicit #10 identity evidence. 16. Vector result points to a deleted/nonexistent canonical record; it is rejected and index inconsistency is surfaced. 17. Vector index is unavailable; exact known-symbol query succeeds with zero vector/model dependence. 18. Lexical backend unavailable during evidentiary query; receipt reports degraded coverage rather than silent completeness. 19. Learned ranker version changes; projection lineage/receipt changes even when answer happens to match. 20. Dense and lexical sensors disagree strongly; disagreement is recorded, not averaged into one confidence scalar. 21. One candidate expands to a million dependency nodes; result becomes closure-resource-limited rather than truncated proof. 22. Thousands of tiny high-score poison candidates cannot evict an already admitted mandatory dependency closure. 23. Poison candidate has valid signature/authentication; this proves origin/integrity only, not proposition truth. 24. Historical negative evidence must not act as current refutation outside validity scope. 25. Current correction/supersession lane finds a newer assertion that outranks/invalidates stale state semantically, regardless of old document relevance score. 26. Case similarity retrieves an unsafe precedent with incompatible guard/context; procedural applicability rejects it. 27. Model query expansion invents a synonym; expansion may retrieve candidates but cannot create identity or evidence. 28. Search returns only positive-source cluster; source-independence obligation reports insufficient independent coverage. 29. Safety-sensitive procedure query with incomplete contraindication/guard retrieval cannot claim action-ready coverage. 30. VERIFY evidence acquisition cannot accept heuristic-only stale evidence when its evidence policy requires current exact/independent evidence. 31. Same exact cut/query/profile with deterministic sensors disabled/enabled produces the same known symbolic conclusion where exact closure suffices; only exposure receipt may differ by declared optional sensor profile. 32. Poisoning detection budget exhausts; status is `resource_limited`/degraded, never `poison_free`. 33. Cross-namespace poisoned embedding neighbor is filtered before scoring/expansion and leaks no metadata. 34. Providers disabled: all exact compiled-semantic OATH-TAPS fixtures requiring no generative fallback complete with **`model_calls = 0`**. ## Concrete canonical deltas ### #381 Retrieval / Evidence Expert Add responsibility for typed retrieval obligations and adversarial exposure receipts. Strategy selection must be able to issue explicit support/opposition/freshness/identity/source-independence subsearches. Backend agreement is not source corroboration. Retrieval Expert may report poisoning/sensor disagreement, but cannot decide epistemic truth. ### #396 semantic_projection Pure in-memory package projection should implement the same control split: trusted QueryIR/profile determines obligations; soft candidate sensors cannot set mandatory/pin state; projection reports opposition coverage and canonical/package membership validation. ### #395 conformance Add a retrieval/attention adversarial lane distinguishing: ```text semantic compiler loss retrieval exposure loss support-closure loss opposition suppression source-copy amplification freshness-selection failure identity-near-merge failure control-metadata injection ``` Do not hide these in generic answer accuracy. ### symbolic-memory #7/#9 `memory_semantic_projection` should expose opposition/freshness/source-independence/selection-integrity receipts and gaps. MCP/native transport must preserve these fields instead of flattening a bounded projection into prose/top-k chunks. ### symbolic-memory #6/#10 Use durable source-dependence and identity/mapping lineage as retrieval inputs. Similarity remains a candidate sensor; dependence/identity decisions remain provenance-bearing semantic knowledge. ## Rejected alternatives - **One global trust/relevance score:** rejected; trust, relevance, provenance, confidence and warrant are different dimensions. - **Allowlist-only retrieval:** rejected as default; robust for narrow deployments but destroys open-world discovery and can freeze stale authority assumptions. - **LLM judge every candidate:** rejected; expensive, attackable by indirect injection, non-deterministic, and violates zero-model known paths. - **Top-k diversification alone:** rejected; diversity does not guarantee opposition/defeater discovery. - **Retriever consensus = truth:** rejected; correlated sensors and shared poisoned corpus can agree. - **Poison classifier = semantic false:** rejected; classifier errors must not manufacture negative knowledge. - **Expand every query adversarially to exhaustion:** rejected; impossible at scale. Obligation/risk profiles make stronger search explicit and bounded. ## Unresolved for C / D Preserve for later subpasses: - interoperability of obligation/coverage contracts across external search engines, vector stores, graph stores, remote ledgers and local symbolic indexes (#403C); - how to compare backend-specific robustness/certification claims without flattening threat models (#403C); - exact index layout, cached obligation plans, incremental invalidation and ranker/version fingerprints (#403D); - empirical thresholds for hub caps, source-component quotas and closure-cost admission (#403D); - adversarial benchmarking at million/billion-record scale and deterministic failure injection (#403D); - whether any backend-specific certified ranking primitive is worth shipping in v1 (#403D). ## Completion statement **#403B is design-complete only.** OATH-TAPS hardens TAPS by making candidate *exposure* inspectable and obligation-driven; it does not claim poisoned corpora are solved, implementation exists, or Machine Spirit acceptance is met. **Exact next subpass: #403C — composition / heterogeneity / interoperability.** Refs #397 #400 #402 #381 #392 #394 #395 #396 and downstream `lost-rob0t/symbolic-memory#6/#7/#9/#10`.
Author
Owner

MACHINE-SPIRIT #403C — composition / heterogeneity / interoperability

Status: C COMPLETE. This is the third distinct subpass for Depth 6. A=TAPS foundations; B=OATH-TAPS adversarial exposure semantics; C addresses composition of heterogeneous retrieval systems without pretending their scores, coverage, freshness, trust, robustness, identity or authority semantics are interchangeable. D remains required before Depth 6 can close.

Research questions / scope

  1. How can local symbolic indexes, lexical/BM25 engines, ANN/vector stores, graph/PPR stores, case retrieval, remote SAFIRE/CLFM ledgers, SPARQL/federated structured sources, web search and external databases participate in one bounded semantic projection without a universal fake score?
  2. How are QueryIR obligations translated into backend-native requests while preserving unsupported/lost constraints explicitly?
  3. How are candidate identity, source independence, freshness, namespace/authority, coverage and threat-model guarantees carried across adapters?
  4. What fusion/composition operators are safe when score spaces are incomparable or only rank order is meaningful?
  5. How do remote/external candidates become admissible semantic evidence without bypassing #392/#394/#402 provenance and admission semantics?
  6. Which guarantees compose, which weaken, and which must stay scoped to one retriever?
  7. Where do orchestration, adapter mechanics, durable storage and provider-context packing belong across #219/#381/#396/symbolic-memory?

Primary sources / mechanisms checked

  • Maurizio Lenzerini, “Data Integration: A Theoretical Perspective,” PODS 2002, DOI 10.1145/543613.543644. Formal data-integration framing: sources and global schema are related by explicit mappings; query answering depends on those mappings rather than assuming source schemas are identical.
  • W3C, SPARQL 1.1 Federated Query, Recommendation 2013-03-21, https://www.w3.org/TR/sparql11-federated-query/. SERVICE gives explicit remote subquery boundaries and defined failure behavior; federation does not require one physical store.
  • Andreas Schwarte et al., “FedX: Optimization Techniques for Federated Query Processing on Linked Data,” ISWC 2011, DOI 10.1007/978-3-642-25073-6_38. Mechanisms include source selection, request grouping and join processing to avoid blindly querying every endpoint.
  • Ronald Fagin, Amnon Lotem, Moni Naor, “Optimal Aggregation Algorithms for Middleware,” PODS 2001 / JCSS 2003, DOI 10.1016/S0022-0000(03)00026-6. Threshold-style aggregation has strong instance-optimality results for monotone aggregation under stated sorted/random access assumptions. Those assumptions matter: the theorem does not authorize arbitrary fusion of semantically unrelated scores.
  • Gordon Cormack, Charles Clarke, Stefan Büttcher, “Reciprocal Rank Fusion Outperforms Condorcet and Individual Rank Learning Methods,” SIGIR 2009, DOI 10.1145/1571941.1572114. RRF combines rank positions without requiring cross-system score calibration; useful for soft candidate fusion, not epistemic warrant.
  • Yu. A. Malkov, D. A. Yashunin, “Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World Graphs,” TPAMI, online 2018 / vol. 42 2020, DOI 10.1109/TPAMI.2018.2889473. HNSW is explicitly approximate and exposes an efficiency/recall tradeoff; ANN candidate coverage cannot be mislabeled exhaustive.
  • Erik Bernhardsson et al., “ANN-Benchmarks,” Information Systems 87 (2020), DOI 10.1016/j.is.2019.02.006. ANN quality is implementation/dataset/parameter dependent and benchmarked by recall/performance tradeoffs, reinforcing that a vector backend’s local score is not a universal completeness certificate.
  • Jennie Duggan et al., “The BigDAWG Polystore System,” SIGMOD Record 2015. Polystore/island architecture is a useful systems analogue: preserve native engines/data models and cross boundaries explicitly rather than forcing all semantics into one lowest-common-denominator engine.

Current repository evidence also matters. rlm_conversation_warm.pl currently ranks warm artifacts with one local weighted score and marks a unit mandatory from trusted pinned signals; rlm_prompt_compiler.pl performs bounded candidate narrowing, dependency closure and final packing through the canonical context-budget solver. Approved RLM-RESEARCH-011 already says retrieval metadata is adversarial evidence, mandatory dependencies precede packing, and selection is not authorization. #381 keeps retrieval strategy in the Retrieval Expert; #396 owns pure in-memory semantic projection; symbolic-memory #7/#9 own durable query/projection and transport surfaces. C must compose these rather than introduce another scheduler or token packer.


Finding 1 — a normalized result envelope is necessary; a normalized score is not

The central interoperability invariant is:

backend result envelope compatibility
    !=
backend score comparability

BM25 score, cosine/dot-product similarity, graph activation/PageRank, case similarity, exact symbolic match, SPARQL binding, external search rank and a remote ledger query are different observables with different semantics.

Therefore this design explicitly rejects a generic contract such as:

hit(Id, UniversalScore0to1).

Normalizing each backend to [0,1] changes numerical range, not meaning or calibration. It also hides exact-vs-approximate coverage and makes future explanations lie about why a result was selected.

Preferred backend contract: Retrieval Semantic Contract (RSC)

Each retriever exposes a versioned, inspectable contract approximately equivalent to:

retrieval_contract(
    RetrieverId,
    Version,
    capability{
        query_classes: QueryClasses,
        source_scope: SourceScope,
        identity_domain: IdentityDomain,
        result_semantics: ResultSemantics,
        ordering: OrderingSemantics,
        coverage: CoverageSemantics,
        freshness: FreshnessSemantics,
        filter_semantics: FilterSemantics,
        pagination: PaginationSemantics,
        provenance: ProvenanceSemantics,
        threat_claims: ThreatClaims,
        egress_class: EgressClass
    }).

Examples:

ordering = exact_boolean
ordering = backend_rank_only
ordering = bm25_score(local_parameterization)
ordering = vector_similarity(metric, model, dimensions)
ordering = graph_activation(algorithm, params)

coverage = exhaustive_for(snapshot, declared_fragment)
coverage = exact_top_k_for(index_generation)
coverage = bounded_structural(radius, edge_classes)
coverage = approximate_ann(index, params, empirical_recall_profile)
coverage = remote_best_effort
coverage = heuristic
coverage = unknown

A backend may expose stronger machine-checkable guarantees where it genuinely has them. The federation layer preserves those claims instead of upgrading them.


Finding 2 — QueryIR translation needs loss receipts

TAPS/OATH-TAPS obligations are semantic, while backends speak different query languages. C therefore inserts a typed translation boundary:

trusted QueryIR + obligation
        ↓
backend capability match
        ↓
translation
        ↓
backend-native request
        + translation receipt

Conceptual record:

retrieval_translation(
    TranslationId,
    ObligationId,
    RetrieverId,
    QueryIRVersion,
    NativeQueryDigest,
    preserved(Preserved),
    weakened(Weakened),
    unsupported(Unsupported),
    pushed_filters(Pushed),
    post_filters(Post),
    provenance(Provenance)).

Examples of material loss:

  • a vector store cannot express an exact temporal validity predicate and instead requires post-filtering;
  • external web search cannot promise namespace-complete search;
  • lexical search can express phrase/date filters but not a graph path obligation;
  • a SPARQL endpoint can execute structural joins but may not expose local epistemic-profile semantics;
  • a remote memory projection may preserve the semantic query but expose only best_effort freshness because its exact frontier is unavailable.

Unsupported constraints are never silently dropped. If an obligation requires a hard predicate and no backend/host post-filter can enforce it, that backend cannot satisfy that obligation.


Candidate architectures

Candidate A — Universal normalized-score bus

All adapters emit {record, score 0..1} and the federation sorts globally.

Rejected. It destroys score meaning, hides exact/approximate coverage, conflates candidate relevance with warrant, is fragile under backend version drift, and cannot express hard obligations/joins/freshness correctly.

Candidate B — Materialize everything into one canonical local index

Import every external source into symbolic-memory, then query only one local world model.

Useful promotion path, rejected as the universal architecture. Once admitted, local semantic records are ideal for repeated reasoning, exact cuts and provenance. But mandatory materialization is unsuitable for fresh web search, huge remote stores, one-shot APIs, privacy boundaries and remote authoritative data. It also creates synchronization and licensing/storage problems.

Candidate C — Late-fusion metasearch

Issue independent searches and combine ranks, preferably with RRF when scores are not calibrated.

Accepted as a submechanism, insufficient as the architecture. RRF is a strong deterministic default for soft peripheral candidate fusion across ranked lists because it relies on ranks rather than comparable scores. It does not express joins, hard coverage requirements, identity mappings, translation loss, authority, source dependence or backend-specific guarantees.

Candidate D — Typed mediator/polystore federation with explicit retrieval algebra

Preserve native retrievers behind RSC adapters; compile obligations into a bounded plan; compose results with typed operators; canonicalize/revalidate before reasoning; retain per-backend receipts.

Preferred. Name: MOSAIC-TAPS — Mediated Obligation-Safe Attention & Interoperability Contracts for TAPS.


Preferred design — MOSAIC-TAPS

trusted QueryIR
+ TAPS/OATH attention profile
+ exact local SAFIRE cut where applicable
        ↓
Retrieval Expert (#381)
        ↓
obligation DAG
        ↓
RSC capability/source selection
        ↓
loss-aware QueryIR translators
        ↓
┌ exact/symbolic ──────┐
├ lexical/BM25 ────────┤
├ graph/PPR ───────────┤
├ ANN/vector ──────────┤
├ case retrieval ──────┤
├ remote memory/ledger ┤
├ SPARQL/database ─────┤
└ external/web ────────┘
        ↓
typed candidate envelopes + backend receipts
        ↓
identity/source-dependence reconciliation
        ↓
composition algebra
        ↓
canonical local revalidation OR typed external observation/admission
        ↓
mandatory semantic support/opposition closure
        ↓
soft bounded packing
        ↓
projection + federated receipt + gaps

Candidate envelope

retrieval_candidate(
    CandidateId,
    RetrieverId,
    NativeRef,
    CandidateKind,
    RankInfo,
    CanonicalRef,
    SourceOrigin,
    IdentityState,
    FreshnessState,
    CoverageRef,
    TranslationRef,
    ThreatClaims,
    Provenance).

RankInfo is typed, e.g. rank(7), bm25(12.3, Params), cosine(0.82, EmbeddingModel), exact_match, not one universal float.

Composition algebra

The coordinator owns typed plan composition, not adapters:

union       — broaden candidate exposure
cascade     — cheap retriever first; invoke expensive lane only on gap
fallback    — use B only if A is unavailable/insufficient under policy
intersect   — require compatible identity across result sets
join        — explicit mapping/key relation; may require remote subqueries
refine      — candidate set from A becomes constrained request to B
corroborate — seek independent origins, NOT independent retrievers
oppose      — run counterevidence/defeater lane
freshen     — require newer/current source class

Each operator has typed preconditions. join cannot silently equate backend-local IDs. corroborate operates on origin/dependence components from #402/#10, not number of retrievers returning a row.


Rank fusion policy

When the goal is only to prioritize the soft periphery, and input systems expose rank but no calibrated common score, use deterministic RRF as the default fusion candidate.

fusion score = Σ 1/(k + rank_i)

This is explicitly marked selection_score, never confidence, truth, warrant or source_quality.

Calibrated/weighted score fusion is permitted only under a named fusion profile that declares compatible score semantics/calibration and versions. Fagin-style threshold algorithms are admissible only when their required monotone aggregation/access assumptions actually hold. The existence of TA’s optimality theorem does not make arbitrary BM25+cosine+trust aggregation sound.

Hard lanes bypass soft fusion where necessary. Example: an exact different_from(A,B) counterexample required by an identity-sensitive query cannot be discarded because an RRF score is low.


Coverage and robustness compose conservatively

There is no single federated complete=true and no robust=true.

A federated receipt should preserve a vector of scoped claims:

federated_coverage{
    support: ...,
    opposition: ...,
    freshness: ...,
    identity: ...,
    source_independence: ...,
    backend_receipts: [...],
    unsatisfied_obligations: [...]
}.

If local exact symbolic lookup is exhaustive for a declared namespace but the required external-source lane is unavailable, the combined query is not globally exhaustive. If an ANN lane is approximate, its contribution remains approximate even if the lexical lane is exact.

Threat/robustness claims are namespaced proof obligations:

backend V certified against threat model T
    !=
whole projection certified against T

Combining a certified retriever with an uncertified web/vector lane invalidates any attempt to claim the whole exposure set has the certified property unless a separate composition proof exists.


External evidence admission boundary

A remote web/search/API result must not acquire local canonical status merely because a retriever returned it.

external candidate
    ↓
source fetch/record observation
    ↓
provenance + content/version identity
    ↓
semantic compile/normalize where needed (#388/#392)
    ↓
local admission/epistemic handling (#394/#402)
    ↓
canonical record/ref

For a one-shot query, the runtime may reason over an explicitly typed external_observation_candidate if the selected epistemic profile allows it, but its status must remain external/uncommitted. Durable reuse belongs in symbolic-memory and cannot be smuggled through retrieval.

Local symbolic-memory candidates, by contrast, must revalidate against the requested ledger cut/generations before entering mandatory closure.


Identity and source-independence interoperability

Hard distinctions:

same URL string       != same source origin
same content hash     != same event/assertion identity
same retriever hit    != same semantic entity
same entity candidate != proven same-as
backend independence  != source independence

Cross-backend dedup uses reversible #392/#symbolic-memory#10 identity mappings and #402 source-dependence lineage. A string/hash/embedding match may propose an identity candidate but cannot perform an irreversible merge.

A Reuters-origin article found by web search, a vector index and a local cached copy remains one evidence-dependence component for corroboration pressure.


Freshness / consistency federation

Adapters declare what a result is bound to:

exact SAFIRE cut/frontier
generation/snapshot token
index generation
database transaction/snapshot
HTTP validator/content hash
retrieval timestamp only
unknown

A cross-backend projection reports these separately. It must not convert retrieved_at(now) into source_current(now).

For current-sensitive obligations, stale/unknown freshness is either a gap or a reason to run a freshen lane according to policy.


Authority, privacy and query egress

C adds an interoperability risk not fully captured by B: sending the query itself to a remote backend leaks information.

Therefore each RSC includes egress_class, and remote dispatch is capability/authority checked before query translation leaves the host.

read local memory
    !=
permission to reveal query/entity names to external search

A private project query may use local symbolic/BM25/vector stores while external web search remains blocked. The projection receipt records the resulting unavailable external obligation rather than silently widening network authority.

Returned remote metadata/content is untrusted data and cannot set mandatory, pinned, trust class, source-independence class, identity mapping or host policy.


Repository ownership boundaries

prolog-rlm

  • #381 Retrieval/Evidence Expert: owns semantic obligation DAG, retriever selection, composition algebra, gap detection, explainable strategy and conservative aggregate receipts.
  • #219 retrieval infrastructure: owns backend-neutral primitive adapter operations/capabilities and concrete retriever adapters; it should expose RSC metadata but not decide semantic strategy.
  • #396 semantic_projection: implements the same candidate/closure/receipt semantics for pure in-memory compiled packages, effectively an exact/local RSC adapter where applicable.
  • #395 conformance: owns cross-retriever semantic-loss/translation-loss/fusion invariants.
  • #176/prompt compiler: consumes only the already-bounded projection/context units. It remains the provider-visible packer/compiler, not retrieval federation.

symbolic-memory

  • #7: local durable semantic query/projection RSC, exact-cut/current/history semantics, external/federated receipt preservation.
  • #9: MCP/native transport of typed QueryIR, candidates, coverage/gap/freshness/fusion receipts without flattening to prose.
  • #10: reversible identity/alignment links and source/entity reconciliation used by federation joins/dedup.
  • #6: durable source/provenance/dependence lineage and canonical records; no storage of disposable global fusion state as truth.

Dependency direction remains symbolic-memory -> prolog-rlm contracts. No second scheduler or authority plane.


Complexity / scaling implications

Let r be selected retrievers, k_i returned candidates per retriever, N=Σk_i, and E the demanded identity/dependency edges traversed.

  • Parallel independent retrieval latency is approximately the maximum selected lane latency plus orchestration overhead, bounded by per-lane deadlines.
  • Naive candidate union/dedupe is O(N) expected with keyed maps where identity is exact; uncertain identity may require bounded mapping lookups/graph traversal rather than all-pairs comparison.
  • RRF over already ranked lists is O(N) accumulation plus deterministic sort O(U log U) for U unique candidate identities.
  • Cross-source joins can dominate cost and may degenerate toward product-size behavior without keys/source selection. FedX-style source selection and bound joins/grouping are the relevant optimization family; D owns exact realization.
  • Mandatory semantic closure remains proportional to the visited dependency subgraph, with explicit resource limits.
  • Remote endpoints require bounded concurrency, pagination/cursor limits, deadlines and result-byte ceilings.
  • Query translation/capability matching should occur before expensive calls so unsupported retrievers are rejected cheaply.

C deliberately does not freeze index/cache structures or adaptive optimizer algorithms; those are #403D.


Epistemic / provenance implications

Every final projection must be able to answer:

  • which obligation caused each backend call;
  • which QueryIR translator/version produced the native request;
  • what constraints were preserved/weakened/unsupported;
  • which backend/version/index/snapshot produced each candidate;
  • which fusion/composition operator admitted it to the periphery;
  • whether it was subsequently canonicalized/admitted;
  • what source-origin/dependence component it belongs to;
  • what backend coverage/freshness/threat claims were actually available;
  • which hard obligations remain unmet.

A fusion explanation is selection provenance, not an epistemic proof. Warrant still comes from #394/profile reasoning over admitted evidence and justifications.


Adversarial review / failure cases

  1. Score laundering: vector cosine .98 must not dominate exact negative evidence because it looks numerically larger.
  2. Normalizer drift: changing BM25/vector normalization parameters cannot silently reuse an old fusion receipt.
  3. Approximate-as-exhaustive: ANN no-hit cannot prove absence unless a stronger declared contract provides that guarantee.
  4. Post-filter trap: vector top-k followed by a hard filter can miss valid filtered neighbors; receipt must distinguish native-filter semantics from post-filter approximation.
  5. Remote partial failure: successful local lanes cannot erase an unavailable required remote/opposition lane.
  6. Backend-collusion illusion: three retrievers indexing the same upstream source do not become three corroborating origins.
  7. Identity collision: same label/URL/hash cannot silently unify incompatible records.
  8. Stale remote cache: retrieval timestamp cannot masquerade as source validity/currentness.
  9. Query leakage: a private entity/goal cannot be sent to web search because local read authority exists.
  10. Threat-claim laundering: one certified retriever cannot confer its robustness certificate on uncertified fused lanes.
  11. SERVICE/federation injection: endpoint identifiers/native queries are trusted-adapter outputs, not arbitrary source/model executable strings.
  12. Fusion starvation: low-ranked mandatory opposition/defeater evidence cannot be removed by top-k fusion.
  13. Endpoint lies: remote source capability metadata is not automatically trusted; locally configured adapter/profile owns contract claims or marks them unverified.
  14. Pagination ambiguity: first page empty/short does not mean source exhaustive unless endpoint contract says so.
  15. Model bailout: unavailable federation lanes produce structured gaps, not implicit model-generated replacement evidence.

Rejected alternatives

  • Universal score/confidence field: rejected; incomparable semantics and epistemic laundering.
  • One global normalized schema that erases backend capabilities: rejected; interoperability needs contracts + mappings, not flattening.
  • RRF as truth/warrant: rejected; it is only soft rank fusion.
  • “query every backend always”: rejected; authority/privacy/cost and source-selection concerns.
  • Remote result automatically becomes durable memory: rejected; admission/persistence boundary remains explicit.
  • Global irreversible dedup on hashes/strings: rejected; identity/source lineage is contextual and reversible.
  • Whole-projection robustness boolean: rejected; threat claims are scoped unless composition is proven.
  • Adapter-owned orchestration: rejected; #381 owns strategy, adapters own mechanics.
  • Prompt compiler as federated retriever: rejected; #176 receives bounded context units after semantic retrieval/projection.

Falsifiable C conformance fixtures

  1. Exact symbolic + BM25 return same record; one canonical candidate, two sensor receipts, one source origin.
  2. BM25 score 20 and cosine .9 are preserved typed; no cross-sort without explicit fusion profile.
  3. RRF produces deterministic same ordering from fixed rank lists independent of raw score scales.
  4. RRF score cannot satisfy truth/warrant field.
  5. Exact counterevidence remains mandatory even if absent from fused top-k periphery.
  6. ANN no-hit returns approximate/heuristic coverage, never explicit false.
  7. Exact declared-fragment no-hit may satisfy only that fragment’s absence obligation.
  8. Vector backend lacking temporal pushdown emits post_filter/weakened receipt.
  9. Hard temporal obligation rejects backend if neither pushdown nor sound host filter can enforce it.
  10. Lexical→vector cascade avoids vector call when exact/lexical evidence closes obligation.
  11. Gap after lexical triggers vector lane under profile and records reason.
  12. Graph→symbolic refine uses typed IDs, not label equality.
  13. SPARQL/structured remote join preserves endpoint/source lineage.
  14. Remote endpoint timeout yields partial_backend and named unsatisfied obligation.
  15. Optional remote timeout does not invalidate locally closed support obligation but remains visible.
  16. Required opposition endpoint timeout prevents claim of opposition completeness.
  17. Three backends returning one syndicated article count as one dependence component.
  18. Two independently originated records discovered by one backend remain two origins.
  19. Same display name with different_from mapping stays separate across fusion.
  20. Retracted identity link changes canonical join result and invalidates prior projection receipt.
  21. Local result bound to SAFIRE cut cannot be replaced by stale cached index hit from another generation.
  22. External retrieved_at without source validator remains freshness unknown.
  23. Current-sensitive query creates freshen gap for freshness-unknown external result.
  24. Remote query dispatch denied by egress policy performs zero network call.
  25. Denied external lane cannot be replaced by wider authority during fallback.
  26. Backend metadata saying trusted=true has no authority/trust effect.
  27. Certified retriever + uncertified retriever yields scoped robustness claims, not global certified.
  28. Changed adapter/translator version invalidates old translation/fusion receipt.
  29. Unsupported QueryIR constraint is reported, not silently omitted.
  30. Post-filter ANN fixture demonstrates why filtered top-k coverage differs from exact filtered search.
  31. Duplicate pagination cursor/retry is idempotent at candidate identity level.
  32. Endpoint fork/change produces distinct content/version provenance rather than silent overwrite.
  33. Pure #396 in-memory projection and symbolic-memory #7 local adapter produce equivalent semantics for the same exact admitted package/query profile.
  34. MCP/native #9 transport preserves typed scores/coverage/gaps rather than serializing only ranked text.
  35. External candidate cannot become durable canonical record without explicit semantic admission/persistence path.
  36. Query with only known local symbolic facts completes with every external/vector provider disabled and model_calls = 0.
  37. Heterogeneous local symbolic + lexical + graph expert cooperation executes with model_calls = 0.
  38. Fixed QueryIR/contracts/backend fixtures replay to identical obligation plan, fusion ordering, receipts and gaps.

Concrete canonical changes from C

  1. #403 status becomes A+B+C COMPLETE / D NEXT; retain TAPS and OATH-TAPS, add MOSAIC-TAPS as the C interoperability layer.
  2. #397 must advance only to #403D, not #404.
  3. #381 should own RSC-aware obligation planning/composition algebra and conservative aggregate receipts; backend adapters remain sensors.
  4. #396 should expose/consume the same RSC/candidate/translation/coverage shapes for in-memory semantic packages.
  5. #395 should add cross-adapter translation/fusion loss conformance.
  6. symbolic-memory #7/#9 should preserve backend-local score semantics, cuts/freshness, translation/fusion receipts and unsatisfied obligations.
  7. symbolic-memory #10 remains the identity/alignment source for cross-backend joins/dedup; retrieval similarity is only candidate evidence.
  8. #219 should expose adapter capability/RSC metadata but must not absorb #381 strategy authority.

Unresolved — reserved for #403D

  • physical representation and indexing of RSC/candidate/receipt caches;
  • optimal demanded source-selection algorithms and statistics;
  • incremental invalidation when adapter/index/embedding/mapping/freshness generations change;
  • exact RRF/fusion cache key/fingerprint and deterministic tie-breaking implementation;
  • concurrency/cancellation semantics across many remote lanes;
  • backpressure/pagination and byte/result budgets;
  • join-order optimization and whether to adopt FedX-like bound joins/grouping;
  • empirical thresholds for switching exact→lexical→graph→ANN/external;
  • million/billion-record benchmarks and adversarial heterogeneous corpus conformance;
  • deterministic replay of asynchronous backend completion order;
  • differential test oracle comparing incremental/cached/federated result against cold full execution.

C design completion is not implementation or Machine Spirit acceptance. #403D is the only legal next subpass.

## MACHINE-SPIRIT #403C — composition / heterogeneity / interoperability **Status:** C COMPLETE. This is the third distinct subpass for Depth 6. A=TAPS foundations; B=OATH-TAPS adversarial exposure semantics; C addresses composition of heterogeneous retrieval systems without pretending their scores, coverage, freshness, trust, robustness, identity or authority semantics are interchangeable. D remains required before Depth 6 can close. ### Research questions / scope 1. How can local symbolic indexes, lexical/BM25 engines, ANN/vector stores, graph/PPR stores, case retrieval, remote SAFIRE/CLFM ledgers, SPARQL/federated structured sources, web search and external databases participate in one bounded semantic projection without a universal fake score? 2. How are QueryIR obligations translated into backend-native requests while preserving unsupported/lost constraints explicitly? 3. How are candidate identity, source independence, freshness, namespace/authority, coverage and threat-model guarantees carried across adapters? 4. What fusion/composition operators are safe when score spaces are incomparable or only rank order is meaningful? 5. How do remote/external candidates become admissible semantic evidence without bypassing #392/#394/#402 provenance and admission semantics? 6. Which guarantees compose, which weaken, and which must stay scoped to one retriever? 7. Where do orchestration, adapter mechanics, durable storage and provider-context packing belong across #219/#381/#396/symbolic-memory? ### Primary sources / mechanisms checked - Maurizio Lenzerini, **“Data Integration: A Theoretical Perspective,” PODS 2002**, DOI 10.1145/543613.543644. Formal data-integration framing: sources and global schema are related by explicit mappings; query answering depends on those mappings rather than assuming source schemas are identical. - W3C, **SPARQL 1.1 Federated Query**, Recommendation **2013-03-21**, https://www.w3.org/TR/sparql11-federated-query/. `SERVICE` gives explicit remote subquery boundaries and defined failure behavior; federation does not require one physical store. - Andreas Schwarte et al., **“FedX: Optimization Techniques for Federated Query Processing on Linked Data,” ISWC 2011**, DOI 10.1007/978-3-642-25073-6_38. Mechanisms include source selection, request grouping and join processing to avoid blindly querying every endpoint. - Ronald Fagin, Amnon Lotem, Moni Naor, **“Optimal Aggregation Algorithms for Middleware,” PODS 2001 / JCSS 2003**, DOI 10.1016/S0022-0000(03)00026-6. Threshold-style aggregation has strong instance-optimality results for monotone aggregation under stated sorted/random access assumptions. Those assumptions matter: the theorem does not authorize arbitrary fusion of semantically unrelated scores. - Gordon Cormack, Charles Clarke, Stefan Büttcher, **“Reciprocal Rank Fusion Outperforms Condorcet and Individual Rank Learning Methods,” SIGIR 2009**, DOI 10.1145/1571941.1572114. RRF combines rank positions without requiring cross-system score calibration; useful for soft candidate fusion, not epistemic warrant. - Yu. A. Malkov, D. A. Yashunin, **“Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World Graphs,” TPAMI, online 2018 / vol. 42 2020**, DOI 10.1109/TPAMI.2018.2889473. HNSW is explicitly approximate and exposes an efficiency/recall tradeoff; ANN candidate coverage cannot be mislabeled exhaustive. - Erik Bernhardsson et al., **“ANN-Benchmarks,” Information Systems 87 (2020)**, DOI 10.1016/j.is.2019.02.006. ANN quality is implementation/dataset/parameter dependent and benchmarked by recall/performance tradeoffs, reinforcing that a vector backend’s local score is not a universal completeness certificate. - Jennie Duggan et al., **“The BigDAWG Polystore System,” SIGMOD Record 2015**. Polystore/island architecture is a useful systems analogue: preserve native engines/data models and cross boundaries explicitly rather than forcing all semantics into one lowest-common-denominator engine. Current repository evidence also matters. `rlm_conversation_warm.pl` currently ranks warm artifacts with one local weighted score and marks a unit mandatory from trusted `pinned` signals; `rlm_prompt_compiler.pl` performs bounded candidate narrowing, dependency closure and final packing through the canonical context-budget solver. Approved RLM-RESEARCH-011 already says retrieval metadata is adversarial evidence, mandatory dependencies precede packing, and selection is not authorization. #381 keeps retrieval strategy in the Retrieval Expert; #396 owns pure in-memory semantic projection; symbolic-memory #7/#9 own durable query/projection and transport surfaces. C must compose these rather than introduce another scheduler or token packer. --- ## Finding 1 — a normalized result envelope is necessary; a normalized score is not The central interoperability invariant is: ```text backend result envelope compatibility != backend score comparability ``` BM25 score, cosine/dot-product similarity, graph activation/PageRank, case similarity, exact symbolic match, SPARQL binding, external search rank and a remote ledger query are different observables with different semantics. Therefore this design explicitly rejects a generic contract such as: ```prolog hit(Id, UniversalScore0to1). ``` Normalizing each backend to `[0,1]` changes numerical range, not meaning or calibration. It also hides exact-vs-approximate coverage and makes future explanations lie about why a result was selected. ### Preferred backend contract: Retrieval Semantic Contract (RSC) Each retriever exposes a versioned, inspectable contract approximately equivalent to: ```prolog retrieval_contract( RetrieverId, Version, capability{ query_classes: QueryClasses, source_scope: SourceScope, identity_domain: IdentityDomain, result_semantics: ResultSemantics, ordering: OrderingSemantics, coverage: CoverageSemantics, freshness: FreshnessSemantics, filter_semantics: FilterSemantics, pagination: PaginationSemantics, provenance: ProvenanceSemantics, threat_claims: ThreatClaims, egress_class: EgressClass }). ``` Examples: ```text ordering = exact_boolean ordering = backend_rank_only ordering = bm25_score(local_parameterization) ordering = vector_similarity(metric, model, dimensions) ordering = graph_activation(algorithm, params) coverage = exhaustive_for(snapshot, declared_fragment) coverage = exact_top_k_for(index_generation) coverage = bounded_structural(radius, edge_classes) coverage = approximate_ann(index, params, empirical_recall_profile) coverage = remote_best_effort coverage = heuristic coverage = unknown ``` A backend may expose stronger machine-checkable guarantees where it genuinely has them. The federation layer preserves those claims instead of upgrading them. --- ## Finding 2 — QueryIR translation needs loss receipts TAPS/OATH-TAPS obligations are semantic, while backends speak different query languages. C therefore inserts a typed translation boundary: ```text trusted QueryIR + obligation ↓ backend capability match ↓ translation ↓ backend-native request + translation receipt ``` Conceptual record: ```prolog retrieval_translation( TranslationId, ObligationId, RetrieverId, QueryIRVersion, NativeQueryDigest, preserved(Preserved), weakened(Weakened), unsupported(Unsupported), pushed_filters(Pushed), post_filters(Post), provenance(Provenance)). ``` Examples of material loss: - a vector store cannot express an exact temporal validity predicate and instead requires post-filtering; - external web search cannot promise namespace-complete search; - lexical search can express phrase/date filters but not a graph path obligation; - a SPARQL endpoint can execute structural joins but may not expose local epistemic-profile semantics; - a remote memory projection may preserve the semantic query but expose only `best_effort` freshness because its exact frontier is unavailable. **Unsupported constraints are never silently dropped.** If an obligation requires a hard predicate and no backend/host post-filter can enforce it, that backend cannot satisfy that obligation. --- ## Candidate architectures ### Candidate A — Universal normalized-score bus All adapters emit `{record, score 0..1}` and the federation sorts globally. **Rejected.** It destroys score meaning, hides exact/approximate coverage, conflates candidate relevance with warrant, is fragile under backend version drift, and cannot express hard obligations/joins/freshness correctly. ### Candidate B — Materialize everything into one canonical local index Import every external source into symbolic-memory, then query only one local world model. **Useful promotion path, rejected as the universal architecture.** Once admitted, local semantic records are ideal for repeated reasoning, exact cuts and provenance. But mandatory materialization is unsuitable for fresh web search, huge remote stores, one-shot APIs, privacy boundaries and remote authoritative data. It also creates synchronization and licensing/storage problems. ### Candidate C — Late-fusion metasearch Issue independent searches and combine ranks, preferably with RRF when scores are not calibrated. **Accepted as a submechanism, insufficient as the architecture.** RRF is a strong deterministic default for *soft peripheral candidate fusion* across ranked lists because it relies on ranks rather than comparable scores. It does not express joins, hard coverage requirements, identity mappings, translation loss, authority, source dependence or backend-specific guarantees. ### Candidate D — Typed mediator/polystore federation with explicit retrieval algebra Preserve native retrievers behind RSC adapters; compile obligations into a bounded plan; compose results with typed operators; canonicalize/revalidate before reasoning; retain per-backend receipts. **Preferred.** Name: **MOSAIC-TAPS — Mediated Obligation-Safe Attention & Interoperability Contracts for TAPS**. --- ## Preferred design — MOSAIC-TAPS ```text trusted QueryIR + TAPS/OATH attention profile + exact local SAFIRE cut where applicable ↓ Retrieval Expert (#381) ↓ obligation DAG ↓ RSC capability/source selection ↓ loss-aware QueryIR translators ↓ ┌ exact/symbolic ──────┐ ├ lexical/BM25 ────────┤ ├ graph/PPR ───────────┤ ├ ANN/vector ──────────┤ ├ case retrieval ──────┤ ├ remote memory/ledger ┤ ├ SPARQL/database ─────┤ └ external/web ────────┘ ↓ typed candidate envelopes + backend receipts ↓ identity/source-dependence reconciliation ↓ composition algebra ↓ canonical local revalidation OR typed external observation/admission ↓ mandatory semantic support/opposition closure ↓ soft bounded packing ↓ projection + federated receipt + gaps ``` ### Candidate envelope ```prolog retrieval_candidate( CandidateId, RetrieverId, NativeRef, CandidateKind, RankInfo, CanonicalRef, SourceOrigin, IdentityState, FreshnessState, CoverageRef, TranslationRef, ThreatClaims, Provenance). ``` `RankInfo` is typed, e.g. `rank(7)`, `bm25(12.3, Params)`, `cosine(0.82, EmbeddingModel)`, `exact_match`, not one universal float. ### Composition algebra The coordinator owns typed plan composition, not adapters: ```text union — broaden candidate exposure cascade — cheap retriever first; invoke expensive lane only on gap fallback — use B only if A is unavailable/insufficient under policy intersect — require compatible identity across result sets join — explicit mapping/key relation; may require remote subqueries refine — candidate set from A becomes constrained request to B corroborate — seek independent origins, NOT independent retrievers oppose — run counterevidence/defeater lane freshen — require newer/current source class ``` Each operator has typed preconditions. `join` cannot silently equate backend-local IDs. `corroborate` operates on origin/dependence components from #402/#10, not number of retrievers returning a row. --- ## Rank fusion policy When the goal is only to prioritize the **soft periphery**, and input systems expose rank but no calibrated common score, use deterministic **RRF** as the default fusion candidate. ```text fusion score = Σ 1/(k + rank_i) ``` This is explicitly marked `selection_score`, never `confidence`, `truth`, `warrant` or `source_quality`. Calibrated/weighted score fusion is permitted only under a named fusion profile that declares compatible score semantics/calibration and versions. Fagin-style threshold algorithms are admissible only when their required monotone aggregation/access assumptions actually hold. The existence of TA’s optimality theorem does not make arbitrary BM25+cosine+trust aggregation sound. Hard lanes bypass soft fusion where necessary. Example: an exact `different_from(A,B)` counterexample required by an identity-sensitive query cannot be discarded because an RRF score is low. --- ## Coverage and robustness compose conservatively There is no single federated `complete=true` and no `robust=true`. A federated receipt should preserve a vector of scoped claims: ```prolog federated_coverage{ support: ..., opposition: ..., freshness: ..., identity: ..., source_independence: ..., backend_receipts: [...], unsatisfied_obligations: [...] }. ``` If local exact symbolic lookup is exhaustive for a declared namespace but the required external-source lane is unavailable, the combined query is not globally exhaustive. If an ANN lane is approximate, its contribution remains approximate even if the lexical lane is exact. Threat/robustness claims are **namespaced proof obligations**: ```text backend V certified against threat model T != whole projection certified against T ``` Combining a certified retriever with an uncertified web/vector lane invalidates any attempt to claim the *whole* exposure set has the certified property unless a separate composition proof exists. --- ## External evidence admission boundary A remote web/search/API result must not acquire local canonical status merely because a retriever returned it. ```text external candidate ↓ source fetch/record observation ↓ provenance + content/version identity ↓ semantic compile/normalize where needed (#388/#392) ↓ local admission/epistemic handling (#394/#402) ↓ canonical record/ref ``` For a one-shot query, the runtime may reason over an explicitly typed `external_observation_candidate` if the selected epistemic profile allows it, but its status must remain external/uncommitted. Durable reuse belongs in symbolic-memory and cannot be smuggled through retrieval. Local symbolic-memory candidates, by contrast, must revalidate against the requested ledger cut/generations before entering mandatory closure. --- ## Identity and source-independence interoperability Hard distinctions: ```text same URL string != same source origin same content hash != same event/assertion identity same retriever hit != same semantic entity same entity candidate != proven same-as backend independence != source independence ``` Cross-backend dedup uses reversible #392/#symbolic-memory#10 identity mappings and #402 source-dependence lineage. A string/hash/embedding match may propose an identity candidate but cannot perform an irreversible merge. A Reuters-origin article found by web search, a vector index and a local cached copy remains one evidence-dependence component for corroboration pressure. --- ## Freshness / consistency federation Adapters declare what a result is bound to: ```text exact SAFIRE cut/frontier generation/snapshot token index generation database transaction/snapshot HTTP validator/content hash retrieval timestamp only unknown ``` A cross-backend projection reports these separately. It must not convert `retrieved_at(now)` into `source_current(now)`. For current-sensitive obligations, stale/unknown freshness is either a gap or a reason to run a `freshen` lane according to policy. --- ## Authority, privacy and query egress C adds an interoperability risk not fully captured by B: **sending the query itself to a remote backend leaks information**. Therefore each RSC includes `egress_class`, and remote dispatch is capability/authority checked before query translation leaves the host. ```text read local memory != permission to reveal query/entity names to external search ``` A private project query may use local symbolic/BM25/vector stores while external web search remains blocked. The projection receipt records the resulting unavailable external obligation rather than silently widening network authority. Returned remote metadata/content is untrusted data and cannot set `mandatory`, `pinned`, trust class, source-independence class, identity mapping or host policy. --- ## Repository ownership boundaries ### `prolog-rlm` - **#381 Retrieval/Evidence Expert:** owns semantic obligation DAG, retriever selection, composition algebra, gap detection, explainable strategy and conservative aggregate receipts. - **#219 retrieval infrastructure:** owns backend-neutral primitive adapter operations/capabilities and concrete retriever adapters; it should expose RSC metadata but not decide semantic strategy. - **#396 semantic_projection:** implements the same candidate/closure/receipt semantics for pure in-memory compiled packages, effectively an exact/local RSC adapter where applicable. - **#395 conformance:** owns cross-retriever semantic-loss/translation-loss/fusion invariants. - **#176/prompt compiler:** consumes only the already-bounded projection/context units. It remains the provider-visible packer/compiler, not retrieval federation. ### `symbolic-memory` - **#7:** local durable semantic query/projection RSC, exact-cut/current/history semantics, external/federated receipt preservation. - **#9:** MCP/native transport of typed QueryIR, candidates, coverage/gap/freshness/fusion receipts without flattening to prose. - **#10:** reversible identity/alignment links and source/entity reconciliation used by federation joins/dedup. - **#6:** durable source/provenance/dependence lineage and canonical records; no storage of disposable global fusion state as truth. Dependency direction remains symbolic-memory -> prolog-rlm contracts. No second scheduler or authority plane. --- ## Complexity / scaling implications Let `r` be selected retrievers, `k_i` returned candidates per retriever, `N=Σk_i`, and `E` the demanded identity/dependency edges traversed. - Parallel independent retrieval latency is approximately the maximum selected lane latency plus orchestration overhead, bounded by per-lane deadlines. - Naive candidate union/dedupe is O(N) expected with keyed maps where identity is exact; uncertain identity may require bounded mapping lookups/graph traversal rather than all-pairs comparison. - RRF over already ranked lists is O(N) accumulation plus deterministic sort O(U log U) for `U` unique candidate identities. - Cross-source joins can dominate cost and may degenerate toward product-size behavior without keys/source selection. FedX-style source selection and bound joins/grouping are the relevant optimization family; D owns exact realization. - Mandatory semantic closure remains proportional to the visited dependency subgraph, with explicit resource limits. - Remote endpoints require bounded concurrency, pagination/cursor limits, deadlines and result-byte ceilings. - Query translation/capability matching should occur before expensive calls so unsupported retrievers are rejected cheaply. C deliberately does **not** freeze index/cache structures or adaptive optimizer algorithms; those are #403D. --- ## Epistemic / provenance implications Every final projection must be able to answer: - which obligation caused each backend call; - which QueryIR translator/version produced the native request; - what constraints were preserved/weakened/unsupported; - which backend/version/index/snapshot produced each candidate; - which fusion/composition operator admitted it to the periphery; - whether it was subsequently canonicalized/admitted; - what source-origin/dependence component it belongs to; - what backend coverage/freshness/threat claims were actually available; - which hard obligations remain unmet. A fusion explanation is selection provenance, not an epistemic proof. Warrant still comes from #394/profile reasoning over admitted evidence and justifications. --- ## Adversarial review / failure cases 1. **Score laundering:** vector cosine `.98` must not dominate exact negative evidence because it looks numerically larger. 2. **Normalizer drift:** changing BM25/vector normalization parameters cannot silently reuse an old fusion receipt. 3. **Approximate-as-exhaustive:** ANN no-hit cannot prove absence unless a stronger declared contract provides that guarantee. 4. **Post-filter trap:** vector top-k followed by a hard filter can miss valid filtered neighbors; receipt must distinguish native-filter semantics from post-filter approximation. 5. **Remote partial failure:** successful local lanes cannot erase an unavailable required remote/opposition lane. 6. **Backend-collusion illusion:** three retrievers indexing the same upstream source do not become three corroborating origins. 7. **Identity collision:** same label/URL/hash cannot silently unify incompatible records. 8. **Stale remote cache:** retrieval timestamp cannot masquerade as source validity/currentness. 9. **Query leakage:** a private entity/goal cannot be sent to web search because local read authority exists. 10. **Threat-claim laundering:** one certified retriever cannot confer its robustness certificate on uncertified fused lanes. 11. **SERVICE/federation injection:** endpoint identifiers/native queries are trusted-adapter outputs, not arbitrary source/model executable strings. 12. **Fusion starvation:** low-ranked mandatory opposition/defeater evidence cannot be removed by top-k fusion. 13. **Endpoint lies:** remote source capability metadata is not automatically trusted; locally configured adapter/profile owns contract claims or marks them unverified. 14. **Pagination ambiguity:** first page empty/short does not mean source exhaustive unless endpoint contract says so. 15. **Model bailout:** unavailable federation lanes produce structured gaps, not implicit model-generated replacement evidence. --- ## Rejected alternatives - Universal score/confidence field: rejected; incomparable semantics and epistemic laundering. - One global normalized schema that erases backend capabilities: rejected; interoperability needs contracts + mappings, not flattening. - RRF as truth/warrant: rejected; it is only soft rank fusion. - “query every backend always”: rejected; authority/privacy/cost and source-selection concerns. - Remote result automatically becomes durable memory: rejected; admission/persistence boundary remains explicit. - Global irreversible dedup on hashes/strings: rejected; identity/source lineage is contextual and reversible. - Whole-projection robustness boolean: rejected; threat claims are scoped unless composition is proven. - Adapter-owned orchestration: rejected; #381 owns strategy, adapters own mechanics. - Prompt compiler as federated retriever: rejected; #176 receives bounded context units after semantic retrieval/projection. --- ## Falsifiable C conformance fixtures 1. Exact symbolic + BM25 return same record; one canonical candidate, two sensor receipts, one source origin. 2. BM25 score `20` and cosine `.9` are preserved typed; no cross-sort without explicit fusion profile. 3. RRF produces deterministic same ordering from fixed rank lists independent of raw score scales. 4. RRF score cannot satisfy truth/warrant field. 5. Exact counterevidence remains mandatory even if absent from fused top-k periphery. 6. ANN no-hit returns approximate/heuristic coverage, never explicit false. 7. Exact declared-fragment no-hit may satisfy only that fragment’s absence obligation. 8. Vector backend lacking temporal pushdown emits `post_filter`/weakened receipt. 9. Hard temporal obligation rejects backend if neither pushdown nor sound host filter can enforce it. 10. Lexical→vector cascade avoids vector call when exact/lexical evidence closes obligation. 11. Gap after lexical triggers vector lane under profile and records reason. 12. Graph→symbolic refine uses typed IDs, not label equality. 13. SPARQL/structured remote join preserves endpoint/source lineage. 14. Remote endpoint timeout yields `partial_backend` and named unsatisfied obligation. 15. Optional remote timeout does not invalidate locally closed support obligation but remains visible. 16. Required opposition endpoint timeout prevents claim of opposition completeness. 17. Three backends returning one syndicated article count as one dependence component. 18. Two independently originated records discovered by one backend remain two origins. 19. Same display name with `different_from` mapping stays separate across fusion. 20. Retracted identity link changes canonical join result and invalidates prior projection receipt. 21. Local result bound to SAFIRE cut cannot be replaced by stale cached index hit from another generation. 22. External `retrieved_at` without source validator remains freshness unknown. 23. Current-sensitive query creates freshen gap for freshness-unknown external result. 24. Remote query dispatch denied by egress policy performs zero network call. 25. Denied external lane cannot be replaced by wider authority during fallback. 26. Backend metadata saying `trusted=true` has no authority/trust effect. 27. Certified retriever + uncertified retriever yields scoped robustness claims, not global certified. 28. Changed adapter/translator version invalidates old translation/fusion receipt. 29. Unsupported QueryIR constraint is reported, not silently omitted. 30. Post-filter ANN fixture demonstrates why filtered top-k coverage differs from exact filtered search. 31. Duplicate pagination cursor/retry is idempotent at candidate identity level. 32. Endpoint fork/change produces distinct content/version provenance rather than silent overwrite. 33. Pure #396 in-memory projection and symbolic-memory #7 local adapter produce equivalent semantics for the same exact admitted package/query profile. 34. MCP/native #9 transport preserves typed scores/coverage/gaps rather than serializing only ranked text. 35. External candidate cannot become durable canonical record without explicit semantic admission/persistence path. 36. Query with only known local symbolic facts completes with every external/vector provider disabled and `model_calls = 0`. 37. Heterogeneous local symbolic + lexical + graph expert cooperation executes with `model_calls = 0`. 38. Fixed QueryIR/contracts/backend fixtures replay to identical obligation plan, fusion ordering, receipts and gaps. --- ## Concrete canonical changes from C 1. #403 status becomes **A+B+C COMPLETE / D NEXT**; retain TAPS and OATH-TAPS, add MOSAIC-TAPS as the C interoperability layer. 2. #397 must advance only to **#403D**, not #404. 3. #381 should own RSC-aware obligation planning/composition algebra and conservative aggregate receipts; backend adapters remain sensors. 4. #396 should expose/consume the same RSC/candidate/translation/coverage shapes for in-memory semantic packages. 5. #395 should add cross-adapter translation/fusion loss conformance. 6. symbolic-memory #7/#9 should preserve backend-local score semantics, cuts/freshness, translation/fusion receipts and unsatisfied obligations. 7. symbolic-memory #10 remains the identity/alignment source for cross-backend joins/dedup; retrieval similarity is only candidate evidence. 8. #219 should expose adapter capability/RSC metadata but must not absorb #381 strategy authority. ### Unresolved — reserved for #403D - physical representation and indexing of RSC/candidate/receipt caches; - optimal demanded source-selection algorithms and statistics; - incremental invalidation when adapter/index/embedding/mapping/freshness generations change; - exact RRF/fusion cache key/fingerprint and deterministic tie-breaking implementation; - concurrency/cancellation semantics across many remote lanes; - backpressure/pagination and byte/result budgets; - join-order optimization and whether to adopt FedX-like bound joins/grouping; - empirical thresholds for switching exact→lexical→graph→ANN/external; - million/billion-record benchmarks and adversarial heterogeneous corpus conformance; - deterministic replay of asynchronous backend completion order; - differential test oracle comparing incremental/cached/federated result against cold full execution. **C design completion is not implementation or Machine Spirit acceptance. #403D is the only legal next subpass.**
Author
Owner

Machine Spirit #403D — computational realization / scaling / deterministic conformance

Status: D COMPLETE. Depth 6 A/B/C/D is now coherent for design reconciliation. This is design completion only; implementation and Machine Spirit acceptance remain unproven.

Scope / research questions

This pass makes TAPS + OATH-TAPS + MOSAIC-TAPS computational rather than restating their semantics.

Questions:

  1. How should obligation-driven heterogeneous retrieval be planned physically without weakening the logical/epistemic contract?
  2. Which caches/indexes are safe, what fingerprints them, and exactly what invalidates them?
  3. How can asynchronous local/remote retrieval remain deterministic under completion-order changes, cancellation, pagination, timeout and backpressure?
  4. When may cost/cardinality statistics alter execution without altering semantic outcome?
  5. How do hard filters interact with approximate/vector retrieval without turning post-filtered ANN into a false completeness claim?
  6. How should ranked fusion, joins and adaptive source selection stop early while preserving coverage/obligation semantics?
  7. What differential/failure-injection fixtures are required before million/billion-record claims are believable?

Consumes #400 EQP, #401 DPEC, #402 SAFIRE, #381, #395/#396 and symbolic-memory #6/#7/#9/#10. It does not redesign persistence, epistemics, semantic parsing, or the one canonical scheduler/runtime.

Primary evidence

  • Goetz Graefe, “The Cascades Framework for Query Optimization,” IEEE Data Engineering Bulletin 18(3), 1995, pp.19–29. Cascades separates logical/physical alternatives, memoizes search, and supports extensible transformations/enforcers/costing. https://www.sigmod.org/publications/dblp/db/journals/debu/Graefe95a.html
  • Ron Avnur & Joseph M. Hellerstein, “Eddies: Continuously Adaptive Query Processing” / “Continuous Query Optimization,” Berkeley tech report UCB/CSD-99-1078 (1999), SIGMOD 2000. Eddies merge optimization/execution and adapt routing to changing runtime conditions; useful here only below a fixed semantic contract. https://www2.eecs.berkeley.edu/Pubs/TechRpts/1999/5714.html
  • Ronald Fagin, Amnon Lotem & Moni Naor, “Optimal Aggregation Algorithms for Middleware,” PODS 2001 / JCSS 2003. Threshold Algorithm is instance-optimal under its stated sorted/random-access and monotone-aggregation assumptions; those assumptions must be explicit before using TA-style early stopping. https://research.ibm.com/publications/optimal-aggregation-algorithms-for-middleware
  • Apostol Natsev et al., “Supporting Incremental Join Queries on Ranked Inputs,” VLDB 2001. Ranked inputs can be joined incrementally, including cases without random access; useful precedent for bounded cross-backend joins. https://research.ibm.com/publications/supporting-incremental-join-queries-on-ranked-inputs
  • Mihai Budiu, Tej Chajed, Frank McSherry, Leonid Ryzhyk & Val Tannen, “DBSP: Automatic Incremental View Maintenance for Rich Query Languages,” PVLDB 16(7), 2023, DOI 10.14778/3587136.3587137. Provides a principled incrementalization model for relational/recursive query state; optional optimization, not a mandatory new runtime. https://www.vldb.org/pvldb/vol16/p1601-budiu.pdf
  • Siddharth Gollapudi et al., “Filtered-DiskANN: Graph Algorithms for Approximate Nearest Neighbor Search with Filters,” WWW 2023, DOI 10.1145/3543507.3583552. Native filtered ANN materially differs from naïve ANN-then-postfilter behavior and can achieve high-throughput/high-recall filtered search. This is direct evidence that filter semantics must be part of an ANN RSC rather than hidden after top-k retrieval. https://doi.org/10.1145/3543507.3583552

Current-system comparison

Current rlm_conversation_warm.pl is still a local conversation-context mechanism: it assigns weighted signals, sorts candidates, applies max_candidates, and lets trusted pinned signals make selected warm units mandatory. That is useful precursor machinery but it is not #403 retrieval execution: there is no exact world-model cut, obligation DAG, RSC-aware physical planning, cross-backend translation receipt, support/opposition closure, generation-directed invalidation, or replay classification.

#381 already owns semantic strategy and evidence-gap reasoning. #403D must therefore not create a competing expert. #219 owns primitive backend mechanics. #402/SAFIRE owns durable cuts/cursors/index generations. #176 owns provider-visible packing after retrieval. The D executor is a derived physical plan/receipt layer under #381.

Candidate architectures

Candidate 1 — static Cascades-style federated optimizer

Compile obligations to one physical plan using RSC capabilities, cardinality/cost statistics, join orders, cascades and pushdowns; execute it unchanged.

Pros: deterministic, cacheable, explainable, easy replay.
Cons: remote latency/cardinality/index-selectivity estimates age badly; one stale estimate can make a valid plan catastrophically slow.

Candidate 2 — fully adaptive Eddy-style tuple/candidate routing

Continuously route candidates among retrievers/filters/joins based on observed runtime rates and utility.

Pros: robust under drifting remote latency/selectivity; good for federated sources.
Cons: arrival order can leak into ranking/early-stop decisions; replay and cancellation semantics become harder; unrestricted adaptivity can accidentally alter obligation coverage rather than merely execution order.

Candidate 3 — preferred: RACE-TAPS

Replayable Adaptive Conformance Executor for TAPS: freeze a typed logical obligation/composition plan, optimize a versioned physical plan beneath it, and permit bounded adaptive physical revisions only through explicit conformance-preserving checkpoints/receipts.

QueryIR + profile + authority + exact SAFIRE cut
                ↓
     OATH obligation DAG
 support / oppose / defeater / freshen /
 identity / independent-origin / closure
                ↓
       RSC capability matching
                ↓
      logical composition plan
   (semantic contract is now fixed)
                ↓
  memoized physical alternatives
 exact/index/graph/BM25/ANN/remote
 joins/cascades/fallbacks/pushdowns
                ↓
 deterministic async executor
 page/byte/call/time/work/backpressure bounds
                ↓
 canonical cut revalidation
                ↓
 source-dependence + identity reconciliation
                ↓
 deterministic soft fusion
                ↓
 mandatory semantic closure
                ↓
 projection + gaps + replay/conformance receipt

This is selected.

RACE-TAPS execution contract

1. Logical plan != physical plan

#381 fixes typed obligations and composition semantics. Physical planning may reorder semantically commutative work, choose implementations, choose bind/semi-join direction, alter concurrency, or switch equivalent RSC implementations. It may not drop an obligation, weaken a hard constraint, transform oppose into ordinary union, or upgrade approximate coverage.

Conceptual records:

retrieval_logical_plan(PlanId, QueryRef, Cut, Profile, Obligations,
                       Composition, HardConstraints, BudgetProfile,
                       SemanticFingerprint).

retrieval_physical_plan(PhysicalId, PlanId, RscGeneration,
                        Operators, Dependencies, Estimates,
                        RevisionPolicy, PhysicalFingerprint).

retrieval_plan_revision(RevisionId, PhysicalId, Trigger,
                        OldSubplan, NewSubplan,
                        PreservedContractRefs, Receipt).

A physical revision is legal only when the replacement advertises the required RSC contract or an explicit conservative loss is surfaced to the logical layer as an unsatisfied obligation/gap.

2. RSC registry is indexed derived state

Index RSCs by query class, namespace/source class, hard-filter capability, snapshot/freshness semantics, egress class and result identity domain. Capability matching should be near O(obligations × compatible-RSCs) rather than scanning every backend; registry indexes are rebuildable and fingerprinted by RSC/translator/backend generations.

3. Cost statistics never become epistemic metadata

Maintain versioned observations such as latency distributions, result cardinality/selectivity, bytes/result, timeout rate, ANN recall benchmark profile and cache hit rate. These may select a physical plan. They never alter warrant, trust, source independence or semantic confidence.

Stats drift may legitimately produce a different physical plan while normalized semantic output remains equal.

4. Bounded optimizer

For small join/source sets, memoized dynamic-programming/Cascades-style search is allowed. Join-order search is combinatorial, so larger plans use bounded greedy/bind/semi-join heuristics rather than pretending global optimality.

Push a hard filter into a backend only when the translation receipt says the constraint is preserved. A post-filter can be used for safety narrowing, but cannot retroactively claim the backend searched the filtered domain exhaustively.

5. Filtered ANN has explicit semantics

RSC capability must distinguish at least:

native_prefilter_exact
native_filtered_ann(Profile, RecallContract)
postfilter_only
unsupported

For a hard eligibility predicate, ANN(top_k) -> postfilter may miss eligible neighbors that never entered the unfiltered top-k. Therefore it cannot satisfy an exhaustive_for_declared_fragment obligation and must advertise approximate/heuristic coverage. Filtered-DiskANN-style native filtering may advertise its measured ANN recall profile, still not exact semantic absence.

6. Adaptive execution stays below semantics

Runtime observations may trigger an explicit physical revision, e.g. remote source stalls, cardinality estimate is wrong, or an equivalent local index becomes cheaper. The revision preserves the same obligation DAG and produces a receipt.

Forbidden:

remote source slow
   -> silently drop opposition lane
   -> answer now looks uncontested

Allowed:

remote source slow
   -> replace with contract-compatible source/plan
   OR mark opposition obligation partial/timeout

7. Deterministic asynchronous normalization

Backend work may execute concurrently through the existing runtime. Arrival order is not semantic order.

Normalize candidate identity/order using stable fields such as:

obligation_id
backend/RSC id + version
backend snapshot/index generation
page/cursor sequence
backend-native rank/tie identity
canonical semantic record id after revalidation

Fusion and final packing operate on the normalized candidate multiset at explicit barriers/threshold conditions, not first response wins. Same retained backend observations + same contracts/budgets must normalize identically across scheduler interleavings.

8. Cancellation/backpressure

Each lane has explicit call, page, candidate, byte, CPU/work, wall and in-flight bounds. Backpressure pauses further page acquisition before unbounded buffering.

After canonical cancellation, no new remote/local retrieval dispatch occurs. Late replies are recorded as discarded_after_cancel and cannot enter the projection. Cancellation is not evidence of absence.

9. Snapshot-safe pagination

Cursor identity includes the backend's declared snapshot/index generation where available. If a backend cannot provide snapshot-stable pagination, the RSC says so. Mixing page 1 from generation G with page 2 from G+1 is either a new best-effort lineage or stale_cursor; it cannot masquerade as one exact scan.

10. Fusion is deterministic and soft

RRF remains the score-free default for soft ranking only. Use deterministic tie-breaking over stable candidate IDs. The RRF result remains selection provenance, not confidence/warrant.

Fagin/TA-style threshold stopping is admitted only when the exact monotone aggregation and sorted/random-access assumptions are satisfied by the selected fusion profile. Otherwise no TA optimality/completeness claim is inherited.

11. Cache identity / invalidation

Cache keys depend on material semantics, not just query text. At minimum fingerprint:

normalized QueryIR
obligation DAG + logical composition
exact SAFIRE cut/frontier
context + epistemic profile
attention/risk policy
read + egress policy generation
RSC registry generation
translator versions
backend snapshot/index/embedding generations
identity/mapping generation
source-dependence generation
freshness/time anchor
fusion profile
budget profile
physical executor version

Cache layers may include logical plans, physical plans, backend pages/candidates, reconciliation/fusion results, closure slices and final projections. Invalidation follows actual dependencies. If recomputation of a leaf/subplan produces the same normalized interface digest and coverage receipt, propagation may stop there.

A cache is never authority. Every local semantic hit still revalidates against the requested cut/generation where the RSC requires it.

12. Incremental maintenance

Use direct generation invalidation/delta maintenance first. DBSP/differential-style incrementalization is appropriate only when repeated rich retrieval views justify it empirically. Do not add a universal dataflow runtime merely because DBSP exists.

13. Remote replay classes

retained_response_replay
    exact replay of captured remote observation/artifact

deterministic_local_reexecution
    recompute against identical retained local generations

remote_requery
    new observation lineage; never called exact historical replay

A URL/query string plus timestamp is not sufficient to reproduce mutable remote results.

Typed outcome sketch

attention_execute(+LogicalPlan, +Options, -Outcome).

attention_execution_receipt(
    logical_plan(LogicalRef),
    physical_plan(PhysicalRef),
    revisions(RevisionRefs),
    exact_cut(Cut),
    rsc_generation(RscGen),
    backend_observations(ObservationRefs),
    normalized_candidates(CandidateDigest),
    fusion(FusionReceipt),
    closure(ClosureReceipt),
    support_closure(SupportClosure),
    search_coverage(SearchCoverage),
    opposition_coverage(OppositionCoverage),
    selection_integrity(SelectionIntegrity),
    freshness(Freshness),
    gaps(Gaps),
    budgets(BudgetReceipt),
    replay(ReplayClass),
    model_calls(ModelCalls)).

Complexity / scaling implications

  • indexed RSC matching: proportional to obligations and compatible contracts rather than total backends;
  • exact B-tree/hash lookup remains roughly O(log N + k) / expected O(1+k) backend-dependently;
  • lexical cost tracks postings visited; graph activation tracks bounded visited frontier/iterations;
  • ANN is approximate and benchmark-dependent; hard filtered ANN capability must be measured separately;
  • exhaustive dynamic-programming join ordering is exponential in join count, therefore explicitly bounded;
  • bind/semi-joins reduce remote transfer when selective keys exist but can explode round trips if bound sets are large, so batch/byte/call caps are required;
  • RRF fusion is linear-ish in retrieved list entries plus deterministic ordering bookkeeping;
  • mandatory closure remains O(V_q+E_q) over visited dependency slice, worst-case whole reachable graph;
  • proof/provenance expansion remains lazy/shared DAG material rather than duplicated text;
  • no billion-record latency/throughput claim is accepted without a generated corpus benchmark over the selected physical backend.

Epistemic / provenance implications

Physical-plan choice, cache hit and fast backend response are operational provenance only. They cannot increase epistemic warrant. Every projection receipt must preserve which observations were actually consulted, which required lanes were exhausted/partial, exact source-dependence components, translation losses, backend coverage profiles and the exact cut/generations.

An answer can therefore honestly report:

support closure: closed
support search: exhaustive in local symbolic fragment
opposition search: remote_timeout / partial
ANN discovery: approximate profile X
identity reconciliation: exact mapping generation Y

rather than collapse that into one confidence.

Safety / authority implications

  • query egress authorization is checked before remote dispatch, including adaptive replacement backends;
  • a cached physical plan cannot bypass a newer read/egress policy generation;
  • backend content/control strings remain data and cannot modify the obligation DAG or budgets;
  • remote source selection never grants source trust;
  • retrieved semantic actions remain inert and do not create capability;
  • adaptive execution cannot widen authority, namespaces or egress targets;
  • timing side effects should be minimized by not probing unauthorized backends during cost estimation.

Rejected alternatives

  1. One universal retrieval engine/index. Rejected: loses RSC heterogeneity and creates a false universal score/coverage model.
  2. Fully static physical plan. Rejected as default: federated latency/selectivity drift can be huge.
  3. Fully unconstrained Eddy routing. Rejected: runtime timing could influence semantic coverage/early stopping and harms deterministic replay.
  4. ANN then arbitrary post-filter == filtered search. Rejected: can lose eligible neighbors before filtering and overclaim coverage.
  5. One global cache generation. Rejected: invalidates everything on tiny changes and hides actual dependencies.
  6. Arrival-order fusion. Rejected: scheduler/network timing would change answers.
  7. Remote requery == replay. Rejected: mutable external results are new observations.
  8. Always use DBSP/differential dataflow. Rejected: valuable optional optimization, not justification for a second runtime.

Falsifiable D conformance fixtures

At minimum implement/encode these as deterministic or benchmark fixtures:

  1. exact symbolic known query bypasses ANN/vector/model;
  2. RSC-index pruning does not scan unrelated backends;
  3. hard filter + postfilter-only ANN cannot claim exhaustive coverage;
  4. native filtered-ANN profile preserves declared approximate coverage only;
  5. stale vector-index generation invalidates its candidate cache;
  6. unrelated namespace generation does not invalidate unaffected plan/result;
  7. changed identity mapping invalidates dependent joins only;
  8. changed source-dependence mapping invalidates corroboration/diversity results;
  9. same normalized leaf digest stops upward invalidation where contract permits;
  10. RSC upgrade invalidates affected physical plans;
  11. translator upgrade invalidates affected translation receipts/plans;
  12. cost-stat drift may change physical plan but not normalized semantic result;
  13. wrong cardinality estimate triggers legal adaptive revision;
  14. adaptive revision cannot drop an opposition obligation;
  15. remote timeout returns partial/gap rather than absence;
  16. equivalent fallback backend preserves obligation semantics;
  17. unauthorized egress performs zero remote dispatches;
  18. physical-plan cache cannot bypass new egress/read policy generation;
  19. all permutations of async backend completion normalize identically;
  20. deterministic RRF tie resolves by stable candidate identity;
  21. arrival order cannot change final packed projection;
  22. canonical cancellation prevents subsequent page/backend dispatch;
  23. late reply after cancellation is discarded and cannot affect answer;
  24. page cursor generation drift returns stale/best-effort lineage, not exact scan;
  25. candidate/page/result-byte bounds produce structured resource limit;
  26. byte budget cannot retain a conclusion while dropping mandatory dependencies;
  27. recursive dependency bomb returns closure resource limit;
  28. graph high-degree explosion obeys frontier/hop/work caps;
  29. bind join batches keys and respects remote call/byte caps;
  30. join uses explicit reversible identity mappings, not display-string equality;
  31. two backend hits for one upstream origin remain one dependence component;
  32. orphaned/corrupt index hit fails canonical cut revalidation;
  33. cache-cold == cache-warm for same cut/generations;
  34. cache-drop/rebuild == warm result;
  35. incremental maintenance == full recomputation on normalized result/receipt;
  36. retained remote-response replay reproduces result without network call;
  37. live remote requery creates a new observation lineage;
  38. backend robustness/coverage guarantee cannot be laundered through fusion;
  39. Fagin/TA optimization is rejected when access/monotonicity assumptions fail;
  40. exact local support + approximate ANN lane remains exact only for declared local fragment, not globally;
  41. opposition/freshness lane incompleteness remains visible after otherwise closed support proof;
  42. planner/executor emits an inspectable logical/physical/revision receipt;
  43. scheduler/interleaving changes cannot alter normalized result;
  44. pure known symbolic heterogeneous retrieval runs with providers disabled and model_calls = 0.

Benchmark lane additionally measures million/billion-record synthetic/realistic corpora for exact lookup, graph closure, lexical retrieval, filtered ANN, mixed federation, cold/warm cache, invalidation fanout, provenance expansion and backpressure. Thresholds must be set from actual backend measurements rather than invented in this research pass.

Repository ownership

prolog-rlm owns:

  • #381 obligation/strategy semantics and logical composition;
  • RSC schema/validation and loss-aware planning semantics;
  • RACE-TAPS logical/physical/revision/receipt contract;
  • deterministic normalization/fusion/conformance semantics;
  • pure in-memory #396 projection equivalence;
  • #395 differential/conformance fixtures.

symbolic-memory owns:

  • physical durable semantic indexes/cursors and exact SAFIRE cuts;
  • index/snapshot/embedding generations;
  • projection/candidate cache persistence where useful;
  • large-corpus benchmark/failure injection;
  • source-dependence/identity generations;
  • bounded native/MCP exposure of receipts/gaps.

Backend adapters (#219) own primitive fetch/search mechanics and backend-specific RSC measurements. The existing canonical runtime owns concurrency/cancellation. No second scheduler is introduced.

Unresolved for implementation / later synthesis

  • first concrete cost/statistics schema and how much historical telemetry is worth retaining;
  • DP-vs-greedy join threshold and bind-join batch defaults;
  • empirical exact→lexical→graph→ANN cascade thresholds by workload;
  • first filtered-ANN backend/profile and recall benchmark methodology;
  • whether a compact memo/Cascades implementation belongs in #381 or a reusable physical-plan module;
  • optional DBSP/differential threshold for repeated recursive retrieval views;
  • exact remote response-artifact retention policy for replay/privacy;
  • benchmark-derived page/byte/concurrency defaults;
  • external engines that cannot expose stable snapshots will necessarily remain best-effort for some query classes.

Completion decision: D contributes new computational architecture, scaling and executable conformance requirements. Depth 6 may be reconciled as design-complete, but no implementation/performance/Machine Spirit success is claimed. Exact next legal research work after reconciliation is #404A — meta-reasoning / bounded self-improvement foundations.

## Machine Spirit #403D — computational realization / scaling / deterministic conformance **Status: D COMPLETE. Depth 6 A/B/C/D is now coherent for design reconciliation. This is design completion only; implementation and Machine Spirit acceptance remain unproven.** ### Scope / research questions This pass makes TAPS + OATH-TAPS + MOSAIC-TAPS computational rather than restating their semantics. Questions: 1. How should obligation-driven heterogeneous retrieval be planned physically without weakening the logical/epistemic contract? 2. Which caches/indexes are safe, what fingerprints them, and exactly what invalidates them? 3. How can asynchronous local/remote retrieval remain deterministic under completion-order changes, cancellation, pagination, timeout and backpressure? 4. When may cost/cardinality statistics alter execution without altering semantic outcome? 5. How do hard filters interact with approximate/vector retrieval without turning post-filtered ANN into a false completeness claim? 6. How should ranked fusion, joins and adaptive source selection stop early while preserving coverage/obligation semantics? 7. What differential/failure-injection fixtures are required before million/billion-record claims are believable? Consumes #400 EQP, #401 DPEC, #402 SAFIRE, #381, #395/#396 and symbolic-memory #6/#7/#9/#10. It does not redesign persistence, epistemics, semantic parsing, or the one canonical scheduler/runtime. ### Primary evidence - Goetz Graefe, **“The Cascades Framework for Query Optimization,”** IEEE Data Engineering Bulletin 18(3), 1995, pp.19–29. Cascades separates logical/physical alternatives, memoizes search, and supports extensible transformations/enforcers/costing. https://www.sigmod.org/publications/dblp/db/journals/debu/Graefe95a.html - Ron Avnur & Joseph M. Hellerstein, **“Eddies: Continuously Adaptive Query Processing” / “Continuous Query Optimization,”** Berkeley tech report UCB/CSD-99-1078 (1999), SIGMOD 2000. Eddies merge optimization/execution and adapt routing to changing runtime conditions; useful here only below a fixed semantic contract. https://www2.eecs.berkeley.edu/Pubs/TechRpts/1999/5714.html - Ronald Fagin, Amnon Lotem & Moni Naor, **“Optimal Aggregation Algorithms for Middleware,”** PODS 2001 / JCSS 2003. Threshold Algorithm is instance-optimal under its stated sorted/random-access and monotone-aggregation assumptions; those assumptions must be explicit before using TA-style early stopping. https://research.ibm.com/publications/optimal-aggregation-algorithms-for-middleware - Apostol Natsev et al., **“Supporting Incremental Join Queries on Ranked Inputs,”** VLDB 2001. Ranked inputs can be joined incrementally, including cases without random access; useful precedent for bounded cross-backend joins. https://research.ibm.com/publications/supporting-incremental-join-queries-on-ranked-inputs - Mihai Budiu, Tej Chajed, Frank McSherry, Leonid Ryzhyk & Val Tannen, **“DBSP: Automatic Incremental View Maintenance for Rich Query Languages,”** PVLDB 16(7), 2023, DOI 10.14778/3587136.3587137. Provides a principled incrementalization model for relational/recursive query state; optional optimization, not a mandatory new runtime. https://www.vldb.org/pvldb/vol16/p1601-budiu.pdf - Siddharth Gollapudi et al., **“Filtered-DiskANN: Graph Algorithms for Approximate Nearest Neighbor Search with Filters,”** WWW 2023, DOI 10.1145/3543507.3583552. Native filtered ANN materially differs from naïve ANN-then-postfilter behavior and can achieve high-throughput/high-recall filtered search. This is direct evidence that filter semantics must be part of an ANN RSC rather than hidden after top-k retrieval. https://doi.org/10.1145/3543507.3583552 ### Current-system comparison Current `rlm_conversation_warm.pl` is still a local conversation-context mechanism: it assigns weighted signals, sorts candidates, applies `max_candidates`, and lets trusted `pinned` signals make selected warm units mandatory. That is useful precursor machinery but it is not #403 retrieval execution: there is no exact world-model cut, obligation DAG, RSC-aware physical planning, cross-backend translation receipt, support/opposition closure, generation-directed invalidation, or replay classification. #381 already owns *semantic strategy* and evidence-gap reasoning. #403D must therefore not create a competing expert. #219 owns primitive backend mechanics. #402/SAFIRE owns durable cuts/cursors/index generations. #176 owns provider-visible packing after retrieval. The D executor is a derived physical plan/receipt layer under #381. ### Candidate architectures #### Candidate 1 — static Cascades-style federated optimizer Compile obligations to one physical plan using RSC capabilities, cardinality/cost statistics, join orders, cascades and pushdowns; execute it unchanged. **Pros:** deterministic, cacheable, explainable, easy replay. **Cons:** remote latency/cardinality/index-selectivity estimates age badly; one stale estimate can make a valid plan catastrophically slow. #### Candidate 2 — fully adaptive Eddy-style tuple/candidate routing Continuously route candidates among retrievers/filters/joins based on observed runtime rates and utility. **Pros:** robust under drifting remote latency/selectivity; good for federated sources. **Cons:** arrival order can leak into ranking/early-stop decisions; replay and cancellation semantics become harder; unrestricted adaptivity can accidentally alter obligation coverage rather than merely execution order. #### Candidate 3 — preferred: RACE-TAPS **Replayable Adaptive Conformance Executor for TAPS**: freeze a typed logical obligation/composition plan, optimize a versioned physical plan beneath it, and permit bounded adaptive physical revisions only through explicit conformance-preserving checkpoints/receipts. ```text QueryIR + profile + authority + exact SAFIRE cut ↓ OATH obligation DAG support / oppose / defeater / freshen / identity / independent-origin / closure ↓ RSC capability matching ↓ logical composition plan (semantic contract is now fixed) ↓ memoized physical alternatives exact/index/graph/BM25/ANN/remote joins/cascades/fallbacks/pushdowns ↓ deterministic async executor page/byte/call/time/work/backpressure bounds ↓ canonical cut revalidation ↓ source-dependence + identity reconciliation ↓ deterministic soft fusion ↓ mandatory semantic closure ↓ projection + gaps + replay/conformance receipt ``` This is selected. ### RACE-TAPS execution contract #### 1. Logical plan != physical plan `#381` fixes typed obligations and composition semantics. Physical planning may reorder semantically commutative work, choose implementations, choose bind/semi-join direction, alter concurrency, or switch equivalent RSC implementations. It may **not** drop an obligation, weaken a hard constraint, transform `oppose` into ordinary `union`, or upgrade approximate coverage. Conceptual records: ```prolog retrieval_logical_plan(PlanId, QueryRef, Cut, Profile, Obligations, Composition, HardConstraints, BudgetProfile, SemanticFingerprint). retrieval_physical_plan(PhysicalId, PlanId, RscGeneration, Operators, Dependencies, Estimates, RevisionPolicy, PhysicalFingerprint). retrieval_plan_revision(RevisionId, PhysicalId, Trigger, OldSubplan, NewSubplan, PreservedContractRefs, Receipt). ``` A physical revision is legal only when the replacement advertises the required RSC contract or an explicit conservative loss is surfaced to the logical layer as an unsatisfied obligation/gap. #### 2. RSC registry is indexed derived state Index RSCs by query class, namespace/source class, hard-filter capability, snapshot/freshness semantics, egress class and result identity domain. Capability matching should be near `O(obligations × compatible-RSCs)` rather than scanning every backend; registry indexes are rebuildable and fingerprinted by RSC/translator/backend generations. #### 3. Cost statistics never become epistemic metadata Maintain versioned observations such as latency distributions, result cardinality/selectivity, bytes/result, timeout rate, ANN recall benchmark profile and cache hit rate. These may select a physical plan. They never alter warrant, trust, source independence or semantic confidence. Stats drift may legitimately produce a different physical plan while normalized semantic output remains equal. #### 4. Bounded optimizer For small join/source sets, memoized dynamic-programming/Cascades-style search is allowed. Join-order search is combinatorial, so larger plans use bounded greedy/bind/semi-join heuristics rather than pretending global optimality. Push a hard filter into a backend only when the translation receipt says the constraint is preserved. A post-filter can be used for safety narrowing, but cannot retroactively claim the backend searched the filtered domain exhaustively. #### 5. Filtered ANN has explicit semantics RSC capability must distinguish at least: ```text native_prefilter_exact native_filtered_ann(Profile, RecallContract) postfilter_only unsupported ``` For a hard eligibility predicate, `ANN(top_k) -> postfilter` may miss eligible neighbors that never entered the unfiltered top-k. Therefore it cannot satisfy an `exhaustive_for_declared_fragment` obligation and must advertise approximate/heuristic coverage. Filtered-DiskANN-style native filtering may advertise its measured ANN recall profile, still not exact semantic absence. #### 6. Adaptive execution stays below semantics Runtime observations may trigger an explicit physical revision, e.g. remote source stalls, cardinality estimate is wrong, or an equivalent local index becomes cheaper. The revision preserves the same obligation DAG and produces a receipt. Forbidden: ```text remote source slow -> silently drop opposition lane -> answer now looks uncontested ``` Allowed: ```text remote source slow -> replace with contract-compatible source/plan OR mark opposition obligation partial/timeout ``` #### 7. Deterministic asynchronous normalization Backend work may execute concurrently through the existing runtime. Arrival order is not semantic order. Normalize candidate identity/order using stable fields such as: ```text obligation_id backend/RSC id + version backend snapshot/index generation page/cursor sequence backend-native rank/tie identity canonical semantic record id after revalidation ``` Fusion and final packing operate on the normalized candidate multiset at explicit barriers/threshold conditions, not `first response wins`. Same retained backend observations + same contracts/budgets must normalize identically across scheduler interleavings. #### 8. Cancellation/backpressure Each lane has explicit call, page, candidate, byte, CPU/work, wall and in-flight bounds. Backpressure pauses further page acquisition before unbounded buffering. After canonical cancellation, no new remote/local retrieval dispatch occurs. Late replies are recorded as `discarded_after_cancel` and cannot enter the projection. Cancellation is not evidence of absence. #### 9. Snapshot-safe pagination Cursor identity includes the backend's declared snapshot/index generation where available. If a backend cannot provide snapshot-stable pagination, the RSC says so. Mixing page 1 from generation G with page 2 from G+1 is either a new best-effort lineage or `stale_cursor`; it cannot masquerade as one exact scan. #### 10. Fusion is deterministic and soft RRF remains the score-free default for *soft ranking only*. Use deterministic tie-breaking over stable candidate IDs. The RRF result remains selection provenance, not confidence/warrant. Fagin/TA-style threshold stopping is admitted only when the exact monotone aggregation and sorted/random-access assumptions are satisfied by the selected fusion profile. Otherwise no TA optimality/completeness claim is inherited. #### 11. Cache identity / invalidation Cache keys depend on material semantics, not just query text. At minimum fingerprint: ```text normalized QueryIR obligation DAG + logical composition exact SAFIRE cut/frontier context + epistemic profile attention/risk policy read + egress policy generation RSC registry generation translator versions backend snapshot/index/embedding generations identity/mapping generation source-dependence generation freshness/time anchor fusion profile budget profile physical executor version ``` Cache layers may include logical plans, physical plans, backend pages/candidates, reconciliation/fusion results, closure slices and final projections. Invalidation follows actual dependencies. If recomputation of a leaf/subplan produces the same normalized interface digest and coverage receipt, propagation may stop there. A cache is never authority. Every local semantic hit still revalidates against the requested cut/generation where the RSC requires it. #### 12. Incremental maintenance Use direct generation invalidation/delta maintenance first. DBSP/differential-style incrementalization is appropriate only when repeated rich retrieval views justify it empirically. Do **not** add a universal dataflow runtime merely because DBSP exists. #### 13. Remote replay classes ```text retained_response_replay exact replay of captured remote observation/artifact deterministic_local_reexecution recompute against identical retained local generations remote_requery new observation lineage; never called exact historical replay ``` A URL/query string plus timestamp is not sufficient to reproduce mutable remote results. ### Typed outcome sketch ```prolog attention_execute(+LogicalPlan, +Options, -Outcome). attention_execution_receipt( logical_plan(LogicalRef), physical_plan(PhysicalRef), revisions(RevisionRefs), exact_cut(Cut), rsc_generation(RscGen), backend_observations(ObservationRefs), normalized_candidates(CandidateDigest), fusion(FusionReceipt), closure(ClosureReceipt), support_closure(SupportClosure), search_coverage(SearchCoverage), opposition_coverage(OppositionCoverage), selection_integrity(SelectionIntegrity), freshness(Freshness), gaps(Gaps), budgets(BudgetReceipt), replay(ReplayClass), model_calls(ModelCalls)). ``` ### Complexity / scaling implications - indexed RSC matching: proportional to obligations and compatible contracts rather than total backends; - exact B-tree/hash lookup remains roughly `O(log N + k)` / expected `O(1+k)` backend-dependently; - lexical cost tracks postings visited; graph activation tracks bounded visited frontier/iterations; - ANN is approximate and benchmark-dependent; hard filtered ANN capability must be measured separately; - exhaustive dynamic-programming join ordering is exponential in join count, therefore explicitly bounded; - bind/semi-joins reduce remote transfer when selective keys exist but can explode round trips if bound sets are large, so batch/byte/call caps are required; - RRF fusion is linear-ish in retrieved list entries plus deterministic ordering bookkeeping; - mandatory closure remains `O(V_q+E_q)` over visited dependency slice, worst-case whole reachable graph; - proof/provenance expansion remains lazy/shared DAG material rather than duplicated text; - no billion-record latency/throughput claim is accepted without a generated corpus benchmark over the selected physical backend. ### Epistemic / provenance implications Physical-plan choice, cache hit and fast backend response are operational provenance only. They cannot increase epistemic warrant. Every projection receipt must preserve which observations were actually consulted, which required lanes were exhausted/partial, exact source-dependence components, translation losses, backend coverage profiles and the exact cut/generations. An answer can therefore honestly report: ```text support closure: closed support search: exhaustive in local symbolic fragment opposition search: remote_timeout / partial ANN discovery: approximate profile X identity reconciliation: exact mapping generation Y ``` rather than collapse that into one confidence. ### Safety / authority implications - query egress authorization is checked before remote dispatch, including adaptive replacement backends; - a cached physical plan cannot bypass a newer read/egress policy generation; - backend content/control strings remain data and cannot modify the obligation DAG or budgets; - remote source selection never grants source trust; - retrieved semantic actions remain inert and do not create capability; - adaptive execution cannot widen authority, namespaces or egress targets; - timing side effects should be minimized by not probing unauthorized backends during cost estimation. ### Rejected alternatives 1. **One universal retrieval engine/index.** Rejected: loses RSC heterogeneity and creates a false universal score/coverage model. 2. **Fully static physical plan.** Rejected as default: federated latency/selectivity drift can be huge. 3. **Fully unconstrained Eddy routing.** Rejected: runtime timing could influence semantic coverage/early stopping and harms deterministic replay. 4. **ANN then arbitrary post-filter == filtered search.** Rejected: can lose eligible neighbors before filtering and overclaim coverage. 5. **One global cache generation.** Rejected: invalidates everything on tiny changes and hides actual dependencies. 6. **Arrival-order fusion.** Rejected: scheduler/network timing would change answers. 7. **Remote requery == replay.** Rejected: mutable external results are new observations. 8. **Always use DBSP/differential dataflow.** Rejected: valuable optional optimization, not justification for a second runtime. ### Falsifiable D conformance fixtures At minimum implement/encode these as deterministic or benchmark fixtures: 1. exact symbolic known query bypasses ANN/vector/model; 2. RSC-index pruning does not scan unrelated backends; 3. hard filter + postfilter-only ANN cannot claim exhaustive coverage; 4. native filtered-ANN profile preserves declared approximate coverage only; 5. stale vector-index generation invalidates its candidate cache; 6. unrelated namespace generation does not invalidate unaffected plan/result; 7. changed identity mapping invalidates dependent joins only; 8. changed source-dependence mapping invalidates corroboration/diversity results; 9. same normalized leaf digest stops upward invalidation where contract permits; 10. RSC upgrade invalidates affected physical plans; 11. translator upgrade invalidates affected translation receipts/plans; 12. cost-stat drift may change physical plan but not normalized semantic result; 13. wrong cardinality estimate triggers legal adaptive revision; 14. adaptive revision cannot drop an opposition obligation; 15. remote timeout returns partial/gap rather than absence; 16. equivalent fallback backend preserves obligation semantics; 17. unauthorized egress performs zero remote dispatches; 18. physical-plan cache cannot bypass new egress/read policy generation; 19. all permutations of async backend completion normalize identically; 20. deterministic RRF tie resolves by stable candidate identity; 21. arrival order cannot change final packed projection; 22. canonical cancellation prevents subsequent page/backend dispatch; 23. late reply after cancellation is discarded and cannot affect answer; 24. page cursor generation drift returns stale/best-effort lineage, not exact scan; 25. candidate/page/result-byte bounds produce structured resource limit; 26. byte budget cannot retain a conclusion while dropping mandatory dependencies; 27. recursive dependency bomb returns closure resource limit; 28. graph high-degree explosion obeys frontier/hop/work caps; 29. bind join batches keys and respects remote call/byte caps; 30. join uses explicit reversible identity mappings, not display-string equality; 31. two backend hits for one upstream origin remain one dependence component; 32. orphaned/corrupt index hit fails canonical cut revalidation; 33. cache-cold == cache-warm for same cut/generations; 34. cache-drop/rebuild == warm result; 35. incremental maintenance == full recomputation on normalized result/receipt; 36. retained remote-response replay reproduces result without network call; 37. live remote requery creates a new observation lineage; 38. backend robustness/coverage guarantee cannot be laundered through fusion; 39. Fagin/TA optimization is rejected when access/monotonicity assumptions fail; 40. exact local support + approximate ANN lane remains exact only for declared local fragment, not globally; 41. opposition/freshness lane incompleteness remains visible after otherwise closed support proof; 42. planner/executor emits an inspectable logical/physical/revision receipt; 43. scheduler/interleaving changes cannot alter normalized result; 44. pure known symbolic heterogeneous retrieval runs with providers disabled and `model_calls = 0`. Benchmark lane additionally measures million/billion-record synthetic/realistic corpora for exact lookup, graph closure, lexical retrieval, filtered ANN, mixed federation, cold/warm cache, invalidation fanout, provenance expansion and backpressure. Thresholds must be set from actual backend measurements rather than invented in this research pass. ### Repository ownership **prolog-rlm** owns: - #381 obligation/strategy semantics and logical composition; - RSC schema/validation and loss-aware planning semantics; - RACE-TAPS logical/physical/revision/receipt contract; - deterministic normalization/fusion/conformance semantics; - pure in-memory #396 projection equivalence; - #395 differential/conformance fixtures. **symbolic-memory** owns: - physical durable semantic indexes/cursors and exact SAFIRE cuts; - index/snapshot/embedding generations; - projection/candidate cache persistence where useful; - large-corpus benchmark/failure injection; - source-dependence/identity generations; - bounded native/MCP exposure of receipts/gaps. Backend adapters (#219) own primitive fetch/search mechanics and backend-specific RSC measurements. The existing canonical runtime owns concurrency/cancellation. No second scheduler is introduced. ### Unresolved for implementation / later synthesis - first concrete cost/statistics schema and how much historical telemetry is worth retaining; - DP-vs-greedy join threshold and bind-join batch defaults; - empirical exact→lexical→graph→ANN cascade thresholds by workload; - first filtered-ANN backend/profile and recall benchmark methodology; - whether a compact memo/Cascades implementation belongs in #381 or a reusable physical-plan module; - optional DBSP/differential threshold for repeated recursive retrieval views; - exact remote response-artifact retention policy for replay/privacy; - benchmark-derived page/byte/concurrency defaults; - external engines that cannot expose stable snapshots will necessarily remain best-effort for some query classes. **Completion decision:** D contributes new computational architecture, scaling and executable conformance requirements. Depth 6 may be reconciled as design-complete, but no implementation/performance/Machine Spirit success is claimed. Exact next legal research work after reconciliation is **#404A — meta-reasoning / bounded self-improvement foundations**.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/prolog-rlm#395
No description provided.