@yiyi_zhang/laoshi 0.1.1 → 0.2.0-beta.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/adapters/dsh/plugin/index.mjs +1 -1
  3. package/adapters/dsh/plugin/package.json +1 -1
  4. package/adapters/mogao/adapter.ts +46 -0
  5. package/adapters/mogao/install.mjs +31 -0
  6. package/adapters/mogao/make-expert.mjs +63 -0
  7. package/adapters/mogao/mogao-runtime.ts +457 -0
  8. package/adapters/mogao/skill/setup.md +21 -0
  9. package/bin/install.mjs +8 -2
  10. package/bin/req.mjs +8 -0
  11. package/contracts/agent-runtime.md +3 -0
  12. package/docs/design/mogao-expert.md +101 -0
  13. package/engine/src/api.ts +5 -5
  14. package/engine/src/code-review.ts +2 -2
  15. package/engine/src/control.ts +6 -6
  16. package/engine/src/danger-guard.ts +7 -0
  17. package/engine/src/doctor.ts +1 -1
  18. package/engine/src/features.ts +2 -2
  19. package/engine/src/integration-cmd.ts +2 -2
  20. package/engine/src/launch.ts +44 -6
  21. package/engine/src/locations.ts +15 -1
  22. package/engine/src/main.ts +3 -0
  23. package/engine/src/permission-cmd.ts +56 -0
  24. package/engine/src/platform.ts +5 -0
  25. package/engine/src/preflight.ts +2 -2
  26. package/engine/src/runtime-loader.ts +2 -0
  27. package/engine/src/runtime.ts +5 -0
  28. package/engine/src/skills-render.ts +10 -6
  29. package/engine/src/state.ts +23 -1
  30. package/package.json +1 -1
  31. package/site-dist/404.html +2 -2
  32. package/site-dist/assets/{app.Df99UgrJ.js → app.DMAHANCl.js} +1 -1
  33. package/site-dist/assets/changelog.md.Q8QGpuBY.js +1 -0
  34. package/site-dist/assets/chunks/@localSearchIndexroot.CQdjFK3w.js +1 -0
  35. package/site-dist/assets/chunks/{VPLocalSearchBox.IEhP6Gw5.js → VPLocalSearchBox.COsLwqWS.js} +1 -1
  36. package/site-dist/assets/chunks/{theme.DHubfO7g.js → theme.CeR3HD86.js} +2 -2
  37. package/site-dist/assets/{guide_getting-started.md.BZTWiHhH.js → guide_getting-started.md.Bytaz3L8.js} +1 -1
  38. package/site-dist/assets/{guide_getting-started.md.BZTWiHhH.lean.js → guide_getting-started.md.Bytaz3L8.lean.js} +1 -1
  39. package/site-dist/assets/{reference_contracts_agent-runtime.md.Bu8q-uGl.js → reference_contracts_agent-runtime.md.TK7Lhwdf.js} +1 -1
  40. package/site-dist/changelog.html +5 -5
  41. package/site-dist/guide/dsh.html +4 -4
  42. package/site-dist/guide/getting-started.html +5 -5
  43. package/site-dist/guide/how-it-works.html +4 -4
  44. package/site-dist/guide/index.html +4 -4
  45. package/site-dist/guide/install.html +4 -4
  46. package/site-dist/guide/intranet.html +4 -4
  47. package/site-dist/guide/maintainer.html +4 -4
  48. package/site-dist/guide/phases.html +4 -4
  49. package/site-dist/guide/project.html +4 -4
  50. package/site-dist/guide/user.html +4 -4
  51. package/site-dist/hashmap.json +1 -1
  52. package/site-dist/index.html +4 -4
  53. package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +4 -4
  54. package/site-dist/reference/adr/0002-two-orchestration-modes.html +4 -4
  55. package/site-dist/reference/adr/0003-generate-once-then-lock.html +4 -4
  56. package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +4 -4
  57. package/site-dist/reference/adr/0005-skill-names.html +4 -4
  58. package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +4 -4
  59. package/site-dist/reference/adr/0007-one-install-many-repos.html +4 -4
  60. package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +4 -4
  61. package/site-dist/reference/adr/index.html +4 -4
  62. package/site-dist/reference/commands.html +4 -4
  63. package/site-dist/reference/config.html +4 -4
  64. package/site-dist/reference/contracts/agent-runtime.html +5 -5
  65. package/site-dist/reference/contracts/cli-json.html +4 -4
  66. package/site-dist/reference/contracts/feature-files.html +4 -4
  67. package/site-dist/reference/contracts/index.html +4 -4
  68. package/site-dist/reference/contracts/notifier-event.html +4 -4
  69. package/site-dist/reference/contracts/result-file.html +4 -4
  70. package/site-dist/reference/contracts/spec.html +4 -4
  71. package/site-dist/reference/contracts/state.html +4 -4
  72. package/site-dist/reference/contracts/usage-record.html +4 -4
  73. package/site-dist/reference/contracts/verify.html +4 -4
  74. package/site-dist/reference/design/adapter-guide.html +4 -4
  75. package/site-dist/reference/design/architecture.html +4 -4
  76. package/site-dist/reference/design/builtin-capabilities.html +4 -4
  77. package/site-dist/reference/design/platform-vocabulary.html +4 -4
  78. package/site-dist/reference/scope.html +4 -4
  79. package/skills/laoshi/SKILL.md +3 -0
  80. package/skills/laoshi-doctor/SKILL.md +2 -0
  81. package/skills/laoshi-retro/SKILL.md +2 -0
  82. package/skills/laoshi-setup/SKILL.md +3 -0
  83. package/site-dist/assets/changelog.md.Df8vFhjK.js +0 -1
  84. package/site-dist/assets/chunks/@localSearchIndexroot.n-0kN-N0.js +0 -1
  85. /package/site-dist/assets/{changelog.md.Df8vFhjK.lean.js → changelog.md.Q8QGpuBY.lean.js} +0 -0
  86. /package/site-dist/assets/{reference_contracts_agent-runtime.md.Bu8q-uGl.lean.js → reference_contracts_agent-runtime.md.TK7Lhwdf.lean.js} +0 -0
