[semantic-compiler] Multi-pass semantic induction: discourse, coreference, events, rules, procedures, constraints, and cross-sentence linking #405

Open
opened 2026-09-08 01:29:20 +00:00 by nsaspy · 3 comments
Owner

Parent: #388
Depends on: #392
Research: #397 #399

Goal

Implement the semantic frontend that maps arbitrary prose into candidate instances of the general semantic IR without flattening meaning, discourse commitment, attribution, scope, or pragmatic status into isolated triples/facts.

The compiler must be usable for heterogeneous sources including LLM logs, Wikipedia/encyclopedic prose, news, manuals, scientific papers, chats, issue/PR histories, policies and arbitrary text.

Architecture: evidence-anchored Semantic Compilation Lattice (SCL)

The old conceptual linear checklist remains useful for coverage, but it is not the execution model. Coreference, scope, attribution, event structure, procedure/rule interpretation, temporal attachment and pragmatic phenomena constrain one another.

Use an ephemeral/versioned Semantic Compilation Lattice (SCL) between immutable source text and #392 candidate IR:

immutable source + exact span/token anchors
                 ↓
     deterministic source adapters
                 +
 syntax/morphology / enhanced dependencies
 SRL / frame evidence
 AMR/UCCA-style graph evidence
 DRS/MRS-style scope/discourse evidence
                 +
 bounded LLM semantic induction
                 ↓
      observations + hypotheses
      alternatives + dependencies
      conflicts + reconciliation
                 ↓
   Semantic Commitment Calculus (SCC)
                 ↓
 deterministic semantic validation/export
                 ↓
          candidate #392 package

No analyzer/model view is authoritative by itself. SCL/SCC are compiler-local evidence/interpretation state, not another durable world model.

SCL conceptual records

sc_span(SpanId, SourceId, Start, End, TokenRefs, Meta).
sc_observation(ObsId, AnalyzerId, Kind, Payload,
               SpanRefs, Confidence, Version).
sc_hypothesis(HypId, SemanticKind, CandidatePayload,
              EvidenceRefs, AlternativeSet, Status).
sc_dependency(FromHyp, Relation, ToHyp).
sc_conflict(HypA, HypB, Dimension, EvidenceRefs).
sc_decision(DecisionId, AlternativeSet, SelectedOrUnresolved,
            Policy, EvidenceRefs, CompilerVersion).

Observations may include syntax/dependencies, SRL/frames, AMR/UCCA-style structure, DRS/MRS-style discourse/scope, quote/speaker boundaries, timestamps, source-format structure, numeric/unit parses, and bounded model-proposed hypotheses.

Observations are evidence, not truth.

Packed ambiguity

Preserve material alternatives for at least:

entity/coreference identity
word/frame sense
predicate/argument structure
quantifier scope
negation/modal scope
condition/exception attachment
temporal attachment
causal strength/direction
speaker/source attribution
instruction vs description
example vs generalized rule
procedure boundary
ellipsis reconstruction
ontology/domain-symbol mapping
pragmatic/projective interpretation

Do not enumerate a Cartesian product. Use shared packed structure + compatibility constraints. Budget exhaustion may leave ambiguity unresolved; it must not silently choose one.

Explicit discourse workspace

Large-document compilation carries symbolic discourse state rather than only overlapping text windows.

Conceptual state includes:

accessible referents
entity/event candidates
speaker + quote stack
time anchors
section/genre/topic
source metadata
prior unresolved hypotheses
relevant prior semantic records
context/attitude stack

For LLM logs, exact envelope metadata such as role, provider/model, message/tool-call IDs, timestamps and request/reply linkage is deterministic input and must not be re-inferred by a model.

Induction / interpretation classes

Every material compiler output distinguishes at least:

source_explicit
compositionally_entailed
source_presupposed
pragmatic_candidate
cross_sentence_synthesized
induced_rule
compiler_repair

pragmatic_candidate, induced_rule, and compiler_repair must never masquerade as source-explicit knowledge. A historical successful troubleshooting episode may support an induced_rule; it does not itself prove a universal procedure.

MACHINE-SPIRIT #399B: Semantic Commitment Calculus (SCC)

#399B found that induction-class labels alone are too flat. The compiler must model who is committed to what, in which context, with which linguistic force, projectivity/opacity, defeasibility and derivation license.

Add compiler-local records equivalent to:

sc_commitment(CommitmentId,
              ContentHypothesis,
              HolderRef,
              ContextRef,
              Force,
              Projectivity,
              Defeasibility,
              LicenseRefs,
              Status).

sc_context_frame(ContextId,
                 Kind,
                 ParentContext,
                 AnchorRefs,
                 Accessibility,
                 Meta).

