Skip to content

chore: repo-compare.json: gate record against a MISS+failed-compare run producing no verdict - #637

Merged
getappz merged 1 commit into
masterfrom
task/181-repo-compare-json-gate-record-against-a
Aug 31, 2026
Merged

chore: repo-compare.json: gate record against a MISS+failed-compare run producing no verdict#637
getappz merged 1 commit into
masterfrom
task/181-repo-compare-json-gate-record-against-a

Conversation

@getappz

@getappz getappz commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Only repo-compare.json uses run_if, so this change is isolated. Done.

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.


Opened by claude-code on flared:51bb8de6c33b for item #181 via agentflare.

Summary by CodeRabbit

  • New Features
    • Workflow conditions now support nested OR and AND logic for more flexible automation.
    • Unset variables are safely treated as false when evaluating workflow conditions.
  • Bug Fixes
    • Cached comparison results can now continue to the recording step without requiring a newly generated verdict.
    • Improved reliability when workflows evaluate missing or partially populated values.

@getappz

getappz commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

Tracking this PR for automated review (flared:c997d745ae66).

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c36c4196-d832-4b72-99ca-1ce0d74ae6e1

📥 Commits

Reviewing files that changed from the base of the PR and between cb1b3d1 and daae25f.

📒 Files selected for processing (2)
  • .agentflare/workflows/repo-compare.json
  • crates/flare-workflow/src/json.rs

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.


📝 Walkthrough

Walkthrough

The workflow now evaluates recursive OR and AND conditions, treats unset variables as falsy, and tests these cases. The repository comparison workflow also records cached results when no fresh verdict exists.

Changes

Workflow condition updates

Layer / File(s) Summary
Recursive run_if evaluation
crates/flare-workflow/src/json.rs
compile_run_if supports recursive OR and AND conditions. Unset variables expand to empty values. Tests cover both operators and unset-variable handling.
Cached comparison recording
.agentflare/workflows/repo-compare.json
The record step runs when cache_check is not MISS or verdict is non-empty.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to daae2

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)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary workflow change: gating the record step for failed comparisons that produce no verdict. It is specific and related to the changeset.
Description check ✅ Passed 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 con…
Docstring Coverage ✅ Passed 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 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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 Coverage

Explanation

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
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/181-repo-compare-json-gate-record-against-a

Comment @coderabbitai help to get the list of available commands.

…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
@getappz
getappz force-pushed the task/181-repo-compare-json-gate-record-against-a branch from f644eb4 to 9367452 Compare August 31, 2026 06:43
@getappz
getappz merged commit 28bfcf3 into master Aug 31, 2026
2 of 15 checks passed
@getappz
getappz deleted the task/181-repo-compare-json-gate-record-against-a branch August 31, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant