@planu/cli 4.3.24 → 4.4.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/engine/constitution/sdd-rules-registry.d.ts +12 -0
  3. package/dist/engine/constitution/sdd-rules-registry.js +105 -0
  4. package/dist/engine/evidence-index/done-drift.d.ts +6 -0
  5. package/dist/engine/evidence-index/done-drift.js +44 -0
  6. package/dist/engine/evidence-index/index-builder.d.ts +10 -0
  7. package/dist/engine/evidence-index/index-builder.js +138 -0
  8. package/dist/engine/handoff-artifacts/index.d.ts +1 -16
  9. package/dist/engine/handoff-artifacts/io.d.ts +1 -1
  10. package/dist/engine/handoff-artifacts/schemas.d.ts +1 -1
  11. package/dist/engine/handoff-artifacts/validation-result.d.ts +18 -0
  12. package/dist/engine/handoff-artifacts/validation-result.js +3 -0
  13. package/dist/engine/hooks/handlers/on-impl-change.js +3 -2
  14. package/dist/engine/host-rules-templates/templates.js +3 -0
  15. package/dist/engine/spec-format/lean-spec-generator.js +17 -12
  16. package/dist/engine/spec-grounding/contract.d.ts +19 -0
  17. package/dist/engine/spec-grounding/contract.js +186 -0
  18. package/dist/engine/spec-metrics/actionable-metrics.d.ts +10 -0
  19. package/dist/engine/spec-metrics/actionable-metrics.js +69 -0
  20. package/dist/engine/spec-quality/generic-output-gate.d.ts +3 -0
  21. package/dist/engine/spec-quality/generic-output-gate.js +105 -0
  22. package/dist/engine/test-contract-generator.js +41 -39
  23. package/dist/engine/test-scaffold-generator/unit-scaffold.js +10 -10
  24. package/dist/engine/test-spec-generator/criterion-parser.js +5 -24
  25. package/dist/storage/base-store.d.ts +0 -1
  26. package/dist/storage/base-store.js +0 -4
  27. package/dist/tools/create-spec.js +160 -30
  28. package/dist/tools/generate-tests/generators/concurrency-test-generator/java-templates.js +8 -13
  29. package/dist/tools/generate-tests/generators/concurrency-test-generator/js-templates.js +21 -47
  30. package/dist/tools/generate-tests/generators/concurrency-test-generator/python-rust-templates.js +3 -14
  31. package/dist/tools/git/auto-complete-ops.d.ts +18 -0
  32. package/dist/tools/git/auto-complete-ops.js +63 -0
  33. package/dist/tools/git/branch-ops.d.ts +0 -17
  34. package/dist/tools/git/branch-ops.js +0 -54
  35. package/dist/tools/git/cleanup-ops.js +0 -16
  36. package/dist/tools/git/release-ops.js +1 -1
  37. package/dist/tools/init-project/handler.js +1 -1
  38. package/dist/tools/manage-hooks.js +3 -1
  39. package/dist/tools/status-handler.js +1 -1
  40. package/dist/tools/update-status/evidence-gate.js +23 -6
  41. package/dist/tools/update-status/transition-guard.js +49 -0
  42. package/dist/tools/update-status-actions.js +8 -5
  43. package/dist/types/actionable-spec-metrics.d.ts +8 -0
  44. package/dist/types/actionable-spec-metrics.js +2 -0
  45. package/dist/types/clarification-token.d.ts +1 -1
  46. package/dist/types/clarification.d.ts +2 -18
  47. package/dist/types/evidence-gates.d.ts +1 -1
  48. package/dist/types/evidence-index.d.ts +24 -0
  49. package/dist/types/evidence-index.js +2 -0
  50. package/dist/types/hook-status-update.d.ts +10 -0
  51. package/dist/types/hook-status-update.js +3 -0
  52. package/dist/types/index.d.ts +6 -0
  53. package/dist/types/index.js +6 -0
  54. package/dist/types/interactive-question.d.ts +19 -0
  55. package/dist/types/interactive-question.js +3 -0
  56. package/dist/types/sdd-constitution.d.ts +27 -0
  57. package/dist/types/sdd-constitution.js +2 -0
  58. package/dist/types/spec-format.d.ts +7 -0
  59. package/dist/types/spec-grounding.d.ts +22 -0
  60. package/dist/types/spec-grounding.js +2 -0
  61. package/dist/types/spec-quality.d.ts +10 -0
  62. package/dist/types/storage.d.ts +1 -1
  63. package/package.json +9 -9
  64. package/planu-native.json +1 -1
  65. package/planu-plugin.json +1 -1
  66. package/dist/engine/hooks/index.d.ts +0 -20
  67. package/dist/engine/hooks/index.js +0 -25
  68. package/dist/storage/crud-store-factory.d.ts +0 -22
  69. package/dist/storage/crud-store-factory.js +0 -72
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planu/cli",
3
- "version": "4.3.24",
3
+ "version": "4.4.0",
4
4
  "description": "Planu — MCP Server for Spec Driven Development with native Rust acceleration for hot paths. Cross-platform (Linux/macOS/Windows, x64/arm64, glibc/musl).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,14 +34,14 @@
