mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 10:18:18 +00:00
dbcbbd7f2745446e946bd913a11e0daea24b149c
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
53a6937c31 |
docs(contributor-scan): the comment on the first-use build says what the wrapper does (item 5a)
A comment in ops/shell/ousast.sh said the first-use build is silent. It is not: the
wrapper prints one line to say why the run waits, and the build's own output then
shows (the eighth session counted 74 lines of it from a warm cache).
The maintainer chose to keep that output ("Keep output, fix comment", the menu of
2026-11-26): on a cold build it is the only sign that a long download is running. Only
the comment changes, to say what the code does. No behaviour changed.
The clause about a cold build is the decision's wording; no cold build was measured
here. The only first-use capture is the eighth session's warm one, in which the build
shows its running steps, not a byte count.
`bash -n` passes, tests/test_shell_wrapper.py passes (3 tests), ruff, mypy, the three
gates and compileall pass, and the gates print what they printed before. An independent
reviewer approved the change in one round.
|
||
|
|
d1f61fbe6f |
fix(contributor-scan): the wrapper writes its runs to the user cache (item 5a)
The shell wrapper wrote the runs of the image to ./.ousast, inside the repository it was scanning (the eighth session: three runs under it). It now creates ~/.cache/openultrasast/runs, mounts it at /reports, the one writable mount, and passes -e OPENULTRASAST_RUNS_DIR=/reports to its compose run, so nothing is written to the scanned directory. The override is the maintainer's choice of 2026-11-27, on a measurement. Answer 4 of the menu of 2026-11-26 was worded as the mount alone. Measured that day: compose sets OPENULTRASAST_RUNS_DIR=/reports/runs in the service, so the mount alone put the run on the host at ~/.cache/openultrasast/runs/runs/<run>, one level below a native run, and nothing prunes it there (prune_old_runs removes only run directories directly under the root whose names match the run id). With the override the run lands beside native runs. Two things the choice does not change: a scan in the image never prunes, so the wrapper's runs are removed by a later native scan on the default location; and the wrapper writes to ~/.cache/openultrasast/runs whether or not XDG_CACHE_HOME or OPENULTRASAST_RUNS_DIR moves a native run elsewhere. ops/shell/ousast.ps1 gets the same change, the maintainer's second choice: it writes %USERPROFILE%\.cache\openultrasast\runs and passes the same override. That file was edited by reading and WAS NOT RUN: there is no PowerShell on this machine. Tests: tests/test_shell_wrapper.py has a third test. It failed before the change (no runs directory under HOME) and again until the override was passed. After: 3 passed. Measured on 2026-11-27 through the shell wrapper with the real Docker, from a directory without .env, both API keys unset: `ousast scan examples --mode quick` on a copy of libpng's contrib/examples prints run_dir=/reports/<run>, the container prefix, with file_targets=4, findings=4, exit 0; the run is on the host directly under ~/.cache/openultrasast/runs, owned by the user; the scanned directory stays empty. The eight tests of tests/test_docs_site.py and tests/test_removed_plane_references.py pass, `mkdocs build --strict` exits 0, ruff format, ruff check, mypy, the three gates and compileall pass, and the gates print what they printed before the change. An independent reviewer approved the change in one round; its remarks on the README clause, on the test, on the evidence and on the width of one line are applied. Left as it is, for the maintainer: with HOME unset the shell wrapper now fails, where it wrote ./.ousast before ($HOME is empty, so the path is /.cache/openultrasast/runs, and a failed mkdir is not checked, as it was not before). |
||
|
|
a6e8e2615a |
fix(contributor-scan): the wrapper's native path runs in the caller's directory (item 5a)
`ousast scan .` through ops/shell/ousast.sh with a native install scanned the wrong tree. The native path changed into the checkout before it passed the arguments on, so `.` was the OpenUltraSAST checkout and a relative file name was looked up there. The eighth session showed it with a stub interpreter in place of `.venv/bin/python` (`cwd=/tmp/opencode/s8_fakehome args=-m openultrasast.cli scan .`). The check also looked for `joern-parse` only, while the batch queries run `joern`: with `joern-parse` alone on PATH every batch query failed and a standard scan still exited 0 (2026-11-26, 14 findings where the working launcher gives 15). The native path now runs the checkout's interpreter by its absolute path, in the caller's directory, as the container path does, and it is taken only when `joern` is on PATH as well. So `.`, relative names and relative options mean the caller's files. The reviewer found, and a run confirmed, what dropping the `cd` brings: `-m` alone puts the working directory first on the interpreter's path, so a file of the scanned tree could stand in for a module the CLI imports (a `json.py` in the caller's directory: `ousast --help` printed SHADOW-EXECUTED and exited 3). The interpreter is started with `-P`, which keeps that directory off the path; the flag needs Python 3.11, the project's floor (pyproject.toml). Changes a caller sees, beyond the one the decision named: - The checkout's .env is no longer read on the native path; the CLI reads .env from the working directory, which is now the caller's. ops/README.md says so. - `ousast pairs` and `ousast repos` no longer find their defaults outside the checkout, because `benchmarks/` is read relative to the working directory. Measured for `pairs`: through the wrapper natively, and on the container path, `pairs --slice vibe-py` ends with "pair catalog is not a file: benchmarks/pairs/catalog.toml", exit 1, so the container path already behaved this way. `repos` by reading. Run from the checkout root they find their defaults again (by reading; not run). The header's `ousast pairs --slice vibe-py` example is removed. This is a reading the maintainer may correct. - The message for a machine without Docker names both executables. Tests: the new tests/test_shell_wrapper.py runs the wrapper by bash with a stub of the interpreter, `joern`, `joern-parse` and `docker` ahead of /usr/bin and /bin on PATH. Its two tests failed before the change (2 failed: the interpreter ran in the fake checkout, and the native path was taken without `joern`), and the first failed again until `-P` was passed (1 failed). With the real venv and Joern 4.0.625 on PATH, from a directory without .env: `ousast scan examples --mode quick` on a fresh copy of libpng's contrib/examples gives file_targets=4, findings=4, exit 0, before and after the flag, the figures of the eighth session. The eight tests of tests/test_docs_site.py and tests/test_removed_plane_references.py pass, `mkdocs build --strict` exits 0, ruff format, ruff check, mypy, the three gates and compileall pass, and the gates print what they printed before the change. An independent reviewer approved the change in the second round; its two findings of the first round led to the `-P` flag and to the removal of the header example. Found by the reviewer and left alone, outside this decision: the background child of `ousast pre-push` (src/openultrasast/push/background.py) starts the CLI with `-m` and without `-P`, from the pushed repository. |
||
|
|
adbb824eac |
feat(ops): a sourceable wrapper so docker is nobody's problem
source ops/shell/ousast.sh # bash / zsh
. ops\shell\ousast.ps1 # powershell
ousast scan .
ousast scan src/api
The container becomes an implementation detail. The engine is a JVM and ~2 GB
of Joern, and a contributor evaluating this tool should not have to install
either to try it -- what they get is a command.
Path rewriting is what makes it feel local: arguments under the working
directory are mapped to their mounted equivalents, so `src/api` means what the
user expects. Anything outside the mount is passed through unchanged WITH A
WARNING rather than silently rewritten into a path the container cannot see --
a wrong path that looks like it worked is worse than one that complains.
A native install wins when it is present. Someone who installed Joern
deliberately should not be quietly routed through a container, so the wrapper
uses a local joern-parse and venv when both exist; OUSAST_PREFER_NATIVE=0
forces the container. Verified end to end from an unrelated directory.
The image builds itself on first use and says why it is pausing. A first run
that prints a wall of build output and then works is worse than one that
explains itself.
Defaults stay conservative: the working directory mounts READ-ONLY, findings go
to ./.ousast as the only writable mount, and the network is off unless
`ousast-with-judge` asks for it.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
|