@agent-surface/cli 0.11.0 → 0.12.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/README.md CHANGED
@@ -19,10 +19,11 @@ A presentation surface only exists once components mount — it is a projection
19
19
  ```tsx
20
20
  // agent-surface.config.tsx
21
21
  import { defineSurface } from "@agent-surface/cli";
22
- import { createApp } from "./src/agent/setup.js"; // already exists
22
+ import { agentManifest, createApp } from "./src/agent/setup.js"; // already exists
23
23
  import { App } from "./src/app/App.js"; // already exists
24
24
 
25
25
  export default defineSurface({
26
+ manifest: agentManifest,
26
27
  mount: ({ user }) => {
27
28
  const app = createApp({ environment: "test", user });
28
29
  return { registry: app.registry, ui: <App app={app} />, app };
@@ -42,13 +43,13 @@ Loading goes through vite-node on your own `vite.config.*`, so your aliases, plu
42
43
  agent-surface init # read the codebase, then scaffold a config
43
44
  agent-surface inspect [scenario] # what an agent can reach, and what it cannot
44
45
  agent-surface snapshot [scenario] # write/refresh the committed baseline
45
- agent-surface check [scenario] # exit non-zero on drift, or on a capability no scenario reaches
46
+ agent-surface check [scenario] # fail drift, gaps, rejections, stale scenarios
46
47
  ```
47
48
 
48
49
  Every command covers all scenarios in the config unless you name one. `inspect` prints each in turn:
49
50
 
50
51
  ```text
51
- 10 authored (upper bound) · 10 call sites across 21 files · domain not analyzed, it comes from the oRPC router
52
+ 11 authored (upper bound) · 10 call sites across 21 files · 1 domain manifest capability
52
53
 
53
54
  scenario admin route /devices
54
55
  9 callable, 2 visible-disabled, 0 hidden
@@ -62,7 +63,7 @@ devices.table.sort action local-state callable idempotent · reve
62
63
  devices.disable procedure destructive disabled confirmation:required · deviceIds bound+locked
63
64
  ⤷ Select at least one device first
64
65
 
65
- 10 authored · 10 reached · 0 unreached · 1 scenario (admin)
66
+ 11 authored · 11 reached · 0 unreached · 1 scenario (admin)
66
67
  ```
67
68
 
68
69
  Every count names what it is relative to — the scenario always, the scope when one is active. A surface is a projection of one mounted context, never "the app".
