@workflow-cannon/workspace-kit 0.14.0 → 0.16.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 (28) hide show
  1. package/README.md +55 -106
  2. package/dist/modules/approvals/review-runtime.js +3 -11
  3. package/dist/modules/improvement/generate-recommendations-runtime.js +3 -11
  4. package/dist/modules/index.d.ts +2 -0
  5. package/dist/modules/index.js +1 -0
  6. package/dist/modules/task-engine/index.d.ts +5 -0
  7. package/dist/modules/task-engine/index.js +327 -17
  8. package/dist/modules/task-engine/migrate-task-persistence-runtime.d.ts +2 -0
  9. package/dist/modules/task-engine/migrate-task-persistence-runtime.js +192 -0
  10. package/dist/modules/task-engine/planning-config.d.ts +10 -0
  11. package/dist/modules/task-engine/planning-config.js +37 -0
  12. package/dist/modules/task-engine/planning-open.d.ts +16 -0
  13. package/dist/modules/task-engine/planning-open.js +34 -0
  14. package/dist/modules/task-engine/sqlite-dual-planning.d.ts +21 -0
  15. package/dist/modules/task-engine/sqlite-dual-planning.js +137 -0
  16. package/dist/modules/task-engine/store.d.ts +12 -3
  17. package/dist/modules/task-engine/store.js +62 -38
  18. package/dist/modules/task-engine/wishlist-store.d.ts +23 -0
  19. package/dist/modules/task-engine/wishlist-store.js +108 -0
  20. package/dist/modules/task-engine/wishlist-types.d.ts +33 -0
  21. package/dist/modules/task-engine/wishlist-types.js +5 -0
  22. package/dist/modules/task-engine/wishlist-validation.d.ts +16 -0
  23. package/dist/modules/task-engine/wishlist-validation.js +96 -0
  24. package/package.json +11 -2
  25. package/src/modules/documentation/README.md +1 -0
  26. package/src/modules/documentation/instructions/document-project.md +1 -0
  27. package/src/modules/documentation/instructions/generate-document.md +1 -0
  28. package/src/modules/documentation/templates/README.md +89 -0
@@ -0,0 +1,96 @@
1
+ /** Wishlist identifiers use a dedicated namespace: `W` + digits (e.g. `W1`, `W42`). */
2
+ export const WISHLIST_ID_RE = /^W\d+$/;
3
+ const REQUIRED_STRING_FIELDS = [
4
+ "title",
5
+ "problemStatement",
6
+ "expectedOutcome",
7
+ "impact",
8
+ "constraints",
9
+ "successSignals",
10
+ "requestor",
11
+ "evidenceRef"
12
+ ];
13
+ function nonEmptyString(v, label) {
14
+ if (typeof v !== "string" || v.trim().length === 0) {
15
+ return null;
16
+ }
17
+ return v.trim();
18
+ }
19
+ /**
20
+ * Validates intake fields for creating or replacing content on an open wishlist item.
21
+ * Wishlist items never carry a Task Engine `phase`; reject if present.
22
+ */
23
+ export function validateWishlistIntakePayload(args) {
24
+ const errors = [];
25
+ if ("phase" in args && args.phase !== undefined) {
26
+ errors.push("Wishlist items must not include 'phase'; only canonical tasks are phased.");
27
+ }
28
+ const id = typeof args.id === "string" ? args.id.trim() : "";
29
+ if (!id) {
30
+ errors.push("Wishlist 'id' is required.");
31
+ }
32
+ else if (!WISHLIST_ID_RE.test(id)) {
33
+ errors.push(`Wishlist 'id' must match ${WISHLIST_ID_RE.source} (e.g. W1).`);
34
+ }
35
+ for (const key of REQUIRED_STRING_FIELDS) {
36
+ const s = nonEmptyString(args[key], key);
37
+ if (s === null) {
38
+ errors.push(`Wishlist '${key}' is required and must be a non-empty string.`);
39
+ }
40
+ }
41
+ if (errors.length > 0) {
42
+ return { ok: false, errors };
43
+ }
44
+ return { ok: true };
45
+ }
46
+ export function buildWishlistItemFromIntake(args, timestamp) {
47
+ const id = args.id.trim();
48
+ const item = {
49
+ id,
50
+ status: "open",
51
+ title: args.title.trim(),
52
+ problemStatement: args.problemStatement.trim(),
53
+ expectedOutcome: args.expectedOutcome.trim(),
54
+ impact: args.impact.trim(),
55
+ constraints: args.constraints.trim(),
56
+ successSignals: args.successSignals.trim(),
57
+ requestor: args.requestor.trim(),
58
+ evidenceRef: args.evidenceRef.trim(),
59
+ createdAt: timestamp,
60
+ updatedAt: timestamp
61
+ };
62
+ return item;
63
+ }
64
+ export function validateWishlistUpdatePayload(updates) {
65
+ if ("phase" in updates && updates.phase !== undefined) {
66
+ return { ok: false, errors: ["Wishlist updates cannot set 'phase'."] };
67
+ }
68
+ const errors = [];
69
+ const allowed = new Set([
70
+ "title",
71
+ "problemStatement",
72
+ "expectedOutcome",
73
+ "impact",
74
+ "constraints",
75
+ "successSignals",
76
+ "requestor",
77
+ "evidenceRef"
78
+ ]);
79
+ for (const key of Object.keys(updates)) {
80
+ if (!allowed.has(key)) {
81
+ errors.push(`Cannot update unknown or immutable wishlist field '${key}'.`);
82
+ }
83
+ }
84
+ for (const key of REQUIRED_STRING_FIELDS) {
85
+ if (key in updates) {
86
+ const s = nonEmptyString(updates[key], key);
87
+ if (s === null) {
88
+ errors.push(`Wishlist '${key}' must be a non-empty string when provided.`);
89
+ }
90
+ }
91
+ }
92
+ if (errors.length > 0) {
93
+ return { ok: false, errors };
94
+ }
95
+ return { ok: true };
96
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workflow-cannon/workspace-kit",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "private": false,
5
5
  "packageManager": "pnpm@10.0.0",
6
6
  "license": "MIT",
@@ -41,6 +41,7 @@
41
41
  "ui:watch": "cd extensions/cursor-workflow-cannon && npm run watch"
42
42
  },
