kiokuko-dsh 0.2.5 → 0.2.7

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 (84) hide show
  1. package/dist/client.cjs +78 -8
  2. package/dist/dsh/agenticreplay-libraries.d.ts +1 -0
  3. package/dist/dsh/agenticreplay-libraries.d.ts.map +1 -1
  4. package/dist/dsh/agenticreplay-libraries.js.map +1 -1
  5. package/dist/dsh/agenticreplay-recorder.d.ts +1 -0
  6. package/dist/dsh/agenticreplay-recorder.d.ts.map +1 -1
  7. package/dist/dsh/agenticreplay-recorder.js +3 -1
  8. package/dist/dsh/agenticreplay-recorder.js.map +1 -1
  9. package/dist/dsh/agenticreplay-security.d.ts +2 -0
  10. package/dist/dsh/agenticreplay-security.d.ts.map +1 -1
  11. package/dist/dsh/agenticreplay-security.js +60 -4
  12. package/dist/dsh/agenticreplay-security.js.map +1 -1
  13. package/dist/dsh/agenticreplay-status-presentation.d.ts.map +1 -1
  14. package/dist/dsh/agenticreplay-status-presentation.js +3 -1
  15. package/dist/dsh/agenticreplay-status-presentation.js.map +1 -1
  16. package/dist/dsh/execution-selection.d.ts +13 -0
  17. package/dist/dsh/execution-selection.d.ts.map +1 -1
  18. package/dist/dsh/execution-selection.js +11 -0
  19. package/dist/dsh/execution-selection.js.map +1 -1
  20. package/dist/dsh/head-worker-configuration.d.ts +27 -0
  21. package/dist/dsh/head-worker-configuration.d.ts.map +1 -0
  22. package/dist/dsh/head-worker-configuration.js +69 -0
  23. package/dist/dsh/head-worker-configuration.js.map +1 -0
  24. package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
  25. package/dist/dsh/host-adapter/admission.js +3 -0
  26. package/dist/dsh/host-adapter/admission.js.map +1 -1
  27. package/dist/dsh/host-adapter/routing.d.ts +3 -1
  28. package/dist/dsh/host-adapter/routing.d.ts.map +1 -1
  29. package/dist/dsh/host-adapter/routing.js +11 -6
  30. package/dist/dsh/host-adapter/routing.js.map +1 -1
  31. package/dist/dsh/host-adapter.d.ts.map +1 -1
  32. package/dist/dsh/host-adapter.js +146 -1
  33. package/dist/dsh/host-adapter.js.map +1 -1
  34. package/dist/dsh/index.d.ts +2 -0
  35. package/dist/dsh/index.d.ts.map +1 -1
  36. package/dist/dsh/index.js +2 -0
  37. package/dist/dsh/index.js.map +1 -1
  38. package/dist/dsh/model-selection-ui.d.ts +2 -0
  39. package/dist/dsh/model-selection-ui.d.ts.map +1 -1
  40. package/dist/dsh/model-selection-ui.js +69 -5
  41. package/dist/dsh/model-selection-ui.js.map +1 -1
  42. package/dist/dsh/models/contracts.d.ts +30 -2
  43. package/dist/dsh/models/contracts.d.ts.map +1 -1
  44. package/dist/dsh/models/contracts.js +6 -0
  45. package/dist/dsh/models/contracts.js.map +1 -1
  46. package/dist/dsh/models/profiles.d.ts +2 -0
  47. package/dist/dsh/models/profiles.d.ts.map +1 -1
  48. package/dist/dsh/models/profiles.js +7 -3
  49. package/dist/dsh/models/profiles.js.map +1 -1
  50. package/dist/dsh/models/service.d.ts +58 -3
  51. package/dist/dsh/models/service.d.ts.map +1 -1
  52. package/dist/dsh/models/service.js +159 -18
  53. package/dist/dsh/models/service.js.map +1 -1
  54. package/dist/dsh/models/session-selection.d.ts +25 -0
  55. package/dist/dsh/models/session-selection.d.ts.map +1 -0
  56. package/dist/dsh/models/session-selection.js +16 -0
  57. package/dist/dsh/models/session-selection.js.map +1 -0
  58. package/dist/dsh/models/surface.d.ts +1 -0
  59. package/dist/dsh/models/surface.d.ts.map +1 -1
  60. package/dist/dsh/models/surface.js +24 -4
  61. package/dist/dsh/models/surface.js.map +1 -1
  62. package/dist/dsh/native-worker-routing.d.ts +69 -0
  63. package/dist/dsh/native-worker-routing.d.ts.map +1 -0
  64. package/dist/dsh/native-worker-routing.js +147 -0
  65. package/dist/dsh/native-worker-routing.js.map +1 -0
  66. package/dist/dsh/skill-prompts.json +1 -1
  67. package/dist/index.js +2 -0
  68. package/dist/locale/en.json +1 -1
  69. package/dist/locale/ja.json +1 -1
  70. package/dist/locale/ko.json +1 -1
  71. package/dist/locale/zh-CN.json +1 -1
  72. package/dist/models-client.cjs +78 -8
  73. package/dist/models-client.d.ts.map +1 -1
  74. package/dist/models-client.js +76 -8
  75. package/dist/models-client.js.map +1 -1
  76. package/docs/kiokuko-models.md +47 -0
  77. package/docs/verification.md +112 -0
  78. package/migrations/037_native_worker_routing.sql +8 -0
  79. package/package.json +7 -3
  80. package/scripts/evaluate-answer-review.mjs +3 -0
  81. package/scripts/verification-completion.mjs +12 -0
  82. package/scripts/verify-lisp-vendor.mjs +3 -0
  83. package/skills/coding-ideal-routine-skill/SKILL.md +12 -0
  84. package/skills/one-shot-software-completion/SKILL.md +13 -0
