@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,1026 @@
|
|
|
1
|
+
import { type EvidenceLicense } from "./evidence-licenses.js";
|
|
2
|
+
import type { ProofStrength, SemanticAttributes, SemanticEntity, SemanticParticipant, SemanticRelation, SemanticValue } from "./types.js";
|
|
3
|
+
export declare const REASONING_POC_VERSION: "conceptual-explanation-poc/57";
|
|
4
|
+
export declare const REASONING_POC_MAX_OUTPUT_TOKENS = 2000;
|
|
5
|
+
export declare const REASONING_POC_MAX_HYPOTHESIS_OUTPUT_TOKENS = 4000;
|
|
6
|
+
export declare const REASONING_POC_MAX_CRITIC_OUTPUT_TOKENS = 7000;
|
|
7
|
+
export declare const REASONING_POC_MAX_TERMINAL_REVIEW_OUTPUT_TOKENS = 4000;
|
|
8
|
+
export declare const REASONING_POC_MAX_RESOLUTION_AUDIT_OUTPUT_TOKENS = 3000;
|
|
9
|
+
/**
|
|
10
|
+
* The optional future-purpose planner may choose one already-supported,
|
|
11
|
+
* bounded probe. It never writes semantic hypotheses, so it gets a smaller
|
|
12
|
+
* transport budget than the hypothesis and critic stages.
|
|
13
|
+
*/
|
|
14
|
+
export declare const REASONING_POC_MAX_PURPOSE_PROBE_OUTPUT_TOKENS = 1500;
|
|
15
|
+
export declare const REASONING_POC_MAX_GRAPH_SELECTION_OUTPUT_TOKENS = 2000;
|
|
16
|
+
export declare const REASONING_POC_MAX_DISCOURSE_OUTPUT_TOKENS = 2500;
|
|
17
|
+
export declare const REASONING_POC_MAX_RENDER_OUTPUT_TOKENS = 4000;
|
|
18
|
+
export declare const REASONING_POC_MAX_HYPOTHESIS_BATCHES = 2;
|
|
19
|
+
export declare const REASONING_POC_RESERVED_MANDATORY_STEPS = 11;
|
|
20
|
+
export declare const REASONING_POC_REVISION_EVIDENCE_ALLOWANCE = 1;
|
|
21
|
+
/** One opt-in slot for the bounded future-purpose planner; base profiles stay unchanged. */
|
|
22
|
+
export declare const REASONING_POC_PURPOSE_PROBE_ALLOWANCE = 1;
|
|
23
|
+
/** One opt-in slot for a complete replacement of structurally invalid critic output. */
|
|
24
|
+
export declare const REASONING_POC_CRITIC_CORRECTION_ALLOWANCE = 1;
|
|
25
|
+
export type ReasoningPositionContext = {
|
|
26
|
+
kind?: "position";
|
|
27
|
+
nodeId: string;
|
|
28
|
+
parentNodeId?: string;
|
|
29
|
+
historyStartFen?: string;
|
|
30
|
+
fenBefore: string;
|
|
31
|
+
fenAfter: string;
|
|
32
|
+
historyUci: string[];
|
|
33
|
+
moveUci: string;
|
|
34
|
+
moveSan: string;
|
|
35
|
+
};
|
|
36
|
+
export type ReasoningAudience = "beginner" | "intermediate" | "advanced";
|
|
37
|
+
export type ReasoningGraphRequirements = {
|
|
38
|
+
minimumEntities: number;
|
|
39
|
+
minimumRelations: number;
|
|
40
|
+
};
|
|
41
|
+
export type QueryContract = {
|
|
42
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
43
|
+
requestId: string;
|
|
44
|
+
question: string;
|
|
45
|
+
requestedConclusion: "move-idea" | "position-question";
|
|
46
|
+
responseCoverageRequirement: "none" | "bounded-class";
|
|
47
|
+
continuationCoverageRequirement: "none" | "principal-variation";
|
|
48
|
+
minimumContinuationLines: number;
|
|
49
|
+
graphRequirements: ReasoningGraphRequirements;
|
|
50
|
+
audience: ReasoningAudience;
|
|
51
|
+
concise: boolean;
|
|
52
|
+
nodeId: string;
|
|
53
|
+
};
|
|
54
|
+
export type ReasoningRunControls = {
|
|
55
|
+
maxModelSteps: number;
|
|
56
|
+
maxToolCalls: number;
|
|
57
|
+
maxProbeCalls: number;
|
|
58
|
+
maxEvidenceRecords: number;
|
|
59
|
+
maxObservationRecords: number;
|
|
60
|
+
maxObservationsPresented: number;
|
|
61
|
+
maxHypotheses: number;
|
|
62
|
+
maxOutputChars: number;
|
|
63
|
+
maxProviderOutputChars: number;
|
|
64
|
+
maxWallTimeMs: number;
|
|
65
|
+
};
|
|
66
|
+
export declare const DEFAULT_REASONING_RUN_CONTROLS: Readonly<ReasoningRunControls>;
|
|
67
|
+
export type ReasoningEvidenceKind = "context" | "fact" | "probe" | "graph" | "observation-review" | "reasoning-challenge" | "hypothesis-review" | "critic-resolution-audit";
|
|
68
|
+
export type ReasoningEvidenceRecord = {
|
|
69
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
70
|
+
id: string;
|
|
71
|
+
contextHash: string;
|
|
72
|
+
kind: ReasoningEvidenceKind;
|
|
73
|
+
source: string;
|
|
74
|
+
proofStrength: ProofStrength | null;
|
|
75
|
+
licenses?: EvidenceLicense[];
|
|
76
|
+
summary: string;
|
|
77
|
+
data: Record<string, SemanticValue>;
|
|
78
|
+
coverage: {
|
|
79
|
+
complete: boolean;
|
|
80
|
+
covered: string[];
|
|
81
|
+
unresolved: string[];
|
|
82
|
+
} | null;
|
|
83
|
+
replay: Record<string, SemanticValue> | null;
|
|
84
|
+
};
|
|
85
|
+
export type ReasoningToolName = "finish_evidence_collection" | "review_observations" | "challenge_reasoning" | "record_hypotheses" | "review_hypotheses" | "finalize_reasoning_review" | "audit_critic_resolutions" | "analyze_game_position" | "test_game_line" | "inspect_position" | "analyze_move" | "explore_continuations" | "compare_moves" | "enumerate_defenses" | "test_line" | "trace_idea" | "explain_plan";
|
|
86
|
+
export type ReasoningToolSupport = "supported" | "insufficient-evidence" | "unsupported";
|
|
87
|
+
export type ReasoningToolResult = {
|
|
88
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
89
|
+
callId: string;
|
|
90
|
+
tool: ReasoningToolName;
|
|
91
|
+
contextHash: string;
|
|
92
|
+
support: ReasoningToolSupport;
|
|
93
|
+
data: Record<string, SemanticValue>;
|
|
94
|
+
evidence: ReasoningEvidenceRecord[];
|
|
95
|
+
limitations: string[];
|
|
96
|
+
durationMs: number;
|
|
97
|
+
};
|
|
98
|
+
export type ReasoningToolDescriptor = {
|
|
99
|
+
name: ReasoningToolName;
|
|
100
|
+
description: string;
|
|
101
|
+
category: "fact" | "probe" | "graph";
|
|
102
|
+
inputSchema: Record<string, unknown>;
|
|
103
|
+
};
|
|
104
|
+
export interface ReasoningToolSet {
|
|
105
|
+
/** Native hosts reserve engine slots after legality checks, at dispatch. */
|
|
106
|
+
reservesSearchAtDispatch?: boolean;
|
|
107
|
+
descriptors(): ReasoningToolDescriptor[];
|
|
108
|
+
execute(name: ReasoningToolName, input: Record<string, unknown>, signal?: AbortSignal, execution?: ReasoningToolExecutionContext): Promise<ReasoningToolResult>;
|
|
109
|
+
seedEvidence?(records: Iterable<ReasoningEvidenceRecord>): void;
|
|
110
|
+
}
|
|
111
|
+
export type ReasoningHypothesisProvenance = {
|
|
112
|
+
provider: string;
|
|
113
|
+
version: string;
|
|
114
|
+
origin: "model" | "learned-provider" | "reviewed-annotation" | "user";
|
|
115
|
+
};
|
|
116
|
+
export type ReasoningToolExecutionContext = {
|
|
117
|
+
hypothesisProvenance?: ReasoningHypothesisProvenance;
|
|
118
|
+
/** Reserve an answer-budgeted engine search after input/legality validation. */
|
|
119
|
+
reserveSearch?: () => boolean;
|
|
120
|
+
/** Reserve one answer-budgeted engine search before a PV endpoint continuation. */
|
|
121
|
+
reserveAdditionalSearch?: () => boolean;
|
|
122
|
+
/** Actual completed analyzer outcome; failed dispatches still consume attempts. */
|
|
123
|
+
recordSearchOutcome?: (outcome: 'succeeded' | 'failed') => void;
|
|
124
|
+
};
|
|
125
|
+
export type ReasoningProbeRecipe = {
|
|
126
|
+
tool: "inspect_position" | "analyze_move" | "enumerate_defenses" | "test_line";
|
|
127
|
+
input: Record<string, SemanticValue>;
|
|
128
|
+
purpose: string;
|
|
129
|
+
};
|
|
130
|
+
export type ReasoningObservation = {
|
|
131
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
132
|
+
id: string;
|
|
133
|
+
contextHash: string;
|
|
134
|
+
observationType: string;
|
|
135
|
+
participants: SemanticParticipant[];
|
|
136
|
+
attributes: Record<string, SemanticValue>;
|
|
137
|
+
exactness: "exact" | "heuristic";
|
|
138
|
+
provenance: {
|
|
139
|
+
provider: string;
|
|
140
|
+
version: string;
|
|
141
|
+
trust: "deterministic" | "learned" | "external";
|
|
142
|
+
methods: string[];
|
|
143
|
+
};
|
|
144
|
+
factEvidenceIds: string[];
|
|
145
|
+
probeRecipes: ReasoningProbeRecipe[];
|
|
146
|
+
};
|
|
147
|
+
export type ReasoningObservationSet = {
|
|
148
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
149
|
+
contextHash: string;
|
|
150
|
+
observations: ReasoningObservation[];
|
|
151
|
+
evidence: ReasoningEvidenceRecord[];
|
|
152
|
+
providers: Array<{
|
|
153
|
+
provider: string;
|
|
154
|
+
version: string;
|
|
155
|
+
}>;
|
|
156
|
+
limitations: string[];
|
|
157
|
+
};
|
|
158
|
+
export type ReasoningRankedObservation = ReasoningObservation & {
|
|
159
|
+
salience: number;
|
|
160
|
+
salienceReasons: string[];
|
|
161
|
+
presentedToModel: boolean;
|
|
162
|
+
};
|
|
163
|
+
export type ReasoningRankedObservationSet = Omit<ReasoningObservationSet, "observations"> & {
|
|
164
|
+
observations: ReasoningRankedObservation[];
|
|
165
|
+
saliencePolicy: string;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* The model-facing observation catalogue deliberately excludes the embedded
|
|
169
|
+
* evidence array. Evidence is transmitted once, through the separately
|
|
170
|
+
* licensed `evidence` field on HypothesisProviderInput. Keeping this shape
|
|
171
|
+
* explicit prevents an omitted observation or a duplicate evidence payload
|
|
172
|
+
* from leaking back into an isolated semantic stage.
|
|
173
|
+
*/
|
|
174
|
+
export type ReasoningProviderObservationSet = Omit<ReasoningRankedObservationSet, "observations" | "evidence"> & {
|
|
175
|
+
observations: Array<Pick<ReasoningRankedObservation, "id" | "observationType" | "participants" | "attributes" | "exactness" | "provenance" | "factEvidenceIds" | "probeRecipes" | "salience" | "salienceReasons" | "presentedToModel">>;
|
|
176
|
+
};
|
|
177
|
+
export interface ObservationProvider {
|
|
178
|
+
readonly id: string;
|
|
179
|
+
readonly version: string;
|
|
180
|
+
observe(context: ReasoningPositionContext, controls: ReasoningRunControls, signal?: AbortSignal): Promise<ReasoningObservationSet> | ReasoningObservationSet;
|
|
181
|
+
}
|
|
182
|
+
export interface SaliencePolicy {
|
|
183
|
+
readonly id: string;
|
|
184
|
+
rank(observations: ReasoningObservationSet, contract: QueryContract, graphContext?: Record<string, SemanticValue>): ReasoningRankedObservationSet;
|
|
185
|
+
}
|
|
186
|
+
export type ReasoningHypothesisRelationProposal = {
|
|
187
|
+
relationType: string;
|
|
188
|
+
from: string;
|
|
189
|
+
to: string;
|
|
190
|
+
attributes: SemanticAttributes;
|
|
191
|
+
evidenceIds: string[];
|
|
192
|
+
sourceObservationIds: string[];
|
|
193
|
+
};
|
|
194
|
+
export type HypothesisProviderInput = {
|
|
195
|
+
mode: "initial" | "revision";
|
|
196
|
+
correction?: {
|
|
197
|
+
attempt: 1;
|
|
198
|
+
rejectionStage: string;
|
|
199
|
+
rejectionCode: string;
|
|
200
|
+
rejectionDetails: string;
|
|
201
|
+
previousInvalidBatch: {
|
|
202
|
+
hypotheses: ReasoningHypothesisProposal[];
|
|
203
|
+
relations: ReasoningHypothesisRelationProposal[];
|
|
204
|
+
};
|
|
205
|
+
instruction: string;
|
|
206
|
+
};
|
|
207
|
+
revisionObligations: {
|
|
208
|
+
minimumNewHypotheses: 1;
|
|
209
|
+
reopenedGaps: Array<Pick<ReasoningChallengeDecision["observationAudits"][number], "observationId" | "missingLink" | "omissionImpact" | "representedHypothesisIds">>;
|
|
210
|
+
novelHypothesisNeeded: boolean;
|
|
211
|
+
questionCoverageRationale: string;
|
|
212
|
+
hypothesisFindings: ReasoningCriticFinding[];
|
|
213
|
+
} | null;
|
|
214
|
+
contract: QueryContract;
|
|
215
|
+
context: ReasoningPositionContext;
|
|
216
|
+
observations: ReasoningProviderObservationSet;
|
|
217
|
+
evidence: Array<Pick<ReasoningEvidenceRecord, "id" | "kind" | "source" | "proofStrength" | "licenses" | "summary" | "data" | "coverage" | "replay">>;
|
|
218
|
+
existingHypotheses: Array<Pick<ReasoningHypothesisRecord, "id" | "localId" | "entityType" | "concepts" | "owner" | "participants" | "attributes" | "proofStrength" | "evidenceIds" | "sourceObservationIds" | "parentHypothesisIds" | "anchorRequirements" | "origin" | "provenance" | "status">>;
|
|
219
|
+
existingRelations: Array<Pick<ReasoningHypothesisRelationRecord, "id" | "relationType" | "fromHypothesisId" | "toHypothesisId" | "attributes" | "evidenceIds" | "sourceObservationIds">>;
|
|
220
|
+
challenge: ReasoningChallengeDecision | null;
|
|
221
|
+
inspectionLenses: {
|
|
222
|
+
version: string;
|
|
223
|
+
authority: "non-evidentiary";
|
|
224
|
+
items: Array<{
|
|
225
|
+
id: string;
|
|
226
|
+
families: string[];
|
|
227
|
+
text: string;
|
|
228
|
+
}>;
|
|
229
|
+
};
|
|
230
|
+
allowedVocabulary: {
|
|
231
|
+
entityTypes: string[];
|
|
232
|
+
concepts: string[];
|
|
233
|
+
relationTypes: string[];
|
|
234
|
+
participantRoles: string[];
|
|
235
|
+
};
|
|
236
|
+
allowedEvidenceIds: string[];
|
|
237
|
+
allowedReferences: Array<{
|
|
238
|
+
domain: string;
|
|
239
|
+
id: string;
|
|
240
|
+
}>;
|
|
241
|
+
maxOutputTokens: number;
|
|
242
|
+
};
|
|
243
|
+
export type HypothesisProviderResult = {
|
|
244
|
+
batch: {
|
|
245
|
+
hypotheses: ReasoningHypothesisProposal[];
|
|
246
|
+
relations: ReasoningHypothesisRelationProposal[];
|
|
247
|
+
};
|
|
248
|
+
provenance: ReasoningHypothesisProvenance;
|
|
249
|
+
steps?: number;
|
|
250
|
+
usage?: {
|
|
251
|
+
inputTokens: number | null;
|
|
252
|
+
outputTokens: number | null;
|
|
253
|
+
};
|
|
254
|
+
diagnostics?: ReasoningRuntimeDiagnostic[];
|
|
255
|
+
};
|
|
256
|
+
export interface HypothesisProvider {
|
|
257
|
+
readonly id: string;
|
|
258
|
+
readonly version: string;
|
|
259
|
+
propose(input: HypothesisProviderInput, signal?: AbortSignal): Promise<HypothesisProviderResult>;
|
|
260
|
+
}
|
|
261
|
+
export type ReasoningAnchorRequirement = {
|
|
262
|
+
participant: SemanticParticipant;
|
|
263
|
+
disposition: "required";
|
|
264
|
+
};
|
|
265
|
+
export type ReasoningHypothesisProposal = {
|
|
266
|
+
localId: string;
|
|
267
|
+
entityType: string;
|
|
268
|
+
concepts: string[];
|
|
269
|
+
owner: "w" | "b" | null;
|
|
270
|
+
participants: SemanticParticipant[];
|
|
271
|
+
attributes: SemanticAttributes;
|
|
272
|
+
proofStrength: ProofStrength | null;
|
|
273
|
+
evidenceIds: string[];
|
|
274
|
+
sourceObservationIds: string[];
|
|
275
|
+
parentHypothesisIds: string[];
|
|
276
|
+
anchorRequirements: ReasoningAnchorRequirement[];
|
|
277
|
+
};
|
|
278
|
+
export type ReasoningHypothesisStatus = "proposed" | "needs-probe" | "accepted" | "rejected" | "superseded";
|
|
279
|
+
export type ReasoningHypothesisRecord = ReasoningHypothesisProposal & {
|
|
280
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
281
|
+
id: string;
|
|
282
|
+
contextHash: string;
|
|
283
|
+
origin: "model" | "learned-provider" | "reviewed-annotation" | "user";
|
|
284
|
+
provenance: {
|
|
285
|
+
provider: string;
|
|
286
|
+
version: string;
|
|
287
|
+
};
|
|
288
|
+
status: ReasoningHypothesisStatus;
|
|
289
|
+
review: {
|
|
290
|
+
rationale: string;
|
|
291
|
+
supersededBy: string[];
|
|
292
|
+
} | null;
|
|
293
|
+
};
|
|
294
|
+
export type ReasoningHypothesisRelationRecord = {
|
|
295
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
296
|
+
id: string;
|
|
297
|
+
contextHash: string;
|
|
298
|
+
relationType: string;
|
|
299
|
+
fromHypothesisId: string;
|
|
300
|
+
toHypothesisId: string;
|
|
301
|
+
attributes: SemanticAttributes;
|
|
302
|
+
evidenceIds: string[];
|
|
303
|
+
sourceObservationIds: string[];
|
|
304
|
+
};
|
|
305
|
+
export type ReasoningHypothesisDecision = {
|
|
306
|
+
hypothesisId: string;
|
|
307
|
+
disposition: "accept" | "reject" | "needs-probe" | "supersede";
|
|
308
|
+
rationale: string;
|
|
309
|
+
supersededBy: string[];
|
|
310
|
+
};
|
|
311
|
+
export type ReasoningObservationDispositionState = "used" | "irrelevant" | "duplicate" | "needs-probe" | "unaddressed" | "deferred-by-harness-budget" | "not-presented-to-model";
|
|
312
|
+
export type ReasoningObservationDecision = {
|
|
313
|
+
observationId: string;
|
|
314
|
+
disposition: "used" | "irrelevant" | "duplicate" | "needs-probe";
|
|
315
|
+
rationale: string;
|
|
316
|
+
hypothesisIds: string[];
|
|
317
|
+
duplicateOfObservationId: string | null;
|
|
318
|
+
probeCallIds: string[];
|
|
319
|
+
};
|
|
320
|
+
export type ReasoningObservationCoverage = {
|
|
321
|
+
observationId: string;
|
|
322
|
+
state: ReasoningObservationDispositionState;
|
|
323
|
+
rationale: string | null;
|
|
324
|
+
hypothesisIds: string[];
|
|
325
|
+
duplicateOfObservationId: string | null;
|
|
326
|
+
probeCallIds: string[];
|
|
327
|
+
};
|
|
328
|
+
export type ReasoningChallengeObservationAudit = {
|
|
329
|
+
observationId: string;
|
|
330
|
+
action: "retain" | "reopen";
|
|
331
|
+
rationale: string;
|
|
332
|
+
missingLink: string | null;
|
|
333
|
+
omissionImpact: "preserves-conclusion" | "weakens-conclusion" | "uncertain";
|
|
334
|
+
representedHypothesisIds: string[];
|
|
335
|
+
};
|
|
336
|
+
export type ReasoningCriticFindingKind = "missing-link" | "evidence-mismatch" | "question-irrelevant" | "overstated" | "redundant";
|
|
337
|
+
export type ReasoningCriticFinding = {
|
|
338
|
+
id: string;
|
|
339
|
+
hypothesisId: string;
|
|
340
|
+
kind: ReasoningCriticFindingKind;
|
|
341
|
+
issue: string;
|
|
342
|
+
};
|
|
343
|
+
export type ReasoningCriticFindingResolutionDisposition = "rejected" | "superseded" | "retained-with-new-evidence" | "retained-safe-to-omit" | "resolved-by-associated-hypotheses" | "resolved-existing-evidence";
|
|
344
|
+
export type ReasoningCriticFindingResolution = {
|
|
345
|
+
findingId: string;
|
|
346
|
+
hypothesisId: string;
|
|
347
|
+
disposition: ReasoningCriticFindingResolutionDisposition;
|
|
348
|
+
rationale: string;
|
|
349
|
+
evidenceIds: string[];
|
|
350
|
+
supersededBy: string[];
|
|
351
|
+
resolvedByHypothesisIds: string[];
|
|
352
|
+
};
|
|
353
|
+
export type ReasoningCriticResolutionAuditDecision = {
|
|
354
|
+
findingId: string;
|
|
355
|
+
hypothesisId: string;
|
|
356
|
+
outcome: "resolved" | "unresolved";
|
|
357
|
+
rationale: string;
|
|
358
|
+
};
|
|
359
|
+
export type ReasoningCriticResolutionAudit = {
|
|
360
|
+
decisions: ReasoningCriticResolutionAuditDecision[];
|
|
361
|
+
batchRationale: string;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Compact provenance that a completed critic audit found an already accepted
|
|
365
|
+
* hypothesis to represent a bounded causal or continuation meaning. It is an
|
|
366
|
+
* omission-audit signal only: it adds neither chess proof nor evidence
|
|
367
|
+
* authority, and is deliberately not a retained copy of the raw critic row.
|
|
368
|
+
*/
|
|
369
|
+
export type ReasoningSemanticPreservationSignal = {
|
|
370
|
+
hypothesisId: string;
|
|
371
|
+
auditKind: "causal-evidence" | "continuation-activity";
|
|
372
|
+
evidenceId: string;
|
|
373
|
+
rootMove: string | null;
|
|
374
|
+
routeMoves: string[];
|
|
375
|
+
contact: {
|
|
376
|
+
attackedSquare: string;
|
|
377
|
+
targetMoverPieceId: string | null;
|
|
378
|
+
targetMoveUci: string | null;
|
|
379
|
+
continuationPieceId: string;
|
|
380
|
+
contactMoveUci: string;
|
|
381
|
+
} | null;
|
|
382
|
+
rationale: string;
|
|
383
|
+
};
|
|
384
|
+
export type ReasoningChallengeDecision = {
|
|
385
|
+
hypothesisIds: string[];
|
|
386
|
+
observationAudits: ReasoningChallengeObservationAudit[];
|
|
387
|
+
hypothesisFindings: ReasoningCriticFinding[];
|
|
388
|
+
semanticPreservationSignals: ReasoningSemanticPreservationSignal[];
|
|
389
|
+
novelHypothesisNeeded: boolean;
|
|
390
|
+
questionCoverageRationale: string;
|
|
391
|
+
};
|
|
392
|
+
export type ReasoningClaimKind = "fact" | "interpretation" | "consequence" | "defense" | "uncertainty";
|
|
393
|
+
export type ReasoningPieceKind = "bishop" | "king" | "knight" | "pawn" | "queen" | "rook";
|
|
394
|
+
export type ReasoningPieceReferenceForm = "definite" | "color-qualified" | "square-qualified" | "canonical" | "bare" | "bare-square-qualified";
|
|
395
|
+
export type ReasoningNarrativeSegment = {
|
|
396
|
+
type: "text";
|
|
397
|
+
text: string;
|
|
398
|
+
} | {
|
|
399
|
+
type: "piece";
|
|
400
|
+
pieceId: string;
|
|
401
|
+
form?: ReasoningPieceReferenceForm;
|
|
402
|
+
capitalize?: boolean;
|
|
403
|
+
label?: string;
|
|
404
|
+
} | {
|
|
405
|
+
type: "piece-kind";
|
|
406
|
+
pieceKind: ReasoningPieceKind;
|
|
407
|
+
color: "w" | "b" | null;
|
|
408
|
+
label?: string;
|
|
409
|
+
} | {
|
|
410
|
+
type: "square";
|
|
411
|
+
square: string;
|
|
412
|
+
label?: string;
|
|
413
|
+
} | {
|
|
414
|
+
type: "move";
|
|
415
|
+
uci: string;
|
|
416
|
+
pieceId: string;
|
|
417
|
+
san?: string;
|
|
418
|
+
label?: string;
|
|
419
|
+
} | {
|
|
420
|
+
type: "entity";
|
|
421
|
+
entityId: string;
|
|
422
|
+
label?: string;
|
|
423
|
+
} | {
|
|
424
|
+
type: "relation";
|
|
425
|
+
relationId: string;
|
|
426
|
+
fromEntityId: string;
|
|
427
|
+
toEntityId: string;
|
|
428
|
+
label?: string;
|
|
429
|
+
};
|
|
430
|
+
export type ResolvedReasoningNarrativeSegment = {
|
|
431
|
+
type: "text";
|
|
432
|
+
text: string;
|
|
433
|
+
} | {
|
|
434
|
+
type: "piece";
|
|
435
|
+
pieceId: string;
|
|
436
|
+
square: string | null;
|
|
437
|
+
label: string;
|
|
438
|
+
} | {
|
|
439
|
+
type: "piece-kind";
|
|
440
|
+
pieceKind: ReasoningPieceKind;
|
|
441
|
+
color: "w" | "b" | null;
|
|
442
|
+
label: string;
|
|
443
|
+
} | {
|
|
444
|
+
type: "square";
|
|
445
|
+
square: string;
|
|
446
|
+
label: string;
|
|
447
|
+
} | {
|
|
448
|
+
type: "move";
|
|
449
|
+
uci: string;
|
|
450
|
+
pieceId: string;
|
|
451
|
+
from: string;
|
|
452
|
+
to: string;
|
|
453
|
+
san: string;
|
|
454
|
+
label: string;
|
|
455
|
+
} | {
|
|
456
|
+
type: "entity";
|
|
457
|
+
entityId: string;
|
|
458
|
+
label: string;
|
|
459
|
+
} | {
|
|
460
|
+
type: "relation";
|
|
461
|
+
relationId: string;
|
|
462
|
+
fromEntityId: string;
|
|
463
|
+
toEntityId: string;
|
|
464
|
+
relationType: string;
|
|
465
|
+
label: string;
|
|
466
|
+
};
|
|
467
|
+
export type ReasoningGraphReference = {
|
|
468
|
+
type: "entity";
|
|
469
|
+
entityId: string;
|
|
470
|
+
} | {
|
|
471
|
+
type: "relation";
|
|
472
|
+
relationId: string;
|
|
473
|
+
fromEntityId: string;
|
|
474
|
+
toEntityId: string;
|
|
475
|
+
};
|
|
476
|
+
export type ReasoningClaim = {
|
|
477
|
+
id: string;
|
|
478
|
+
kind: ReasoningClaimKind;
|
|
479
|
+
content: ReasoningNarrativeSegment[];
|
|
480
|
+
proofStrength: ProofStrength | null;
|
|
481
|
+
evidenceIds: string[];
|
|
482
|
+
graphRefs: ReasoningGraphReference[];
|
|
483
|
+
};
|
|
484
|
+
export type ValidatedReasoningClaim = Omit<ReasoningClaim, "content"> & {
|
|
485
|
+
content: ResolvedReasoningNarrativeSegment[];
|
|
486
|
+
text: string;
|
|
487
|
+
graphEvidenceId: string | null;
|
|
488
|
+
};
|
|
489
|
+
export type ReasoningMoveInput = {
|
|
490
|
+
uci: string;
|
|
491
|
+
pieceId: string;
|
|
492
|
+
};
|
|
493
|
+
type ReasoningDraftGraphCoverage = {
|
|
494
|
+
graphRefs: ReasoningGraphReference[];
|
|
495
|
+
intentId?: string;
|
|
496
|
+
};
|
|
497
|
+
export type ReasoningDraftDemonstration = ({
|
|
498
|
+
id: string;
|
|
499
|
+
type: "legal-variation";
|
|
500
|
+
start: "before" | "after";
|
|
501
|
+
moves: ReasoningMoveInput[];
|
|
502
|
+
label: string;
|
|
503
|
+
evidenceIds: string[];
|
|
504
|
+
} & ReasoningDraftGraphCoverage) | ({
|
|
505
|
+
id: string;
|
|
506
|
+
type: "conditional-route";
|
|
507
|
+
pieceId: string;
|
|
508
|
+
waypoints: string[];
|
|
509
|
+
prerequisiteRefs: ReasoningNarrativeSegment[];
|
|
510
|
+
label: string;
|
|
511
|
+
evidenceIds: string[];
|
|
512
|
+
} & ReasoningDraftGraphCoverage) | ({
|
|
513
|
+
id: string;
|
|
514
|
+
type: "static-relationship";
|
|
515
|
+
from: ReasoningNarrativeSegment;
|
|
516
|
+
to: ReasoningNarrativeSegment;
|
|
517
|
+
relationType: string;
|
|
518
|
+
label: string;
|
|
519
|
+
evidenceIds: string[];
|
|
520
|
+
} & ReasoningDraftGraphCoverage);
|
|
521
|
+
export type ResolvedReasoningMove = ReasoningMoveInput & {
|
|
522
|
+
from: string;
|
|
523
|
+
to: string;
|
|
524
|
+
san: string;
|
|
525
|
+
resultingFen: string;
|
|
526
|
+
};
|
|
527
|
+
export type ReasoningDemonstration = ((Omit<Extract<ReasoningDraftDemonstration, {
|
|
528
|
+
type: "legal-variation";
|
|
529
|
+
}>, "moves"> & {
|
|
530
|
+
moves: ResolvedReasoningMove[];
|
|
531
|
+
}) | (Omit<Extract<ReasoningDraftDemonstration, {
|
|
532
|
+
type: "conditional-route";
|
|
533
|
+
}>, "prerequisiteRefs"> & {
|
|
534
|
+
prerequisiteRefs: ResolvedReasoningNarrativeSegment[];
|
|
535
|
+
}) | (Omit<Extract<ReasoningDraftDemonstration, {
|
|
536
|
+
type: "static-relationship";
|
|
537
|
+
}>, "from" | "to"> & {
|
|
538
|
+
from: ResolvedReasoningNarrativeSegment;
|
|
539
|
+
to: ResolvedReasoningNarrativeSegment;
|
|
540
|
+
})) & {
|
|
541
|
+
graphEvidenceId: string | null;
|
|
542
|
+
};
|
|
543
|
+
export type BoardAnnotation = {
|
|
544
|
+
kind: "arrow" | "highlight";
|
|
545
|
+
from?: string;
|
|
546
|
+
to: string;
|
|
547
|
+
sourceRefType: "move" | "piece" | "square" | "route";
|
|
548
|
+
};
|
|
549
|
+
export type ReasoningClaimScope = "conditional-plan" | "bounded-consequence" | "position-fact";
|
|
550
|
+
export type ReasoningDefenseCoverage = {
|
|
551
|
+
completeWithinClass: boolean;
|
|
552
|
+
completeForAllResponses: boolean;
|
|
553
|
+
coveredClasses: string[];
|
|
554
|
+
unresolvedClasses: string[];
|
|
555
|
+
evidenceIds: string[];
|
|
556
|
+
};
|
|
557
|
+
export type ReasoningValidationIssue = {
|
|
558
|
+
path: string;
|
|
559
|
+
code: string;
|
|
560
|
+
message: string;
|
|
561
|
+
permittedReferences: string[];
|
|
562
|
+
};
|
|
563
|
+
export type ReasoningDraft = {
|
|
564
|
+
claimScope: ReasoningClaimScope;
|
|
565
|
+
defenseCoverage: ReasoningDefenseCoverage;
|
|
566
|
+
claims: ReasoningClaim[];
|
|
567
|
+
demonstrations: ReasoningDraftDemonstration[];
|
|
568
|
+
limitations: string[];
|
|
569
|
+
};
|
|
570
|
+
export type ReasoningModelNarrativeSegment = Extract<ReasoningNarrativeSegment, {
|
|
571
|
+
type: "text";
|
|
572
|
+
}> | Omit<Extract<ReasoningNarrativeSegment, {
|
|
573
|
+
type: "piece";
|
|
574
|
+
}>, "label"> | Omit<Extract<ReasoningNarrativeSegment, {
|
|
575
|
+
type: "piece-kind";
|
|
576
|
+
}>, "label"> | Omit<Extract<ReasoningNarrativeSegment, {
|
|
577
|
+
type: "square";
|
|
578
|
+
}>, "label"> | Omit<Extract<ReasoningNarrativeSegment, {
|
|
579
|
+
type: "move";
|
|
580
|
+
}>, "label"> | Omit<Extract<ReasoningNarrativeSegment, {
|
|
581
|
+
type: "entity";
|
|
582
|
+
}>, "label"> | Omit<Extract<ReasoningNarrativeSegment, {
|
|
583
|
+
type: "relation";
|
|
584
|
+
}>, "label">;
|
|
585
|
+
export type ReasoningModelDraftClaim = Omit<ReasoningClaim, "content" | "graphRefs"> & {
|
|
586
|
+
content: ReasoningModelNarrativeSegment[];
|
|
587
|
+
};
|
|
588
|
+
export type ReasoningModelDraftDemonstration = Omit<Extract<ReasoningDraftDemonstration, {
|
|
589
|
+
type: "legal-variation";
|
|
590
|
+
}>, "graphRefs"> | (Omit<Extract<ReasoningDraftDemonstration, {
|
|
591
|
+
type: "conditional-route";
|
|
592
|
+
}>, "graphRefs" | "prerequisiteRefs"> & {
|
|
593
|
+
prerequisiteRefs: ReasoningModelNarrativeSegment[];
|
|
594
|
+
}) | {
|
|
595
|
+
id: string;
|
|
596
|
+
type: "static-relationship";
|
|
597
|
+
relation: Extract<ReasoningModelNarrativeSegment, {
|
|
598
|
+
type: "relation";
|
|
599
|
+
}>;
|
|
600
|
+
label: string;
|
|
601
|
+
evidenceIds: string[];
|
|
602
|
+
};
|
|
603
|
+
export type ReasoningModelDraft = {
|
|
604
|
+
claimScope: ReasoningClaimScope;
|
|
605
|
+
defenseCoverage: ReasoningDefenseCoverage;
|
|
606
|
+
claims: ReasoningModelDraftClaim[];
|
|
607
|
+
demonstrations: ReasoningModelDraftDemonstration[];
|
|
608
|
+
limitations: string[];
|
|
609
|
+
};
|
|
610
|
+
export type ReasoningRenderNarrativeSegment = Exclude<ReasoningModelNarrativeSegment, {
|
|
611
|
+
type: "relation" | "entity";
|
|
612
|
+
}> | {
|
|
613
|
+
type: "entity";
|
|
614
|
+
entityId: string;
|
|
615
|
+
label?: string;
|
|
616
|
+
};
|
|
617
|
+
export type ReasoningRenderDraftClaim = Omit<ReasoningModelDraftClaim, "content"> & {
|
|
618
|
+
content: ReasoningRenderNarrativeSegment[];
|
|
619
|
+
entityIds: string[];
|
|
620
|
+
};
|
|
621
|
+
export type ReasoningRenderDraftDemonstration = {
|
|
622
|
+
type: "legal-variation";
|
|
623
|
+
intentId: string;
|
|
624
|
+
} | (Omit<Extract<ReasoningModelDraftDemonstration, {
|
|
625
|
+
type: "conditional-route";
|
|
626
|
+
}>, "prerequisiteRefs"> & {
|
|
627
|
+
intentId?: string;
|
|
628
|
+
prerequisiteRefs: ReasoningRenderNarrativeSegment[];
|
|
629
|
+
});
|
|
630
|
+
export type ReasoningRenderDraft = {
|
|
631
|
+
claims: ReasoningRenderDraftClaim[];
|
|
632
|
+
demonstrations: ReasoningRenderDraftDemonstration[];
|
|
633
|
+
};
|
|
634
|
+
export declare const REASONING_DISCOURSE_PLAN_VERSION: "reasoning-discourse-plan/2";
|
|
635
|
+
export type ReasoningDiscourseRole = "main-idea" | "mechanism" | "practical-consequence" | "qualification";
|
|
636
|
+
export type ReasoningDiscourseParagraph = {
|
|
637
|
+
id: string;
|
|
638
|
+
role: ReasoningDiscourseRole;
|
|
639
|
+
claimKind: ReasoningClaimKind;
|
|
640
|
+
objective: string;
|
|
641
|
+
entityIds: string[];
|
|
642
|
+
relationIds: string[];
|
|
643
|
+
evidenceIds: string[];
|
|
644
|
+
};
|
|
645
|
+
export type ReasoningDiscourseRelationAction = {
|
|
646
|
+
relationId: string;
|
|
647
|
+
label: string;
|
|
648
|
+
};
|
|
649
|
+
export type ReasoningDiscourseDemonstrationIntent = {
|
|
650
|
+
id: string;
|
|
651
|
+
paragraphId: string;
|
|
652
|
+
type: "legal-variation" | "conditional-route";
|
|
653
|
+
evidenceIds: string[];
|
|
654
|
+
objective: string;
|
|
655
|
+
};
|
|
656
|
+
export type ReasoningDiscoursePlan = {
|
|
657
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
658
|
+
planVersion: typeof REASONING_DISCOURSE_PLAN_VERSION;
|
|
659
|
+
id: string;
|
|
660
|
+
checkpointId: string;
|
|
661
|
+
paragraphs: ReasoningDiscourseParagraph[];
|
|
662
|
+
relationActions: ReasoningDiscourseRelationAction[];
|
|
663
|
+
demonstrationIntents: ReasoningDiscourseDemonstrationIntent[];
|
|
664
|
+
};
|
|
665
|
+
export type ReasoningDiscoursePlanDraft = Pick<ReasoningDiscoursePlan, "paragraphs" | "relationActions" | "demonstrationIntents">;
|
|
666
|
+
export type ReasoningCheckpointEvidenceSummary = {
|
|
667
|
+
id: string;
|
|
668
|
+
kind: ReasoningEvidenceKind;
|
|
669
|
+
source: string;
|
|
670
|
+
proofStrength: ProofStrength | null;
|
|
671
|
+
licenses: EvidenceLicense[];
|
|
672
|
+
summary: string;
|
|
673
|
+
details: Record<string, SemanticValue>;
|
|
674
|
+
coverage: ReasoningEvidenceRecord["coverage"];
|
|
675
|
+
};
|
|
676
|
+
export type ReasoningReferenceScope = {
|
|
677
|
+
pieceIds: string[];
|
|
678
|
+
squares: string[];
|
|
679
|
+
moves: Array<ReasoningMoveInput & {
|
|
680
|
+
san: string;
|
|
681
|
+
}>;
|
|
682
|
+
};
|
|
683
|
+
export type ReasoningCheckpointReferenceBindings = {
|
|
684
|
+
target: ReasoningReferenceScope;
|
|
685
|
+
evidence: Array<{
|
|
686
|
+
evidenceId: string;
|
|
687
|
+
} & ReasoningReferenceScope>;
|
|
688
|
+
entities: Array<{
|
|
689
|
+
entityId: string;
|
|
690
|
+
} & ReasoningReferenceScope>;
|
|
691
|
+
relations: Array<{
|
|
692
|
+
relationId: string;
|
|
693
|
+
} & ReasoningReferenceScope>;
|
|
694
|
+
};
|
|
695
|
+
export type ReasoningCheckpoint = {
|
|
696
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
697
|
+
checkpointVersion: "reasoning-checkpoint/5";
|
|
698
|
+
id: string;
|
|
699
|
+
requestId: string;
|
|
700
|
+
contextHash: string;
|
|
701
|
+
question: string;
|
|
702
|
+
audience: ReasoningAudience;
|
|
703
|
+
concise: boolean;
|
|
704
|
+
requestedConclusion: QueryContract["requestedConclusion"];
|
|
705
|
+
hypothesisLedgerRevision: string;
|
|
706
|
+
observationCoverage: ReasoningObservationCoverage[];
|
|
707
|
+
reviewedHypotheses: ReasoningHypothesisRecord[];
|
|
708
|
+
selectedGraph: {
|
|
709
|
+
evidenceId: string;
|
|
710
|
+
graphHash: string;
|
|
711
|
+
entities: SemanticEntity[];
|
|
712
|
+
relations: SemanticRelation[];
|
|
713
|
+
};
|
|
714
|
+
presentation: {
|
|
715
|
+
entities: Array<{
|
|
716
|
+
entityId: string;
|
|
717
|
+
label: string;
|
|
718
|
+
}>;
|
|
719
|
+
relations: Array<{
|
|
720
|
+
relationId: string;
|
|
721
|
+
fromEntityId: string;
|
|
722
|
+
toEntityId: string;
|
|
723
|
+
label: string;
|
|
724
|
+
}>;
|
|
725
|
+
};
|
|
726
|
+
approvedEvidence: ReasoningCheckpointEvidenceSummary[];
|
|
727
|
+
claimScope: ReasoningClaimScope;
|
|
728
|
+
defenseCoverage: ReasoningDefenseCoverage;
|
|
729
|
+
limitations: string[];
|
|
730
|
+
referenceBindings: ReasoningCheckpointReferenceBindings;
|
|
731
|
+
allowlists: {
|
|
732
|
+
evidenceIds: string[];
|
|
733
|
+
pieceIds: string[];
|
|
734
|
+
squares: string[];
|
|
735
|
+
moves: Array<ReasoningMoveInput & {
|
|
736
|
+
san: string;
|
|
737
|
+
}>;
|
|
738
|
+
entityIds: string[];
|
|
739
|
+
relations: Array<{
|
|
740
|
+
relationId: string;
|
|
741
|
+
fromEntityId: string;
|
|
742
|
+
toEntityId: string;
|
|
743
|
+
}>;
|
|
744
|
+
};
|
|
745
|
+
obligations: {
|
|
746
|
+
requestedConclusion: QueryContract["requestedConclusion"];
|
|
747
|
+
responseCoverageRequirement: QueryContract["responseCoverageRequirement"];
|
|
748
|
+
continuationCoverageRequirement: QueryContract["continuationCoverageRequirement"];
|
|
749
|
+
minimumContinuationLines: number;
|
|
750
|
+
graphRequirements: ReasoningGraphRequirements;
|
|
751
|
+
entityIds: string[];
|
|
752
|
+
relations: Array<{
|
|
753
|
+
relationId: string;
|
|
754
|
+
fromEntityId: string;
|
|
755
|
+
toEntityId: string;
|
|
756
|
+
}>;
|
|
757
|
+
requireInterpretationClaim: boolean;
|
|
758
|
+
requireConditionalQualification: boolean;
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
export type ReasoningCompletionStage = "semantic-incomplete" | "reasoned-unrendered" | "render-invalid" | "complete";
|
|
762
|
+
export type ReasoningStructuralOutcome = "incomplete" | "complete";
|
|
763
|
+
export type ReasoningNarrativeOutcome = "not-attempted" | "unrendered" | "invalid" | "valid";
|
|
764
|
+
export type ReasoningInteractionCoverage = {
|
|
765
|
+
status: "not-assessed" | "partial" | "complete";
|
|
766
|
+
semanticReferenceCount: number;
|
|
767
|
+
interactiveReferenceCount: number;
|
|
768
|
+
genericReferenceCount: number;
|
|
769
|
+
coverageRatio: number | null;
|
|
770
|
+
gaps: Array<{
|
|
771
|
+
path: string;
|
|
772
|
+
type: "piece-kind" | "off-board-piece" | "unbound-entity" | "unbound-relation" | "indistinguishable-entity-label";
|
|
773
|
+
label: string;
|
|
774
|
+
}>;
|
|
775
|
+
};
|
|
776
|
+
export type ReasoningRenderMetrics = {
|
|
777
|
+
inputBytes: number | null;
|
|
778
|
+
generatedJsonBytes: number;
|
|
779
|
+
inputTokens: number | null;
|
|
780
|
+
outputTokens: number | null;
|
|
781
|
+
finishReason: string | null;
|
|
782
|
+
validationResult: "not-attempted" | "unparseable" | "invalid" | "valid";
|
|
783
|
+
};
|
|
784
|
+
export type ReasoningToolTrace = {
|
|
785
|
+
callId: string;
|
|
786
|
+
tool: ReasoningToolName;
|
|
787
|
+
input: Record<string, unknown>;
|
|
788
|
+
support: ReasoningToolSupport;
|
|
789
|
+
evidenceIds: string[];
|
|
790
|
+
durationMs: number;
|
|
791
|
+
error?: string;
|
|
792
|
+
};
|
|
793
|
+
export type ReasoningHarnessPhase = "observations-presented" | "hypothesis-submission-required" | "hypotheses-recorded" | "observations-reviewed" | "future-purpose-planning" | "reasoning-challenged" | "hypotheses-revised" | "hypotheses-reviewed" | "critic-resolutions-audited" | "graph-materialized" | "checkpoint-frozen" | "discourse-planning" | "discourse-planning-repair" | "discourse-planned" | "draft-render" | "draft-generated" | "draft-repair";
|
|
794
|
+
export type ReasoningRuntimeDiagnostic = {
|
|
795
|
+
step: number;
|
|
796
|
+
provider: string;
|
|
797
|
+
model: string;
|
|
798
|
+
route: string;
|
|
799
|
+
sdkRuntime: string;
|
|
800
|
+
reasoningEffort: string;
|
|
801
|
+
outcome: "succeeded" | "failed" | "aborted";
|
|
802
|
+
httpStatus: number | null;
|
|
803
|
+
providerRequestId: string | null;
|
|
804
|
+
latencyMs: number | null;
|
|
805
|
+
retryCount: number | null;
|
|
806
|
+
finishReason: string | null;
|
|
807
|
+
contentPartCount: number;
|
|
808
|
+
textBytes: number;
|
|
809
|
+
toolCallCount: number;
|
|
810
|
+
toolCallBytes: number;
|
|
811
|
+
structuredOutputBytes: number;
|
|
812
|
+
reasoningPartCount: number;
|
|
813
|
+
reasoningBytes: number;
|
|
814
|
+
reasoningDetailsPresent: boolean;
|
|
815
|
+
inputTokens: number | null;
|
|
816
|
+
outputTokens: number | null;
|
|
817
|
+
outputTokenLimit: number;
|
|
818
|
+
requestContextBytes: number | null;
|
|
819
|
+
requestMessageCount: number | null;
|
|
820
|
+
contextCompacted: boolean;
|
|
821
|
+
lastHarnessPhase: ReasoningHarnessPhase;
|
|
822
|
+
errorCategory: string | null;
|
|
823
|
+
structuredOutputRecovery?: "locally-validated-json" | null;
|
|
824
|
+
/** Transport-only structured-output retry metadata for bounded stage recovery. */
|
|
825
|
+
recoveryAttempt?: number | null;
|
|
826
|
+
recoveryTrigger?: "output-truncated" | "output-missing" | null;
|
|
827
|
+
hypothesisRejectionStage?: "provider-structured-output" | "schema-validation" | "harness-validation" | null;
|
|
828
|
+
hypothesisRejectionCode?: "no-output" | "parse" | "schema" | "unknown-reference-or-evidence" | "unsupported-concept" | "anchor-incompatibility" | "supersession-lineage" | "critic-resolution-evidence" | "critic-resolution-incompatibility" | "used-observation-orphaned" | "empty-batch" | "evidence-license" | "proof-overstatement" | "malformed-structure" | "relation-or-budget" | "harness-validation" | null;
|
|
829
|
+
abortSource: "external" | "wall-time" | "provider" | null;
|
|
830
|
+
};
|
|
831
|
+
export declare class ModelRuntimeFailure extends Error {
|
|
832
|
+
readonly runtime: string;
|
|
833
|
+
readonly model: string;
|
|
834
|
+
readonly diagnostics: ReasoningRuntimeDiagnostic[];
|
|
835
|
+
readonly usage: {
|
|
836
|
+
inputTokens: number | null;
|
|
837
|
+
outputTokens: number | null;
|
|
838
|
+
};
|
|
839
|
+
constructor(input: {
|
|
840
|
+
runtime: string;
|
|
841
|
+
model: string;
|
|
842
|
+
diagnostics: ReasoningRuntimeDiagnostic[];
|
|
843
|
+
usage: {
|
|
844
|
+
inputTokens: number | null;
|
|
845
|
+
outputTokens: number | null;
|
|
846
|
+
};
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
export type ModelRunRequest = {
|
|
850
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
851
|
+
contract: QueryContract;
|
|
852
|
+
context: ReasoningPositionContext;
|
|
853
|
+
contextHash: string;
|
|
854
|
+
observations: ReasoningRankedObservationSet;
|
|
855
|
+
controls: ReasoningRunControls;
|
|
856
|
+
};
|
|
857
|
+
export type ModelRunResult = {
|
|
858
|
+
runtime: string;
|
|
859
|
+
model: string;
|
|
860
|
+
draft?: ReasoningDraft;
|
|
861
|
+
trace: ReasoningToolTrace[];
|
|
862
|
+
steps: number;
|
|
863
|
+
usage: {
|
|
864
|
+
inputTokens: number | null;
|
|
865
|
+
outputTokens: number | null;
|
|
866
|
+
};
|
|
867
|
+
diagnostics?: ReasoningRuntimeDiagnostic[];
|
|
868
|
+
};
|
|
869
|
+
export interface ModelRuntime {
|
|
870
|
+
run(request: ModelRunRequest, tools: ReasoningToolSet, signal?: AbortSignal): Promise<ModelRunResult>;
|
|
871
|
+
replaySemanticStage?(request: ModelSemanticStageReplayRequest, signal?: AbortSignal): Promise<ModelSemanticStageReplayResult>;
|
|
872
|
+
planDiscourse?(request: ModelDiscoursePlanRequest, signal?: AbortSignal): Promise<ModelDiscoursePlanResult>;
|
|
873
|
+
renderCheckpoint?(request: ModelRenderRequest, signal?: AbortSignal): Promise<ModelRenderResult>;
|
|
874
|
+
repairDraft?(request: ModelDraftRepairRequest, signal?: AbortSignal): Promise<ModelDraftRepairResult>;
|
|
875
|
+
}
|
|
876
|
+
export type ReasoningSemanticReplayStage = "hypothesis-initial" | "hypothesis-revision" | "future-purpose-probe" | "reasoning-critic" | "critic-resolution-audit" | "answer-obligation-and-graph-selection" | "graph-selection";
|
|
877
|
+
export type ModelSemanticStageReplayRequest = {
|
|
878
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
879
|
+
stage: ReasoningSemanticReplayStage;
|
|
880
|
+
input: Record<string, unknown>;
|
|
881
|
+
};
|
|
882
|
+
export type ModelSemanticStageReplayResult = {
|
|
883
|
+
runtime: string;
|
|
884
|
+
model: string;
|
|
885
|
+
stage: ReasoningSemanticReplayStage;
|
|
886
|
+
output: Record<string, unknown>;
|
|
887
|
+
usage: {
|
|
888
|
+
inputTokens: number | null;
|
|
889
|
+
outputTokens: number | null;
|
|
890
|
+
};
|
|
891
|
+
diagnostics?: ReasoningRuntimeDiagnostic[];
|
|
892
|
+
};
|
|
893
|
+
export type ModelDiscoursePlanRequest = {
|
|
894
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
895
|
+
contract: QueryContract;
|
|
896
|
+
context: ReasoningPositionContext;
|
|
897
|
+
contextHash: string;
|
|
898
|
+
checkpoint: ReasoningCheckpoint;
|
|
899
|
+
};
|
|
900
|
+
export type ModelDiscoursePlanResult = {
|
|
901
|
+
runtime: string;
|
|
902
|
+
model: string;
|
|
903
|
+
plan: ReasoningDiscoursePlan;
|
|
904
|
+
usage: {
|
|
905
|
+
inputTokens: number | null;
|
|
906
|
+
outputTokens: number | null;
|
|
907
|
+
};
|
|
908
|
+
diagnostics?: ReasoningRuntimeDiagnostic[];
|
|
909
|
+
};
|
|
910
|
+
export type ModelRenderRequest = {
|
|
911
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
912
|
+
contract: QueryContract;
|
|
913
|
+
context: ReasoningPositionContext;
|
|
914
|
+
contextHash: string;
|
|
915
|
+
checkpoint: ReasoningCheckpoint;
|
|
916
|
+
discoursePlan?: ReasoningDiscoursePlan;
|
|
917
|
+
maxOutputChars: number;
|
|
918
|
+
previousValidationIssues?: ReasoningValidationIssue[];
|
|
919
|
+
};
|
|
920
|
+
export type ModelRenderResult = {
|
|
921
|
+
runtime: string;
|
|
922
|
+
model: string;
|
|
923
|
+
draft: ReasoningDraft;
|
|
924
|
+
usage: {
|
|
925
|
+
inputTokens: number | null;
|
|
926
|
+
outputTokens: number | null;
|
|
927
|
+
};
|
|
928
|
+
diagnostics?: ReasoningRuntimeDiagnostic[];
|
|
929
|
+
metrics: ReasoningRenderMetrics;
|
|
930
|
+
};
|
|
931
|
+
export type ModelDraftRepairRequest = {
|
|
932
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
933
|
+
contract: QueryContract;
|
|
934
|
+
context: ReasoningPositionContext;
|
|
935
|
+
contextHash: string;
|
|
936
|
+
originalDraft: ReasoningDraft;
|
|
937
|
+
issues: ReasoningValidationIssue[];
|
|
938
|
+
frozen: {
|
|
939
|
+
observationCoverage: ReasoningObservationCoverage[];
|
|
940
|
+
hypothesisLedgerRevision: string;
|
|
941
|
+
hypothesisIds: string[];
|
|
942
|
+
relationIds: string[];
|
|
943
|
+
graphEvidenceIds: string[];
|
|
944
|
+
evidenceIds: string[];
|
|
945
|
+
referenceAllowlists: {
|
|
946
|
+
pieceIds: string[];
|
|
947
|
+
squares: string[];
|
|
948
|
+
moves: Array<{
|
|
949
|
+
uci: string;
|
|
950
|
+
pieceId: string;
|
|
951
|
+
san: string;
|
|
952
|
+
}>;
|
|
953
|
+
};
|
|
954
|
+
referenceBindings: ReasoningCheckpointReferenceBindings;
|
|
955
|
+
claimScope: ReasoningClaimScope;
|
|
956
|
+
defenseCoverage: ReasoningDefenseCoverage;
|
|
957
|
+
};
|
|
958
|
+
maxOutputChars: number;
|
|
959
|
+
};
|
|
960
|
+
export type ModelDraftRepairResult = {
|
|
961
|
+
runtime: string;
|
|
962
|
+
model: string;
|
|
963
|
+
draft: ReasoningDraft;
|
|
964
|
+
usage: {
|
|
965
|
+
inputTokens: number | null;
|
|
966
|
+
outputTokens: number | null;
|
|
967
|
+
};
|
|
968
|
+
diagnostics?: ReasoningRuntimeDiagnostic[];
|
|
969
|
+
};
|
|
970
|
+
export type ValidatedReasoningAnswer = {
|
|
971
|
+
schemaVersion: typeof REASONING_POC_VERSION;
|
|
972
|
+
requestId: string;
|
|
973
|
+
contextHash: string;
|
|
974
|
+
status: "supported" | "partial" | "fact-only";
|
|
975
|
+
completionStage: ReasoningCompletionStage;
|
|
976
|
+
reasoningOutcome: ReasoningStructuralOutcome;
|
|
977
|
+
narrativeOutcome: ReasoningNarrativeOutcome;
|
|
978
|
+
interactionCoverage: ReasoningInteractionCoverage;
|
|
979
|
+
reasoningCheckpoint: ReasoningCheckpoint | null;
|
|
980
|
+
discoursePlan: ReasoningDiscoursePlan | null;
|
|
981
|
+
renderMetrics: ReasoningRenderMetrics;
|
|
982
|
+
claimScope: ReasoningClaimScope;
|
|
983
|
+
defenseCoverage: ReasoningDefenseCoverage;
|
|
984
|
+
answer: string;
|
|
985
|
+
claims: ValidatedReasoningClaim[];
|
|
986
|
+
rejectedClaims: Array<{
|
|
987
|
+
claim: ReasoningClaim;
|
|
988
|
+
reasons: string[];
|
|
989
|
+
}>;
|
|
990
|
+
rejectedDemonstrations: Array<{
|
|
991
|
+
demonstration: ReasoningDraftDemonstration;
|
|
992
|
+
issues: ReasoningValidationIssue[];
|
|
993
|
+
}>;
|
|
994
|
+
validationIssues: ReasoningValidationIssue[];
|
|
995
|
+
repair: {
|
|
996
|
+
attempted: boolean;
|
|
997
|
+
succeeded: boolean;
|
|
998
|
+
};
|
|
999
|
+
demonstrations: ReasoningDemonstration[];
|
|
1000
|
+
annotations: BoardAnnotation[];
|
|
1001
|
+
observationCoverage: ReasoningObservationCoverage[];
|
|
1002
|
+
hypotheses: ReasoningHypothesisRecord[];
|
|
1003
|
+
unverifiedCandidateHypothesisIds: string[];
|
|
1004
|
+
evidence: ReasoningEvidenceRecord[];
|
|
1005
|
+
limitations: string[];
|
|
1006
|
+
trace: ReasoningToolTrace[];
|
|
1007
|
+
runtime: string;
|
|
1008
|
+
model: string;
|
|
1009
|
+
usage: ModelRunResult["usage"];
|
|
1010
|
+
runtimeDiagnostics: ReasoningRuntimeDiagnostic[];
|
|
1011
|
+
};
|
|
1012
|
+
export declare function validateReasoningPositionContext(value: ReasoningPositionContext): ReasoningPositionContext;
|
|
1013
|
+
export declare function reasoningContextHash(context: ReasoningPositionContext): string;
|
|
1014
|
+
export declare function createQueryContract(input: {
|
|
1015
|
+
requestId: string;
|
|
1016
|
+
question: string;
|
|
1017
|
+
audience?: ReasoningAudience;
|
|
1018
|
+
concise?: boolean;
|
|
1019
|
+
responseCoverageRequirement?: QueryContract["responseCoverageRequirement"];
|
|
1020
|
+
continuationCoverageRequirement?: QueryContract["continuationCoverageRequirement"];
|
|
1021
|
+
minimumContinuationLines?: number;
|
|
1022
|
+
graphRequirements?: Partial<ReasoningGraphRequirements>;
|
|
1023
|
+
context: ReasoningPositionContext;
|
|
1024
|
+
}): QueryContract;
|
|
1025
|
+
export declare function createContextEvidence(context: ReasoningPositionContext, contextHash?: string): ReasoningEvidenceRecord;
|
|
1026
|
+
export {};
|