Repository navigation
feat(review): fail review --branch on an invalid workflow - #1266
Conversation
review --branch will gate a merge on workflow files. Lock the invalid file, the missing prompt, a parent whose child cannot run, and the materialization of workflows, prompts, scorers and symlinks before that check exists.
A kept cache can hide a parent whose child is invalid on the branch, so the gate checks an empty data home. The validator's warnings would also land in front of --json. Materialization preserves symlinks and covers scorers for #1085.
A workflow branch is gated with the same rules pull already runs, and the sample has to be the log that command prints.
Code Erosion ReportInformational — never blocks the merge.
Scanned 393 files / 88281 SLOC · high-CC functions 682/7525 * On TypeScript, Rule hits (TS verbosity layer)Standalone
58 distinct lines flagged across |
ce1ae47 to
c8d02cc
Compare
|
No confident findings in the specified PR diff.
Review was read-only; no PR code was run, built, or installed. |
c8d02cc to
0c1d55b
Compare
|
No confident findings in the specified PR diff.
Review was read-only; no PR code was run, built, or installed. |
0c1d55b to
70a3d54
Compare
|
No confident findings in the specified PR diff.
Review was read-only; no PR code was run, built, or installed. |
70a3d54 to
f718d17
Compare
The PR description satisfies the testing requirement: it records a build followed by real-CLI checks for invalid and valid workflows, JSON output, and cache isolation. Earlier reviews raised no actionable findings to mark resolved. Review was read-only; no PR code was run, built, or installed. |
A link to `target.md ` was trimmed to `target.md`, so review could check a different file than pull reads.
|
No confident new findings in the specified PR diff.
Review was read-only; no PR code was run, built, or installed. |
Summary
teamai review --branchchecked skills, rules, and agents, so a branch with a broken workflow still exited 0. The failure showed up on the next pull, which keeps the last valid copy. This check reusessyncWorkflowDefinitions, the validator pull already runs, and turns eachinvaliddiagnostic into afailfinding. A valid workflow tree still prints no findings. Branch materialization (materializeRef) preserves symlinks (git mode120000) and coversworkflows,prompts, andscorers(prepared for #1085).Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpassesnpx vitest runpassesnpx vitest run src/__tests__/review-branch.test.tspasses 17 tests, including bad step needs, missing prompt file, missing child workflow, andmaterializeRefextracting workflows, prompts, scorers, and preserving symlinks from a git revision.After
npm run build, the real CLI ran against a fixture team repo in a sandbox home.teamai review --branch feature/deployexited 1 and printed:--jsonprinted one object withok: falseand no warning lines in front of it.teamai review --branch feature/validexited 0 and printedNo findings.The sandbox home had no workflow cache afterwards.Head 026042e: the same
teamai review --branch feature/deployrun, withworkflows/deploy.yamlcopied verbatim from the guide, exited 1 and printed the guide's line exactly:workflow-docs-examples.test.tsnow accepts an invalid example only when the same page prints its exact✖ [workflows]diagnostic, and every such line must match a real diagnostic. Changing the shown"biuld"to"bild"fails it (1 of 21).review-branch.test.tskeeps a symlink totarget.md(trailing space) verbatim.npx tsc --noEmitandnpm run lintpass. The fullnpx vitest runsuite was not run on this head.Related Issues
Closes #1248. Scorer and benchmark validation in
review --branchis now in the scope of #1085 and #1180, which add those definitions.Notes for Reviewers
Push still warns and continues. Scorer validation joins here with #1085 (
scorersis already inREAD_ROOTSinmaterializeRef), and benchmark validation with #1180. A branch with noworkflows/directory gets no workflow finding.materializeRefcreates real symlinks for git mode120000blobs, ensuringsyncWorkflowDefinitionsinspects symlink prompt files and symlink workflow definitions with the exact same behavior aspull.The call is dry-run and uses an empty temporary data home, so the verdict does not read or write this machine's workflow cache. A parent whose child has no runnable version on the branch fails here. Pull can still keep that parent when a cached child exists.