@lmzhen/dsh-evolution-core 0.47.0 → 0.48.0

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 (58) hide show
  1. package/lib/authority-plugin.js +1 -1
  2. package/lib/index.js +27 -114
  3. package/lib/{io-BCBSr6Ot.js → io-GxghO3Ip.js} +30 -8
  4. package/lib/io-node.js +1 -1
  5. package/lib/io-registry.js +1 -20
  6. package/lib/{mutation-authority-CM6wRgyK.js → mutation-authority-l57R626O.js} +14 -2
  7. package/lib/{mutations-DihgpfgG.js → mutations-DQXddSJd.js} +1 -1
  8. package/lib/{numeric-DLeLvvGb.js → numeric-D8js3sqC.js} +1 -5
  9. package/lib/platform/index.js +1 -1
  10. package/lib/{platform-CFA12Jam.js → platform-Cc9cNt5j.js} +4 -28
  11. package/lib/policy.js +1 -1
  12. package/lib/runtime/plugin.js +21 -43
  13. package/lib/{session-projection-BhlDXqws.js → session-projection-DSXnUNZG.js} +1 -19
  14. package/lib/{skill-health-BzkUQDi7.js → skill-health-DP8z9TPf.js} +3 -3
  15. package/lib/{skill-history-RWt1-kbZ.js → skill-history-CxrDE3Rb.js} +43 -51
  16. package/lib/skills.js +165 -183
  17. package/lib/types/authority.d.ts +2 -0
  18. package/lib/types/authority.js +5 -0
  19. package/lib/types/constants.d.ts +0 -4
  20. package/lib/types/constants.js +0 -4
  21. package/lib/types/contract.d.ts +0 -5
  22. package/lib/types/health-baseline.d.ts +0 -13
  23. package/lib/types/health-baseline.js +0 -20
  24. package/lib/types/home-fence.d.ts +2 -0
  25. package/lib/types/home-fence.js +11 -1
  26. package/lib/types/io-registry.d.ts +0 -16
  27. package/lib/types/io-registry.js +0 -24
  28. package/lib/types/io.d.ts +6 -1
  29. package/lib/types/io.js +35 -9
  30. package/lib/types/memory-store.js +13 -5
  31. package/lib/types/mutation-authority.js +5 -0
  32. package/lib/types/mutation-unit.d.ts +1 -1
  33. package/lib/types/mutation-unit.js +9 -27
  34. package/lib/types/params.d.ts +11 -29
  35. package/lib/types/params.js +13 -60
  36. package/lib/types/platform/llm.d.ts +2 -3
  37. package/lib/types/platform/llm.js +3 -10
  38. package/lib/types/platform/projections.d.ts +4 -5
  39. package/lib/types/platform/projections.js +4 -18
  40. package/lib/types/runtime/llm.js +2 -2
  41. package/lib/types/runtime/platform.d.ts +7 -11
  42. package/lib/types/runtime/platform.js +13 -19
  43. package/lib/types/runtime/plugin.d.ts +1 -1
  44. package/lib/types/runtime/plugin.js +6 -4
  45. package/lib/types/runtime/projections.js +1 -2
  46. package/lib/types/skill-health.d.ts +29 -1
  47. package/lib/types/skill-store.d.ts +6 -0
  48. package/lib/types/skill-store.js +130 -142
  49. package/lib/types/tool-dispatch.d.ts +1 -16
  50. package/lib/types/tool-dispatch.js +0 -18
  51. package/lib/types/unit-journal.js +19 -12
  52. package/lib/types/write-inventory.d.ts +0 -4
  53. package/lib/types/write-inventory.js +0 -9
  54. package/lib/types/write-kernel.d.ts +3 -4
  55. package/lib/types/write-kernel.js +13 -25
  56. package/lib/write.js +2 -2
  57. package/package.json +1 -1
  58. package/persisted-write-inventory.json +31 -13
@@ -5,16 +5,16 @@
5
5
  * the SAME name in two carriers (reviewMode, staleAfterDays, archiveAfterDays —
6
6
  * resolved by the existing policy-shadows-row rule) and six use DIFFERENT names.
7
7
  * This module owns the six: the policy/snapshot name is the canonical id, the
