Repository navigation
Conversation
…tecture guards The stack replaced every parallel vocabulary for why a target could not be read with the TargetFailure model. The architecture guards now fail when any retired carrier or spelling returns in src, tests, scripts or the Python bridges: AnalysisUnsupportedTargetError, AnalysisMalformedTargetError, MachoReadIssue, FatSliceRangeIssue, details.format_failure, and a "format" failure reason in TypeScript or on a worker wire. The ESP image decoder's own failure kind "format" becomes "malformed", and the tests that asserted format_failure is absent are removed: the guard covers that. BREAKING CHANGE: no public field changes here; this completes the #14239 migration's removal of the retired reason vocabularies.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
3 tasks done
Contributor
[Medium impact] The PR appears safe to merge, with no actionable issues found. SummaryThis PR adds an architecture guard against retired target-failure names and reason values.
Reviews (11) · Last reviewed commit: "Merge remote-tracking branch 'origin/fix..." · Reviewed by Greptile |
…-vocabulary-guard
…-vocabulary-guard
…lary guard's patterns
…into fix/target-failure-vocabulary-guard
…-vocabulary-guard
…-vocabulary-guard
…into fix/target-failure-vocabulary-guard
…into fix/target-failure-vocabulary-guard
…into fix/target-failure-vocabulary-guard
…into fix/target-failure-vocabulary-guard
…into fix/target-failure-vocabulary-guard
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.
Depends on #14416. The base branch is #14416's, so the diff shows only this PR.
Final PR of the #14239 stack: a guard that rejects the retired vocabularies, the zero-use search, and the public-corpus before/after.
Root cause
Each earlier PR deleted its area's parallel vocabulary, but nothing stopped a new reader from bringing one back: a second error class for unsupported targets, a Mach-O issue struct,
details.format_failure, or a"format"failure reason on a worker wire.Structural fix
scripts/verify/architecture-guards.mjs(run bynpm run check:fastand CI) fails on any of these insrc,tests,scriptsor the Python bridges:AnalysisUnsupportedTargetError,AnalysisMalformedTargetError,MachoReadIssue,FatSliceRangeIssue;format_failure;reasonof"format"(:,===,!==), a"reason":"format"wire value, or a Python…Failure("format", …)."format"with a TargetFailure kind (the retired ESP spelling); unrelated"format"kinds such as the desktop draft change stay allowed.The patterns live in
scripts/verify/retired-target-failure-vocabulary.mjs, tested bytests/evaluation/retiredTargetFailureVocabulary.test.ts; those two files are exempt. Compile-time checks already cover the rest:ArtifactOperationErrorhas no target reasons, andArtifactReaderFailurerequires the owner's facts for every target reason."format"becomes"malformed", the last internal use of that spelling as a failure kind.details.format_failureis absent are removed; the guard now enforces it everywhere.Design notes
Zero-use search
grep -rnE 'AnalysisUnsupportedTargetError|AnalysisMalformedTargetError|MachoReadIssue|FatSliceRangeIssue|format_failure|reason\s*(:|===|!==)\s*["'"'"']format["'"'"']|"reason"\s*:\s*"format"|Failure\(\s*["'"'"']format["'"'"']\s*,'over the whole repository (excludingnode_modules,dist,.git,docs/releases) returns two lines, both indocs/reference/target-failures.md's Migration section, which names the retired field for callers. No code, test, script or bridge uses any of them.Mutation check
Appending
{ reason: "format" }tosrc/domain/firmware/espImage.tsand aLayoutFailure("format", …)line tobridge/pwntools/layout_impl.pymakes the guard fail and name both files; reverting passes.Public corpus before/after
Inputs, downloaded into a scratch directory and only read, never executed: every file in
corkami/pocsPE/bin(243 files) andWerWolv/ImHex-Patternstests/patterns/test_data(190 files). Each raninspect-artifact <file> --jsonin-process throughcreateClifrom source, once onmain(26cb5b53ce, which already includes #14247) and once on this branch.maincodefailure_kindPE/binok, 20target_unavailableok, 20target_unavailabletest_dataok, 168target_unavailableok, 168target_unavailableNo file changed
codeorfailure_kind. The refusals I sampled (a PEbin.shaand an ImHex3dsfile) are target-admission refusals (BinaryTargetError,details.constraint: "file_format_rejected", "unsupported binary format"), which happens before any reader and carries nofailure_kind. That admission path is outside this stack; it is where #14151'sunrecognizedverdict would land. The readers this stack migrated are exercised by the conformance registry instead.Validation
node scripts/verify/architecture-guards.mjs: passes.npx vitest run src/domain/firmware src/artifacts/EspImageArtifactReader.test.ts src/domain/targetFailure.test.ts: 296 passed.oxfmton every changed file.Remaining cleanup
Listed in the stack PRs and kept out of the guard because they are not retired spellings: Hopper and
binaryTargetuniversal-container strings (#14416), the source-map and capture decoders'invalid_requestfor malformed bytes and theasarFailure/keyed-archive fallbacks (#14292), and owners that call a magic mismatchmalformedrather thanunrecognized(#14281).