mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 10:18:18 +00:00
The maintainer's request, in their words: "run /humanizer across the readme and docs and push them to main". The menu of 2026-11-28, three answers, each the option recommended: prose only (headings, code blocks, commands, paths, link targets and quoted strings stay); README.md and the 21 pages under docs/ (the three ops pages that the site includes stay as they are); the push follows the full gate. What changed - The pass read the 22 files with the humanizer skill, in its register for reference text: plain and neutral, no personality added. Apart from the two corrections below, a file was edited only where a pattern of the skill required it. - Six files changed, +14 -12 (s10_rd3_diffcheck.out). The other 16 pages are byte-identical to HEAD. - README.md: one tailing negation became a sentence of its own. A missing engine is recorded as a degradation; it does not count as a clean result. - README.md, docs/architecture.md, docs/memory-and-detection.md and docs/scanning.md: four sentences lost a diff-anchored "now" (one word each). - docs/pre-push-for-developers.md: two "not just" contrasts, a tailing negation and a run of three subjectless "No ..." fragments became plain clauses. The bold label keeps its strength: "It can prove as well as warn." - Two old faults that the README rewrite of6ef8381carried over, seen by the pass and corrected here: - docs/examples.md pointed at a README section that was removed on 2026-10-02 (bdabb97, "Agent integrations"). It now names "For maintainers and contributors", which holds the text on the MCP server. - README.md, scan modes: "Each adds to the one before" (552671c, 2026-10-02) contradicted the third bullet below it since that bullet was rewritten on 2026-10-13 (f5a904b): deep records a degradation and otherwise equals standard. The sentence now says the same. Checks - s10_rd3_pytest_docs.out: the five test files that read the README, docs and ops: 30 passed. - s10_rd3_build.out: a strict build, exit 0, 22 html files (21 pages and the 404 page), none with a steering string on it. - s10_rd3_invariants.out, against HEADc10dc11for all 22 files: headings, fenced lines, include lines and link targets equal; no non-ASCII in prose. The script prints FAIL for one check, by design: README.md gained four inline code spans in the corrected sentence on the scan modes. Its "only in HEAD" lists are empty, so no code span was lost. - s10_rd3_exits.txt: the gates with label rd3, ten zeros. - s10_rd3_diffcheck.out: git diff --check exits 0. Not verified - The claims of the pages against the records. Apart from the two corrections, the pass kept every claim as it was; what it saw and left is in the session's evidence, for the maintainer. Review. Two rounds on 2026-11-28, read-only, against HEADc10dc11. Round one approved the tree and blocked the message on five statements; all five are corrected. Round two read the three edits made in between against their old lines and the facts: README.md:118 keeps the qualifier of the third bullet, README.md:128 lost its "now" like the two other copies, and pre-push-for-developers.md:58 has the strength of its original. Every hunk was read old against new in both rounds. My own comparison of the six HEAD blobs with the working tree found headings, fenced lines, include lines, link targets, HTML tags and bold marks equal, with no non-ASCII character added. No page under docs/ contains ".kiro" or "kiro-". The other 16 files are tracked and identical to HEAD. Run again in each round: the five test files, 30 passed; a strict build to a scratch directory, exit 0, 22 html files (21 pages and 404.html), none with a steering string; git diff --check, exit 0.
123 lines
6.1 KiB
Markdown
123 lines
6.1 KiB
Markdown
# End-to-end examples
|
||
|
||
Each example stands on its own. A scan writes its run under
|
||
`~/.cache/openultrasast/runs/<scan-id>/`, or under `$XDG_CACHE_HOME/openultrasast/runs/` when
|
||
that variable is set to an absolute path, and prints that path. `OPENULTRASAST_RUNS_DIR`
|
||
overrides the location: an absolute path is used as given, and a relative one is resolved against
|
||
the current working directory, never against the target. Once a scan has written its run to the
|
||
default location, with no `OPENULTRASAST_RUNS_DIR` set, the runs there that are older than 30 days
|
||
are removed, and `ousast` prints one `notice:` line when it removes any;
|
||
`OPENULTRASAST_RUNS_RETENTION_DAYS` sets the number of days (`0` keeps every run), and nothing is
|
||
ever removed from a location chosen with `OPENULTRASAST_RUNS_DIR`, except through the shell wrapper:
|
||
it mounts `~/.cache/openultrasast/runs` at `/reports` in the image, and a scan through it removes the
|
||
expired runs there as well; the ledgers of tree digests (`calibration/` under the same directories)
|
||
go by the same number of days, dated by their last use. A scan does not read the files
|
||
under its runs directory when that directory lies inside the scanned path; when this leaves source
|
||
files out of the scan, `ousast` prints one `notice:` line naming the directory and how many.
|
||
`ousast benchmark` writes its run to the same directory, as `<runs_dir>/<benchmark-run-id>/` beside
|
||
the scan runs, and prints that path (`benchmark_run_dir=<path>`); run retention removes it like a
|
||
scan run. The MCP tool `openultrasast.benchmark` uses the same directory.
|
||
|
||
A scan that rejects or holds a finding writes one file into the scanned tree, and only when that
|
||
file's content would change:
|
||
`<target>/.openultrasast/calibration/false_positive_learnings.json` (`.openultrasast/` is
|
||
gitignored in this repository, not in one of your own). On a read-only tree the scan records
|
||
`ledger_not_written` instead and keeps the learnings in the ledger of the tree's digest,
|
||
`<runs_dir>/calibration/<digest>.json`, read by the next scan of the very same bytes. The `ledger` block
|
||
of `manifest.json` names the digest, how many learnings came from each ledger, and what became of the
|
||
digest's ledger. [Architecture](architecture.md#scoped-calibration-every-scan) describes the mechanism.
|
||
|
||
## 1. Quick scan a local repo (deterministic, no keys)
|
||
|
||
```bash
|
||
uv run ousast scan /path/to/code --mode quick
|
||
# the scan prints: run_dir=/home/you/.cache/openultrasast/runs/<scan-id>
|
||
run=/home/you/.cache/openultrasast/runs/<scan-id>
|
||
cat "$run/report.md" # findings + evidence (secrets redacted)
|
||
jq . "$run/score.json" # 0–100 project score + gate verdict
|
||
"$run/report.sarif" # SARIF for code-scanning / IDEs
|
||
```
|
||
|
||
## 2. Standard scan with the engine (Docker)
|
||
|
||
```bash
|
||
source ops/shell/ousast.sh # once per shell; builds the image on first use
|
||
ousast scan . --mode standard # Joern model layer, container network off: no model calls
|
||
ousast-with-judge scan . --mode standard # network on, so the model is asked (needs DEEPSEEK_API_KEY)
|
||
```
|
||
|
||
Without a key, the graph still decides. Its entailed findings are reported. The LLM's residual
|
||
and suspicion questions go unasked.
|
||
|
||
## 3. CI gate
|
||
|
||
```bash
|
||
# Fail the build on any evidence-verified finding:
|
||
uv run ousast scan . --mode quick --fail-on verified
|
||
|
||
# The hard detection gate (>=90% recall, <10% FP), score-independent:
|
||
uv run python -m openultrasast.gate
|
||
```
|
||
|
||
## 4. Benchmark a known-vulnerable corpus
|
||
|
||
```bash
|
||
uv run ousast benchmark benchmarks/manifests/python-vulnerable.toml --mode quick
|
||
# -> expected / matched / missed counts + a per-rule recommendation delta
|
||
```
|
||
|
||
## 5. Vuln vs fixed pair eval (efficiency, not cheat-sheet recall)
|
||
|
||
```bash
|
||
uv run ousast pairs # local fixtures + vendored GitHub VFCs
|
||
uv run ousast pairs --slice github --json # honesty dashboard as JSON
|
||
uv run ousast pairs --slice sast # OWASP Benchmark + Juliet Youden (TPR-FPR)
|
||
uv run ousast pairs --slice vibe-py --pointers # nightly: pointer pairs via the local cache (network)
|
||
uv run ousast pairs --split holdout --profile human # filter by declared split and provenance profile
|
||
uv run python -m openultrasast.pair_gate # CI: local pairs must all pass
|
||
```
|
||
|
||
Each case is two isolated trees: the vuln file and the patched file, at the same relative path.
|
||
|
||
- `pair_correct` means the harness fired on the vuln side and stayed silent on the fix.
|
||
- Misses become `miss` signals and fix-side leaks become `fp` signals in the pair report.
|
||
- The catalog and public dataset pointers live in `benchmarks/pairs/`.
|
||
|
||
## 6. Running the agentic plane
|
||
|
||
Model work over whole repositories runs as a Run manifest on ax. Each task gets one isolated
|
||
actor. Bring-up is in [ops/ax/README.md](ops/ax/README.md).
|
||
|
||
`ousast` reads the provider key from the environment, or from `.env`. `.env` never overrides an
|
||
exported variable. The key is sent only in each task's start request.
|
||
|
||
```bash
|
||
uv run ousast plane doctor # kind, Agent Substrate, ax controller, runner image
|
||
uv run ousast plane run plane/runs/validation-46.yaml # per case: repo-facts, verify a/b/c, agree, final, features, remember
|
||
uv run ousast plane status validation-46 # per-task status and token attribution
|
||
uv run ousast plane remember validation-46 # re-ingest the run's memory rows (OUSAST_MEMORY)
|
||
```
|
||
|
||
Each task in the Run carries its own Model and `budget: {usd, calls}`.
|
||
|
||
- A task that reaches its ceiling stops as `unfinished`. It resumes on a rerun with a larger
|
||
budget.
|
||
- `ousast plane status` prints the token attribution table. It shows calls, prompt, cache-hit and
|
||
output tokens, and USD per task.
|
||
|
||
## 7. Drive it from an MCP client (OpenCode / IDE)
|
||
|
||
MCP (Model Context Protocol) lets an editor or agent call the tool's functions.
|
||
|
||
```jsonc
|
||
{ "command": "uv", "args": ["run", "ousast", "mcp"] }
|
||
```
|
||
|
||
Then call the tools in this order:
|
||
|
||
1. `openultrasast.scan {path}` returns a `run_dir`.
|
||
2. `openultrasast.findings {run_dir}` lists the findings.
|
||
3. `openultrasast.explain {run_dir, finding_id}` explains one.
|
||
|
||
See the README section "For maintainers and contributors".
|