sc_transform(TransformId,
             Kind,
             InputRefs,
             OutputHypothesis,
             TriggerRefs,
             Reversibility,
             Status).

sc_cancellation(CancelId,
                TargetCommitment,
                EvidenceRefs,
                Kind).

Candidate linguistic-force distinctions include:

asserted
presupposed
conventionally_implied
conversationally_implicated
reported_content
quoted_form
reconstructed
coerced
indexically_anchored
generic
habitual

Candidate projectivity/opacity distinctions include:

local_only
projects_by_default
embedding_sensitive
opaque
metalinguistic

Candidate defeasibility distinctions include:

strict_compositional
resolvable
accommodatable
cancellable
repairable

Exact enums may be tightened fixture-first. Do not collapse these dimensions into one confidence score.

Presupposition

A presupposition trigger creates a content hypothesis plus a resolution obligation. Resolution may bind existing discourse content, accommodate locally/above, remain unresolved, or be filtered/cancelled by context. Triggered content is never automatically a global assertion.

Alice stopped smoking may license prior-smoking content, but that content remains presupposed, not source_explicit asserted.

Conversational implicature

Implicature is an optional licensed, cancellable pragmatic transformation. Some services passed may support a not all candidate, but In fact, all passed cancels it without contradicting the asserted content. Pragmatic candidates cannot silently become ordinary world assertions.

Ellipsis

Reconstructed content retains ellipsis site, antecedent candidate and reconstruction transform. The source span is not rewritten to pretend reconstructed wording occurred literally.

Intensionality / attitudes

Belief, desire, report, plan and modal content lives in explicit attitude/modal contexts. No automatic extensional substitution or upward leakage into actual-world assertions. Preserve de-re/de-dicto alternatives when material.

Indexicals

Resolve I/you/here/now/today/... from explicit utterance/source context where available. Structured logs provide deterministic speaker/time/session anchors. Missing anchors remain unresolved; never default them to ingestion time/operator/current process.

Direct / indirect / mixed quotation

Separate:

surface quoted form
quote/source span
speaker attribution
semantic content attributed to speaker
narrator/reporting proposition

Indirect report does not imply verbatim wording. Mixed quotation may require metalinguistic/form semantics and cannot be flattened to ordinary embedded content.

Genericity / habituality

Generic and habitual language must not silently lower to exceptionless universal rules/events.

Preserve semantic forms equivalent to:

sem_generic(Id, RestrictorRef, ScopeRef, Context, Meta).
sem_habitual(Id, Agent, EventPattern, TemporalFrame, FrequencyInfo, Meta).

A reasoning profile may later interpret generics as defaults. That is not a compiler truth.

Metonymy

Preserve surface referent separately from a contextual coerced/intended participant. Do not turn The White House denied P into a global identity merge between building/institution/spokesperson, and never use metonymic coercion to rebind security principals.

Temporal discourse

Distinguish explicit temporal relations from tense/aspect constraints, temporal anaphora, discourse-derived likely sequence and mere textual order. Constraint propagation may leave partial/underspecified order. Text order alone is not sufficient evidence for before/2.

Discourse relation != world relation

Relations such as explanation/elaboration/contrast/narration connect discourse units. Any conversion into causal or other world relations requires a separate typed transform with explicit semantic-strength evidence.

Export contract

Reconciliation decides not only accepted/rejected, but an export class:

export_assertion
export_attributed_assertion
export_presupposition
export_generic
export_habitual
export_modal_attitude
export_alternative
export_pragmatic_candidate
export_interpretation_only
reject

Conceptual API:

semantic_reconcile(+SCL,
                   +DiscourseContext,
                   +Policy,
                   -CommitmentGraph).

semantic_export(+CommitmentGraph,
                +TargetProfile,
                -CandidatePackage,
                -ExportReceipt).

Every exported material #392 record needs an auditable receipt to source/SCL/SCC evidence showing what licensed the export.

Three independent provenance/epistemic axes

Preserve independently:

A. linguistic force
B. compiler derivation mechanism
C. world/source epistemic status

Parser/model confidence concerns interpretation confidence, not world truth confidence.

LLM role

Use LLMs as bounded semantic inducer/reconciler for open-domain concepts, discourse repair, implicit procedure/rule structure, ellipsis/metonymy/pragmatic candidates and alternative ranking.

Prefer:

semantic_induce(+SpanRefs,
                +EvidenceProjection,
                +Vocabulary,
                +TargetKinds,
                -CandidateHypotheses).

not whole-document direct truth generation.

Grammar/schema constraints guarantee structure only; they do not guarantee semantic faithfulness.