@@ -0,0 +1,112 @@
1
+ # Repository verification
2
+
3
+ Goal: CI executes the same repository-owned verification contract as local development.
4
+ `npm run verify` runs the full applicable scope. `npm run verify -- --profile main`
5
+ and other profiles are explicitly partial. `npm test` remains a fast/focused entry.
6
+
7
+ Inspect `npm run verify:plan` before running. Each check declares its runner,
8
+ dependencies, required capability and required result in `scripts/verification.json`.
9
+ CI prepares environments, selects profiles and retains output. Missing required
10
+ capabilities are `prerequisite-missing`; unexpected skips, empty Node suites and
11
+ failed assertions are non-success. Platform exclusions are declared before execution
12
+ and recorded with a reason. Exclusions never imply a result on that platform.
13
+
14
+ Output defaults to a fresh OS temporary directory. Supply an empty directory
15
+ outside the repository with `--output`. `plan.json`, per-command logs, official
16
+ Node lifecycle reports, `progress.json`, `result.json` and the candidate archive
17
+ are retained. Reports identify source content, runtime, profile, contract and archive.
18
+
19
+ All package consumers run after a final clean build and pack, against the same
20
+ archive and hash. Installed smoke/host assertions remain the existing assertions.
21
+ The DSH core pack and Skill consumers use normal minimal installs, with no links
22
+ to the development node_modules. Changes during verification are `stale`; saved
23
+ results must be rechecked using `npm run verify -- --status <result.json>`.
24
+ A profile passing alone never sets `completionReady`. A stale or failed full run
25
+ must not be reported as full verification, and local results do not prove remote CI.
26
+
27
+ ## Common suites and retained assertions
28
+
29
+ The inventory below is generated from the repository contract. A script check
30
+ requires a fresh check-bound completion receipt after its existing assertions;
31
+ arbitrary stdout or a successful no-op process is insufficient.
32
+
33
+ | Common check | Profiles | Runner | Required result |
34
+ | --- | --- | --- | --- |
35
+ | verification-contract | main, semantic, lisp, browser, runtime | `node --test scripts/verification-contract.test.mjs` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
36
+ | typecheck | main | `npm run typecheck` | exit 0 |
37
+ | build | main, semantic, lisp, browser, runtime, code-provider, p0, packages-live | `npm run build` | exit 0 |
38
+ | native-unit | main | `node scripts/run-ci-native.mjs unit` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
39
+ | native-integration | main | `node scripts/run-ci-native.mjs integration` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
40
+ | native-e2e | main | `node scripts/run-ci-native.mjs e2e` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
41
+ | skill-efficiency | main | `npm run test:skill-efficiency` | explicit completion receipt |
42
+ | coding-offline | main | `node --test tests/fixtures/skill-coding/offline.test.mjs` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
43
+ | harness | main | `npm run test:harness` | explicit completion receipt |
44
+ | retrieval | main | `npm run test:evaluation` | explicit completion receipt |
45
+ | decision-evaluation | main | `npm run test:evaluation:decisions` | explicit completion receipt |
46
+ | intent-evaluation | main | `npm run test:evaluation:request-intent` | explicit completion receipt |
47
+ | answer-evaluation | main | `npm run test:evaluation:answer-review` | explicit completion receipt |
48
+ | memory-reuse-evaluation | main | `npm run test:evaluation:memory-reuse -- --mode=all` | explicit completion receipt |
49
+ | sampledb | main | `npm run test:sampledb` | explicit completion receipt |
50
+ | publint | main | `npm run publint` | exit 0 |
51
+ | prepare-reproducibility | main | `npm run verify:prepare` | explicit completion receipt |
52
+ | native-search | lisp, runtime | `node scripts/run-tests.mjs tests/dsh/integration/native-search.test.ts` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
53
+ | laya-worker | lisp | `npm run test:laya-worker` | exit 0 |
54
+ | lisp-vendor | lisp | `npm run verify:lisp:vendor` | explicit completion receipt |
55
+ | lisp-native | lisp | `npm run test:ci:lisp` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
56
+ | owned-native | lisp | `node scripts/run-tests.mjs tests/dsh/integration/owned-execution.test.ts tests/dsh/integration/owned-native-lifecycle.test.ts` | complete official lifecycle; at least one passing leaf; no failures, cancellation, todo or undeclared skips |
57
+ | modules | lisp | `npm run test:modules` | explicit completion receipt |
58
+ | models-web | browser | `node scripts/verify-models-web.mjs` | explicit completion receipt |
59
+ | coding-web | browser | `node scripts/verify-coding-workflow-web.mjs` | explicit completion receipt |
60
+ | shortcuts-web | browser | `node scripts/verify-shortcuts-web.mjs` | explicit completion receipt |
61
+ | lisp-approval-web | browser | `node scripts/verify-lisp-approval-web.mjs` | explicit completion receipt |
62
+ | lisp-plan-web | browser | `node scripts/verify-lisp-plan-web.mjs` | explicit completion receipt |
63
+ | pack-check | main, lisp | `node scripts/pack-check.mjs` | explicit completion receipt |
64
+ | skill-delivery | main, lisp | `node scripts/run-skill-delivery.mjs` | explicit completion receipt |
65
+ | consumer-npm | main, runtime | `node scripts/verify-agenticreplay-consumer.mjs` | explicit completion receipt |
66
+ | consumer-pnpm | main, runtime | `node scripts/verify-agenticreplay-consumer.mjs --pnpm` | explicit completion receipt |
67
+ | dsh-lifecycle | main, runtime | `node scripts/run-enno-dsh-e2e.mjs` | explicit completion receipt |
68
+ | sqlite-vec | main, semantic | `npm run test:sqlite-vec` | explicit completion receipt |
69
+ | code-provider | code-provider | `node scripts/run-ci-native.mjs code-provider` | Explicit selected native fixture; nonempty official lifecycle without skipped required cases. |
70
+ | p0 | p0 | `node scripts/run-ci-native.mjs p0` | Explicit selected native fixture; nonempty official lifecycle without skipped required cases. |
71
+ | packages-live | packages-live | `node scripts/run-ci-native.mjs packages-live` | Explicit selected native fixture; nonempty official lifecycle without skipped required cases. |
72
+
73
+ ## Consolidated duplicate invocations
74
+
75
+ - `skill-prompts` is covered by `native-unit`: `tests/dsh/unit/skill-compiler.test.ts`, `tests/dsh/unit/skill-snapshot.test.ts`.
76
+ - `index-reasoning` is covered by `native-integration`: `tests/dsh/integration/index-reasoning.test.ts`, `tests/dsh/integration/index-reasoning-native.test.ts`, `tests/dsh/integration/index-reasoning-evaluation.test.ts`.
77
+ - `index-evaluation` is covered by `native-integration`: `tests/dsh/integration/index-reasoning-evaluation.test.ts`.
78
+
79
+ Import-only convenience entrypoints remain usable explicitly. Recursive discovery
80
+ excludes these aliases and executes each declared leaf exactly once:
81
+
82
+ - `tests/dsh/integration/capability.test.ts`: `tests/dsh/integration/akinator-gate.test.ts`, `tests/dsh/integration/pre-step/gate.test.ts`, `tests/dsh/unit/capability-catalog.test.ts`.
83
+ - `tests/dsh/integration/close-resume.test.ts`: `tests/dsh/integration/run-close.test.ts`, `tests/dsh/integration/run-resume.test.ts`, `tests/dsh/integration/run-resume/exact-route.test.ts`.
84
+ - `tests/dsh/integration/enno-turn-stopping.test.ts`: `tests/dsh/integration/turn-stopping-gate.test.ts`, `tests/dsh/integration/enno-role-loop.test.ts`.
85
+ - `tests/dsh/integration/provider.test.ts`: `tests/dsh/integration/skill-provider.test.ts`.
86
+
87
+ ## Explicit optional lanes
88
+
89
+ These files are excluded before ordinary discovery and recorded as scope-excluded
90
+ in the full plan. Selecting the named profile makes its fixture and assertions required.
91
+
92
+ - `code-provider`: `tests/dsh/integration/lisp/code-intelligence-native.test.ts`. This optional V1 provider requires an explicit built provider fixture.
93
+ - `p0`: `tests/dsh/integration/lisp/p0-seatbelt.test.ts`. This experimental macOS P0 candidate is an explicit probe, not production protection evidence.
94
+ - `packages-live`: `tests/dsh/integration/lisp/packages-live.test.ts`. Live public package registries are an explicitly selected integration lane.
95
+
96
+ ## Removed no-op checks
97
+
98
+ - `embedding`: The old --offline invocation read no model manifest; DSH ships no preset manifest. Explicit --model-dir checksum/inference remains available.
99
+
100
+ The five browser consumers receive the same final tarball as CLI, npm and pnpm
101
+ consumers. Their standalone npm commands remain available; formal verification
102
+ executes the existing assertion scripts directly after its own clean build.
103
+
104
+ The old CI YAML substring test is retired: the common runner probes required
105
+ runtime capabilities and rejects missing prerequisites in the real execution path.
106
+ The fixture-version, suite-discovery and alias/optional-lane contracts remain tested.
107
+
108
+ `pre-step.test.ts` is also an import-only alias for `pre-step/gate.test.ts`.
109
+ Native Lisp integration requires `protected-python3`: a real sandbox subprocess
110
+ probe. An Apple launcher that only reports its version outside the sandbox does
111
+ not satisfy this capability. Local/CI environment preparation must select a real
112
+ installed Python interpreter; the repository never changes the global PATH.
@@ -0,0 +1,8 @@
1
+ CREATE TABLE dsh_native_worker_routes (
2
+ child_session_id TEXT PRIMARY KEY,
3
+ parent_session_id TEXT NOT NULL,
4
+ owner_json TEXT NOT NULL CHECK(json_valid(owner_json)),
5
+ state TEXT NOT NULL CHECK(state IN ('admitting', 'active', 'revoked')),
6
+ created_at TEXT NOT NULL
7
+ );
8
+ CREATE INDEX idx_dsh_native_worker_routes_parent ON dsh_native_worker_routes(parent_session_id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiokuko-dsh",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Kiokuko plugin for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,7 +44,8 @@
44
44
  "scripts/smoke-laya-coreml.mjs",
45
45
  "scripts/evaluate-answer-review.mjs",
46
46
  "scripts/answer-review-evaluation.mjs",
47
- "scripts/answer-review-evaluation.d.mts"
47
+ "scripts/answer-review-evaluation.d.mts",
48
+ "scripts/verification-completion.mjs"
48
49
  ],
