@lmzhen/dsh-evolution-state-json 0.1.0 → 0.2.0-rc.1
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/lib/index.js +8 -5
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -41,7 +41,7 @@ async function transactIo(io, path, task) {
|
|
|
41
41
|
* changes semantically: the bundle digest is the fail-closed signal for
|
|
42
42
|
* review workers, so a stale id across deployments must be distinguishable.
|
|
43
43
|
*/
|
|
44
|
-
const PROMPT_BUNDLE_ID = "dsh-evolution@
|
|
44
|
+
const PROMPT_BUNDLE_ID = "dsh-evolution@9";
|
|
45
45
|
const MEMORY_REVIEW_PROMPT = `[Auto-review — Memory]
|
|
46
46
|
Review the conversation above and consider saving to memory if appropriate.
|
|
47
47
|
|
|
@@ -72,7 +72,8 @@ Preference order — prefer the earliest action that fits, but do pick one when
|
|
|
72
72
|
• templates/<name>.<ext> — starter files meant to be copied and modified (boilerplate configs, scaffolding, a known-good example the agent can reproduce with modifications).
|
|
73
73
|
• scripts/<name>.<ext> — statically re-runnable actions the skill can invoke directly (verification scripts, fixture generators, deterministic probes, anything the agent should run rather than hand-type each time).
|
|
74
74
|
Add support files via skill_manage action=write_file with file_path starting 'references/', 'templates/', or 'scripts/'. The umbrella's SKILL.md should gain a one-line pointer to any new support file so future agents know it exists.
|
|
75
|
-
4.
|
|
75
|
+
4. RESTRUCTURE a loaded skill whose body grew log-like — rc/sha/date-dense sections, session-detail spirals, or a fat body with no support files. Use skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section (from that heading to the next heading) moves into the support file and its position becomes a pointer line. The skill's name and directory never change. Only propose headings that exist verbatim in the body; never invent one, and never restructure a healthy small skill.
|
|
76
|
+
5. CREATE A NEW CLASS-LEVEL UMBRELLA SKILL when no existing skill covers the class. The name MUST be at the class level. The name MUST NOT be a specific PR number, error string, feature codename, library-alone name, or 'fix-X / debug-Y / audit-Z-today' session artifact. If the proposed name only makes sense for today's task, it's wrong — fall back to (1), (2), or (3).
|
|
76
77
|
|
|
77
78
|
User-preference embedding (important): when the user expressed a style/format/workflow preference, the update belongs in the SKILL.md body, not just in memory. Memory captures 'who the user is and what the current situation and state of your operations are'; skills capture 'how to do this class of task for this user'. When they complain about how you handled a task, the skill that governs that task needs to carry the lesson.
|
|
78
79
|
|
|
@@ -117,7 +118,8 @@ Preference order for skills — pick the earliest that fits:
|
|
|
117
118
|
1. UPDATE A CURRENTLY-LOADED SKILL. Check what skills were loaded or read in the conversation. If one of them covers the learning, PATCH it first. It was in play; it's the right place.
|
|
118
119
|
2. UPDATE AN EXISTING UMBRELLA. Patch it.
|
|
119
120
|
3. ADD A SUPPORT FILE under an existing umbrella via skill_manage action=write_file. Three kinds: references/<topic>.md for session-specific detail OR condensed knowledge banks (quoted research, API docs excerpts, domain notes) written concise and task-focused; templates/<name>.<ext> for starter files meant to be copied and modified; scripts/<name>.<ext> for statically re-runnable actions (verification, fixture generators, probes). Add a one-line pointer in SKILL.md so future agents find them.
|
|
120
|
-
4.
|
|
121
|
+
4. RESTRUCTURE a loaded skill whose body grew log-like (rc/sha/date-dense sections, session-detail spirals, fat body with no support files) via skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section moves into the support file and its position becomes a pointer line; the skill's name and directory never change. Only propose headings that exist verbatim in the body.
|
|
122
|
+
5. CREATE A NEW CLASS-LEVEL UMBRELLA when nothing exists. Name at the class level — NOT a PR number, error string, codename, library-alone name, or 'fix-X / debug-Y' session artifact. If the name only fits today's task, fall back to (1), (2), or (3).
|
|
121
123
|
|
|
122
124
|
Two-tier deposition discipline (DSH addition): classify before writing — PATTERN (symptom → mechanism → fix → verification) goes in the SKILL.md body; LOG (commit SHAs, npm/profile states, this release's change list, this session's narrative) goes in a references/ file. Body density IS reuse rate; a pattern fits in 2-8 physical lines.
|
|
123
125
|
|
|
@@ -183,6 +185,7 @@ When done, write a human summary THEN the structured machine-readable block. The
|
|
|
183
185
|
\`\`\`yaml
|
|
184
186
|
consolidations:
|
|
185
187
|
- from: <old-skill-name>
|
|
188
|
+
mode: reference # optional — ONLY for a 'demote': source is narrow-but-valuable session detail, write it as references/<source>.md under the umbrella instead of appending to the body. Default is append. Place this line BEFORE into:. NEVER use reference when the source body links its own references/ templates/ scripts/ files.
|
|
186
189
|
into: <umbrella-skill-name>
|
|
187
190
|
reason: <one short sentence — why merged, not just 'similar'>
|
|
188
191
|
prunings:
|
|
@@ -220,12 +223,12 @@ function sha256(text) {
|
|
|
220
223
|
function createPromptBundle(prompts) {
|
|
221
224
|
const canonical = JSON.stringify({
|
|
222
225
|
id: PROMPT_BUNDLE_ID,
|
|
223
|
-
version:
|
|
226
|
+
version: 9,
|
|
224
227
|
prompts: Object.fromEntries(Object.entries(prompts).sort())
|
|
225
228
|
});
|
|
226
229
|
return Object.freeze({
|
|
227
230
|
id: PROMPT_BUNDLE_ID,
|
|
228
|
-
version:
|
|
231
|
+
version: 9,
|
|
229
232
|
prompts: Object.freeze({ ...prompts }),
|
|
230
233
|
sha256: sha256(canonical)
|
|
231
234
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-state-json",
|
|
3
3
|
"description": "JSON-file evolution state provider over the IO seam (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0-rc.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
39
39
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
|
-
"@lmzhen/dsh-evolution-io": "^0.
|
|
41
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.
|
|
40
|
+
"@lmzhen/dsh-evolution-io": "^0.2.0-rc.1",
|
|
41
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.2.0-rc.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
45
|
-
"@lmzhen/dsh-evolution-io": "^0.
|
|
46
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.
|
|
45
|
+
"@lmzhen/dsh-evolution-io": "^0.2.0-rc.1",
|
|
46
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.2.0-rc.1"
|
|
47
47
|
}
|
|
48
48
|
}
|