Skip to content

fix(weave): stop claiming syntaxValid for unparsed sources - #354

Open
DeryFerd wants to merge 1 commit into
qybaihe:mainfrom
DeryFerd:fix/weave-syntax-validity-honesty
Open

DeryFerd wants to merge 1 commit into
qybaihe:mainfrom
DeryFerd:fix/weave-syntax-validity-honesty

Conversation

@DeryFerd

@DeryFerd DeryFerd commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Python and native weave reports always said syntaxValid: true. Only the JavaScript verifier actually parses the source; the Python and native paths extract functions with regexes and brace counting, so a file with broken syntax was reported as syntactically valid.

An agent that introduced a broken edit during source surgery then got a green structural report. The optional field is part of bla-weave-verify/v1, so the claim travelled to MCP clients too.

What changed

  • verifyPythonWeaveFile and verifyNativeWeaveFile no longer set syntaxValid. The field stays optional, so the report simply does not claim a check that never ran.
  • The JavaScript verifier keeps its real parse result, including false on a broken .js source.
  • tests/weave-syntax-validity-honesty.test.ts asserts that broken Python and C fixtures do not report true, and that a broken JS fixture still reports false.

Compatibility

JSON consumers that read syntaxValid need to treat absence as "not checked", which is already how the optional field is typed. JavaScript reports are unchanged. No check ids, scores or overall pass values change.

Verification

  • npx vitest run tests/weave-syntax-validity-honesty.test.ts tests/agent-driven-hardening-v3.test.ts tests/weave-verify-scope.test.ts passes, 14 tests.
  • npx tsc --noEmit is clean.

Python and native weave reports hardcoded syntaxValid: true while only the JavaScript verifier parses source. Leave the optional field unset for formats without a parser so the report no longer claims a check that never ran.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant