@agent-ix/quoin 0.3.6 → 0.3.8

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.
@@ -28,13 +28,13 @@ entries:
28
28
  ref: v0.2.0
29
29
 
30
30
  - name: spec-artifacts-process
31
- version: "0.2.0"
31
+ version: "0.3.0"
32
32
  defaultEnabled: true
33
33
  source:
34
34
  type: git-subdir
35
35
  url: agent-ix/spec-artifacts-process
36
36
  path: spec_artifacts_process
37
- ref: v0.2.0
37
+ ref: v0.3.0
38
38
 
39
39
  - name: spec-objects-business
40
40
  version: "0.3.0"
@@ -1,14 +1,14 @@
1
1
  import { existsSync as e, readFileSync as t, readdirSync as n, rmSync as r, statSync as i } from "node:fs";
2
2
  import { basename as a, dirname as o, join as s, resolve as c } from "node:path";
3
3
  import { fileURLToPath as l } from "node:url";
4
- import { configureRuntimeContext as u } from "@agent-ix/ix-cli-core";
5
- import { homedir as d } from "node:os";
6
- import { parse as f } from "yaml";
7
- import { installEntry as p, readRegistry as m, reconcile as ee, validateMarketplaceManifest as h, writeRegistry as g } from "@agent-ix/ts-plugin-kit";
4
+ import { configureRuntimeContext as u, runSelfUpdate as d } from "@agent-ix/ix-cli-core";
5
+ import { homedir as f } from "node:os";
6
+ import { parse as p } from "yaml";
7
+ import { installEntry as ee, readRegistry as m, reconcile as h, validateMarketplaceManifest as te, writeRegistry as g } from "@agent-ix/ts-plugin-kit";
8
8
  import { spawn as _ } from "node:child_process";
9
9
  //#region src/catalog.ts
10
10
  function v() {
11
- return process.env.IX_HOME && process.env.IX_HOME.length > 0 ? process.env.IX_HOME : s(d(), ".ix");
11
+ return process.env.IX_HOME && process.env.IX_HOME.length > 0 ? process.env.IX_HOME : s(f(), ".ix");
12
12
  }
