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,118 @@
1
+ TAP version 13
2
+ # Subtest: typed finite domains preserve unknown and reject integer truthiness and unbounded graphs
3
+ ok 1 - typed finite domains preserve unknown and reject integer truthiness and unbounded graphs
4
+ ---
5
+ duration_ms: 0.615416
6
+ type: 'test'
7
+ ...
8
+ # Subtest: independent source comparison uses a distinct purpose and source, not extraction probabilities
9
+ ok 2 - independent source comparison uses a distinct purpose and source, not extraction probabilities
10
+ ---
11
+ duration_ms: 2.127416
12
+ type: 'test'
13
+ ...
14
+ # Subtest: missing or unsupported binary is explicit unavailable, never an allow
15
+ ok 3 - missing or unsupported binary is explicit unavailable, never an allow
16
+ ---
17
+ duration_ms: 7.25125
18
+ type: 'test'
19
+ ...
20
+ # Subtest: corrupt executable is rejected before spawning
21
+ ok 4 - corrupt executable is rejected before spawning
22
+ ---
23
+ duration_ms: 2.971292
24
+ type: 'test'
25
+ ...
26
+ # Subtest: actual packaged executable distinguishes all four complete statuses and incomplete budget exhaustion
27
+ ok 5 - actual packaged executable distinguishes all four complete statuses and incomplete budget exhaustion
28
+ ---
29
+ duration_ms: 19.495125
30
+ type: 'test'
31
+ ...
32
+ # Subtest: actual Rust MRV 4 queens has 2 solutions
33
+ ok 6 - actual Rust MRV 4 queens has 2 solutions
34
+ ---
35
+ duration_ms: 2.232583
36
+ type: 'test'
37
+ ...
38
+ # Subtest: actual Rust MRV 6 queens has 4 solutions
39
+ ok 7 - actual Rust MRV 6 queens has 4 solutions
40
+ ---
41
+ duration_ms: 3.096167
42
+ type: 'test'
43
+ ...
44
+ # Subtest: actual Rust MRV 8 queens has 92 solutions
45
+ ok 8 - actual Rust MRV 8 queens has 92 solutions
46
+ ---
47
+ duration_ms: 14.89725
48
+ type: 'test'
49
+ ...
50
+ # Subtest: actual Rust agrees with an independent exhaustive oracle on 200 deterministic small problems
51
+ ok 9 - actual Rust agrees with an independent exhaustive oracle on 200 deterministic small problems
52
+ ---
53
+ duration_ms: 401.608666
54
+ type: 'test'
55
+ ...
56
+ # Subtest: all eight proposals with current Task and Goal fit the declared host bounds
57
+ ok 10 - all eight proposals with current Task and Goal fit the declared host bounds
58
+ ---
59
+ duration_ms: 4.827292
60
+ type: 'test'
61
+ ...
62
+ # Subtest: host source/candidate relation graph detects stale source and preserves semantic unknown
63
+ ok 11 - host source/candidate relation graph detects stale source and preserves semantic unknown
64
+ ---
65
+ duration_ms: 9.531958
66
+ type: 'test'
67
+ ...
68
+ # Subtest: subprocess malformed is explicit unavailable
69
+ ok 12 - subprocess malformed is explicit unavailable
70
+ ---
71
+ duration_ms: 37.859208
72
+ type: 'test'
73
+ ...
74
+ # Subtest: subprocess version is explicit unavailable
75
+ ok 13 - subprocess version is explicit unavailable
76
+ ---
77
+ duration_ms: 37.804167
78
+ type: 'test'
79
+ ...
80
+ # Subtest: subprocess digest is explicit unavailable
81
+ ok 14 - subprocess digest is explicit unavailable
82
+ ---
83
+ duration_ms: 37.819916
84
+ type: 'test'
85
+ ...
86
+ # Subtest: subprocess output_limit is explicit unavailable
87
+ ok 15 - subprocess output_limit is explicit unavailable
88
+ ---
89
+ duration_ms: 34.880125
90
+ type: 'test'
91
+ ...
92
+ # Subtest: subprocess timeout is explicit unavailable
93
+ ok 16 - subprocess timeout is explicit unavailable
94
+ ---
95
+ duration_ms: 103.301083
96
+ type: 'test'
97
+ ...
98
+ # Subtest: subprocess process_failed is explicit unavailable
99
+ ok 17 - subprocess process_failed is explicit unavailable
100
+ ---
101
+ duration_ms: 40.533209
102
+ type: 'test'
103
+ ...
104
+ # Subtest: explicit typed-decision OFF does not fabricate a solver verdict; missing enabled provider is unavailable
105
+ ok 18 - explicit typed-decision OFF does not fabricate a solver verdict; missing enabled provider is unavailable
106
+ ---
107
+ duration_ms: 4.572541
108
+ type: 'test'
109
+ ...
110
+ 1..18
111
+ # tests 18
112
+ # suites 0
113
+ # pass 18
114
+ # fail 0
115
+ # cancelled 0
116
+ # skipped 0
117
+ # todo 0
118
+ # duration_ms 1069.852792
@@ -0,0 +1,20 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "platform": "darwin",
4
+ "arch": "arm64",
5
+ "target": "aarch64-apple-darwin",
6
+ "binarySha256": "03b8b94e8a0bd243056e633e6048bf292f9e8fcecb0327c3e93c1b2ee11811e0",
7
+ "sourceDigest": "fb105717ea188e0a2c47f0b469b8f0f9761fd058f28d6eecf68ffe171188dfcf",
8
+ "compiler": "rustc 1.85.0 (4d91de4e4 2025-02-17)",
9
+ "exitCode": 0,
10
+ "summary": {
11
+ "tests": 18,
12
+ "pass": 18,
13
+ "fail": 0,
14
+ "cancelled": 0,
15
+ "skipped": 0,
16
+ "todo": 0
17
+ },
18
+ "log": "native-acceptance-darwin-arm64.tap",
19
+ "logSha256": "c9363791f66864da5b5752c090a9c6e48d6ce4505746ee6b8390f16e133ff825"
20
+ }
@@ -0,0 +1,46 @@
1
+ -- Advisory provenance only. No diagnostic row is execution authority.
2
+ CREATE TABLE dsh_diagnostic_attempts (
3
+ decision_id TEXT PRIMARY KEY,
4
+ request_ref TEXT NOT NULL,
5
+ session_id TEXT,
6
+ native_turn INTEGER,
7
+ run_id TEXT REFERENCES ledger_runs(run_id) ON DELETE CASCADE,
8
+ input_digest TEXT NOT NULL,
9
+ document_json TEXT NOT NULL CHECK(json_valid(document_json) AND length(document_json)<=16384),
10
+ document_digest TEXT NOT NULL,
11
+ created_at TEXT NOT NULL
12
+ );
13
+ CREATE INDEX dsh_diagnostic_request ON dsh_diagnostic_attempts(request_ref,created_at);
14
+ CREATE INDEX dsh_diagnostic_session ON dsh_diagnostic_attempts(session_id,native_turn);
15
+ CREATE TABLE dsh_diagnostic_events (
16
+ event_id TEXT PRIMARY KEY,
17
+ decision_id TEXT NOT NULL REFERENCES dsh_diagnostic_attempts(decision_id) ON DELETE CASCADE,
18
+ sequence INTEGER NOT NULL CHECK(sequence>0),
19
+ kind TEXT NOT NULL,
20
+ parent_event_id TEXT,
21
+ reference_digest TEXT,
22
+ target_session_id TEXT,
23
+ document_json TEXT NOT NULL CHECK(json_valid(document_json) AND length(document_json)<=16384),
24
+ document_digest TEXT NOT NULL,
25
+ created_at TEXT NOT NULL,
26
+ UNIQUE(decision_id,sequence), UNIQUE(decision_id,event_id),
27
+ FOREIGN KEY(decision_id,parent_event_id) REFERENCES dsh_diagnostic_events(decision_id,event_id)
28
+ );
29
+ CREATE INDEX dsh_diagnostic_reference ON dsh_diagnostic_events(reference_digest,kind);
30
+ CREATE TABLE dsh_diagnostic_gaps (
31
+ gap_id TEXT PRIMARY KEY, scope_ref TEXT NOT NULL,
32
+ reason TEXT NOT NULL CHECK(reason IN ('recording_failed','stale_binding','causal_conflict')),
33
+ created_at TEXT NOT NULL
34
+ );
35
+ CREATE TABLE dsh_diagnostic_reviews (
36
+ decision_id TEXT PRIMARY KEY REFERENCES dsh_diagnostic_attempts(decision_id) ON DELETE CASCADE,
37
+ verdict TEXT NOT NULL CHECK(verdict IN ('false_stop','justified_stop')),
38
+ review_ref TEXT NOT NULL,
39
+ created_at TEXT NOT NULL
40
+ );
41
+ CREATE TRIGGER dsh_diagnostic_attempt_immutable BEFORE UPDATE ON dsh_diagnostic_attempts
42
+ BEGIN SELECT RAISE(ABORT,'diagnostic attempt is immutable'); END;
43
+ CREATE TRIGGER dsh_diagnostic_event_immutable BEFORE UPDATE ON dsh_diagnostic_events
44
+ BEGIN SELECT RAISE(ABORT,'diagnostic event is immutable'); END;
45
+ CREATE TRIGGER dsh_diagnostic_review_immutable BEFORE UPDATE ON dsh_diagnostic_reviews
46
+ BEGIN SELECT RAISE(ABORT,'diagnostic review is immutable'); END;
@@ -0,0 +1,11 @@
1
+ -- Host-owned, content-bound enrichment; never duplicates correction text or mutates a memory revision.
2
+ CREATE TABLE correction_classifications (
3
+ workspace TEXT NOT NULL,
4
+ entry_id TEXT NOT NULL REFERENCES entries(id) ON DELETE CASCADE,
5
+ entry_revision INTEGER NOT NULL CHECK(entry_revision > 0),
6
+ input_digest TEXT NOT NULL,
7
+ policy_version TEXT NOT NULL,
8
+ configuration_digest TEXT NOT NULL,
9
+ result_json TEXT NOT NULL,
10
+ PRIMARY KEY(workspace,entry_id,entry_revision,input_digest,policy_version,configuration_digest)
11
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiokuko-dsh",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "Kiokuko plugin for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -47,6 +47,8 @@
47
47
  "scripts/answer-review-evaluation.d.mts",
48
48
  "scripts/verification-completion.mjs",
49
49
  "guardrail/",
50
+ "micro-judge/",
51
+ "scripts/verify-micro-judge.mjs",
50
52
  "scripts/guardrail-artifacts.mjs",
51
53
  "scripts/guardrail-artifacts.d.mts"
52
54
  ],
