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.
Files changed (201) hide show
  1. package/PERMISSIONS.md +11 -0
  2. package/README.ja.md +2 -0
  3. package/README.ko.md +2 -0
  4. package/README.md +2 -0
  5. package/README.zh-CN.md +2 -0
  6. package/THIRD_PARTY_NOTICES.md +4 -0
  7. package/dist/deep-thinker/core/contracts.d.ts +5 -5
  8. package/dist/deep-thinker/memory-finalizer.d.ts +1 -1
  9. package/dist/deep-thinker/store.d.ts +1 -1
  10. package/dist/dsh/coding-workflow/host.d.ts.map +1 -1
  11. package/dist/dsh/coding-workflow/host.js +7 -6
  12. package/dist/dsh/coding-workflow/host.js.map +1 -1
  13. package/dist/dsh/coding-workflow/intent.js +1 -1
  14. package/dist/dsh/coding-workflow/intent.js.map +1 -1
  15. package/dist/dsh/coding-workflow/service.js +2 -2
  16. package/dist/dsh/coding-workflow/service.js.map +1 -1
  17. package/dist/dsh/composition.js +1 -1
  18. package/dist/dsh/composition.js.map +1 -1
  19. package/dist/dsh/config.d.ts +8 -1
  20. package/dist/dsh/config.d.ts.map +1 -1
  21. package/dist/dsh/core/host.d.ts +7 -0
  22. package/dist/dsh/core/host.d.ts.map +1 -1
  23. package/dist/dsh/core/host.js +21 -1
  24. package/dist/dsh/core/host.js.map +1 -1
  25. package/dist/dsh/core/index.d.ts +20 -0
  26. package/dist/dsh/core/index.d.ts.map +1 -1
  27. package/dist/dsh/core/tasks.d.ts +3 -1
  28. package/dist/dsh/core/tasks.d.ts.map +1 -1
  29. package/dist/dsh/core/tasks.js +29 -6
  30. package/dist/dsh/core/tasks.js.map +1 -1
  31. package/dist/dsh/correction-context.d.ts +54 -0
  32. package/dist/dsh/correction-context.d.ts.map +1 -0
  33. package/dist/dsh/correction-context.js +70 -0
  34. package/dist/dsh/correction-context.js.map +1 -0
  35. package/dist/dsh/correction-decision.d.ts +38 -0
  36. package/dist/dsh/correction-decision.d.ts.map +1 -0
  37. package/dist/dsh/correction-decision.js +71 -0
  38. package/dist/dsh/correction-decision.js.map +1 -0
  39. package/dist/dsh/decisions/config.d.ts +7 -0
  40. package/dist/dsh/decisions/config.d.ts.map +1 -1
  41. package/dist/dsh/decisions/config.js +1 -0
  42. package/dist/dsh/decisions/config.js.map +1 -1
  43. package/dist/dsh/decisions/contracts.d.ts +2 -0
  44. package/dist/dsh/decisions/contracts.d.ts.map +1 -1
  45. package/dist/dsh/decisions/contracts.js +1 -1
  46. package/dist/dsh/decisions/contracts.js.map +1 -1
  47. package/dist/dsh/decisions/correction.d.ts +9 -0
  48. package/dist/dsh/decisions/correction.d.ts.map +1 -0
  49. package/dist/dsh/decisions/correction.js +15 -0
  50. package/dist/dsh/decisions/correction.js.map +1 -0
  51. package/dist/dsh/decisions/diagnostic-correlation.d.ts +3 -0
  52. package/dist/dsh/decisions/diagnostic-correlation.d.ts.map +1 -0
  53. package/dist/dsh/decisions/diagnostic-correlation.js +7 -0
  54. package/dist/dsh/decisions/diagnostic-correlation.js.map +1 -0
  55. package/dist/dsh/decisions/diagnostics.d.ts +513 -0
  56. package/dist/dsh/decisions/diagnostics.d.ts.map +1 -0
  57. package/dist/dsh/decisions/diagnostics.js +389 -0
  58. package/dist/dsh/decisions/diagnostics.js.map +1 -0
  59. package/dist/dsh/decisions/host.d.ts +2 -1
  60. package/dist/dsh/decisions/host.d.ts.map +1 -1
  61. package/dist/dsh/decisions/host.js +18 -5
  62. package/dist/dsh/decisions/host.js.map +1 -1
  63. package/dist/dsh/decisions/intent-assessment.d.ts +20 -0
  64. package/dist/dsh/decisions/intent-assessment.d.ts.map +1 -0
  65. package/dist/dsh/decisions/intent-assessment.js +104 -0
  66. package/dist/dsh/decisions/intent-assessment.js.map +1 -0
  67. package/dist/dsh/decisions/message-refs.d.ts +6 -0
  68. package/dist/dsh/decisions/message-refs.d.ts.map +1 -0
  69. package/dist/dsh/decisions/message-refs.js +16 -0
  70. package/dist/dsh/decisions/message-refs.js.map +1 -0
  71. package/dist/dsh/decisions/micro-judge.d.ts +58 -0
  72. package/dist/dsh/decisions/micro-judge.d.ts.map +1 -0
  73. package/dist/dsh/decisions/micro-judge.js +160 -0
  74. package/dist/dsh/decisions/micro-judge.js.map +1 -0
  75. package/dist/dsh/decisions/request-intent.d.ts +1 -2
  76. package/dist/dsh/decisions/request-intent.d.ts.map +1 -1
  77. package/dist/dsh/decisions/request-intent.js +16 -18
  78. package/dist/dsh/decisions/request-intent.js.map +1 -1
  79. package/dist/dsh/decisions/service.d.ts +11 -1
  80. package/dist/dsh/decisions/service.d.ts.map +1 -1
  81. package/dist/dsh/decisions/service.js +54 -8
  82. package/dist/dsh/decisions/service.js.map +1 -1
  83. package/dist/dsh/execution-command.d.ts +12 -1
  84. package/dist/dsh/execution-command.d.ts.map +1 -1
  85. package/dist/dsh/execution-command.js +54 -6
  86. package/dist/dsh/execution-command.js.map +1 -1
  87. package/dist/dsh/execution-selection.d.ts +5 -5
  88. package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
  89. package/dist/dsh/host-adapter/admission.js +3 -0
  90. package/dist/dsh/host-adapter/admission.js.map +1 -1
  91. package/dist/dsh/host-adapter/context.d.ts +5 -1
  92. package/dist/dsh/host-adapter/context.d.ts.map +1 -1
  93. package/dist/dsh/host-adapter/context.js +16 -1
  94. package/dist/dsh/host-adapter/context.js.map +1 -1
  95. package/dist/dsh/host-adapter/memory-application-host.d.ts +2 -0
  96. package/dist/dsh/host-adapter/memory-application-host.d.ts.map +1 -1
  97. package/dist/dsh/host-adapter/memory-application-host.js +3 -1
  98. package/dist/dsh/host-adapter/memory-application-host.js.map +1 -1
  99. package/dist/dsh/host-adapter/routing.d.ts.map +1 -1
  100. package/dist/dsh/host-adapter/routing.js +13 -0
  101. package/dist/dsh/host-adapter/routing.js.map +1 -1
  102. package/dist/dsh/host-adapter.d.ts.map +1 -1
  103. package/dist/dsh/host-adapter.js +6 -1
  104. package/dist/dsh/host-adapter.js.map +1 -1
  105. package/dist/dsh/index.d.ts +8 -2
  106. package/dist/dsh/index.d.ts.map +1 -1
  107. package/dist/dsh/lisp/surface.js +1 -1
  108. package/dist/dsh/lisp/surface.js.map +1 -1
  109. package/dist/dsh/memory-application.d.ts +7 -2
  110. package/dist/dsh/memory-application.d.ts.map +1 -1
  111. package/dist/dsh/memory-application.js +92 -2
  112. package/dist/dsh/memory-application.js.map +1 -1
  113. package/dist/dsh/model-configuration.d.ts +6 -6
  114. package/dist/dsh/models/vendor/opencode-adapter.d.ts.map +1 -1
  115. package/dist/dsh/models/vendor/opencode-adapter.js +67 -2
  116. package/dist/dsh/models/vendor/opencode-adapter.js.map +1 -1
  117. package/dist/dsh/modules/enno.d.ts +1 -1
  118. package/dist/dsh/native-task-authority.d.ts +1 -0
  119. package/dist/dsh/native-task-authority.d.ts.map +1 -1
  120. package/dist/dsh/native-task-authority.js +74 -50
  121. package/dist/dsh/native-task-authority.js.map +1 -1
  122. package/dist/dsh/on-demand-intake.d.ts +10 -0
  123. package/dist/dsh/on-demand-intake.d.ts.map +1 -1
  124. package/dist/dsh/on-demand-intake.js +63 -9
  125. package/dist/dsh/on-demand-intake.js.map +1 -1
  126. package/dist/dsh/task-completion.js +5 -5
  127. package/dist/dsh/task-completion.js.map +1 -1
  128. package/dist/dsh/task-intake.d.ts +1 -0
  129. package/dist/dsh/task-intake.d.ts.map +1 -1
  130. package/dist/dsh/task-intake.js.map +1 -1
  131. package/dist/dsh/task-state.d.ts.map +1 -1
  132. package/dist/dsh/task-state.js +4 -0
  133. package/dist/dsh/task-state.js.map +1 -1
  134. package/dist/dsh/tools.d.ts +1 -1
  135. package/dist/dsh/tools.d.ts.map +1 -1
  136. package/dist/dsh/tools.js +63 -35
  137. package/dist/dsh/tools.js.map +1 -1
  138. package/dist/dsh/turn-process.d.ts.map +1 -1
  139. package/dist/dsh/turn-process.js +3 -0
  140. package/dist/dsh/turn-process.js.map +1 -1
  141. package/dist/enno-oduno/store.d.ts.map +1 -1
  142. package/dist/enno-oduno/store.js +2 -0
  143. package/dist/enno-oduno/store.js.map +1 -1
  144. package/dist/locale/en.json +1 -1
  145. package/dist/locale/ja.json +1 -1
  146. package/dist/locale/ko.json +1 -1
  147. package/dist/locale/zh-CN.json +1 -1
  148. package/dist/memory/application.d.ts.map +1 -1
  149. package/dist/memory/application.js +3 -2
  150. package/dist/memory/application.js.map +1 -1
  151. package/dist/memory/correction-classification.d.ts +47 -0
  152. package/dist/memory/correction-classification.d.ts.map +1 -0
  153. package/dist/memory/correction-classification.js +143 -0
  154. package/dist/memory/correction-classification.js.map +1 -0
  155. package/dist/memory/correction-contract.d.ts +136 -0
  156. package/dist/memory/correction-contract.d.ts.map +1 -0
  157. package/dist/memory/correction-contract.js +42 -0
  158. package/dist/memory/correction-contract.js.map +1 -0
  159. package/dist/memory/lifecycle.d.ts +1 -1
  160. package/docs/coding-workflow.md +1 -1
  161. package/docs/correction-classification.md +122 -0
  162. package/docs/decision-diagnostics.md +60 -0
  163. package/docs/dsh-plugin.md +42 -0
  164. package/docs/evaluations/correction-classification-2026-10-21/assessment.json +717 -0
  165. package/docs/evaluations/correction-classification-2026-10-21/built-both-product-pair.log +14 -0
  166. package/docs/evaluations/correction-classification-2026-10-21/development.json +877 -0
  167. package/docs/evaluations/correction-classification-2026-10-21/dsh-build.log +9 -0
  168. package/docs/evaluations/correction-classification-2026-10-21/dsh-final-2-typecheck.log +0 -0
  169. package/docs/evaluations/correction-classification-2026-10-21/dsh-final-2-unit.log +43 -0
  170. package/docs/evaluations/correction-classification-2026-10-21/dsh-final-3-typecheck.log +0 -0
  171. package/docs/evaluations/correction-classification-2026-10-21/held-out.json +2671 -0
  172. package/docs/evaluations/correction-classification-2026-10-21/live-mcp-final-2.json +32 -0
  173. package/docs/evaluations/correction-classification-2026-10-21/live-mcp-final-2.log +1 -0
  174. package/docs/evaluations/correction-classification-2026-10-21/live-mcp-final.json +32 -0
  175. package/docs/evaluations/correction-classification-2026-10-21/main-build.log +17 -0
  176. package/docs/evaluations/correction-classification-2026-10-21/main-final-2-typecheck.log +0 -0
  177. package/docs/evaluations/correction-classification-2026-10-21/main-final-2-unit.log +64 -0
  178. package/docs/evaluations/correction-classification-2026-10-21/metrics-final.log +11 -0
  179. package/docs/evaluations/correction-classification-2026-10-21/native-final.log +57 -0
  180. package/docs/evaluations/correction-classification-2026-10-21/package-evidence.json +51 -0
  181. package/docs/evaluations/correction-classification-2026-10-21/timing-final.json +53 -0
  182. package/docs/evaluations/correction-classification-2026-10-21/verification.json +199 -0
  183. package/docs/guardrail.md +3 -3
  184. package/docs/harness-map.md +2 -0
  185. package/docs/micro-judge.md +34 -0
  186. package/guardrail/manifest.json +0 -22
  187. package/micro-judge/darwin-arm64/kiokuko-micro-judge +0 -0
  188. package/micro-judge/licenses/COPYRIGHT-Rust-1.85.0.txt +384 -0
  189. package/micro-judge/licenses/LICENSE-APACHE +176 -0
  190. package/micro-judge/licenses/LICENSE-MIT +23 -0
  191. package/micro-judge/licenses/manifest.json +5 -0
  192. package/micro-judge/manifest.json +15 -0
  193. package/micro-judge/native-acceptance-darwin-arm64.tap +118 -0
  194. package/micro-judge/native-verification-darwin-arm64.json +20 -0
  195. package/migrations/044_decision_diagnostics.sql +46 -0
  196. package/migrations/045_correction_classification.sql +11 -0
  197. package/package.json +13 -8
  198. package/scripts/guardrail-artifacts.mjs +0 -1
  199. package/scripts/verify-micro-judge.mjs +53 -0
  200. package/guardrail/x86_64-apple-darwin/kiokuko-guardrail +0 -0
  201. package/guardrail/x86_64-apple-darwin/manifest.json +0 -71
