kiokuko-dsh 0.2.19 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.ko.md +86 -2
- package/README.zh-CN.md +86 -2
- package/dist/client.cjs +1 -0
- package/dist/deep-thinker/configuration.d.ts +2 -2
- package/dist/deep-thinker/configuration.d.ts.map +1 -1
- package/dist/deep-thinker/configuration.js +40 -12
- package/dist/deep-thinker/configuration.js.map +1 -1
- package/dist/diff-review/controller.js +1 -1
- package/dist/diff-review/controller.js.map +1 -1
- package/dist/dsh/config.d.ts +6 -0
- package/dist/dsh/config.d.ts.map +1 -1
- package/dist/dsh/core/host.d.ts +6 -0
- package/dist/dsh/core/host.d.ts.map +1 -1
- package/dist/dsh/core/index.d.ts +18 -0
- package/dist/dsh/core/index.d.ts.map +1 -1
- package/dist/dsh/decisions/config.d.ts +6 -0
- package/dist/dsh/decisions/config.d.ts.map +1 -1
- package/dist/dsh/decisions/config.js +1 -0
- package/dist/dsh/decisions/config.js.map +1 -1
- package/dist/dsh/decisions/contracts.d.ts +4 -3
- package/dist/dsh/decisions/contracts.d.ts.map +1 -1
- package/dist/dsh/decisions/contracts.js +1 -1
- package/dist/dsh/decisions/contracts.js.map +1 -1
- package/dist/dsh/decisions/curator.d.ts +5 -0
- package/dist/dsh/decisions/curator.d.ts.map +1 -0
- package/dist/dsh/decisions/curator.js +17 -0
- package/dist/dsh/decisions/curator.js.map +1 -0
- package/dist/dsh/decisions/diagnostics.d.ts +11 -10
- package/dist/dsh/decisions/diagnostics.d.ts.map +1 -1
- package/dist/dsh/decisions/diagnostics.js +1 -1
- package/dist/dsh/decisions/diagnostics.js.map +1 -1
- package/dist/dsh/decisions/service.d.ts +1 -0
- package/dist/dsh/decisions/service.d.ts.map +1 -1
- package/dist/dsh/decisions/service.js +2 -1
- package/dist/dsh/decisions/service.js.map +1 -1
- package/dist/dsh/head-worker-configuration.d.ts.map +1 -1
- package/dist/dsh/head-worker-configuration.js +12 -3
- package/dist/dsh/head-worker-configuration.js.map +1 -1
- package/dist/dsh/host-adapter/tool-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/tool-host.js +5 -2
- package/dist/dsh/host-adapter/tool-host.js.map +1 -1
- package/dist/dsh/index.d.ts +6 -0
- package/dist/dsh/index.d.ts.map +1 -1
- package/dist/dsh/model-auto/candidates.js +2 -2
- package/dist/dsh/model-auto/candidates.js.map +1 -1
- package/dist/dsh/model-configuration.d.ts +9 -2
- package/dist/dsh/model-configuration.d.ts.map +1 -1
- package/dist/dsh/model-configuration.js +19 -8
- package/dist/dsh/model-configuration.js.map +1 -1
- package/dist/dsh/model-selection-ui.d.ts.map +1 -1
- package/dist/dsh/model-selection-ui.js +32 -13
- package/dist/dsh/model-selection-ui.js.map +1 -1
- package/dist/dsh/models/metadata.d.ts +8 -4
- package/dist/dsh/models/metadata.d.ts.map +1 -1
- package/dist/dsh/models/metadata.js +4 -0
- package/dist/dsh/models/metadata.js.map +1 -1
- package/dist/dsh/models/service.d.ts +1 -1
- package/dist/dsh/models/service.d.ts.map +1 -1
- package/dist/dsh/models/service.js +4 -2
- package/dist/dsh/models/service.js.map +1 -1
- package/dist/dsh/native-model-catalog.d.ts +6 -0
- package/dist/dsh/native-model-catalog.d.ts.map +1 -1
- package/dist/dsh/native-model-catalog.js +46 -5
- package/dist/dsh/native-model-catalog.js.map +1 -1
- package/dist/locale/en.json +1 -1
- package/dist/locale/ja.json +1 -1
- package/dist/locale/ko.json +1 -1
- package/dist/locale/zh-CN.json +1 -1
- package/dist/memory/correction-contract.d.ts +12 -12
- package/dist/memory/curator-classification.d.ts +52 -0
- package/dist/memory/curator-classification.d.ts.map +1 -0
- package/dist/memory/curator-classification.js +103 -0
- package/dist/memory/curator-classification.js.map +1 -0
- package/dist/memory/curator.d.ts +16 -2
- package/dist/memory/curator.d.ts.map +1 -1
- package/dist/memory/curator.js +72 -47
- package/dist/memory/curator.js.map +1 -1
- package/dist/models-client.cjs +1 -0
- package/dist/models-client.d.ts.map +1 -1
- package/dist/models-client.js +1 -0
- package/dist/models-client.js.map +1 -1
- package/docs/curator-classification.md +76 -0
- package/docs/dependency-security.md +26 -0
- package/docs/provider-auth-boundaries.md +28 -0
- package/migrations/046_curator_classification.sql +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Curator semantic classification (opt-in)
|
|
2
|
+
|
|
3
|
+
Curator no longer treats Japanese/English keywords or character count as semantic
|
|
4
|
+
proof. The provider-neutral `curator-classification` Typed Decisions contract asks
|
|
5
|
+
three independent questions: reusable meaning, actionable procedure, and
|
|
6
|
+
project-bound meaning. It is not correction classification and does not assign
|
|
7
|
+
trust, verification, skill readiness, or permission.
|
|
8
|
+
|
|
9
|
+
## Safe rollout
|
|
10
|
+
|
|
11
|
+
The feature defaults to off. Explicitly set
|
|
12
|
+
`typedDecisions.curatorClassification.mode` to `auto` in the existing Typed
|
|
13
|
+
Decisions configuration when intentionally testing or enabling the classifier.
|
|
14
|
+
The host passes the configured DecisionService to `curator_check`; it never
|
|
15
|
+
substitutes a provider or lowers its acceptance gates. Default-off means Curator
|
|
16
|
+
returns no admitted candidates until classification is enabled, with an explicit
|
|
17
|
+
`classificationStatus` explaining withheld candidates. Ordinary memory capture,
|
|
18
|
+
retrieval, and existing trusted global entries are not disabled.
|
|
19
|
+
|
|
20
|
+
Current evidence is offline only. Do not interpret the new contract as a claim of
|
|
21
|
+
multilingual model accuracy. Validate the selected provider/model against the
|
|
22
|
+
benchmark, especially missed project-local boundaries, before enabling it for
|
|
23
|
+
real data. Enabling may send complete title, summary and body to the configured
|
|
24
|
+
provider, subject to the existing credential, secret filtering and size limits.
|
|
25
|
+
|
|
26
|
+
## Persistence and approval
|
|
27
|
+
|
|
28
|
+
Inference is not guaranteed deterministic. A successful classification is stored
|
|
29
|
+
with source identity/revision/content digest, schema/policy version, configuration
|
|
30
|
+
digest, provider/model metadata, and result digest. The first persisted result
|
|
31
|
+
wins for that exact identity. Repeated views and restarts replay it; downstream
|
|
32
|
+
scoring and draft rendering are deterministic. This is integrity/reproducibility,
|
|
33
|
+
not evidence that the model is correct. The existing deterministic draft version
|
|
34
|
+
continues to describe only draft generation, not inference.
|
|
35
|
+
|
|
36
|
+
Unknown, abstained, malformed, oversized, timed-out, stale or unavailable results
|
|
37
|
+
cannot admit candidates or authorize globalization. No semantic regex fallback
|
|
38
|
+
exists. Unsuccessful assessments are not cached by the Curator store (the
|
|
39
|
+
DecisionService may retain its own request-bound outcome). A later bounded
|
|
40
|
+
invocation can attempt classification again. A view processes at most 50 new
|
|
41
|
+
assessments with a 10-second inference budget and reports deferred rows; narrow
|
|
42
|
+
filters if necessary. Cached rows are still checked for cancellation and current
|
|
43
|
+
configuration.
|
|
44
|
+
|
|
45
|
+
Globalization remains an explicit application action, never a classifier side
|
|
46
|
+
effect. Its synchronous API requires the reviewed assessment digest and a
|
|
47
|
+
separate host-owned current configuration digest. Callers must obtain that digest
|
|
48
|
+
from the initialized current DecisionService, not from model or user input.
|
|
49
|
+
Changed source/configuration, corrupted evidence or missing review identity
|
|
50
|
+
reject the action. Project-bound assessments are previewable but cannot be
|
|
51
|
+
globalized: revise the source into genuinely portable knowledge, then reclassify
|
|
52
|
+
and review it. Lexical draft normalization is not multilingual portability proof.
|
|
53
|
+
Existing trust/projection checks and qualified-application evidence stay intact;
|
|
54
|
+
classification does not enable the separate automatic globalization route.
|
|
55
|
+
|
|
56
|
+
## Reproducible evaluation
|
|
57
|
+
|
|
58
|
+
Run `node --import tsx --test tests/dsh/unit/curator-classification.test.ts` for
|
|
59
|
+
SQLite, restart, score-threshold, failure, approval and trust-boundary tests.
|
|
60
|
+
|
|
61
|
+
Run `node --import tsx scripts/evaluate-curator.ts --oracle` for offline plumbing.
|
|
62
|
+
Its 20 cases cover Japanese, English, Chinese, Korean and Spanish with reusable,
|
|
63
|
+
local-only, negated and quoted meanings. The oracle supplies expected labels:
|
|
64
|
+
20/20 is therefore not a model accuracy measurement.
|
|
65
|
+
|
|
66
|
+
Run `node --import tsx scripts/evaluate-curator.ts --live config.json` only with
|
|
67
|
+
an explicitly enabled standalone Typed Decisions configuration and a configured
|
|
68
|
+
provider. It supports TypeSafe, Nimble and Laya through their existing adapters.
|
|
69
|
+
TypeSafe reads TYPESAFE_API_KEY; Nimble reads only its configured credentialRef.
|
|
70
|
+
The harness does not create, save or print credentials and never globalizes.
|
|
71
|
+
Review all unavailable/abstained attempts, not only classified samples. It does
|
|
72
|
+
not retry failed samples to compute admission. Per-case elapsed time includes
|
|
73
|
+
classification and, on success, cached candidate projection/DB reads. Token and
|
|
74
|
+
cost fields are explicitly unavailable, not zero. The fixtures are a small
|
|
75
|
+
handwritten set, not statistical or deployment qualification; use further
|
|
76
|
+
paraphrases, adversarial text and repeated independent runs for that purpose.
|
|
@@ -77,3 +77,29 @@ inference, and the installer skip path with a blocked-network negative control.
|
|
|
77
77
|
When a symlink extraction fix is published, update both override definitions
|
|
78
78
|
and lockfiles, rerun those checks and both audits, and re-evaluate the temporary
|
|
79
79
|
CI mitigation.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## Repository lifecycle approvals
|
|
83
|
+
|
|
84
|
+
The repository pnpm policy explicitly allows esbuild and denies onnxruntime-node,
|
|
85
|
+
protobufjs, sharp and @google/genai. This is a CPU/prebuilt development policy, not a GPU or
|
|
86
|
+
source-build installation recipe, and does not change a user's DSH profile.
|
|
87
|
+
|
|
88
|
+
- @google/genai 2.21.0 preinstall only echoes a no-op message; its published
|
|
89
|
+
runtime is already built. Deny that unnecessary lifecycle explicitly.
|
|
90
|
+
- esbuild 0.28.2 is a direct development dependency. Its postinstall validates and
|
|
91
|
+
prepares the platform executable; fallback installation can use the network.
|
|
92
|
+
- onnxruntime-node 1.24.3 bundles the CPU runtime. Denying its lifecycle prevents
|
|
93
|
+
optional CUDA downloads/extraction, consistent with the npm/CI skip mitigation
|
|
94
|
+
above. Keep ONNXRUNTIME_NODE_INSTALL=skip for npm, which does not read this map.
|
|
95
|
+
- protobufjs 7.6.6 postinstall only emits a version-scheme compatibility warning;
|
|
96
|
+
it does not generate runtime files or invoke npm. Its separate prepublish
|
|
97
|
+
scripts contain the cli npm install command, not postinstall.
|
|
98
|
+
- sharp 0.35.5 has no install lifecycle script. Its build script is an explicit
|
|
99
|
+
source-build command, not an automatic installer. Prebuilt optional packages
|
|
100
|
+
supply the native runtime, and must not be omitted during installation.
|
|
101
|
+
|
|
102
|
+
The dependency tests check these explicit booleans, the absence of sharp install
|
|
103
|
+
hooks, esbuild transformation, protobuf encoding/decoding, sharp image processing,
|
|
104
|
+
and bundled ONNX CPU inference. Platform coverage is limited to the hosts where
|
|
105
|
+
these tests actually run; upgrades that introduce new hooks need review.
|
|
@@ -7,6 +7,34 @@ credential-resolving `listModels` just to show that inventory. Validation of an
|
|
|
7
7
|
existing head/worker pair lists only those two selected providers. Current model
|
|
8
8
|
selection validates its call configuration once, in the Models service.
|
|
9
9
|
|
|
10
|
+
Head/worker candidates and template previews check catalog membership only. They
|
|
11
|
+
do not resolve call configurations or inspect authenticated transports. Preview
|
|
12
|
+
labels say the connection is unverified; a saved pair with matching catalog
|
|
13
|
+
entries reports `currentAvailable: null`. Missing entries remain unavailable.
|
|
14
|
+
Final adoption re-reads only selected providers and validates each distinct
|
|
15
|
+
binding once; errors prevent a ready selection.
|
|
16
|
+
|
|
17
|
+
The native catalog's display seam uses Kiokuko-owned read-only model metadata or
|
|
18
|
+
the installed pi-ai public discovery with **only** a provider ID. The latter
|
|
19
|
+
answers from its installed catalog, or refuses before credentials when the ID is
|
|
20
|
+
unknown and no endpoint was supplied. It never receives a base URL, credential,
|
|
21
|
+
or fallback request. Redacted configured `models` IDs and `modelOverrides` keys
|
|
22
|
+
also remain candidate metadata for aliases and the DeepSeek account provider.
|
|
23
|
+
Providers lacking static metadata are marked **unverified**, separately from an
|
|
24
|
+
actual catalog failure. Existing draft IDs and shipped template IDs remain
|
|
25
|
+
candidates; the custom picker permits an explicit exact model ID. This preserves
|
|
26
|
+
selection without pretending the account's remote catalog was read. The host's
|
|
27
|
+
dynamic account model names cannot be shown before confirmation without its own
|
|
28
|
+
non-authenticating metadata API. Explicit validation retains native `listModels`
|
|
29
|
+
and `resolveCallConfig` for the selected providers only; absent models still fail.
|
|
30
|
+
|
|
31
|
+
Deep's role and alternative-model picker follows the same incomplete-inventory
|
|
32
|
+
contract: select a registered provider and enter an exact model ID, then validate
|
|
33
|
+
only on Save. Unknown providers, absent models and connection failures cannot
|
|
34
|
+
become an applied configuration. Native test adapters explicitly attest their
|
|
35
|
+
pure display metadata; separate native cases disable that seam to exercise the
|
|
36
|
+
real incomplete-inventory path rather than authenticating during display.
|
|
37
|
+
|
|
10
38
|
The legacy Models transport still accepts an explicitly injected `CredentialFile`
|
|
11
39
|
and owns OAuth/API-key transport authentication. Read-only listing must never
|
|
12
40
|
refresh OAuth or acquire its mutation lock. Explicit Nous refresh uses the plugin
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- Host-owned, content-bound assessments; no source text or authority labels.
|
|
2
|
+
CREATE TABLE curator_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
|
+
result_digest TEXT NOT NULL,
|
|
11
|
+
PRIMARY KEY(workspace,entry_id,entry_revision,input_digest,policy_version,configuration_digest)
|
|
12
|
+
);
|