43
43
  "devDependencies": {
44
+ "@types/better-sqlite3": "^7.6.13",
44
45
  "@types/node": "^25.5.0",
45
46
  "typescript": "^5.9.3"
46
47
  },
@@ -48,5 +49,13 @@
48
49
  "dist",
49
50
  "src/modules/documentation",
50
51
  "package.json"
51
- ]
52
+ ],
53
+ "dependencies": {
54
+ "better-sqlite3": "^12.8.0"
55
+ },
56
+ "pnpm": {
57
+ "onlyBuiltDependencies": [
58
+ "better-sqlite3"
59
+ ]
60
+ }
52
61
  }
@@ -24,6 +24,7 @@ Files under `templates/`; `documentType` is the filename (basename). Keep this l
24
24
  - `AGENTS.md`
25
25
  - `ARCHITECTURE.md`
26
26
  - `PRINCIPLES.md`
27
+ - `README.md`
27
28
  - `RELEASING.md`
28
29
  - `ROADMAP.md`
29
30
  - `SECURITY.md`
@@ -18,6 +18,7 @@ All `.md` files under `sources.templatesRoot` (default `src/modules/documentatio
18
18
  - `AGENTS.md`
19
19
  - `ARCHITECTURE.md`
20
20
  - `PRINCIPLES.md`
21
+ - `README.md`
21
22
  - `RELEASING.md`
22
23
  - `ROADMAP.md`
23
24
  - `SECURITY.md`
@@ -8,6 +8,7 @@ Generate a single document for both canonical AI and human-readable surfaces usi
8
8
  - `AGENTS.md`
9
9
  - `ARCHITECTURE.md`
10
10
  - `PRINCIPLES.md`
11
+ - `README.md`
11
12
  - `RELEASING.md`
12
13
  - `ROADMAP.md`
13
14
  - `SECURITY.md`
@@ -0,0 +1,89 @@
1
+ <!--
2
+ Human output path: docs/maintainers/README.md (image uses ../title_image.png from that location).
3
+ Root README.md: mirror this body but use title_image.png and keep the agent notice line at the very top.
4
+ Audience: developers cloning the repo or adding @workflow-cannon/workspace-kit to a project who want to run something useful in minutes.
5
+ -->
6
+
7
+ <div align="center">
8
+ <img src="../title_image.png" alt="Workflow Cannon" width="720" />
9
+ </div>
10
+
11
+ # Workflow Cannon
12
+
13
+ **[`@workflow-cannon/workspace-kit`](https://www.npmjs.com/package/@workflow-cannon/workspace-kit)** — CLI, task engine, and workflow contracts for repos that want deterministic, policy-governed automation with clear evidence.
14
+
15
+ ## Quick start (clone this repo)
16
+
17
+ **Needs:** Node.js **22+** (see CI), **pnpm 10** (see `packageManager` in `package.json`).
18
+
19
+ ```bash
20
+ git clone https://github.com/NJLaPrell/workflow-cannon.git
21
+ cd workflow-cannon
22
+ pnpm install
23
+ pnpm run build
24
+ ```
25
+
26
+ Verify the kit sees your workspace:
27
+
28
+ ```bash
29
+ node dist/cli.js doctor
30
+ node dist/cli.js --help
31
+ ```
32
+
33
+ Try **read-only** task-engine queries:
34
+
35
+ ```bash
36
+ node dist/cli.js run list-tasks '{}'
37
+ node dist/cli.js run get-next-actions '{}'
38
+ ```
39
+
40
+ **Developing:** after edits, `pnpm run build` then `pnpm test` (or `pnpm run phase5-gates` before larger changes). If `workspace-kit` is not on your `PATH`, use `node dist/cli.js …` from the repo root (same as above).
41
+
42
+ ## Quick start (use the package in another project)
43
+
44
+ ```bash
45
+ npm install @workflow-cannon/workspace-kit
46
+ npx workspace-kit --help
47
+ ```
48
+
49
+ Or with pnpm: `pnpm add @workflow-cannon/workspace-kit` then `pnpm exec workspace-kit --help`.
50
+
51
+ ## What this repo contains
52
+
53
+ | Area | What |
54
+ | --- | --- |
55
+ | **CLI** | `workspace-kit` — `doctor`, `config`, `run <module-command>` (see `workspace-kit run` with no args for the list). |
56
+ | **Task engine** | Canonical queue in `.workspace-kit/tasks/state.json`; lifecycle via `run-transition`. Wishlist ideation uses ids `W###` (see maintainer runbooks). |
57
+ | **Docs** | Maintainer process, roadmap, and changelog under `docs/maintainers/`. |
58
+ | **Cursor extension** (optional) | Thin UI in `extensions/cursor-workflow-cannon/` — build with `pnpm run ui:prepare`. |
59
+
60
+ There is **no** built-in IDE slash command like `/qt` from this package; editor integrations are **your** config (e.g. `.cursor/commands/`), while **`workspace-kit`** is the supported CLI.
61
+
62
+ ## Policy and approvals (read this before mutating state)
63
+
64
+ Sensitive `workspace-kit run` commands require JSON **`policyApproval`** in the third CLI argument. Chat approval is not enough. Env-based approval applies to `init` / `upgrade` / `config`, not the `run` path.
65
+
66
+ - **Human guide:** [`docs/maintainers/POLICY-APPROVAL.md`](POLICY-APPROVAL.md)
67
+ - **Copy-paste table:** [`docs/maintainers/AGENT-CLI-MAP.md`](AGENT-CLI-MAP.md)
68
+
69
+ ## Project status and roadmap
70
+
71
+ Release cadence, phase history, and strategic decisions: [`docs/maintainers/ROADMAP.md`](ROADMAP.md). **Live execution queue:** `.workspace-kit/tasks/state.json` (`status` and `id` are authoritative — not this README’s milestone bullets).
72
+
73
+ Snapshot: [`docs/maintainers/data/workspace-kit-status.yaml`](data/workspace-kit-status.yaml).
74
+
75
+ ## Where to go next
76
+
77
+ | Goal | Start here |
78
+ | --- | --- |
79
+ | Goals, trade-offs, gates | [`.ai/PRINCIPLES.md`](../.ai/PRINCIPLES.md) |
80
+ | Roadmap & versions | [`ROADMAP.md`](ROADMAP.md) |
81
+ | Changelog | [`CHANGELOG.md`](CHANGELOG.md) |
82
+ | Release process | [`RELEASING.md`](RELEASING.md) |
83
+ | Glossary | [`TERMS.md`](TERMS.md) |
84
+ | Architecture | [`ARCHITECTURE.md`](ARCHITECTURE.md) |
85
+ | Agent/CLI execution | [`AGENTS.md`](AGENTS.md) |
86
+
87
+ ## License
88
+
89
+ MIT. See [`LICENSE`](../LICENSE) at the repository root.