34
34
  "packageName": "@planu/core"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@planu/core-darwin-arm64": "4.3.24",
38
- "@planu/core-darwin-x64": "4.3.24",
39
- "@planu/core-linux-arm64-gnu": "4.3.24",
40
- "@planu/core-linux-arm64-musl": "4.3.24",
41
- "@planu/core-linux-x64-gnu": "4.3.24",
42
- "@planu/core-linux-x64-musl": "4.3.24",
43
- "@planu/core-win32-arm64-msvc": "4.3.24",
44
- "@planu/core-win32-x64-msvc": "4.3.24"
37
+ "@planu/core-darwin-arm64": "4.4.0",
38
+ "@planu/core-darwin-x64": "4.4.0",
39
+ "@planu/core-linux-arm64-gnu": "4.4.0",
40
+ "@planu/core-linux-arm64-musl": "4.4.0",
41
+ "@planu/core-linux-x64-gnu": "4.4.0",
42
+ "@planu/core-linux-x64-musl": "4.4.0",
43
+ "@planu/core-win32-arm64-msvc": "4.4.0",
44
+ "@planu/core-win32-x64-msvc": "4.4.0"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=24.0.0"
package/planu-native.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dev.planu.native",
3
3
  "displayName": "Planu Native Lightweight Surface",
4
- "version": "4.3.24",
4
+ "version": "4.4.0",
5
5
  "packageName": "@planu/cli",
