Skip to content

🐛 Reviewer preflight: follow the repo's own references, report release age without a default verdict, ask for understanding - #19111

Merged
kubestellar-prow[bot] merged 1 commit into
v5from
preflight-reference-discovery
Nov 18, 2026
Merged

kubestellar-prow[bot] merged 1 commit into
v5from
preflight-reference-discovery

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #19106

Reworks the reviewer preflight from #19075 (#19069) in response to critique from @MikeSpreitzer, whose reviewer comparison motivated it.

What #19075 added, and what changes

  1. Rule documents. ✨ Reviewer preflight: repo rules, dependency advisories and release age, subtle-defect guidance #19075 matched a fixed filename list (DESIGN*.md, ARCHITECTURE*.md, STYLE*.md, docs/adr/** and so on). That only works when a repo happens to use those names. Now discovery starts from the standard entry files the repo has (AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, CONTRIBUTING, README, docs README/index pages, CODEOWNERS for context), reads them, and follows the repository-relative references in them: markdown links and reference definitions, hrefs, reStructuredText links, links to this repo's files on github.com, and bare file mentions. Breadth first to depth 2, at most 40 documents, each capped at a quarter of the byte budget, deterministic order, cycles and missing targets skipped. Each listed document says how it was found ("linked from CONTRIBUTING.md"). rule_doc_paths is now an explicit override that replaces discovery (a repo's list replaces the hive-wide one). The reviewer still has to cite the rule it applied.
  2. Release age. ✨ Reviewer preflight: repo rules, dependency advisories and release age, subtle-defect guidance #19075 defaulted min_release_age_days to 14 and labeled younger versions as "inside the release-age window". There is no universal right threshold, so the default is gone: publish dates are reported as facts ("published 2026-11-16 (2 days ago)") with no verdict, and the reviewer applies a release-age policy only when the hive config declares one (min_release_age_days, hive-wide or per repo) or the repository's own documents state one, quoted. OSV advisory evidence is unchanged; dependency checks stay opt-in.
  3. Reviewer guidance. ✨ Reviewer preflight: repo rules, dependency advisories and release age, subtle-defect guidance #19075 added two named failure-mode checks (outdated failure messages, sentinels in min/max/sum). They are removed and replaced by a short general method on the correctness perspective: state the intended behavior change, trace the changed paths and callers, identify and check the invariants and contracts involved, check that comments, docs, messages and tests still match, and report only findings with concrete evidence from the code.

Config. No keys added or removed (golden and settings parity unchanged); rule_doc_paths and min_release_age_days change meaning as above, documented in src/docs/review-swarm.md and src/hive.yaml.example.

Tests. Discovery: links, mentions, directory links, github.com links to the same repo, depth bound, byte budget and document cap with provenance on omitted entries, cycles and self links, missing and escaping targets, excluded and unsafe paths, unreadable files and no reader, override replacing discovery. Release age: reported without a verdict when no policy, policy honored when declared (hive or repo), repo can clear a hive policy. Prompt: method present on correctness only, failure-mode checklist gone.

🤖 Generated with Claude Code

…lease-age verdict, ask for understanding

Rule documents are found from the repository's standard entry files and
the links and mentions they contain (bounded depth, byte budget,
deterministic order, provenance per document) instead of guessed
filename patterns; rule_doc_paths becomes an explicit override.

Release age is reported as a fact with no verdict unless the hive config
declares min_release_age_days or the repository documents a policy; the
14 day default is removed.

The correctness guidance replaces the named failure-mode checks with a
short method for understanding the change.

Fixes #19106

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18873 🐛 needs-sha: exempt owner/detailed issues, overrideable waiver, visible hold on the row same files src/hive.yaml.example

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • build-go

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

18 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/cmd/hive/review_preflight.go 74 CONDITIONALS_NEGATION
src/cmd/hive/review_preflight.go 74 CONDITIONALS_NEGATION
src/pkg/github/review_preflight.go 48 CONDITIONALS_BOUNDARY
src/pkg/github/review_preflight.go 48 CONDITIONALS_NEGATION
src/pkg/github/review_preflight.go 48 CONDITIONALS_NEGATION
src/pkg/github/review_preflight.go 48 CONDITIONALS_NEGATION
src/pkg/github/review_preflight.go 52 CONDITIONALS_NEGATION
src/pkg/review/prompts_preflight.go 21 ARITHMETIC_BASE
src/pkg/review/prompts_preflight.go 22 ARITHMETIC_BASE
src/pkg/review/prompts_preflight.go 23 ARITHMETIC_BASE
src/pkg/review/prompts_preflight.go 24 ARITHMETIC_BASE
src/pkg/review/prompts_preflight.go 25 ARITHMETIC_BASE
src/pkg/reviewpreflight/rules.go 294 CONDITIONALS_BOUNDARY
src/pkg/reviewpreflight/rules.go 294 CONDITIONALS_NEGATION
src/pkg/reviewpreflight/rules.go 344 ARITHMETIC_BASE
src/pkg/reviewpreflight/rules.go 344 INVERT_NEGATIVES
src/pkg/reviewpreflight/rules.go 373 ARITHMETIC_BASE
src/pkg/reviewpreflight/rules.go 373 ARITHMETIC_BASE

ℹ️ 5 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first lines added lines of each default-context hunk, so non-contiguous edits in one hunk are partly missed. This does not affect the verdict.

File Line Mutation
src/pkg/reviewpreflight/rules.go 451 ARITHMETIC_BASE
src/pkg/reviewpreflight/rules.go 451 ARITHMETIC_BASE
src/pkg/reviewpreflight/rules.go 451 CONDITIONALS_BOUNDARY
src/pkg/reviewpreflight/rules.go 451 CONDITIONALS_NEGATION
src/pkg/reviewpreflight/rules.go 500 CONDITIONALS_NEGATION

Verdict: uncovered (#17349).

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 18, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
kubestellar-prow Bot merged commit 5ee4952 into v5 Nov 18, 2026
114 of 116 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the preflight-reference-discovery branch November 18, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

1 participant