peaks-loop 4.0.0-beta.12 → 4.0.0-beta.15

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 (212) hide show
  1. package/CHANGELOG.md +282 -147
  2. package/README-en.md +1 -1
  3. package/README.md +32 -1
  4. package/bin/peaks.js +0 -0
  5. package/dist/cli/cli-helpers.d.ts +1 -1
  6. package/dist/cli/cli-helpers.js +1 -1
  7. package/dist/cli/commands/adapter-commands-s2a.js +1 -1
  8. package/dist/cli/commands/asset-commands.js +33 -16
  9. package/dist/cli/commands/audit-commands.js +1 -1
  10. package/dist/cli/commands/bee-commands.js +1 -1
  11. package/dist/cli/commands/capability-commands.js +1 -1
  12. package/dist/cli/commands/classify-classify-commands.js +1 -1
  13. package/dist/cli/commands/code-commands.js +1 -1
  14. package/dist/cli/commands/code-review-commands.js +1 -1
  15. package/dist/cli/commands/codegraph-commands.js +1 -1
  16. package/dist/cli/commands/compact-command.js +1 -1
  17. package/dist/cli/commands/complexity-commands.js +1 -1
  18. package/dist/cli/commands/config-commands.js +1 -1
  19. package/dist/cli/commands/context-commands.js +1 -1
  20. package/dist/cli/commands/contract-commands.js +1 -1
  21. package/dist/cli/commands/core/artifacts-command.js +1 -1
  22. package/dist/cli/commands/core/binding-commands.js +1 -1
  23. package/dist/cli/commands/core/doctor-command.js +63 -3
  24. package/dist/cli/commands/core/memory-command.js +1 -1
  25. package/dist/cli/commands/core/profile-command.js +1 -1
  26. package/dist/cli/commands/core/proxy-command.js +1 -1
  27. package/dist/cli/commands/core/session-command.js +1 -1
  28. package/dist/cli/commands/core/skill-command.js +2 -2
  29. package/dist/cli/commands/core/standards-command.js +1 -1
  30. package/dist/cli/commands/dispatch-commands.js +2 -2
  31. package/dist/cli/commands/dispatch-from-dag.js +1 -1
  32. package/dist/cli/commands/doc-commands.js +1 -1
  33. package/dist/cli/commands/ecc-commands.js +2 -2
  34. package/dist/cli/commands/evolution-commands.js +1 -1
  35. package/dist/cli/commands/feedback-commands.js +1 -1
  36. package/dist/cli/commands/final-review-commands.js +1 -1
  37. package/dist/cli/commands/fixture-commands.js +1 -1
  38. package/dist/cli/commands/fork-commands.js +1 -1
  39. package/dist/cli/commands/gate-commands.js +1 -1
  40. package/dist/cli/commands/heartbeat-commands.js +1 -1
  41. package/dist/cli/commands/hook-handle.js +1 -1
  42. package/dist/cli/commands/hooks-commands.js +1 -1
  43. package/dist/cli/commands/ide-commands.js +1 -1
  44. package/dist/cli/commands/impact-commands.js +1 -1
  45. package/dist/cli/commands/job-commands.js +1 -1
  46. package/dist/cli/commands/legacy-commands.js +1 -1
  47. package/dist/cli/commands/log-commands.js +1 -1
  48. package/dist/cli/commands/loop-commands.js +1 -1
  49. package/dist/cli/commands/loop-eval-commands.js +1 -1
  50. package/dist/cli/commands/memory-commands.js +1 -1
  51. package/dist/cli/commands/migrate-1-4-1-command.js +1 -1
  52. package/dist/cli/commands/migrate-v2-10-to-v2-11-command.js +1 -1
  53. package/dist/cli/commands/mut-commands.d.ts +1 -1
  54. package/dist/cli/commands/mut-commands.js +1 -5
  55. package/dist/cli/commands/observability-commands.js +1 -1
  56. package/dist/cli/commands/openspec-commands.js +2 -2
  57. package/dist/cli/commands/perf-audit-commands.js +2 -2
  58. package/dist/cli/commands/perf-commands.js +1 -1
  59. package/dist/cli/commands/polyrepo-commands.js +1 -1
  60. package/dist/cli/commands/prd-blocks-commands.js +1 -1
  61. package/dist/cli/commands/prd-commands.js +1 -1
  62. package/dist/cli/commands/project-commands.js +1 -1
  63. package/dist/cli/commands/qa-business-review-commands.js +1 -1
  64. package/dist/cli/commands/qa-commands.d.ts +1 -1
  65. package/dist/cli/commands/qa-commands.js +2 -2
  66. package/dist/cli/commands/release-commands.js +1 -1
  67. package/dist/cli/commands/request-commands.js +1 -1
  68. package/dist/cli/commands/retrospective-commands.js +1 -1
  69. package/dist/cli/commands/reviewer-commands.js +1 -1
  70. package/dist/cli/commands/role-commands.js +1 -1
  71. package/dist/cli/commands/runtime-commands.js +1 -2
  72. package/dist/cli/commands/sc-commands.js +1 -1
  73. package/dist/cli/commands/scan-commands.js +1 -1
  74. package/dist/cli/commands/security-audit-commands.js +2 -2
  75. package/dist/cli/commands/sediment-commands.js +10 -1
  76. package/dist/cli/commands/share-commands.d.ts +19 -0
  77. package/dist/cli/commands/share-commands.js +121 -2
  78. package/dist/cli/commands/skill-conformance-commands.js +1 -1
  79. package/dist/cli/commands/skill-loop-engineering-readiness-commands.js +1 -1
  80. package/dist/cli/commands/skill-search-commands.js +1 -1
  81. package/dist/cli/commands/slice-commands.js +1 -1
  82. package/dist/cli/commands/slice-integrate-commands.js +1 -1
  83. package/dist/cli/commands/slice-review-commands.js +1 -1
  84. package/dist/cli/commands/smoke-commands.js +1 -1
  85. package/dist/cli/commands/sop-commands.js +1 -1
  86. package/dist/cli/commands/statusline-commands.js +1 -1
  87. package/dist/cli/commands/sub-agent-commands.js +2 -1
  88. package/dist/cli/commands/understand-commands.js +1 -1
  89. package/dist/cli/commands/upgrade-commands.js +1 -1
  90. package/dist/cli/commands/user-touchpoint-commands.js +1 -1
  91. package/dist/cli/commands/verdict-aggregate-command.js +1 -1
  92. package/dist/cli/commands/workflow-commands.js +1 -1
  93. package/dist/cli/commands/workflow-plan-commands.js +1 -1
  94. package/dist/cli/commands/workspace/init-command.js +1 -1
  95. package/dist/cli/commands/workspace/migrate-command.js +1 -1
  96. package/dist/cli/commands/workspace/reconcile-command.js +1 -1
  97. package/dist/cli/index.js +1 -1
  98. package/dist/cli/program.js +2 -2
  99. package/dist/services/artifacts/artifact-prerequisites.js +1 -1
  100. package/dist/services/artifacts/request-artifact-service.js +1 -1
  101. package/dist/services/artifacts/workspace-service.js +1 -1
  102. package/dist/services/code/auto-compact-orchestrator.js +5 -2
  103. package/dist/services/code-review/ocr-service.d.ts +1 -1
  104. package/dist/services/code-review/ocr-service.js +6 -3
  105. package/dist/services/config/config-types.js +1 -1
  106. package/dist/services/dashboard/project-dashboard-service.js +2 -2
  107. package/dist/services/dispatch/batch-counter.js +1 -1
  108. package/dist/services/dispatch/dispatch-record-writer.js +1 -1
  109. package/dist/services/job/job-progress-store.d.ts +2 -2
  110. package/dist/services/job/job-types.d.ts +27 -27
  111. package/dist/services/log/retention.js +1 -1
  112. package/dist/services/openspec/openspec-archive-service.js +1 -1
  113. package/dist/services/openspec/openspec-bridge-service.js +1 -1
  114. package/dist/services/openspec/openspec-init-service.js +1 -1
  115. package/dist/services/openspec/openspec-propose-from-doctor-service.js +1 -1
  116. package/dist/services/openspec/openspec-render-service.js +1 -1
  117. package/dist/services/openspec/openspec-scan-service.js +1 -1
  118. package/dist/services/openspec/openspec-validate-service.js +1 -1
  119. package/dist/services/scan/acceptance-coverage-service.js +1 -1
  120. package/dist/services/scan/archetype-service.js +1 -1
  121. package/dist/services/scan/existing-system-service.js +1 -1
  122. package/dist/services/scan/libraries-service.js +1 -1
  123. package/dist/services/skill/skill-search-service.d.ts +5 -5
  124. package/dist/services/skill/skill-search-service.js +2 -2
  125. package/dist/services/skillhub/migrations/001-initial.sql +71 -0
  126. package/dist/services/skillhub/migrations/002-loop-release.sql +32 -0
  127. package/dist/services/skillhub/migrations/003-loop-bee-relation.sql +35 -0
  128. package/dist/services/skillhub/migrations/004-loop-bee-extension.sql +65 -0
  129. package/dist/services/skillhub/migrations/005-evolution-evaluation.sql +81 -0
  130. package/dist/services/skillhub/migrations/006-crystallization-event.sql +92 -0
  131. package/dist/services/skills/skill-registry.js +2 -2
  132. package/dist/services/skills/skill-runbook-service.js +1 -1
  133. package/dist/services/slice/slice-check-service.js +1 -1
  134. package/dist/services/understand/understand-hybrid-service.js +1 -1
  135. package/dist/services/understand/understand-scan-service.js +2 -2
  136. package/dist/services/upgrade/upgrade-service.js +4 -3
  137. package/dist/services/verdict/envelopes.d.ts +2 -2
  138. package/dist/services/verdict/envelopes.js +2 -2
  139. package/dist/services/verdict/verdict-aggregator.d.ts +3 -3
  140. package/dist/services/workflow/autonomous-resume-writer.js +1 -1
  141. package/dist/services/workflow/plan-reader.d.ts +1 -1
  142. package/dist/services/workflow/plan-reader.js +1 -1
  143. package/dist/services/workflow/plan-refresher.d.ts +1 -1
  144. package/dist/services/workflow/plan-refresher.js +1 -1
  145. package/dist/services/workflow/plan-trigger-detector.d.ts +1 -1
  146. package/dist/services/workflow/plan-trigger-detector.js +1 -1
  147. package/dist/services/workflow/workflow-router-service.js +11 -9
  148. package/dist/services/workspace/migrate-service.js +1 -1
  149. package/dist/services/workspace/workspace-service.js +1 -1
  150. package/package.json +14 -8
  151. package/scripts/copy-templates.mjs +16 -0
  152. package/scripts/sync-version.mjs +8 -1
  153. package/skills/bee/peaks-rd/SKILL.md +14 -1
  154. package/skills/peaks-code/SKILL.md +44 -0
  155. package/skills/peaks-code/references/sub-agent-dispatch.md +30 -0
  156. package/dist/services/agent/ecc-cache-service.d.ts +0 -97
  157. package/dist/services/agent/ecc-cache-service.js +0 -491
  158. package/dist/services/audit-independent/perf-audit-service.d.ts +0 -151
  159. package/dist/services/audit-independent/perf-audit-service.js +0 -316
  160. package/dist/services/audit-independent/security-audit-service.d.ts +0 -155
  161. package/dist/services/audit-independent/security-audit-service.js +0 -316
  162. package/dist/services/context/dispatch-context-guard.d.ts +0 -27
  163. package/dist/services/context/dispatch-context-guard.js +0 -192
  164. package/dist/services/context/shared-channel.d.ts +0 -93
  165. package/dist/services/context/shared-channel.js +0 -308
  166. package/dist/services/crystallization/crystallization-service.d.ts +0 -239
  167. package/dist/services/crystallization/crystallization-service.js +0 -397
  168. package/dist/services/crystallization/crystallization-store.d.ts +0 -75
  169. package/dist/services/crystallization/crystallization-store.js +0 -193
  170. package/dist/services/crystallization/crystallization-types.d.ts +0 -313
  171. package/dist/services/crystallization/crystallization-types.js +0 -299
  172. package/dist/services/crystallization/evidence-brief-builder.d.ts +0 -237
  173. package/dist/services/crystallization/evidence-brief-builder.js +0 -240
  174. package/dist/services/doctor/doctor-service.d.ts +0 -149
  175. package/dist/services/doctor/doctor-service.js +0 -929
  176. package/dist/services/filesystem/file-lock.d.ts +0 -11
  177. package/dist/services/filesystem/file-lock.js +0 -152
  178. package/dist/services/final-review/final-review-service.d.ts +0 -12
  179. package/dist/services/final-review/final-review-service.js +0 -52
  180. package/dist/services/final-review/final-review-types.d.ts +0 -42
  181. package/dist/services/final-review/final-review-types.js +0 -18
  182. package/dist/services/job/job-resource-snapshot.d.ts +0 -7
  183. package/dist/services/job/job-resource-snapshot.js +0 -75
  184. package/dist/services/mut/assert-scanner.d.ts +0 -6
  185. package/dist/services/mut/assert-scanner.js +0 -116
  186. package/dist/services/mut/index.d.ts +0 -8
  187. package/dist/services/mut/index.js +0 -7
  188. package/dist/services/mut/mut-runner.d.ts +0 -39
  189. package/dist/services/mut/mut-runner.js +0 -29
  190. package/dist/services/mut/production-stryker.d.ts +0 -2
  191. package/dist/services/mut/production-stryker.js +0 -75
  192. package/dist/services/mut/report-builder.d.ts +0 -11
  193. package/dist/services/mut/report-builder.js +0 -110
  194. package/dist/services/mut/report-loader.d.ts +0 -31
  195. package/dist/services/mut/report-loader.js +0 -78
  196. package/dist/services/mut/thresholds.d.ts +0 -21
  197. package/dist/services/mut/thresholds.js +0 -22
  198. package/dist/services/mut/types.d.ts +0 -336
  199. package/dist/services/mut/types.js +0 -59
  200. package/dist/shared/fs.d.ts +0 -4
  201. package/dist/shared/fs.js +0 -26
  202. package/dist/shared/paths.d.ts +0 -6
  203. package/dist/shared/paths.js +0 -50
  204. package/dist/shared/result.d.ts +0 -22
  205. package/dist/shared/result.js +0 -46
  206. package/dist/shared/version.d.ts +0 -1
  207. package/dist/shared/version.js +0 -1
  208. package/examples/video-demo/README.md +0 -142
  209. package/examples/video-demo/out/en-closing-960.png +0 -0
  210. package/examples/video-demo/out/zh-closing-960.png +0 -0
  211. package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
  212. package/examples/video-demo/preview/peaks-loop-demo.mp4 +0 -0