@@ -0,0 +1,122 @@
1
+ # Correction meaning classification (2026-10-21)
2
+
3
+ The implementation is complete as a shadow observation path. **Automatic production activation is not qualified.** Jev held-out special-rule precision is 86.54% and false-special rate is 7/75 = 9.33%; both miss the provisional release gates. No live configuration, installed plugin or production database was changed.
4
+
5
+ ## Source and design
6
+
7
+ Fetched DSH baseline: `01e27576d2efe5020c19e93bdba1a6528bfcaee1`. Fetched Kiokuko baseline: `5289ed72e347e65eb9a17d8b1d90f51958f8b333`. These remain HEAD; the implementation is an uncommitted working-tree diff. Final file digests and command evidence are in `evaluations/correction-classification-2026-10-21/verification.json`.
8
+
9
+ `correctionSource` no longer infers meaning with language-specific regex. The common `correction-classification` finite Choice contract admits `capability_compatibility`, `reference`, and explicit `uncertain` abstention. Input contains title, full body and summary; a summary never replaces the body. The configured DSH DecisionService dispatches the same contract through TypeSafe/Jev, Nimble or Laya. Existing request-intent classification remains independent. Laya v1 cannot attest internal truncation/model identity; its results remain advisory even in explicit auto mode. Strict adapter preflight runs before this purpose's inference.
10
+
11
+ Classification is host-owned metadata in an additive `correction_classifications` table (DSH migration 045, Kiokuko 015), separate from memory/provenance. The key includes workspace, entry ID, revision, semantic-input digest, policy and provider-configuration digest. Persisted results contain the rule, bounded reason, provider/model metadata where exposed, timing and token counts; raw correction text is not duplicated. Input digests exclude classifier output. Source-evidence digests also bind original provenance. Caller provenance is neither a cache nor classification authority.
12
+
13
+ Generation/capture remains unchanged. First eligible retrieval classifies explicit `interaction_capture` / `user_correction` entries. Existing legacy and duplicate recaptures enrich the existing entry on first use without rewriting its content/revision or creating competing memories. Both DSH core task and full host-adapter retrieval paths pass their existing DecisionService. Delivery carries observed classification plus source identity. Application still requires existing delivered/observed-input evidence, current source checks, capability confirmation and machine-verified execution authorization. `compatibilityDecisionConflicts` and the execution gates are unchanged.
14
+
15
+ Before any cache hit, the current persisted entry must match revision, full evidence, correction provenance, status and workspace. The same check runs inside the publication transaction after asynchronous inference. Deleted or changed entries return stale/uncertain; no obsolete result is published. Concurrent identical lookups on one connection share inference. Valid cache reuse works across reopening the database. Corrupt cache metadata fails closed.
16
+
17
+ Timeout, malformed output, provider outage, unsupported input and semantic abstention stay explicit and never become `reference`. Caller cancellation persists nothing. Successful and failure results are cached for unchanged keys; transient outages are not automatically retried until the host changes the cache/configuration/policy key or explicitly clears its own failed cache row. This deliberately avoids repeated model calls and is an operational limitation. There is no permanent regex fallback.
18
+
19
+ Default mode is `shadow`; optional host configuration is `typedDecisions.correctionClassification.mode = off | shadow | auto`. Global Typed Decisions off suppresses inference. In shadow, unavailable, stale, uncertain, off or insufficiently attested cases, exposed `source.rule` is `uncertain`, so special machine handling cannot start. An explicit auto option exists for controlled tests/experiments, but these results do not qualify it for production. A semantic label never grants execution authorization.
20
+
21
+ ## Kiokuko host boundary
22
+
23
+ Kiokuko has no existing DSH DecisionService or standalone semantic-provider configuration at this baseline. Its shared contract/cache implementation is byte-identical to DSH, and its strict MCP wire schema accepts uncertainty and classification metadata. A trusted configured host can reuse its existing neutral backend with:
24
+
25
+ ```ts
26
+ const classifier = createCorrectionEnrichment(cacheRuntime, configuredDecisionBackend, 'shadow')
27
+ const server = createChatgptMemoryServer(owner, {correctionClassifier: classifier})
28
+ ```
29
+
30
+ `cacheRuntime` is an explicitly host-owned writable cache connection; `owner` keeps the MCP profile's original access boundary. Provider configuration/credentials remain owned by the host, not MCP tool arguments. The live test supplies the existing configured DSH backend across this interface. Standalone Kiokuko CLI does not silently acquire a provider or credential configuration: absent injection it returns explicit uncertain/unavailable. This is a working injectable semantic integration, with a standalone default limitation; removing regex alone is not claimed as automatic provider parity. Main MCP keeps `modelInput: unobserved`, `verification: unverified`, and `authorizationGranted: false`.
31
+
32
+ ## Timing decision
33
+
34
+ The final-source Jev prototype used two new synthetic entries, 20 unchanged repeated reads, and one changed entry, all in a disposable database. Capture-time classification took 233.71 ms total (write 4.67 ms, inference 229.04 ms, 571 input tokens). First-use capture took 2.96 ms; its cold lookup took 155.61 ms (570 input tokens). Twenty cached reads averaged 0.949 ms and made zero provider calls. A changed entry caused one call (160.63 ms); retaining the old entry object returned stale.
35
+
36
+ First use was selected: capture stays independent of inference; corrections never retrieved incur no provider call; unchanged reads use durable metadata. These sequential point measurements justify the workflow choice, not a general throughput or model-speed claim. Actual full body remains subject to adapter admission; rejected/truncated-unattested inputs cannot become authoritative.
37
+
38
+ ## Live quality measurement
39
+
40
+ Existing authorized TypeSafe/Jev configuration was used with a process-local credential reference; no credential, private correction memory or persistent configuration was copied into evidence. Model: `jev-1.13.0`; policy: `correction-meaning-v1`; TypeSafe minimum confidence: 0.8. Development: 25 aligned cases across 5 semantic families, 25 correct. Held-out: **120 cases across 24 distinct semantic families and five aligned languages**; 45 special, 60 reference, 15 genuinely uncertain. Aligned translations are not 120 independent meanings. No held-out threshold/prompt tuning was performed.
41
+
42
+ Coverage includes positive paraphrases without version words, indirect and mixed-language wording, negation, quotations, opposing opinions, explanatory text, factual version/capability records, legitimate compiler minimums, reproducibility pins, CI prerequisites, runbooks, short/long input and lossy/contradictory summaries. The frozen historical regex remains only in the benchmark. It misclassifies relevant positives and hard negatives in the same corpus; it is never a production compatibility path.
43
+
44
+ | Metric | Jev held-out | Frozen regex |
45
+ | --- | --- | --- |
46
+ | Three-class accuracy | 107/120 = 89.17% | 52/120 = 43.33% |
47
+ | Special precision | 45/52 = 86.54% | 5/19 = 26.32% |
48
+ | Special recall | 45/45 = 100% | 5/45 = 11.11% |
49
+ | False-special rate | 7/75 = 9.33% | 14/75 = 18.67% |
50
+ | Abstention rate | 21/120 = 17.50% | 0/120 |
51
+ | Provider failure rate | 0/120 | 0/120 (no provider) |
52
+ | Classified coverage | 99/120 = 82.50% | 120/120 |
53
+ | Accuracy conditional on classified output | 92/99 = 92.93% | 52/120 = 43.33% |
54
+ | Mean / p50 / p95 latency | 165.69 / 157.47 / 210.28 ms | 0.000181 / 0.000145 / 0.000269 ms (CPU only) |
55
+ | Input tokens | 71,438 total; mean 595.32; reported 120/120 | 0 |
56
+
57
+ Accuracy counts abstain-on-gold-uncertain as correct: 15 of 21 abstentions are correct uncertain results; six are misses on gold reference. Thus 107 correct can exceed 99 classified outputs. Provider failures are separate from genuine uncertainty and never score correct. Positive abstentions/provider failures count as recall misses. The false-special denominator includes **all 75 gold non-special cases**, including 15 uncertain cases. Zero denominators are `null`, never a success.
58
+
59
+ Regex CPU timing used 20 warmups and 1,000 repetitions per each of the same 120 inputs. Repetitions add timing samples, not semantic coverage; CPU timing is not directly comparable with network/model/cache latency. The original raw report's zero baseline latency was an unmeasured placeholder; use `assessment.json` for the separately measured baseline. The runner now represents unmeasured baseline time as null.
60
+
61
+ Per-language binary results (`TP/FP/TN/FN`; each language has 9 special and 15 non-special cases):
62
+
63
+ | Method | Language | TP/FP/TN/FN | Precision | Recall | False-special / non-special | Correct / total | Abstention |
64
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
65
+ | Jev | ja | 9/1/14/0 | 90.00% | 100.00% | 1/15 (6.67%) | 22/24 | 16.67% |
66
+ | Jev | en | 9/1/14/0 | 90.00% | 100.00% | 1/15 (6.67%) | 22/24 | 16.67% |
67
+ | Jev | zh | 9/2/13/0 | 81.82% | 100.00% | 2/15 (13.33%) | 20/24 | 20.83% |
68
+ | Jev | ko | 9/2/13/0 | 81.82% | 100.00% | 2/15 (13.33%) | 22/24 | 12.50% |
69
+ | Jev | es | 9/1/14/0 | 90.00% | 100.00% | 1/15 (6.67%) | 21/24 | 20.83% |
70
+ | Frozen regex | ja | 1/3/12/8 | 25.00% | 11.11% | 3/15 (20.00%) | 10/24 | 0.00% |
71
+ | Frozen regex | en | 2/9/6/7 | 18.18% | 22.22% | 9/15 (60.00%) | 6/24 | 0.00% |
72
+ | Frozen regex | zh | 1/2/13/8 | 33.33% | 11.11% | 2/15 (13.33%) | 11/24 | 0.00% |
73
+ | Frozen regex | ko | 1/0/15/8 | 100.00% | 11.11% | 0/15 (0.00%) | 13/24 | 0.00% |
74
+ | Frozen regex | es | 0/0/15/9 | n/a | 0.00% | 0/15 (0.00%) | 12/24 | 0.00% |
75
+
76
+ Full three-class confusion matrices below use rows gold special/reference/uncertain. Each cell lists predicted `special/reference/uncertain/provider_failure` counts:
77
+
78
+ | Method | Language | Gold special | Gold reference | Gold uncertain |
79
+ | --- | --- | --- | --- | --- |
80
+ | Jev | all | 45/0/0/0 | 7/47/6/0 | 0/0/15/0 |
81
+ | Jev | ja | 9/0/0/0 | 1/10/1/0 | 0/0/3/0 |
82
+ | Jev | en | 9/0/0/0 | 1/10/1/0 | 0/0/3/0 |
83
+ | Jev | zh | 9/0/0/0 | 2/8/2/0 | 0/0/3/0 |
84
+ | Jev | ko | 9/0/0/0 | 2/10/0/0 | 0/0/3/0 |
85
+ | Jev | es | 9/0/0/0 | 1/9/2/0 | 0/0/3/0 |
86
+ | Frozen regex | all | 5/40/0/0 | 13/47/0/0 | 1/14/0/0 |
87
+ | Frozen regex | ja | 1/8/0/0 | 3/9/0/0 | 0/3/0/0 |
88
+ | Frozen regex | en | 2/7/0/0 | 8/4/0/0 | 1/2/0/0 |
89
+ | Frozen regex | zh | 1/8/0/0 | 2/10/0/0 | 0/3/0/0 |
90
+ | Frozen regex | ko | 1/8/0/0 | 0/12/0/0 | 0/3/0/0 |
91
+ | Frozen regex | es | 0/9/0/0 | 0/12/0/0 | 0/3/0/0 |
92
+
93
+ Provisional gates were precision >=95%, recall >=90%, false-special <=2%, with no sharply failing tested language. Precision and false-special gates fail overall; precision also fails in every tested language. Factual capability-failure records account for five false-special cases, and two runbook cases for the others. Keep production auto-enable off and observe in shadow. Five languages and small per-language samples do not establish arbitrary-language reliability or tight confidence bounds.
94
+
95
+ ## Evidence and verification
96
+
97
+ The immutable `held-out.json` was measured before the final cache-current-entry fix. Its SHA-256 is `11ba14264c4945d2e6dd15fc254cd81b4ed2bbc53b866c8bd90ea524d92e6c54`. Model-input contract digest remains `fc16c03dae9fac288f713acc0e1e64cdff2bc338600e8cf2b3b873441f63054e`; corpus digest remains `55350662ade98aaeb475829cfc5158828d629da2ac06ae72b93d959afb20c80d`. Prompt, model, policy, threshold and corpus were not changed after held-out evaluation. The old quality result is preserved, not relabeled as final-source evidence. Final-source live timing and main MCP handoff were rerun after the cache fix.
98
+
99
+ Final targeted checks on this Mac:
100
+
101
+ - DSH 35/35 selected unit/integration/adapter/contract/migration-assets checks passed; metrics-only follow-up 3/3 passed after clarifying unmeasured baseline time.
102
+ - DSH native consumer: 12/12 passed, covering public/adapter, delivered/dropped input and shadow/reference/uncertain/outage safety.
103
+ - Kiokuko 54/54 selected cache, MCP wire/consumer/capture and additive-migration checks passed.
104
+ - Both repositories' TypeScript noEmit checks passed.
105
+ - Both isolated source snapshots built. Compiled DSH + compiled Kiokuko product-pair passed four public/adapter delivery cases using actual Rust 1.99.1; scripted decision fixtures establish handoff/gating, not model accuracy.
106
+ - Runtime source files in those snapshots byte-matched final source. `npm pack --ignore-scripts --json` verified compiled common files and new migration assets in both packages. No install/publish occurred.
107
+ - Final live MCP handoff: two synthetic captures, two real Jev calls, zero repeat calls; observed special/reference both delivered as uncertain/shadow; unobserved/unverified/no authorization retained.
108
+
109
+ Tests cover persisted restart reuse; title/body/summary/revision/config invalidation; duplicate capture enrichment; concurrent mutation and retained old objects; deleted/foreign-workspace rows; malformed/timeout/outage/abstain; cancellation; corruption; legacy schema upgrades; reference not activating compatibility gates; strict Laya admission; full/core and main MCP wire consumers. The stale-object regression was observed red before adding the pre-cache current-entry check, then green in both implementations. Only disposable databases were migrated.
110
+
111
+ This is implemented, locally unit/integration tested, built-artifact tested and live measured. **GitHub CI/Linux is not tested for this uncommitted diff.** No new CI jobs or check weakening was introduced. Rust 1.99.1 local evidence is not Rust 1.85 CI evidence. No commit, push, version change, installed live-plugin change, global configuration change, live database migration or unrelated doctor repair was performed.
112
+
113
+ Reproduction (isolated Node 24 and existing dependencies; synthetic data only):
114
+
115
+ ```sh
116
+ node --import tsx scripts/evaluate-correction-classification.mjs --live --config /path/to/ephemeral-provider.json --split development --output /tmp/development.json
117
+ node --import tsx scripts/evaluate-correction-classification.mjs --live --config /path/to/ephemeral-provider.json --split held-out --output /tmp/held-out.json
118
+ node --import tsx scripts/evaluate-correction-classification.mjs --live --config /path/to/ephemeral-provider.json --split development --prototype-only --prototype --output /tmp/timing.json
119
+ node --import tsx scripts/verify-correction-mcp-live.mts /path/to/kiokuko /path/to/ephemeral-provider.json /tmp/live-mcp.json
120
+ ```
121
+
122
+ The host must supply its already-authorized process-local provider credential. The benchmark does not discover new credentials or grant external access. Exact targeted test arguments, build outcomes, final runtime hashes and package evidence are in the accompanying verification JSON. Frozen corpus and runner live in DSH; Kiokuko copies the shared results for cross-product evidence.
@@ -0,0 +1,60 @@
1
+ # 判断診断
2
+
3
+ `/kioku-decisions diagnostics` は、現在の native session の判断経路を SQLite の既存記録と関連付けて表示します。
4
+ `/kioku-decisions diagnostics <decision_id>` で一つの試行に絞れます。表示は読み取り専用のスナップショットで、モデル通信、再実行、migration、評価ラベルの追加を行いません。
5
+
6
+ ## 記録する経路
7
+
8
+ - `DecisionService` の受理済み batch の評価結果・fallback・cache hit。`DecisionObservation` と DB は同じ不変の `decisionId`、`requestRef`、`inputDigest` を使います。実際の provider 呼び出しは `providerDispatched` で区別します。
9
+ - 実 decoder が出した Choice 診断の確信度、上位確率、差、受理閾値、失敗した条件。cache hit で推論を行ったようには記録しません。
10
+ - 公開 adapter と Core の OnDemandIntake による現在の依頼参照、解釈、経路、確認質問、受理した UI 回答、native followup の再捕捉。モデルが提出する `requestIntent` schema に診断 ID の指定欄はありません。
11
+ - host が実際に run を束縛した admission。元の解釈が参照する task と新しい実行 run が異なる場合も、元の参照は書き換えません。
12
+ - 明示的な task resume/native session の所有権引き継ぎ。対象 session、task revision/generation、source epoch をその時点の DB から取得します。
13
+ - Enno operation receipt の既存 trigger が作った turn receipt/continuation outbox、未提出ターンと予測可能な失敗の既存取引。
14
+
15
+ 有効な型付き判定で必須項目が解決した実行候補は、原文と候補を独立した provider 呼び出しで照合し、同梱 Rust の有限領域制約で検査します。`semantic_match`/`detector` には実際の入力・出力 digest、実行ファイル hash、版、完全性、所要時間と結果を記録します。通常の request-intent 分類だけをこれらの成功として扱いません。説明・情報収集・未解決の必須項目では未実行、明示的な判定 OFF は `assessment_disabled`/`not_run`、有効な検査の障害は unavailable として区別します。制約・対象・revision と利用不能の扱いは [micro judge の契約](micro-judge.md) を参照してください。
16
+
17
+ ## 同一性と因果関係
18
+
19
+ migration 044 は `dsh_diagnostic_attempts`、`dsh_diagnostic_events`、`dsh_diagnostic_gaps`、`dsh_diagnostic_reviews` を追加します。既存の判断結果、task、Goal、native 会話は移し替えません。
20
+
21
+ 試行 ID は host が発行し不変です。イベントは試行内の連番を DB の writer transaction で割り当てます。同じ event ID と正規化後の同じ内容だけを再送として受理し、異なる内容や別の試行への使い回しを拒否します。質問→回答→再開には同じ試行内の正しい親イベントが必要です。既に受理した質問への別回答は別の内容で上書きできません。受理した native 回答から新しい入力を再捕捉すると、resume の `nextDecisionId` が新しい試行へ接続します。同一 session の後続 turn で、その回答の message ID digest を入力参照に含む試行だけを結べます。これにより確認前の判定と、最新回答からの再判定を同じ lineage で追跡します。
22
+
23
+ 入力・context digest、task revision/generation、source epoch、取得できる workflow/Goal/scope revision を束縛します。新しいイベントの古い束縛は記録できません。再開の新しい束縛は既存 task の実際の状態から取得します。再起動後も質問・回答 ID の digest から関連を復元します。別 session の同名回答を同一回答として再利用しません。既に記録されたイベントの正確な再送は履歴の再利用であり、現在の実行権限にはなりません。
24
+
25
+ provider の試行 ID は extraction イベントの `evaluationDecisionId` に関連付けます。加えて、同じ依頼に属する独立した評価を `providerAttempts` に表示します。同じ依頼に属することだけで、その評価を別の試行の結果や実行権限とは扱いません。
26
+
27
+ ## 秘密・本文を複製しない
28
+
29
+ 診断表には、依頼原文、質問本文、回答本文、ツール結果本文、認証情報、provider の生エラーを保存しません。原文・参照・モデル・provider 版・方針は digest または既存の ID への参照で関連付けます。Choice の質問・選択肢も digest で表します。モデル名などの実際の設定・結果を確認する場合は、`resultRef` の指す既存 `dsh_decision_results(request_id,input_digest)` と `dsh_decision_bindings` を参照します。
30
+
31
+ reason は有限の code だけを許可します。session、task、receipt、outbox の参照は host が確認した既存 ID から取得し、モデル自由文を理由や新しい ID に変換しません。表示にも原文や outbox message 本文を出しません。
32
+
33
+ ## 診断の障害と取引
34
+
35
+ 診断を許可・停止・完了判定の入力として使用しません。診断の追記は保存点で隔離し、記録エラーが既存処理を中止したり、実行権限や偽の完了を作ったりしないようにします。
36
+
37
+ Enno の完了 receipt、未提出・失敗の receipt/outbox、task resume/引き継ぎへの追記は、同じ DB の既存の取引内で行います。外側の rollback は診断も取り消します。判断 cache 保存や native UI/followup との記録は別の観測点です。native 会話ログと SQLite、または別 DB 間の atomicity は主張しません。
38
+
39
+ 保存点の失敗は、可能なら `dsh_diagnostic_gaps` に内容を含まない code を記録します。DB 全体が利用不能な場合はプロセス内の loss count と表示の `DIAGNOSTIC_UNAVAILABLE` で区別します。診断表示は次を分けます。
40
+
41
+ - `persistedGaps`: DB 全体に保存された欠損件数。特定 session だけの件数ではありません。
42
+ - `volatileLosses`/`runtimeLosses`: プロセス内で観測した書き込み/DB 利用の失敗。再起動で消えます。
43
+ - `missingReceiptLinks`/`missingContinuationLinks`: 表示対象の試行について、確定済みの既存行に対応する診断イベントがない件数。記録前の host crash も、元の receipt/outbox が残っていれば検出できます。
44
+ - `authoritativeLinks`: 既存 receipt/outbox の現在の ID、対象 session、状態。診断イベントの存在だけから配信成功とは推定しません。
45
+
46
+ 診断表示は直近100試行、同じ依頼の provider 評価は各20試行までです。履歴全件の集計値と表示対象の欠損数は異なる範囲です。上限到達は `truncated` で示します。
47
+
48
+ ## 評価と保持
49
+
50
+ 停止事例は実際に確認質問を記録した試行です。`reviewDiagnosticStop` は独立した人間レビュー/テスト oracle の参照 digest による評価用 API で、モデル tool や診断表示からは呼べません。再開できたことや最後まで処理できたことから正解を自動ラベル付けしません。
51
+
52
+ `falseStopRate = falseStops / evaluated`。未評価なら `null` です。`evaluationRate = evaluated / stopped` は別に表示し、停止事例そのものがなければ `null` です。ラベルの黙った変更・上書きは認めません。
53
+
54
+ 既存の判断結果は永続保存され、自動 TTL 削除の仕様はありません(`docs/model-selection.ja.md` の共有判定 cache 参照)。今回も独自の削除期限・本番 prune は追加していません。診断行は関連 run または試行の削除に従って cascade しますが、既存テーブルの削除制約は維持します。保留中の質問を経過時間や再起動だけで消しません。cascade、保留状態、再起動をテスト DB で検証し、本番 DB の直接 migration や削除は行いません。
55
+
56
+ ## 検証入口
57
+
58
+ node scripts/run-tests.mjs tests/dsh/integration/decision-diagnostics.test.ts tests/dsh/integration/decision-diagnostics-native.test.ts tests/dsh/integration/request-intent-clarification-native.test.ts tests/dsh/integration/request-intent-clarification-adapter-native.test.ts tests/dsh/integration/turn-process.test.ts
59
+
60
+ native 試験は実際の DSH model loop/質問サービス/ファイル読み取り経路を使い、モデルと provider・UI 回答は scripted fixture です。実モデルの意味判断品質やインストール済みプラグインの更新を証明するものではありません。
@@ -604,6 +604,48 @@ scripted offline fixture: this checks host integration, not real-model behavior.
604
604
  paths and versions are recorded with the result. Missing prerequisites and