package/dist/bin.js CHANGED
@@ -131,7 +131,7 @@ async function main(argv = process.argv.slice(2)) {
131
131
  const depth = values.depth;
132
132
  try {
133
133
  if (command === "init") {
134
- const { runInit } = await import("./init-LYYVXFEQ.js");
134
+ const { runInit } = await import("./init-LFQ5R3G7.js");
135
135
  return await runInit({
136
136
  cwd: process.cwd(),
137
137
  ...values.tsconfig ? { tsconfig: values.tsconfig } : {},
@@ -158,7 +158,7 @@ async function main(argv = process.argv.slice(2)) {
158
158
  ...values["baseline-dir"] ? { baselineDir: values["baseline-dir"] } : {}
159
159
  };
160
160
  if (command === "inspect") {
161
- const { runInspect } = await import("./inspect-3CBRKTDM.js");
161
+ const { runInspect } = await import("./inspect-ELUQ73MZ.js");
162
162
  return await runInspect({
163
163
  ...shared,
164
164
  ...values.detail ? { detail: true } : {},
@@ -167,10 +167,10 @@ async function main(argv = process.argv.slice(2)) {
167
167
  });
168
168
  }
169
169
  if (command === "snapshot") {
170
- const { runSnapshot } = await import("./snapshot-DJ22WCT4.js");
170
+ const { runSnapshot } = await import("./snapshot-3E7MVMVG.js");
171
171
  return await runSnapshot(shared);
172
172
  }
173
- const { runCheck } = await import("./check-BYQ34OVQ.js");
173
+ const { runCheck } = await import("./check-CS4Z3ZK3.js");
174
174
  return await runCheck({
175
175
  ...shared,
176
176
  ...values["allow-unresolved"] ? { allowUnresolved: true } : {}
@@ -1,21 +1,26 @@
1
1
  import {
2
+ coverageReport,
2
3
  renderCoveragePlain,
3
4
  renderDriftPlain,
4
5
  renderFailuresPlain,
5
- renderNoVerdictPlain
6
- } from "./chunk-RXX63JSL.js";
6
+ renderNoVerdictPlain,
7
+ scenarioBaseline
8
+ } from "./chunk-TPWRSFK7.js";
7
9
  import "./chunk-DYDSJM7R.js";
8
10
  import {
11
+ ALLOWLIST_FILE,
12
+ SCENARIO_MANIFEST_FILE,
13
+ UNREAD_ALLOWLIST_FILE,
9
14
  annotate,
10
15
  baselinePath,
11
16
  coverageExitCode,
12
17
  diff,
13
18
  joinCoverage,
14
19
  mountScenarios,
15
- normalize,
16
20
  readBaseline,
17
- readInventory
18
- } from "./chunk-GXXKZTQB.js";
21
+ readInventory,
22
+ readScenarioManifest
23
+ } from "./chunk-Q5WOLWEW.js";
19
24
  import {
20
25
  UsageError,
21
26
  write,
@@ -23,6 +28,7 @@ import {
23
28
  } from "./chunk-QIVOZAWX.js";
24
29
 
25
30
  // src/commands/check.ts
31
+ import { existsSync, readdirSync } from "fs";
26
32
  import { relative } from "path";
27
33
  async function runCheck(options) {
28
34
  if (options.depth === "static") {
@@ -49,18 +55,35 @@ async function runCheck(options) {
49
55
  drifted.push({ scenario: result.scenario, missingBaseline: true, entries: [] });
50
56
  continue;
51
57
  }
52
- const actual = normalize(result.snapshot);
58
+ const actual = scenarioBaseline(result);
53
59
  const entries = annotate(diff(expected, actual), actual, expected);
54
60
  if (entries.length > 0) drifted.push({ scenario: result.scenario, entries });
55
61
  }
62
+ const committedScenarios = readScenarioManifest(runtime.baselineDir);
63
+ const declared = [...runtime.declaredScenarios].sort();
64
+ const scenarioManifestMismatch = committedScenarios === void 0 || JSON.stringify(committedScenarios) !== JSON.stringify(declared);
65
+ const reserved = /* @__PURE__ */ new Set([SCENARIO_MANIFEST_FILE, ALLOWLIST_FILE, UNREAD_ALLOWLIST_FILE]);
66
+ const staleBaselineFiles = (existsSync(runtime.baselineDir) ? readdirSync(runtime.baselineDir, { withFileTypes: true }) : []).filter((entry) => entry.isFile() && entry.name.endsWith(".json") && !reserved.has(entry.name)).map((entry) => entry.name.slice(0, -5)).filter((scenario) => !runtime.declaredScenarios.includes(scenario)).sort();
67
+ const rejected = runtime.results.filter((result) => result.rejections.length > 0).map((result) => ({ scenario: result.scenario, rejections: result.rejections }));
56
68
  const coverage = joinCoverage(inventory, runtime, analysis);
57
69
  const coverageFailed = coverage !== void 0 && coverageExitCode(coverage, { allowUnresolved: options.allowUnresolved === true }) !== 0;
58
70
  const couldNotRun = runtime.failures.length > 0;
59
- const ok = drifted.length === 0 && !coverageFailed && !couldNotRun;
71
+ const ok = drifted.length === 0 && !coverageFailed && !couldNotRun && rejected.length === 0 && !scenarioManifestMismatch && staleBaselineFiles.length === 0;
60
72
  if (options.json) {
61
73
  write(
62
74
  JSON.stringify(
63
- { ok, drifted, failures: runtime.failures, coverage: coverage ?? null },
75
+ {
76
+ ok,
77
+ drifted,
78
+ failures: runtime.failures,
79
+ rejected,
80
+ scenarioManifest: {
81
+ expected: declared,
82
+ committed: committedScenarios ?? null,
83
+ staleBaselines: staleBaselineFiles
84
+ },
85
+ coverage: coverageReport(coverage)
86
+ },
64
87
  null,
65
88
  2
66
89
  )
@@ -74,6 +97,30 @@ async function runCheck(options) {
74
97
  }
75
98
  const missing = drifted.filter((entry) => entry.missingBaseline);
76
99
  const changed = drifted.filter((entry) => !entry.missingBaseline);
100
+ if (rejected.length > 0) {
101
+ writeError(
102
+ [
103
+ `${coverage ? "\n" : ""}REJECTED REGISTRATIONS \u2014 the runtime refused authored surface (${rejected.reduce((sum, entry) => sum + entry.rejections.length, 0)})`,
104
+ ...rejected.flatMap(
105
+ (entry) => entry.rejections.map(
106
+ (rejection) => ` ${entry.scenario}: ${rejection.componentType}@${rejection.instanceId} (${rejection.reason})`
107
+ )
108
+ )
109
+ ].join("\n")
110
+ );
111
+ }
112
+ if (scenarioManifestMismatch || staleBaselineFiles.length > 0) {
113
+ const committed = committedScenarios?.join(", ") ?? "missing";
114
+ writeError(
115
+ [
116
+ `${coverage || rejected.length > 0 ? "\n" : ""}SCENARIO DRIFT \u2014 committed baselines do not match config`,
117
+ ` config: ${declared.join(", ")}`,
118
+ ` manifest: ${committed}`,
119
+ ...staleBaselineFiles.length > 0 ? [` stale baselines: ${staleBaselineFiles.join(", ")}`] : [],
120
+ " run `agent-surface snapshot` and commit the manifest"
121
+ ].join("\n")
122
+ );
123
+ }
77
124
  if (missing.length > 0) {
78
125
  writeError(
79
126
  [
@@ -119,4 +166,4 @@ ${renderNoVerdictPlain(runtime.failures)}`);
119
166
  export {
120
167
  runCheck
121
168
  };
122
- //# sourceMappingURL=check-BYQ34OVQ.js.map
169
+ //# sourceMappingURL=check-CS4Z3ZK3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/check.ts"],"sourcesContent":["import { existsSync, readdirSync } from \"node:fs\";\nimport { relative } from \"node:path\";\nimport {\n UsageError,\n joinCoverage,\n mountScenarios,\n readInventory,\n type AnalysisOptions,\n type Depth,\n} from \"../analysis.js\";\nimport {\n annotate,\n baselinePath,\n diff,\n readBaseline,\n readScenarioManifest,\n SCENARIO_MANIFEST_FILE,\n type DiffEntry,\n} from \"../baseline.js\";\nimport { ALLOWLIST_FILE, coverageExitCode, UNREAD_ALLOWLIST_FILE } from \"../coverage.js\";\nimport {\n renderCoveragePlain,\n renderDriftPlain,\n renderFailuresPlain,\n renderNoVerdictPlain,\n} from \"../render/plain.js\";\nimport { write, writeError } from \"../output.js\";\nimport { coverageReport, scenarioBaseline } from \"../report.js\";\n\nexport interface CheckOptions {\n configPath: string;\n depth: Depth;\n scenario?: string;\n scope?: string[];\n tsconfig?: string;\n baselineDir?: string;\n allowUnresolved?: boolean;\n json?: boolean;\n plain?: boolean;\n}\n\ninterface ScenarioDrift {\n scenario: string;\n missingBaseline?: boolean;\n entries: DiffEntry[];\n}\n\ninterface RejectedScenario {\n scenario: string;\n rejections: Array<{ componentType: string; instanceId: string; reason: string }>;\n}\n\n/**\n * The gate. The only command in this package that fails on a finding, which is\n * why every finding has to reach it.\n *\n * It used to fail on exactly one class — the projection drifting from its\n * baseline — and print a line telling you that capabilities no scenario mounts\n * were a different command's question. A gate that names the check it is not\n * performing is a gate with a hole in it, and in CI the hole was silent: a\n * whole unreached route sat behind a green tick.\n *\n * So it now fails on every incomplete or changed report:\n *\n * - **drift** — the surface changed against its committed baseline;\n * - **a missing baseline** — nothing to compare, which is not the same as a match;\n * - **an unreached capability** — authored, and no scenario mounts it;\n * - **an unread call site** — the catalog is incomplete, so the third check\n * above is computed over a denominator that is only a floor;\n * - **a rejected registration** — authored surface was refused;\n * - **scenario drift** — config, manifest and baseline files disagree.\n *\n * `.agent-surface/coverage-allow.json` ratchets the third; `--allow-unresolved`\n * accepts the fourth. Both are deliberate, committed decisions rather than\n * flags that quietly widen the gate.\n *\n * Output is always plain, with no rendering framework in its path at all: this\n * is a report that gets pasted into a pull request and read out of a CI log,\n * and neither of those is a terminal.\n */\nexport async function runCheck(options: CheckOptions): Promise<number> {\n if (options.depth === \"static\") {\n throw new UsageError(\n \"check --depth static has nothing to compare — a baseline is a projection, and \" +\n \"at this depth nothing is mounted. Use --depth runtime for drift alone, or full for both.\",\n );\n }\n\n const analysis: AnalysisOptions = {\n configPath: options.configPath,\n depth: options.depth,\n ...(options.scenario ? { scenario: options.scenario } : {}),\n ...(options.scope ? { scope: options.scope } : {}),\n ...(options.tsconfig ? { tsconfig: options.tsconfig } : {}),\n ...(options.baselineDir ? { baselineDir: options.baselineDir } : {}),\n };\n\n const inventory = readInventory(analysis);\n // No streaming here, unlike `inspect`. A report is read top-down and has to\n // lead with its findings, which means every finding has to exist first.\n const runtime = await mountScenarios(analysis);\n if (!runtime) throw new UsageError(\"check needs a mount, and this depth performs none\");\n\n const drifted: ScenarioDrift[] = [];\n for (const result of runtime.results) {\n const path = baselinePath(runtime.baselineDir, result.scenario);\n const expected = readBaseline(path);\n if (expected === undefined) {\n drifted.push({ scenario: result.scenario, missingBaseline: true, entries: [] });\n continue;\n }\n const actual = scenarioBaseline(result);\n const entries = annotate(diff(expected, actual), actual, expected);\n if (entries.length > 0) drifted.push({ scenario: result.scenario, entries });\n }\n\n const committedScenarios = readScenarioManifest(runtime.baselineDir);\n const declared = [...runtime.declaredScenarios].sort();\n const scenarioManifestMismatch =\n committedScenarios === undefined ||\n JSON.stringify(committedScenarios) !== JSON.stringify(declared);\n const reserved = new Set([SCENARIO_MANIFEST_FILE, ALLOWLIST_FILE, UNREAD_ALLOWLIST_FILE]);\n const staleBaselineFiles = (existsSync(runtime.baselineDir)\n ? readdirSync(runtime.baselineDir, { withFileTypes: true })\n : [])\n .filter((entry) => entry.isFile() && entry.name.endsWith(\".json\") && !reserved.has(entry.name))\n .map((entry) => entry.name.slice(0, -5))\n .filter((scenario) => !runtime.declaredScenarios.includes(scenario))\n .sort();\n\n const rejected: RejectedScenario[] = runtime.results\n .filter((result) => result.rejections.length > 0)\n .map((result) => ({ scenario: result.scenario, rejections: result.rejections }));\n\n const coverage = joinCoverage(inventory, runtime, analysis);\n const coverageFailed =\n coverage !== undefined &&\n coverageExitCode(coverage, { allowUnresolved: options.allowUnresolved === true }) !== 0;\n const couldNotRun = runtime.failures.length > 0;\n const ok =\n drifted.length === 0 &&\n !coverageFailed &&\n !couldNotRun &&\n rejected.length === 0 &&\n !scenarioManifestMismatch &&\n staleBaselineFiles.length === 0;\n\n if (options.json) {\n write(\n JSON.stringify(\n {\n ok,\n drifted,\n failures: runtime.failures,\n rejected,\n scenarioManifest: {\n expected: declared,\n committed: committedScenarios ?? null,\n staleBaselines: staleBaselineFiles,\n },\n coverage: coverageReport(coverage),\n },\n null,\n 2,\n ),\n );\n return couldNotRun ? 2 : ok ? 0 : 1;\n }\n\n // The gap leads, because it is the finding this command could not previously\n // make at all. Drift follows, because it is the one it always could.\n if (coverage) {\n const rendered = renderCoveragePlain(coverage);\n if (coverageFailed) writeError(rendered);\n else write(rendered);\n }\n\n // \"No baseline\" is not drift, and filing it under a heading that says the\n // surface changed would be a claim about a comparison that never happened.\n const missing = drifted.filter((entry) => entry.missingBaseline);\n const changed = drifted.filter((entry) => !entry.missingBaseline);\n\n if (rejected.length > 0) {\n writeError(\n [\n `${coverage ? \"\\n\" : \"\"}REJECTED REGISTRATIONS — the runtime refused authored surface (${rejected.reduce((sum, entry) => sum + entry.rejections.length, 0)})`,\n ...rejected.flatMap((entry) =>\n entry.rejections.map(\n (rejection) =>\n ` ${entry.scenario}: ${rejection.componentType}@${rejection.instanceId} (${rejection.reason})`,\n ),\n ),\n ].join(\"\\n\"),\n );\n }\n\n if (scenarioManifestMismatch || staleBaselineFiles.length > 0) {\n const committed = committedScenarios?.join(\", \") ?? \"missing\";\n writeError(\n [\n `${coverage || rejected.length > 0 ? \"\\n\" : \"\"}SCENARIO DRIFT — committed baselines do not match config`,\n ` config: ${declared.join(\", \")}`,\n ` manifest: ${committed}`,\n ...(staleBaselineFiles.length > 0\n ? [` stale baselines: ${staleBaselineFiles.join(\", \")}`]\n : []),\n \" run `agent-surface snapshot` and commit the manifest\",\n ].join(\"\\n\"),\n );\n }\n\n if (missing.length > 0) {\n writeError(\n [\n `${coverage ? \"\\n\" : \"\"}NO BASELINE — nothing to compare against, which is not the same as a match (${missing.length})`,\n ...missing.map(\n (entry) =>\n ` ${entry.scenario}: ${relative(\n process.cwd(),\n baselinePath(runtime.baselineDir, entry.scenario),\n )} does not exist — run \\`agent-surface snapshot\\` and commit it`,\n ),\n ].join(\"\\n\"),\n );\n }\n\n if (changed.length > 0) {\n writeError(\n [\n `${coverage || missing.length > 0 ? \"\\n\" : \"\"}DRIFT — the surface changed against its baseline (${changed.length})`,\n ...changed.map((entry) => renderDriftPlain(entry.scenario, entry.entries)),\n \"\",\n `surface drift in ${changed.length} scenario${\n changed.length === 1 ? \"\" : \"s\"\n } — review the change, then \\`agent-surface snapshot\\` to accept it`,\n ].join(\"\\n\"),\n );\n }\n\n if (couldNotRun) {\n writeError(`\\n${renderFailuresPlain(runtime.failures)}`);\n if (inventory) writeError(`\\n${renderNoVerdictPlain(runtime.failures)}`);\n return 2;\n }\n\n if (ok) {\n if (coverage) write(\"\");\n // Naming them is the point (`AS-CLI-007`). This used to have to add that it\n // was a statement about these scenarios only, and point at another command\n // for the rest; at `--depth full` there is no rest, so the caveat is gone\n // along with the command it pointed at.\n write(`surface matches the baseline in ${runtime.scenarios.join(\", \")}`);\n if (!coverage) {\n write(\n \"that is a statement about these scenarios only — re-run at --depth full to find \" +\n \"capabilities no scenario mounts\",\n );\n }\n return 0;\n }\n return 1;\n}\n"],"mappings":";;;;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