auditor-lambda 0.3.12 → 0.3.13

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
@@ -30,7 +30,7 @@ npm install -g auditor-lambda
30
30
 
31
31
  That makes `audit-code` available on `PATH`. During package install, the package
32
32
  also writes user-level command/skill assets for hosts we can seed safely, including
33
- the Claude command file and Codex skill bundle.
33
+ the Claude command file and global Codex skill bundle.
34
34
 
35
35
  After that, invoke `/audit-code` in a supported host. The prompt self-bootstraps
36
36
  the current repository by running:
@@ -51,7 +51,7 @@ audit-code install
51
51
 
52
52
  That bootstraps repo-local `/audit-code` surfaces for the hosts we can automate today, including:
53
53
 
54
- - Codex skill bundle, `AGENTS.md` guidance, and MCP setup notes
54
+ - Codex `AGENTS.md` fallback guidance for the global skill surface
55
55
  - Claude Desktop local MCP bundle artifacts and project template guidance
56
56
  - OpenCode command, skill, and `opencode.json` surfaces
57
57
  - VS Code prompt, custom agent, Copilot instructions, and `.vscode/mcp.json`
@@ -398,6 +398,23 @@ async function writeGeneratedMarkdown(targetPath, content) {
398
398
  };
399
399
  }
400
400
 
