prjct-cli 1.56.12 → 2.1.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 CHANGED
@@ -1,5 +1,382 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.0] - 2026-04-22
4
+
5
+ ### Features
6
+
7
+ - current work
8
+
9
+
10
+ ## [2.0.0-alpha.12] - 2026-04-21
11
+
12
+ Summary of the alpha.6 → alpha.12 arc and the dead-code / harness sweep
13
+ that closed it. Covers five commits on `v2/cut`: 28eb87e0, e3a163cb,
14
+ 4c661bde, d59612a5, b1cd664f.
15
+
16
+ ### Added (alpha.6 → alpha.11, landed earlier in the arc)
17
+ - **Hook pack**: `prjct claude install` writes 7 passive hooks into
18
+ `~/.claude/settings.json` (SessionStart / UserPromptSubmit /
19
+ PreToolUse / PostToolUse / Stop / SubagentStart / CwdChanged).
20
+ Each hook emits `additionalContext` from project memory + persona;
21
+ nothing blocks unless a hand-rolled workflow rule says so.
22
+ - **Persona per project** (`.prjct/prjct.config.json#persona`):
23
+ `role`, `focus`, `mcps`, `packs`. Injected by every hook.
24
+ - **Packs (5)**: `code`, `daily`, `pm`, `founder`, `research` as
25
+ declarative JSON manifests — no bash seeded, just memory types +
26
+ workflow-slot names + hook signals + suggested persona.
27
+ - **`prjct capture`** — GTD inbox verb. Bare `prjct "..."` now
28
+ routes here (was `task`).
29
+ - **14 base memory types + user-defined**: `fact`, `decision`,
30
+ `learning`, `gotcha`, `pattern`, `anti-pattern`, `shipped`,
31
+ `inbox`, `todo`, `idea`, `insight`, `question`, `source`,
32
+ `person`. Any lowercase identifier also accepted.
33
+ - **Workflow step types**: `script:<path>`, `mcp:<server>:<tool>`,
34
+ `persona:context`. Scripts live in `.prjct/workflows/*.sh` and
35
+ receive `PRJCT_BRANCH` / `PRJCT_FILES_CHANGED` / `PRJCT_TAGS` env.
36
+
37
+ ### Removed (this sweep — 16,859 LOC across 58 files)
38
+ - **Outcome subsystem** (`outcome-recorder/storage/learner/analyzer`):
39
+ zero write callsites anywhere in the codebase; every read returned
40
+ empty. Downstream velocity / estimate-history / learn-from-outcomes
41
+ features went with it.
42
+ - **Agentic stack** (`command-executor`, `loop-detector`,
43
+ `plan-mode`, `context-builder`, `prompt-builder`,
44
+ `orchestrator-executor`, `memory-system`, `semantic-memories`,
45
+ `pattern-store`, `memory-stores`, `domain-classifier`,
46
+ `response-validator`). `workflow.now()` (`prjct task` entry
47
+ point) rewired to persist via `stateStorage` directly +
48
+ `executeWorkflowRules`; no more detour through the orchestration
49
+ chain.
50
+ - **Pre-v2 MCP tools** (`patterns.ts`, `session.ts`, `review.ts`,
51
+ `context.ts`): duplicated what `projectMemory` already does.
52
+ `prjct_mem_save / _list / _similar / _forget` in `memory.ts` is
53
+ now the single MCP memory surface, wired to `projectMemory`.
54
+ `prjct_patterns` in `project.ts` reads the same store.
55
+ - **Six outcome-backed MCP tools** (`prjct_velocity`,
56
+ `_outcomes_search`, `_outcomes_similar`, `_outcomes_recent`,
57
+ `_estimate_accuracy`, `_velocity_detail`).
58
+ - **Ghost verbs** (`sessions`, `tokens` — no handlers).
59
+ - **Harness CLI context subtools** (`files`, `signatures`,
60
+ `imports`, `recent`, `summary` under `prjct context` — Claude has
61
+ Glob / Grep / Read / git natively). Internals kept for MCP.
62
+ - **Seven phantom dispatcher entries** (`diff`, `seal`, `rollback`,
63
+ `verify`, `analysis-payload`, `analysis-save-llm`, `analysis-llm`)
64
+ that routed to methods deleted in earlier alphas — 8 pre-existing
65
+ TS errors gone.
66
+ - **Gate cache** + **bilingual NL parser** in `workflow.ts` (alpha.10).
67
+ - **Obsolete config files / types / utils**: `core/cli/arg-parser`,
68
+ `core/events/pub-sub`, `core/schemas/roadmap`,
69
+ `core/session/task-session-manager`, `core/session/utils`,
70
+ `core/commands/context-contract`, `core/schemas/outcomes`,
71
+ `core/schemas/classification`, `core/schemas/llm-output`,
72
+ `core/constants/commands`, `core/session/session-log-manager`,
73
+ `core/tools/context/recent-tool`, `core/utils/agent-stream`,
74
+ `core/utils/jsonl-helper`, `core/utils/subtask-table`.
75
+
76
+ ### Changed
77
+ - `workflow.now()` 346 → ~120 LOC. `prjct task` (no arg) now shows
78
+ the active task instead of failing validation; `command-data.ts`
79
+ marks the description optional.
80
+ - `context.ts#context` emits the same JSON shape but `domains` /
81
+ `primaryDomain` / `subtasks` are empty — no more intent guessing.
82
+ Use `prjct tag` to classify explicitly.
83
+ - `analysis.ts` inlines `pathManager.getFilePath` instead of pulling
84
+ `contextBuilder`. Stats endpoint keeps its output shape for
85
+ backward compat; `patternsSummary` fields are zeros.
86
+ - `shipping.ts` drops `memorySystem.learnDecision` /
87
+ `recordWorkflow` calls — redundant with `shippedStorage.addShipped`
88
+ (which `projectMemory` reads as `type=shipped`).
89
+ - MCP server registers 5 tool groups (was 9): memory, project,
90
+ files, workflow, code-intel.
91
+
92
+ ### Verified
93
+ `prjct init --pack … --persona …`, `sync`, `task` (with + without
94
+ arg), `remember`, `capture`, `context memory`, `seed list`,
95
+ `SessionStart` / `CwdChanged` hooks with persona — all green on a
96
+ fresh tmp project. `bun test`: 756 pass / 0 fail. `tsc --noEmit`: 0
97
+ errors (was 8 pre-existing). `knip`: 0 unused files.
98
+
99
+ ## [2.0.0-alpha.5] - 2026-04-20
100
+
101
+ Wiki performance pass — answers the "SQLite vs Obsidian markdown graph"
102
+ question by making the hybrid (SQLite source-of-truth + markdown cache)
103
+ cheap enough that there's no reason to pick only one.
104
+
105
+ ### Incremental regen (O-1)
106
+ `core/services/wiki-generator.ts` now keeps a `.manifest.json` of
107
+ `{relPath: sha256}` per generated file. On regen:
108
+ - build every file body in memory
109
+ - sha256 each, diff against the manifest
110
+ - write only files whose hash changed
111
+ - delete files that were in the old manifest but not the new
112
+ - always rewrite the manifest itself (tiny)
113
+
114
+ For the common delta (one new memory entry touching 1-2 files), the
115
+ wiki now writes those 1-2 files instead of the whole tree. ~100ms →
116
+ <5ms in the write-bound case.
117
+
118
+ ### Deferred under daemon (O-2)
119
+ New `regenerateWikiDeferred(projectPath, projectId)`. When the daemon
120
+ sets `PRJCT_IN_DAEMON=1`, it fires the regen via `setImmediate` and
121
+ returns immediately — the CLI response flushes before the regen
122
+ touches disk. CLI path (no daemon) still awaits because
123
+ `process.exit` would drop the pending promise. `primitives.remember`
124
+ and `shipping.ship` call the deferred wrapper.
125
+
126
+ ### File-size cap via chunking (O-3)
127
+ Any memory bucket (type or tag-value pair) with more than 50 entries
128
+ is paginated:
129
+
130
+ ```
131
+ memory/decision.md ← index with links
132
+ memory/decision/chunk-1.md ← 50 entries
133
+ memory/decision/chunk-2.md ← 50 entries
134
+
135
+ ```
136
+
137
+ Tag pages go deeper: `tags/<key>/<value>.md` instead of cramming all
138
+ values under a single `tags/<key>.md`. An agent that reads one chunk
139
+ or one tag page stays under ~5K tokens regardless of corpus size.
140
+
141
+ ### Bottom line
142
+ The hybrid is now the right answer on every axis: SQLite still wins
143
+ writes + complex queries, markdown still wins LLM comprehension +
144
+ token-per-read, and the cost of keeping them in sync is near-zero.
145
+
146
+ ## [2.0.0-alpha.4] - 2026-04-20
147
+
148
+ Quality pass — applies every finding from the three-round line-by-line
149
+ review. No new user-facing verbs; everything is tightening what's already
150
+ in alpha.3.
151
+
152
+ ### DRY
153
+ - `core/commands/verb-names.ts` — single source for the auto-route
154
+ allowlist, imported by both bin (zero-heavy-imports path) and the
155
+ daemon dispatcher. Adding a verb touches one list instead of two.
156
+ - `core/memory/events.ts` — constants for event prefixes so
157
+ `'memory.remember.%'`, `'memory.task.tagged'`, etc. stop drifting
158
+ between writer and reader.
159
+ - `core/commands/guards.ts` — `requireProjectId` / `requireActiveTask`
160
+ helpers kill the duplicated 3-line preamble every v2 primitive used to
161
+ carry.
162
+ - `MEMORY_TYPES` is now a single `const` tuple in `project-memory.ts`
163
+ with the `MemoryType` union derived from it. `primitives.ts` imports it
164
+ instead of maintaining a parallel list.
165
+
166
+ ### Perf
167
+ - Workflow engine hot path: dynamic imports moved to static top-level,
168
+ the two `git diff` execs run in parallel, and `buildWhenContext` is
169
+ skipped entirely unless a rule in this phase actually reads it
170
+ (conditional rule or gate). Saves ~30ms on the plain hook/step case.
171
+ - `when-evaluator.globToRegex` single-pass walker with a compile cache.
172
+ Same pattern tested against N files only compiles once.
173
+
174
+ ### Bugs / UX
175
+ - `prjct status` (no args) now shows the real task status recovered from
176
+ `status.changed` events instead of misrepresenting the task `type` tag
177
+ as the status.
178
+ - Auto-route no longer swallows typos: a single-token input within
179
+ edit-distance 2 of a known verb surfaces a `did you mean` instead of
180
+ silently creating `prjct task "shipp"`.
181
+
182
+ ### Security
183
+ - Wiki lives at `.prjct/wiki/_generated/`. The top-level `.prjct/wiki/`
184
+ is user-owned — any notes you put there survive rebuilds. Only the
185
+ generated subdir gets wiped.
186
+ - Workflow rules gain `trust_source` (schema v14). Rules with
187
+ `trustSource === 'imported'` refuse to run their shell action, buying
188
+ forward-compat for a future template registry without shipping it as
189
+ an arbitrary-code-execution vector.
190
+ - `prjct remember` refuses content matching obvious secret patterns
191
+ (sk-… tokens, GitHub PATs, AWS access keys, Slack tokens, bearer
192
+ JWT-ish strings) unless `--force` is passed.
193
+
194
+ ### Cleanup / smell
195
+ - Magic numbers in `recall()` replaced with `OVERFETCH_FACTOR` and
196
+ `DEFAULT_RECALL_LIMIT` constants with comments explaining the 4×.
197
+ - Wiki regenerates on `prjct remember` too — not just `prjct ship`.
198
+ Subagents reading `_generated/` see newly captured memory without
199
+ waiting for the next ship.
200
+ - Wiki now surfaces inferred `patterns` + `anti-patterns` from
201
+ `prjct sync`, rendered at `_generated/patterns.md` with an
202
+ INFR provenance note so agents can weight them accordingly.
203
+ - Fragile `§§` glob placeholder replaced by a single-pass walker.
204
+
205
+ ### Schema
206
+ New migration v14 `workflow-rules-trust-source`:
207
+ - `workflow_rules.trust_source TEXT NOT NULL DEFAULT 'local'`
208
+
209
+ ## [2.0.0-alpha.3] - 2026-04-20
210
+
211
+ Fourth alpha — adds two high-leverage borrows from the graphify review:
212
+ provenance tags on memory entries and an agent-crawlable wiki under
213
+ `.prjct/wiki/`.
214
+
215
+ ### Memory provenance
216
+ Every `MemoryEntry` now carries a `provenance` field so Claude can
217
+ calibrate trust when reading memory:
218
+
219
+ DECL — declared by user / LLM via `prjct remember`
220
+ EXTR — extracted from verifiable project state (ships, tags)
221
+ INFR — inferred by pattern extractor or heuristic (weakest)
222
+ AMBG — mixed / unclear
223
+
224
+ Surfaced as a prefix in `prjct context memory --md`:
225
+
226
+ ### DECISION
227
+ - `DECL` [mem_15] use SQLite
228
+ ### LEARNING
229
+ - `DECL` [mem_8] bun faster than npm _(area=perf)_
230
+
231
+ Ships auto-tag as `EXTR`; user `remember` calls default to `DECL`. Future
232
+ pattern/heuristic-backed entries can override with `INFR`.
233
+
234
+ ### Agent-crawlable wiki
235
+ New `core/services/wiki-generator.ts` writes `.prjct/wiki/` on every
236
+ `prjct ship`:
237
+
238
+ .prjct/wiki/
239
+ index.md — entry point with links to everything
240
+ ships/<slug>.md — one file per shipped feature
241
+ memory/<type>.md — one file per memory type
242
+ tags/<key>.md — one file per tag key
243
+
244
+ Subagents can read these with native Read/Glob — no CLI round-trip into
245
+ SQLite, zero tokens until the file is opened. New `prjct context wiki`
246
+ rebuilds on demand.
247
+
248
+ ### Why these, not the rest of graphify
249
+ graphify's knowledge-graph engine (NetworkX + Leiden + vis.js) is a
250
+ harness pattern that duplicates what the LLM + file-scorer already do for
251
+ a solo-dev codebase. Multimodal PDF ingest is out of scope. The
252
+ long-running `--watch` daemon burns tokens. The `--mcp` server fragments
253
+ the toolbox. We took the two ideas that fit the v2 philosophy and left
254
+ the rest.
255
+
256
+ Hash cache + post-commit hook were already present in prjct
257
+ (`core/domain/file-hasher.ts` + `core/services/hooks-service.ts`) — no
258
+ duplication needed.
259
+
260
+ ## [2.0.0-alpha.2] - 2026-04-19
261
+
262
+ Third alpha — finishes the workflow engine upgrades from the Phase 4 plan.
263
+ Custom workflows can now be written once and execute efficiently.
264
+
265
+ ### Conditional rules
266
+ New `when_expr` column on `workflow_rules` with a tiny DSL:
267
+
268
+ ```
269
+ when: tags:type=bug
270
+ when: branch~main files:*.ts
271
+ when: tags:domain=frontend
272
+ ```
273
+
274
+ Supported: `tags:key=value` / `tags:key~value` (contains), `branch=` / `branch~`,
275
+ `files:<glob>` (glob against the current diff). Multiple tokens AND
276
+ together. Empty / null → unconditional.
277
+
278
+ ### Parallel hooks
279
+ Hooks now run concurrently via `Promise.all` by default. Opt out per rule
280
+ with `parallel: false` — those run sequentially ahead of the batch so
281
+ ordering-dependent cleanups still work. Gates and steps stay sequential.
282
+ Typical speedup on the common "3 independent hooks" case: ~3x.
283
+
284
+ ### Gate result cache
285
+ Gate passes are cached in a new `workflow_rule_cache` table, keyed on
286
+ `(files changed, tags, branch)`. Default TTL 1 h. Only successful passes
287
+ are cached — failures always re-run so the user sees a fresh error. Any
288
+ rule edit invalidates its cache. The win: `tsc` / `eslint` gates don't
289
+ re-run on every task start when nothing relevant has moved.
290
+
291
+ ### Schema
292
+ New migration `v13 workflow-rules-v2`:
293
+ - `workflow_rules.when_expr TEXT` (nullable)
294
+ - `workflow_rules.parallel INTEGER NOT NULL DEFAULT 1`
295
+ - `workflow_rule_cache(rule_id, context_hash, ran_at, ttl_ms)` table
296
+
297
+ All backward-compatible: existing rules keep running without `when_expr`
298
+ and with parallel=true.
299
+
300
+ ### New files
301
+ - `core/workflow/when-evaluator.ts` — DSL parser + evaluator (~100 LOC)
302
+ - `core/workflow/gate-cache.ts` — cache API + SHA-256 context hasher
303
+
304
+ ## [2.0.0-alpha.1] - 2026-04-19
305
+
306
+ Second alpha — finishes the four-PR arc planned for v2 so the new shape is
307
+ usable, not just carved out.
308
+
309
+ ### Auto-route (PR 2)
310
+ - `prjct arregla el checkout lento` → `prjct task "arregla el checkout lento"`.
311
+ Unknown verbs flow straight to task; explicit verbs still win. Works with
312
+ and without the daemon (bin/prjct.ts uses a hardcoded allowlist, core
313
+ dispatcher checks the registry).
314
+
315
+ ### Lazy context (PR 3)
316
+ - `prjct task` output collapsed from ~2,400 chars to ~400. No more eager
317
+ `findRelevantFiles` / pattern briefing / RPI / efficiency sections at
318
+ task start — Claude pulls them on demand.
319
+ - New context topics:
320
+ prjct context memory [topic] → facts, decisions, learnings…
321
+ prjct context learnings [topic] → learning + anti-pattern + gotcha
322
+
323
+ ### Project memory API (PR 4)
324
+ - `core/memory/project-memory.ts` — one surface over events-table entries
325
+ (from `prjct remember`) and `shipped_features` rows. Exposes
326
+ `remember / recall / similar` plus a compact markdown renderer.
327
+ - `prjct remember` auto-captures the active task id as `source`.
328
+
329
+ ### Workflow engine (PR 4)
330
+ - Step actions with prefix `status:` run through the state-machine instead
331
+ of `execAsync`. Custom workflows can now do:
332
+ - step: lint
333
+ - step: test
334
+ - step: status:shipped
335
+ and the final step closes the loop declaratively.
336
+
337
+ ### Fixes
338
+ - `tag` param spec `<pairs...>` — previous `<k:v> [<k:v>...]` tripped
339
+ `validateCommandParams` and blocked valid invocations.
340
+
341
+ ## [2.0.0-alpha.0] - 2026-04-19
342
+
343
+ **BREAKING.** First alpha of the v2 rewrite — "toolbox for LLMs, not harness".
344
+
345
+ ### Removed integrations (pure MCP gateways, no native value)
346
+ - `prjct jira` — use Jira MCP directly
347
+ - `prjct linear` — use Linear MCP directly
348
+ - `prjct obsidian` — use Obsidian MCP or a custom hook
349
+
350
+ ### Removed verbs (status-changes & ceremony)
351
+ - `done`, `pause`, `resume`, `next` — status transitions, handled by workflows or `prjct status`
352
+ - `bug`, `idea`, `spec` — replaced by `prjct task` + `prjct tag type:bug`
353
+ - `cleanup`, `undo`, `redo`, `history`, `recover`, `enrich`, `design` — maintenance ceremony
354
+ - `dash`, `stats`, `perf`, `velocity`, `tokens`, `sessions` — observability, not primitives
355
+ - `worktree`, `parallel`, `conductor` — harness patterns
356
+
357
+ ### New primitives
358
+ - `prjct status [value]` — inline task status change (Linear-style escape hatch)
359
+ - `prjct tag <k:v> [<k:v>...]` — Claude attaches tags; no heuristic classifier
360
+ - `prjct remember <type> "<content>"` — capture project memory (fact, decision, learning, gotcha, pattern, anti-pattern, shipped)
361
+
362
+ ### CLI surface (v2 minimal)
363
+ - Core: `task`, `ship`, `workflow`, `context`, `status`, `tag`, `remember`
364
+ - Bootstrap: `init`, `setup`, `login`, `logout`, `update`, `uninstall`
365
+
366
+ ### Skills (~/.claude/skills/)
367
+ - Kept: `prjct-context`, `prjct-task` (toolbox-style rewrite), `prjct-ship`, `prjct-workflow`
368
+ - Dropped: 12 dead skills matching removed commands
369
+
370
+ ### Stats
371
+ - ~7,000 LOC removed across integrations, aux commands, templates, and tests
372
+ - Skills bundle: 16 → 4 | templates bundle: 71 → 52 files
373
+ - Build output: 1.61 MB → 1.40 MB (-13%)
374
+
375
+ ### Coming next (not in this alpha)
376
+ - PR 2 — dispatcher auto-route (`prjct "fix bug"` → `prjct task`)
377
+ - PR 3 — lazy context injection (`prjct task` < 50 tokens)
378
+ - PR 4 — workflow engine upgrade: status-transitions as steps, conditionals, parallel hooks, cache, rich project-memory API
379
+
3
380
  ## [1.56.12] - 2026-04-14
4
381
 
5
382
  ### Bug Fixes