@@ -115,7 +117,8 @@
115
117
  "Selected session repository status, staged and working-tree diffs, and explicitly selected untracked files for Diff review",
116
118
  "AgenticReplay traces belonging to the exact native DSH session",
117
119
  "Stored native DSH session IDs and histories for startup validation and legacy Kiokuko compatibility",
118
- "Bundled Rust guardrail manifests, bounded protocol and exact precompiled host artifact for explicitly enrolled TDD units"
120
+ "Bundled Rust guardrail manifests, bounded protocol and exact precompiled host artifact for explicitly enrolled TDD units",
121
+ "Bundled finite-domain micro-judge manifest, native verification receipt and exact platform artifact"
119
122
  ],
120
123
  "writePaths": [
121
124
  "Seventeen bundled managed Skills and references under ~/.agents/skills on enabled plugin load",
@@ -131,7 +134,8 @@
131
134
  "Restricted repository-relative verifier and backup subprocesses when explicitly requested",
132
135
  "Read-only fixed-argument Git commands for an explicitly captured Diff review",
133
136
  "Owned bash/zsh, PATH commands, builds/tests and Lisp with the normal user environment; explicit protected Lisp compatibility mode remains available",
134
- "Bundled Rust guardrail check/validate and the host-owned Node test runner for explicitly enrolled bounded TDD units; no download, Cargo, SBCL or PATH engine fallback"
137
+ "Bundled Rust guardrail check/validate and the host-owned Node test runner for explicitly enrolled bounded TDD units; no download, Cargo, SBCL or PATH engine fallback",
138
+ "Bundled finite-domain micro judge for resolved request candidates through bounded stdin/stdout with deadlines; no automatic compiler, download or PATH fallback"
135
139
  ],
