@amsterdamdatalabs/enact-extensions 0.1.51 → 0.1.55

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.
@@ -8,7 +8,7 @@ disable-model-invocation: true
8
8
 
9
9
  Open a **Feature** on the board and give it a plan folder to live in.
10
10
 
11
- **A plan is a Feature, and a Feature is a directory** — `features/az<id>-<slug>/spec.md`, named for the work item it is. This skill creates that Feature and that directory; `to-workitems` later fills its `items/` with PBIs and Bugs parented under it. Where the repo carries a `plans/AGENTS.md`, it governs; otherwise follow the global `## Plans and work items` contract in your host's agent instructions.
11
+ **A plan is a Feature, and a Feature is a directory** — `plans/features/az<id>-<slug>/spec.md`, named for the work item it is. This skill creates that Feature and that directory; `to-workitems` later fills its `items/` with PBIs and Bugs parented under it. Where the repo carries a `plans/AGENTS.md`, it governs; otherwise follow the global `## Plans and work items` contract in your host's agent instructions.
12
12
 
13
13
  Do NOT interview the user — synthesize what you already know from the conversation and the codebase.
14
14
 
@@ -72,7 +72,7 @@ workitem_create_or_update({
72
72
 
73
73
  ### 6. Record the id, then verify the link landed
74
74
 
75
- Create `features/az<id>-<slug>/` — named with the id the create call just returned, which is the only name it ever has — and write the drafted spec into its `spec.md` with `work_item:` set to that id and `epic:` carried through. Do this **immediately**, before anything else: a crash then leaves a folder that says what exists on the board, rather than a Feature nobody can trace back to a plan.
75
+ Create `plans/features/az<id>-<slug>/` — named with the id the create call just returned, which is the only name it ever has — and write the drafted spec into its `spec.md` with `work_item:` set to that id and `epic:` carried through. Do this **immediately**, before anything else: a crash then leaves a folder that says what exists on the board, rather than a Feature nobody can trace back to a plan.
76
76
 
77
77
  Leave `items/` uncreated. A Feature whose items do not exist yet is the normal resting state of a fresh plan, not an unfinished one.
78
78
 
@@ -1,6 +1,6 @@
1
1
  # The plan document
2
2
 
3
- `features/az<id>-<slug>/spec.md`. **This file IS the Feature** — the long form of its work
3
+ `plans/features/az<id>-<slug>/spec.md`. **This file IS the Feature** — the long form of its work
4
4
  item, not a parallel copy. `## Problem` and `## Solution` are its Description; `## Acceptance
5
5
  criteria` is its Acceptance Criteria field. If the two ever differ, the board is lying.
6
6
 
@@ -52,11 +52,12 @@ Non-goals: [what a reader would wrongly assume is included]
52
52
 
53
53
  ## Items
54
54
 
55
- Order and dependencies. What each delivers lives in its own file under `items/`.
55
+ Order and dependencies. Each row is the complete source for an item that does not have a file
56
+ until `to-workitems` allocates its id.
56
57
 
57
- | # | Item | Work item | Predecessor |
58
- | --- | --- | --- | --- |
59
- | 1 | `az<id>-<slug>.md` | <id> | — |
58
+ | # | Title | Item type | Delivers | Verification | Work item | Predecessor |
59
+ | --- | --- | --- | --- | --- | --- | --- |
60
+ | 1 | [the outcome this slice delivers] | pbi | [the complete vertical slice] | [a falsifiable check] | | — |
60
61
 
61
62
  ## Verification
62
63
 
@@ -17,13 +17,13 @@ Put a plan's **backlog items** on the board.
17
17
  ## Do Not Use When
18
18
 
19
19
  - The plan has open decisions under `## Decisions` — resolve them first, or chart the effort with `wayfinder` if the destination itself is still unclear.
20
- - `epic:` or `feature:` is unset. **Stop and ask.** Never create an Epic or Feature to fill the gap: a typo must fail here, not silently spawn a duplicate. The server refuses a stray Epic outright, and refuses a wrong-*typed* parent for any creatable type — but a right-typed id can still be the **wrong** one, and nothing on the board catches that. Identity is on you.
20
+ - `epic:` or `work_item:` is unset. **Stop and ask.** Those are the plan's Epic id and Feature id respectively. Never create an Epic or Feature to fill the gap: a typo must fail here, not silently spawn a duplicate. The server refuses a stray Epic outright, and refuses a wrong-*typed* parent for any creatable type — but a right-typed id can still be the **wrong** one, and nothing on the board catches that. Identity is on you.
21
21
 
22
22
  ## Process
23
23
 
24
24
  ### 1. Read the plan and check the board
25
25
 
26
- `workitem_list_or_get({ id: <feature>, raw: true })` and assert:
26
+ `workitem_list_or_get({ id: <work_item>, raw: true })` and assert:
27
27
 
28
28
  - `fields['System.WorkItemType']` is `Feature`
29
29
  - `links.parent` is `epic`
@@ -65,14 +65,15 @@ In `## Items` order, predecessors first — that is what makes `predecessors` ex
65
65
  workitem_create_or_update({
66
66
  type: <item_type: pbi -> 'Product Backlog Item', bug -> 'Bug'>,
67
67
  title: <the item's title>,
68
- description: <the body, per references/TICKET-TEMPLATES.md>,
69
- parentId: <the plan's feature>,
68
+ description: <the row's Delivers plus its source plan and row, per references/TICKET-TEMPLATES.md>,
69
+ acceptanceCriteria: <the row's Verification, verbatim>,
70
+ parentId: <the plan's work_item>,
70
71
  predecessors: [<ids of the rows this one lists under Predecessor>],
71
72
  related: [<for a Bug: the id of the PBI it was found in>],
72
73
  })
73
74
  ```
74
75
 
75
- The body is the row's own what-it-delivers and verification, shaped by [references/TICKET-TEMPLATES.md](references/TICKET-TEMPLATES.md). It goes in on the create call — `description` is an advertised argument that becomes a `System.Description` field op, so there is no follow-up write and nothing to confirm afterwards.
76
+ The row's delivery and source become `description`, shaped by [references/TICKET-TEMPLATES.md](references/TICKET-TEMPLATES.md). Its falsifiable verification becomes `acceptanceCriteria` verbatim. Both are advertised arguments and go on the create call, so the board receives the same fields as the row without a follow-up write.
76
77
 
77
78
  A Bug parents to the **Feature**, exactly as a PBI does, so `related` is the only way to record which item it was found while building.
78
79
 
@@ -2,22 +2,24 @@
2
2
 
3
3
  ## The work item's `description`
4
4
 
5
- Sent on the create call for every PBI and Bug. It is the item's own two sections — no more:
5
+ Sent on the create call for every PBI and Bug. It carries what the row delivers and where that
6
+ row came from:
6
7
 
7
8
  ```markdown
8
9
  ## What it delivers
9
10
 
10
11
  The end-to-end behaviour this makes work. Not a layer-by-layer list.
11
12
 
12
- ## Verification
13
-
14
- The falsifiable check. A command and its expected result, not "tested".
15
-
16
13
  ## Source
17
14
 
18
15
  Plan: the Feature's `spec.md`, `## Items` row <n>.
19
16
  ```
20
17
 
18
+ ## The work item's `acceptanceCriteria`
19
+
20
+ The row's `Verification` cell, verbatim: a falsifiable check with its expected result, not
21
+ "tested". Send it as `acceptanceCriteria` on the same create call as `description`.
22
+
21
23
  ## The item file
22
24
 
23
25
  Written after the create call returns, because the file is named `az<work item id>-<slug>.md`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amsterdamdatalabs/enact-extensions",
3
- "version": "0.1.51",
3
+ "version": "0.1.55",
4
4
  "description": "Create and validate Enact multi-platform plugin manifests",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -14,16 +14,17 @@
14
14
  * match; every merged JSON entry /
15
15
  * TOML block present; list drifted
16
16
  * or missing)
17
- * - per-host status: claude (marketplace + settings present; trust +
18
- * "start a new session" note), codex (files present; read-only
17
+ * - per-host status: direct native files recorded in the lock (never a
18
+ * plugin root or marketplace), codex (files present; read-only
19
19
  * ~/.codex/config.toml projects."<repo>".trust_level; hooks-review-
20
20
  * pending note), cursor (files present; MCP approval note), kimi
21
- * (.kimi-code/mcp.json present; global hooks are enact-vps-owned, so we
22
- * only report whether ~/.kimi-code/config.toml has the
21
+ * (native files present; global hooks are enact-vps-owned, so we only
22
+ * report whether ~/.kimi-code/config.toml has the
23
23
  * `# BEGIN ENACT KIMI HOOKS` block; PLUS a read-only Kimi Code
24
24
  * workspace-trust check — Kimi only loads project MCP servers, including
25
25
  * `.kimi-code/mcp.json`, once the workspace is trusted), opencode
26
- * (plugin file present and generated from the current bundle)
26
+ * (native agents/skills and root `opencode.json` MCP entries when the
27
+ * selected bundle declares them; hooks are global enact-vps-owned)
27
28
  * - required global binaries on PATH (enact-hook, lean-ctx,
28
29
  * code-review-graph/crg, azure-devops-mcp) with versions
29
30
  * - root `enact-config.toml` marker: present, parses as TOML, has our
@@ -332,14 +333,9 @@ function checkLockIntegrity(repo, name, lock) {
332
333
  const found = existsSync(path) ? findBlock(readFileSync(path, "utf8"), name) : null;
333
334
  if (!found || sha256(found.block) !== record.sha256) tomlIssues.push(rel);
334
335
  }
335
- // Managed symlinks (today: the Claude plugin's skills -> ../../.agents/skills
336
- // link). These carry no content hash, so `lock.files`-style verification does
337
- // not reach them: a broken or retargeted link is invisible to every other
338
- // check here. It is not a cosmetic gap -- a dangling link makes Claude Code
339
- // report `Skills (0)` while the repo still looks installed, which is exactly
340
- // the "presence is not armedness" failure AGENTS.md exists to catch. Verify
341
- // by the link's own mechanism: it must BE a symlink, point where the lock
342
- // says, and actually resolve.
336
+ // Managed symlinks carry no content hash, so `lock.files`-style verification
337
+ // does not reach them. Verify by the link's own mechanism: it must BE a
338
+ // symlink, point where the lock says, and actually resolve.
343
339
  //
344
340
  // lstatSync, never existsSync: existsSync follows the link and returns false
345
341
  // for a dangling one, so it cannot tell "absent" from "present but broken".
@@ -374,48 +370,76 @@ function checkLockIntegrity(repo, name, lock) {
374
370
  // ---------------------------------------------------------------------------
375
371
  // per-host status
376
372
  // ---------------------------------------------------------------------------
377
- function checkHosts(repo, lock, home, contentOutdated) {
373
+ const NATIVE_HOST_PATHS = {
374
+ claude: { prefixes: [".claude/"], exact: [".mcp.json"] },
375
+ codex: { prefixes: [".codex/", ".agents/skills/"], exact: [] },
376
+ cursor: { prefixes: [".cursor/"], exact: [] },
377
+ kimi: { prefixes: [".kimi-code/"], exact: [] },
378
+ opencode: { prefixes: [".opencode/"], exact: ["opencode.json"] },
379
+ };
380
+
381
+ function isNativeHostPath(host, rel) {
382
+ const { prefixes, exact } = NATIVE_HOST_PATHS[host];
383
+ return exact.includes(rel) || prefixes.some((prefix) => rel.startsWith(prefix));
384
+ }
385
+
386
+ // The lock is the authoritative ownership record. A host is present only
387
+ // when it owns at least one direct native path and every such path still
388
+ // exists. This deliberately does not infer installation from a plugin root,
389
+ // marketplace, or a host config file that another extension/user may own.
390
+ function checkNativeHostPresence(repo, lock, host) {
391
+ const rels = [
392
+ ...Object.keys(lock.files ?? {}),
393
+ ...Object.keys(lock.merged ?? {}),
394
+ ...Object.keys(lock.toml ?? {}),
395
+ ...Object.keys(lock.symlinks ?? {}),
396
+ ].filter((rel) => isNativeHostPath(host, rel));
397
+ const nativePaths = [...new Set(rels)].sort();
398
+ return {
399
+ nativePaths,
400
+ present: nativePaths.length > 0 && nativePaths.every((rel) => existsSync(abs(repo, rel))),
401
+ };
402
+ }
403
+
404
+ function checkHosts(repo, lock, home) {
378
405
  const hosts = {};
379
406
  for (const host of REPO_HOSTS) {
380
407
  const targeted = lock.hosts.includes(host);
408
+ const native = targeted ? checkNativeHostPresence(repo, lock, host) : { nativePaths: [], present: true };
381
409
  if (host === "claude") {
382
- const present =
383
- !targeted ||
384
- (existsSync(abs(repo, ".claude-plugin/marketplace.json")) && existsSync(abs(repo, ".claude/settings.json")));
385
410
  hosts.claude = {
386
411
  targeted,
387
- present,
412
+ present: native.present,
413
+ nativePaths: native.nativePaths,
388
414
  note: targeted
389
- ? "loads only after you TRUST this folder in Claude Code -- the marketplace registers on first launch; if hooks/skills are missing in that FIRST session, start a NEW session in this folder"
415
+ ? "direct native Claude files are installed; Claude Code loads them after you TRUST this folder"
390
416
  : "not targeted by this install",
391
417
  };
392
418
  } else if (host === "codex") {
393
- const present =
394
- !targeted || existsSync(abs(repo, ".codex/hooks.json")) || existsSync(abs(repo, ".codex/config.toml"));
395
419
  hosts.codex = {
396
420
  targeted,
397
- present,
421
+ present: native.present,
422
+ nativePaths: native.nativePaths,
398
423
  trust: checkCodexTrust(repo, home),
399
424
  note: targeted
400
425
  ? "config/hooks load only after you trust this project; hooks review (/hooks) is pending until you review them in Codex"
401
426
  : "not targeted by this install",
402
427
  };
403
428
  } else if (host === "cursor") {
404
- const present =
405
- !targeted || existsSync(abs(repo, ".cursor/hooks.json")) || existsSync(abs(repo, ".cursor/mcp.json"));
406
429
  hosts.cursor = {
407
430
  targeted,
408
- present,
431
+ present: native.present,
432
+ nativePaths: native.nativePaths,
409
433
  note: targeted
410
434
  ? "Cursor prompts for MCP server approval on first use -- approve code-review-graph/lean-ctx in Cursor's MCP settings"
411
435
  : "not targeted by this install",
412
436
  };
413
437
  } else if (host === "kimi") {
414
- const present = !targeted || existsSync(abs(repo, ".kimi-code/mcp.json"));
415
438
  const globalHooks = checkKimiGlobalHooks(home);
416
439
  hosts.kimi = {
417
440
  targeted,
418
- present,
441
+ present: native.present,
442
+ nativePaths: native.nativePaths,
419
443
  globalHooksInstalled: globalHooks.hooksBlockPresent,
420
444
  globalHooksNote: !globalHooks.configFound
421
445
  ? `${globalHooks.configPath} not found`
@@ -425,15 +449,12 @@ function checkHosts(repo, lock, home, contentOutdated) {
425
449
  workspaceTrust: checkKimiWorkspaceTrust(repo),
426
450
  };
427
451
  } else if (host === "opencode") {
428
- const rel = `.opencode/plugins/${lock.plugin}.ts`;
429
- const present = !targeted || existsSync(abs(repo, rel));
430
- const generatedFromCurrentBundle = targeted && present ? !contentOutdated.includes(rel) : null;
431
452
  hosts.opencode = {
432
453
  targeted,
433
- present,
434
- generatedFromCurrentBundle,
454
+ present: native.present,
455
+ nativePaths: native.nativePaths,
435
456
  note: targeted
436
- ? "one generated plugin file; re-run install after a bundle update to regenerate it"
457
+ ? "direct native OpenCode files are installed; repo-local hooks are global enact-vps-owned"
437
458
  : "not targeted by this install",
438
459
  };
439
460
  }
@@ -567,7 +588,7 @@ export function runRepoDoctor(pluginRoot, options = {}) {
567
588
  );
568
589
  }
569
590
 
570
- const hosts = checkHosts(repo, lock, home, contentOutdated);
591
+ const hosts = checkHosts(repo, lock, home);
571
592
 
572
593
  const binaries = {};
573
594
  for (const bin of REQUIRED_BINARIES) binaries[bin] = checkBinary(bin);