Commit Graph
1349 Commits
Author SHA1 Message Date
Marius Ciepluch e2163a4fea feat(scan): an unwritable tree keeps a scan's learnings under the runs directory (item 5b)
The decision of the maintainer on the ninth session's menu, answer 9 (.kiro/handover.md,
untracked, 1340-1343 as it stood on 2026-11-27; the option as offered, 1451-1452):

> 9. The ledger in the image. Answer: "Decide the key now": a digest of the tree's files
> (the `fingerprint` of the `provenance` stage is no digest), one ledger per digest under
> the runs directory; a design note is shown to the maintainer before any code.

The design note (/tmp/opencode/s10_c10_design_note.md, 299 lines) was reviewed in five
rounds before it was shown, and shown to the maintainer whole on 2026-11-27 with its three
questions. The maintainer's answers came on 2026-11-28, through the question tool, each the
recommended option as offered: "Stand as written (Recommended)" on the note's rule of reading
and writing (its section 3.3), "With the runs, by last use (Recommended)" on how long a ledger
stays (section 3.5), and "Build it now (Recommended)". The dated note on task 3.1 of
.kiro/specs/contributor-scan/tasks.md (lines 459-502) carries the rule as approved.

The fault: the image mounts the target read-only, so the ledger a scan writes into the tree
(<target>/.openultrasast/calibration/false_positive_learnings.json) cannot be written there,
the scan records ledger_not_written, and the next scan in the image starts without the
learnings of the one before.

What changed
- src/openultrasast/tree_digest.py: tree_digest(target, runs_directory) (line 48), a sha256
  over one entry per file in path order (the length of the path, a colon, the path, a tab,
  the sha256 of the bytes), after a version line. Left out: links, the directories a scan
  ignores (IGNORED_DIRS, so that the tree's ledger does not change its own key) and the runs
  directory, whichever way it is reached (by device and inode). A file that cannot be read
  and a directory that cannot be listed are named "unreadable"; a directory that can be
  listed but not searched raises, as the scan's own reading of the tree does.
- src/openultrasast/digest_ledger.py: the ledger of a digest, calibration/<digest>.json under
  the runs directory, in the JSON of the tree's ledger. read_digest_ledger (line 47) reads it
  and marks it as used; settle_digest_ledger (line 65) applies the rule.
  The tree took the write: the ledger is removed. The tree refused: the ledger is written
  with its own entries and this scan's new ones, never one whose finding id the tree's
  ledger has, only when that differs from its content, and removed when that would leave it
  empty. No write: a ledger whose every entry the tree's ledger also has is removed. One that
  could not be read (a file that is not a ledger, whatever its top level or its depth) is
  taken for empty and goes, unless the tree refused and this scan wrote it. It is written
  through a temporary file of the writer's own and a rename (line 112).
- src/openultrasast/cli.py: the stage tree_digest, before any stage reads the tree
  (cli.py:603-605); _read_ledgers (cli.py:1085-1099), the tree's ledger and then the
  digest's, the tree's entry winning by finding id; _persist_calibration_feedback
  (cli.py:1101-1136), which writes the tree's ledger when its content would differ from what
  it held, also when only the digest's entries are new to it; the manifest's ledger block
  (cli.py:731-735); a notice when the digest's ledger could not be written or removed
  (cli.py:755).
- src/openultrasast/run.py: prune_expired_ledgers (run.py:112), called by prune_scan_runs
  (run.py:71-99). Under calibration/ of the same two locations as the runs, a ledger, or the
  temporary file it was written through, last used OPENULTRASAST_RUNS_RETENTION_DAYS days
  ago is removed; 0 keeps all. Files called something else, links and directories stay. A
  removal that fails is said once and costs the scan nothing.
- src/openultrasast/reports.py: write_manifest takes ledger (reports.py:212, 254-255). The
  ledger_not_written sentence names the digest's ledger when it holds the learnings
  (reports.py:461-467, chosen at 479-483).
- README.md, docs/examples.md, docs/architecture.md and
  .agents/skills/openultrasast-scan/SKILL.md say where the learnings of a read-only tree go,
  and what removes them.

Two departures from recorded decisions, both put to the maintainer in the note and accepted
with it:
- The tree's ledger is written when a scan learns nothing new, because the digest's entries
  are new to it. The decision of 2026-11-24 says it "is written only when a scan learns
  something" (spec.json:68).
- A ledger of a digest is removed when it expires, and its time is changed when a scan reads
  it. The decision of 2026-11-24 says "the scan's own run and anything not named like a run
  are never touched" (spec.json:73), and dates a run by its id, where a ledger is dated by
  its use.

Measured
- The built function gives the note's prototype's digest for the four-file subject
  (915506a8...) and for libpng's copy (1dcd664f...): s10_c10_port.out.
- In the image, on the final code. A probe image of openultrasast:dev (3f959b31f2f2) with
  the tree's package copied over it, built at 09:06:36Z and holding the tree's 297 .py files
  (s10_c10_image_probe/03_probe_sources.out, s10_c10_sources_still_equal4.out). Standard
  mode, no key, network none. The four C files of contrib/examples of libpng and their
  README, copied fresh and mounted read-only at /target; a scratch runs directory mounted at
  /reports with the wrapper's OPENULTRASAST_RUNS_DIR=/reports (s10_c10_image_probe.sh,
  stamps 09:06:36Z to 09:09:14Z, 2026-11-28).
  - The first scan learns four entries and keeps them in /reports/calibration/<digest>.json:
    calibrations_applied=0, project_score 26, the manifest's ledger {digest_ledger: written,
    learnings_read: {digest: 0, tree: 0}} (10_, 11_). The report names the file.
  - The second scan of the same bytes reads them: calibrations_applied=2 on two files,
    project_score 59, penalty_total 32.0, learnings_read 4 from the digest's ledger,
    digest_ledger "left as it was" (20_, 21_). The file's time is that of the second scan's
    read, 09:07:19Z (22_).
  - The digest the scan took in the image equals the one taken on the host for the same
    files (s10_c10_image_digest_host4.out). The target is unchanged
    (s10_c10_image_target_same4.out).
  - Three earlier runs of this probe and of the native run below, each on the code as it
    stood before a later correction of the same rule (the value for a ledger that could not
    be read; a ledger whose top level is not an object; one nested too deep), gave the same
    numbers. Their stamps: 08:12:50Z to 08:17:31Z, 08:23:38Z to 08:27:42Z and 08:50:15Z to
    08:54:17Z. They are kept as s10_c10_image_probe_run1, _run2, s10_c10_native_run1,
    _run2 and _run3; of the third image run s10_c10_image_probe_run3.out and the host,
    target and sources checks numbered 3 remain, since s10_c10_image_probe_run3 is empty.
    Its files were read by the reviewer in round two.
- The shipped image, the control, on the same files: calibrations_applied=0 and
  project_score 26 on both scans, no ledger block and no ledger (30_ to 42_).
