kiokuko-dsh 0.2.16 → 0.2.18
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/PERMISSIONS.md +11 -0
- package/README.ja.md +2 -0
- package/README.ko.md +2 -0
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/deep-thinker/core/contracts.d.ts +5 -5
- package/dist/deep-thinker/memory-finalizer.d.ts +1 -1
- package/dist/deep-thinker/store.d.ts +1 -1
- package/dist/dsh/coding-workflow/host.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/host.js +7 -6
- package/dist/dsh/coding-workflow/host.js.map +1 -1
- package/dist/dsh/coding-workflow/intent.js +1 -1
- package/dist/dsh/coding-workflow/intent.js.map +1 -1
- package/dist/dsh/coding-workflow/service.js +2 -2
- package/dist/dsh/coding-workflow/service.js.map +1 -1
- package/dist/dsh/composition.js +1 -1
- package/dist/dsh/composition.js.map +1 -1
- package/dist/dsh/config.d.ts +8 -1
- package/dist/dsh/config.d.ts.map +1 -1
- package/dist/dsh/core/host.d.ts +7 -0
- package/dist/dsh/core/host.d.ts.map +1 -1
- package/dist/dsh/core/host.js +21 -1
- package/dist/dsh/core/host.js.map +1 -1
- package/dist/dsh/core/index.d.ts +20 -0
- package/dist/dsh/core/index.d.ts.map +1 -1
- package/dist/dsh/core/tasks.d.ts +3 -1
- package/dist/dsh/core/tasks.d.ts.map +1 -1
- package/dist/dsh/core/tasks.js +29 -6
- package/dist/dsh/core/tasks.js.map +1 -1
- package/dist/dsh/correction-context.d.ts +54 -0
- package/dist/dsh/correction-context.d.ts.map +1 -0
- package/dist/dsh/correction-context.js +70 -0
- package/dist/dsh/correction-context.js.map +1 -0
- package/dist/dsh/correction-decision.d.ts +38 -0
- package/dist/dsh/correction-decision.d.ts.map +1 -0
- package/dist/dsh/correction-decision.js +71 -0
- package/dist/dsh/correction-decision.js.map +1 -0
- package/dist/dsh/decisions/config.d.ts +7 -0
- package/dist/dsh/decisions/config.d.ts.map +1 -1
- package/dist/dsh/decisions/config.js +1 -0
- package/dist/dsh/decisions/config.js.map +1 -1
- package/dist/dsh/decisions/contracts.d.ts +2 -0
- package/dist/dsh/decisions/contracts.d.ts.map +1 -1
- package/dist/dsh/decisions/contracts.js +1 -1
- package/dist/dsh/decisions/contracts.js.map +1 -1
- package/dist/dsh/decisions/correction.d.ts +9 -0
- package/dist/dsh/decisions/correction.d.ts.map +1 -0
- package/dist/dsh/decisions/correction.js +15 -0
- package/dist/dsh/decisions/correction.js.map +1 -0
- package/dist/dsh/decisions/diagnostic-correlation.d.ts +3 -0
- package/dist/dsh/decisions/diagnostic-correlation.d.ts.map +1 -0
- package/dist/dsh/decisions/diagnostic-correlation.js +7 -0
- package/dist/dsh/decisions/diagnostic-correlation.js.map +1 -0
- package/dist/dsh/decisions/diagnostics.d.ts +513 -0
- package/dist/dsh/decisions/diagnostics.d.ts.map +1 -0
- package/dist/dsh/decisions/diagnostics.js +389 -0
- package/dist/dsh/decisions/diagnostics.js.map +1 -0
- package/dist/dsh/decisions/host.d.ts +2 -1
- package/dist/dsh/decisions/host.d.ts.map +1 -1
- package/dist/dsh/decisions/host.js +18 -5
- package/dist/dsh/decisions/host.js.map +1 -1
- package/dist/dsh/decisions/intent-assessment.d.ts +20 -0
- package/dist/dsh/decisions/intent-assessment.d.ts.map +1 -0
- package/dist/dsh/decisions/intent-assessment.js +104 -0
- package/dist/dsh/decisions/intent-assessment.js.map +1 -0
- package/dist/dsh/decisions/message-refs.d.ts +6 -0
- package/dist/dsh/decisions/message-refs.d.ts.map +1 -0
- package/dist/dsh/decisions/message-refs.js +16 -0
- package/dist/dsh/decisions/message-refs.js.map +1 -0
- package/dist/dsh/decisions/micro-judge.d.ts +58 -0
- package/dist/dsh/decisions/micro-judge.d.ts.map +1 -0
- package/dist/dsh/decisions/micro-judge.js +160 -0
- package/dist/dsh/decisions/micro-judge.js.map +1 -0
- package/dist/dsh/decisions/request-intent.d.ts +1 -2
- package/dist/dsh/decisions/request-intent.d.ts.map +1 -1
- package/dist/dsh/decisions/request-intent.js +16 -18
- package/dist/dsh/decisions/request-intent.js.map +1 -1
- package/dist/dsh/decisions/service.d.ts +11 -1
- package/dist/dsh/decisions/service.d.ts.map +1 -1
- package/dist/dsh/decisions/service.js +54 -8
- package/dist/dsh/decisions/service.js.map +1 -1
- package/dist/dsh/execution-command.d.ts +12 -1
- package/dist/dsh/execution-command.d.ts.map +1 -1
- package/dist/dsh/execution-command.js +54 -6
- package/dist/dsh/execution-command.js.map +1 -1
- package/dist/dsh/execution-selection.d.ts +5 -5
- package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
- package/dist/dsh/host-adapter/admission.js +3 -0
- package/dist/dsh/host-adapter/admission.js.map +1 -1
- package/dist/dsh/host-adapter/context.d.ts +5 -1
- package/dist/dsh/host-adapter/context.d.ts.map +1 -1
- package/dist/dsh/host-adapter/context.js +16 -1
- package/dist/dsh/host-adapter/context.js.map +1 -1
- package/dist/dsh/host-adapter/memory-application-host.d.ts +2 -0
- package/dist/dsh/host-adapter/memory-application-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/memory-application-host.js +3 -1
- package/dist/dsh/host-adapter/memory-application-host.js.map +1 -1
- package/dist/dsh/host-adapter/routing.d.ts.map +1 -1
- package/dist/dsh/host-adapter/routing.js +13 -0
- package/dist/dsh/host-adapter/routing.js.map +1 -1
- package/dist/dsh/host-adapter.d.ts.map +1 -1
- package/dist/dsh/host-adapter.js +6 -1
- package/dist/dsh/host-adapter.js.map +1 -1
- package/dist/dsh/index.d.ts +8 -2
- package/dist/dsh/index.d.ts.map +1 -1
- package/dist/dsh/lisp/surface.js +1 -1
- package/dist/dsh/lisp/surface.js.map +1 -1
- package/dist/dsh/memory-application.d.ts +7 -2
- package/dist/dsh/memory-application.d.ts.map +1 -1
- package/dist/dsh/memory-application.js +92 -2
- package/dist/dsh/memory-application.js.map +1 -1
- package/dist/dsh/model-configuration.d.ts +6 -6
- package/dist/dsh/models/vendor/opencode-adapter.d.ts.map +1 -1
- package/dist/dsh/models/vendor/opencode-adapter.js +67 -2
- package/dist/dsh/models/vendor/opencode-adapter.js.map +1 -1
- package/dist/dsh/modules/enno.d.ts +1 -1
- package/dist/dsh/native-task-authority.d.ts +1 -0
- package/dist/dsh/native-task-authority.d.ts.map +1 -1
- package/dist/dsh/native-task-authority.js +74 -50
- package/dist/dsh/native-task-authority.js.map +1 -1
- package/dist/dsh/on-demand-intake.d.ts +10 -0
- package/dist/dsh/on-demand-intake.d.ts.map +1 -1
- package/dist/dsh/on-demand-intake.js +63 -9
- package/dist/dsh/on-demand-intake.js.map +1 -1
- package/dist/dsh/task-completion.js +5 -5
- package/dist/dsh/task-completion.js.map +1 -1
- package/dist/dsh/task-intake.d.ts +1 -0
- package/dist/dsh/task-intake.d.ts.map +1 -1
- package/dist/dsh/task-intake.js.map +1 -1
- package/dist/dsh/task-state.d.ts.map +1 -1
- package/dist/dsh/task-state.js +4 -0
- package/dist/dsh/task-state.js.map +1 -1
- package/dist/dsh/tools.d.ts +1 -1
- package/dist/dsh/tools.d.ts.map +1 -1
- package/dist/dsh/tools.js +63 -35
- package/dist/dsh/tools.js.map +1 -1
- package/dist/dsh/turn-process.d.ts.map +1 -1
- package/dist/dsh/turn-process.js +3 -0
- package/dist/dsh/turn-process.js.map +1 -1
- package/dist/enno-oduno/store.d.ts.map +1 -1
- package/dist/enno-oduno/store.js +2 -0
- package/dist/enno-oduno/store.js.map +1 -1
- package/dist/locale/en.json +1 -1
- package/dist/locale/ja.json +1 -1
- package/dist/locale/ko.json +1 -1
- package/dist/locale/zh-CN.json +1 -1
- package/dist/memory/application.d.ts.map +1 -1
- package/dist/memory/application.js +3 -2
- package/dist/memory/application.js.map +1 -1
- package/dist/memory/correction-classification.d.ts +47 -0
- package/dist/memory/correction-classification.d.ts.map +1 -0
- package/dist/memory/correction-classification.js +143 -0
- package/dist/memory/correction-classification.js.map +1 -0
- package/dist/memory/correction-contract.d.ts +136 -0
- package/dist/memory/correction-contract.d.ts.map +1 -0
- package/dist/memory/correction-contract.js +42 -0
- package/dist/memory/correction-contract.js.map +1 -0
- package/dist/memory/lifecycle.d.ts +1 -1
- package/docs/coding-workflow.md +1 -1
- package/docs/correction-classification.md +122 -0
- package/docs/decision-diagnostics.md +60 -0
- package/docs/dsh-plugin.md +42 -0
- package/docs/evaluations/correction-classification-2026-10-21/assessment.json +717 -0
- package/docs/evaluations/correction-classification-2026-10-21/built-both-product-pair.log +14 -0
- package/docs/evaluations/correction-classification-2026-10-21/development.json +877 -0
- package/docs/evaluations/correction-classification-2026-10-21/dsh-build.log +9 -0
- package/docs/evaluations/correction-classification-2026-10-21/dsh-final-2-typecheck.log +0 -0
- package/docs/evaluations/correction-classification-2026-10-21/dsh-final-2-unit.log +43 -0
- package/docs/evaluations/correction-classification-2026-10-21/dsh-final-3-typecheck.log +0 -0
- package/docs/evaluations/correction-classification-2026-10-21/held-out.json +2671 -0
- package/docs/evaluations/correction-classification-2026-10-21/live-mcp-final-2.json +32 -0
- package/docs/evaluations/correction-classification-2026-10-21/live-mcp-final-2.log +1 -0
- package/docs/evaluations/correction-classification-2026-10-21/live-mcp-final.json +32 -0
- package/docs/evaluations/correction-classification-2026-10-21/main-build.log +17 -0
- package/docs/evaluations/correction-classification-2026-10-21/main-final-2-typecheck.log +0 -0
- package/docs/evaluations/correction-classification-2026-10-21/main-final-2-unit.log +64 -0
- package/docs/evaluations/correction-classification-2026-10-21/metrics-final.log +11 -0
- package/docs/evaluations/correction-classification-2026-10-21/native-final.log +57 -0
- package/docs/evaluations/correction-classification-2026-10-21/package-evidence.json +51 -0
- package/docs/evaluations/correction-classification-2026-10-21/timing-final.json +53 -0
- package/docs/evaluations/correction-classification-2026-10-21/verification.json +199 -0
- package/docs/guardrail.md +3 -3
- package/docs/harness-map.md +2 -0
- package/docs/micro-judge.md +34 -0
- package/guardrail/manifest.json +0 -22
- package/micro-judge/darwin-arm64/kiokuko-micro-judge +0 -0
- package/micro-judge/licenses/COPYRIGHT-Rust-1.85.0.txt +384 -0
- package/micro-judge/licenses/LICENSE-APACHE +176 -0
- package/micro-judge/licenses/LICENSE-MIT +23 -0
- package/micro-judge/licenses/manifest.json +5 -0
- package/micro-judge/manifest.json +15 -0
- package/micro-judge/native-acceptance-darwin-arm64.tap +118 -0
- package/micro-judge/native-verification-darwin-arm64.json +20 -0
- package/migrations/044_decision_diagnostics.sql +46 -0
- package/migrations/045_correction_classification.sql +11 -0
- package/package.json +13 -8
- package/scripts/guardrail-artifacts.mjs +0 -1
- package/scripts/verify-micro-judge.mjs +53 -0
- package/guardrail/x86_64-apple-darwin/kiokuko-guardrail +0 -0
- package/guardrail/x86_64-apple-darwin/manifest.json +0 -71
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correction.d.ts","sourceRoot":"","sources":["../../../src/dsh/decisions/correction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,2CAA2C,CAAA;AAChF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAA;AAEjD,oFAAoF;AACpF,wBAAsB,oBAAoB,CAAC,OAAO,CAAC,EAAC,eAAe,GAAE,OAAO,CAAC;IAAC,IAAI,EAAC,cAAc,CAAC;IAAA,OAAO,CAAC,EAAC,iBAAiB,CAAA;CAAC,CAAC,CAU7H"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The configured Typed Decisions provider owns inference; no Jev-specific path. */
|
|
2
|
+
export async function correctionClassifier(service) {
|
|
3
|
+
if (!service)
|
|
4
|
+
return { mode: 'shadow' };
|
|
5
|
+
await service.initialize();
|
|
6
|
+
const mode = service.correctionClassificationMode();
|
|
7
|
+
if (mode === 'off')
|
|
8
|
+
return { mode };
|
|
9
|
+
return { mode, backend: { configurationDigest: service.configurationDigest(), evaluate: async (id, batch, signal) => {
|
|
10
|
+
const config = await service.bind(id, signal);
|
|
11
|
+
const outcome = await service.evaluate(id, batch, signal);
|
|
12
|
+
return outcome.status === 'completed' ? { ...outcome, attested: config.provider !== 'laya-coreml' || config['laya-coreml']?.protocol !== 'v1' } : outcome;
|
|
13
|
+
} } };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=correction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correction.js","sourceRoot":"","sources":["../../../src/dsh/decisions/correction.ts"],"names":[],"mappings":"AAIA,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAwB;IACjE,IAAG,CAAC,OAAO;QAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAA;IAClC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAA;IAC1B,MAAM,IAAI,GAAC,OAAO,CAAC,4BAA4B,EAAE,CAAA;IACjD,IAAG,IAAI,KAAG,KAAK;QAAC,OAAO,EAAC,IAAI,EAAC,CAAA;IAC7B,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,mBAAmB,EAAC,OAAO,CAAC,mBAAmB,EAAE,EAAC,QAAQ,EAAC,KAAK,EAAC,EAAE,EAAC,KAAK,EAAC,MAAM,EAAC,EAAE;gBACvG,MAAM,MAAM,GAAC,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,EAAC,MAAM,CAAC,CAAA;gBAC1C,MAAM,OAAO,GAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAC,KAAK,EAAC,MAAM,CAAC,CAAA;gBACrD,OAAO,OAAO,CAAC,MAAM,KAAG,WAAW,CAAA,CAAC,CAAA,EAAC,GAAG,OAAO,EAAC,QAAQ,EAAC,MAAM,CAAC,QAAQ,KAAG,aAAa,IAAE,MAAM,CAAC,aAAa,CAAC,EAAE,QAAQ,KAAG,IAAI,EAAC,CAAA,CAAC,CAAA,OAAO,CAAA;YAC3I,CAAC,EAAC,EAAC,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostic-correlation.d.ts","sourceRoot":"","sources":["../../../src/dsh/decisions/diagnostic-correlation.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB,CAAC,KAAK,EAAC,MAAM,EAAC,UAAU,EAAC,MAAM,GAAE,IAAI,CAAqC;AAChH,wBAAgB,yBAAyB,CAAC,KAAK,EAAC,OAAO,GAAE,MAAM,GAAC,SAAS,CAExE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Process-local telemetry identity must never enter an authority fingerprint, wire value or cache key. */
|
|
2
|
+
const identities = new WeakMap();
|
|
3
|
+
export function correlateRequestIntent(value, decisionId) { identities.set(value, decisionId); }
|
|
4
|
+
export function requestIntentDiagnosticId(value) {
|
|
5
|
+
return value && typeof value === 'object' ? identities.get(value) : undefined;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=diagnostic-correlation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostic-correlation.js","sourceRoot":"","sources":["../../../src/dsh/decisions/diagnostic-correlation.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,UAAU,GAAC,IAAI,OAAO,EAAiB,CAAA;AAC7C,MAAM,UAAU,sBAAsB,CAAC,KAAY,EAAC,UAAiB,IAAS,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,UAAU,CAAC,CAAA,CAAC,CAAC;AAChH,MAAM,UAAU,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,IAAI,OAAO,KAAK,KAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC7E,CAAC"}
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import type { IntentAssessment } from './intent-assessment.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { SqliteDatabase } from '../../db/adapter.js';
|
|
4
|
+
import type { RequestIntentContext, RequestIntentDecision } from './request-intent.js';
|
|
5
|
+
export declare const DiagnosticBinding: z.ZodObject<{
|
|
6
|
+
runId: z.ZodString;
|
|
7
|
+
sessionId: z.ZodString;
|
|
8
|
+
repositoryDigest: z.ZodString;
|
|
9
|
+
revision: z.ZodNumber;
|
|
10
|
+
generation: z.ZodNumber;
|
|
11
|
+
sourceEpoch: z.ZodNumber;
|
|
12
|
+
workflowRevision: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
goalRevision: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
scopeRevision: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type DiagnosticBinding = z.infer<typeof DiagnosticBinding>;
|
|
17
|
+
export declare const DiagnosticAttempt: z.ZodObject<{
|
|
18
|
+
origin: z.ZodEnum<{
|
|
19
|
+
intake: "intake";
|
|
20
|
+
provider: "provider";
|
|
21
|
+
}>;
|
|
22
|
+
requestRef: z.ZodString;
|
|
23
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
turn: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
inputDigest: z.ZodString;
|
|
26
|
+
contextDigest: z.ZodOptional<z.ZodString>;
|
|
27
|
+
binding: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
runId: z.ZodString;
|
|
29
|
+
sessionId: z.ZodString;
|
|
30
|
+
repositoryDigest: z.ZodString;
|
|
31
|
+
revision: z.ZodNumber;
|
|
32
|
+
generation: z.ZodNumber;
|
|
33
|
+
sourceEpoch: z.ZodNumber;
|
|
34
|
+
workflowRevision: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
goalRevision: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
scopeRevision: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
}, z.core.$strict>>;
|
|
38
|
+
policyRef: z.ZodString;
|
|
39
|
+
referenceDigests: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
40
|
+
purpose: z.ZodEnum<{
|
|
41
|
+
skills: "skills";
|
|
42
|
+
akinator: "akinator";
|
|
43
|
+
"request-intent": "request-intent";
|
|
44
|
+
"enno-check": "enno-check";
|
|
45
|
+
lisp: "lisp";
|
|
46
|
+
"memory-reuse": "memory-reuse";
|
|
47
|
+
compaction: "compaction";
|
|
48
|
+
"model-handoff": "model-handoff";
|
|
49
|
+
"answer-review": "answer-review";
|
|
50
|
+
"model-routing": "model-routing";
|
|
51
|
+
"intent-semantic-match": "intent-semantic-match";
|
|
52
|
+
"correction-classification": "correction-classification";
|
|
53
|
+
}>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export type DiagnosticAttempt = z.input<typeof DiagnosticAttempt>;
|
|
56
|
+
export declare const DIAGNOSTIC_REASONS: readonly ["observed", "resolved", "unresolved", "native_unowned", "clarification_required", "target_unknown", "scope_unknown", "transition_required", "question_unavailable", "context_changed", "answer_queued", "resume_observed", "receipt_observed", "continuation_observed", "assessment_disabled", "assessment_consistent", "assessment_clarify", "assessment_unavailable", "provider_completed", "provider_fallback", "provider_cancelled", "evaluation_failed"];
|
|
57
|
+
export declare const DiagnosticEvent: z.ZodObject<{
|
|
58
|
+
kind: z.ZodEnum<{
|
|
59
|
+
reference: "reference";
|
|
60
|
+
provider: "provider";
|
|
61
|
+
extraction: "extraction";
|
|
62
|
+
answer: "answer";
|
|
63
|
+
question: "question";
|
|
64
|
+
receipt: "receipt";
|
|
65
|
+
semantic_match: "semantic_match";
|
|
66
|
+
choice: "choice";
|
|
67
|
+
resume: "resume";
|
|
68
|
+
detector: "detector";
|
|
69
|
+
route: "route";
|
|
70
|
+
admission: "admission";
|
|
71
|
+
task_resume: "task_resume";
|
|
72
|
+
continuation: "continuation";
|
|
73
|
+
}>;
|
|
74
|
+
status: z.ZodEnum<{
|
|
75
|
+
observed: "observed";
|
|
76
|
+
blocked: "blocked";
|
|
77
|
+
not_run: "not_run";
|
|
78
|
+
waiting: "waiting";
|
|
79
|
+
queued: "queued";
|
|
80
|
+
}>;
|
|
81
|
+
reason: z.ZodEnum<{
|
|
82
|
+
unresolved: "unresolved";
|
|
83
|
+
resolved: "resolved";
|
|
84
|
+
observed: "observed";
|
|
85
|
+
native_unowned: "native_unowned";
|
|
86
|
+
clarification_required: "clarification_required";
|
|
87
|
+
target_unknown: "target_unknown";
|
|
88
|
+
scope_unknown: "scope_unknown";
|
|
89
|
+
transition_required: "transition_required";
|
|
90
|
+
question_unavailable: "question_unavailable";
|
|
91
|
+
context_changed: "context_changed";
|
|
92
|
+
answer_queued: "answer_queued";
|
|
93
|
+
resume_observed: "resume_observed";
|
|
94
|
+
receipt_observed: "receipt_observed";
|
|
95
|
+
continuation_observed: "continuation_observed";
|
|
96
|
+
assessment_disabled: "assessment_disabled";
|
|
97
|
+
assessment_consistent: "assessment_consistent";
|
|
98
|
+
assessment_clarify: "assessment_clarify";
|
|
99
|
+
assessment_unavailable: "assessment_unavailable";
|
|
100
|
+
provider_completed: "provider_completed";
|
|
101
|
+
provider_fallback: "provider_fallback";
|
|
102
|
+
provider_cancelled: "provider_cancelled";
|
|
103
|
+
evaluation_failed: "evaluation_failed";
|
|
104
|
+
}>;
|
|
105
|
+
parentEventId: z.ZodOptional<z.ZodString>;
|
|
106
|
+
referenceDigest: z.ZodOptional<z.ZodString>;
|
|
107
|
+
targetSessionId: z.ZodOptional<z.ZodString>;
|
|
108
|
+
binding: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
runId: z.ZodString;
|
|
110
|
+
sessionId: z.ZodString;
|
|
111
|
+
repositoryDigest: z.ZodString;
|
|
112
|
+
revision: z.ZodNumber;
|
|
113
|
+
generation: z.ZodNumber;
|
|
114
|
+
sourceEpoch: z.ZodNumber;
|
|
115
|
+
workflowRevision: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
goalRevision: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
scopeRevision: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
}, z.core.$strict>>;
|
|
119
|
+
relation: z.ZodOptional<z.ZodEnum<{
|
|
120
|
+
unknown: "unknown";
|
|
121
|
+
new: "new";
|
|
122
|
+
same_scope_continuation: "same_scope_continuation";
|
|
123
|
+
scope_change: "scope_change";
|
|
124
|
+
}>>;
|
|
125
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
126
|
+
unknown: "unknown";
|
|
127
|
+
research: "research";
|
|
128
|
+
answer: "answer";
|
|
129
|
+
change: "change";
|
|
130
|
+
verify: "verify";
|
|
131
|
+
operate: "operate";
|
|
132
|
+
}>>;
|
|
133
|
+
changeScope: z.ZodOptional<z.ZodEnum<{
|
|
134
|
+
unknown: "unknown";
|
|
135
|
+
implementation: "implementation";
|
|
136
|
+
document: "document";
|
|
137
|
+
}>>;
|
|
138
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
139
|
+
unresolved: "unresolved";
|
|
140
|
+
"decision-provider": "decision-provider";
|
|
141
|
+
"main-model": "main-model";
|
|
142
|
+
}>>;
|
|
143
|
+
provider: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
typesafe: "typesafe";
|
|
145
|
+
nimble: "nimble";
|
|
146
|
+
"laya-coreml": "laya-coreml";
|
|
147
|
+
}>>;
|
|
148
|
+
modelRef: z.ZodOptional<z.ZodString>;
|
|
149
|
+
policyRef: z.ZodOptional<z.ZodString>;
|
|
150
|
+
detectorVersionRef: z.ZodOptional<z.ZodString>;
|
|
151
|
+
providerRevisionRef: z.ZodOptional<z.ZodString>;
|
|
152
|
+
elapsedMs: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
cacheHit: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
providerDispatched: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
semanticVerdict: z.ZodOptional<z.ZodEnum<{
|
|
156
|
+
unavailable: "unavailable";
|
|
157
|
+
contradicted: "contradicted";
|
|
158
|
+
insufficient: "insufficient";
|
|
159
|
+
supported: "supported";
|
|
160
|
+
}>>;
|
|
161
|
+
assessmentInputDigest: z.ZodOptional<z.ZodString>;
|
|
162
|
+
assessmentOutputDigest: z.ZodOptional<z.ZodString>;
|
|
163
|
+
judge: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
state: z.ZodEnum<{
|
|
165
|
+
unavailable: "unavailable";
|
|
166
|
+
available: "available";
|
|
167
|
+
}>;
|
|
168
|
+
inputDigest: z.ZodOptional<z.ZodString>;
|
|
169
|
+
outputDigest: z.ZodOptional<z.ZodString>;
|
|
170
|
+
binaryHash: z.ZodOptional<z.ZodString>;
|
|
171
|
+
version: z.ZodLiteral<"kiokuko-fd-v1">;
|
|
172
|
+
complete: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
174
|
+
entailed: "entailed";
|
|
175
|
+
refuted: "refuted";
|
|
176
|
+
undetermined: "undetermined";
|
|
177
|
+
inconsistent: "inconsistent";
|
|
178
|
+
resource_limit: "resource_limit";
|
|
179
|
+
}>>;
|
|
180
|
+
unavailableReason: z.ZodOptional<z.ZodEnum<{
|
|
181
|
+
cancelled: "cancelled";
|
|
182
|
+
timeout: "timeout";
|
|
183
|
+
unsupported_platform: "unsupported_platform";
|
|
184
|
+
artifact_unavailable: "artifact_unavailable";
|
|
185
|
+
artifact_mismatch: "artifact_mismatch";
|
|
186
|
+
invalid_input: "invalid_input";
|
|
187
|
+
process_failed: "process_failed";
|
|
188
|
+
output_limit: "output_limit";
|
|
189
|
+
malformed_response: "malformed_response";
|
|
190
|
+
}>>;
|
|
191
|
+
}, z.core.$strict>>;
|
|
192
|
+
selected: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
abstained: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
measured: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
choice: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
questionRef: z.ZodString;
|
|
197
|
+
choiceRef: z.ZodString;
|
|
198
|
+
topProbability: z.ZodNumber;
|
|
199
|
+
runnerUpProbability: z.ZodNumber;
|
|
200
|
+
margin: z.ZodNumber;
|
|
201
|
+
confidence: z.ZodNumber;
|
|
202
|
+
gate: z.ZodEnum<{
|
|
203
|
+
confidence: "confidence";
|
|
204
|
+
probability_margin: "probability_margin";
|
|
205
|
+
}>;
|
|
206
|
+
acceptance: z.ZodObject<{
|
|
207
|
+
minConfidence: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
minProbability: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
minMargin: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
}, z.core.$strict>;
|
|
211
|
+
status: z.ZodEnum<{
|
|
212
|
+
selected: "selected";
|
|
213
|
+
abstained: "abstained";
|
|
214
|
+
}>;
|
|
215
|
+
failedChecks: z.ZodArray<z.ZodEnum<{
|
|
216
|
+
confidence: "confidence";
|
|
217
|
+
probability: "probability";
|
|
218
|
+
margin: "margin";
|
|
219
|
+
}>>;
|
|
220
|
+
}, z.core.$strict>>;
|
|
221
|
+
fallback: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
DECISION_TIMEOUT: "DECISION_TIMEOUT";
|
|
223
|
+
DECISION_UNAVAILABLE: "DECISION_UNAVAILABLE";
|
|
224
|
+
DECISION_AUTH: "DECISION_AUTH";
|
|
225
|
+
DECISION_CANCELLED: "DECISION_CANCELLED";
|
|
226
|
+
DECISION_INVALID_INPUT: "DECISION_INVALID_INPUT";
|
|
227
|
+
DECISION_UNSUPPORTED: "DECISION_UNSUPPORTED";
|
|
228
|
+
DECISION_TOO_LARGE: "DECISION_TOO_LARGE";
|
|
229
|
+
DECISION_MALFORMED_RESPONSE: "DECISION_MALFORMED_RESPONSE";
|
|
230
|
+
other: "other";
|
|
231
|
+
}>>;
|
|
232
|
+
resultRef: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
requestId: z.ZodString;
|
|
234
|
+
inputDigest: z.ZodString;
|
|
235
|
+
}, z.core.$strict>>;
|
|
236
|
+
nextDecisionId: z.ZodOptional<z.ZodString>;
|
|
237
|
+
receiptId: z.ZodOptional<z.ZodString>;
|
|
238
|
+
continuationId: z.ZodOptional<z.ZodString>;
|
|
239
|
+
evaluationDecisionId: z.ZodOptional<z.ZodString>;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
export type DiagnosticEvent = z.input<typeof DiagnosticEvent>;
|
|
242
|
+
export type DiagnosticRuntime = {
|
|
243
|
+
withDatabase<T>(operation: (db: SqliteDatabase) => T): Promise<T>;
|
|
244
|
+
};
|
|
245
|
+
export declare function diagnosticId(): string;
|
|
246
|
+
export declare function diagnosticEventId(decisionId: string, key: unknown): string;
|
|
247
|
+
/** Current source epoch follows the same rule as task-source-history/finalization. */
|
|
248
|
+
export declare function captureDiagnosticBinding(db: SqliteDatabase, runId: string, sessionId: string): DiagnosticBinding;
|
|
249
|
+
export declare function createDiagnosticAttempt(db: SqliteDatabase, decisionId: string, raw: DiagnosticAttempt): void;
|
|
250
|
+
/** Serialize sequence allocation and validate causality inside the caller's managed transaction. */
|
|
251
|
+
export declare function appendDiagnosticEvent(db: SqliteDatabase, decisionId: string, eventId: string, raw: DiagnosticEvent): number;
|
|
252
|
+
/** No raw exception is retained. A failed savepoint cannot alter the authoritative operation. */
|
|
253
|
+
export declare function bestEffortDiagnostic(db: SqliteDatabase, scopeRef: string, operation: () => void): boolean;
|
|
254
|
+
export declare function observeDiagnostic(runtime: DiagnosticRuntime, scope: string, operation: (db: SqliteDatabase) => void): Promise<void>;
|
|
255
|
+
export declare function diagnosticRuntimeLosses(runtime: DiagnosticRuntime): number;
|
|
256
|
+
/** Called only after the real host has bound the admitted run. Source interpretation stays immutable. */
|
|
257
|
+
export declare function recordDiagnosticAdmission(db: SqliteDatabase, input: {
|
|
258
|
+
sessionId: string;
|
|
259
|
+
turn: number;
|
|
260
|
+
runId: string;
|
|
261
|
+
task: string;
|
|
262
|
+
context?: RequestIntentContext;
|
|
263
|
+
decision?: RequestIntentDecision;
|
|
264
|
+
}): void;
|
|
265
|
+
/** Same managed transaction as the authoritative state transition. Never creates a correctness label. */
|
|
266
|
+
export declare function recordDiagnosticTaskResume(db: SqliteDatabase, runId: string, sessionId: string, operationId: string): void;
|
|
267
|
+
/** The receipt/outbox already exists. Savepoint failure is advisory; outer rollback also rolls back diagnostics. */
|
|
268
|
+
export declare function recordDiagnosticTurn(db: SqliteDatabase, receiptId: string): void;
|
|
269
|
+
/** Runs after the existing Enno receipt trigger, inside its authoritative transaction. */
|
|
270
|
+
export declare function recordDiagnosticEnnoCommit(db: SqliteDatabase, runId: string, operation: string, key: string): void;
|
|
271
|
+
/** Trusted, independent adjudication API; never exposed as a model tool or inferred from resume. */
|
|
272
|
+
export declare function reviewDiagnosticStop(db: SqliteDatabase, decisionId: string, verdict: 'false_stop' | 'justified_stop', reviewRef: string): void;
|
|
273
|
+
/** SELECT-only. Never backfill, migrate, probe a provider, dispatch or label an outcome. */
|
|
274
|
+
export declare function readDecisionDiagnostics(db: SqliteDatabase, sessionId: string, decisionId?: string): {
|
|
275
|
+
attempts: {
|
|
276
|
+
events: {
|
|
277
|
+
kind: "reference" | "provider" | "extraction" | "answer" | "question" | "receipt" | "semantic_match" | "choice" | "resume" | "detector" | "route" | "admission" | "task_resume" | "continuation";
|
|
278
|
+
status: "observed" | "blocked" | "not_run" | "waiting" | "queued";
|
|
279
|
+
reason: "unresolved" | "resolved" | "observed" | "native_unowned" | "clarification_required" | "target_unknown" | "scope_unknown" | "transition_required" | "question_unavailable" | "context_changed" | "answer_queued" | "resume_observed" | "receipt_observed" | "continuation_observed" | "assessment_disabled" | "assessment_consistent" | "assessment_clarify" | "assessment_unavailable" | "provider_completed" | "provider_fallback" | "provider_cancelled" | "evaluation_failed";
|
|
280
|
+
parentEventId?: string | undefined;
|
|
281
|
+
referenceDigest?: string | undefined;
|
|
282
|
+
targetSessionId?: string | undefined;
|
|
283
|
+
binding?: {
|
|
284
|
+
runId: string;
|
|
285
|
+
sessionId: string;
|
|
286
|
+
repositoryDigest: string;
|
|
287
|
+
revision: number;
|
|
288
|
+
generation: number;
|
|
289
|
+
sourceEpoch: number;
|
|
290
|
+
workflowRevision?: number | undefined;
|
|
291
|
+
goalRevision?: number | undefined;
|
|
292
|
+
scopeRevision?: number | undefined;
|
|
293
|
+
} | undefined;
|
|
294
|
+
relation?: "unknown" | "new" | "same_scope_continuation" | "scope_change" | undefined;
|
|
295
|
+
action?: "unknown" | "research" | "answer" | "change" | "verify" | "operate" | undefined;
|
|
296
|
+
changeScope?: "unknown" | "implementation" | "document" | undefined;
|
|
297
|
+
source?: "unresolved" | "decision-provider" | "main-model" | undefined;
|
|
298
|
+
provider?: "typesafe" | "nimble" | "laya-coreml" | undefined;
|
|
299
|
+
modelRef?: string | undefined;
|
|
300
|
+
policyRef?: string | undefined;
|
|
301
|
+
detectorVersionRef?: string | undefined;
|
|
302
|
+
providerRevisionRef?: string | undefined;
|
|
303
|
+
elapsedMs?: number | undefined;
|
|
304
|
+
cacheHit?: boolean | undefined;
|
|
305
|
+
providerDispatched?: boolean | undefined;
|
|
306
|
+
semanticVerdict?: "unavailable" | "contradicted" | "insufficient" | "supported" | undefined;
|
|
307
|
+
assessmentInputDigest?: string | undefined;
|
|
308
|
+
assessmentOutputDigest?: string | undefined;
|
|
309
|
+
judge?: {
|
|
310
|
+
state: "unavailable" | "available";
|
|
311
|
+
version: "kiokuko-fd-v1";
|
|
312
|
+
inputDigest?: string | undefined;
|
|
313
|
+
outputDigest?: string | undefined;
|
|
314
|
+
binaryHash?: string | undefined;
|
|
315
|
+
complete?: boolean | undefined;
|
|
316
|
+
status?: "entailed" | "refuted" | "undetermined" | "inconsistent" | "resource_limit" | undefined;
|
|
317
|
+
unavailableReason?: "cancelled" | "timeout" | "unsupported_platform" | "artifact_unavailable" | "artifact_mismatch" | "invalid_input" | "process_failed" | "output_limit" | "malformed_response" | undefined;
|
|
318
|
+
} | undefined;
|
|
319
|
+
selected?: number | undefined;
|
|
320
|
+
abstained?: number | undefined;
|
|
321
|
+
measured?: number | undefined;
|
|
322
|
+
choice?: {
|
|
323
|
+
questionRef: string;
|
|
324
|
+
choiceRef: string;
|
|
325
|
+
topProbability: number;
|
|
326
|
+
runnerUpProbability: number;
|
|
327
|
+
margin: number;
|
|
328
|
+
confidence: number;
|
|
329
|
+
gate: "confidence" | "probability_margin";
|
|
330
|
+
acceptance: {
|
|
331
|
+
minConfidence?: number | undefined;
|
|
332
|
+
minProbability?: number | undefined;
|
|
333
|
+
minMargin?: number | undefined;
|
|
334
|
+
};
|
|
335
|
+
status: "selected" | "abstained";
|
|
336
|
+
failedChecks: ("confidence" | "probability" | "margin")[];
|
|
337
|
+
} | undefined;
|
|
338
|
+
fallback?: "DECISION_TIMEOUT" | "DECISION_UNAVAILABLE" | "DECISION_AUTH" | "DECISION_CANCELLED" | "DECISION_INVALID_INPUT" | "DECISION_UNSUPPORTED" | "DECISION_TOO_LARGE" | "DECISION_MALFORMED_RESPONSE" | "other" | undefined;
|
|
339
|
+
resultRef?: {
|
|
340
|
+
requestId: string;
|
|
341
|
+
inputDigest: string;
|
|
342
|
+
} | undefined;
|
|
343
|
+
nextDecisionId?: string | undefined;
|
|
344
|
+
receiptId?: string | undefined;
|
|
345
|
+
continuationId?: string | undefined;
|
|
346
|
+
evaluationDecisionId?: string | undefined;
|
|
347
|
+
eventId: unknown;
|
|
348
|
+
sequence: unknown;
|
|
349
|
+
}[];
|
|
350
|
+
authoritativeLinks: {
|
|
351
|
+
receipts: import("../../db/adapter.js").SqliteRow[];
|
|
352
|
+
outbox: import("../../db/adapter.js").SqliteRow[];
|
|
353
|
+
};
|
|
354
|
+
missingReceiptLinks: number;
|
|
355
|
+
missingContinuationLinks: number;
|
|
356
|
+
stages: {
|
|
357
|
+
extraction: "observed" | "blocked" | "not_run" | "waiting" | "queued";
|
|
358
|
+
semanticMatch: "observed" | "blocked" | "not_run" | "waiting" | "queued";
|
|
359
|
+
detector: "observed" | "blocked" | "not_run" | "waiting" | "queued";
|
|
360
|
+
};
|
|
361
|
+
providerAttempts: {
|
|
362
|
+
events: {
|
|
363
|
+
kind: "reference" | "provider" | "extraction" | "answer" | "question" | "receipt" | "semantic_match" | "choice" | "resume" | "detector" | "route" | "admission" | "task_resume" | "continuation";
|
|
364
|
+
status: "observed" | "blocked" | "not_run" | "waiting" | "queued";
|
|
365
|
+
reason: "unresolved" | "resolved" | "observed" | "native_unowned" | "clarification_required" | "target_unknown" | "scope_unknown" | "transition_required" | "question_unavailable" | "context_changed" | "answer_queued" | "resume_observed" | "receipt_observed" | "continuation_observed" | "assessment_disabled" | "assessment_consistent" | "assessment_clarify" | "assessment_unavailable" | "provider_completed" | "provider_fallback" | "provider_cancelled" | "evaluation_failed";
|
|
366
|
+
parentEventId?: string | undefined;
|
|
367
|
+
referenceDigest?: string | undefined;
|
|
368
|
+
targetSessionId?: string | undefined;
|
|
369
|
+
binding?: {
|
|
370
|
+
runId: string;
|
|
371
|
+
sessionId: string;
|
|
372
|
+
repositoryDigest: string;
|
|
373
|
+
revision: number;
|
|
374
|
+
generation: number;
|
|
375
|
+
sourceEpoch: number;
|
|
376
|
+
workflowRevision?: number | undefined;
|
|
377
|
+
goalRevision?: number | undefined;
|
|
378
|
+
scopeRevision?: number | undefined;
|
|
379
|
+
} | undefined;
|
|
380
|
+
relation?: "unknown" | "new" | "same_scope_continuation" | "scope_change" | undefined;
|
|
381
|
+
action?: "unknown" | "research" | "answer" | "change" | "verify" | "operate" | undefined;
|
|
382
|
+
changeScope?: "unknown" | "implementation" | "document" | undefined;
|
|
383
|
+
source?: "unresolved" | "decision-provider" | "main-model" | undefined;
|
|
384
|
+
provider?: "typesafe" | "nimble" | "laya-coreml" | undefined;
|
|
385
|
+
modelRef?: string | undefined;
|
|
386
|
+
policyRef?: string | undefined;
|
|
387
|
+
detectorVersionRef?: string | undefined;
|
|
388
|
+
providerRevisionRef?: string | undefined;
|
|
389
|
+
elapsedMs?: number | undefined;
|
|
390
|
+
cacheHit?: boolean | undefined;
|
|
391
|
+
providerDispatched?: boolean | undefined;
|
|
392
|
+
semanticVerdict?: "unavailable" | "contradicted" | "insufficient" | "supported" | undefined;
|
|
393
|
+
assessmentInputDigest?: string | undefined;
|
|
394
|
+
assessmentOutputDigest?: string | undefined;
|
|
395
|
+
judge?: {
|
|
396
|
+
state: "unavailable" | "available";
|
|
397
|
+
version: "kiokuko-fd-v1";
|
|
398
|
+
inputDigest?: string | undefined;
|
|
399
|
+
outputDigest?: string | undefined;
|
|
400
|
+
binaryHash?: string | undefined;
|
|
401
|
+
complete?: boolean | undefined;
|
|
402
|
+
status?: "entailed" | "refuted" | "undetermined" | "inconsistent" | "resource_limit" | undefined;
|
|
403
|
+
unavailableReason?: "cancelled" | "timeout" | "unsupported_platform" | "artifact_unavailable" | "artifact_mismatch" | "invalid_input" | "process_failed" | "output_limit" | "malformed_response" | undefined;
|
|
404
|
+
} | undefined;
|
|
405
|
+
selected?: number | undefined;
|
|
406
|
+
abstained?: number | undefined;
|
|
407
|
+
measured?: number | undefined;
|
|
408
|
+
choice?: {
|
|
409
|
+
questionRef: string;
|
|
410
|
+
choiceRef: string;
|
|
411
|
+
topProbability: number;
|
|
412
|
+
runnerUpProbability: number;
|
|
413
|
+
margin: number;
|
|
414
|
+
confidence: number;
|
|
415
|
+
gate: "confidence" | "probability_margin";
|
|
416
|
+
acceptance: {
|
|
417
|
+
minConfidence?: number | undefined;
|
|
418
|
+
minProbability?: number | undefined;
|
|
419
|
+
minMargin?: number | undefined;
|
|
420
|
+
};
|
|
421
|
+
status: "selected" | "abstained";
|
|
422
|
+
failedChecks: ("confidence" | "probability" | "margin")[];
|
|
423
|
+
} | undefined;
|
|
424
|
+
fallback?: "DECISION_TIMEOUT" | "DECISION_UNAVAILABLE" | "DECISION_AUTH" | "DECISION_CANCELLED" | "DECISION_INVALID_INPUT" | "DECISION_UNSUPPORTED" | "DECISION_TOO_LARGE" | "DECISION_MALFORMED_RESPONSE" | "other" | undefined;
|
|
425
|
+
resultRef?: {
|
|
426
|
+
requestId: string;
|
|
427
|
+
inputDigest: string;
|
|
428
|
+
} | undefined;
|
|
429
|
+
nextDecisionId?: string | undefined;
|
|
430
|
+
receiptId?: string | undefined;
|
|
431
|
+
continuationId?: string | undefined;
|
|
432
|
+
evaluationDecisionId?: string | undefined;
|
|
433
|
+
}[];
|
|
434
|
+
origin: "intake" | "provider";
|
|
435
|
+
requestRef: string;
|
|
436
|
+
inputDigest: string;
|
|
437
|
+
policyRef: string;
|
|
438
|
+
referenceDigests: string[];
|
|
439
|
+
purpose: "skills" | "akinator" | "request-intent" | "enno-check" | "lisp" | "memory-reuse" | "compaction" | "model-handoff" | "answer-review" | "model-routing" | "intent-semantic-match" | "correction-classification";
|
|
440
|
+
sessionId?: string | undefined;
|
|
441
|
+
turn?: number | undefined;
|
|
442
|
+
contextDigest?: string | undefined;
|
|
443
|
+
binding?: {
|
|
444
|
+
runId: string;
|
|
445
|
+
sessionId: string;
|
|
446
|
+
repositoryDigest: string;
|
|
447
|
+
revision: number;
|
|
448
|
+
generation: number;
|
|
449
|
+
sourceEpoch: number;
|
|
450
|
+
workflowRevision?: number | undefined;
|
|
451
|
+
goalRevision?: number | undefined;
|
|
452
|
+
scopeRevision?: number | undefined;
|
|
453
|
+
} | undefined;
|
|
454
|
+
decisionId: unknown;
|
|
455
|
+
}[];
|
|
456
|
+
origin: "intake" | "provider";
|
|
457
|
+
requestRef: string;
|
|
458
|
+
inputDigest: string;
|
|
459
|
+
policyRef: string;
|
|
460
|
+
referenceDigests: string[];
|
|
461
|
+
purpose: "skills" | "akinator" | "request-intent" | "enno-check" | "lisp" | "memory-reuse" | "compaction" | "model-handoff" | "answer-review" | "model-routing" | "intent-semantic-match" | "correction-classification";
|
|
462
|
+
sessionId?: string | undefined;
|
|
463
|
+
turn?: number | undefined;
|
|
464
|
+
contextDigest?: string | undefined;
|
|
465
|
+
binding?: {
|
|
466
|
+
runId: string;
|
|
467
|
+
sessionId: string;
|
|
468
|
+
repositoryDigest: string;
|
|
469
|
+
revision: number;
|
|
470
|
+
generation: number;
|
|
471
|
+
sourceEpoch: number;
|
|
472
|
+
workflowRevision?: number | undefined;
|
|
473
|
+
goalRevision?: number | undefined;
|
|
474
|
+
scopeRevision?: number | undefined;
|
|
475
|
+
} | undefined;
|
|
476
|
+
decisionId: unknown;
|
|
477
|
+
}[];
|
|
478
|
+
metrics: {
|
|
479
|
+
stopped: number;
|
|
480
|
+
evaluated: number;
|
|
481
|
+
falseStops: number;
|
|
482
|
+
falseStopRate: number | null;
|
|
483
|
+
evaluationRate: number | null;
|
|
484
|
+
};
|
|
485
|
+
completeness: {
|
|
486
|
+
persistedGaps: number;
|
|
487
|
+
volatileLosses: number;
|
|
488
|
+
missingReceiptLinks: number;
|
|
489
|
+
missingContinuationLinks: number;
|
|
490
|
+
};
|
|
491
|
+
truncated: boolean;
|
|
492
|
+
};
|
|
493
|
+
export interface IntakeDiagnosticInput {
|
|
494
|
+
agent: {
|
|
495
|
+
session?: {
|
|
496
|
+
id: string;
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
turn: number;
|
|
500
|
+
messages: readonly unknown[];
|
|
501
|
+
}
|
|
502
|
+
export interface IntakeDiagnosticObservation {
|
|
503
|
+
kind: 'interpretation' | 'native_unowned' | 'question' | 'answer' | 'resume' | 'assessment' | 'assessment_disabled';
|
|
504
|
+
assessment?: IntentAssessment;
|
|
505
|
+
context?: RequestIntentContext;
|
|
506
|
+
decision?: RequestIntentDecision;
|
|
507
|
+
questionRef?: string;
|
|
508
|
+
answerRef?: string;
|
|
509
|
+
reason?: 'target_unknown' | 'scope_unknown' | 'transition_required' | 'clarification_required' | 'context_changed';
|
|
510
|
+
}
|
|
511
|
+
/** References originate in captured native input / host-issued question and followup IDs, never model submissions. */
|
|
512
|
+
export declare function createIntakeDiagnosticSink(runtime: DiagnosticRuntime): (input: IntakeDiagnosticInput, observation: IntakeDiagnosticObservation) => Promise<void>;
|
|
513
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -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