@knights-eye-chess/ai-analysis 0.0.0-stage → 0.1.0-dev.14
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 +24 -0
- package/README.md +141 -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 +72 -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,90 @@
|
|
|
1
|
+
import { type ReasoningEvidenceRecord, type ReasoningPositionContext } from './poc-contracts.js';
|
|
2
|
+
export declare const EXPLANATION_FAMILIES: readonly ["accept-offer", "central-break", "kingside-play", "queenside-play", "exchange-defender", "preserve-piece", "direct-tactics", "quiet-improvement"];
|
|
3
|
+
export declare const EXPLANATION_REVIEW_SCHEMA: Record<string, unknown>;
|
|
4
|
+
export type ExplanationReview = {
|
|
5
|
+
mode: 'positional' | 'tactical' | 'direct' | 'not-explanation';
|
|
6
|
+
mechanism: string;
|
|
7
|
+
challenges: string[];
|
|
8
|
+
evidenceIds: string[];
|
|
9
|
+
unresolved: string[];
|
|
10
|
+
limitations?: string[];
|
|
11
|
+
shortLineReasons?: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare function validateExplanationReview(input: Record<string, unknown>, context: ReasoningPositionContext, known: Map<string, ReasoningEvidenceRecord>): ExplanationReview;
|
|
14
|
+
export declare function explanationBranches(context: ReasoningPositionContext, records: Iterable<ReasoningEvidenceRecord>): {
|
|
15
|
+
root: string;
|
|
16
|
+
id: string;
|
|
17
|
+
pv: string[];
|
|
18
|
+
san: string[];
|
|
19
|
+
depth: number;
|
|
20
|
+
score: unknown;
|
|
21
|
+
prefixLength: number;
|
|
22
|
+
prefixEvidenceId: string | null;
|
|
23
|
+
pvCompletion: unknown;
|
|
24
|
+
rawPv: unknown;
|
|
25
|
+
continuationCovered: boolean;
|
|
26
|
+
unmetHorizonRequests: {
|
|
27
|
+
evidenceId: string;
|
|
28
|
+
requested: number;
|
|
29
|
+
prefixLength: number;
|
|
30
|
+
}[];
|
|
31
|
+
}[];
|
|
32
|
+
export declare function legalInvestigationRoots(context: ReasoningPositionContext): {
|
|
33
|
+
[k: string]: {
|
|
34
|
+
uci: string;
|
|
35
|
+
san: string;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
export declare function explanationSummary(context: ReasoningPositionContext, records: Iterable<ReasoningEvidenceRecord>): {
|
|
39
|
+
authority: string;
|
|
40
|
+
branches: {
|
|
41
|
+
root: string;
|
|
42
|
+
evidenceId: string;
|
|
43
|
+
plies: number;
|
|
44
|
+
depth: number;
|
|
45
|
+
continuationCoverage: string;
|
|
46
|
+
unmetHorizonRequests: {
|
|
47
|
+
evidenceId: string;
|
|
48
|
+
requested: number;
|
|
49
|
+
prefixLength: number;
|
|
50
|
+
}[];
|
|
51
|
+
prefixLength: number;
|
|
52
|
+
prefixEvidenceId: string | null;
|
|
53
|
+
pvCompletion: unknown;
|
|
54
|
+
rawPv: unknown;
|
|
55
|
+
san: string;
|
|
56
|
+
score: unknown;
|
|
57
|
+
structuralEvents: unknown[];
|
|
58
|
+
}[];
|
|
59
|
+
observedRoutes: {
|
|
60
|
+
piece: string;
|
|
61
|
+
start: string;
|
|
62
|
+
destination: string;
|
|
63
|
+
roots: string[];
|
|
64
|
+
witnesses: unknown[];
|
|
65
|
+
}[];
|
|
66
|
+
distinctOpponentRoots: number;
|
|
67
|
+
};
|
|
68
|
+
export declare function explanationCoverage(context: ReasoningPositionContext, records: Iterable<ReasoningEvidenceRecord>, review: ExplanationReview | null): {
|
|
69
|
+
status: string;
|
|
70
|
+
unresolved: never[];
|
|
71
|
+
investigated: never[];
|
|
72
|
+
modelJudgment: null;
|
|
73
|
+
limitation: string;
|
|
74
|
+
} | {
|
|
75
|
+
status: string;
|
|
76
|
+
unresolved: string[];
|
|
77
|
+
investigated: string[];
|
|
78
|
+
modelJudgment: ExplanationReview;
|
|
79
|
+
limitation: string;
|
|
80
|
+
};
|
|
81
|
+
/** Remove only expensive per-ply geometry from planning copies; original evidence stays in known. */
|
|
82
|
+
export declare function planningEvidence(result: {
|
|
83
|
+
contextHash: string;
|
|
84
|
+
evidence: ReasoningEvidenceRecord[];
|
|
85
|
+
limitations: readonly string[];
|
|
86
|
+
}): {
|
|
87
|
+
evidence: ReasoningEvidenceRecord[];
|
|
88
|
+
contextHash: string;
|
|
89
|
+
limitations: readonly string[];
|
|
90
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReasoningEvidenceRecord } from "./poc-contracts.js";
|
|
2
|
+
export declare const FACT_DELIVERY_INSTRUCTIONS = "{$priorFact:[toolCallId,evidenceId,variation,ply]} reuses an identical tactical fact from an earlier tool result in this CURRENT_QUESTION only. Locate the native result for toolCallId, then that evidence record's continuationMoveFacts[variation].moves[ply-1]; variation=-1 instead means rootMoveFacts[ply-1]. Expand its same-message encoding/metadata. Position, ordered prefix and the complete fact were checked for equality; this does NOT reuse scores or search provenance. Every current comparison retains its own ranking, settings and coverage. No references point to previous chat exchanges.";
|
|
3
|
+
/** Request-local reuse, valid only while the loop's earlier tool messages remain. */
|
|
4
|
+
export declare class SimpleFactDelivery {
|
|
5
|
+
private readonly contextHash;
|
|
6
|
+
private delivered;
|
|
7
|
+
private pending;
|
|
8
|
+
/** Called only after complete native response messages have entered context. */
|
|
9
|
+
commit(): void;
|
|
10
|
+
constructor(contextHash: string);
|
|
11
|
+
project(callId: string, result: {
|
|
12
|
+
contextHash: string;
|
|
13
|
+
evidence: readonly ReasoningEvidenceRecord[];
|
|
14
|
+
limitations: readonly string[];
|
|
15
|
+
}): {
|
|
16
|
+
evidence: (ReasoningEvidenceRecord | {
|
|
17
|
+
data: {
|
|
18
|
+
rootMoveFacts?: unknown[] | undefined;
|
|
19
|
+
continuationMoveFacts?: (string | number | boolean | import("./types.js").SemanticValue[] | {
|
|
20
|
+
[key: string]: import("./types.js").SemanticValue;
|
|
21
|
+
} | {
|
|
22
|
+
moves: unknown[];
|
|
23
|
+
} | null)[] | undefined;
|
|
24
|
+
};
|
|
25
|
+
schemaVersion: typeof import("./poc-contracts.js").REASONING_POC_VERSION;
|
|
26
|
+
id: string;
|
|
27
|
+
contextHash: string;
|
|
28
|
+
kind: import("./poc-contracts.js").ReasoningEvidenceKind;
|
|
29
|
+
source: string;
|
|
30
|
+
proofStrength: import("./types.js").ProofStrength | null;
|
|
31
|
+
licenses?: import("./evidence-licenses.js").EvidenceLicense[];
|
|
32
|
+
summary: string;
|
|
33
|
+
coverage: {
|
|
34
|
+
complete: boolean;
|
|
35
|
+
covered: string[];
|
|
36
|
+
unresolved: string[];
|
|
37
|
+
} | null;
|
|
38
|
+
replay: Record<string, import("./types.js").SemanticValue> | null;
|
|
39
|
+
})[];
|
|
40
|
+
contextHash: string;
|
|
41
|
+
limitations: readonly string[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReasoningEvidenceRecord, ReasoningPositionContext } from './poc-contracts.js';
|
|
2
|
+
/** A deliberately narrow correction for an asserted forced win. The finite
|
|
3
|
+
* search only limits what this fallback can support; it is no proof that a
|
|
4
|
+
* different search could never find a forced win. */
|
|
5
|
+
export declare function forcedWinPremiseFallback(question: string, context: ReasoningPositionContext | undefined, records: readonly ReasoningEvidenceRecord[], selectedContextAvailable?: boolean): string | null;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { RecordedReferenceLine } from './historical-prose.js';
|
|
2
|
+
export type AuthoredReferenceResult = {
|
|
3
|
+
label: string;
|
|
4
|
+
target: string;
|
|
5
|
+
resolved: boolean;
|
|
6
|
+
reason?: string;
|
|
7
|
+
canonicalLabel?: string;
|
|
8
|
+
};
|
|
9
|
+
import { type ReasoningPositionContext, type ReasoningEvidenceRecord } from "./poc-contracts.js";
|
|
10
|
+
import { type FreshEnginePvWitness, type FreshEnginePvReferenceEvidence } from './fresh-engine-pv-witnesses.js';
|
|
11
|
+
export type { FreshEnginePvWitness } from './fresh-engine-pv-witnesses.js';
|
|
12
|
+
export type SimpleProseReferenceOptions = {
|
|
13
|
+
freshEnginePvWitnesses?: readonly FreshEnginePvWitness[];
|
|
14
|
+
};
|
|
15
|
+
export type SimpleReferenceGapCounts = {
|
|
16
|
+
version: 'simple-reference-gap-counts/1';
|
|
17
|
+
unboundProseSpans: number;
|
|
18
|
+
unboundMentions: number;
|
|
19
|
+
unresolvedReferences: number;
|
|
20
|
+
unknownCitations: number;
|
|
21
|
+
formattingWarnings: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const SIMPLE_REFERENCE_VERSION = "simple-references/22";
|
|
24
|
+
declare const INTERNAL_WITNESS: unique symbol;
|
|
25
|
+
type Phase = "before" | "after";
|
|
26
|
+
export type SimplePosition = {
|
|
27
|
+
recordedContext?: ReasoningPositionContext;
|
|
28
|
+
start: Phase;
|
|
29
|
+
moves: {
|
|
30
|
+
uci: string;
|
|
31
|
+
san: string;
|
|
32
|
+
pieceId: string;
|
|
33
|
+
}[];
|
|
34
|
+
fen: string;
|
|
35
|
+
};
|
|
36
|
+
export type SimpleReference = {
|
|
37
|
+
kind: "move" | "piece" | "square" | "sequence";
|
|
38
|
+
label: string;
|
|
39
|
+
displayLabel?: string;
|
|
40
|
+
position: SimplePosition;
|
|
41
|
+
evidenceIds: string[];
|
|
42
|
+
engineEvidence?: FreshEnginePvReferenceEvidence[];
|
|
43
|
+
square?: string;
|
|
44
|
+
pieceId?: string;
|
|
45
|
+
san?: string;
|
|
46
|
+
uci?: string;
|
|
47
|
+
copyText?: string;
|
|
48
|
+
pieceCode?: string;
|
|
49
|
+
};
|
|
50
|
+
export type SimpleToken = {
|
|
51
|
+
text: string;
|
|
52
|
+
reference?: SimpleReference;
|
|
53
|
+
sourceLink?: {
|
|
54
|
+
href: string;
|
|
55
|
+
};
|
|
56
|
+
gap?: string;
|
|
57
|
+
variationIndex?: number;
|
|
58
|
+
variationStart?: boolean;
|
|
59
|
+
variationEnd?: boolean;
|
|
60
|
+
variationPlayFrom?: number;
|
|
61
|
+
variationMoveIndices?: number[];
|
|
62
|
+
};
|
|
63
|
+
/** Source attribution links are presentation-only; they never confer chess evidence. */
|
|
64
|
+
export declare function safeSimpleSourceLink(target: string): {
|
|
65
|
+
href: string;
|
|
66
|
+
} | null;
|
|
67
|
+
/** Preserve the model's prose while removing presentation-only fence markers. */
|
|
68
|
+
export declare function stripSimpleMarkdownFences(value: string): string;
|
|
69
|
+
/** Internal citation labels are not user prose or navigation. Raw output is retained. */
|
|
70
|
+
export declare function stripSimpleCitationLinks(value: string): string;
|
|
71
|
+
/** Repair only trailing legacy labels attested as internal links in the raw answer. */
|
|
72
|
+
export declare function repairFrozenCitationLabels(value: string, rawParagraph: string): string;
|
|
73
|
+
/** Presentation admission only: no claim-entailment or strategic validator. */
|
|
74
|
+
export declare function simpleProseReferences(answer: string, context: ReasoningPositionContext, records: readonly ReasoningEvidenceRecord[], recordedLine?: RecordedReferenceLine, recordedPath?: string[], onReference?: (reference: AuthoredReferenceResult) => void, internalWitness?: typeof INTERNAL_WITNESS | SimpleProseReferenceOptions): {
|
|
75
|
+
variations: {
|
|
76
|
+
position: SimplePosition;
|
|
77
|
+
references: SimpleReference[];
|
|
78
|
+
start: Phase;
|
|
79
|
+
ucis: string[];
|
|
80
|
+
evidenceIds: string[];
|
|
81
|
+
authority: string;
|
|
82
|
+
engineEvidence?: FreshEnginePvReferenceEvidence[];
|
|
83
|
+
recordedContext?: ReasoningPositionContext;
|
|
84
|
+
}[];
|
|
85
|
+
freshEnginePvAdmission?: import("./fresh-engine-pv-witnesses.js").FreshEnginePvAdmissionAudit | undefined;
|
|
86
|
+
referenceGapCounts?: SimpleReferenceGapCounts | undefined;
|
|
87
|
+
blocks: {
|
|
88
|
+
tokens: SimpleToken[];
|
|
89
|
+
evidenceIds: string[];
|
|
90
|
+
leadingVariationIndex: number | undefined;
|
|
91
|
+
}[];
|
|
92
|
+
evidence: ReasoningEvidenceRecord[];
|
|
93
|
+
gaps: string[];
|
|
94
|
+
notationCorrections: string[];
|
|
95
|
+
coverage: {
|
|
96
|
+
resolved: number;
|
|
97
|
+
total: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/** Formatting only: use already validated paths, including persisted answer views. */
|
|
101
|
+
export declare function decorateSimpleVariations(blocks: {
|
|
102
|
+
tokens: SimpleToken[];
|
|
103
|
+
leadingVariationIndex?: number;
|
|
104
|
+
}[], variations: readonly {
|
|
105
|
+
start: Phase;
|
|
106
|
+
ucis: string[];
|
|
107
|
+
recordedContext?: ReasoningPositionContext;
|
|
108
|
+
}[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SIMPLE_TOOL_AGENT_VERSION = "simple-native-tool-agent/40";
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { Color, PieceSymbol, Square } from "chess.js";
|
|
2
|
+
export declare const CHESS_REASONING_SCHEMA_VERSION: "0.2.0";
|
|
3
|
+
export declare const CHESS_REASONING_POLICY_VERSION: "shadow-2";
|
|
4
|
+
export type BranchId = string;
|
|
5
|
+
export type PieceId = string;
|
|
6
|
+
export type EntityId = string;
|
|
7
|
+
export type EvidenceId = string;
|
|
8
|
+
export type CandidateId = string;
|
|
9
|
+
export type ConceptKey = string;
|
|
10
|
+
export type RegistryKey = string;
|
|
11
|
+
export type ProofStrength = "observed" | "supported" | "forced";
|
|
12
|
+
export type CandidateDisposition = "accepted" | "rejected" | "unsupported";
|
|
13
|
+
export type ConceptCoverage = "evaluated" | "partial" | "unsupported";
|
|
14
|
+
export type SemanticScalar = string | number | boolean | null;
|
|
15
|
+
export type SemanticValue = SemanticScalar | SemanticValue[] | {
|
|
16
|
+
[key: string]: SemanticValue;
|
|
17
|
+
};
|
|
18
|
+
export type SemanticAttributes = Record<string, SemanticValue>;
|
|
19
|
+
export type SemanticReference = {
|
|
20
|
+
domain: RegistryKey;
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
export type SemanticParticipant = {
|
|
24
|
+
role: RegistryKey;
|
|
25
|
+
ref: SemanticReference;
|
|
26
|
+
};
|
|
27
|
+
export type PieceIdentity = {
|
|
28
|
+
id: PieceId;
|
|
29
|
+
color: Color;
|
|
30
|
+
type: PieceSymbol;
|
|
31
|
+
originSquare: Square;
|
|
32
|
+
createdPly: number;
|
|
33
|
+
promotedFrom: PieceId | null;
|
|
34
|
+
capturedAtPly: number | null;
|
|
35
|
+
retiredAtPly: number | null;
|
|
36
|
+
};
|
|
37
|
+
export type IdentityState = {
|
|
38
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
39
|
+
branchId: BranchId;
|
|
40
|
+
fen: string;
|
|
41
|
+
ply: number;
|
|
42
|
+
pieces: Record<PieceId, PieceIdentity>;
|
|
43
|
+
squares: Partial<Record<Square, PieceId>>;
|
|
44
|
+
promotionSequence: number;
|
|
45
|
+
};
|
|
46
|
+
export type MoveIdentityDelta = {
|
|
47
|
+
branchId: BranchId;
|
|
48
|
+
ply: number;
|
|
49
|
+
uci: string;
|
|
50
|
+
san: string;
|
|
51
|
+
mover: PieceId;
|
|
52
|
+
captured: PieceId | null;
|
|
53
|
+
promoted: PieceId | null;
|
|
54
|
+
rookMoved: PieceId | null;
|
|
55
|
+
beforeFen: string;
|
|
56
|
+
afterFen: string;
|
|
57
|
+
};
|
|
58
|
+
export type ProposalReason = {
|
|
59
|
+
code: RegistryKey;
|
|
60
|
+
detail: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Candidates and persisted entities deliberately share generic semantic
|
|
64
|
+
* building blocks. Chess concepts are registry values in `concepts`; they do
|
|
65
|
+
* not add flags, fields, or concept-specific entity subclasses.
|
|
66
|
+
*/
|
|
67
|
+
export type SemanticCandidate = {
|
|
68
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
69
|
+
id: CandidateId;
|
|
70
|
+
branchId: BranchId;
|
|
71
|
+
ply: number;
|
|
72
|
+
uci: string;
|
|
73
|
+
san: string;
|
|
74
|
+
entityType: RegistryKey;
|
|
75
|
+
concepts: ConceptKey[];
|
|
76
|
+
owner: Color | null;
|
|
77
|
+
participants: SemanticParticipant[];
|
|
78
|
+
attributes: SemanticAttributes;
|
|
79
|
+
proposalReasons: ProposalReason[];
|
|
80
|
+
verification: "not-requested";
|
|
81
|
+
};
|
|
82
|
+
export type CandidateGenerationReport = {
|
|
83
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
84
|
+
branchId: BranchId;
|
|
85
|
+
ply: number;
|
|
86
|
+
move: MoveIdentityDelta;
|
|
87
|
+
candidates: SemanticCandidate[];
|
|
88
|
+
conceptCoverage: Record<ConceptKey, ConceptCoverage>;
|
|
89
|
+
skipped: Array<{
|
|
90
|
+
concept: ConceptKey;
|
|
91
|
+
reason: string;
|
|
92
|
+
}>;
|
|
93
|
+
};
|
|
94
|
+
export type ProbeBudget = {
|
|
95
|
+
depth: number | null;
|
|
96
|
+
nodes: number | null;
|
|
97
|
+
timeMs: number | null;
|
|
98
|
+
};
|
|
99
|
+
export type EvidenceRecord = {
|
|
100
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
101
|
+
id: EvidenceId;
|
|
102
|
+
candidateId: CandidateId;
|
|
103
|
+
disposition: CandidateDisposition;
|
|
104
|
+
proofStrength: ProofStrength | null;
|
|
105
|
+
summary: string;
|
|
106
|
+
engine: string;
|
|
107
|
+
engineBuild: string;
|
|
108
|
+
budget: ProbeBudget;
|
|
109
|
+
rootMovesCovered: string[];
|
|
110
|
+
unresolvedMoves: string[];
|
|
111
|
+
principalVariations: string[][];
|
|
112
|
+
scoreCp: number | null;
|
|
113
|
+
matePly: number | null;
|
|
114
|
+
replay: {
|
|
115
|
+
fen: string;
|
|
116
|
+
command: string;
|
|
117
|
+
} | null;
|
|
118
|
+
};
|
|
119
|
+
export type SemanticTransition = {
|
|
120
|
+
ply: number;
|
|
121
|
+
uci: string;
|
|
122
|
+
state: RegistryKey;
|
|
123
|
+
annotation: RegistryKey;
|
|
124
|
+
evidence: EvidenceId[];
|
|
125
|
+
};
|
|
126
|
+
export type SemanticEntity = {
|
|
127
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
128
|
+
id: EntityId;
|
|
129
|
+
branchId: BranchId;
|
|
130
|
+
entityType: RegistryKey;
|
|
131
|
+
concepts: ConceptKey[];
|
|
132
|
+
owner: Color | null;
|
|
133
|
+
createdByPly: number;
|
|
134
|
+
createdByUci: string;
|
|
135
|
+
participants: SemanticParticipant[];
|
|
136
|
+
attributes: SemanticAttributes;
|
|
137
|
+
proofStrength: ProofStrength | null;
|
|
138
|
+
state: RegistryKey;
|
|
139
|
+
evidence: EvidenceId[];
|
|
140
|
+
transitions: SemanticTransition[];
|
|
141
|
+
};
|
|
142
|
+
export type SemanticRelation = {
|
|
143
|
+
id: string;
|
|
144
|
+
branchId: BranchId;
|
|
145
|
+
relationType: RegistryKey;
|
|
146
|
+
from: EntityId;
|
|
147
|
+
to: EntityId;
|
|
148
|
+
createdAtPly: number;
|
|
149
|
+
attributes: SemanticAttributes;
|
|
150
|
+
evidence: EvidenceId[];
|
|
151
|
+
};
|
|
152
|
+
export type IdeaGraph = {
|
|
153
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
154
|
+
policyVersion: typeof CHESS_REASONING_POLICY_VERSION;
|
|
155
|
+
branchId: BranchId;
|
|
156
|
+
ply: number;
|
|
157
|
+
inputHash: string;
|
|
158
|
+
entities: SemanticEntity[];
|
|
159
|
+
relations: SemanticRelation[];
|
|
160
|
+
candidateOutcomes: Array<{
|
|
161
|
+
candidateId: CandidateId;
|
|
162
|
+
disposition: CandidateDisposition;
|
|
163
|
+
evidence: EvidenceId[];
|
|
164
|
+
}>;
|
|
165
|
+
};
|
|
166
|
+
export type SemanticMoveRecord = {
|
|
167
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
168
|
+
identity: IdentityState;
|
|
169
|
+
generation: CandidateGenerationReport;
|
|
170
|
+
evidence: EvidenceRecord[];
|
|
171
|
+
graph: IdeaGraph;
|
|
172
|
+
};
|
|
173
|
+
export type ToolSupport = "supported" | "insufficient-evidence" | "unsupported-concept";
|
|
174
|
+
export type ReasoningToolResponse<T> = {
|
|
175
|
+
schemaVersion: typeof CHESS_REASONING_SCHEMA_VERSION;
|
|
176
|
+
support: ToolSupport;
|
|
177
|
+
answer: T | null;
|
|
178
|
+
evidence: EvidenceId[];
|
|
179
|
+
limitations: string[];
|
|
180
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RecordedReferenceLine } from './historical-prose.js';
|
|
2
|
+
import { type ReasoningPositionContext, type ReasoningEvidenceRecord } from './poc-contracts.js';
|
|
3
|
+
/** Expose only a path the answer already explicitly referenced and admission verified. */
|
|
4
|
+
export declare function visibleSupportLines(answer: string, context: ReasoningPositionContext, records: readonly ReasoningEvidenceRecord[], recordedLine?: RecordedReferenceLine): {
|
|
5
|
+
answer: string;
|
|
6
|
+
additions: {
|
|
7
|
+
target: string;
|
|
8
|
+
label: string;
|
|
9
|
+
evidenceIds: string[];
|
|
10
|
+
authority: string;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type WikibooksIndexData = {
|
|
2
|
+
v: number;
|
|
3
|
+
at: string;
|
|
4
|
+
run: string;
|
|
5
|
+
extractor: string;
|
|
6
|
+
entries: string[][];
|
|
7
|
+
};
|
|
8
|
+
export type IndexedOpening = {
|
|
9
|
+
title: string;
|
|
10
|
+
canonicalTitle: string;
|
|
11
|
+
positionKey: string;
|
|
12
|
+
plies: number;
|
|
13
|
+
};
|
|
14
|
+
export type WikibooksIndex = {
|
|
15
|
+
at: string;
|
|
16
|
+
byPath: Map<string, IndexedOpening[]>;
|
|
17
|
+
byPosition: Map<string, IndexedOpening[]>;
|
|
18
|
+
};
|
|
19
|
+
export declare function openingTitle(moves: string[]): string;
|
|
20
|
+
export declare function decodeWikibooksIndex(data: WikibooksIndexData): WikibooksIndex;
|
|
21
|
+
export declare function positionKey(fen: string): string;
|
|
22
|
+
/** Normalize only title notation; every move must replay legally with its actual side/number. */
|
|
23
|
+
export declare function replayWikibooksTitle(title: string): string | null;
|
|
24
|
+
export type IndexedSelection = {
|
|
25
|
+
entry: IndexedOpening;
|
|
26
|
+
requestedTitle: string;
|
|
27
|
+
ancestorPlies: number;
|
|
28
|
+
transposition: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare function selectIndexedOpening(index: WikibooksIndex, title: string, maxAncestorPlies?: number, minSourcePlies?: number): IndexedSelection | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type WikibooksIndex } from './wikibooks-index.js';
|
|
2
|
+
import { type ReasoningPositionContext, type ReasoningToolResult } from './poc-contracts.js';
|
|
3
|
+
import { type WikibooksTarget } from './opening-source-contracts.js';
|
|
4
|
+
/** Legacy unfiltered planner; production uses the indexed entrypoint below. */
|
|
5
|
+
export declare function wikibooksTargetsForTool(context: ReasoningPositionContext, name: string, args: Record<string, unknown>, result: ReasoningToolResult): WikibooksTarget[];
|
|
6
|
+
export declare function wikibooksTargetsForToolIndexed(context: ReasoningPositionContext, name: string, args: Record<string, unknown>, result: ReasoningToolResult, catalog: WikibooksIndex): {
|
|
7
|
+
targets: WikibooksTarget[];
|
|
8
|
+
positionChecks: number;
|
|
9
|
+
candidateCount: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type PlayerPerspective = Readonly<{
|
|
2
|
+
side: "white" | "black";
|
|
3
|
+
basis: "linked-lichess-identity" | "chesscom-lookup-handle";
|
|
4
|
+
}>;
|
|
5
|
+
export type PlayerPerspectiveIdentity = Readonly<{
|
|
6
|
+
provider: string;
|
|
7
|
+
providerUserId: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Resolve the current viewer's side without using board orientation or stored game data. */
|
|
11
|
+
export declare function resolvePlayerPerspective(input: {
|
|
12
|
+
white: string;
|
|
13
|
+
black: string;
|
|
14
|
+
providerIdentities?: readonly PlayerPerspectiveIdentity[];
|
|
15
|
+
chessComLookupHandle?: string;
|
|
16
|
+
}): PlayerPerspective | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Pure host protocol, presentation and error helpers; no model connector or answer loop. */
|
|
2
|
+
export * from './ai-request-failure.js';
|
|
3
|
+
export * from './ai-request-limits.js';
|
|
4
|
+
export * from './ai-routing-diagnostics.js';
|
|
5
|
+
export * from './player-perspective.js';
|
|
6
|
+
export { validateReasoningPositionContext, reasoningContextHash, createContextEvidence, createQueryContract, DEFAULT_REASONING_RUN_CONTROLS, REASONING_POC_VERSION } from './chess-reasoning/poc-contracts.js';
|
|
7
|
+
export { toPositionAnalysis, toLegacyPositionAnalysis, toPositionAnalysisProvider, toLegacyPositionAnalysisProvider } from './chess-reasoning/position-analysis-contracts.js';
|
|
8
|
+
export { simpleProseReferences, SIMPLE_REFERENCE_VERSION, safeSimpleSourceLink, decorateSimpleVariations, repairFrozenCitationLabels, stripSimpleMarkdownFences, stripSimpleCitationLinks } from './chess-reasoning/simple-prose-references.js';
|
|
9
|
+
export { admitFreshEnginePvWitnesses, MAX_FRESH_ENGINE_WITNESS_ACQUISITIONS } from './chess-reasoning/fresh-engine-pv-witnesses.js';
|
|
10
|
+
export { MAX_INTERACTIVE_LINE_PLIES } from './chess-reasoning/reference-limits.js';
|
|
11
|
+
export { recordedMainLineResult } from './chess-reasoning/recorded-main-line.js';
|
|
12
|
+
export { recordedNavigation, historyPositionContext } from './chess-reasoning/recorded-reference-context.js';
|
|
13
|
+
export { classificationTargetAtSelection } from './chess-reasoning/classification-question-target.js';
|
|
14
|
+
export { scopePositionAnalysis } from './chess-reasoning/position-analysis-scope.js';
|
|
15
|
+
export { priorConversationMessages } from './chess-reasoning/conversation-context.js';
|
|
16
|
+
export { parseOpeningSourceCredits, openingSourceLinks, OPENING_SOURCE_LICENSE_URL, openingSourcesInMessages } from './chess-reasoning/opening-source-credits.js';
|
|
17
|
+
export { openingTitle, positionKey, replayWikibooksTitle, selectIndexedOpening, decodeWikibooksIndex } from './chess-reasoning/wikibooks-index.js';
|
|
18
|
+
export { QUESTION_ROUTING_VERSION, classifyQuestionRoutingAnswers, classifyReviewSubject, makeQuestionRoutingRequest, parseQuestionRoutingAnswers, hasMoveClassificationQuestion, moveSectionScope, REVIEW_SUBJECTS } from './chess-reasoning/question-routing.js';
|
|
19
|
+
export { SIMPLE_TOOL_AGENT_VERSION } from './chess-reasoning/simple-runtime-version.js';
|
|
20
|
+
export { SIMPLE_MODEL_CATALOGUE, simpleEffortsForModel, validateSimpleAgentConfig, selectSimpleModel, SIMPLE_EXTENSION_CONFIGS, SIMPLE_VENDOR_CONFIGS, EVALUATED_ASTRA_CONFIG } from './chess-reasoning/simple-agent-config.js';
|
|
21
|
+
export { hasSharedEvidence, expandSharedEvidence, EVIDENCE_SHARING_VERSION, shareEvidence, shareEvidenceMessages } from './chess-reasoning/lossless-evidence-sharing.js';
|
|
22
|
+
export type * from './chess-reasoning/answer-pipeline-exports.js';
|
package/docs/API.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Answer pipeline contracts
|
|
2
|
+
|
|
3
|
+
Connectors return assistant continuation messages with their proposed tool calls.
|
|
4
|
+
Preserve opaque provider continuation metadata in memory. Do not execute proposed
|
|
5
|
+
tools in connectors: the pipeline performs validation, dispatch and result append.
|
|
6
|
+
Cancellation is checked before invocation, after response and around each tool.
|
|
7
|
+
`simpleSystemPolicy` and `simpleToolDescription` expose the existing base policy
|
|
8
|
+
builder. Hosts must deliberately supply their chosen policy; this base builder
|
|
9
|
+
is not a claim of equivalence to the website's currently selected conversational
|
|
10
|
+
policy. Website relay adapters continue injecting the existing server-owned prompt.
|
|
11
|
+
|
|
12
|
+
Preferred public analyzer lines and conditional segments use `mateInMoves`: signed
|
|
13
|
+
mate distance in moves. Explicit `toPositionAnalysis` / `toLegacyPositionAnalysis`
|
|
14
|
+
adapters retain legacy provider compatibility and reject contradictory aliases.
|
|
15
|
+
Existing versioned trace/evidence outputs keep their historical `matePly` spelling;
|
|
16
|
+
this is not a trace-schema migration. See the publication contract documentation.
|
|
17
|
+
|
|
18
|
+
All observations and diagnostic events may contain user chess data. Hosts choose
|
|
19
|
+
storage and retention. Published package files contain no recorded study fixtures,
|
|
20
|
+
credentials or private traces. Network and engine work requires an injected port.
|
|
21
|
+
|
|
22
|
+
Budget behavior is inherited: at most six normal model turns, at most eight
|
|
23
|
+
searches per batch, reserved final composition, plus the existing one-slot
|
|
24
|
+
recovery rules. There is no new aggregate engine-search quota. Connector output
|
|
25
|
+
limits may be requested rather than guaranteed. `usage.outputTokens` retains
|
|
26
|
+
legacy budget accounting; check `reportedOutputTokens` and `metering` before
|
|
27
|
+
reporting measured usage. Missing usage reserves the call allowance and has an
|
|
28
|
+
explicit `outputBudgetReservation`; it is not measured usage or billing.
|
|
29
|
+
|
|
30
|
+
Requirement KE-AI-PORT-002: `searchesUsed` retains attempted engine dispatch
|
|
31
|
+
accounting, including failures. `searchesSucceeded` and `searchesFailed` report
|
|
32
|
+
completed search outcomes separately. Preparation retains bounded error message,
|
|
33
|
+
code and HTTP status, without stacks or headers. When every completed attempted
|
|
34
|
+
search fails, `engineEvidenceStatus` is `unavailable` and the saved answer plainly
|
|
35
|
+
discloses that engine analysis could not be completed. A successful later search
|
|
36
|
+
clears that all-failed condition. The disclosure precedes final reference validation;
|
|
37
|
+
causal claim and sentence-context ranges remain half-open UTF-16 offsets into
|
|
38
|
+
the returned final answer. Cancellation remains a failure, and answers
|
|
39
|
+
that request no searches are not labelled engine outages. Hosts can mark such
|
|
40
|
+
unavailable answers degraded while retaining the pipeline's `diagnostic` status.
|
|
41
|
+
|
|
42
|
+
Requirement KE-AI-PORT-003: optional observable traces pair input and output/error
|
|
43
|
+
phase events for routing performed here, opponent preparation, classification
|
|
44
|
+
refresh, observations, evidence construction, and the residual opening wait.
|
|
45
|
+
These events use `deterministic`/`local-harness` identity so model-attempt and
|
|
46
|
+
billing summaries exclude them. `invocationId` joins each pair; terminal
|
|
47
|
+
`durationMs` measures that operation and
|
|
48
|
+
`elapsedMs` is relative to pipeline entry. Opening lookup runs concurrently;
|
|
49
|
+
its wait duration is only the remaining wait after chess evidence collection.
|
|
50
|
+
No event is emitted for an operation that is skipped or routing already supplied
|
|
51
|
+
by the host. Existing preparation/result diagnostics remain unchanged. Failed or
|
|
52
|
+
cancelled operations emit a terminal timing event and preserve the original error
|
|
53
|
+
and cancellation behavior. Phase events never include host error messages,
|
|
54
|
+
credentials or chess payloads. Model/tool intervals remain separately measured;
|
|
55
|
+
do not sum overlapping source lookup and engine intervals.
|
|
56
|
+
|
|
57
|
+
Requirement KE-AI-PORT-004: hosts can explicitly set `parallelPreparation: true`
|
|
58
|
+
to overlap the two independent ordinary opponent probes and classification refresh
|
|
59
|
+
after routing. The probes retain their original evidence order when they finish
|
|
60
|
+
out of order. At most three upfront searches can overlap with this opt-in.
|
|
61
|
+
The default remains serial, and prepared-board initial searches retain their existing
|
|
62
|
+
refresh order. Both ordinary operations complete before observation collection or
|
|
63
|
+
model invocation. On failure the sibling is cancelled and drained before the
|
|
64
|
+
original failure is propagated; explicit cancellation prevents model dispatch.
|
|
65
|
+
Hosts must provide analyzers that safely support the overlap. `preparationAnalyzer`
|
|
66
|
+
can select a separate provider for ordinary opponent probes only; evidence tools
|
|
67
|
+
and prepared-board initial searches still use `analyzer`. Classification remains
|
|
68
|
+
owned by the history bridge. No search, freshness, score or classification semantics
|
|
69
|
+
are relaxed, and engine outages continue to use the inherited degraded-answer path.
|
|
70
|
+
Overlapping phase durations must not be summed as sequential wall time.
|
|
71
|
+
|
|
72
|
+
Connector capability metadata declares `toolRequests`, `toolFreeComposition`,
|
|
73
|
+
`opaqueContinuation` booleans; `outputTokenLimit` is `enforced`, `requested` or
|
|
74
|
+
`unavailable`; `usageReporting` is `reported`, `optional` or `unavailable`.
|
|
75
|
+
The interface rejects an entire proposed batch before dispatch if a call ID is
|
|
76
|
+
empty or repeated, a tool is unknown, arguments are not objects, or the batch
|
|
77
|
+
exceeds 32 calls. This is an interface admission ceiling, separate from the
|
|
78
|
+
inherited eight-search batch limit. Detailed chess schema and legality checks
|
|
79
|
+
remain in the canonical tool wrappers and host.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
See the [pipeline source](../src/chess-reasoning/answer-pipeline.ts) and [connector contract](../src/chess-reasoning/answer-model-connector.ts).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# AI owner consolidation, 10 October 2026
|
|
2
|
+
|
|
3
|
+
`OWNERSHIP-DRIFT.json` records SHA-256 hashes before deletion for all eight
|
|
4
|
+
non-identical app/component modules. The app installed `0.1.0-dev.9`; every one
|
|
5
|
+
of those eight installed source files equals component source `0.1.0-dev.11`.
|
|
6
|
+
Thus source dev11's newer behavior was already the application's shipped
|
|
7
|
+
controlled answer pipeline. It is retained deliberately:
|
|
8
|
+
|
|
9
|
+
| Module | Adoption |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| answer-pipeline | Intentional ed04bb0 phase timing and be9eedd cancellation-safe opt-in parallel preparation retained; both already shipped in installed dev9. |
|
|
12
|
+
| opponent-threat-preparation | Intentional fea48a8 search outcome accounting and be9eedd opt-in concurrency retained. |
|
|
13
|
+
| poc-contracts | Intentional fea48a8 actual analyzer-outcome callback retained. |
|
|
14
|
+
| poc-tools | Intentional fea48a8 completed search-outcome accounting retained. |
|
|
15
|
+
| portable-answer-runtime | Intentional fea48a8 outage disclosure and 610a27d preserved final reference ranges retained. |
|
|
16
|
+
| simple-evidence-preparation | Intentional fea48a8 failure causes and outcome counts retained. |
|
|
17
|
+
| server-simple-policy | Adopt intentional 610a27d issue #7 correction: both descriptions explicitly require analyzeFinal=true for compareFinalMovesUci. The app retained source missed that migration; no old-wording override remains. System text is unchanged. |
|
|
18
|
+
| simple-prose-references | Upstream intentional app ed87585 / 347f478 / 89cce23 v22 changes: fresh same-answer PV admission and structured gap counts. Their legality/provenance gates and stored-answer version remain intact. |
|
|
19
|
+
|
|
20
|
+
The fresh-engine-pv-witnesses validator now belongs here with prose references.
|
|
21
|
+
The app's 91 maintained copies (87 reasoning modules and four identical pure top-level helpers) were removed after replacing consumers with
|
|
22
|
+
installed root/research exports. Host adapters, deployment policy variants,
|
|
23
|
+
node/browser providers and active historical research runners remain in the app.
|
|
24
|
+
Their versioned evidence and archived source snapshots were not rewritten.
|
|
25
|
+
|
|
26
|
+
Classifier version and scoped decision validation are imported from the
|
|
27
|
+
classifier's public `/contracts` entry; this repository no longer owns a second
|
|
28
|
+
classifier-rules or classifier-decision runtime. The dependency is a hash-pinned
|
|
29
|
+
local source-build archive and the packed release names its exact public version.
|
|
30
|
+
|
|
31
|
+
No widget source fragment or fingerprint, real model run, registry publication,
|
|
32
|
+
commit or push is part of this consolidation. Package checks validate offline
|
|
33
|
+
protocol and evidence behavior, not model answer quality.
|
|
34
|
+
|
|
35
|
+
The four identical helpers ai-request-failure, ai-request-limits, ai-routing-diagnostics and player-perspective were extracted in bc8f5f2. Their maintained component source now serves all hosts via `/shared`. This entry also provides pure context, reference, recorded-view and routing helpers. Its runtime closure imports only chess.js; the build rejects model SDK or classifier runtime imports. Workspace browser presentation/protocol/client entries use `/shared`, while website browser execution intentionally loads the root pipeline in its execution adapter outside those entries.
|