Repository navigation
fix(workspace): verification strategy keyed off the file extension, not the declared type - #67
Open
minerva-sky wants to merge 1 commit into
Open
minerva-sky wants to merge 1 commit into
minerva-sky wants to merge 1 commit into
Conversation
…n, not the declared type Workspace#verify_artifact dispatched on artifact.type, which the generating model declares. A `.rb` artifact labelled `:markdown` therefore skipped the Ruby strategy entirely. Add ArtifactVerificationStrategy.for_artifact, keyed off File.extname(artifact.name), and use it from the workspace. The declared type still works for for_type callers; a mismatch is logged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
Workspace#verify_artifactchose its strategy fromartifact.type, which is whatever the generating model declared. A.rbartifact labelled:markdownskippedRubyArtifactVerificationStrategyentirely. Same shape as the sanitizer spoof: the declared type is model input, not a fact about the file.ArtifactVerificationStrategy.for_artifact(artifact)mapsFile.extname(artifact.name)(case-insensitive) to the strategy:.rb,.js,.py, else basic.Workspace#verify_artifactuses it.for_typestays for callers that only have a type.Tests
for_artifact:.rbdeclared:markdown→ Ruby strategy;README.mddeclared:ruby_class→ basic;Script.PY→ Python; mismatch warns;.txt/:textstays quiet.add_artifacton a spoofed.rbinstantiates the Ruby strategy.bundle exec rspec spec/integration/workspace_integration_spec.rb spec/agentic/workspace_spec.rb spec/agentic/verification/: 208 examples, 0 failures. standardrb clean.Out of scope
validate_artifactstill passesartifact.typetoSecurity::Sanitizer.sanitize_file_content. Once #32's type-scoped denylists land, that call should key off the extension the same way; separate PR so the two don't tangle.🤖 Generated with Claude Code