605
605
  runtime errors fail the runner rather than count as successful acceptance.
606
606
 
607
+ The same runner also has an explicit `source` stage for the existing Linux
608
+ consumer lane and macOS runtime job. It loads the current Kiokuko build and the
609
+ pinned `@askdkc/dsh-cli@0.14.11` bundle through source patch overlays, using the
610
+ canonical DSH fixture and a private profile. This stage performs no package
611
+ operations and does not prove installation or registry-update behavior. The
612
+ npm/pnpm consumer checks and packed module/Skills checks remain separate.
613
+ The terminal run checks task completion rejection without evidence, task
614
+ wait/resume, model-switch state transfer, persisted task recovery, and clean
615
+ exit as well as ordinary input, cancellation and Lisp evaluation. It declines
616
+ the fixture's derived-memory proposal through the native terminal UI.
617
+ A cold model continuation can retain its ancestor's protection while Lisp is
618
+ disabled for the current session. Task resume changes task state only. The
619
+ runner checks that input stays blocked, invokes the displayed
620
+ `/kioku-lisp enable` recovery command, and then verifies admitted input.
621
+
622
+ CI uses a source-bound selected plan. Known application changes run five jobs:
623
+ selection, one Linux native build, combined Linux core/Lisp checks, combined
624
+ consumer/runtime/terminal checks, and the required aggregate. UI changes add
625
+ the browser job. Host/platform boundaries add the affected CPU/OS checks.
626
+ Only genuine prose documentation can select the two lightweight jobs; Skills
627
+ Markdown remains runtime input. Dependency, exports, package, build, test or
628
+ verification changes, releases and manual runs select complete CI coverage.
629
+ Unknown paths, unavailable/empty diffs, renames and deletions also select full.
630
+ Consequently this CI/fixture repair itself selects full coverage.
631
+
632
+ Full mode has 27 jobs, including selection, and 22 required verification
633
+ reports. It retains all Main partitions, all four Lisp partitions on each OS,
634
+ three semantic platforms, macOS runtime and browser coverage. Lisp still tests
635
+ `macos-latest`; source and packed Skills remain separate. Ordinary mode has
636
+ two required reports, each combining existing checks with a shared build.
637
+ Required selected jobs cannot be missing, skipped, failed or cancelled.
638
+ Unselected jobs remain explicitly unselected, never reported as executed tests.
639
+
640
+ The fixture declares exact DSH, terminal UI and headless-terminal versions in
641
+ one npm lockfile and uses one normal `npm ci`, preserving the DSH peer graph.
642
+ Native test artifacts bind to the selected commit, source, contract and
643
+ Node/npm/Rust toolchain. Representative bundles remove unselected binaries,
644
+ carry their limited scope, and cannot become complete release-review artifacts.
645
+ Only full-mode consumer verification retains a release-review tarball. Local
646
+ host validation plans have a separate scope and are rejected by GitHub CI.
647
+ Future GitHub runs are still needed to measure actual runner usage.
648
+
607
649
  The compatibility coverage is:
608
650
 
609
651
  | Harness profile | Status |