fix(images): add indentContinuation ledger and sanitize inline fields (closes #552) - #554
Open
xsvm wants to merge 1 commit into
Open
fix(images): add indentContinuation ledger and sanitize inline fields (closes #552)#554xsvm wants to merge 1 commit into
xsvm wants to merge 1 commit into
Conversation
…closes civitai#552) - Introduce safeTermSingle to sanitize inline metadata fields against newline injection - Replace safeTerm with safeTermSingle for 8 forgeable single-line positions in images.go - Add bidirectional AST call-site ledger and behavioural seam test in indentcontinuation_ledger_test.go - Extend civitai#393 anti-corruption test to audit safeTermSingle alongside safeTerm - Clarify prompt line continuation vs soft wrap behavior in README.md
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 #552.
Summary
Establishes a bidirectional AST call-site ledger for
indentContinuation, replacessafeTermwithsafeTermSingleacross 8 inline positions inimages.goto prevent newline row forgery, and expands the #393 anti-corruption harness to guardsafeTermSingle.Key Changes
safeTermSingle(strings.ReplaceAll(safeTerm(s), "\n", " ")) ininternal/cmd/safeterm.go.safeTermSingleto 8 fields (Model,Sampler,CfgScale,Steps,Seed,URL,Username,NSFWLevel, andresources[].type/name/weight/hash) ininternal/cmd/images.go.internal/cmd/indentcontinuation_ledger_test.gowithTestIndentContinuationCallSitesAreLedgered(StructuralLedgerpins 6 sites;BehaviouralSeamasserts zero\nleaks across all 8 fields + resources).internal/cmd/safeterm_userinput_test.goto audit bothsafeTermandsafeTermSingle(152 calls across 67 files verified).README.md.Verification