Commit Graph
758 Commits
Author SHA1 Message Date
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 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 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
Marius Ciepluch 28f160419a test(valid-detection-benchmark): add the opt-in full-scale rehearsal
One test runs the whole lifecycle at 840 inputs with every planned arm and
the per-population review subject, so a correctly reviewed full-scale run
completes for the first time. It is skipped unless
OPENULTRASAST_FULL_SCALE_REHEARSAL=1 and records per-stage wall-clock
seconds. The default path is unchanged: the new ScaleLifecycle arguments
default to None and the timing wrapper always calls its stage.
2026-11-24 07:41:26 +01:00
Marius Ciepluch 081adfc052 test(valid-detection-benchmark): route the harness spends through the production spend stage
The end-to-end and scale harnesses committed the shared custody spend by
hand. They now bind the production stage (bind_case_adapter_spend_stage)
through one shared helper that predicts the release review subject before
the spend, so the harness exercises the same path the adapter replay
binds. The failure-injection copy stays a raising fault injector so the
failure matrix keeps its pinned outcomes.

The sealed release the harness persists now has the production shape
(schema version and review covered by the release digest); nothing
pinned the old five-key payload.
2026-11-23 21:54:42 +01:00
Marius Ciepluch 2951f7d53a fix(valid-detection-benchmark): refuse a wrong-typed stage product as an instrument failure
A run stage that returned None or a product of another type escaped the run
command as a raw AttributeError, or was passed on to the next stage. The
run command now type-checks every stage product against its declared type
and persists an IMPAIRED outcome at that phase with reason
INSTRUMENT_FAILURE; the spent flag stays what durable custody says. Seam
refusals are still re-raised and the INTERRUPTED path is unchanged.
2026-11-23 20:15:28 +01:00
Marius Ciepluch f9d29aa6e8 fix(valid-detection-benchmark): bind a production spend stage for the adapter path
Add bind_case_adapter_spend_stage and export it from the run module: the
stage derives the preparation from the adapter request and commits the
shared spend through commit_preparation_spend_and_release, so a receipt
minted on this path satisfies the core's shared-spend validation. The
legacy release is refused on the same path (contrast test).

The bound stage refuses a stage product that differs from the execution the
request was validated for, before any custody read or write.
2026-11-23 20:15:21 +01:00
Marius Ciepluch 5fdf65e02d fix(valid-detection-benchmark): mint the shared spend receipt from the preparation
Add commit_preparation_spend_and_release: the shared label spend mints its
custody receipt from preparation.label_release_request, which is what the
core's shared-spend validation requires (arm id and influenced artifact
digest of the authority). commit_spend_and_release keeps its behaviour and
its mint order; its receipts cannot satisfy a preparation and are refused by
the replay, as a contrast test now pins.

Closed refusals, all before any write unless stated: wrong preparation type,
head unavailable or moved (no CAS), lost CAS, labels unreadable after the
committed spend (labels_spent true).
2026-11-23 20:15:09 +01:00
Marius Ciepluch d9b7aaa6ac feat(pre-push-safety-net): exclude the memory family explicitly and document the scope line
- advisory-scope.json names the taxonomy family memory as excluded, with
  the registry-grounded reason and what a run does not tell
- docs/scanning.md shows the Scope line exactly as the hook prints it
- the loaded-scope guard moves into a helper, so __post_init__ keeps its
  complexity of 14
2026-11-23 13:45:27 +01:00
Marius Ciepluch 364b4c0777 test(valid-detection-benchmark): pin each fix-site key element and non-integer closure totals
- one sourcing-queue pair per fix-site key element (path-only,
  function-only), each proven red by dropping that key line alone
- the closure decode test covers a self-consistent bool total next to
  the float total
- the _request_order docstring names the two ties that remain open
  (fix revisions; shared candidate digest with another family or CWE)
2026-11-23 13:31:01 +01:00
Marius Ciepluch b82b52f976 feat(pre-push-safety-net): declare the provisional advisory scope and print it on every run
One packaged record (advisory-scope.json, shipped in the wheel beside eligibility.json) states the provisional scope, every exclusion with its reason, and what each exclusion leaves untold. The hook renders exactly one bounded Scope line per run in every state (provisional, with defects, record unavailable) and the artifact carries the record under advisory_scope. The record is provisional if and only if the shipped registry is NO-GO with no enabled declaration.