13
13
  function y(e = v()) {
14
14
  return s(e, "filament", "modules");
@@ -23,22 +23,22 @@ function b(t = v()) {
23
23
  function x(e = b()) {
24
24
  let n = [], r = [], i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
25
25
  for (let c of e) {
26
- let e = w(c);
26
+ let e = ne(c);
27
27
  if (!e || i.has(e)) continue;
28
28
  i.add(e);
29
- let l = f(t(s(e, "manifest.yaml"), "utf8")), u = D(l.name) ?? a(e);
29
+ let l = p(t(s(e, "manifest.yaml"), "utf8")), u = E(l.name) ?? a(e);
30
30
  if (o.has(u)) continue;
31
31
  o.add(u);
32
- let d = E(l.artifact_types), p = E(l.object_types);
32
+ let d = T(l.artifact_types), f = T(l.object_types);
33
33
  n.push({
34
34
  name: u,
35
- version: D(l.version),
35
+ version: E(l.version),
36
36
  root: e,
37
37
  artifactTypes: d.map((e) => String(e.name)),
38
- objectTypes: p.map((e) => String(e.name))
38
+ objectTypes: f.map((e) => String(e.name))
39
39
  });
40
40
  for (let t of d) {
41
- let n = String(t.name), i = D(t.frontmatter_schema_ref);
41
+ let n = String(t.name), i = E(t.frontmatter_schema_ref);
42
42
  r.push({
43
43
  name: n,
44
44
  kind: "artifact",
@@ -46,24 +46,24 @@ function x(e = b()) {
46
46
  moduleRoot: e,
47
47
  schemaRef: i,
48
48
  schemaPath: i ? s(e, i) : void 0,
49
- skeletonPath: T(e, n)
49
+ skeletonPath: w(e, n)
50
50
  });
51
51
  }
52
- for (let t of p) {
52
+ for (let t of f) {
53
53
  let n = String(t.name);
54
54
  r.push({
55
55
  name: n,
56
56
  kind: "object",
57
57
  moduleName: u,
58
58
  moduleRoot: e,
59
- skeletonPath: T(e, n)
59
+ skeletonPath: w(e, n)
60
60
  });
61
61
  }
62
62
  }
63
63
  return {
64
64
  modules: n,
65
65
  entries: r,
66
- duplicates: te(r)
66
+ duplicates: D(r)
67
67
  };
68
68
  }
69
69
  function S(e, t) {
@@ -73,7 +73,7 @@ function S(e, t) {
73
73
  function C(e) {
74
74
  return e.toLowerCase();
75
75
  }
76
- function w(t) {
76
+ function ne(t) {
77
77
  let r = c(t);
78
78
  if (e(r)) {
79
79
  if (e(s(r, "manifest.yaml"))) return r;
@@ -83,16 +83,16 @@ function w(t) {
83
83
  }
84
84
  }
85
85
  }
86
- function T(t, n) {
86
+ function w(t, n) {
87
87
  return [s(t, "skeletons", `${n}.md`), s(t, "skeletons", `${n.toLowerCase()}.md`)].find((t) => e(t));
88
88
  }
89
- function E(e) {
89
+ function T(e) {
90
90
  return Array.isArray(e) ? e.filter((e) => !!e && typeof e == "object" && "name" in e) : [];
91
91
  }
92
- function D(e) {
92
+ function E(e) {
93
93
  return typeof e == "string" ? e : void 0;
94
94
  }
95
- function te(e) {
95
+ function D(e) {
96
96
  let t = /* @__PURE__ */ new Map();
97
97
  for (let n of e) {
98
98
  let e = `${n.kind}:${n.name}`, r = t.get(e) ?? /* @__PURE__ */ new Set();
@@ -156,7 +156,7 @@ function A(e) {
156
156
  };
157
157
  }
158
158
  function j(e, t = v()) {
159
- return p({ source: A(e) }, k(t));
159
+ return ee({ source: A(e) }, k(t));
160
160
  }
161
161
  function M(e = v()) {
162
162
  return m(O(e)).plugins;
@@ -174,7 +174,7 @@ function N(e, t = v()) {
174
174
  function P(n) {
175
175
  let r = e(s(n, "manifest.yaml")) ? s(n, "manifest.yaml") : s(n, a(n), "manifest.yaml");
176
176
  if (!e(r)) throw Error(`no manifest.yaml found under ${n}`);
177
- let i = f(t(r, "utf8"));
177
+ let i = p(t(r, "utf8"));
178
178
  if (typeof i.name != "string" || i.name.length === 0) throw Error(`manifest ${r} has no name`);
179
179
  return i.name;
180
180
  }
@@ -184,10 +184,10 @@ function F() {
184
184
  return o(o(l(import.meta.url)));
185
185
  }
186
186
  function I() {
187
- return h(f(t(s(F(), "default-modules.yaml"), "utf8")));
187
+ return te(p(t(s(F(), "default-modules.yaml"), "utf8")));
188
188
  }
189
189
  function L(e = v(), t = I()) {
190
- ee(t, {
190
+ h(t, {
191
191
  ...k(e),
192
192
  mode: "lazy"
193
193
  });
@@ -211,8 +211,8 @@ var R = {
211
211
  function z() {
212
212
  return Object.keys(R);
213
213
  }
214
- async function ne(e, t = {}) {
215
- let n = B(e), r = v(), i = [
214
+ async function B(e, t = {}) {
215
+ let n = V(e), r = v(), i = [
216
216
  "run",
217
217
  e,
218
218
  "--path",
@@ -224,16 +224,16 @@ async function ne(e, t = {}) {
224
224
  ];
225
225
  t.id && i.push("--id", t.id), t.json && i.push("--json");
226
226
  for (let e of t.target ?? []) i.push("--target", e);
227
- await H(i);
227
+ await U(i);
228
228
  }
229
- function B(t) {
229
+ function V(t) {
230
230
  let n = R[t];
231
231
  if (!n) throw Error(`unknown spec flow ${t}`);
232
232
  let r = [
233
233
  process.env.IX_SPEC_WORKFLOWS_ROOT,
234
- V(),
234
+ H(),
235
235
  s(o(c(process.cwd())), "ix-spec-workflows"),
236
- s(d(), ".ix", "plugins", "ix-spec-workflows")
236
+ s(f(), ".ix", "plugins", "ix-spec-workflows")
237
237
  ].filter((e) => !!e);
238
238
  for (let t of r) {
239
239
  let r = s(t, n.packageSkill, "workflow-assets", "skills", n.runtimeSkill);
@@ -241,10 +241,10 @@ function B(t) {
241
241
  }
242
242
  throw Error(`could not find ix-spec workflow skill ${n.runtimeSkill}; set IX_SPEC_WORKFLOWS_ROOT`);
243
243
  }
244
- function V() {
244
+ function H() {
245
245
  return s(o(o(l(import.meta.url))), "skills");
246
246
  }
247
- async function H(e) {
247
+ async function U(e) {
248
248
  await new Promise((t, n) => {
249
249
  let r = _("ix-flow", e, { stdio: "inherit" });
250
250
  r.on("error", n), r.on("close", (e) => {
@@ -258,10 +258,10 @@ async function H(e) {
258
258
  }
259
259
  //#endregion
260
260
  //#region src/write.ts
261
- function U(e) {
261
+ function W(e) {
262
262
  return (Array.isArray(e) ? e : e ? [e] : []).flatMap((e) => e.split(",")).map((e) => e.trim()).filter(Boolean);
263
263
  }
264
- function W(t, n, r) {
264
+ function G(t, n, r) {
265
265
  if (r.length === 0) throw Error("write requires --types <type[,type...]>");
266
266
  let a = c(n);
267
267
  if (!e(a) || !i(a).isDirectory()) throw Error(`write repo_dir is not a directory: ${n}`);
@@ -270,16 +270,16 @@ function W(t, n, r) {
270
270
  types: r.map((e) => {
271
271
  let n = S(t, e);
272
272
  if (!n) throw Error(`catalog type not found: ${e}\nAvailable types: ${t.entries.map((e) => e.name).sort((e, t) => e.localeCompare(t)).join(", ")}`);
273
- return K(n);
273
+ return q(n);
274
274
  }),
275
275
  validation: {
276
- command: `quire validate --scope ${q(a)} "spec/**/*.md"`,
276
+ command: `quire validate --scope ${J(a)} "spec/**/*.md"`,
277
277
  scope: a,
278
278
  globs: ["spec/**/*.md"]
279
279
  }
280
280
  };
281
281
  }
282
- function G(e) {
282
+ function K(e) {
283
283
  let t = [
284
284
  "quoin write",
285
285
  "",
@@ -290,7 +290,7 @@ function G(e) {
290
290
  for (let n of e.types) t.push(`- ${n.name} (${n.kind})`), t.push(` module: ${n.moduleName}`), t.push(` module_root: ${n.moduleRoot}`), n.skeletonPath && t.push(` skeleton: ${n.skeletonPath}`), n.schemaPath && t.push(` schema: ${n.schemaPath}`), !n.skeletonPath && !n.schemaPath && t.push(" contract: manifest only");
291
291
  return t.push(""), t.push("Author files directly in the repo, then validate changed spec files."), t.push(`Validate scope: ${e.validation.scope}`), t.push(`Validate command: ${e.validation.command}`), t.join("\n");
292
292
  }
293
- function K(e) {
293
+ function q(e) {
294
294
  return {
295
295
  name: e.name,
296
296
  kind: e.kind,
@@ -300,24 +300,24 @@ function K(e) {
300
300
  ...e.skeletonPath ? { skeletonPath: e.skeletonPath } : {}
301
301
  };
302
302
  }
303
- function q(e) {
303
+ function J(e) {
304
304
  return /^[A-Za-z0-9_./:-]+$/.test(e) ? e : `'${e.replaceAll("'", "'\\''")}'`;
305
305
  }
306
306
  //#endregion
307
307
  //#region src/cli.ts
308
- var J = "quoin\n\nSpec workflow and catalog CLI for Agent IX.\n\nquoin starts spec-domain work. ix-flow resumes, advances, acknowledges gates,\nand inspects workflow runs created by quoin.\n\nDefault modules (installed on first use into ~/.ix/filament/modules):\n Artifact modules: spec-artifacts-iso, spec-artifacts-app, spec-artifacts-process\n Object modules: spec-objects-business, spec-objects-architecture,\n spec-objects-enterprise, spec-objects-operational,\n spec-objects-security\n Workflows: review, matrix, to-plan\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n quoin catalog list|validate\n quoin catalog show <type>\n quoin plugin install <path:...|github:...>\n quoin plugin list\n quoin plugin remove <name>\n quoin review|matrix|to-plan [--target <ref>...]\n\nGlobal flags:\n --json\n --config-root <dir> Defaults to ~/.ix\n\nExamples:\n quoin catalog list\n quoin catalog show FR\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin write . --types FR,domain\n ix-flow status <run-id>\n", Y = "quoin write\n\nBuild an authoring pack for spec files an agent is about to create or edit.\n\nPass the target repository and the artifact/object types involved in the work.\nquoin resolves those types from the active catalog and returns the local\nskeletons, schemas, module roots, and Quire validation command for the repo.\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n\nExamples:\n quoin write . --types FR\n quoin write . --types FR,domain,entity\n quoin write ../my-service --types fr,DOMAIN --json\n\nNotes:\n - Type lookup is case-insensitive; FR and fr are the same type.\n - Types can be artifacts or objects from the default module set or plugins.\n - Use the returned skeletons and schemas as the authoring contract.\n - Run the returned Quire command after editing spec files.\n", X = "quoin catalog\n\nInspect the active artifact/object catalog.\n\nThe catalog is assembled from, in order:\n 1. QUOIN_MODULE_PATHS\n 2. modules installed under ~/.ix/filament/modules\n\nThe default module set is installed there automatically on first catalog access,\nand updated by \"quoin plugin install\". The same directory is read by quire-rs.\n\nDefault artifact modules:\n spec-artifacts-iso FR, NFR, StR, US, IT, TC, AC, CON, Spec\n spec-artifacts-app app-level artifacts\n spec-artifacts-process plans, reviews, matrices, ADRs, tasks, findings\n\nDefault object modules:\n spec-objects-business\n spec-objects-architecture\n spec-objects-enterprise\n spec-objects-operational\n spec-objects-security\n\nUsage:\n quoin catalog list\n quoin catalog show <type>\n quoin catalog validate\n\nExamples:\n quoin catalog show FR\n quoin catalog show entity\n quoin catalog validate --json\n", re = "quoin plugin\n\nInstall and manage user/community spec modules.\n\nPlugins add or override artifact/object modules under ~/.ix/filament/modules.\nUse \"catalog list\" to see the full active catalog, including default modules and\nplugins.\n\nSupported install sources:\n path:<dir> Use a local directory containing manifest.yaml\n github:<owner>/<repo> Clone a GitHub repository (manifest at root)\n github:<owner>/<repo>@<ref> Pin to a tag, branch, or sha\n github:<owner>/<repo>//<subdir> Manifest in a monorepo subdirectory (@<ref> ok)\n\nUsage:\n quoin plugin install <path:...|github:...>\n quoin plugin list\n quoin plugin remove <name>\n quoin plugin ensure-defaults\n\nExamples:\n quoin plugin install path:../spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-security//spec_objects_security@v0.1.1\n quoin plugin list\n quoin plugin ensure-defaults\n", ie = "quoin workflows\n\nStart bundled spec review/planning workflows. quoin creates the workflow run in ~/.ix/flows.\nUse ix-flow to inspect, resume, advance phases, and acknowledge human gates.\n\nAvailable workflow launchers:\n review Run a composite spec review\n matrix Build or update a requirements test matrix\n to-plan Convert accepted requirements into an implementation plan\n\nUsage:\n quoin review|matrix|to-plan [--target <ref>...]\n\nExamples:\n quoin review --target spec/\n quoin matrix --target spec/\n ix-flow status <run-id>\n ix-flow resume <run-id>\n";
309
- async function ae(e) {
310
- let t = ue(e);
308
+ var Y = "quoin\n\nSpec workflow and catalog CLI for Agent IX.\n\nquoin starts spec-domain work. ix-flow resumes, advances, acknowledges gates,\nand inspects workflow runs created by quoin.\n\nDefault modules (installed on first use into ~/.ix/filament/modules):\n Artifact modules: spec-artifacts-iso, spec-artifacts-app, spec-artifacts-process\n Object modules: spec-objects-business, spec-objects-architecture,\n spec-objects-enterprise, spec-objects-operational,\n spec-objects-security\n Workflows: review, matrix, to-plan\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n quoin catalog list|validate\n quoin catalog show <type>\n quoin plugin install <path:...|github:...>\n quoin plugin list\n quoin plugin remove <name>\n quoin review|matrix|to-plan [--target <ref>...]\n quoin update [--check] [--registry <url>]\n\nGlobal flags:\n --json\n --config-root <dir> Defaults to ~/.ix\n\nExamples:\n quoin catalog list\n quoin catalog show FR\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin write . --types FR,domain\n ix-flow status <run-id>\n", X = "quoin write\n\nBuild an authoring pack for spec files an agent is about to create or edit.\n\nPass the target repository and the artifact/object types involved in the work.\nquoin resolves those types from the active catalog and returns the local\nskeletons, schemas, module roots, and Quire validation command for the repo.\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n\nExamples:\n quoin write . --types FR\n quoin write . --types FR,domain,entity\n quoin write ../my-service --types fr,DOMAIN --json\n\nNotes:\n - Type lookup is case-insensitive; FR and fr are the same type.\n - Types can be artifacts or objects from the default module set or plugins.\n - Use the returned skeletons and schemas as the authoring contract.\n - Run the returned Quire command after editing spec files.\n", re = "quoin catalog\n\nInspect the active artifact/object catalog.\n\nThe catalog is assembled from, in order:\n 1. QUOIN_MODULE_PATHS\n 2. modules installed under ~/.ix/filament/modules\n\nThe default module set is installed there automatically on first catalog access,\nand updated by \"quoin plugin install\". The same directory is read by quire-rs.\n\nDefault artifact modules:\n spec-artifacts-iso FR, NFR, StR, US, IT, TC, AC, CON, Spec\n spec-artifacts-app app-level artifacts\n spec-artifacts-process plans, reviews, matrices, ADRs, tasks, findings\n\nDefault object modules:\n spec-objects-business\n spec-objects-architecture\n spec-objects-enterprise\n spec-objects-operational\n spec-objects-security\n\nUsage:\n quoin catalog list\n quoin catalog show <type>\n quoin catalog validate\n\nExamples:\n quoin catalog show FR\n quoin catalog show entity\n quoin catalog validate --json\n", ie = "quoin plugin\n\nInstall and manage user/community spec modules.\n\nPlugins add or override artifact/object modules under ~/.ix/filament/modules.\nUse \"catalog list\" to see the full active catalog, including default modules and\nplugins.\n\nSupported install sources:\n path:<dir> Use a local directory containing manifest.yaml\n github:<owner>/<repo> Clone a GitHub repository (manifest at root)\n github:<owner>/<repo>@<ref> Pin to a tag, branch, or sha\n github:<owner>/<repo>//<subdir> Manifest in a monorepo subdirectory (@<ref> ok)\n\nUsage:\n quoin plugin install <path:...|github:...>\n quoin plugin list\n quoin plugin remove <name>\n quoin plugin ensure-defaults\n\nExamples:\n quoin plugin install path:../spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-security//spec_objects_security@v0.1.1\n quoin plugin list\n quoin plugin ensure-defaults\n", ae = "quoin update\n\nCheck for and install the latest published quoin.\n\nquoin is distributed on the public npm registry as @agent-ix/quoin. This command\nqueries the registry for the latest version, compares it to the running version,\nand (unless --check) runs npm install -g to upgrade in place.\n\nUsage:\n quoin update [--check] [--registry <url>]\n\nFlags:\n --check Report whether an update is available; do not install.\n --registry <url> Force an npm registry to query/install from. Defaults\n to your npm config (the registry @agent-ix resolves to,\n i.e. however quoin was installed). Pass\n https://registry.npmjs.org/ for public npm, or\n http://npm.ix/ for local dev snapshots.\n\nExamples:\n quoin update\n quoin update --check\n quoin update --registry http://npm.ix/\n", oe = "quoin workflows\n\nStart bundled spec review/planning workflows. quoin creates the workflow run in ~/.ix/flows.\nUse ix-flow to inspect, resume, advance phases, and acknowledge human gates.\n\nAvailable workflow launchers:\n review Run a composite spec review\n matrix Build or update a requirements test matrix\n to-plan Convert accepted requirements into an implementation plan\n\nUsage:\n quoin review|matrix|to-plan [--target <ref>...]\n\nExamples:\n quoin review --target spec/\n quoin matrix --target spec/\n ix-flow status <run-id>\n ix-flow resume <run-id>\n";
309
+ async function se(e) {
310
+ let t = pe(e);
311
311
  if (t.flags.version || t.flags.v || t.command === "version") {
312
312
  console.log(Z());
313
313
  return;
314
314
  }
315
315
  if (!t.command) {
316
- console.log(J);
316
+ console.log(Y);
317
317
  return;
318
318
  }
319
319
  if (t.flags.help || t.flags.h) {
320
- console.log(oe(t));
320
+ console.log(ce(t));
321
321
  return;
322
322
  }
323
323
  let n = Q(t, "config-root") ?? v();
@@ -326,32 +326,42 @@ async function ae(e) {
326
326
  configNamespace: "ix",
327
327
  projectConfigRoot: `${process.cwd()}/.ix`,
328
328
  projectConfigEnabled: t.flags["no-project-config"] !== !0
329
- }), t.command === "catalog") return ce(t);
330
- if (t.command === "plugin") return le(t);
331
- if (t.command === "write") return se(t);
332
- if (z().includes(t.command)) return ne(t.command, {
329
+ }), t.command === "update") return ue(t);
330
+ if (t.command === "catalog") return de(t);
331
+ if (t.command === "plugin") return fe(t);
332
+ if (t.command === "write") return le(t);
333
+ if (z().includes(t.command)) return B(t.command, {
333
334
  json: t.flags.json === !0,
334
335
  id: Q(t, "id"),
335
336
  target: $(t, "target")
336
337
  });
337
- throw Error(`unknown command ${t.command}\n\n${J}`);
338
+ throw Error(`unknown command ${t.command}\n\n${Y}`);
338
339
  }
339
340
  function Z() {
340
341
  let e = o(o(l(import.meta.url))), n = JSON.parse(t(s(e, "package.json"), "utf8"));
341
342
  if (typeof n.version != "string") throw Error("package.json version is missing");
342
343
  return n.version;
343
344
  }
344
- function oe(e) {
345
- return e.command === "write" ? Y : e.command === "catalog" ? X : e.command === "plugin" ? re : z().includes(e.command) ? ie : J;
345
+ function ce(e) {
346
+ return e.command === "update" ? ae : e.command === "write" ? X : e.command === "catalog" ? re : e.command === "plugin" ? ie : z().includes(e.command) ? oe : Y;
346
347
  }
347
- function se(e) {
348
+ function le(e) {
348
349
  let [t] = e.positionals;
349
- if (!t) throw Error(`write requires <repo_dir>\n\n${Y}`);
350
+ if (!t) throw Error(`write requires <repo_dir>\n\n${X}`);
350
351
  L();
351
- let n = W(x(), t, U($(e, "types")));
352
- console.log(e.flags.json ? JSON.stringify(n, null, 2) : G(n));
352
+ let n = G(x(), t, W($(e, "types")));
353
+ console.log(e.flags.json ? JSON.stringify(n, null, 2) : K(n));
354
+ }
355
+ async function ue(e) {
356
+ await d({
357
+ packageName: "@agent-ix/quoin",
358
+ currentVersion: Z(),
359
+ header: "quoin update",
360
+ registry: Q(e, "registry"),
361
+ check: e.flags.check === !0
362
+ });
353
363
  }
354
- function ce(e) {
364
+ function de(e) {
355
365
  L();
356
366
  let t = x();
357
367
  switch (e.subcommand) {
@@ -387,7 +397,7 @@ function ce(e) {
387
397
  default: throw Error(`unknown catalog command ${e.subcommand}`);
388
398
  }
389
399
  }
390
- function le(e) {
400
+ function fe(e) {
391
401
  switch (e.subcommand) {
392
402
  case "list":
393
403
  case void 0:
@@ -414,7 +424,7 @@ function le(e) {
414
424
  default: throw Error(`unknown plugin command ${e.subcommand}`);
415
425
  }
416
426
  }
417
- function ue(e) {
427
+ function pe(e) {
418
428
  let t = {}, n = [], r, i;
419
429
  for (let a = 0; a < e.length; a++) {
420
430
  let o = e[a];
@@ -439,4 +449,4 @@ function $(e, t) {
439
449
  return Array.isArray(n) ? n : [];
440
450
  }
441
451
  //#endregion
442
- export { U as a, j as c, N as d, b as f, x as h, G as i, M as l, S as m, Z as n, I as o, y as p, W as r, L as s, ae as t, A as u };
452
+ export { W as a, j as c, N as d, b as f, x as h, K as i, M as l, S as m, Z as n, I as o, y as p, G as r, L as s, se as t, A as u };
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAmKA,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCxD;AAED,wBAAgB,cAAc,IAAI,MAAM,CASvC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AA6LA,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCxD;AAED,wBAAgB,cAAc,IAAI,MAAM,CASvC"}
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./cli-CNlT2O2s.js";
1
+ import { n as e, t } from "./cli-CQCkDA9J.js";
2
2
  export { t as main, e as packageVersion };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./cli-CNlT2O2s.js";
1
+ import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./cli-CQCkDA9J.js";
2
2
  export { u as createAuthoringPack, r as defaultModuleRoots, c as defaultModulesManifest, d as ensureDefaultModules, l as filamentModulesDir, s as findCatalogEntry, a as formatAuthoringPack, t as installPlugin, o as listPlugins, i as loadCatalog, f as main, p as parseSourceArg, e as parseTypeList, n as removePlugin };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agent-ix/quoin",
3
3
  "description": "Spec workflow and catalog CLI for Agent IX.",
4
- "version": "0.3.6",
4
+ "version": "0.3.8",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "files": [
@@ -54,7 +54,7 @@
54
54
  "test-results:warnings": "./node_modules/.bin/jest-results warnings"
55
55
  },
56
56
  "dependencies": {
57
- "@agent-ix/ix-cli-core": ">=0.10.4",
57
+ "@agent-ix/ix-cli-core": ">=0.10.5",
58
58
  "@agent-ix/ts-plugin-kit": ">=0.1.3",
59
59
  "yaml": "^2.9.0"
60
60
  },
@@ -11,27 +11,56 @@ Use this skill to validate requirements artefacts before implementation.
11
11
 
12
12
  See **[references/checklist.md](references/checklist.md)** for the detailed quality gates.
13
13
 
14
+ ## Choose the review set
15
+
16
+ Before reviewing, present these options to the user and let them choose:
17
+
18
+ - **base** — the **Checklist** only: ID formats, US/FR/TC quality, and the six coverage
19
+ rules. No analysis skills.
20
+ - **all** — `base` plus all six analyses below.
21
+ - **subset** — `base` plus the analyses the user picks from the six below.
22
+
23
+ The six analyses:
24
+
25
+ | Analysis | Skill |
26
+ | --- | --- |
27
+ | failure-domain | `spec-failure-domain-analysis` |
28
+ | integrity | `spec-integrity-analysis` |
29
+ | dependency | `spec-dependency-analysis` |
30
+ | evidence | `spec-evidence-analysis` |
31
+ | risk-complexity | `spec-risk-complexity-analysis` |
32
+ | scope-boundary | `spec-scope-boundary-analysis` |
33
+
14
34
  ## Process
15
35
 
16
- 1. Automated Checks:
36
+ 1. Automated Checks (always — part of `base`):
17
37
  - Validate ID formats (US/FR/TC/AC/CON).
18
38
  - Detect duplicates or gaps.
19
39
  - Validation link integrity.
20
- 2. Manual Review:
40
+ 2. Base Review (always):
21
41
  - Read each artifact.
22
42
  - Verify against the **Checklist**.
23
43
  - Verify Test Coverage (6 Rules).
24
- - Run Analysis Skills:
25
- - `spec-failure-domain-analysis`
26
- - `spec-integrity-analysis`
27
- - `spec-dependency-analysis`
28
- - `spec-evidence-analysis`
29
- - `spec-risk-complexity-analysis`
30
- - `spec-scope-boundary-analysis`
31
- 3. Findings:
32
- - Document issues or gaps.
33
- - Assign action items.
34
- - Do not proceed to implementation until reviewed.
44
+ 3. Selected Analyses:
45
+ - Run each analysis the user chose. Prefer running them **in parallel**.
46
+ - **Fetch the template from quoin** once with `quoin write --types SpecReview` — use its
47
+ skeleton + schema as the contract (do not invent the format).
48
+ - Write **one `SpecReview` document per analysis** to `spec/reviews/<analysis>.md`
49
+ (plus `spec/reviews/base.md` for the base checklist). Findings go in a validated
50
+ `## Findings` table (`| ID | Severity | Summary | Refs |`, `FND-NNN` ids, Severity ∈
51
+ `low`/`medium`/`high`).
52
+ 4. Validate + record:
53
+ - Run `quire validate --scope <repo> "spec/**/*.md"` and fix any errors.
54
+ - The docs sync into filament-core as `SpecReview` artifacts; do not proceed to
55
+ implementation until reviewed.
56
+
57
+ ## Enforced runs (workflow mode)
58
+
59
+ `quoin review` drives this through `ix-flow`, which **records the chosen set and hard-blocks
60
+ acceptance until every selected analysis has produced a validated `SpecReview` doc** (the
61
+ `selected_analyses_covered` gate). Use it when you want the choice enforced rather than
62
+ trusted to discipline. The per-analysis `SpecReview` structure + the findings table are
63
+ defined in the workflow skill (`workflow-assets/skills/review/SKILL.md`).
35
64
 
36
65
  ## Common Issues
37
66
 
@@ -13,19 +13,80 @@ Use this skill for a full or multi-artifact spec review before implementation, r
13
13
 
14
14
  ## What It Does
15
15
 
16
- Run a composite specification review. The workflow definition is the source of truth for phases, gates, item schemas, recipes, and validation points.
16
+ Run a composite specification review. The workflow definition is the source of truth for
17
+ phases, gates, item schemas, and recipes. The review produces **one validated `SpecReview`
18
+ document per analysis** under `spec/reviews/`, rather than a single freeform report.
17
19
 
18
20
  ## Workflow Behavior
19
21
 
20
22
  - Start from the workflow status and follow reported next actions.
21
- - Record evidence items before advancing analysis, review, or validation phases.
22
- - Use recipes for deterministic command chains, but preserve human gates for acceptance.
23
- - Prefer templates for stable artifact creation and generic file editing for broad semantic rewrites.
23
+ - **intake — offer the review set.** Before advancing, present the choice to the user and
24
+ record it in the `request` interview as `review_set` plus `selected_analyses`:
25
+ - `base` — the skill checklist only (ID formats, US/FR/TC quality, the six coverage
26
+ rules). No analysis skills. `selected_analyses` is empty.
27
+ - `all` — `base` plus all six analyses: `failure-domain`, `integrity`, `dependency`,
28
+ `evidence`, `risk-complexity`, `scope-boundary`.
29
+ - `subset` — `base` plus the analyses the user picks from those six.
30
+ - **analyses_run — run the selected set, one SpecReview doc each.** Run each selected
31
+ analysis (the matching `spec-*-analysis` skill). Prefer running them **in parallel** —
32
+ each writes its own file, so there is no contention.
33
+ - **Guardrail — fetch the template from quoin (do not invent the format).** Once, run
34
+ `quoin write <repo> --types SpecReview` and use the emitted skeleton + schema as the
35
+ authoritative contract. Reuse that one contract for every analysis doc.
36
+ - **Direct-author** a `SpecReview` markdown document per analysis to
37
+ `spec/reviews/<analysis>.md` from that template. `base` renders a single
38
+ `spec/reviews/base.md` with `analysis: base`.
39
+ - **reviews_rendered — validate (guardrail).** Always run the quire validation command (the
40
+ calling tool emits it, e.g. `quire validate --scope <repo> "spec/**/*.md"`). Fix any finding-table / severity
41
+ / id errors it reports. Only once a SpecReview doc validates, record it:
42
+ `add-item review_doc --item '{"id":"RD-<analysis>","analysis":"<analysis>","path":"spec/reviews/<analysis>.md"}'`
43
+ (the item `id` must be non-empty). These items drive the coverage gate.
44
+ - Use recipes for deterministic command chains, but preserve the human gate for acceptance.
45
+
46
+ ## SpecReview document structure
47
+
48
+ The **authoritative** template comes from `quoin write --types SpecReview` (fetch it; do not
49
+ hand-copy). The structure below is a reference for what that skeleton contains — each
50
+ `spec/reviews/<analysis>.md` is a `SpecReview` artifact (archetype in
51
+ `spec-artifacts-process`):
52
+
53
+ ```markdown
54
+ ---
55
+ id: SR-001
56
+ title: "<analysis> review of <scope>"
57
+ type: SpecReview
58
+ analysis: <failure-domain|integrity|dependency|evidence|risk-complexity|scope-boundary|base>
59
+ scope: <spec paths / ids>
60
+ review_set: <base|all|subset>
61
+ ---
62
+
63
+ ## Summary
64
+
65
+ <one or two sentences on what this analysis found>
66
+
67
+ ## Findings
68
+
69
+ | ID | Severity | Summary | Refs |
70
+ | --- | --- | --- | --- |
71
+ | FND-001 | medium | <one-line finding> | FR-014 |
72
+ ```
73
+
74
+ The `## Findings` table is **validated by quire**: exact columns `[ID, Severity, Summary,
75
+ Refs]`, at least one row, `FND-NNN` ids, and `Severity` must be one of `low`/`medium`/`high`.
76
+ An analysis that found nothing still renders a doc; record that as a single
77
+ `FND-001 | low | No issues found | —` row (or state it in `## Summary`).
78
+
79
+ ## Coverage gate
80
+
81
+ The final `validated → accepted` transition enforces `selected_analyses_covered`: the run
82
+ cannot be accepted until every selected analysis has a recorded `review_doc`. If it reports
83
+ `selected_analyses_not_run` with a `missing` list, render + validate + record those analyses
84
+ before retrying acceptance. `base` passes with no analyses required.
24
85
 
25
86
  ## Acceptance Criteria
26
87
 
27
88
  - AC-1: Reviews structural integrity, traceability, coverage, and readiness across selected artifacts.
28
- - AC-2: Records evidence items before validation.
89
+ - AC-2: Produces one validated `SpecReview` doc per selected analysis before acceptance.
29
90
  - AC-3: Stops at acceptance with findings and recommended next workflows rather than making broad edits.
30
91
 
31
92
  ## Boundaries
@@ -1 +1,60 @@
1
- export { specInvariants as invariants } from "../../../dist/index.js";
1
+ import { specInvariants } from "../../../dist/index.js";
2
+
3
+ // Canonical "all" set — the six analyses named in the spec-review skill.
4
+ const ALL_ANALYSES = [
5
+ "failure-domain",
6
+ "integrity",
7
+ "dependency",
8
+ "evidence",
9
+ "risk-complexity",
10
+ "scope-boundary",
11
+ ];
12
+
13
+ const norm = (value) =>
14
+ String(value ?? "")
15
+ .trim()
16
+ .toLowerCase()
17
+ .replace(/^spec-/, "")
18
+ .replace(/-analysis$/, "");
19
+
20
+ function findRequest(instance) {
21
+ const items = instance.items?.operation_request ?? [];
22
+ return (
23
+ items.find((item) => item && item.interviewId === "request") ?? items[0]
24
+ );
25
+ }
26
+
27
+ // Hard check (final gate): every selected analysis must have a recorded
28
+ // `review_doc` (a rendered + quire-validated SpecReview doc on disk) before
29
+ // the run can be accepted. 'base' selects nothing, so it passes trivially;
30
+ // 'all' expands to the canonical six when the agent did not echo the list.
31
+ const selectedAnalysesCovered = ({ instance }) => {
32
+ const request = findRequest(instance);
33
+ const reviewSet = norm(request?.review_set);
34
+ let selected = Array.isArray(request?.selected_analyses)
35
+ ? request.selected_analyses.map(norm).filter(Boolean)
36
+ : [];
37
+ if (reviewSet === "all" && selected.length === 0) {
38
+ selected = [...ALL_ANALYSES];
39
+ }
40
+ if (selected.length === 0) return true;
41
+
42
+ const ran = new Set(
43
+ (instance.items?.review_doc ?? [])
44
+ .map((doc) => norm(doc?.analysis))
45
+ .filter(Boolean),
46
+ );
47
+ const missing = selected.filter((analysis) => !ran.has(analysis));
48
+ return (
49
+ missing.length === 0 || {
50
+ ok: false,
51
+ code: "selected_analyses_not_run",
52
+ details: { reviewSet, selected, missing },
53
+ }
54
+ );
55
+ };
56
+
57
+ export const invariants = {
58
+ ...specInvariants,
59
+ selected_analyses_covered: selectedAnalysesCovered,
60
+ };
@@ -1,81 +1,67 @@
1
1
  name: review
2
- version: 0.1.0
3
- description: Run a composite specification review.
2
+ version: 0.2.0
3
+ description: Run a composite specification review producing validated SpecReview docs.
4
4
  initialPhase: intake
5
5
  phases:
6
6
  - { name: intake }
7
- - { name: evidence_recorded }
8
- - { name: report_rendered }
7
+ - { name: analyses_run }
8
+ - { name: reviews_rendered }
9
9
  - { name: validated }
10
10
  - { name: accepted, terminal: true }
11
11
  transitions:
12
12
  - from: intake
13
- to: evidence_recorded
13
+ to: analyses_run
14
14
  invariants:
15
15
  - "interview.complete:request"
16
16
  defaultGate: auto
17
- - from: evidence_recorded
18
- to: report_rendered
17
+ - from: analyses_run
18
+ to: reviews_rendered
19
19
  invariants: []
20
20
  defaultGate: auto
21
- - from: report_rendered
21
+ - from: reviews_rendered
22
22
  to: validated
23
- invariants:
24
- - "artifact.frontmatter_valid:report"
23
+ invariants: []
25
24
  defaultGate: auto
26
25
  - from: validated
27
26
  to: accepted
28
- invariants: []
27
+ invariants:
28
+ - "selected_analyses_covered"
29
29
  defaultGate: hitl
30
30
  itemSchemas:
31
31
  operation_request: {}
32
- OperationReportSchema:
33
- required: [type, id, title, scope]
32
+ # One per analysis the agent ran + validated: a SpecReview doc on disk.
33
+ review_doc:
34
+ required: [analysis, path]
34
35
  properties:
35
- type: { type: string }
36
- id: { type: string }
37
- title: { type: string }
38
- scope: { type: string }
36
+ analysis: { type: string }
37
+ path: { type: string }
39
38
  linkSchemas: {}
40
39
  interviews:
41
40
  request:
42
41
  itemType: operation_request
43
42
  completenessRule: all_required
44
43
  questions:
45
- - key: artifact_id
46
- prompt: "Report id, for example REPORT-001."
47
- type: text
48
- required: true
49
- - key: title
50
- prompt: "Report title."
51
- type: text
52
- required: true
53
44
  - key: scope
54
- prompt: "Spec paths, requirement ids, or graph scope to inspect."
45
+ prompt: "Spec paths, requirement ids, or graph scope to review."
55
46
  type: text
56
47
  required: true
57
- - key: evidence
58
- prompt: "Evidence sources used for this operation."
59
- type: text
60
- required: true
61
- - key: findings
62
- prompt: "Findings, gaps, or result summary."
63
- type: text
48
+ - key: review_set
49
+ prompt: "Review set: 'base' (skill checklist only), 'all' (the six analyses), or 'subset'."
50
+ type: enum
51
+ options: [base, all, subset]
64
52
  required: true
65
- artifactTemplates:
66
- report:
67
- source: templates/report/default.md
68
- target: spec/reports/review/${items.operation_request.request.artifact_id}.md
69
- phase: report_rendered
70
- frontmatterSchema: OperationReportSchema
53
+ - key: selected_analyses
54
+ prompt: "Analyses to run as a list, drawn from: failure-domain, integrity, dependency, evidence, risk-complexity, scope-boundary. Use all six for 'all'; the chosen ones for 'subset'; leave empty for 'base'."
55
+ type: list<text>
56
+ required: false
71
57
  recipes:
72
58
  run-to-review:
73
- description: Record inputs, render the operation report, validate it, then stop at acceptance.
59
+ description: Record inputs, then advance through analyses, rendering, validation, to acceptance.
74
60
  steps:
75
61
  - command: advance
76
- to: evidence_recorded
62
+ to: analyses_run
77
63
  - command: advance
78
- to: report_rendered
64
+ to: reviews_rendered
79
65
  - command: advance
80
66
  to: validated
81
67
  - command: advance
@@ -1,30 +0,0 @@
1
- ---
2
- type: spec-review
3
- id: "{{items.operation_request.request.artifact_id}}"
4
- title: "{{items.operation_request.request.title}}"
5
- scope: "{{items.operation_request.request.scope}}"
6
- ---
7
-
8
- # {{items.operation_request.request.artifact_id}}: {{items.operation_request.request.title}}
9
-
10
- ## Operation
11
-
12
- Run a composite specification review.
13
-
14
- ## Scope
15
-
16
- {{items.operation_request.request.scope}}
17
-
18
- ## Evidence
19
-
20
- {{items.operation_request.request.evidence}}
21
-
22
- ## Findings
23
-
24
- {{items.operation_request.request.findings}}
25
-
26
- ## Acceptance Criteria
27
-
28
- - Evidence is recorded before conclusions.
29
- - Findings reference concrete spec paths, requirement ids, or graph objects where available.
30
- - Follow-up work is expressed as recommended next workflows rather than hidden edits.