Skip to content

TE-33570: shared policy lint fixture; alias bomb is policy.parse - #23

Draft
lt-zeeshan wants to merge 4 commits into
LambdaTest:mainfrom
lt-zeeshan:feat/TE-33570-policy-archive
Draft

lt-zeeshan wants to merge 4 commits into
LambdaTest:mainfrom
lt-zeeshan:feat/TE-33570-policy-archive

Conversation

@lt-zeeshan

Copy link
Copy Markdown
Collaborator

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 inside lint.test.ts.

A YAML alias bomb (anchors that expand past yaml's alias limit) made loadPolicy throw 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.ts runs the fixture instead of inline cases. Clean cases assert no error-severity codes; broken cases assert the exact code set.
  • loadPolicy turns yaml's alias-count error into policy.parse.
  • Decision 0047, README and CHANGELOG: the fixture is the contract. A rule change lands here first, with its case.

Tests

  • npx vitest run src/verdict/lint.test.ts: 68 passed.
  • Test Manager's Go port runs the same file (Forge PR for TE-33570), and its codes match on every case.

Jira: TE-33570

🤖 Generated with Claude Code

lt-zeeshan and others added 4 commits November 5, 2026 13:00
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>
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