audit-tools 0.30.7 → 0.30.9
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 +229 -0
- package/audit-code.mjs +1 -1
- package/dist/audit/cli/dispatch/packetPrompt.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/packetPrompt.js +1 -0
- package/dist/audit/cli/dispatch/packetPrompt.js.map +1 -1
- package/dist/audit/cli/dispatch.d.ts.map +1 -1
- package/dist/audit/cli/dispatch.js +4 -1
- package/dist/audit/cli/dispatch.js.map +1 -1
- package/dist/audit/cli/mergeAndIngestCommand.d.ts.map +1 -1
- package/dist/audit/cli/mergeAndIngestCommand.js +76 -35
- package/dist/audit/cli/mergeAndIngestCommand.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +8 -3
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +2 -0
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +49 -16
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/prompts.d.ts +2 -1
- package/dist/audit/cli/prompts.d.ts.map +1 -1
- package/dist/audit/cli/prompts.js +12 -3
- package/dist/audit/cli/prompts.js.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.d.ts.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.js +18 -1
- package/dist/audit/cli/rollingAuditDispatch.js.map +1 -1
- package/dist/audit/io/toolingManifest.d.ts +1 -1
- package/dist/audit/io/toolingManifest.d.ts.map +1 -1
- package/dist/audit/io/toolingManifest.js +1 -1
- package/dist/audit/io/toolingManifest.js.map +1 -1
- package/dist/audit/orchestrator/auditTaskUtils.js +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +6 -9
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts +5 -9
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +5 -9
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.js +2 -2
- package/dist/audit/orchestrator/taskAffinityGraph.js +1 -1
- package/dist/audit/types.d.ts +3 -3
- package/dist/audit/types.js +1 -1
- package/dist/remediate/contractPipeline/derive.d.ts +1 -1
- package/dist/remediate/contractPipeline/derive.js +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +32 -48
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/providerNodeDispatch.d.ts.map +1 -1
- package/dist/remediate/steps/providerNodeDispatch.js +16 -1
- package/dist/remediate/steps/providerNodeDispatch.js.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.js +1 -1
- package/dist/shared/engine/obligationEngine.d.ts +1 -1
- package/dist/shared/engine/obligationEngine.js +1 -1
- package/dist/shared/friction/triage.d.ts +50 -20
- package/dist/shared/friction/triage.d.ts.map +1 -1
- package/dist/shared/friction/triage.js +70 -23
- package/dist/shared/friction/triage.js.map +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/quota/scheduler.d.ts +1 -1
- package/dist/shared/types/rollingDispatch.d.ts +1 -1
- package/package.json +2 -2
- package/{audit-code-wrapper-build.mjs → wrapper/audit-code-wrapper-build.mjs} +1 -1
- package/{audit-code-wrapper-install-hosts.mjs → wrapper/audit-code-wrapper-install-hosts.mjs} +1 -1
- package/{audit-code-wrapper-lib.mjs → wrapper/audit-code-wrapper-lib.mjs} +1 -1
- package/README.audit.md +0 -222
- package/README.remediate.md +0 -112
- /package/{audit-code-wrapper-install-renderers.mjs → wrapper/audit-code-wrapper-install-renderers.mjs} +0 -0
- /package/{audit-code-wrapper-io.mjs → wrapper/audit-code-wrapper-io.mjs} +0 -0
- /package/{audit-code-wrapper-legacy.mjs → wrapper/audit-code-wrapper-legacy.mjs} +0 -0
- /package/{audit-code-wrapper-opencode.mjs → wrapper/audit-code-wrapper-opencode.mjs} +0 -0
package/README.audit.md
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
# audit-code
|
|
2
|
-
|
|
3
|
-
Skill-first audit orchestration backend for the `/audit-code` product surface.
|
|
4
|
-
|
|
5
|
-
## Canonical Product Route
|
|
6
|
-
|
|
7
|
-
The primary product is `/audit-code` in conversation.
|
|
8
|
-
|
|
9
|
-
Normal product usage should:
|
|
10
|
-
|
|
11
|
-
- use the active conversation model by default
|
|
12
|
-
- use project files and attached repository context by default
|
|
13
|
-
- avoid manual paths, provider flags, and model-selection arguments
|
|
14
|
-
- keep semantic review with the active conversation agent by default
|
|
15
|
-
- advance the audit automatically until it completes or no further automatic progress is possible
|
|
16
|
-
|
|
17
|
-
## Conversation Setup
|
|
18
|
-
|
|
19
|
-
The canonical asset for editor and conversation integrations is:
|
|
20
|
-
|
|
21
|
-
`skills/audit-code/audit-code.prompt.md`
|
|
22
|
-
|
|
23
|
-
Packaged installs and repository checkouts both ship that prompt asset.
|
|
24
|
-
|
|
25
|
-
The intended user install is one global tool install:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install -g audit-tools
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
That makes `audit-code` available on `PATH`. During package install, the package
|
|
32
|
-
also writes user-level command/skill assets for hosts we can seed safely, including
|
|
33
|
-
the Claude command file, the global Codex skill bundle with `audit-code` display
|
|
34
|
-
metadata, and the global OpenCode slash command entry in
|
|
35
|
-
`~/.config/opencode/opencode.json`.
|
|
36
|
-
|
|
37
|
-
After that, invoke `/audit-code` in a supported host. The prompt self-bootstraps
|
|
38
|
-
the current repository by running:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
audit-code ensure --quiet
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
That command writes or refreshes the repo-local assets only when they are missing
|
|
45
|
-
or stale, then normal audit execution continues without manual paths, provider
|
|
46
|
-
flags, or model-selection arguments.
|
|
47
|
-
|
|
48
|
-
The explicit repair and compatibility setup path remains:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
audit-code install
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
That bootstraps repo-local supporting surfaces for the hosts we can automate today, including:
|
|
55
|
-
|
|
56
|
-
- Codex `AGENTS.md` fallback guidance for the global skill surface
|
|
57
|
-
- Claude Desktop local MCP bundle artifacts and project template guidance
|
|
58
|
-
- OpenCode `opencode.json` with auditor agent and permission wiring; the `/audit-code` command stays in the global npm-installed OpenCode config
|
|
59
|
-
- VS Code prompt, custom agent, Copilot instructions, and `.vscode/mcp.json`
|
|
60
|
-
- Antigravity planning-mode guidance plus the shared repo-local MCP launcher
|
|
61
|
-
|
|
62
|
-
`audit-code ensure` refreshes those files automatically when the packaged prompt
|
|
63
|
-
or skill changes. Use `audit-code install` or `audit-code ensure --force` when
|
|
64
|
-
you intentionally want to rewrite every generated host surface on demand.
|
|
65
|
-
|
|
66
|
-
After bootstrap, you can smoke-test the generated host assets and launcher from the repository root:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
audit-code verify-install
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
After that, open a supported conversation surface in the repository and invoke `/audit-code`.
|
|
73
|
-
|
|
74
|
-
If a host still needs manual prompt import after bootstrap, open:
|
|
75
|
-
|
|
76
|
-
```text
|
|
77
|
-
.audit-code/install/GETTING-STARTED.md
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
That repo-local guide now includes dedicated quick-start sections for Codex, Claude Desktop, OpenCode, VS Code, and Antigravity, plus the installed canonical prompt asset path for prompt-import fallback flows.
|
|
81
|
-
|
|
82
|
-
For narrower compatibility, `audit-code install-host --host copilot` still exists.
|
|
83
|
-
|
|
84
|
-
For hosts that still need manual import after bootstrap, or for environments with no repo-local install surface, after installing the package or checking out the repository, use:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
audit-code prompt-path
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Import the reported file into your editor or conversation environment's custom prompt configuration, then invoke `/audit-code` in conversation.
|
|
91
|
-
|
|
92
|
-
Typical examples include custom instructions, `.cursorrules`, prompt libraries, or comparable editor-specific prompt surfaces.
|
|
93
|
-
|
|
94
|
-
## Repo-Local Backend Fallback
|
|
95
|
-
|
|
96
|
-
The CLI in this repository is backend infrastructure and a repo-local fallback surface.
|
|
97
|
-
|
|
98
|
-
The conversation step engine used by `/audit-code` — the single execution loop —
|
|
99
|
-
runs from the target repository root:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
audit-code next-step
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Repository-local equivalent:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
node /path/to/audit-tools/audit-code.mjs next-step
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
This advances deterministic audit state one bounded step, writes
|
|
112
|
-
`.audit-tools/audit/steps/current-step.json` and
|
|
113
|
-
`.audit-tools/audit/steps/current-prompt.md`, auto-builds `dist/` if it is
|
|
114
|
-
missing, and creates the artifacts directory automatically. Hosts follow only
|
|
115
|
-
the returned step prompt, then call `next-step` again. A bare `audit-code`
|
|
116
|
-
invocation prints usage; there is no implicit batch loop.
|
|
117
|
-
|
|
118
|
-
Explicit root override still exists for callers running from outside the target repository:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
audit-code next-step --root /path/to/repo
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
For one bounded debug advance that prints the execution envelope
|
|
125
|
-
(`contract_version: "audit-code/v1alpha1"`) instead of a step contract:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
audit-code advance-audit
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
For an operator-side artifact consistency check:
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
audit-code validate
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
That check now covers the artifact bundle plus `session-config.json` and explicit provider readiness.
|
|
138
|
-
|
|
139
|
-
For native batch ingestion of multiple result files during a debug advance:
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
audit-code advance-audit --batch-results /path/to/audit-results-dir
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
For task-to-coverage inspection without reverse-engineering multiple artifacts:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
audit-code explain-task <task_id>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
To remove a leftover `.audit-tools/audit/` directory from an interrupted or
|
|
152
|
-
crashed audit:
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
audit-code cleanup
|
|
156
|
-
audit-code cleanup --dry-run # preview without deleting
|
|
157
|
-
audit-code cleanup --force # delete even if state is unknown
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Refuses to delete if the audit state is `active` or `blocked` (resumable).
|
|
161
|
-
Pass `--force` when `audit_state.json` is missing (crashed run).
|
|
162
|
-
|
|
163
|
-
The backend wrapper response schema is `schemas/audit-code-v1alpha1.schema.json`.
|
|
164
|
-
|
|
165
|
-
## Backend Provider Modes
|
|
166
|
-
|
|
167
|
-
If `provider` is omitted, the backend defaults to the safest mode:
|
|
168
|
-
|
|
169
|
-
```json
|
|
170
|
-
{
|
|
171
|
-
"provider": "local-subprocess"
|
|
172
|
-
}
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
If you want best-effort cross-editor or provider routing, opt into:
|
|
176
|
-
|
|
177
|
-
```json
|
|
178
|
-
{
|
|
179
|
-
"provider": "auto",
|
|
180
|
-
"ui_mode": "visible"
|
|
181
|
-
}
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Optional backend config:
|
|
185
|
-
|
|
186
|
-
`.audit-tools/audit/session-config.json`
|
|
187
|
-
|
|
188
|
-
## Practical Guidance
|
|
189
|
-
|
|
190
|
-
- use `/audit-code` in conversation as the canonical product surface
|
|
191
|
-
- install once with `npm install -g audit-tools`, then let `/audit-code` run `audit-code ensure --quiet` in each repository
|
|
192
|
-
- use `audit-code install` when you want to repair or force-refresh repo-local host assets
|
|
193
|
-
- use `audit-code prompt-path` to locate the packaged prompt asset
|
|
194
|
-
- use `audit-code` from the repository root only when you need the repo-local backend fallback
|
|
195
|
-
- use omitted provider or `local-subprocess` for the safest deterministic fallback behavior
|
|
196
|
-
- use `provider: "auto"` only when you want best-effort routing across installed backends
|
|
197
|
-
- treat explicit provider bridges as compatibility fallback, not as the intended owner of semantic review
|
|
198
|
-
|
|
199
|
-
## Build And Test
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
npm install
|
|
203
|
-
npm run test:single -- tests/audit/next-step.test.mjs
|
|
204
|
-
npm run verify:release
|
|
205
|
-
npm run release:patch
|
|
206
|
-
npm run release:patch:publish
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
When developing from a fresh clone or git worktree, run repo-root `npm install`
|
|
210
|
-
before package checks. Missing `node_modules` can cause misleading type errors.
|
|
211
|
-
|
|
212
|
-
For GitHub Actions publication and npm Trusted Publishing setup, see `docs/audit-pkg/release.md`.
|
|
213
|
-
|
|
214
|
-
## Key Docs
|
|
215
|
-
|
|
216
|
-
- `docs/audit-pkg/product.md`
|
|
217
|
-
- `docs/audit-pkg/operator-guide.md`
|
|
218
|
-
- `docs/audit-pkg/contracts.md`
|
|
219
|
-
- `docs/audit-pkg/release.md`
|
|
220
|
-
- `docs/audit-pkg/development.md`
|
|
221
|
-
- `docs/history.md`
|
|
222
|
-
- `skills/audit-code/SKILL.md`
|
package/README.remediate.md
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# remediate-code
|
|
2
|
-
|
|
3
|
-
Conversation-first remediation orchestrator for arbitrary repositories. It
|
|
4
|
-
accepts the auditor's `audit-findings.json` (the deterministic machine contract)
|
|
5
|
-
from [audit-code](https://github.com/OhOkThisIsFine/audit-tools), an
|
|
6
|
-
`audit-report.md` or other feedback document (LLM-extracted), or conversational
|
|
7
|
-
feedback — then advances through one backend-rendered step prompt at a time.
|
|
8
|
-
|
|
9
|
-
## Primary Usage
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g audit-tools
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Then start from a conversation:
|
|
16
|
-
|
|
17
|
-
```text
|
|
18
|
-
/remediate-code path/to/audit-findings.json
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
You can also start with free-form feedback:
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
/remediate-code clean up the auth flow and make the session refresh behavior easier to test
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The global loader runs `remediate-code ensure --quiet`, then
|
|
28
|
-
`remediate-code next-step`, reads only the returned `prompt_path`, and follows
|
|
29
|
-
that one prompt. Each prompt carries its own allowed commands and stop
|
|
30
|
-
condition.
|
|
31
|
-
|
|
32
|
-
If the starting point is not already a structured auditor report, the backend
|
|
33
|
-
first creates an intake brief from the supplied document(s) or conversational
|
|
34
|
-
feedback. It asks for clarification when the goals, non-goals, affected areas,
|
|
35
|
-
or success criteria are ambiguous. The normal remediation workflow starts only
|
|
36
|
-
after that brief is clear enough to convert into bounded findings.
|
|
37
|
-
|
|
38
|
-
## Runtime Artifacts
|
|
39
|
-
|
|
40
|
-
Active runs use `.audit-tools/remediation/` in the target repository. The current
|
|
41
|
-
state is `.audit-tools/remediation/state.json`, and the current step contract is
|
|
42
|
-
written to:
|
|
43
|
-
|
|
44
|
-
- `.audit-tools/remediation/steps/current-step.json`
|
|
45
|
-
- `.audit-tools/remediation/steps/current-prompt.md`
|
|
46
|
-
|
|
47
|
-
After close, the durable outputs are written to `.audit-tools/`:
|
|
48
|
-
|
|
49
|
-
- `remediation-report.md`
|
|
50
|
-
- `remediation-outcomes.json`
|
|
51
|
-
- `remediation-closing-result.json`
|
|
52
|
-
|
|
53
|
-
## Development From Source
|
|
54
|
-
|
|
55
|
-
The global `npm install -g audit-tools` path is for users. For repository
|
|
56
|
-
development in a fresh clone or git worktree, run `npm install` at the repo root
|
|
57
|
-
before build, check, or test workflows.
|
|
58
|
-
|
|
59
|
-
## CLI
|
|
60
|
-
|
|
61
|
-
| Command | Description |
|
|
62
|
-
| --- | --- |
|
|
63
|
-
| `remediate-code next-step [--input <path>] [--host-can-dispatch-subagents]` | Decide and render exactly one next action |
|
|
64
|
-
| `remediate-code prepare-implement-dispatch --run-id <id>` | Write bounded implementation prompts |
|
|
65
|
-
| `remediate-code merge-implement-results --run-id <id>` | Validate implementation results and update item state |
|
|
66
|
-
| `remediate-code validate-artifacts` | Validate runtime artifacts |
|
|
67
|
-
| `remediate-code install` | Deprecated alias that repairs global assets and writes no repo-local host files |
|
|
68
|
-
| `remediate-code ensure [--quiet]` | Repair/check global Claude, Codex, and OpenCode assets |
|
|
69
|
-
|
|
70
|
-
`next-step` is the single canonical execution path. Hosts and IDEs should call
|
|
71
|
-
it repeatedly, read the returned `prompt_path`, follow that one prompt, and then
|
|
72
|
-
call `next-step` again only when the prompt says to continue.
|
|
73
|
-
|
|
74
|
-
## Auditor Compatibility
|
|
75
|
-
|
|
76
|
-
The auditor's canonical `audit-findings.json` is parsed **deterministically** —
|
|
77
|
-
findings, work-block assignments, and synthesis themes are adopted verbatim, with
|
|
78
|
-
no LLM involved. A Markdown `audit-report.md` (or any other free-form or partial
|
|
79
|
-
document) is instead routed through intake synthesis and bounded LLM finding
|
|
80
|
-
extraction, so it cannot silently produce a zero-finding plan. The deterministic
|
|
81
|
-
contract is locked by `tests/fixtures/auditor-contract-audit-findings.json`,
|
|
82
|
-
regenerated with `npm run fixtures:auditor-contract` from audit-code's
|
|
83
|
-
findings renderer.
|
|
84
|
-
|
|
85
|
-
## Intake
|
|
86
|
-
|
|
87
|
-
The remediator can start from any of these inputs:
|
|
88
|
-
|
|
89
|
-
- a structured auditor report
|
|
90
|
-
- one or more feedback or planning documents
|
|
91
|
-
- conversational feedback typed directly after `/remediate-code`
|
|
92
|
-
- a mix of documents and conversation
|
|
93
|
-
|
|
94
|
-
Runtime intake artifacts live under `.audit-tools/remediation/intake/`:
|
|
95
|
-
|
|
96
|
-
- `source-manifest.json`
|
|
97
|
-
- `conversation-start.md`
|
|
98
|
-
- `intake-summary.json`
|
|
99
|
-
- `intake-clarifications.json`
|
|
100
|
-
- `remediation-brief.md`
|
|
101
|
-
|
|
102
|
-
Structured auditor reports skip intake and go directly to planning. All other
|
|
103
|
-
starting points go through synthesis first, and ambiguous requests pause for a
|
|
104
|
-
single batched clarification before findings are extracted.
|
|
105
|
-
|
|
106
|
-
## Closing
|
|
107
|
-
|
|
108
|
-
The default closing action is `none`. Actions such as `commit`, `push`,
|
|
109
|
-
`open-pr`, `publish`, `tag`, and `custom` record command exit codes and captured
|
|
110
|
-
output in `remediation-closing-result.json`; reports only claim success after
|
|
111
|
-
the command succeeds. Closing is advanced by a generated `next-step` finalization
|
|
112
|
-
command, not the broad compatibility `run` loop.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|