49
50
  "exports": {
50
51
  ".": {
@@ -245,7 +246,10 @@
245
246
  "test:models:web": "npm run build && node scripts/verify-models-web.mjs",
246
247
  "test:code-intelligence": "node scripts/run-code-intelligence.mjs",
247
248
  "test:code-intelligence:packed": "node scripts/run-code-intelligence.mjs --packed",
248
- "test:code-intelligence:benchmark": "node scripts/benchmark-code-intelligence.mjs"
249
+ "test:code-intelligence:benchmark": "node scripts/benchmark-code-intelligence.mjs",
250
+ "verify": "node scripts/verify.mjs",
251
+ "verify:plan": "node scripts/verify.mjs --plan",
252
+ "test:verification": "node --test scripts/verification-contract.test.mjs"
249
253
  },
250
254
  "dependencies": {
251
255
  "@deepseek-ai/cosmokit": "1.8.5",
@@ -1,3 +1,4 @@
1
+ import { completeVerification } from './verification-completion.mjs';
1
2
  import { parseArgs } from 'node:util'
2
3
  import { readFile, writeFile } from 'node:fs/promises'
3
4
  import { createHash } from 'node:crypto'
@@ -126,3 +127,5 @@ const json=JSON.stringify(report,null,2)+'\n'
126
127
  if(values.output)await writeFile(values.output,json)
127
128
  process.stdout.write(json)
128
129
  if(report.cases.some(row=>row.status!=='completed') || warmupCases.some(row => row.status !== 'completed'))process.exitCode=1
130
+
131
+ completeVerification({});
@@ -0,0 +1,12 @@
1
+ import { writeFileSync } from 'node:fs';
2
+ export function completeVerification(evidence = {}) {
3
+ if (!process.env.KIOKUKO_VERIFY_COMPLETION_FILE || process.exitCode && process.exitCode !== 0) return;
4
+ const {KIOKUKO_VERIFY_CHECK_ID:id,KIOKUKO_VERIFY_NONCE:nonce}=process.env;
5
+ if (!id || !nonce) throw new Error('Missing verification completion identity');
6
+ writeFileSync(process.env.KIOKUKO_VERIFY_COMPLETION_FILE,JSON.stringify({schema:'verification-completion-v1',id,nonce,status:'passed',evidence}),{flag:'wx'});
7
+ }
8
+ export function validCompletion(value, id, nonce, required = {}) {
9
+ return !!(value?.schema === 'verification-completion-v1' && value.id === id && value.nonce === nonce && value.status === 'passed'
10
+ && value.evidence && typeof value.evidence === 'object' && !Array.isArray(value.evidence)
11
+ && Object.entries(required).every(([key,expected])=>value.evidence[key]===expected));
12
+ }
@@ -1,3 +1,4 @@
1
+ import { completeVerification } from './verification-completion.mjs';
1
2
  import { readFile, readdir, writeFile } from 'node:fs/promises'
2
3
  import { createHash } from 'node:crypto'
3
4
  import { join, relative, resolve } from 'node:path'
@@ -28,3 +29,5 @@ else {
28
29
  if (changed.length) throw new Error(`Lisp vendor content differs from the reviewed manifest: ${JSON.stringify(changed)}`)
29
30
  }
30
31
  console.log(`Lisp vendor: ${Object.keys(files).length} files verified`)
32
+
33
+ completeVerification({});
@@ -63,3 +63,15 @@ DSH の実装タスクでは、初回の変更前に `coding_workflow status`
63
63
  - ユーザーには、変更内容、確認できた通常利用、実行した検証と結果、残る制約を簡潔に報告する。再現・実装・ローカル検証・公開/本番反映は別々の事実として扱う。許可のない公開やデプロイを完了条件に追加しない。
64
64
 
65
65
  この Skill は実行時の判断を支援する手順であり、ホストによる毎回の呼び出しや不具合の完全防止を保証する仕組みではない。
66
+
67
+ ## Repository verification entry
68
+
69
+ When the target repository defines `npm run verify`, read `npm run verify:plan`
70
+ (or `npm run verify -- --plan --profile <profile>`) and use that declared scope.
71
+ Run the same profile locally and in CI; do not reconstruct independent checks
72
+ from CI YAML. `npm test` and focused commands are partial evidence. The JSON
73
+ result records each required check, prerequisite failure, platform exclusion,
74
+ and source/artifact identity. Only a current full-scope `completionReady: true`
75
+ result supports full verification. Recheck saved results with
76
+ `npm run verify -- --status <result.json>` after related edits or artifact changes.
77
+ Never derive skip permissions or expected failures from observed test output.
@@ -100,4 +100,17 @@ the recovery reference before changing strategy. Do not retry an unchanged
100
100
  failed operation or hide failures by weakening checks. Stop on completion or a
101
101
  specific blocker requiring unavailable access, evidence or user action.
102
102
 
103
+
104
+ ## Repository verification entry
105
+
106
+ When the target repository defines `npm run verify`, read `npm run verify:plan`
107
+ (or `npm run verify -- --plan --profile <profile>`) and use that declared scope.
108
+ Run the same profile locally and in CI; do not reconstruct independent checks
109
+ from CI YAML. `npm test` and focused commands are partial evidence. The JSON
110
+ result records each required check, prerequisite failure, platform exclusion,
111
+ and source/artifact identity. Only a current full-scope `completionReady: true`
112
+ result supports full verification. Recheck saved results with
113
+ `npm run verify -- --status <result.json>` after related edits or artifact changes.
114
+ Never derive skip permissions or expected failures from observed test output.
115
+
103
116
  <!-- /kiokuko:runtime -->