Repository navigation
test(audit-engine): an all-cached re-audit feeds the probe rules the same endpoints as a refresh #2081 - #2160
Merged
Merged
Conversation
…same endpoints as a refresh #2081 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
marked this pull request as ready for review
November 20, 2026 20:46
nc9
added a commit
that referenced
this pull request
Nov 20, 2026
…pass (#2082) (#2164) security/unauthenticated-api reports every leaking current-user endpoint with no hand-off; after the site pass the runner keeps exactly one finding per endpoint (security/auth-endpoint-disclosure's when its results include the endpoint, otherwise unauthenticated-api's). Before, an endpoint handed to the auth rule lost its finding when that rule threw or ran past its time budget. The deferredToAuth detail on the unauthenticated-api clean row is replaced by reportedBy/reportedElsewhere. landed during Actions billing lock: Daytona CI pubci-11202044-240a587 (PASS at 240a587; quality, tests, build; DCO 2/2). 4 behind main at merge (#2143, #2150, #2161, #2160): no overlap with packages/rules/src/runner.ts, packages/rules/src/security/ or the 1886/2082 tests. Hold-list security-rule change: merged on Nik's approval. Signed-off-by: Nik Cubrilovic <[email protected]>
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.
Closes #2081
Summary
This PR adds a test only. The bug does not reproduce on current main. It was seen on an unmerged branch build (49db10f). On main, a re-audit where every page is a crawl cache hit (hash_match) and is replayed from the rule cache restores the endpoint collector's snapshot. The probe rules get the same candidates as a fresh run.
I checked this two ways:
squirrel audit <local fixture> --aggressive -m 40, run twice. The second run had 3/3 hash_match page hits and 3 pages replayed, and both probe rules still flagged both endpoints.The new e2e test pins this behaviour:
packages/audit-engine/tests/cached-endpoint-candidates-2081-e2e.test.ts. It runs three audits of one unchanged fixture site against one store:A pass-through spy on
RuleRunner.prototype.runSiteRules(restored in afterAll) captures the real endpoint surface each audit hands the site rules.Acceptance criteria
expect(warm.surface).toEqual(refresh.surface). The refresh surface holds both inline fetch() call sites as same-origin, probe-eligible candidates.pageCacheHits === pages, freshPages 0, replayedPages 3. Both runs give the same candidates and the same verdicts for both rules.Regression check: with the collector's
replayturned into a no-op, the test fails on the warm run.Gates
bun install --frozen-lockfile, thenbun run format:check,bun run lint, andbun run typecheckin packages/audit-engine: passbun run scripts/test-suites.ts --check: pass.bash scripts/test-ci-classify.sh: 42/42bun run scripts/test-suites.ts --run audit-engine: 2366 pass, 3 skip, 0 fail (2369 tests, 248 files)Residual risk
The signed-in cloud-rendering path was not exercised here, because the sandbox has no credentials.
Agent skill change: none.