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 +2 -2
- package/audit-code-wrapper-lib.mjs +51 -52
- package/dist/cli.js +2 -2
- package/docs/agent-integrations.md +7 -6
- package/docs/bootstrap-install.md +4 -7
- package/docs/next-steps.md +2 -2
- package/docs/packaging.md +1 -1
- package/package.json +1 -1
- package/skills/audit-code/SKILL.md +7 -3
- package/skills/audit-code/audit-code.prompt.md +4 -1
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
|
|
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: '
|
|
1041
|
+
setup_kind: 'global-skill+instructions',
|
|
1025
1042
|
summary:
|
|
1026
|
-
'Use the
|
|
1027
|
-
primary_path_key: '
|
|
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
|
-
'
|
|
1030
|
-
'
|
|
1031
|
-
'codexAutomationRecipePath',
|
|
1046
|
+
'installedPromptPath',
|
|
1047
|
+
'mcpLauncherPath',
|
|
1032
1048
|
],
|
|
1033
1049
|
steps: [
|
|
1034
1050
|
'Open this repository in Codex.',
|
|
1035
|
-
'
|
|
1036
|
-
'
|
|
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, '
|
|
1689
|
-
const content = await readFile(assetPaths.
|
|
1690
|
-
if (!content.includes('
|
|
1691
|
-
throw new Error(`
|
|
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
|
|
1701
|
-
path: assetPaths.
|
|
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)
|
|
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)
|
|
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
|
|
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
|
|
85
|
+
the Codex fallback files from the target repository root.
|
|
85
86
|
|
|
86
|
-
That
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
The
|
|
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
|
-
-
|
|
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
|
|
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
|
package/docs/next-steps.md
CHANGED
|
@@ -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
|
|
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
|
|
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
|
@@ -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
|
|
56
|
-
|
|
57
|
-
|
|
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>
|