Repository navigation
feat(kb): learn upstream PR history in one Codex-reviewed knowledge PR - #283
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f337b5c6a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not model_scope_valid(owner.owner, rule["title"] + "\n" + body, paths, models) or \ | ||
| (not owner.owner.startswith("model:") and | ||
| (self._owner_for(paths) != owner or any(owner not in self._owners_at(p) for p in paths))): |
There was a problem hiding this comment.
Route rules by every code path they name
When a generated rule cites evidence under one owner but names a backticked path or symbol belonging to another owner in its trigger/action text, this check validates ownership using only the evidence paths assembled above. Although _screen later validates those named claims, it never rechecks their ownership, so the rule can be written under the wrong component and omitted from Direct reviews of the component it actually governs. Include the paths discovered by _paths_named when selecting and validating the nearest owner.
AGENTS.md reference: AGENTS.md:L12-L17
Useful? React with 👍 / 👎.
KB init adds a
pr-historyphase afterdeepen. It reads the latest 1,000 merged upstream PRs by default, replays them oldest first through the configured model gateway, and opens one draft knowledge PR with one nonempty knowledge-upgrade commit per accepted upstream PR. Codex reviews the complete aggregate diff, prior owner rules, routes and pinned source evidence; only approval of the exact head makes the draft ready.The phase keeps executable rules with their nearest component or model owner and never writes raw PR archives into knowledge. It checkpoints the immutable window, frozen baseline, completed PRs, pending extraction and cumulative spend, so failures and budget increases resume the same batch. Publication retries preserve the commit series and reject changed inputs. The compact PR description stays within GitHub's limit, while commit trailers retain every upstream reference. Existing init records remain compatible, including completed repositories adding this phase.
Use
kb init <repo> --stage pr-history;--pr-count Noverrides the default and--budget-usd Ncan raise the cumulative ceiling. This change adds the phase; production learning runs are invoked separately.Validation at
f337b5c6a263b3433d9760ff072ae1de637d170d:87b16108283f8e27d07b570f213f30285ec4c398, with no remaining actionable findings; its 206 targeted tests passed.