136
140
  "externalServices": [
137
141
  "GitHub or skills.sh for optional Skill discovery and source retrieval",
@@ -139,7 +143,7 @@
139
143
  "DSH-configured model providers for explicitly started Deep planning and its budgeted memory extraction",
140
144
  "The explicitly selected DSH model provider for a user-started Diff review without tools",
141
145
  "DSH-configured model provider for automatic memory review (active by default, up to 12 worker dispatches per project per UTC day), ordinary finalization and configured memory evolution",
142
- "Configured TypeSafe fixed endpoint or explicit Nimble HTTPS/loopback endpoint for automatic task/Skill/draft decisions, projected memory reuse after a synthetic readiness probe, and Lisp; no redirects, retries or provider substitution; exact roles.check no-tool fallback for complete draft review",
146
+ "Configured TypeSafe fixed endpoint or explicit Nimble HTTPS/loopback endpoint for automatic task/Skill/draft decisions and independent original-source/candidate comparison, projected memory reuse after a synthetic readiness probe, and Lisp; no redirects, retries or provider substitution; exact roles.check no-tool fallback for complete draft review",
143
147
  "Explicit Laya-CoreML Unix socket for local finite decisions using the existing v1 worker or optional strict operations; no subprocess client, automatic worker startup, model downloads or provider substitution",
144
148
  "DSH-configured admitted provider/model for default-active source-backed index reasoning: up to 8 worker dispatches per workspace per UTC day; no retrieval-time generation or automatic resend of uncertain dispatches",
145
149
  "User-configured AI API endpoints and vendored provider OAuth flows through Kiokuko Models"
@@ -155,7 +159,8 @@
155
159
  "Remote embedding is disabled by default and unavailable services do not become normal success",
156
160
  "Ordinary memory finalization failures are retryable; uncertain Deep requests are never automatically resent. Neither can veto completion or session-log export",
157
161
  "AgenticReplay is configured by default; capture requires a session choice or start command, adds no network transmission, and cannot veto native outcomes",
158
- "Explicitly enrolled bounded TDD units fail closed on absent/invalid guardrail artifacts or stale authority/receipt bindings; only Linux x64 has native engine verification, other bundled targets are cross-built"
162
+ "Explicitly enrolled bounded TDD units fail closed on absent/invalid guardrail artifacts or stale authority/receipt bindings; only Linux x64 has native engine verification, other bundled targets are cross-built",
163
+ "Enabled source-candidate assessment distinguishes unavailable and incomplete checks from proof; the micro judge is native-verified on Apple Silicon macOS only, unsupported platforms report unavailable, and explicit typed-decision OFF records no assessment"
159
164
  ],