Task 15.2. The task text cites a requirement 5.6 that does not exist, so this is implemented against 3.1, 5.1, 7.1 and 7.3.
2026-11-23 13:01:01 +01:00
Marius Ciepluch 0d5aaeecca test(valid-detection-benchmark): cover a non-permissive license class behind an allowlisted expression
The license_class conjunct of the public-material partition had no mismatch fixture. NON_PERMISSIVE and UNCERTAIN sources with an allowlisted expression and an approval are now pinned to the private partition.
2026-11-23 11:40:09 +01:00
Marius Ciepluch 67bc37cac6 fix(valid-detection-benchmark): break sourcing-queue ties on fix-site path and function
Candidates that differed only in fix-site path or function were selected by input order under the queue cap. Both scalars are now part of the request order, so cap selection no longer depends on input order for them.
2026-11-23 11:40:09 +01:00
Marius Ciepluch 9e884e8342 fix(valid-detection-benchmark): require a strict integer for the accepted positive total
total_accepted_positives accepted floats and booleans on both the direct and the decode path. Both now fail closed with STATE_MISMATCH through one sibling helper that keeps _validate_closure within the complexity cap.
2026-11-23 11:40:09 +01:00
Marius Ciepluch 60bb7f0bdd fix(valid-detection-benchmark): fail cohort selection closed on a malformed pending ledger
_ledger_facts accepted any pending_entries value and turned it into a set; a ledger outside the durable shape is now a STATE_MISMATCH on both selection rounds. The _pending_by_ecosystem docstring now states the conflicting-accepted-review corner accurately.
2026-11-23 11:40:09 +01:00
Marius Ciepluch 7e6da2efae fix(valid-detection-benchmark): normalize mixed-case .git suffixes in reservation identity
A reference such as OWNER/REPO.GIT escaped the reserved-identity check at both reservation sites because the suffix was stripped case-sensitively. One shared strip now handles the suffix case-insensitively; identities without a mixed-case suffix are byte-identical.
2026-11-23 11:40:09 +01:00
Marius Ciepluch f2093a5380 fix(valid-detection-benchmark): floor scale runtimes at one millisecond
The 11.5 review noted that the scale validator accepted runtime_ms >= 0,
so a sub-millisecond or frozen-clock reading could be recorded as 0 ms.
Clamp every recorded runtime (per-arm, streaming, lane) to at least 1 ms
and tighten the validator to > 0. A frozen-clock test proves all three
floors; it fails against the previous source (0 ms receipts).
2026-11-23 11:05:20 +01:00
Marius Ciepluch f30a5d2cb2 style(valid-detection-benchmark): apply ruff format to 10.x/11.x test files
`ruff format --check src tests` failed on the 17 test files and helpers added by tasks 10.x and 11.x. Formatting only: the AST of every file is unchanged.
2026-11-23 09:27:41 +01:00
Marius Ciepluch a68796610a feat(valid-detection-benchmark): 11.5 streaming scale bounded validation and back-pressure 2026-11-23 06:21:43 +01:00
Marius Ciepluch 66ec3e1a31 feat(valid-detection-benchmark): 11.4 spend-ordering crash and failure-visibility matrix 2026-11-23 03:51:56 +01:00
Marius Ciepluch da5323002e feat(valid-detection-benchmark): 11.3 end-to-end lifecycle with case adapter and hostile-decode retrofit 2026-11-23 02:50:12 +01:00
Marius Ciepluch 73c8a9d6b3 feat(valid-detection-benchmark): 11.2 persistence custody and scratch-loss suites 2026-11-22 23:28:46 +01:00
Marius Ciepluch 936835477a feat(valid-detection-benchmark): 11.1 governance and confidentiality adversarial suites 2026-11-22 23:01:01 +01:00
Marius Ciepluch c587f25bb3 feat(valid-detection-benchmark): 10.7 freeze and causally bind replacement baseline 2026-11-22 22:27:09 +01:00
Marius Ciepluch 93ebea7b93 feat(valid-detection-benchmark): 10.6 draw and validate ordinary-change population 2026-11-22 21:38:26 +01:00
Marius Ciepluch c2b5f5bc92 feat(valid-detection-benchmark): 10.5 ingest fourth cohort and close positive set 2026-11-22 20:12:03 +01:00
Marius Ciepluch 6d66501192 feat(valid-detection-benchmark): 10.4 select and ingest third reviewed cohort 2026-11-22 19:16:54 +01:00
Marius Ciepluch 408a562c41 feat(valid-detection-benchmark): 10.3 ingest bounded reviewed JavaScript/TypeScript cohort 2026-11-22 18:42:51 +01:00
Marius Ciepluch 825e680804 feat(valid-detection-benchmark): 10.2 ingest bounded reviewed Python cohort 2026-11-22 10:25:59 +01:00
Marius Ciepluch 34344234d5 feat(valid-detection-benchmark): 10.1 create bounded sourcing and review queues for both initial ecosystems 2026-11-21 21:29:52 +01:00
Marius Ciepluch d81255e256 style(valid-detection-benchmark): apply repo formatter to R1 test files 2026-11-21 19:28:10 +01:00
Marius Ciepluch 38e12282da feat(valid-detection-benchmark): 9.3 publish benchmark-only run, resume, and status commands 2026-11-21 19:27:27 +01:00
Marius Ciepluch 4085f236f3 feat(valid-detection-benchmark): 8.6 resume exact pre-spend and post-spend workflows without changing authority 2026-11-21 17:39:10 +01:00
Marius Ciepluch 6fad162962 feat(valid-detection-benchmark): 8.5 produce every scoped report and one complete evaluation replay 2026-11-21 16:34:30 +01:00
Marius Ciepluch 475ff3a5fe feat(valid-detection-benchmark): 8.4 project exact-scope cases and promote only matching differential proof 2026-11-21 15:23:51 +01:00
Marius Ciepluch 14036e1ec9 feat(valid-detection-benchmark): 8.3 commit spend before label release with independent V3 case review 2026-11-21 14:11:01 +01:00
Marius Ciepluch 14bf931f01 feat(valid-detection-benchmark): 9.2 remove replacement authority from legacy aggregate scoring 2026-11-21 13:39:38 +01:00
Marius Ciepluch 9ba0a9d4c5 feat(valid-detection-benchmark): 8.2 execute and seal planned observations before spend 2026-11-21 12:41:55 +01:00
Marius Ciepluch a7adc99d31 feat(valid-detection-benchmark): 9.1 route catalog, verification, and assembly through new authorities 2026-11-21 12:41:42 +01:00
Marius Ciepluch 3a9f1d12ab feat(valid-detection-benchmark): 8.1 admission preflight with sealed retry authority 2026-11-21 11:10:05 +01:00
Marius Ciepluch 8b0cf664b3 feat(valid-detection-benchmark): render deterministic transport-neutral operator reports 2026-11-21 10:25:33 +01:00
Marius Ciepluch cf4467aa5e feat(valid-detection-benchmark): implement causal workflow journal with lease-protected head 2026-11-20 22:25:06 +01:00
Marius Ciepluch 0ba6d22d17 feat(valid-detection-benchmark): define closed workflow outcomes and redacted serialization 2026-11-20 21:35:16 +01:00
Marius Ciepluch b1a7ccd231 feat(valid-detection-benchmark): integrate sealed pre-spend diagnostics with reviewed development opening 2026-11-20 20:25:08 +01:00
Marius Ciepluch 5610e7be33 fix(valid-detection-benchmark): collapse nested precondition guard ifs
Ruff SIM102: combine the IfMatch precondition check into one condition;
behavior unchanged.
2026-11-20 20:08:21 +01:00
Marius Ciepluch e6984b2f46 feat(detection-core): resolve 11.4 governance blocker and pass final gate
The owning spec valid-detection-benchmark landed the authoritative
reservation/withdrawal/replacement lifecycle (tasks 2.1-2.4), resolving
the reservation-guard conflict that blocked the full-suite gate. The
final gate instrument now declares the V3 evaluation layer in its core
authority and passes; test_independent_population is green 12/12.
Full-tree 6425 passed with one documented load-induced timing flake
(budget-contract tests pass standalone 52/52).
2026-11-20 20:08:16 +01:00
Marius Ciepluch c122c72da1 feat(valid-detection-benchmark): freeze exact observation checkpoints 2026-11-17 22:42:00 +01:00
Marius Ciepluch 06cee280df feat(valid-detection-benchmark): isolate label blind arm execution 2026-11-17 20:34:11 +01:00
Marius Ciepluch 6a71a86ee5 feat(valid-detection-benchmark): combine preserved arm observations 2026-11-17 17:34:49 +01:00