package manager: advisory files and torb audit --advisories <directory> (step 1 of #309) #451
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Step 1 of #309. RELEASE.md section 7.6 promises "a public repository of TorbScript files, one per advisory", and CONCEPT promises that
torb auditchecks the locked graph against it. Todaytorb audit(#23,compiler/src/package/audit.trb) reports only what the registry index carries: yanked versions and deprecated packages.This step fixes the file format of an advisory and teaches
torb auditto read a local directory of advisories. It does not publish anything: the public repository, the endpoint that serves it and the OSV export are later steps of #309 and wait for the owner (public commitment, external service). A directory on disk is enough to test the whole path and is what a clone of that repository will be.Source
torb audit)compiler/src/package/audit.trb,literal.trb(settingsOf),requirement.trb(versionsOf),docs/tooling/torb-audit.mdDecided by the loop
One file per advisory,
<directory>/<owner>/<name>/<id>.trb, so a package's advisories are found by its name without reading the whole database;<id>isTORB-<year>-<number>. A file whosepackageline is not its directory's package, or whoseadvisoryline is not its file name, is refused (same rule as the index'sdeprecate).Receiver script of literals, read statically with
settingsOf, like the index and the lock:advisory,package,summary,severityandaffectedare required;published(Unix seconds, asowner.trb),aliasesandreferencesare optional.severityis one oflow,moderate,high,critical.affectedtakes one or more requirement texts ofversionsOf(requirement.trb), a version is affected where any of them allows it. An unknown word is refused, not skipped: a database is read whole or not at all, a typo must not turn into "no findings".No signatures in this step. The directory is the reviewed repository (pull request review is the trust, RELEASE.md 7.6). Whether a registry-served copy is signed like the index (7.14) is decided with the endpoint, in a later step.
Source of the directory:
torb audit --advisories <directory>; no flag, no advisory check, output and exit codes of today unchanged. A default source (registry endpoint,config.trbline) belongs to the step that has something to fetch.Exit codes: a covered locked version is a finding, exit 1 as before; an advisory file that does not read, or a directory that does not exist, is exit 2 (a database that cannot be read must not look like a clean lock).
Acceptance criteria
affectedranges, the path rule, what is refused) is specified in RELEASE.md section 7.6, with an "as built" notecompiler/src/package/advisory.trbhasAdvisoryRecordand a static reader (settingsOf-based, nothing evaluated) and a lookup of the advisories that cover a package and versiontorb audit --advisories <directory>reports, for every locked registry package, each advisory covering the pinned version:acme/http 1.2.4 is affected by TORB-2026-0001 (high): sends the proxy password in clear text; findings are ordered by package, then advisory id; the closing line counts them with the others; exit 1 where there is anyaffectedrange or an unknown severity; the message names the filecompiler/tests/over a directory fixture: a covered pin, a pin outside the range, a second range ofaffected, a pre-release pin, an advisory for a package the lock does not pin (ignored), apath:package skipped, two advisories for one package, and each refusal abovetorb auditusage text (compiler/src/cli/usage.trb) anddocs/tooling/torb-audit.md(synopsis, the format, examples, exit codes) updated;docs/tooling/the-torb-command.mdif it lists flags;skills/regeneratedSeed impact
None expected: TorbScript in
compiler/src/packageandcompiler/src/clionly, no new native, no syntax change, no driver flag, no std name looked up by string.Size
One PR, two Conventional Commits (
feat(package): read advisory files and check the lock against them,docs(tooling): document the advisory format and torb audit --advisories).Dependencies
None open (#23 is closed). Later steps of #309, not part of this one: the public repository and the endpoint that serves it (owner decision),
torb auditfetching it by default, the OSV export.torb auditadvisory database #309torb auditadvisory database #309[loop:torbscript] refine: ready. Source of the requirements: RELEASE.md 7.4/7.6/7.14, CONCEPT package manager list, code at main (audit.trb, literal.trb, requirement.trb, torb-audit.md). Technical choices recorded in the body under "Decided by the loop"; touches no seed surface. next: implement.
[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T02:05:46Z
[loop:torbscript] implement: PR opened #452 (Closes #451), forge CI running, next: review
[loop:torbscript] implement: update on #452. All four PR checks (commit messages, what the change touches, gates, pdisc) are still queued on the CI workers after ~20 min (runs waiting, none started), so there is no CI verdict yet; no failure either. Local quick checks green: torb check, torb format --check, torb docs source/check/skill, advisory.test.trb 20/20 in the VM. next: review (a red CI round is a fix round on loop/451-advisory-files)