chore: repo-compare.json: gate record against a MISS+failed-compare run producing no verdict - #637
Conversation
|
Tracking this PR for automated review ( |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe workflow now evaluates recursive ChangesWorkflow condition updates
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change gates recording when a fresh comparison produces no verdict while preserving cache-hit behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation The description provides the change summary, implementation details, test results, risk assessment, and compatibility context. It does not use the template headings or test-plan checkboxes, but it contains the required information and is mostly complete. Full details: Docstring CoverageExplanation Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…one.
**What I did:** Extended `compile_run_if` in `crates/flare-workflow/src/json.rs` to support a single top-level `OR`/`AND` combining two atomic conditions (each still `==`/`!=`/bare-truthy), and fixed a landmine I hit along the way: `expand_variables` leaves an unresolved `{{var}}` as literal template text rather than empty string, which would have made `verdict != ''` spuriously true whenever `compare` never ran. I now normalize any still-bracketed `{{...}}` output to falsy/empty inside `run_if` evaluation only (prompt expansion elsewhere is untouched, preserving the "agent sees the raw placeholder and refuses to fabricate" fallback).
Wired `record`'s gate in `.agentflare/workflows/repo-compare.json` to `{{cache_check}} != 'MISS' OR {{verdict}} != ''` — skips only on a fresh-analysis run with no verdict, still runs on a legitimate cache-hit passthrough.
**Tests:** added two unit tests directly against `compile_run_if` (`run_if_or_treats_unset_var_as_falsy_not_its_own_placeholder_text`, covering MISS+no-verdict skip / MISS+verdict run / cache-hit run; and `run_if_and_requires_both_sides`). Full `flare-workflow` crate suite: 29/29 passing, no regressions. JSON file validated as well-formed. Confirmed no other workflow file in the repo uses `run_if`, so this grammar change is isolated to `repo-compare.json`.
**Concerns:** the `OR`/`AND` split is a plain substring match, so a quoted literal containing the literal substring `" OR "` or `" AND "` would misparse — acceptable per the task's own scope note ("string-only, no full expression language"), but worth remembering if this grammar gets reused elsewhere.
Agentflare-Branch: task/181-repo-compare-json-gate-record-against-a
Agentflare-Item: 181-repo-compare-json-gate-record-against-a
f644eb4 to
9367452
Compare
Only
repo-compare.jsonusesrun_if, so this change is isolated. Done.What I did: Extended
compile_run_ifincrates/flare-workflow/src/json.rsto support a single top-levelOR/ANDcombining two atomic conditions (each still==/!=/bare-truthy), and fixed a landmine I hit along the way:expand_variablesleaves an unresolved{{var}}as literal template text rather than empty string, which would have madeverdict != ''spuriously true whenevercomparenever ran. I now normalize any still-bracketed{{...}}output to falsy/empty insiderun_ifevaluation only (prompt expansion elsewhere is untouched, preserving the "agent sees the raw placeholder and refuses to fabricate" fallback).Wired
record's gate in.agentflare/workflows/repo-compare.jsonto{{cache_check}} != 'MISS' OR {{verdict}} != ''— skips only on a fresh-analysis run with no verdict, still runs on a legitimate cache-hit passthrough.Tests: added two unit tests directly against
compile_run_if(run_if_or_treats_unset_var_as_falsy_not_its_own_placeholder_text, covering MISS+no-verdict skip / MISS+verdict run / cache-hit run; andrun_if_and_requires_both_sides). Fullflare-workflowcrate suite: 29/29 passing, no regressions. JSON file validated as well-formed. Confirmed no other workflow file in the repo usesrun_if, so this grammar change is isolated torepo-compare.json.Concerns: the
OR/ANDsplit is a plain substring match, so a quoted literal containing the literal substring" OR "or" AND "would misparse — acceptable per the task's own scope note ("string-only, no full expression language"), but worth remembering if this grammar gets reused elsewhere.Opened by
claude-codeon flared:51bb8de6c33b for item #181 via agentflare.Summary by CodeRabbit
ORandANDlogic for more flexible automation.