Repository navigation
Validate Triage categories in the correction turn and give Report Triage the repository categories - #2139
Merged
Conversation
…age the repository categories Closes #2110
Share one category resolution between correction and publication, and cover per-issue category overrides and post-session GitHub read failures.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Both Triage modes now read the repository categories before the session starts and put them in the prompt. A proposed issue with an invalid category now gets the one correction turn, instead of failing later in
check_publication.Confirmed cause:
correction::validatechecked onlyparse_recommendationandexisting::check_recommendation. The category check ran only incheck_publication, after the correction loop had finished. Report Triage also never received the categories it was checked against.Docs updated:
docs/guide.md(and the regenerated manual),skills/thirdshift-triage/SKILL.md, the regenerated prompts, and the hand-written pagessite/index.html,site/how-it-works/andsite/architecture/. They now say Report sessions receive the categories too, and that an invalid category gets the correction turn.Evidence
Execution evidence
Before (commit e802b10 plus only the new test):
Command:
cargo test --test triage_correction a_factory_or_unknown_category_gets_one_correction_in_both_modesThe Report run exited 1 straight from
check_publication, with noTriageCorrectionturn.After:
cargo test --test triage_correction:This includes:
a_factory_or_unknown_category_gets_one_correction_in_both_modes: Report and existing-issue modes ×security-findingand an unknown label. Checks the categories prompt line, the exact correction error and the corrected category.a_proposed_issue_category_override_gets_one_correctiona_bad_category_is_reported_alongside_another_validation_errorOther targeted runs:
cargo test --test triage_run --test triage_issue --test triage_spec_regressions: all pass.cargo test --bin thirdshift triage: 26 passed.cargo test prompts_page: 14 passed.npm run docs:check --prefix site: passes.scripts/affected-tests mainselected the full suite and stopped at an intermittentcargo test --test processfailure infindings::Security finding Step tests:merged_fix_is_rechecked_after_a_later_fix_failsfixing_dispatches_each_reproduced_finding_and_keeps_unreproduced_findings_privateBoth also fail intermittently at this branch's base commit e802b10 with none of this change (2/6 and 1/6 runs). They don't touch Triage code.
A full
cargo test --no-fail-fastafter mergingorigin/mainpassed (exit 0).Visual evidence
There are no visual or layout changes. The hand-written site pages change by one sentence each, so I made no screenshots.
Merge Danger
Door: two-way
Blast Radius: Triage
Report Triage now reads repository labels before its session. If listing labels fails, a Report run now stops before investigating, instead of after investigating; this matches existing-issue mode.
Unaddressed findings
Standards
docs/guide.mdnow says "A proposed issue whose category is not one of the repository categories…".src/prompt.rsdoc comment now reads "Each proposed issue's category…".recommendation.issuesis non-empty".a_comment_only_recommendation_with_a_factory_category_gets_one_correctionpassed, but 6 existingcargo test --test triage_runtests failed (for exampletriage_comments_on_a_covering_issue_without_filing_or_changing_labels,recommend_only_names_the_covering_issue_and_comment_without_github_writes). Those recommendations only comment on an existing issue and never use the category. I reverted it.investigate's two match arms (judgement). I declined. In the Issue arm,existing::check_trustandimages::hand_overrun before the label read. Hoisting the read would reorder the trust check. The repetition is one line per arm.Categoriesnewtype (judgement). I declined.categoriesis a&[String]passed between three functions in one module. Finding 2'sissue_categoryhelper already gives the resolution rule a single home, so a newtype would be speculative.Spec
None. All three findings were addressed:
"lookup"case covers a GitHub read failure after the session.Security
None. The Security review of this change found no introduced finding: repository categories reach the prompt JSON-encoded from maintainer-owned labels with factory labels filtered, and the category allowlist check is unchanged and now also runs in the correction turn.
Security review outcome
No unaddressed introduced findings.
Review coverage
Reviewer reports cover commit 7224e0c. Every changed file was read by both axes. Generated outputs were excluded and checked by regeneration, with changed lines inspected:
prompts/triage*.mdsite/prompts/index.htmlsite/docs/index.htmlThe follow-up commit dbaccc3 (review fixes) and the merge of
origin/maincame after the review. No changed file was left unread.Closes #2110
Built with claude 2.1.314 · opus · default effort