@planu/cli 8.7.2 → 8.8.0
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 +12 -0
- package/README.md +8 -4
- package/dist/sdd-engine/canonical-tools.d.ts +31 -0
- package/dist/sdd-engine/canonical-tools.js +48 -0
- package/dist/sdd-engine/feature-manifest.js +1 -1
- package/dist/sdd-engine/host-rule-pack.d.ts +7 -3
- package/dist/sdd-engine/host-rule-pack.js +26 -52
- package/dist/sdd-engine/host-skill-reader.d.ts +3 -2
- package/dist/sdd-engine/host-skill-reader.js +49 -1
- package/dist/sdd-engine/tools/execution-tools.js +12 -53
- package/dist/sdd-engine/tools/workspace-tools.js +8 -18
- package/dist/sdd-engine/trinity-structure.js +1 -1
- package/dist/sdd-engine/verification-receipts.d.ts +3 -2
- package/dist/sdd-engine/verification-receipts.js +50 -1
- package/dist/types/resume-views.d.ts +41 -0
- package/package.json +2 -2
- package/templates/AGENTS.md +2 -0
- package/templates/host/planu-sdd.md +2 -0
- package/templates/skills/preflight-guardian.md +2 -0
- package/templates/skills/spec-executor.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [8.8.0]
|
|
2
|
+
|
|
3
|
+
- Add a version 1 server implementation capability descriptor to setup diagnostics for supported views and observations.
|
|
4
|
+
- Advertise read-only hints for four of the nine existing tools; preserve their input schemas and existing execution authority.
|
|
5
|
+
- Treat missing or unknown descriptor versions as unsupported, without mutation probes. Installed files do not verify the host catalogue; refreshing that catalogue is separate from restarting MCP.
|
|
6
|
+
|
|
7
|
+
## [8.7.3]
|
|
8
|
+
|
|
9
|
+
- Run the complete strict quality stage before build and tests in `validate`.
|
|
10
|
+
- Run local check and dead-code gates before mandatory dependency freshness, build and tests in the pre-push hook.
|
|
11
|
+
- Preserve all existing gates, build prerequisites, dependencies and verification budgets.
|
|
12
|
+
|
|
1
13
|
## [8.7.2]
|
|
2
14
|
|
|
3
15
|
- Use the exact repository Node pin for development verification; reject invalid or mismatched runtimes before fixture preparation.
|
package/README.md
CHANGED
|
@@ -132,6 +132,8 @@ This is role guidance, not a runtime dispatcher or a guarantee that a host loads
|
|
|
132
132
|
|
|
133
133
|
Normal task verification still has a 180000 ms limit. An operator may authorize one pinned task in an isolated Darwin/Linux server with a strict startup-only budget of 180001–600000 ms. The grant binds the canonical workspace, feature, task, raw lock SHA-256 and exact command SHA-256. It is consumed before the first spawn, including failed attempts; uncertain cleanup or persistence quarantines that feature.
|
|
134
134
|
|
|
135
|
+
Before optional views or observations, inspect `sdd_list_features` setup diagnostics and require a recognized `engineCapabilities.version=1` and the relevant advertised value. An absent or unknown version means unsupported; never probe a mutation or fall back to lock/relock to discover support. The descriptor describes server implementation, not host catalogue activation, filesystem eligibility, a grant or certification. Host catalogue refresh remains separate from restarting MCP.
|
|
136
|
+
|
|
135
137
|
Explicit `verification_preflight` and `resume` views expose `budget.version=1` with admission, reason and effective timeout when available. This read-only observation is not a reservation: state may change, and completion revalidates and consumes any matching grant before spawning.
|
|
136
138
|
|
|
137
139
|
Completion can expose `verificationProcess` after a spawned verification, including timeout, cancellation, exit and cleanup evidence. Its `cleanupScope` is `owned_process_group`; `fixturePostconditions` remains `unknown`. Group cleanup does not prove fixture-owned state is safe. Reconcile uncertain attempts before retrying.
|
|
@@ -142,14 +144,14 @@ The reviewed operator procedure is in the repository guide `docs/verification-bu
|
|
|
142
144
|
|
|
143
145
|
## Read-only diagnostics
|
|
144
146
|
|
|
145
|
-
The existing nine tools expose additive diagnostics since 8.4.0; 8.5.0 adds compact resume and history views, and 8.6.0 adds bounded execution views and explicit evidence checkpoints. 8.7.0 adds advisory budget observations and verification process evidence. An ordinary `sdd_get_active_task` request keeps its previous response shape.
|
|
147
|
+
The existing nine tools expose additive diagnostics since 8.4.0; 8.5.0 adds compact resume and history views, and 8.6.0 adds bounded execution views and explicit evidence checkpoints. 8.7.0 adds advisory budget observations and verification process evidence. 8.8.0 adds the server implementation capability descriptor version 1 to setup diagnostics. An ordinary `sdd_get_active_task` request keeps its previous response shape.
|
|
146
148
|
|
|
147
149
|
`sdd_list_features` includes `hostSkills`. For example, a missing installed role can produce this field (other installed files match the available bundled reference):
|
|
148
150
|
|
|
149
151
|
```json
|
|
150
152
|
{
|
|
151
153
|
"version": 1,
|
|
152
|
-
"bundledVersion": "8.
|
|
154
|
+
"bundledVersion": "8.8.0",
|
|
153
155
|
"baseline": "available",
|
|
154
156
|
"catalog": "unverified",
|
|
155
157
|
"issues": [{
|
|
@@ -309,6 +311,8 @@ Effective MODIFY (including CREATE with a nonempty search) requires a regular si
|
|
|
309
311
|
|
|
310
312
|
`sdd_init_workspace`, `sdd_list_features`, `sdd_create_feature`, `sdd_lock_spec`, `sdd_read_spec_artifact`, `sdd_read_file_slice`, `sdd_get_active_task`, `sdd_apply_file_patch`, `sdd_complete_task`
|
|
311
313
|
|
|
314
|
+
`tools/list` marks `sdd_list_features`, `sdd_read_spec_artifact`, `sdd_read_file_slice`, and `sdd_get_active_task` with `readOnlyHint: true`; the other five registrations have `readOnlyHint: false`. A hint describes the registration, not host catalogue activation or permission to read a particular file.
|
|
315
|
+
|
|
312
316
|
Deleted: `create_spec`, `challenge_spec`, `check_readiness`, `validate`, `planu_status`, `update_status`, `init_project`, `package_handoff`.
|
|
313
317
|
|
|
314
318
|
---
|
|
@@ -351,7 +355,7 @@ pnpm validate
|
|
|
351
355
|
|
|
352
356
|
`verifyDepsBeforeRun: error` makes `pnpm run`, shorthand scripts and `pnpm exec` reject missing or stale installations instead of installing implicitly. After an authorized declaration or lock change, reconcile the reviewed files and run the explicit frozen installation; do not bypass the policy or substitute the TypeScript 6 library for the TypeScript 7 build compiler.
|
|
353
357
|
|
|
354
|
-
For an agent maintenance loop, read the active locked task, make only its manifest-authorized changes, run its exact verification command, review the evidence and let the parent certify. Before pushing, the existing hook runs
|
|
358
|
+
For an agent maintenance loop, read the active locked task, make only its manifest-authorized changes, run its exact verification command, review the evidence and let the parent certify. The `validate` script runs `check:strict`, then `build`, then `test`. Before pushing, the existing hook runs `check`, `audit:deadcode`, `check:deps:fresh`, `build:ts`, and `test` in that order; freshness remains mandatory. Pre-commit inspects only changed dependency declarations and their attributable direct-root advisories; it performs no installation.
|
|
355
359
|
|
|
356
360
|
`pnpm check:deps:fresh` exits 0 for complete current evidence, 1 for stable direct dependency drift, or 3 when registry, installed-state, process or metadata evidence is unavailable. It compares installed versions with published stable latest, including exact pins and npm aliases. Only the declared `@types/node` branch stays on the greatest stable 22.x version; a global newer major does not replace that branch, while a new 22.x patch is drift. Keep release-age settings unchanged and retain unavailable evidence instead of treating it as current.
|
|
357
361
|
|
|
@@ -380,7 +384,7 @@ See the [Planu Proprietary Free-Use License](LICENSE) and [planu.dev/license](ht
|
|
|
380
384
|
"mcpServers": {
|
|
381
385
|
"planu": {
|
|
382
386
|
"command": "npx",
|
|
383
|
-
"args": ["-y", "@planu/cli@8.
|
|
387
|
+
"args": ["-y", "@planu/cli@8.8.0"],
|
|
384
388
|
"cwd": ".",
|
|
385
389
|
"env": {
|
|
386
390
|
"PLANU_WORKSPACE": "."
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
+
import type { EngineCapabilitiesV1 } from '../types/resume-views.js';
|
|
1
2
|
export declare const CANONICAL_SDD_TOOL_NAMES: readonly ['sdd_init_workspace', 'sdd_list_features', 'sdd_create_feature', 'sdd_lock_spec', 'sdd_read_spec_artifact', 'sdd_read_file_slice', 'sdd_get_active_task', 'sdd_apply_file_patch', 'sdd_complete_task'];
|
|
3
|
+
export declare const ENGINE_CAPABILITIES: EngineCapabilitiesV1;
|
|
4
|
+
export declare const TOOL_ANNOTATIONS: Readonly<{
|
|
5
|
+
sdd_init_workspace: Readonly<{
|
|
6
|
+
readOnlyHint: false;
|
|
7
|
+
}>;
|
|
8
|
+
sdd_list_features: Readonly<{
|
|
9
|
+
readOnlyHint: true;
|
|
10
|
+
}>;
|
|
11
|
+
sdd_create_feature: Readonly<{
|
|
12
|
+
readOnlyHint: false;
|
|
13
|
+
}>;
|
|
14
|
+
sdd_lock_spec: Readonly<{
|
|
15
|
+
readOnlyHint: false;
|
|
16
|
+
}>;
|
|
17
|
+
sdd_read_spec_artifact: Readonly<{
|
|
18
|
+
readOnlyHint: true;
|
|
19
|
+
}>;
|
|
20
|
+
sdd_read_file_slice: Readonly<{
|
|
21
|
+
readOnlyHint: true;
|
|
22
|
+
}>;
|
|
23
|
+
sdd_get_active_task: Readonly<{
|
|
24
|
+
readOnlyHint: true;
|
|
25
|
+
}>;
|
|
26
|
+
sdd_apply_file_patch: Readonly<{
|
|
27
|
+
readOnlyHint: false;
|
|
28
|
+
}>;
|
|
29
|
+
sdd_complete_task: Readonly<{
|
|
30
|
+
readOnlyHint: false;
|
|
31
|
+
}>;
|
|
32
|
+
}>;
|
|
2
33
|
//# sourceMappingURL=canonical-tools.d.ts.map
|
|
@@ -9,4 +9,52 @@ export const CANONICAL_SDD_TOOL_NAMES = [
|
|
|
9
9
|
'sdd_apply_file_patch',
|
|
10
10
|
'sdd_complete_task',
|
|
11
11
|
];
|
|
12
|
+
export const ENGINE_CAPABILITIES = Object.freeze({
|
|
13
|
+
version: 1,
|
|
14
|
+
scope: 'server_implementation',
|
|
15
|
+
readOnlyTools: Object.freeze([
|
|
16
|
+
'sdd_list_features',
|
|
17
|
+
'sdd_read_spec_artifact',
|
|
18
|
+
'sdd_read_file_slice',
|
|
19
|
+
'sdd_get_active_task',
|
|
20
|
+
]),
|
|
21
|
+
views: Object.freeze({
|
|
22
|
+
sdd_list_features: Object.freeze(['setup_diagnostics']),
|
|
23
|
+
sdd_get_active_task: Object.freeze([
|
|
24
|
+
'verification_preflight',
|
|
25
|
+
'resume',
|
|
26
|
+
'relock_history',
|
|
27
|
+
'execution_window',
|
|
28
|
+
'execution_detail',
|
|
29
|
+
'evidence_history',
|
|
30
|
+
]),
|
|
31
|
+
}),
|
|
32
|
+
operations: Object.freeze({
|
|
33
|
+
sdd_lock_spec: Object.freeze(['lock', 'evidence_checkpoint']),
|
|
34
|
+
}),
|
|
35
|
+
observations: Object.freeze({
|
|
36
|
+
setupDiagnostics: 1,
|
|
37
|
+
verificationPreflight: 1,
|
|
38
|
+
resume: 1,
|
|
39
|
+
relockHistory: 1,
|
|
40
|
+
executionWindow: 1,
|
|
41
|
+
executionDetail: 1,
|
|
42
|
+
evidenceHistory: 1,
|
|
43
|
+
evidenceCheckpoint: 1,
|
|
44
|
+
verificationBudget: 1,
|
|
45
|
+
verificationProcess: 1,
|
|
46
|
+
}),
|
|
47
|
+
limits: Object.freeze({ compactTextBytes: 8192, defaultVerificationTimeoutMs: 180000 }),
|
|
48
|
+
});
|
|
49
|
+
export const TOOL_ANNOTATIONS = Object.freeze({
|
|
50
|
+
sdd_init_workspace: Object.freeze({ readOnlyHint: false }),
|
|
51
|
+
sdd_list_features: Object.freeze({ readOnlyHint: true }),
|
|
52
|
+
sdd_create_feature: Object.freeze({ readOnlyHint: false }),
|
|
53
|
+
sdd_lock_spec: Object.freeze({ readOnlyHint: false }),
|
|
54
|
+
sdd_read_spec_artifact: Object.freeze({ readOnlyHint: true }),
|
|
55
|
+
sdd_read_file_slice: Object.freeze({ readOnlyHint: true }),
|
|
56
|
+
sdd_get_active_task: Object.freeze({ readOnlyHint: true }),
|
|
57
|
+
sdd_apply_file_patch: Object.freeze({ readOnlyHint: false }),
|
|
58
|
+
sdd_complete_task: Object.freeze({ readOnlyHint: false }),
|
|
59
|
+
});
|
|
12
60
|
//# sourceMappingURL=canonical-tools.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { countTaskIds, dueTaskOrdinals, hasReceiptDirective, receiptCommand, taskBlocks, } from './task-content.js';
|
|
3
|
-
import { featureIdPattern, gateIdPattern, importReceiptPublicKey, maxVerificationReceipts, sha256Schema, taskIdPattern, } from './
|
|
3
|
+
import { featureIdPattern, gateIdPattern, importReceiptPublicKey, maxVerificationReceipts, sha256Schema, taskIdPattern, } from './receipt-assessment.js';
|
|
4
4
|
import { disjointPaths, isEvidencePath } from './feature-authority.js';
|
|
5
5
|
import { candidateCreationIssue, invalidTask, invalidCandidate, candidateIssue, manifestEntries, policyIssueLine, policyText, toPosixPath, } from './trinity-structure.js';
|
|
6
6
|
export { assessTrinityCompleteness, parseManifestContent, toPosixPath, } from './trinity-structure.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import * as compact from './tools/compact-result.js';
|
|
3
|
+
import type { HostSkillDiagnostics, SddWorkspaceHandle } from '../types/sdd-engine.js';
|
|
3
4
|
export declare const MISSING_SDD_HINT = "No .sdd directory in the client project. Call sdd_init_workspace with scope=project. MCP hosts should advertise roots; do not pin PLANU_WORKSPACE globally.";
|
|
4
5
|
export declare function isStaleV6HostDoc(content: string): boolean;
|
|
5
6
|
export declare function copyGlobalRules(workspaceRoot: string, force?: boolean): Promise<'preserved' | 'replaced' | 'created'>;
|
|
@@ -8,9 +9,12 @@ export declare function inspectHostSkillPackDetailed(workspaceRoot: string, bund
|
|
|
8
9
|
hostSkills: HostSkillDiagnostics;
|
|
9
10
|
hint?: string;
|
|
10
11
|
}>;
|
|
11
|
-
export declare function inspectSetupDiagnostics(root: string, version: string, selectedHost: SetupHost | 'all', client: unknown): Promise<SetupDiagnostics>;
|
|
12
12
|
export declare function copySkillTemplates(skillsDir: string): Promise<void>;
|
|
13
13
|
export declare function installHostSkillPack(workspaceRoot: string): Promise<string[]>;
|
|
14
14
|
export declare function installCursorGuard(workspaceRoot: string): Promise<string[]>;
|
|
15
15
|
export declare function installHostRulePack(workspaceRoot: string): Promise<string[]>;
|
|
16
|
+
export declare function setupDiagnosticResult(server: McpServer, workspace: SddWorkspaceHandle, version: string | undefined, args: {
|
|
17
|
+
view?: string;
|
|
18
|
+
host?: string;
|
|
19
|
+
}): Promise<ReturnType<typeof compact.formatCompactResult>>;
|
|
16
20
|
//# sourceMappingURL=host-rule-pack.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as compact from './tools/compact-result.js';
|
|
2
|
+
import { readTextInsideWorkspaceDetailed, homeFallbackFailure } from './workspace-root.js';
|
|
3
|
+
import { CANONICAL_SDD_TOOL_NAMES, ENGINE_CAPABILITIES } from './canonical-tools.js';
|
|
3
4
|
import * as fs from 'node:fs/promises';
|
|
4
5
|
import * as path from 'node:path';
|
|
5
6
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import { scanPack, legacyIssue,
|
|
7
|
+
import { scanPack, legacyIssue, diagnosticRow, clientInfo } from './host-skill-reader.js';
|
|
7
8
|
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
8
9
|
const TEMPLATES_ROOT = path.resolve(moduleDir, '..', '..', 'templates');
|
|
9
10
|
export const MISSING_SDD_HINT = 'No .sdd directory in the client project. Call sdd_init_workspace with scope=project. MCP hosts should advertise roots; do not pin PLANU_WORKSPACE globally.';
|
|
@@ -17,6 +18,8 @@ After the local client has registered the MCP server and the intended project is
|
|
|
17
18
|
|
|
18
19
|
## Read-only diagnostics
|
|
19
20
|
|
|
21
|
+
Before optional views or observations, inspect setup diagnostics and require a recognized \`engineCapabilities.version=1\` and the relevant advertised value. An absent or unknown version means unsupported; never probe a mutation or fall back to lock/relock to discover support. This describes server implementation only: host catalogues remain unverified, and a host catalogue refresh is separate from restarting MCP.
|
|
22
|
+
|
|
20
23
|
Use \`sdd_list_features.hostSkills\` to identify fixed installed role paths, causes and the bundled reference version. \`catalog\` stays \`unverified\` even when files match. An unavailable baseline requires inspecting the installation; unsafe paths require inspection before authorized setup. Project setup and client catalogue reload are explicit, separate actions.
|
|
21
24
|
|
|
22
25
|
For a rejected \`sdd_lock_spec\`, inspect \`error.details.issues\` for artifact, stable rule and optional 1-based original source line. Missing or ambiguous locations omit the line. Existing rejection codes and legacy details remain authoritative; rejection writes no lock. Do not automatically relock.
|
|
@@ -153,54 +156,6 @@ export async function inspectHostSkillPackDetailed(workspaceRoot, bundledVersion
|
|
|
153
156
|
};
|
|
154
157
|
}
|
|
155
158
|
const HOSTS = ['claude', 'cursor', 'codex', 'gemini'];
|
|
156
|
-
function diagnosticRow(row, version) {
|
|
157
|
-
const host = { '.claude': 'claude', '.cursor': 'cursor', '.agents': 'codex', '.gemini': 'gemini' }[row.relative.split(path.sep)[0]];
|
|
158
|
-
const base = {
|
|
159
|
-
host,
|
|
160
|
-
role: row.slug,
|
|
161
|
-
path: row.relative.split(path.sep).join('/'),
|
|
162
|
-
referenceVersion: version,
|
|
163
|
-
referenceSha256: row.referenceSha256,
|
|
164
|
-
installedSha256: row.installedSha256,
|
|
165
|
-
installedVersion: 'unverified',
|
|
166
|
-
};
|
|
167
|
-
const disposition = hostDisposition(row);
|
|
168
|
-
const proposedAction = {
|
|
169
|
-
match: 'none',
|
|
170
|
-
missing: 'create_on_authorized_setup',
|
|
171
|
-
different: 'replace_on_authorized_setup',
|
|
172
|
-
unreadable: 'inspect_path',
|
|
173
|
-
reference_unavailable: 'inspect_installation',
|
|
174
|
-
};
|
|
175
|
-
return { ...base, ...disposition, proposedAction: proposedAction[disposition.status] };
|
|
176
|
-
}
|
|
177
|
-
function clientInfo(value) {
|
|
178
|
-
if (value === undefined || value === null) {
|
|
179
|
-
return { client: null, clientMetadataCause: 'unavailable' };
|
|
180
|
-
}
|
|
181
|
-
if (typeof value !== 'object' ||
|
|
182
|
-
!('name' in value) ||
|
|
183
|
-
!('version' in value) ||
|
|
184
|
-
typeof value.name !== 'string' ||
|
|
185
|
-
typeof value.version !== 'string' ||
|
|
186
|
-
Array.from(value.name + value.version).some((char) => {
|
|
187
|
-
const code = char.codePointAt(0) ?? 0;
|
|
188
|
-
return code < 32 || (code >= 127 && code <= 159);
|
|
189
|
-
})) {
|
|
190
|
-
return { client: null, clientMetadataCause: 'invalid' };
|
|
191
|
-
}
|
|
192
|
-
if (Buffer.byteLength(value.name) > 128 || Buffer.byteLength(value.version) > 128) {
|
|
193
|
-
return { client: null, clientMetadataCause: 'over_limit' };
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
client: {
|
|
197
|
-
name: value.name,
|
|
198
|
-
version: value.version,
|
|
199
|
-
source: 'initialize',
|
|
200
|
-
provenance: 'client_reported',
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
159
|
function hostSummary(host, rows, available) {
|
|
205
160
|
const own = rows.filter((row) => row.host === host);
|
|
206
161
|
const count = (status) => own.filter((row) => row.status === status).length;
|
|
@@ -220,11 +175,12 @@ function hostSummary(host, rows, available) {
|
|
|
220
175
|
: 'none',
|
|
221
176
|
};
|
|
222
177
|
}
|
|
223
|
-
|
|
178
|
+
async function inspectSetupDiagnostics(root, version, selectedHost, client) {
|
|
224
179
|
const { available, rows: scanned } = await scanPack(root, TEMPLATES_ROOT, Object.keys(HOST_SKILL_DESCRIPTIONS).sort(), hostSkillTargets, toHostSkillMarkdown, readTextInsideWorkspaceDetailed);
|
|
225
180
|
const rows = scanned.map((row) => diagnosticRow(row, version));
|
|
226
181
|
return {
|
|
227
182
|
version: 1,
|
|
183
|
+
engineCapabilities: ENGINE_CAPABILITIES,
|
|
228
184
|
server: { version, tools: CANONICAL_SDD_TOOL_NAMES, count: 9, scope: 'server_registration' },
|
|
229
185
|
...clientInfo(client),
|
|
230
186
|
effectiveMcpCatalogue: 'unverified',
|
|
@@ -351,4 +307,22 @@ ${body}`;
|
|
|
351
307
|
}
|
|
352
308
|
return written;
|
|
353
309
|
}
|
|
310
|
+
export async function setupDiagnosticResult(server, workspace, version, args) {
|
|
311
|
+
try {
|
|
312
|
+
const resolved = await workspace.resolve();
|
|
313
|
+
const homeError = homeFallbackFailure(resolved, 'sdd_list_features');
|
|
314
|
+
if (homeError) {
|
|
315
|
+
return compact.formatCompactResult(homeError);
|
|
316
|
+
}
|
|
317
|
+
const setupDiagnostics = await inspectSetupDiagnostics(resolved.workspaceRoot, version ?? 'unknown', (args.host ?? 'all'), server.server.getClientVersion());
|
|
318
|
+
return compact.formatCompactResult({ success: true, data: { setupDiagnostics } });
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
const failure = compact.compactFailure('artifact_unavailable');
|
|
322
|
+
if (!failure.success) {
|
|
323
|
+
failure.error.trigger = 'sdd_list_features';
|
|
324
|
+
}
|
|
325
|
+
return compact.formatCompactResult(failure);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
354
328
|
//# sourceMappingURL=host-rule-pack.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HostScanRow, SetupRow } from '../types/resume-views.js';
|
|
1
|
+
import type { HostScanRow, SetupRow, SetupDiagnostics } from '../types/resume-views.js';
|
|
2
2
|
import type { HostSkillReadResult, HostSkillIssue } from '../types/sdd-engine.js';
|
|
3
3
|
/** Strict bounded reader for host diagnostics; legacy reader semantics remain unchanged. */
|
|
4
4
|
export declare function readTextInsideWorkspaceDetailed(workspaceRoot: string, absolutePath: string, options: {
|
|
@@ -9,5 +9,6 @@ export declare function scanPack(workspaceRoot: string, templatesRoot: string, s
|
|
|
9
9
|
rows: HostScanRow[];
|
|
10
10
|
}>;
|
|
11
11
|
export declare function legacyIssue(row: HostScanRow, available: boolean): HostSkillIssue | undefined;
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function diagnosticRow(row: HostScanRow, version: string): SetupRow;
|
|
13
|
+
export declare function clientInfo(value: unknown): Pick<SetupDiagnostics, 'client' | 'clientMetadataCause'>;
|
|
13
14
|
//# sourceMappingURL=host-skill-reader.d.ts.map
|
|
@@ -243,7 +243,7 @@ export function legacyIssue(row, available) {
|
|
|
243
243
|
}
|
|
244
244
|
return undefined;
|
|
245
245
|
}
|
|
246
|
-
|
|
246
|
+
function hostDisposition(row) {
|
|
247
247
|
if (!row.read.ok && row.read.cause !== 'not_found') {
|
|
248
248
|
return { status: 'unreadable', cause: row.read.cause };
|
|
249
249
|
}
|
|
@@ -257,4 +257,52 @@ export function hostDisposition(row) {
|
|
|
257
257
|
? { status: 'match', cause: null }
|
|
258
258
|
: { status: 'different', cause: 'content_mismatch' };
|
|
259
259
|
}
|
|
260
|
+
export function diagnosticRow(row, version) {
|
|
261
|
+
const host = { '.claude': 'claude', '.cursor': 'cursor', '.agents': 'codex', '.gemini': 'gemini' }[row.relative.split(sep)[0]];
|
|
262
|
+
const base = {
|
|
263
|
+
host,
|
|
264
|
+
role: row.slug,
|
|
265
|
+
path: row.relative.split(sep).join('/'),
|
|
266
|
+
referenceVersion: version,
|
|
267
|
+
referenceSha256: row.referenceSha256,
|
|
268
|
+
installedSha256: row.installedSha256,
|
|
269
|
+
installedVersion: 'unverified',
|
|
270
|
+
};
|
|
271
|
+
const disposition = hostDisposition(row);
|
|
272
|
+
const proposedAction = {
|
|
273
|
+
match: 'none',
|
|
274
|
+
missing: 'create_on_authorized_setup',
|
|
275
|
+
different: 'replace_on_authorized_setup',
|
|
276
|
+
unreadable: 'inspect_path',
|
|
277
|
+
reference_unavailable: 'inspect_installation',
|
|
278
|
+
};
|
|
279
|
+
return { ...base, ...disposition, proposedAction: proposedAction[disposition.status] };
|
|
280
|
+
}
|
|
281
|
+
export function clientInfo(value) {
|
|
282
|
+
if (value === undefined || value === null) {
|
|
283
|
+
return { client: null, clientMetadataCause: 'unavailable' };
|
|
284
|
+
}
|
|
285
|
+
if (typeof value !== 'object' ||
|
|
286
|
+
!('name' in value) ||
|
|
287
|
+
!('version' in value) ||
|
|
288
|
+
typeof value.name !== 'string' ||
|
|
289
|
+
typeof value.version !== 'string' ||
|
|
290
|
+
Array.from(value.name + value.version).some((char) => {
|
|
291
|
+
const code = char.codePointAt(0) ?? 0;
|
|
292
|
+
return code < 32 || (code >= 127 && code <= 159);
|
|
293
|
+
})) {
|
|
294
|
+
return { client: null, clientMetadataCause: 'invalid' };
|
|
295
|
+
}
|
|
296
|
+
if (Buffer.byteLength(value.name) > 128 || Buffer.byteLength(value.version) > 128) {
|
|
297
|
+
return { client: null, clientMetadataCause: 'over_limit' };
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
client: {
|
|
301
|
+
name: value.name,
|
|
302
|
+
version: value.version,
|
|
303
|
+
source: 'initialize',
|
|
304
|
+
provenance: 'client_reported',
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
}
|
|
260
308
|
//# sourceMappingURL=host-skill-reader.js.map
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { TOOL_ANNOTATIONS } from '../canonical-tools.js';
|
|
1
2
|
import * as path from 'node:path';
|
|
2
3
|
import { ReadSpecArtifactInputSchema, ReadFileSliceInputSchema, GetActiveTaskInputSchema, ApplyFilePatchInputSchema, CompleteTaskInputSchema, } from '../contracts.js';
|
|
3
4
|
import { PatchSandbox } from '../patch-sandbox.js';
|
|
4
|
-
import { TaskWindowManager
|
|
5
|
-
import {
|
|
5
|
+
import { TaskWindowManager } from '../task-window.js';
|
|
6
|
+
import { hasReceiptDirective, sliceNumberedSource } from '../task-content.js';
|
|
6
7
|
export { sliceNumberedSource } from '../task-content.js';
|
|
7
8
|
import { parseManifestContent, parseVerificationReceiptPolicy, toPosixPath, } from '../feature-manifest.js';
|
|
8
|
-
import {
|
|
9
|
-
import { captureVerificationRoot, checkReceiptPatchTarget
|
|
10
|
-
import {
|
|
9
|
+
import { getReceiptActiveTask } from '../verification-receipts.js';
|
|
10
|
+
import { captureVerificationRoot, checkReceiptPatchTarget } from '../verification-inputs.js';
|
|
11
|
+
import { patchMutationError } from '../task-failures.js';
|
|
11
12
|
import { formatResult } from './compact-result.js';
|
|
12
|
-
import { acquireCompletionLease
|
|
13
|
+
import { acquireCompletionLease } from '../completion-guard.js';
|
|
13
14
|
import { captureCompletionSnapshot, revalidateCompletionSnapshot } from '../completion-snapshot.js';
|
|
14
15
|
import { homeFallbackFailure, readTextInsideWorkspace } from '../workspace-root.js';
|
|
15
16
|
import { guardFailure } from '../feature-authority.js';
|
|
@@ -24,6 +25,7 @@ export function registerExecutionTools(server, workspace, policy) {
|
|
|
24
25
|
}
|
|
25
26
|
function registerReadArtifactTool(server, workspace) {
|
|
26
27
|
server.registerTool('sdd_read_spec_artifact', {
|
|
28
|
+
annotations: TOOL_ANNOTATIONS.sdd_read_spec_artifact,
|
|
27
29
|
description: 'Reads one of the three Holy Trinity artifacts (spec, plan, or tasks).',
|
|
28
30
|
inputSchema: ReadSpecArtifactInputSchema.shape,
|
|
29
31
|
}, async (rawArgs) => {
|
|
@@ -52,6 +54,7 @@ function registerReadArtifactTool(server, workspace) {
|
|
|
52
54
|
}
|
|
53
55
|
function registerReadFileSliceTool(server, workspace) {
|
|
54
56
|
server.registerTool('sdd_read_file_slice', {
|
|
57
|
+
annotations: TOOL_ANNOTATIONS.sdd_read_file_slice,
|
|
55
58
|
description: 'Reads an exact line slice from a target file to optimize token usage.',
|
|
56
59
|
inputSchema: ReadFileSliceInputSchema.shape,
|
|
57
60
|
}, async (rawArgs) => {
|
|
@@ -66,6 +69,7 @@ function registerReadFileSliceTool(server, workspace) {
|
|
|
66
69
|
}
|
|
67
70
|
function registerGetActiveTaskTool(server, workspace, taskWindow) {
|
|
68
71
|
server.registerTool('sdd_get_active_task', {
|
|
72
|
+
annotations: TOOL_ANNOTATIONS.sdd_get_active_task,
|
|
69
73
|
description: 'Returns only the active task. For fast resumption use view="resume"; use "relock_history" with history_cursor for older lock references, or "verification_preflight" to inspect evidence. Compact views are read-only and do not certify work.',
|
|
70
74
|
inputSchema: GetActiveTaskInputSchema.shape,
|
|
71
75
|
}, async (rawArgs, extra) => {
|
|
@@ -101,55 +105,9 @@ function registerGetActiveTaskTool(server, workspace, taskWindow) {
|
|
|
101
105
|
return formatResult(result);
|
|
102
106
|
});
|
|
103
107
|
}
|
|
104
|
-
async function getReceiptActiveTask(feature, previousTaskMarkdown, workspaceRoot, signal) {
|
|
105
|
-
const trigger = 'sdd_get_active_task';
|
|
106
|
-
try {
|
|
107
|
-
const root = await captureVerificationRoot(workspaceRoot);
|
|
108
|
-
const snapshot = await captureCompletionSnapshot(feature, {
|
|
109
|
-
workspaceRoot: root.canonical,
|
|
110
|
-
});
|
|
111
|
-
const current = activeTaskFromContent(snapshot.tasksContent, verificationCommand);
|
|
112
|
-
const active = current.success ? current.data.activeTask : null;
|
|
113
|
-
if (!current.success || active?.fullTaskMarkdown !== previousTaskMarkdown) {
|
|
114
|
-
return completionFailure('contract_drift', undefined, trigger);
|
|
115
|
-
}
|
|
116
|
-
const data = current.data;
|
|
117
|
-
const policy = parseVerificationReceiptPolicy(path.basename(snapshot.featDir), snapshot.planContent, snapshot.tasksContent);
|
|
118
|
-
const task = policy.status === 'ready' ? policy.tasks.get(active.taskId) : undefined;
|
|
119
|
-
if (policy.status !== 'ready' || !task) {
|
|
120
|
-
return completionFailure('contract_drift', undefined, trigger);
|
|
121
|
-
}
|
|
122
|
-
const captured = await captureReceiptEvidence(snapshot, workspaceRoot, policy, task, root, signal);
|
|
123
|
-
if (captured.success) {
|
|
124
|
-
await revalidateVerificationInputs(captured.data.inputs, signal);
|
|
125
|
-
}
|
|
126
|
-
await revalidateCompletionSnapshot(snapshot);
|
|
127
|
-
const guard = await inspectCompletionGuard(feature);
|
|
128
|
-
if (guard) {
|
|
129
|
-
return completionFailure(guard.reason, undefined, trigger);
|
|
130
|
-
}
|
|
131
|
-
if (!captured.success) {
|
|
132
|
-
return { ...captured, error: { ...captured.error, trigger } };
|
|
133
|
-
}
|
|
134
|
-
const manifest = [...parseManifestContent(snapshot.planContent).allowedFiles.entries()].map(([filePath, permission]) => ({ path: filePath, permission }));
|
|
135
|
-
return {
|
|
136
|
-
success: true,
|
|
137
|
-
data: {
|
|
138
|
-
...data,
|
|
139
|
-
activeTask: { ...active, verificationCommand: task.command },
|
|
140
|
-
locked: true,
|
|
141
|
-
trinity: 'ready',
|
|
142
|
-
manifest,
|
|
143
|
-
verificationEvidence: captured.data.evidence,
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
return completionError(error, trigger);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
108
|
function registerApplyPatchTool(server, workspace) {
|
|
152
109
|
server.registerTool('sdd_apply_file_patch', {
|
|
110
|
+
annotations: TOOL_ANNOTATIONS.sdd_apply_file_patch,
|
|
153
111
|
description: 'Applies CREATE and MODIFY patches, or exact DELETE operations, strictly authorized in plan.md File Manifest. DELETE requires empty search_content and replace_content.',
|
|
154
112
|
inputSchema: ApplyFilePatchInputSchema.shape,
|
|
155
113
|
}, async (rawArgs) => {
|
|
@@ -164,6 +122,7 @@ function registerApplyPatchTool(server, workspace) {
|
|
|
164
122
|
}
|
|
165
123
|
function registerCompleteTaskTool(server, workspace, taskWindow) {
|
|
166
124
|
server.registerTool('sdd_complete_task', {
|
|
125
|
+
annotations: TOOL_ANNOTATIONS.sdd_complete_task,
|
|
167
126
|
description: 'Completes the active task by running its Verification command in the workspace and storing that output. verification_output is accepted and ignored.',
|
|
168
127
|
inputSchema: CompleteTaskInputSchema.shape,
|
|
169
128
|
}, async (rawArgs, extra) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TOOL_ANNOTATIONS } from '../canonical-tools.js';
|
|
1
2
|
import * as fs from 'node:fs/promises';
|
|
2
3
|
import * as path from 'node:path';
|
|
3
4
|
import * as contracts from '../contracts.js';
|
|
@@ -49,6 +50,7 @@ export function registerWorkspaceTools(server, workspace, bundledVersion) {
|
|
|
49
50
|
}
|
|
50
51
|
function registerInitTool(server, workspace) {
|
|
51
52
|
server.registerTool('sdd_init_workspace', {
|
|
53
|
+
annotations: TOOL_ANNOTATIONS.sdd_init_workspace,
|
|
52
54
|
description: 'Initializes the SDD workspace creating .sdd/ directory and decoupled skills.',
|
|
53
55
|
inputSchema: contracts.InitWorkspaceInputSchema.shape,
|
|
54
56
|
}, async (rawArgs) => {
|
|
@@ -106,22 +108,9 @@ function listFailure(reason) {
|
|
|
106
108
|
}
|
|
107
109
|
return compact.formatCompactResult(failure);
|
|
108
110
|
}
|
|
109
|
-
async function setupDiagnosticResult(server, workspace, version, args) {
|
|
110
|
-
try {
|
|
111
|
-
const resolved = await workspace.resolve();
|
|
112
|
-
const homeError = homeFallbackFailure(resolved, 'sdd_list_features');
|
|
113
|
-
if (homeError) {
|
|
114
|
-
return compact.formatCompactResult(homeError);
|
|
115
|
-
}
|
|
116
|
-
const setupDiagnostics = await hostPack.inspectSetupDiagnostics(resolved.workspaceRoot, version ?? 'unknown', (args.host ?? 'all'), server.server.getClientVersion());
|
|
117
|
-
return compact.formatCompactResult({ success: true, data: { setupDiagnostics } });
|
|
118
|
-
}
|
|
119
|
-
catch {
|
|
120
|
-
return listFailure('artifact_unavailable');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
111
|
function registerListTool(server, workspace, taskWindow, bundledVersion) {
|
|
124
112
|
server.registerTool('sdd_list_features', {
|
|
113
|
+
annotations: TOOL_ANNOTATIONS.sdd_list_features,
|
|
125
114
|
description: 'Lists executable Planu v8 FEAT-* features from .sdd/features only.',
|
|
126
115
|
inputSchema: contracts.ListFeaturesInputSchema,
|
|
127
116
|
}, async (rawArgs) => {
|
|
@@ -129,9 +118,8 @@ function registerListTool(server, workspace, taskWindow, bundledVersion) {
|
|
|
129
118
|
if (!parsed.success) {
|
|
130
119
|
return listFailure('compact_input_invalid');
|
|
131
120
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return setupDiagnosticResult(server, workspace, bundledVersion, args);
|
|
121
|
+
if (parsed.data.view !== undefined || parsed.data.host !== undefined) {
|
|
122
|
+
return hostPack.setupDiagnosticResult(server, workspace, bundledVersion, parsed.data);
|
|
135
123
|
}
|
|
136
124
|
const resolved = await workspace.resolve();
|
|
137
125
|
const homeError = homeFallbackFailure(resolved, 'sdd_list_features');
|
|
@@ -143,7 +131,7 @@ function registerListTool(server, workspace, taskWindow, bundledVersion) {
|
|
|
143
131
|
if (safety) {
|
|
144
132
|
return compact.formatResult(safety);
|
|
145
133
|
}
|
|
146
|
-
const collected = await collectFeatures(featuresDir, taskWindow,
|
|
134
|
+
const collected = await collectFeatures(featuresDir, taskWindow, parsed.data.status_filter);
|
|
147
135
|
if (!collected.success) {
|
|
148
136
|
return compact.formatResult(collected);
|
|
149
137
|
}
|
|
@@ -166,6 +154,7 @@ function registerListTool(server, workspace, taskWindow, bundledVersion) {
|
|
|
166
154
|
}
|
|
167
155
|
function registerCreateTool(server, workspace) {
|
|
168
156
|
server.registerTool('sdd_create_feature', {
|
|
157
|
+
annotations: TOOL_ANNOTATIONS.sdd_create_feature,
|
|
169
158
|
description: 'Creates a Holy Trinity feature. Omit id to atomically reserve the next global FEAT-NNNN-TITLE identifier; explicit FEAT-* IDs remain supported.',
|
|
170
159
|
inputSchema: contracts.CreateFeatureInputSchema.shape,
|
|
171
160
|
}, async (rawArgs) => {
|
|
@@ -223,6 +212,7 @@ function registerCreateTool(server, workspace) {
|
|
|
223
212
|
}
|
|
224
213
|
function registerLockTool(server, workspace) {
|
|
225
214
|
server.registerTool('sdd_lock_spec', {
|
|
215
|
+
annotations: TOOL_ANNOTATIONS.sdd_lock_spec,
|
|
226
216
|
description: 'Locks spec.md, plan.md, and tasks.md. Pass relock=true and reason to reseal after review. The explicit evidence_checkpoint operation records a caller-reported, non-certifying observation.',
|
|
227
217
|
inputSchema: contracts.LockSpecInputSchema,
|
|
228
218
|
}, async (rawArgs, extra) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hasReceiptDirective, insideMarkdownBlock } from './task-content.js';
|
|
2
|
-
import { taskIdPattern } from './
|
|
2
|
+
import { taskIdPattern } from './receipt-assessment.js';
|
|
3
3
|
import { disjointPaths, isEvidencePath, CompletionGuardError } from './feature-authority.js';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
const CHECKBOX_TASK = /^[-*]\s*\[[ xX]\]/u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReceiptPolicyResult, ReceiptTaskPolicy, WorkspaceRoot, CompletionSnapshot } from '../types/completion.js';
|
|
2
2
|
export { maxVerificationReceipts, gateIdPattern, taskIdPattern, featureIdPattern, sha256Schema, importReceiptPublicKey, validateVerificationReceiptSet, assessVerificationReceiptSet, } from './receipt-assessment.js';
|
|
3
|
-
import type { CompleteTaskResult, SddResult, VerificationEvidence } from '../types/sdd-engine.js';
|
|
4
|
-
import type
|
|
3
|
+
import type { ActiveTaskResult, CompleteTaskResult, SddResult, VerificationEvidence } from '../types/sdd-engine.js';
|
|
4
|
+
import { type CompletionLease } from './completion-guard.js';
|
|
5
5
|
import { captureVerificationInputs } from './verification-inputs.js';
|
|
6
6
|
import type { ScopedVerificationRun, ScopedVerificationRunnerOptions } from '../types/verification.js';
|
|
7
7
|
export declare function captureReceiptEvidence(snapshot: CompletionSnapshot, workspaceRoot: string, policy: Extract<ReceiptPolicyResult, {
|
|
@@ -13,4 +13,5 @@ export declare function captureReceiptEvidence(snapshot: CompletionSnapshot, wor
|
|
|
13
13
|
export declare function completeReceiptTask(snapshot: CompletionSnapshot, workspaceRoot: string, policy: Extract<ReceiptPolicyResult, {
|
|
14
14
|
status: 'ready';
|
|
15
15
|
}>, task: ReceiptTaskPolicy, receipts: unknown, lease: CompletionLease, signal: AbortSignal, timeoutMs: number, runVerification: (options: ScopedVerificationRunnerOptions) => Promise<ScopedVerificationRun>): Promise<SddResult<CompleteTaskResult>>;
|
|
16
|
+
export declare function getReceiptActiveTask(feature: string, previousTaskMarkdown: string, workspaceRoot: string, signal?: AbortSignal): Promise<SddResult<ActiveTaskResult>>;
|
|
16
17
|
//# sourceMappingURL=verification-receipts.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { parseManifestContent, parseVerificationReceiptPolicy } from './feature-manifest.js';
|
|
1
2
|
export { maxVerificationReceipts, gateIdPattern, taskIdPattern, featureIdPattern, sha256Schema, importReceiptPublicKey, validateVerificationReceiptSet, assessVerificationReceiptSet, } from './receipt-assessment.js';
|
|
2
3
|
import { validateVerificationReceiptSet } from './receipt-assessment.js';
|
|
3
4
|
import * as path from 'node:path';
|
|
5
|
+
import { inspectCompletionGuard } from './completion-guard.js';
|
|
4
6
|
import { captureCompletionSnapshot, persistCompletionSnapshot, revalidateCompletionSnapshot, } from './completion-snapshot.js';
|
|
5
7
|
import { hashArtifact } from './feature-authority.js';
|
|
6
8
|
import { activeTaskFromContent, markReceiptTaskVerified, remainingTaskCount, } from './task-content.js';
|
|
7
|
-
import { completionFailure, receiptFailure, unsupportedVerificationPlatform, verificationFailed, verificationProcessEvidence, } from './task-failures.js';
|
|
9
|
+
import { completionError, verificationCommand, completionFailure, receiptFailure, unsupportedVerificationPlatform, verificationFailed, verificationProcessEvidence, } from './task-failures.js';
|
|
8
10
|
import { captureVerificationInputs, captureVerificationRoot, revalidateVerificationInputs, } from './verification-inputs.js';
|
|
9
11
|
export async function captureReceiptEvidence(snapshot, workspaceRoot, policy, task, root, signal) {
|
|
10
12
|
if (path.resolve(snapshot.featDir, '../../..') !== root.canonical) {
|
|
@@ -96,4 +98,51 @@ export async function completeReceiptTask(snapshot, workspaceRoot, policy, task,
|
|
|
96
98
|
},
|
|
97
99
|
};
|
|
98
100
|
}
|
|
101
|
+
export async function getReceiptActiveTask(feature, previousTaskMarkdown, workspaceRoot, signal) {
|
|
102
|
+
const trigger = 'sdd_get_active_task';
|
|
103
|
+
try {
|
|
104
|
+
const root = await captureVerificationRoot(workspaceRoot);
|
|
105
|
+
const snapshot = await captureCompletionSnapshot(feature, {
|
|
106
|
+
workspaceRoot: root.canonical,
|
|
107
|
+
});
|
|
108
|
+
const current = activeTaskFromContent(snapshot.tasksContent, verificationCommand);
|
|
109
|
+
const active = current.success ? current.data.activeTask : null;
|
|
110
|
+
if (!current.success || active?.fullTaskMarkdown !== previousTaskMarkdown) {
|
|
111
|
+
return completionFailure('contract_drift', undefined, trigger);
|
|
112
|
+
}
|
|
113
|
+
const data = current.data;
|
|
114
|
+
const policy = parseVerificationReceiptPolicy(path.basename(snapshot.featDir), snapshot.planContent, snapshot.tasksContent);
|
|
115
|
+
const task = policy.status === 'ready' ? policy.tasks.get(active.taskId) : undefined;
|
|
116
|
+
if (policy.status !== 'ready' || !task) {
|
|
117
|
+
return completionFailure('contract_drift', undefined, trigger);
|
|
118
|
+
}
|
|
119
|
+
const captured = await captureReceiptEvidence(snapshot, workspaceRoot, policy, task, root, signal);
|
|
120
|
+
if (captured.success) {
|
|
121
|
+
await revalidateVerificationInputs(captured.data.inputs, signal);
|
|
122
|
+
}
|
|
123
|
+
await revalidateCompletionSnapshot(snapshot);
|
|
124
|
+
const guard = await inspectCompletionGuard(feature);
|
|
125
|
+
if (guard) {
|
|
126
|
+
return completionFailure(guard.reason, undefined, trigger);
|
|
127
|
+
}
|
|
128
|
+
if (!captured.success) {
|
|
129
|
+
return { ...captured, error: { ...captured.error, trigger } };
|
|
130
|
+
}
|
|
131
|
+
const manifest = [...parseManifestContent(snapshot.planContent).allowedFiles.entries()].map(([filePath, permission]) => ({ path: filePath, permission }));
|
|
132
|
+
return {
|
|
133
|
+
success: true,
|
|
134
|
+
data: {
|
|
135
|
+
...data,
|
|
136
|
+
activeTask: { ...active, verificationCommand: task.command },
|
|
137
|
+
locked: true,
|
|
138
|
+
trinity: 'ready',
|
|
139
|
+
manifest,
|
|
140
|
+
verificationEvidence: captured.data.evidence,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return completionError(error, trigger);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
99
148
|
//# sourceMappingURL=verification-receipts.js.map
|
|
@@ -223,7 +223,48 @@ export interface SetupRow {
|
|
|
223
223
|
cause: HostSkillReadCause | 'content_mismatch' | 'reference_unavailable' | null;
|
|
224
224
|
proposedAction: 'none' | 'create_on_authorized_setup' | 'replace_on_authorized_setup' | 'inspect_path' | 'inspect_installation';
|
|
225
225
|
}
|
|
226
|
+
export interface EngineCapabilitiesV1 {
|
|
227
|
+
readonly version: 1;
|
|
228
|
+
readonly scope: 'server_implementation';
|
|
229
|
+
readonly readOnlyTools: readonly [
|
|
230
|
+
'sdd_list_features',
|
|
231
|
+
'sdd_read_spec_artifact',
|
|
232
|
+
'sdd_read_file_slice',
|
|
233
|
+
'sdd_get_active_task'
|
|
234
|
+
];
|
|
235
|
+
readonly views: {
|
|
236
|
+
readonly sdd_list_features: readonly ['setup_diagnostics'];
|
|
237
|
+
readonly sdd_get_active_task: readonly [
|
|
238
|
+
'verification_preflight',
|
|
239
|
+
'resume',
|
|
240
|
+
'relock_history',
|
|
241
|
+
'execution_window',
|
|
242
|
+
'execution_detail',
|
|
243
|
+
'evidence_history'
|
|
244
|
+
];
|
|
245
|
+
};
|
|
246
|
+
readonly operations: {
|
|
247
|
+
readonly sdd_lock_spec: readonly ['lock', 'evidence_checkpoint'];
|
|
248
|
+
};
|
|
249
|
+
readonly observations: {
|
|
250
|
+
readonly setupDiagnostics: 1;
|
|
251
|
+
readonly verificationPreflight: 1;
|
|
252
|
+
readonly resume: 1;
|
|
253
|
+
readonly relockHistory: 1;
|
|
254
|
+
readonly executionWindow: 1;
|
|
255
|
+
readonly executionDetail: 1;
|
|
256
|
+
readonly evidenceHistory: 1;
|
|
257
|
+
readonly evidenceCheckpoint: 1;
|
|
258
|
+
readonly verificationBudget: 1;
|
|
259
|
+
readonly verificationProcess: 1;
|
|
260
|
+
};
|
|
261
|
+
readonly limits: {
|
|
262
|
+
readonly compactTextBytes: 8192;
|
|
263
|
+
readonly defaultVerificationTimeoutMs: 180000;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
226
266
|
export interface SetupDiagnostics {
|
|
267
|
+
engineCapabilities: EngineCapabilitiesV1;
|
|
227
268
|
version: 1;
|
|
228
269
|
server: {
|
|
229
270
|
version: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planu/cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.8.0",
|
|
4
4
|
"description": "Planu — MCP server for Spec Driven Development. Planning and file operations on macOS/Linux/Windows; automated verification requires macOS/Linux (POSIX).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"audit:deadcode": "knip",
|
|
126
126
|
"audit:circular": "madge --circular --extensions ts --ts-config tsconfig.json src/",
|
|
127
127
|
"audit:types": "type-coverage --at-least 98 --ignore-catch --strict --ignore-files 'tests/**'",
|
|
128
|
-
"validate": "pnpm
|
|
128
|
+
"validate": "pnpm check:strict && pnpm build && pnpm test",
|
|
129
129
|
"package:size": "node scripts/check-package-size.mjs"
|
|
130
130
|
}
|
|
131
131
|
}
|
package/templates/AGENTS.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# SDD Engine v8 — Master Global Rules
|
|
2
2
|
|
|
3
|
+
Before optional views or observations, inspect setup diagnostics and require a recognized `engineCapabilities.version=1` and the relevant advertised value. An absent or unknown version means unsupported; never probe a mutation or fall back to lock/relock to discover support. This describes server implementation only: host catalogues remain unverified, and a host catalogue refresh is separate from restarting MCP.
|
|
4
|
+
|
|
3
5
|
You are operating within a Spec-Driven Development environment (Planu v8).
|
|
4
6
|
Canonical contract: `PLANU_V8_MANIFESTO.txt`.
|
|
5
7
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Planu v8 host contract
|
|
2
2
|
|
|
3
|
+
Before optional views or observations, inspect setup diagnostics and require a recognized `engineCapabilities.version=1` and the relevant advertised value. An absent or unknown version means unsupported; never probe a mutation or fall back to lock/relock to discover support. This describes server implementation only: host catalogues remain unverified, and a host catalogue refresh is separate from restarting MCP.
|
|
4
|
+
|
|
3
5
|
The only SDD contract is `.sdd/features/{FEAT-*}/spec.md`, `plan.md`, and `tasks.md`.
|
|
4
6
|
|
|
5
7
|
## First use in this project
|
|
@@ -4,6 +4,8 @@ role: SDD Readiness Guardian
|
|
|
4
4
|
target_tools: [sdd_list_features, sdd_read_spec_artifact, sdd_get_active_task, sdd_read_file_slice]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
Before optional views or observations, inspect setup diagnostics and require a recognized `engineCapabilities.version=1` and the relevant advertised value. An absent or unknown version means unsupported; never probe a mutation or fall back to lock/relock to discover support. This describes server implementation only: host catalogues remain unverified, and a host catalogue refresh is separate from restarting MCP.
|
|
8
|
+
|
|
7
9
|
# SDD PREFLIGHT GUARDIAN DIRECTIVE
|
|
8
10
|
|
|
9
11
|
You act as the read-only readiness boundary before architecture or execution.
|
|
@@ -4,6 +4,8 @@ role: Zero-Freedom SDD Coder
|
|
|
4
4
|
target_tools: [sdd_get_active_task, sdd_read_file_slice, sdd_apply_file_patch, sdd_complete_task]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
Before optional views or observations, inspect setup diagnostics and require a recognized `engineCapabilities.version=1` and the relevant advertised value. An absent or unknown version means unsupported; never probe a mutation or fall back to lock/relock to discover support. This describes server implementation only: host catalogues remain unverified, and a host catalogue refresh is separate from restarting MCP.
|
|
8
|
+
|
|
7
9
|
# SDD SPEC EXECUTOR DIRECTIVE (ZERO FREEDOM)
|
|
8
10
|
|
|
9
11
|
You act as the Implementation Agent operating in "Zero Freedom" mode.
|