Files
Open_Ultra_SAST/docs/examples.md
T
Marius Ciepluch 6ef8381396 docs(readme): an adopter's front door; roadmap and engine-trace runbook move to docs
The maintainer's request of 2026-11-28, in chat: update the README for an adopter
with /cobesy; move the parts on the roadmap and on technical internals to docs;
index docs/ from the README; add a roadmap visualization with the present state
and the past milestones; then give the choices for the open items through the
menu. The menu had eleven questions, each answered with the option recommended.
Two answers govern this commit. "README first": the README work is committed with
the per-commit gate and a fresh reviewer, before the record commit for 5b and
item 5c. "Fix in this commit": the faults found while moving text are fixed here,
the wording shown first.

The wording of the two fixes was shown in chat and answered "Write it as shown
(Recommended)" and "Say why, in a comment (Recommended)". A third fault offered in
that menu, "five docs pages link README anchors that do not exist", was the
session's error: they are seven links, in four pages, to five anchors of
ops/ax/README.md and ops/README.md, and all five headings exist. Nothing was
repointed. The learning is in the handover, which is not tracked, with the
maintainer's approval.

What changed. Measured in /tmp/opencode/s10_rd1_diffcheck.out: five tracked files
changed (144 insertions, 328 deletions) and three files are new.
- README.md, 488 lines at HEAD and 296 now. It keeps the install of Tier 1 and
  Tier 2, the scan modes, the run artifacts and the maintainer commands. It adds
  "What you can run today", "Status and roadmap" (a Mermaid ladder of R0 to R6, a
  table with each step's state on 2026-11-28, a table of past milestones) and
  "Documentation", a table with one row for each of the 21 pages under docs/.
- docs/roadmap.md, new, 123 lines: the destination, the ladder with what must be
  true to move on, the release milestones M1a to M5, the past milestones, the
  status of 2026-11-06 as the README carried it, what changed after that day, and
  the rules that bind every step.
- ops/ax/engine-traces.md, new, 80 lines: the README's section "Engine traces on
  kube-ax" as it stood, with "s3://..." written "s3://<bucket>" and the link to
  ops/ax/README.md written as a path and a section name. docs/ops/ax/engine-traces.md,
  new, includes it from its line 3, as docs/ops/ax/README.md includes
  ops/ax/README.md.
- mkdocs.yml: two entries in the nav, Roadmap and Engine traces on kube-ax.
- docs/evaluation.md: one paragraph with the gate's committed baseline
  (benchmarks/measurements/2026-09-06-gate-baseline.txt: recall 93.62%, 44 of 47;
  false positives 0.0%), the day the README quoted it (2026-10-02, bdabb97), and
  that PHP is not in the gate.
- docs/examples.md: two sentences moved from the README, on the ledger block of
  manifest.json and on the MCP tool openultrasast.benchmark. The sentence that
  pointed to the README's "Scan modes" now points to architecture.md.
- docs/index.md: the state line, from 2026-10-02 to 2026-11-28, in the words that
  were shown.
- The README's pull line: a comment says that 2.0.1 is the last full release and
  that a prerelease is tagged with its version (.github/workflows/release.yml:93-95).

Left out of the README because another page already held it, each checked by grep
before the cut and then by the reviewer: Tier 3 and Tier 4, the plane, the memory
store, the decision engine, the token economics, the detection techniques, the
framework priors, and the details of the run directory, its retention and the
ledger (docs/examples.md, docs/architecture.md). The note on the retired HarnessX
keys is in RELEASE_NOTES.md, which the README links.

Checks, in files under /tmp/opencode/ that start with their command; s10_rd1_exits.txt
is the gates script's own output, ten exit codes.
- s10_rd1_pytest_docs.out: 30 passed in the five test files that read the README,
  docs and ops (test_docs_site, with the strict build;
  test_removed_plane_references; test_plane_literals; test_push_explain;
  test_engine_queue), run after the last edit.
- s10_rd1_pytest_ops.out: 141 passed and 3 skipped in seven test files that touch
  ops/ax or the hook install.
- s10_rd1_links.out: the relative links resolve, anchors included: 41 in the
  README, 5 in docs/roadmap.md, 19 in docs/index.md, 3 in docs/evaluation.md, 2
  in docs/examples.md. README.md and docs/roadmap.md hold one flowchart each, of
  seven nodes, by the checks of test_docs_site. No file under docs/ contains
  ".kiro" or "kiro-".
- s10_rd1_diffcheck.out: the new text is ASCII; git diff --check exits 0.
- s10_rd1_gates_run.out and s10_rd1_exits.txt: the gates of label rd1 give ten
  zeros.
Not verified: the README's Mermaid block in a browser.

Review.
Three rounds, read-only. The old README was split into 351 sentences and each was
traced in the README, docs/, ops/ and the release notes. Round one found a lost
sentence, now in docs/examples.md, four false states in README.md and docs/roadmap.md
(Docker, M4, the proof arm, "a human go") and three wrong counts in the message; all
are corrected. Round two found the rewording of a remark false at docs/roadmap.md:14.
Round three read every number of that page: its only detection figures are the two
recall counts of the status of 2026-11-06, as the page now says. Measured in round
three: 123 lines; 41 relative links of the README resolve, and 5, 19, 3 and 2 in the
changed pages; 21 rows for 21 pages; one flowchart of seven nodes in each of README.md
and docs/roadmap.md; a strict build with no ".kiro" or "kiro-"; 11 tests passed in
the three permitted files. The counts 30, 141 and 3 and the ten gate zeros were read
in the session's files, not re-run.
2026-11-28 16:30:44 +01:00

6.1 KiB
Raw Blame History

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 describes the mechanism.

1. Quick scan a local repo (deterministic, no keys)

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)

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

# 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

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)

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.

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.

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.

{ "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 "Agent integrations".