8
- * plugin-row name is a deprecated alias kept readable since 0.6.x. Removal was
9
- * planned for 0.7.0 and is deferred: the aliases still ship, so no later version
10
- * is claimed here.
8
+ * plugin-row name is a deprecated alias. The alias table survives only for the one-time
9
+ * legacy-document migration and the doctor's old-key report; live readers use the
10
+ * canonical id and its carrier no longer falls back to the legacy spelling.
11
11
  *
12
- * Reading stays compatible (a carrier still spelling the legacy name resolves),
13
- * writing is strict (the write path accepts canonical ids only, so no new
14
- * document is created under a deprecated name).
12
+ * Writing is canonical-only (a deprecated name is not a live row field in 0.48).
15
13
  * @module
16
14
  */
17
- /** Deprecated alias (plugin-row name) -> canonical id (policy/snapshot name). */
15
+ /** Deprecated alias (plugin-row name) -> canonical id (policy/snapshot name).
16
+ * Retained for the one-time legacy-document migration and the doctor's old-key report;
17
+ * live readers use the canonical id only. */
18
18
  export const PARAM_ALIASES = Object.freeze({
19
19
  memoryInterval: 'reviewMemoryInterval',
20
20
  skillInterval: 'reviewSkillInterval',
@@ -23,15 +23,6 @@ export const PARAM_ALIASES = Object.freeze({
23
23
  memoryCharLimit: 'memoryChars',
24
24
  userCharLimit: 'userChars',
25
25
  });
26
- /** Canonical ids that have at least one deprecated alias, for read fallback. */
27
- const ALIASES_BY_CANONICAL = (() => {
28
- const index = {};
29
- for (const [alias, canonical] of Object.entries(PARAM_ALIASES)) {
30
- ;
31
- (index[canonical] ??= []).push(alias);
32
- }
33
- return index;
34
- })();
35
26
  /**
36
27
  * Resolve any parameter id to its canonical form.
37
28
  * @param id - canonical id or deprecated alias.
@@ -49,35 +40,15 @@ export function isDeprecatedParamId(id) {
49
40
  return PARAM_ALIASES[id] !== undefined;
50
41
  }
51
42
  /**
52
- * Guard for the write path: only canonical ids may be written.
53
- * @param id - parameter id a caller intends to write.
54
- * @returns the canonical id.
55
- * @throws {Error} when the id is a deprecated alias; the message names both ids.
56
- */
57
- export function canonicalWriteId(id) {
58
- const canonical = PARAM_ALIASES[id];
59
- if (canonical === undefined)
60
- return id;
61
- throw new Error(`parameter id \`${id}\` is deprecated; write \`${canonical}\` instead`);
62
- }
63
- /**
64
- * Read a parameter from a carrier that may still spell the legacy name.
43
+ * Read a parameter by its canonical id.
65
44
  * @param carrier - config/snapshot object to read from, or undefined.
66
- * @param id - canonical id (a deprecated alias is accepted and resolved first).
67
- * @returns the canonical value when present, else the alias value, else undefined.
45
+ * @param id - canonical id (an alias is resolved first, for migration callers).
46
+ * @returns the canonical value, or undefined.
68
47
  */
69
48
  export function readParam(carrier, id) {
70
49
  if (carrier === undefined)
71
50
  return undefined;
72
- const record = carrier;
73
- const canonical = resolveParamId(id);
74
- if (record[canonical] !== undefined)
75
- return record[canonical];
76
- for (const alias of ALIASES_BY_CANONICAL[canonical] ?? []) {
77
- if (record[alias] !== undefined)
78
- return record[alias];
79
- }
80
- return undefined;
51
+ return carrier[resolveParamId(id)];
81
52
  }
82
53
  /**
83
54
  * Chinese display name per group, one entry per line (the scripts read this block
@@ -190,10 +161,8 @@ export const PARAM_EXPOSURE = Object.freeze([
190
161
  { id: 'evolution-commands.maintainTimeoutMs', group: 'deployment', tier: 'E2', authority: 'cordis', owner: 'evolution-commands', applies: 'none', docAnchor: 'PARAMETERS.md#deployment', summary: 'Timeout of one maintenance run started from the command surface.', why: 'internal' },
191
162
  { id: 'evolution-maintenance.probeTimeoutMs', group: 'deployment', tier: 'E2', authority: 'cordis', owner: 'evolution-maintenance', applies: 'none', docAnchor: 'PARAMETERS.md#deployment', summary: 'Model-facing budget of one maintenance_probe call — a hang guard, not a latency budget.', why: 'internal' },
192
163
  { id: 'skill-usage.supportReadToolNames', group: 'deployment', tier: 'E2', authority: 'cordis', owner: 'skill-usage', applies: 'none', docAnchor: 'PARAMETERS.md#deployment', summary: 'Tool names whose file reads are attributed to support files.', why: 'internal' },
193
- { id: 'install.mode', group: 'deployment', tier: 'E4', authority: 'install', owner: 'scripts', applies: 'restart', docAnchor: 'PARAMETERS.md#deployment', summary: 'Install target plane (values all / host; the legacy layered preset path is internal-only).', why: 'install' },
194
- { id: 'install.basePreset', group: 'deployment', tier: 'E4', authority: 'install', owner: 'scripts', applies: 'restart', docAnchor: 'PARAMETERS.md#deployment', summary: 'Agent-preset base the layered install composes from (--base).', why: 'install', consumer: 'basePresetPlugins' },
164
+ { id: 'install.mode', group: 'deployment', tier: 'E4', authority: 'install', owner: 'scripts', applies: 'restart', docAnchor: 'PARAMETERS.md#deployment', summary: 'Install target plane (values all / host; legacy modes are uninstall-only in 0.48).', why: 'install' },
195
165
  { id: 'install.home', group: 'deployment', tier: 'E4', authority: 'install', owner: 'scripts', applies: 'restart', docAnchor: 'PARAMETERS.md#deployment', summary: 'Harness home the installer writes into (--home).', why: 'install' },
196
- { id: 'install.presetRowOverrides', group: 'deployment', tier: 'E4', authority: 'install', owner: 'scripts', applies: 'restart', docAnchor: 'PARAMETERS.md#deployment', summary: 'Preset row overrides the installer injects (row-overrides.json).', why: 'install', consumer: 'loadRowOverrides' },
197
166
  { id: 'mergeApproval', group: 'merge', tier: 'E3', authority: 'cordis', owner: 'evolution-merge', applies: 'live', docAnchor: 'PARAMETERS.md#merge', summary: 'Pause after round 1 and put the pair in the pending queue instead of authoring round 2 automatically.', label: '合并审批', hint: '开启后,第一轮判定完先停下、进入待批准清单;关闭则直接进入第二轮合并。', control: 'switch', unit: '', values: '', card: 'evolution-merge' },
198
167
  { id: 'mergeSkippedTtlDays', group: 'merge', tier: 'E3', authority: 'cordis', owner: 'evolution-merge', applies: 'live', docAnchor: 'PARAMETERS.md#merge', summary: 'Days a skipped pair stays out of screening; 0 means it never expires.', label: '无需合并保留天数', hint: '判定无需合并的对,多少天内不再参与筛选;0 表示一直保留。', control: 'number', unit: '天', values: '', card: 'evolution-merge' },
199
168
  { id: 'mergeRunTimeoutMinutes', group: 'merge', tier: 'E3', authority: 'cordis', owner: 'evolution-merge', applies: 'live', docAnchor: 'PARAMETERS.md#merge', summary: 'Wall-clock budget of one merge run; 0 means no limit.', label: '单次运行上限', hint: '一次合并运行最多持续多少分钟;0 表示不设上限。', control: 'number', unit: '分钟', values: '', card: 'evolution-merge' },
@@ -233,22 +202,6 @@ export const PARAM_NAMESPACES = Object.freeze({
233
202
  export const NAMESPACE_MIGRATIONS = Object.freeze(Object.entries(PARAM_NAMESPACES)
234
203
  .filter(([owner, namespace]) => namespace !== owner)
235
204
  .map(([owner, namespace]) => Object.freeze({ namespace, rowId: owner })));
236
- /**
237
- * The LEGACY settings namespace one owner package used to register through the family's
238
- * own seam (0.1.x). It is no longer what the platform calls the section: the platform
239
- * derives a settings namespace from the Loader entry id, and this registry's `owner` field
240
- * IS that row id, so a live lookup uses {@link paramRowId}. What remains here is the
241
- * migration SOURCE (G3 moves a user layer out of this string and into the row id).
242
- * @param owner - owner package directory name (the map's key).
243
- * @returns the legacy namespace that owner registered.
244
- * @throws when the owner has no entry in {@link PARAM_NAMESPACES}.
245
- */
246
- export function paramNamespace(owner) {
247
- const namespace = PARAM_NAMESPACES[owner];
248
- if (namespace === undefined)
249
- throw new Error('no settings namespace registered for owner `' + owner + '` (add it to PARAM_NAMESPACES)');
250
- return namespace;
251
- }
252
205
  /**
253
206
  * The settings id one row's user layer lives under, or undefined when the owner publishes
254
207
  * no user layer at all (a deployment-only row: its knobs are E2 and never reach a settings
@@ -256,7 +209,7 @@ export function paramNamespace(owner) {
256
209
  * it in `settings.describe()` / `configForms.get(entryId)`, and an owner package's row id is
257
210
  * its own name — spelled the same in every bundle patch.
258
211
  *
259
- * This is the id to LOOK UP with; {@link paramNamespace} keeps the legacy string the 0.1.x
212
+ * This is the id to LOOK UP with; {@link PARAM_NAMESPACES} keeps the legacy string the 0.1.x
260
213
  * seam registered, which is the G3 migration source and never a live lookup key.
261
214
  * @param owner - owner package directory name (the row id).
262
215
  * @returns the entry id the platform reports for that row, or undefined for a row without
@@ -2,9 +2,8 @@
2
2
  * The LLM half of the family's host platform boundary.
3
3
  *
4
4
  * Features pass a family request (route, messages, purpose); this module owns
5
- * the platform GenerateOptions cast, prepareCall fallback, and text assembly.
6
- * The purpose cast is the only compatibility point between the 0.2.1 fixed
7
- * union and 0.2.2's declaration-merge map.
5
+ * the platform GenerateOptions cast and text assembly. The purpose declaration
6
+ * merge below is the family's contribution to the 0.2.2 request map.
8
7
  */
9
8
  import type { StreamChunk, UserMessage } from '@deepseek-ai/dsh-llm';
10
9
  import type { Context } from '@deepseek-ai/cordis';
@@ -29,16 +29,9 @@ export function llmPort(ctx) {
29
29
  const port = {
30
30
  async *stream(request) {
31
31
  const options = toOptions(request);
32
- if (llm.stream !== undefined) {
33
- yield* llm.stream(options);
34
- return;
35
- }
36
- if (llm.prepareCall !== undefined) {
37
- const call = await llm.prepareCall(options, request.signal);
38
- yield* call.stream({ ...call.config, messages: request.messages, ...(request.signal === undefined ? {} : { signal: request.signal }) });
39
- return;
40
- }
41
- throw new EvolutionLlmError('transport', 'llm service has neither stream nor prepareCall');
32
+ if (llm.stream === undefined)
33
+ throw new EvolutionLlmError('transport', 'llm service has no stream()');
34
+ yield* llm.stream(options);
42
35
  },
43
36
  async completeText(request) {
44
37
  let text = '';
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * The session-projection half of the family's host platform boundary.
3
3
  *
4
- * The platform moved this port from "a disposer plus a registry read" to an awaitable handle. Both
5
- * are accepted here, and the port NAMES which shape it found: an unrecognised shape used to fall
6
- * through to the legacy read and return undefined for every unit without an error (audit 06-P1),
7
- * which reads as "the sessions have no projection data" instead of "this build cannot read them".
4
+ * The 0.2.2 platform returns an awaitable `ProjectionHandle` (`stateOf` + `dispose`). The port
5
+ * accepts that one contract and NAMES a non-conforming answer (`unrecognised`) instead of
6
+ * returning undefined for every unit without an error (audit 06-P1).
8
7
  */
9
8
  import type { Context } from '@deepseek-ai/cordis';
10
9
  import type { ZodType } from 'zod';
@@ -23,7 +22,7 @@ export interface ProjectionHandleLike<S> {
23
22
  dispose(): Promise<void>;
24
23
  }
25
24
  /** Which registration contract the live registry speaks. */
26
- export type ProjectionPortShape = 'handle' | 'legacy' | 'unrecognised';
25
+ export type ProjectionPortShape = 'handle' | 'unrecognised';
27
26
  export interface ProjectionPort {
28
27
  /** The shape this port adapted to; `unrecognised` means reads will be empty and why. */
29
28
  readonly shape: ProjectionPortShape;
@@ -1,7 +1,3 @@
1
- const isThenable = (value) =>
2
- // A callable-thenable is a FUNCTION with \ hen\ (the deprecated shape); a plain Promise is an
3
- // object. Both must be awaited, or the callable one falls into the legacy branch by accident.
4
- (typeof value === 'object' || typeof value === 'function') && value !== null && typeof value.then === 'function';
5
1
  const isHandle = (value) => value !== null && typeof value === 'object'
6
2
  && typeof value.stateOf === 'function'
7
3
  && typeof value.dispose === 'function';
@@ -17,9 +13,7 @@ export function projectionPort(ctx) {
17
13
  get shape() { return shape; },
18
14
  get reason() { return shape === 'unrecognised' ? reason : undefined; },
19
15
  async register(definition) {
20
- const raw = registry.register(definition);
21
- // A callable-thenable and a plain Promise are the same contract from the caller's side.
22
- const resolved = isThenable(raw) ? await raw : raw;
16
+ const resolved = await registry.register(definition);
23
17
  if (isHandle(resolved)) {
24
18
  shape = 'handle';
25
19
  reason = undefined;
@@ -28,19 +22,11 @@ export function projectionPort(ctx) {
28
22
  dispose: () => resolved.dispose(),
29
23
  };
30
24
  }
31
- if (resolved === raw && typeof raw === 'function' && typeof registry.stateOf === 'function') {
32
- shape = 'legacy';
33
- reason = undefined;
34
- return {
35
- stateOf: (session) => registry.stateOf?.(session, definition.key),
36
- dispose: async () => { raw(); },
37
- };
38
- }
39
- // Neither contract: keep reads empty, but say so through `shape`/`reason` instead of
40
- // pretending the units have no data.
25
+ // Keep reads empty, but say so through `shape`/`reason` instead of pretending the
26
+ // units have no data.
41
27
  shape = 'unrecognised';
42
28
  reason = 'sessionProjections.register returned ' + (resolved === null ? 'null' : typeof resolved)
43
- + ' with neither a projection handle nor a legacy disposer';
29
+ + ' without a projection handle';
44
30
  return { stateOf: () => undefined, dispose: async () => { } };
45
31
  },
46
32
  };
@@ -3,7 +3,7 @@
3
3
  * model calls. Feature-specific retries and parsing stay in their features.
4
4
  */
5
5
  import { Service } from '@deepseek-ai/cordis';
6
- import { EvolutionLlmError, llmPort, modelRoute } from "../platform/index.js";
6
+ import { EvolutionLlmError, modelRoute } from "../platform/index.js";
7
7
  /** Domain service for every auxiliary LLM request in the family. */
8
8
  export class EvolutionLlm extends Service {
9
9
  static inject = [];
@@ -13,7 +13,7 @@ export class EvolutionLlm extends Service {
13
13
  }
14
14
  [Service.init]() {
15
15
  const platform = this.ctx.get('evolutionPlatform');
16
- this.port = platform?.ports?.llm ?? llmPort(this.ctx);
16
+ this.port = platform?.ports.llm;
17
17
  if (this.port === undefined)
18
18
  this.ctx.logger.warn('evolution-core-runtime: llm service unavailable; model calls fail with llm-unavailable');
19
19
  }
@@ -9,12 +9,6 @@ import type { LlmPort } from '../platform/llm.ts';
9
9
  import type { PresetsPort } from '../platform/presets.ts';
10
10
  import type { ProjectionPort } from '../platform/projections.ts';
11
11
  import type { ToolsPort } from '../platform/tools.ts';
12
- /** One capability row for doctor/status consumers. */
13
- export interface PlatformCapability {
14
- readonly name: 'projections' | 'llm' | 'tools' | 'presets';
15
- readonly available: boolean;
16
- readonly reason?: string;
17
- }
18
12
  /** Resolved host ports and their availability. */
19
13
  export interface HostPlatformPorts {
20
14
  readonly projections: ProjectionPort | undefined;
@@ -25,11 +19,13 @@ export interface HostPlatformPorts {
25
19
  /** Domain service owning the host port table. */
26
20
  export declare class EvolutionPlatform extends Service {
27
21
  static inject: never[];
28
- readonly ports: HostPlatformPorts;
22
+ private resolved;
29
23
  constructor(ctx: Context);
30
- /** True when the two services the runtime cannot work without are present. */
31
- ready(): boolean;
32
- /** One row per optional host service; absent services stay visible, not silent. */
33
- capabilities(): readonly PlatformCapability[];
24
+ /**
25
+ * Resolve the host ports on first use and keep that answer for the service
26
+ * lifetime. Consumers read this one table; they never fall back to a direct
27
+ * platform import (the second resolution D7 removed).
28
+ */
29
+ get ports(): HostPlatformPorts;
34
30
  }
35
31
  //# sourceMappingURL=platform.d.ts.map
@@ -11,28 +11,22 @@ import { llmPort } from "../platform/llm.js";
11
11
  /** Domain service owning the host port table. */
12
12
  export class EvolutionPlatform extends Service {
13
13
  static inject = [];
14
- ports;
14
+ resolved;
15
15
  constructor(ctx) {
16
16
  super(ctx, 'evolutionPlatform');
17
- this.ports = {
18
- projections: projectionPort(ctx),
19
- llm: llmPort(ctx),
20
- tools: toolsPort(ctx),
21
- presets: presetsPort(ctx),
22
- };
23
- }
24
- /** True when the two services the runtime cannot work without are present. */
25
- ready() {
26
- return this.ports.projections !== undefined && this.ports.llm !== undefined;
27
17
  }
28
- /** One row per optional host service; absent services stay visible, not silent. */
29
- capabilities() {
30
- return [
31
- { name: 'projections', available: this.ports.projections !== undefined, ...(this.ports.projections === undefined ? { reason: 'sessionProjections unavailable' } : {}) },
32
- { name: 'llm', available: this.ports.llm !== undefined, ...(this.ports.llm === undefined ? { reason: 'llm unavailable' } : {}) },
33
- { name: 'tools', available: this.ports.tools !== undefined, ...(this.ports.tools === undefined ? { reason: 'tools unavailable' } : {}) },
34
- { name: 'presets', available: this.ports.presets !== undefined, ...(this.ports.presets === undefined ? { reason: 'agentPresets unavailable' } : {}) },
35
- ];
18
+ /**
19
+ * Resolve the host ports on first use and keep that answer for the service
20
+ * lifetime. Consumers read this one table; they never fall back to a direct
21
+ * platform import (the second resolution D7 removed).
22
+ */
23
+ get ports() {
24
+ return this.resolved ??= {
25
+ projections: projectionPort(this.ctx),
26
+ llm: llmPort(this.ctx),
27
+ tools: toolsPort(this.ctx),
28
+ presets: presetsPort(this.ctx),
29
+ };
36
30
  }
37
31
  }
38
32
  //# sourceMappingURL=platform.js.map
@@ -6,5 +6,5 @@
6
6
  import type { Context } from '@deepseek-ai/cordis';
7
7
  export declare const name = "evolution-core-runtime";
8
8
  /** @param ctx - the composition context that owns the runtime services. */
9
- export declare function apply(ctx: Context): void;
9
+ export declare function apply(ctx: Context): Promise<void>;
10
10
  //# sourceMappingURL=plugin.d.ts.map
@@ -3,9 +3,11 @@ import { EvolutionPlatform } from "./platform.js";
3
3
  import { EvolutionProjections } from "./projections.js";
4
4
  export const name = 'evolution-core-runtime';
5
5
  /** @param ctx - the composition context that owns the runtime services. */
6
- export function apply(ctx) {
7
- ctx.plugin(EvolutionPlatform);
8
- ctx.plugin(EvolutionProjections);
9
- ctx.plugin(EvolutionLlm);
6
+ export async function apply(ctx) {
7
+ // Ports resolve from the platform service now, so the platform must be mounted
8
+ // before the consumers initialize; sequential plugin mounts make that order real.
9
+ await ctx.plugin(EvolutionPlatform);
10
+ await ctx.plugin(EvolutionProjections);
11
+ await ctx.plugin(EvolutionLlm);
10
12
  }
11
13
  //# sourceMappingURL=plugin.js.map
@@ -5,7 +5,6 @@
5
5
  * into the host.
6
6
  */
7
7
  import { Service } from '@deepseek-ai/cordis';
8
- import { projectionPort } from "../platform/index.js";
9
8
  import { evolutionActivityProjection, evolutionEvidenceProjection, evolutionProjectionHistoryProjection, evolutionReadsProjection, evolutionSignalsProjection, } from "../session-projection.js";
10
9
  /** Domain service owning the family's projection registrations. */
11
10
  export class EvolutionProjections extends Service {
@@ -17,7 +16,7 @@ export class EvolutionProjections extends Service {
17
16
  }
18
17
  async [Service.init]() {
19
18
  const platform = this.ctx.get('evolutionPlatform');
20
- const port = platform?.ports?.projections ?? projectionPort(this.ctx);
19
+ const port = platform?.ports.projections;
21
20
  if (port === undefined) {
22
21
  this.markDegraded('sessionProjections service unavailable');
23
22
  return;
@@ -72,7 +72,7 @@ interface SkillHealthSnapshot {
72
72
  /** Mechanical hard-cap-hit count, when the caller has it; null = unknown. */
73
73
  hardCapHits?: number | null | undefined;
74
74
  }
75
- interface SkillHealthDim {
75
+ export interface SkillHealthDim {
76
76
  bodyChars: number;
77
77
  /** The same body on the token scale (limit basis) — the judged quantity. */
78
78
  bodyTokens: number;
@@ -93,6 +93,34 @@ export interface SkillHealthAssessment {
93
93
  /** The same judgement as `reasons`, in diffable form: (rule id, severity, count). G1. */
94
94
  findings: LintFinding[];
95
95
  }
96
+ /** One finding as the health route/panel sees it (wire shape, not the engine's LintFinding). */
97
+ export interface SkillHealthWireFinding {
98
+ rule: string;
99
+ count: number;
100
+ line: string | null;
101
+ countIsMeaningful: boolean;
102
+ severity?: 'warn' | 'error';
103
+ message?: string;
104
+ }
105
+ /** Measured dimensions on the health wire; absent when the scan could not read them. */
106
+ export interface SkillHealthWireDims {
107
+ bodyChars: number | null;
108
+ bodyTokens: number | null;
109
+ supportGroups: number;
110
+ supportFiles: number | null;
111
+ churnPatches: number | null;
112
+ churnReads: number | null;
113
+ stampDensityPerKb: number | null;
114
+ }
115
+ /** One health row on the wire; `readable: false` is its own verdict, never healthy. */
116
+ export interface SkillHealthWireRow {
117
+ name: string;
118
+ verdict: 'healthy' | 'warn' | 'error' | 'unreadable' | 'needs-restructure';
119
+ findings: SkillHealthWireFinding[];
120
+ dims?: SkillHealthWireDims | null;
121
+ protection?: string | null;
122
+ hardCapHits?: number | null;
123
+ }
96
124
  /**
97
125
  * The findings for ONE body, computed by the engine that owns the judgement (G4).
98
126
  *
@@ -365,6 +365,10 @@ export declare class SkillLibrary {
365
365
  */
366
366
  private unitHeadForOps;
367
367
  private withMutationLock;
368
+ /** The one MutationUnit constructor: storage ports are fixed here, callers pass the rest. */
369
+ private commitUnit;
370
+ /** The one frontmatter pipeline for create/update/patch; patch keeps its cap checks outside. */
371
+ private prepareBody;
368
372
  private lockPort;
369
373
  private recovery;
370
374
  /** Run the boot recovery once per library instance, before the first write. */
@@ -628,6 +632,7 @@ export declare class SkillLibrary {
628
632
  /** Mark merge-absorbed sources archived in the usage sidecar (FR-DATA-07). */
629
633
  private foldArchivedUsage;
630
634
  archive(rawName: string, options?: ArchiveOptions, origin?: WriteOrigin): Promise<SkillActionResult>;
635
+ private archiveCore;
631
636
  /**
632
637
  * Commit one merge plan as a single multi-skill transaction.
633
638
  *
@@ -719,6 +724,7 @@ export declare class SkillLibrary {
719
724
  * path back. The `.archive-reason` marker is dropped on restore.
720
725
  */
721
726
  restoreFromArchive(rawName: string, origin?: WriteOrigin): Promise<SkillActionResult>;
727
+ private restoreFromArchiveCore;
722
728
  writeSupportFile(rawName: string, filePath: string, content: string, origin?: WriteOrigin, anchor?: WriteAnchor): Promise<SkillActionResult>;
723
729
  private writeSupportFileCore;
724
730
  removeSupportFile(rawName: string, filePath: string, origin?: WriteOrigin, anchor?: WriteAnchor, unitId?: string): Promise<SkillActionResult>;