401
+ async function removeGeneratedMarkdownIfMatches(targetPath, expectedContent) {
402
+ const existing = await readTextIfExists(targetPath);
403
+ if (existing === null) {
404
+ return null;
405
+ }
406
+
407
+ if (normalizeNewlines(existing) !== normalizeNewlines(expectedContent)) {
408
+ return null;
409
+ }
410
+
411
+ await unlink(targetPath);
412
+ return {
413
+ path: targetPath,
414
+ mode: 'removed',
415
+ };
416
+ }
417
+
401
418
  async function writeGeneratedJson(targetPath, value) {
402
419
  const existed = await fileExists(targetPath);
403
420
  await mkdir(dirname(targetPath), { recursive: true });
@@ -1021,22 +1038,20 @@ const INSTALL_HOST_DEFINITIONS = {
1021
1038
  host: 'codex',
1022
1039
  label: 'Codex',
1023
1040
  support_level: 'supported',
1024
- setup_kind: 'skills+mcp+instructions',
1041
+ setup_kind: 'global-skill+instructions',
1025
1042
  summary:
1026
- 'Use the generated Codex skill bundle, AGENTS instructions, and shared MCP launcher so Codex can drive the backend through native tools instead of raw shell commands.',
1027
- primary_path_key: 'codexSkillPath',
1043
+ 'Use the global Codex skill installed by npm plus AGENTS fallback instructions for this repository. Repo-local Codex skill bundles are intentionally not generated.',
1044
+ primary_path_key: 'agentsInstructionsPath',
1028
1045
  supporting_path_keys: [
1029
- 'agentsInstructionsPath',
1030
- 'codexMcpSetupPath',
1031
- 'codexAutomationRecipePath',
1046
+ 'installedPromptPath',
1047
+ 'mcpLauncherPath',
1032
1048
  ],
1033
1049
  steps: [
1034
1050
  'Open this repository in Codex.',
1035
- 'Ensure Codex can access the repo-local auditor MCP server using the generated setup guide.',
1036
- 'Ask Codex to use the auditor MCP tools to start or continue `/audit-code`.',
1051
+ 'Use the global `/audit-code` skill installed by `npm install -g auditor-lambda`.',
1052
+ 'If the global skill is unavailable, follow the AGENTS fallback instructions that point at the repo-local prompt asset.',
1037
1053
  ],
1038
1054
  profile: {
1039
- writeCodex: true,
1040
1055
  writeAgents: true,
1041
1056
  },
1042
1057
  },
@@ -1685,43 +1700,14 @@ async function verifyInstalledBootstrap(argv) {
1685
1700
 
1686
1701
  switch (hostKey) {
1687
1702
  case 'codex':
1688
- await collectVerifyCheck(checks, 'codex_skill', async () => {
1689
- const content = await readFile(assetPaths.codexSkillPath, 'utf8');
1690
- if (!content.includes('# audit-code skill')) {
1691
- throw new Error(`Codex skill file is missing the expected heading: ${assetPaths.codexSkillPath}`);
1692
- }
1693
- const sourceSkill = (await readFile(skillAssetPath, 'utf8')).replace(/\r\n/g, '\n');
1694
- if (content.replace(/\r\n/g, '\n') !== sourceSkill) {
1695
- throw new Error(
1696
- `Codex skill is out of sync with the source skill. Run "audit-code install --host codex" or "audit-code install".`,
1697
- );
1703
+ await collectVerifyCheck(checks, 'codex_global_surface', async () => {
1704
+ const content = await readFile(assetPaths.agentsInstructionsPath, 'utf8');
1705
+ if (!content.includes('/audit-code')) {
1706
+ throw new Error(`AGENTS instructions do not reference /audit-code: ${assetPaths.agentsInstructionsPath}`);
1698
1707
  }
1699
1708
  return {
1700
- summary: 'Codex skill bundle is present and matches the source skill.',
1701
- path: assetPaths.codexSkillPath,
1702
- };
1703
- });
1704
- await collectVerifyCheck(checks, 'codex_prompt', async () => {
1705
- const content = await readFile(assetPaths.codexPromptPath, 'utf8');
1706
- const sourcePrompt = await readFile(promptAssetPath, 'utf8');
1707
- if (content !== sourcePrompt) {
1708
- throw new Error(
1709
- `Codex prompt is out of sync with the source prompt. Run "audit-code install --host codex" or "audit-code install".`,
1710
- );
1711
- }
1712
- return {
1713
- summary: 'Codex prompt bundle is present and matches the source prompt.',
1714
- path: assetPaths.codexPromptPath,
1715
- };
1716
- });
1717
- await collectVerifyCheck(checks, 'codex_mcp_setup', async () => {
1718
- const content = await readFile(assetPaths.codexMcpSetupPath, 'utf8');
1719
- if (!content.includes(MCP_LAUNCHER_FILENAME)) {
1720
- throw new Error(`Codex MCP setup guide does not reference ${MCP_LAUNCHER_FILENAME}.`);
1721
- }
1722
- return {
1723
- summary: 'Codex MCP setup guide references the shared launcher.',
1724
- path: assetPaths.codexMcpSetupPath,
1709
+ summary: 'Codex uses the global skill surface with AGENTS fallback instructions.',
1710
+ path: assetPaths.agentsInstructionsPath,
1725
1711
  };
1726
1712
  });
1727
1713
  break;
@@ -1989,6 +1975,10 @@ async function detectBootstrapRefreshReason(root, host) {
1989
1975
  (installManifest.hosts ?? []).map((entry) => entry.host),
1990
1976
  );
1991
1977
 
1978
+ if (hostCatalog.has('codex') && (assetPaths.codexSkillPath || assetPaths.codexPromptPath)) {
1979
+ return 'legacy_repo_local_codex_skill';
1980
+ }
1981
+
1992
1982
  for (const hostKey of getInstallHostKeys(host)) {
1993
1983
  if (!hostCatalog.has(hostKey)) {
1994
1984
  return `missing_host_surface:${hostKey}`;
@@ -2029,14 +2019,6 @@ async function detectBootstrapRefreshReason(root, host) {
2029
2019
  for (const hostKey of getInstallHostKeys(host)) {
2030
2020
  switch (hostKey) {
2031
2021
  case 'codex': {
2032
- const codexSkill = await readTextIfExists(assetPaths.codexSkillPath);
2033
- if (codexSkill?.replace(/\r\n/g, '\n') !== sourceSkill) {
2034
- return 'stale_host_asset:codex:skill';
2035
- }
2036
- const codexPrompt = await readTextIfExists(assetPaths.codexPromptPath);
2037
- if (codexPrompt !== sourcePrompt) {
2038
- return 'stale_host_asset:codex:prompt';
2039
- }
2040
2022
  break;
2041
2023
  }
2042
2024
  case 'opencode': {
@@ -2240,6 +2222,23 @@ async function installBootstrap(argv, options = {}) {
2240
2222
  );
2241
2223
  }
2242
2224
 
2225
+ if (!profile.writeCodex) {
2226
+ const legacyCodexSkillRemoval = await removeGeneratedMarkdownIfMatches(
2227
+ join(root, '.codex', 'skills', 'audit-code', 'SKILL.md'),
2228
+ skillSource,
2229
+ );
2230
+ if (legacyCodexSkillRemoval) {
2231
+ results.push(legacyCodexSkillRemoval);
2232
+ }
2233
+ const legacyCodexPromptRemoval = await removeGeneratedMarkdownIfMatches(
2234
+ join(root, '.codex', 'skills', 'audit-code', 'audit-code.prompt.md'),
2235
+ promptSource,
2236
+ );
2237
+ if (legacyCodexPromptRemoval) {
2238
+ results.push(legacyCodexPromptRemoval);
2239
+ }
2240
+ }
2241
+
2243
2242
  if (profile.writeCodex) {
2244
2243
  results.push(
2245
2244
  await writeGeneratedMarkdown(
package/dist/cli.js CHANGED
@@ -792,7 +792,7 @@ async function cmdRunToCompletion(argv) {
792
792
  });
793
793
  const blockRunId = buildRunId(obligationId, runCount + 1);
794
794
  const blockPaths = getRunPaths(artifactsDir, blockRunId);
795
- const blockPendingTasks = await addFileLineCountHints(root, buildPendingAuditTasks(bundle).slice(0, agentBatchSize));
795
+ const blockPendingTasks = await addFileLineCountHints(root, buildPendingAuditTasks(bundle));
796
796
  const blockPendingTasksPath = join(blockPaths.runDir, "pending-audit-tasks.json");
797
797
  const blockAuditResultsPath = join(blockPaths.runDir, "audit-results.json");
798
798
  const blockTask = {
@@ -1193,7 +1193,7 @@ async function cmdRunToCompletion(argv) {
1193
1193
  continue;
1194
1194
  }
1195
1195
  const pendingAuditTasks = preferredExecutor === "agent"
1196
- ? await addFileLineCountHints(root, buildPendingAuditTasks(bundle).slice(0, agentBatchSize))
1196
+ ? await addFileLineCountHints(root, buildPendingAuditTasks(bundle))
1197
1197
  : undefined;
1198
1198
  const pendingAuditTasksPath = preferredExecutor === "agent"
1199
1199
  ? join(paths.runDir, "pending-audit-tasks.json")
@@ -78,15 +78,16 @@ Use `/audit-code` in conversation, treat the active conversation model as the de
78
78
 
79
79
  The global npm install seeds `~/.codex/skills/audit-code/` so the command can be
80
80
  available before a repository is bootstrapped. The first `/audit-code` run then
81
- uses `audit-code ensure --quiet` to create or refresh repo-local Codex support.
81
+ uses `audit-code ensure --quiet` to create or refresh only repo-local fallback
82
+ instructions and shared launcher assets.
82
83
 
83
84
  Use `audit-code install --host codex` only when you want to repair or force-refresh
84
- the Codex repo-local files from the target repository root.
85
+ the Codex fallback files from the target repository root.
85
86
 
86
- That writes a repo-local Codex skill bundle, updates `AGENTS.md` through a managed block when needed, and emits Codex-specific MCP setup guidance plus an automation recipe in `.audit-code/install/codex/`.
87
- The intended operator flow is still conversational first, with the generated skill and AGENTS guidance steering the active Codex session toward `/audit-code` and the MCP-backed workflow.
88
-
89
- The Codex automation recipe should still be treated as optional follow-through after the basic local flow is validated in the real app.
87
+ That updates `AGENTS.md` through a managed fallback block when needed. It does
88
+ not write a repo-local Codex skill bundle, so Codex should expose only the
89
+ global `/audit-code` command surface.
90
+ The intended operator flow is still conversational first, with the global skill and AGENTS guidance steering the active Codex session toward `/audit-code` and the MCP-backed workflow.
90
91
 
91
92
  ### Claude Desktop
92
93
 
@@ -8,7 +8,7 @@ npm install -g auditor-lambda
8
8
 
9
9
  That makes the `audit-code` command available from any repository. Package
10
10
  install also seeds user-level command or skill assets for hosts we can update
11
- safely, including the Claude command file and Codex skill bundle.
11
+ safely, including the Claude command file and global Codex skill bundle.
12
12
 
13
13
  After that, the normal user flow is to invoke `/audit-code` in a supported host.
14
14
  The prompt starts by running:
@@ -55,10 +55,7 @@ Installed shared surfaces:
55
55
  Installed host-specific surfaces:
56
56
 
57
57
  - Codex:
58
- - `.codex/skills/audit-code/*`
59
- - `AGENTS.md` managed block when needed
60
- - `.audit-code/install/codex/MCP-SETUP.md`
61
- - `.audit-code/install/codex/RE-AUDIT-AUTOMATION.md`
58
+ - `AGENTS.md` managed fallback block when needed
62
59
  - Claude Desktop:
63
60
  - `.audit-code/install/claude-desktop/PROJECT-TEMPLATE.md`
64
61
  - `.audit-code/install/claude-desktop/remote-mcp-connector.json`
@@ -99,11 +96,11 @@ without supplying extra root paths, provider flags, or model-selection arguments
99
96
  ## What is fully automated today
100
97
 
101
98
  - global `npm install -g auditor-lambda` seeds user-level Claude command and
102
- Codex skill assets when filesystem permissions allow it
99
+ global Codex skill assets when filesystem permissions allow it
103
100
  - `/audit-code` runs `audit-code ensure --quiet` before advancing the audit
104
101
  - shared installer output, manifest generation, and repo-local MCP launcher generation
105
102
  - default backend fallback session-config creation when no config exists yet
106
- - Codex skill-bundle and AGENTS-oriented install output
103
+ - Codex global-skill and AGENTS-oriented install output
107
104
  - OpenCode command, skill, prompt, and config generation
108
105
  - VS Code prompt, custom-agent, instruction, and MCP config generation
109
106
  - Claude Desktop project-template, remote-connector, and local bundle generation
@@ -24,7 +24,7 @@ The repository now supports:
24
24
  - repo-local MCP resources for current artifacts, operator handoff, install guidance, and the current audit report
25
25
  - repo-local MCP prompts for `audit-code`, `review-task`, and `synthesize-report`
26
26
  - generated `.audit-code/install/manifest.json` plus a shared repo-local MCP launcher script
27
- - Codex install assets including a repo skill bundle, `AGENTS.md` support, MCP setup guidance, and an automation recipe
27
+ - Codex global skill assets plus `AGENTS.md` fallback support
28
28
  - Claude Desktop install assets including a project template, remote connector template, and generated local bundle artifacts
29
29
  - OpenCode install assets including command, skill, prompt, and `opencode.json` support
30
30
  - VS Code install assets including prompt file, Copilot instructions, custom agent, and `.vscode/mcp.json`
@@ -66,7 +66,7 @@ The biggest remaining gap is not raw feature presence anymore. It is host-by-hos
66
66
 
67
67
  Near-term work should focus on:
68
68
 
69
- - verifying the Codex skill bundle, `AGENTS.md`, MCP setup guidance, and automation recipe against the real Codex app flow
69
+ - verifying the global Codex skill bundle and `AGENTS.md` fallback guidance against the real Codex app flow
70
70
  - installing and smoke-testing the generated Claude Desktop `DXT` or bundle output in a real Desktop environment
71
71
  - validating that the OpenCode `opencode.json` shape, command file, and MCP config match current OpenCode behavior
72
72
  - validating the VS Code prompt, agent, and `.vscode/mcp.json` flow inside a real workspace
package/docs/packaging.md CHANGED
@@ -22,7 +22,7 @@ That means the package needs to ship:
22
22
  - packet-dispatch support data such as `dispatch/lens-definitions.json`
23
23
  - the backend fallback wrapper exposed as `audit-code`
24
24
  - user-level postinstall assets for hosts we can safely seed from a global npm
25
- install, currently the Claude command and Codex skill bundle
25
+ install, currently the Claude command and global Codex skill bundle
26
26
  - `audit-code ensure`, so a globally installed slash command can lazily create
27
27
  the repo-local host assets it needs in each target repository
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auditor-lambda",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "private": false,
5
5
  "description": "Portable hybrid code-auditing framework for arbitrary repositories.",
6
6
  "type": "module",
@@ -20,6 +20,9 @@ Normal usage should:
20
20
  Semantic review should be delegated to bounded subagents whenever the host can
21
21
  dispatch them. The conversation orchestrator owns dispatch and ingestion control;
22
22
  it should not perform broad review itself when subagents are available.
23
+ Entering `/audit-code` is explicit user authorization to fan out those review
24
+ subagents; do not require a separate delegation request before parallel
25
+ dispatch.
23
26
 
24
27
  If the host cannot delegate to subagents, the conversation orchestrator may
25
28
  complete exactly one assigned review task, ingest it through the provided backend
@@ -52,9 +55,10 @@ current repository before advancing the audit:
52
55
  audit-code ensure --quiet
53
56
  ```
54
57
 
55
- That idempotent bootstrap writes repo-local host assets for Codex, Claude Desktop,
56
- OpenCode, VS Code, and Antigravity plus shared MCP setup guidance only when they
57
- are missing or stale.
58
+ That idempotent bootstrap writes repo-local fallback/guidance assets for
59
+ supported hosts plus shared MCP setup guidance only when they are missing or
60
+ stale. Codex uses the global skill installed by npm rather than a repo-local
61
+ skill bundle.
58
62
 
59
63
  Use the explicit installer for repair or forced refresh:
60
64
 
@@ -28,6 +28,9 @@ and ingest results mechanically.
28
28
  - CRITICAL: Do not use your `Read` tool to read `entry.prompt_path` or JSON schemas into your own context window. The subagent will read them. Pass the path literally.
29
29
  - Prefer subagent dispatch for semantic review whenever the host exposes an
30
30
  Agent/subagent tool.
31
+ - Treat the user's `/audit-code` request as explicit authorization to launch
32
+ review subagents in parallel. Do not ask for a separate delegation request
33
+ before using available Agent/subagent tools.
31
34
  - Do not use `browser_subagent` for semantic review of source code unless the
32
35
  task explicitly requires browser-based validation.
33
36
  - If the host cannot dispatch subagents, complete exactly one assigned review
@@ -83,7 +86,7 @@ If status is `"blocked"` for semantic review, continue to Step 2.
83
86
 
84
87
  ## Step 2 - Dispatch Review Work
85
88
 
86
- When the host supports subagents, prepare a dispatch plan:
89
+ When the host supports subagents, prepare a dispatch plan by default:
87
90
 
88
91
  ```bash
89
92
  audit-code prepare-dispatch --run-id <run_id> --artifacts-dir <artifacts_dir>