Files
Open_Ultra_SAST/.kiro/specs/ir-consolidation/brief.md
T
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

100 lines
6.5 KiB
Markdown

# Brief: ir-consolidation, stop maintaining an IR we did not need, and adopt one we do
> **Status 2026-10-02:** dormant. Brief only and unapproved. The subtraction it asks for still needs a measured recall comparison before the flat IR goes.
**Status:** brief only, unapproved.
> **Overtaken 2026-11-24:** question 2 (the C arithmetic class and a second pipeline) is not pursued. The
> maintainer decided 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.
## Why now
> "we should make sure our code base here doesn't explode. for example we have a custom IR. maybe vine
> (berkely) or another existing IR (rolf rolles had one) ... I know Ghidra has one we could steal"
Two different questions live inside that, and they have opposite answers. Keeping them apart is most of the
value of this brief.
## Question 1, the source IR we already replaced and never retired
`semantic/` is **3,218 lines, 16% of the codebase**: a hand-written IR (`ir.py`, `cst.py`) and a flat taint
engine (`taint.py`), plus the overlay that runs them. `model-grounded-detection` measured that IR against
Joern's CPG and the result was decisive, **2.2% entailment against 41.3%**, which is why the CPG was
adopted for the model layer. The flat IR was never removed, and still runs as a proposer in every scan.
So the outgrowth is not something we are about to add. It is something already carried.
**Vine and P-Code do not help here.** Both are *binary* IRs. Vine lifts executables (BitBlaze, UC Berkeley,
GPL-2.0, last significant activity 2009), and P-Code lifts machine code. Our source languages are Python,
PHP, JavaScript and Java, and the source IR we should adopt is the one we already have. The work is
subtraction, not substitution:
- Can the CPG serve the overlay's job at equal or better recall?
- What does deleting `semantic/`'s IR and taint cost, measured on the pair corpus and both repositories?
- What has to stay? `obligations/` reads the same facts and is a different analysis.
A candidate ~1,000-line deletion with a number attached, which is the only kind worth doing.
## Question 2, the abstraction we are missing, where an existing IR is exactly right
`c/memory` has produced **zero true positives** and three distinct classes of false one. The reason is
structural and now stated in the report (Req 5.6): it models unbounded string CALLS, while real C overflows
are *arithmetic* (an index, a pointer offset, a `memcpy` whose size is computed). Every one of libpng's is,
and its library code never calls a modelled string API at all.
"Can this expression exceed this allocation" is a value question, not a reachability one. **Rolf Rolles'
GhidraPAL carries a three-valued-logic abstract interpreter over Ghidra P-Code**, with each bit definite 0,
definite 1, or unknown, and with abstract transformers for `INT_ADD`, `INT_MULT`, `INT_AND`, the comparisons,
validated against concrete execution in its own tests. That is precisely the shape of analysis the C family
lacks, and it exists.
### The candidates, and why they are not equivalent
| | language | IR | analyses | licence | state |
| --- | --- | --- | --- | --- | --- |
| **angr** | **Python 3** (+ Rust) | VEX, lifting | CFG recovery, data-dependency, **value-set analysis**, symbolic execution | BSD-2-Clause | actively maintained, ~14.8k commits |
| **GhidraPAL** | Java | Ghidra P-Code | **three-valued-logic abstract interpreter**, transformers validated against concrete runs | see repo | research code, small |
| **Vine** | OCaml/C++ | own IL | BitBlaze static analysis | GPL-2.0 | dormant since 2009 |
**angr is the strongest candidate and Vine is not one.** Three things decide it:
* It is Python. This codebase is Python with `dependencies = []` in the core, and every heavyweight
capability so far has been reached across a subprocess boundary rather than imported. angr fits that
pattern as an extra, the way `harnessx` and the tree-sitter grammars already do.
* Value-set analysis is the abstraction we are missing, by name. "Can this index exceed this allocation"
is a VSA question, and VSA is abstract interpretation rather than SMT -- which is the choice
`model-grounded-detection` already made and gave its reasons for.
* BSD-2-Clause, against Vine's GPL-2.0. This project has a standing rule about never vendoring code
without a stated licence, and a GPL dependency is a decision about the whole tool rather than about one
analysis.
GhidraPAL stays interesting for a different reason: it is a worked example of the *domain*, not a platform.
Its TVL bit-vector and its validated transformers for `INT_ADD`, `INT_MULT` and the comparisons are the
thing to read before writing any abstract domain here, whether the platform underneath is angr or Ghidra.
It is also the honest answer to a decision this project already took. `model-grounded-detection` chose
abstract interpretation over SMT, and chose to build the model from code because execution cannot be
assumed. A bit-level abstract interpreter over P-Code is *still abstract interpretation* and still static.
What changes is the artifact: it needs a **built** library rather than its source.
## What this brief must decide
1. Whether the source-IR subtraction is safe, measured rather than assumed.
2. Whether the C arithmetic class is worth a second pipeline at all, or whether `c/memory` stays scoped to
string misuse and says so, which is where task 2.16 left it, deliberately.
3. If it is worth it: **angr** first, on language, licence and the fact that value-set analysis is the
named abstraction -- with GhidraPAL read as the worked example of a bit-precise domain rather than as a
platform. Vine is dormant since 2009 and is not a candidate.
4. What a second pipeline costs in the one currency this project has been strict about,
**the number of things that can silently return nothing rather than lines.** This session found three separate quiet failures
in one PHP scan. A binary pipeline adds a build step, a lifter, and a domain, each of which can produce
an empty result that looks like a clean one.
## The constraint that governs it
Nothing here may grow the codebase without a measurement that justifies it, and the module audit
(`benchmarks/measurements/2026-09-08-module-audit.json`, currently 97 modules with no orphans) is the
instrument. A brief that ends in "adopt P-Code" and 3,000 new lines while `semantic/` still carries 3,218
has made the problem worse, not better. **Question 1 should land before Question 2 starts.**