Skip to content

docs(research): reading path into --quality-delta + a harness design for gate-vs-degradation - #316

Draft
joyful-ii-V-I wants to merge 3 commits into
mainfrom
lane/research-degradation
Draft

joyful-ii-V-I wants to merge 3 commits into
mainfrom
lane/research-degradation

Conversation

@joyful-ii-V-I

Copy link
Copy Markdown
Collaborator

Responds to Nakka, Security Degradation in Iterative AI Code Generation: A Systematic Analysis of the Paradox (IEEE-ISTAS 2025, arXiv:2506.11022), which finds security getting worse, not better, across iterations of an LLM improving its own code.

This work is not filed as a docs/LINEAGE.md row, and this PR does not add one--quality-delta's external/deterministic-gate design predates reading this paper, so it would misrepresent the lineage convention (a row records a lesson actually taken from a cited work). The actual design record is src/quality.h's own top-of-file comment, on main at src/quality.h#L7-L20, which the note below points to instead. Full write-up: docs/research/gate-vs-iterative-degradation.md.

This is a first pass, not a finished study, and says so throughout. No src/ changes. (Base note: measured against main at 755f9026, before 0.6.2; the diff still merges cleanly onto today's main, 15a20855, tag 0.6.2.)

Two parts, one of them an unflattering measurement of our own tool.

  1. A reading path into --quality-delta for an outside researcher — the ten kinds and where each is computed, the baseline model, the ack ledger, the eval harness, and an honest restatement of our own backtest: --quality-delta behaves as a debt ratchet (58% recall / 40% false-alarm rate at a realistic 5-commit window), not a defect detector. That is already true of the tool's own documentation ("report only what got worse") — this is the first time it has been measured rather than asserted, and the note says so plainly rather than only citing the flattering half.
  2. A concrete harness design for the actual question — does a deterministic external gate change the trajectory of repeated self-improvement, not just catch individual regressions — with four pre-registered instruments, two controls for the "the gate also adds prompt length" confound, and an explicit section on what result would count against our own position, including the Goodhart-one-level-down failure mode: the model gaming the gate's visible bar while sub-bar debt still accumulates.

bench/degradeloop/ has the scaffolding — deterministic bookkeeping and measurement calls, with the one seam that needs a real model API left as an explicit NotImplementedError rather than a faked call site. No model was run to produce this; no numbers here are results, and we cannot run them here — that is stated plainly in the doc rather than worked around.

This is a first pass with a lot further to push. We would like help with: a vetted seed-task set, a model-call adapter, a pinned per-language security scanner, and a second opinion on whether the wrong-target confound control (arm D) earns its cost over the neutral-text control alone. Full list at the end of the doc.

Our working premise across this line of investigations: algorithmic, deterministic checks applied while an AI writes are the practical way to keep code sound at the speed AI now writes it — no label, no vendor claim, a check that either fires or it doesn't.

🤖 Generated with Claude Code

…sign for gate-vs-degradation

Responds to Nakka 2025 (arXiv:2506.11022, IEEE-ISTAS), which measures security getting worse
across iterations of an LLM improving its own code. Part 1 is a reading path for an outside
researcher into --quality-delta: the ten kinds and where each is computed, the two-floor baseline
model, the no-op-diff fix from this round (t12-qd-noop), the ack ledger, the eval harness, and our
own honest backtest (a debt ratchet, not a detector: 14/24 recall vs 12/30 control at a 5-commit
window). Part 2 designs the actual experiment — a gated vs ungated iterative-improvement loop, four
pre-registered instruments, the prompt-length confound and two controls for it, and what result
would count against our own position.

This is a design and untested scaffolding, not a result: no model calls were made, and
bench/degradeloop's call_model() seam raises NotImplementedError on purpose rather than faking a
call site. The position (a deterministic external gate as a Goodhart defense) is recorded where it
has lived since before this note — src/quality.h's own design comment — and stays there rather than
being backdated into docs/LINEAGE.md, which is reserved for a lesson actually taken from a work,
not a hypothesis this note argues from.

No src/ changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

barefootski and others added 2 commits September 21, 2026 11:52
ripwirepubliccheck arm 6b requires every file under `docs/` to be reachable
from `docs/README.md`. The row added here is byte-identical to the one on every
other research lane, so eight branches adding the same table line merge without
a conflict.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The note cited "Kalyan Nakka" / "Nakka 2025" at 8 sites for the
Security Degradation paper. The real authors, per the arXiv abstract
page and export API, are Shivani Shukla, Himanshu Joshi and Romilla
Syed (Shukla is first author). Fix the citation line and every
shorthand reference.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants