@planu/cli 5.7.21 → 5.7.23
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 +52 -0
- package/dist/.planu-build.json +1 -1
- package/dist/cli/commands/release.js +23 -10
- package/dist/cli/commands/spec.js +2 -32
- package/dist/config/registries/error-recovery.json +18 -18
- package/dist/config/registries/legacy-guidance.json +33 -1
- package/dist/config/server-instructions.js +16 -20
- package/dist/config/skill-templates/planu-release.md +3 -3
- package/dist/config/token-waste-autopilot.json +1 -1
- package/dist/core/shared/object.d.ts +3 -0
- package/dist/core/shared/object.js +12 -0
- package/dist/engine/config-loader.js +24 -32
- package/dist/engine/conventions-ttl.d.ts +2 -0
- package/dist/engine/conventions-ttl.js +1 -1
- package/dist/engine/detectors/library-detector-langs3b.d.ts +0 -5
- package/dist/engine/detectors/library-detector-langs3b.js +2 -16
- package/dist/engine/detectors/library-detector-langs5.d.ts +0 -1
- package/dist/engine/detectors/library-detector-langs5.js +2 -16
- package/dist/engine/detectors/otel-detector.js +4 -3
- package/dist/engine/detectors/otel-ecosystem-detectors.d.ts +0 -4
- package/dist/engine/detectors/otel-ecosystem-detectors.js +2 -14
- package/dist/engine/detectors/toml-dependencies.d.ts +2 -0
- package/dist/engine/detectors/toml-dependencies.js +16 -0
- package/dist/engine/drift-detection/release-status-drift.js +2 -17
- package/dist/engine/errors/registry-loader.js +3 -2
- package/dist/engine/evidence-gates/artifact-reader.d.ts +78 -0
- package/dist/engine/evidence-gates/artifact-reader.js +19 -7
- package/dist/engine/health/auto-fixer.js +2 -2
- package/dist/engine/minimality/policy-loader.js +1 -11
- package/dist/engine/model-tier-resolver.js +3 -11
- package/dist/engine/platform-detector/desktop.js +3 -13
- package/dist/engine/platform-detector/games.js +3 -13
- package/dist/engine/release-pipeline/release-spec-closer.d.ts +1 -0
- package/dist/engine/release-pipeline/release-spec-closer.js +1 -1
- package/dist/engine/safety/cross-process-lock.js +6 -21
- package/dist/engine/safety/lock-scavenger.d.ts +3 -1
- package/dist/engine/safety/lock-scavenger.js +3 -3
- package/dist/engine/score-to-grade.d.ts +2 -0
- package/dist/engine/score-to-grade.js +16 -0
- package/dist/engine/spec-grounding/contract.js +2 -1
- package/dist/engine/spec-grounding/grounding-entry-parser.d.ts +0 -1
- package/dist/engine/spec-grounding/grounding-entry-parser.js +1 -3
- package/dist/engine/telemetry/health-checker.js +2 -20
- package/dist/engine/telemetry/telemetry-client.d.ts +1 -0
- package/dist/engine/telemetry/telemetry-client.js +1 -1
- package/dist/engine/test-scaffold-generator/advanced-scaffold.js +1 -24
- package/dist/engine/token-optimizer/analytics.d.ts +1 -1
- package/dist/engine/token-optimizer/analytics.js +2 -22
- package/dist/engine/token-optimizer/policy-loader.js +1 -11
- package/dist/engine/validation-evidence-ledger.d.ts +1 -0
- package/dist/engine/validation-evidence-ledger.js +44 -3
- package/dist/engine/workers/handlers/code-map.js +4 -46
- package/dist/engine/workers/handlers/collect-files.d.ts +3 -0
- package/dist/engine/workers/handlers/collect-files.js +53 -0
- package/dist/engine/workers/handlers/documentation.js +4 -49
- package/dist/engine/workers/handlers/optimization.js +4 -46
- package/dist/engine/workers/handlers/security-audit.js +4 -45
- package/dist/hosts/codex/config-scaffold.js +1 -1
- package/dist/hosts/gemini/config-scaffold.js +1 -1
- package/dist/storage/spec-index.js +8 -3
- package/dist/storage/token-ledger-store.d.ts +1 -1
- package/dist/storage/token-ledger-store.js +2 -22
- package/dist/tools/audit.js +1 -15
- package/dist/tools/claude-settings-file.d.ts +3 -0
- package/dist/tools/claude-settings-file.js +19 -0
- package/dist/tools/create-spec/post-creation.d.ts +1 -1
- package/dist/tools/create-spec/post-creation.js +7 -49
- package/dist/tools/create-spec.js +1 -1
- package/dist/tools/facilitate.js +6 -6
- package/dist/tools/init-project/result-builder.js +4 -4
- package/dist/tools/reconcile-interactive-question-hooks.js +3 -18
- package/dist/tools/reconcile-session-safeguard-hook.js +3 -18
- package/dist/tools/reconcile-spec-sanctity-hook.js +4 -19
- package/dist/tools/safe-handler.js +1 -1
- package/dist/tools/status-handler.js +1 -1
- package/dist/tools/tool-registry/core-tools.js +3 -1
- package/dist/tools/update-status/evidence-payload.d.ts +180 -0
- package/dist/tools/update-status/evidence-payload.js +76 -0
- package/dist/tools/update-status/index.js +30 -0
- package/dist/tools/validate.js +2 -16
- package/dist/types/evidence-gates.d.ts +9 -0
- package/dist/types/lifecycle.d.ts +1 -10
- package/dist/types/spec/inputs.d.ts +2 -1
- package/dist/types/token-ledger.d.ts +1 -0
- package/dist/types/token-ledger.js +21 -1
- package/package.json +1 -1
- package/planu-plugin.json +14 -4
- package/src/i18n/messages/en.json +2 -2
- package/src/i18n/messages/es.json +2 -2
- package/src/i18n/messages/pt.json +2 -2
- package/dist/engine/detectors/cicd-detector.d.ts +0 -7
- package/dist/engine/detectors/cicd-detector.js +0 -170
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
## [5.7.23] - 2026-09-09
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
- fix(update-status): keep the evidence transport contract under the tools/list compactor budget
|
|
5
|
+
- fix(update-status): stop leaking internal artifact constraints in the evidence input schema
|
|
6
|
+
- fix(tool-registry): drop retired tool names from the registry and i18n descriptions
|
|
7
|
+
- fix(storage): report and resolve duplicate spec ids deterministically
|
|
8
|
+
- fix(evidence-gates): require a non-empty capability in receipt identities and simplify the test cast
|
|
9
|
+
- fix(evidence-gates): compare repository identity fields, not the full key, for command evidence
|
|
10
|
+
- fix(evidence-gates): split ledger receipt check and export readPassedValidationReceipt
|
|
11
|
+
- fix(scripts): fail local smoke when the server is killed by the timeout (SPEC-1827 B5)
|
|
12
|
+
- fix(cli): treat develop and release as optional mirrors in release check (SPEC-1827 B4)
|
|
13
|
+
- fix(config): name the host fallback for AskUserQuestion (SPEC-1827 B3)
|
|
14
|
+
- fix(tools): persist evidence payload through update_status (SPEC-1827 B1)
|
|
15
|
+
- fix(errors): resolve error-recovery registry from installed package (SPEC-1827 B2)
|
|
16
|
+
- fix(config): mirror the Gemini bullet and plugin manifest to real registries (SPEC-1826 G/H)
|
|
17
|
+
- fix(tools): rewrite nine runtime hints to name official tools (SPEC-1826 F)
|
|
18
|
+
- fix(config): point error-recovery rules at official tools (SPEC-1826 E)
|
|
19
|
+
- fix(config): describe the real git flow and approval gates (SPEC-1826 D)
|
|
20
|
+
- fix(tools): route facilitate and post-creation hints to official tools (SPEC-1826 B/C)
|
|
21
|
+
|
|
22
|
+
### Chores
|
|
23
|
+
- chore(planu): remove the re-created historical duplicate SPEC-766 folder
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [5.7.22] - 2026-09-09
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
- feat(tests): require an assertion in every vitest project
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
- fix(tools): stop exporting the internal-only claude settings path constant
|
|
33
|
+
|
|
34
|
+
### Refactoring
|
|
35
|
+
- refactor: extract shared isRecord and mergeDeep into core/shared/object.ts
|
|
36
|
+
- refactor: export readConventionsFile and reuse it in model tier resolver
|
|
37
|
+
- refactor: reuse readFileOrNull instead of duplicate tryReadFile helper
|
|
38
|
+
- refactor: share validate and loadSystem bodies between config loaders
|
|
39
|
+
- refactor: reuse shared getFrameworkExt and getFrameworkRunCommand helpers
|
|
40
|
+
- refactor: export resolveSpecDir and reuse it in release status drift
|
|
41
|
+
- refactor: extract shared scoreToGrade helper for audit and validate
|
|
42
|
+
- refactor: rename lock-scavenger metadata builder to shared lockMetadata
|
|
43
|
+
- refactor: extract shared parseTomlDependencies for gleam and alire toml
|
|
44
|
+
- refactor: reuse readPackageJson instead of the duplicate readPackageDeps
|
|
45
|
+
- refactor: share isValidTelemetryEndpoint between telemetry client and health checker
|
|
46
|
+
- refactor: extract shared claude settings file read/write helpers
|
|
47
|
+
- refactor: share emptyLedgerAggregation between analytics and ledger store
|
|
48
|
+
- refactor: route spec list subcommand through the shared list command
|
|
49
|
+
- refactor: extract shared collectFiles helper for worker handlers
|
|
50
|
+
- refactor(tests): rename type-only test files to test-d suffix
|
|
51
|
+
|
|
52
|
+
|
|
1
53
|
## [5.7.21] - 2026-09-09
|
|
2
54
|
|
|
3
55
|
### Bug Fixes
|
package/dist/.planu-build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":1,"commit":"
|
|
1
|
+
{"schemaVersion":1,"commit":"ce91ee7289dc55598ba5d20c4d6e63ce410a0fd1"}
|
|
@@ -3,7 +3,8 @@ import { execFile } from 'node:child_process';
|
|
|
3
3
|
import { promisify } from 'node:util';
|
|
4
4
|
import { green, red, yellow } from '../colors.js';
|
|
5
5
|
const execFileAsync = promisify(execFile);
|
|
6
|
-
const
|
|
6
|
+
const CANONICAL_BRANCH = 'main';
|
|
7
|
+
const MIRROR_BRANCHES = ['develop', 'release'];
|
|
7
8
|
export const releaseCommand = {
|
|
8
9
|
name: 'release',
|
|
9
10
|
description: 'Check lightweight release readiness',
|
|
@@ -39,16 +40,26 @@ async function checkReleaseReadiness(cwd) {
|
|
|
39
40
|
}
|
|
40
41
|
const head = (await git(cwd, ['rev-parse', 'HEAD'])).trim() || null;
|
|
41
42
|
const branches = {};
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
branches[CANONICAL_BRANCH] = await resolveRef(cwd, CANONICAL_BRANCH);
|
|
44
|
+
for (const mirror of MIRROR_BRANCHES) {
|
|
45
|
+
branches[mirror] = await resolveRef(cwd, mirror);
|
|
44
46
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (
|
|
50
|
-
problems.push('main
|
|
47
|
+
const mainRef = branches[CANONICAL_BRANCH];
|
|
48
|
+
if (mainRef === null) {
|
|
49
|
+
problems.push('main branch not found');
|
|
50
|
+
}
|
|
51
|
+
else if (mainRef !== head) {
|
|
52
|
+
problems.push('main is not at HEAD');
|
|
51
53
|
}
|
|
54
|
+
for (const mirror of MIRROR_BRANCHES) {
|
|
55
|
+
const ref = branches[mirror];
|
|
56
|
+
if (ref !== null && ref !== head) {
|
|
57
|
+
problems.push(`${mirror} mirror is not at HEAD`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const synced = head !== null &&
|
|
61
|
+
mainRef === head &&
|
|
62
|
+
MIRROR_BRANCHES.every((mirror) => branches[mirror] === null || branches[mirror] === head);
|
|
52
63
|
return { clean, synced, head, branches, problems };
|
|
53
64
|
}
|
|
54
65
|
async function resolveRef(cwd, branch) {
|
|
@@ -76,7 +87,9 @@ async function git(cwd, args) {
|
|
|
76
87
|
}
|
|
77
88
|
function writeReleaseCheck(result) {
|
|
78
89
|
if (result.clean && result.synced) {
|
|
79
|
-
|
|
90
|
+
const resolvedMirrors = MIRROR_BRANCHES.filter((mirror) => result.branches[mirror] !== null);
|
|
91
|
+
const mirrors = resolvedMirrors.length === 0 ? '' : ` with mirrors ${resolvedMirrors.join(', ')}`;
|
|
92
|
+
process.stdout.write(`${green('Release ready.')} main matches HEAD${mirrors}.\n`);
|
|
80
93
|
return;
|
|
81
94
|
}
|
|
82
95
|
process.stdout.write(`${yellow('Release not ready.')}\n`);
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import { parseArgs } from 'node:util';
|
|
10
10
|
import { resolve } from 'node:path';
|
|
11
11
|
import { handleCreateSpec } from '../../tools/create-spec.js';
|
|
12
|
-
import { handleListSpecs } from '../../tools/list-specs.js';
|
|
13
12
|
import { handleUpdateStatus } from '../../tools/update-status.js';
|
|
14
13
|
import { handleUpdateStatusBatch } from '../../tools/update-status/batch.js';
|
|
15
14
|
import { handleValidate } from '../../tools/validate.js';
|
|
@@ -17,6 +16,7 @@ import { formatToolResult, writeCliResult } from '../formatter.js';
|
|
|
17
16
|
import { detectProjectId } from '../project-detector.js';
|
|
18
17
|
import { bold, cyan, red, dim } from '../colors.js';
|
|
19
18
|
import { SINGLE_STATUS_PARSE_OPTIONS, buildSingleStatusInput } from './status.js';
|
|
19
|
+
import { listCommand } from './list.js';
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
// Helpers
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
@@ -110,36 +110,6 @@ async function runCreate(args, flags) {
|
|
|
110
110
|
writeCliResult(result, flags, 'Spec created!');
|
|
111
111
|
}
|
|
112
112
|
// ---------------------------------------------------------------------------
|
|
113
|
-
// Subcommand: spec list
|
|
114
|
-
// ---------------------------------------------------------------------------
|
|
115
|
-
async function runList(args, flags) {
|
|
116
|
-
const { values } = parseArgs({
|
|
117
|
-
args,
|
|
118
|
-
options: {
|
|
119
|
-
status: { type: 'string', short: 's' },
|
|
120
|
-
type: { type: 'string', short: 't' },
|
|
121
|
-
'project-id': { type: 'string' },
|
|
122
|
-
},
|
|
123
|
-
strict: false,
|
|
124
|
-
allowPositionals: true,
|
|
125
|
-
});
|
|
126
|
-
const projectId = values['project-id'] ?? detectProjectId();
|
|
127
|
-
const result = await handleListSpecs({
|
|
128
|
-
projectId,
|
|
129
|
-
status: values.status,
|
|
130
|
-
type: values.type,
|
|
131
|
-
});
|
|
132
|
-
if (result.isError) {
|
|
133
|
-
process.stderr.write(`${red(formatToolResult(result, flags))}\n`);
|
|
134
|
-
process.exitCode = 1;
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
const output = formatToolResult(result, flags);
|
|
138
|
-
if (output) {
|
|
139
|
-
process.stdout.write(output + '\n');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
// ---------------------------------------------------------------------------
|
|
143
113
|
// Subcommand: spec show
|
|
144
114
|
// ---------------------------------------------------------------------------
|
|
145
115
|
async function runShow(args, flags) {
|
|
@@ -257,7 +227,7 @@ export const specCommand = {
|
|
|
257
227
|
await runCreate(rest, flags);
|
|
258
228
|
break;
|
|
259
229
|
case 'list':
|
|
260
|
-
await
|
|
230
|
+
await listCommand.run(rest, flags);
|
|
261
231
|
break;
|
|
262
232
|
case 'show':
|
|
263
233
|
await runShow(rest, flags);
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"what": "Permission denied",
|
|
20
20
|
"why": "Planu cannot read or write the requested path.",
|
|
21
21
|
"nextAction": {
|
|
22
|
-
"tool": "
|
|
22
|
+
"tool": "planu_status",
|
|
23
23
|
"args": {},
|
|
24
|
-
"rationale": "
|
|
24
|
+
"rationale": "No Planu tool can change filesystem permissions: fix them in the shell, then call planu_status with projectPath to confirm the project loads before retrying."
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"what": "Resource temporarily unavailable",
|
|
31
31
|
"why": "The file or socket is busy. This is usually transient.",
|
|
32
32
|
"nextAction": {
|
|
33
|
-
"tool": "
|
|
33
|
+
"tool": "planu_status",
|
|
34
34
|
"args": {},
|
|
35
|
-
"rationale": "
|
|
35
|
+
"rationale": "The resource is temporarily busy: wait a moment, call planu_status with projectPath to confirm the project still loads, then retry the original call."
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
{
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"what": "Connection refused",
|
|
42
42
|
"why": "The remote service is not accepting connections.",
|
|
43
43
|
"nextAction": {
|
|
44
|
-
"tool": "
|
|
44
|
+
"tool": "planu_status",
|
|
45
45
|
"args": {},
|
|
46
|
-
"rationale": "
|
|
46
|
+
"rationale": "No Planu tool can start an external service: start it, then call planu_status with projectPath to confirm the project loads before retrying the integration."
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
{
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"what": "Operation timed out",
|
|
53
53
|
"why": "The request exceeded the allowed execution time.",
|
|
54
54
|
"nextAction": {
|
|
55
|
-
"tool": "
|
|
55
|
+
"tool": "get_job",
|
|
56
56
|
"args": {},
|
|
57
|
-
"rationale": "
|
|
57
|
+
"rationale": "If the timed-out call returned an operationId, poll it with get_job (operationId plus projectPath) instead of re-issuing the call; otherwise retry once."
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"what": "Resource is locked",
|
|
64
64
|
"why": "Another session or agent holds a lock on this spec.",
|
|
65
65
|
"nextAction": {
|
|
66
|
-
"tool": "
|
|
66
|
+
"tool": "planu_status",
|
|
67
67
|
"args": {},
|
|
68
|
-
"rationale": "
|
|
68
|
+
"rationale": "Another session holds the lock: call planu_status with projectPath to see the active spec, then wait or coordinate before retrying."
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
{
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"what": "Version conflict detected",
|
|
75
75
|
"why": "The spec version in your request does not match the current version.",
|
|
76
76
|
"nextAction": {
|
|
77
|
-
"tool": "
|
|
77
|
+
"tool": "list_specs",
|
|
78
78
|
"args": {},
|
|
79
|
-
"rationale": "
|
|
79
|
+
"rationale": "Reload the specs from disk with list_specs and repeat the request against the state it returns."
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"what": "Schema validation failed",
|
|
86
86
|
"why": "The provided data does not conform to the expected schema.",
|
|
87
87
|
"nextAction": {
|
|
88
|
-
"tool": "
|
|
88
|
+
"tool": "facilitate",
|
|
89
89
|
"args": {},
|
|
90
|
-
"rationale": "
|
|
90
|
+
"rationale": "Call facilitate with description set to what you were trying to do: it recommends which Planu tool fits the request."
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
{
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"match": { "code": "RUNTIME_SCHEMA_AHEAD" },
|
|
96
96
|
"what": "Runtime store schema is newer than this server supports",
|
|
97
97
|
"nextAction": {
|
|
98
|
-
"tool": "
|
|
98
|
+
"tool": "planu_status",
|
|
99
99
|
"args": {},
|
|
100
|
-
"rationale": "Restart the MCP server so it loads the current dist
|
|
100
|
+
"rationale": "Restart the MCP server so it loads the current dist, then call planu_status with projectPath to confirm it answers before retrying."
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
{
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"match": { "code": "LOCK_SCHEMA_AHEAD" },
|
|
106
106
|
"what": "Lock store schema is newer than this server supports",
|
|
107
107
|
"nextAction": {
|
|
108
|
-
"tool": "
|
|
108
|
+
"tool": "planu_status",
|
|
109
109
|
"args": {},
|
|
110
|
-
"rationale": "Restart the MCP server so it loads the current dist
|
|
110
|
+
"rationale": "Restart the MCP server so it loads the current dist, then call planu_status with projectPath to confirm it answers before retrying."
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
]
|
|
@@ -81,6 +81,38 @@
|
|
|
81
81
|
"generate_orchestration_plan",
|
|
82
82
|
"capture_idea",
|
|
83
83
|
"log_lesson",
|
|
84
|
-
"security_scan"
|
|
84
|
+
"security_scan",
|
|
85
|
+
"ai_ecosystem_status",
|
|
86
|
+
"apply_template",
|
|
87
|
+
"branch_spec",
|
|
88
|
+
"configure_telemetry",
|
|
89
|
+
"define_ui_contract",
|
|
90
|
+
"delete_spec",
|
|
91
|
+
"design_schema",
|
|
92
|
+
"detect_contradictions",
|
|
93
|
+
"detect_drift",
|
|
94
|
+
"federate_specs",
|
|
95
|
+
"federation_status",
|
|
96
|
+
"generate_adr",
|
|
97
|
+
"generate_checklist",
|
|
98
|
+
"generate_docs",
|
|
99
|
+
"generate_execution_plan",
|
|
100
|
+
"generate_planu_ci",
|
|
101
|
+
"inject_component_context",
|
|
102
|
+
"list_locks",
|
|
103
|
+
"manage_git",
|
|
104
|
+
"merge_spec_branch",
|
|
105
|
+
"reality_check",
|
|
106
|
+
"scan_project",
|
|
107
|
+
"search_specs",
|
|
108
|
+
"security_check",
|
|
109
|
+
"session_handoff",
|
|
110
|
+
"set_locale",
|
|
111
|
+
"skill_install",
|
|
112
|
+
"sync_ai_configs",
|
|
113
|
+
"sync_spec_state",
|
|
114
|
+
"verify_integrations",
|
|
115
|
+
"verify_versions",
|
|
116
|
+
"workspace_alerts"
|
|
85
117
|
]
|
|
86
118
|
}
|
|
@@ -58,34 +58,30 @@ export const SERVER_INSTRUCTIONS = [
|
|
|
58
58
|
'',
|
|
59
59
|
'INTERACTIVE QUESTIONS — HARD GATE enforcement (SPEC-584):',
|
|
60
60
|
'GENERAL RULE: Whenever you would ask the user ANY question — follow-up after a tool call, clarification,',
|
|
61
|
-
'"what do you want to do next?", or any decision — you MUST
|
|
62
|
-
'
|
|
61
|
+
'"what do you want to do next?", or any decision — you MUST present it as a structured choice with 2-4 options.',
|
|
62
|
+
'In Claude Code that means AskUserQuestion. In hosts without AskUserQuestion (Codex, Gemini CLI, Cursor,',
|
|
63
|
+
'Windsurf) present the same options as a numbered list, mark the recommended one, and wait for the answer',
|
|
64
|
+
'before any other action. NEVER write an open-ended question as plain prose.',
|
|
63
65
|
'When ANY tool response includes structuredContent.interactiveQuestions[]:',
|
|
64
|
-
'-
|
|
65
|
-
'- Map each interactiveQuestion to
|
|
66
|
-
'- Do NOT summarize or paraphrase the question. Relay it verbatim
|
|
66
|
+
'- Relay it immediately through AskUserQuestion, or the numbered-list fallback in hosts without it.',
|
|
67
|
+
'- Map each interactiveQuestion to the prompt: use question as the prompt, options[].label as the choices.',
|
|
68
|
+
'- Do NOT summarize or paraphrase the question. Relay it verbatim.',
|
|
67
69
|
'- Do NOT continue with any other action until the user answers.',
|
|
68
70
|
'- After the user answers, retry the same tool with clarificationAnswers: { <questionKey>: <selectedLabel>, ... }.',
|
|
69
71
|
'- WARNING: Calling a tool again WITHOUT clarificationAnswers when a pending clarification exists returns isError: true.',
|
|
70
72
|
' The server will block the call until you provide answers. There is no way to bypass this gate.',
|
|
71
73
|
'',
|
|
72
|
-
'GIT WORKFLOW
|
|
73
|
-
'- Planu
|
|
74
|
-
|
|
75
|
-
'- The base branch is fetched and updated before creating the feature branch — no manual git pull needed.',
|
|
76
|
-
'- If there are uncommitted changes, Planu warns instead of risking data loss.',
|
|
77
|
-
'- Use manage_git with action "auto-setup" to manually trigger branch setup for an existing spec.',
|
|
78
|
-
'- Available git actions: create-branch, generate-pr, link-commits, generate-changelog, setup-hooks, check-branch, status, sync-branch, check-gitflow, resolve-conflict, breaking-check, release, hotfix, promote, auto-setup.',
|
|
79
|
-
'- Branch naming convention: feat/SPEC-XXX-short-name for features, fix/SPEC-XXX-short-name for fixes.',
|
|
80
|
-
'- Explain why: "Working in a separate branch keeps your main code safe while you build this feature. When it is ready, you merge it back."',
|
|
74
|
+
'GIT WORKFLOW:',
|
|
75
|
+
'- When a spec is created, Planu queues a git-setup task that creates feat/SPEC-XXX-short-name (or fix/…) from the detected base branch without touching the working tree; if the branch cannot be created the task records why and the spec is still usable.',
|
|
76
|
+
"- There is no git tool in the MCP surface: commit, push and merge with your host's git commands, and mention the spec ID in commit messages.",
|
|
81
77
|
'',
|
|
82
78
|
'SPEC APPROVAL FLOW — MANDATORY after every create_spec:',
|
|
83
|
-
'-
|
|
84
|
-
'-
|
|
85
|
-
'- If the user
|
|
86
|
-
'-
|
|
87
|
-
'-
|
|
88
|
-
'-
|
|
79
|
+
'- Present a clear summary and ask whether the user approves the spec or has observations.',
|
|
80
|
+
'- Before approval run challenge_spec and check_readiness, and record independent planu-spec-reviewer evidence; update_status enforces these gates and refuses to approve without them.',
|
|
81
|
+
'- If the user APPROVES: call update_status with status="review", then status="approved" with modelTierUsed="max".',
|
|
82
|
+
'- If the user has OBSERVATIONS: call update_status with status="draft" and their feedback in reviewNotes, revise, and ask again.',
|
|
83
|
+
'- NEVER start implementing before the spec is approved; the spec is the contract.',
|
|
84
|
+
'- When creating several specs, present all of them and let the user approve or reject each one.',
|
|
89
85
|
'',
|
|
90
86
|
'RESPONSE FORMAT — MANDATORY for all tool results:',
|
|
91
87
|
'- NEVER show raw JSON.stringify output to the user — always format as readable markdown',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: planu-release
|
|
3
|
-
description:
|
|
3
|
+
description: Release with Planu — runs the local gates and, with --publish, bumps, tags and publishes through the canonical release orchestrator.
|
|
4
4
|
triggers:
|
|
5
5
|
- let's release
|
|
6
6
|
- create a release
|
|
@@ -32,7 +32,7 @@ Use this skill when all done specs are merged to main and you want to publish a
|
|
|
32
32
|
1. **Check state** — calls `planu_status` to confirm no specs are `implementing` or `review`
|
|
33
33
|
2. **Determine version bump** — analyzes commits since last release: `feat` → minor, `fix` → patch, breaking changes → major
|
|
34
34
|
3. **Run the local gate** — run `pnpm check:preflight` and fix anything it flags
|
|
35
|
-
4. **Release** — run `pnpm release:local
|
|
35
|
+
4. **Release** — run `pnpm release:local` to rerun the local gates (typecheck, lint, build, tests, dist smoke); it does not bump, tag or publish. To publish, run `pnpm release:local --publish`, which delegates to `scripts/release.sh` (version bump, CHANGELOG entry, tag, npm publish, push).
|
|
36
36
|
5. **Confirm** — reports the published version and npm URL
|
|
37
37
|
|
|
38
38
|
## Usage
|
|
@@ -42,7 +42,7 @@ User: "let's release"
|
|
|
42
42
|
→ Planu: "3 specs done since last release. Suggested bump: minor (v1.5.0 → v1.6.0).
|
|
43
43
|
Changelog: [preview]. Proceed?"
|
|
44
44
|
→ User: confirms
|
|
45
|
-
→ Planu:
|
|
45
|
+
→ Planu: runs pnpm release:local --publish and reports the published version
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Notes
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"tools": {
|
|
37
37
|
"groups": {
|
|
38
38
|
"spec": ["create_spec", "check_readiness", "challenge_spec", "update_status"],
|
|
39
|
-
"handoff": ["package_handoff"
|
|
39
|
+
"handoff": ["package_handoff"],
|
|
40
40
|
"status": ["planu_status", "session_checkpoint"],
|
|
41
41
|
"token": ["token_intelligence", "tokens", "context_budget"]
|
|
42
42
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function isRecord(value) {
|
|
2
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
|
+
}
|
|
4
|
+
export function mergeDeep(base, override) {
|
|
5
|
+
const result = { ...base };
|
|
6
|
+
for (const [key, value] of Object.entries(override)) {
|
|
7
|
+
const current = result[key];
|
|
8
|
+
result[key] = isRecord(current) && isRecord(value) ? mergeDeep(current, value) : value;
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -23,6 +23,26 @@ import { join, dirname } from 'node:path';
|
|
|
23
23
|
import { fileURLToPath } from 'node:url';
|
|
24
24
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
const DATA_DIR = join(__dirname, '..', '..', 'data');
|
|
26
|
+
function validateConfig(schema, area, data) {
|
|
27
|
+
const result = schema.safeParse(data);
|
|
28
|
+
if (result.success) {
|
|
29
|
+
return result.data;
|
|
30
|
+
}
|
|
31
|
+
const details = formatZodError(result.error);
|
|
32
|
+
throw new Error(`Invalid ${area} config: ${details}`);
|
|
33
|
+
}
|
|
34
|
+
function loadSystemConfig(require, area, validate) {
|
|
35
|
+
try {
|
|
36
|
+
const raw = require(`../config/${area}.json`);
|
|
37
|
+
return validate(raw);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
if (err instanceof Error && err.message.includes('Invalid')) {
|
|
41
|
+
throw err;
|
|
42
|
+
}
|
|
43
|
+
throw new Error(`System config not found: src/config/${area}.json`, { cause: err });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
26
46
|
/**
|
|
27
47
|
* Canonical 3-layer configuration loader.
|
|
28
48
|
*
|
|
@@ -64,27 +84,13 @@ export class ConfigLoader {
|
|
|
64
84
|
* a descriptive error with the exact path of the invalid field.
|
|
65
85
|
*/
|
|
66
86
|
validate(data) {
|
|
67
|
-
|
|
68
|
-
if (result.success) {
|
|
69
|
-
return result.data;
|
|
70
|
-
}
|
|
71
|
-
const details = formatZodError(result.error);
|
|
72
|
-
throw new Error(`Invalid ${this.area} config: ${details}`);
|
|
87
|
+
return validateConfig(this.schema, this.area, data);
|
|
73
88
|
}
|
|
74
89
|
/**
|
|
75
90
|
* Load only system defaults (src/config/{area}.json).
|
|
76
91
|
*/
|
|
77
92
|
loadSystem() {
|
|
78
|
-
|
|
79
|
-
const raw = this.require(`../config/${this.area}.json`);
|
|
80
|
-
return this.validate(raw);
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
if (err instanceof Error && err.message.includes('Invalid')) {
|
|
84
|
-
throw err;
|
|
85
|
-
}
|
|
86
|
-
throw new Error(`System config not found: src/config/${this.area}.json`, { cause: err });
|
|
87
|
-
}
|
|
93
|
+
return loadSystemConfig(this.require, this.area, (raw) => this.validate(raw));
|
|
88
94
|
}
|
|
89
95
|
// -----------------------------------------------------------------------
|
|
90
96
|
// Private helpers
|
|
@@ -183,25 +189,11 @@ export class ObjectConfigLoader {
|
|
|
183
189
|
}
|
|
184
190
|
/** Validate raw data against the schema. */
|
|
185
191
|
validate(data) {
|
|
186
|
-
|
|
187
|
-
if (result.success) {
|
|
188
|
-
return result.data;
|
|
189
|
-
}
|
|
190
|
-
const details = formatZodError(result.error);
|
|
191
|
-
throw new Error(`Invalid ${this.area} config: ${details}`);
|
|
192
|
+
return validateConfig(this.schema, this.area, data);
|
|
192
193
|
}
|
|
193
194
|
/** Load system defaults. */
|
|
194
195
|
loadSystem() {
|
|
195
|
-
|
|
196
|
-
const raw = this.require(`../config/${this.area}.json`);
|
|
197
|
-
return this.validate(raw);
|
|
198
|
-
}
|
|
199
|
-
catch (err) {
|
|
200
|
-
if (err instanceof Error && err.message.includes('Invalid')) {
|
|
201
|
-
throw err;
|
|
202
|
-
}
|
|
203
|
-
throw new Error(`System config not found: src/config/${this.area}.json`, { cause: err });
|
|
204
|
-
}
|
|
196
|
+
return loadSystemConfig(this.require, this.area, (raw) => this.validate(raw));
|
|
205
197
|
}
|
|
206
198
|
loadFileSync(filePath) {
|
|
207
199
|
try {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ScannedConventions } from '../types/index.js';
|
|
2
|
+
export declare function readConventionsFile(projectPath: string): Promise<ScannedConventions | null>;
|
|
1
3
|
/**
|
|
2
4
|
* SPEC-665: Check if conventions.json TTL is expired and trigger a background re-fetch.
|
|
3
5
|
* Fire-and-forget — never blocks the caller. Silent failure on any error.
|
|
@@ -4,7 +4,7 @@ import { readFile, writeFile, mkdir, appendFile } from 'node:fs/promises';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
const TTL_DAYS = 7;
|
|
6
6
|
const MS_PER_DAY = 86_400_000;
|
|
7
|
-
async function readConventionsFile(projectPath) {
|
|
7
|
+
export async function readConventionsFile(projectPath) {
|
|
8
8
|
try {
|
|
9
9
|
const raw = await readFile(join(projectPath, 'planu', 'conventions.json'), 'utf-8');
|
|
10
10
|
return JSON.parse(raw);
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { GleamLibraryGroups, CrystalLibraryGroups, NimLibraryGroups, ZigLibraryGroups } from '../../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Parse gleam.toml [dependencies] section.
|
|
4
|
-
* Matches `name = "version"` lines.
|
|
5
|
-
*/
|
|
6
|
-
export declare function parseGleamToml(content: string): Set<string>;
|
|
7
2
|
/**
|
|
8
3
|
* Parse shard.yml dependencies section.
|
|
9
4
|
* Matches top-level package names under `dependencies:` key.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { glob } from 'glob';
|
|
6
|
+
import { parseTomlDependencies } from './toml-dependencies.js';
|
|
6
7
|
// === Catalog constants ===
|
|
7
8
|
const GLEAM_WEB_LIBS = ['gleam_http', 'mist', 'wisp'];
|
|
8
9
|
const GLEAM_TESTING_LIBS = ['gleeunit', 'gleam_stdlib'];
|
|
@@ -24,25 +25,10 @@ function filterPresent(catalog, deps) {
|
|
|
24
25
|
* Parse gleam.toml [dependencies] section.
|
|
25
26
|
* Matches `name = "version"` lines.
|
|
26
27
|
*/
|
|
27
|
-
export function parseGleamToml(content) {
|
|
28
|
-
const deps = new Set();
|
|
29
|
-
const sectionMatch = /\[dependencies\]([\s\S]*?)(?:\n\[|$)/s.exec(content);
|
|
30
|
-
if (sectionMatch?.[1]) {
|
|
31
|
-
const matches = sectionMatch[1].matchAll(/^([a-zA-Z0-9_-]+)\s*=/gm);
|
|
32
|
-
for (const match of matches) {
|
|
33
|
-
/* v8 ignore start */
|
|
34
|
-
if (match[1]) {
|
|
35
|
-
/* v8 ignore stop */
|
|
36
|
-
deps.add(match[1]);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return deps;
|
|
41
|
-
}
|
|
42
28
|
async function collectGleamDeps(projectPath) {
|
|
43
29
|
try {
|
|
44
30
|
const content = await readFile(join(projectPath, 'gleam.toml'), 'utf-8');
|
|
45
|
-
return
|
|
31
|
+
return parseTomlDependencies(content);
|
|
46
32
|
}
|
|
47
33
|
catch {
|
|
48
34
|
return new Set();
|
|
@@ -8,7 +8,6 @@ export declare function parseVMod(content: string): Set<string>;
|
|
|
8
8
|
* Parse alire.toml dependencies block.
|
|
9
9
|
* Matches `name = { version = "..." }` entries.
|
|
10
10
|
*/
|
|
11
|
-
export declare function parseAlireToml(content: string): Set<string>;
|
|
12
11
|
/**
|
|
13
12
|
* Determine ColdFusion server type by checking config filenames.
|
|
14
13
|
*/
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { glob } from 'glob';
|
|
6
|
+
import { parseTomlDependencies } from './toml-dependencies.js';
|
|
6
7
|
// === Helpers ===
|
|
7
8
|
async function globFiles(pattern, projectPath) {
|
|
8
9
|
try {
|
|
@@ -46,21 +47,6 @@ export function parseVMod(content) {
|
|
|
46
47
|
* Parse alire.toml dependencies block.
|
|
47
48
|
* Matches `name = { version = "..." }` entries.
|
|
48
49
|
*/
|
|
49
|
-
export function parseAlireToml(content) {
|
|
50
|
-
const deps = new Set();
|
|
51
|
-
const sectionMatch = /\[dependencies\]([\s\S]*?)(?:\n\[|$)/s.exec(content);
|
|
52
|
-
if (sectionMatch?.[1]) {
|
|
53
|
-
const matches = sectionMatch[1].matchAll(/^([a-zA-Z0-9_-]+)\s*=/gm);
|
|
54
|
-
for (const match of matches) {
|
|
55
|
-
/* v8 ignore start */
|
|
56
|
-
if (match[1]) {
|
|
57
|
-
/* v8 ignore stop */
|
|
58
|
-
deps.add(match[1]);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return deps;
|
|
63
|
-
}
|
|
64
50
|
// === ColdFusion server detection ===
|
|
65
51
|
/**
|
|
66
52
|
* Determine ColdFusion server type by checking config filenames.
|
|
@@ -109,7 +95,7 @@ export async function detectAdaProject(projectPath) {
|
|
|
109
95
|
let packages = [];
|
|
110
96
|
try {
|
|
111
97
|
const alireContent = await readFile(join(projectPath, 'alire.toml'), 'utf-8');
|
|
112
|
-
packages = [...
|
|
98
|
+
packages = [...parseTomlDependencies(alireContent)];
|
|
113
99
|
}
|
|
114
100
|
catch {
|
|
115
101
|
// no alire.toml — that's fine
|