Skip to content

refactor(runtime): read four agents' readiness from JSON rule files through one engine - #24348

Merged
Jinwoo-H merged 14 commits into
mainfrom
jinwoo/agent-state-rules-engine
Oct 2, 2026
Merged

Jinwoo-H merged 14 commits into
mainfrom
jinwoo/agent-state-rules-engine

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​353 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​328
Prod 25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​890 $\color{#cf222e}{\Huge{\mathbf{−}}}$​346 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​544

Builds on the readiness census (#24336, merged), which proves this PR changes no verdict.

ELI5

Orca decides whether an agent in a terminal is "ready for input", "busy" or "waiting on a question" by reading its screen. For each agent that logic was hand-written code. This PR moves four agents' rules into small JSON files that one shared engine reads, so later agents can move the same way and the rules can be read in one place. Nothing the user sees changes.

What Changed

  • Before: Antigravity, Cline and Prime Agent each had a TypeScript function that inspected the bottom rows of the screen; Cursor's approval menu and input prompt were hard-coded inside the shared wait detection.
  • After: src/main/runtime/agent-state-rules/<agent>.json holds those rules, validated by a strict zod schema when the app loads (unknown fields, unknown agents, unsafe regexes are rejected). The old agent-specific functions are deleted.

The mechanism:

  • One rule shape. Every rule and text anchor is when (a region and what it must show) plus answer, each a closed list checked by zod. Today the only region is the trusted screen grid and the answers are idle (with strength strong/weak and requiresQuiet) and hold ("the screen was readable and it is not ready, so don't fall back to weaker hints"). Later agents add the title, text and status regions and the working and blocked answers as new entries in those lists, not as new kinds of field.
  • Per-agent priority list. Highest priority wins; ties keep file order. No match, or no trusted screen, means "no answer" and the existing lanes decide, exactly as before.
  • Shared, position-ordered text anchors. Anchors (Cursor's approval menu, Cursor's prompt, the Antigravity text composer) apply to every pane, because today a pane's text tail can show any agent's dialog, and adopted panes have no known agent. So they are not in the per-agent priority list: the latest one in the text wins. An anchor finds a position (the last occurrence of a lowercase literal, or a named scan) and may test the text after it or count matching lines. Cursor's prompt is two anchors, one answering working (spinner after the prompt) and one idle; either proves an earlier dialog was answered, and only idle settles a wait. The blocked layer (moved into agent-state-rules/blocked-text-layer.ts) still picks the blocker painted latest, and its cheap prefilter regex is now built from the rule files' blocked anchors.
  • Named scans for what is not data. The Antigravity text-tail scan stays code, registered by name (antigravity-text-composer) and referenced from antigravity.json.
  • Profile. profile.screenProbeBanner holds the one fact that is not a detection rule: tail text that makes a wait read the visible screen once (Antigravity's banner).
  • Lowercase where the text is lowercased. Text anchors read the lowercased tail, so their literals (find.lastOf and any contains term) must be lowercase or the file is rejected; screen rows keep mixed case.
  • Pattern safety. Regexes load only if they compile, have no backreference or lookbehind, and never repeat a group whose body varies (a quantifier, including ?, or an alternation), which is what makes backtracking exponential. Every rule and anchor carries a why, since JSON has no comments and the rationale should travel with the pattern.
  • Seam for the remaining agents. evaluateTuiIdle's lane order is unchanged; the rule verdict plugs into the same three places the old screen verdict did (strong ready, quiet ready, and "screen decided, close the weak lanes"). Codex, Muse, Qoder and every other agent still run through the existing code; they can move one by one.
  • Rule files are imported as JSON modules, so the bundler inlines them into the main bundle (no resource path to resolve in packaged or headless builds).

Why

Every agent's readiness logic lived in its own code path, with ordering spread across several files. One engine with data files gives one place to read each agent's rules and makes migrating the other agents mechanical. The alternatives were to keep adding per-agent functions (more drift) or to rewrite all agents at once (no way to prove zero behaviour change). Doing four agents now, under the census, proves the engine can reproduce today's verdicts exactly before the rest move.

Linked Issue

Refs STA-9098 (part a: the engine, with no behaviour change).

Visual Proof

N/A: no UI or behaviour change. The readiness census (#24336) replays every recorded agent session and a synthetic matrix over all agents, and its committed baselines are untouched and pass.

Testing

  • pnpm test src/main/runtime/readiness-census: 218/218 passed, three runs, about 20 s each; no baseline file changed.

  • Mutation check against the census (re-run after the rule shape change): Cline's hold above its composer rule (11 failures), Prime without requiresQuiet (12), the Antigravity text anchor answering working (13), Cursor's idle prompt without its spinner veto (2), and counting working anchors as ready (2 census frames plus a unit test) all fail. Earlier: moving hold above the composer rule (each of the three screen agents), a priority tie with hold first in file order, dropping requiresQuiet (Prime), dropping Cline's spinner veto, dropping Cursor's busy spinner, and dropping the Antigravity text anchor all fail the census. Raising Cursor's choice count to 3 passes the census (no recording separates it) and is caught by a new unit test.

  • New unit tests for the engine: schema rejections (including unsafe and safe pattern cases and uppercase anchor literals), priority and ties, hold, optional and relative rows, strength and quiet through the tui-idle ranking, text anchors, and the prefilter.

  • pnpm test src/main/runtime src/shared: all pass except omp-draft-launch-shell.test.ts (fish), which fails locally because of my own shell config and does not touch this code.

  • pnpm tc:node, oxlint, anti-slop and pnpm run check:code-quality:changed: clean.

  • Platforms: macOS locally; the change is platform-neutral string matching. SSH: unaffected, since detection runs on the execution host as before.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No security, platform, SSH, mobile or wire-compatibility impact: same verdicts, same blocked reasons. Performance: rules are compiled once at load. Per evaluation, the screen is read once per agent and each anchor scan runs once, as before.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Replays every recorded agent PTY transcript frame by frame through a real
runtime pane (agent-known and agent-unknown, clocked and clockless) and a
synthetic evidence matrix for all 43 TuiAgents, and compares each verdict
and tui-idle wait outcome to committed run-length-encoded baselines.

Refs STA-9098
A census that read TUI_IDLE_QUIESCENCE_MS would move with it; fixed 2999/3000 ms
reads and a fixed 2000 ms poll step make a changed window show as changed verdicts.

Refs STA-9098
…sible waits

- Read each verdict through the runtime's own settle seam (evaluateTuiIdleForLeaf) instead
  of re-wiring evaluateTuiIdle/leafTuiIdleEvidence/buildTerminalWaitText, so the census is
  coupled to one runtime method, not to the module STA-9098 rewrites.
- Let the runtime finish each chunk (one macrotask turn) before reading. The old read raced
  work chained on the paint, so 14 frames pinned a microtask-ordering artefact.
- Record when a wait settles (@start vs @poll), not just its outcome.
- Exit each pane's PTY after reading it so its emulator is freed.
- Replace the hand-grouped families, literal fixture list and per-pane split flag with a
  directory-scanned catalog, one baseline per replayed pane, and size-balanced shards.
- Run the synthetic matrix in one file; it takes about 2 s.
…e in the census matrix

Blocked detection is position-ordered (design doc 11.5): the later of a blocker and a ready
anchor wins. The matrix now paints a workspace-trust dialog after, and before, each agent's
ready screen under every title, so a rule engine that loses that ordering fails per agent.
The anti-slop lint rejects Reflect.get on parsed input.
…adiness from rule files

Adds agent-state-rules/: a zod-validated JSON file per agent, one priority list of
screen rules per agent (idle with strength and requiresQuiet, or hold), and text
anchors that feed the shared, position-ordered blocked layer every pane reads first.

The three screen-ruled agents and Cursor's approval menu and prompt move to data;
the Antigravity text scan stays code as a named anchor. Their old code paths are
deleted. Every other agent still runs through the existing lanes, unchanged.
The readiness census baselines are untouched and pass.

Refs STA-9098
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Refactors agent readiness detection into a rules engine.

The PR appears safe to merge based on the reviewed changes and resolved prior finding.

Summary

The PR moves Antigravity, Cline, Prime Agent, and Cursor readiness evidence into validated JSON rules and shared screen/text matching paths.

  • The changes since the previous review tighten validation of text-anchor literals and simplify the screen-probe banner check.
  • No new actionable issue was identified. The earlier regex-safety thread is resolved.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  J[Bundled JSON rule files] --> V[Schema validation]
  V --> S[Screen rules]
  V --> T[Shared text anchors]
  S --> E[TUI idle evidence ranking]
  T --> E
  E --> R[Ready, pending, or blocked]
Loading

Reviews (4) · Last reviewed commit: "fix(runtime): refuse uppercase contains ..."

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — two minor suggestions inline/body. The refactor is behavior-preserving for the four migrated agents, verified against the census and by tracing every deleted function to its replacement.

Reviewed changes

  • Rule files + engine. Four agents' readiness (Antigravity, Cline, Prime Agent screen rules; Cursor text anchors) moves from per-agent TypeScript into strict-schema JSON (agent-state-rules/*.json) compiled by agent-state-rules-engine.ts / agent-state-rule-matchers.ts.
  • Shared text layer. Cursor's approval menu and prompt become data anchors in agent-state-text-anchors.ts; blocked-text-layer.ts takes the old live-window scan and prefilter.
  • Lane rewiring. tui-idle-evidence.ts swaps readScreenDecidesReadiness: boolean for readAgentRuleVerdict: AgentStateVerdict | null, adds a weak-idle settle branch, and extracts hasQuietOutput. hasScreenRules replaces getScreenReadyRule.
  • Deletions. The old per-agent readiness files, Cursor approval detector, and inline blocked/prompt helpers are removed; no live code references them.

I independently traced each deleted predicate to its rule/engine replacement and ran two read-only specialist passes; none could produce an input where the four agents' verdicts differ, and the committed census baselines are unchanged and pass.

ℹ️ Stale evidence docs still name the deleted detectors

Two reference docs describe the removed functions as the shipped implementation, so a reader lands on symbols that no longer exist.

Technical details
# Update evidence docs to the rule-file engine

## Affected sites
- `docs/reference/cline-and-prime-agent-readiness-evidence.md:5` — names `isClineComposerReadyScreen` and `isPrimeAgentComposerReadyScreen`, both deleted; readiness now comes from `agent-state-rules/cline.json` / `prime-agent.json`.
- `docs/reference/antigravity-readiness-evidence.md:3` and `:44` — place `findAntigravityReadyPromptIndex` in `src/main/runtime/terminal-wait-detection.ts`; it is gone, and its body now lives as `findAntigravityComposerIndex` in `agent-state-rules/antigravity-text-composer.ts`, referenced by name from `antigravity.json`.

## Required outcome
- Retarget each reference to the rule file (and, for Antigravity, the named predicate) so the docs match what ships.

## Suggested approach (optional)
- Both docs already explain the tiering; only the symbol/path references need to change.
- Worth a one-line note that screen rules now live in `agent-state-rules/<agent>.json` so future agents are discoverable.

</details>

<!--
Pullfrog review metadata. These findings were written against eaa0706b99;
if commits have landed on jinwoo/agent-state-rules-engine since, treat every specific bug, file, or
line callout as POTENTIALLY STALE and re-diff before acting on it.

- Mode: Review (initial)
- Files reviewed: 31
- Commits reviewed: 2
- Base: jinwoo/readiness-census (50038b0c)
- Head: jinwoo/agent-state-rules-engine (eaa0706b)
- Reviewed commits:
  - faa97a21c5 — refactor(runtime): read Antigravity, Cline, Prime Agent and Cursor readiness from rule files
  - eaa0706b99 — test(runtime): cover the agent state rule engine's schema, priority, rows, anchors and lanes
- Prior pullfrog review: none
-->


<!-- PULLFROG_DIVIDER_DO_NOT_REMOVE_PLZ -->
<sup><a href="https://pullfrog.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pullfrog.com/logos/frog-white-full-18px.png"><img src="https://pullfrog.com/logos/frog-green-full-18px.png" width="9px" height="9px" style="vertical-align: middle; " alt="Pullfrog"></picture></a>&nbsp;&nbsp;| [Fix all ➔](https://pullfrog.com/trigger/stablyai/orca/24348?action=fix&review_id=5377941346) | [Fix 👍s ➔](https://pullfrog.com/trigger/stablyai/orca/24348?action=fix-approved&review_id=5377941346) | [View workflow run](https://github.com/stablyai/orca/actions/runs/36845649333/job/110315447195) | Using `DeepSeek Flash` (free via [Pullfrog for OSS](https://pullfrog.com/for-oss)) | [𝕏](https://x.com/pullfrogai)</sup>

…ting group

The load-time regex check only flagged a repeated group whose body held * + or {,
so (a?)* and (a|aa)+ passed though both backtrack exponentially. A repeated
group's body must now be fixed: no quantifier of any kind and no alternation.
The comment states the remaining polynomial gap instead of claiming linearity.
…nswer shape

Every rule and text anchor is now when (a region and what it must show) plus
answer, each a discriminated union, so part (b) adds title, text and status
regions and working or blocked answers as new variants instead of new fields.

- Cursor's prompt is two anchors answering working and idle; the one-off
  workingIfAfter and followedBy fields become a general after test.
- Anchor literals and the probe banner must be lowercase, since they are
  matched against the lowercased tail.
- screenProbeBanner moves under profile, the place for non-detection facts.
- why is required on every rule and anchor.
- A blocked anchor must name a lastOf literal, which the prefilter keys on.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the three commits landed since the prior pullfrog review at eaa0706b99.

  • Reshaped rules and anchors. Every rule and text anchor moved from a state-discriminated object to a shared when/answer shape; Cursor's single prompt anchor split into prompt_busy (answer working) and prompt_idle (answer idle), with the live index spanning both and ready gated on idle.
  • Regex safety broadened. The load-time unsafe-pattern check now also flags a repeated group whose body varies by a quantifier or an alternation ((a?)*, (?:a|aa)+), and the comment is narrowed to the subset actually detected (adjacent-quantifier overlaps like a*a* stay out of scope).
  • Evidence docs retargeted. Both readiness evidence docs now name the rule files and the named Antigravity predicate instead of the deleted per-agent detectors.

I independently traced the when/answer rewrite of the text-anchor layer and ran a read-only specialist differential over constructed tails: the blocked signal, live, and ready verdicts match the pre-refactor helpers for every input tested, not just the bundled Cursor strings. The focused unit tests (agent-state-rules-engine.test.ts, agent-state-text-anchors.test.ts) pass locally, and the prior inline note on regex safety is addressed.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H changed the base branch from jinwoo/readiness-census to main October 1, 2026 22:12
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 590b69b6-c430-4da9-ad04-ec46df8ddc7f

📥 Commits

Reviewing files that changed from the base of the PR and between 2813182 and 7d7d7ab.

📒 Files selected for processing (3)
  • src/main/runtime/agent-state-rules/agent-state-rules-engine.test.ts
  • src/main/runtime/agent-state-rules/agent-state-rules-schema.ts
  • src/main/runtime/agent-state-rules/agent-state-text-anchors.ts
💤 Files with no reviewable changes (1)
  • src/main/runtime/agent-state-rules/agent-state-text-anchors.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The change adds schema-validated agent-state rules, bundled configurations, text anchors, and shared blocked-text detection. Terminal-wait and TUI idle evaluation now use agent-rule verdicts. Probe selection and transcript tests also use the shared rules engine. The change removes several agent-specific readiness detectors and updates reference documentation.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 7d7d7

No actionable merge-blocking issue remains. The readiness-rule migration is mergeable subject to normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 7d7d7

The checked paths retain validation, blocked-state precedence and cancellation safeguards. No new privileged access was identified, but complete behavior equivalence and exposure coverage were not established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — In the traced callers, externally influenced terminal content can affect readiness and blocked-state outcomes for an active terminal wait. No new command-execution, credential, identity or cross-tenant authority transition was identified in that path; undocumented consumers remain outside this assessment.

Trust Boundaries and Controls

  • observed — Production configuration enters through bundled JSON imports and strict parsing, not through the terminal text being classified. Terminal-derived evidence remains subject to blocked-state ordering and verdict-specific quietness requirements.

Resilience and Maintainability Implications

  • observed — Visible-read continuations recheck waiter membership and current output-clock state. Timeout or missing projections do not settle a wait, limiting stale or interrupted probes from producing externally visible readiness outcomes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.54% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 52 functions across 23 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly states the primary change: moving four agents' readiness evaluation into JSON rule files with one shared engine.
Description check ✅ Passed The description is detailed and covers the required explanation, changes, rationale, testing, visual proof, compatibility notes, and checklist. The linked issue section uses “Refs STA-9098” instead of…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/runtime/agent-state-rules/agent-state-rules-schema.ts (1)

35-49: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Text-anchor contains terms can be uppercase. They then never match.

  • Text anchors run against the lowercased text tail.
  • The schema rejects an uppercase find.lastOf with TailLiteral for this reason. It does not apply the same check to contains terms inside when.after and when.lines.test, which also read the lowercased tail.
  • Screen rows use the same TextTestSchema, but screen rows are not lowercased. One check cannot cover both cases.

If a rule author writes { "contains": "Run (once)" } in a text anchor, the file loads and the term never matches:

  • In all or any, the anchor never fires. The approval menu is then not reported as blocked.
  • In none, the veto never fires. An idle anchor can then report ready when it should not.

This breaks the guarantee in the file header: "a misspelled field rejects the file instead of silently dropping a condition".

Build the text-test schema from a term factory. Then use a lowercase-checked variant for anchor after and lines.test. A regex cannot be checked the same way, because escapes such as \S and \W are uppercase, so check only contains.

♻️ Sketch
-const TextTermSchema = z.union([
-  z.object({ regex: SafeRegex, ignoreCase: z.boolean().optional() }).strict(),
-  z.object({ contains: Literal }).strict()
-])
-
-const Terms = z.array(TextTermSchema).min(1).max(MAX_TERMS)
-
-const TextTestSchema = z.union([
-  TextTermSchema,
-  z
-    .object({ all: Terms.optional(), any: Terms.optional(), none: Terms.optional() })
-    .strict()
-    .refine((test) => Boolean(test.all ?? test.any ?? test.none), 'needs all, any or none')
-])
+function textTestSchema(containsLiteral: typeof Literal) {
+  const term = z.union([
+    z.object({ regex: SafeRegex, ignoreCase: z.boolean().optional() }).strict(),
+    z.object({ contains: containsLiteral }).strict()
+  ])
+  const terms = z.array(term).min(1).max(MAX_TERMS)
+  return z.union([
+    term,
+    z
+      .object({ all: terms.optional(), any: terms.optional(), none: terms.optional() })
+      .strict()
+      .refine((test) => Boolean(test.all ?? test.any ?? test.none), 'needs all, any or none')
+  ])
+}
+const TextTestSchema = textTestSchema(Literal)
+// Why: anchors read the lowercased tail.
+const TailTextTestSchema = textTestSchema(TailLiteral)

Then use TailTextTestSchema for when.after and when.lines.test in TextAnchorSchema.

Also applies to: 129-151


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a9401f57-f1c7-4bea-bddd-1552fd47782c

📥 Commits

Reviewing files that changed from the base of the PR and between 8b76683 and 2813182.

📒 Files selected for processing (33)
  • docs/reference/antigravity-readiness-evidence.md
  • docs/reference/cline-and-prime-agent-readiness-evidence.md
  • src/main/runtime/agent-state-rules/agent-state-rule-matchers.ts
  • src/main/runtime/agent-state-rules/agent-state-rule-pattern-safety.ts
  • src/main/runtime/agent-state-rules/agent-state-rules-catalog.ts
  • src/main/runtime/agent-state-rules/agent-state-rules-engine.test.ts
  • src/main/runtime/agent-state-rules/agent-state-rules-engine.ts
  • src/main/runtime/agent-state-rules/agent-state-rules-schema.ts
  • src/main/runtime/agent-state-rules/agent-state-text-anchors.test.ts
  • src/main/runtime/agent-state-rules/agent-state-text-anchors.ts
  • src/main/runtime/agent-state-rules/antigravity-text-composer.ts
  • src/main/runtime/agent-state-rules/antigravity.json
  • src/main/runtime/agent-state-rules/blocked-text-layer.ts
  • src/main/runtime/agent-state-rules/cline.json
  • src/main/runtime/agent-state-rules/cursor.json
  • src/main/runtime/agent-state-rules/prime-agent.json
  • src/main/runtime/antigravity-screen-readiness-transcripts.test.ts
  • src/main/runtime/cline-screen-readiness-transcripts.test.ts
  • src/main/runtime/cline-terminal-readiness.ts
  • src/main/runtime/codex-quiet-ready-screen.test.ts
  • src/main/runtime/cursor-approval-prompt-detection.ts
  • src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts
  • src/main/runtime/prime-agent-screen-readiness-transcripts.test.ts
  • src/main/runtime/prime-agent-terminal-readiness.ts
  • src/main/runtime/runtime-terminal-wait.ts
  • src/main/runtime/screen-ruled-agent-readiness.ts
  • src/main/runtime/screen-ruled-agent-transcript-suite.ts
  • src/main/runtime/terminal-tail-sentinel-index.test.ts
  • src/main/runtime/terminal-tail-sentinel-index.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/main/runtime/terminal-wait-tail-state.ts
  • src/main/runtime/tui-idle-evidence.test.ts
  • src/main/runtime/tui-idle-evidence.ts
💤 Files with no reviewable changes (4)
  • src/main/runtime/prime-agent-terminal-readiness.ts
  • src/main/runtime/cline-terminal-readiness.ts
  • src/main/runtime/cursor-approval-prompt-detection.ts
  • src/main/runtime/screen-ruled-agent-readiness.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…read the lowercased tail

A text anchor's after and lines tests run on the lowercased tail, so an
uppercase contains term loaded and then never matched. Build the text test
schema from the literal it accepts and give anchors the lowercase one. Also
drop a probe-banner early return that no bundled catalog reaches.
@Jinwoo-H

Jinwoo-H commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Re the review note on uppercase contains terms in text anchors: agreed, fixed in 7d7d7ab. Text anchors now validate their after and lines.test terms with the lowercase check find.lastOf already had; screen rows keep mixed case. A schema test covers it.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the one commit landed since the prior pullfrog review at a567b268e0, which closes the lowercase anchor gap CodeRabbit flagged.

  • Lowercase contains terms in text anchors. agent-state-rules-schema.ts now builds its text-test schema from a term factory: screen rows keep the mixed-case Literal, while an anchor's after and lines.test are built from the lowercase-only TailLiteral. find.lastOf already used TailLiteral, so an uppercase contains in a text anchor is now rejected at load instead of silently never matching. regex terms are deliberately left unchecked, since escapes like \S are uppercase.
  • Dead branch removed. showsScreenProbeBanner drops its empty-banner early return; .some over an empty list already yields false.

I verified all bundled rule files' contains terms are already lowercase (so no file is rejected by the stricter check), ran the focused suite (44/44 pass), and pnpm tc:node is clean. The textTestSchema(...) factory typechecks because Zod 4's .refine preserves the ZodString type.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

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