@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.
Files changed (258) hide show
  1. package/LICENSE +235 -0
  2. package/LICENSING.md +26 -0
  3. package/NOTICE +5 -0
  4. package/NPM-PUBLISHING.md +24 -0
  5. package/README.md +141 -2
  6. package/SOURCE-ORIGIN.json +16 -0
  7. package/THIRD_PARTY_NOTICES.md +18 -0
  8. package/build.mjs +22 -0
  9. package/dist/answer-pipeline.test.mjs +375 -0
  10. package/dist/chunk-PLKNJRPF.js +10662 -0
  11. package/dist/chunk-XQDZJOYD.js +2515 -0
  12. package/dist/index.js +146 -0
  13. package/dist/owner-tests/chess-reasoning-compact-search-preparation.test.mjs +963 -0
  14. package/dist/owner-tests/mechanism-encoding.test.mjs +529 -0
  15. package/dist/owner-tests/move-mechanism-facts.test.mjs +396 -0
  16. package/dist/owner-tests/pipeline-host-preparation.test.mjs +10556 -0
  17. package/dist/owner-tests/position-preparation.test.mjs +625 -0
  18. package/dist/owner-tests/preparation-consolidation.test.mjs +1052 -0
  19. package/dist/owner-tests/prose-reference-admission.test.mjs +1770 -0
  20. package/dist/owner-tests/score-comparison-notices.test.mjs +240 -0
  21. package/dist/owner-tests/simple-engine-presentation.test.mjs +233 -0
  22. package/dist/owner-tests/tool-input-loop-guard.test.mjs +78 -0
  23. package/dist/research.js +2274 -0
  24. package/dist/runtime-closure.json +103 -0
  25. package/dist/shared-runtime-closure.json +39 -0
  26. package/dist/shared.js +152 -0
  27. package/dist/types/ai-request-failure.d.ts +14 -0
  28. package/dist/types/ai-request-limits.d.ts +4 -0
  29. package/dist/types/ai-routing-diagnostics.d.ts +14 -0
  30. package/dist/types/chess-reasoning/ablation-adaptive-evidence-loop.d.ts +127 -0
  31. package/dist/types/chess-reasoning/ablation-adaptive-runtime.d.ts +178 -0
  32. package/dist/types/chess-reasoning/ablation-direct-synthesis.d.ts +1030 -0
  33. package/dist/types/chess-reasoning/ablation-evidence-bundle.d.ts +185 -0
  34. package/dist/types/chess-reasoning/ablation-evidence-capture.d.ts +37 -0
  35. package/dist/types/chess-reasoning/ablation-lean-direct-runtime.d.ts +193 -0
  36. package/dist/types/chess-reasoning/ablation-model-facing-evidence.d.ts +38 -0
  37. package/dist/types/chess-reasoning/ablation-transport-correction.d.ts +13 -0
  38. package/dist/types/chess-reasoning/ai-sdk-runtime-support.d.ts +93 -0
  39. package/dist/types/chess-reasoning/answer-host-contracts.d.ts +59 -0
  40. package/dist/types/chess-reasoning/answer-model-connector.d.ts +68 -0
  41. package/dist/types/chess-reasoning/answer-pipeline-exports.d.ts +98 -0
  42. package/dist/types/chess-reasoning/answer-pipeline.d.ts +41 -0
  43. package/dist/types/chess-reasoning/answer-reference-validation.d.ts +40 -0
  44. package/dist/types/chess-reasoning/answer-tool-host.d.ts +8 -0
  45. package/dist/types/chess-reasoning/branch-expansion-policy.d.ts +13 -0
  46. package/dist/types/chess-reasoning/branch-expansion.d.ts +39 -0
  47. package/dist/types/chess-reasoning/causal-claim-checks.d.ts +21 -0
  48. package/dist/types/chess-reasoning/chess-reference-dictionary.d.ts +13 -0
  49. package/dist/types/chess-reasoning/classification-question-target.d.ts +22 -0
  50. package/dist/types/chess-reasoning/classification-reassessment.d.ts +31 -0
  51. package/dist/types/chess-reasoning/compact-search-preparation.d.ts +7 -0
  52. package/dist/types/chess-reasoning/concept-registry.d.ts +99 -0
  53. package/dist/types/chess-reasoning/conversation-context.d.ts +12 -0
  54. package/dist/types/chess-reasoning/engine-search-failure.d.ts +7 -0
  55. package/dist/types/chess-reasoning/evidence-citation-normalization.d.ts +9 -0
  56. package/dist/types/chess-reasoning/evidence-licenses.d.ts +57 -0
  57. package/dist/types/chess-reasoning/evidence-selector-contract.d.ts +5 -0
  58. package/dist/types/chess-reasoning/existing-analysis-context.d.ts +104 -0
  59. package/dist/types/chess-reasoning/fact-observation-provider.d.ts +15 -0
  60. package/dist/types/chess-reasoning/fact-provider.d.ts +111 -0
  61. package/dist/types/chess-reasoning/fresh-engine-pv-witnesses.d.ts +67 -0
  62. package/dist/types/chess-reasoning/historical-prose.d.ts +23 -0
  63. package/dist/types/chess-reasoning/idea-graph.d.ts +34 -0
  64. package/dist/types/chess-reasoning/initial-search-plan.d.ts +37 -0
  65. package/dist/types/chess-reasoning/lossless-evidence-sharing.d.ts +18 -0
  66. package/dist/types/chess-reasoning/matched-comparison.d.ts +10 -0
  67. package/dist/types/chess-reasoning/material-accounting.d.ts +80 -0
  68. package/dist/types/chess-reasoning/material-format.d.ts +4 -0
  69. package/dist/types/chess-reasoning/mechanical-fact-provider.d.ts +33 -0
  70. package/dist/types/chess-reasoning/mechanical-ray-facts.d.ts +19 -0
  71. package/dist/types/chess-reasoning/mechanism-presentation.d.ts +9 -0
  72. package/dist/types/chess-reasoning/move-mechanism-facts.d.ts +45 -0
  73. package/dist/types/chess-reasoning/native-answer-connector.d.ts +4 -0
  74. package/dist/types/chess-reasoning/opening-source-contracts.d.ts +54 -0
  75. package/dist/types/chess-reasoning/opening-source-credits.d.ts +16 -0
  76. package/dist/types/chess-reasoning/opponent-threat-preparation.d.ts +7 -0
  77. package/dist/types/chess-reasoning/piece-identities.d.ts +11 -0
  78. package/dist/types/chess-reasoning/poc-contracts.d.ts +1026 -0
  79. package/dist/types/chess-reasoning/poc-hypotheses.d.ts +74 -0
  80. package/dist/types/chess-reasoning/poc-move-witnesses.d.ts +13 -0
  81. package/dist/types/chess-reasoning/poc-observations.d.ts +23 -0
  82. package/dist/types/chess-reasoning/poc-piece-refs.d.ts +12 -0
  83. package/dist/types/chess-reasoning/poc-plan-model.d.ts +45 -0
  84. package/dist/types/chess-reasoning/poc-semantic-text.d.ts +8 -0
  85. package/dist/types/chess-reasoning/poc-tools.d.ts +81 -0
  86. package/dist/types/chess-reasoning/portable-answer-runtime.d.ts +291 -0
  87. package/dist/types/chess-reasoning/position-analysis-contracts.d.ts +31 -0
  88. package/dist/types/chess-reasoning/position-analysis-scope.d.ts +3 -0
  89. package/dist/types/chess-reasoning/preparation-consolidation.d.ts +21 -0
  90. package/dist/types/chess-reasoning/production-observation-provider.d.ts +16 -0
  91. package/dist/types/chess-reasoning/question-routing.d.ts +326 -0
  92. package/dist/types/chess-reasoning/recorded-main-line.d.ts +37 -0
  93. package/dist/types/chess-reasoning/recorded-position-tools.d.ts +11 -0
  94. package/dist/types/chess-reasoning/recorded-reference-context.d.ts +13 -0
  95. package/dist/types/chess-reasoning/recorded-selected-classification.d.ts +36 -0
  96. package/dist/types/chess-reasoning/reference-limits.d.ts +2 -0
  97. package/dist/types/chess-reasoning/research-exports.d.ts +197 -0
  98. package/dist/types/chess-reasoning/saved-score-presentation.d.ts +14 -0
  99. package/dist/types/chess-reasoning/score-comparison-notices.d.ts +33 -0
  100. package/dist/types/chess-reasoning/server-simple-policy.d.ts +31 -0
  101. package/dist/types/chess-reasoning/simple-agent-config.d.ts +73 -0
  102. package/dist/types/chess-reasoning/simple-board-analysis.d.ts +85 -0
  103. package/dist/types/chess-reasoning/simple-compact-evidence.d.ts +7 -0
  104. package/dist/types/chess-reasoning/simple-completion.d.ts +23 -0
  105. package/dist/types/chess-reasoning/simple-engine-presentation.d.ts +3 -0
  106. package/dist/types/chess-reasoning/simple-evidence-preparation.d.ts +17 -0
  107. package/dist/types/chess-reasoning/simple-evidence-view.d.ts +17 -0
  108. package/dist/types/chess-reasoning/simple-explanation-coverage.d.ts +90 -0
  109. package/dist/types/chess-reasoning/simple-fact-delivery.d.ts +43 -0
  110. package/dist/types/chess-reasoning/simple-fallback-premise.d.ts +5 -0
  111. package/dist/types/chess-reasoning/simple-prose-references.d.ts +108 -0
  112. package/dist/types/chess-reasoning/simple-runtime-version.d.ts +1 -0
  113. package/dist/types/chess-reasoning/stable.d.ts +2 -0
  114. package/dist/types/chess-reasoning/tool-input-loop-guard.d.ts +5 -0
  115. package/dist/types/chess-reasoning/types.d.ts +180 -0
  116. package/dist/types/chess-reasoning/visible-support-lines.d.ts +12 -0
  117. package/dist/types/chess-reasoning/wikibooks-index.d.ts +30 -0
  118. package/dist/types/chess-reasoning/wikibooks-tool-context.d.ts +10 -0
  119. package/dist/types/player-perspective.d.ts +16 -0
  120. package/dist/types/shared-exports.d.ts +22 -0
  121. package/docs/API.md +82 -0
  122. package/docs/OWNERSHIP-ADOPTION.md +35 -0
  123. package/docs/OWNERSHIP-DRIFT.json +55 -0
  124. package/docs/RESEARCH-API.md +28 -0
  125. package/licenses/third-party/INVENTORY.json +202 -0
  126. package/licenses/third-party/ai-7.0.85/LICENSE +13 -0
  127. package/licenses/third-party/ai-sdk--gateway-4.0.69/LICENSE +13 -0
  128. package/licenses/third-party/ai-sdk--provider-4.0.9/LICENSE +13 -0
  129. package/licenses/third-party/ai-sdk--provider-utils-5.0.34/APACHE-2.0.txt +73 -0
  130. package/licenses/third-party/ai-sdk--provider-utils-5.0.34/src/to-json-schema/zod3-to-json-schema/LICENSE +16 -0
  131. package/licenses/third-party/chess.js-1.4.0/LICENSE +23 -0
  132. package/licenses/third-party/eventsource-parser-3.1.1/LICENSE +21 -0
  133. package/licenses/third-party/json-schema-0.4.0/LICENSE +195 -0
  134. package/licenses/third-party/standard-schema--spec-1.1.0/LICENSE +21 -0
  135. package/licenses/third-party/types--json-schema-7.0.15/LICENSE +21 -0
  136. package/licenses/third-party/types--node-22.19.19/LICENSE +21 -0
  137. package/licenses/third-party/undici-7.30.0/LICENSE +21 -0
  138. package/licenses/third-party/undici-7.30.0/lib/web/fetch/LICENSE +21 -0
  139. package/licenses/third-party/undici-types-6.21.0/LICENSE +21 -0
  140. package/licenses/third-party/vercel--oidc-3.2.0/LICENSE +202 -0
  141. package/licenses/third-party/workflow--serde-4.1.0/APACHE-2.0.txt +73 -0
  142. package/licenses/third-party/workflow--serde-4.1.0/LICENSE.md +3 -0
  143. package/licenses/third-party/zod-4.6.5/LICENSE +21 -0
  144. package/npm-release.json +5 -0
  145. package/package.json +72 -4
  146. package/scripts/check-release-tooling.mjs +22 -0
  147. package/scripts/pack.mjs +68 -0
  148. package/scripts/publish-reviewed.mjs +72 -0
  149. package/scripts/release-tooling.json +13 -0
  150. package/scripts/update-dependency.mjs +44 -0
  151. package/scripts/verify-release.mjs +52 -0
  152. package/src/ai-request-failure.ts +34 -0
  153. package/src/ai-request-limits.ts +4 -0
  154. package/src/ai-routing-diagnostics.ts +33 -0
  155. package/src/chess-reasoning/ablation-adaptive-evidence-loop.ts +515 -0
  156. package/src/chess-reasoning/ablation-adaptive-runtime.ts +924 -0
  157. package/src/chess-reasoning/ablation-direct-synthesis.ts +1128 -0
  158. package/src/chess-reasoning/ablation-evidence-bundle.ts +726 -0
  159. package/src/chess-reasoning/ablation-evidence-capture.ts +513 -0
  160. package/src/chess-reasoning/ablation-lean-direct-runtime.ts +670 -0
  161. package/src/chess-reasoning/ablation-model-facing-evidence.ts +212 -0
  162. package/src/chess-reasoning/ablation-transport-correction.ts +106 -0
  163. package/src/chess-reasoning/ai-sdk-runtime-support.ts +381 -0
  164. package/src/chess-reasoning/answer-host-contracts.ts +10 -0
  165. package/src/chess-reasoning/answer-model-connector.ts +83 -0
  166. package/src/chess-reasoning/answer-pipeline-exports.ts +98 -0
  167. package/src/chess-reasoning/answer-pipeline.ts +195 -0
  168. package/src/chess-reasoning/answer-reference-validation.ts +124 -0
  169. package/src/chess-reasoning/answer-tool-host.ts +10 -0
  170. package/src/chess-reasoning/branch-expansion-policy.ts +32 -0
  171. package/src/chess-reasoning/branch-expansion.ts +80 -0
  172. package/src/chess-reasoning/causal-claim-checks.ts +256 -0
  173. package/src/chess-reasoning/chess-reference-dictionary.ts +21 -0
  174. package/src/chess-reasoning/classification-question-target.ts +30 -0
  175. package/src/chess-reasoning/classification-reassessment.ts +34 -0
  176. package/src/chess-reasoning/compact-search-preparation.ts +125 -0
  177. package/src/chess-reasoning/concept-registry.ts +275 -0
  178. package/src/chess-reasoning/conversation-context.ts +29 -0
  179. package/src/chess-reasoning/engine-search-failure.ts +11 -0
  180. package/src/chess-reasoning/evidence-citation-normalization.ts +15 -0
  181. package/src/chess-reasoning/evidence-licenses.ts +166 -0
  182. package/src/chess-reasoning/evidence-selector-contract.ts +5 -0
  183. package/src/chess-reasoning/existing-analysis-context.ts +544 -0
  184. package/src/chess-reasoning/fact-observation-provider.ts +134 -0
  185. package/src/chess-reasoning/fact-provider.ts +250 -0
  186. package/src/chess-reasoning/fresh-engine-pv-witnesses.ts +128 -0
  187. package/src/chess-reasoning/historical-prose.ts +116 -0
  188. package/src/chess-reasoning/idea-graph.ts +224 -0
  189. package/src/chess-reasoning/initial-search-plan.ts +115 -0
  190. package/src/chess-reasoning/lossless-evidence-sharing.ts +135 -0
  191. package/src/chess-reasoning/matched-comparison.ts +40 -0
  192. package/src/chess-reasoning/material-accounting.ts +55 -0
  193. package/src/chess-reasoning/material-format.ts +47 -0
  194. package/src/chess-reasoning/mechanical-fact-provider.ts +1602 -0
  195. package/src/chess-reasoning/mechanical-ray-facts.ts +123 -0
  196. package/src/chess-reasoning/mechanism-presentation.ts +94 -0
  197. package/src/chess-reasoning/move-mechanism-facts.ts +185 -0
  198. package/src/chess-reasoning/native-answer-connector.ts +13 -0
  199. package/src/chess-reasoning/opening-source-contracts.ts +47 -0
  200. package/src/chess-reasoning/opening-source-credits.ts +53 -0
  201. package/src/chess-reasoning/opponent-threat-preparation.ts +98 -0
  202. package/src/chess-reasoning/piece-identities.ts +159 -0
  203. package/src/chess-reasoning/poc-contracts.ts +1097 -0
  204. package/src/chess-reasoning/poc-hypotheses.ts +759 -0
  205. package/src/chess-reasoning/poc-move-witnesses.ts +170 -0
  206. package/src/chess-reasoning/poc-observations.ts +611 -0
  207. package/src/chess-reasoning/poc-piece-refs.ts +62 -0
  208. package/src/chess-reasoning/poc-plan-model.ts +345 -0
  209. package/src/chess-reasoning/poc-semantic-text.ts +10 -0
  210. package/src/chess-reasoning/poc-tools.ts +978 -0
  211. package/src/chess-reasoning/portable-answer-runtime.ts +684 -0
  212. package/src/chess-reasoning/position-analysis-contracts.ts +88 -0
  213. package/src/chess-reasoning/position-analysis-scope.ts +20 -0
  214. package/src/chess-reasoning/preparation-consolidation.ts +91 -0
  215. package/src/chess-reasoning/production-observation-provider.ts +41 -0
  216. package/src/chess-reasoning/question-routing.ts +332 -0
  217. package/src/chess-reasoning/recorded-main-line.ts +55 -0
  218. package/src/chess-reasoning/recorded-position-tools.ts +78 -0
  219. package/src/chess-reasoning/recorded-reference-context.ts +44 -0
  220. package/src/chess-reasoning/recorded-selected-classification.ts +54 -0
  221. package/src/chess-reasoning/reference-limits.ts +2 -0
  222. package/src/chess-reasoning/research-exports.ts +197 -0
  223. package/src/chess-reasoning/saved-score-presentation.ts +6 -0
  224. package/src/chess-reasoning/score-comparison-notices.ts +115 -0
  225. package/src/chess-reasoning/server-simple-policy.ts +75 -0
  226. package/src/chess-reasoning/simple-agent-config.ts +58 -0
  227. package/src/chess-reasoning/simple-board-analysis.ts +57 -0
  228. package/src/chess-reasoning/simple-compact-evidence.ts +79 -0
  229. package/src/chess-reasoning/simple-completion.ts +37 -0
  230. package/src/chess-reasoning/simple-engine-presentation.ts +95 -0
  231. package/src/chess-reasoning/simple-evidence-preparation.ts +32 -0
  232. package/src/chess-reasoning/simple-evidence-view.ts +69 -0
  233. package/src/chess-reasoning/simple-explanation-coverage.ts +118 -0
  234. package/src/chess-reasoning/simple-fact-delivery.ts +52 -0
  235. package/src/chess-reasoning/simple-fallback-premise.ts +65 -0
  236. package/src/chess-reasoning/simple-prose-references.ts +528 -0
  237. package/src/chess-reasoning/simple-runtime-version.ts +2 -0
  238. package/src/chess-reasoning/stable.ts +18 -0
  239. package/src/chess-reasoning/tool-input-loop-guard.ts +38 -0
  240. package/src/chess-reasoning/types.ts +195 -0
  241. package/src/chess-reasoning/visible-support-lines.ts +44 -0
  242. package/src/chess-reasoning/wikibooks-index.ts +56 -0
  243. package/src/chess-reasoning/wikibooks-tool-context.ts +91 -0
  244. package/src/player-perspective.ts +41 -0
  245. package/src/shared-exports.ts +23 -0
  246. package/test/answer-pipeline.test.mjs +375 -0
  247. package/test/owner/chess-reasoning-compact-search-preparation.test.mjs +111 -0
  248. package/test/owner/mechanism-encoding.test.mjs +78 -0
  249. package/test/owner/move-mechanism-facts.test.mjs +105 -0
  250. package/test/owner/pipeline-host-preparation.test.mjs +115 -0
  251. package/test/owner/position-preparation.test.mjs +22 -0
  252. package/test/owner/preparation-consolidation.test.mjs +74 -0
  253. package/test/owner/prose-reference-admission.test.mjs +26 -0
  254. package/test/owner/score-comparison-notices.test.mjs +116 -0
  255. package/test/owner/simple-engine-presentation.test.mjs +50 -0
  256. package/test/owner/tool-input-loop-guard.test.mjs +25 -0
  257. package/test-types.mts +23 -0
  258. package/tsconfig.json +22 -0
