Repository navigation
feat(security): real shadow-patch detection against a base ref (Part of #8431) - #8629
Conversation
#8431) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
PR #8629 @ 28f96aa: 3 failed check(s) == full-suite (failure) -- real == full-suite part 1/4 (failure) -- real == full-suite part 2/4 (failure) -- real |
|
Owner 2026-11-18: merge this as the final shadow-patch change; no follow-up slices (see #8431). The current red is the CLI contract: add |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
PR #8629 @ b1b94f2: 2 failed check(s) == crucible (failure) -- real == measure (shard 4/4) (failure) -- real |
|
No description provided. |
Part of #8431 (slice 3, option A). Follows #8611 and #8627, which made the manual flag honest.
What
--shadow-patch-base REF(new, opt-in) runs real detection, independent of any model: a tracked file whose content changed sinceREFwhile theversionof its nearestpackage.json/pyproject.toml([project]) /Cargo.toml([package]) stayed the same is recorded in that file'stelemetry["shadow_patch"](base ref, version, manifest dir). It assigns no threat class or score, so it is its own signal rather than an ML override. Design: the base is a git ref (the issue's "previous scan or a given base ref"), reusing the commit a delta scan already baselines on; the scan DB stores no per-file content hash, so a stored-hash comparison would need a schema change (see Remaining slices).Tests (
tests/security_auditing/test_shadow_patch_8431.py, real temp git repos): changed + no bump flags; changed + bump does not; unchanged never flags; only the changed file flags; manifest-only edit does not; unreadable ref flags nothing; nested manifest governs its own subtree; manifest version parsing.Class / Sibling gaps
Class: the shadow-patch path (#8431 table). Members: flag/override text and docs (done in #8611/#8627); hash/version comparison (done here, as a git-ref comparison); reachability without a model (done here: the new path does not touch
security_auditor.py); tests (done here).Sibling gaps
record_keeper.pycolumn, its migration and a golden re-bless; not here (different mechanism, over the 5-file cap).setup.cfg,pom.xml,go.mod,composer.json, poetry[tool.poetry]): not read; a file under only those never flags. Two manifests in one directory: the last listed wins.security_auditor.pystill skips its manual-flag alert without a model (reachability of the manual hint); belongs to the classifier issue in the epic.Remaining slices
record_keeper.pycolumn + recorders (SARIF/audit) + golden re-bless forshadow_patch.Gates
audit_check.py(ruff, mypy, dead-key, doc-refs, ast-accuracy, signal-coverage) all clear;ruff formatwith the pinned 0.16.10;tests/test_source_reads.py,test_change_classifier.py,test_sweep_plan.py,test_generated_branch.py,tests/security_auditingpass; one real CLI run with--shadow-patch-base HEADon a planted repo completed. Not run:pr_gates --ratchetsand the golden bless (the flag is opt-in and off by default, so no scan output moves; CI's crucible check is the check of that). Hand-written files: 4 (shadow_patch.py,galaxyscope.py, its test,security/README.md).Lessons for agents
tests/test_source_reads.pyfails on a newopen(..., encoding=...)read ingitgalaxy/: usegitgalaxy.core.source_text.read_source(path).text.doc_refs_auditflags a new module named in a README until the file isgit added (it reads tracked files).🤖 Generated with Claude Code