160
165
  "lifecycleEvidence": [
161
166
  "prepare runs only npm run build",
@@ -166,7 +171,7 @@
166
171
  },
167
172
  "scripts": {
168
173
  "clean:dist": "node --input-type=module --eval \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"",
169
- "build": "npm run clean:dist && tsc -p tsconfig.build.json && node scripts/build-model-transports.mjs && node scripts/compile-skill-prompts.mjs && node scripts/build-dsh-client.mjs && node scripts/build-history-codecs.mjs && node scripts/build-plugin-entry.mjs && node scripts/guardrail-artifacts.mjs --verify-bundled --quiet",
174
+ "build": "npm run clean:dist && tsc -p tsconfig.build.json && node scripts/build-model-transports.mjs && node scripts/compile-skill-prompts.mjs && node scripts/build-dsh-client.mjs && node scripts/build-history-codecs.mjs && node scripts/build-plugin-entry.mjs && node scripts/guardrail-artifacts.mjs --verify-bundled --quiet && node scripts/verify-micro-judge.mjs",
170
175
  "typecheck": "tsc -p tsconfig.json --noEmit",
171
176
  "test": "node scripts/run-tests.mjs tests/dsh",
172
177
  "test:harness": "node --import tsx scripts/run-harness-evaluation.mjs",
@@ -341,8 +346,8 @@
341
346
  },
342
347
  "guardrail": {
343
348
  "manifest": "guardrail/manifest.json",
344
- "manifestSha256": "0a48e29154e1bf498254dbeb4073d16a6526d1e27019e3e21d490d9c179048e4",
345
- "availability": "Bundled Linux x64/arm64 static musl and macOS x64/arm64; only Linux x64 native smoke verified. Missing or invalid host artifact blocks protocol enrollment.",
349
+ "manifestSha256": "8da49d55f6bb7b8ccf2717f6680e439adda3d7347fb77de39f77566dd6a6d2b1",
350
+ "availability": "Bundled Linux x64/arm64 static musl and macOS Apple Silicon (ARM64). Intel Mac is unsupported. Only Linux x64 native smoke was recorded for the bundled release. Missing or invalid host artifact blocks protocol enrollment.",
346
351
  "verification": "npm run verify:guardrail validates bundled identities without executing cross-built binaries; npm run check:guardrail checks current host availability."
347
352
  }