@@ -6,7 +6,7 @@ import { advanceSop, SopAdvanceError, SopGateBlockedError, SopPhaseSkipError } f
6
6
  import { sopStateDir } from '../../services/sop/sop-paths.js';
7
7
  import { getSkillPresence } from '../../services/skills/skill-presence-service.js';
8
8
  import { recordBypass, isBypassLimitReached, MAX_BYPASSES_PER_SESSION } from '../../services/mode/bypass-tracker.js';
9
- import { fail, ok } from '../../shared/result.js';
9
+ import { fail, ok } from 'peaks-loop-shared/result';
10
10
  import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
11
11
  export function registerSopCommands(program, io) {
12
12
  const sop = program.command('sop').description('Author and validate user-defined SOP skills');
@@ -1,4 +1,4 @@
1
- import { fail, ok } from '../../shared/result.js';
1
+ import { fail, ok } from 'peaks-loop-shared/result';
2
2
  import { addJsonOption, printResult, getErrorMessage } from '../cli-helpers.js';
3
3
  import { findProjectRoot } from '../../services/config/config-safety.js';
4
4
  import { buildStatusLineModel, parseStatusLineStdin } from '../../services/skills/skill-statusline-service.js';
@@ -1,6 +1,6 @@
1
1
  import { registerDispatchCommand } from './dispatch-commands.js';
2
2
  import { registerHeartbeatCommand } from './heartbeat-commands.js';
3
- import { registerShareCommand, registerSharedReadCommand, registerAwaitCommand } from './share-commands.js';
3
+ import { registerShareCommand, registerSharedReadCommand, registerAwaitCommand, registerFinalizeCommand } from './share-commands.js';
4
4
  // Re-export `validateRole` for backward compat — the integration test
5
5
  // suite and any external callers still import it from this entry file.
6
6
  // The canonical implementation now lives in `sub-agent-shared.ts`.
@@ -16,4 +16,5 @@ export function registerSubAgentCommands(program, io) {
16
16
  registerShareCommand(subAgent, io);
17
17
  registerSharedReadCommand(subAgent, io);
18
18
  registerAwaitCommand(subAgent, io);
19
+ registerFinalizeCommand(subAgent, io); // D21
19
20
  }
@@ -1,7 +1,7 @@
1
1
  import { InvalidArgumentError } from 'commander';
2
2
  import { scanUnderstandAnything, summarizeKnowledgeGraph } from '../../services/understand/understand-scan-service.js';
3
3
  import { buildUnderstandContext } from '../../services/understand/understand-hybrid-service.js';
4
- import { fail, ok } from '../../shared/result.js';
4
+ import { fail, ok } from 'peaks-loop-shared/result';
5
5
  import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
6
6
  function parsePositiveInteger(value) {
7
7
  if (!/^\d+$/.test(value)) {
@@ -4,7 +4,7 @@ import { initWorkspace } from '../../services/workspace/workspace-service.js';
4
4
  import { ensureSessionWithRotation } from '../../services/session/session-manager.js';
5
5
  import { resolveCanonicalProjectRoot } from '../../services/config/config-service.js';
6
6
  import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
7
- import { fail, ok } from '../../shared/result.js';
7
+ import { fail, ok } from 'peaks-loop-shared/result';
8
8
  export function registerUpgradeCommands(program, io) {
9
9
  addJsonOption(program
10
10
  .command('upgrade', { hidden: true })
@@ -14,7 +14,7 @@
14
14
  * "user 在循环里 = 业务/产品审阅者,不参与技术决策"
15
15
  */
16
16
  import { aiAutoDecidesGates, classifyGate, COMMIT_BOUNDARY_ACTIONS_LIST, userMustReviewGates } from '../../services/code/user-touchpoint-classifier.js';
17
- import { fail, ok } from '../../shared/result.js';
17
+ import { fail, ok } from 'peaks-loop-shared/result';
18
18
  import { addJsonOption, printResult } from '../cli-helpers.js';
19
19
  export function registerUserTouchpointCommands(program, io) {
20
20
  // G4 commands are registered as TOP-LEVEL commands (not sub-commands
@@ -3,7 +3,7 @@ import { join } from 'node:path';
3
3
  import { aggregateVerdict } from '../../services/verdict/verdict-aggregator.js';
4
4
  import { parseKarpathyEnvelope, parseMutEnvelope, parseQaEnvelope, parseSecurityEnvelope, parsePerfEnvelope, envelopesToAggregatorInput } from '../../services/verdict/envelopes.js';
5
5
  import { addJsonOption, printResult } from '../cli-helpers.js';
6
- import { fail, ok } from '../../shared/result.js';
6
+ import { fail, ok } from 'peaks-loop-shared/result';
7
7
  const SECURITY_REL = 'audit/security.md';
8
8
  const PERF_REL = 'audit/perf.md';
9
9
  const KARPATHY_REL = 'rd/karpathy-review.md';
@@ -13,7 +13,7 @@ import { getSessionDir } from '../../services/session/getSessionDir.js';
13
13
  import { findProjectRoot } from '../../services/config/config-safety.js';
14
14
  import { verifyPipeline } from '../../services/workflow/pipeline-verify-service.js';
15
15
  import { applySkip, detectCallerKind } from '../../services/workflow/workflow-skip-service.js';
16
- import { fail, ok } from '../../shared/result.js';
16
+ import { fail, ok } from 'peaks-loop-shared/result';
17
17
  import { addJsonOption, failUnsupportedNonDryRun, getErrorMessage, isRecommendationWorkflow, printResult } from '../cli-helpers.js';
18
18
  // Slice 015 — typed error → envelope code routing. Used by the four
19
19
  // catch sites below (tech.plan / workflow.route / workflow.autonomous /
@@ -1,4 +1,4 @@
1
- import { fail, getErrorMessage } from '../../shared/result.js';
1
+ import { fail, getErrorMessage } from 'peaks-loop-shared/result';
2
2
  import { addJsonOption, printResult } from '../cli-helpers.js';
3
3
  import { readPlan } from '../../services/workflow/plan-reader.js';
4
4
  import { refreshPlan } from '../../services/workflow/plan-refresher.js';
@@ -25,7 +25,7 @@ import { ensureSessionWithRotation } from '../../../services/session/session-man
25
25
  import { resolveCanonicalProjectRoot } from '../../../services/config/config-service.js';
26
26
  import { applyHookInstall, readHookStatus } from '../../../services/skills/hooks-settings-service.js';
27
27
  import { clearStalePresenceOnRotation } from '../../../services/skills/skill-presence-service.js';
28
- import { fail, ok } from '../../../shared/result.js';
28
+ import { fail, ok } from 'peaks-loop-shared/result';
29
29
  import { addJsonOption, getErrorMessage, printResult } from '../../cli-helpers.js';
30
30
  import { hasStandardsCheckedMarker, markStandardsChecked } from '../../../services/standards/missing-standards-detector.js';
31
31
  import { bootstrapProjectScan } from '../../../services/prd/project-scan-bootstrap-service.js';
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import { migrateWorkspace } from '../../../services/workspace/migrate-service.js';
10
10
  import { resolveCanonicalProjectRoot } from '../../../services/config/config-service.js';
11
- import { fail, ok } from '../../../shared/result.js';
11
+ import { fail, ok } from 'peaks-loop-shared/result';
12
12
  import { addJsonOption, getErrorMessage, printResult } from '../../cli-helpers.js';
13
13
  export function registerWorkspaceMigrateCommand(workspace, io) {
14
14
  addJsonOption(workspace
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import { reconcileWorkspace } from '../../../services/workspace/reconcile-service.js';
13
13
  import { resolveCanonicalProjectRoot } from '../../../services/config/config-service.js';
14
- import { fail, ok } from '../../../shared/result.js';
14
+ import { fail, ok } from 'peaks-loop-shared/result';
15
15
  import { addJsonOption, getErrorMessage, printResult } from '../../cli-helpers.js';
16
16
  // Inlined from the original 925-line workspace-commands.ts; the import
17
17
  // path '../../../shared/duration.js' did not exist and the constants
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CommanderError } from 'commander';
2
2
  import { createProgram } from './program.js';
3
- import { getErrorMessage } from '../shared/result.js';
3
+ import { getErrorMessage } from 'peaks-loop-shared/result';
4
4
  // D-013 wrapper exit-code fix (PART 2): Commander's `--help` short-circuit
5
5
  // fires BEFORE `commander.unknownCommand` is raised, so `peaks xxx --help`
6
6
  // (where `xxx` is not a registered command) prints the help banner and
@@ -1,8 +1,8 @@
1
1
  import { readdirSync, existsSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { Command } from 'commander';
4
- import { skillsDir, repoRoot } from '../shared/paths.js';
5
- import { CLI_VERSION } from '../shared/version.js';
4
+ import { skillsDir, repoRoot } from 'peaks-loop-shared/paths';
5
+ import { CLI_VERSION } from 'peaks-loop-shared/version';
6
6
  import { registerCoreAndArtifactCommands } from './commands/core-artifact-commands.js';
7
7
  import { registerWorkflowCommands } from './commands/workflow-commands.js';
8
8
  import { registerCapabilityWorkerConfigAndSCCommands } from './commands/capability-worker-config-sc-commands.js';
@@ -1,6 +1,6 @@
1
1
  import { join, dirname, basename } from 'node:path';
2
2
  import { readFile, readdir } from 'node:fs/promises';
3
- import { pathExists } from '../../shared/fs.js';
3
+ import { pathExists } from 'peaks-loop-shared/fs';
4
4
  import { emitObservabilityEvent } from '../observability/observability-service.js';
5
5
  export const VALID_REQUEST_TYPES = [
6
6
  'feature',
@@ -1,7 +1,7 @@
1
1
  import { mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { dirname, join } from 'node:path';
4
- import { isDirectory, listDirectories } from '../../shared/fs.js';
4
+ import { isDirectory, listDirectories } from 'peaks-loop-shared/fs';
5
5
  import { checkPrerequisites, DEFAULT_REQUEST_TYPE, isRequestType, VALID_REQUEST_TYPES } from './artifact-prerequisites.js';
6
6
  import { ensureSession, getSessionIdCanonical } from '../session/session-manager.js';
7
7
  // Slice 2026-06-29-change-id-root-removal: `getCurrentChangeId` was
@@ -3,7 +3,7 @@ import { Buffer } from 'node:buffer';
3
3
  import { resolve } from 'node:path';
4
4
  import { isInsidePath, stablePath } from '../../shared/path-utils.js';
5
5
  import { getWorkspaceConfig, getWorkspaceConfigForCurrentPath } from '../config/config-service.js';
6
- import { pathExists } from '../../shared/fs.js';
6
+ import { pathExists } from 'peaks-loop-shared/fs';
7
7
  import { execCommand } from '../../shared/process.js';
8
8
  function canonicalPath(path) {
9
9
  return stablePath(path);
@@ -59,12 +59,15 @@ export function evaluateCompactTrigger(ratio) {
59
59
  message: `Context at ${(ratio * 100).toFixed(1)}% ≥ 95% red line. Synchronous compact REQUIRED (LLM cannot opt out).`
60
60
  };
61
61
  }
62
- // 0.85 ≤ ratio < 0.95: pre-compact zone — toolkit ready, LLM decides.
62
+ // 0.85 ≤ ratio < 0.95: pre-compact zone — peaks-loop fires
63
+ // `peaks session auto-compact --execute` AUTOMATICALLY (zero-pause
64
+ // contract, v2.13.0). The LLM does NOT decide; the orchestrator does.
65
+ // D6.e in-flight deferral below is the only reason to wait.
63
66
  return {
64
67
  kind: 'pre-compact',
65
68
  ratio,
66
69
  toolkitReady: true,
67
- message: `Context at ${(ratio * 100).toFixed(1)}% in pre-compact zone (0.85–0.95). Convergence toolkit is ready; LLM decides when to fire \`peaks code auto-compact --execute\`.`
70
+ message: `Context at ${(ratio * 100).toFixed(1)}% in pre-compact zone (0.85–0.95). peaks-loop will automatically fire \`peaks session auto-compact --execute\` (zero-pause contract).`
68
71
  };
69
72
  }
70
73
  /**
@@ -52,7 +52,7 @@ export interface SubprocessRunner {
52
52
  * present (peaks-loop was installed but its dependency tree is
53
53
  * corrupt, or the user removed it).
54
54
  *
55
- * Walks up from this file (dist/src/services/code-review/) to
55
+ * Walks up from this file (dist/services/code-review/) to
56
56
  * find the project root, then checks node_modules.
57
57
  */
58
58
  export declare function resolveOcrLauncher(searchRoots: readonly string[]): string | null;
@@ -101,7 +101,7 @@ const DEFAULT_RUNNER = {
101
101
  * present (peaks-loop was installed but its dependency tree is
102
102
  * corrupt, or the user removed it).
103
103
  *
104
- * Walks up from this file (dist/src/services/code-review/) to
104
+ * Walks up from this file (dist/services/code-review/) to
105
105
  * find the project root, then checks node_modules.
106
106
  */
107
107
  export function resolveOcrLauncher(searchRoots) {
@@ -122,8 +122,11 @@ export function resolveOcrLauncher(searchRoots) {
122
122
  * (2) the user's cwd.
123
123
  */
124
124
  export function defaultOcrSearchRoots(currentDirPath, cwd) {
125
- // currentDirPath is dist/src/services/code-review/; walk up 4 to repo root.
126
- const peaksRoot = join(currentDirPath, '..', '..', '..', '..');
125
+ // currentDirPath is dist/services/code-review/ under tsc rootDir=src;
126
+ // walk up 3 to repo root. If tsconfig.build.json#rootDir ever reverts
127
+ // to "." (emits dist/src/services/code-review/), this must become
128
+ // walk-4 — keep these two in lockstep.
129
+ const peaksRoot = join(currentDirPath, '..', '..', '..');
127
130
  return [peaksRoot, cwd];
128
131
  }
129
132
  /**
@@ -1,4 +1,4 @@
1
- import { CLI_VERSION } from '../../shared/version.js';
1
+ import { CLI_VERSION } from 'peaks-loop-shared/version';
2
2
  /**
3
3
  * 2.0.1 slim runtime default for `~/.peaks/config.json`. The on-disk
4
4
  * file only carries `version` + empty `ocr.llm.*` placeholders.
@@ -2,7 +2,7 @@ import { listRequestArtifacts } from '../artifacts/request-artifact-service.js';
2
2
  import { scanOpenSpec } from '../openspec/openspec-scan-service.js';
3
3
  import { scanUnderstandAnything } from '../understand/understand-scan-service.js';
4
4
  import { seedCapabilityItems } from '../recommendations/capability-seed-items.js';
5
- import { requiredSkillNames } from '../../shared/paths.js';
5
+ import { requiredSkillNames } from 'peaks-loop-shared/paths';
6
6
  import { getSkillPresence } from '../skills/skill-presence-service.js';
7
7
  const SKILL_PRESENCE_FRESHNESS_THRESHOLD_MS = 24 * 60 * 60 * 1000;
8
8
  /**
@@ -45,7 +45,7 @@ async function loadDoctorAndRunbookHealth(doctorOverride, runbookOverride) {
45
45
  runbookHealth: { ok: true, required: 0, healthy: 0, missingRunbook: [], applyNoteFailed: [] }
46
46
  };
47
47
  }
48
- const { runDoctor } = await import('../doctor/doctor-service.js');
48
+ const { runDoctor } = await import('peaks-loop-doctor');
49
49
  const report = await runDoctor();
50
50
  return {
51
51
  doctor: { ok: report.summary.ok, passed: report.summary.passed, failed: report.summary.failed },
@@ -23,7 +23,7 @@
23
23
  */
24
24
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
25
25
  import { dirname, resolve } from 'node:path';
26
- import { withFileLockSync } from '../filesystem/file-lock.js';
26
+ import { withFileLockSync } from 'peaks-loop-shared-channel';
27
27
  export const BATCH_LIMIT = 6;
28
28
  export const BATCH_OVER_LIMIT_CODE = 'BATCH_OVER_LIMIT';
29
29
  /** Build the per-batch counter file path. */
@@ -27,7 +27,7 @@
27
27
  import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
28
28
  import { dirname, resolve } from 'node:path';
29
29
  import { assertSafeDispatchRecordPath, dispatchRecordPath } from '../security/safe-settings-path.js';
30
- import { withFileLockSync } from '../filesystem/file-lock.js';
30
+ import { withFileLockSync } from 'peaks-loop-shared-channel';
31
31
  const MAX_PROMPT_BYTES = 256 * 1024;
32
32
  /** Write a new dispatch record (G2 + G5 + G6). Returns the absolute path. */
33
33
  export function writeInitialDispatchRecord(input) {
@@ -30,16 +30,16 @@ export declare const JobProgressSchema: z.ZodObject<{
30
30
  lastCommitSha: z.ZodNullable<z.ZodString>;
31
31
  updatedAt: z.ZodString;
32
32
  }, "strip", z.ZodTypeAny, {
33
- updatedAt: string;
34
33
  done: number;
34
+ updatedAt: string;
35
35
  schemaVersion: 1;
36
36
  jobId: string;
37
37
  total: number;
38
38
  currentSlice: string;
39
39
  lastCommitSha: string | null;
40
40
  }, {
41
- updatedAt: string;
42
41
  done: number;
42
+ updatedAt: string;
43
43
  schemaVersion: 1;
44
44
  jobId: string;
45
45
  total: number;
@@ -9,7 +9,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
9
9
  repairCycles: z.ZodDefault<z.ZodNumber>;
10
10
  blockedReason: z.ZodOptional<z.ZodString>;
11
11
  }, "strip", z.ZodTypeAny, {
12
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
12
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
13
13
  label: string;
14
14
  sliceId: string;
15
15
  repairCycles: number;
@@ -18,7 +18,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
18
18
  failureReason?: string | undefined;
19
19
  blockedReason?: string | undefined;
20
20
  }, {
21
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
21
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
22
22
  label: string;
23
23
  sliceId: string;
24
24
  commitSha?: string | undefined;
@@ -27,7 +27,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
27
27
  repairCycles?: number | undefined;
28
28
  blockedReason?: string | undefined;
29
29
  }>, {
30
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
30
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
31
31
  label: string;
32
32
  sliceId: string;
33
33
  repairCycles: number;
@@ -36,7 +36,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
36
36
  failureReason?: string | undefined;
37
37
  blockedReason?: string | undefined;
38
38
  }, {
39
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
39
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
40
40
  label: string;
41
41
  sliceId: string;
42
42
  commitSha?: string | undefined;
@@ -45,7 +45,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
45
45
  repairCycles?: number | undefined;
46
46
  blockedReason?: string | undefined;
47
47
  }>, {
48
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
48
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
49
49
  label: string;
50
50
  sliceId: string;
51
51
  repairCycles: number;
@@ -54,7 +54,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
54
54
  failureReason?: string | undefined;
55
55
  blockedReason?: string | undefined;
56
56
  }, {
57
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
57
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
58
58
  label: string;
59
59
  sliceId: string;
60
60
  commitSha?: string | undefined;
@@ -63,7 +63,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
63
63
  repairCycles?: number | undefined;
64
64
  blockedReason?: string | undefined;
65
65
  }>, {
66
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
66
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
67
67
  label: string;
68
68
  sliceId: string;
69
69
  repairCycles: number;
@@ -72,7 +72,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
72
72
  failureReason?: string | undefined;
73
73
  blockedReason?: string | undefined;
74
74
  }, {
75
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
75
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
76
76
  label: string;
77
77
  sliceId: string;
78
78
  commitSha?: string | undefined;
@@ -117,7 +117,7 @@ export declare const JobStateSchema: z.ZodObject<{
117
117
  repairCycles: z.ZodDefault<z.ZodNumber>;
118
118
  blockedReason: z.ZodOptional<z.ZodString>;
119
119
  }, "strip", z.ZodTypeAny, {
120
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
120
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
121
121
  label: string;
122
122
  sliceId: string;
123
123
  repairCycles: number;
@@ -126,7 +126,7 @@ export declare const JobStateSchema: z.ZodObject<{
126
126
  failureReason?: string | undefined;
127
127
  blockedReason?: string | undefined;
128
128
  }, {
129
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
129
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
130
130
  label: string;
131
131
  sliceId: string;
132
132
  commitSha?: string | undefined;
@@ -135,7 +135,7 @@ export declare const JobStateSchema: z.ZodObject<{
135
135
  repairCycles?: number | undefined;
136
136
  blockedReason?: string | undefined;
137
137
  }>, {
138
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
138
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
139
139
  label: string;
140
140
  sliceId: string;
141
141
  repairCycles: number;
@@ -144,7 +144,7 @@ export declare const JobStateSchema: z.ZodObject<{
144
144
  failureReason?: string | undefined;
145
145
  blockedReason?: string | undefined;
146
146
  }, {
147
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
147
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
148
148
  label: string;
149
149
  sliceId: string;
150
150
  commitSha?: string | undefined;
@@ -153,7 +153,7 @@ export declare const JobStateSchema: z.ZodObject<{
153
153
  repairCycles?: number | undefined;
154
154
  blockedReason?: string | undefined;
155
155
  }>, {
156
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
156
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
157
157
  label: string;
158
158
  sliceId: string;
159
159
  repairCycles: number;
@@ -162,7 +162,7 @@ export declare const JobStateSchema: z.ZodObject<{
162
162
  failureReason?: string | undefined;
163
163
  blockedReason?: string | undefined;
164
164
  }, {
165
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
165
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
166
166
  label: string;
167
167
  sliceId: string;
168
168
  commitSha?: string | undefined;
@@ -171,7 +171,7 @@ export declare const JobStateSchema: z.ZodObject<{
171
171
  repairCycles?: number | undefined;
172
172
  blockedReason?: string | undefined;
173
173
  }>, {
174
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
174
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
175
175
  label: string;
176
176
  sliceId: string;
177
177
  repairCycles: number;
@@ -180,7 +180,7 @@ export declare const JobStateSchema: z.ZodObject<{
180
180
  failureReason?: string | undefined;
181
181
  blockedReason?: string | undefined;
182
182
  }, {
183
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
183
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
184
184
  label: string;
185
185
  sliceId: string;
186
186
  commitSha?: string | undefined;
@@ -194,7 +194,7 @@ export declare const JobStateSchema: z.ZodObject<{
194
194
  sessionId: string;
195
195
  jobId: string;
196
196
  slices: {
197
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
197
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
198
198
  label: string;
199
199
  sliceId: string;
200
200
  repairCycles: number;
@@ -220,7 +220,7 @@ export declare const JobStateSchema: z.ZodObject<{
220
220
  sessionId: string;
221
221
  jobId: string;
222
222
  slices: {
223
- status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
223
+ status: "pending" | "done" | "failed" | "skipped" | "blocked" | "in-progress";
224
224
  label: string;
225
225
  sliceId: string;
226
226
  commitSha?: string | undefined;
@@ -292,9 +292,9 @@ export declare const JobStatusSummarySchema: z.ZodObject<{
292
292
  contextRatio: number;
293
293
  }>>;
294
294
  }, "strip", z.ZodTypeAny, {
295
- skipped: number;
296
295
  done: number;
297
296
  failed: number;
297
+ skipped: number;
298
298
  blocked: number;
299
299
  total: number;
300
300
  mainLoopStrategy: "single" | "rotating";
@@ -310,9 +310,9 @@ export declare const JobStatusSummarySchema: z.ZodObject<{
310
310
  contextRatio: number;
311
311
  } | undefined;
312
312
  }, {
313
- skipped: number;
314
313
  done: number;
315
314
  failed: number;
315
+ skipped: number;
316
316
  blocked: number;
317
317
  total: number;
318
318
  mainLoopStrategy: "single" | "rotating";
@@ -330,7 +330,7 @@ export declare const JobStatusSummarySchema: z.ZodObject<{
330
330
  }>;
331
331
  export type SliceState = z.infer<typeof SliceStateSchema>;
332
332
  export type JobState = z.infer<typeof JobStateSchema>;
333
- export type ResourceSnapshot = z.infer<typeof ResourceSnapshotSchema>;
333
+ export type { ResourceSnapshot } from 'peaks-loop-job-snapshot/types';
334
334
  export type JobStatusSummary = z.infer<typeof JobStatusSummarySchema>;
335
335
  export declare const JobInitInputSchema: z.ZodObject<{
336
336
  jobId: z.ZodString;
@@ -375,14 +375,14 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
375
375
  }, "strip", z.ZodTypeAny, {
376
376
  project: string;
377
377
  json: boolean;
378
- state: "skipped" | "done" | "failed";
378
+ state: "done" | "failed" | "skipped";
379
379
  sliceId: string;
380
380
  jobId: string;
381
381
  reason?: string | undefined;
382
382
  commitSha?: string | undefined;
383
383
  }, {
384
384
  project: string;
385
- state: "skipped" | "done" | "failed";
385
+ state: "done" | "failed" | "skipped";
386
386
  sliceId: string;
387
387
  jobId: string;
388
388
  json?: boolean | undefined;
@@ -391,14 +391,14 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
391
391
  }>, {
392
392
  project: string;
393
393
  json: boolean;
394
- state: "skipped" | "done" | "failed";
394
+ state: "done" | "failed" | "skipped";
395
395
  sliceId: string;
396
396
  jobId: string;
397
397
  reason?: string | undefined;
398
398
  commitSha?: string | undefined;
399
399
  }, {
400
400
  project: string;
401
- state: "skipped" | "done" | "failed";
401
+ state: "done" | "failed" | "skipped";
402
402
  sliceId: string;
403
403
  jobId: string;
404
404
  json?: boolean | undefined;
@@ -407,14 +407,14 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
407
407
  }>, {
408
408
  project: string;
409
409
  json: boolean;
410
- state: "skipped" | "done" | "failed";
410
+ state: "done" | "failed" | "skipped";
411
411
  sliceId: string;
412
412
  jobId: string;
413
413
  reason?: string | undefined;
414
414
  commitSha?: string | undefined;
415
415
  }, {
416
416
  project: string;
417
- state: "skipped" | "done" | "failed";
417
+ state: "done" | "failed" | "skipped";
418
418
  sliceId: string;
419
419
  jobId: string;
420
420
  json?: boolean | undefined;
@@ -16,7 +16,7 @@
16
16
  import { readdirSync, statSync, unlinkSync, existsSync } from 'node:fs';
17
17
  import { join } from 'node:path';
18
18
  import { resolveLogDir } from './logger.js';
19
- import { cleanupStaleCache } from '../agent/ecc-cache-service.js';
19
+ import { cleanupStaleCache } from 'peaks-loop-mut';
20
20
  const LOG_FILE_NAME_PATTERN = /^peaks-loop-(\d{4}-\d{2}-\d{2})\.log$/;
21
21
  function dayDiffUtc(nowUtcMidnightMs, fileDateUtcMs) {
22
22
  const dayMs = 24 * 60 * 60 * 1000;
@@ -1,6 +1,6 @@
1
1
  import { mkdir, rename } from 'node:fs/promises';
2
2
  import { dirname, join } from 'node:path';
3
- import { isDirectory } from '../../shared/fs.js';
3
+ import { isDirectory } from 'peaks-loop-shared/fs';
4
4
  const CHANGE_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
5
5
  function defaultOpenSpecRoot() {
6
6
  return join(process.cwd(), 'openspec');
@@ -1,4 +1,4 @@
1
- import { readText } from '../../shared/fs.js';
1
+ import { readText } from 'peaks-loop-shared/fs';
2
2
  import { loadOpenSpecChange } from './openspec-scan-service.js';
3
3
  function splitTaskSections(markdown) {
4
4
  const sections = [];
@@ -1,6 +1,6 @@
1
1
  import { mkdir, writeFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
- import { isDirectory, pathExists } from '../../shared/fs.js';
3
+ import { isDirectory, pathExists } from 'peaks-loop-shared/fs';
4
4
  const README_BODY = `# OpenSpec — change proposals for this project
5
5
 
6
6
  This directory hosts the \`peaks openspec\` change proposal lifecycle:
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
14
14
  import { join } from 'node:path';
15
- import { getErrorMessage } from '../../shared/result.js';
15
+ import { getErrorMessage } from 'peaks-loop-shared/result';
16
16
  const SLUGIFY = /[^a-z0-9]+/g;
17
17
  function slugify(text) {
18
18
  return text
@@ -1,7 +1,7 @@
1
1
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
2
2
  import { dirname, join, resolve } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
- import { isDirectory, pathExists } from '../../shared/fs.js';
4
+ import { isDirectory, pathExists } from 'peaks-loop-shared/fs';
5
5
  import { validateAgainstSchema } from '../../shared/json-schema-mini.js';
6
6
  const CHANGE_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
7
7
  function defaultOpenSpecRoot() {
@@ -1,5 +1,5 @@
1
1
  import { join } from 'node:path';
2
- import { isDirectory, listDirectories, pathExists, readText } from '../../shared/fs.js';
2
+ import { isDirectory, listDirectories, pathExists, readText } from 'peaks-loop-shared/fs';
3
3
  function defaultOpenSpecRoot() {
4
4
  return join(process.cwd(), 'openspec');
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { join } from 'node:path';
2
- import { isDirectory } from '../../shared/fs.js';
2
+ import { isDirectory } from 'peaks-loop-shared/fs';
3
3
  import { loadOpenSpecChange } from './openspec-scan-service.js';
4
4
  const CHANGE_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
5
5
  function defaultOpenSpecRoot() {
@@ -1,5 +1,5 @@
1
1
  import { join } from 'node:path';
2
- import { pathExists, readText } from '../../shared/fs.js';
2
+ import { pathExists, readText } from 'peaks-loop-shared/fs';
3
3
  import { showRequestArtifact } from '../artifacts/request-artifact-service.js';
4
4
  const ACCEPTANCE_SECTION_PATTERN = /^##\s+(?:Acceptance criteria|验收标准|Acceptance Criteria)\s*$/m;
5
5
  function extractAcceptanceItems(prdBody) {
@@ -1,6 +1,6 @@
1
1
  import { readdir, stat } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
- import { isDirectory, pathExists, readText } from '../../shared/fs.js';
3
+ import { isDirectory, pathExists, readText } from 'peaks-loop-shared/fs';
4
4
  const BACKEND_DEP_NAMES = [
5
5
  'express',
6
6
  'koa',