Repository navigation
Fix Extraction hardening: dockerfile #842 - #959
Merged
Merged
Conversation
…on rules against heredocs, multi-line continuations, and BuildKit syntax This fix was developed using the rigorous 5-stage agent pipeline: What the Agents Found: - Heredoc and Continuation Blindness: Naive func_start regexes failed to handle \ line continuations and <<EOF heredocs, causing valid instructions to be missed and fake instructions inside heredocs to be incorrectly matched. - False Positives in Lookalikes: Dependencies and commands disguised in comments or string literals were hallucinated due to lack of start-of-line anchors on the right side of OR expressions. - Missing BuildKit Support: Dependencies pulled using COPY --from or FROM with cross-platform flags were often missed or partially captured without tags. Engineering Implementation: - Rewrote _dependency_capture and import regexes to properly anchor COPY --from and capture image tags. - Added 15 adversarial tests in test_dockerfile.py covering modern BuildKit features, heredocs, edge-case spacing, syntax continuations, and embedded string literals. - Known limitations: Simple line-by-line regexes without multi-line AST parsing still have edge cases inside deeply nested string literals, which require future architectural changes to completely solve. QA Auditing: Verified the changes across the language-crucible corpus via crucible_check.py, successfully eliminating a hallucinated false positive 'criu' dependency capture in daemon.Dockerfile without introducing new false positives.
Contributor
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.
Fix Extraction hardening: dockerfile closes #842: Harden Dockerfile extraction rules against heredocs, multi-line continuations, and BuildKit syntax
This fix was developed using the rigorous 5-stage agent pipeline:
What the Agents Found:
Engineering Implementation:
QA Auditing: Verified the changes across the language-crucible corpus via crucible_check.py, successfully eliminating a hallucinated false positive 'criu' dependency capture in daemon.Dockerfile without introducing new false positives.