@@ -6,7 +6,7 @@
6
6
  // (PlatformAdapter.skillSetup), or laoshi's
7
7
  // A line whose word is null, or whose fragment the platform does not have, is left out.
8
8
  //
9
- // tsx engine/src/skills-render.ts --out <dir> [--config <install-level config>]
9
+ // tsx engine/src/skills-render.ts --out <dir> [--config <install-level config>] [--root <where the program will be>]
10
10
 
11
11
  import fs from "node:fs";
12
12
  import path from "node:path";
@@ -50,13 +50,16 @@ export function parseFragments(text: string): Record<string, string> {
50
50
  /** The skills' values for a configuration's platform (the install-level configuration's when not given). */
51
51
  export function skillValues(config?: unknown, root: string = KIT_ROOT): SkillValues {
52
52
  const adapter = config === undefined ? adapterForFile(defaultConfigPath()) : adapterFor(config);
53
- const file = adapter.skillSetup ?? (adapter.capabilities.services === "builtin" ? BUILTIN_SETUP : null);
53
+ // The platform's sections; on a platform that uses laoshi's builtin services, laoshi's sections for
54
+ // those, with the platform's own (e.g. how to install on first use) added.
55
+ const builtin = adapter.capabilities.services === "builtin" ? parseFragments(fs.readFileSync(BUILTIN_SETUP, "utf8")) : {};
56
+ const own = adapter.skillSetup ? parseFragments(fs.readFileSync(adapter.skillSetup, "utf8")) : {};
54
57
  return {
55
58
  root,
56
59
  launcher: path.join(root, path.relative(KIT_ROOT, LAUNCHER)),
57
60
  version: kitVersion(),
58
61
  words: wordsFor(config),
59
- fragments: file ? parseFragments(fs.readFileSync(file, "utf8")) : {},
62
+ fragments: { ...builtin, ...own },
60
63
  };
61
64
  }
62
65
 
@@ -93,12 +96,13 @@ export function renderSkills(out: string, v: SkillValues, from: string = SKILLS_
93
96
 
94
97
  const isMain = process.argv[1] && path.resolve(process.argv[1]).replace(/\.ts$/, "") === path.join(ENGINE_DIR, "src", "skills-render");
95
98
  if (isMain) {
96
- const { values } = parseArgs({ options: { out: { type: "string" }, config: { type: "string" } } });
99
+ const { values } = parseArgs({ options: { out: { type: "string" }, config: { type: "string" }, root: { type: "string" } } });
97
100
  if (!values.out) {
98
- console.error("用法:skills-render --out <目录> [--config <安装级配置>]");
101
+ console.error("用法:skills-render --out <目录> [--config <安装级配置>] [--root <程序将来所在的目录>]");
99
102
  process.exit(2);
100
103
  }
101
104
  const config = values.config ? JSON.parse(fs.readFileSync(path.resolve(values.config), "utf8")) : undefined;
102
- const written = renderSkills(path.resolve(values.out), skillValues(config));
105
+ // --root: skills for a program installed elsewhere later (e.g. a platform's workspace, laoshi M4).
106
+ const written = renderSkills(path.resolve(values.out), skillValues(config, values.root ? path.posix.normalize(values.root) : undefined));
103
107
  console.log(`已写入 ${written.length} 个文件到 ${path.resolve(values.out)}`);
104
108
  }
@@ -134,6 +134,8 @@ export interface PipelineState {
134
134
  */
135
135
  originSessionId: string | null;
136
136
  pid: number;
137
+ /** The machine the engine process runs on (laoshi: platforms that give each chat turn a new machine). */
138
+ host?: string;
137
139
  startedAt: string;
138
140
  updatedAt: string;
139
141
  /** Completed step results by step key. A resumed run reuses these instead of re-running the step. */
@@ -441,13 +443,33 @@ export function lockPath(repo: string): string {
441
443
  return path.join(os.tmpdir(), `requirement-pipeline-${id}.lock`);
442
444
  }
443
445
 
446
+ /**
447
+ * Whether the run's engine process is alive: its process on this machine. A run recorded on another
448
+ * machine (a platform that gives each chat turn a new one) is not, whatever process has its ID here.
449
+ */
450
+ export function engineAlive(state: { pid: number; host?: string }): boolean {
451
+ if (state.host && state.host !== os.hostname()) return false;
452
+ return isAlive(state.pid);
453
+ }
454
+
444
455
  export function isAlive(pid: number): boolean {
445
456
  try {
446
457
  process.kill(pid, 0);
447
- return true;
448
458
  } catch (error) {
449
459
  return (error as NodeJS.ErrnoException).code === "EPERM";
450
460
  }
461
+ return !isZombie(pid);
462
+ }
463
+
464
+ /** A process that has exited but was not reaped (its parent died first) still answers kill(pid, 0). */
465
+ export function isZombie(pid: number): boolean {
466
+ if (process.platform !== "linux") return false;
467
+ try {
468
+ const stat = fs.readFileSync(`/proc/${pid}/stat`, "utf8");
469
+ return stat.slice(stat.lastIndexOf(")") + 2).startsWith("Z");
470
+ } catch {
471
+ return false;
472
+ }
451
473
  }
452
474
 
453
475
  /** Returns the live holder of the repository lock, or null. Removes a stale lock. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yiyi_zhang/laoshi",
3
- "version": "0.1.1",
3
+ "version": "0.2.0-beta.1",
4
4
  "description": "laoshi:给测试、产品、项目经理用的需求开发体系。在 agent 平台(Paseo、DeepSeek Harness)的对话中对齐需求,由一组 AI agent 在后台完成设计、实现、评审和验证。",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  <link rel="preload stylesheet" href="/assets/style.BX2ZxxqY.css" as="style">
10
10
  <link rel="preload stylesheet" href="/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/assets/app.Df99UgrJ.js"></script>
12
+ <script type="module" src="/assets/app.DMAHANCl.js"></script>
13
13
  <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
14
  <link rel="icon" type="image/svg+xml" href="/favicon.svg">
15
15
  <meta name="theme-color" content="#a8e01f">
@@ -21,7 +21,7 @@
21
21
  </head>
22
22
  <body>
23
23
  <div id="app"></div>
24
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"changelog.md\":\"Df8vFhjK\",\"guide_dsh.md\":\"0X-eYB87\",\"guide_getting-started.md\":\"BZTWiHhH\",\"guide_how-it-works.md\":\"CkvlSgxO\",\"guide_index.md\":\"D67QX_Vi\",\"guide_install.md\":\"D7NiiOPu\",\"guide_intranet.md\":\"Bz0sAHK0\",\"guide_maintainer.md\":\"C-Vt-DdK\",\"guide_phases.md\":\"Cw0A9Vb1\",\"guide_project.md\":\"BIcaDhdS\",\"guide_user.md\":\"B66TQvIA\",\"index.md\":\"CrBM3tiI\",\"reference_adr_0001-new-repo-core-and-adapters.md\":\"CjNHHmrf\",\"reference_adr_0002-two-orchestration-modes.md\":\"CHD05agO\",\"reference_adr_0003-generate-once-then-lock.md\":\"BaRiZfXT\",\"reference_adr_0004-external-contracts-stay-stable.md\":\"DUJ7CTV1\",\"reference_adr_0005-skill-names.md\":\"DuBVd1tl\",\"reference_adr_0006-deterministic-engine-platform-capabilities.md\":\"Dcrnx1-L\",\"reference_adr_0007-one-install-many-repos.md\":\"C78cd4_P\",\"reference_adr_0008-capability-sources-and-platform-plugin.md\":\"B4vBkIDS\",\"reference_adr_index.md\":\"Dx8sPsjs\",\"reference_commands.md\":\"BFJRjNju\",\"reference_config.md\":\"Dt_TJ2y9\",\"reference_contracts_agent-runtime.md\":\"Bu8q-uGl\",\"reference_contracts_cli-json.md\":\"Bonk0m6-\",\"reference_contracts_feature-files.md\":\"9n332kF_\",\"reference_contracts_index.md\":\"dqNwNs6U\",\"reference_contracts_notifier-event.md\":\"D6we9wWS\",\"reference_contracts_result-file.md\":\"BmCaSlEu\",\"reference_contracts_spec.md\":\"CDQYgJz7\",\"reference_contracts_state.md\":\"DVHC4opX\",\"reference_contracts_usage-record.md\":\"CQI2chqh\",\"reference_contracts_verify.md\":\"CkJy8LXk\",\"reference_design_adapter-guide.md\":\"BSziZJSM\",\"reference_design_architecture.md\":\"Bfoc-F2B\",\"reference_design_builtin-capabilities.md\":\"CZYtjo_v\",\"reference_design_platform-vocabulary.md\":\"xWGv5QO8\",\"reference_scope.md\":\"aUo6vISB\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"laoshi\",\"titleTemplate\":\":title · laoshi\",\"description\":\"在 agent 平台(Paseo、DeepSeek Harness)中用对话对齐需求,由一组 AI agent 在后台完成设计、实现、评审和验证。给测试、产品、项目经理用的需求开发体系。\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"rk\":{\"version\":\"0.1.1\",\"beta\":false,\"releases\":2,\"stable\":2,\"adrs\":8},\"logo\":{\"light\":\"/logo-light.svg\",\"dark\":\"/logo.svg\",\"alt\":\"laoshi\"},\"siteTitle\":\"laoshi\",\"nav\":[{\"text\":\"指南\",\"link\":\"/guide/\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/commands\",\"activeMatch\":\"^/reference/\"},{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"v0.1.1\",\"items\":[{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"GitHub Releases\",\"link\":\"https://github.com/yiyisf/laoshi/releases\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]}],\"sidebar\":{\"/guide/\":[{\"text\":\"开始\",\"items\":[{\"text\":\"laoshi 是什么\",\"link\":\"/guide/\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"工作原理\",\"link\":\"/guide/how-it-works\"}]},{\"text\":\"使用\",\"items\":[{\"text\":\"使用者指南\",\"link\":\"/guide/user\"},{\"text\":\"分阶段执行与提测\",\"link\":\"/guide/phases\"}]},{\"text\":\"安装与维护\",\"items\":[{\"text\":\"安装与升级\",\"link\":\"/guide/install\"},{\"text\":\"在 DeepSeek Harness 上使用\",\"link\":\"/guide/dsh\"},{\"text\":\"内网安装与验证\",\"link\":\"/guide/intranet\"},{\"text\":\"项目定制与运行规则\",\"link\":\"/guide/project\"},{\"text\":\"维护者指南\",\"link\":\"/guide/maintainer\"}]}],\"/reference/\":[{\"text\":\"参考\",\"items\":[{\"text\":\"命令\",\"link\":\"/reference/commands\"},{\"text\":\"配置项\",\"link\":\"/reference/config\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]},{\"text\":\"文件格式约定\",\"collapsed\":false,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/contracts/\"},{\"text\":\"需求说明 spec.md\",\"link\":\"/reference/contracts/spec\"},{\"text\":\"状态文件 state.json\",\"link\":\"/reference/contracts/state\"},{\"text\":\"结果文件\",\"link\":\"/reference/contracts/result-file\"},{\"text\":\"功能目录中的文件\",\"link\":\"/reference/contracts/feature-files\"},{\"text\":\"验证方法 verify.md\",\"link\":\"/reference/contracts/verify\"},{\"text\":\"外部通知事件\",\"link\":\"/reference/contracts/notifier-event\"},{\"text\":\"laoshi api 的 JSON 输出\",\"link\":\"/reference/contracts/cli-json\"},{\"text\":\"agent 平台运行时\",\"link\":\"/reference/contracts/agent-runtime\"},{\"text\":\"需求索引与使用记录\",\"link\":\"/reference/contracts/usage-record\"}]},{\"text\":\"设计\",\"collapsed\":true,\"items\":[{\"text\":\"架构\",\"link\":\"/reference/design/architecture\"},{\"text\":\"平台用词\",\"link\":\"/reference/design/platform-vocabulary\"},{\"text\":\"内置能力\",\"link\":\"/reference/design/builtin-capabilities\"},{\"text\":\"编写平台适配器\",\"link\":\"/reference/design/adapter-guide\"}]},{\"text\":\"设计决定(ADR)\",\"collapsed\":true,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/adr/\"},{\"text\":\"0001 新建 laoshi 库:核心与平台适配器分开\",\"link\":\"/reference/adr/0001-new-repo-core-and-adapters\"},{\"text\":\"0002 两种编排模式:外部引擎与会话内编排\",\"link\":\"/reference/adr/0002-two-orchestration-modes\"},{\"text\":\"0003 适配器只在安装时生成一次并锁定\",\"link\":\"/reference/adr/0003-generate-once-then-lock\"},{\"text\":\"0004 对外契约在迁移中保持稳定\",\"link\":\"/reference/adr/0004-external-contracts-stay-stable\"},{\"text\":\"0005 入口 skill 命名\",\"link\":\"/reference/adr/0005-skill-names\"},{\"text\":\"0006 确定性引擎 + 平台能力层:先手写,后生成\",\"link\":\"/reference/adr/0006-deterministic-engine-platform-capabilities\"},{\"text\":\"0007 一次安装,多库共用;库内只放专属配置\",\"link\":\"/reference/adr/0007-one-install-many-repos\"},{\"text\":\"0008 能力按来源分层,平台插件作为适配器的一部分\",\"link\":\"/reference/adr/0008-capability-sources-and-platform-plugin\"}]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/yiyisf/laoshi\"}],\"editLink\":{\"pattern\":\"https://github.com/yiyisf/laoshi/edit/main/site/:path\",\"text\":\"在 GitHub 上编辑此页\"},\"footer\":{\"message\":\"以 MIT 许可发布。laoshi 可运行在 Paseo、DeepSeek Harness 等 agent 平台上。\",\"copyright\":\"Copyright © 2026 yiyisf\"},\"search\":{\"provider\":\"local\",\"options\":{\"translations\":{\"button\":{\"buttonText\":\"搜索文档\",\"buttonAriaLabel\":\"搜索文档\"},\"modal\":{\"noResultsText\":\"没有找到相关结果\",\"resetButtonTitle\":\"清除\",\"footer\":{\"selectText\":\"选择\",\"navigateText\":\"切换\",\"closeText\":\"关闭\"}}}}},\"outline\":{\"level\":[2,3],\"label\":\"本页内容\"},\"docFooter\":{\"prev\":\"上一页\",\"next\":\"下一页\"},\"lastUpdated\":{\"text\":\"最后更新\"},\"returnToTopLabel\":\"回到顶部\",\"sidebarMenuLabel\":\"目录\",\"darkModeSwitchLabel\":\"外观\",\"lightModeSwitchTitle\":\"切换到浅色\",\"darkModeSwitchTitle\":\"切换到深色\",\"externalLinkIcon\":true,\"notFound\":{\"title\":\"页面不存在\",\"quote\":\"这个页面可能已经移动或删除。\",\"linkText\":\"回到首页\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
24
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"changelog.md\":\"Q8QGpuBY\",\"guide_dsh.md\":\"0X-eYB87\",\"guide_getting-started.md\":\"Bytaz3L8\",\"guide_how-it-works.md\":\"CkvlSgxO\",\"guide_index.md\":\"D67QX_Vi\",\"guide_install.md\":\"D7NiiOPu\",\"guide_intranet.md\":\"Bz0sAHK0\",\"guide_maintainer.md\":\"C-Vt-DdK\",\"guide_phases.md\":\"Cw0A9Vb1\",\"guide_project.md\":\"BIcaDhdS\",\"guide_user.md\":\"B66TQvIA\",\"index.md\":\"CrBM3tiI\",\"reference_adr_0001-new-repo-core-and-adapters.md\":\"CjNHHmrf\",\"reference_adr_0002-two-orchestration-modes.md\":\"CHD05agO\",\"reference_adr_0003-generate-once-then-lock.md\":\"BaRiZfXT\",\"reference_adr_0004-external-contracts-stay-stable.md\":\"DUJ7CTV1\",\"reference_adr_0005-skill-names.md\":\"DuBVd1tl\",\"reference_adr_0006-deterministic-engine-platform-capabilities.md\":\"Dcrnx1-L\",\"reference_adr_0007-one-install-many-repos.md\":\"C78cd4_P\",\"reference_adr_0008-capability-sources-and-platform-plugin.md\":\"B4vBkIDS\",\"reference_adr_index.md\":\"Dx8sPsjs\",\"reference_commands.md\":\"BFJRjNju\",\"reference_config.md\":\"Dt_TJ2y9\",\"reference_contracts_agent-runtime.md\":\"TK7Lhwdf\",\"reference_contracts_cli-json.md\":\"Bonk0m6-\",\"reference_contracts_feature-files.md\":\"9n332kF_\",\"reference_contracts_index.md\":\"dqNwNs6U\",\"reference_contracts_notifier-event.md\":\"D6we9wWS\",\"reference_contracts_result-file.md\":\"BmCaSlEu\",\"reference_contracts_spec.md\":\"CDQYgJz7\",\"reference_contracts_state.md\":\"DVHC4opX\",\"reference_contracts_usage-record.md\":\"CQI2chqh\",\"reference_contracts_verify.md\":\"CkJy8LXk\",\"reference_design_adapter-guide.md\":\"BSziZJSM\",\"reference_design_architecture.md\":\"Bfoc-F2B\",\"reference_design_builtin-capabilities.md\":\"CZYtjo_v\",\"reference_design_platform-vocabulary.md\":\"xWGv5QO8\",\"reference_scope.md\":\"aUo6vISB\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"laoshi\",\"titleTemplate\":\":title · laoshi\",\"description\":\"在 agent 平台(Paseo、DeepSeek Harness)中用对话对齐需求,由一组 AI agent 在后台完成设计、实现、评审和验证。给测试、产品、项目经理用的需求开发体系。\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"rk\":{\"version\":\"0.2.0-beta.1\",\"beta\":true,\"releases\":3,\"stable\":2,\"adrs\":8},\"logo\":{\"light\":\"/logo-light.svg\",\"dark\":\"/logo.svg\",\"alt\":\"laoshi\"},\"siteTitle\":\"laoshi\",\"nav\":[{\"text\":\"指南\",\"link\":\"/guide/\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/commands\",\"activeMatch\":\"^/reference/\"},{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"v0.2.0-beta.1\",\"items\":[{\"text\":\"更新记录\",\"link\":\"/changelog\"},{\"text\":\"GitHub Releases\",\"link\":\"https://github.com/yiyisf/laoshi/releases\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]}],\"sidebar\":{\"/guide/\":[{\"text\":\"开始\",\"items\":[{\"text\":\"laoshi 是什么\",\"link\":\"/guide/\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"工作原理\",\"link\":\"/guide/how-it-works\"}]},{\"text\":\"使用\",\"items\":[{\"text\":\"使用者指南\",\"link\":\"/guide/user\"},{\"text\":\"分阶段执行与提测\",\"link\":\"/guide/phases\"}]},{\"text\":\"安装与维护\",\"items\":[{\"text\":\"安装与升级\",\"link\":\"/guide/install\"},{\"text\":\"在 DeepSeek Harness 上使用\",\"link\":\"/guide/dsh\"},{\"text\":\"内网安装与验证\",\"link\":\"/guide/intranet\"},{\"text\":\"项目定制与运行规则\",\"link\":\"/guide/project\"},{\"text\":\"维护者指南\",\"link\":\"/guide/maintainer\"}]}],\"/reference/\":[{\"text\":\"参考\",\"items\":[{\"text\":\"命令\",\"link\":\"/reference/commands\"},{\"text\":\"配置项\",\"link\":\"/reference/config\"},{\"text\":\"范围与取舍\",\"link\":\"/reference/scope\"}]},{\"text\":\"文件格式约定\",\"collapsed\":false,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/contracts/\"},{\"text\":\"需求说明 spec.md\",\"link\":\"/reference/contracts/spec\"},{\"text\":\"状态文件 state.json\",\"link\":\"/reference/contracts/state\"},{\"text\":\"结果文件\",\"link\":\"/reference/contracts/result-file\"},{\"text\":\"功能目录中的文件\",\"link\":\"/reference/contracts/feature-files\"},{\"text\":\"验证方法 verify.md\",\"link\":\"/reference/contracts/verify\"},{\"text\":\"外部通知事件\",\"link\":\"/reference/contracts/notifier-event\"},{\"text\":\"laoshi api 的 JSON 输出\",\"link\":\"/reference/contracts/cli-json\"},{\"text\":\"agent 平台运行时\",\"link\":\"/reference/contracts/agent-runtime\"},{\"text\":\"需求索引与使用记录\",\"link\":\"/reference/contracts/usage-record\"}]},{\"text\":\"设计\",\"collapsed\":true,\"items\":[{\"text\":\"架构\",\"link\":\"/reference/design/architecture\"},{\"text\":\"平台用词\",\"link\":\"/reference/design/platform-vocabulary\"},{\"text\":\"内置能力\",\"link\":\"/reference/design/builtin-capabilities\"},{\"text\":\"编写平台适配器\",\"link\":\"/reference/design/adapter-guide\"}]},{\"text\":\"设计决定(ADR)\",\"collapsed\":true,\"items\":[{\"text\":\"总览\",\"link\":\"/reference/adr/\"},{\"text\":\"0001 新建 laoshi 库:核心与平台适配器分开\",\"link\":\"/reference/adr/0001-new-repo-core-and-adapters\"},{\"text\":\"0002 两种编排模式:外部引擎与会话内编排\",\"link\":\"/reference/adr/0002-two-orchestration-modes\"},{\"text\":\"0003 适配器只在安装时生成一次并锁定\",\"link\":\"/reference/adr/0003-generate-once-then-lock\"},{\"text\":\"0004 对外契约在迁移中保持稳定\",\"link\":\"/reference/adr/0004-external-contracts-stay-stable\"},{\"text\":\"0005 入口 skill 命名\",\"link\":\"/reference/adr/0005-skill-names\"},{\"text\":\"0006 确定性引擎 + 平台能力层:先手写,后生成\",\"link\":\"/reference/adr/0006-deterministic-engine-platform-capabilities\"},{\"text\":\"0007 一次安装,多库共用;库内只放专属配置\",\"link\":\"/reference/adr/0007-one-install-many-repos\"},{\"text\":\"0008 能力按来源分层,平台插件作为适配器的一部分\",\"link\":\"/reference/adr/0008-capability-sources-and-platform-plugin\"}]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/yiyisf/laoshi\"}],\"editLink\":{\"pattern\":\"https://github.com/yiyisf/laoshi/edit/main/site/:path\",\"text\":\"在 GitHub 上编辑此页\"},\"footer\":{\"message\":\"以 MIT 许可发布。laoshi 可运行在 Paseo、DeepSeek Harness 等 agent 平台上。\",\"copyright\":\"Copyright © 2026 yiyisf\"},\"search\":{\"provider\":\"local\",\"options\":{\"translations\":{\"button\":{\"buttonText\":\"搜索文档\",\"buttonAriaLabel\":\"搜索文档\"},\"modal\":{\"noResultsText\":\"没有找到相关结果\",\"resetButtonTitle\":\"清除\",\"footer\":{\"selectText\":\"选择\",\"navigateText\":\"切换\",\"closeText\":\"关闭\"}}}}},\"outline\":{\"level\":[2,3],\"label\":\"本页内容\"},\"docFooter\":{\"prev\":\"上一页\",\"next\":\"下一页\"},\"lastUpdated\":{\"text\":\"最后更新\"},\"returnToTopLabel\":\"回到顶部\",\"sidebarMenuLabel\":\"目录\",\"darkModeSwitchLabel\":\"外观\",\"lightModeSwitchTitle\":\"切换到浅色\",\"darkModeSwitchTitle\":\"切换到深色\",\"externalLinkIcon\":true,\"notFound\":{\"title\":\"页面不存在\",\"quote\":\"这个页面可能已经移动或删除。\",\"linkText\":\"回到首页\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
25
25
 
26
26
  </body>
27
27
  </html>
@@ -1 +1 @@
1
- import{R as p}from"./chunks/theme.DHubfO7g.js";import{R as s,a4 as i,a5 as u,a6 as c,a7 as l,a8 as f,a9 as d,aa as m,ab as h,ac as g,ad as A,d as v,u as R,v as w,s as y,ae as C,af as P,ag as b,a3 as E}from"./chunks/framework.BetZR81g.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
1
+ import{R as p}from"./chunks/theme.CeR3HD86.js";import{R as s,a4 as i,a5 as u,a6 as c,a7 as l,a8 as f,a9 as d,aa as m,ab as h,ac as g,ad as A,d as v,u as R,v as w,s as y,ae as C,af as P,ag as b,a3 as E}from"./chunks/framework.BetZR81g.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
@@ -0,0 +1 @@
1
+ import{_ as o,o as a,c as i,a2 as t}from"./chunks/framework.BetZR81g.js";const g=JSON.parse('{"title":"更新记录","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"changelog.md","filePath":"changelog.md","lastUpdated":null}'),l={name:"changelog.md"};function s(d,e,c,r,n,h){return a(),i("div",null,[...e[0]||(e[0]=[t('<div><h1 id="更新记录" tabindex="-1">更新记录 <a class="header-anchor" href="#更新记录" aria-label="Permalink to &quot;更新记录&quot;">​</a></h1><p>laoshi 的版本号遵循语义化版本,从 0.1.0 开始;每一版的标题写成 <code>## &lt;版本&gt; - &lt;日期&gt;</code>。每一版先写使用者会看到的变化,再写升级须知。laoshi 之前的历史见 paseo-req-kit 的更新记录(laoshi 从它的 1.15.0 抽出)。</p><h2 id="_0-2-0-beta-1-2026-11-07" tabindex="-1">0.2.0-beta.1 - 2026-11-07 <a class="header-anchor" href="#_0-2-0-beta-1-2026-11-07" aria-label="Permalink to &quot;0.2.0-beta.1 - 2026-11-07&quot;">​</a></h2><p>预发布版(npm 的 <code>beta</code> 标签,<code>latest</code> 仍是 0.1.1):支持摸高,用来在摸高沙箱里验证专家。安装:<code>npx -y @yiyi_zhang/laoshi@beta install --platform &lt;平台&gt;</code>。</p><h3 id="使用者会看到的变化" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>支持摸高</strong>(<code>laoshi install --platform mogao</code>):每一步是摸高的一个独立 agent(<code>aimax run</code>),审批用摸高的人工审批,工具调用和用量来自摸高的进度回调。引擎在对话的命令里运行,进展显示在命令输出里;对话轮次结束打断的运行,下一轮用继续命令接着做。</li><li><strong>摸高专家</strong>:<code>node adapters/mogao/make-expert.mjs</code> 生成提交给摸高的专家(按摸高渲染的 skill 和介绍);入口 skill 第一次使用时把 laoshi 装到工作区,并说明在摸高上命令会一直运行到停下、等待批准怎么回答、工具装在工作区。</li><li><strong>安装根</strong>:没有 <code>LAOSHI_HOME</code> 时,程序装在 <code>&lt;安装根&gt;/npm</code> 下就用这个安装根(每个对话轮次换机器的平台上不能依赖 <code>~</code>)。</li><li><strong><code>laoshi permission &lt;需求&gt; approve|deny [理由]</code></strong>:在对话里批准或拒绝步骤等待批准的操作,并接着运行(摸高上用)。</li><li><strong>危险命令拦截</strong>:读出凭据环境变量(如 <code>echo $XXX_TOKEN</code>、<code>printenv</code>)算作危险操作。</li></ul><h2 id="_0-1-1-2026-11-05" tabindex="-1">0.1.1 - 2026-11-05 <a class="header-anchor" href="#_0-1-1-2026-11-05" aria-label="Permalink to &quot;0.1.1 - 2026-11-05&quot;">​</a></h2><p>在 npm 上的包名改为 <strong><code>@yiyi_zhang/laoshi</code></strong>:<code>laoshi</code> 这个名字在 npm 上不能使用,0.1.0 只发布到了 GitHub Release,没有发布到 npm。其余内容与 0.1.0 相同。</p><h3 id="升级须知" tabindex="-1">升级须知 <a class="header-anchor" href="#升级须知" aria-label="Permalink to &quot;升级须知&quot;">​</a></h3><ul><li>安装命令:<code>npx -y @yiyi_zhang/laoshi@latest install --platform dsh|paseo</code>(内网加 <code>--registry=&lt;镜像地址&gt;</code>)。装好后的命令仍是 <code>laoshi</code>(别名 <code>req</code>),skill 仍是 <code>/laoshi</code> 等。</li><li>公司的 npm 镜像需要能同步 <code>@yiyi_zhang</code> 作用域下的包。</li><li>用 GitHub Release 上 0.1.0 的 <code>.tgz</code> 或离线包装过的机器,运行一次上面的安装命令即可换成 npm 上的版本。</li></ul><h2 id="_0-1-0-2026-11-05" tabindex="-1">0.1.0 - 2026-11-05 <a class="header-anchor" href="#_0-1-0-2026-11-05" aria-label="Permalink to &quot;0.1.0 - 2026-11-05&quot;">​</a></h2><p>第一个正式版:paseo-req-kit 的需求开发体系,抽成不绑定平台的工具包,支持 Paseo 和 DeepSeek Harness。</p><h3 id="使用者会看到的变化-1" tabindex="-1">使用者会看到的变化 <a class="header-anchor" href="#使用者会看到的变化-1" aria-label="Permalink to &quot;使用者会看到的变化&quot;">​</a></h3><ul><li><strong>新的名字和命令</strong>:对话中的入口是 <code>/laoshi</code>、<code>/laoshi-setup</code>、<code>/laoshi-doctor</code>、<code>/laoshi-retro</code>;终端命令是 <code>laoshi</code>(<code>req</code> 是它的别名)。</li><li><strong>支持 DeepSeek Harness(dsh)</strong>:步骤 agent 作为子会话挂在发起的对话下,进展和结果发回对话;各角色可以各用一个 dsh 中的模型(<code>&lt;提供方&gt;/&lt;模型&gt;</code>,<code>dsh/chat-model</code> 用对话的模型);<code>laoshi doctor</code> 列出可用的模型并逐个角色检查。</li><li><strong>内置工作区和服务</strong>:平台不提供时,laoshi 用 <code>git worktree</code> 为需求新建工作区,并按 <code>.laoshi/services.json</code> 启动、检查、停止项目的服务(每个工作区独立端口)。</li><li><strong>一步安装</strong>:<code>npx -y @yiyi_zhang/laoshi@latest install --platform dsh|paseo</code>;公司内网加 <code>--registry=&lt;镜像地址&gt;</code>;<code>laoshi upgrade</code> 升级或回退;<code>laoshi install --check</code>、<code>--uninstall</code>。Windows 上只用 cmd 和 Git Bash。</li><li><strong>离线安装包</strong>:完全没有 npm 源的机器,用 GitHub Release 上带 Windows 依赖的离线安装包,步骤见&quot;内网安装与验证&quot;。</li><li><strong>文档站点</strong>:<a href="https://yiyisf.github.io/laoshi/" target="_blank" rel="noreferrer">https://yiyisf.github.io/laoshi/</a> ;<code>laoshi docs</code> 在本机打开和装的版本一致的文档(不需要外网)。</li><li><strong>体检</strong>:<code>laoshi doctor</code> 的&quot;安装&quot;一节检查 skill 是否已是这个版本的,并从 npm 源查询有没有新版本。</li><li><strong>使用记录带上代码库和使用者</strong>:使用记录、通知事件和 <code>laoshi api list</code> 中增加了代码库(目录、远程地址)和使用者(<code>LAOSHI_USER</code> 或安装级配置的 <code>user</code>)。</li></ul><h3 id="升级须知-从-paseo-req-kit" tabindex="-1">升级须知(从 paseo-req-kit) <a class="header-anchor" href="#升级须知-从-paseo-req-kit" aria-label="Permalink to &quot;升级须知(从 paseo-req-kit)&quot;">​</a></h3><ul><li>laoshi 和 paseo-req-kit 可以装在同一台机器上,互不覆盖:安装根是 <code>~/.laoshi</code>(只有 <code>~/.req-kit</code> 时读取它),项目配置是 <code>.laoshi.json</code>(<code>.requirement-pipeline.json</code> 继续被读取)。</li><li>状态文件升到第 2 版:第一次读到旧的状态文件时自动迁移,原文件留作 <code>.bak-v1</code>;正在运行的流水线只在内存中迁移。</li><li>配置中的 <code>paseoProfile</code>、<code>paseoServices</code> 改名为 <code>platformProfile</code>、<code>platformServices</code>,旧名继续有效。</li><li>Paseo 的需求插件暂时仍由 paseo-req-kit 提供,计划在 0.1.0 之后迁入。</li></ul></div><p class="source-note">本页由仓库中的 <a href="https://github.com/yiyisf/laoshi/blob/main/CHANGELOG.md">CHANGELOG.md</a> 生成。<a href="https://github.com/yiyisf/laoshi/edit/main/CHANGELOG.md">在 GitHub 上编辑</a></p>',2)])])}const u=o(l,[["render",s]]);export{g as __pageData,u as default};