@knights-eye-chess/ai-analysis 0.0.0-stage → 0.1.0-dev.17
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/LICENSE +235 -0
- package/LICENSING.md +26 -0
- package/NOTICE +5 -0
- package/NPM-PUBLISHING.md +28 -0
- package/README.md +139 -2
- package/SOURCE-ORIGIN.json +16 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/build.mjs +22 -0
- package/dist/answer-pipeline.test.mjs +375 -0
- package/dist/chunk-PLKNJRPF.js +10662 -0
- package/dist/chunk-XQDZJOYD.js +2515 -0
- package/dist/index.js +146 -0
- package/dist/owner-tests/chess-reasoning-compact-search-preparation.test.mjs +963 -0
- package/dist/owner-tests/mechanism-encoding.test.mjs +529 -0
- package/dist/owner-tests/move-mechanism-facts.test.mjs +396 -0
- package/dist/owner-tests/pipeline-host-preparation.test.mjs +10556 -0
- package/dist/owner-tests/position-preparation.test.mjs +625 -0
- package/dist/owner-tests/preparation-consolidation.test.mjs +1052 -0
- package/dist/owner-tests/prose-reference-admission.test.mjs +1770 -0
- package/dist/owner-tests/score-comparison-notices.test.mjs +240 -0
- package/dist/owner-tests/simple-engine-presentation.test.mjs +233 -0
- package/dist/owner-tests/tool-input-loop-guard.test.mjs +78 -0
- package/dist/research.js +2274 -0
- package/dist/runtime-closure.json +103 -0
- package/dist/shared-runtime-closure.json +39 -0
- package/dist/shared.js +152 -0
- package/dist/types/ai-request-failure.d.ts +14 -0
- package/dist/types/ai-request-limits.d.ts +4 -0
- package/dist/types/ai-routing-diagnostics.d.ts +14 -0
- package/dist/types/chess-reasoning/ablation-adaptive-evidence-loop.d.ts +127 -0
- package/dist/types/chess-reasoning/ablation-adaptive-runtime.d.ts +178 -0
- package/dist/types/chess-reasoning/ablation-direct-synthesis.d.ts +1030 -0
- package/dist/types/chess-reasoning/ablation-evidence-bundle.d.ts +185 -0
- package/dist/types/chess-reasoning/ablation-evidence-capture.d.ts +37 -0
- package/dist/types/chess-reasoning/ablation-lean-direct-runtime.d.ts +193 -0
- package/dist/types/chess-reasoning/ablation-model-facing-evidence.d.ts +38 -0
- package/dist/types/chess-reasoning/ablation-transport-correction.d.ts +13 -0
- package/dist/types/chess-reasoning/ai-sdk-runtime-support.d.ts +93 -0
- package/dist/types/chess-reasoning/answer-host-contracts.d.ts +59 -0
- package/dist/types/chess-reasoning/answer-model-connector.d.ts +68 -0
- package/dist/types/chess-reasoning/answer-pipeline-exports.d.ts +98 -0
- package/dist/types/chess-reasoning/answer-pipeline.d.ts +41 -0
- package/dist/types/chess-reasoning/answer-reference-validation.d.ts +40 -0
- package/dist/types/chess-reasoning/answer-tool-host.d.ts +8 -0
- package/dist/types/chess-reasoning/branch-expansion-policy.d.ts +13 -0
- package/dist/types/chess-reasoning/branch-expansion.d.ts +39 -0
- package/dist/types/chess-reasoning/causal-claim-checks.d.ts +21 -0
- package/dist/types/chess-reasoning/chess-reference-dictionary.d.ts +13 -0
- package/dist/types/chess-reasoning/classification-question-target.d.ts +22 -0
- package/dist/types/chess-reasoning/classification-reassessment.d.ts +31 -0
- package/dist/types/chess-reasoning/compact-search-preparation.d.ts +7 -0
- package/dist/types/chess-reasoning/concept-registry.d.ts +99 -0
- package/dist/types/chess-reasoning/conversation-context.d.ts +12 -0
- package/dist/types/chess-reasoning/engine-search-failure.d.ts +7 -0
- package/dist/types/chess-reasoning/evidence-citation-normalization.d.ts +9 -0
- package/dist/types/chess-reasoning/evidence-licenses.d.ts +57 -0
- package/dist/types/chess-reasoning/evidence-selector-contract.d.ts +5 -0
- package/dist/types/chess-reasoning/existing-analysis-context.d.ts +104 -0
- package/dist/types/chess-reasoning/fact-observation-provider.d.ts +15 -0
- package/dist/types/chess-reasoning/fact-provider.d.ts +111 -0
- package/dist/types/chess-reasoning/fresh-engine-pv-witnesses.d.ts +67 -0
- package/dist/types/chess-reasoning/historical-prose.d.ts +23 -0
- package/dist/types/chess-reasoning/idea-graph.d.ts +34 -0
- package/dist/types/chess-reasoning/initial-search-plan.d.ts +37 -0
- package/dist/types/chess-reasoning/lossless-evidence-sharing.d.ts +18 -0
- package/dist/types/chess-reasoning/matched-comparison.d.ts +10 -0
- package/dist/types/chess-reasoning/material-accounting.d.ts +80 -0
- package/dist/types/chess-reasoning/material-format.d.ts +4 -0
- package/dist/types/chess-reasoning/mechanical-fact-provider.d.ts +33 -0
- package/dist/types/chess-reasoning/mechanical-ray-facts.d.ts +19 -0
- package/dist/types/chess-reasoning/mechanism-presentation.d.ts +9 -0
- package/dist/types/chess-reasoning/move-mechanism-facts.d.ts +45 -0
- package/dist/types/chess-reasoning/native-answer-connector.d.ts +4 -0
- package/dist/types/chess-reasoning/opening-source-contracts.d.ts +54 -0
- package/dist/types/chess-reasoning/opening-source-credits.d.ts +16 -0
- package/dist/types/chess-reasoning/opponent-threat-preparation.d.ts +7 -0
- package/dist/types/chess-reasoning/piece-identities.d.ts +11 -0
- package/dist/types/chess-reasoning/poc-contracts.d.ts +1026 -0
- package/dist/types/chess-reasoning/poc-hypotheses.d.ts +74 -0
- package/dist/types/chess-reasoning/poc-move-witnesses.d.ts +13 -0
- package/dist/types/chess-reasoning/poc-observations.d.ts +23 -0
- package/dist/types/chess-reasoning/poc-piece-refs.d.ts +12 -0
- package/dist/types/chess-reasoning/poc-plan-model.d.ts +45 -0
- package/dist/types/chess-reasoning/poc-semantic-text.d.ts +8 -0
- package/dist/types/chess-reasoning/poc-tools.d.ts +81 -0
- package/dist/types/chess-reasoning/portable-answer-runtime.d.ts +291 -0
- package/dist/types/chess-reasoning/position-analysis-contracts.d.ts +31 -0
- package/dist/types/chess-reasoning/position-analysis-scope.d.ts +3 -0
- package/dist/types/chess-reasoning/preparation-consolidation.d.ts +21 -0
- package/dist/types/chess-reasoning/production-observation-provider.d.ts +16 -0
- package/dist/types/chess-reasoning/question-routing.d.ts +326 -0
- package/dist/types/chess-reasoning/recorded-main-line.d.ts +37 -0
- package/dist/types/chess-reasoning/recorded-position-tools.d.ts +11 -0
- package/dist/types/chess-reasoning/recorded-reference-context.d.ts +13 -0
- package/dist/types/chess-reasoning/recorded-selected-classification.d.ts +36 -0
- package/dist/types/chess-reasoning/reference-limits.d.ts +2 -0
- package/dist/types/chess-reasoning/research-exports.d.ts +197 -0
- package/dist/types/chess-reasoning/saved-score-presentation.d.ts +14 -0
- package/dist/types/chess-reasoning/score-comparison-notices.d.ts +33 -0
- package/dist/types/chess-reasoning/server-simple-policy.d.ts +31 -0
- package/dist/types/chess-reasoning/simple-agent-config.d.ts +73 -0
- package/dist/types/chess-reasoning/simple-board-analysis.d.ts +85 -0
- package/dist/types/chess-reasoning/simple-compact-evidence.d.ts +7 -0
- package/dist/types/chess-reasoning/simple-completion.d.ts +23 -0
- package/dist/types/chess-reasoning/simple-engine-presentation.d.ts +3 -0
- package/dist/types/chess-reasoning/simple-evidence-preparation.d.ts +17 -0
- package/dist/types/chess-reasoning/simple-evidence-view.d.ts +17 -0
- package/dist/types/chess-reasoning/simple-explanation-coverage.d.ts +90 -0
- package/dist/types/chess-reasoning/simple-fact-delivery.d.ts +43 -0
- package/dist/types/chess-reasoning/simple-fallback-premise.d.ts +5 -0
- package/dist/types/chess-reasoning/simple-prose-references.d.ts +108 -0
- package/dist/types/chess-reasoning/simple-runtime-version.d.ts +1 -0
- package/dist/types/chess-reasoning/stable.d.ts +2 -0
- package/dist/types/chess-reasoning/tool-input-loop-guard.d.ts +5 -0
- package/dist/types/chess-reasoning/types.d.ts +180 -0
- package/dist/types/chess-reasoning/visible-support-lines.d.ts +12 -0
- package/dist/types/chess-reasoning/wikibooks-index.d.ts +30 -0
- package/dist/types/chess-reasoning/wikibooks-tool-context.d.ts +10 -0
- package/dist/types/player-perspective.d.ts +16 -0
- package/dist/types/shared-exports.d.ts +22 -0
- package/docs/API.md +82 -0
- package/docs/OWNERSHIP-ADOPTION.md +35 -0
- package/docs/OWNERSHIP-DRIFT.json +55 -0
- package/docs/RESEARCH-API.md +28 -0
- package/licenses/third-party/INVENTORY.json +202 -0
- package/licenses/third-party/ai-7.0.85/LICENSE +13 -0
- package/licenses/third-party/ai-sdk--gateway-4.0.69/LICENSE +13 -0
- package/licenses/third-party/ai-sdk--provider-4.0.9/LICENSE +13 -0
- package/licenses/third-party/ai-sdk--provider-utils-5.0.34/APACHE-2.0.txt +73 -0
- package/licenses/third-party/ai-sdk--provider-utils-5.0.34/src/to-json-schema/zod3-to-json-schema/LICENSE +16 -0
- package/licenses/third-party/chess.js-1.4.0/LICENSE +23 -0
- package/licenses/third-party/eventsource-parser-3.1.1/LICENSE +21 -0
- package/licenses/third-party/json-schema-0.4.0/LICENSE +195 -0
- package/licenses/third-party/standard-schema--spec-1.1.0/LICENSE +21 -0
- package/licenses/third-party/types--json-schema-7.0.15/LICENSE +21 -0
- package/licenses/third-party/types--node-22.19.19/LICENSE +21 -0
- package/licenses/third-party/undici-7.30.0/LICENSE +21 -0
- package/licenses/third-party/undici-7.30.0/lib/web/fetch/LICENSE +21 -0
- package/licenses/third-party/undici-types-6.21.0/LICENSE +21 -0
- package/licenses/third-party/vercel--oidc-3.2.0/LICENSE +202 -0
- package/licenses/third-party/workflow--serde-4.1.0/APACHE-2.0.txt +73 -0
- package/licenses/third-party/workflow--serde-4.1.0/LICENSE.md +3 -0
- package/licenses/third-party/zod-4.6.5/LICENSE +21 -0
- package/npm-release.json +5 -0
- package/package.json +72 -4
- package/scripts/check-release-tooling.mjs +22 -0
- package/scripts/pack.mjs +68 -0
- package/scripts/publish-reviewed.mjs +85 -0
- package/scripts/release-tooling.json +13 -0
- package/scripts/update-dependency.mjs +44 -0
- package/scripts/verify-release.mjs +52 -0
- package/src/ai-request-failure.ts +34 -0
- package/src/ai-request-limits.ts +4 -0
- package/src/ai-routing-diagnostics.ts +33 -0
- package/src/chess-reasoning/ablation-adaptive-evidence-loop.ts +515 -0
- package/src/chess-reasoning/ablation-adaptive-runtime.ts +924 -0
- package/src/chess-reasoning/ablation-direct-synthesis.ts +1128 -0
- package/src/chess-reasoning/ablation-evidence-bundle.ts +726 -0
- package/src/chess-reasoning/ablation-evidence-capture.ts +513 -0
- package/src/chess-reasoning/ablation-lean-direct-runtime.ts +670 -0
- package/src/chess-reasoning/ablation-model-facing-evidence.ts +212 -0
- package/src/chess-reasoning/ablation-transport-correction.ts +106 -0
- package/src/chess-reasoning/ai-sdk-runtime-support.ts +381 -0
- package/src/chess-reasoning/answer-host-contracts.ts +10 -0
- package/src/chess-reasoning/answer-model-connector.ts +83 -0
- package/src/chess-reasoning/answer-pipeline-exports.ts +98 -0
- package/src/chess-reasoning/answer-pipeline.ts +195 -0
- package/src/chess-reasoning/answer-reference-validation.ts +124 -0
- package/src/chess-reasoning/answer-tool-host.ts +10 -0
- package/src/chess-reasoning/branch-expansion-policy.ts +32 -0
- package/src/chess-reasoning/branch-expansion.ts +80 -0
- package/src/chess-reasoning/causal-claim-checks.ts +256 -0
- package/src/chess-reasoning/chess-reference-dictionary.ts +21 -0
- package/src/chess-reasoning/classification-question-target.ts +30 -0
- package/src/chess-reasoning/classification-reassessment.ts +34 -0
- package/src/chess-reasoning/compact-search-preparation.ts +125 -0
- package/src/chess-reasoning/concept-registry.ts +275 -0
- package/src/chess-reasoning/conversation-context.ts +29 -0
- package/src/chess-reasoning/engine-search-failure.ts +11 -0
- package/src/chess-reasoning/evidence-citation-normalization.ts +15 -0
- package/src/chess-reasoning/evidence-licenses.ts +166 -0
- package/src/chess-reasoning/evidence-selector-contract.ts +5 -0
- package/src/chess-reasoning/existing-analysis-context.ts +544 -0
- package/src/chess-reasoning/fact-observation-provider.ts +134 -0
- package/src/chess-reasoning/fact-provider.ts +250 -0
- package/src/chess-reasoning/fresh-engine-pv-witnesses.ts +128 -0
- package/src/chess-reasoning/historical-prose.ts +116 -0
- package/src/chess-reasoning/idea-graph.ts +224 -0
- package/src/chess-reasoning/initial-search-plan.ts +115 -0
- package/src/chess-reasoning/lossless-evidence-sharing.ts +135 -0
- package/src/chess-reasoning/matched-comparison.ts +40 -0
- package/src/chess-reasoning/material-accounting.ts +55 -0
- package/src/chess-reasoning/material-format.ts +47 -0
- package/src/chess-reasoning/mechanical-fact-provider.ts +1602 -0
- package/src/chess-reasoning/mechanical-ray-facts.ts +123 -0
- package/src/chess-reasoning/mechanism-presentation.ts +94 -0
- package/src/chess-reasoning/move-mechanism-facts.ts +185 -0
- package/src/chess-reasoning/native-answer-connector.ts +13 -0
- package/src/chess-reasoning/opening-source-contracts.ts +47 -0
- package/src/chess-reasoning/opening-source-credits.ts +53 -0
- package/src/chess-reasoning/opponent-threat-preparation.ts +98 -0
- package/src/chess-reasoning/piece-identities.ts +159 -0
- package/src/chess-reasoning/poc-contracts.ts +1097 -0
- package/src/chess-reasoning/poc-hypotheses.ts +759 -0
- package/src/chess-reasoning/poc-move-witnesses.ts +170 -0
- package/src/chess-reasoning/poc-observations.ts +611 -0
- package/src/chess-reasoning/poc-piece-refs.ts +62 -0
- package/src/chess-reasoning/poc-plan-model.ts +345 -0
- package/src/chess-reasoning/poc-semantic-text.ts +10 -0
- package/src/chess-reasoning/poc-tools.ts +978 -0
- package/src/chess-reasoning/portable-answer-runtime.ts +684 -0
- package/src/chess-reasoning/position-analysis-contracts.ts +88 -0
- package/src/chess-reasoning/position-analysis-scope.ts +20 -0
- package/src/chess-reasoning/preparation-consolidation.ts +91 -0
- package/src/chess-reasoning/production-observation-provider.ts +41 -0
- package/src/chess-reasoning/question-routing.ts +332 -0
- package/src/chess-reasoning/recorded-main-line.ts +55 -0
- package/src/chess-reasoning/recorded-position-tools.ts +78 -0
- package/src/chess-reasoning/recorded-reference-context.ts +44 -0
- package/src/chess-reasoning/recorded-selected-classification.ts +54 -0
- package/src/chess-reasoning/reference-limits.ts +2 -0
- package/src/chess-reasoning/research-exports.ts +197 -0
- package/src/chess-reasoning/saved-score-presentation.ts +6 -0
- package/src/chess-reasoning/score-comparison-notices.ts +115 -0
- package/src/chess-reasoning/server-simple-policy.ts +75 -0
- package/src/chess-reasoning/simple-agent-config.ts +58 -0
- package/src/chess-reasoning/simple-board-analysis.ts +57 -0
- package/src/chess-reasoning/simple-compact-evidence.ts +79 -0
- package/src/chess-reasoning/simple-completion.ts +37 -0
- package/src/chess-reasoning/simple-engine-presentation.ts +95 -0
- package/src/chess-reasoning/simple-evidence-preparation.ts +32 -0
- package/src/chess-reasoning/simple-evidence-view.ts +69 -0
- package/src/chess-reasoning/simple-explanation-coverage.ts +118 -0
- package/src/chess-reasoning/simple-fact-delivery.ts +52 -0
- package/src/chess-reasoning/simple-fallback-premise.ts +65 -0
- package/src/chess-reasoning/simple-prose-references.ts +528 -0
- package/src/chess-reasoning/simple-runtime-version.ts +2 -0
- package/src/chess-reasoning/stable.ts +18 -0
- package/src/chess-reasoning/tool-input-loop-guard.ts +38 -0
- package/src/chess-reasoning/types.ts +195 -0
- package/src/chess-reasoning/visible-support-lines.ts +44 -0
- package/src/chess-reasoning/wikibooks-index.ts +56 -0
- package/src/chess-reasoning/wikibooks-tool-context.ts +91 -0
- package/src/player-perspective.ts +41 -0
- package/src/shared-exports.ts +23 -0
- package/test/answer-pipeline.test.mjs +375 -0
- package/test/owner/chess-reasoning-compact-search-preparation.test.mjs +111 -0
- package/test/owner/mechanism-encoding.test.mjs +78 -0
- package/test/owner/move-mechanism-facts.test.mjs +105 -0
- package/test/owner/pipeline-host-preparation.test.mjs +115 -0
- package/test/owner/position-preparation.test.mjs +22 -0
- package/test/owner/preparation-consolidation.test.mjs +74 -0
- package/test/owner/prose-reference-admission.test.mjs +26 -0
- package/test/owner/score-comparison-notices.test.mjs +116 -0
- package/test/owner/simple-engine-presentation.test.mjs +50 -0
- package/test/owner/tool-input-loop-guard.test.mjs +25 -0
- package/test-types.mts +23 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type ConceptRegistry } from "./concept-registry.js";
|
|
2
|
+
import { type ReasoningEvidenceRecord, type ReasoningHypothesisDecision, type ReasoningHypothesisProposal, type ReasoningHypothesisRecord, type ReasoningHypothesisProvenance, type ReasoningHypothesisRelationRecord, type ReasoningPositionContext, type ReasoningRankedObservationSet, type ReasoningToolDescriptor } from "./poc-contracts.js";
|
|
3
|
+
import type { SemanticAttributes } from "./types.js";
|
|
4
|
+
export declare const RECORD_HYPOTHESES_DESCRIPTOR: ReasoningToolDescriptor;
|
|
5
|
+
export declare const REVIEW_HYPOTHESES_DESCRIPTOR: ReasoningToolDescriptor;
|
|
6
|
+
export declare const EXPLAIN_PLAN_SELECTION_DESCRIPTOR: ReasoningToolDescriptor;
|
|
7
|
+
/**
|
|
8
|
+
* Pure policy-only validation shared by every semantic admission boundary.
|
|
9
|
+
* It does not alter Ledger status, review provenance, or hypothesis meaning.
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateHypothesisAcceptancePolicies(hypothesis: ReasoningHypothesisRecord, evidence: Map<string, ReasoningEvidenceRecord>, registry?: ConceptRegistry): string[];
|
|
12
|
+
export type ExplainPlanSelection = {
|
|
13
|
+
hypothesisIds: string[];
|
|
14
|
+
relationIds: string[];
|
|
15
|
+
startHypothesisId: string;
|
|
16
|
+
goalHypothesisId: string;
|
|
17
|
+
requiredHypothesisIds: string[];
|
|
18
|
+
maxEntities: number;
|
|
19
|
+
};
|
|
20
|
+
export type InternalExplainPlanRequest = {
|
|
21
|
+
hypothesisLedgerRevision: string;
|
|
22
|
+
hypotheses: {
|
|
23
|
+
entities: Array<ReasoningHypothesisProposal & {
|
|
24
|
+
hypothesisId: string;
|
|
25
|
+
}>;
|
|
26
|
+
relations: Array<{
|
|
27
|
+
relationType: string;
|
|
28
|
+
from: string;
|
|
29
|
+
to: string;
|
|
30
|
+
attributes: SemanticAttributes;
|
|
31
|
+
evidenceIds: string[];
|
|
32
|
+
hypothesisRelationId: string;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
startEntityId: string;
|
|
36
|
+
goalEntityId: string;
|
|
37
|
+
requiredEntityIds: string[];
|
|
38
|
+
maxEntities: number;
|
|
39
|
+
};
|
|
40
|
+
export declare class HypothesisLedger {
|
|
41
|
+
private readonly contextHash;
|
|
42
|
+
private readonly evidence;
|
|
43
|
+
private readonly maxHypotheses;
|
|
44
|
+
private readonly context?;
|
|
45
|
+
private readonly registry;
|
|
46
|
+
private readonly records;
|
|
47
|
+
private readonly relations;
|
|
48
|
+
private readonly observations;
|
|
49
|
+
constructor(contextHash: string, observations: ReasoningRankedObservationSet, evidence: Map<string, ReasoningEvidenceRecord>, maxHypotheses: number, context?: ReasoningPositionContext | undefined, registry?: ConceptRegistry);
|
|
50
|
+
allRecords(): ReasoningHypothesisRecord[];
|
|
51
|
+
allRelations(): ReasoningHypothesisRelationRecord[];
|
|
52
|
+
proposalRevision(): string;
|
|
53
|
+
finalRevision(): string;
|
|
54
|
+
record(value: unknown, provenance?: ReasoningHypothesisProvenance): {
|
|
55
|
+
records: ReasoningHypothesisRecord[];
|
|
56
|
+
relations: ReasoningHypothesisRelationRecord[];
|
|
57
|
+
localToHypothesisIds: Record<string, string>;
|
|
58
|
+
};
|
|
59
|
+
review(value: unknown, validateProspective?: (records: ReasoningHypothesisRecord[]) => void, supplementalEvidenceByHypothesisId?: Map<string, string[]>): {
|
|
60
|
+
decisions: ReasoningHypothesisDecision[];
|
|
61
|
+
evidence: ReasoningEvidenceRecord;
|
|
62
|
+
};
|
|
63
|
+
toInternalPlanRequest(value: unknown): InternalExplainPlanRequest;
|
|
64
|
+
private parseSelection;
|
|
65
|
+
private validateRealization;
|
|
66
|
+
private validateDirectedDestinationAnchors;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Actor/subject plus destination/goal is an exact typed movement assertion,
|
|
70
|
+
* even when the surrounding hypothesis remains provisional semantic meaning.
|
|
71
|
+
* Reject impossible bindings before they enter the Ledger so a later reviewer
|
|
72
|
+
* cannot accidentally promote a supporting piece into the mover's role.
|
|
73
|
+
*/
|
|
74
|
+
export declare function assertDirectedDestinationAnchors(record: Pick<ReasoningHypothesisRecord, "id" | "localId" | "participants" | "evidenceIds">, evidenceById: Map<string, ReasoningEvidenceRecord>, context: ReasoningPositionContext | undefined): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReasoningEvidenceRecord, ReasoningPositionContext } from "./poc-contracts.js";
|
|
2
|
+
export type ReasoningMoveWitness = {
|
|
3
|
+
evidenceId: string;
|
|
4
|
+
uci: string;
|
|
5
|
+
pieceId: string;
|
|
6
|
+
san: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function reasoningEvidenceReplayStartPhase(record: ReasoningEvidenceRecord, context: ReasoningPositionContext): "before" | "after" | null;
|
|
9
|
+
/**
|
|
10
|
+
* Replays only admitted evidence whose starting position is one of the exact
|
|
11
|
+
* request positions. A malformed or partial replay contributes no witnesses.
|
|
12
|
+
*/
|
|
13
|
+
export declare function collectReasoningMoveWitnesses(records: Iterable<ReasoningEvidenceRecord>, context: ReasoningPositionContext): ReasoningMoveWitness[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ObservationProvider, type QueryContract, type ReasoningObservationSet, type ReasoningPositionContext, type ReasoningRankedObservationSet, type ReasoningRunControls, type SaliencePolicy } from "./poc-contracts.js";
|
|
2
|
+
export declare const DETERMINISTIC_OBSERVATION_PROVIDER_VERSION: "deterministic-position-observations/5";
|
|
3
|
+
export declare const QUESTION_SALIENCE_POLICY_VERSION: "question-conditioned-observation-salience/4";
|
|
4
|
+
export declare class DeterministicObservationProvider implements ObservationProvider {
|
|
5
|
+
readonly id = "knights-eye/deterministic-position-observations";
|
|
6
|
+
readonly version: "deterministic-position-observations/5";
|
|
7
|
+
observe(context: ReasoningPositionContext, _controls: ReasoningRunControls, signal?: AbortSignal): ReasoningObservationSet;
|
|
8
|
+
}
|
|
9
|
+
export declare class CompositeObservationProvider implements ObservationProvider {
|
|
10
|
+
private readonly providers;
|
|
11
|
+
readonly id = "knights-eye/composite-observation-provider";
|
|
12
|
+
readonly version: string;
|
|
13
|
+
constructor(providers: ObservationProvider[]);
|
|
14
|
+
observe(context: ReasoningPositionContext, controls: ReasoningRunControls, signal?: AbortSignal): Promise<ReasoningObservationSet>;
|
|
15
|
+
}
|
|
16
|
+
export declare class QuestionConditionedSaliencePolicy implements SaliencePolicy {
|
|
17
|
+
private readonly maxPresented;
|
|
18
|
+
readonly id: "question-conditioned-observation-salience/4";
|
|
19
|
+
constructor(maxPresented?: number);
|
|
20
|
+
rank(observations: ReasoningObservationSet, contract: QueryContract): ReasoningRankedObservationSet;
|
|
21
|
+
}
|
|
22
|
+
export declare function createDefaultObservationProvider(): ObservationProvider;
|
|
23
|
+
export declare function createDefaultSaliencePolicy(maxPresented?: number): SaliencePolicy;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Square } from "chess.js";
|
|
2
|
+
import type { IdentityState, PieceId, PieceIdentity } from "./types.js";
|
|
3
|
+
import type { ReasoningPositionContext } from "./poc-contracts.js";
|
|
4
|
+
export type PocIdentityTimeline = {
|
|
5
|
+
before: IdentityState;
|
|
6
|
+
after: IdentityState;
|
|
7
|
+
};
|
|
8
|
+
export declare function createPocIdentityTimeline(context: ReasoningPositionContext): PocIdentityTimeline;
|
|
9
|
+
export declare function pieceIdAt(state: IdentityState, square: Square): PieceId | null;
|
|
10
|
+
export declare function squareForPiece(state: IdentityState, pieceId: PieceId): Square | null;
|
|
11
|
+
export declare function pieceIdentity(state: IdentityState, pieceId: PieceId): PieceIdentity | null;
|
|
12
|
+
export declare function canonicalPieceLabel(piece: PieceIdentity): string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ConceptRegistry } from "./concept-registry.js";
|
|
2
|
+
import type { ReasoningEvidenceRecord, ReasoningPositionContext } from "./poc-contracts.js";
|
|
3
|
+
import type { IdeaGraph, ProofStrength, SemanticAttributes, SemanticParticipant } from "./types.js";
|
|
4
|
+
export type PlanEntityHypothesis = {
|
|
5
|
+
hypothesisId: string;
|
|
6
|
+
localId: string;
|
|
7
|
+
entityType: string;
|
|
8
|
+
concepts: string[];
|
|
9
|
+
owner: "w" | "b" | null;
|
|
10
|
+
participants: SemanticParticipant[];
|
|
11
|
+
attributes: SemanticAttributes;
|
|
12
|
+
proofStrength: ProofStrength | null;
|
|
13
|
+
evidenceIds: string[];
|
|
14
|
+
sourceObservationIds: string[];
|
|
15
|
+
};
|
|
16
|
+
export type PlanRelationHypothesis = {
|
|
17
|
+
hypothesisRelationId: string;
|
|
18
|
+
relationType: string;
|
|
19
|
+
from: string;
|
|
20
|
+
to: string;
|
|
21
|
+
attributes: SemanticAttributes;
|
|
22
|
+
evidenceIds: string[];
|
|
23
|
+
};
|
|
24
|
+
export type PlanHypothesisSet = {
|
|
25
|
+
entities: PlanEntityHypothesis[];
|
|
26
|
+
relations: PlanRelationHypothesis[];
|
|
27
|
+
};
|
|
28
|
+
export type ExplainPlanRequest = {
|
|
29
|
+
hypothesisLedgerRevision: string;
|
|
30
|
+
hypotheses: PlanHypothesisSet;
|
|
31
|
+
startEntityId: string;
|
|
32
|
+
goalEntityId: string;
|
|
33
|
+
requiredEntityIds: string[];
|
|
34
|
+
maxEntities: number;
|
|
35
|
+
};
|
|
36
|
+
export type ResolvedPlanExplanation = {
|
|
37
|
+
hypothesisLedgerRevision: string;
|
|
38
|
+
graph: IdeaGraph;
|
|
39
|
+
localToGraphIds: Record<string, string>;
|
|
40
|
+
selectedEntityIds: string[];
|
|
41
|
+
selectedRelationIds: string[];
|
|
42
|
+
evidenceIds: string[];
|
|
43
|
+
};
|
|
44
|
+
export declare function parseExplainPlanRequest(value: unknown): ExplainPlanRequest;
|
|
45
|
+
export declare function resolveAndSelectPlan(rawRequest: unknown, context: ReasoningPositionContext, contextHash: string, availableEvidence: Iterable<ReasoningEvidenceRecord>, registry?: ConceptRegistry): ResolvedPlanExplanation;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Board objects must travel as typed narrative segments. This pattern catches
|
|
3
|
+
* piece names, coordinates, UCI, common SAN (including captures and
|
|
4
|
+
* disambiguation), and castling when they leak into opaque text.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RAW_CHESS_TEXT_PATTERN_SOURCE: string;
|
|
7
|
+
export declare const RAW_CHESS_TEXT: RegExp;
|
|
8
|
+
export declare const SEMANTIC_TEXT_JSON_PATTERN: string;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type BranchExpansionConfig } from './branch-expansion.js';
|
|
2
|
+
import type { ConceptRegistry } from "./concept-registry.js";
|
|
3
|
+
import { type ReasoningPositionContext, type ReasoningToolSet } from "./poc-contracts.js";
|
|
4
|
+
import type { IdeaGraph, SemanticValue } from "./types.js";
|
|
5
|
+
export type PositionAnalysisLine = {
|
|
6
|
+
rootMove: string;
|
|
7
|
+
pv: string[];
|
|
8
|
+
depth: number;
|
|
9
|
+
nodes: number | null;
|
|
10
|
+
scoreCp: number | null;
|
|
11
|
+
/** @deprecated Legacy name: signed mate distance in moves, NOT plies. Rename before public release. */
|
|
12
|
+
matePly: number | null;
|
|
13
|
+
/** Added at the adapter/tool boundary; old saved records remain unchanged. */
|
|
14
|
+
scoreScope?: Record<string, string>;
|
|
15
|
+
scoreProvenance?: Record<string, SemanticValue>;
|
|
16
|
+
/** The unmodified engine line from the original search root. */
|
|
17
|
+
rawPv?: string[];
|
|
18
|
+
/** Joined endpoint searches are conditional, each with its own score/search scope. */
|
|
19
|
+
pvCompletion?: {
|
|
20
|
+
requestedPlies: number;
|
|
21
|
+
actualPlies: number;
|
|
22
|
+
status: "complete" | "terminal" | "short-budget" | "short-attempt-limit" | "short-no-progress" | "short-error" | "invalid";
|
|
23
|
+
conditional: boolean;
|
|
24
|
+
segments: Array<{
|
|
25
|
+
fen: string;
|
|
26
|
+
startPly: number;
|
|
27
|
+
depth: number;
|
|
28
|
+
pv: string[];
|
|
29
|
+
scoreCp: number | null;
|
|
30
|
+
matePly: number | null;
|
|
31
|
+
scoreScope?: Record<string, string>;
|
|
32
|
+
scoreProvenance?: Record<string, SemanticValue>;
|
|
33
|
+
command: string;
|
|
34
|
+
engine: string;
|
|
35
|
+
engineBuild: string;
|
|
36
|
+
cacheProvenance: string;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type PositionAnalysisRequest = {
|
|
41
|
+
fen: string;
|
|
42
|
+
depth: number;
|
|
43
|
+
multiPv: number;
|
|
44
|
+
rootMoves: string[];
|
|
45
|
+
minimumPvPlies?: number;
|
|
46
|
+
/** Defaults to `default`; `bypass` is reserved for independently sampled probes. */
|
|
47
|
+
cachePolicy?: "default" | "bypass";
|
|
48
|
+
signal?: AbortSignal;
|
|
49
|
+
};
|
|
50
|
+
/** Identifies the exact local source that supplied a browser analysis result. */
|
|
51
|
+
export type PositionAnalysisCacheProvenance = "engine" | "widget-analysis-cache" | "browser-completed-cache";
|
|
52
|
+
export type PositionAnalysisResult = {
|
|
53
|
+
engine: string;
|
|
54
|
+
engineBuild: string;
|
|
55
|
+
command: string;
|
|
56
|
+
bestMove: string | null;
|
|
57
|
+
lines: PositionAnalysisLine[];
|
|
58
|
+
/** Present for browser-backed analyses so callers can distinguish local reuse from a search. */
|
|
59
|
+
cacheProvenance?: PositionAnalysisCacheProvenance;
|
|
60
|
+
sourceCacheProvenance?: PositionAnalysisCacheProvenance;
|
|
61
|
+
};
|
|
62
|
+
export interface PositionAnalysisProvider {
|
|
63
|
+
analyze(request: PositionAnalysisRequest): Promise<PositionAnalysisResult>;
|
|
64
|
+
}
|
|
65
|
+
export type PocToolHostOptions = {
|
|
66
|
+
analyzer?: PositionAnalysisProvider;
|
|
67
|
+
graph?: IdeaGraph;
|
|
68
|
+
registry?: ConceptRegistry;
|
|
69
|
+
defaultDepth?: number;
|
|
70
|
+
minimumDepth?: number;
|
|
71
|
+
maxDepth?: number;
|
|
72
|
+
maxRootMoves?: number;
|
|
73
|
+
leadingAlternative?: {
|
|
74
|
+
fen: string;
|
|
75
|
+
uci: string;
|
|
76
|
+
evidenceId: string;
|
|
77
|
+
};
|
|
78
|
+
/** Explicit, bounded option; omitted for ordinary hosts. */
|
|
79
|
+
branchExpansion?: BranchExpansionConfig;
|
|
80
|
+
};
|
|
81
|
+
export declare function createPocToolHost(contextInput: ReasoningPositionContext, options?: PocToolHostOptions): ReasoningToolSet;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import type { RecordedSelectedClassification } from './recorded-selected-classification.js';
|
|
2
|
+
import { visibleSupportLines } from './visible-support-lines.js';
|
|
3
|
+
import type { WikibooksIndex } from './wikibooks-index.js';
|
|
4
|
+
import { type OpeningSourceCredit } from './opening-source-credits.js';
|
|
5
|
+
import type { MaterialFormat } from './material-format.js';
|
|
6
|
+
import { type InitialSearchPlan } from './initial-search-plan.js';
|
|
7
|
+
import type { WikibooksContextResult, WikibooksTarget } from "./opening-source-contracts.js";
|
|
8
|
+
import { type ExplanationReview } from './simple-explanation-coverage.js';
|
|
9
|
+
import { type AiFailureDetails } from "../ai-request-failure.js";
|
|
10
|
+
import type { SimpleBoardAnalysis } from "./simple-board-analysis.js";
|
|
11
|
+
import { type PriorConversationMessage } from "./conversation-context.js";
|
|
12
|
+
import type { RecordedMainLine } from "./answer-host-contracts.js";
|
|
13
|
+
import type { SimpleEffort } from "./simple-agent-config.js";
|
|
14
|
+
import { type AnswerModelConnector } from "./answer-model-connector.js";
|
|
15
|
+
import { type AblationEvidenceClosureBundle } from "./ablation-evidence-bundle.js";
|
|
16
|
+
import { type ObservableLlmTraceSink } from "./ai-sdk-runtime-support.js";
|
|
17
|
+
import { type ReasoningEvidenceRecord, type ReasoningToolSet } from "./poc-contracts.js";
|
|
18
|
+
import type { PlayerPerspective } from "../player-perspective.js";
|
|
19
|
+
export { SIMPLE_TOOL_AGENT_VERSION } from "./simple-runtime-version.js";
|
|
20
|
+
export declare const SIMPLE_MODELS: {
|
|
21
|
+
readonly "Simple-Sol": "openai/gpt-5.6-sol";
|
|
22
|
+
readonly "Simple-Opus": "anthropic/claude-opus-5";
|
|
23
|
+
};
|
|
24
|
+
export type SimpleModelOption = keyof typeof SIMPLE_MODELS;
|
|
25
|
+
export declare const SIMPLE_BUDGETS: Readonly<{
|
|
26
|
+
maxModelCalls: 6;
|
|
27
|
+
maxOutputTokensPerCall: 6000;
|
|
28
|
+
maxSearchesPerBatch: 8;
|
|
29
|
+
maxOutputTokens: 18000;
|
|
30
|
+
maxWallTimeMs: 180000;
|
|
31
|
+
maxRequestBytes: 1000000;
|
|
32
|
+
maxDepth: 14;
|
|
33
|
+
maxRootMoves: 6;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const SIMPLE_EXPANDED_BUDGETS: Readonly<{
|
|
36
|
+
maxOutputTokensPerCall: 12000;
|
|
37
|
+
maxOutputTokens: 36000;
|
|
38
|
+
maxWallTimeMs: 300000;
|
|
39
|
+
maxModelCalls: 6;
|
|
40
|
+
maxSearchesPerBatch: 8;
|
|
41
|
+
maxRequestBytes: 1000000;
|
|
42
|
+
maxDepth: 14;
|
|
43
|
+
maxRootMoves: 6;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const SIMPLE_RECOVERY_BUDGETS: Readonly<{
|
|
46
|
+
maxOutputTokensPerCall: 24000;
|
|
47
|
+
maxOutputTokens: 72000;
|
|
48
|
+
maxWallTimeMs: 600000;
|
|
49
|
+
maxModelCalls: 6;
|
|
50
|
+
maxSearchesPerBatch: 8;
|
|
51
|
+
maxRequestBytes: 1000000;
|
|
52
|
+
maxDepth: 14;
|
|
53
|
+
maxRootMoves: 6;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const SIMPLE_DISCLOSURE = "Experimental answer. Tool inputs, legality, evidence scope and interactive references are checked at completion and reported in referenceValidation; prose correctness and claim entailment are not validated. Unresolved references remain plain text.";
|
|
56
|
+
/** Keep only billing and bounded routing metadata; provider reasoning stays private in continuation memory. */
|
|
57
|
+
export declare function simpleUsageForTrace(usage: unknown, metadata: unknown, headers?: Record<string, string>): {
|
|
58
|
+
providerMetadata?: {
|
|
59
|
+
openrouter: {
|
|
60
|
+
usage: {
|
|
61
|
+
cost: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
} | undefined;
|
|
65
|
+
serviceRouting?: import("../ai-routing-diagnostics.js").AiRoutingDiagnostics | undefined;
|
|
66
|
+
usage: unknown;
|
|
67
|
+
};
|
|
68
|
+
export declare function validateSimpleToolInput(name: string, input: Record<string, unknown>, schema: Record<string, unknown>): void;
|
|
69
|
+
export type SimpleAgentDiagnostic = {
|
|
70
|
+
stage: string;
|
|
71
|
+
inputTokens: number;
|
|
72
|
+
outputTokens: number;
|
|
73
|
+
latencyMs: number;
|
|
74
|
+
finishReason: string;
|
|
75
|
+
};
|
|
76
|
+
export declare function runPreparedAnswer(input: {
|
|
77
|
+
policy?: {
|
|
78
|
+
system: (flags: {
|
|
79
|
+
encoded: boolean;
|
|
80
|
+
reusedFacts: boolean;
|
|
81
|
+
sharedEvidence?: boolean;
|
|
82
|
+
final: boolean;
|
|
83
|
+
purposeGuidance?: boolean;
|
|
84
|
+
searchBreadthGuidance?: boolean;
|
|
85
|
+
boardAnalysisGuidance?: boolean;
|
|
86
|
+
explanationCoverage?: boolean;
|
|
87
|
+
answerComposition?: 'move-explanation' | 'none';
|
|
88
|
+
}) => string;
|
|
89
|
+
description: (name: string) => string;
|
|
90
|
+
};
|
|
91
|
+
connector: AnswerModelConnector;
|
|
92
|
+
openingIndex?: () => Promise<WikibooksIndex>;
|
|
93
|
+
modelName: string;
|
|
94
|
+
requestId: string;
|
|
95
|
+
/** Offline evaluation only; callers supply a condition-specific bundle without withheld evidence. */
|
|
96
|
+
evaluation?: {
|
|
97
|
+
fixedEvidence: true;
|
|
98
|
+
requiredEvidenceIds: string[];
|
|
99
|
+
};
|
|
100
|
+
/** Node evaluation only: provider metering is unavailable; no browser caller sets this. */
|
|
101
|
+
evaluationTransport?: {
|
|
102
|
+
kind: "subagent-files" | "openrouter-direct";
|
|
103
|
+
wallTimeMs: number;
|
|
104
|
+
};
|
|
105
|
+
/** Baseline switch for controlled serializer evaluation only. */
|
|
106
|
+
evidenceCompaction?: "baseline" | "lossless";
|
|
107
|
+
/** Node comparison override; browser uses the qualified default. */
|
|
108
|
+
materialFormat?: MaterialFormat;
|
|
109
|
+
question?: string;
|
|
110
|
+
/** Diagnostic ablation only; live Simple enables bounded explanation review. */
|
|
111
|
+
explanationCoverage?: boolean;
|
|
112
|
+
boardAnalysis?: SimpleBoardAnalysis;
|
|
113
|
+
recordedSelectedClassification?: RecordedSelectedClassification;
|
|
114
|
+
/** Research ablation; normal evidence always includes the standard reference. */
|
|
115
|
+
squareReference?: boolean;
|
|
116
|
+
openingSourceContext?: WikibooksContextResult;
|
|
117
|
+
openingSourceLookup?: (targets: WikibooksTarget[], signal: AbortSignal, root?: import("./poc-contracts.js").ReasoningPositionContext) => Promise<WikibooksContextResult>;
|
|
118
|
+
/** Total overlapping browser preparation time, including optional source wait. */
|
|
119
|
+
preModelElapsedMs?: number;
|
|
120
|
+
playerPerspective?: PlayerPerspective | null;
|
|
121
|
+
conversationHistory?: readonly PriorConversationMessage[];
|
|
122
|
+
getMainLine?: (signal: AbortSignal) => Promise<RecordedMainLine>;
|
|
123
|
+
initialMainLine?: RecordedMainLine;
|
|
124
|
+
initialSearchPlan?: InitialSearchPlan;
|
|
125
|
+
refreshPreparedBoardAnalysis?: (signal: AbortSignal) => Promise<SimpleBoardAnalysis | undefined>;
|
|
126
|
+
omitSelectedContext?: boolean;
|
|
127
|
+
routingDecision?: import('./question-routing.js').QuestionRoutingDecision;
|
|
128
|
+
effort?: SimpleEffort;
|
|
129
|
+
providerRoute?: string;
|
|
130
|
+
/** Explicit browser analysis policy; frozen diagnostic defaults remain unchanged. */
|
|
131
|
+
analysisDepth?: 18;
|
|
132
|
+
preparation?: import("./simple-evidence-preparation.js").SimpleEvidencePreparation;
|
|
133
|
+
purposeGuidance?: boolean;
|
|
134
|
+
searchBreadthGuidance?: boolean;
|
|
135
|
+
boardAnalysisGuidance?: boolean;
|
|
136
|
+
simpleAllowance?: "default" | "expanded" | "glm-recovery";
|
|
137
|
+
bundle: Readonly<AblationEvidenceClosureBundle>;
|
|
138
|
+
host: ReasoningToolSet;
|
|
139
|
+
signal?: AbortSignal;
|
|
140
|
+
observableTraceSink?: ObservableLlmTraceSink;
|
|
141
|
+
onProgress?: (message: string) => void;
|
|
142
|
+
}): Promise<{
|
|
143
|
+
usage: {
|
|
144
|
+
inputTokens: number;
|
|
145
|
+
outputTokens: number;
|
|
146
|
+
metering: "reported" | "partly-unavailable";
|
|
147
|
+
reportedOutputTokens: number | null;
|
|
148
|
+
outputBudgetReservation: number;
|
|
149
|
+
unmeteredCalls: number;
|
|
150
|
+
reportedInputTokens: number | null;
|
|
151
|
+
unmeteredInputCalls: number;
|
|
152
|
+
};
|
|
153
|
+
limitations: string[];
|
|
154
|
+
evaluationTransport?: {
|
|
155
|
+
metering: string;
|
|
156
|
+
outputBudgetReserved: number;
|
|
157
|
+
kind: "subagent-files" | "openrouter-direct";
|
|
158
|
+
wallTimeMs: number;
|
|
159
|
+
} | undefined;
|
|
160
|
+
acquiredMainLines: {
|
|
161
|
+
source: string;
|
|
162
|
+
startFen: string;
|
|
163
|
+
moves: {
|
|
164
|
+
uci: string;
|
|
165
|
+
san: string;
|
|
166
|
+
moveNumber: number;
|
|
167
|
+
color: import("chess.js").Color;
|
|
168
|
+
}[];
|
|
169
|
+
selectedIndex: number;
|
|
170
|
+
selectedAtStart: boolean;
|
|
171
|
+
selectedOnMainLine: boolean;
|
|
172
|
+
totalPlies: number;
|
|
173
|
+
truncated: boolean;
|
|
174
|
+
pgn: string;
|
|
175
|
+
}[];
|
|
176
|
+
status: "failure" | "diagnostic";
|
|
177
|
+
answer: string;
|
|
178
|
+
failure: string | null;
|
|
179
|
+
failureDetails: AiFailureDetails | undefined;
|
|
180
|
+
diagnostics: SimpleAgentDiagnostic[];
|
|
181
|
+
toolRuns: Record<string, unknown>[];
|
|
182
|
+
elapsedMs: number;
|
|
183
|
+
initialEvidenceIds: string[];
|
|
184
|
+
presentedEvidenceIds: string[];
|
|
185
|
+
presentedEvidence: ReasoningEvidenceRecord[];
|
|
186
|
+
openingSources: OpeningSourceCredit[];
|
|
187
|
+
searchesUsed: 0 | 1 | 2 | 3;
|
|
188
|
+
searchesSucceeded: number;
|
|
189
|
+
searchesFailed: number;
|
|
190
|
+
engineEvidenceStatus: "unavailable" | "not-requested" | "unknown" | "available";
|
|
191
|
+
preparation: import("./simple-evidence-preparation.js").SimpleEvidencePreparation | undefined;
|
|
192
|
+
explanationCoverage?: {
|
|
193
|
+
stopRepairs: number;
|
|
194
|
+
reviewCount: number;
|
|
195
|
+
qualificationRequested: boolean;
|
|
196
|
+
status: string;
|
|
197
|
+
unresolved: never[];
|
|
198
|
+
investigated: never[];
|
|
199
|
+
modelJudgment: null;
|
|
200
|
+
limitation: string;
|
|
201
|
+
} | {
|
|
202
|
+
stopRepairs: number;
|
|
203
|
+
reviewCount: number;
|
|
204
|
+
qualificationRequested: boolean;
|
|
205
|
+
status: string;
|
|
206
|
+
unresolved: string[];
|
|
207
|
+
investigated: string[];
|
|
208
|
+
modelJudgment: ExplanationReview;
|
|
209
|
+
limitation: string;
|
|
210
|
+
} | undefined;
|
|
211
|
+
recurringMotifs?: {
|
|
212
|
+
authority: string;
|
|
213
|
+
branches: {
|
|
214
|
+
root: string;
|
|
215
|
+
evidenceId: string;
|
|
216
|
+
plies: number;
|
|
217
|
+
depth: number;
|
|
218
|
+
continuationCoverage: string;
|
|
219
|
+
unmetHorizonRequests: {
|
|
220
|
+
evidenceId: string;
|
|
221
|
+
requested: number;
|
|
222
|
+
prefixLength: number;
|
|
223
|
+
}[];
|
|
224
|
+
prefixLength: number;
|
|
225
|
+
prefixEvidenceId: string | null;
|
|
226
|
+
pvCompletion: unknown;
|
|
227
|
+
rawPv: unknown;
|
|
228
|
+
san: string;
|
|
229
|
+
score: unknown;
|
|
230
|
+
structuralEvents: unknown[];
|
|
231
|
+
}[];
|
|
232
|
+
observedRoutes: {
|
|
233
|
+
piece: string;
|
|
234
|
+
start: string;
|
|
235
|
+
destination: string;
|
|
236
|
+
roots: string[];
|
|
237
|
+
witnesses: unknown[];
|
|
238
|
+
}[];
|
|
239
|
+
distinctOpponentRoots: number;
|
|
240
|
+
} | undefined;
|
|
241
|
+
preparationConsolidation: {
|
|
242
|
+
version: string;
|
|
243
|
+
searchCount: number;
|
|
244
|
+
primaryEntryCount: number;
|
|
245
|
+
summarizedDiscoveryCount: number;
|
|
246
|
+
dependencies: Record<string, unknown>[];
|
|
247
|
+
interpretation: string;
|
|
248
|
+
};
|
|
249
|
+
referenceValidation: ({
|
|
250
|
+
version: string;
|
|
251
|
+
citationRepairs: {
|
|
252
|
+
originalId: string;
|
|
253
|
+
canonicalId: string;
|
|
254
|
+
}[];
|
|
255
|
+
interactionCoverage: {
|
|
256
|
+
resolved: number;
|
|
257
|
+
total: number;
|
|
258
|
+
};
|
|
259
|
+
unresolvedReferences: string[];
|
|
260
|
+
unboundMentions: string[];
|
|
261
|
+
notationCorrections: string[];
|
|
262
|
+
labelCorrections: {
|
|
263
|
+
originalLabel: string;
|
|
264
|
+
canonicalLabel: string;
|
|
265
|
+
target: string;
|
|
266
|
+
}[];
|
|
267
|
+
gameReferences: {
|
|
268
|
+
target: string;
|
|
269
|
+
status: "resolved" | "repaired" | "unresolved";
|
|
270
|
+
reason?: string;
|
|
271
|
+
}[];
|
|
272
|
+
repairs: {
|
|
273
|
+
originalTarget: string;
|
|
274
|
+
repairedTarget: string;
|
|
275
|
+
label: string;
|
|
276
|
+
evidenceIds: string[];
|
|
277
|
+
authority: string;
|
|
278
|
+
}[];
|
|
279
|
+
causalClaimChecks: import("./causal-claim-checks.js").CausalClaimCheck[];
|
|
280
|
+
causalClaimCheckStatus: "unavailable" | "completed";
|
|
281
|
+
causalClaimCheckScope: string;
|
|
282
|
+
} & {
|
|
283
|
+
supportingContinuations?: ReturnType<typeof visibleSupportLines>["additions"];
|
|
284
|
+
}) | {
|
|
285
|
+
status: "unavailable";
|
|
286
|
+
reason: string;
|
|
287
|
+
};
|
|
288
|
+
completionReason: string | null;
|
|
289
|
+
toolCallsUsed: number;
|
|
290
|
+
initialSearches: Record<string, unknown>[];
|
|
291
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PositionAnalysisLine as LegacyPositionAnalysisLine, PositionAnalysisResult as LegacyPositionAnalysisResult, PositionAnalysisProvider as LegacyPositionAnalysisProvider, PositionAnalysisRequest } from './poc-tools.js';
|
|
2
|
+
export type { PositionAnalysisRequest } from './poc-tools.js';
|
|
3
|
+
/** Historical evidence uses matePly, whose values have always been signed moves. */
|
|
4
|
+
export type { LegacyPositionAnalysisLine, LegacyPositionAnalysisResult, LegacyPositionAnalysisProvider };
|
|
5
|
+
type LegacyCompletion = NonNullable<LegacyPositionAnalysisLine['pvCompletion']>;
|
|
6
|
+
type LegacySegment = LegacyCompletion['segments'][number];
|
|
7
|
+
/** Signed mate-in-moves relative to the declared score perspective; null is no mate score. */
|
|
8
|
+
export type PositionAnalysisSegment = Omit<LegacySegment, 'matePly'> & {
|
|
9
|
+
mateInMoves: number | null;
|
|
10
|
+
};
|
|
11
|
+
export type PositionAnalysisLine = Omit<LegacyPositionAnalysisLine, 'matePly' | 'pvCompletion'> & {
|
|
12
|
+
mateInMoves: number | null;
|
|
13
|
+
pvCompletion?: Omit<LegacyCompletion, 'segments'> & {
|
|
14
|
+
segments: PositionAnalysisSegment[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type PositionAnalysisResult = Omit<LegacyPositionAnalysisResult, 'lines'> & {
|
|
18
|
+
lines: PositionAnalysisLine[];
|
|
19
|
+
};
|
|
20
|
+
export interface PositionAnalysisProvider {
|
|
21
|
+
analyze(request: PositionAnalysisRequest): Promise<PositionAnalysisResult>;
|
|
22
|
+
}
|
|
23
|
+
export type CompatiblePositionAnalysisProvider = PositionAnalysisProvider | LegacyPositionAnalysisProvider;
|
|
24
|
+
/** Rename only: no search, score reinterpretation, schema migration or evidence admission. */
|
|
25
|
+
export declare function toPositionAnalysis(result: PositionAnalysisResult | LegacyPositionAnalysisResult): PositionAnalysisResult;
|
|
26
|
+
/** Explicit compatibility conversion for current internal tool/trace wire schemas. */
|
|
27
|
+
export declare function toLegacyPositionAnalysis(result: PositionAnalysisResult | LegacyPositionAnalysisResult): LegacyPositionAnalysisResult;
|
|
28
|
+
/** Public/legacy input normalization; delegates the original request and cancellation signal. */
|
|
29
|
+
export declare function toLegacyPositionAnalysisProvider(provider: CompatiblePositionAnalysisProvider): LegacyPositionAnalysisProvider;
|
|
30
|
+
/** Adapt an existing legacy provider to the preferred public signed-moves contract. */
|
|
31
|
+
export declare function toPositionAnalysisProvider(provider: CompatiblePositionAnalysisProvider): PositionAnalysisProvider;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PositionAnalysisRequest, PositionAnalysisResult } from "./poc-tools.js";
|
|
2
|
+
/** Both Stockfish adapters retain UCI scores relative to the search root's turn. */
|
|
3
|
+
export declare function scopePositionAnalysis(result: PositionAnalysisResult, request: PositionAnalysisRequest): PositionAnalysisResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReasoningEvidenceRecord } from './poc-contracts.js';
|
|
2
|
+
export type PreparedPresentation = {
|
|
3
|
+
callId: string;
|
|
4
|
+
modelRun: Record<string, unknown>;
|
|
5
|
+
records: ReasoningEvidenceRecord[];
|
|
6
|
+
playedMove?: string;
|
|
7
|
+
discoveryCallId?: string;
|
|
8
|
+
limitations?: string[];
|
|
9
|
+
};
|
|
10
|
+
/** Consolidates presentation only. Raw searches, evidence and numeric scores are never merged. */
|
|
11
|
+
export declare function consolidatePreparedSearches(entries: readonly PreparedPresentation[]): {
|
|
12
|
+
results: Record<string, unknown>[];
|
|
13
|
+
diagnostics: {
|
|
14
|
+
version: string;
|
|
15
|
+
searchCount: number;
|
|
16
|
+
primaryEntryCount: number;
|
|
17
|
+
summarizedDiscoveryCount: number;
|
|
18
|
+
dependencies: Record<string, unknown>[];
|
|
19
|
+
interpretation: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ExistingAnalysisContextMode } from "./existing-analysis-context.js";
|
|
2
|
+
import { CompositeObservationProvider } from "./poc-observations.js";
|
|
3
|
+
import type { ReasoningPositionContext } from "./poc-contracts.js";
|
|
4
|
+
/**
|
|
5
|
+
* The production pre-semantic observation composition. It is deliberately
|
|
6
|
+
* environment-neutral: browser and evaluation callers share exactly the same
|
|
7
|
+
* deterministic, mechanical-fact, and attributed-existing-analysis inputs.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PRODUCTION_OBSERVATION_PROVIDER_VERSION: "production-observation-provider/1";
|
|
10
|
+
export type ProductionObservationProviderInput = {
|
|
11
|
+
existingAnalysis?: unknown;
|
|
12
|
+
context?: ReasoningPositionContext;
|
|
13
|
+
question?: string;
|
|
14
|
+
existingAnalysisContextMode?: ExistingAnalysisContextMode;
|
|
15
|
+
};
|
|
16
|
+
export declare function createProductionObservationProvider(input?: ProductionObservationProviderInput): CompositeObservationProvider;
|