Skip to content

fix(replacements): skip Bucket folders that are not run identities - #238

Merged
osolmaz merged 1 commit into
mainfrom
fix/replacement-evidence-skip-foreign-dirs
Sep 27, 2026
Merged

osolmaz merged 1 commit into
mainfrom
fix/replacement-evidence-skip-foreign-dirs

Conversation

@osolmaz

@osolmaz osolmaz commented Sep 26, 2026

Copy link
Copy Markdown
Member

Every replacement request failed with replacement_unavailable ("Replacement request could not be confirmed; refresh before retrying"), and the leaderboard returned no rows.

ReplacementEvidence.records() lists every folder under runs/ in the Bucket and reads run.json from each one. The artifact Bucket can hold other folders there, such as older smoke-test outputs, and those have no run.json. The read threw, the replacement routes mapped the unexpected error to a generic 503, and the leaderboard caught it and returned an empty list.

This change filters the listing to runs/run-<24 hex>/ before reading, which is the same rule the projection already uses when it lists run records (packages/control-core/src/projection.ts).

A new test in packages/control-core/test/replacements.test.ts adds a stray runs/legacy-smoke/ folder and checks that records() still returns the real runs. It fails without the fix. The full suite passes (102 files, 1718 tests) after npm ci and npm run build, and the public privacy check passed.

🤖 Generated with Claude Code

ReplacementEvidence.records() read run.json from every folder under runs/.
Folders that are not Harbor-HF runs have no run.json, so every replacement
request and the leaderboard failed. Match the projection, which already
reads only run-<24 hex> folders.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@osolmaz
osolmaz merged commit b152279 into main Sep 27, 2026
1 check passed
@osolmaz
osolmaz deleted the fix/replacement-evidence-skip-foreign-dirs branch September 27, 2026 13:23
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.

1 participant