Skip to content

pr-debug: post landed-fix records to the knowledge intake mailbox issue - #138

Merged
tzhouam merged 1 commit into
mainfrom
feat/knowledge-intake-mailbox
Sep 8, 2026
Merged

tzhouam merged 1 commit into
mainfrom
feat/knowledge-intake-mailbox

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

pr.harvest_debug_knowledge wrote its bugfix-run record only to a local drop directory (KNOWLEDGE_INTAKE_DIR), and the reviewbot that batches those records runs on another host. In production the bot's COPILOT_INTAKE_DIR does not even exist, so no pr_debug learning has ever reached a knowledge batch.

Change

  • New setting knowledge_intake_issue (KNOWLEDGE_INTAKE_ISSUE, owner/repo#N, default empty): the locked, pinned mailbox issue [Knowledge] intake mailbox: pr_debug landed-fix records (bugfix-record:v1) #135 in this repo.
  • After a landed fix, the step delivers the same record to two independent sinks: the drop file when a directory is configured, and a comment on the mailbox issue when one is configured, posted through gh api as <!-- infermatrix-copilot:bugfix-record:v1 --> followed by one fenced JSON block (the comment body is also kept in the run directory). Either sink alone is enough; neither one's failure suppresses the other.
  • Outward writes stay double-gated (invariant 5): the mailbox is posted to only when it is configured and ALLOW_POST=1; otherwise the post is a traced dry-run skip (knowledge_intake_publish_skipped). It also only ever runs after a real, authorized push. Fail-open is preserved: a bad setting, a write error, a non-zero gh exit, or a raised timeout is traced (knowledge_intake_publish_failed) and reported in outputs, never raised.
  • Consumer side: JiusiServe/omni-reviewbot#41 reads the mailbox. SPEC/config.md, SPEC/engine/steps/pr.md and the RFC rollout step describe the channel.

Validation

  • Full suite passes except the pre-existing environment failure test_phase1_cluster.py::test_drift_guard_unimportable_checked_class_fails_guard (vllm import, fails identically on clean origin/main).
  • New tests: both sinks, the ALLOW_POST=0 dry-run skip, mailbox-only configuration, drop failure not suppressing the mailbox, non-zero gh exit, raised timeout, off state, and the posted body equalling the drop record.
  • check_doc_links.py, check_doc_citations.py, check_spec_freshness.py --strict pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Js5CsiwSYjcAYvqti1Lp1Y

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T07:39:46.285464Z 0e838e7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e838e791e

ℹ️ 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".

Comment on lines +305 to +306
body = (BUGFIX_RECORD_MARKER + "\n```json\n"
+ json.dumps(record, ensure_ascii=False, indent=1) + "\n```\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cap mailbox comments below GitHub's body limit

When a run contains the default maximum of six groups with values near the existing per-field truncation limits, this serialization produces about 77,000 characters, exceeding GitHub's 65,536-character issue-comment limit. gh api then fails, and in the documented mailbox-only production configuration the fail-open path silently loses the entire valid record. Truncate or split the mailbox payload to the API limit while preserving the full local record.

Useful? React with 👍 / 👎.

The harvest step wrote its bugfix-run record only to a local drop
directory, and the reviewbot that batches those records runs on another
host: no pr_debug learning has ever reached a knowledge batch.

When KNOWLEDGE_INTAKE_ISSUE names a mailbox issue (owner/repo#N), the
step now also posts the same record as a comment carrying the
bugfix-record:v1 marker and one fenced JSON block, through gh, after the
drop file is written. The gate is the one that already admitted the
step: an operator-configured mailbox plus a real, authorized push. It
stays fail-open: a bad setting, a write error or a failed post is traced
(knowledge_intake_publish_failed) and reported in outputs, never raised.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Js5CsiwSYjcAYvqti1Lp1Y
@tzhouam
tzhouam force-pushed the feat/knowledge-intake-mailbox branch from 0e838e7 to 88d4ad5 Compare September 8, 2026 07:45
@tzhouam
tzhouam merged commit c62b72e into main Sep 8, 2026
2 checks passed
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