Repository navigation
Conversation
The Python weave verifier counted any indented 'name = {}/[]/dict()' as a shared-state carrier, so function-local containers satisfied the shared-state gate. Anchor the pattern at column 0 so locals and class attributes no longer count, and keep module-level containers working.
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.
Summary
The Python weave verifier treated any assignment shaped like
name = {},name = [],name = dict()orname = SomeClass()as a module-level shared-state carrier, even when the line was indented inside a function. A file made of two functions with only local containers could therefore satisfy theshared-state-mutationcheck without sharing anything.That check feeds
require_agent_weavethroughbla_verify_weave, so the gate could accept a weave that never wires customer definitions to a common carrier. That is the opposite of what the check is meant to prove.What changed
src/shields/weave/weave-decoy.tsis anchored at column 0, so module-level containers still count while function locals and class attributes do not.tests/weave-python-state-scope.test.tscovers both directions: a two-function file with localcacheandledgercontainers must fail the check, and aSTATE = {}carrier touched by two functions must still pass.Compatibility
Module-level state detection is unchanged. Files that only used indented containers were relying on a false positive; they will now be asked for a real module-level carrier before the gate passes. No output format changes.
Verification
npx vitest run tests/weave-python-state-scope.test.ts tests/weave-verify-scope.test.ts tests/weave-post-harden-exemptions.test.ts tests/red-blue-v3-adversarial.test.tspasses, 15 tests.npx tsc --noEmitis clean.