Repository navigation
TE-33570: shared policy lint fixture; alias bomb is policy.parse - #23
Draft
lt-zeeshan wants to merge 4 commits into
Draft
lt-zeeshan wants to merge 4 commits into
lt-zeeshan wants to merge 4 commits into
Conversation
fixtures/policy-lint/cases.json holds the lint's clean policies and, for each broken one, the set of error codes it must produce. lint.test.ts runs it, and Test Manager's Go port of the lint runs the same file, so the two report the same codes. Adds CEL cases: unknown function, AST node and depth limits, a dyn where, the custom sum/mean/percentile functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fixture lintPolicy threw when the YAML parser refused aliases that expand past its limit; loadPolicy now reports it as policy.parse. The shared fixture gains the CEL cases where another implementation's environment drifted: cross-type numeric comparisons and string extensions are clean; mixed-type list and map literals and the global matches() form are policy.expr_type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
Problem
Test Manager now re-checks every uploaded policy on the server, using a Go port of
lintPolicy. Both sides must accept and refuse the same policies, or a policy that passes local lint gets refused on upload, or the reverse. Until now the lint cases lived only insidelint.test.ts.A YAML alias bomb (anchors that expand past yaml's alias limit) made
loadPolicythrow instead of returning a diagnostic.Change
fixtures/policy-lint/cases.json: 11 clean policies and 36 broken ones, each with the set of error codes it must produce, checked against one kane-cli catalog plus evidence-core. Includes the cases where implementations could differ: CEL cross-type number comparison, mixed list literals, string extensions,matches, and YAML aliases (yaml limits each anchor, not the document).src/verdict/lint.test.tsruns the fixture instead of inline cases. Clean cases assert no error-severity codes; broken cases assert the exact code set.loadPolicyturns yaml's alias-count error intopolicy.parse.Tests
npx vitest run src/verdict/lint.test.ts: 68 passed.Jira: TE-33570
🤖 Generated with Claude Code