@shgroup/dsh-serenity-hooks 1.19.7 → 1.19.9

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/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-serenity-hooks",
3
- "version": "1.19.7",
3
+ "version": "1.19.9",
4
4
  "main": "lib/index.js",
5
5
  "description": "宁静号 ACC harness(Native Cordis 插件):真实 DSH 工具 cc_fs/session/acc_msm/eap/neat/cce/loop + 拦截缝机械约束(safe-mode/路径守卫)。适配 DSH 公开版(0.1.0-rc,deepseek-ai/deepseek-harness)。私有(dsh-external 组织)。",
6
6
  "engines": {
package/lib/index.js CHANGED
@@ -4089,11 +4089,31 @@ function cceBlock() {
4089
4089
  ""
4090
4090
  ].join("\n");
4091
4091
  }
4092
- /** 3) Constraints 块:逐字对齐 osp(Root + 文件边界 + shell + subagent + session-first) */
4093
- function constraintsBlock(root) {
4092
+ /**
4093
+ * Principles 块(v1.19.8 合并,S142):认知容器本体论(why)+ 操作边界(operational
4094
+ * boundaries)。原独立 Principles 与 Constraints 合并——同属容器约束体系,先原则
4095
+ * 后边界(从抽象到具体,重建视角 R↓)。**注意:Constraints 不再作为独立对齐块存在
4096
+ * (spec 修订:同步 osp compacting.ts——Constraints 内容并入本块,工具名仍为平台真实名)。**
4097
+ */
4098
+ function principlesBlock(root) {
4094
4099
  return [
4095
4100
  "",
4096
- "=== Serenity Constraints ===",
4101
+ "=== Serenity Principles ===",
4102
+ "Why a cognitive container: all work is cognition — every artifact, decision,",
4103
+ "and line of code is a product of thought; and from cognition, any work can",
4104
+ "be built. In this frame, the world contains no errors — only insufficient",
4105
+ "cognition. A setback is a gap to be filled (read, ask, research), not a",
4106
+ "fault to be hidden. Never disguise or excuse what you do not know;",
4107
+ "not-knowing is a state to be repaired, and reporting it is the first repair.",
4108
+ "",
4109
+ "MSM principles — machinery before improvisation:",
4110
+ "- Determinism first: use a registered Mech before hand-rolling; reserve",
4111
+ " Semi-Mech for genuine judgment points.",
4112
+ "- Single source of truth: an MSM is the only decoder of its own usage",
4113
+ " (--help/--schema); documents must not duplicate it.",
4114
+ "- Registered to act: no tool exists unless it is on the manifest.",
4115
+ "",
4116
+ "Operational boundaries:",
4097
4117
  `Root: ${root}`,
4098
4118
  " • File access — read/edit/write/grep/glob are confined to Root; paths outside Root are rejected (RR5)",
4099
4119
  " • Shell — use acc_msm by default. Note: bash may be disabled",
@@ -4134,7 +4154,7 @@ function metaphorBlock() {
4134
4154
  "violation. The universe is structured in three layers — the Ship (the",
4135
4155
  "container itself), the Voyage (the cognitive lifecycle), the Crew",
4136
4156
  "(multi-agent collaboration); every metaphor maps to one protocol",
4137
- "constraint.",
4157
+ "constraint. The Sea has no mistakes — only waters you have not yet charted.",
4138
4158
  "",
4139
4159
  "THE SHIP — the container itself",
4140
4160
  "",
@@ -4151,30 +4171,42 @@ function metaphorBlock() {
4151
4171
  " drawings rebuild the whole machine (R↓), the drawings are reusable",
4152
4172
  " (S↑). Verdict: an undimensioned part = unassemblable.",
4153
4173
  "",
4174
+ "4. The Machinery → MSM (Mech & Semi-Mech). The ship's equipment is",
4175
+ " machinery: registered, deterministic, self-describing. Turn the",
4176
+ " crank of a Mech and the action is exact; the wheel with a helmsman",
4177
+ " (Semi-Mech) steers where judgment is needed. Verdict: hand-rolling",
4178
+ " what a machine already does = wasting the crew.",
4179
+ "",
4180
+ "5. The Manifest → Single Source of Truth. Every tool exists only if it",
4181
+ " is on the manifest (mech-registry); there is exactly one manifest.",
4182
+ " An MSM self-describes (--help/--schema) — the manifest is the only",
4183
+ " key. Verdict: duplicating a tool's usage in documents = two",
4184
+ " contradictory charts.",
4185
+ "",
4154
4186
  "THE VOYAGE — the cognitive lifecycle",
4155
4187
  "",
4156
- "4. Harbor Inspection → First Anchor. The first anchor = departure",
4188
+ "6. Harbor Inspection → First Anchor. The first anchor = departure",
4157
4189
  " inspection: confirm identity (ACC manifesto), logbook (SESSION),",
4158
4190
  " ballast (constraints) before setting sail. Verdict: skipping the",
4159
4191
  " anchor and working directly = sailing uninspected.",
4160
4192
  "",
4161
- "5. The Logbook → Session Tracking. SESSION.md is the only ship log.",
4193
+ "7. The Logbook → Session Tracking. SESSION.md is the only ship log.",
4162
4194
  " Unrecorded = unvoyaged. Verdict: finishing multi-step work without",
4163
4195
  " a progress record = a missing page.",
4164
4196
  "",
4165
- "6. The Ship of Theseus → Continuity. Planks may be replaced; the ship",
4197
+ "8. The Ship of Theseus → Continuity. Planks may be replaced; the ship",
4166
4198
  " remains the same. The container can be rebuilt; identity persists.",
4167
4199
  " You are part of a trajectory, not a new ship. Verdict: acting",
4168
4200
  " without consulting precedent = a different ship.",
4169
4201
  "",
4170
4202
  "THE CREW — multi-agent collaboration",
4171
4203
  "",
4172
- "7. Crew Rotation → Multi-Agent Cognition. Other crew members will come",
4204
+ "9. Crew Rotation → Multi-Agent Cognition. Other crew members will come",
4173
4205
  " after you. When you leave, leave a handover they can pick up",
4174
4206
  " (SESSION closed, open problems listed). Verdict: leaving without",
4175
4207
  " handover = abandoning ship.",
4176
4208
  "",
4177
- "8. Blueprint over Statue → Reconstruction > Preservation. Keep the",
4209
+ "10. Blueprint over Statue → Reconstruction > Preservation. Keep the",
4178
4210
  " blueprint, not the statue. Recording only conclusions without",
4179
4211
  " rationale = a statue with no blueprint, unreconstructable.",
4180
4212
  " Verdict: a decision record without reasons or alternatives =",
@@ -4183,9 +4215,11 @@ function metaphorBlock() {
4183
4215
  ].join("\n");
4184
4216
  }
4185
4217
  /**
4186
- * 运行时状态块 1) safe-mode(S134 v1.16.12):ON 时告知 agent(行为约束;机制仍由 guards 强制)。
4187
- * 文案与实现逐项对应(guards.ts):bash 禁用(restrict deny + decideGuard)、
4188
- * 黑名单路径拦截、CCC 治理文件保护;write/edit 等其余工具保留(受路径逃逸/黑名单约束)。
4218
+ * 运行时状态块 1) safe-mode(S134 v1.16.12):ON 时告知 agent
4219
+ * v1.19.8 结构重排(S142 用户设计思路):语义(为什么——无人值守自由)→
4220
+ * 机制(什么被禁用)→ 约束(不可做什么)。文案与实现逐项对应(guards.ts):
4221
+ * bash 禁用(restrict deny + decideGuard)、黑名单路径拦截、CCC 治理文件保护;
4222
+ * write/edit 等其余工具保留(受路径逃逸/黑名单约束)。
4189
4223
  */
4190
4224
  function safeModeBlock(root) {
4191
4225
  if (!isSafeModeOn(root)) return "";
@@ -4193,13 +4227,21 @@ function safeModeBlock(root) {
4193
4227
  return [
4194
4228
  "",
4195
4229
  "=== Serenity Safe Mode ===",
4196
- "Safe mode is ON (enabled by the user): bash is disabled (hidden and blocked);",
4197
- "blacklist rules apply to file paths; CCC governance files (.serenity,",
4198
- ".serenity-safe-on) are protected from agent writes. Other read/write tools",
4199
- "remain available, subject to path-escape and blacklist guards.",
4230
+ "Safe mode is ON (enabled by the user). It makes the vessel unattended-capable ",
4231
+ "the hull holds its course without a watch on deck: you may work with fuller",
4232
+ "freedom, pushing work forward autonomously without pausing for approval at",
4233
+ "every step. The guards are not chains; they are the ballast that lets you",
4234
+ "sail unaccompanied.",
4235
+ "",
4236
+ "Operational details:",
4237
+ "- bash is disabled (hidden and blocked)",
4238
+ "- blacklist rules apply to file paths",
4239
+ "- CCC governance files (.serenity, .serenity-safe-on) are protected from agent writes",
4240
+ "- other read/write tools remain available, subject to path-escape and blacklist guards",
4241
+ blacklist.length > 0 ? `\nActive blacklist rules: ${blacklist.map((b) => b.message ?? b.pattern).join(", ")}` : "",
4242
+ "",
4200
4243
  "Behavior constraints: do not attempt to bypass restrictions; do not write to",
4201
4244
  "blacklisted paths or governance files.",
4202
- blacklist.length > 0 ? `\nActive blacklist rules: ${blacklist.map((b) => b.message ?? b.pattern).join(", ")}` : "",
4203
4245
  ""
4204
4246
  ].join("\n");
4205
4247
  }
@@ -4282,17 +4324,22 @@ function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
4282
4324
  ""
4283
4325
  ].join("\n");
4284
4326
  }
4285
- /** 完整系统提示词注入文本:ACC + CCE + Constraints + EAP + SKILL 全文 + Session(osp 顺序 + EAP 扩展) */
4327
+ /**
4328
+ * 完整系统提示词注入文本(v1.19.8 结构精简,S142 重建视角 R↓):
4329
+ * 身份(ACC)→ 世界模型(Metaphor)→ 信念/边界(Principles)→ 时间约束(CCE)
4330
+ * → 质量(EAP)→ 状态(SafeMode/Localstore)→ CCC 上下文(SKILL)→ 会话(Session)。
4331
+ * 认知展开顺序:我是谁 → 我所在的世界 → 为什么 → 如何一致 → 产物标准 → 当前状态 → 上下文。
4332
+ */
4286
4333
  function serenitySystemPrompt(root, scope = DEFAULT_SESSION_SCOPE) {
4287
4334
  const parts = [
4288
4335
  accBlock(root),
4336
+ metaphorBlock(),
4337
+ principlesBlock(root),
4289
4338
  cceBlock(),
4290
- constraintsBlock(root)
4339
+ eapBlock()
4291
4340
  ];
4292
4341
  const state = [safeModeBlock(root), localstoreBlock(root)].filter((b) => b !== "").join("\n");
4293
4342
  if (state) parts.push(state);
4294
- parts.push(eapBlock());
4295
- parts.push(metaphorBlock());
4296
4343
  const skill = entrySkillSectionText(root);
4297
4344
  if (skill) parts.push(skill);
4298
4345
  const session = sessionBlock(root, scope);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.19.7",
3
+ "version": "1.19.9",
4
4
  "description": "宁静号 ACC harness — Native Cordis 插件(DeepSeek Harness 运行时)。真实 DSH 工具注册(cc_fs/session/acc_msm 等 9 工具)+ 拦截缝机械约束(safe-mode/路径守卫/会话落盘)+ 系统提示词注入(ACC/CCE/Constraints/SKILL/Session 五块)。适配 DSH 公开版(deepseek-ai/deepseek-harness 0.1.0-rc)。",
5
5
  "license": "MIT",
6
6
  "repository": {