auditor-lambda 0.1.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 +173 -0
- package/audit-code-wrapper-lib.mjs +905 -0
- package/audit-code.mjs +13 -0
- package/dist/adapters/coverageSummary.d.ts +8 -0
- package/dist/adapters/coverageSummary.js +13 -0
- package/dist/adapters/eslint.d.ts +13 -0
- package/dist/adapters/eslint.js +21 -0
- package/dist/adapters/normalizeExternal.d.ts +12 -0
- package/dist/adapters/normalizeExternal.js +19 -0
- package/dist/adapters/npmAudit.d.ts +15 -0
- package/dist/adapters/npmAudit.js +12 -0
- package/dist/adapters/semgrep.d.ts +22 -0
- package/dist/adapters/semgrep.js +14 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +724 -0
- package/dist/coverage.d.ts +11 -0
- package/dist/coverage.js +102 -0
- package/dist/extractors/bucketing.d.ts +7 -0
- package/dist/extractors/bucketing.js +72 -0
- package/dist/extractors/disposition.d.ts +4 -0
- package/dist/extractors/disposition.js +41 -0
- package/dist/extractors/fileInventory.d.ts +7 -0
- package/dist/extractors/fileInventory.js +44 -0
- package/dist/extractors/flows.d.ts +5 -0
- package/dist/extractors/flows.js +125 -0
- package/dist/extractors/fsIntake.d.ts +8 -0
- package/dist/extractors/fsIntake.js +66 -0
- package/dist/extractors/graph.d.ts +4 -0
- package/dist/extractors/graph.js +46 -0
- package/dist/extractors/ignore.d.ts +1 -0
- package/dist/extractors/ignore.js +17 -0
- package/dist/extractors/risk.d.ts +5 -0
- package/dist/extractors/risk.js +45 -0
- package/dist/extractors/surfaces.d.ts +4 -0
- package/dist/extractors/surfaces.js +40 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/artifacts.d.ts +38 -0
- package/dist/io/artifacts.js +100 -0
- package/dist/io/json.d.ts +8 -0
- package/dist/io/json.js +96 -0
- package/dist/io/runArtifacts.d.ts +14 -0
- package/dist/io/runArtifacts.js +37 -0
- package/dist/orchestrator/advance.d.ts +24 -0
- package/dist/orchestrator/advance.js +104 -0
- package/dist/orchestrator/artifactMetadata.d.ts +4 -0
- package/dist/orchestrator/artifactMetadata.js +111 -0
- package/dist/orchestrator/autoFixExecutor.d.ts +3 -0
- package/dist/orchestrator/autoFixExecutor.js +63 -0
- package/dist/orchestrator/chunking.d.ts +5 -0
- package/dist/orchestrator/chunking.js +13 -0
- package/dist/orchestrator/dependencyMap.d.ts +1 -0
- package/dist/orchestrator/dependencyMap.js +82 -0
- package/dist/orchestrator/executors.d.ts +6 -0
- package/dist/orchestrator/executors.js +52 -0
- package/dist/orchestrator/flowCoverage.d.ts +4 -0
- package/dist/orchestrator/flowCoverage.js +44 -0
- package/dist/orchestrator/flowPlanning.d.ts +3 -0
- package/dist/orchestrator/flowPlanning.js +42 -0
- package/dist/orchestrator/flowRequeue.d.ts +5 -0
- package/dist/orchestrator/flowRequeue.js +58 -0
- package/dist/orchestrator/internalExecutors.d.ts +16 -0
- package/dist/orchestrator/internalExecutors.js +212 -0
- package/dist/orchestrator/nextStep.d.ts +9 -0
- package/dist/orchestrator/nextStep.js +44 -0
- package/dist/orchestrator/planning.d.ts +4 -0
- package/dist/orchestrator/planning.js +62 -0
- package/dist/orchestrator/requeue.d.ts +3 -0
- package/dist/orchestrator/requeue.js +25 -0
- package/dist/orchestrator/requeueCommand.d.ts +10 -0
- package/dist/orchestrator/requeueCommand.js +27 -0
- package/dist/orchestrator/resultIngestion.d.ts +2 -0
- package/dist/orchestrator/resultIngestion.js +13 -0
- package/dist/orchestrator/runtimeValidation.d.ts +7 -0
- package/dist/orchestrator/runtimeValidation.js +103 -0
- package/dist/orchestrator/runtimeValidationUpdate.d.ts +2 -0
- package/dist/orchestrator/runtimeValidationUpdate.js +52 -0
- package/dist/orchestrator/staleness.d.ts +2 -0
- package/dist/orchestrator/staleness.js +83 -0
- package/dist/orchestrator/state.d.ts +3 -0
- package/dist/orchestrator/state.js +85 -0
- package/dist/orchestrator/syntaxResolutionExecutor.d.ts +3 -0
- package/dist/orchestrator/syntaxResolutionExecutor.js +99 -0
- package/dist/orchestrator/taskBuilder.d.ts +12 -0
- package/dist/orchestrator/taskBuilder.js +154 -0
- package/dist/orchestrator/unitBuilder.d.ts +3 -0
- package/dist/orchestrator/unitBuilder.js +145 -0
- package/dist/orchestrator.d.ts +6 -0
- package/dist/orchestrator.js +33 -0
- package/dist/prompts/renderWorkerPrompt.d.ts +2 -0
- package/dist/prompts/renderWorkerPrompt.js +19 -0
- package/dist/providers/claudeCodeProvider.d.ts +8 -0
- package/dist/providers/claudeCodeProvider.js +20 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.js +77 -0
- package/dist/providers/localSubprocessProvider.d.ts +5 -0
- package/dist/providers/localSubprocessProvider.js +13 -0
- package/dist/providers/opencodeProvider.d.ts +8 -0
- package/dist/providers/opencodeProvider.js +15 -0
- package/dist/providers/spawnLoggedCommand.d.ts +2 -0
- package/dist/providers/spawnLoggedCommand.js +48 -0
- package/dist/providers/subprocessTemplateProvider.d.ts +8 -0
- package/dist/providers/subprocessTemplateProvider.js +41 -0
- package/dist/providers/types.d.ts +22 -0
- package/dist/providers/types.js +1 -0
- package/dist/providers/vscodeTaskProvider.d.ts +8 -0
- package/dist/providers/vscodeTaskProvider.js +14 -0
- package/dist/reporting/mergeFindings.d.ts +4 -0
- package/dist/reporting/mergeFindings.js +136 -0
- package/dist/reporting/rootCause.d.ts +11 -0
- package/dist/reporting/rootCause.js +69 -0
- package/dist/reporting/synthesis.d.ts +21 -0
- package/dist/reporting/synthesis.js +55 -0
- package/dist/supervisor/operatorHandoff.d.ts +37 -0
- package/dist/supervisor/operatorHandoff.js +144 -0
- package/dist/supervisor/runLedger.d.ts +3 -0
- package/dist/supervisor/runLedger.js +17 -0
- package/dist/supervisor/sessionConfig.d.ts +4 -0
- package/dist/supervisor/sessionConfig.js +26 -0
- package/dist/types/artifactMetadata.d.ts +8 -0
- package/dist/types/artifactMetadata.js +1 -0
- package/dist/types/auditState.d.ts +14 -0
- package/dist/types/auditState.js +1 -0
- package/dist/types/disposition.d.ts +9 -0
- package/dist/types/disposition.js +1 -0
- package/dist/types/externalAnalyzer.d.ts +16 -0
- package/dist/types/externalAnalyzer.js +1 -0
- package/dist/types/flowCoverage.d.ts +11 -0
- package/dist/types/flowCoverage.js +1 -0
- package/dist/types/flows.d.ts +11 -0
- package/dist/types/flows.js +1 -0
- package/dist/types/graph.d.ts +18 -0
- package/dist/types/graph.js +1 -0
- package/dist/types/risk.d.ts +9 -0
- package/dist/types/risk.js +1 -0
- package/dist/types/runLedger.d.ts +13 -0
- package/dist/types/runLedger.js +1 -0
- package/dist/types/runtimeValidation.d.ts +22 -0
- package/dist/types/runtimeValidation.js +1 -0
- package/dist/types/sessionConfig.d.ts +27 -0
- package/dist/types/sessionConfig.js +1 -0
- package/dist/types/surfaces.d.ts +11 -0
- package/dist/types/surfaces.js +1 -0
- package/dist/types/workerResult.d.ts +13 -0
- package/dist/types/workerResult.js +1 -0
- package/dist/types/workerSession.d.ts +13 -0
- package/dist/types/workerSession.js +1 -0
- package/dist/types.d.ts +104 -0
- package/dist/types.js +1 -0
- package/dist/validation/artifacts.d.ts +3 -0
- package/dist/validation/artifacts.js +191 -0
- package/dist/validation/basic.d.ts +5 -0
- package/dist/validation/basic.js +9 -0
- package/dist/validation/sessionConfig.d.ts +6 -0
- package/dist/validation/sessionConfig.js +139 -0
- package/docs/agent-integrations.md +237 -0
- package/docs/agent-roles.md +69 -0
- package/docs/architecture.md +90 -0
- package/docs/artifacts.md +69 -0
- package/docs/bootstrap-install.md +79 -0
- package/docs/contract.md +140 -0
- package/docs/github-copilot.md +50 -0
- package/docs/model-selection.md +86 -0
- package/docs/next-steps.md +161 -0
- package/docs/packaging.md +88 -0
- package/docs/pipeline.md +152 -0
- package/docs/product-direction.md +111 -0
- package/docs/production-launch-bar.md +83 -0
- package/docs/production-readiness.md +52 -0
- package/docs/repo-layout.md +30 -0
- package/docs/run-flow.md +49 -0
- package/docs/session-config.md +232 -0
- package/docs/supervisor.md +83 -0
- package/docs/usage.md +172 -0
- package/docs/windows-setup.md +146 -0
- package/package.json +56 -0
- package/schemas/audit-code-v1alpha1.schema.json +191 -0
- package/schemas/audit_result.schema.json +48 -0
- package/schemas/audit_state.schema.json +36 -0
- package/schemas/audit_task.schema.json +49 -0
- package/schemas/blind_spot_register.schema.json +40 -0
- package/schemas/coverage_matrix.schema.json +50 -0
- package/schemas/critical_flows.schema.json +38 -0
- package/schemas/external_analyzer_results.schema.json +31 -0
- package/schemas/file_disposition.schema.json +33 -0
- package/schemas/finding.schema.json +62 -0
- package/schemas/flow_coverage.schema.json +44 -0
- package/schemas/graph_bundle.schema.json +55 -0
- package/schemas/merged_findings.schema.json +14 -0
- package/schemas/repo_manifest.schema.json +37 -0
- package/schemas/risk_register.schema.json +30 -0
- package/schemas/root_cause_clusters.schema.json +31 -0
- package/schemas/runtime_validation_report.schema.json +34 -0
- package/schemas/runtime_validation_tasks.schema.json +36 -0
- package/schemas/surface_manifest.schema.json +32 -0
- package/schemas/synthesis_report.schema.json +61 -0
- package/schemas/unit_manifest.schema.json +36 -0
- package/skills/audit-code/SKILL.md +54 -0
- package/skills/audit-code/audit-code.prompt.md +66 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# GitHub Copilot setup
|
|
2
|
+
|
|
3
|
+
This is the first shipped native host integration for the `/audit-code` conversation surface.
|
|
4
|
+
|
|
5
|
+
It is now a narrower host-specific path. The preferred setup flow is `audit-code install`, which bootstraps all supported repo-local host surfaces in one step.
|
|
6
|
+
|
|
7
|
+
## Recommended path
|
|
8
|
+
|
|
9
|
+
From the target repository root:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
audit-code install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
That writes the canonical `/audit-code` prompt and compatibility instructions into:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
.github/prompts/audit-code.prompt.md
|
|
19
|
+
.github/copilot-instructions.md
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
After that, open GitHub Copilot Chat in the same repository and invoke `/audit-code`.
|
|
23
|
+
|
|
24
|
+
If you only want the narrower VS Code / Copilot install surface, use:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
audit-code install --host vscode
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Behavior
|
|
31
|
+
|
|
32
|
+
- the command copies the canonical prompt payload from `skills/audit-code/audit-code.prompt.md`
|
|
33
|
+
- the generated prompt file explicitly sets `agent: agent` so Copilot Chat runs `/audit-code` with tool-capable agent mode
|
|
34
|
+
- the installer upserts its managed compatibility block into `.github/copilot-instructions.md` instead of clobbering unrelated instructions
|
|
35
|
+
- it prints machine-readable JSON describing the installed targets
|
|
36
|
+
|
|
37
|
+
## Explicit root override
|
|
38
|
+
|
|
39
|
+
If you are running from outside the target repository:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
audit-code install --root /path/to/repo
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Why this exists
|
|
46
|
+
|
|
47
|
+
The goal is to reduce conversation setup friction without repositioning the backend CLI as the primary product surface.
|
|
48
|
+
|
|
49
|
+
GitHub Copilot now shares the same repo-native bootstrap path as the other currently automated hosts.
|
|
50
|
+
The older `audit-code install-host --host copilot` alias still exists for compatibility, but it is no longer the recommended setup flow.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# model selection
|
|
2
|
+
|
|
3
|
+
This repository has two distinct model-selection layers.
|
|
4
|
+
|
|
5
|
+
## 1. Skill-first product rule
|
|
6
|
+
|
|
7
|
+
The canonical product surface is `/audit-code` in conversation.
|
|
8
|
+
|
|
9
|
+
For that surface, the default model rule is:
|
|
10
|
+
|
|
11
|
+
- use the active conversation model by default
|
|
12
|
+
- avoid forcing the user to supply a model in normal usage
|
|
13
|
+
|
|
14
|
+
That is the intended product contract.
|
|
15
|
+
|
|
16
|
+
## 2. Backend provider rule
|
|
17
|
+
|
|
18
|
+
When the local backend delegates bounded worker runs into an external provider, model selection becomes provider-specific.
|
|
19
|
+
|
|
20
|
+
That means the supervisor should not invent a global model abstraction unless it can be implemented consistently across adapters.
|
|
21
|
+
|
|
22
|
+
Today the practical rule is:
|
|
23
|
+
|
|
24
|
+
- no provider-specific model override by default
|
|
25
|
+
- let each provider use its own default model unless explicitly configured otherwise
|
|
26
|
+
- when a model is required, pass it through the provider's own native CLI arguments via `extra_args`
|
|
27
|
+
|
|
28
|
+
## Current provider behavior
|
|
29
|
+
|
|
30
|
+
### `local-subprocess`
|
|
31
|
+
|
|
32
|
+
No external LLM provider is selected here.
|
|
33
|
+
|
|
34
|
+
The supervisor simply launches the bounded local worker command.
|
|
35
|
+
|
|
36
|
+
### `claude-code`
|
|
37
|
+
|
|
38
|
+
The built-in Claude Code adapter supports model overrides through `claude_code.extra_args`.
|
|
39
|
+
|
|
40
|
+
Example:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"provider": "claude-code",
|
|
45
|
+
"ui_mode": "visible",
|
|
46
|
+
"claude_code": {
|
|
47
|
+
"command": "claude",
|
|
48
|
+
"extra_args": ["--model", "sonnet"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use this only when you want to force a specific Claude Code model instead of relying on the user's normal Claude Code default.
|
|
54
|
+
|
|
55
|
+
### `opencode`
|
|
56
|
+
|
|
57
|
+
The built-in OpenCode adapter supports model overrides through `opencode.extra_args`.
|
|
58
|
+
|
|
59
|
+
Example:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"provider": "opencode",
|
|
64
|
+
"ui_mode": "visible",
|
|
65
|
+
"opencode": {
|
|
66
|
+
"command": "opencode",
|
|
67
|
+
"extra_args": ["--model", "anthropic/claude-sonnet-4.5"]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Use this only when you want to force a specific OpenCode provider/model pair instead of relying on the user's normal OpenCode default.
|
|
73
|
+
|
|
74
|
+
### `subprocess-template` and `vscode-task`
|
|
75
|
+
|
|
76
|
+
These adapters do not define model semantics themselves.
|
|
77
|
+
|
|
78
|
+
If you need model selection here, include it in the external launcher command template or in the external tool being invoked.
|
|
79
|
+
|
|
80
|
+
## Recommendation
|
|
81
|
+
|
|
82
|
+
For the cleanest product behavior:
|
|
83
|
+
|
|
84
|
+
1. in conversation, let `/audit-code` inherit the active conversation model
|
|
85
|
+
2. for repo-local backend usage, do not force model selection unless the operator has a concrete reason
|
|
86
|
+
3. when needed, set model selection in the provider-native config rather than inventing another repo-level abstraction
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Next Implementation Steps
|
|
2
|
+
|
|
3
|
+
This document tracks the next meaningful implementation work after the current skill-first productionization pass.
|
|
4
|
+
|
|
5
|
+
As of April 17, 2026, this repository is not yet ready for a public production launch.
|
|
6
|
+
|
|
7
|
+
See:
|
|
8
|
+
|
|
9
|
+
- `docs/production-readiness.md`
|
|
10
|
+
|
|
11
|
+
## Current state
|
|
12
|
+
|
|
13
|
+
The repository now supports:
|
|
14
|
+
|
|
15
|
+
- `/audit-code` as the documented canonical product route
|
|
16
|
+
- packaged and repository-local access to `skills/audit-code/audit-code.prompt.md`
|
|
17
|
+
- `audit-code prompt-path` as a stable prompt lookup helper
|
|
18
|
+
- `audit-code install` as a bootstrap installer for the currently automated repo-local host surfaces
|
|
19
|
+
- explicit failures for malformed backend config and corrupted artifact JSON
|
|
20
|
+
- `audit-code validate` as a machine-readable backend operator check
|
|
21
|
+
- an explicit in-repo release gate via `npm run verify:release`
|
|
22
|
+
- structured operator handoff output plus `.audit-artifacts/operator-handoff.{json,md}` for blocked fallback runs
|
|
23
|
+
|
|
24
|
+
That means the current release is suitable for a controlled alpha or beta skill-first workflow, but it is not yet the final public production end-state.
|
|
25
|
+
|
|
26
|
+
## Near-term priorities
|
|
27
|
+
|
|
28
|
+
### 1. Reduce conversation setup friction
|
|
29
|
+
|
|
30
|
+
The biggest remaining UX gap is that some hosts still lack a verified repo-local install surface.
|
|
31
|
+
|
|
32
|
+
Near-term work should focus on:
|
|
33
|
+
|
|
34
|
+
- host-specific setup guides that reduce copy-paste ambiguity
|
|
35
|
+
- preserving `audit-code install` as the default no-guess bootstrap path
|
|
36
|
+
- extending bootstrap coverage to hosts that still need manual prompt import
|
|
37
|
+
- a shorter path from package install to a working `/audit-code` conversation flow
|
|
38
|
+
|
|
39
|
+
Current emphasis should follow actual operator usage:
|
|
40
|
+
|
|
41
|
+
- keep VS Code and OpenCode as the primary polished happy path
|
|
42
|
+
- treat Claude Desktop and Antigravity as the highest-priority manual-import surfaces
|
|
43
|
+
- avoid spending near-term effort on lower-priority editor integrations unless they materially improve the shared prompt-import path
|
|
44
|
+
|
|
45
|
+
### 2. Make the conversation route more native
|
|
46
|
+
|
|
47
|
+
The product goal is still conversational first, not fallback-CLI first.
|
|
48
|
+
|
|
49
|
+
Near-term work should focus on:
|
|
50
|
+
|
|
51
|
+
- first-class integrations for the most important editor or agent hosts
|
|
52
|
+
- removing host-specific manual prompt wiring where practical
|
|
53
|
+
- keeping the active conversation model and attached repo context as the default operating mode
|
|
54
|
+
|
|
55
|
+
### 3. Improve continuation through assisted review
|
|
56
|
+
|
|
57
|
+
The repo-local backend fallback still intentionally stops once only manual or provider-assisted review remains.
|
|
58
|
+
|
|
59
|
+
Near-term work should focus on:
|
|
60
|
+
|
|
61
|
+
- smoother continuation when an interactive provider is configured
|
|
62
|
+
- clearer evidence handoff for imported results and runtime updates
|
|
63
|
+
- less operator guesswork when the backend reaches a blocked terminal handoff
|
|
64
|
+
|
|
65
|
+
### 4. Harden publish and release operations
|
|
66
|
+
|
|
67
|
+
The packaged install story is in place, but release operations still need finishing work.
|
|
68
|
+
|
|
69
|
+
Near-term work should focus on:
|
|
70
|
+
|
|
71
|
+
- npm package-name availability and ownership
|
|
72
|
+
- final publication automation and secret management
|
|
73
|
+
- keeping linked-install and packaged-install smoke checks as release gates
|
|
74
|
+
|
|
75
|
+
## Frictionless-ready checklist
|
|
76
|
+
|
|
77
|
+
The repository should not be described as frictionless and production-ready until this checklist is substantially true:
|
|
78
|
+
|
|
79
|
+
### VS Code, OpenCode, and Claude Code
|
|
80
|
+
|
|
81
|
+
- `audit-code install` remains the default bootstrap path
|
|
82
|
+
- the generated repo-local surfaces are obvious in installer output and in `.audit-code/install/GETTING-STARTED.md`
|
|
83
|
+
- a new user can invoke `/audit-code` without guessing where prompts or commands were written
|
|
84
|
+
- smoke coverage continues to verify the exact repo-local files these hosts consume
|
|
85
|
+
|
|
86
|
+
### Claude Desktop and Antigravity
|
|
87
|
+
|
|
88
|
+
- the installed prompt-import path is explicit, repo-local, and easy to discover
|
|
89
|
+
- `.audit-code/install/GETTING-STARTED.md` gives host-specific steps instead of generic manual-import advice
|
|
90
|
+
- docs avoid implying native repo-local slash-command support that is not actually shipped
|
|
91
|
+
- the backend fallback remains a clearly secondary path instead of the default recommendation
|
|
92
|
+
|
|
93
|
+
### Assisted review continuation
|
|
94
|
+
|
|
95
|
+
- when an interactive provider is configured, blocked audits continue with less manual result import
|
|
96
|
+
- operator handoff artifacts remain explicit and inspectable even when continuation is smoother
|
|
97
|
+
|
|
98
|
+
### Release operations
|
|
99
|
+
|
|
100
|
+
- `npm run verify:release` remains green and authoritative
|
|
101
|
+
- the real publish path is proven with npm ownership, `NPM_TOKEN`, and a real dry-run or pre-release publish
|
|
102
|
+
|
|
103
|
+
## Probable next steps
|
|
104
|
+
|
|
105
|
+
These are the most likely next implementation steps based on the current codebase state, but they should still be treated as provisional rather than guaranteed:
|
|
106
|
+
|
|
107
|
+
### 1. Ship a real bootstrap installer instead of making users pick a host first
|
|
108
|
+
|
|
109
|
+
Status:
|
|
110
|
+
|
|
111
|
+
- completed for the currently automated repo-local hosts via `audit-code install`
|
|
112
|
+
|
|
113
|
+
Practical success bar now met:
|
|
114
|
+
|
|
115
|
+
- a new user can run one install command and get repo-local `/audit-code` surfaces for VS Code / Copilot, OpenCode, and Claude Code without guessing where the prompt belongs
|
|
116
|
+
|
|
117
|
+
Follow-on shape:
|
|
118
|
+
|
|
119
|
+
- keep the shared bootstrap path well-supported instead of growing one-off host installers
|
|
120
|
+
- document the exact install and verification path for hosts that still need extra handling
|
|
121
|
+
- only claim native support for a host once its install surface is equally concrete and testable
|
|
122
|
+
|
|
123
|
+
### 2. Continue blocked reviews through a configured interactive provider
|
|
124
|
+
|
|
125
|
+
Most likely shape:
|
|
126
|
+
|
|
127
|
+
- use the existing provider configuration surface in `.audit-artifacts/session-config.json`
|
|
128
|
+
- make the blocked handoff less manual when `claude-code`, `opencode`, or another bridge is intentionally configured
|
|
129
|
+
- preserve explicit artifact imports and operator visibility instead of hiding state transitions
|
|
130
|
+
|
|
131
|
+
Practical success bar:
|
|
132
|
+
|
|
133
|
+
- a blocked audit can continue through the configured provider with fewer manual result-import and handoff steps
|
|
134
|
+
|
|
135
|
+
### 3. Prove the release path outside the repository
|
|
136
|
+
|
|
137
|
+
Most likely shape:
|
|
138
|
+
|
|
139
|
+
- confirm npm package-name ownership and `NPM_TOKEN` availability
|
|
140
|
+
- run a real pre-release or dry-run publish
|
|
141
|
+
- keep `npm run verify:release` as the minimum in-repo gate before publish
|
|
142
|
+
|
|
143
|
+
Practical success bar:
|
|
144
|
+
|
|
145
|
+
- the release workflow is demonstrated end to end instead of only being inferred from configuration
|
|
146
|
+
|
|
147
|
+
### 4. Expand host-specific setup guidance after the first integration lands
|
|
148
|
+
|
|
149
|
+
Most likely shape:
|
|
150
|
+
|
|
151
|
+
- keep the generated repo-local guide aligned with the real bootstrap surfaces for VS Code, OpenCode, and Claude Code
|
|
152
|
+
- keep Claude Desktop and Antigravity guidance explicit about prompt import and terminal fallback rather than pretending native repo-local slash-command support
|
|
153
|
+
- avoid broad host promises that the codebase does not yet verify
|
|
154
|
+
|
|
155
|
+
## Non-goals for the next phase
|
|
156
|
+
|
|
157
|
+
These should not become the primary focus of the next implementation pass:
|
|
158
|
+
|
|
159
|
+
- repositioning the CLI as a peer product surface
|
|
160
|
+
- expanding low-level backend helpers into a CLI-first user experience
|
|
161
|
+
- making backend implementation details outrank the conversation contract in docs or product decisions
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# packaged audit-code validation
|
|
2
|
+
|
|
3
|
+
This repository validates the packaged installation story for both:
|
|
4
|
+
|
|
5
|
+
1. the canonical conversation prompt asset
|
|
6
|
+
2. the backend fallback `audit-code` entrypoint
|
|
7
|
+
|
|
8
|
+
It does so in two installation modes:
|
|
9
|
+
|
|
10
|
+
1. linked local command via `npm link`
|
|
11
|
+
2. clean-room packaged install via `npm pack` followed by `npm install <tarball>`
|
|
12
|
+
|
|
13
|
+
## Why this exists
|
|
14
|
+
|
|
15
|
+
The primary product surface is `/audit-code` in conversation.
|
|
16
|
+
|
|
17
|
+
That means the package needs to ship:
|
|
18
|
+
|
|
19
|
+
- the canonical prompt asset at `skills/audit-code/audit-code.prompt.md`
|
|
20
|
+
- the backend fallback wrapper exposed as `audit-code`
|
|
21
|
+
|
|
22
|
+
A linked-command smoke test proves the installed wrapper and prompt lookup work from the working tree.
|
|
23
|
+
A packaged-install smoke test proves the same assets still work when consumed from the packed artifact that a downstream installer would receive.
|
|
24
|
+
|
|
25
|
+
## Packaged smoke command
|
|
26
|
+
|
|
27
|
+
From the repository root:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install
|
|
31
|
+
npm run verify:release
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That script:
|
|
35
|
+
|
|
36
|
+
- creates a tarball with `npm pack`
|
|
37
|
+
- asserts the packed tarball still includes the required shipped assets and runtime entrypoints
|
|
38
|
+
- installs it into a fresh temporary directory
|
|
39
|
+
- verifies the packaged prompt asset is present and discoverable
|
|
40
|
+
- verifies `audit-code install` can write the bootstrap host surfaces from the packaged install
|
|
41
|
+
- invokes the installed `audit-code` binary from `node_modules/.bin`
|
|
42
|
+
- validates emitted JSON against `schemas/audit-code-v1alpha1.schema.json`
|
|
43
|
+
- exercises the same evidence-import and completion flow used by the linked-command smoke test
|
|
44
|
+
|
|
45
|
+
## CI
|
|
46
|
+
|
|
47
|
+
The packaged-install path is covered by:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
.github/workflows/packaged-entrypoint.yml
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The release publish gate also runs both installed-entrypoint smoke paths before `npm publish`:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
.github/workflows/publish-package.yml
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Publish pipeline state
|
|
60
|
+
|
|
61
|
+
The repository now includes packaging metadata and lifecycle hooks intended for registry publication:
|
|
62
|
+
|
|
63
|
+
- `package.json` is no longer marked private
|
|
64
|
+
- package contents are curated with a `files` allowlist that includes the canonical prompt asset
|
|
65
|
+
- `prepack` and `prepare` build the runtime artifact
|
|
66
|
+
- `verify:release` codifies the minimum in-repo release gate
|
|
67
|
+
- `prepublishOnly` now runs that full release gate, including both linked-install and packaged-install smoke validation
|
|
68
|
+
- packaged smoke now verifies the tarball includes `audit-code-wrapper-lib.mjs`, the prompt asset, the response schema, and `dist/` entrypoints before install-time smoke runs
|
|
69
|
+
- the GitHub publish workflow uses the same release gate before `npm publish`
|
|
70
|
+
|
|
71
|
+
## Remaining external dependency
|
|
72
|
+
|
|
73
|
+
Actual publication still depends on confirmed npm package-name availability and ownership, plus a configured `NPM_TOKEN` secret for automated publishing.
|
|
74
|
+
|
|
75
|
+
## Next packaging steps
|
|
76
|
+
|
|
77
|
+
The next implementation phase should focus on:
|
|
78
|
+
|
|
79
|
+
- completing npm publication prerequisites
|
|
80
|
+
- preserving the packaged prompt asset and `audit-code prompt-path` as stable release guarantees
|
|
81
|
+
- preserving `audit-code install` as a packaged-install compatibility guarantee
|
|
82
|
+
- keeping linked-install and packaged-install smoke coverage in the publish gate
|
|
83
|
+
- keeping `docs/production-launch-bar.md` aligned with the real release gate
|
|
84
|
+
|
|
85
|
+
Related roadmap notes:
|
|
86
|
+
|
|
87
|
+
- `docs/production-readiness.md`
|
|
88
|
+
- `docs/next-steps.md`
|
package/docs/pipeline.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Audit pipeline
|
|
2
|
+
|
|
3
|
+
## Phase 0: intake
|
|
4
|
+
|
|
5
|
+
Automated:
|
|
6
|
+
|
|
7
|
+
- enumerate files
|
|
8
|
+
- detect languages and frameworks
|
|
9
|
+
- identify exclusions
|
|
10
|
+
- hash files
|
|
11
|
+
- collect git metadata
|
|
12
|
+
|
|
13
|
+
Outputs:
|
|
14
|
+
|
|
15
|
+
- `repo_manifest.json`
|
|
16
|
+
- `file_inventory.json`
|
|
17
|
+
- `stack_profile.json`
|
|
18
|
+
|
|
19
|
+
## Phase 1: structural extraction
|
|
20
|
+
|
|
21
|
+
Automated:
|
|
22
|
+
|
|
23
|
+
- detect services, packages, apps
|
|
24
|
+
- detect routes, jobs, commands, workflows
|
|
25
|
+
- bucket files
|
|
26
|
+
- extract graphs
|
|
27
|
+
- detect data-layer artifacts
|
|
28
|
+
|
|
29
|
+
Outputs:
|
|
30
|
+
|
|
31
|
+
- `unit_manifest.json`
|
|
32
|
+
- `surface_manifest.json`
|
|
33
|
+
- `bucket_assignments.json`
|
|
34
|
+
- `graph_bundle.json`
|
|
35
|
+
|
|
36
|
+
LLM role:
|
|
37
|
+
|
|
38
|
+
- resolve ambiguous units and suspicious classifications
|
|
39
|
+
|
|
40
|
+
## Phase 2: mechanical analysis
|
|
41
|
+
|
|
42
|
+
Automated:
|
|
43
|
+
|
|
44
|
+
- lint
|
|
45
|
+
- typecheck
|
|
46
|
+
- tests
|
|
47
|
+
- coverage
|
|
48
|
+
- secrets
|
|
49
|
+
- dependencies
|
|
50
|
+
- static security
|
|
51
|
+
- complexity and duplication
|
|
52
|
+
|
|
53
|
+
Outputs:
|
|
54
|
+
|
|
55
|
+
- `mechanical_results.json`
|
|
56
|
+
- `hotspot_report.json`
|
|
57
|
+
|
|
58
|
+
LLM role:
|
|
59
|
+
|
|
60
|
+
- distinguish signal from noise
|
|
61
|
+
- identify what deserves deeper review
|
|
62
|
+
|
|
63
|
+
## Phase 3: risk scoring
|
|
64
|
+
|
|
65
|
+
Automated inputs:
|
|
66
|
+
|
|
67
|
+
- exposure
|
|
68
|
+
- privilege indicators
|
|
69
|
+
- persistent writes
|
|
70
|
+
- secrets access
|
|
71
|
+
- concurrency signals
|
|
72
|
+
- churn
|
|
73
|
+
- coverage weakness
|
|
74
|
+
|
|
75
|
+
Outputs:
|
|
76
|
+
|
|
77
|
+
- `risk_register.json`
|
|
78
|
+
|
|
79
|
+
LLM role:
|
|
80
|
+
|
|
81
|
+
- adjust for semantic criticality
|
|
82
|
+
|
|
83
|
+
## Phase 4: blind-spot mapping
|
|
84
|
+
|
|
85
|
+
LLM task:
|
|
86
|
+
|
|
87
|
+
- use manifests, graphs, and bounded source excerpts to identify what tools are likely missing
|
|
88
|
+
|
|
89
|
+
Outputs:
|
|
90
|
+
|
|
91
|
+
- `blind_spot_register.json`
|
|
92
|
+
- `runtime_validation_targets.json`
|
|
93
|
+
|
|
94
|
+
## Phase 5: unit audits
|
|
95
|
+
|
|
96
|
+
LLM task:
|
|
97
|
+
|
|
98
|
+
- audit each unit under required lenses
|
|
99
|
+
|
|
100
|
+
Outputs:
|
|
101
|
+
|
|
102
|
+
- `audit_results/<unit>/<lens>.json`
|
|
103
|
+
|
|
104
|
+
## Phase 6: cross-cutting audits
|
|
105
|
+
|
|
106
|
+
LLM task:
|
|
107
|
+
|
|
108
|
+
- audit repo-wide concerns such as auth, retries, migrations, config validation, observability, and secrets flow
|
|
109
|
+
|
|
110
|
+
Outputs:
|
|
111
|
+
|
|
112
|
+
- `cross_cutting/<theme>.json`
|
|
113
|
+
|
|
114
|
+
## Phase 7: dynamic validation
|
|
115
|
+
|
|
116
|
+
Automated + LLM:
|
|
117
|
+
|
|
118
|
+
- run targeted checks for suspicious cases
|
|
119
|
+
- interpret repro results
|
|
120
|
+
|
|
121
|
+
Outputs:
|
|
122
|
+
|
|
123
|
+
- `runtime_validation_report.json`
|
|
124
|
+
|
|
125
|
+
## Phase 8: coverage verification
|
|
126
|
+
|
|
127
|
+
Automated:
|
|
128
|
+
|
|
129
|
+
- verify every file is classified
|
|
130
|
+
- verify every file is audited or explicitly excluded
|
|
131
|
+
- verify reviewed line ranges cover the intended source
|
|
132
|
+
- verify multi-pass overlap for critical units
|
|
133
|
+
|
|
134
|
+
Outputs:
|
|
135
|
+
|
|
136
|
+
- `coverage_matrix.json`
|
|
137
|
+
- `line_coverage_map.json`
|
|
138
|
+
- `uncovered_items.json`
|
|
139
|
+
|
|
140
|
+
## Phase 9: synthesis
|
|
141
|
+
|
|
142
|
+
LLM task:
|
|
143
|
+
|
|
144
|
+
- deduplicate findings
|
|
145
|
+
- cluster by root cause
|
|
146
|
+
- prioritize remediation
|
|
147
|
+
|
|
148
|
+
Outputs:
|
|
149
|
+
|
|
150
|
+
- `findings.json`
|
|
151
|
+
- `root_cause_clusters.json`
|
|
152
|
+
- `remediation_plan.md`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Product direction
|
|
2
|
+
|
|
3
|
+
## Source of truth
|
|
4
|
+
|
|
5
|
+
The primary product is an in-conversation ChatGPT skill:
|
|
6
|
+
|
|
7
|
+
`/audit-code`
|
|
8
|
+
|
|
9
|
+
The intended user experience is:
|
|
10
|
+
|
|
11
|
+
- invoke `/audit-code` in a ChatGPT project conversation
|
|
12
|
+
- use the current conversation model as the primary model
|
|
13
|
+
- use project files and attached repository context as the primary operating context
|
|
14
|
+
- require no manual filesystem paths, provider flags, or model-selection arguments from the user
|
|
15
|
+
- advance the audit automatically until it completes or no further automatic progress is possible, using bounded internal steps only as an implementation detail
|
|
16
|
+
|
|
17
|
+
## Canonical install asset
|
|
18
|
+
|
|
19
|
+
The canonical integration asset is:
|
|
20
|
+
|
|
21
|
+
`skills/audit-code/audit-code.prompt.md`
|
|
22
|
+
|
|
23
|
+
That asset should be available from both:
|
|
24
|
+
|
|
25
|
+
- repository checkouts
|
|
26
|
+
- packaged installs
|
|
27
|
+
|
|
28
|
+
The stable packaged lookup helper is:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
audit-code prompt-path
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That command exists to locate the conversation prompt asset, not to reposition the CLI as the primary user surface.
|
|
35
|
+
|
|
36
|
+
The preferred bootstrap installer is:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
audit-code install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
That command writes the repo-local `/audit-code` surfaces we can automate today instead of making the user choose one host up front.
|
|
43
|
+
|
|
44
|
+
## What the CLI is
|
|
45
|
+
|
|
46
|
+
The CLI in this repository is backend infrastructure, a local development harness, and a repo-local fallback operator surface.
|
|
47
|
+
|
|
48
|
+
It is not the preferred end-user mental model.
|
|
49
|
+
|
|
50
|
+
## Repo-local fallback
|
|
51
|
+
|
|
52
|
+
Repo-local backend wrapper:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
audit-code
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
from the target repository root.
|
|
59
|
+
|
|
60
|
+
Fallback explicit form:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
audit-code --root /path/to/repo
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Debug one-step mode:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
audit-code --single-step
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Backend mode rule
|
|
73
|
+
|
|
74
|
+
For repo-local backend usage:
|
|
75
|
+
|
|
76
|
+
- omitted provider should remain the stable safe default: `local-subprocess`
|
|
77
|
+
- `local-subprocess` should stop cleanly once only manual or provider-assisted review remains
|
|
78
|
+
- `provider: "auto"` is the explicit opt-in mode for best-effort routing across configured or detected backends
|
|
79
|
+
- explicit provider names should remain available for operators who want a specific backend
|
|
80
|
+
|
|
81
|
+
## Default context & model rules
|
|
82
|
+
|
|
83
|
+
1. By default, the current ChatGPT project conversation and its files should be treated as the primary context.
|
|
84
|
+
2. The user should not need to supply `--root`, provider names, or backend-specific settings in normal usage.
|
|
85
|
+
3. For backend CLI delegation, let the chosen provider own its own model-selection behavior unless explicitly configured.
|
|
86
|
+
|
|
87
|
+
## Development rule
|
|
88
|
+
|
|
89
|
+
Future development should optimize for the native skill UX first:
|
|
90
|
+
|
|
91
|
+
- `/audit-code` in conversation is the canonical product entrypoint
|
|
92
|
+
- packaged installs should help users reach the prompt asset for that conversation route
|
|
93
|
+
- the CLI and supervisor are implementation details and fallback harnesses
|
|
94
|
+
- provider adapters are backend internals, not the primary product concept
|
|
95
|
+
- docs, tests, and examples should present the skill-first flow before any CLI flow
|
|
96
|
+
|
|
97
|
+
If documentation or implementation details conflict, prefer the skill-first contract above over the CLI-first backend shape.
|
|
98
|
+
|
|
99
|
+
## Near-term implementation priorities
|
|
100
|
+
|
|
101
|
+
The next implementation phase should focus on:
|
|
102
|
+
|
|
103
|
+
- reducing prompt-import friction for the conversation setup path
|
|
104
|
+
- keeping the bootstrap path stable across supported hosts
|
|
105
|
+
- extending automation to hosts that still lack a verified repo-local slash-command surface
|
|
106
|
+
- improving continuation when review needs an interactive or assisted provider
|
|
107
|
+
- finishing publish and release hardening for packaged installs
|
|
108
|
+
|
|
109
|
+
For a fuller roadmap summary, see:
|
|
110
|
+
|
|
111
|
+
- `docs/next-steps.md`
|