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.
- package/CHANGELOG.md +282 -147
- package/README-en.md +1 -1
- package/README.md +32 -1
- package/bin/peaks.js +0 -0
- package/dist/cli/cli-helpers.d.ts +1 -1
- package/dist/cli/cli-helpers.js +1 -1
- package/dist/cli/commands/adapter-commands-s2a.js +1 -1
- package/dist/cli/commands/asset-commands.js +33 -16
- package/dist/cli/commands/audit-commands.js +1 -1
- package/dist/cli/commands/bee-commands.js +1 -1
- package/dist/cli/commands/capability-commands.js +1 -1
- package/dist/cli/commands/classify-classify-commands.js +1 -1
- package/dist/cli/commands/code-commands.js +1 -1
- package/dist/cli/commands/code-review-commands.js +1 -1
- package/dist/cli/commands/codegraph-commands.js +1 -1
- package/dist/cli/commands/compact-command.js +1 -1
- package/dist/cli/commands/complexity-commands.js +1 -1
- package/dist/cli/commands/config-commands.js +1 -1
- package/dist/cli/commands/context-commands.js +1 -1
- package/dist/cli/commands/contract-commands.js +1 -1
- package/dist/cli/commands/core/artifacts-command.js +1 -1
- package/dist/cli/commands/core/binding-commands.js +1 -1
- package/dist/cli/commands/core/doctor-command.js +63 -3
- package/dist/cli/commands/core/memory-command.js +1 -1
- package/dist/cli/commands/core/profile-command.js +1 -1
- package/dist/cli/commands/core/proxy-command.js +1 -1
- package/dist/cli/commands/core/session-command.js +1 -1
- package/dist/cli/commands/core/skill-command.js +2 -2
- package/dist/cli/commands/core/standards-command.js +1 -1
- package/dist/cli/commands/dispatch-commands.js +2 -2
- package/dist/cli/commands/dispatch-from-dag.js +1 -1
- package/dist/cli/commands/doc-commands.js +1 -1
- package/dist/cli/commands/ecc-commands.js +2 -2
- package/dist/cli/commands/evolution-commands.js +1 -1
- package/dist/cli/commands/feedback-commands.js +1 -1
- package/dist/cli/commands/final-review-commands.js +1 -1
- package/dist/cli/commands/fixture-commands.js +1 -1
- package/dist/cli/commands/fork-commands.js +1 -1
- package/dist/cli/commands/gate-commands.js +1 -1
- package/dist/cli/commands/heartbeat-commands.js +1 -1
- package/dist/cli/commands/hook-handle.js +1 -1
- package/dist/cli/commands/hooks-commands.js +1 -1
- package/dist/cli/commands/ide-commands.js +1 -1
- package/dist/cli/commands/impact-commands.js +1 -1
- package/dist/cli/commands/job-commands.js +1 -1
- package/dist/cli/commands/legacy-commands.js +1 -1
- package/dist/cli/commands/log-commands.js +1 -1
- package/dist/cli/commands/loop-commands.js +1 -1
- package/dist/cli/commands/loop-eval-commands.js +1 -1
- package/dist/cli/commands/memory-commands.js +1 -1
- package/dist/cli/commands/migrate-1-4-1-command.js +1 -1
- package/dist/cli/commands/migrate-v2-10-to-v2-11-command.js +1 -1
- package/dist/cli/commands/mut-commands.d.ts +1 -1
- package/dist/cli/commands/mut-commands.js +1 -5
- package/dist/cli/commands/observability-commands.js +1 -1
- package/dist/cli/commands/openspec-commands.js +2 -2
- package/dist/cli/commands/perf-audit-commands.js +2 -2
- package/dist/cli/commands/perf-commands.js +1 -1
- package/dist/cli/commands/polyrepo-commands.js +1 -1
- package/dist/cli/commands/prd-blocks-commands.js +1 -1
- package/dist/cli/commands/prd-commands.js +1 -1
- package/dist/cli/commands/project-commands.js +1 -1
- package/dist/cli/commands/qa-business-review-commands.js +1 -1
- package/dist/cli/commands/qa-commands.d.ts +1 -1
- package/dist/cli/commands/qa-commands.js +2 -2
- package/dist/cli/commands/release-commands.js +1 -1
- package/dist/cli/commands/request-commands.js +1 -1
- package/dist/cli/commands/retrospective-commands.js +1 -1
- package/dist/cli/commands/reviewer-commands.js +1 -1
- package/dist/cli/commands/role-commands.js +1 -1
- package/dist/cli/commands/runtime-commands.js +1 -2
- package/dist/cli/commands/sc-commands.js +1 -1
- package/dist/cli/commands/scan-commands.js +1 -1
- package/dist/cli/commands/security-audit-commands.js +2 -2
- package/dist/cli/commands/sediment-commands.js +10 -1
- package/dist/cli/commands/share-commands.d.ts +19 -0
- package/dist/cli/commands/share-commands.js +121 -2
- package/dist/cli/commands/skill-conformance-commands.js +1 -1
- package/dist/cli/commands/skill-loop-engineering-readiness-commands.js +1 -1
- package/dist/cli/commands/skill-search-commands.js +1 -1
- package/dist/cli/commands/slice-commands.js +1 -1
- package/dist/cli/commands/slice-integrate-commands.js +1 -1
- package/dist/cli/commands/slice-review-commands.js +1 -1
- package/dist/cli/commands/smoke-commands.js +1 -1
- package/dist/cli/commands/sop-commands.js +1 -1
- package/dist/cli/commands/statusline-commands.js +1 -1
- package/dist/cli/commands/sub-agent-commands.js +2 -1
- package/dist/cli/commands/understand-commands.js +1 -1
- package/dist/cli/commands/upgrade-commands.js +1 -1
- package/dist/cli/commands/user-touchpoint-commands.js +1 -1
- package/dist/cli/commands/verdict-aggregate-command.js +1 -1
- package/dist/cli/commands/workflow-commands.js +1 -1
- package/dist/cli/commands/workflow-plan-commands.js +1 -1
- package/dist/cli/commands/workspace/init-command.js +1 -1
- package/dist/cli/commands/workspace/migrate-command.js +1 -1
- package/dist/cli/commands/workspace/reconcile-command.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/program.js +2 -2
- package/dist/services/artifacts/artifact-prerequisites.js +1 -1
- package/dist/services/artifacts/request-artifact-service.js +1 -1
- package/dist/services/artifacts/workspace-service.js +1 -1
- package/dist/services/code/auto-compact-orchestrator.js +5 -2
- package/dist/services/code-review/ocr-service.d.ts +1 -1
- package/dist/services/code-review/ocr-service.js +6 -3
- package/dist/services/config/config-types.js +1 -1
- package/dist/services/dashboard/project-dashboard-service.js +2 -2
- package/dist/services/dispatch/batch-counter.js +1 -1
- package/dist/services/dispatch/dispatch-record-writer.js +1 -1
- package/dist/services/job/job-progress-store.d.ts +2 -2
- package/dist/services/job/job-types.d.ts +27 -27
- package/dist/services/log/retention.js +1 -1
- package/dist/services/openspec/openspec-archive-service.js +1 -1
- package/dist/services/openspec/openspec-bridge-service.js +1 -1
- package/dist/services/openspec/openspec-init-service.js +1 -1
- package/dist/services/openspec/openspec-propose-from-doctor-service.js +1 -1
- package/dist/services/openspec/openspec-render-service.js +1 -1
- package/dist/services/openspec/openspec-scan-service.js +1 -1
- package/dist/services/openspec/openspec-validate-service.js +1 -1
- package/dist/services/scan/acceptance-coverage-service.js +1 -1
- package/dist/services/scan/archetype-service.js +1 -1
- package/dist/services/scan/existing-system-service.js +1 -1
- package/dist/services/scan/libraries-service.js +1 -1
- package/dist/services/skill/skill-search-service.d.ts +5 -5
- package/dist/services/skill/skill-search-service.js +2 -2
- package/dist/services/skillhub/migrations/001-initial.sql +71 -0
- package/dist/services/skillhub/migrations/002-loop-release.sql +32 -0
- package/dist/services/skillhub/migrations/003-loop-bee-relation.sql +35 -0
- package/dist/services/skillhub/migrations/004-loop-bee-extension.sql +65 -0
- package/dist/services/skillhub/migrations/005-evolution-evaluation.sql +81 -0
- package/dist/services/skillhub/migrations/006-crystallization-event.sql +92 -0
- package/dist/services/skills/skill-registry.js +2 -2
- package/dist/services/skills/skill-runbook-service.js +1 -1
- package/dist/services/slice/slice-check-service.js +1 -1
- package/dist/services/understand/understand-hybrid-service.js +1 -1
- package/dist/services/understand/understand-scan-service.js +2 -2
- package/dist/services/upgrade/upgrade-service.js +4 -3
- package/dist/services/verdict/envelopes.d.ts +2 -2
- package/dist/services/verdict/envelopes.js +2 -2
- package/dist/services/verdict/verdict-aggregator.d.ts +3 -3
- package/dist/services/workflow/autonomous-resume-writer.js +1 -1
- package/dist/services/workflow/plan-reader.d.ts +1 -1
- package/dist/services/workflow/plan-reader.js +1 -1
- package/dist/services/workflow/plan-refresher.d.ts +1 -1
- package/dist/services/workflow/plan-refresher.js +1 -1
- package/dist/services/workflow/plan-trigger-detector.d.ts +1 -1
- package/dist/services/workflow/plan-trigger-detector.js +1 -1
- package/dist/services/workflow/workflow-router-service.js +11 -9
- package/dist/services/workspace/migrate-service.js +1 -1
- package/dist/services/workspace/workspace-service.js +1 -1
- package/package.json +14 -8
- package/scripts/copy-templates.mjs +16 -0
- package/scripts/sync-version.mjs +8 -1
- package/skills/bee/peaks-rd/SKILL.md +14 -1
- package/skills/peaks-code/SKILL.md +44 -0
- package/skills/peaks-code/references/sub-agent-dispatch.md +30 -0
- package/dist/services/agent/ecc-cache-service.d.ts +0 -97
- package/dist/services/agent/ecc-cache-service.js +0 -491
- package/dist/services/audit-independent/perf-audit-service.d.ts +0 -151
- package/dist/services/audit-independent/perf-audit-service.js +0 -316
- package/dist/services/audit-independent/security-audit-service.d.ts +0 -155
- package/dist/services/audit-independent/security-audit-service.js +0 -316
- package/dist/services/context/dispatch-context-guard.d.ts +0 -27
- package/dist/services/context/dispatch-context-guard.js +0 -192
- package/dist/services/context/shared-channel.d.ts +0 -93
- package/dist/services/context/shared-channel.js +0 -308
- package/dist/services/crystallization/crystallization-service.d.ts +0 -239
- package/dist/services/crystallization/crystallization-service.js +0 -397
- package/dist/services/crystallization/crystallization-store.d.ts +0 -75
- package/dist/services/crystallization/crystallization-store.js +0 -193
- package/dist/services/crystallization/crystallization-types.d.ts +0 -313
- package/dist/services/crystallization/crystallization-types.js +0 -299
- package/dist/services/crystallization/evidence-brief-builder.d.ts +0 -237
- package/dist/services/crystallization/evidence-brief-builder.js +0 -240
- package/dist/services/doctor/doctor-service.d.ts +0 -149
- package/dist/services/doctor/doctor-service.js +0 -929
- package/dist/services/filesystem/file-lock.d.ts +0 -11
- package/dist/services/filesystem/file-lock.js +0 -152
- package/dist/services/final-review/final-review-service.d.ts +0 -12
- package/dist/services/final-review/final-review-service.js +0 -52
- package/dist/services/final-review/final-review-types.d.ts +0 -42
- package/dist/services/final-review/final-review-types.js +0 -18
- package/dist/services/job/job-resource-snapshot.d.ts +0 -7
- package/dist/services/job/job-resource-snapshot.js +0 -75
- package/dist/services/mut/assert-scanner.d.ts +0 -6
- package/dist/services/mut/assert-scanner.js +0 -116
- package/dist/services/mut/index.d.ts +0 -8
- package/dist/services/mut/index.js +0 -7
- package/dist/services/mut/mut-runner.d.ts +0 -39
- package/dist/services/mut/mut-runner.js +0 -29
- package/dist/services/mut/production-stryker.d.ts +0 -2
- package/dist/services/mut/production-stryker.js +0 -75
- package/dist/services/mut/report-builder.d.ts +0 -11
- package/dist/services/mut/report-builder.js +0 -110
- package/dist/services/mut/report-loader.d.ts +0 -31
- package/dist/services/mut/report-loader.js +0 -78
- package/dist/services/mut/thresholds.d.ts +0 -21
- package/dist/services/mut/thresholds.js +0 -22
- package/dist/services/mut/types.d.ts +0 -336
- package/dist/services/mut/types.js +0 -59
- package/dist/shared/fs.d.ts +0 -4
- package/dist/shared/fs.js +0 -26
- package/dist/shared/paths.d.ts +0 -6
- package/dist/shared/paths.js +0 -50
- package/dist/shared/result.d.ts +0 -22
- package/dist/shared/result.js +0 -46
- package/dist/shared/version.d.ts +0 -1
- package/dist/shared/version.js +0 -1
- package/examples/video-demo/README.md +0 -142
- package/examples/video-demo/out/en-closing-960.png +0 -0
- package/examples/video-demo/out/zh-closing-960.png +0 -0
- package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
- 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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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
|
package/dist/cli/program.js
CHANGED
|
@@ -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 '
|
|
5
|
-
import { CLI_VERSION } from '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 —
|
|
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).
|
|
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/
|
|
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/
|
|
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/
|
|
126
|
-
|
|
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
|
/**
|
|
@@ -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 '
|
|
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('
|
|
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 '
|
|
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 '
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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" | "
|
|
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
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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 '
|
|
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 '
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import { isDirectory, pathExists } from '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
3
|
+
import { isDirectory, pathExists, readText } from 'peaks-loop-shared/fs';
|
|
4
4
|
const BACKEND_DEP_NAMES = [
|
|
5
5
|
'express',
|
|
6
6
|
'koa',
|