6
6
  "modes": {
7
7
  "lightweight": {
package/planu-plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dev.planu.cli",
3
3
  "displayName": "Planu — Spec Driven Development",
4
4
  "description": "Manage software specs, estimations, and autonomous SDD workflows. Language-agnostic MCP server for Claude Code.",
5
- "version": "4.3.24",
5
+ "version": "4.4.0",
6
6
  "icon": "assets/plugin/icon.svg",
7
7
  "command": [
8
8
  "npx",
@@ -1,20 +0,0 @@
1
- export { dispatchEvent, executeHook, dryRunDispatch } from './core.js';
2
- export { buildSpecCreatedPayload, buildStatusChangePayload, buildDriftDetectedPayload, buildCommitPayload, matchesFilter, matchesGlob, } from './triggers.js';
3
- export { generateGitHookScript, generateGitHooks, formatGitHookInstallGuide, } from './git-hook-generator.js';
4
- export { listTemplateNames, getTemplate, getAllTemplates } from './templates.js';
5
- export { FileWatcher, globToRegex, matchesGlobPattern, matchesPatterns } from './file-watcher.js';
6
- export { Debouncer } from './debouncer.js';
7
- export { ConfigLoader } from './config-loader.js';
8
- export { handleOnSave, extractSpecAnnotations, getStoredHash, setStoredHash, removeStoredHash, clearStoredHashes, } from './handlers/on-save.js';
9
- export { handleOnCreate } from './handlers/on-create.js';
10
- export { handleOnDelete } from './handlers/on-delete.js';
11
- export { HookEngine } from './hook-engine.js';
12
- export { EventBus } from './event-bus.js';
13
- export { handleOnTestPass, parseCoverageSummary, computeCoverageDelta, mapFilesToSpecs, clearPreviousCoverage, } from './handlers/on-test-pass.js';
14
- export { handleOnCommit, installGitHook, uninstallGitHook } from './handlers/on-commit.js';
15
- export { handleOnImplChange, isSourceFile, findRelatedSpecs, isRateLimited as isImplChangeRateLimited, clearRateLimitTimestamps as clearImplChangeTimestamps, } from './handlers/on-impl-change.js';
16
- export { handleOnSpecChange, isSpecFile } from './handlers/on-spec-change.js';
17
- export { handleStatusChange, emitSpecStatusChange, subscribeStatusChangeHandler, extractStatusChangePayload, isDashboardRateLimited, clearRegenTimestamps, } from './handlers/on-status-change.js';
18
- export { handleOnPushCheck, isSpecRelatedFile, isSecuritySensitiveFilePath, computeDriftScore, detectSecuritySensitivePaths, getLastPushCheckResult, resetPushCheckCache, } from './handlers/on-push-check.js';
19
- export { handleOnSecurityCheck, isSecuritySensitiveFile, isDependencyFile, isInCooldown as isSecurityCooldown, resetSecurityCooldown, getLastSecurityCheckResult, resetSecurityCheckCache, } from './handlers/on-security-check.js';
20
- //# sourceMappingURL=index.d.ts.map
@@ -1,25 +0,0 @@
1
- // engine/hooks/index.ts — Barrel export for hooks engine (SPEC-071)
2
- export { dispatchEvent, executeHook, dryRunDispatch } from './core.js';
3
- export { buildSpecCreatedPayload, buildStatusChangePayload, buildDriftDetectedPayload, buildCommitPayload, matchesFilter, matchesGlob, } from './triggers.js';
4
- export { generateGitHookScript, generateGitHooks, formatGitHookInstallGuide, } from './git-hook-generator.js';
5
- export { listTemplateNames, getTemplate, getAllTemplates } from './templates.js';
6
- // SPEC-129 — File Event Hooks
7
- export { FileWatcher, globToRegex, matchesGlobPattern, matchesPatterns } from './file-watcher.js';
8
- export { Debouncer } from './debouncer.js';
9
- export { ConfigLoader } from './config-loader.js';
10
- export { handleOnSave, extractSpecAnnotations, getStoredHash, setStoredHash, removeStoredHash, clearStoredHashes, } from './handlers/on-save.js';
11
- export { handleOnCreate } from './handlers/on-create.js';
12
- export { handleOnDelete } from './handlers/on-delete.js';
13
- // SPEC-130 — Hook Engine Advanced
14
- export { HookEngine } from './hook-engine.js';
15
- export { EventBus } from './event-bus.js';
16
- export { handleOnTestPass, parseCoverageSummary, computeCoverageDelta, mapFilesToSpecs, clearPreviousCoverage, } from './handlers/on-test-pass.js';
17
- export { handleOnCommit, installGitHook, uninstallGitHook } from './handlers/on-commit.js';
18
- // SPEC-137 — Auto-reconcile and progress tracking
19
- export { handleOnImplChange, isSourceFile, findRelatedSpecs, isRateLimited as isImplChangeRateLimited, clearRateLimitTimestamps as clearImplChangeTimestamps, } from './handlers/on-impl-change.js';
20
- export { handleOnSpecChange, isSpecFile } from './handlers/on-spec-change.js';
21
- export { handleStatusChange, emitSpecStatusChange, subscribeStatusChangeHandler, extractStatusChangePayload, isDashboardRateLimited, clearRegenTimestamps, } from './handlers/on-status-change.js';
22
- // SPEC-138 — Automated drift detection and security audits
23
- export { handleOnPushCheck, isSpecRelatedFile, isSecuritySensitiveFilePath, computeDriftScore, detectSecuritySensitivePaths, getLastPushCheckResult, resetPushCheckCache, } from './handlers/on-push-check.js';
24
- export { handleOnSecurityCheck, isSecuritySensitiveFile, isDependencyFile, isInCooldown as isSecurityCooldown, resetSecurityCooldown, getLastSecurityCheckResult, resetSecurityCheckCache, } from './handlers/on-security-check.js';
25
- //# sourceMappingURL=index.js.map
@@ -1,22 +0,0 @@
1
- import type { CrudStore } from '../types/index.js';
2
- /**
3
- * Create a generic CRUD store backed by a single JSON array file per project.
4
- *
5
- * @param fileName - File name relative to `projectDataDir(projectId)/`, e.g. `"patterns.json"`.
6
- *
7
- * All mutating methods (add / update / remove) acquire a per-file lock via
8
- * `withFileLock` to prevent concurrent-write races.
9
- *
10
- * @example
11
- * ```ts
12
- * const store = createCrudStore<MyEntity>('my-entities.json');
13
- * const all = await store.list(projectId);
14
- * await store.add(projectId, { id: 'x', ... });
15
- * await store.update(projectId, 'x', { field: 'value' });
16
- * await store.remove(projectId, 'x');
17
- * ```
18
- */
19
- export declare function createCrudStore<T extends {
20
- id: string;
21
- }>(fileName: string): CrudStore<T>;
22
- //# sourceMappingURL=crud-store-factory.d.ts.map
@@ -1,72 +0,0 @@
1
- // storage/crud-store-factory.ts — Generic CRUD store factory
2
- // Kept in a separate file so that tests mocking base-store.js can intercept
3
- // readJson / writeJson calls made by the factory (ESM live binding rule).
4
- import { readJson, writeJson, projectDataDir } from './base-store.js';
5
- import { withFileLock } from './file-mutex.js';
6
- /**
7
- * Create a generic CRUD store backed by a single JSON array file per project.
8
- *
9
- * @param fileName - File name relative to `projectDataDir(projectId)/`, e.g. `"patterns.json"`.
10
- *
11
- * All mutating methods (add / update / remove) acquire a per-file lock via
12
- * `withFileLock` to prevent concurrent-write races.
13
- *
14
- * @example
15
- * ```ts
16
- * const store = createCrudStore<MyEntity>('my-entities.json');
17
- * const all = await store.list(projectId);
18
- * await store.add(projectId, { id: 'x', ... });
19
- * await store.update(projectId, 'x', { field: 'value' });
20
- * await store.remove(projectId, 'x');
21
- * ```
22
- */
23
- export function createCrudStore(fileName) {
24
- function filePath(projectId) {
25
- return `${projectDataDir(projectId)}/${fileName}`;
26
- }
27
- return {
28
- async list(projectId) {
29
- return readJson(filePath(projectId), []);
30
- },
31
- async get(projectId, id) {
32
- const items = await readJson(filePath(projectId), []);
33
- return items.find((item) => item.id === id);
34
- },
35
- async add(projectId, item) {
36
- const fp = filePath(projectId);
37
- await withFileLock(fp, async () => {
38
- const items = await readJson(fp, []);
39
- items.push(item);
40
- await writeJson(fp, items);
41
- });
42
- },
43
- async update(projectId, id, updates) {
44
- const fp = filePath(projectId);
45
- await withFileLock(fp, async () => {
46
- const items = await readJson(fp, []);
47
- const idx = items.findIndex((item) => item.id === id);
48
- if (idx === -1) {
49
- throw new Error(`[Planu] Item "${id}" not found in ${fileName} for project "${projectId}"`);
50
- }
51
- const existing = items[idx];
52
- /* v8 ignore next 5 */
53
- if (!existing) {
54
- throw new Error(`[Planu] Item "${id}" not found in ${fileName} for project "${projectId}"`);
55
- }
56
- items[idx] = { ...existing, ...updates, id };
57
- await writeJson(fp, items);
58
- });
59
- },
60
- async remove(projectId, id) {
61
- const fp = filePath(projectId);
62
- await withFileLock(fp, async () => {
63
- const items = await readJson(fp, []);
64
- const filtered = items.filter((item) => item.id !== id);
65
- if (filtered.length !== items.length) {
66
- await writeJson(fp, filtered);
67
- }
68
- });
69
- },
70
- };
71
- }
72
- //# sourceMappingURL=crud-store-factory.js.map