Deterministic source-first extraction

Adapters expose exact source structure before model analysis:

  • LLM logs: role/session/message/tool-call/result/timestamp/provider metadata;
  • web/news: URL/publication/byline/update/quote boundaries where available;
  • Wikipedia: title/section/revision/link/list/table structure;
  • manuals/docs: headings, numbered steps, warnings, notes, code/tables/cross-references.

A model must not be asked to rediscover deterministic metadata already present in the source.

Dedicated rule/procedure lane

Explicitly induce/validate:

goal
steps/partial order
preconditions/postconditions
branch/failure/retry/loop
success/verification
fallback/recovery

and rule distinctions such as if, only if, iff, unless, generic/habitual, default/exception, requirement/recommendation/permission.

Scaling requirements

  • cache analyzer output by source-span/analyzer/version/config fingerprint;
  • cheap deterministic adapters before expensive models;
  • semantic-risk routing determines deep analyzers;
  • packed alternatives share structure;
  • context frames form shared DAGs;
  • trigger-driven pragmatic analysis rather than every phenomenon on every span;
  • lazy resolution where safe;
  • unresolved ambiguity survives bounded budgets;
  • discourse state is incrementally reusable;
  • validation/export receipts are independently cacheable.

Worst-case scope/reference/pragmatic ambiguity is combinatorial. The correct failure mode is bounded unresolved alternatives, not heuristic silent collapse.

Safety / authority invariants

  • source/quoted commands remain semantic source content;
  • reported plans/actions remain attributed content;
  • attitude/modal/counterfactual content cannot become actual capabilities;
  • generic admins can restart services does not grant restart authority;
  • pragmatic inference cannot synthesize authority;
  • metonymic resolution cannot rebind principals;
  • accommodation cannot invent credentials/identity/authorization;
  • unresolved indexicals cannot default to the operator/process;
  • model-generated open vocabulary remains inert data.

Language interpretation is never an authority bridge.

Acceptance

  • Multi-paragraph procedure preserves branching and success/failure semantics.
  • Historical narrative becomes linked events with temporal ordering/underspecification.
  • Scientific passage distinguishes correlation/possible cause/asserted cause.
  • Policy text preserves obligation, permission, prohibition, default and exception.
  • Quantified statements retain scope/cardinality semantics.
  • Pronouns/coreferences resolve across sentences or remain explicit ambiguity.
  • Quoted/attributed claims do not become unqualified assertions.
  • Mixed passage generates linked records of multiple knowledge classes.
  • Chunked compilation preserves cross-segment identity/discourse state.
  • Generalized knowledge is distinguished from source-explicit content.
  • Analyzer disagreement is preserved or reconciled with evidence.
  • Quantifier/modal/negation scope can remain packed/underspecified.
  • Historical case and induced generalized rule have different induction classes.
  • Source-embedded prompt/tool/Prolog text cannot alter compiler control flow/authority.
  • A compiler run may return unresolved/rejected candidates without false success.
  • Presupposition filtering does not leak triggered content globally.
  • Scalar implicature cancellation removes/rejects the candidate without contradicting asserted content.
  • Belief/attitude contexts preserve opacity and block naive identity substitution.
  • Missing indexical anchors remain unresolved; structured source anchors are used deterministically.
  • Direct, indirect and mixed quotation retain form/content/source distinctions.
  • Generic/habitual language cannot silently become exceptionless universal rules/events.
  • Metonymic interpretation does not destructively merge entity identity.
  • Ellipsis reconstruction retains transform/antecedent provenance.
  • Text order alone cannot override explicit temporal relations.
  • Discourse explanation cannot silently become world-level causation.
  • Every exported record exposes an export/license receipt.

