@lmzhen/dsh-evolution-commands 0.3.82 → 0.4.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.
- package/README.md +18 -29
- package/lib/index.js +17 -6
- package/lib/types/registry.d.ts +3 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,39 +1,28 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @lmzhen/dsh-evolution-commands
|
|
2
2
|
|
|
3
|
-
Human commands for the evolution family
|
|
3
|
+
Human commands for the evolution family: it registers the `/evolution …` command surface
|
|
4
|
+
and its help text, and drives the other rows from a command. It adds no automatic
|
|
5
|
+
background behaviour of its own.
|
|
4
6
|
|
|
5
|
-
## Model
|
|
7
|
+
## Model surface
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
- **Model-visible:** one direct token — the `/evolution learn` injection — the full learning guidance is injected as a user message in this session; everything else adds no tokens.
|
|
10
|
+
- **Prompt prefix / KV cache:** independent of request-prefix construction — it does not alter the assembled prompt or tool list; family rules: `packages/README.md` §"Model-visible prompt prefix and the KV cache".
|
|
11
|
+
- **Mount it?** yes — the `evolution-commands` row, carried by the `evolution-host`, `evolution-all` and `evolution-preset` bundles.
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
## Command reference
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
#### Token effect
|
|
14
|
-
|
|
15
|
-
P2-22 (v11) correction: this package's **only** direct model-visible token is the
|
|
16
|
-
`/evolution learn` injection — the full learning guidance is injected as a user
|
|
17
|
-
message in this session. Everything else adds no tokens; consumers add their own.
|
|
18
|
-
The injection goes through the agent's waking primitive (`followup`, falling back
|
|
19
|
-
to `inject` when the host lacks it), **called on the agent instance**: the
|
|
20
|
-
platform's `Agent.followup` is a prototype method (`this.send(...)`), so a
|
|
21
|
-
detached reference throws and queues nothing (0.3.73 fix; the same shape is
|
|
22
|
-
pinned by rule N13b in `packages/scripts/verify-arch-guards.mjs`, which masks comments and string literals before matching and self-tests its detector at startup).
|
|
23
|
-
|
|
24
|
-
#### KV Cache effect
|
|
25
|
-
|
|
26
|
-
Independent of request-prefix construction. This package does not alter the assembled prompt or tool list.
|
|
27
|
-
|
|
28
|
-
## Known Limitations and Deferred Work
|
|
15
|
+
The full `/evolution` subcommand table is single-sourced in the family README's **Command reference** section (`packages/README.md` in the source repository; it is named here instead of linked because a repo-relative markdown link out of this package would be dead inside the npm published tree). It is rendered from the subcommand registry (`src/registry.ts`, the same single source as the `/evolution` input-declaration hint and the bare-command help output), and `tests/registry.spec.ts` (T-WD2) pins that rendered table byte-for-byte.
|
|
29
16
|
|
|
17
|
+
## Known limitations
|
|
30
18
|
|
|
31
19
|
- No known durable consumer gaps at this time. Runtime contracts are covered by package and boundary tests.
|
|
32
|
-
- **① variant form: the `/evolution …` command face is visible in every session**
|
|
33
|
-
(accepted, not fixed — 0.3.78). Commands are registered in scope layers, and the
|
|
34
|
-
family registers once on the host plane, so a session on a platform original
|
|
35
|
-
preset still lists the management-only subcommands even though no automatic
|
|
36
|
-
family behaviour reaches it. The difference and its reasoning are single-sourced
|
|
37
|
-
in `INSTALL.md` ("Known difference").
|
|
20
|
+
- **① variant form: the `/evolution …` command face is visible in every session** (accepted, not fixed). Commands are registered in scope layers, and the family registers once on the host plane, so a session on a platform original preset still lists the management-only subcommands even though no automatic family behaviour reaches it. The difference and its reasoning are single-sourced in `INSTALL.md` ("Known difference").
|
|
38
21
|
|
|
39
22
|
**Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
|
|
23
|
+
|
|
24
|
+
## Notes and history
|
|
25
|
+
|
|
26
|
+
- P2-22 (v11) correction: this package's **only** direct model-visible token is the `/evolution learn` injection — the full learning guidance is injected as a user message in this session.
|
|
27
|
+
- **① variant form: the `/evolution …` command face is visible in every session** (accepted, not fixed: 0.3.78).
|
|
28
|
+
- The injection goes through the agent's waking primitive (`followup`, falling back to `inject` when the host lacks it), **called on the agent instance**: the platform's `Agent.followup` is a prototype method (`this.send(...)`), so a detached reference throws and queues nothing (0.3.73 fix; the same shape is pinned by rule N13b in `packages/scripts/verify-arch-guards.mjs`, which masks comments and string literals before matching and self-tests its detector at startup).
|
package/lib/index.js
CHANGED
|
@@ -321,8 +321,8 @@ async function diagnose(ctx, options = {}) {
|
|
|
321
321
|
if (full && host) conflicts.push("evolution-all and evolution-host are installed together — the infra rows double-mount and startup fails loud. Keep ONE: remove the other bundle.");
|
|
322
322
|
if (full && preset) conflicts.push("evolution-all and evolution-preset are installed together — the infra rows double-mount. Keep ONE.");
|
|
323
323
|
if (host && preset) conflicts.push("evolution-host and evolution-preset are installed together — the infra rows double-mount. Keep ONE.");
|
|
324
|
-
if (full && presetDirInstalled) conflicts.push(`evolution-all and the layered Evolution preset (${layeredArtifactLabel}) are both present — the model rows double-
|
|
325
|
-
if (preset && presetDirInstalled) conflicts.push(`evolution-preset and the layered Evolution preset (${layeredArtifactLabel}) are both present — the model rows double-
|
|
324
|
+
if (full && presetDirInstalled) conflicts.push(`evolution-all and the layered Evolution preset (${layeredArtifactLabel}) are both present — the four model rows AND the systemPrompt sections double-instance across the profile and preset layers; the preset loader does not fail on it, shadowing semantics take the nearest layer, so an Evolution-preset session silently runs the preset's copies of everything. Keep ONE (use layered without all, or drop the preset).`);
|
|
325
|
+
if (preset && presetDirInstalled) conflicts.push(`evolution-preset and the layered Evolution preset (${layeredArtifactLabel}) are both present — the preset bundle carries the same model rows as all, so the four model rows AND the systemPrompt sections double-instance and shadowing semantics take the nearest layer (the preset loader does not fail on it). Keep ONE (drop the preset bundle, or remove the layered preset).`);
|
|
326
326
|
const reviewMounted = full || host || preset;
|
|
327
327
|
const services = {
|
|
328
328
|
review: reviewMounted,
|
|
@@ -850,13 +850,22 @@ function apply(ctx, rawConfig = {}) {
|
|
|
850
850
|
io: ioRegistry.provider()
|
|
851
851
|
});
|
|
852
852
|
const enrichment = await buildEnrichment(ctx, library);
|
|
853
|
-
const
|
|
853
|
+
const readFailures = [];
|
|
854
|
+
const snapshots = await snapshotFromLibrary(library, {
|
|
854
855
|
descriptions: enrichment.descriptions,
|
|
855
856
|
supportFiles: enrichment.supportFiles,
|
|
856
857
|
quality: enrichment.quality,
|
|
857
858
|
protected: enrichment.protected,
|
|
858
|
-
catalogInvalid: enrichment.catalogInvalid
|
|
859
|
-
|
|
859
|
+
catalogInvalid: enrichment.catalogInvalid,
|
|
860
|
+
onReadError: (name, error) => {
|
|
861
|
+
readFailures.push(name);
|
|
862
|
+
ctx.logger.warn(`evolution-maintenance: skipping unreadable skill "${name}": ${error instanceof Error ? error.message : String(error)}`);
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
if (snapshots.length === 0 && readFailures.length > 0) return err(`maintenance scan could not read ${readFailures.length} listed skill(s) (${readFailures.slice(0, 10).join(", ")}${readFailures.length > 10 ? ", …" : ""}) and read no skill at all — the library was NOT audited; fix the unreadable skills (or their directory names) and run the scan again`);
|
|
866
|
+
if (snapshots.length === 0 && skillsRootValue !== "" && !await ioRegistry.provider().exists(skillsRootValue)) return err(`maintenance scan found an empty skill library, but the configured skill root does not exist (${skillsRootValue}) — point the skillsRoot config at a real directory (a literal \`~\` is not expanded) and run the scan again`);
|
|
867
|
+
if (snapshots.length === 0) return ok("Maintenance scan: empty skill library. Nothing to do.");
|
|
868
|
+
const { facts } = buildMaintainFacts(snapshots, enrichment.usageObservedValue, void 0);
|
|
860
869
|
return ok(`Maintenance facts (0-token preview):\n${facts}`);
|
|
861
870
|
}
|
|
862
871
|
const maintainArgs = /^maintain(?:\s+--timeout[ =](\d+))?\s*$/.exec(input);
|
|
@@ -994,7 +1003,9 @@ function apply(ctx, rawConfig = {}) {
|
|
|
994
1003
|
if (approval) {
|
|
995
1004
|
const session = invocationAgent?.session;
|
|
996
1005
|
const sessionPolicy = effectiveSessionPolicy(ctx, session);
|
|
997
|
-
|
|
1006
|
+
const stagesForeground = approval.isEnabled !== false && sessionPolicy !== "never" && approval.stageForeground !== false;
|
|
1007
|
+
if (stagesForeground && session === void 0) return err("E-306: this deployment stages foreground writes, but this invocation carries no agent session — `/evolution restructure` would stage a record with no session attribution. Run it from a session in the GUI or the CLI, or set `stageForeground: false` on the evolution-approval row, then repeat the command.");
|
|
1008
|
+
if (stagesForeground && !approval.hasRunner("skill")) return err("Restructure cannot be staged: no skill replay runner is registered — mount the tool-skill-manage row (evolution-agent preset, or evolution-all) or disable evolution-approval.");
|
|
998
1009
|
const decision = await approval.request({
|
|
999
1010
|
kind: "skill",
|
|
1000
1011
|
summary: `/evolution restructure ${name}${planRunId ? ` (plan ${planRunId})` : ""}`,
|
package/lib/types/registry.d.ts
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* 0.3.55 (WD1): the input-declaration hint, the bare `/evolution` help output
|
|
5
5
|
* and the README command table all render FROM this table; a hand-written
|
|
6
6
|
* copy anywhere is drift waiting to happen (v10 R-13 proved it once).
|
|
7
|
+
* PLAN S5.3 (2026-09-16): "the README command table" means the FAMILY README
|
|
8
|
+
* (`packages/README.md` — the T-WD2 anchor). Package-level READMEs cite that
|
|
9
|
+
* home instead of restating the table (doc-facts rule N19).
|
|
7
10
|
* Keep `usage` in the exact shape a user can type after `/evolution`.
|
|
8
11
|
*/
|
|
9
12
|
export interface CommandEntry {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-commands",
|
|
3
3
|
"description": "Human commands for the evolution family (/evolution pending|curator|maintain|doctor) (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
30
|
-
"@lmzhen/dsh-evolution-approval": "^0.
|
|
31
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
32
|
-
"@lmzhen/dsh-evolution-maintenance": "^0.
|
|
30
|
+
"@lmzhen/dsh-evolution-approval": "^0.4.0",
|
|
31
|
+
"@lmzhen/dsh-evolution-core": "^0.4.0",
|
|
32
|
+
"@lmzhen/dsh-evolution-maintenance": "^0.4.0"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@lmzhen/dsh-evolution-agent-preset": "^0.
|
|
35
|
+
"@lmzhen/dsh-evolution-agent-preset": "^0.4.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.1",
|