@@ -0,0 +1,68 @@
1
+ import type { ModelMessage, ToolSet, jsonSchema } from 'ai';
2
+ /** A single resumable model turn. No HTTP, account, storage or agent executor assumption. */
3
+ export type AnswerTurnRequest = {
4
+ system?: string;
5
+ messages: ModelMessage[];
6
+ tools: Array<{
7
+ name: string;
8
+ description?: string;
9
+ inputSchema: Parameters<typeof jsonSchema>[0];
10
+ }>;
11
+ toolChoice: 'auto' | 'none';
12
+ maxOutputTokens: number;
13
+ signal?: AbortSignal;
14
+ effort: string;
15
+ };
16
+ export type AnswerToolRequest = {
17
+ toolCallId: string;
18
+ toolName: string;
19
+ input: Record<string, unknown>;
20
+ };
21
+ export type AnswerTurnResult = {
22
+ text: string;
23
+ toolCalls: AnswerToolRequest[];
24
+ finishReason: string;
25
+ usage: {
26
+ inputTokens?: number;
27
+ outputTokens?: number;
28
+ };
29
+ /** Provider continuation messages; opaque provider metadata must be preserved in memory. */
30
+ response: {
31
+ messages: ModelMessage[];
32
+ headers?: Record<string, string>;
33
+ };
34
+ providerMetadata?: unknown;
35
+ };
36
+ export interface AnswerModelConnector {
37
+ readonly kind: 'model-turn';
38
+ readonly capabilities?: {
39
+ toolRequests: boolean;
40
+ toolFreeComposition: boolean;
41
+ opaqueContinuation: boolean;
42
+ outputTokenLimit: 'enforced' | 'requested' | 'unavailable';
43
+ usageReporting: 'reported' | 'optional' | 'unavailable';
44
+ };
45
+ /** Connectors propose calls; only the pipeline executes them. */
46
+ invoke(request: AnswerTurnRequest): Promise<AnswerTurnResult>;
47
+ }
48
+ export type ExecutableTurn = {
49
+ system?: string;
50
+ messages: ModelMessage[];
51
+ tools?: ToolSet;
52
+ toolChoice: 'auto' | 'none';
53
+ maxOutputTokens: number;
54
+ maxRetries: 0;
55
+ abortSignal?: AbortSignal;
56
+ providerOptions: {
57
+ openai: {
58
+ store: boolean;
59
+ include: string[];
60
+ reasoningEffort: string;
61
+ };
62
+ };
63
+ /** Fixed-evidence evaluation only: validate but discard unsolicited known calls. Never advertised or dispatched. */
64
+ fixedEvidenceDiscardTools?: ToolSet;
65
+ };
66
+ /** Interface admission ceiling, separate from the inherited search-batch budget. */
67
+ export declare const MAX_ANSWER_TOOL_REQUESTS_PER_TURN = 32;
68
+ export declare function invokeAnswerTurn(connector: AnswerModelConnector, request: ExecutableTurn): Promise<AnswerTurnResult>;
@@ -0,0 +1,98 @@
1
+ export { runAnswerPipeline } from './answer-pipeline.js';
2
+ export type { AnswerPipelineResult } from './answer-pipeline.js';
3
+ export { runPreparedAnswer, SIMPLE_BUDGETS, SIMPLE_MODELS, SIMPLE_EXPANDED_BUDGETS, SIMPLE_RECOVERY_BUDGETS, validateSimpleToolInput } from './portable-answer-runtime.js';
4
+ export type { SimpleModelOption } from './portable-answer-runtime.js';
5
+ export type { AnswerModelConnector, AnswerTurnRequest, AnswerTurnResult, AnswerToolRequest } from './answer-model-connector.js';
6
+ export { createNativeAnswerConnector } from './native-answer-connector.js';
7
+ export { simpleSystemPolicy, simpleToolDescription } from './server-simple-policy.js';
8
+ export { createPocToolHost } from './answer-tool-host.js';
9
+ export type { AnswerToolHostOptions } from './answer-tool-host.js';
10
+ export type { PositionAnalysisProvider, PositionAnalysisRequest, PositionAnalysisResult, PositionAnalysisLine, PositionAnalysisSegment, CompatiblePositionAnalysisProvider, LegacyPositionAnalysisProvider, LegacyPositionAnalysisResult, LegacyPositionAnalysisLine } from './position-analysis-contracts.js';
11
+ export { toPositionAnalysis, toLegacyPositionAnalysis, toPositionAnalysisProvider, toLegacyPositionAnalysisProvider } from './position-analysis-contracts.js';
12
+ export { createProductionObservationProvider } from './production-observation-provider.js';
13
+ export { validateReasoningPositionContext, reasoningContextHash, createContextEvidence, createQueryContract, DEFAULT_REASONING_RUN_CONTROLS, REASONING_POC_VERSION } from './poc-contracts.js';
14
+ export type { ReasoningPositionContext, ReasoningToolSet, ObservationProvider, ReasoningEvidenceRecord } from './poc-contracts.js';
15
+ export { captureAblationOriginalEvidenceBundle } from './ablation-evidence-capture.js';
16
+ export { createDefaultSaliencePolicy } from './poc-observations.js';
17
+ export { planInitialSearches } from './initial-search-plan.js';
18
+ export { QUESTION_ROUTING_VERSION } from './question-routing.js';
19
+ export type { QuestionRoutingDecision } from './question-routing.js';
20
+ export type { RecordedMainLine } from './answer-host-contracts.js';
21
+ export type { AnswerRoutingPreparation, AnswerSelection, AnswerHistoryPort, AnswerOpeningSession } from './answer-host-contracts.js';
22
+ export { MAX_ANSWER_TOOL_REQUESTS_PER_TURN } from './answer-model-connector.js';
23
+ export type { ReasoningToolResult } from './poc-contracts.js';
24
+ export type { ReasoningObservation } from './poc-contracts.js';
25
+ export type { ReasoningObservationSet } from './poc-contracts.js';
26
+ export type { ReasoningRankedObservationSet } from './poc-contracts.js';
27
+ export type { ReasoningToolDescriptor } from './poc-contracts.js';
28
+ export type { ReasoningToolName } from './poc-contracts.js';
29
+ export type { ModelRuntime } from './poc-contracts.js';
30
+ export type { QueryContract } from './poc-contracts.js';
31
+ export type { ReasoningRunControls } from './poc-contracts.js';
32
+ export type { ReasoningToolExecutionContext } from './poc-contracts.js';
33
+ export type { ReasoningProviderObservationSet } from './poc-contracts.js';
34
+ export { SIMPLE_MODEL_CATALOGUE } from './simple-agent-config.js';
35
+ export { simpleEffortsForModel } from './simple-agent-config.js';
36
+ export type { SimpleAgentConfig } from './simple-agent-config.js';
37
+ export { validateSimpleAgentConfig } from './simple-agent-config.js';
38
+ export type { SimpleModelId } from './simple-agent-config.js';
39
+ export type { SimpleEffort } from './simple-agent-config.js';
40
+ export { hasSharedEvidence } from './lossless-evidence-sharing.js';
41
+ export { expandSharedEvidence } from './lossless-evidence-sharing.js';
42
+ export { EVIDENCE_SHARING_VERSION } from './lossless-evidence-sharing.js';
43
+ export { shareEvidence } from './lossless-evidence-sharing.js';
44
+ export { shareEvidenceMessages } from './lossless-evidence-sharing.js';
45
+ export { PRODUCTION_OBSERVATION_PROVIDER_VERSION } from './production-observation-provider.js';
46
+ export type { SimpleToken } from './simple-prose-references.js';
47
+ export { simpleProseReferences } from './simple-prose-references.js';
48
+ export type { SimpleReference } from './simple-prose-references.js';
49
+ export type { SimplePosition } from './simple-prose-references.js';
50
+ export { safeSimpleSourceLink } from './simple-prose-references.js';
51
+ export type { FreshEnginePvWitness } from './simple-prose-references.js';
52
+ export { SIMPLE_REFERENCE_VERSION } from './simple-prose-references.js';
53
+ export { decorateSimpleVariations } from './simple-prose-references.js';
54
+ export { repairFrozenCitationLabels } from './simple-prose-references.js';
55
+ export { stripSimpleMarkdownFences } from './simple-prose-references.js';
56
+ export { stripSimpleCitationLinks } from './simple-prose-references.js';
57
+ export type { AuthoredReferenceResult } from './simple-prose-references.js';
58
+ export type { SimpleProseReferenceOptions } from './simple-prose-references.js';
59
+ export type { SimpleReferenceGapCounts } from './simple-prose-references.js';
60
+ export type { RecordedMoveAnalysis } from './answer-host-contracts.js';
61
+ export { classifyQuestionRoutingAnswers } from './question-routing.js';
62
+ export { classifyReviewSubject } from './question-routing.js';
63
+ export { makeQuestionRoutingRequest } from './question-routing.js';
64
+ export { parseQuestionRoutingAnswers } from './question-routing.js';
65
+ export { hasMoveClassificationQuestion } from './question-routing.js';
66
+ export { moveSectionScope } from './question-routing.js';
67
+ export { REVIEW_SUBJECTS } from './question-routing.js';
68
+ export { openingTitle } from './wikibooks-index.js';
69
+ export { positionKey } from './wikibooks-index.js';
70
+ export { replayWikibooksTitle } from './wikibooks-index.js';
71
+ export { selectIndexedOpening } from './wikibooks-index.js';
72
+ export type { WikibooksIndex } from './wikibooks-index.js';
73
+ export type { IndexedSelection } from './wikibooks-index.js';
74
+ export { decodeWikibooksIndex } from './wikibooks-index.js';
75
+ export type { WikibooksTarget } from './opening-source-contracts.js';
76
+ export type { WikibooksPage } from './opening-source-contracts.js';
77
+ export type { WikibooksContextResult } from './opening-source-contracts.js';
78
+ export type { WikibooksPlan } from './opening-source-contracts.js';
79
+ export { MAX_INTERACTIVE_LINE_PLIES } from './reference-limits.js';
80
+ export { parseOpeningSourceCredits } from './opening-source-credits.js';
81
+ export type { OpeningSourceCredit } from './opening-source-credits.js';
82
+ export { openingSourceLinks } from './opening-source-credits.js';
83
+ export { OPENING_SOURCE_LICENSE_URL } from './opening-source-credits.js';
84
+ export { openingSourcesInMessages } from './opening-source-credits.js';
85
+ export type { RecordedReferenceLine } from './historical-prose.js';
86
+ export { admitFreshEnginePvWitnesses } from './fresh-engine-pv-witnesses.js';
87
+ export type { FreshEnginePvAdmissionAudit } from './fresh-engine-pv-witnesses.js';
88
+ export { MAX_FRESH_ENGINE_WITNESS_ACQUISITIONS } from './fresh-engine-pv-witnesses.js';
89
+ export { SIMPLE_TOOL_AGENT_VERSION } from './simple-runtime-version.js';
90
+ export { recordedMainLineResult } from './recorded-main-line.js';
91
+ export { classificationTargetAtSelection } from './classification-question-target.js';
92
+ export { scopePositionAnalysis } from './position-analysis-scope.js';
93
+ export { priorConversationMessages } from './conversation-context.js';
94
+ export type { PriorConversationMessage } from './conversation-context.js';
95
+ export { emitObservableTrace } from './ai-sdk-runtime-support.js';
96
+ export type { ObservableLlmTraceSink, ObservableLlmTraceEvent, SanitizedHttpAttempt } from './ai-sdk-runtime-support.js';
97
+ export { selectSimpleModel } from './simple-agent-config.js';
98
+ export { recordedNavigation } from './recorded-reference-context.js';
@@ -0,0 +1,41 @@
1
+ import type { AnswerRoutingPreparation, AnswerSelection, AnswerHistoryPort, AnswerOpeningSession } from './answer-host-contracts.js';
2
+ import type { PriorConversationMessage } from "./conversation-context.js";
3
+ import type { SimpleAgentConfig } from "./simple-agent-config.js";
4
+ import { type CompatiblePositionAnalysisProvider } from "./position-analysis-contracts.js";
5
+ import type { ObservationProvider } from "./poc-contracts.js";
6
+ import type { AnswerModelConnector } from "./answer-model-connector.js";
7
+ import type { WikibooksIndex } from "./wikibooks-index.js";
8
+ import { type ObservableLlmTraceSink } from "./ai-sdk-runtime-support.js";
9
+ import { runPreparedAnswer } from "./portable-answer-runtime.js";
10
+ import type { PlayerPerspective } from "../player-perspective.js";
11
+ export type AnswerPipelineResult = Awaited<ReturnType<typeof runPreparedAnswer>> & {
12
+ arm: "Simple";
13
+ bundleHash: string;
14
+ };
15
+ export declare function runAnswerPipeline(input: {
16
+ connector: AnswerModelConnector;
17
+ policy?: Parameters<typeof runPreparedAnswer>[0]["policy"];
18
+ modelName?: string;
19
+ providerRoute?: string;
20
+ analyzer?: CompatiblePositionAnalysisProvider;
21
+ /** Optional analyzer for ordinary opponent preparation; later model tools still use analyzer. */
22
+ preparationAnalyzer?: CompatiblePositionAnalysisProvider;
23
+ /** Opt in only when the host can safely serve overlapping preparation and classification searches. */
24
+ parallelPreparation?: boolean;
25
+ observationProvider: ObservationProvider;
26
+ prepareRouting: () => Promise<AnswerRoutingPreparation>;
27
+ openingSession?: AnswerOpeningSession;
28
+ openingIndex?: () => Promise<WikibooksIndex>;
29
+ routingPreparation?: AnswerRoutingPreparation;
30
+ conversationHistory?: readonly PriorConversationMessage[];
31
+ simpleConfig?: SimpleAgentConfig;
32
+ simpleAllowance?: "default" | "expanded" | "glm-recovery";
33
+ requestId: string;
34
+ question: string;
35
+ playerPerspective?: PlayerPerspective | null;
36
+ selected: AnswerSelection;
37
+ bridge?: AnswerHistoryPort;
38
+ signal?: AbortSignal;
39
+ observableTraceSink?: ObservableLlmTraceSink;
40
+ onProgress?: (message: string) => void;
41
+ }): Promise<AnswerPipelineResult>;
@@ -0,0 +1,40 @@
1
+ import type { RecordedReferenceLine } from './historical-prose.js';
2
+ import type { ReasoningPositionContext, ReasoningEvidenceRecord } from './poc-contracts.js';
3
+ /** Deterministic presentation repair, never new analytical evidence. */
4
+ export declare function validateAnswerReferences(answer: string, context: ReasoningPositionContext, records: readonly ReasoningEvidenceRecord[], recordedLine?: RecordedReferenceLine): {
5
+ answer: string;
6
+ referenceValidation: {
7
+ version: string;
8
+ citationRepairs: {
9
+ originalId: string;
10
+ canonicalId: string;
11
+ }[];
12
+ interactionCoverage: {
13
+ resolved: number;
14
+ total: number;
15
+ };
16
+ unresolvedReferences: string[];
17
+ unboundMentions: string[];
18
+ notationCorrections: string[];
19
+ labelCorrections: {
20
+ originalLabel: string;
21
+ canonicalLabel: string;
22
+ target: string;
23
+ }[];
24
+ gameReferences: {
25
+ target: string;
26
+ status: "resolved" | "repaired" | "unresolved";
27
+ reason?: string;
28
+ }[];
29
+ repairs: {
30
+ originalTarget: string;
31
+ repairedTarget: string;
32
+ label: string;
33
+ evidenceIds: string[];
34
+ authority: string;
35
+ }[];
36
+ causalClaimChecks: import("./causal-claim-checks.js").CausalClaimCheck[];
37
+ causalClaimCheckStatus: "unavailable" | "completed";
38
+ causalClaimCheckScope: string;
39
+ };
40
+ };
@@ -0,0 +1,8 @@
1
+ import { type PocToolHostOptions } from './poc-tools.js';
2
+ import type { ReasoningPositionContext } from './poc-contracts.js';
3
+ import { type CompatiblePositionAnalysisProvider } from './position-analysis-contracts.js';
4
+ export type AnswerToolHostOptions = Omit<PocToolHostOptions, 'analyzer'> & {
5
+ analyzer?: CompatiblePositionAnalysisProvider;
6
+ };
7
+ /** Public analyzer contract; the existing evidence protocol retains its versioned legacy spelling. */
8
+ export declare function createPocToolHost(context: ReasoningPositionContext, options?: AnswerToolHostOptions): import("./poc-contracts.js").ReasoningToolSet;
@@ -0,0 +1,13 @@
1
+ import type { BranchExpansionConfig } from './branch-expansion.js';
2
+ import type { InitialSearchPlan } from './initial-search-plan.js';
3
+ import type { ReasoningPositionContext, ReasoningToolSet } from './poc-contracts.js';
4
+ export type BranchExpansionMode = 'off' | 'preparation' | 'tools' | 'both';
5
+ export declare const BRANCH_EXPANSION_OPTIONS: BranchExpansionConfig;
6
+ export declare const DEFAULT_BRANCH_EXPANSION_MODE: BranchExpansionMode;
7
+ /** Add a registered actual-after search without replacing hypothetical eager leads.
8
+ * Selected-context retention is the authority; omitted historical questions must
9
+ * acquire their explicit root through ordinary tools. No natural-language guesses. */
10
+ export declare function withBranchPreparation(plan: InitialSearchPlan, context: ReasoningPositionContext, omitSelectedContext: boolean, mode: BranchExpansionMode): InitialSearchPlan;
11
+ /** Both hosts keep the same contracts. Only internally generated initial calls
12
+ * select the preparation arm; user/model tool schemas cannot alter this setting. */
13
+ export declare function selectBranchHost(ordinary: ReasoningToolSet, expanded: ReasoningToolSet, mode: BranchExpansionMode): ReasoningToolSet;
@@ -0,0 +1,39 @@
1
+ import type { PositionAnalysisLine } from './poc-tools.js';
2
+ export type BranchExpansionConfig = {
3
+ maxNodes: number;
4
+ maxPlies: number;
5
+ maxLines: number;
6
+ depthFloor: number;
7
+ depthMode: 'fixed' | 'decreasing';
8
+ maxElapsedMs?: number;
9
+ };
10
+ export type BranchNode<T> = {
11
+ prefix: string[];
12
+ finalFen: string;
13
+ analysis: T;
14
+ };
15
+ export type BranchExpansionResult<T> = {
16
+ nodes: BranchNode<T>[];
17
+ summary: {
18
+ requestedNodes: number;
19
+ searchedNodes: number;
20
+ returnedNodes: number;
21
+ skippedDuplicate: number;
22
+ skippedInvalid: number;
23
+ failedNodes: number;
24
+ stopped: 'complete' | 'node-limit' | 'elapsed-limit';
25
+ scope: string;
26
+ };
27
+ };
28
+ /** Only the original PVs are traversed. New alternatives are retained, never
29
+ * recursively scheduled. Each node is an independent FEN-root search. */
30
+ export declare function expandPrincipalBranches<T extends {
31
+ lines: PositionAnalysisLine[];
32
+ }>(input: {
33
+ rootFen: string;
34
+ lines: readonly PositionAnalysisLine[];
35
+ parentDepth: number;
36
+ config: BranchExpansionConfig;
37
+ signal?: AbortSignal;
38
+ search: (fen: string, depth: number) => Promise<T | null>;
39
+ }): Promise<BranchExpansionResult<T>>;
@@ -0,0 +1,21 @@
1
+ import { type RecordedReferenceLine } from './historical-prose.js';
2
+ import type { ReasoningEvidenceRecord, ReasoningPositionContext } from './poc-contracts.js';
3
+ export type CausalClaimCheck = {
4
+ claim: string;
5
+ /** Half-open UTF-16 offsets into the final reference-repaired answer. */
6
+ claimRange: {
7
+ start: number;
8
+ end: number;
9
+ };
10
+ sentenceContext: {
11
+ text: string;
12
+ start: number;
13
+ end: number;
14
+ };
15
+ reference: string;
16
+ predicate: 'moving-piece-escape' | 'stationary-slider-ray' | 'square-control-release';
17
+ verdict: 'supported' | 'contradicted' | 'unresolved';
18
+ reason: string;
19
+ };
20
+ /** Bounded geometry diagnostics only. No answer modification, strategic judgment or intent inference. */
21
+ export declare function checkCausalClaims(answer: string, context: ReasoningPositionContext, records: readonly ReasoningEvidenceRecord[], recordedLine?: RecordedReferenceLine): CausalClaimCheck[];
@@ -0,0 +1,13 @@
1
+ /** Stable, position-independent geometry. a1 is dark, regardless of orientation. */
2
+ export type SquareColor = 'light' | 'dark';
3
+ export declare function chessSquareColor(square: string): SquareColor | null;
4
+ /** Grouping is a complete square->colour dictionary without 64 repeated keys. */
5
+ export declare const CHESS_REFERENCE_DICTIONARY: Readonly<{
6
+ version: "square-colors-v1";
7
+ scope: "Position-independent square colors; not piece ownership or a position assessment.";
8
+ squareColors: Readonly<{
9
+ light: readonly string[];
10
+ dark: readonly string[];
11
+ }>;
12
+ use: "A bishop occupies squares of its color complex. Identify the bishop and the relevant position before applying this reference; do not infer which bishop a move frees from square colors alone.";
13
+ }>;
@@ -0,0 +1,22 @@
1
+ import type { ReasoningPositionContext } from './poc-contracts.js';
2
+ import { type QuestionRoutingDecision } from './question-routing.js';
3
+ /** Question-only notation extraction; these are references, not verified moves. */
4
+ export declare function classificationQuestionMoveReferences(question: string): {
5
+ san: string;
6
+ moveNumber: number | null;
7
+ color: string | null;
8
+ }[];
9
+ /** Resolve wording against frozen context AFTER Jev; never change board selection. */
10
+ export declare function classificationTargetAtSelection(decision: QuestionRoutingDecision, question: string, context: ReasoningPositionContext): {
11
+ applies: boolean;
12
+ resolution: string;
13
+ references?: undefined;
14
+ } | {
15
+ applies: boolean;
16
+ resolution: string;
17
+ references: {
18
+ san: string;
19
+ moveNumber: number | null;
20
+ color: string | null;
21
+ }[];
22
+ };
@@ -0,0 +1,31 @@
1
+ import type { SimpleBoardAnalysis } from './simple-board-analysis.js';
2
+ /** Preserve decision provenance without repeating the full board-analysis snapshots. */
3
+ export declare function classificationReassessment(previous: SimpleBoardAnalysis | undefined, current: SimpleBoardAnalysis | undefined): {
4
+ limitation: string;
5
+ current?: {
6
+ role: "previous-analysis" | "current-analysis";
7
+ evidenceId: string;
8
+ classification: string | null;
9
+ lossCp: number | null;
10
+ recordedRequestedDepth: number | null;
11
+ beforeDepth: number | null;
12
+ afterDepth: number | null;
13
+ } | undefined;
14
+ previous?: {
15
+ recordedReason?: {} | null | undefined;
16
+ superseded?: boolean | undefined;
17
+ supersededBy?: string | undefined;
18
+ role: "previous-analysis" | "current-analysis";
19
+ evidenceId: string;
20
+ classification: string | null;
21
+ lossCp: number | null;
22
+ recordedRequestedDepth: number | null;
23
+ beforeDepth: number | null;
24
+ afterDepth: number | null;
25
+ } | undefined;
26
+ version: string;
27
+ status: string;
28
+ labelChanged: boolean;
29
+ preparationRequestedDepth: number;
30
+ };
31
+ export declare const CLASSIFICATION_REASSESSMENT_GUIDANCE = "For questions that include the selected move's classification, Knight's Eye may prepare a deeper before-position search and refresh the board's canonical classification before answering. classificationReassessment contains compact decision summaries: the current full analysis is in boardAnalysis; previous is an attributed historical summary, superseded only for a matching current context. retrieve_evidence with the previous evidenceId restores omitted historical details when needed. preparationRequestedDepth names the preparation request, not the recorded depth of either decision. When classificationReassessment.status is changed and labelChanged is true, acknowledge the change explicitly in first-person Knight's Eye language, for example: \u201CI had a better look at this move and changed its classification from Great to Best because \u2026\u201D. Use the previous recordedReason and the current boardAnalysis decision details to explain the supported reason. Distinguish why we originally assigned the old label from why the refreshed decision differs; do not defend an outdated label as the current one. A changed score with an unchanged label is not a classification change. If the original or current decision, its reason, or the search is unavailable, state the material uncertainty and never invent a change or explanation. A recorded candidate-gap flag is a bounded policy signal, not proof that only one move preserves a favorable position.";
@@ -0,0 +1,7 @@
1
+ import type { MaterialFormat } from './material-format.js';
2
+ import type { ReasoningEvidenceRecord, ReasoningToolResult } from './poc-contracts.js';
3
+ /** The initial projection must not silently discard a new engine field. */
4
+ export declare function compactSearchRecord(record: ReasoningEvidenceRecord, playedMove?: string): ReasoningEvidenceRecord | null;
5
+ /** Only automatic preparation is thinned. The caller keeps the original tool
6
+ * result in its evidence ledger and observable trace for retrieval/replay. */
7
+ export declare function compactPreparedSearchResult(result: ReasoningToolResult, playedMove?: string, format?: MaterialFormat): unknown;
@@ -0,0 +1,99 @@
1
+ import type { ConceptKey, RegistryKey, SemanticCandidate, SemanticEntity, SemanticParticipant, SemanticValue } from "./types.js";
2
+ export declare const ENTITY_TYPES: {
3
+ readonly IDEA: "idea";
4
+ readonly PLAN: "plan";
5
+ readonly ROLE: "role-assignment";
6
+ readonly CONDITION: "condition";
7
+ readonly TRANSFORMATION: "transformation";
8
+ readonly OUTCOME: "outcome";
9
+ };
10
+ export declare const REFERENCE_DOMAINS: {
11
+ readonly PIECE: "piece";
12
+ readonly SQUARE: "square";
13
+ readonly MOVE: "move";
14
+ readonly POSITION: "position";
15
+ readonly OUTCOME: "outcome";
16
+ readonly ENTITY: "entity";
17
+ };
18
+ export declare const PARTICIPANT_ROLES: {
19
+ readonly ACTOR: "actor";
20
+ readonly SUBJECT: "subject";
21
+ readonly TARGET: "target";
22
+ readonly GOAL: "goal";
23
+ readonly RESOURCE: "resource";
24
+ readonly DEFENDER: "defender";
25
+ readonly DESTINATION: "destination";
26
+ };
27
+ export declare const ATTRIBUTE_KEYS: {
28
+ readonly ACCEPTING_MOVES: "acceptingMoves";
29
+ readonly PROPOSAL_REASONS: "proposalReasons";
30
+ readonly DESCRIPTION: "description";
31
+ readonly CONFIDENCE_NOTE: "confidenceNote";
32
+ };
33
+ export declare const RELATION_TYPES: {
34
+ readonly SUPPORTS: "supports";
35
+ readonly COMPETES: "competes";
36
+ readonly DERIVES: "derives";
37
+ readonly SPLITS: "splits";
38
+ readonly CONVERGES: "converges";
39
+ readonly ENABLES: "enables";
40
+ readonly REQUIRES: "requires";
41
+ readonly REFUTES: "refutes";
42
+ readonly EXPLAINS: "explains";
43
+ readonly TRANSFORMS: "transforms";
44
+ };
45
+ /**
46
+ * These are registry values, not members of the entity schema. New concepts
47
+ * may be registered without changing `SemanticCandidate` or `SemanticEntity`.
48
+ */
49
+ export declare const CONCEPT_KEYS: {
50
+ readonly OFFER: "material.offer";
51
+ readonly MATERIAL_CLAIM: "material.claim";
52
+ readonly FORK: "tactic.fork";
53
+ readonly TRAPPED_TARGET: "tactic.trapped-target";
54
+ readonly PROMOTION: "tactic.promotion";
55
+ readonly MATING_ATTACK: "attack.mating";
56
+ readonly PERPETUAL_CHECK: "attack.perpetual-check";
57
+ readonly POSITIONAL_CLAIM: "position.claim";
58
+ readonly KING_ATTACK_PLAN: "plan.king-attack";
59
+ readonly PIECE_ROLE: "role.piece-function";
60
+ readonly CHANGED_CONSTRAINT: "condition.changed-constraint";
61
+ readonly POSITIONAL_TRANSFORMATION: "position.transformation";
62
+ };
63
+ export type CaptureActor = "owner" | "opponent" | "either";
64
+ export type ConceptLifecycle = {
65
+ initialState: RegistryKey;
66
+ retainedState: RegistryKey;
67
+ terminalStates: RegistryKey[];
68
+ trackedParticipantRole?: RegistryKey;
69
+ expireWhenTrackedUnavailable?: boolean;
70
+ onTrackedCapture?: {
71
+ capturedBy: CaptureActor;
72
+ matchingState: RegistryKey;
73
+ matchingAnnotation: RegistryKey;
74
+ otherState: RegistryKey;
75
+ otherAnnotation: RegistryKey;
76
+ };
77
+ };
78
+ export type ConceptDefinition = {
79
+ key: ConceptKey;
80
+ label: string;
81
+ category: RegistryKey;
82
+ description: string;
83
+ defaultEntityType: RegistryKey;
84
+ acceptancePolicy?: RegistryKey;
85
+ lifecycle?: ConceptLifecycle;
86
+ };
87
+ export type ConceptRegistry = Readonly<Record<ConceptKey, Readonly<ConceptDefinition>>>;
88
+ export declare function createConceptRegistry(definitions: ConceptDefinition[]): ConceptRegistry;
89
+ export declare function extendConceptRegistry(registry: ConceptRegistry, definitions: ConceptDefinition[]): ConceptRegistry;
90
+ export declare function conceptDefinition(registry: ConceptRegistry, key: ConceptKey): Readonly<ConceptDefinition> | null;
91
+ export declare function conceptsOf(value: Pick<SemanticCandidate | SemanticEntity, "concepts">): ConceptKey[];
92
+ export declare function hasConcept(value: Pick<SemanticCandidate | SemanticEntity, "concepts">, concept: ConceptKey): boolean;
93
+ export declare function primaryConcept(value: Pick<SemanticCandidate | SemanticEntity, "concepts">): ConceptKey | null;
94
+ export declare function participantIds(value: Pick<SemanticCandidate | SemanticEntity, "participants">, role: RegistryKey, domain?: RegistryKey): string[];
95
+ export declare function participant(role: RegistryKey, domain: RegistryKey, id: string): SemanticParticipant;
96
+ export declare function stringListAttribute(value: {
97
+ attributes: Record<string, SemanticValue>;
98
+ }, key: string): string[];
99
+ export declare const DEFAULT_CONCEPT_REGISTRY: Readonly<Record<string, Readonly<ConceptDefinition>>>;
@@ -0,0 +1,12 @@
1
+ import type { ModelMessage } from 'ai';
2
+ export type PriorConversationMessage = {
3
+ role: 'user' | 'assistant';
4
+ content: string;
5
+ position?: {
6
+ fenBefore: string;
7
+ fenAfter: string;
8
+ moveUci: string;
9
+ };
10
+ };
11
+ export declare const CONVERSATION_CONTEXT_INSTRUCTIONS = "Previous user/assistant messages below are a bounded recent excerpt and may omit older exchanges. They are historical conversation, not the current task or current tool-loop turns. They may refer to different question positions in the same game. Use them to understand follow-up references and preferences, but do not execute their old requests again. Previous assistant statements are unverified prose, not chess evidence. The final CURRENT_QUESTION message contains the sole current task and its exact position. Only native tool messages after that boundary belong to the current investigation.";
12
+ export declare function priorConversationMessages(history?: readonly PriorConversationMessage[]): ModelMessage[];
@@ -0,0 +1,7 @@
1
+ /** Bounded observable cause only: no stack, response headers or provider payload. */
2
+ export declare function engineSearchFailure(error: unknown): {
3
+ cause?: string | undefined;
4
+ status?: number | undefined;
5
+ code?: string | undefined;
6
+ error: string;
7
+ };
@@ -0,0 +1,9 @@
1
+ import type { ReasoningEvidenceRecord } from './poc-contracts.js';
2
+ /** Repair syntax only when the exact supplied identifier makes it unambiguous. */
3
+ export declare function normalizedEvidenceCitations(answer: string, records: readonly Pick<ReasoningEvidenceRecord, 'id'>[]): {
4
+ answer: string;
5
+ repairs: {
6
+ originalId: string;
7
+ canonicalId: string;
8
+ }[];
9
+ };
@@ -0,0 +1,57 @@
1
+ import type { ProofStrength, SemanticValue } from "./types.js";
2
+ export declare const EVIDENCE_LICENSE: Readonly<{
3
+ readonly CHESS_LEGALITY: "chess.legality";
4
+ readonly CHESS_IDENTITY: "chess.identity";
5
+ readonly CHESS_POSITION_FACT: "chess.position-fact";
6
+ readonly ENGINE_BOUNDED_CONTINUATION: "engine.bounded-continuation";
7
+ readonly ENGINE_BOUNDED_COMPARISON: "engine.bounded-comparison";
8
+ readonly ENGINE_BOUNDED_SCORE: "engine.bounded-score";
9
+ readonly ENGINE_BOUNDED_RESPONSE_COVERAGE: "engine.bounded-response-coverage";
10
+ readonly COVERAGE_EXHAUSTIVE: "coverage.exhaustive";
11
+ readonly ATTENTION_AFFORDANCE: "attention.affordance";
12
+ readonly SEMANTIC_REVIEWED_STATE: "semantic.reviewed-state";
13
+ readonly WORKFLOW_AUDIT: "workflow.audit";
14
+ }>;
15
+ export type EvidenceLicense = typeof EVIDENCE_LICENSE[keyof typeof EVIDENCE_LICENSE];
16
+ export type EvidenceLicenseInput = {
17
+ kind: string;
18
+ source: string;
19
+ authority: string | null;
20
+ proofStrength: ProofStrength | null;
21
+ data: Record<string, SemanticValue>;
22
+ coverage: {
23
+ complete: boolean;
24
+ covered: string[];
25
+ unresolved: string[];
26
+ } | null;
27
+ replay: Record<string, SemanticValue> | null;
28
+ };
29
+ export type LicensableEvidenceRecord = {
30
+ kind: string;
31
+ source: string;
32
+ proofStrength: ProofStrength | null;
33
+ licenses?: EvidenceLicense[];
34
+ data: Record<string, SemanticValue>;
35
+ coverage: {
36
+ complete: boolean;
37
+ covered: string[];
38
+ unresolved: string[];
39
+ } | null;
40
+ replay: Record<string, SemanticValue> | null;
41
+ };
42
+ export declare function evidenceLicenseInput(record: LicensableEvidenceRecord): EvidenceLicenseInput;
43
+ /**
44
+ * Central maximum-license policy. A producer may claim any subset of these
45
+ * values, but no producer can broaden its source by adding a license.
46
+ */
47
+ export declare function maximumEvidenceLicenses(input: EvidenceLicenseInput): EvidenceLicense[];
48
+ export declare function validateEvidenceLicenseClaims(input: EvidenceLicenseInput, claimed: readonly unknown[]): EvidenceLicense[];
49
+ export declare function effectiveEvidenceLicenses(input: EvidenceLicenseInput & {
50
+ licenses?: readonly unknown[];
51
+ }): EvidenceLicense[];
52
+ export declare function effectiveLicensesForRecord(record: LicensableEvidenceRecord): EvidenceLicense[];
53
+ export declare function withEvidenceLicenses<T extends LicensableEvidenceRecord>(record: T): T & {
54
+ licenses: EvidenceLicense[];
55
+ };
56
+ export declare function licensesSemanticChessGrounding(licenses: readonly EvidenceLicense[]): boolean;
57
+ export declare function licensesBoundedRouteRelevance(licenses: readonly EvidenceLicense[]): boolean;
@@ -0,0 +1,5 @@
1
+ export type LeanDirectEvidenceSelector = Readonly<{
2
+ id: string;
3
+ factKinds?: readonly string[];
4
+ observationTypes?: readonly string[];
5
+ }>;