@lucern/confidence 1.0.28 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -7
- package/dist/index.js +905 -770
- package/dist/index.js.map +1 -1
- package/dist/proof-attestation.json +1 -1
- package/dist/v1/codec.js.map +1 -1
- package/dist/v1/index.d.ts +7 -7
- package/dist/v1/index.js +905 -770
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/interfaces.d.ts +5 -5
- package/dist/v1/operations/approximation.d.ts +1 -1
- package/dist/v1/operations/approximation.js +8 -7
- package/dist/v1/operations/approximation.js.map +1 -1
- package/dist/v1/operations/bridge/index.js +7 -6
- package/dist/v1/operations/bridge/index.js.map +1 -1
- package/dist/v1/operations/canonical.d.ts +1 -1
- package/dist/v1/operations/canonical.js +106 -57
- package/dist/v1/operations/canonical.js.map +1 -1
- package/dist/v1/operations/contracts/epistemicContract.d.ts +1 -1
- package/dist/v1/operations/contracts/epistemicContract.js +9 -3
- package/dist/v1/operations/contracts/epistemicContract.js.map +1 -1
- package/dist/v1/operations/contradiction/detectTupleContradiction.js.map +1 -1
- package/dist/v1/operations/contradiction/index.js.map +1 -1
- package/dist/v1/operations/dynamics/cascade.js +1 -1
- package/dist/v1/operations/dynamics/cascade.js.map +1 -1
- package/dist/v1/operations/dynamics/decay.js +105 -41
- package/dist/v1/operations/dynamics/decay.js.map +1 -1
- package/dist/v1/operations/dynamics/defeat.js.map +1 -1
- package/dist/v1/operations/dynamics/propagation.d.ts +3 -3
- package/dist/v1/operations/dynamics/propagation.js +101 -57
- package/dist/v1/operations/dynamics/propagation.js.map +1 -1
- package/dist/v1/operations/dynamics/revision.js +7 -6
- package/dist/v1/operations/dynamics/revision.js.map +1 -1
- package/dist/v1/operations/index.js +8 -3
- package/dist/v1/operations/index.js.map +1 -1
- package/dist/v1/operations/lucern.d.ts +7 -7
- package/dist/v1/operations/lucern.js +934 -807
- package/dist/v1/operations/lucern.js.map +1 -1
- package/dist/v1/operations/operatorTaxonomy.d.ts +10 -10
- package/dist/v1/operations/operatorTaxonomy.js.map +1 -1
- package/dist/v1/operations/scoring.d.ts +2 -1
- package/dist/v1/operations/scoring.js +20 -5
- package/dist/v1/operations/scoring.js.map +1 -1
- package/dist/v1/operations/subjectiveLogic/index.js +91 -54
- package/dist/v1/operations/subjectiveLogic/index.js.map +1 -1
- package/dist/v1/operations/temporalDecay.d.ts +3 -3
- package/dist/v1/operations/temporalDecay.js +8 -3
- package/dist/v1/operations/temporalDecay.js.map +1 -1
- package/dist/v1/types.d.ts +101 -101
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { SL_APPROXIMATION_OPERATOR_NAMES } from './approximation.js';
|
|
2
2
|
import { SL_CANONICAL_OPERATOR_NAMES } from './canonical.js';
|
|
3
3
|
import { LUCERN_SPECIFIC_OPERATOR_NAMES } from './lucern.js';
|
|
4
|
-
import './subjectiveLogic/index.js';
|
|
5
|
-
import '../types.js';
|
|
6
4
|
import './bridge/index.js';
|
|
5
|
+
import '../types.js';
|
|
7
6
|
import './dynamics/cascade.js';
|
|
7
|
+
import './subjectiveLogic/index.js';
|
|
8
8
|
import './scoring.js';
|
|
9
9
|
import '../codec.js';
|
|
10
10
|
import 'zod';
|
|
11
|
-
import './
|
|
11
|
+
import './contracts/epistemicContract.js';
|
|
12
12
|
import './contradiction/detectTupleContradiction.js';
|
|
13
|
-
import './dynamics/propagation.js';
|
|
14
|
-
import './dynamics/revision.js';
|
|
15
13
|
import './dynamics/decay.js';
|
|
16
14
|
import './dynamics/defeat.js';
|
|
17
|
-
import './
|
|
15
|
+
import './dynamics/propagation.js';
|
|
16
|
+
import './dynamics/revision.js';
|
|
17
|
+
import './temporalDecay.js';
|
|
18
18
|
|
|
19
19
|
declare const OPERATOR_TAXONOMY_TAGS: readonly ["SL_CANONICAL", "SL_APPROXIMATION", "LUCERN_SPECIFIC"];
|
|
20
20
|
type OperatorTaxonomyTag = (typeof OPERATOR_TAXONOMY_TAGS)[number];
|
|
21
21
|
type ConfidenceOperatorName = (typeof SL_CANONICAL_OPERATOR_NAMES)[number] | (typeof SL_APPROXIMATION_OPERATOR_NAMES)[number] | (typeof LUCERN_SPECIFIC_OPERATOR_NAMES)[number];
|
|
22
|
-
|
|
22
|
+
interface OperatorTaxonomyEntry {
|
|
23
23
|
readonly operator: ConfidenceOperatorName;
|
|
24
|
-
readonly tag: OperatorTaxonomyTag;
|
|
25
|
-
readonly sourceModule: string;
|
|
26
24
|
readonly rationale: string;
|
|
27
|
-
|
|
25
|
+
readonly sourceModule: string;
|
|
26
|
+
readonly tag: OperatorTaxonomyTag;
|
|
27
|
+
}
|
|
28
28
|
declare const PUBLIC_OPERATOR_EXPORT_NAMES: readonly ["mkOpinion", "opinion", "vacuous", "dogmatic", "project", "trustDiscount", "negate", "conditionalDeduction", "confidenceFromOpinion", "confidenceFromSL", "opinionFromBaseRate", "opinionFromDogmatic", "opinionFromProjected", "cumulativeFusion", "averagingFusion", "conditionalAbduction", "opinionFromDirichlet", "projectDirichletOpinion", "opinionFromBeta", "betaFromOpinion", "dampedDependencyOpinion", "dampedDependencyCascade", "clamp01", "fromStorage", "toStorage", "toStoredOpinionFields", "readOpinionFromRecord", "opinionFromScalar", "temporalDecay", "toDogmaticOpinion", "hasProjectedOpinionChanged", "normalizeTupleContradictionPolicy", "detectTupleContradiction", "evaluateTupleContradictionTransition", "confidenceLevel", "constraintFusion", "evidenceBalance", "areTensioned", "informationGain", "isPropagationEdgeType", "getPropagationTraversalSpecs", "propagateThroughEdge", "propagateAllEdges", "bayesianUpdate", "reviseConfidence", "reviseConfidenceOpinion", "computeBaseDecay", "computeDeadlineUrgency", "computeEffectiveDecay", "getRescoringSchedule", "decay", "applyNegativeSupport", "applyNegativeEvidence", "deriveContractStatus", "deriveVerificationTrigger", "deriveContractModulationPlan", "createInheritedContractRecord", "normalizeEvidentialAction", "parseComparisonOperator", "parseNumericThreshold", "pickFiniteNumber", "getEvaluatorInputRecord", "parseEvidentialEvaluatorConfig", "compareMetricValue", "resolveComparisonResult", "buildComparisonRationale", "buildEvidentialRationale", "parseMetricCheckerConfig", "parseReferenceCheckCounterConfig", "parseTemporalDeadlineConfig", "parseMarketIndexComparatorConfig"];
|
|
29
29
|
declare const OPERATOR_TAXONOMY_ENTRIES: readonly [{
|
|
30
30
|
readonly operator: "mkOpinion";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/v1/operations/approximation.ts","../../../src/v1/operations/canonical.ts","../../../src/v1/operations/lucern.ts","../../../src/v1/operations/operatorTaxonomy.ts"],"names":[],"mappings":";AAAO,IAAM,+BAAA,GAAkC;AAAA,EAC7C,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,sBAAA;AAAA,EACA,sBAAA;AAAA,EACA,yBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,yBAAA;AAAA,EACA;AACF,CAAA;;;ACVO,IAAM,2BAAA,GAA8B;AAAA,EACzC,WAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,kBAAA;AAAA,EACA,qBAAA;AAAA,EACA,qBAAA;AAAA,EACA;AACF,CAAA;;;ACdO,IAAM,8BAAA,GAAiC;AAAA,EAC5C,SAAA;AAAA,EACA,aAAA;AAAA,EACA,WAAA;AAAA,EACA,uBAAA;AAAA,EACA,uBAAA;AAAA,EACA,mBAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA;AAAA,EACA,4BAAA;AAAA,EACA,mCAAA;AAAA,EACA,0BAAA;AAAA,EACA,sCAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,uBAAA;AAAA,EACA,8BAAA;AAAA,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A,EACE;AAAA,GACJ;AAAA,EACA;AAAA,IACE,QAAA,EAAU,kCAAA;AAAA,IACV,GAAA,EAAK,iBAAA;AAAA,IACL,YAAA,EAAc,2CAAA;AAAA,IACd,SAAA,EACE;AAAA,GACJ;AAAA,EACA;AAAA,IACE,QAAA,EAAU,6BAAA;AAAA,IACV,GAAA,EAAK,iBAAA;AAAA,IACL,YAAA,EAAc,2CAAA;AAAA,IACd,SAAA,EACE;AAAA,GACJ;AAAA,EACA;AAAA,IACE,QAAA,EAAU,kCAAA;AAAA,IACV,GAAA,EAAK,iBAAA;AAAA,IACL,YAAA,EAAc,2CAAA;AAAA,IACd,SAAA,EACE;AAAA;AAEN;AAEO,IAAM,oBAAoB,MAAA,CAAO,MAAA;AAAA,EACtC,MAAA,CAAO,WAAA;AAAA,IACL,yBAAA,CAA0B,IAAI,CAAC,KAAA,KAAU,CAAC,KAAA,CAAM,QAAA,EAAU,KAAK,CAAC;AAAA;AAEpE;AAEO,IAAM,wBAAA,GAA2B,OAAO,MAAA,CAAO;AAAA,EACpD,YAAA,EAAc,2BAAA;AAAA,EACd,gBAAA,EAAkB,+BAAA;AAAA,EAClB,eAAA,EAAiB;AACnB,CAAC","file":"operatorTaxonomy.js","sourcesContent":["export const SL_APPROXIMATION_OPERATOR_NAMES = [\n \"cumulativeFusion\",\n \"averagingFusion\",\n \"conditionalAbduction\",\n \"opinionFromDirichlet\",\n \"projectDirichletOpinion\",\n \"opinionFromBeta\",\n \"betaFromOpinion\",\n \"dampedDependencyOpinion\",\n \"dampedDependencyCascade\",\n] as const;\n\nexport {\n cumulativeFusion,\n averagingFusion,\n conditionalAbduction,\n} from \"./subjectiveLogic\";\nexport {\n opinionFromDirichlet,\n projectDirichletOpinion,\n opinionFromBeta,\n betaFromOpinion,\n} from \"./bridge\";\nexport {\n dampedDependencyOpinion,\n dampedDependencyCascade,\n} from \"./dynamics/cascade\";\n","export const SL_CANONICAL_OPERATOR_NAMES = [\n \"mkOpinion\",\n \"opinion\",\n \"vacuous\",\n \"dogmatic\",\n \"project\",\n \"trustDiscount\",\n \"negate\",\n \"conditionalDeduction\",\n \"confidenceFromOpinion\",\n \"confidenceFromSL\",\n \"opinionFromBaseRate\",\n \"opinionFromDogmatic\",\n \"opinionFromProjected\",\n] as const;\n\nexport {\n mkOpinion,\n opinion,\n vacuous,\n dogmatic,\n project,\n trustDiscount,\n negate,\n conditionalDeduction,\n} from \"./subjectiveLogic\";\nexport {\n confidenceFromOpinion,\n confidenceFromSL,\n opinionFromBaseRate,\n opinionFromDogmatic,\n opinionFromProjected,\n} from \"./scoring\";\n","export const LUCERN_SPECIFIC_OPERATOR_NAMES = [\n \"clamp01\",\n \"fromStorage\",\n \"toStorage\",\n \"toStoredOpinionFields\",\n \"readOpinionFromRecord\",\n \"opinionFromScalar\",\n \"temporalDecay\",\n \"toDogmaticOpinion\",\n \"hasProjectedOpinionChanged\",\n \"normalizeTupleContradictionPolicy\",\n \"detectTupleContradiction\",\n \"evaluateTupleContradictionTransition\",\n \"confidenceLevel\",\n \"constraintFusion\",\n \"evidenceBalance\",\n \"areTensioned\",\n \"informationGain\",\n \"isPropagationEdgeType\",\n \"getPropagationTraversalSpecs\",\n \"propagateThroughEdge\",\n \"propagateAllEdges\",\n \"bayesianUpdate\",\n \"reviseConfidence\",\n \"reviseConfidenceOpinion\",\n \"computeBaseDecay\",\n \"computeDeadlineUrgency\",\n \"computeEffectiveDecay\",\n \"getRescoringSchedule\",\n \"decay\",\n \"applyNegativeSupport\",\n \"applyNegativeEvidence\",\n \"deriveContractStatus\",\n \"deriveVerificationTrigger\",\n \"deriveContractModulationPlan\",\n \"createInheritedContractRecord\",\n \"normalizeEvidentialAction\",\n \"parseComparisonOperator\",\n \"parseNumericThreshold\",\n \"pickFiniteNumber\",\n \"getEvaluatorInputRecord\",\n \"parseEvidentialEvaluatorConfig\",\n \"compareMetricValue\",\n \"resolveComparisonResult\",\n \"buildComparisonRationale\",\n \"buildEvidentialRationale\",\n \"parseMetricCheckerConfig\",\n \"parseReferenceCheckCounterConfig\",\n \"parseTemporalDeadlineConfig\",\n \"parseMarketIndexComparatorConfig\",\n] as const;\n\nexport {\n clamp01,\n toStoredOpinionFields,\n readOpinionFromRecord,\n opinionFromScalar,\n toDogmaticOpinion,\n hasProjectedOpinionChanged,\n} from \"./scoring\";\nexport { fromStorage, toStorage } from \"../codec\";\nexport { temporalDecay } from \"./temporalDecay\";\nexport {\n normalizeTupleContradictionPolicy,\n detectTupleContradiction,\n evaluateTupleContradictionTransition,\n} from \"./contradiction\";\nexport {\n confidenceLevel,\n constraintFusion,\n evidenceBalance,\n areTensioned,\n informationGain,\n} from \"./subjectiveLogic\";\nexport {\n isPropagationEdgeType,\n getPropagationTraversalSpecs,\n propagateThroughEdge,\n propagateAllEdges,\n} from \"./dynamics/propagation\";\nexport {\n bayesianUpdate,\n reviseConfidence,\n reviseConfidenceOpinion,\n} from \"./dynamics/revision\";\nexport {\n computeBaseDecay,\n computeDeadlineUrgency,\n computeEffectiveDecay,\n getRescoringSchedule,\n decay,\n} from \"./dynamics/decay\";\nexport { applyNegativeSupport, applyNegativeEvidence } from \"./dynamics/defeat\";\nexport {\n deriveContractStatus,\n deriveVerificationTrigger,\n deriveContractModulationPlan,\n createInheritedContractRecord,\n normalizeEvidentialAction,\n parseComparisonOperator,\n parseNumericThreshold,\n pickFiniteNumber,\n getEvaluatorInputRecord,\n parseEvidentialEvaluatorConfig,\n compareMetricValue,\n resolveComparisonResult,\n buildComparisonRationale,\n buildEvidentialRationale,\n parseMetricCheckerConfig,\n parseReferenceCheckCounterConfig,\n parseTemporalDeadlineConfig,\n parseMarketIndexComparatorConfig,\n} from \"./contracts/epistemicContract\";\n","import { SL_APPROXIMATION_OPERATOR_NAMES } from \"./approximation\";\nimport { SL_CANONICAL_OPERATOR_NAMES } from \"./canonical\";\nimport { LUCERN_SPECIFIC_OPERATOR_NAMES } from \"./lucern\";\n\nexport const OPERATOR_TAXONOMY_TAGS = [\n \"SL_CANONICAL\",\n \"SL_APPROXIMATION\",\n \"LUCERN_SPECIFIC\",\n] as const;\n\nexport type OperatorTaxonomyTag = (typeof OPERATOR_TAXONOMY_TAGS)[number];\nexport type ConfidenceOperatorName =\n | (typeof SL_CANONICAL_OPERATOR_NAMES)[number]\n | (typeof SL_APPROXIMATION_OPERATOR_NAMES)[number]\n | (typeof LUCERN_SPECIFIC_OPERATOR_NAMES)[number];\n\nexport type OperatorTaxonomyEntry = {\n readonly operator: ConfidenceOperatorName;\n readonly tag: OperatorTaxonomyTag;\n readonly sourceModule: string;\n readonly rationale: string;\n};\n\nexport const PUBLIC_OPERATOR_EXPORT_NAMES = [\n ...SL_CANONICAL_OPERATOR_NAMES,\n ...SL_APPROXIMATION_OPERATOR_NAMES,\n ...LUCERN_SPECIFIC_OPERATOR_NAMES,\n] as const;\n\nexport const OPERATOR_TAXONOMY_ENTRIES = [\n {\n operator: \"mkOpinion\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Constructs the canonical binomial SL opinion tuple and normalizes it into valid mass components.\",\n },\n {\n operator: \"opinion\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Constructs the canonical binomial SL opinion tuple and normalizes it into valid mass components.\",\n },\n {\n operator: \"vacuous\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Builds the canonical vacuous opinion with full uncertainty and an explicit base rate.\",\n },\n {\n operator: \"dogmatic\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Builds the canonical dogmatic opinion with zero uncertainty at a projected probability.\",\n },\n {\n operator: \"project\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements the canonical SL projected probability formula P = b + a*u.\",\n },\n {\n operator: \"trustDiscount\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements standard trust discounting by attenuating belief/disbelief mass and returning the remainder to uncertainty.\",\n },\n {\n operator: \"negate\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements canonical opinion negation by swapping belief and disbelief and complementing the base rate.\",\n },\n {\n operator: \"confidenceFromOpinion\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Projects a stored opinion into its canonical scalar probability without adding Lucern-specific heuristics.\",\n },\n {\n operator: \"confidenceFromSL\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Thin wrapper over the canonical SL projection formula for callers that provide tuple components directly.\",\n },\n {\n operator: \"opinionFromBaseRate\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Constructs the canonical vacuous opinion from a prior/base-rate probability.\",\n },\n {\n operator: \"opinionFromDogmatic\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Constructs the canonical dogmatic opinion from a projected probability and base rate.\",\n },\n {\n operator: \"opinionFromProjected\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Reconstructs a valid opinion from projected probability plus explicit uncertainty without changing the SL tuple semantics.\",\n },\n {\n operator: \"cumulativeFusion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements the cumulative fusion family, but Lucern averages base rates and special-cases dogmatic pairs instead of claiming a verbatim textbook transcription.\",\n },\n {\n operator: \"averagingFusion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements the averaging fusion family with Lucern-specific base-rate averaging and dogmatic shortcuts.\",\n },\n {\n operator: \"conditionalDeduction\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements textbook Jøsang conditional deduction over (b, d, u, a) tuples with explicit child base-rate derivation and uncertainty correction.\",\n },\n {\n operator: \"conditionalAbduction\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements inverse conditional reasoning through projected probabilities and a Lucern uncertainty floor rather than a full subjective-network derivation.\",\n },\n {\n operator: \"opinionFromDirichlet\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Bridges multinomial Dirichlet-style evidence counts into opinion mass with a configurable non-informative weight and normalized base-rate vector.\",\n },\n {\n operator: \"projectDirichletOpinion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Projects a Dirichlet opinion back into a multinomial probability vector rather than into Lucern's scalar node confidence.\",\n },\n {\n operator: \"opinionFromBeta\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Bridges Beta evidence counts into SL opinions, but exposes a configurable non-informative weight instead of locking the canonical bridge to W = 2.\",\n },\n {\n operator: \"betaFromOpinion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Bridges opinions back to Beta parameters while allowing a configurable non-informative weight and explicit dogmatic infinities.\",\n },\n {\n operator: \"dampedDependencyOpinion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/dynamics/cascade.ts\",\n rationale:\n \"Approximates dependency propagation with a threshold-or-damping scheme instead of a general SL network inference operator. Used as the fallback when edge metadata lacks explicit conditional opinions.\",\n },\n {\n operator: \"dampedDependencyCascade\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/dynamics/cascade.ts\",\n rationale:\n \"Wraps the damped dependency approximation and records it as dependency_cascade provenance for graph propagation. Fallback path for depends_on when edge conditionals are absent.\",\n },\n {\n operator: \"clamp01\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Implementation helper for Lucern APIs; it has no direct Jøsang operator analogue.\",\n },\n {\n operator: \"fromStorage\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"codec.ts\",\n rationale:\n \"Reads Lucern storage fields into a normalized opinion and reports repair metadata; it is storage glue, not SL algebra.\",\n },\n {\n operator: \"toStorage\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"codec.ts\",\n rationale:\n \"Serializes a normalized opinion into Lucern storage fields rather than implementing an SL algebra operator.\",\n },\n {\n operator: \"toStoredOpinionFields\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Serializes opinions into Lucern storage fields rather than implementing an SL algebra operator.\",\n },\n {\n operator: \"readOpinionFromRecord\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Deserializes opinion fields from Lucern record shapes and fallback aliases; it is storage glue, not SL.\",\n },\n {\n operator: \"opinionFromScalar\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Lucern convenience wrapper that multiplexes several scalar-to-opinion construction modes behind one API.\",\n },\n {\n operator: \"temporalDecay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/temporalDecay.ts\",\n rationale:\n \"Lucern temporal operator that exponentially ages evidential mass back into uncertainty while preserving the prior/base rate.\",\n },\n {\n operator: \"toDogmaticOpinion\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Deprecated Lucern shim retained for compatibility rather than as a canonical SL operator.\",\n },\n {\n operator: \"hasProjectedOpinionChanged\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Lucern propagation threshold helper that decides whether a write is materially different enough to fan out.\",\n },\n {\n operator: \"normalizeTupleContradictionPolicy\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contradiction/detectTupleContradiction.ts\",\n rationale:\n \"Normalizes Lucern tuple-contradiction thresholds; tuple contradiction is not a standard SL operator.\",\n },\n {\n operator: \"detectTupleContradiction\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contradiction/detectTupleContradiction.ts\",\n rationale:\n \"Lucern heuristic that flags simultaneous high belief and disbelief mass as a first-class contradiction state.\",\n },\n {\n operator: \"evaluateTupleContradictionTransition\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contradiction/detectTupleContradiction.ts\",\n rationale:\n \"Lucern transition helper that turns tuple-contradiction threshold crossings into workflow signals.\",\n },\n {\n operator: \"confidenceLevel\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Buckets opinions into Lucern UI labels; it is not part of Jøsang's operator set.\",\n },\n {\n operator: \"constraintFusion\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern exclusivity/XOR heuristic that pressures paired opinions; there is no direct textbook SL operator with this behavior.\",\n },\n {\n operator: \"evidenceBalance\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern analytic helper that summarizes resolved evidence tilt after uncertainty is excluded.\",\n },\n {\n operator: \"areTensioned\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern heuristic for surfacing opinion tension based on projected agreement plus residual disbelief mass.\",\n },\n {\n operator: \"informationGain\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern heuristic score over uncertainty and balance; it is neither Shannon entropy nor a named SL operator.\",\n },\n {\n operator: \"isPropagationEdgeType\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Lucern dispatch-table guard for graph edge semantics, not an SL algebra operator.\",\n },\n {\n operator: \"getPropagationTraversalSpecs\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Exposes the pure-module edge traversal ordering used by the local propagation helpers; graph-primitives owns the multi-hop runtime.\",\n },\n {\n operator: \"propagateThroughEdge\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Compiles Lucern edge types into operator application; the dispatch architecture itself has no direct Jøsang analogue.\",\n },\n {\n operator: \"propagateAllEdges\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Lucern bounded aggregator for ordered 1-hop dispatch results across edge families.\",\n },\n {\n operator: \"bayesianUpdate\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/revision.ts\",\n rationale:\n \"Scalar Bayesian helper retained by Lucern as a fallback revision primitive outside the canonical SL operator family.\",\n },\n {\n operator: \"reviseConfidence\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/revision.ts\",\n rationale:\n \"Lucern wrapper around the scalar Bayesian revision helper rather than a direct SL operator.\",\n },\n {\n operator: \"reviseConfidenceOpinion\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/revision.ts\",\n rationale:\n \"Lucern revision helper that exposes the Beta-bridge opinion behind scalar confidence revision.\",\n },\n {\n operator: \"computeBaseDecay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Lucern recency heuristic over scored beliefs; decay tiers are a product rule, not part of SL.\",\n },\n {\n operator: \"computeDeadlineUrgency\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Lucern deadline heuristic that modulates rescoring urgency outside the SL literature.\",\n },\n {\n operator: \"computeEffectiveDecay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Combines Lucern age, lifecycle, and deadline heuristics into an effective decay weight.\",\n },\n {\n operator: \"getRescoringSchedule\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Produces Lucern operational scheduling guidance for rescoring rather than opinion algebra.\",\n },\n {\n operator: \"decay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Applies Lucern time-decay heuristics to an opinion tuple; it is not a named Jøsang operator.\",\n },\n {\n operator: \"applyNegativeSupport\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/defeat.ts\",\n rationale:\n \"Lucern graph-specific defeater wrapper that chooses between XOR pressure and negation-plus-discount-plus-fusion.\",\n },\n {\n operator: \"applyNegativeEvidence\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/defeat.ts\",\n rationale:\n \"Lucern signed-edge wrapper that interprets negative evidence through a composed anti-opinion path.\",\n },\n {\n operator: \"deriveContractStatus\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Lucern contract-lifecycle helper with no direct relation to the SL operator family.\",\n },\n {\n operator: \"deriveVerificationTrigger\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Maps Lucern contract evaluation results into confidence triggers for workflow use.\",\n },\n {\n operator: \"deriveContractModulationPlan\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Computes Lucern confidence deltas from contract outcomes; contracts are a Lucern control surface, not SL.\",\n },\n {\n operator: \"createInheritedContractRecord\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Builds Lucern contract lineage records rather than confidence algebra.\",\n },\n {\n operator: \"normalizeEvidentialAction\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Normalizes Lucern evidential contract actions for workflow execution.\",\n },\n {\n operator: \"parseComparisonOperator\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses Lucern contract evaluator configuration; it is not an SL operator.\",\n },\n {\n operator: \"parseNumericThreshold\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Lucern contract-config helper for numeric thresholds.\",\n },\n {\n operator: \"pickFiniteNumber\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Lucern parser utility for evaluator configuration and snapshots.\",\n },\n {\n operator: \"getEvaluatorInputRecord\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Extracts Lucern evaluator payloads from nested runtime records.\",\n },\n {\n operator: \"parseEvidentialEvaluatorConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses Lucern evidential contract configuration into a typed evaluator plan.\",\n },\n {\n operator: \"compareMetricValue\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Executes Lucern contract comparison semantics rather than SL tuple algebra.\",\n },\n {\n operator: \"resolveComparisonResult\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Maps Lucern comparison outcomes into contract confirmation or disconfirmation.\",\n },\n {\n operator: \"buildComparisonRationale\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Renders Lucern contract-evaluation explanations for auditability.\",\n },\n {\n operator: \"buildEvidentialRationale\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Renders Lucern evidential evaluator explanations for auditability.\",\n },\n {\n operator: \"parseMetricCheckerConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses the Lucern metric-checker contract evaluator.\",\n },\n {\n operator: \"parseReferenceCheckCounterConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses the Lucern reference-check counter evaluator.\",\n },\n {\n operator: \"parseTemporalDeadlineConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses Lucern deadline-evaluator configuration for time-bounded claims.\",\n },\n {\n operator: \"parseMarketIndexComparatorConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses the Lucern market-index comparator evaluator.\",\n },\n] as const satisfies readonly OperatorTaxonomyEntry[];\n\nexport const OPERATOR_TAXONOMY = Object.freeze(\n Object.fromEntries(\n OPERATOR_TAXONOMY_ENTRIES.map((entry) => [entry.operator, entry])\n )\n) as Readonly<Record<ConfidenceOperatorName, OperatorTaxonomyEntry>>;\n\nexport const OPERATOR_TAXONOMY_BY_TAG = Object.freeze({\n SL_CANONICAL: SL_CANONICAL_OPERATOR_NAMES,\n SL_APPROXIMATION: SL_APPROXIMATION_OPERATOR_NAMES,\n LUCERN_SPECIFIC: LUCERN_SPECIFIC_OPERATOR_NAMES,\n}) as Readonly<Record<OperatorTaxonomyTag, readonly ConfidenceOperatorName[]>>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/v1/operations/approximation.ts","../../../src/v1/operations/canonical.ts","../../../src/v1/operations/lucern.ts","../../../src/v1/operations/operatorTaxonomy.ts"],"names":[],"mappings":";AAEO,IAAM,+BAAA,GAAkC;AAAA,EA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BAAoB,MAAA,CAAO,MAAA;AAAA,EACtC,MAAA,CAAO,WAAA;AAAA,IACL,yBAAA,CAA0B,IAAI,CAAC,KAAA,KAAU,CAAC,KAAA,CAAM,QAAA,EAAU,KAAK,CAAC;AAAA;AAEpE;AAEO,IAAM,wBAAA,GAA2B,OAAO,MAAA,CAAO;AAAA,EACpD,YAAA,EAAc,2BAAA;AAAA,EACd,gBAAA,EAAkB,+BAAA;AAAA,EAClB,eAAA,EAAiB;AACnB,CAAC","file":"operatorTaxonomy.js","sourcesContent":["// biome-ignore-all lint/performance/noBarrelFile: Public confidence approximation facade; splitting requires an export-map migration.\n\nexport const SL_APPROXIMATION_OPERATOR_NAMES = [\n \"cumulativeFusion\",\n \"averagingFusion\",\n \"conditionalAbduction\",\n \"opinionFromDirichlet\",\n \"projectDirichletOpinion\",\n \"opinionFromBeta\",\n \"betaFromOpinion\",\n \"dampedDependencyOpinion\",\n \"dampedDependencyCascade\",\n] as const;\n\nexport {\n betaFromOpinion,\n opinionFromBeta,\n opinionFromDirichlet,\n projectDirichletOpinion,\n} from \"./bridge\";\nexport {\n dampedDependencyCascade,\n dampedDependencyOpinion,\n} from \"./dynamics/cascade\";\nexport {\n averagingFusion,\n conditionalAbduction,\n cumulativeFusion,\n} from \"./subjectiveLogic\";\n","// biome-ignore-all lint/performance/noBarrelFile: Public confidence canonical facade; splitting requires an export-map migration.\n\nexport const SL_CANONICAL_OPERATOR_NAMES = [\n \"mkOpinion\",\n \"opinion\",\n \"vacuous\",\n \"dogmatic\",\n \"project\",\n \"trustDiscount\",\n \"negate\",\n \"conditionalDeduction\",\n \"confidenceFromOpinion\",\n \"confidenceFromSL\",\n \"opinionFromBaseRate\",\n \"opinionFromDogmatic\",\n \"opinionFromProjected\",\n] as const;\n\nexport {\n confidenceFromOpinion,\n confidenceFromSL,\n opinionFromBaseRate,\n opinionFromDogmatic,\n opinionFromProjected,\n} from \"./scoring\";\nexport {\n conditionalDeduction,\n dogmatic,\n mkOpinion,\n negate,\n opinion,\n project,\n trustDiscount,\n vacuous,\n} from \"./subjectiveLogic\";\n","// biome-ignore-all lint/performance/noBarrelFile: Public confidence lucern-specific facade; splitting requires an export-map migration.\n\nexport const LUCERN_SPECIFIC_OPERATOR_NAMES = [\n \"clamp01\",\n \"fromStorage\",\n \"toStorage\",\n \"toStoredOpinionFields\",\n \"readOpinionFromRecord\",\n \"opinionFromScalar\",\n \"temporalDecay\",\n \"toDogmaticOpinion\",\n \"hasProjectedOpinionChanged\",\n \"normalizeTupleContradictionPolicy\",\n \"detectTupleContradiction\",\n \"evaluateTupleContradictionTransition\",\n \"confidenceLevel\",\n \"constraintFusion\",\n \"evidenceBalance\",\n \"areTensioned\",\n \"informationGain\",\n \"isPropagationEdgeType\",\n \"getPropagationTraversalSpecs\",\n \"propagateThroughEdge\",\n \"propagateAllEdges\",\n \"bayesianUpdate\",\n \"reviseConfidence\",\n \"reviseConfidenceOpinion\",\n \"computeBaseDecay\",\n \"computeDeadlineUrgency\",\n \"computeEffectiveDecay\",\n \"getRescoringSchedule\",\n \"decay\",\n \"applyNegativeSupport\",\n \"applyNegativeEvidence\",\n \"deriveContractStatus\",\n \"deriveVerificationTrigger\",\n \"deriveContractModulationPlan\",\n \"createInheritedContractRecord\",\n \"normalizeEvidentialAction\",\n \"parseComparisonOperator\",\n \"parseNumericThreshold\",\n \"pickFiniteNumber\",\n \"getEvaluatorInputRecord\",\n \"parseEvidentialEvaluatorConfig\",\n \"compareMetricValue\",\n \"resolveComparisonResult\",\n \"buildComparisonRationale\",\n \"buildEvidentialRationale\",\n \"parseMetricCheckerConfig\",\n \"parseReferenceCheckCounterConfig\",\n \"parseTemporalDeadlineConfig\",\n \"parseMarketIndexComparatorConfig\",\n] as const;\n\nexport { fromStorage, toStorage } from \"../codec\";\nexport {\n buildComparisonRationale,\n buildEvidentialRationale,\n compareMetricValue,\n createInheritedContractRecord,\n deriveContractModulationPlan,\n deriveContractStatus,\n deriveVerificationTrigger,\n getEvaluatorInputRecord,\n normalizeEvidentialAction,\n parseComparisonOperator,\n parseEvidentialEvaluatorConfig,\n parseMarketIndexComparatorConfig,\n parseMetricCheckerConfig,\n parseNumericThreshold,\n parseReferenceCheckCounterConfig,\n parseTemporalDeadlineConfig,\n pickFiniteNumber,\n resolveComparisonResult,\n} from \"./contracts/epistemicContract\";\nexport {\n detectTupleContradiction,\n evaluateTupleContradictionTransition,\n normalizeTupleContradictionPolicy,\n} from \"./contradiction\";\nexport {\n computeBaseDecay,\n computeDeadlineUrgency,\n computeEffectiveDecay,\n decay,\n getRescoringSchedule,\n} from \"./dynamics/decay\";\nexport { applyNegativeEvidence, applyNegativeSupport } from \"./dynamics/defeat\";\nexport {\n getPropagationTraversalSpecs,\n isPropagationEdgeType,\n propagateAllEdges,\n propagateThroughEdge,\n} from \"./dynamics/propagation\";\nexport {\n bayesianUpdate,\n reviseConfidence,\n reviseConfidenceOpinion,\n} from \"./dynamics/revision\";\nexport {\n clamp01,\n hasProjectedOpinionChanged,\n opinionFromScalar,\n readOpinionFromRecord,\n toDogmaticOpinion,\n toStoredOpinionFields,\n} from \"./scoring\";\nexport {\n areTensioned,\n confidenceLevel,\n constraintFusion,\n evidenceBalance,\n informationGain,\n} from \"./subjectiveLogic\";\nexport { temporalDecay } from \"./temporalDecay\";\n","// biome-ignore-all lint/style/useFilenamingConvention: Published @lucern/confidence operator taxonomy subpath; rename needs an export-map migration.\n\nimport { SL_APPROXIMATION_OPERATOR_NAMES } from \"./approximation\";\nimport { SL_CANONICAL_OPERATOR_NAMES } from \"./canonical\";\nimport { LUCERN_SPECIFIC_OPERATOR_NAMES } from \"./lucern\";\n\nexport const OPERATOR_TAXONOMY_TAGS = [\n \"SL_CANONICAL\",\n \"SL_APPROXIMATION\",\n \"LUCERN_SPECIFIC\",\n] as const;\n\nexport type OperatorTaxonomyTag = (typeof OPERATOR_TAXONOMY_TAGS)[number];\nexport type ConfidenceOperatorName =\n | (typeof SL_CANONICAL_OPERATOR_NAMES)[number]\n | (typeof SL_APPROXIMATION_OPERATOR_NAMES)[number]\n | (typeof LUCERN_SPECIFIC_OPERATOR_NAMES)[number];\n\nexport interface OperatorTaxonomyEntry {\n readonly operator: ConfidenceOperatorName;\n readonly rationale: string;\n readonly sourceModule: string;\n readonly tag: OperatorTaxonomyTag;\n}\n\nexport const PUBLIC_OPERATOR_EXPORT_NAMES = [\n ...SL_CANONICAL_OPERATOR_NAMES,\n ...SL_APPROXIMATION_OPERATOR_NAMES,\n ...LUCERN_SPECIFIC_OPERATOR_NAMES,\n] as const;\n\nexport const OPERATOR_TAXONOMY_ENTRIES = [\n {\n operator: \"mkOpinion\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Constructs the canonical binomial SL opinion tuple and normalizes it into valid mass components.\",\n },\n {\n operator: \"opinion\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Constructs the canonical binomial SL opinion tuple and normalizes it into valid mass components.\",\n },\n {\n operator: \"vacuous\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Builds the canonical vacuous opinion with full uncertainty and an explicit base rate.\",\n },\n {\n operator: \"dogmatic\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Builds the canonical dogmatic opinion with zero uncertainty at a projected probability.\",\n },\n {\n operator: \"project\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements the canonical SL projected probability formula P = b + a*u.\",\n },\n {\n operator: \"trustDiscount\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements standard trust discounting by attenuating belief/disbelief mass and returning the remainder to uncertainty.\",\n },\n {\n operator: \"negate\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements canonical opinion negation by swapping belief and disbelief and complementing the base rate.\",\n },\n {\n operator: \"confidenceFromOpinion\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Projects a stored opinion into its canonical scalar probability without adding Lucern-specific heuristics.\",\n },\n {\n operator: \"confidenceFromSL\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Thin wrapper over the canonical SL projection formula for callers that provide tuple components directly.\",\n },\n {\n operator: \"opinionFromBaseRate\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Constructs the canonical vacuous opinion from a prior/base-rate probability.\",\n },\n {\n operator: \"opinionFromDogmatic\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Constructs the canonical dogmatic opinion from a projected probability and base rate.\",\n },\n {\n operator: \"opinionFromProjected\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Reconstructs a valid opinion from projected probability plus explicit uncertainty without changing the SL tuple semantics.\",\n },\n {\n operator: \"cumulativeFusion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements the cumulative fusion family, but Lucern averages base rates and special-cases dogmatic pairs instead of claiming a verbatim textbook transcription.\",\n },\n {\n operator: \"averagingFusion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements the averaging fusion family with Lucern-specific base-rate averaging and dogmatic shortcuts.\",\n },\n {\n operator: \"conditionalDeduction\",\n tag: \"SL_CANONICAL\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements textbook Jøsang conditional deduction over (b, d, u, a) tuples with explicit child base-rate derivation and uncertainty correction.\",\n },\n {\n operator: \"conditionalAbduction\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Implements inverse conditional reasoning through projected probabilities and a Lucern uncertainty floor rather than a full subjective-network derivation.\",\n },\n {\n operator: \"opinionFromDirichlet\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Bridges multinomial Dirichlet-style evidence counts into opinion mass with a configurable non-informative weight and normalized base-rate vector.\",\n },\n {\n operator: \"projectDirichletOpinion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Projects a Dirichlet opinion back into a multinomial probability vector rather than into Lucern's scalar node confidence.\",\n },\n {\n operator: \"opinionFromBeta\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Bridges Beta evidence counts into SL opinions, but exposes a configurable non-informative weight instead of locking the canonical bridge to W = 2.\",\n },\n {\n operator: \"betaFromOpinion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/bridge/index.ts\",\n rationale:\n \"Bridges opinions back to Beta parameters while allowing a configurable non-informative weight and explicit dogmatic infinities.\",\n },\n {\n operator: \"dampedDependencyOpinion\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/dynamics/cascade.ts\",\n rationale:\n \"Approximates dependency propagation with a threshold-or-damping scheme instead of a general SL network inference operator. Used as the fallback when edge metadata lacks explicit conditional opinions.\",\n },\n {\n operator: \"dampedDependencyCascade\",\n tag: \"SL_APPROXIMATION\",\n sourceModule: \"operations/dynamics/cascade.ts\",\n rationale:\n \"Wraps the damped dependency approximation and records it as dependency_cascade provenance for graph propagation. Fallback path for depends_on when edge conditionals are absent.\",\n },\n {\n operator: \"clamp01\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Implementation helper for Lucern APIs; it has no direct Jøsang operator analogue.\",\n },\n {\n operator: \"fromStorage\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"codec.ts\",\n rationale:\n \"Reads Lucern storage fields into a normalized opinion and reports repair metadata; it is storage glue, not SL algebra.\",\n },\n {\n operator: \"toStorage\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"codec.ts\",\n rationale:\n \"Serializes a normalized opinion into Lucern storage fields rather than implementing an SL algebra operator.\",\n },\n {\n operator: \"toStoredOpinionFields\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Serializes opinions into Lucern storage fields rather than implementing an SL algebra operator.\",\n },\n {\n operator: \"readOpinionFromRecord\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Deserializes opinion fields from Lucern record shapes and fallback aliases; it is storage glue, not SL.\",\n },\n {\n operator: \"opinionFromScalar\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Lucern convenience wrapper that multiplexes several scalar-to-opinion construction modes behind one API.\",\n },\n {\n operator: \"temporalDecay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/temporalDecay.ts\",\n rationale:\n \"Lucern temporal operator that exponentially ages evidential mass back into uncertainty while preserving the prior/base rate.\",\n },\n {\n operator: \"toDogmaticOpinion\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Deprecated Lucern shim retained for compatibility rather than as a canonical SL operator.\",\n },\n {\n operator: \"hasProjectedOpinionChanged\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/scoring.ts\",\n rationale:\n \"Lucern propagation threshold helper that decides whether a write is materially different enough to fan out.\",\n },\n {\n operator: \"normalizeTupleContradictionPolicy\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contradiction/detectTupleContradiction.ts\",\n rationale:\n \"Normalizes Lucern tuple-contradiction thresholds; tuple contradiction is not a standard SL operator.\",\n },\n {\n operator: \"detectTupleContradiction\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contradiction/detectTupleContradiction.ts\",\n rationale:\n \"Lucern heuristic that flags simultaneous high belief and disbelief mass as a first-class contradiction state.\",\n },\n {\n operator: \"evaluateTupleContradictionTransition\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contradiction/detectTupleContradiction.ts\",\n rationale:\n \"Lucern transition helper that turns tuple-contradiction threshold crossings into workflow signals.\",\n },\n {\n operator: \"confidenceLevel\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Buckets opinions into Lucern UI labels; it is not part of Jøsang's operator set.\",\n },\n {\n operator: \"constraintFusion\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern exclusivity/XOR heuristic that pressures paired opinions; there is no direct textbook SL operator with this behavior.\",\n },\n {\n operator: \"evidenceBalance\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern analytic helper that summarizes resolved evidence tilt after uncertainty is excluded.\",\n },\n {\n operator: \"areTensioned\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern heuristic for surfacing opinion tension based on projected agreement plus residual disbelief mass.\",\n },\n {\n operator: \"informationGain\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/subjectiveLogic/index.ts\",\n rationale:\n \"Lucern heuristic score over uncertainty and balance; it is neither Shannon entropy nor a named SL operator.\",\n },\n {\n operator: \"isPropagationEdgeType\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Lucern dispatch-table guard for graph edge semantics, not an SL algebra operator.\",\n },\n {\n operator: \"getPropagationTraversalSpecs\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Exposes the pure-module edge traversal ordering used by the local propagation helpers; graph-primitives owns the multi-hop runtime.\",\n },\n {\n operator: \"propagateThroughEdge\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Compiles Lucern edge types into operator application; the dispatch architecture itself has no direct Jøsang analogue.\",\n },\n {\n operator: \"propagateAllEdges\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/propagation.ts\",\n rationale:\n \"Lucern bounded aggregator for ordered 1-hop dispatch results across edge families.\",\n },\n {\n operator: \"bayesianUpdate\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/revision.ts\",\n rationale:\n \"Scalar Bayesian helper retained by Lucern as a fallback revision primitive outside the canonical SL operator family.\",\n },\n {\n operator: \"reviseConfidence\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/revision.ts\",\n rationale:\n \"Lucern wrapper around the scalar Bayesian revision helper rather than a direct SL operator.\",\n },\n {\n operator: \"reviseConfidenceOpinion\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/revision.ts\",\n rationale:\n \"Lucern revision helper that exposes the Beta-bridge opinion behind scalar confidence revision.\",\n },\n {\n operator: \"computeBaseDecay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Lucern recency heuristic over scored beliefs; decay tiers are a product rule, not part of SL.\",\n },\n {\n operator: \"computeDeadlineUrgency\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Lucern deadline heuristic that modulates rescoring urgency outside the SL literature.\",\n },\n {\n operator: \"computeEffectiveDecay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Combines Lucern age, lifecycle, and deadline heuristics into an effective decay weight.\",\n },\n {\n operator: \"getRescoringSchedule\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Produces Lucern operational scheduling guidance for rescoring rather than opinion algebra.\",\n },\n {\n operator: \"decay\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/decay.ts\",\n rationale:\n \"Applies Lucern time-decay heuristics to an opinion tuple; it is not a named Jøsang operator.\",\n },\n {\n operator: \"applyNegativeSupport\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/defeat.ts\",\n rationale:\n \"Lucern graph-specific defeater wrapper that chooses between XOR pressure and negation-plus-discount-plus-fusion.\",\n },\n {\n operator: \"applyNegativeEvidence\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/dynamics/defeat.ts\",\n rationale:\n \"Lucern signed-edge wrapper that interprets negative evidence through a composed anti-opinion path.\",\n },\n {\n operator: \"deriveContractStatus\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Lucern contract-lifecycle helper with no direct relation to the SL operator family.\",\n },\n {\n operator: \"deriveVerificationTrigger\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Maps Lucern contract evaluation results into confidence triggers for workflow use.\",\n },\n {\n operator: \"deriveContractModulationPlan\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Computes Lucern confidence deltas from contract outcomes; contracts are a Lucern control surface, not SL.\",\n },\n {\n operator: \"createInheritedContractRecord\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Builds Lucern contract lineage records rather than confidence algebra.\",\n },\n {\n operator: \"normalizeEvidentialAction\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Normalizes Lucern evidential contract actions for workflow execution.\",\n },\n {\n operator: \"parseComparisonOperator\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses Lucern contract evaluator configuration; it is not an SL operator.\",\n },\n {\n operator: \"parseNumericThreshold\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale: \"Lucern contract-config helper for numeric thresholds.\",\n },\n {\n operator: \"pickFiniteNumber\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Lucern parser utility for evaluator configuration and snapshots.\",\n },\n {\n operator: \"getEvaluatorInputRecord\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Extracts Lucern evaluator payloads from nested runtime records.\",\n },\n {\n operator: \"parseEvidentialEvaluatorConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses Lucern evidential contract configuration into a typed evaluator plan.\",\n },\n {\n operator: \"compareMetricValue\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Executes Lucern contract comparison semantics rather than SL tuple algebra.\",\n },\n {\n operator: \"resolveComparisonResult\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Maps Lucern comparison outcomes into contract confirmation or disconfirmation.\",\n },\n {\n operator: \"buildComparisonRationale\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Renders Lucern contract-evaluation explanations for auditability.\",\n },\n {\n operator: \"buildEvidentialRationale\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Renders Lucern evidential evaluator explanations for auditability.\",\n },\n {\n operator: \"parseMetricCheckerConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale: \"Parses the Lucern metric-checker contract evaluator.\",\n },\n {\n operator: \"parseReferenceCheckCounterConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale: \"Parses the Lucern reference-check counter evaluator.\",\n },\n {\n operator: \"parseTemporalDeadlineConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale:\n \"Parses Lucern deadline-evaluator configuration for time-bounded claims.\",\n },\n {\n operator: \"parseMarketIndexComparatorConfig\",\n tag: \"LUCERN_SPECIFIC\",\n sourceModule: \"operations/contracts/epistemicContract.ts\",\n rationale: \"Parses the Lucern market-index comparator evaluator.\",\n },\n] as const satisfies readonly OperatorTaxonomyEntry[];\n\nexport const OPERATOR_TAXONOMY = Object.freeze(\n Object.fromEntries(\n OPERATOR_TAXONOMY_ENTRIES.map((entry) => [entry.operator, entry])\n )\n) as Readonly<Record<ConfidenceOperatorName, OperatorTaxonomyEntry>>;\n\nexport const OPERATOR_TAXONOMY_BY_TAG = Object.freeze({\n SL_CANONICAL: SL_CANONICAL_OPERATOR_NAMES,\n SL_APPROXIMATION: SL_APPROXIMATION_OPERATOR_NAMES,\n LUCERN_SPECIFIC: LUCERN_SPECIFIC_OPERATOR_NAMES,\n}) as Readonly<Record<OperatorTaxonomyTag, readonly ConfidenceOperatorName[]>>;\n"]}
|
|
@@ -38,7 +38,8 @@ declare function opinionFromBaseRate(probability: number): SLOpinion;
|
|
|
38
38
|
declare function opinionFromDogmatic(probability: number, baseRate: number): SLOpinion;
|
|
39
39
|
/**
|
|
40
40
|
* Interpret p as a projected probability with an explicit uncertainty bucket.
|
|
41
|
-
*
|
|
41
|
+
* Uses the requested uncertainty when representable; otherwise lowers it so the
|
|
42
|
+
* resulting opinion stays valid and projects back to p.
|
|
42
43
|
*/
|
|
43
44
|
declare function opinionFromProjected(probability: number, uncertainty: number, baseRate: number): SLOpinion;
|
|
44
45
|
declare function hasProjectedOpinionChanged(current: Opinion, next: Opinion, tolerance?: number): boolean;
|
|
@@ -101,7 +101,9 @@ function opinionFromScalar(value, mode, options) {
|
|
|
101
101
|
return mkOpinion(0, 0, 1, clampedValue);
|
|
102
102
|
case "dogmatic":
|
|
103
103
|
if (baseRate === void 0) {
|
|
104
|
-
throw new Error(
|
|
104
|
+
throw new Error(
|
|
105
|
+
'opinionFromScalar(value, "dogmatic") requires options.baseRate.'
|
|
106
|
+
);
|
|
105
107
|
}
|
|
106
108
|
return mkOpinion(clampedValue, 1 - clampedValue, 0, baseRate);
|
|
107
109
|
case "projected_with_u": {
|
|
@@ -125,8 +127,9 @@ function opinionFromScalar(value, mode, options) {
|
|
|
125
127
|
baseRate
|
|
126
128
|
);
|
|
127
129
|
}
|
|
130
|
+
default:
|
|
131
|
+
throw new Error(`Unsupported opinionFromScalar mode: ${mode}`);
|
|
128
132
|
}
|
|
129
|
-
throw new Error(`Unsupported opinionFromScalar mode: ${mode}`);
|
|
130
133
|
}
|
|
131
134
|
function toDogmaticOpinion(confidence, baseRate) {
|
|
132
135
|
return opinionFromScalar(confidence, "dogmatic", { baseRate });
|
|
@@ -137,11 +140,23 @@ function opinionFromBaseRate(probability) {
|
|
|
137
140
|
function opinionFromDogmatic(probability, baseRate) {
|
|
138
141
|
return dogmatic(clamp01(probability), clamp01(baseRate));
|
|
139
142
|
}
|
|
143
|
+
function representableProjectedUncertainty(probability, uncertainty, baseRate) {
|
|
144
|
+
const maxBeliefUncertainty = baseRate > 0 ? probability / baseRate : Number.POSITIVE_INFINITY;
|
|
145
|
+
const maxDisbeliefUncertainty = baseRate < 1 ? (1 - probability) / (1 - baseRate) : Number.POSITIVE_INFINITY;
|
|
146
|
+
return clamp01(
|
|
147
|
+
Math.min(uncertainty, maxBeliefUncertainty, maxDisbeliefUncertainty)
|
|
148
|
+
);
|
|
149
|
+
}
|
|
140
150
|
function opinionFromProjected(probability, uncertainty, baseRate) {
|
|
141
151
|
const p = clamp01(probability);
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
return mkOpinion(
|
|
152
|
+
const a = clamp01(baseRate);
|
|
153
|
+
const u = representableProjectedUncertainty(p, clamp01(uncertainty), a);
|
|
154
|
+
return mkOpinion(
|
|
155
|
+
Math.max(0, p - a * u),
|
|
156
|
+
Math.max(0, 1 - p - (1 - a) * u),
|
|
157
|
+
u,
|
|
158
|
+
a
|
|
159
|
+
);
|
|
145
160
|
}
|
|
146
161
|
function hasProjectedOpinionChanged(current, next, tolerance = 0.01) {
|
|
147
162
|
return Math.abs(confidenceFromOpinion(next) - confidenceFromOpinion(current)) >= tolerance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/v1/operations/subjectiveLogic/index.ts","../../../src/v1/operations/scoring.ts"],"names":["opinion"],"mappings":";AAEO,SAAS,OAAA,CACd,MAAA,EACA,SAAA,EACA,WAAA,EACA,QAAA,EACW;AACX,EAAA,MAAM,CAAA,GAAI,OAAO,QAAA,CAAS,MAAM,IAAI,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,MAAM,CAAA,GAAI,CAAA;AAC1D,EAAA,MAAM,CAAA,GAAI,OAAO,QAAA,CAAS,SAAS,IAAI,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,SAAS,CAAA,GAAI,CAAA;AAChE,EAAA,MAAM,CAAA,GAAI,OAAO,QAAA,CAAS,WAAW,IAAI,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,WAAW,CAAA,GAAI,CAAA;AACpE,EAAA,MAAM,CAAA,GAAI,KAAK,GAAA,CAAI,CAAA,EAAG,KAAK,GAAA,CAAI,CAAA,EAAG,QAAQ,CAAC,CAAA;AAC3C,EAAA,MAAM,GAAA,GAAM,IAAI,CAAA,GAAI,CAAA;AAEpB,EAAA,IAAI,QAAQ,CAAA,EAAG;AACb,IAAA,OAAO,EAAE,CAAA,EAAG,CAAA,EAAG,GAAG,CAAA,EAAG,CAAA,EAAG,GAAG,CAAA,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KAAA,CAAM,CAAA,oCAAA,EAAuC,IAAI,CAAA,CAAE,CAAA;AAC/D;AAKO,SAAS,iBAAA,CACd,YACA,QAAA,EACW;AACX,EAAA,OAAO,iBAAA,CAAkB,UAAA,EAAY,UAAA,EAAY,EAAE,UAAU,CAAA;AAC/D;AAGO,SAAS,oBAAoB,WAAA,EAAgC;AAClE,EAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,WAAW,CAAC,CAAA;AACrC;AAGO,SAAS,mBAAA,CACd,aACA,QAAA,EACW;AACX,EAAA,OAAO,SAAS,OAAA,CAAQ,WAAW,CAAA,EAAG,OAAA,CAAQ,QAAQ,CAAC,CAAA;AACzD;AAMO,SAAS,oBAAA,CACd,WAAA,EACA,WAAA,EACA,QAAA,EACW;AACX,EAAA,MAAM,CAAA,GAAI,QAAQ,WAAW,CAAA;AAC7B,EAAA,MAAM,CAAA,GAAI,QAAQ,WAAW,CAAA;AAC7B,EAAA,MAAM,gBAAgB,CAAA,GAAI,CAAA;AAC1B,EAAA,OAAO,SAAA,CAAU,IAAI,aAAA,EAAA,CAAgB,CAAA,GAAI,KAAK,aAAA,EAAe,CAAA,EAAG,OAAA,CAAQ,QAAQ,CAAC,CAAA;AACnF;AAEO,SAAS,0BAAA,CACd,OAAA,EACA,IAAA,EACA,SAAA,GAAoB,IAAA,EACX;AACT,EAAA,OAAO,IAAA,CAAK,IAAI,qBAAA,CAAsB,IAAI,IAAI,qBAAA,CAAsB,OAAO,CAAC,CAAA,IAC1E,SAAA;AACJ","file":"scoring.js","sourcesContent":["import type { SLOpinion } from \"../../types\";\n\nexport function opinion(\n belief: number,\n disbelief: number,\n uncertainty: number,\n baseRate: number\n): SLOpinion {\n const b = Number.isFinite(belief) ? Math.max(0, belief) : 0;\n const d = Number.isFinite(disbelief) ? Math.max(0, disbelief) : 0;\n const u = Number.isFinite(uncertainty) ? Math.max(0, uncertainty) : 0;\n const a = Math.max(0, Math.min(1, baseRate));\n const sum = b + d + u;\n\n if (sum === 0) {\n return { b: 0, d: 0, u: 1, a } as SLOpinion;\n }\n\n return {\n b: b / sum,\n d: d / sum,\n u: u / sum,\n a,\n } as SLOpinion;\n}\n\nexport function mkOpinion(\n belief: number,\n disbelief: number,\n uncertainty: number,\n baseRate: number\n): SLOpinion {\n return opinion(belief, disbelief, uncertainty, baseRate);\n}\n\nexport function vacuous(baseRate: number): SLOpinion {\n return mkOpinion(0, 0, 1, baseRate);\n}\n\nexport function dogmatic(probability: number, baseRate: number): SLOpinion {\n const p = Math.max(0, Math.min(1, probability));\n return mkOpinion(p, 1 - p, 0, baseRate);\n}\n\nexport function project(o: SLOpinion): number {\n return o.b + o.a * o.u;\n}\n\nexport function confidenceLevel(o: SLOpinion): \"high\" | \"medium\" | \"low\" {\n const projected = project(o);\n if (o.u > 0.5) {\n return \"low\";\n }\n if (projected >= 0.8 && o.u < 0.2) {\n return \"high\";\n }\n if (projected >= 0.6) {\n return \"medium\";\n }\n return \"low\";\n}\n\nconst VACUOUS_IDENTITY_EPSILON = 1e-12;\n\n/**\n * Associative, vacuous-identity-preserving base rate for a fused opinion.\n *\n * The legacy `(left.a + right.a) / 2` arithmetic mean was the shared root of\n * RR.7 F1 (projected-confidence non-associativity) and F2 (a vacuous opinion of\n * a different base rate was not a fusion identity): averaging always pulled the\n * fused base rate toward the other operand even when that operand carried no\n * evidence. Subjective Logic requires every opinion over the same frame to share\n * one canonical base rate, so a correct fusion never *invents* a new base rate\n * from the operands' priors. We therefore:\n *\n * - return the informative operand's base rate when exactly one operand is\n * vacuous (the vacuous operand contributes no prior), making `vacuous(a)` a\n * true identity for any `a`; and\n * - require equal base rates otherwise (the canonical-frame contract). When\n * they coincide the result is that shared value — trivially associative.\n *\n * If two informative opinions carry genuinely different base rates they are not\n * opinions over the same frame and must be reconciled before fusion; we fall\n * back to the arithmetic mean ONLY in that ill-posed case to stay total, and the\n * property suite documents that this path is outside the order-independence\n * guarantee.\n */\nfunction fusedBaseRate(left: SLOpinion, right: SLOpinion): number {\n const leftVacuous = 1 - left.u <= VACUOUS_IDENTITY_EPSILON;\n const rightVacuous = 1 - right.u <= VACUOUS_IDENTITY_EPSILON;\n if (leftVacuous && !rightVacuous) {\n return right.a;\n }\n if (rightVacuous && !leftVacuous) {\n return left.a;\n }\n if (Math.abs(left.a - right.a) <= VACUOUS_IDENTITY_EPSILON) {\n return left.a;\n }\n return (left.a + right.a) / 2;\n}\n\nexport function cumulativeFusion(left: SLOpinion, right: SLOpinion): SLOpinion {\n const a = fusedBaseRate(left, right);\n\n // F2: a vacuous operand is the identity element of cumulative fusion. Return\n // the other operand verbatim (including its base rate) so fusion with the\n // vacuous opinion is a true no-op regardless of differing priors.\n if (1 - left.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(right.b, right.d, right.u, a);\n }\n if (1 - right.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(left.b, left.d, left.u, a);\n }\n\n // F4: dogmatic pair handled via the ε-limit of the cumulative rule rather than\n // the standalone `(b+d)/2` shortcut. As both uncertainties shrink at the same\n // rate, the cumulative formula's `(b_L·u_R + b_R·u_L)/k` term converges to the\n // arithmetic mean of the masses; deriving it from the same limit the interior\n // formula uses keeps mass-associativity intact (no special-case discontinuity).\n if (left.u <= VACUOUS_IDENTITY_EPSILON && right.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion((left.b + right.b) / 2, (left.d + right.d) / 2, 0, a);\n }\n\n const k = left.u + right.u - left.u * right.u;\n if (k === 0) {\n return vacuous(a);\n }\n\n return opinion(\n (left.b * right.u + right.b * left.u) / k,\n (left.d * right.u + right.d * left.u) / k,\n (left.u * right.u) / k,\n a\n );\n}\n\nexport function averagingFusion(left: SLOpinion, right: SLOpinion): SLOpinion {\n const a = fusedBaseRate(left, right);\n\n // F2: vacuous identity, mirroring cumulativeFusion.\n if (1 - left.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(right.b, right.d, right.u, a);\n }\n if (1 - right.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(left.b, left.d, left.u, a);\n }\n\n // F4: dogmatic pair via the ε-limit of the averaging rule.\n if (left.u <= VACUOUS_IDENTITY_EPSILON && right.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion((left.b + right.b) / 2, (left.d + right.d) / 2, 0, a);\n }\n\n const k = left.u + right.u;\n if (k === 0) {\n return vacuous(a);\n }\n\n return opinion(\n (left.b * right.u + right.b * left.u) / k,\n (left.d * right.u + right.d * left.u) / k,\n (2 * left.u * right.u) / k,\n a\n );\n}\n\nexport function trustDiscount(sourceOpinion: SLOpinion, trust: number): SLOpinion {\n const weight = Math.max(0, Math.min(1, Math.abs(trust)));\n return opinion(\n weight * sourceOpinion.b,\n weight * sourceOpinion.d,\n 1 - weight * (sourceOpinion.b + sourceOpinion.d),\n sourceOpinion.a\n );\n}\n\nconst EPSILON = 1e-9;\n\nfunction childBaseRateFallback(\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n fallbackBaseRate: number | undefined\n): number {\n if (fallbackBaseRate !== undefined) {\n return Math.max(0, Math.min(1, fallbackBaseRate));\n }\n\n if (Math.abs(ifTrue.a - ifFalse.a) <= EPSILON) {\n return ifTrue.a;\n }\n\n return (ifTrue.a + ifFalse.a) / 2;\n}\n\nfunction computeConditionalDeductionBaseRate(\n opinionA: SLOpinion,\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n fallbackBaseRate: number\n): number {\n const denominator =\n 1 - opinionA.a * ifTrue.u - (1 - opinionA.a) * ifFalse.u;\n\n if (ifTrue.u + ifFalse.u < 2 - EPSILON && Math.abs(denominator) > EPSILON) {\n const baseRate =\n (opinionA.a * ifTrue.b + (1 - opinionA.a) * ifFalse.b) / denominator;\n if (baseRate >= -EPSILON && baseRate <= 1 + EPSILON) {\n return Math.max(0, Math.min(1, baseRate));\n }\n }\n\n return fallbackBaseRate;\n}\n\nfunction safeCorrectionTerm(\n numerator: number,\n denominator: number\n): number | undefined {\n if (Math.abs(denominator) <= EPSILON) {\n return undefined;\n }\n\n const value = numerator / denominator;\n if (!Number.isFinite(value)) {\n return undefined;\n }\n\n return Math.max(0, value);\n}\n\nexport function conditionalDeduction(\n opinionA: SLOpinion,\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n fallbackBaseRate?: number\n): SLOpinion {\n const fallbackChildBaseRate = childBaseRateFallback(\n ifTrue,\n ifFalse,\n fallbackBaseRate\n );\n const childBaseRate = computeConditionalDeductionBaseRate(\n opinionA,\n ifTrue,\n ifFalse,\n fallbackChildBaseRate\n );\n const projectedAntecedent = project(opinionA);\n const projectedAntecedentComplement = 1 - projectedAntecedent;\n const intermediateBelief =\n opinionA.b * ifTrue.b +\n opinionA.d * ifFalse.b +\n opinionA.u * (ifTrue.b * opinionA.a + ifFalse.b * (1 - opinionA.a));\n const intermediateDisbelief =\n opinionA.b * ifTrue.d +\n opinionA.d * ifFalse.d +\n opinionA.u * (ifTrue.d * opinionA.a + ifFalse.d * (1 - opinionA.a));\n const intermediateUncertainty =\n opinionA.b * ifTrue.u +\n opinionA.d * ifFalse.u +\n opinionA.u * (ifTrue.u * opinionA.a + ifFalse.u * (1 - opinionA.a));\n const projectedVacuousDeduction =\n ifTrue.b * opinionA.a +\n ifFalse.b * (1 - opinionA.a) +\n childBaseRate *\n (ifTrue.u * opinionA.a + ifFalse.u * (1 - opinionA.a));\n const projectedConditionalA =\n ifTrue.b + childBaseRate * (1 - ifTrue.b - ifTrue.d);\n let correction = 0;\n\n if (\n (ifTrue.b > ifFalse.b && ifTrue.d > ifFalse.d) ||\n (ifTrue.b <= ifFalse.b && ifTrue.d <= ifFalse.d)\n ) {\n correction = 0;\n } else if (ifTrue.b > ifFalse.b && ifTrue.d <= ifFalse.d) {\n const beliefGap = ifTrue.b - ifFalse.b;\n const disbeliefGap = ifFalse.d - ifTrue.d;\n\n if (\n projectedVacuousDeduction <= projectedConditionalA &&\n projectedAntecedent <= opinionA.a\n ) {\n correction =\n safeCorrectionTerm(\n opinionA.a * opinionA.u * (intermediateBelief - ifTrue.b),\n projectedAntecedent * childBaseRate\n ) ?? 0;\n } else if (\n projectedVacuousDeduction <= projectedConditionalA &&\n projectedAntecedent > opinionA.a\n ) {\n correction =\n safeCorrectionTerm(\n opinionA.a * opinionA.u * (intermediateDisbelief - ifTrue.d) * beliefGap,\n projectedAntecedentComplement * childBaseRate * disbeliefGap\n ) ?? 0;\n } else if (\n projectedVacuousDeduction > projectedConditionalA &&\n projectedAntecedent <= opinionA.a\n ) {\n correction =\n safeCorrectionTerm(\n (1 - opinionA.a) *\n opinionA.u *\n (intermediateBelief - ifTrue.b) *\n disbeliefGap,\n projectedAntecedent * (1 - childBaseRate) * beliefGap\n ) ?? 0;\n } else {\n correction =\n safeCorrectionTerm(\n (1 - opinionA.a) * opinionA.u * (intermediateDisbelief - ifTrue.d),\n projectedAntecedentComplement * (1 - childBaseRate)\n ) ?? 0;\n }\n } else {\n const beliefGap = ifFalse.b - ifTrue.b;\n const disbeliefGap = ifTrue.d - ifFalse.d;\n\n if (\n projectedVacuousDeduction <= projectedConditionalA &&\n projectedAntecedent <= opinionA.a\n ) {\n correction =\n safeCorrectionTerm(\n (1 - opinionA.a) *\n opinionA.u *\n (intermediateDisbelief - ifTrue.d) *\n beliefGap,\n projectedAntecedent * childBaseRate * disbeliefGap\n ) ?? 0;\n } else if (\n projectedVacuousDeduction <= projectedConditionalA &&\n projectedAntecedent > opinionA.a\n ) {\n correction =\n safeCorrectionTerm(\n (1 - opinionA.a) * opinionA.u * (intermediateBelief - ifTrue.b),\n projectedAntecedentComplement * childBaseRate\n ) ?? 0;\n } else if (\n projectedVacuousDeduction > projectedConditionalA &&\n projectedAntecedent <= opinionA.a\n ) {\n correction =\n safeCorrectionTerm(\n opinionA.a * opinionA.u * (intermediateDisbelief - ifTrue.d),\n projectedAntecedent * (1 - childBaseRate)\n ) ?? 0;\n } else {\n correction =\n safeCorrectionTerm(\n opinionA.a *\n opinionA.u *\n (intermediateBelief - ifTrue.b) *\n disbeliefGap,\n projectedAntecedentComplement * (1 - childBaseRate) * beliefGap\n ) ?? 0;\n }\n }\n\n return opinion(\n intermediateBelief - childBaseRate * correction,\n intermediateDisbelief - (1 - childBaseRate) * correction,\n intermediateUncertainty + correction,\n childBaseRate\n );\n}\n\n/**\n * Abductive inference over a conditional.\n * Given an opinion on Y and conditionals P(Y|X), P(Y|~X), infer an opinion on X.\n */\nexport function conditionalAbduction(\n opinionY: SLOpinion,\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n baseRateX: number\n): SLOpinion {\n const priorX = Math.max(0, Math.min(1, baseRateX));\n const probabilityY = project(opinionY);\n const probabilityGivenTrue = project(ifTrue);\n const probabilityGivenFalse = project(ifFalse);\n\n const posteriorIfYDenominator =\n probabilityGivenTrue * priorX +\n probabilityGivenFalse * (1 - priorX);\n const posteriorIfY =\n posteriorIfYDenominator === 0\n ? priorX\n : (probabilityGivenTrue * priorX) / posteriorIfYDenominator;\n\n const posteriorIfNotYDenominator =\n (1 - probabilityGivenTrue) * priorX +\n (1 - probabilityGivenFalse) * (1 - priorX);\n const posteriorIfNotY =\n posteriorIfNotYDenominator === 0\n ? priorX\n : ((1 - probabilityGivenTrue) * priorX) / posteriorIfNotYDenominator;\n\n const projectedX =\n probabilityY * posteriorIfY + (1 - probabilityY) * posteriorIfNotY;\n const uncertainty = Math.max(\n opinionY.u * 0.5,\n probabilityY * ifTrue.u + (1 - probabilityY) * ifFalse.u\n );\n\n return opinion(\n projectedX * (1 - uncertainty),\n (1 - projectedX) * (1 - uncertainty),\n uncertainty,\n priorX\n );\n}\n\nexport function negate(o: SLOpinion): SLOpinion {\n return mkOpinion(o.d, o.b, o.u, 1 - o.a);\n}\n\nexport function constraintFusion(\n left: SLOpinion,\n right: SLOpinion,\n mode: \"pressure\" | \"redistribute\" = \"pressure\"\n): { o1: SLOpinion; o2: SLOpinion } {\n if (mode === \"redistribute\") {\n const leftProjected = project(left);\n const rightProjected = project(right);\n const total = leftProjected + rightProjected;\n\n if (total <= 1) {\n return { o1: left, o2: right };\n }\n\n const scale = 1 / total;\n return {\n o1: opinion(\n left.b * scale,\n left.d + left.b * (1 - scale),\n left.u,\n left.a\n ),\n o2: opinion(\n right.b * scale,\n right.d + right.b * (1 - scale),\n right.u,\n right.a\n ),\n };\n }\n\n const pressureLeft = right.b * 0.5;\n const pressureRight = left.b * 0.5;\n\n return {\n o1: opinion(\n left.b - pressureLeft * 0.3,\n left.d + pressureLeft * 0.3,\n left.u,\n left.a\n ),\n o2: opinion(\n right.b - pressureRight * 0.3,\n right.d + pressureRight * 0.3,\n right.u,\n right.a\n ),\n };\n}\n\nexport function evidenceBalance(o: SLOpinion): number {\n const total = o.b + o.d;\n if (total === 0) {\n return 0;\n }\n return (o.b - o.d) / total;\n}\n\nexport function areTensioned(left: SLOpinion, right: SLOpinion): boolean {\n return (\n project(left) > 0.5 &&\n project(right) > 0.5 &&\n (left.d > 0.2 || right.d > 0.2)\n );\n}\n\nexport function informationGain(o: SLOpinion): number {\n if (o.u === 0) {\n return 0;\n }\n if (o.u === 1) {\n return 1;\n }\n return o.u * (1 - Math.abs(o.b - o.d));\n}\n","import type { Opinion, SLOpinion, StoredOpinionFields } from \"../types\";\nimport { dogmatic, mkOpinion, vacuous } from \"./subjectiveLogic\";\n\nfunction finiteNumber(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value) ? value : undefined;\n}\n\nfunction requiredOpinionNumber(label: string, ...values: unknown[]): number {\n for (const value of values) {\n const numberValue = finiteNumber(value);\n if (numberValue !== undefined) {\n return numberValue;\n }\n }\n throw new Error(`Opinion record is missing required ${label}.`);\n}\n\nexport function clamp01(value: number): number {\n return Math.max(0, Math.min(1, value));\n}\n\nexport function confidenceFromOpinion(opinion: Opinion): number {\n return clamp01(opinion.b + opinion.a * opinion.u);\n}\n\nexport function confidenceFromSL(\n belief: number,\n _disbelief: number,\n uncertainty: number,\n baseRate: number\n): number {\n return confidenceFromOpinion({\n b: belief,\n d: _disbelief,\n u: uncertainty,\n a: baseRate,\n });\n}\n\nexport function toStoredOpinionFields(opinion: Opinion): StoredOpinionFields {\n return {\n belief: opinion.b,\n disbelief: opinion.d,\n uncertainty: opinion.u,\n baseRate: opinion.a,\n };\n}\n\nexport function readOpinionFromRecord(\n source: unknown\n): SLOpinion {\n const record =\n source && typeof source === \"object\"\n ? (source as Record<string, unknown>)\n : {};\n\n return mkOpinion(\n requiredOpinionNumber(\n \"belief\",\n record.b,\n record.belief,\n record.slBelief,\n record.opinion_b\n ),\n requiredOpinionNumber(\n \"disbelief\",\n record.d,\n record.disbelief,\n record.slDisbelief,\n record.opinion_d\n ),\n requiredOpinionNumber(\n \"uncertainty\",\n record.u,\n record.uncertainty,\n record.slUncertainty,\n record.opinion_u\n ),\n requiredOpinionNumber(\n \"baseRate\",\n record.a,\n record.baseRate,\n record.slBaseRate,\n record.opinion_a\n )\n );\n}\n\nexport type OpinionFromScalarMode =\n | \"base_rate\"\n | \"dogmatic\"\n | \"projected_with_u\";\n\nexport type OpinionFromScalarOptions =\n | { baseRate?: never; uncertainty?: never }\n | { baseRate: number; uncertainty?: never }\n | { baseRate: number; uncertainty: number };\n\nexport function opinionFromScalar(\n value: number,\n mode: \"base_rate\",\n options?: { baseRate?: never; uncertainty?: never }\n): SLOpinion;\nexport function opinionFromScalar(\n value: number,\n mode: \"dogmatic\",\n options: { baseRate: number; uncertainty?: never }\n): SLOpinion;\nexport function opinionFromScalar(\n value: number,\n mode: \"projected_with_u\",\n options: { baseRate: number; uncertainty: number }\n): SLOpinion;\nexport function opinionFromScalar(\n value: number,\n mode: OpinionFromScalarMode,\n options?: OpinionFromScalarOptions\n): SLOpinion {\n const clampedValue = clamp01(value);\n const baseRate =\n options?.baseRate === undefined ? undefined : clamp01(options.baseRate);\n\n switch (mode) {\n case \"base_rate\":\n return mkOpinion(0, 0, 1, clampedValue);\n case \"dogmatic\":\n if (baseRate === undefined) {\n throw new Error(\"opinionFromScalar(value, \\\"dogmatic\\\") requires options.baseRate.\");\n }\n return mkOpinion(clampedValue, 1 - clampedValue, 0, baseRate);\n case \"projected_with_u\": {\n if (baseRate === undefined) {\n throw new Error(\n \"opinionFromScalar(value, \\\"projected_with_u\\\") requires options.baseRate.\"\n );\n }\n const uncertainty = options?.uncertainty;\n if (uncertainty === undefined) {\n throw new Error(\n \"opinionFromScalar(value, \\\"projected_with_u\\\") requires options.uncertainty.\"\n );\n }\n const clampedUncertainty = clamp01(uncertainty);\n const evidenceWeight = 1 - clampedUncertainty;\n return mkOpinion(\n clampedValue * evidenceWeight,\n (1 - clampedValue) * evidenceWeight,\n clampedUncertainty,\n baseRate\n );\n }\n }\n\n throw new Error(`Unsupported opinionFromScalar mode: ${mode}`);\n}\n\n/**\n * @deprecated Use opinionFromScalar(value, \"dogmatic\", { baseRate }) instead.\n */\nexport function toDogmaticOpinion(\n confidence: number,\n baseRate: number\n): SLOpinion {\n return opinionFromScalar(confidence, \"dogmatic\", { baseRate });\n}\n\n/** Interpret p as a prior with no observed evidence. */\nexport function opinionFromBaseRate(probability: number): SLOpinion {\n return vacuous(clamp01(probability));\n}\n\n/** Interpret p as a certainty-equivalent projected probability. */\nexport function opinionFromDogmatic(\n probability: number,\n baseRate: number\n): SLOpinion {\n return dogmatic(clamp01(probability), clamp01(baseRate));\n}\n\n/**\n * Interpret p as a projected probability with an explicit uncertainty bucket.\n * The resulting opinion always projects back to p.\n */\nexport function opinionFromProjected(\n probability: number,\n uncertainty: number,\n baseRate: number\n): SLOpinion {\n const p = clamp01(probability);\n const u = clamp01(uncertainty);\n const remainingMass = 1 - u;\n return mkOpinion(p * remainingMass, (1 - p) * remainingMass, u, clamp01(baseRate));\n}\n\nexport function hasProjectedOpinionChanged(\n current: Opinion,\n next: Opinion,\n tolerance: number = 0.01\n): boolean {\n return Math.abs(confidenceFromOpinion(next) - confidenceFromOpinion(current)) >=\n tolerance;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/v1/operations/subjectiveLogic/index.ts","../../../src/v1/operations/scoring.ts"],"names":["opinion"],"mappings":";AAEO,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GACJ,QAAA,GAAW,CAAA,GAAI,WAAA,GAAc,WAAW,MAAA,CAAO,iBAAA;AACjD,EAAA,MAAM,0BACJ,QAAA,GAAW,CAAA,GAAA,CACN,IAAI,WAAA,KAAgB,CAAA,GAAI,YACzB,MAAA,CAAO,iBAAA;AAEb,EAAA,OAAO,OAAA;AAAA,IACL,IAAA,CAAK,GAAA,CAAI,WAAA,EAAa,oBAAA,EAAsB,uBAAuB;AAAA,GACrE;AACF;AAOO,SAAS,oBAAA,CACd,WAAA,EACA,WAAA,EACA,QAAA,EACW;AACX,EAAA,MAAM,CAAA,GAAI,QAAQ,WAAW,CAAA;AAC7B,EAAA,MAAM,CAAA,GAAI,QAAQ,QAAQ,CAAA;AAC1B,EAAA,MAAM,IAAI,iCAAA,CAAkC,CAAA,EAAG,OAAA,CAAQ,WAAW,GAAG,CAAC,CAAA;AACtE,EAAA,OAAO,SAAA;AAAA,IACL,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,CAAA,GAAI,IAAI,CAAC,CAAA;AAAA,IACrB,KAAK,GAAA,CAAI,CAAA,EAAG,IAAI,CAAA,GAAA,CAAK,CAAA,GAAI,KAAK,CAAC,CAAA;AAAA,IAC/B,CAAA;AAAA,IACA;AAAA,GACF;AACF;AAEO,SAAS,0BAAA,CACd,OAAA,EACA,IAAA,EACA,SAAA,GAAY,IAAA,EACH;AACT,EAAA,OACE,IAAA,CAAK,IAAI,qBAAA,CAAsB,IAAI,IAAI,qBAAA,CAAsB,OAAO,CAAC,CAAA,IACrE,SAAA;AAEJ","file":"scoring.js","sourcesContent":["import type { SLOpinion } from \"../../types\";\n\nexport function opinion(\n belief: number,\n disbelief: number,\n uncertainty: number,\n baseRate: number\n): SLOpinion {\n const b = Number.isFinite(belief) ? Math.max(0, belief) : 0;\n const d = Number.isFinite(disbelief) ? Math.max(0, disbelief) : 0;\n const u = Number.isFinite(uncertainty) ? Math.max(0, uncertainty) : 0;\n const a = Math.max(0, Math.min(1, baseRate));\n const sum = b + d + u;\n\n if (sum === 0) {\n return { b: 0, d: 0, u: 1, a } as SLOpinion;\n }\n\n return {\n b: b / sum,\n d: d / sum,\n u: u / sum,\n a,\n } as SLOpinion;\n}\n\nexport function mkOpinion(\n belief: number,\n disbelief: number,\n uncertainty: number,\n baseRate: number\n): SLOpinion {\n return opinion(belief, disbelief, uncertainty, baseRate);\n}\n\nexport function vacuous(baseRate: number): SLOpinion {\n return mkOpinion(0, 0, 1, baseRate);\n}\n\nexport function dogmatic(probability: number, baseRate: number): SLOpinion {\n const p = Math.max(0, Math.min(1, probability));\n return mkOpinion(p, 1 - p, 0, baseRate);\n}\n\nexport function project(o: SLOpinion): number {\n return o.b + o.a * o.u;\n}\n\nexport function confidenceLevel(o: SLOpinion): \"high\" | \"medium\" | \"low\" {\n const projected = project(o);\n if (o.u > 0.5) {\n return \"low\";\n }\n if (projected >= 0.8 && o.u < 0.2) {\n return \"high\";\n }\n if (projected >= 0.6) {\n return \"medium\";\n }\n return \"low\";\n}\n\nconst VACUOUS_IDENTITY_EPSILON = 1e-12;\n\n/**\n * Associative, vacuous-identity-preserving base rate for a fused opinion.\n *\n * The legacy `(left.a + right.a) / 2` arithmetic mean was the shared root of\n * RR.7 F1 (projected-confidence non-associativity) and F2 (a vacuous opinion of\n * a different base rate was not a fusion identity): averaging always pulled the\n * fused base rate toward the other operand even when that operand carried no\n * evidence. Subjective Logic requires every opinion over the same frame to share\n * one canonical base rate, so a correct fusion never *invents* a new base rate\n * from the operands' priors. We therefore:\n *\n * - return the informative operand's base rate when exactly one operand is\n * vacuous (the vacuous operand contributes no prior), making `vacuous(a)` a\n * true identity for any `a`; and\n * - require equal base rates otherwise (the canonical-frame contract). When\n * they coincide the result is that shared value — trivially associative.\n *\n * If two informative opinions carry genuinely different base rates they are not\n * opinions over the same frame and must be reconciled before fusion; we fall\n * back to the arithmetic mean ONLY in that ill-posed case to stay total, and the\n * property suite documents that this path is outside the order-independence\n * guarantee.\n */\nfunction fusedBaseRate(left: SLOpinion, right: SLOpinion): number {\n const leftVacuous = 1 - left.u <= VACUOUS_IDENTITY_EPSILON;\n const rightVacuous = 1 - right.u <= VACUOUS_IDENTITY_EPSILON;\n if (leftVacuous && !rightVacuous) {\n return right.a;\n }\n if (rightVacuous && !leftVacuous) {\n return left.a;\n }\n if (Math.abs(left.a - right.a) <= VACUOUS_IDENTITY_EPSILON) {\n return left.a;\n }\n return (left.a + right.a) / 2;\n}\n\nexport function cumulativeFusion(left: SLOpinion, right: SLOpinion): SLOpinion {\n const a = fusedBaseRate(left, right);\n\n // F2: a vacuous operand is the identity element of cumulative fusion. Return\n // the other operand verbatim (including its base rate) so fusion with the\n // vacuous opinion is a true no-op regardless of differing priors.\n if (1 - left.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(right.b, right.d, right.u, a);\n }\n if (1 - right.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(left.b, left.d, left.u, a);\n }\n\n // F4: dogmatic pair handled via the ε-limit of the cumulative rule rather than\n // the standalone `(b+d)/2` shortcut. As both uncertainties shrink at the same\n // rate, the cumulative formula's `(b_L·u_R + b_R·u_L)/k` term converges to the\n // arithmetic mean of the masses; deriving it from the same limit the interior\n // formula uses keeps mass-associativity intact (no special-case discontinuity).\n if (\n left.u <= VACUOUS_IDENTITY_EPSILON &&\n right.u <= VACUOUS_IDENTITY_EPSILON\n ) {\n return opinion((left.b + right.b) / 2, (left.d + right.d) / 2, 0, a);\n }\n\n const k = left.u + right.u - left.u * right.u;\n if (k === 0) {\n return vacuous(a);\n }\n\n return opinion(\n (left.b * right.u + right.b * left.u) / k,\n (left.d * right.u + right.d * left.u) / k,\n (left.u * right.u) / k,\n a\n );\n}\n\nexport function averagingFusion(left: SLOpinion, right: SLOpinion): SLOpinion {\n const a = fusedBaseRate(left, right);\n\n // F2: vacuous identity, mirroring cumulativeFusion.\n if (1 - left.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(right.b, right.d, right.u, a);\n }\n if (1 - right.u <= VACUOUS_IDENTITY_EPSILON) {\n return opinion(left.b, left.d, left.u, a);\n }\n\n // F4: dogmatic pair via the ε-limit of the averaging rule.\n if (\n left.u <= VACUOUS_IDENTITY_EPSILON &&\n right.u <= VACUOUS_IDENTITY_EPSILON\n ) {\n return opinion((left.b + right.b) / 2, (left.d + right.d) / 2, 0, a);\n }\n\n const k = left.u + right.u;\n if (k === 0) {\n return vacuous(a);\n }\n\n return opinion(\n (left.b * right.u + right.b * left.u) / k,\n (left.d * right.u + right.d * left.u) / k,\n (2 * left.u * right.u) / k,\n a\n );\n}\n\nexport function trustDiscount(\n sourceOpinion: SLOpinion,\n trust: number\n): SLOpinion {\n const weight = Math.max(0, Math.min(1, Math.abs(trust)));\n return opinion(\n weight * sourceOpinion.b,\n weight * sourceOpinion.d,\n 1 - weight * (sourceOpinion.b + sourceOpinion.d),\n sourceOpinion.a\n );\n}\n\nconst EPSILON = 1e-9;\n\nfunction childBaseRateFallback(\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n fallbackBaseRate: number | undefined\n): number {\n if (fallbackBaseRate !== undefined) {\n return Math.max(0, Math.min(1, fallbackBaseRate));\n }\n\n if (Math.abs(ifTrue.a - ifFalse.a) <= EPSILON) {\n return ifTrue.a;\n }\n\n return (ifTrue.a + ifFalse.a) / 2;\n}\n\nfunction computeConditionalDeductionBaseRate(\n opinionA: SLOpinion,\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n fallbackBaseRate: number\n): number {\n const denominator = 1 - opinionA.a * ifTrue.u - (1 - opinionA.a) * ifFalse.u;\n\n if (ifTrue.u + ifFalse.u < 2 - EPSILON && Math.abs(denominator) > EPSILON) {\n const baseRate =\n (opinionA.a * ifTrue.b + (1 - opinionA.a) * ifFalse.b) / denominator;\n if (baseRate >= -EPSILON && baseRate <= 1 + EPSILON) {\n return Math.max(0, Math.min(1, baseRate));\n }\n }\n\n return fallbackBaseRate;\n}\n\nfunction safeCorrectionTerm(\n numerator: number,\n denominator: number\n): number | undefined {\n if (Math.abs(denominator) <= EPSILON) {\n return;\n }\n\n const value = numerator / denominator;\n if (!Number.isFinite(value)) {\n return;\n }\n\n return Math.max(0, value);\n}\n\ninterface ConditionalDeductionCorrectionContext {\n childBaseRate: number;\n ifFalse: SLOpinion;\n ifTrue: SLOpinion;\n intermediateBelief: number;\n intermediateDisbelief: number;\n opinionA: SLOpinion;\n projectedAntecedent: number;\n projectedAntecedentComplement: number;\n projectedConditionalA: number;\n projectedVacuousDeduction: number;\n}\n\nfunction correctionOrZero(numerator: number, denominator: number): number {\n return safeCorrectionTerm(numerator, denominator) ?? 0;\n}\n\nfunction hasNoConditionalDeductionCorrection(\n ifTrue: SLOpinion,\n ifFalse: SLOpinion\n): boolean {\n return (\n (ifTrue.b > ifFalse.b && ifTrue.d > ifFalse.d) ||\n (ifTrue.b <= ifFalse.b && ifTrue.d <= ifFalse.d)\n );\n}\n\nfunction usesLowerVacuousBranch(\n context: ConditionalDeductionCorrectionContext\n): boolean {\n return context.projectedVacuousDeduction <= context.projectedConditionalA;\n}\n\nfunction usesLowerAntecedentBranch(\n context: ConditionalDeductionCorrectionContext\n): boolean {\n return context.projectedAntecedent <= context.opinionA.a;\n}\n\nfunction computeTrueDominantDeductionCorrection(\n context: ConditionalDeductionCorrectionContext\n): number {\n const beliefGap = context.ifTrue.b - context.ifFalse.b;\n const disbeliefGap = context.ifFalse.d - context.ifTrue.d;\n const lowerVacuous = usesLowerVacuousBranch(context);\n const lowerAntecedent = usesLowerAntecedentBranch(context);\n\n if (lowerVacuous && lowerAntecedent) {\n return correctionOrZero(\n context.opinionA.a *\n context.opinionA.u *\n (context.intermediateBelief - context.ifTrue.b),\n context.projectedAntecedent * context.childBaseRate\n );\n }\n\n if (lowerVacuous) {\n return correctionOrZero(\n context.opinionA.a *\n context.opinionA.u *\n (context.intermediateDisbelief - context.ifTrue.d) *\n beliefGap,\n context.projectedAntecedentComplement *\n context.childBaseRate *\n disbeliefGap\n );\n }\n\n if (lowerAntecedent) {\n return correctionOrZero(\n (1 - context.opinionA.a) *\n context.opinionA.u *\n (context.intermediateBelief - context.ifTrue.b) *\n disbeliefGap,\n context.projectedAntecedent * (1 - context.childBaseRate) * beliefGap\n );\n }\n\n return correctionOrZero(\n (1 - context.opinionA.a) *\n context.opinionA.u *\n (context.intermediateDisbelief - context.ifTrue.d),\n context.projectedAntecedentComplement * (1 - context.childBaseRate)\n );\n}\n\nfunction computeFalseDominantDeductionCorrection(\n context: ConditionalDeductionCorrectionContext\n): number {\n const beliefGap = context.ifFalse.b - context.ifTrue.b;\n const disbeliefGap = context.ifTrue.d - context.ifFalse.d;\n const lowerVacuous = usesLowerVacuousBranch(context);\n const lowerAntecedent = usesLowerAntecedentBranch(context);\n\n if (lowerVacuous && lowerAntecedent) {\n return correctionOrZero(\n (1 - context.opinionA.a) *\n context.opinionA.u *\n (context.intermediateDisbelief - context.ifTrue.d) *\n beliefGap,\n context.projectedAntecedent * context.childBaseRate * disbeliefGap\n );\n }\n\n if (lowerVacuous) {\n return correctionOrZero(\n (1 - context.opinionA.a) *\n context.opinionA.u *\n (context.intermediateBelief - context.ifTrue.b),\n context.projectedAntecedentComplement * context.childBaseRate\n );\n }\n\n if (lowerAntecedent) {\n return correctionOrZero(\n context.opinionA.a *\n context.opinionA.u *\n (context.intermediateDisbelief - context.ifTrue.d),\n context.projectedAntecedent * (1 - context.childBaseRate)\n );\n }\n\n return correctionOrZero(\n context.opinionA.a *\n context.opinionA.u *\n (context.intermediateBelief - context.ifTrue.b) *\n disbeliefGap,\n context.projectedAntecedentComplement *\n (1 - context.childBaseRate) *\n beliefGap\n );\n}\n\nfunction computeConditionalDeductionCorrection(\n context: ConditionalDeductionCorrectionContext\n): number {\n if (hasNoConditionalDeductionCorrection(context.ifTrue, context.ifFalse)) {\n return 0;\n }\n\n if (\n context.ifTrue.b > context.ifFalse.b &&\n context.ifTrue.d <= context.ifFalse.d\n ) {\n return computeTrueDominantDeductionCorrection(context);\n }\n\n return computeFalseDominantDeductionCorrection(context);\n}\n\nexport function conditionalDeduction(\n opinionA: SLOpinion,\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n fallbackBaseRate?: number\n): SLOpinion {\n const fallbackChildBaseRate = childBaseRateFallback(\n ifTrue,\n ifFalse,\n fallbackBaseRate\n );\n const childBaseRate = computeConditionalDeductionBaseRate(\n opinionA,\n ifTrue,\n ifFalse,\n fallbackChildBaseRate\n );\n const projectedAntecedent = project(opinionA);\n const projectedAntecedentComplement = 1 - projectedAntecedent;\n const intermediateBelief =\n opinionA.b * ifTrue.b +\n opinionA.d * ifFalse.b +\n opinionA.u * (ifTrue.b * opinionA.a + ifFalse.b * (1 - opinionA.a));\n const intermediateDisbelief =\n opinionA.b * ifTrue.d +\n opinionA.d * ifFalse.d +\n opinionA.u * (ifTrue.d * opinionA.a + ifFalse.d * (1 - opinionA.a));\n const intermediateUncertainty =\n opinionA.b * ifTrue.u +\n opinionA.d * ifFalse.u +\n opinionA.u * (ifTrue.u * opinionA.a + ifFalse.u * (1 - opinionA.a));\n const projectedVacuousDeduction =\n ifTrue.b * opinionA.a +\n ifFalse.b * (1 - opinionA.a) +\n childBaseRate * (ifTrue.u * opinionA.a + ifFalse.u * (1 - opinionA.a));\n const projectedConditionalA =\n ifTrue.b + childBaseRate * (1 - ifTrue.b - ifTrue.d);\n const correction = computeConditionalDeductionCorrection({\n childBaseRate,\n ifFalse,\n ifTrue,\n intermediateBelief,\n intermediateDisbelief,\n opinionA,\n projectedAntecedent,\n projectedAntecedentComplement,\n projectedConditionalA,\n projectedVacuousDeduction,\n });\n\n return opinion(\n intermediateBelief - childBaseRate * correction,\n intermediateDisbelief - (1 - childBaseRate) * correction,\n intermediateUncertainty + correction,\n childBaseRate\n );\n}\n\n/**\n * Abductive inference over a conditional.\n * Given an opinion on Y and conditionals P(Y|X), P(Y|~X), infer an opinion on X.\n */\nexport function conditionalAbduction(\n opinionY: SLOpinion,\n ifTrue: SLOpinion,\n ifFalse: SLOpinion,\n baseRateX: number\n): SLOpinion {\n const priorX = Math.max(0, Math.min(1, baseRateX));\n const probabilityY = project(opinionY);\n const probabilityGivenTrue = project(ifTrue);\n const probabilityGivenFalse = project(ifFalse);\n\n const posteriorIfYDenominator =\n probabilityGivenTrue * priorX + probabilityGivenFalse * (1 - priorX);\n const posteriorIfY =\n posteriorIfYDenominator === 0\n ? priorX\n : (probabilityGivenTrue * priorX) / posteriorIfYDenominator;\n\n const posteriorIfNotYDenominator =\n (1 - probabilityGivenTrue) * priorX +\n (1 - probabilityGivenFalse) * (1 - priorX);\n const posteriorIfNotY =\n posteriorIfNotYDenominator === 0\n ? priorX\n : ((1 - probabilityGivenTrue) * priorX) / posteriorIfNotYDenominator;\n\n const projectedX =\n probabilityY * posteriorIfY + (1 - probabilityY) * posteriorIfNotY;\n const uncertainty = Math.max(\n opinionY.u * 0.5,\n probabilityY * ifTrue.u + (1 - probabilityY) * ifFalse.u\n );\n\n return opinion(\n projectedX * (1 - uncertainty),\n (1 - projectedX) * (1 - uncertainty),\n uncertainty,\n priorX\n );\n}\n\nexport function negate(o: SLOpinion): SLOpinion {\n return mkOpinion(o.d, o.b, o.u, 1 - o.a);\n}\n\nexport function constraintFusion(\n left: SLOpinion,\n right: SLOpinion,\n mode: \"pressure\" | \"redistribute\" = \"pressure\"\n): { o1: SLOpinion; o2: SLOpinion } {\n if (mode === \"redistribute\") {\n const leftProjected = project(left);\n const rightProjected = project(right);\n const total = leftProjected + rightProjected;\n\n if (total <= 1) {\n return { o1: left, o2: right };\n }\n\n const scale = 1 / total;\n return {\n o1: opinion(\n left.b * scale,\n left.d + left.b * (1 - scale),\n left.u,\n left.a\n ),\n o2: opinion(\n right.b * scale,\n right.d + right.b * (1 - scale),\n right.u,\n right.a\n ),\n };\n }\n\n const pressureLeft = right.b * 0.5;\n const pressureRight = left.b * 0.5;\n\n return {\n o1: opinion(\n left.b - pressureLeft * 0.3,\n left.d + pressureLeft * 0.3,\n left.u,\n left.a\n ),\n o2: opinion(\n right.b - pressureRight * 0.3,\n right.d + pressureRight * 0.3,\n right.u,\n right.a\n ),\n };\n}\n\nexport function evidenceBalance(o: SLOpinion): number {\n const total = o.b + o.d;\n if (total === 0) {\n return 0;\n }\n return (o.b - o.d) / total;\n}\n\nexport function areTensioned(left: SLOpinion, right: SLOpinion): boolean {\n return (\n project(left) > 0.5 &&\n project(right) > 0.5 &&\n (left.d > 0.2 || right.d > 0.2)\n );\n}\n\nexport function informationGain(o: SLOpinion): number {\n if (o.u === 0) {\n return 0;\n }\n if (o.u === 1) {\n return 1;\n }\n return o.u * (1 - Math.abs(o.b - o.d));\n}\n","import type { Opinion, SLOpinion, StoredOpinionFields } from \"../types\";\nimport { dogmatic, mkOpinion, vacuous } from \"./subjectiveLogic\";\n\nfunction finiteNumber(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value)\n ? value\n : undefined;\n}\n\nfunction requiredOpinionNumber(label: string, ...values: unknown[]): number {\n for (const value of values) {\n const numberValue = finiteNumber(value);\n if (numberValue !== undefined) {\n return numberValue;\n }\n }\n throw new Error(`Opinion record is missing required ${label}.`);\n}\n\nexport function clamp01(value: number): number {\n return Math.max(0, Math.min(1, value));\n}\n\nexport function confidenceFromOpinion(opinion: Opinion): number {\n return clamp01(opinion.b + opinion.a * opinion.u);\n}\n\nexport function confidenceFromSL(\n belief: number,\n _disbelief: number,\n uncertainty: number,\n baseRate: number\n): number {\n return confidenceFromOpinion({\n b: belief,\n d: _disbelief,\n u: uncertainty,\n a: baseRate,\n });\n}\n\nexport function toStoredOpinionFields(opinion: Opinion): StoredOpinionFields {\n return {\n belief: opinion.b,\n disbelief: opinion.d,\n uncertainty: opinion.u,\n baseRate: opinion.a,\n };\n}\n\nexport function readOpinionFromRecord(source: unknown): SLOpinion {\n const record =\n source && typeof source === \"object\"\n ? (source as Record<string, unknown>)\n : {};\n\n return mkOpinion(\n requiredOpinionNumber(\n \"belief\",\n record.b,\n record.belief,\n record.slBelief,\n record.opinion_b\n ),\n requiredOpinionNumber(\n \"disbelief\",\n record.d,\n record.disbelief,\n record.slDisbelief,\n record.opinion_d\n ),\n requiredOpinionNumber(\n \"uncertainty\",\n record.u,\n record.uncertainty,\n record.slUncertainty,\n record.opinion_u\n ),\n requiredOpinionNumber(\n \"baseRate\",\n record.a,\n record.baseRate,\n record.slBaseRate,\n record.opinion_a\n )\n );\n}\n\nexport type OpinionFromScalarMode =\n | \"base_rate\"\n | \"dogmatic\"\n | \"projected_with_u\";\n\nexport type OpinionFromScalarOptions =\n | { baseRate?: never; uncertainty?: never }\n | { baseRate: number; uncertainty?: never }\n | { baseRate: number; uncertainty: number };\n\nexport function opinionFromScalar(\n value: number,\n mode: \"base_rate\",\n options?: { baseRate?: never; uncertainty?: never }\n): SLOpinion;\nexport function opinionFromScalar(\n value: number,\n mode: \"dogmatic\",\n options: { baseRate: number; uncertainty?: never }\n): SLOpinion;\nexport function opinionFromScalar(\n value: number,\n mode: \"projected_with_u\",\n options: { baseRate: number; uncertainty: number }\n): SLOpinion;\nexport function opinionFromScalar(\n value: number,\n mode: OpinionFromScalarMode,\n options?: OpinionFromScalarOptions\n): SLOpinion {\n const clampedValue = clamp01(value);\n const baseRate =\n options?.baseRate === undefined ? undefined : clamp01(options.baseRate);\n\n switch (mode) {\n case \"base_rate\":\n return mkOpinion(0, 0, 1, clampedValue);\n case \"dogmatic\":\n if (baseRate === undefined) {\n throw new Error(\n 'opinionFromScalar(value, \"dogmatic\") requires options.baseRate.'\n );\n }\n return mkOpinion(clampedValue, 1 - clampedValue, 0, baseRate);\n case \"projected_with_u\": {\n if (baseRate === undefined) {\n throw new Error(\n 'opinionFromScalar(value, \"projected_with_u\") requires options.baseRate.'\n );\n }\n const uncertainty = options?.uncertainty;\n if (uncertainty === undefined) {\n throw new Error(\n 'opinionFromScalar(value, \"projected_with_u\") requires options.uncertainty.'\n );\n }\n const clampedUncertainty = clamp01(uncertainty);\n const evidenceWeight = 1 - clampedUncertainty;\n return mkOpinion(\n clampedValue * evidenceWeight,\n (1 - clampedValue) * evidenceWeight,\n clampedUncertainty,\n baseRate\n );\n }\n default:\n throw new Error(`Unsupported opinionFromScalar mode: ${mode}`);\n }\n}\n\n/**\n * @deprecated Use opinionFromScalar(value, \"dogmatic\", { baseRate }) instead.\n */\nexport function toDogmaticOpinion(\n confidence: number,\n baseRate: number\n): SLOpinion {\n return opinionFromScalar(confidence, \"dogmatic\", { baseRate });\n}\n\n/** Interpret p as a prior with no observed evidence. */\nexport function opinionFromBaseRate(probability: number): SLOpinion {\n return vacuous(clamp01(probability));\n}\n\n/** Interpret p as a certainty-equivalent projected probability. */\nexport function opinionFromDogmatic(\n probability: number,\n baseRate: number\n): SLOpinion {\n return dogmatic(clamp01(probability), clamp01(baseRate));\n}\n\nfunction representableProjectedUncertainty(\n probability: number,\n uncertainty: number,\n baseRate: number\n): number {\n const maxBeliefUncertainty =\n baseRate > 0 ? probability / baseRate : Number.POSITIVE_INFINITY;\n const maxDisbeliefUncertainty =\n baseRate < 1\n ? (1 - probability) / (1 - baseRate)\n : Number.POSITIVE_INFINITY;\n\n return clamp01(\n Math.min(uncertainty, maxBeliefUncertainty, maxDisbeliefUncertainty)\n );\n}\n\n/**\n * Interpret p as a projected probability with an explicit uncertainty bucket.\n * Uses the requested uncertainty when representable; otherwise lowers it so the\n * resulting opinion stays valid and projects back to p.\n */\nexport function opinionFromProjected(\n probability: number,\n uncertainty: number,\n baseRate: number\n): SLOpinion {\n const p = clamp01(probability);\n const a = clamp01(baseRate);\n const u = representableProjectedUncertainty(p, clamp01(uncertainty), a);\n return mkOpinion(\n Math.max(0, p - a * u),\n Math.max(0, 1 - p - (1 - a) * u),\n u,\n a\n );\n}\n\nexport function hasProjectedOpinionChanged(\n current: Opinion,\n next: Opinion,\n tolerance = 0.01\n): boolean {\n return (\n Math.abs(confidenceFromOpinion(next) - confidenceFromOpinion(current)) >=\n tolerance\n );\n}\n"]}
|
|
@@ -131,14 +131,91 @@ function computeConditionalDeductionBaseRate(opinionA, ifTrue, ifFalse, fallback
|
|
|
131
131
|
}
|
|
132
132
|
function safeCorrectionTerm(numerator, denominator) {
|
|
133
133
|
if (Math.abs(denominator) <= EPSILON) {
|
|
134
|
-
return
|
|
134
|
+
return;
|
|
135
135
|
}
|
|
136
136
|
const value = numerator / denominator;
|
|
137
137
|
if (!Number.isFinite(value)) {
|
|
138
|
-
return
|
|
138
|
+
return;
|
|
139
139
|
}
|
|
140
140
|
return Math.max(0, value);
|
|
141
141
|
}
|
|
142
|
+
function correctionOrZero(numerator, denominator) {
|
|
143
|
+
return safeCorrectionTerm(numerator, denominator) ?? 0;
|
|
144
|
+
}
|
|
145
|
+
function hasNoConditionalDeductionCorrection(ifTrue, ifFalse) {
|
|
146
|
+
return ifTrue.b > ifFalse.b && ifTrue.d > ifFalse.d || ifTrue.b <= ifFalse.b && ifTrue.d <= ifFalse.d;
|
|
147
|
+
}
|
|
148
|
+
function usesLowerVacuousBranch(context) {
|
|
149
|
+
return context.projectedVacuousDeduction <= context.projectedConditionalA;
|
|
150
|
+
}
|
|
151
|
+
function usesLowerAntecedentBranch(context) {
|
|
152
|
+
return context.projectedAntecedent <= context.opinionA.a;
|
|
153
|
+
}
|
|
154
|
+
function computeTrueDominantDeductionCorrection(context) {
|
|
155
|
+
const beliefGap = context.ifTrue.b - context.ifFalse.b;
|
|
156
|
+
const disbeliefGap = context.ifFalse.d - context.ifTrue.d;
|
|
157
|
+
const lowerVacuous = usesLowerVacuousBranch(context);
|
|
158
|
+
const lowerAntecedent = usesLowerAntecedentBranch(context);
|
|
159
|
+
if (lowerVacuous && lowerAntecedent) {
|
|
160
|
+
return correctionOrZero(
|
|
161
|
+
context.opinionA.a * context.opinionA.u * (context.intermediateBelief - context.ifTrue.b),
|
|
162
|
+
context.projectedAntecedent * context.childBaseRate
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
if (lowerVacuous) {
|
|
166
|
+
return correctionOrZero(
|
|
167
|
+
context.opinionA.a * context.opinionA.u * (context.intermediateDisbelief - context.ifTrue.d) * beliefGap,
|
|
168
|
+
context.projectedAntecedentComplement * context.childBaseRate * disbeliefGap
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (lowerAntecedent) {
|
|
172
|
+
return correctionOrZero(
|
|
173
|
+
(1 - context.opinionA.a) * context.opinionA.u * (context.intermediateBelief - context.ifTrue.b) * disbeliefGap,
|
|
174
|
+
context.projectedAntecedent * (1 - context.childBaseRate) * beliefGap
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
return correctionOrZero(
|
|
178
|
+
(1 - context.opinionA.a) * context.opinionA.u * (context.intermediateDisbelief - context.ifTrue.d),
|
|
179
|
+
context.projectedAntecedentComplement * (1 - context.childBaseRate)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
function computeFalseDominantDeductionCorrection(context) {
|
|
183
|
+
const beliefGap = context.ifFalse.b - context.ifTrue.b;
|
|
184
|
+
const disbeliefGap = context.ifTrue.d - context.ifFalse.d;
|
|
185
|
+
const lowerVacuous = usesLowerVacuousBranch(context);
|
|
186
|
+
const lowerAntecedent = usesLowerAntecedentBranch(context);
|
|
187
|
+
if (lowerVacuous && lowerAntecedent) {
|
|
188
|
+
return correctionOrZero(
|
|
189
|
+
(1 - context.opinionA.a) * context.opinionA.u * (context.intermediateDisbelief - context.ifTrue.d) * beliefGap,
|
|
190
|
+
context.projectedAntecedent * context.childBaseRate * disbeliefGap
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
if (lowerVacuous) {
|
|
194
|
+
return correctionOrZero(
|
|
195
|
+
(1 - context.opinionA.a) * context.opinionA.u * (context.intermediateBelief - context.ifTrue.b),
|
|
196
|
+
context.projectedAntecedentComplement * context.childBaseRate
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
if (lowerAntecedent) {
|
|
200
|
+
return correctionOrZero(
|
|
201
|
+
context.opinionA.a * context.opinionA.u * (context.intermediateDisbelief - context.ifTrue.d),
|
|
202
|
+
context.projectedAntecedent * (1 - context.childBaseRate)
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
return correctionOrZero(
|
|
206
|
+
context.opinionA.a * context.opinionA.u * (context.intermediateBelief - context.ifTrue.b) * disbeliefGap,
|
|
207
|
+
context.projectedAntecedentComplement * (1 - context.childBaseRate) * beliefGap
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
function computeConditionalDeductionCorrection(context) {
|
|
211
|
+
if (hasNoConditionalDeductionCorrection(context.ifTrue, context.ifFalse)) {
|
|
212
|
+
return 0;
|
|
213
|
+
}
|
|
214
|
+
if (context.ifTrue.b > context.ifFalse.b && context.ifTrue.d <= context.ifFalse.d) {
|
|
215
|
+
return computeTrueDominantDeductionCorrection(context);
|
|
216
|
+
}
|
|
217
|
+
return computeFalseDominantDeductionCorrection(context);
|
|
218
|
+
}
|
|
142
219
|
function conditionalDeduction(opinionA, ifTrue, ifFalse, fallbackBaseRate) {
|
|
143
220
|
const fallbackChildBaseRate = childBaseRateFallback(
|
|
144
221
|
ifTrue,
|
|
@@ -158,58 +235,18 @@ function conditionalDeduction(opinionA, ifTrue, ifFalse, fallbackBaseRate) {
|
|
|
158
235
|
const intermediateUncertainty = opinionA.b * ifTrue.u + opinionA.d * ifFalse.u + opinionA.u * (ifTrue.u * opinionA.a + ifFalse.u * (1 - opinionA.a));
|
|
159
236
|
const projectedVacuousDeduction = ifTrue.b * opinionA.a + ifFalse.b * (1 - opinionA.a) + childBaseRate * (ifTrue.u * opinionA.a + ifFalse.u * (1 - opinionA.a));
|
|
160
237
|
const projectedConditionalA = ifTrue.b + childBaseRate * (1 - ifTrue.b - ifTrue.d);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
correction = safeCorrectionTerm(
|
|
174
|
-
opinionA.a * opinionA.u * (intermediateDisbelief - ifTrue.d) * beliefGap,
|
|
175
|
-
projectedAntecedentComplement * childBaseRate * disbeliefGap
|
|
176
|
-
) ?? 0;
|
|
177
|
-
} else if (projectedVacuousDeduction > projectedConditionalA && projectedAntecedent <= opinionA.a) {
|
|
178
|
-
correction = safeCorrectionTerm(
|
|
179
|
-
(1 - opinionA.a) * opinionA.u * (intermediateBelief - ifTrue.b) * disbeliefGap,
|
|
180
|
-
projectedAntecedent * (1 - childBaseRate) * beliefGap
|
|
181
|
-
) ?? 0;
|
|
182
|
-
} else {
|
|
183
|
-
correction = safeCorrectionTerm(
|
|
184
|
-
(1 - opinionA.a) * opinionA.u * (intermediateDisbelief - ifTrue.d),
|
|
185
|
-
projectedAntecedentComplement * (1 - childBaseRate)
|
|
186
|
-
) ?? 0;
|
|
187
|
-
}
|
|
188
|
-
} else {
|
|
189
|
-
const beliefGap = ifFalse.b - ifTrue.b;
|
|
190
|
-
const disbeliefGap = ifTrue.d - ifFalse.d;
|
|
191
|
-
if (projectedVacuousDeduction <= projectedConditionalA && projectedAntecedent <= opinionA.a) {
|
|
192
|
-
correction = safeCorrectionTerm(
|
|
193
|
-
(1 - opinionA.a) * opinionA.u * (intermediateDisbelief - ifTrue.d) * beliefGap,
|
|
194
|
-
projectedAntecedent * childBaseRate * disbeliefGap
|
|
195
|
-
) ?? 0;
|
|
196
|
-
} else if (projectedVacuousDeduction <= projectedConditionalA && projectedAntecedent > opinionA.a) {
|
|
197
|
-
correction = safeCorrectionTerm(
|
|
198
|
-
(1 - opinionA.a) * opinionA.u * (intermediateBelief - ifTrue.b),
|
|
199
|
-
projectedAntecedentComplement * childBaseRate
|
|
200
|
-
) ?? 0;
|
|
201
|
-
} else if (projectedVacuousDeduction > projectedConditionalA && projectedAntecedent <= opinionA.a) {
|
|
202
|
-
correction = safeCorrectionTerm(
|
|
203
|
-
opinionA.a * opinionA.u * (intermediateDisbelief - ifTrue.d),
|
|
204
|
-
projectedAntecedent * (1 - childBaseRate)
|
|
205
|
-
) ?? 0;
|
|
206
|
-
} else {
|
|
207
|
-
correction = safeCorrectionTerm(
|
|
208
|
-
opinionA.a * opinionA.u * (intermediateBelief - ifTrue.b) * disbeliefGap,
|
|
209
|
-
projectedAntecedentComplement * (1 - childBaseRate) * beliefGap
|
|
210
|
-
) ?? 0;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
238
|
+
const correction = computeConditionalDeductionCorrection({
|
|
239
|
+
childBaseRate,
|
|
240
|
+
ifFalse,
|
|
241
|
+
ifTrue,
|
|
242
|
+
intermediateBelief,
|
|
243
|
+
intermediateDisbelief,
|
|
244
|
+
opinionA,
|
|
245
|
+
projectedAntecedent,
|
|
246
|
+
projectedAntecedentComplement,
|
|
247
|
+
projectedConditionalA,
|
|
248
|
+
projectedVacuousDeduction
|
|
249
|
+
});
|
|
213
250
|
return opinion(
|
|
214
251
|
intermediateBelief - childBaseRate * correction,
|
|
215
252
|
intermediateDisbelief - (1 - childBaseRate) * correction,
|