feat(pre-push-safety-net): connect change context to ranked questions

This commit is contained in:
Marius Ciepluch
2026-09-13 10:41:32 +02:00
parent 546db24b8e
commit ebad83009e
11 changed files with 1570 additions and 17 deletions
@@ -90,3 +90,39 @@ This manually declared entry-region smoke does not validate mapper discovery,
PMPro/NodeGoat replay, capability admission or hook latency.
Nine of 27 tasks are now complete; tasks 3.3–3.4 remain for this group.
## Task 3.3 evidence
Independent review APPROVED after one required repair; verification status VERIFIED,
claim type TASK. The fresh reviewer suite passed 1,128 tests, nine skipped, in
105.95 seconds. Global Ruff, formatting (224 files), mypy (108 source files) and
diff checks passed. The context suite contains 23 focused cases.
The generic driver accepts `change_context` and retains its enriched form. Existing
taint evidence optionally projects full first-party method paths/ranges for entry,
callee, same-file field, known hook and sanitizer context. Decoded snapshot changes
and lexical anchors attach to exact questions without changing ranking weights or
introducing another scope selector. Missing base, locations, empty projections,
dynamic/external/depth dependencies and unsupported configuration/deleted-dependency
projections remain explicit gaps. Missing context prevents tier-zero pruning and
complete-negative outcomes; raw answers remain available.
Review found that broad source/sink/sanitizer text matching could mistakenly exempt
an unknown consumer such as `unknown(req.body)` from missing-context reporting.
The production-query regression reproduced exit 1 with that question incorrectly
pruned as tier zero. The task-local repair restricts the exemption to directly
invoked fact-modeled operations. Existing detector matchers are unchanged. After
repair, consumers of a source, nested sink and sanitizer name all remain unresolved;
a direct modeled sink completes, and the direct sanitizer retains tier zero without
a false context gap.
`benchmarks/measurements/2026-09-13-change-context-smoke.json` retains the final image
and matching backend/driver/regions/snapshot/query hashes, plus both runtime checks.
Real Git histories remove a caller guard while keeping helper code unchanged. PHP
reads 124 source bytes and reaches `helper.php:2:helper` in 63.48 seconds; JavaScript
reads 133 bytes and reaches `helper.js:1:helper` through an ES-module import in
39.63 seconds. Both preserve the dirty checkout/index and remove snapshot scratch.
These are controlled change-to-question/witness checks, not proof that the removed
line enforced security, that the defect is new, or that a hook meets its latency bar.
Ten of 27 tasks are now complete; task 3.4 remains for this group.
+4 -3
View File
@@ -1,7 +1,7 @@
{
"feature_name": "pre-push-safety-net",
"created_at": "2026-09-12T15:35:00Z",
"updated_at": "2026-09-13T08:16:14.274231+00:00",
"updated_at": "2026-09-13T08:41:28.781759+00:00",
"language": "en",
"phase": "implementation",
"approvals": {
@@ -71,9 +71,10 @@
"2.2",
"2.3",
"3.1",
"3.2"
"3.2",
"3.3"
],
"remaining_tasks": 18,
"remaining_tasks": 17,
"verification_record": "implementation-group-3.md",
"verification_records": [
"implementation-group-1.md",
+3 -2
View File
@@ -1,7 +1,7 @@
# Implementation Plan: pre-push-safety-net
Status: task plan approved by the maintainer's "approve." on 2026-09-12. Groups 1 and 2 (tasks 1.1–2.3)
are complete after independent review and fresh verification. Group 3 is in progress (3.1–3.2 verified); groups 4–8 remain pending;
are complete after independent review and fresh verification. Group 3 is in progress (3.1–3.3 verified); groups 4–8 remain pending;
the hook and capability admission are not yet implemented. See `implementation-group-1.md` and `implementation-group-2.md`.
## Execution contract
@@ -95,13 +95,14 @@ the hook and capability admission are not yet implemented. See `implementation-g
- _Boundary: Ranker Scope Contract, generic driver integration_
- _Requirements: 2.1, 2.2, 6.4, 7.3, 8.1, 8.2_
- _Verified 2026-09-13:_ independent review APPROVED; 1,105 passed, nine skipped; global Ruff/format/mypy passed. Twenty-four independent order/budget/missing-family combinations retained all question identities. Packaged PHP/JavaScript smoke selected the same controlled risky operation at tier 4/score 2.5, with exact execution/outcome IDs and reconciled family coverage. Missing evidence, partial graphs and interrupted arbitration remain explicit; CLI consumes authoritative scope. Evidence: `benchmarks/measurements/2026-09-13-ranker-scope-smoke.json`. No new ranking weights or hook admission claim.
- [ ] 3.3 Connect change context to supported first-party relationships
- [x] 3.3 Connect change context to supported first-party relationships
- Use existing entry/callee, field, hook and guard relationships to supply affected context to ranked questions, including unchanged sinks after source/guard changes.
- Preserve current abstract semantics; absent dynamic or external relationships remain unresolved rather than guessed safe. A required new feature or fact is reported to its owning spec.
- Done when controlled cross-file and removed-guard cases reach the relevant question/witness, while an unresolved boundary cannot produce a complete negative.
- _Boundary: Ranker Scope Contract, Snapshot Adapter integration_
- _Depends: 2.3, 3.2_
- _Requirements: 2.1, 2.2, 2.4, 8.1, 8.2_
- _Verified 2026-09-13:_ independent review APPROVED after an unknown-call boundary repair; fresh suite 1,128 passed, nine skipped; global Ruff/format/mypy passed. Real PHP/JavaScript Git guard-removal snapshots reached unchanged helper-file witnesses with local dirty state preserved. Production negative regression reproduced then fixed unknown(req.body) being pruned as tier zero: modeled arguments no longer summarize unknown consumers. Existing ranking and detector semantics unchanged; unsupported projections remain explicit. Evidence: `benchmarks/measurements/2026-09-13-change-context-smoke.json`. Lexical attribution is not semantic novelty or alert admission.
- [ ] 3.4 Apply vendor exclusion and explicit language partitions
- Reuse declared layout exclusions before target enumeration and graph build; retain unshipped first-party tests and separate browser/server or language capability coverage.
- Build supported frontend partitions explicitly; preserve unknown cross-language and vendor semantics without restoring excluded sources.