Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1d63651
qd: call-sequence clone idiom (QD-FALSE-ROWS-E0) + stale_tree header …
joyful-ii-V-I Nov 19, 2026
f2be3cd
qd-false-rows: prereview fixes (if/else verdicts in (B2), legend dict…
joyful-ii-V-I Nov 19, 2026
6e7ab89
qd: tangle kind (report-only), D4 best-since ratchet, improved sectio…
joyful-ii-V-I Nov 19, 2026
1396bdb
qd-tangle: first build — def record size 98, versions above in-flight…
joyful-ii-V-I Nov 19, 2026
9cf8799
qd-tangle: census FP classes — cursor reads (bounds, indices) do not …
joyful-ii-V-I Nov 19, 2026
4611333
qd-tangle: census FP class 3 — a steering slot lives until its block …
joyful-ii-V-I Nov 19, 2026
ee551c9
qd-tangle: replay fixes — ratchet reads the first-parent line; a tang…
joyful-ii-V-I Nov 19, 2026
d4bae54
qd-tangle: own-branch qd refactor — helpers for the tangle additions,…
joyful-ii-V-I Nov 19, 2026
e3446a1
qd-tangle: writeTangleLines reuses writeHexPairLines; steer_find keep…
joyful-ii-V-I Nov 19, 2026
be86e14
qd-tangle: qddegradecheck fixture gains a tangle change (arm C judged…
joyful-ii-V-I Nov 20, 2026
b1ee031
qd-tangle: prereview items — steer declaration shape is a langfacts c…
joyful-ii-V-I Nov 20, 2026
a63c428
qd-tangle: drop the 4-argument pathQualifiedKey overload (api-surface…
joyful-ii-V-I Nov 20, 2026
7f14b94
qd-tangle: record the legend dictionary's new dictv (4ba5085036feeb02…
joyful-ii-V-I Nov 20, 2026
7347f43
qd-lessons-1: a clone row over different data stops gating; a repeate…
joyful-ii-V-I Nov 20, 2026
b066024
qd-lessons-1: own-range qd clean-up, guard-provable facet negatives, …
joyful-ii-V-I Nov 20, 2026
847a236
qd-lessons-1: sortutil::sortUnique is the one sorted-unique step the …
joyful-ii-V-I Nov 20, 2026
23ed7ee
qd-lessons-1: Eval::sortUniq and normSet take sortutil::sortUnique in…
joyful-ii-V-I Nov 20, 2026
e320178
qd-lessons-1: an idiom group whose members share a domain value keeps…
joyful-ii-V-I Nov 20, 2026
723c552
qd-lessons-1: functionNameHashes is a filter/transform view, not a si…
joyful-ii-V-I Nov 20, 2026
1a08b47
qd-lessons-1: census numbers after operand rule (6)
joyful-ii-V-I Nov 20, 2026
c7d3756
qd-lessons-1: the literal proof refuses a separator-parameter copy; a…
joyful-ii-V-I Nov 20, 2026
ac82bbd
qd-lessons-1: census numbers after the two refusals (head11)
joyful-ii-V-I Nov 20, 2026
07c91cc
qd-lessons-1: prereview — gate ok() write check, status notes, regres…
joyful-ii-V-I Nov 20, 2026
0674456
qd-lessons-1: the compact why= reading covers the clone row in the by…
joyful-ii-V-I Nov 20, 2026
0511830
qd-lessons-1: record the legend dictionary's new dictv (eb13eea6256a6…
joyful-ii-V-I Nov 20, 2026
33dc95a
qd-shrink-pair (WIP, NOT YET BUILT): a clone pair that crossed the ba…
joyful-ii-V-I Nov 20, 2026
cc73856
qd-shrink-pair: a member cut to under half its base body still gates …
joyful-ii-V-I Nov 20, 2026
63759c2
qd-shrink-pair: record the legend dictionary's new dictv (e2aa5aa57e9…
joyful-ii-V-I Nov 20, 2026
1426024
qd-shrink-pair: qd own range — one body-start rule, one sorted-row lo…
joyful-ii-V-I Nov 20, 2026
97f837f
qd-shrink-pair: a history blob's definition keys through one pathQual…
joyful-ii-V-I Nov 20, 2026
710c87d
qd-shrink-pair: the parts keying rule is definitionQualityKey, not a …
joyful-ii-V-I Nov 20, 2026
9211125
qd-shrink-pair: ack the one-statement pair pathQualifiedKey(relPath, …
joyful-ii-V-I Nov 20, 2026
9030e91
qd-shrink-pair: LIMITS.md rows for the two shrink caps; langidentity …
joyful-ii-V-I Nov 20, 2026
c86e05b
qd-shrink-pair: the WIP commit b7c0cd65b is now built and verified
joyful-ii-V-I Nov 20, 2026
2d27798
shstatus: the B43 exit-status matcher's C++ port, held to test/lib/ex…
joyful-ii-V-I Nov 19, 2026
c13c09e
exitstatus: a single quote inside "$( … )" is a live quote (one match…
joyful-ii-V-I Nov 19, 2026
ebae905
defect-shape vacuous-assert: a status-dataflow walk on the B43 matche…
joyful-ii-V-I Nov 19, 2026
bbbc4ca
defect-shape vacuous-assert: sites() runs five named shape steps; vis…
joyful-ii-V-I Nov 19, 2026
e51be3a
shstatus/defectshape: the eight functions past the new-function ceili…
joyful-ii-V-I Nov 19, 2026
f9b7173
shstatus: Parser's kw and isOp ask one peekIs (the pair was a within-…
joyful-ii-V-I Nov 19, 2026
cfaba5c
chore(quality): ack the lane's 13 shape-only clone rows, each with it…
joyful-ii-V-I Nov 19, 2026
d6953ad
quality: kQSnapCacheScheme 34 -> 35 (the vacuous-assert site set move…
joyful-ii-V-I Nov 19, 2026
fee9443
qd defect-shape: unchecked-status, a dropped I/O or child status (QD-…
joyful-ii-V-I Nov 19, 2026
38a1ed0
unchecked-status: reuse rw::inSet, keep scanPython's arity; defectsha…
joyful-ii-V-I Nov 19, 2026
f72b8a6
unchecked-status: os:: shims, precision from the census, p= at the ea…
joyful-ii-V-I Nov 19, 2026
dcee925
unchecked-status: EVALS measurement, COMMANDS regen, if/else verdicts…
joyful-ii-V-I Nov 20, 2026
8c8951c
unchecked-status: dictv + printf-parity re-pin, changelog fragment, a…
joyful-ii-V-I Nov 20, 2026
3e81d97
qd: defect-shape facet unhandled-arm — a classifier that gives a valu…
joyful-ii-V-I Nov 20, 2026
1188b6e
unhandled-arm: qd own range — named steps, shared helpers, no wider s…
joyful-ii-V-I Nov 20, 2026
e1b970b
unhandled-arm: EnumTable::add takes one def; scanC names only its enu…
joyful-ii-V-I Nov 20, 2026
cd5bff0
unhandled-arm: facetNamesSite reads a facet bit; re-pins and measured…
joyful-ii-V-I Nov 20, 2026
fca1244
unhandled-arm: one present-only call=/why= helper pair, so runQuality…
joyful-ii-V-I Nov 20, 2026
c5f2822
unhandled-arm: the JSON member helper returns its text (no clone of l…
joyful-ii-V-I Nov 20, 2026
1465a17
SORT-UNIQUE-HELPER: the sort-then-erase(unique) pair spelled once (so…
joyful-ii-V-I Nov 19, 2026
9c1f02d
SORT-UNIQUE-HELPER: one "is this word one of these" helper (rw::isOneOf)
joyful-ii-V-I Nov 19, 2026
913b8cc
portablebuildcheck #6b/#6c: read sortutil::sortUnique as a ranges::so…
joyful-ii-V-I Nov 19, 2026
0856a30
ingest_valuerefs: isDeclaratorWrapper reads through rw::isOneOf
joyful-ii-V-I Nov 19, 2026
8277512
train ge2 compose: one sortUnique for both stacks and sort-unique
joyful-ii-V-I Nov 20, 2026
b0d4696
train ge2 compose: thirteen kinds everywhere; defect-shape languages …
joyful-ii-V-I Nov 20, 2026
8dde6ea
train ge2: ack the one composition clone row qd-range gated (unitIdsO…
joyful-ii-V-I Nov 20, 2026
cce45d3
train ge2: re-pin binary-pinned files once from the composed build; f…
joyful-ii-V-I Nov 20, 2026
3a0b426
train ge2 compose: defectshapecheck reads the one merged compact why=…
joyful-ii-V-I Nov 20, 2026
cd0ae3b
train ge2 compose: hazard registry follows blobPoolWorker; no throwin…
joyful-ii-V-I Nov 20, 2026
80e60ca
train ge2 compose: capdisclose rows for the two tangle thresholds
joyful-ii-V-I Nov 20, 2026
7729be2
train ge2 CR round 1: --quality-kinds help names thirteen kinds; chan…
joyful-ii-V-I Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .ripwire_quality_acks

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<p align="center"><a href="https://trendshift.io/repositories/217924?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-217924"><img src="https://trendshift.io/api/badge/trendshift/repositories/217924/weekly?language=C%2B%2B" alt="Trendshift: C++ Repository of the Week badge for redhat-et/ripwire" width="250" height="55"></a></p>

Ranked, deterministic call graph: what to touch, what it breaks, which tests to run. On the edit: blast
radius, tests that reach it, twelve quality kinds reporting only what got worse, forgotten co-changes, fields
radius, tests that reach it, thirteen quality kinds reporting only what got worse, forgotten co-changes, fields
read and written, names that resolve more than one way.

**Just want to use it?** Install it with the one line below, then start each coding session by telling your agent to
Expand Down Expand Up @@ -961,12 +961,13 @@ firing on the same function is corroboration rather than one metric counted twic
That matters most for code an agent wrote. Empty-catch error masking is **+47%** more common in
AI-authored commits, a function rewritten again inside two weeks **+15%** more likely, and reuse is
*declining* as AI's share of commits grows (GitClear, *AI Copilot Code Quality*, 2026). Ten of
`--quality-delta`'s 12 kinds each target one measured mode like those (the eleventh, `placeholder`,
`--quality-delta`'s 13 kinds each target one measured mode like those (the eleventh, `placeholder`,
lists the stubs and TODOs a change adds, and never gates; the twelfth, `defect-shape`, catches four
defect shapes review kept finding by hand —
new-symbol rows never gate, except defect-shape format-arity and a new function at the ceiling,
because a format/argument mismatch is a defect, not debt, and a new function at 4x the bar — ccx 60 or 240 lines —
is how a 1,000-line function starts), and it reports **only what your
is how a 1,000-line function starts; the thirteenth, `tangle`, is report-only: a long function's nesting, deep share and
steering locals, with length only amplifying them, so a long orchestrator of named steps stays quiet), and it reports **only what your
change made worse** — then `--exemplar` shows the pattern in your own repo to copy, and `--test-gate`
names the tests that must run before "done."

Expand Down
16 changes: 16 additions & 0 deletions changelog.d/qd-false-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Changed — quality-delta: a run of calls that shares no callee is an idiom collision, not a copy; range answers say when the files on disk moved on

Duplication rows gain a fifth recognized idiom, `call-sequence`: a body that is only call statements (no return,
declaration, assignment or control flow). Normalized, every such body reads `$I . $I ( … ) ;` repeated, so a
reused two-line helper (`sortUnique`: sort, then erase-unique) gated as a NEW clone of a four-call stream writer
and of a bench wrapper it has nothing in common with. A call-sequence group whose members share no callee or
other identifier (parameter names, `std::` chains and container words aside), sit in different files or scopes,
are under 80 tokens and are not one body with renamed parameters is now reported `sev="minor"` with
`idiom="call-sequence"` instead of gating. A shared callee, one namespace, or a parameter-only rename keeps it
gating. On this repo, tmux and hono the rule demotes no existing clone group; `test/cloneidiomcheck.sh` arm (P)
pins both directions.

`--quality-delta=A..B` now carries `stale_tree="1"` (and a one-line stderr note) when the files on disk are not B's
tree — uncommitted edits, untracked files, or a HEAD whose tree differs from B's (another commit with the same tree is
not stale) — so a green range answer is not read as a
pass for the files on disk. Never gating; `test/qdrefpaircheck.sh` arm (B2).
41 changes: 41 additions & 0 deletions changelog.d/qd-lessons-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### Changed — `--quality-delta`: a short clone row over different data stops gating; a repeated decision is named on its complexity row

**Clone rows over different data (QD-IDIOM-ELEMTYPE).** Some clone groups are under 80 tokens, sit in distinct
contexts and were not already demoted as a recognized idiom. Such a group is now reported `sev="minor"`, and no
longer gates, when every pair of members operates on different data. "Different data" means one of two things.
The members share no literal: 0 and 1 are left out, and `true`, `nullptr`, `None` and the like count. Or the members
take the same number of concrete parameters, with a different type at some position. The row says which with
`why="different literals"`, `why="different parameter types"` or `why="different literals or parameter types"`.
A shared literal rules out the literal proof, and a template or generic member or an untyped parameter rules out the
type proof; a group with neither proof keeps gating, as before. A recognized idiom whose members share a domain
value, such as a ladder over the same `Grade::Poor` … with tuned thresholds, a pair sharing a named constant, or a
pair calling the same helper, keeps gating under both proofs. A function passed by value, like `svLess`, does not
count. Two bodies that both pass their literal straight to a call keep gating too, because that is one function with
the literal as a parameter (`rfind( '/' )` beside `rfind( "::" )`, the `afterLast` family).
`--clones` does not read this verdict and is byte-identical.

Measured on ripwire's own history, gating rows fell from 13 to 3 on the 13 acknowledged VA-FORMS rows. The 3 that
still gate do so by design: one is past the 80-token ceiling, and two members share the literal `0x80`. Other ranges:
- 41 to 36 on 40 tmux commits;
- no change on the qd-tangle range, the last 20 merges, the slip commits, textual or 20 other tmux commits;
- 1,863 to 1,327 on a synthetic envoy range that adds two whole subtrees.

The real duplicates still gate (`writeTangleLines`/`writeHexPairLines`, `steer_find`/`JsonNode::get`). Hand-reading
24 envoy demotions found 21 idiom collisions over different data and 3 borderline rows, among them the identical
"all matchers match" loop over two element types. None was a verbatim copy. `test/cloneoperandcheck.sh` pins the
path: three positives, six counted negatives and a guard-off proof.

**A repeated decision (QD-REPEATED-DECISION).** A function may test the same condition twice: the same 6 or more
tokens, verbatim, in an `if`/`while`/`elif` or a `( … ) ?` ternary. Or it may repeat a loop body: 12 or more tokens
identical. Its complexity or tangle row now carries `fix="name the decision once: <condition> is tested at lines A and
B"` or `fix="name the loop once: the loop body at line A repeats at line B"`. This is a facet. It never makes a row,
and it never changes a severity or gating. In Python a keyword counts only when it starts its line, so comprehensions
and conditional expressions are not read as statements. Ruby, Lua, Elixir and shell are not read.

On ripwire's last 20 merges 14 rows gained the fix, among them `chooseInWindow`'s copied pass loop. Three of the 42
distinct fix= rows across the ripwire, tmux and textual ranges re-test a fact that changes in between:
`memguard::overHardLimit()`, `!qsnapGet(…)` and tmux `event_initialized`. For those, deciding once is the wrong advice.
`test/repeateddecisioncheck.sh` pins it with two positives and five counted negatives.

The legend defines `why=` on a clone row and the new fix= text only when a row carries them. The compact dictionary's
`why` entry now also covers the clone row, so its `dictv` moves.
26 changes: 26 additions & 0 deletions changelog.d/qd-shrink-pair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
### Changed — `--quality-delta`: a clone pair that crossed the bar only because one member shrank stops gating

**Shrink-only clone pairs (QD-SHRINK-PAIR).** A Type-3 pair's similarity is 2·LCS/(|a|+|b|), so it rises when either
member loses tokens the other does not share. Handing a body's sort and `erase( unique )` lines to a helper therefore
made it look more like its neighbour: on lane/sort-unique, `cFamilyMacroNames` fell from 135 to 99 tokens, its shared
LCS with `jsExportsOf` fell from 84 to 81, and the pair crossed 0.8. It printed as a gating duplication row and a gating
new-clone-of-reused-helper row about an edit that removed code and copied none.

Such a row is now reported `sev="minor"`, and no longer gates, when all of these hold:
- every member existed at the base;
- some member's body has fewer tokens now, and no member's body was cut to under half its base tokens;
- no pair's shared LCS grew.

The row says why: `why="pair crossed the bar because cFamilyMacroNames shrank 135->99 tok; shared code did not grow
(LCS 84->81)"`. A pair whose LCS grew still gates, even while a member shrank, because code was copied in. A member
cut to under half its body is a rewrite the rule cannot judge (a long base body holds most short ones as a subsequence,
so its base LCS says nothing), and it still gates. A group with
a member the base did not hold still gates, and so does one with an overload under a member's key, more than four
members, or a body the base commit could not be read for. The base bodies are read from git at the base commit for
the files of those rows only: the range form's base, or HEAD for the working-tree form, MCP `quality_delta` and the
`--quality-baseline` dirty-pin check. They are read with the same extraction and tokenizer the clone pass uses.
No snapshot or cache format changes. `--clones` does not read this verdict and is byte-identical.

The legend defines the new `why=` only when a row carries it, and the compact dictionary's `why` entry now covers it,
so its `dictv` moves. `test/shrinkpaircheck.sh` pins the rule with three positives (range, working tree, MCP), a
both-shrank positive, four counted negatives and a guard-off proof.
13 changes: 13 additions & 0 deletions changelog.d/qd-tangle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Added — `--quality-delta` reports `tangle`, the thirteenth kind, with a best-since-tag ratchet and an `<improved>` section

A long function whose nesting goes past 3, whose deep regions take a growing share, or whose steering locals (a
primitive set in one step and read by a branch 10 or more statements later) multiply, scores a tangle: T from those
three inputs, S = T x log2(lines / 50), so a function of 50 lines or fewer scores 0 and a long orchestrator of named
steps scores 0 too. The row is report-only (always `sev="minor"`) and carries `why=` (the inputs that rose), `fix=`
(the shape the rise calls for, with lines) and `locals=` (the steering locals); `--metrics` gains `steer=` and
`tangle=`. Short arms of a 4+-arm switch or else-if chain are left out of the deep share, so a flat dispatcher reads
flat. A function above its best since the last tag gets `ratchet="TAG"` (the history is read on the first-parent
line, at most 512 versions; a ref-pair range reads no history and gets no ratchet), and an `<improved>` section (JSON
`"improved"`) lists what the change made better, never as a row and never gating. Measured on 44 hand labels across
ripwire, tmux, textual and envoy: AUC 0.986 for S (0.728 for the cx metric, 0.882 for ccx). The ingest
cache moves to 54 and the warm snapshot to 4 (the definition record carries the steering byte), so both rebuild once.
12 changes: 12 additions & 0 deletions changelog.d/qd-unchecked-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Added — `--quality-delta` names a dropped I/O or child status (`defect="unchecked-status"`)

A fifth defect-shape facet reports, as a minor row that never gates, a status the change drops: in C/C++ a
statement-level `pclose`, `rename`, `write`, `system`, `fflush` (not of stdout/stderr), `waitpid` whose status
nothing reads, and `fclose`/`close` of a stream or fd the function wrote (plain, `std::`, `os::` or `rw::os::`); in
Python `subprocess.run` without `check=` whose result is dropped or read only for its output, `subprocess.call` and
`os.system`. A `(void)` cast, `check=` and a cleanup inside a failed write's branch say "decided" and give no row. The
row's `p=` is the dropped call's line and its new `call=` attribute names the call (XML, `--json` and MCP). Replaying
three fix commits backwards gives their rows (3 of 3); a 20-site hand-check on tmux, code-review-graph and this tree
found 20 of 20 drops real and 16 worth a check. Go `_ = f()` and Rust `let _ = f()` stay out, as in error-masking.
The quality snapshot scheme moves to 37 (qd-unhandled-arm, later in the same release, takes it to 38), so an older snapshot cache is rebuilt once; the legend dictionary moves to
`dictv=ff6a8ec8438b7fe0 entries=1176` (with the other quality-delta changes in this release).
15 changes: 15 additions & 0 deletions changelog.d/qd-unhandled-arm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Added — `--quality-delta` names a classifier that leaves a value without an outcome (`defect="unhandled-arm"`)

A sixth defect-shape facet reports, as a minor row that never gates, a classifier over a closed set that gives a
value it does not name no outcome: a C/C++ `switch` with no `default:` that decides a value (every arm returns one,
or every arm assigns the same name) over an enum defined in the indexed tree and leaves one of its enumerators out
(count sentinels such as `kFooCount` and aliases are owed no arm); a shell `case` with no `*)` arm that ends its
function with `return`/`echo`/`printf` arms, or whose arms each set one name read after `esac`; a Python if/elif
chain or `match` that ends a value-returning function with no `else`, so an unmatched value returns `None` (an
`Enum` the file defines is checked for coverage). The row's `p=` is the switch's line and its new `why=` attribute
names what is left out (XML, `--json` and MCP). Because the site names the missing enumerators, appending one to an
enum gives a row on every switch it leaves incomplete, even an untouched one. A default/`*)`/`else`, full coverage,
a comment that states the omission, a void dispatcher, an `#if` in the switch or the enum, and generated code give
no row. Rust and TypeScript stay out (the compiler checks `match`; TS has no never-check reading yet). The quality
snapshot scheme moves to 38, so an older snapshot cache is rebuilt once; the legend dictionary moves to
`dictv=ff6a8ec8438b7fe0 entries=1176` (with the other quality-delta changes in this release).
9 changes: 9 additions & 0 deletions changelog.d/qd-va-forms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Changed — `defect="vacuous-assert"` reads a test script's exit-status dataflow, not a grep prefilter

The vacuous-assert facet now runs on a C++ port of the exit-status matcher in `test/lib/exitstatus.py`
(`src/shstatus.h`; `test/gateexitcheck.sh` H4 holds the two equal on 9,144 calls). It reports an assertion that
passes on an empty text (an absence `grep`, `[ -z ]`, a `cmp`/`diff`/`=` parity) when the text was read off a run
whose status nothing checks: a capture, a pipe without `pipefail`, a redirected file, a dropped wrapper status, a FAIL
reporter inside `$( )` or an unread `rc=$?`. Every test script is read (the `grep` prefilter is gone). Recall is 8 of
11 on this project's own fix commits (it was 0), with 0 new rows on a forward replay of the same files. The row stays
`sev="minor"`. The quality snapshot scheme moves to 35 (later members of the same release take it to 38).
Loading
Loading