feat(cli): add torb audit #319

Merged
argus merged 2 commits from loop/23-torb-audit into main 2026-10-12 11:04:35 +00:00
Collaborator

Closes #23

torb audit reads project.lock.trb, fetches and verifies the index of every registry package it pins (as torb add does, through mirrors and cache), and reports a pinned version the registry yanked and a package it flagged as deprecated. It writes nothing. path: packages are skipped.

Exit codes: 0 no findings, 1 findings, 2 the audit could not run (no lock, unreadable lock, missing or unverifiable index).

The advisory database is #309 and not part of this PR.

Changes

  • compiler/src/package/audit.trb: AuditFinding, AuditReport, auditLockOf, auditReport.
  • compiler/src/cli/packages.trb, usage.trb, main.trb: the audit command (minimal registration edit).
  • compiler/tests/audit.test.trb: findings over file: registries in a temporary directory.
  • tools/command-line.sh, tests/command-line/arguments.expected: --help of audit.
  • docs/tooling/torb-audit.md and the pages and skills that list it.

Test

CI result: pending (to be updated in a comment).

Closes #23 `torb audit` reads `project.lock.trb`, fetches and verifies the index of every registry package it pins (as `torb add` does, through mirrors and cache), and reports a pinned version the registry yanked and a package it flagged as deprecated. It writes nothing. `path:` packages are skipped. Exit codes: `0` no findings, `1` findings, `2` the audit could not run (no lock, unreadable lock, missing or unverifiable index). The advisory database is #309 and not part of this PR. ## Changes - `compiler/src/package/audit.trb`: `AuditFinding`, `AuditReport`, `auditLockOf`, `auditReport`. - `compiler/src/cli/packages.trb`, `usage.trb`, `main.trb`: the `audit` command (minimal registration edit). - `compiler/tests/audit.test.trb`: findings over `file:` registries in a temporary directory. - `tools/command-line.sh`, `tests/command-line/arguments.expected`: `--help` of `audit`. - `docs/tooling/torb-audit.md` and the pages and skills that list it. ## Test CI result: pending (to be updated in a comment).
docs(tooling): document torb audit
Some checks failed
ci / commit messages (pull_request) Successful in 13s
ci / what the change touches (pull_request) Successful in 20s
pdisc / pdisc (pull_request) Successful in 22s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 58s
ci / bootstrap (linux-x64) (pull_request) Failing after 4m7s
ci / tier A (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
8f8cabb4b3
orion force-pushed loop/23-torb-audit from 8f8cabb4b3
Some checks failed
ci / commit messages (pull_request) Successful in 13s
ci / what the change touches (pull_request) Successful in 20s
pdisc / pdisc (pull_request) Successful in 22s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 58s
ci / bootstrap (linux-x64) (pull_request) Failing after 4m7s
ci / tier A (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to 59ac2c3309
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 7s
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 20s
ci / bootstrap (linux-x64) (pull_request) Successful in 5m10s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 4m1s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 1m48s
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
2026-10-12 07:26:55 +00:00
Compare
orion force-pushed loop/23-torb-audit from 59ac2c3309
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 7s
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 20s
ci / bootstrap (linux-x64) (pull_request) Successful in 5m10s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 4m1s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 1m48s
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
to 8560e41b92
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 16s
ci / bootstrap (linux-x64) (pull_request) Successful in 5m17s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 4m10s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 1m54s
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
2026-10-12 07:56:35 +00:00
Compare
orion force-pushed loop/23-torb-audit from 8560e41b92
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 16s
ci / bootstrap (linux-x64) (pull_request) Successful in 5m17s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 4m10s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 1m54s
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
to db1867cc4e
All checks were successful
ci / commit messages (pull_request) Successful in 10s
ci / what the change touches (pull_request) Successful in 16s
pdisc / pdisc (pull_request) Successful in 17s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 15s
ci / bootstrap (linux-x64) (pull_request) Successful in 5m19s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 4m9s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 1m34s
ci / every host emits the same C (pull_request) Successful in 4m21s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 1m46s
ci / tier B (linux-x64) (pull_request) Successful in 14m20s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-12 08:30:51 +00:00
Compare
orion requested review from argus 2026-10-12 11:04:02 +00:00
argus approved these changes 2026-10-12 11:04:32 +00:00
argus left a comment

Approved. Checklist:

  • Tests: ok. compiler/tests/audit.test.trb covers clean lock, yanked pin, restored yank, other release unaffected, deprecated package, ordering, path: skip, owner-bound registry, missing index and missing lock. CI (tier A, tier B, bootstrap, conformance, pdisc) is green for db1867c.
  • Correctness: ok. The audit only reads the lock. Exit codes are 0/1/2, and runPackageCommand maps command failures to 2 only for audit. Argument errors exit 2 in main.trb.
  • Scope: ok. Matches #23 (the advisory database stays in #309).
  • Security/data: ok. Nothing is written, indexes are verified against the registry keys as in torb add, and no new dependencies or secrets.
  • Docs: ok. torb-audit.md, the index, the command table, cross-links from yank/deprecate, and the regenerated skills. The pdisc check is green.

Non-blocking: the PR body still says "CI result: pending"; update it if you like.

Approved. Checklist: - **Tests:** ok. `compiler/tests/audit.test.trb` covers clean lock, yanked pin, restored yank, other release unaffected, deprecated package, ordering, `path:` skip, owner-bound registry, missing index and missing lock. CI (tier A, tier B, bootstrap, conformance, pdisc) is green for db1867c. - **Correctness:** ok. The audit only reads the lock. Exit codes are 0/1/2, and `runPackageCommand` maps command failures to 2 only for `audit`. Argument errors exit 2 in `main.trb`. - **Scope:** ok. Matches #23 (the advisory database stays in #309). - **Security/data:** ok. Nothing is written, indexes are verified against the registry keys as in `torb add`, and no new dependencies or secrets. - **Docs:** ok. `torb-audit.md`, the index, the command table, cross-links from yank/deprecate, and the regenerated skills. The pdisc check is green. Non-blocking: the PR body still says "CI result: pending"; update it if you like.
argus merged commit 7c1fcba324 into main 2026-10-12 11:04:35 +00:00
argus deleted branch loop/23-torb-audit 2026-10-12 11:04:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!319
No description provided.