348
353
  }
@@ -6,7 +6,6 @@ import { fileURLToPath } from 'node:url'
6
6
  const targets = Object.freeze({
7
7
  'linux:x64': 'x86_64-unknown-linux-musl',
8
8
  'linux:arm64': 'aarch64-unknown-linux-musl',
9
- 'darwin:x64': 'x86_64-apple-darwin',
10
9
  'darwin:arm64': 'aarch64-apple-darwin',
11
10
  })
12
11
  const digest = bytes => createHash('sha256').update(bytes).digest('hex')
@@ -0,0 +1,53 @@
1
+ // Verify packaged identities without compiling, downloading or changing state.
2
+ import assert from 'node:assert/strict'
3
+ import { createHash } from 'node:crypto'
4
+ import { spawnSync } from 'node:child_process'
5
+ import { lstat, readFile } from 'node:fs/promises'
6
+ import { join, resolve } from 'node:path'
7
+ const root=resolve(process.argv.find(a=>a.startsWith('--root='))?.slice(7)??resolve(import.meta.dirname,'..'))
8
+ const hash=bytes=>createHash('sha256').update(bytes).digest('hex')
9
+ const manifest=JSON.parse(await readFile(join(root,'micro-judge/manifest.json'),'utf8'))
10
+ assert.equal(manifest.version,'kiokuko-fd-v1');assert.ok(Array.isArray(manifest.artifacts)&&manifest.artifacts.length<=3)
11
+ const platforms=new Set();let executedNative=false
12
+ let sourceDigest
13
+ try {sourceDigest=hash(Buffer.concat(await Promise.all(['Cargo.toml','src/main.rs','src/digest.rs'].map(file=>readFile(join(root,'crates/micro-judge',file))))))}catch(error){if(error.code!=='ENOENT')throw error}
14
+ const licenses=JSON.parse(await readFile(join(root,'micro-judge/licenses/manifest.json'),'utf8'))
15
+ assert.deepEqual(Object.keys(licenses).sort(),['COPYRIGHT-Rust-1.85.0.txt','LICENSE-APACHE','LICENSE-MIT'])
16
+ for(const [name,digest]of Object.entries(licenses))assert.equal(hash(await readFile(join(root,'micro-judge/licenses',name))),digest)
17
+ for(const entry of manifest.artifacts){
18
+ const key=`${entry.platform}-${entry.arch}`;assert.ok(!platforms.has(key));platforms.add(key)
19
+ assert.ok(['darwin-arm64','linux-arm64','linux-x64'].includes(key))
20
+ assert.equal(entry.file,`${key}/kiokuko-micro-judge${entry.platform==='win32'?'.exe':''}`)
21
+ for(const path of [join(root,'micro-judge'),join(root,'micro-judge',key)]){const stat=await lstat(path);assert.ok(stat.isDirectory()&&!stat.isSymbolicLink())}
22
+ const file=join(root,'micro-judge',entry.file),stat=await lstat(file)
23
+ assert.ok(stat.isFile()&&!stat.isSymbolicLink()&&stat.size<8000000);assert.equal(stat.size,entry.bytes)
24
+ const bytes=await readFile(file);assert.equal(hash(bytes),entry.sha256);if(sourceDigest)assert.equal(entry.sourceDigest,sourceDigest,'Artifact source digest must match current crate')
25
+ assert.equal(entry.nativeVerified,true,'Only artifacts with native acceptance evidence may be packaged')
26
+ const receipt=JSON.parse(await readFile(join(root,`micro-judge/native-verification-${key}.json`),'utf8'))
27
+ assert.equal(receipt.binarySha256,entry.sha256);assert.equal(receipt.sourceDigest,entry.sourceDigest)
28
+ if(receipt.schemaVersion===1){
29
+ assert.equal(receipt.platform,entry.platform);assert.equal(receipt.arch,entry.arch);assert.equal(receipt.compiler,entry.compiler);assert.equal(receipt.exitCode,0)
30
+ assert.equal(receipt.log,`native-acceptance-${key}.tap`)
31
+ const logPath=join(root,'micro-judge',receipt.log),info=await lstat(logPath);assert.ok(info.isFile()&&!info.isSymbolicLink()&&info.size<8000000)
32
+ const log=await readFile(logPath);assert.equal(hash(log),receipt.logSha256)
33
+ assert.ok(receipt.summary.tests>=18);assert.equal(receipt.summary.tests,receipt.summary.pass)
34
+ for(const name of ['tests','pass','fail','cancelled','skipped','todo']){
35
+ const matches=[...log.toString().matchAll(new RegExp(`^# ${name} (\\d+)$`,'gm'))];assert.equal(matches.length,1);assert.equal(Number(matches[0][1]),receipt.summary[name]);if(!['tests','pass'].includes(name))assert.equal(receipt.summary[name],0)
36
+ }
37
+ }
38
+ if(entry.platform==='darwin'){assert.equal(bytes.subarray(0,4).toString('hex'),'cffaedfe');assert.equal(bytes.readUInt32LE(4),entry.arch==='arm64'?0x100000c:0x1000007)}
39
+ if(entry.platform==='linux'){assert.equal(bytes.subarray(0,4).toString('hex'),'7f454c46');assert.equal(bytes[4],2);assert.equal(bytes[5],1);assert.equal(bytes.readUInt16LE(18),entry.arch==='arm64'?183:62)}
40
+ if(entry.platform===process.platform&&entry.arch===process.arch&&process.argv.includes('--execute')){
41
+ const version=spawnSync(file,['--version'],{encoding:'utf8',timeout:1500,maxBuffer:16384,env:{}})
42
+ assert.equal(version.status,0);assert.equal(version.stdout.trim(),'kiokuko-micro-judge 0.1.0 kiokuko-fd-v1')
43
+ const payload='2000 1 0 b 2 0 1 @0',id=hash(Buffer.from('packaged-probe')),digest=hash(Buffer.from(payload))
44
+ const executed=spawnSync(file,[],{input:`kiokuko-fd-v1\t${id}\t${digest}\t${payload}\n`,encoding:'utf8',timeout:1500,maxBuffer:16384,env:{}})
45
+ assert.equal(executed.status,0);const result=JSON.parse(executed.stdout)
46
+ assert.equal(result.version,manifest.version);assert.equal(result.inputDigest,digest);assert.equal(result.inputId,id);assert.equal(result.status,'undetermined');assert.equal(result.complete,true)
47
+ executedNative=true
48
+ console.log(JSON.stringify({platform:key,binarySha256:entry.sha256,version:version.stdout.trim(),actualExecution:true}))
49
+ }
50
+ }
51
+ if(!manifest.artifacts.length)throw new Error('No verified micro-judge artifacts bundled')
52
+
53
+ if(process.argv.includes('--execute')&&!executedNative){console.log(JSON.stringify({platform:`${process.platform}-${process.arch}`,actualExecution:false,reason:'unsupported_platform'}));process.exitCode=2}
@@ -1,71 +0,0 @@
1
- {
2
- "artifacts": {
3
- "README.md": {
4
- "bytes": 10748,
5
- "sha256": "4b5d7c785121c865945f6379de31565c6aa9218f9d4333519ce3d450e85d0c55"
6
- },
7
- "bin/kiokuko-guardrail": {
8
- "bytes": 414856,
9
- "sha256": "673e9b26eda59ba18e217034c6502daa65a2ab10f22403685c4aaf42181631f0"
10
- },
11
- "protocols/coding-routine.lisp": {
12
- "bytes": 948,
13
- "sha256": "82b56af81d12a8cab8352b0825c913f00f73708b2339a9b567cc6f4d4e52da49"
14
- }
15
- },
16
- "build_inputs": {
17
- "cargo_sha256": "e951141cc55a6cd7b9876d187bd30a3720e6086b99413af95e3b8de1cdd72f14",
18
- "cargo_version": "cargo 1.99.0 (5f94df478 2026-08-27)",
19
- "command": [
20
- "env",
21
- "SOURCE_DATE_EPOCH=0",
22
- "MACOSX_DEPLOYMENT_TARGET=13.0",
23
- "LD_LIBRARY_PATH=RUST_TOOLCHAIN/lib",
24
- "RUSTFLAGS=--remap-path-prefix=SOURCE=kiokuko-guardrail --remap-path-prefix=TEMP=build",
25
- "LINKER=zig-0.17.0-cc-strip-target-x86_64-macos.13.0.0",
26
- "cargo",
27
- "build",
28
- "--manifest-path",
29
- "Cargo.toml",
30
- "--locked",
31
- "--offline",
32
- "--release",
33
- "--target",
34
- "x86_64-apple-darwin"
35
- ],
36
- "rustc_sha256": "f3834d26669b03f6855fa54bd2381443123e860167bc0c7a8dd137e5cf6e5e4f",
37
- "rustc_version": "rustc 1.99.0 (b940084d7 2026-09-28)\nbinary: rustc\ncommit-hash: b940084d7eb6a299eb4bfeb8e34901bc051e7ac4\ncommit-date: 2026-09-28\nhost: x86_64-unknown-linux-gnu\nrelease: 1.99.0\nLLVM version: 23.1.1",
38
- "source_date_epoch": 0,
39
- "target": "x86_64-apple-darwin"
40
- },
41
- "package": "kiokuko-guardrail",
42
- "schema": 1,
43
- "scope": "Declared source/compiler/build inputs and artifact identity. This is not a signature, sandbox, or a claim of deterministic model inference or identical binaries across target operating systems.",
44
- "source_sha256": "c835782d88444f03f9bce01106b75b9c071fa18543d51e7fcb754f403ba6deab",
45
- "sources": {
46
- "BOOTSTRAP.md": "b9d0db4c38561d6173e2396bfca979743c66fe64dc15f8c10931d5ae02800a95",
47
- "Cargo.lock": "16f51b3ffc20349a69b4b580ea59d2354c9d496911c7e530509492d9b46ecb3a",
48
- "Cargo.toml": "1cc0b8df18413f925841e6acddfe14a49f7e8dd4236660eb9d822f1ccdcc9d4e",
49
- "README.md": "4b5d7c785121c865945f6379de31565c6aa9218f9d4333519ce3d450e85d0c55",
50
- "examples/coding-routine.lisp": "82b56af81d12a8cab8352b0825c913f00f73708b2339a9b567cc6f4d4e52da49",
51
- "scripts/package.py": "159b8cdda58b422a60aee95554eb0febc3b520d7ef5d5a4bac1cdd046a514e16",
52
- "scripts/test.py": "d8ed547d0943f8b23838b146c6e1d31ad9004c525868d19a2fffafef67e6b6c9",
53
- "src/digest.rs": "a46aa8ac0ba3f8e29e268a495723b6d49a4741399bb595c34a3d021dc295c800",
54
- "src/eval.rs": "7742caeeac426783647363242d93845369c018b00528312573f1cdc668c22ec3",
55
- "src/host.rs": "de9f34ad6ce8246e6f80cbf3d4f56bb07ed8043b17232135755a5e3ee5602cf5",
56
- "src/lib.rs": "2f591de0e7520a313da9668491da106d904bb19ef2384c717e87cd06bac665a3",
57
- "src/main.rs": "16a3a42d8338ca20e66173648c0a407b24724eeb1a4b3710c8a3b90b5aade10f",
58
- "src/protocol.rs": "d9009f5977707141f3547902a07f2f2c5455e4b9516b01a9ba4eb22a82af2a39",
59
- "src/reader.rs": "7bc1ff7aece72fc44ac43d5a207a3c8f2fd009eae41cb4b4dadb4eb9436d15f3",
60
- "tests/cli.rs": "22955ba315007b4a18409b31439345eb84ce0a62b88658cf440d513b10811357",
61
- "tests/digest.rs": "63a3a1b4963ef03260cae4ff9bfeed3596a445dc8df74ecc91b5750d3a6fa28d",
62
- "tests/edge_contract.rs": "4f9c7b068db44e9beceb811ceac4a5e8d6cf7cda51eee5a2449f29ab0fa6ade9",
63
- "tests/evaluator.rs": "a09c811494615b01e19ccef78491b8bbfee07fede8dcbee59f384fe59e145401",
64
- "tests/packaging.rs": "61ae1bfed0d4f31748ce2af58953387045f4231370d46cb809f26e93aea1e033",
65
- "tests/protocol.rs": "8f6b7ad5842f5b596efe8da01bba84f39fcd8d6426fde6932cb2a5cbb44d589f",
66
- "tests/reader.rs": "249092f56768a6511dbb15825be55f4cf0105269cb9dba1d6f8169ff66d44ab5",
67
- "tests/robustness.rs": "464c26addcf5188128d2e6eedd97cccccdb82ada0bc94a0648b77c8043118ba9"
68
- },
69
- "target": "x86_64-apple-darwin",
70
- "version": "0.1.0"
71
- }