Repository navigation
feat(exaforce): recall program P0-P7 with lure rules and tooling - #18
Open
will-exaforce wants to merge 100 commits into
Open
will-exaforce wants to merge 100 commits into
will-exaforce wants to merge 100 commits into
Conversation
… calls The fixed default of 8 workers left most of the machine idle. Measured on a 48 GB / 16-core Mac, throughput climbs to ~3.7 units/s at 96 workers and then falls as Bedrock starts queueing calls. The default is now the smallest of half the RAM at 256 MB per worker, 6 workers per CPU, and 96. The scan report already counts LLM calls attempted vs. succeeded. The harness now stores both counts, and the run summary warns when some scans lost calls, which is the throttling signal that means --workers should come down.
Record the --units-file (resolved path + sha256) in runs.config_json and, on --run-id, compare the run's recorded SKILLSPECTOR_EXA_*, SKILLSPECTOR_MODEL, SKILLSPECTOR_PROVIDER, MODEL_OVERRIDE and units-file record against this invocation before purging or scanning anything. Runs without config_json resume with a warning.
doc_medium_cap now drops MEDIUM findings from files whose components row says executable=False, past the first N by (rule_id, file, start_line), before the unchanged upstream rescore, so dropped findings free their rule's diminishing-weight slot. Files without a components row are not capped and every such finding counts regardless of confidence. A gate hit now also raises the replayed score to max(score, 51), as in P1.
Print each run's git sha, UTC start date and SKILLSPECTOR_EXA_* env relative to the first control run (unrecorded when config_json lacks it), and warn when the runs started on different dates. Display only: the verdict is unchanged.
The summary Splits table now shows TP, TN and precision so holdout precision can be read directly; the comparison report gains a per-side counts table and a precision table next to recall.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
L (lure rules) PROMISING by arms (+46 TP / +4 FP, N_TP 4, N_FP 2, all replicates healthy at 10%); the fetch-line guard fails as written (+4.5 > 2) on LLM drift, not on the rule (2 guard units carry an LU finding, <= 0.5 attributable FP). Task 4 held for the user's guard decision.
REJECTED (user decision): arms PROMISING but the fetch-line guard failed as written on LLM drift; rule-attributable gain ~+28 TP (~+0.45 pts full set) at <=0.5 FP. Lure rules stay default-off.
Pre-registered before any Task 4 run: recall, precision/guard and holdout gates are measured on units carrying an EXA-LU* finding in the full treatment run; whole-set numbers reported for information.
Full-set acceptance (control 0e0f9e105cf8, treatment 93c1faec5bec, both healthy): on the 301 rule-matched units dTP +41 (+0.0064 recall, need +0.005), dFP 0 (need <= 2); M has no holdout units. SKILLSPECTOR_EXA_LURE_RULES=off now disables; unknown values warn and stay on. Also fixes lint left by the fix wave (UP031, E402 import order in rulelab, one format nit).
P5 ACCEPTED on the full pair (control 0e0f9e105cf8, L 93c1faec5bec) under the acceptance re-registered in 21e3720: +41 TP on the 301 rule-matched units (+0.0064 recall), 0 FP. Replaces the earlier REJECTED overview and corrects its attribution (+28 TP / +0.45 pt was an undercount; the replay '2x overestimate' was selection bias). Appends both spec report commands.
P6 ACCEPTED at T = 49 (paired replay of bfa51d835e8b; findings identical): recall +0.0087, precision -0.0040, TP +56 / FP +26, holdout +0.0038. Replication on 93c1faec5bec picks the same T. Live smoke not reproduced (scores at the cut move 25-50 points run to run). Appends both spec report commands.
…e (final review C1)
Report head replay is now 60503e65c287 (clamped score; TP/FP unchanged). Corrects the smoke-check spread (2-51 points), adds T = 47's precision reject, the clamp, the five inverted upstream tests, and the replay-source handoff (final re-review I1: record replay sources at threshold 51).
/v1/models returns a random order per call, so the plan's 'listing order' rule is a random draw. User chose the largest open-weight models: deepseek.v3.2, qwen3-235b-a22b-2507, mistral-large-3-675b-instruct (backups kimi-k2.5, glm-5). Target slot: semantic_security_discovery.
…of crashing qwen3-235b returned an object for an SSD explanation; slicing it raised KeyError and killed the P7 qwen screen.
All three SSD-slot candidates REJECT on the dev set (deepseek +13 TP, mistral +5.5 TP, qwen FUTILE); P7 is rejected at the dev stage.
The P7 misses are a detection gap, not the B1 scoring cap; P1/P3/P4 failed on FP cost; the harness crash came from a non-SSD analyzer; holdout bias caveat extended; call-site test for the explanation coercion.
P7 (stronger model in the SSD slot) was rejected at the dev stage. Removes its plan amendment, ledger rows, dev evalset, screen manifests, P7 report and program summary (recoverable from 910859e..0702a6d). Keeps the harness fix 79176a3 and its tests: the non-string explanation crash can hit any run. The outcome is recorded in the consolidated program write-up.
P1 was rejected on FP cost. Removes SKILLSPECTOR_EXA_SEMANTIC_GATE, _GATE_RULES, _GATE_MIN_SEVERITY and _DOC_MEDIUM_CAP from _score_patches, which keeps only P6's block threshold and clamp; their tests and the gate/cap replay-parity cases go too (recoverable from 89959bf..0def329). Keeps patchlib's intercept_module_callable (P6 and the lure rules use it) and replay's offline gate/cap policies (benchmark tooling).
P2 never reached a verdict. Removes _doc_text, _build_context_patches (SKILLSPECTOR_EXA_DOC_TEXT) and the EXA-HT1..3 analyzer (SKILLSPECTOR_EXA_HIDDEN_TEXT) with their tests (recoverable from ead32f4..e5de1bf). Keeps the analyzer registry, and moves the shared is_code_example bypass the lure rules need into _fork_context; registry tests now use the lure analyzer.
…ram (P0-P7) One entry point for the single PR: goal and outcome, method and tooling, each plan's hypothesis, numbers, verdict and code status (including the P1, P2 and P7 rollbacks), cumulative and per-behaviour results, lessons, flags, reproduction commands and ranked next levers. The per-plan records stay in place.
…t-in PR review of the recall program: P6's T = 49 trades about 2.2 malicious catches per benign block on a corpus that is half malicious. The moved units are 0.87% of malicious and 0.41% of benign units, so at realistic malware prevalence the trade is several benign blocks per catch (about 4 at 10%), and the new FPs include mainstream integrations. The flag and clamp stay; unset now means 51, where the patch passes upstream's result through unchanged. - _score_patches: DEFAULT_THRESHOLD = HIGH_FLOOR (51) - tests: unset/blank/non-integer resolve to 51; replay parity pins the unset default to Policy() - conftest/EXPECTED_TEST_FAILURES: the five test_report xfails apply only under the opt-in =49 (9 xfailed by default, 14 with =49) - write-up: head run is now bfa51d835e8b (a real full run at the shipped defaults: recall 0.725, precision 0.930); P6 section records the decision
It failed the 5% threshold in force at P0 (6.9% dropped). The write-up said it fails today's health; report and health both mark it healthy.
P1 stays rolled back. The item now asks for a freshly designed and pre-registered scoring path for HIGH LLM findings, using P1's record as input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SKILLSPECTOR_EXA_BLOCK_THRESHOLD=49; the default stays at upstream's 51). It passed its benchmark test (+0.87 pt recall, −0.40 pt precision), but at real-world malware rates it blocks several benign skills per extra catch, so it is not the default.arms,screen,replay,health,evalset,rulelab,reportextras). It is what let us reject five other attempts (P1–P4, P7) cheaply. Their code is rolled back and their records are kept.Details
Start here.
benchmark/results/recall-improvement-program.mdis the entry point: a summary, each plan's verdict and why, lessons, and next steps ranked by expected value. About 55k of the ~65k added lines are data inbenchmark/results/(evaluation sets, the dev/holdout split, screen manifests, per-plan reports). Apart from the write-up, reviewers can skip that folder.Classifier (
src/skillspector/exaforce/). Runtime patches only; no upstream file is edited._lure_rules.py:107: theEXA-LU1/EXA-LU4regexes, severity HIGH at confidence 0.9, with the paste-host list at:80. Every gap is bounded and long lines are scanned in overlapping windows, so crafted input can't make the scan slow or hide the lure by padding the line.SKILLSPECTOR_EXA_LURE_RULES=offdisables them._score_patches.py:40: the threshold flag. Unset means 51, and the upstream result passes through unchanged. At any other value the score is clamped (:71) so that the CLI exit code, MCPsafe_to_installand the recommendation agree._analyzer_registry.py:71,_fork_context.py:30,_patchlib.py:100: plumbing the lure rules need.intercept_module_callablewraps an upstream function with signature drift checks.Tests. Upstream tests that the patches invert by design are never edited. They are marked strict-xfail in the root
conftest.pyand listed indocs/superpowers/EXPECTED_TEST_FAILURES.md. The fivetest_reportentries apply only while the threshold is 50 or below.Benchmark (
benchmark/). P0's tooling,rulelab(offline match counts for candidate static rules),replaythreshold support, a worker-count default, a dropped-LLM-call count per scan (the basis ofhealth), and a fix that stores a non-stringexplanationas JSON instead of aborting the run (79176a33).Known limits of the lure rules.
EXA-LU1does not exclude private IP ranges and does include gist URLs, so a homelab-stylecurl http://192.168.1.10/install.sh | bashis flagged HIGH. None of the units they fire on are in the holdout split, so there is no out-of-sample measurement. The case for them is that the patterns are generic and match a real campaign.Plans:
docs/superpowers/plans/2026-10-29-recall-p0-measurement.md…-p7-model-split.md; specdocs/superpowers/specs/2026-10-29-recall-improvement-program.md.Tests: 2,046 passed, 9 xfailed (
uv run pytest -m "not integration and not provider" tests/); 2,041 passed, 14 xfailed withSKILLSPECTOR_EXA_BLOCK_THRESHOLD=49; benchmark 214 passed (cd benchmark && uv run pytest).Implementation Plan
Each plan pre-registered its candidates and decision rule before any run. Claims are same-day comparisons on the same code tree, replicated, with arms that differ only in env flags. A rejected plan's code was rolled back in a revert commit and its record kept.
--workersdefault and dropped-call counts (9e8c48cb); why upstream 2.13.1 is on hold (c3cc13f2)baseline-v2run5a0bbb04680326551b950d70b9354821525a426f)cb417b57Main lesson for whoever comes next: about 90% of the malware the scanner misses gets no high-severity finding from the model under any of four models. The limit is detection, not the scoring cap.