Skip to content

fix(triage): accept note-only evidence; raise research max-turns to 200 - #97

Merged
chrisleekr merged 4 commits into
mainfrom
fix/triage-evidence-schema-file-optional
May 3, 2026
Merged

fix(triage): accept note-only evidence; raise research max-turns to 200#97
chrisleekr merged 4 commits into
mainfrom
fix/triage-evidence-schema-file-optional

Conversation

@chrisleekr

Copy link
Copy Markdown
Owner

Summary

Two unrelated but small changes shipping together.

1. Triage schema no longer discards valid verdicts over note-only evidence. On issue #76 (daemon log: 5c88cc8f7b-5nztr), the triage agent produced a VALID verdict in 11 turns / 93s / $0.575 with a real citation at src/orchestrator/ws-server.ts:52, then was thrown away by verdictSchema because two evidence entries (cross-cutting observations like a negative grep timingSafeEqual src/ result) had no file. The whole run was discarded with a generic "see server logs" message and the ship cascade halted at step 0. Per the team's brief ("any workflow shouldn't fail due to strict enforcing"), evidence[].file is now optional, with a .refine() keeping the schema honest by requiring at least one of file or note. The prompt is updated to match so the agent knows note-only entries are acceptable for cross-cutting evidence while file+line remains preferred.

2. Research workflow --max-turns raised from 80 → 200. Daily research runs were hitting the 80-turn cap before producing usable issues. Plus a YAML reflow on the focus_area description.

Diagram

```mermaid
flowchart TD
Agent["agent writes
TRIAGE_VERDICT.json
w/ note-only entry"] --> Before["BEFORE
z.string.min1
file required"]:::bad
Before --> Reject["whole run discarded
cost wasted
ship halted"]:::bad

Agent --> After["AFTER
file optional
refine: file or note"]:::good
After --> Accept["valid verdict accepted
cross-cutting evidence kept
empty objects still rejected"]:::good

classDef good fill:#22863a,stroke:#0b3d18,color:#ffffff
classDef bad fill:#b31d28,stroke:#5b0a0e,color:#ffffff
```

Changes

  • `src/workflows/handlers/triage.ts` — `evidence[].file` is now optional; new `.refine()` enforces `file || note` so empty `{}` still fails validation.
  • `src/workflows/handlers/triage.ts` — prompt example updated to `"<path|omit>" / "<short|omit>"` plus a one-line rule explaining when note-only is acceptable.
  • `test/workflows/handlers/triage.test.ts` — two regression tests: accepts note-only evidence; rejects entries missing both `file` and `note`.
  • `.github/workflows/research.yml` — `--max-turns 80 → 200`; YAML reflow of the `focus_area` description (no semantic change).

Related Issues

Test plan

The triage handler's verdictSchema required every evidence[] entry to
have a non-empty `file` string. Cross-cutting observations (negative
grep results, "no usage anywhere" claims) legitimately have no single
file pointer, and on issue #76 the agent produced a VALID verdict that
was thrown away (11 turns, 93s, $0.575) when two such entries failed
validation. Make `file` optional but require at least one of
`file` or `note` via .refine() so empty {} still fails. Update the
prompt example + rules to match. Bundles a small unrelated bump:
research workflow `--max-turns` 80→200.
Copilot AI review requested due to automatic review settings May 3, 2026 07:08
@coderabbitai

coderabbitai Bot commented May 3, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@chrisleekr has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 35 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 001a72c0-2016-47ea-8c94-85ea2d4d5710

📥 Commits

Reviewing files that changed from the base of the PR and between 71f83a6 and c7afc34.

📒 Files selected for processing (4)
  • .github/workflows/research.yml
  • docs/use/workflows/triage.md
  • src/workflows/handlers/triage.ts
  • test/workflows/handlers/triage.test.ts

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
Review rate limit: 0/1 reviews remaining, refill in 31 minutes and 35 seconds.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the triage workflow more tolerant of valid note-only evidence entries and increases the scheduled research workflow's turn budget so longer investigations can complete. It fits into the existing bot/workflow infrastructure by adjusting agent-facing contracts rather than changing core orchestration behavior.

Changes:

  • Relax the triage verdict schema so evidence[] entries can be note-only, while still rejecting empty evidence objects.
  • Add regression tests covering accepted note-only evidence and rejected evidence entries missing both file and note.
  • Raise the scheduled research workflow's Claude turn cap from 80 to 200 and reflow the manual input description.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/workflows/handlers/triage.ts Updates triage verdict validation and agent prompt guidance for note-only evidence.
test/workflows/handlers/triage.test.ts Adds regression coverage for the new evidence-schema behavior.
.github/workflows/research.yml Increases research workflow turn budget and reformats the dispatch input description.

Comment thread src/workflows/handlers/triage.ts
Comment thread .github/workflows/research.yml
chrisleekr added 2 commits May 3, 2026 17:23
…n budget

Address two Copilot findings on PR #97:
- triage.ts: standing rule said 'a claim without a file:line citation
  is a guess' which contradicted the new note-only allowance and would
  push the agent back to the old behavior. Restate as: prefer file:line
  citations; a claim with neither a citation nor a concrete cross-cutting
  observation is a guess.
- research.yml: embedded prompt still told the agent it had ~80 turns,
  even though --max-turns was raised to 200. Updated to ~200 to match.
@chrisleekr
chrisleekr merged commit 3b6036c into main May 3, 2026
9 checks passed
@chrisleekr
chrisleekr deleted the fix/triage-evidence-schema-file-optional branch May 3, 2026 08:43
chrisleekr pushed a commit that referenced this pull request May 3, 2026
# [1.9.0](v1.8.0...v1.9.0) (2026-05-03)

### Bug Fixes

* **checkout:** fetch PR base branch so origin/<baseBranch> resolves (closes [#74](#74)) ([#96](#96)) ([71f83a6](71f83a6))
* **fetcher:** paginate GraphQL connections + MAX_FETCHED_* caps (closes [#66](#66)) ([#95](#95)) ([f728ecd](f728ecd))
* **triage:** accept note-only evidence; raise research max-turns to 200 ([#97](#97)) ([3b6036c](3b6036c))
* **workflow:** fix release.yml ([#98](#98)) ([cb43d69](cb43d69))

### Features

* **workflows:** publish SLSA provenance + SBOM attestations on every release tag (closes [#58](#58)) ([#94](#94)) ([95856bc](95856bc))
@chrisleekr

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

2 participants