- Natively, on a fresh copy of the same five files, the network off (s10_c10_native.sh,
  09:09:14Z to 09:10:38Z): the first scan writes the tree's ledger (calibrations_applied=0,
  project_score 26, digest_ledger none), the second reads it (calibrations_applied=2,
  project_score 59, learnings_read 4 from the tree's ledger), and no ledger of a digest is
  made (s10_c10_native/10_ to 22_).
- The probe left no container (2 before, 2 after: 00_, 91_) and its image is removed (90_,
  92_).

Tests
- tests/test_tree_digest.py (7) and tests/test_digest_ledger.py (11, one over nine contents
  a file may hold); seven tests in tests/test_scan_output_location.py, six through the scan
  (three over two cases) and one on _read_ledgers; six in tests/test_run_pruning.py; one
  sentence in tests/test_reports.py. The scan test of a refused write selects its run by
  name now, since the runs directory holds calibration/ as well.
- RED on an archive of e231b78 with the final test files: the two unit files do not import
  (s10_c10_red14.out); the scan, pruning and report files give 15 failed, 101 passed
  (s10_c10_red13.out; the tree's tree_digest.py and digest_ledger.py were copied into that
  archive, since the test file imports both, and cli.py, run.py and reports.py were HEAD's).
  On the tree before each fix: the test of a ledger that is not a JSON object failed
  (s10_c10_red8.out), and so did the content nested too deep and its scan test
  (s10_c10_red12.out).
- GREEN on the final tree: 134 passed over the five files (s10_c10_green9.out); 873 passed
  over the 60 files of the scan path (s10_c10_wide4_full.out; the list is
  s10_c10_testfiles.txt); the docs and skills tests, with the strict site build, 11 passed
  (s10_c10_docs_tests4.out; no page changed after it).
- Gates on the final tree: ten zeros (s10_c10e_exits.txt), the three gate outputs equal to
  the baseline.

- Review: three rounds against e231b78, by one reviewer subagent, read-only; no
  docker and no wrapper run, the probes read from their files. Round one blocked
  on one finding and measured it end to end on a scratch tree: a ledger of a
  digest whose top level is not a JSON object raised AttributeError in the tree's
  loader and stopped the scan (exit 1), against the note's "a cache must not stop
  a scan". Round two approved with remarks, which the code and the tests took:
  RecursionError joined the tuple (digest_ledger.py:57), with a ninth content in
  the unit test and a scan test of a ledger that is not a ledger, red before the
  fix (s10_c10_red12.out). Round three approved the code, the tests and the dated
  note, and blocked on one sentence of this message, which named
  s10_c10_image_probe_run3 as kept: that directory is empty. On the final tree the
  reviewer measured the scan past a digest's ledger nested 5000 deep (exit 0,
  "unreadable", the file removed) and passed 30000 contents through
  read_digest_ledger, with none let through; it re-ran the five files (134
  passed), the docs and skills files with two scan files outside the sixty (20
  passed), ruff, mypy (297 files) and the comparison of the three gate outputs
  with the baseline, the gates themselves not run; it recomputed the three
  digests, matched the tree's 297 .py files to the fourth probe image's list, and
  read the fourth image and native runs. The third image run's files were read in
  round two, before they were lost. The sentence was reworded as the reviewer
  wrote it.

By reading, not measured
- A pre-push run does not go through _run_scan, and src/openultrasast/push names no ledger:
  nothing changes there.
- ousast benchmark and the MCP server call _run_scan and get the rule as a scan does.
- mark_all of the hunt tooling lists the children of a runs root it is given; it has no
  caller under src.

Found and not fixed, for the maintainer
- The note says the digest stage's seconds are in the manifest. No stage's are: a stage's
  time is in trace/events.jsonl (stage_start and stage_end), and so is this one's. The pages
  and the dated note do not repeat the sentence.
- The report's sentence (reports.py:461-467) says this scan's learnings are kept in the
  ledger of the digest whenever that file holds some of them (cli.py:1131-1133). A new
  learning whose finding id the tree's ledger already holds is left out by the rule; the
  tree's version stands, and the new evidence text is in the run directory alone. The
  sentence is the note's as approved.
- The tree's own ledger stops the scan when its top level is not a JSON object, or when it
  is nested too deep (calibration.py:157-159, read at cli.py:610 outside any stage). That
  is older than this commit; the ledger of a digest does not.
- read_digest_ledger raises when calibration/ cannot be searched, as the tree's ledger does
  when .openultrasast/calibration cannot (digest_ledger.py:53).
- By reading: a tree whose runs directory is the target itself gets another digest at every
  scan, since its run directory is made inside the target before the stage. Such a tree can
  be written, so its own ledger takes the learnings and no ledger of a digest is made.
- docs/architecture.md draws no provenance stage, which cli.py runs between
  entry_point_mapping and rank.
- The wrapper builds its image only when the image is missing: until a rebuild, a scan
  through it runs the shipped code, which has none of this.
- The notice of a removed ledger names the runs directory as the scan sees it (/reports in
  the image), not the host's path.

Not checked
- the whole test suite; Windows; ops/shell/ousast.ps1 (not read for this commit); two scans
  of one tree at once; the wrapper and the compose route (the probe used docker run with the
  wrapper's mount and override); a removal that fails on a real cache; Docker Desktop, where
  a directory mounted twice may not keep one inode.
2026-11-28 10:21:05 +01:00
Marius Ciepluch e231b78e04 docs(readme): the AX coordinator commands build with docker compose only (item 5b)
Decision (the ninth session's menu of 2026-11-27, question 8, "README.md's copy of
the base pin"; .kiro/handover.md, not tracked, lines 1338-1339 and 1439-1445). The
maintainer's answer: "Drop the two lines". As offered: "README.md says `docker compose
build` only; one docs commit." Not chosen: "Guard it with a test" (the session's
recommendation); "Leave it".

The fault: the two build commands of the section "Engine traces on kube-ax", one
docker buildx build and one docker build, carried the base tag and digest by hand in
two --build-arg pairs, and no test read them. When plane/task-base.digest changes,
both builds still succeed on the old base until that base is deleted from GHCR. The
copy in docker-compose.yml is guarded (tests/test_task_images.py:51-59,
test_compose_builds_from_the_pinned_base).

What changed (README.md:440-458, which are lines 440-463 on efa311a; one file, 12
insertions, 17 deletions):
- The two build commands are gone, with the lines that served them alone: TASK_TAG,
  the metadata file that gave TASK_IMAGE its digest, and the printf of it.
- The block builds with `OUSAST_VERSION=engine-ax docker compose build` and sets
  TASK_IMAGE to the reference the Engine image workflow printed.
- The lead-in and the paragraph after the block say what the block does now. The
  sentence "The Engine image workflow also builds/pushes both images and prints each
  digest; CI needs the changes published before dispatch" stands as it was.

The session's readings of the decision, open to correction:
1. OUSAST_VERSION=engine-ax stands before the command so that the image keeps the tag
   the two trace commands below name (--docker-image openultrasast:engine-ax,
   README.md:469 and :479) and does not overwrite openultrasast:dev, the image the
   wrapper uses (ops/shell/ousast.sh:64) and the default of --docker-image
   (benchmarks/learn/engine_trace.py:890). The block still says docker compose build
   alone.
2. TASK_IMAGE now comes from the Engine image workflow. The dropped buildx command was
   the README's only local build of the task image. The workflow's engine job builds
   plane/Dockerfile.engine-task, target engine, pushes ghcr.io/<owner>/ousast-engine-task
   at sha-<7> and main, and writes image@digest to its log and to its step summary
   (.github/workflows/engine-image.yml:104-151). AX takes --image by digest only
   (engine_trace.py:915-916).
3. The README no longer documents a build of the task image from uncommitted code. The
   last sentence of the paragraph says what a reader now gets: the Docker lane runs the
   local image, committed or not; the AX lanes run the task image of the revision the
   workflow built.
4. The paragraph that opens the section (README.md:412-413, "Rebuild it after code
   changes and pass its digest with --image") is left as it is: the rebuild is the
   workflow's, and the sentence does not say who builds.
5. When the workflow runs is not restated here; the sentence points at the rebuild
   policy (ops/ax/README.md:296-319).

Measured (files under /tmp/opencode; all but the gate files start with their
command; the gates were run as `bash /tmp/opencode/s10_gates.sh c9`):
- The image compose names: `OUSAST_VERSION=engine-ax docker compose config --images`
  prints openultrasast:engine-ax; without the variable, openultrasast:dev
  (s10_c9_compose_images.out). Only the lines that start with openultrasast: were
  printed. No image was built.
- The block parses: `sed -n '444,449p' README.md | bash -n` exits 0
  (s10_c9_block.out).
- Before and after: a grep for six markers (build-arg, TASK_BASE_TAG,
  TASK_BASE_DIGEST, docker build, TASK_TAG, metadata-file) over README.md gives 10
  lines on efa311a and 0 on this tree (s10_c9_before_after.out).
- Tests: tests/test_removed_plane_references.py (it reads README.md:49-50),
  tests/test_docs_site.py and tests/test_task_images.py::test_compose_builds_from_the_pinned_base
  give 9 passed, exit 0 (s10_c9_tests.out).
- The root README.md is not a page of the docs site: mkdocs.yml's nav names no
  README, and docs/ includes ops/README.md and ops/ax/README.md only
  (s10_c9_site.out). The strict site build that tests/test_docs_site.py runs
  passed, and it does not read the root README.
- Gates, mypy, compileall, ruff format and ruff check: ten zeros
  (s10_c9_exits.txt); the three gate outputs equal the baseline.

By reading, not measured:
- docker compose build builds the service ousast from the root Dockerfile with the
  defaults of docker-compose.yml:13-20, which the test cited above keeps equal to
  plane/task-base.digest.
- The workflow's paths filter (engine-image.yml:7-10) and the policy it implements
  are taken from the two files; no run of the workflow was watched.

Found and not fixed, for the maintainer:
- The dropped buildx command named no --target, so since c6e87a8 (2026-10-04) it built
  the last stage of plane/Dockerfile.engine-task, which is replay, not the engine
  stage the workflow publishes (engine-image.yml:130; the stage list on this tree is
  in s10_c9_byreading.out). By reading; that image was never built here.
- ops/ax/README.md:321-322 still says how a local task build passes the two build
  args, without a command. A local build whose args are read from
  plane/task-base.digest would give back the local task build without a by-hand copy;
  it was not offered and is not written.

Not checked:
- No image was built and nothing was dispatched to AX; the Engine image workflow was
  not run.
- The whole test suite.
- Whether the checkout's .env names OUSAST_VERSION: not read. The measurement above
  was made with the variable set in the command line, which compose takes first.

- Review: two rounds by a reviewer subagent, read-only; it ran no docker build or run.
  Round one approved the change: the diff is README.md alone, 12 insertions and 17
  deletions in 440-458; the three test selections re-run (9 passed); the compose
  measurement repeated (openultrasast:engine-ax); the three gate outputs equal to the
  baseline by cmp, the gates not re-run; every citation read. It conditioned the commit
  on three statements of this message, met: which evidence files carry their command,
  the first changed line (440), and that the strict site build did run, inside
  tests/test_docs_site.py. Round two read the corrected message line by line and found
  the three conditions met; it re-ran the three tests (9 passed), and a strict site
  build to a scratch directory holds neither the section's heading nor its new last
  sentence. Not carried: its remark that the block could say the coordinator and the
  task image have to be one revision, which was not measured here.
2026-11-27 20:16:35 +01:00
Marius Ciepluch efa311a112 fix(shell): the wrapper passes the retention days into the image (item 5b)
The maintainer's second decision on answer 7, taken on 2026-11-27 while the scan path
change (312c09b) was reviewed. Put with the question tool, in this question: "Answer 7
... is built, measured and reviewed, with one consequence the decision does not cover.
The wrapper passes only OPENULTRASAST_RUNS_DIR into the image, never
OPENULTRASAST_RUNS_RETENTION_DAYS. ... How should the retention reach the image?" The
option chosen, in full: "Pass it through (Recommended)": "The wrappers pass
OPENULTRASAST_RUNS_RETENTION_DAYS into the container: one more -e in
ops/shell/ousast.sh and ops/shell/ousast.ps1, a test first. The scan in the image then
honours the host's setting, 0 included. Measured: compose passes a variable named
without a value only when the host sets it. This commit stays the scan path alone; the
wrapper is the next commit." Not chosen: "Document it", "Hold answer 7".

What changed.
- ops/shell/ousast.sh: the compose run passes -e OPENULTRASAST_RUNS_RETENTION_DAYS,
  without a value, beside the runs directory's override; the comment above it says why.
- ops/shell/ousast.ps1: the same option, edited by reading: no PowerShell is installed
  here.
- tests/test_shell_wrapper.py: test_the_container_path_passes_the_retention_into_the_image.
- tests/test_run_pruning.py: the guard test of 312c09b pinned one text,
  "-e OPENULTRASAST_RUNS_DIR=/reports ousast". With the new option between the two it
  now pins the word OPENULTRASAST_RUNS_DIR=<WRAPPER_RUNS_MOUNT> wherever it stands in
  the wrapper's text.

Measured, through the wrapper function itself. The script is /tmp/opencode/s10_c8_probe.sh
and its files are under /tmp/opencode/s10_c8_probe/, one per measurement; those of the
wrapper runs start with the command and then with the line that ran. bash sources the
working tree's ops/shell/ousast.sh and runs `ousast scan examples --mode quick` with
HOME at a scratch directory, so the runs directory the wrapper mounts at /reports is a
scratch one; the real ~/.cache/openultrasast/runs was not touched
(/tmp/opencode/s10_c8_real_runs.out). The image is openultrasast:dev (3f959b31f2f2) with
the working tree's package copied over it, under a tag that OUSAST_VERSION gives to
compose, so the wrapper finds an image and does not build. Network off. No key is in the
shell's environment; compose reads the checkout's .env by default, and that file names
both keys, which docker-compose.yml:44-45 pass on, so the containers may have had them:
not looked at, and no measurement depends on it (quick mode, network none). Compose
5.5.1. Each scratch runs directory held a run of 40 days ago, a run of 5 days ago and a
directory called notes. The stamps run from 18:54:48Z to 18:54:58Z.
- Retention unset on the host (10_changed_unset.out): "notice: removed 1 run older
  than 30 days from /reports"; the expired run is gone, the run of 5 days ago, the new
  run and notes remain (11_changed_unset_after.out).
- Retention 0 on the host (20_changed_zero.out, 21_changed_zero_after.out): no notice;
  the expired run stays, with the run of 5 days ago, the new run and notes.
- Retention 3 on the host (30_changed_three.out): "notice: removed 2 runs older
  than 3 days from /reports"; both old runs are gone (31_changed_three_after.out).
- The control: HEAD's wrapper (312c09b) with retention 0 on the host (40_head_zero.out):
  "notice: removed 1 run older than 30 days from /reports". That is the gap this
  commit closes (41_head_zero_after.out).
- What the container sees of the variable under the wrapper's two options, asked of the
  image's Python (50_variable_unset.out, 51_variable_zero.out, 52_variable_empty.out):
  unset, "set to 0" and empty, as on the host. An empty value reads as not set
  (config.py, _runs_retention_days).
- The wrapper the probe ran is the tree's, and the package it was built from equals the
  tree's (03_probe_sources.out is a bare list of digests).
- The probe image is removed (90_remove_probe.out); no container remains
  (91_containers_after.out), and openultrasast:dev alone is left (92_images_after.out).

Tests. RED: an archive of HEAD (src, ops, tests, pyproject.toml) with the new test, the
package imported from the archive and the wrapper HEAD's (s10_c8_red2.out: 1 failed,
6 passed, at "ValueError: 'OPENULTRASAST_RUNS_RETENTION_DAYS' is not in list").
GREEN on the final tree: 78 passed over tests/test_shell_wrapper.py,
tests/test_run_pruning.py, tests/test_task_images.py, tests/test_docs_site.py and
tests/test_removed_plane_references.py (s10_c8_green4.out; the command is not in the
file). Mutants, the tree with one line changed, run on the two wrapper and pruning
test files (the copies are /tmp/opencode/s10_c8_mutB and s10_c8_mutD):
- WRAPPER_RUNS_MOUNT = "/reports2" fails the guard and the first test of 312c09b
  (s10_c8_mutB2.out: 2 failed, 41 passed);
- the wrapper's word changed to OPENULTRASAST_RUNS_DIR=/reports2 fails the guard and
  the wrapper test of d1f61fb (s10_c8_mutD2.out: 2 failed, 41 passed).
Two earlier GREEN runs failed on the guard as it was (s10_c8_green.out,
s10_c8_green2.out): that is the change to tests/test_run_pruning.py.

Checks on the final tree: ruff format, ruff check, mypy, compileall and the three gates
pass, and the gates print what they printed before the change (s10_c8b_exits.txt);
bash -n on ops/shell/ousast.sh exits 0.

- Review: two rounds by a reviewer subagent, reading and re-running, no docker. Round one
  approved the four files and conditioned the commit on the message: "Network off, no
  key" was unsupported, since compose reads the checkout's .env, which names both keys,
  and the review line was a placeholder. Round two checked the tree after the optional
  remarks were taken (the guard takes the word exactly; the shell command is on two
  lines) and found the code right: GREEN 78 passed again, both mutants 2 failed and 41
  passed, the probe's second run read as stated. One condition remained: the stamps at
  line 39, 18:54:48Z to 18:54:58Z.

By reading, not measured.
- ops/shell/ousast.ps1: no PowerShell is installed here.
- No page says what the wrapper passes into the image, so none needed a change:
  README.md and docs/examples.md say that OPENULTRASAST_RUNS_RETENTION_DAYS sets the
  days and that 0 keeps every run, and through the wrapper that is now true.
- A value the host sets that is not a whole number of days now stops the scan in the
  image with the message a native scan gives (config.py, _runs_retention_days); before
  it did not reach the image.

Not checked: the whole test suite; Windows and ops/shell/ousast.ps1; whether the keys
of the checkout's .env reached the probe's containers.
2026-11-27 19:59:50 +01:00
Marius Ciepluch 312c09bdbf fix(scan): a scan in the image prunes the wrapper's runs directory too (item 5b)
The maintainer's answer 7 of 2026-11-27 (the ninth session's menu). The label is in
.kiro/specs/contributor-scan/spec.json (80abac5). The record, .kiro/handover.md:1335-1337
(not tracked), in full:

    7. The wrapper's runs are never pruned by a scan in the image. Answer: "Image scan
    prunes too": a scan in the image prunes its runs directory when the wrapper's
    override is set; a change in the scan path, a test first. Not chosen: "Document:
    never pruned" (the session's recommendation); "Queue in step 8"; "Leave it".

The option as offered (handover.md:1435-1436): "the scan path prunes its runs
directory when the wrapper's override is set; a code change, a test first."

A second decision, taken on this change. The reviewer found that the wrapper passes no
OPENULTRASAST_RUNS_RETENTION_DAYS into the image, so with this change alone a scan
through the wrapper would remove runs older than 30 days from
~/.cache/openultrasast/runs, native runs included, even for a user who keeps every run
natively with 0. Asked, the maintainer chose "Pass it through (Recommended)": the
wrappers pass OPENULTRASAST_RUNS_RETENTION_DAYS into the container, one more -e in
ops/shell/ousast.sh and ops/shell/ousast.ps1, a test first. That is the next commit.
This one is the scan path alone, as answer 7 says. The wrapper builds its image only
when it is missing (ops/shell/ousast.sh:64-67), so until the image is rebuilt the
wrapper's scans run the code shipped in it and remove nothing (measured below).

The fault. The shell wrapper mounts ~/.cache/openultrasast/runs at /reports and passes
-e OPENULTRASAST_RUNS_DIR=/reports (d1f61fb). prune_scan_runs returned nothing whenever
OPENULTRASAST_RUNS_DIR was set, so a scan in the image never removed an expired run:
the wrapper's runs were removed only by a later native scan on the default location.

What changed.
- src/openultrasast/config.py: WRAPPER_RUNS_MOUNT = "/reports" and
  runs_dir_is_the_wrappers(), true when OPENULTRASAST_RUNS_DIR is that path.
- src/openultrasast/run.py: prune_scan_runs prunes config.runs_dir when the override
  is unset (as before) or is the wrapper's. Any other override still removes nothing.
- README.md, docs/examples.md and .agents/skills/openultrasast-scan/SKILL.md said that
  nothing is removed from a location chosen with OPENULTRASAST_RUNS_DIR; each says now
  that the shell wrapper is the one exception. The decision says "a change in the scan
  path"; these three sentences state the rule the change alters, and would be false
  without them.
- tests/test_run_pruning.py: its module docstring, and three tests (below).

The session's readings of the decision, to be confirmed by the maintainer.
1. "The wrapper's override" is recognised by its value. Both wrappers pass exactly
   /reports (ops/shell/ousast.sh:91, ops/shell/ousast.ps1:50), and nothing in the
   container's environment tells the wrapper's run from a compose run started by hand.
   Two consequences, by reading: a native scan with OPENULTRASAST_RUNS_DIR=/reports is
   pruned as well; and a compose run started by hand with the same -e and the default
   ./reports mounted prunes run-shaped directories older than 30 days under the
   checkout's reports/ (docker-compose.yml:33-34).
2. The compose file's own value, /reports/runs (docker-compose.yml:47), is a chosen
   location and is not pruned: there ./reports on the host is mounted, which may hold
   more than runs.

This amends the run retention decided on 2026-11-24 (spec.json, approval_history entry
six: "after each scan, with no OPENULTRASAST_RUNS_DIR set, runs in the default location
older than 30 days are removed"): the wrapper's mount is pruned as well.

Measured, in an image. The script is /tmp/opencode/s10_c7_probe.sh and its files are
under /tmp/opencode/s10_c7_probe/, one per measurement; the files of the four scans
and of the listings after them start with the command they ran. The four scans' stamps
run from 17:57:27Z to 17:57:32Z; the listings carry none. The probe image is
openultrasast:dev (3f959b31f2f2, uid 1000) with the working tree's package copied
over it: 295 files, equal to the tree by
sha256 (03_probe_sources.out is a bare list of digests; the comparison is
/tmp/opencode/s10_c7_sources_cmp.out, which starts with its command). Every runs
directory is a scratch directory mounted at /reports; the real ~/.cache/openultrasast/
runs was not mounted. Network off, no key. The subject is a fresh copy of the four C
files and their README (04_subject.out). Each scratch runs directory held a run of 40
days ago, a run of 5 days ago and a directory called notes.
- With the wrapper's override, on the probe image (10_wrapper_override.out): exit 0,
  file_targets=4, findings=4, and the line
  "notice: removed 1 run older than 30 days from /reports". The expired run is gone;
  the run of 5 days ago, the new run and notes remain (11_wrapper_override_after.out).
- With the compose file's /reports/runs (20_compose_override.out,
  21_compose_override_after.out): no notice, all three entries remain.
- With the wrapper's override on the shipped image (30_shipped_image.out,
  31_shipped_image_after.out): no notice, all three remain: the fault as shipped.
- With the wrapper's override and OPENULTRASAST_RUNS_RETENTION_DAYS=0 passed into the
  container (40_retention_zero.out, 41_retention_zero_after.out): no notice, all three
  remain.
- The probe image is removed (90_remove_probe.out); no container remains
  (91_containers_after.out).
The wrapper itself was not run.

Tests (tests/test_run_pruning.py).
- test_a_scan_through_the_wrapper_removes_the_expired_runs_from_the_mounted_runs_directory
  calls prune_scan_runs, as cli.py:720 does, with OPENULTRASAST_RUNS_DIR=/reports and
  a runs directory that stands in for /reports, which only root can make on the host.
  It expects one notice, and the run of 5 days ago and the current run to remain.
- test_a_scan_that_compose_runs_without_the_wrapper_removes_nothing: /reports/runs
  removes nothing and says nothing.
- test_the_wrapper_passes_the_override_that_a_scan_prunes: the shell wrapper's command
  holds "-e OPENULTRASAST_RUNS_DIR=" + WRAPPER_RUNS_MOUNT, so its word and the scan's
  mount point cannot drift apart. Nothing reads the PowerShell wrapper's.
RED. An archive of HEAD (src, tests, pyproject.toml) with the first test as written,
the package imported from the archive (s10_c7_red_where.out): 1 failed, 1 passed; the
passed one was a throwaway test that printed where the package came from and was
removed after. The failure is at
"assert () == ('removed 1 run older than 30 days from .../reports',)"
(s10_c7_red.out). The command, run from the archive's directory, where the throwaway
test was tests/test_zz_where.py:
env -u OPENROUTER_API_KEY -u DEEPSEEK_API_KEY PYTHONPATH=/tmp/opencode/s10_c7_head/src
/home/mc/Source/OpenUltraSAST/.venv/bin/python -m pytest -q -p no:cacheprovider
tests/test_run_pruning.py tests/test_zz_where.py -k "where or through_the_wrapper"
GREEN: 250 passed on the final tree (s10_c7_green4.out; the command is not
in the file) over
tests/test_run_pruning.py tests/test_scan_output_location.py tests/test_config.py
tests/test_run.py tests/test_mcp.py tests/test_agent_skills.py
tests/test_shell_wrapper.py tests/test_task_images.py tests/test_benchmark.py
tests/test_benchmark_artifact_contract.py tests/test_model_scope.py
tests/test_pair_harvest.py.
Mutants, to show the two guards bite: the tree's sources with one line changed and the
final test file (the copies are /tmp/opencode/s10_c7_mutA, mutB, mutC).
- the predicate "_runs_dir_override().startswith(WRAPPER_RUNS_MOUNT)" fails the
  compose test alone (s10_c7_mutA2.out: 1 failed, 36 passed);
- WRAPPER_RUNS_MOUNT = "/reports2" fails the wrapper test and the first test
  (s10_c7_mutB2.out: 2 failed, 35 passed);
- HEAD's condition, "if runs_dir_is_overridden():", fails the first test alone, at the
  assertion above (s10_c7_mutC2.out: 1 failed, 36 passed).

Checks on the final tree. mkdocs build --strict exits 0 (s10_c7_mkdocs2.out; its
examples page is byte-identical to the first build's); ruff format, ruff check, mypy,
compileall and the three gates pass, and the gates print what they printed before the
change (s10_c7d_exits.txt). Three files date from before the test module's docstring
was edited, on documentation unchanged since: the first build's examples page holds
each of the three added phrases once and the old wording zero times
(s10_c7_site_sentence.out), and tests/test_docs_site.py with
tests/test_removed_plane_references.py gave 8 passed (s10_c7_docs_tests.out). An
earlier gates run found an unused name in the first test (s10_c7_ruff_check.out); it
is removed.

- Review: two rounds by a reviewer subagent, reading and re-running, no docker. Round one
  found the code right for answer 7 (RED reproduced on an archive of HEAD, 250 passed over
  the 12 files, the three mutants failing as stated) and conditioned the commit on a
  decision: the wrapper passed no retention variable into the image, so this change alone
  broke "0 keeps every run" on the wrapper path. Asked, the maintainer chose "Pass it
  through (Recommended)"; the wrapper's commit follows at once, before other work and any
  push. Round two found the delta to be the test module's docstring; re-ran the 12 files
  (250 passed), the docs tests, ruff, mypy, mkdocs and the three mutants; checked the
  round-two evidence against the test file's last change and every sentence of this
  message, and had two false sentences corrected: the spec.json path and the RED command.

By reading, not measured.
- cli.py:720 passes the config whose runs_dir is /reports in the image (config.py,
  _runs_dir), so the scan in the image prunes that directory.
- ops/shell/ousast.ps1:50 passes the same override; PowerShell is not installed here.
- A failed removal still costs the scan nothing: prune_scan_runs catches OSError and
  RecursionError, and tests/test_run_pruning.py has two scans whose removal fails.
- `ousast benchmark` in the image goes through the same line (cli.py:1123, then
  cli.py:720) and prunes once per benchmark scan. That is answer 7's rule.

Found and not fixed, for the maintainer.
- The notice names the path the scan sees, /reports, not the host's
  ~/.cache/openultrasast/runs.

Not checked: the whole test suite; the wrapper and a compose run (the image was run
with docker run on scratch mounts); a removal that fails inside the container; Windows
and ops/shell/ousast.ps1; a native scan with OPENULTRASAST_RUNS_DIR=/reports.
2026-11-27 19:36:15 +01:00
Marius Ciepluch d9205fd267 docs(ops): say where ousast pairs and ousast repos find their defaults (item 5b)
The maintainer's answer 6 of 2026-11-27, "Document: run from checkout"
(.kiro/handover.md:1333-1334): "one sentence in ops/README.md; no code changes." In
the handover's options for that question (:1422-1430): "run them from the checkout
root, as every page shows."

What changed
- ops/README.md, at the end of "Use it as a command", after the paragraph on the
  native route (lines 40-42): "With their defaults, `ousast pairs` and `ousast repos`
  need the root of the checkout as the working directory, which under the wrapper means
  a native run: `benchmarks/pairs/catalog.toml` and `benchmarks/repos` are read from
  the current directory."
- No code change, no test change.

The session's reading of the answer
- The sentence names the native run, which the answer's sentence does not. Measured
  below, the checkout root does not help through the wrapper's container path: the
  container's working directory is /work (docker-compose.yml:37), never the checkout.
  The image holds a copy of both defaults in /app, so the need is the wrapper's, not
  Docker's; the sentence says so.
- The sentence does not repeat "as every page shows". The pages show the two commands
  (docs/examples.md:66-70, README.md:331, benchmarks/pairs/README.md:126-128,
  benchmarks/repos/README.md:16-18); by reading, none of these four places says in
  which directory they are run. So the sentence gives the reason instead.

Measured (/tmp/opencode/s10_c6_probe.sh, output s10_c6_probe.out, 17:32:07Z to
17:32:13Z; each run file starts with its command, the wrapper files with a one-line
description of the call)
- From an empty directory, the CLI directly and natively: `pairs` ends with "pair
  catalog is not a file: benchmarks/pairs/catalog.toml", exit 1
  (s10_c6_native_elsewhere_pairs.out); `repos` with "no repository recipe matches
  'all' in benchmarks/repos", exit 1 (s10_c6_native_elsewhere_repos.out).
- The same two through the wrapper's native path, with stubs of joern and joern-parse
  ahead on PATH, never called (s10_c6_wrapper_native_elsewhere_pairs.out,
  s10_c6_wrapper_native_elsewhere_repos.out).
- From the checkout root, natively: `repos` lists seven recipes, exit 0
  (s10_c6_native_root_repos.out). `pairs --slice sast --json` ends with exit 0 and
  18,013 bytes of JSON, with per_slice.sast.pairs 11 and achievable.sast.pairs 10
  (one known limit, src/openultrasast/pairs.py:467), and without the lookup's message
  (s10_c6_native_root_pairs.out for the exit and the message;
  s10_c6_native_root_pairs_full.out for the bytes and the two counts). joern was not
  on PATH for that run; what scored the pairs was not examined.
- From the checkout root, through the wrapper's container path (OUSAST_PREFER_NATIVE=0;
  the image openultrasast:dev 3f959b31f2f2): both end with the same two messages, exit
  1 (s10_c6_wrapper_container_root_pairs.out,
  s10_c6_wrapper_container_root_repos.out). No container remains
  (s10_c6_wrapper_container_index.out).
- A separate run at 17:40:30Z, not from the probe: in the image's own working directory
  /app (Dockerfile:38), a plain `docker run` with no mount and no network, `repos`
  lists the seven recipes, each absent in the container, exit 0
  (s10_c6_image_app_repos.out). `pairs` was not run there.

By reading, not measured
- Where the defaults come from: src/openultrasast/pairs.py:47-53 and
  src/openultrasast/repos.py:34 hold relative paths. The two stops are at
  src/openultrasast/cli.py:1156-1157 and :1178-1180.
- The image's copy: Dockerfile:44 copies benchmarks, and .dockerignore excludes
  nothing of benchmarks/pairs or benchmarks/repos.

Checks, on the final text
- `mkdocs build --strict` into scratch: exit 0 (s10_c6b_mkdocs.out); the built page
  holds a phrase from each of the sentence's three lines once, and the first wording
  zero times (s10_c6c_site_sentence.out).
- tests/test_docs_site.py and tests/test_removed_plane_references.py: 8 passed
  (s10_c6b_docs_tests.out).
- Gates (s10_c6b_exits.txt): ten zeros; the three gate outputs equal the baseline's.

Found and not fixed, for the maintainer
- `ousast model candidates` has the same default for its catalog
  (src/openultrasast/cli.py:262), and `ousast plane harvest` for its own (:324). The
  sentence names the two commands of the answer. Neither was run.
- The pages that show the two commands do not say where they are run from (above). The
  answer puts one sentence in ops/README.md.
- Through the wrapper's container path the two commands cannot reach their defaults,
  by reading from any directory. A reader with Docker alone is told that they need a
  native run, not what to do instead.

Not checked
- ops/shell/ousast.ps1 was not read for this change.
- `ousast pairs` with --catalog, and `ousast repos` with --dir, through either path.
- `ousast pairs` in the image's /app.
- The whole test suite.

Review
- Review: three rounds against d8b4cac, by one reviewer subagent. Round one blocked
  on the message alone (the sast slice holds 11 pairs, 10 of them achievable) and
  remarked that the image keeps its own copy of both defaults in /app, that the
  sentence separated the code block from the paragraph that explains it, and that
  "each file starts with its command" held for the run files alone. On those: the
  sentence moved to the end of the section and says that the need for a native run is
  the wrapper's; `repos` was measured in /app. Round two approved the diff and blocked
  on one line citation in the message (40-42). Round three left the diff approved and
  blocked on one clause, that the /app run is a separate run; it is now marked so.
  Docker was run by the session alone, never by the reviewer.
2026-11-27 18:48:37 +01:00
Marius Ciepluch d8b4cac023 fix(shell): the wrapper says so when it cannot make its runs directory (item 5b)
The maintainer's answer 4 of 2026-11-27, "Guard it" (.kiro/handover.md:1409-1413), as
offered: "a clear message when HOME is unset, and a failed mkdir stops the wrapper
with exit 1; a test first." The fault it answers, in the same words: "With HOME unset
the wrapper now fails ($HOME/.cache becomes /.cache), where it wrote ./.ousast
before; a failed mkdir is not checked, as before."

What changed
- ops/shell/ousast.sh, the container path: the wrapper returns 1 with "ousast: HOME is
  not set, so there is no ~/.cache/openultrasast/runs to write the runs to" when HOME
  is unset or empty, and with "ousast: cannot create <runs>, where the runs are
  written" when mkdir -p fails (mkdir's own line comes first).
- The two lines that set `runs` and ran mkdir -p moved up to that place, from after the
  build. The placement is the session's reading of "stops the wrapper": a cold build
  pulls ~2 GB, and a run that cannot write its runs should say so before it waits.
- The native path names no HOME and is not touched.

Tests (tests/test_shell_wrapper.py)
- test_the_container_path_stops_when_home_is_not_set: exit 1, that one line on
  stderr, nothing on stdout, so neither the build nor the container is started.
- test_a_runs_directory_that_cannot_be_made_stops_the_wrapper: a file where
  $HOME/.cache should be; exit 1, the wrapper's line last on stderr, nothing on stdout.
- The helper `ousast` takes `without_home`. The docker stub answers `image inspect`
  with exit 1, so the wrapper takes its build branch in each test that reaches the
  build (the second and the third); before that, "nothing on stdout" said nothing
  about the build.
- RED, on an archive of HEAD with the final test file (s10_c4_red5.out): 2 failed, 3
  passed, each `assert 0 == 1`. For the reason of the fault: the wrapper builds, mkdir
  is refused ("/.cache: Permission denied", run as uid 1000) or fails ("Not a
  directory"), the wrapper goes on to the container (with reports=/.cache/... when
  HOME is unset), and the exit status is 0.
- GREEN, on the working tree (s10_c4_green5.out): 5 passed.
- A mutant with the guard behind the build fails both new tests on the build's line
  (/tmp/opencode/s10_c4_mutant.py, output s10_c4_mut.out), so the tests pin the
  placement; with another shebang in STUB it fails the same way (s10_c4_nopin.out).
- Gates (s10_c4e_exits.txt): ten zeros; the three gate outputs equal the baseline's.

Measured outside the stubs (/tmp/opencode/s10_c4_probe.sh, output s10_c4_probe.out):
real bash on this machine, the native path switched off so that no probe can scan.
HOME unset, HOME empty, and bash under set -u with HOME unset each print the one line
and exit 1; a file at $HOME/.cache prints mkdir's line, then the wrapper's, exit 1.

By reading, not measured
- zsh can source the wrapper as well. The block uses `[ -z "${HOME:-}" ]`, `local`,
  `if ! mkdir -p`, `echo ... >&2` and `return 1`; zsh is not installed here, so no
  probe ran.
- A run as root with HOME unset had another shape on HEAD: mkdir -p /.cache succeeds
  there, so the runs went to the filesystem root with no error. The guard closes it
  the same way. This session's runs are as uid 1000.

Found and not fixed, for the maintainer
- The helper's second parameter is `executables`. The third test passes "scan" there
  (tests/test_shell_wrapper.py:65, HEAD:63), which makes four stubs named s, c, a and
  n beside docker's. Nothing calls them. The new tests pass an empty tuple.
- A runs directory that exists but cannot be written to passes the guard: mkdir -p
  exits 0 on it (s10_c4_readonly_runs.out), and the wrapper goes on to docker. The
  decision says "a failed mkdir".
- The container path reads $HOME/.cache alone and ignores XDG_CACHE_HOME, which the
  native path honours (src/openultrasast/config.py:198-203); README.md:189-190 and
  docs/examples.md:3-5 state the rule for every run. From before this commit.
- ops/shell/ousast.ps1:44-45 has the same shape, a New-Item whose result is not
  checked, after the build. Read, not run: pwsh is not installed.
- The wrapper's message for an unset HOME (ops/shell/ousast.sh:53) describes the
  container path, which reads $HOME alone. Without HOME, Python's Path.home() and
  bash's `~` still give /home/mc on this machine (s10_c4_pathhome.out), and a native
  scan's default runs directory comes from the former unless XDG_CACHE_HOME is set to
  an absolute path (src/openultrasast/config.py:198-203 and :216-226). As decided.

Review
- Review: four rounds against 7396887, all by one reviewer subagent. Round one
  approved the change with seven remarks; six were carried into the test file and
  this message, and the seventh is the last bullet above. A probe of the reviewer
  started one container by mistake, against the brief: it failed at creating its run
  directory, and nothing of it remains (/tmp/opencode/s10_c4_after_review_docker.out).
  Round two approved the code and the tests on one condition, met in this message
  ("in every test" became "in each test that reaches the build"), and remarked that
  the docker stub's shebang was its second line. Round three approved the tree as it
  stood and remarked that the stub's inserted line depended on the shebang's text.
  Round four approved the final tree. Docker was not run in rounds two to four.
2026-11-27 18:24:11 +01:00
Marius Ciepluch 739688730f fix(push): the background child is started with -P, as the wrapper is (item 5b)
The maintainer's answer of 2026-11-27 to question 3 of the ninth session's menu, "Add -P there
too", as offered: one line, a test first, a reviewer.

src/openultrasast/push/background.py starts the detached replay of `ousast pre-push --engine
background` with the interpreter, -m and openultrasast.cli, from the pushed repository. With -m
alone the working directory is first on the interpreter's path, so a file of the pushed repository
could stand in for a module the CLI imports. The wrapper's native path had the same fault and was
fixed with -P in a6e8e26; the reviewer of that commit found this one and it was left alone.

The child is now started with -P, which keeps that directory off the path. The flag needs Python
3.11, the project's floor (pyproject.toml).

Measured by the new test, with a real child process: tests/test_push_background.py puts a json.py
that exits into the pushed repository and starts the child. On a git archive of HEAD the child's
log is "SHADOW-EXECUTED" and its artifact is never written (s10_c3_red2.out). With the change the
artifact is written and the log does not hold that line, on this host's default PATH, where Joern is
not found (the child ends in about 1 s), and with Joern 4.0.625 and its JavaScript
frontend on PATH, where the child uses its whole deadline (s10_c3_green2.out, s10_c3_green3.out).
The five push test files give 106 passed. ruff, mypy, the three gates and compileall pass, and the
gates print what they printed before (s10_c3b_exits.txt). `git diff --check` exits 0. No
whole-suite run: that is step 9.

An independent reviewer blocked the first round on the test: its wait equalled the child's
deadline, so it was red on a host where the engine can build a JavaScript graph (1 failed,
4 passed). The child's deadline is now 5 s. The second round approved the final diff.

Found and not fixed, for the maintainer:
- The container path has the fault too, by one probe. docker-compose.yml:37 sets the working
  directory to /work, and the wrapper's own comment (ops/shell/ousast.sh:13-16 and :34-35) says
  the container runs in the caller's directory. On the local openultrasast:dev image
  3f959b31f2f2, network none, a tree that holds such a json.py mounted at /work: the image's own
  entrypoint (Dockerfile:46, python -m openultrasast.cli) prints SHADOW-EXECUTED for --help and
  exits 1; the same tree with -P prints the usage (s10_c3_container_probe.out). The wrapper and
  compose were not run, and the published image was not probed.
- ops/ax/smoke-run.sh:9 and :12, ops/ax/up.sh:14 and ops/ax/probe-placement.sh:16 run this
  checkout's code with -m and without -P, in the caller's directory (by reading): the CLI at
  smoke-run.sh:12, openultrasast.plane.profile at the other three.
- src/openultrasast/plane/runner.py:678 starts a task's module with -m from the task's first
  workspace (by reading). Whether a file of that workspace can stand in for a module the task
  imports was not measured.
- The two launches in src/openultrasast/search/demo.py use -I, which keeps the directory off the
  path.
2026-11-27 17:49:08 +01:00
Marius Ciepluch f6b1406541 fix(model): a failed judge call is recorded and ends the asking (item 5b)
The maintainer's answer of 2026-11-27 to question 2 of the ninth session's menu, "Record and stop
asking", as offered: "a failed judge call adds a degradation to the manifest, with the count; the
report says those questions went unasked; after one transport failure the remaining questions are
not asked." Measured by the ninth session: with a key in the environment and no network, 16 judge
calls failed in one scan of a four-file subject, three attempts each, and each dropped its claim
as a "no" would (model/pipeline.py); the manifest counted model_calls 16 and recorded no failure,
and the report said less than that of a run without an endpoint.

What changed:
- model/scan.py, `_CountingClient`: a call that raises is counted in `failed` and ends the asking.
  The calls left in the question being put are refused without reaching the client (`refused`),
  and the driver withholds the judge from every question after it, as it does when the budget runs
  out. An answer with no decision in it (empty, not JSON, no boolean `vulnerable`) is counted in
  `failed` as well and does not end the asking. The graph still arbitrates every region.
- Two degradations, each with a sentence under "What could not be analysed" (reports.py) and a
  line in the scan skill's list:
  - `judge_calls_failed`, `count`: the judge calls that gave no decision.
  - `judge_withheld`, `questions`: the judge calls refused after the failure in the question
    being put. Of the questions after it the report says that none was put to the judge; they are
    not counted, because some of them would have put nothing to the judge.
- model/pipeline.py: the parsing half of `_ask` is moved as it was into `judge_decision`, so the
  driver reads a decision the way `_ask` does. `_ask` returns what it returned.
- The claim of every such question is still dropped, as before: "Keep the claim" was not chosen.

The session's two readings of the decision, open to correction:
- A transport failure is read as a judge call that raised, whatever the exception. The transport
  has already made its three attempts for what is transient (provider/openrouter.py), so one
  raised call ends the asking for the whole scan. That holds for a connection failure and for a
  timeout, and also for a request the endpoint refuses with an error status, where the transport
  makes one attempt: there the scan withholds every later question, where before it dropped that
  claim alone and went on. The judge_withheld line says so in the report.
- A failed judge call is read as a call that raised or a call whose answer gave no decision. Both
  are counted.

Measured on fresh copies of the four C files the ninth session used, with a placeholder key and
the network off (the scratch is /tmp/opencode/s10_c2_* and is not kept):
- Native, in a network namespace without routes: one "judge call failed" line, file_targets=4,
  findings=15, exit 0, 45 s (s10_c2_native_key3.out). The ninth session's run of the same bytes:
  16 lines, 68 s.
- In a probe image built from openultrasast:dev 3f959b31f2f2 with src copied over, network none:
  one line, file_targets=4, findings=15, exit 0, 43 s (s10_c2_image_key3.out). The ninth
  session's run: 16 lines, 65 s. The probe image is removed.
- Both manifests: model_calls 1, judge_calls_failed with count 1, judge_withheld with questions
  7; report.md carries the two sentences (s10_c2_native_inspect3.out, s10_c2_image_inspect3.out).
  The findings are the 15 the ninth session recorded with a key and without one.

Tests, one at a time, each red before its code:
- test_a_judge_that_cannot_be_reached_is_recorded_and_asked_no_further: on a git archive of
  HEAD, assert 120 == 1; after, one call, model_calls 1, ten regions arbitrated, the two
  degradations with count 1 and questions 5.
- test_a_judge_answer_with_no_decision_in_it_is_counted_and_the_rest_are_still_asked: red with
  no degradation; after, count 120 and no judge_withheld.
- test_a_failed_judge_call_is_reported_as_unasked_and_not_as_a_no: red with the two bare
  reasons; after, the two sentences. The three red runs, with the package imported from the
  archive, are in s10_c2_red8.out: 3 failed, 1 passed.
- GREEN: 657 passed over the 39 test files that name degradations, scan_repository, model_calls
  or write_markdown_report (s10_c2_green9.out); 214 passed over ten model, report and skill files
  (s10_c2_green8.out). ruff, mypy, the three gates and compileall pass, and the gates print what
  they printed before (s10_c2c_exits.txt). `git diff --check` exits 0. No whole-suite run: that is
  step 9.
- The review took three rounds on one reviewer. Round one approved a first shape that counted the
  withheld regions, and remarked that a region with several families was counted as withheld while
  its first family had been put to the judge; its other remarks changed the second sentence,
  `__all__` and a docstring. Round two blocked the sum that replaced that count: it added judge
  calls to region-and-family questions under one name. The count is of judge calls now. Round
  three approved this diff, on the condition that this message carry the measured numbers.

By reading, not measured: a pre-push run makes no judge call (push/runner.py and push/policy.py
pass no client and an execution budget), so the two reasons cannot arise there.

Found and not fixed, for the maintainer:
- .agents/skills/openultrasast-scan/SKILL.md:68-70 and docs/where-we-stand.md:349-350 say that
  `learning_endpoint_unavailable` has no line in report.md. It has had one since f555dee
  (2026-10-02).
- The citations of scan.py in docs/detection-techniques.md: of 24, 19 sit one, two or seven lines
  further down after this commit (5 do not move, 9 move by one line, 1 by two, 9 by seven).
2026-11-27 17:06:25 +01:00
Marius Ciepluch 55583b34c3 fix(images): the replay entry leaves benchmarks/unseen, so the replay stage builds (item 5b)
The maintainer's answer of 2026-11-27 to question 1 of the ninth session's menu, "Move the
file, fix now": the script leaves benchmarks/unseen for a path the build context keeps, and
the four references follow. .dockerignore:32 has excluded benchmarks/unseen since 9017038
(2026-11-24), so the COPY of the replay stage of plane/Dockerfile.engine-task stopped the
build. Measured again here from the root context, with scratch Dockerfiles: a COPY of the old
path fails with "not found", a COPY of a kept path succeeds, and after the change a COPY of
the new path succeeds.

What changed:
- benchmarks/unseen/replay_entry.py is benchmarks/replay/replay_entry.py (git mv, the
  content unchanged). The directory is the session's choice; no decision names it. The
  script's own line 18 looks for learn/ beside its own directory (parents[1] / "learn"), so a
  sibling of benchmarks/learn keeps that line as it is. Measured in a probe image: with the
  file directly under benchmarks/, the import of engine_task_entry fails at line 19.
- plane/Dockerfile.engine-task:47 copies the new path to ./benchmarks/replay/. The command
  of benchmarks/unseen/replay.py:46 names /app/benchmarks/replay/replay_entry.py. The two
  tests import benchmarks.replay.replay_entry.
- tests/test_task_images.py gains test_copy_sources_are_kept_by_the_build_context, over the
  four Dockerfiles that build from the root context: a COPY source that the root .dockerignore
  excludes stops the build.

Evidence:
- RED: the new test on a git archive of HEAD plus the new test file, 1 failed and 3 passed
  (the engine-task Dockerfile copies benchmarks/unseen/replay_entry.py); the first version of
  the helper gave the same on the working tree before the move.
- GREEN: 458 passed over tests/test_task_images.py, tests/test_unseen_*.py,
  tests/test_independent_population.py and tests/test_search_image.py after the move, and
  tests/test_task_images.py again, 27 passed, after the helper was hardened.
- ruff, mypy, the three gates and compileall pass, and the gates print what they printed
  before. `git diff --check` exits 0. No whole-suite run: that is step 9.
- An independent reviewer approved the change in one round. Its optional hardening of the
  helper is applied after the approval, as proposed: a line of .dockerignore is now matched
  against the path and each directory above it, where the first version took a line without a
  wildcard by prefix only. Two shapes stay as the reviewer found them: a line written with a
  leading ./ or /, and a `!` line with a wildcard are not read as Docker reads them.
- The scratch is under /tmp/opencode/s10_* and is not kept.

Side effect, by reading: the root Dockerfile copies the whole benchmarks directory
(Dockerfile:44), so the next scan image carries benchmarks/replay/replay_entry.py, where the
file was excluded with its directory. No image is rebuilt.

Found and not fixed, for the maintainer: after this commit the replay job of
engine-image.yml builds again, and the image it publishes cannot start its entry. In an
image built from plane/Dockerfile.engine-task the import at benchmarks/learn/
engine_task_entry.py:17 (from benchmarks.valid.artifact_contract, from 11059c4c of
2026-11-03) has nothing to resolve. By reading: the engine stage copies pyproject.toml,
README.md, LICENSE, src and three named files of benchmarks/learn, and the replay stage adds
one file, so neither image holds benchmarks/valid. Measured on the shipped scan image
openultrasast:dev 3f959b31f2f2 (built from 88ea171, before this change) with the network
off; the engine image and the replay image were not built or run here, and the runner's
environment was not read: `python3 /app/benchmarks/learn/engine_task_entry.py`, the way
benchmarks/learn/engine_trace_ax.py:38 launches the engine workload, stops at line 17 with
"No module named 'benchmarks'"; with /app on the path it stops with "No module named
'benchmarks.valid'", because 9017038 keeps benchmarks/valid out of every image; and the
replay actor's command in a probe image built from the scan image stops at
replay_entry.py:19 and then at that line. So a green replay job is not a working replay. The
fix is a decision: carry artifact_contract.py in the two stages, move
write_benchmark_artifact out of benchmarks/valid, or make the import lazy. It is not made
here; the fault is outside the answer.

Left as they are: .kiro/steering/roadmap.md:289 and
.kiro/specs/engine-change-scoped-analysis/brief.md:36 name the old path in the image
(steering is the maintainer's; both are reported); the contributor-scan record,
benchmarks/measurements/2026-10-04-unseen-06-scorer/record.json:8 and a PATHFINDER document
are dated records. No test reads the command path of replay.py:46 against the COPY's
destination; they agree by reading.
2026-11-27 16:00:32 +01:00
Marius Ciepluch 80abac5fd1 spec(contributor-scan): record the thirteen answers of 2026-11-27 (item 5b)
A record of maintainer decisions, in the form of 23c5383. In
.kiro/specs/contributor-scan/spec.json, updated_at moves to 2026-11-27T14:15:26Z and
approval_history gains one entry with the maintainer's thirteen answers of 2026-11-27 to
the ninth session's menu, each with the label chosen and what it means as offered. Until
now they were recorded only in .kiro/handover.md, which is not tracked. The work they
choose is item 5b of the queue, before step 9; this commit is its first piece.

The entry also records what started the work. On 2026-11-27 the maintainer wrote
"proceed". Asked with the question tool what it names (the options: item 5b only, step 9,
step 6), the maintainer answered in free text "1-13". The session's reading, labelled as
such in the entry and open to correction: the work of item 5b in full, a record commit
first and then the menu's questions 1 to 13 in the order of the questions; question 13 is
the order of work, not a word for step 9. The session told the maintainer that reading
and that step 9 would be asked for; the maintainer had not answered by the time of this
record. Nothing is decided here beyond the maintainer's words.

Limits of what is on record:
- The options not chosen are not repeated in the entry; the handover holds them.
- In the handover the section that copies the menu ("Open items of the ninth session")
  restates the chosen label of answers 2, 6, 7, 10, 12 and 13 and some options not chosen,
  against its own sentence that it keeps them as offered. The entry quotes the labels of
  the decisions section, which a reviewer checked against the stored question call: they
  are the labels offered and returned. The handover is not tracked and is not changed
  here.

spec.json parses, with its keys in order and its earlier seven entries equal to HEAD's;
outside updated_at and the new entry the file is byte-identical to HEAD (one line
replaced, five added). The added lines are ASCII and `git diff --check` exits 0. ruff,
mypy, the three gates and compileall pass, and the gates print what they printed before.
No test reads a spec, by a grep of tests/. An independent reviewer approved the change in
one round; its optional rewordings are applied after the approval, as proposed (items 3
and 11 carry the meaning as offered; the pointer names the handover's decisions section;
the answer "1-13" is said to be free text; the entry says the maintainer had not answered
the reading).
2026-11-27 15:31:17 +01:00
Marius Ciepluch 23c5383701 spec(contributor-scan): record item 5a under 3.2, and what is left open (item 5a)
The record of the ninth session (2026-11-26 and 2026-11-27), in the form of ea8d3d2. Four
dated notes close task 3.2's list, at .kiro/specs/contributor-scan/tasks.md:538-660:
- item 5a: the eight commits, each with the menu item of 2026-11-26 it answers, in the
  order of the commits, and the two decisions of the maintainer on 2026-11-27;
- the judge calls with the network off, assessed on menu item 5: nothing fixed;
- the release job's tests of run 42229293910, assessed on menu item 9: nothing fixed;
- sixteen points left for the maintainer: reported, not fixed.

Nothing is decided here. "Proceed", read as the work of item 5a only, is the session's
reading. The first assessment rests on five runs (natively with the network off, without
a key and with a placeholder key; in the image with the placeholder; and the eighth
session's two image runs) and on the code by reading: a failed judge call drops the claim
as a "no" does, nothing in the manifest or the run directory says so, and such a report
says less than one without an endpoint. The second rests on `gh run view` logs: twelve
tests failed in the release job; they pass at 7e26f5f on this machine; ten of them still
failed on the runner at origin/main. In the log of the d26fbcb checks job the list of
failed tests is taken from the outer run's eleven failure lines; a nested pytest run of 45
failures inside one test's message is not counted.

In .kiro/specs/contributor-scan/spec.json, updated_at moves to 2026-11-27T10:49:05Z and
approval_history gains one entry with the maintainer's thirteen answers of 2026-11-26 and
two decisions of 2026-11-27. Until now the thirteen answers were recorded only in
.kiro/handover.md, which is not tracked. The two decisions of 2026-11-27 (the mount with
the override OPENULTRASAST_RUNS_DIR=/reports; the PowerShell wrapper changed, untested)
changed the shape answer 4 was offered in, and were otherwise recorded only in d1f61fb's
message. 4ef1394, 11733bf and ab2f55d did the same for earlier decisions; ea8d3d2 and
7e26f5f recorded no decision and touched tasks.md only.

Limits of what is on record:
- The two option labels, "Mount and override" and "Change it, untested here", are quoted
  from the session's question to the maintainer; they are in the handover, in no tracked
  file.
- The removal of the two images and the deletion of the regress directory rest on the
  handover and one output file; git holds no trace of either.
- The mount-alone run's output was overwritten; the claim also follows by reading, since
  docker-compose.yml sets OPENULTRASAST_RUNS_DIR to /reports/runs.
- "Natively" for an empty directory is the eighth session's word: its output on file is
  the image run.
- 68 against 44 and 65 against 40 are whole-command times.
- The reviewer rounds are from the commit messages; libpng at cf53e54 rests on the eighth
  session's record; the scratch under /tmp/opencode/s9_* is not kept.

spec.json parses, with its keys in order and its earlier six entries equal to HEAD's.
Everything outside lines 538-660 of the spec is byte-identical to HEAD. The added lines
are ASCII and `git diff --check` exits 0. ruff, mypy, the three gates and compileall
pass, and the gates print what they printed before. No test reads a spec, by grep. An
independent reviewer approved the change in two rounds: its first round found the
commit list numbered with the session's own item numbers and presented as the menu's,
and that is corrected; its four optional rewordings of the second round are applied
after the approval, as proposed.
2026-11-27 12:13:37 +01:00
Marius Ciepluch 9a8e0038b0 spec(plane-on-kubernetes): 4.4 is on kube-ax, a dated note (item 5a)
The maintainer's decision of 2026-11-26 on the eighth session's menu (item 13), as it
was offered: "plane-on-kubernetes tasks.md:191 says '4.4 Kind proof and record' while
roadmap.md:318 places 4.4 on kube-ax: a dated note or a reworded line." Answer: "4.4
line to kube-ax". The form was offered both ways and left to this session, which says
before this commit that it takes a dated note. A reworded line is not taken: the header
of the spec keeps the text of groups 3 to 8 as written, and this file records change by
dated text (the header note and the last section, both of 2026-11-24).

Two files. In .kiro/specs/plane-on-kubernetes/tasks.md, nine lines are the last
sub-bullet of task 4.4; the line of 4.4 and its bullets are untouched and the checkbox
stays open. In .kiro/specs/plane-on-kubernetes/spec.json, updated_at moves from
2026-11-24T13:58:17Z to 2026-11-27T10:39:48Z: d45fc98, this spec's last dated note, did
the same, and the spec skills say to update the timestamp. No code changes.

The note records that the roadmap counts 4.4 among "the open spec tasks that gate G1"
and describes it as the engine smoke on kube-ax, leading to record 04. It decides
nothing. Three points are named as open: what the proof is on kube-ax, since the
roadmap calls 4.4 the engine smoke and the task's bullets prove the GHCR images; how a
task of a group to re-plan under G4 gates G1, in a section of the roadmap whose ordering
the sections above it supersede (roadmap.md:5, the ladder of 2026-11-20, and :162; :115
and :150 say the same for detection work and detection claims); and the marker
"(coordinator, network)", which the roadmap says 4.4 and 5.4 carry and neither task's
line in the spec has. The roadmap, which is steering, is not touched.

The decision and its options are recorded in .kiro/handover.md, which is not tracked;
the note names it.

No test reads the spec, by grep: the tests that name it do so in comments and
docstrings. tests/test_obligation_siblings.py passes (4 tests) and reads no spec. ruff,
mypy, the three gates and compileall pass, and the gates print what they printed before.
An independent reviewer approved in two rounds. Its four remarks of the first round are
applied: the handover is named as the record of the decision; "the task above" became
"the bullets above"; the clause on ordering; and the marker sentence names 4.4 and 5.4
and says neither task's line carries the marker.
2026-11-27 11:44:33 +01:00
Marius Ciepluch 7e26f5fabc spec(contributor-scan): the ledger in the image is an open task on 3.1 (item 5a)
A dated note on task 3.1 of .kiro/specs/contributor-scan/tasks.md (ninth session,
2026-11-27). No code changes, and nothing is decided: the maintainer chose "Open task"
on 2026-11-26 for item 3 of the eighth session's menu ("Record it as an open task:
nothing changes now. A dated note on task 3.1 holds the measurements and the design
question (a ledger under the runs directory must be keyed by target, because its
entries name relative paths)."), and the checkbox of 3.1 stays open.

The note holds:
- what a scan does with the false-positive ledger, by reading
  src/openultrasast/cli.py and reports.py: the path under the target, the read before
  the ranking is calibrated, the write when its content would change, the degradation
  ledger_not_written on a read-only target, the report's sentence under "What could
  not be analysed", and that through the image a scan applies learnings only from a
  ledger already in the tree and can never add one (by the code, not run);
- the measurements of 2026-11-26, read again on 2026-11-27 from the run artifacts, not
  from new runs. Standard mode on contrib/examples of libpng at cf53e54, 15 findings on
  both sides, no key on either side. In the image (run 20261126T125414Z-facce3bb):
  calibrations_applied=0, project_score 26, penalty_total 80.0. Natively, a second scan
  of a copy that held the ledger an earlier native scan had written:
  calibrations_applied=2, project_score 59, penalty_total 32.0. calibrations_applied
  counts files: the native second scan applied all four learnings of that ledger, to
  two files;
- the design question, with the options not chosen.

The design question names no key for a ledger under the runs directory. The note
records two candidates that cannot serve: the path as the image shows it (every target
is /target there) and the fingerprint of the provenance stage, which classes a tree as
human, agent or mixed and hashes nothing.

The decision and its options are recorded in .kiro/handover.md, which is not tracked;
the note says so. The measurements rest on the eighth and ninth sessions' scratch under
/tmp/opencode, which is not kept; the note names the files.

tests/test_obligation_siblings.py passes (4 tests), ruff, mypy, the three gates and
compileall pass, and the gates print what they printed before. An independent reviewer
approved the change in three rounds. Its remarks are applied: the handover is named as
the record of the decision; the image figures come from the run without a key, as the
native run is; calibrations_applied is said to count files; and a clause that pointed
the design at a function that is not a key is gone. That clause came from the
reviewer's own first-round remark and was written in after checking only the call
site; the reviewer caught it in the second round.
2026-11-27 11:07:49 +01:00
Marius Ciepluch 6e4a62edd4 docs(contributor-scan): the citations in detection-techniques.md name the instruction (item 5a)
docs/detection-techniques.md pointed into Dockerfile and docker-compose.yml by line
number, and every one of those citations was off. Its three doc regions were written on
2026-10-02. Then 1b9d1ca (2026-10-05) moved the base image and php-cli out of the root
Dockerfile and into the task base (plane/Dockerfile.base), and 9d53c32 moved the Joern
build argument of docker-compose.yml from line 15 to line 16. Before this commit, lines
171 and 299 cited Dockerfile:14, Dockerfile:12 and docker-compose.yml:30-31, none of
them the instruction meant, and docker-compose.yml:15 no longer held the pin.

The maintainer's decision of 2026-11-26 (menu item 8): "Name instructions", so that the
next edit does not stale them. What the four citations name now:
- Dockerfile: the ARG JOERN_VERSION line (line 7 at HEAD).
- docker-compose.yml: the JOERN_VERSION build argument (line 16 at HEAD).
- docker-compose.yml: the comment above mem_limit (lines 49-51 at HEAD). The quotation
  is unchanged.
- The Java the engine runs on: the FROM eclipse-temurin:21-jdk-jammy AS jdk line of
  plane/Dockerfile.base (line 5 at HEAD).

Two positions are this session's, not the maintainer's decision; both are open to a
correction:
- A fifth citation of the same kind. The decision names four. The PHP row of the
  frontend table (line 158) cited Dockerfile:17-21 for the php-cli install. It was exact
  when written and went stale in 1b9d1ca with the others. It now names the apt-get
  install line of the base stage in plane/Dockerfile.base (lines 20-21 at HEAD; the file
  has a second apt-get install line, in its base-browser stage), and says the base image
  installs php-cli, since the root Dockerfile no longer does.
- A fact changed, not only a citation. The sentence said the image is on
  eclipse-temurin:21-jre-noble (Dockerfile:12). That FROM left the root Dockerfile in
  1b9d1ca, so no instruction could be named for it. The sentence now says the engine
  runs on Temurin 21, taken from eclipse-temurin:21-jdk-jammy: the jdk stage of
  plane/Dockerfile.base, copied into its base stage (line 11), which the task-base-image
  workflow publishes (target: base) and Dockerfile builds on (line 5).

Measured on 2026-11-27 in openultrasast:dev (3f959b31f2f2, built from 88ea171): Debian
13 (trixie), OpenJDK Runtime Environment Temurin-21.0.12.1+1, PHP 8.4.26 (cli), uid
1000; exit 0. No file that enters the image changed, so it was not rebuilt.

Left alone, and reported:
- .kiro/specs/plane-on-kubernetes/design.md:252 cites Dockerfile:1-7 for the argument
  against sibling services. That header left the root Dockerfile in 1b9d1ca too. It is
  a spec's design record, not a site page. By the reviewer's reading, two more are stale
  in the same spec (design.md:248 and tasks.md:180, both Dockerfile.runner:25-29).
- The citations into the Python source by line number, in the same page, are not
  touched: the decision is about the Dockerfile and compose citations.
After this commit no site page (docs/, README.md, ops/README.md) cites a Dockerfile or
a compose file by line number.

`mkdocs build --strict` exits 0, tests/test_docs_site.py and
tests/test_removed_plane_references.py pass (8 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; its remark that the root Dockerfile no longer installs
php-cli is applied.
2026-11-27 10:43:13 +01:00
Marius Ciepluch dbcbbd7f27 docs(contributor-scan): the documented build commands carry the base pin (item 5a)
Three documented build commands would have failed. README.md told the reader to build
plane/Dockerfile.engine-task with docker buildx and Dockerfile with docker build,
without TASK_BASE_TAG and TASK_BASE_DIGEST. Both Dockerfiles default the tag to
base-unpublished and give the digest no default. Measured on 2026-11-27 from a clean
copy of the tree, with the push and the published tags taken out so nothing could be
published: each failed in one to two seconds with `failed to parse stage name
"ghcr.io/norandom/ousast-task-base:base-unpublished@": invalid reference format`.

Both lines now pass the tag and the digest of `base` in plane/task-base.digest, and a
sentence after the block names the file. With those arguments the main Dockerfile
builds (exit 0 in two seconds; the image was removed afterwards). docs/scanning.md
says `docker compose build`, which pins the base and tags openultrasast:dev (the
defaults are guarded by tests/test_task_images.py), and says to run it in a checkout
of this repository.

Found while measuring, and not fixed:
- README.md's buildx line still does not run to the end on this tree. It builds the
  last stage, `replay`, and plane/Dockerfile.engine-task:47 copies
  benchmarks/unseen/replay_entry.py, which .dockerignore:32 has excluded since
  9017038 (2026-11-24). With the arguments the base resolves and the build stops at
  that COPY (`not found`). By the reviewer's reading, which was not run: of the
  Engine image workflow only its `replay` job reaches that line, so that job fails on
  the next push and on the next tag, and the `engine` job and the release image do
  not. tests/test_task_images.py forbids a negation pattern for the reserved
  populations.
- The README's copy of the pin is kept by hand and no test reads it. When the pin
  changes, both builds still succeed on the old base until that base is deleted.

The nine test files that reference README.md or docs/scanning.md pass (190 tests),
`mkdocs build --strict` exits 0, 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; its remark that docs/scanning.md did not say where to run the build is
applied.
2026-11-27 10:21:17 +01:00
Marius Ciepluch 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.
2026-11-27 10:05:00 +01:00
Marius Ciepluch 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).
2026-11-27 09:56:27 +01:00
Marius Ciepluch 5ad9e7781d fix(contributor-scan): compose refuses a target that does not exist (item 5a)
A mistyped TARGET read as a clean scan. The `/target` mount was in the short syntax, so
Docker created a path that does not exist as an empty directory owned by 0:0, and the
scan ended with exit 0 and no findings (the eighth session, 2026-11-26: file_targets=0,
findings=0, exit=0).

The mount is now in the long syntax with `create_host_path: false`, as `/reports` is
since 9d53c32. The source is still `${TARGET:-.}` and the mount is still read-only. A
path that does not exist is refused by the daemon before the container starts ("bind
source path does not exist"), and nothing is created. Measured on 2026-11-26 with the
new file alone in a scratch directory, Docker 29.8.1 and Compose v5.5.1, image
openultrasast:dev (3f959b31f2f2), both API keys unset: a TARGET that does not exist
gives exit 1 in one second and no directory; the documented command with `--mode quick`
on a copy of libpng's contrib/examples gives file_targets=4, findings=4, exit 0;
`touch /target/x` ends with "Read-only file system", exit 1; with TARGET unset the
default source mounts (exit 0).

Tests: the new
`tests/test_task_images.py::test_compose_refuses_a_target_that_does_not_exist` fails on
the short syntax (1 failed, 22 deselected) and passes after; with
`tests/test_search_image.py`, 24 passed. 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 two wordings are
applied.

Left as they are: `docs/detection-techniques.md` cites `docker-compose.yml` by line
numbers that were already off before this change; that is the next docs commit of item
5a. An empty directory that exists still scans clean, natively and in the image; the
menu did not choose to fail that.
2026-11-26 17:44:46 +01:00
Marius Ciepluch 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.
2026-11-26 17:29:16 +01:00
Marius Ciepluch ea8d3d2e6e spec(contributor-scan): record part 2 of the image under 3.2, and what is left open
Started on the maintainer's "proceed" of 2026-11-26, read as step 5 only. The note on task
3.2 records part 2, done in `9d53c32` and `88ea171`, with its evidence: the image built from
`88ea171`, the documented command before and after `9d53c32`, the read-only target, the
network off, the reserved populations absent, the parity of a first scan natively and in the
image on libpng's `contrib/examples` (4 and 4 findings, then 15 and 15) and on libpng whole
(167 and 167), the wrapper, the release pins read with `gh`, and what the entailment at
`contrib/examples/iccfrompng.c:124` does at `88ea171`: it is still reported, so the roadmap's
second criterion does not hold on libpng. The box of 3.2 is ticked; the task's observable
is met.

A second note lists eleven items left for the maintainer, none of them changed. The first
is a fault: the native path of `ops/shell/ousast.sh` changes into the checkout before any
path is rewritten, so `ousast scan .` from a user's directory would scan the OpenUltraSAST
checkout.

Decisions are quoted and everything else is labelled as evidence. No test reads this file;
`tests/test_obligation_siblings.py`, which the handover names as the one that reads the
specs, passes (4 tests). ruff format, ruff check, mypy, the three gates and compileall
pass, and the gates print what they printed before. An independent reviewer approved the
note in the third round. Its first verdict corrected the open list: one number was wrong
(the first run printed 84 lines, 74 of them build output) and one count could not be
verified because its output had not been kept, so it was dropped; five measurements were
then re-run with complete captures kept.
2026-11-26 15:03:38 +01:00
Marius Ciepluch 88ea171dbe fix(contributor-scan): the release builds the scan image from the pinned base (3.2, part 2)
The `images` job of `.github/workflows/release.yml` built `Dockerfile` with no build
arguments, so the file's own defaults applied: `TASK_BASE_TAG=base-unpublished` and an
empty digest. The first `FROM` could not be resolved. The log of the `v2.1.0-alpha.1` tag's
run (42229293910, job `images (openultrasast, Dockerfile)`, 2026-11-06T13:54:46Z) reads
`ERROR: failed to build: failed to solve: failed to parse stage name
"ghcr.io/norandom/ousast-task-base:base-unpublished@": invalid reference format`. Compose
had the same defect, closed in 89d08e0.

The job now reads `plane/task-base.digest` in a `pins` step before its build, the way the
`pins` job of `engine-image.yml` does: the same pattern, fail closed on an unpublished or
malformed pin, the tag and digest written to the step's outputs. The build step passes them
as `TASK_BASE_TAG` and `TASK_BASE_DIGEST`. The other leg of the matrix, the runner, declares
no such arguments and ignores them. The `image` job of `engine-image.yml` already passes
both arguments to its search-task leg, which does not declare them either: run 42229294086
of the same tag succeeded, and its log holds no line about unused arguments.

Tests: the new `tests/test_task_images.py::test_release_pins_the_base_of_its_scan_image`
fails on the workflow at 9d53c32 (3 failed: the job reads no pin) and passes after, in five
cases. A valid pin writes exactly the two output lines. An unpublished pin, a bare tag, a
short digest and another repository each stop the script with its own message and write
nothing. The test also asserts that the pin is read before the build and that the build
carries both arguments from that step. With `tests/test_search_image.py`, 23 passed. On
this machine the script, run from the tree, wrote `base_tag=base-b696c08` and the digest
`docker-compose.yml` defaults to. 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 three notes on the test are applied here
(the step order, the exit status and message, two more malformed pins).

Not run: the release workflow itself, on GitHub.
2026-11-26 13:50:17 +01:00
Marius Ciepluch 9d53c320a5 fix(contributor-scan): compose leaves the reports directory to the user (3.2, part 2)
On a fresh checkout the documented command, `TARGET=/path/to/repo docker compose run
--rm ousast scan /target`, died before scanning. The `/reports` mount was in the short
syntax, so Docker created a missing `./reports` as root, and the image runs as uid 1000.
On 2026-11-26, from a copy of the compose file at 8daca3d, Docker created the directory
owned by 0:0 and the scan stopped after one second with exit 1 and `PermissionError:
[Errno 13] Permission denied: '/reports/runs'`.

The mount is now in the long syntax with `create_host_path: false`, so nothing is
created. Without the directory the daemon refuses the container ("bind source path does
not exist") and leaves nothing behind. After `mkdir -p reports` the same command
completes with exit 0 and writes the run directory owned by the user (quick mode on four
C files: file_targets=4, findings=4). The documented command in the compose header, in
`README.md` and in `ops/README.md` creates the directory first. Both shell wrappers
already did.

Tests: the new `tests/test_task_images.py::test_compose_leaves_the_reports_directory_to_the_user`
fails on the short syntax (1 failed, 16 deselected) and passes after; with
`tests/test_search_image.py`, 18 passed. The eight test files that read `README.md` pass
(183 tests). 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.

Left as it was, an open item for the maintainer: the `/target` mount is still in the
short syntax, so a `TARGET` that does not exist is created as an empty root-owned
directory and the scan ends with exit 0 and no findings (measured on 2026-11-26).
2026-11-26 13:25:20 +01:00
Marius Ciepluch 8daca3df76 docs(plane-on-kubernetes): the pages that placed the plane in the kind cluster say it is stopped
By the maintainer's decisions of 2026-11-25 and 2026-11-26, recorded in the handover. The
question: "The local kind cluster is stopped since 2026-11-24, and three pages still say in
the present tense that the plane runs in it ... Fix them?" Answer: "One docs commit now", as
offered: "The statement step 3 made in the other pages: the cluster is stopped and its code
stays. The docs tests and a reviewer, as for step 3." Four smaller leftovers chosen in the
same menu are done here too: "Reword three link sentences", "Drop Today's in
deployment.md", "Note the proof on kind" and "Note the probe on kind".

The three pages: `docs/ops/ax/README.md` and `docs/where-we-stand.md` take the sentence of
`3a34929` ("That cluster is stopped since 2026-11-24: the code stays, `ops/ax/up.sh`
recreates the cluster, and whether the executor code is deleted is decided at the plane
re-plan"). `ops/ax/README.md` lines 3-4 are one sentence now, as the second menu decided,
and still two lines, because `docs/ops/ax/README.md` includes that page from its line 5.
For that reason the clause "`ousast plane run` submits, resumes, starts and collects" left
those two lines; it stays in the docs page's own paragraph.

The link sentences in `README.md`, `ops/README.md` and `docs/index.md` say what
`docs/deployment.md` holds, in the page's own words: how the plane was deployed on the
maintainer's host, and what moving it to a separate cluster would take. In
`docs/deployment.md`, "Today's EndpointSlice" is an undated statement about the kind
profile. Two dated notes say what waits for the cluster: the replay proof of 5.4 on kind,
and the kind half of the probe of task 3.2 in the parked search-with-proof spec.

Left alone, as decided: `ops/ax/README.md:20`; the rewrite of `ops/ax/README.md` and
`docs/ops/ax/README.md`, and k3s against kube-ax, wait for the plane re-plan.

Tests: the seven test files that read these pages (`test_docs_site.py`,
`test_removed_plane_references.py`, `test_plane_literals.py`, `test_plane_profile.py`,
`test_obligation_siblings.py`, `test_learn_experiments.py`, `test_config.py`): 113 passed
before and after the change. `git diff --check` is clean, and `mkdocs build --strict`
builds the site into a scratch directory. An independent reviewer approved the change in
one round; its remarks on the probe's kind half and on the style of the two notes are
applied.

Outside this commit, from the reviewer: `.kiro/specs/plane-on-kubernetes/tasks.md` has
"4.4 Kind proof and record 04", while `roadmap.md` places 4.4 on kube-ax.
2026-11-26 10:59:35 +01:00
Marius Ciepluch a706a7d811 build(image): the app layers name the runtime user, so the chown layer is gone
By the maintainer's decision of 2026-11-25, recorded in the handover. The option as
offered: "Drop the duplicate chown layer", as offered: "`COPY --chown` on the app file
layers instead of a final `chown -R`. Every file under `/app` stays owned by uid 1000,
compared file by file in the rebuilt image."

`RUN chown -R ousast /app` ran after the last COPY, so it copied every file of `/app`
into a second layer: 194 MB beside the 189 MB `benchmarks` layer in the local image,
and the build of 2026-11-25 spent 311 of its 470 seconds in it. The line is removed, and
the copies it covered take `--chown=1000` as `benchmarks` already did: `pyproject.toml`,
`README.md` and `LICENSE` in one, `src` in the other. Nothing after the last COPY writes
under `/app`: the pip install runs with the uv_build backend and left nothing there in
the image built on 2026-11-25.

Two things are expected to change besides the layer. `/app` itself, which `WORKDIR`
creates, is owned by root, where `chown -R` made it uid 1000. And the files that were
gid 0 take gid 1000. No tracked use writes into `/app` as the runtime user: compose runs
in `/work` and writes under `/reports`, the wrapper `ops/ousast-docker` works in the
mounted repository, and the workflows build and push.

Tests: the new `tests/test_task_images.py::test_app_layers_carry_their_owner` fails on
a `RUN chown` in the final stage and on a `COPY` into it that does not start with
`COPY --chown=1000 `. It failed before the change (1 failed, 15 passed) and passes
after; with `tests/test_search_image.py`, 17 passed. On scratch copies it fails when
the chown line is put back and when the flag is dropped from `COPY src ./src`.
`test_digest_required_and_code_last` found its code line by `COPY src `; it accepts the
new prefix, and its ordering check is unchanged. ruff, 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.

Not claimed here: the rebuilt image. It follows in this step's next part, with the
proof that every file under `/app` is owned by uid 1000 and that `/app` holds the
tracked files only.
2026-11-26 10:36:59 +01:00
Marius Ciepluch 005bffb677 build(image): the image leaves the search pilot's git-ignored working files out
By the maintainer's decision of 2026-11-25, recorded in the handover. The option as
offered: "One line in `.dockerignore` names `benchmarks/search/private/`, with a test
that pins it. The local image then holds what a checkout holds."

`.gitignore` ignores `benchmarks/search/private/`, where the feasibility pilot keeps its
local identities and working files. `.dockerignore` did not, so `COPY --chown=1000
benchmarks` baked the directory of a local tree, 49,961 files, into the local image
`openultrasast:dev`; nothing under it is tracked. A checkout has none of these files, so
an image built from one never held them. Nothing under `src/` names the directory: the
pilot scripts, `benchmarks/search/pilot_run.py` and `pilot_select.py`, run on the host
and take the image under test as an argument.

Tests: `tests/test_task_images.py::test_search_pilot_files_stay_out_of_the_image` pins
the pattern, and that no `!` line with its exact prefix, with or without the trailing
slash, lets it back in. It failed before the change (1 failed, 14 deselected) and passes
after; with `tests/test_search_image.py`, 16 passed. On scratch copies the test fails
when the line is removed, and when `!benchmarks/search/private` or
`!benchmarks/search/private/` is appended. ruff, 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 remark on the re-include check is applied.

Not claimed here: the rebuilt image. It follows in this step's next part, with the check
that the directory is absent from it.
2026-11-26 10:15:26 +01:00
Marius Ciepluch 3a34929c55 docs(plane-on-kubernetes): the docs say the local kind cluster is stopped and its code stays
The maintainer decided on 2026-11-24: "The local kind cluster is stopped and the
code stays. Whether the executor code is deleted is decided at the plane
re-plan." d45fc98 recorded the decision in the spec's tasks. The documentation
went on calling the cluster the development default, or saying that it runs
today. This is step 3 of the handover: one documentation commit for that
decision, with the two records the same step names.

What changes, by file:

- README.md, tier 3: the cluster is stopped since 2026-11-24, the code stays,
  ops/ax/up.sh recreates the cluster, and the deletion of the executor code is
  decided at the plane re-plan. Tier 4 names the stop where it says that no
  other cluster has received a deployment.
- docs/plane.md: the same under "ax is the only executor"; the Deployment link
  and the profile list no longer say "today".
- docs/deployment.md: a dated paragraph at the top carries the record's own
  facts: the decision, the teardown with ops/ax/down.sh, ops/ax/up.sh, a cold
  bring-up that has not been timed, and that nothing on the product's main line
  used the cluster. The frame sentence, two headings, one table header and the
  sentences that said "today" or "runs" are dated or put in the past.
- .kiro/steering/overview.md, the Engine bullet of the dated section of
  2026-10-04; .kiro/steering/roadmap.md, the Destination list, the
  Infrastructure row and the plane-on-kubernetes row. Each keeps the earlier
  target and adds the dated fact, the form roadmap.md already uses for the
  decisions of 2026-11-24.
- ops/k8s/profiles/kind.toml: the leading comment only. No value changes.
- .kiro/specs/ir-consolidation/brief.md: a dated note. Question 2 is overtaken
  by the maintainer's decision on contributor-scan task 4.1: "C memory-safety
  beyond string-function misuse is out of scope. Record that, and say so per
  corpus slice." Question 1 is not affected.
- .kiro/specs/reachability-flow-model/design.md, Data Models: the run directory
  of a scan since 6edae3a, where the line named the location that ended then.

The roadmap's Position is refreshed (verified 2026-11-25). An open subtask is
an open checkbox whose first token is a task number without a trailing dot;
the group headers end with a dot. valid-detection-benchmark 2 (11.6, 11.7);
contributor-scan 18; plane-on-kubernetes 22; reachability-flow-model 16;
authorization-obligations 18; pre-push-safety-net 4 (8.3, 11.3, 13.2, 13.3);
hunter-learning-loop 1; detection-core 0 (11.4 closed under R0). The new
bullet says what the task boxes show for R1 to R5 and records the stop.

Beyond the handover's line numbers, in files it names: README tier 4 (one
clause), two sentences of docs/plane.md, and in docs/deployment.md the frame
sentence, two headings, one table header and three sentences that said "today"
or "runs". Also roadmap.md's Destination bullet (line 239 before this commit):
the same claim 21 lines above the row the handover names, in steering that
every run loads.

Left as they are and reported, on the maintainer's rule that a fault outside
the chosen tasks is reported and not fixed in passing: docs/ops/ax/README.md:3,
ops/ax/README.md:3 and :20, and docs/where-we-stand.md:184-185, which still say
that the plane runs in the cluster; README.md:270-271, ops/README.md:388 and
docs/index.md:56, "where the plane runs today"; roadmap.md:317, "proof on
kind"; search-with-proof/tasks.md:27; the requirements and design of
plane-on-kubernetes, where a change is a spec amendment; and README tier 4 and
docs/deployment.md naming k3s as production, where the roadmap's spec map says
that the production path was re-scoped to kube-ax.

Evidence:
- tests/test_docs_site.py (the strict site build), test_removed_plane_references.py,
  test_plane_literals.py, test_plane_profile.py and test_obligation_siblings.py:
  exit=0, 40 passed, on the committed tree.
- git diff --check: exit 0. The added lines are ASCII.
- The reviewer counted the open work by a method of its own and found the same
  numbers. It built the site strict into scratch, and measured the host: no
  kind cluster and no kube context.

Review: an independent reviewer approved the change in round 1 (no REQUIRED
finding, two SHOULD FIX) and again in round 2, after those were folded in.
After round 2 its round-2 wordings were applied as proposed: one sentence, one
clause and two table labels. No test pins these sentences. The cluster was not
recreated and ops/ax/up.sh was not run.
2026-11-25 19:19:46 +01:00
Marius Ciepluch 91d305cd3c ci: keep the local .env out of the dagger upload
By the maintainer's decision of 2026-11-25, recorded in the handover: "dagger/ci.py syncs the
git-ignored .env into the local container when run locally, and step 9 runs that script locally
for the first time. I have not read how CI supplies what .env holds; that is checked first, so
CI keeps what it needs."

`.env` is the first entry of the exclude list of the one upload in dagger/ci.py,
`client.host().directory(".", exclude=[...])`. The script is CI's dagger job and the same
script run locally; the entry matches nothing in CI and removes the root `.env` of the tree
when the script runs on a machine that has one.

CI keeps what it needs, read before the change: `.github/workflows/ci.yml` (97 lines) sets two
literal variables (`UV_NO_SYNC`, `DAGGER_VERSION`), uses no `secrets.*` and no `vars.*`, and
has no step that creates or copies a `.env`; the container gets one variable, `UV_NO_SYNC=1`.
The names `.env.example` lists, the two API keys, the `VALID_BENCHMARK_*` S3 settings and the
two Discord values, are supplied by no workflow. A checkout has no `.env`, because the file is
git-ignored; `.env.example` is not matched and stays in the upload. No test reads a `.env` from
the tree.

That the pattern removes the root `.env` rests on reading, not on a run: the SDK passes the
list unchanged to the engine, whose filter matches a pattern without wildcards against the
whole relative path (the independent reviewer traced it at v0.21.7, the version CI pins, and
ran that filter over a scratch tree; no engine and no container was started).

Tests: the new tests/test_dagger_ci_upload.py parses dagger/ci.py as text, so it needs no
dagger engine, and asserts that the one exclude list holds `.env`. It failed before the change
(the list without the entry, 1 failed) and passes after; with the two test files that read the
workflow files, 16 passed. ruff, 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 wording of the comment and of the test, and on the failure message of the
test, are applied.

Left for the maintainer's menu, not decided: excluding `.env.*` files as well (a bare pattern
would also drop `.env.example`, which a test reads), an in-container check that fails the
pipeline if the file ever got in, and `__pycache__` directories, which a local run uploads.
2026-11-25 18:37:30 +01:00
Marius Ciepluch 8998697b4e fix(contributor-scan): the MCP server answers a tool that stops the CLI and stays up (3.1, follow-up)
By the maintainer's decision of 2026-11-25, recorded in the handover: "McpServer.handle
catches Exception only, so a missing scan path raises SystemExit through it and ends the stdio
loop; openultrasast.scan and openultrasast.benchmark both take that path. One bad call would
become an error result for that call and the server would stay up."

`McpServer.handle` in src/openultrasast/mcp.py catches `SystemExit` beside `Exception` and
answers with the error it already builds for any exception a tool raises: `-32603` with
`SystemExit: scan path is not a directory: <path>`. The stdio loop reads on, answers the next
request and exits 0 at EOF; before, the process exited 1 with that message on stderr and nothing
on stdout. `openultrasast.benchmark` takes the same clause when the manifest names a source path
that does not exist. No other path changes: the notification return comes before the `try`, a
line that does not parse is answered in `serve`, and `cli.py:588` is the only `SystemExit` a tool
handler can reach (the independent reviewer's trace), raised before the configuration is loaded
and before a run directory is created.

"Error result" is read as that JSON-RPC error: the decision names `handle`, and the handover
keeps this channel apart from `isError: true`, which `_call_tool` builds for `McpToolError`. A
missing path therefore travels a different channel from a missing `path` argument or an
unsupported mode; that is left for the maintainer's menu, with one pre-existing gap the reviewer
found: a line that is valid JSON but not an object still ends the loop.

Tests: through `serve`, a tools/call for `openultrasast.scan` with a missing path followed by a
ping gives the error object and then the ping result, and `serve` returns 0; through `handle`,
the same call gives that error object. Both failed on the code as it was, each with the
`SystemExit` raised through the function it calls (the first in my run, the second in the
reviewer's, on a copy of the code before the change); the second pins that the catch sits in
`handle`, the public dispatch, where a catch in `serve` alone passes the first. The 23 test files
around the scan path and the MCP server pass (242 passed before the second test was added, and
`tests/test_mcp.py` 18 passed after); ruff, mypy, the three gates and compileall pass, and the
gates print what they printed before the change. The real `ousast mcp` process, fed the same two
lines, answered both and exited 0 with an empty stderr. An independent reviewer approved the
change in one round and proposed the second test.
2026-11-25 18:14:06 +01:00
Marius Ciepluch 09a9fcea96 docs(contributor-scan): the user docs name the skipped runs directory and its notice (3.1, follow-up)
By the maintainer's decision of 2026-11-25, as the handover records it: "One
sentence in README.md and docs/examples.md, in its own docs commit: a scan does
not read the files under its runs directory when it lies inside the scanned
path. A notice chosen above would be documented in the same place."

The sentence, the same in both files: "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." It closes the run-location paragraph of README.md
and sits in the first paragraph of docs/examples.md, before the benchmark
sentence.

"when this leaves source files out of the scan" is the exact promise of
`52c9afb`: the notice counts what the skip took out of the scan, so a source
file that the target's root `.gitignore` or an ignored directory already keeps
out brings none. "`ousast` prints" matches the retention sentence two lines up;
`ousast scan` and `ousast benchmark` print the line, and the
`openultrasast.scan` and `openultrasast.benchmark` tools return the same text
among their notices instead (the independent reviewer's probes). The first
clause keeps the maintainer's words: nothing under the runs directory becomes a
file target, while the other readers of a scanned tree stay as they are by the
decision "No, leave them"; a route manifest under the runs directory is still
read.

No code changes. The two documentation test files pass (8 passed). An
independent reviewer approved the change in two rounds; its first round found
that the first wording, "when source files are left out there", promised a
notice for files the scan was not going to read anyway, which this wording
closes.
2026-11-25 17:44:42 +01:00
Marius Ciepluch 52c9afb85f feat(contributor-scan): a scan says how many source files it left out under its runs directory (3.1, follow-up)
`56c4620` made a scan skip its runs directory when it lies inside the scanned
path, and said nothing about it. By the maintainer's decision of 2026-11-25,
recorded in the handover, the scan now prints one notice. The decision, as the
handover records it: "When source files lie under the runs directory inside the
scanned path, the scan prints one notice: line naming the path and the number
left out, the way run retention does."

The line is `notice: skipped <n> source files under the runs directory <path>`
(`source file` at one). `ousast scan` prints it, the `openultrasast.scan` tool
returns it among its notices, and `openultrasast.benchmark` returns the notices
of the scan it runs. Nothing is added to the manifest or the report.

The count follows the scanned tree's own rules, so it is the number the skip
took: a source file that the target's root `.gitignore` already keeps out, or
that lies under a directory the scan ignores, brings no notice, and a
`.gitignore` inside the runs directory does not hide what was left out. To that
end `enumerate_source_files` in src/openultrasast/preprocess.py and the new
`count_skipped_source_files` share one private predicate,
`_is_read_as_source`. The enumeration returns the lists it returned before
(the skip test now comes first, so a path under the skipped directory is no
longer stat'ed). The count is taken after the preprocess stage, so a tree
whose ignore file cannot be read stops the scan inside that stage, as before.
It costs one more read of the target's root `.gitignore` and, where there is
one, one more `git ls-files`, and only when the runs directory lies inside the
scanned path.

Nothing is said when no source file is left out, when the runs directory lies
outside the scanned path, or when it is the target or lies above it.

Tests: the notice tests failed on the code as it was (6 failed) and pass after
the change. Four more failed on a first cut that counted by the runs
directory's own `.gitignore` and pass on this one: a `.gitignore` inside the
runs directory does not hide what the scan left out, nothing is left out where
the target already ignores the runs directory, nothing under a directory the
scan ignores, and a directory named `.gitignore` costs the scan nothing. The
test that a target inside the runs directory is read as it was now also pins
that nothing is said; a count that covered that target failed it. The 23 test
files around the change pass (241 passed); ruff, mypy, the three gates and
compileall pass, and the gates print what they printed before the change.

An independent reviewer approved the change in two rounds. Its first round
found the count by the wrong rules, which this cut closes. Its second round
named two things that are left open and recorded in the handover: were the
target's root `.gitignore` to become unreadable between the preprocess stage
and the count, the scan would stop with no failed stage recorded in its trace
and no manifest; and no test pins that a tracked source file under an ignored
runs directory is counted.
2026-11-25 17:15:13 +01:00
Marius Ciepluch 9a0b27e07b spec(contributor-scan): record the benchmark runs and the skipped runs directory under 3.1
The 3.1 task note gains two record paragraphs.

`9e4983f` moved the benchmark runs beside the scan runs. `56c4620` made a
scan skip its runs directory when it lies inside the scanned path: the
maintainer's decision, as the handover records it, is quoted. Each paragraph
closes the item the note of 2026-11-24 had marked "not yet done", and the
older wording, "skip the cache when a scan meets a directory that contains
it", is marked as overtaken by the decision, which names the runs directory
only.

The rest is labeled evidence on record: the skip applies only where the runs
directory lies inside the scanned path (the reading the independent reviewer
confirmed), it is silent, no run of this package keeps a source file today,
and the counts of tests, lint and gates of `56c4620`. What is left for the
maintainer is named as such and not decided: whether a scan should say when
it left files out, whether a target inside the runs directory should be
named, and a sentence for the user docs.

No code changes.
2026-11-25 14:42:59 +01:00
Marius Ciepluch 56c4620087 feat(contributor-scan): a scan skips its runs directory when it lies inside the scanned path (3.1, follow-up)
Since part A a native scan writes its run under the user cache or wherever
`OPENULTRASAST_RUNS_DIR` points. A scan of a path that contains that directory,
a home directory or a tree with the runs directory set inside it, took the
files under it for source: those of earlier runs and those of its own run. On
the code as it was, a source file under the runs directory inside the target
was read and its finding reported (`file_targets=3 findings=2` for a tree of
two files and one such copy).

By the maintainer's decision, recorded as step 2c of the handover, the scan
skips the runs directory only: `config.runs_dir`, the default location or the
override. The other directories under `~/.cache/openultrasast` are read as
before, and so is every tree whose runs directory lies outside it.

`preprocess_repository` and `enumerate_source_files` in
src/openultrasast/preprocess.py take a `skip` directory, and the preprocess
stage of a scan (`_map_scan_targets` in cli.py) passes `Path(config.runs_dir)`.
The skip applies only where the runs directory lies inside the scanned path:
a target that is the runs directory or lies inside it is read as it was, so a
runs directory set to `.` does not silence a scan. Both paths are compared
resolved, so a symlinked or relative name is found, and the excluded path is
built under the root as the walk spells it, so a relative root works too. Every
other caller of the two functions passes no `skip` and is unchanged.

No run of this package keeps a source file today (the independent reviewer's
count: a quick run holds 15 files, all `.json`, `.jsonl`, `.md` or `.sarif`;
the two benchmark runs in the real cache hold `.json` and `.toml`). The copy in
the tests is a constructed case.

Tests: four tests failed on the code as it was and pass after the change: the
runs directory inside the scanned path, by the override, by the default
location and by the override through a symlink, and the rest of the cache
still read. Two more pin the narrow reading, a target that is the runs
directory or lies inside it is read as it was; they failed on a first cut
that skipped more than was decided. A direct call with a relative root pins
the path comparison. The nine test files around the change pass (113 passed),
as do the 37 files that exercise the scan path (362 passed); ruff, mypy, the
three gates and compileall pass. Runs of the real CLI on one scratch subject,
the code at HEAD against this tree: with the runs directory inside the target
the copy under it is no longer read (`file_targets=4 findings=3` for five
source files); with the runs directory a parent of the target, or the target
itself, both read the same five files and report the same four findings. An
independent reviewer approved the change in three rounds; its first round
found that the first cut also silenced a scan whose target lay inside the
runs directory, which this cut narrows to the decided case.
2026-11-25 14:41:44 +01:00
Marius Ciepluch 9e4983f465 feat(contributor-scan): benchmark runs go beside the scan runs (3.1, follow-up)
`ousast benchmark` and its MCP twin wrote a run to
`<target>/.openultrasast/benchmarks/<id>/`, into the scanned tree, and no user
document said so. By the maintainer decision of 2026-11-24 a benchmark run now
goes to `<runs_dir>/<benchmark-run-id>/`, beside the scan runs, where run
retention removes it like a scan run.

`create_benchmark_run` in src/openultrasast/benchmark.py takes the runs
directory instead of the target. The two `_benchmark` functions, in cli.py and
in mcp.py, load the configuration the way `_run_scan` does and pass
`config.runs_dir`, so a benchmark run follows `OPENULTRASAST_RUNS_DIR` like the
scan it runs.

Both create the run once the scan has returned. Created first, as it was, the
run was under the scan's own retention while the scan ran, and a scan that
outlasted the retention window took it for an old one: the scoreboard could not
be written and the scan outcome was never printed. A failed scan now also
leaves no empty run behind.

README.md and docs/examples.md name where a benchmark run goes.

Tests: the three location assertions failed before the change and pass after
it. A new test pins that retention removes a benchmark run like a scan run, and
another that a benchmark keeps its run when its scan outlasts the retention
window. The nine test files around the change pass (120 passed); ruff, mypy,
the three gates and compileall pass. A run of the real CLI printed `run_dir=`
and `benchmark_run_dir=` as siblings under the runs directory and left only the
calibration ledger in the scanned tree. An independent reviewer approved the
change in two rounds; its first round found the retention window, which this
cut closes.
2026-11-25 10:40:01 +01:00
Marius Ciepluch 78434a6e9f refactor(contributor-scan): split _run_scan into its stages (3.1, follow-up)
`_run_scan` in src/openultrasast/cli.py stood at a McCabe complexity of 18
and 124 logical lines, against the caps of 10 and 50 in
.kiro/steering/code-standards.md. It is now 5 and 45 and reads as the stage
sequence.

The stages moved to six private helpers in the same module, in call order:
_map_scan_targets, _collect_findings, _verify_and_fuse, _map_and_overlay,
_add_obligation_and_model_findings and _run_map_stage. Two small records
carry what crosses between them. _RunFiles names the ten artifacts a run
writes, where the function kept ten path locals; _MapStage carries what the
MAP stage hands to the reports, with the defaults of a scan that did not
request that stage. The wrote_overlay flag is gone: the overlay is a list
when the stage ran and None otherwise.

No statement changed. What differs from the old function is where values
live: the tool hunter's budget is read as config.hardening.max_findings,
the fusion decisions come from their helper's return, and the reports and
the manifest read the two records.

Logical lines are counted the way the detection-core final gate counts
them (the tokenize method). _main, _pre_push and _plane in the same file
were already over the complexity cap and are not touched.

Tests: the 38 test files that import the CLI or the MCP server pass (563
passed, 11 skipped); ruff, mypy and the three gates pass. Scans by the code
before and after agree artifact for artifact: quick mode on a scratch copy
of src and tests, and standard mode with defaults and with the scripted
tool hunter under a budget of three findings. An independent reviewer
approved the change in two rounds; its first round asked for the
logical-lines cap, which this cut meets.

The task note in .kiro/specs/contributor-scan/tasks.md records the split.
2026-11-24 22:05:49 +01:00
Marius Ciepluch 61581f63b8 ci: raise the dagger job's timeout to 60 minutes
The limit of 20 minutes dates from fb7594a (2026-06-22). Run 45352669096
was cancelled at it with pytest at 89 percent, before any summary was
printed. On the runner host the last 11 percent of the suite took 662 of
2095 seconds, and eleven tests that failed early there for want of a git
index now run to their end, so the job needs about 40 minutes on that
runner. 60 leaves room for a slower one.
2026-11-24 20:40:48 +01:00
Marius Ciepluch 75233fdf14 ci(dagger): give the mounted tree a git index
The dagger job mounts the checkout without `.git` (excluded from the synced
directory), and eleven tests need it. The detection-core final gate and
ten tests in the migration files list tracked Python files with
`git ls-files` under check=True, so in run 45352669096 each failed for
want of that index soon after it started, while the job's 52 performance
tests passed.

The container now trusts the worktree, which can be owned by another user
than the container's, and builds an index of the mounted tree before uv
runs. In python:3.11-bookworm the final gate then passes (1 passed in
358 s) and the index holds the same 1031 Python files as on the host;
without the index the final gate fails in 12 s.
2026-11-24 20:40:48 +01:00
Marius Ciepluch 53a68907ea test(detection-core): give the measured seed budget headroom over its proxy workload
Forty-five tests in tests/test_detection_core_performance.py failed on the
GitHub runner (run 45352669096) with "measured budget gate failed", for
example 206ms>157ms. The seed budget is the slowest `_validate_work`
sample, and it gates the complete consumer run, which also derives and
encodes output. The two workloads scale differently per host: the complete
run measured 0.78 of the seed on the development machine and 1.28 to 1.41
on the runner. Through the final gate's nested run this was also the run's
eleventh failure.

The seed is now doubled before it is used. The budget that the tests
derive and assert is unchanged, and the gate keeps its teeth: with the
gated run slowed by one second the module fails (1222ms>1146ms), with a
quarter of a second it passes. No production code changes.
2026-11-24 20:16:23 +01:00
Marius Ciepluch 7c707d61f9 test(search-with-proof): flush the disk-bound write inside the program
tests/test_search_worker.py::test_run_timeout_truncation_and_disk_bound
failed on the ubuntu-26.04 runner (run 45352669096) with exit status 0,
where it requires a non-zero status. The runner's Python 3.14 buffers
131072 bytes by default, so a 16 KiB write to an unclosed file is flushed
only at interpreter exit, where the error is ignored. The program now
closes its file, so ENOSPC surfaces on every Python version.
2026-11-24 20:16:23 +01:00
Marius Ciepluch c4720ba186 test(search-with-proof): skip by cause where the host refuses the browser sandbox, a private network namespace or node
GitHub CI's checks job failed nine search tests on the ubuntu-26.04 runner
(run 45352669096), which has chromium and bubblewrap. Three causes:

- chromium prints "No usable sandbox!" inside the bubblewrap user namespace
  and does not exit. The browser test skips on that evidence in the launch
  error's cause, as it already did on "Operation not permitted" and
  "Permission denied"; an ordinary browser failure still fails.
- `unshare --user --map-root-user --net` is refused ("write failed
  /proc/self/uid_map: Operation not permitted"). The ssrf differential and
  the namespace handoff test probe that command first and skip when it
  fails. The other three differential families do not need it.
- The six node fixture tests could not run their app on the runner. They
  need /usr/bin/node, the path the demo launcher uses, and now skip when
  it is not executable. The runner's log does not name the missing path;
  hiding it locally reproduces the same six failures.

A present but broken node, or a browser that fails for its own reasons,
remains a failure.
2026-11-24 20:16:23 +01:00
Marius Ciepluch 02493bd6b7 spec(pre-push-safety-net): record the stale push eligibility registry as owned M5 work
The maintainer decided on 2026-11-24 to file the push eligibility registry
under milestone M5 ("File under M5"). The item had no owner.

The paragraph under M5 in release-milestones.md quotes the decision and
labels the rest as evidence on record: the file was last written at commit
b506516 (2026-09-13), and by the task 15.2 note its bindings match the code
of that commit and no binding at HEAD, so load_registry returns stale with
zero capabilities and the hook emits no admitted alert. The hook stays
silent until M5 regenerates the registry.
2026-11-24 18:37:47 +01:00
Marius Ciepluch 4ef1394c2b spec(contributor-scan): record the decisions taken after the stop: run retention, the push condition, and the next session's work
The maintainer answered six open questions on 2026-11-24, so that a new
session can continue without asking. tasks.md carries them where they apply.
Task 3.1 notes the run retention (17d46c0) and the three follow-ons decided
for the next session: the benchmark runs move to the cache, a scan that
meets a directory containing the cache skips it, and _run_scan is split in
its own commit. Task 3.2 notes that part 2 also carries the release workflow
fix and the libpng re-measurement against the second release criterion.
Tasks 5.14, 7.3, 7.7, 7.8 and 5.9 carry one rule: each closes on the fresh
pmpro measurement when its own completion criterion holds there, and stays
open with the fresh number recorded otherwise.

spec.json records the same decisions in one approval entry together with
the push condition: a push follows a local gate, the whole test suite and
every CI command passing locally, while GitHub CI stays red for reasons in
other specs.
2026-11-24 17:54:21 +01:00
Marius Ciepluch 17d46c0f93 feat(contributor-scan): remove scan runs older than 30 days from the default cache (3.1, run retention)
By maintainer decision. Since 6edae3a a native scan leaves a run directory
under ~/.cache/openultrasast/runs/ and nothing removed them. After a scan's
manifest is written, with no OPENULTRASAST_RUNS_DIR set, the runs in that
default location that are older than 30 days are now removed. The age comes
from the UTC timestamp in the run id, never from file times, so a copied or
touched directory is not misjudged, and a run exactly 30 days old is kept.

Never touched: the scan's own run; anything not named exactly like a run
(only direct children of the runs root whose name is a run id); symlinks,
which are neither followed nor removed; and any location chosen with
OPENULTRASAST_RUNS_DIR, even when it resolves to the default.

OPENULTRASAST_RUNS_RETENTION_DAYS sets the number of days and 0 keeps every
run. A failed prune never fails the scan: it is one notice on the command
line, and the MCP scan and benchmark results now carry a notices key. A
retention longer than the calendar and a directory tree too deep to remove
are both turned into that same behaviour.

Known limits, on record: a removal that fails part-way leaves the run half
deleted and it is retried on every later scan; the prune stops at the first
failure; a clock set far ahead removes earlier runs; a filesystem mounted at
or under an expired run is emptied before the removal fails.

Tests: tests/test_run_pruning.py drives the function and the real command
line (34 tests); tests/test_mcp.py pins the notices. The reviewer attacked
the deletion path with about sixty hostile inputs and twenty-three mutations;
all are killed or kept safe.
2026-11-24 17:51:37 +01:00
Marius Ciepluch efa2b62bff feat(contributor-scan): pin Open Notebook as the whole vibe-code checkout (5.2, part 1)
benchmarks/repos/open-notebook.toml pins lfnovo/open-notebook at 89eac04c
(tag v1.8.3, MIT), chosen by the maintainer from a shortlist: 462 files in
two languages, 101 Python and 197 TypeScript or JavaScript. It holds one
known entry for each of the eight published advisories whose range covers
the pin, five in scope and three out with the reason in each, and asserts no
rung. Every site was read in the code at the pin, and the fix statements in
the code of the fixed trees rather than in the advisory text.

What the recipe says about scope, so that the measurement is read correctly:
two in-scope entries hand the value to a dependency that performs the sink
(a file read and an HTTP request in content-core), and one sits in
docker-compose.yml, which no scan opens. The engine cannot entail a flow to
a callee that no sink table names, so a miss on those is structural. Only
CVE-2026-33588 has its sink in the tree. The recipe also states what the
learning labels would make of the YAML entry, were a source to list it.

The measurement is part 2 and runs in the image.
2026-11-24 16:06:32 +01:00
Marius Ciepluch 6edae3a585 feat(contributor-scan): a scan writes its run to the user cache, and the ledger only when it learns (3.1, part A)
Where a scan writes. A native scan now creates its run under the user cache,
~/.cache/openultrasast/runs/<scan-id>/ by default ($XDG_CACHE_HOME when it is
set and absolute), prints run_dir=<path> once, and no longer writes anything
under the analysed tree. OPENULTRASAST_RUNS_DIR still wins: an absolute value
is used as given, a relative one resolves against the working directory.
Pre-push storage is unchanged.

The calibration ledger, by maintainer decision: .openultrasast/calibration/
stays the store, and a scan writes the false-positive ledger into the tree
only when its content would change. On a read-only tree the scan records
ledger_not_written, with a sentence in the report, and completes; before, a
read-only target with one rejected finding crashed before report.md existed.

benchmarks/repos/measure.py follows the printed run directory. It read the
run from under the scanned copy, which would have recorded every repository
as failed, and it also read a stale run left in a copy.

Tests: tests/test_scan_output_location.py drives the real CLI and compares
the whole tree before and after; tests/test_repo_measure.py pins the
measurement script; an autouse fixture keeps every test's scan runs out of
the developer's cache; fourteen test files follow the run to its new place.
README, docs/examples.md and the scan skill name the ledger as the one write
a scan makes. _run_scan is touched by one line and stays over the complexity
cap.

Task 3.1 stays open for part B, the readable summary.
2026-11-24 15:33:35 +01:00
Marius Ciepluch d45fc98c4e spec(plane-on-kubernetes): record that the local kind cluster is stopped and the code stays
The maintainer decided on 2026-11-24 to stop the local kind cluster and keep
the code until groups 3 to 8 are re-planned. The cluster was torn down the
same day with ops/ax/down.sh; whether the executor code is deleted is decided
at that re-plan.

The dated section at the end of tasks.md records what was true when the
decision was taken, each with its source: nothing on the product's main line
used the cluster or its stores and the memory store is remote; the rustfs in
the cluster was Substrate's snapshot store, and a file copy of it with
Substrate's postgres data is kept on the development machine; search-with-proof
demonstrated on kube-ax and takes from plane/ only memory.py and budget.py;
the admission that decides rollout does not depend on the local cluster. The
status block at the top points to it, and spec.json carries the date.
2026-11-24 15:25:48 +01:00
Marius Ciepluch 11733bfb87 spec(contributor-scan): record the course of the implementation run and close 7.1 as superseded
The maintainer set the course for this run on 2026-11-24. spec.json now
carries it as two approval entries: the course itself (7.1 closes as
superseded; 5.12 covers facts and generic features and is to record why it
drops the LLM ranker; 7.2 lands before 5.6 and 5.1; the subject for 5.2 is
chosen by the maintainer; a native scan writes to the user cache; both
stages run autonomously and a push follows only after the whole test suite
and every CI check pass), and the later decisions of the same day, recorded
at the time of writing (the 5.2 subject, the calibration ledger, the build
cache, the image contents).

tasks.md: 7.1 is ticked as superseded. Its instrument was built on
2026-09-21 (0beae46, b0500ec), measured on NodeGoat only, and retired with
the other cuts on 2026-10-13 (f5a904b); the NodeGoat record survives and the
successor is the detection-core fact-pack workstream. 5.1 carries its
deferral, which sets aside the Depends line task 5.6 carries. 5.2 names its
chosen subject and says that other advisories affect the pinned version
besides the two labelled ones.
2026-11-24 14:40:08 +01:00
Marius Ciepluch 90170380ec fix(docker): keep the reserved populations out of the image (contributor-scan 3.2)
The root image copies benchmarks/ (Dockerfile:43), and .dockerignore let benchmarks/valid
and benchmarks/unseen through, about 18 MB of reserved-population material.
RELEASE_NOTES.md says every version tag is pushed to ghcr.io/norandom/openultrasast.
Decided by the maintainer on 2026-11-24: both stay out of the image.

The scan path reads neither. The one run-time reader is the hunter's contamination report
(hunt/contamination.py), which runs from a checkout: a missing pool contributes nothing to
it, and it imports benchmarks.unseen.eligibility late, so inside the image that report has
no eligibility module and fails at the import rather than silently.

A test pins both patterns and fails if a later negation lets either back in. The built image
is checked for their absence in task 3.2 part 2, when it is rebuilt.
2026-11-24 14:25:30 +01:00
Marius Ciepluch ab2f55d8ae spec(contributor-scan): close the deferred decisions 4.1 and 4.2 on the maintainer's record
Task 4.1 (Req 7.1), decided 2026-11-24: "C memory-safety beyond string-function misuse
is out of scope. Record that, and say so per corpus slice." The decision is recorded in
the spec's amendment record, the steering overview and roadmap, and the user docs; the
pair corpus README states it per slice (vfc, sast, local). The maintainer stated no
reason, so the records name the evidence that was on record and label it as such: the
memory family models calls, not arithmetic; no execution tier is adopted, since
Rung.EXECUTION_CONFIRMED has no producer; of the 176 vfc pairs none is labelled as going
through a string API the family models (129 carry no sink label, counted 2026-11-24).

With it, task 5.3 (the C harvest of Req 9.2) and task 2.13 are withdrawn, and task 2.15
closes on its recorded-decision branch. Req 9.2 is left unmet and its text stands. The
entailment at contrib/examples/iccfrompng.c:124, libpng's last one by task 2.13's
account, now has nothing that removes it; that is recorded as to be re-measured.

Task 4.2 (Req 7.2), decided 2026-11-24: "Keep both, record why. No output change for
JSON, SARIF or MCP consumers. Record the reason in the spec and docs, and revisit when
detection-core revises its consumer contract." rung is the model ladder's verdict;
evidence_level is the pattern and overlay pipeline's vocabulary, which the overlay raises
only to static_corroboration. Folding one into the other would present a text match as a
model verdict or change the JSON, SARIF and MCP output. No code changes.

Reviewed in four adversarial rounds; the fourth approved both records.
2026-11-24 14:17:30 +01:00
Marius Ciepluch 89d08e01d3 fix(contributor-scan): build the image from the pinned base and keep runs on the writable mount (3.2, part 1)
`docker compose build` has failed since 1b9d1ca (2026-10-05): the Dockerfile requires the task
base's tag and digest and deliberately has no floating fallback, but the compose file passed
neither argument. Compose now defaults both from plane/task-base.digest, the pin CI builds
from, and a test fails when the two drift apart or an argument goes missing.

The service also sets OPENULTRASAST_RUNS_DIR=/reports/runs, so a scan's run directory lands on
the one writable mount (Req 6.3) whatever the default location is.

Built and verified once, with no scan (2026-11-24, 11:02Z to 11:10Z): `docker compose build`
exit 0 in 8m03s, the Joern zip passing its sha512 check, and inside the image the CLI usage,
native PHP 8.4.26, lib/io.joern.joern-cli-4.0.625.jar, the installed package, and the pinned
base's 12 layers and 24 history entries as the image's prefix. That image held HEAD's source
and was removed from the build machine by a Docker prune at 12:56Z.

Task 3.2 stays open: the image must be rebuilt after task 3.1 lands, and part 2 (a real scan
through the image and the shell wrapper, parity with a native run) is not done. Known for part
2: on a fresh checkout Docker creates ./reports root-owned and the image runs as uid 1000, so
the first run cannot write its output.
2026-11-24 14:04:33 +01:00
Marius Ciepluch 4c5b5d7932 test(contributor-scan): pin tier-zero pruning at the scan boundary (5.14)
Four regression tests for the mechanism that landed in 9a8e9f0 and 3b6e642:

- a family absent from the repository is never asked, at callDepth 0 or 3;
- the evidence that prunes a question is asked over that question's own
  scope and at the arbiter's callDepth;
- a pruned question is recorded as deferred with reason tier_zero and
  never as an outcome;
- an evidence summary that does not say the family is absent excludes
  nothing.

Each test was shown red under a control that breaks only the rule it
names. The engine's half of the rules (familyInRepo over the whole graph,
the reachable-set scope above depth 0) is verified by reading taint.sc
only; no executable test pins it.

Task 5.14 stays open: its Observable also asks whether the query completes
on pmpro, and the record on file (2026-09-22) answers that it does not.
2026-11-24 11:43:37 +01:00