Non-goals

  • no durable memory storage;
  • no arbitrary generated clause execution;
  • no requirement that all ambiguity/pragmatics be resolved;
  • no requirement that every analyzer/formalism be available for every language/domain;
  • no claim that constrained generation guarantees semantic correctness;
  • no final truth-maintenance/default-belief policy (Machine Spirit depth 3 / #400);
  • no automatic promotion of pragmatics/generics to world truth.

Refs #388 #392 #394 #395 #397 #399.

Parent: #388 Depends on: #392 Research: #397 #399 ## Goal Implement the semantic frontend that maps arbitrary prose into candidate instances of the general semantic IR **without flattening meaning, discourse commitment, attribution, scope, or pragmatic status into isolated triples/facts**. The compiler must be usable for heterogeneous sources including LLM logs, Wikipedia/encyclopedic prose, news, manuals, scientific papers, chats, issue/PR histories, policies and arbitrary text. ## Architecture: evidence-anchored Semantic Compilation Lattice (SCL) The old conceptual linear checklist remains useful for coverage, but it is **not** the execution model. Coreference, scope, attribution, event structure, procedure/rule interpretation, temporal attachment and pragmatic phenomena constrain one another. Use an ephemeral/versioned **Semantic Compilation Lattice (SCL)** between immutable source text and #392 candidate IR: ```text immutable source + exact span/token anchors ↓ deterministic source adapters + syntax/morphology / enhanced dependencies SRL / frame evidence AMR/UCCA-style graph evidence DRS/MRS-style scope/discourse evidence + bounded LLM semantic induction ↓ observations + hypotheses alternatives + dependencies conflicts + reconciliation ↓ Semantic Commitment Calculus (SCC) ↓ deterministic semantic validation/export ↓ candidate #392 package ``` No analyzer/model view is authoritative by itself. SCL/SCC are compiler-local evidence/interpretation state, **not another durable world model**. ## SCL conceptual records ```prolog sc_span(SpanId, SourceId, Start, End, TokenRefs, Meta). sc_observation(ObsId, AnalyzerId, Kind, Payload, SpanRefs, Confidence, Version). sc_hypothesis(HypId, SemanticKind, CandidatePayload, EvidenceRefs, AlternativeSet, Status). sc_dependency(FromHyp, Relation, ToHyp). sc_conflict(HypA, HypB, Dimension, EvidenceRefs). sc_decision(DecisionId, AlternativeSet, SelectedOrUnresolved, Policy, EvidenceRefs, CompilerVersion). ``` Observations may include syntax/dependencies, SRL/frames, AMR/UCCA-style structure, DRS/MRS-style discourse/scope, quote/speaker boundaries, timestamps, source-format structure, numeric/unit parses, and bounded model-proposed hypotheses. Observations are evidence, not truth. ## Packed ambiguity Preserve material alternatives for at least: ```text entity/coreference identity word/frame sense predicate/argument structure quantifier scope negation/modal scope condition/exception attachment temporal attachment causal strength/direction speaker/source attribution instruction vs description example vs generalized rule procedure boundary ellipsis reconstruction ontology/domain-symbol mapping pragmatic/projective interpretation ``` Do not enumerate a Cartesian product. Use shared packed structure + compatibility constraints. Budget exhaustion may leave ambiguity unresolved; it must not silently choose one. ## Explicit discourse workspace Large-document compilation carries symbolic discourse state rather than only overlapping text windows. Conceptual state includes: ```text accessible referents entity/event candidates speaker + quote stack time anchors section/genre/topic source metadata prior unresolved hypotheses relevant prior semantic records context/attitude stack ``` For LLM logs, exact envelope metadata such as role, provider/model, message/tool-call IDs, timestamps and request/reply linkage is deterministic input and must not be re-inferred by a model. ## Induction / interpretation classes Every material compiler output distinguishes at least: ```text source_explicit compositionally_entailed source_presupposed pragmatic_candidate cross_sentence_synthesized induced_rule compiler_repair ``` `pragmatic_candidate`, `induced_rule`, and `compiler_repair` must never masquerade as source-explicit knowledge. A historical successful troubleshooting episode may support an `induced_rule`; it does not itself prove a universal procedure. ## MACHINE-SPIRIT #399B: Semantic Commitment Calculus (SCC) #399B found that induction-class labels alone are too flat. The compiler must model **who is committed to what, in which context, with which linguistic force, projectivity/opacity, defeasibility and derivation license**. Add compiler-local records equivalent to: ```prolog sc_commitment(CommitmentId, ContentHypothesis, HolderRef, ContextRef, Force, Projectivity, Defeasibility, LicenseRefs, Status). sc_context_frame(ContextId, Kind, ParentContext, AnchorRefs, Accessibility, Meta). sc_transform(TransformId, Kind, InputRefs, OutputHypothesis, TriggerRefs, Reversibility, Status). sc_cancellation(CancelId, TargetCommitment, EvidenceRefs, Kind). ``` Candidate linguistic-force distinctions include: ```text asserted presupposed conventionally_implied conversationally_implicated reported_content quoted_form reconstructed coerced indexically_anchored generic habitual ``` Candidate projectivity/opacity distinctions include: ```text local_only projects_by_default embedding_sensitive opaque metalinguistic ``` Candidate defeasibility distinctions include: ```text strict_compositional resolvable accommodatable cancellable repairable ``` Exact enums may be tightened fixture-first. **Do not collapse these dimensions into one confidence score.** ### Presupposition A presupposition trigger creates a content hypothesis plus a resolution obligation. Resolution may bind existing discourse content, accommodate locally/above, remain unresolved, or be filtered/cancelled by context. Triggered content is never automatically a global assertion. `Alice stopped smoking` may license prior-smoking content, but that content remains `presupposed`, not `source_explicit asserted`. ### Conversational implicature Implicature is an optional licensed, cancellable pragmatic transformation. `Some services passed` may support a `not all` candidate, but `In fact, all passed` cancels it without contradicting the asserted content. Pragmatic candidates cannot silently become ordinary world assertions. ### Ellipsis Reconstructed content retains ellipsis site, antecedent candidate and reconstruction transform. The source span is not rewritten to pretend reconstructed wording occurred literally. ### Intensionality / attitudes Belief, desire, report, plan and modal content lives in explicit attitude/modal contexts. No automatic extensional substitution or upward leakage into actual-world assertions. Preserve de-re/de-dicto alternatives when material. ### Indexicals Resolve `I/you/here/now/today/...` from explicit utterance/source context where available. Structured logs provide deterministic speaker/time/session anchors. Missing anchors remain unresolved; never default them to ingestion time/operator/current process. ### Direct / indirect / mixed quotation Separate: ```text surface quoted form quote/source span speaker attribution semantic content attributed to speaker narrator/reporting proposition ``` Indirect report does not imply verbatim wording. Mixed quotation may require metalinguistic/form semantics and cannot be flattened to ordinary embedded content. ### Genericity / habituality Generic and habitual language must not silently lower to exceptionless universal rules/events. Preserve semantic forms equivalent to: ```prolog sem_generic(Id, RestrictorRef, ScopeRef, Context, Meta). sem_habitual(Id, Agent, EventPattern, TemporalFrame, FrequencyInfo, Meta). ``` A reasoning profile may later interpret generics as defaults. That is not a compiler truth. ### Metonymy Preserve surface referent separately from a contextual coerced/intended participant. Do not turn `The White House denied P` into a global identity merge between building/institution/spokesperson, and never use metonymic coercion to rebind security principals. ### Temporal discourse Distinguish explicit temporal relations from tense/aspect constraints, temporal anaphora, discourse-derived likely sequence and mere textual order. Constraint propagation may leave partial/underspecified order. Text order alone is not sufficient evidence for `before/2`. ### Discourse relation != world relation Relations such as explanation/elaboration/contrast/narration connect discourse units. Any conversion into causal or other world relations requires a separate typed transform with explicit semantic-strength evidence. ## Export contract Reconciliation decides not only accepted/rejected, but an export class: ```text export_assertion export_attributed_assertion export_presupposition export_generic export_habitual export_modal_attitude export_alternative export_pragmatic_candidate export_interpretation_only reject ``` Conceptual API: ```prolog semantic_reconcile(+SCL, +DiscourseContext, +Policy, -CommitmentGraph). semantic_export(+CommitmentGraph, +TargetProfile, -CandidatePackage, -ExportReceipt). ``` Every exported material #392 record needs an auditable receipt to source/SCL/SCC evidence showing what licensed the export. ## Three independent provenance/epistemic axes Preserve independently: ```text A. linguistic force B. compiler derivation mechanism C. world/source epistemic status ``` Parser/model confidence concerns interpretation confidence, **not world truth confidence**. ## LLM role Use LLMs as bounded semantic inducer/reconciler for open-domain concepts, discourse repair, implicit procedure/rule structure, ellipsis/metonymy/pragmatic candidates and alternative ranking. Prefer: ```prolog semantic_induce(+SpanRefs, +EvidenceProjection, +Vocabulary, +TargetKinds, -CandidateHypotheses). ``` not whole-document direct truth generation. Grammar/schema constraints guarantee structure only; they do not guarantee semantic faithfulness. ## Deterministic source-first extraction Adapters expose exact source structure before model analysis: - LLM logs: role/session/message/tool-call/result/timestamp/provider metadata; - web/news: URL/publication/byline/update/quote boundaries where available; - Wikipedia: title/section/revision/link/list/table structure; - manuals/docs: headings, numbered steps, warnings, notes, code/tables/cross-references. A model must not be asked to rediscover deterministic metadata already present in the source. ## Dedicated rule/procedure lane Explicitly induce/validate: ```text goal steps/partial order preconditions/postconditions branch/failure/retry/loop success/verification fallback/recovery ``` and rule distinctions such as `if`, `only if`, `iff`, `unless`, generic/habitual, default/exception, requirement/recommendation/permission. ## Scaling requirements - cache analyzer output by source-span/analyzer/version/config fingerprint; - cheap deterministic adapters before expensive models; - semantic-risk routing determines deep analyzers; - packed alternatives share structure; - context frames form shared DAGs; - trigger-driven pragmatic analysis rather than every phenomenon on every span; - lazy resolution where safe; - unresolved ambiguity survives bounded budgets; - discourse state is incrementally reusable; - validation/export receipts are independently cacheable. Worst-case scope/reference/pragmatic ambiguity is combinatorial. The correct failure mode is bounded unresolved alternatives, not heuristic silent collapse. ## Safety / authority invariants - source/quoted commands remain semantic source content; - reported plans/actions remain attributed content; - attitude/modal/counterfactual content cannot become actual capabilities; - generic `admins can restart services` does not grant restart authority; - pragmatic inference cannot synthesize authority; - metonymic resolution cannot rebind principals; - accommodation cannot invent credentials/identity/authorization; - unresolved indexicals cannot default to the operator/process; - model-generated open vocabulary remains inert data. **Language interpretation is never an authority bridge.** ## Acceptance - [ ] Multi-paragraph procedure preserves branching and success/failure semantics. - [ ] Historical narrative becomes linked events with temporal ordering/underspecification. - [ ] Scientific passage distinguishes correlation/possible cause/asserted cause. - [ ] Policy text preserves obligation, permission, prohibition, default and exception. - [ ] Quantified statements retain scope/cardinality semantics. - [ ] Pronouns/coreferences resolve across sentences or remain explicit ambiguity. - [ ] Quoted/attributed claims do not become unqualified assertions. - [ ] Mixed passage generates linked records of multiple knowledge classes. - [ ] Chunked compilation preserves cross-segment identity/discourse state. - [ ] Generalized knowledge is distinguished from source-explicit content. - [ ] Analyzer disagreement is preserved or reconciled with evidence. - [ ] Quantifier/modal/negation scope can remain packed/underspecified. - [ ] Historical case and induced generalized rule have different induction classes. - [ ] Source-embedded prompt/tool/Prolog text cannot alter compiler control flow/authority. - [ ] A compiler run may return unresolved/rejected candidates without false success. - [ ] Presupposition filtering does not leak triggered content globally. - [ ] Scalar implicature cancellation removes/rejects the candidate without contradicting asserted content. - [ ] Belief/attitude contexts preserve opacity and block naive identity substitution. - [ ] Missing indexical anchors remain unresolved; structured source anchors are used deterministically. - [ ] Direct, indirect and mixed quotation retain form/content/source distinctions. - [ ] Generic/habitual language cannot silently become exceptionless universal rules/events. - [ ] Metonymic interpretation does not destructively merge entity identity. - [ ] Ellipsis reconstruction retains transform/antecedent provenance. - [ ] Text order alone cannot override explicit temporal relations. - [ ] Discourse explanation cannot silently become world-level causation. - [ ] Every exported record exposes an export/license receipt. ## Non-goals - no durable memory storage; - no arbitrary generated clause execution; - no requirement that all ambiguity/pragmatics be resolved; - no requirement that every analyzer/formalism be available for every language/domain; - no claim that constrained generation guarantees semantic correctness; - no final truth-maintenance/default-belief policy (Machine Spirit depth 3 / #400); - no automatic promotion of pragmatics/generics to world truth. Refs #388 #392 #394 #395 #397 #399.
Author
Owner

MACHINE-SPIRIT #399C canonical compiler delta — Semantic Interoperability Fabric

Depth 2C found that SCL/SCC still need an explicit interoperability layer. Add compiler-local support for:

sc_analyzer_manifest(...).
sc_native_observation(...).
sc_semantic_map(...).
sc_loss_profile(...).
sc_mapping_bundle(...).
sc_translation_unit(...).
sc_crosslingual_map(...).

Hard requirements:

  • retain native analyzer/formalism observations with schema/version/config fingerprints long enough to audit/reconcile them;
  • common graph/metamodel serialization is transport, not semantic equivalence;
  • mappings need typed relations such as exact/refines/coarsens/broader/narrower/overlap/entails/projects/approximate/incompatible/unknown and must be qualified by semantic dimensions/profile;
  • every nontrivial conversion carries mapping provenance + explicit preserved/weakened/dropped dimensions + introduced assumptions + invertibility;
  • analyzer selection uses capability manifests scoped by phenomenon/language/genre/version rather than binary installed/not-installed checks;
  • cross-lingual translation/alignment is evidence, never proposition identity; preserve explicitation, omission, specialization/generalization and unresolved divergence;
  • cross-linguistic category systems may be finer/coarser/cross-cutting; represent mappings as partial-order/lattice relations rather than forcing one flat universal label set;
  • genre affects routing/risk policy but never directly promotes truth/authority;
  • mapping/ontology/analyzer upgrades create new interpretation generations; never reinterpret old compiler evidence in place;
  • external import/export returns conversion/loss receipts and may refuse unsupported semantics;
  • mapping confidence is representational-correspondence confidence, separate from interpretation confidence and world/source epistemic status;
  • representation interoperability is never an authority bridge.

The full research, alternatives, sources and conformance cases are in #399's C comment. This should be incorporated into the fixture-first implementation design of #393 rather than implemented as arbitrary pairwise Prolog conversion clauses.

## MACHINE-SPIRIT #399C canonical compiler delta — Semantic Interoperability Fabric Depth 2C found that SCL/SCC still need an explicit interoperability layer. Add compiler-local support for: ```prolog sc_analyzer_manifest(...). sc_native_observation(...). sc_semantic_map(...). sc_loss_profile(...). sc_mapping_bundle(...). sc_translation_unit(...). sc_crosslingual_map(...). ``` Hard requirements: - retain native analyzer/formalism observations with schema/version/config fingerprints long enough to audit/reconcile them; - common graph/metamodel serialization is transport, **not semantic equivalence**; - mappings need typed relations such as exact/refines/coarsens/broader/narrower/overlap/entails/projects/approximate/incompatible/unknown and must be qualified by semantic dimensions/profile; - every nontrivial conversion carries mapping provenance + explicit preserved/weakened/dropped dimensions + introduced assumptions + invertibility; - analyzer selection uses capability manifests scoped by phenomenon/language/genre/version rather than binary installed/not-installed checks; - cross-lingual translation/alignment is evidence, never proposition identity; preserve explicitation, omission, specialization/generalization and unresolved divergence; - cross-linguistic category systems may be finer/coarser/cross-cutting; represent mappings as partial-order/lattice relations rather than forcing one flat universal label set; - genre affects routing/risk policy but never directly promotes truth/authority; - mapping/ontology/analyzer upgrades create new interpretation generations; never reinterpret old compiler evidence in place; - external import/export returns conversion/loss receipts and may refuse unsupported semantics; - mapping confidence is representational-correspondence confidence, separate from interpretation confidence and world/source epistemic status; - representation interoperability is never an authority bridge. The full research, alternatives, sources and conformance cases are in #399's C comment. This should be incorporated into the fixture-first implementation design of #393 rather than implemented as arbitrary pairwise Prolog conversion clauses.
Author
Owner

MACHINE-SPIRIT #399D canonical execution handoff — Semantic Build Graph (SBG)

Depth 2D makes the #393 scaling section normative rather than aspirational.

Adopt a compiler-local Semantic Build Graph: typed stage actions with exact input/dependency fingerprints, immutable/content-addressable artifacts, dynamically recorded discourse dependencies, explicit determinism classes, and demanded incremental recomputation.

Required stage semantics

Conceptual contracts:

semantic_plan_compile(+SourceDescriptor,+RequiredSemanticProfile,+Budget,+AvailableAnalyzers,-CompilePlan,-PlanReceipt).
semantic_work_key(+Stage,+Inputs,+Versions,+Configs,-WorkKey).
semantic_execute_plan(+CompilePlan,+RuntimeOptions,-Outcome,-CompileReceipt).

Exact names follow repository conventions.

Hard invariants:

  • only actual stage dependencies enter the work key;
  • changing SRL/analyzer version invalidates that artifact + actual descendants, not deterministic source adapters;
  • changing mapping/schema invalidates mapping/normalization/export descendants without rerunning unrelated native parsers;
  • stage classes distinguish pure_deterministic, versioned deterministic external work, retained/recorded nondeterministic work and volatile external work;
  • a model request hash alone is not deterministic replay; exact replay of a model-backed stage requires the retained candidate/output artifact;
  • local analyzers may fan out under bounded concurrency, but discourse/SCC reconciliation records exact cross-segment/frontier dependencies rather than racing independent chunks;
  • later text may resolve earlier obligations; record explicit backlinks and invalidate the affected dependency closure;
  • propagation stops on edges when recomputed semantic/frontier artifact digest is unchanged;
  • cyclic semantic regions use bounded fixed-point/reconciliation semantics and return unresolved on exhaustion;
  • packed ambiguity is structurally budgeted; budget exhaustion may preserve/spill unresolved alternatives but may never silently choose top-1 truth;
  • analyzer routing is an inspectable typed plan constrained by required semantic dimensions and resource budgets;
  • partial failures create typed source-span/semantic-dimension gaps and obey caller completeness policy;
  • incremental results are conformance-checked against from-scratch semantics under the same retained nondeterministic artifacts.

Runtime boundary

The SBG is work-plan/dependency data, not a second scheduler. Execute through existing Prolog-RLM async/Futures/cancellation/concurrency/runtime machinery where available; direct library callers may execute synchronously. Preserve #376's one-runtime/one-authority boundary.

Discourse frontier

Cross-segment processing should pass a bounded symbolic semantic frontier (referents/events/context frames/open obligations + dependency digests), not all prior text. An edit invalidates only observed dependency closure; late resolution creates explicit back-dependencies.

Full research, candidate alternatives, sources, adversarial review and D1-D13 fixtures are in #399 subpass D.

## MACHINE-SPIRIT #399D canonical execution handoff — Semantic Build Graph (SBG) Depth 2D makes the `#393` scaling section normative rather than aspirational. Adopt a compiler-local **Semantic Build Graph**: typed stage actions with exact input/dependency fingerprints, immutable/content-addressable artifacts, dynamically recorded discourse dependencies, explicit determinism classes, and demanded incremental recomputation. ### Required stage semantics Conceptual contracts: ```prolog semantic_plan_compile(+SourceDescriptor,+RequiredSemanticProfile,+Budget,+AvailableAnalyzers,-CompilePlan,-PlanReceipt). semantic_work_key(+Stage,+Inputs,+Versions,+Configs,-WorkKey). semantic_execute_plan(+CompilePlan,+RuntimeOptions,-Outcome,-CompileReceipt). ``` Exact names follow repository conventions. Hard invariants: - only actual stage dependencies enter the work key; - changing SRL/analyzer version invalidates that artifact + actual descendants, not deterministic source adapters; - changing mapping/schema invalidates mapping/normalization/export descendants without rerunning unrelated native parsers; - stage classes distinguish `pure_deterministic`, versioned deterministic external work, retained/recorded nondeterministic work and volatile external work; - a model request hash alone is **not** deterministic replay; exact replay of a model-backed stage requires the retained candidate/output artifact; - local analyzers may fan out under bounded concurrency, but discourse/SCC reconciliation records exact cross-segment/frontier dependencies rather than racing independent chunks; - later text may resolve earlier obligations; record explicit backlinks and invalidate the affected dependency closure; - propagation stops on edges when recomputed semantic/frontier artifact digest is unchanged; - cyclic semantic regions use bounded fixed-point/reconciliation semantics and return unresolved on exhaustion; - packed ambiguity is structurally budgeted; budget exhaustion may preserve/spill unresolved alternatives but may never silently choose top-1 truth; - analyzer routing is an inspectable typed plan constrained by required semantic dimensions and resource budgets; - partial failures create typed source-span/semantic-dimension gaps and obey caller completeness policy; - incremental results are conformance-checked against from-scratch semantics under the same retained nondeterministic artifacts. ### Runtime boundary The SBG is work-plan/dependency data, **not a second scheduler**. Execute through existing Prolog-RLM async/Futures/cancellation/concurrency/runtime machinery where available; direct library callers may execute synchronously. Preserve #376's one-runtime/one-authority boundary. ### Discourse frontier Cross-segment processing should pass a bounded symbolic semantic frontier (referents/events/context frames/open obligations + dependency digests), not all prior text. An edit invalidates only observed dependency closure; late resolution creates explicit back-dependencies. Full research, candidate alternatives, sources, adversarial review and D1-D13 fixtures are in #399 subpass D.
Author
Owner

MACHINE-SPIRIT #404A handoff — induction output remains candidate knowledge

The semantic compiler's existing induced_rule distinction now feeds EPOCH explicitly:

compiler/LLM induces rule
    -> candidate semantic learned object
    -> #404 validation/promotion lifecycle
    -> admitted learned knowledge only after policy evidence

induced_rule or model-generated lesson must never be exported as source-explicit truth or trusted control policy merely because schema validation succeeds. Preserve source/SCL/SCC evidence plus induction mechanism/version so #404 can distinguish language interpretation evidence from later empirical/VERIFY learning evidence.

Ref #404A EPOCH.

## MACHINE-SPIRIT #404A handoff — induction output remains candidate knowledge The semantic compiler's existing `induced_rule` distinction now feeds EPOCH explicitly: ```text compiler/LLM induces rule -> candidate semantic learned object -> #404 validation/promotion lifecycle -> admitted learned knowledge only after policy evidence ``` `induced_rule` or model-generated lesson must never be exported as source-explicit truth or trusted control policy merely because schema validation succeeds. Preserve source/SCL/SCC evidence plus induction mechanism/version so #404 can distinguish language interpretation evidence from later empirical/VERIFY learning evidence. Ref #404A EPOCH.
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#405
No description provided.