Repository navigation
[WS-GHPROOF-001-02] Read-only GitHub App facts adapter - #682
flow-research-agents[bot] wants to merge 9 commits into
Conversation
Typed GitHubFactsAdapter port and GitHub App provider registered per ADR 0014. Reads pull request, classic branch-protection required checks, check runs and commit statuses with bounded retries and secret-free errors. No production caller yet (WS-GHPROOF-001-02). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the most recent check run and commit status per required check count; required checks are the union of protection checks and contexts. The App private key is the WORKSTREAM_GITHUB_APP_PRIVATE_KEY secret setting with the existing redacted custody path, replacing the key file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
The architecture proof counts every ExternalServiceAdapterFactory call site. Add the GitHub adapter package as one more approved composition root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Integrity facts for owner decision 20: PR author, all reviews, all changed files (fail closed when GitHub cannot list every file), and the producing App of each judged required check. The reader makes no policy decision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Security review (time-of-check binding): re-read the pull request after all other reads and require head, merge state, base, state and file count to match; retry the whole read within the deadline, then raise the retryable GitHubFactsInconsistentError. Check runs and combined statuses must report the head SHA, and each required check records the commit it was judged on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Security review (parser differential): facts carry GitHub's pull-request html_url and each judged run's html_url, details_url and Actions workflow run id; parse_pull_request_url is the single strict parser for claimed pull-request URLs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rejecting tests for malformed keys, installation lookups, token exchanges, pull requests, protection, listings, check results, rate-limit headers and deadline exhaustion; remove three unreachable branches. Branch coverage of the adapter and port is now 100%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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: b905f25081
ℹ️ 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".
| timeout=timeout, | ||
| ) |
There was a problem hiding this comment.
Enforce an absolute deadline around the facts read
If GitHub sends response chunks frequently enough to avoid HTTPX's read-inactivity timeout, this await can continue beyond github_facts_total_deadline_seconds: the scalar HTTPX timeout limits individual network waits, not total request duration. The budget is checked only before each request, and successful responses return immediately, so an overdue final pull-request reread can even return successful facts. Wrap the complete facts operation in an absolute asynchronous timeout, including token-lock acquisition, and translate expiry to GitHubFactsUnavailableError so the advertised total budget actually bounds execution.
Useful? React with 👍 / 👎.
Resolves the behavior-ownership partition conflict by regenerating partition.v1.json with scripts.behavior_ownership (entries from both sides kept; only authority_digest recomputed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change
WS-GHPROOF-001-02- Read-only GitHub App facts adapterGoal
A typed port and adapter that read one pull request's merge facts and its base branch's required checks from GitHub, as a read-only GitHub App, producing
workstream.github_facts.v1.Intent And Planning Context
harnessy_proofchecker compares against (chunk 03). Not yet called by any production path; wiring is chunk 04.WS-GHPROOF-001-02.md. Stacked on [WS-GHPROOF-001-01] Record GitHub proof facts initiative #681.What Changed
app/interfaces/github_facts.py: port, frozen facts model, typed errors.app/adapters/github/: ADR 0014 factory andapp_facts.py(RS256 App JWT → repository-scoped installation token, cached until near expiry; PR, required status checks, paginated check runs, commit statuses; SHA-256 of each response body).core/config.pyand.env.example: App id, the private key as a redacted secret settingWORKSTREAM_GITHUB_APP_PRIVATE_KEY, API base, timeouts.Why It Changed
WorkStream has no GitHub integration; checking proof needs trusted facts read outside the checker sandbox.
Design Chosen
checks[].contextandcontexts. A check bound to an App counts only runs from that App. Commit statuses count only for any-source requirements.successpasses. No branch protection or no required checks fails closed (non-retryable).Alternatives Rejected
neutral/skippedas passing, as GitHub does: rejected for now because the facts gate payment; open for the team's view.httpxandPyJWT[crypto]already exist.Scope Control
Allowed Files Changed
Files Outside Stated Scope
Product Behavior
Evidence
Commands Run
Result Summary
Acceptance Criteria Proof
Test Delta
Tests Added
backend/tests/test_github_facts_adapter.pyTests Modified
backend/tests/test_ci_lane_catalogue.py(shared-family fingerprint for the new module)Tests Removed Or Skipped
Impact-Routed Reviewer Results
PROVISIONALRemaining Risks
Follow-Up Work
Chunk 04 wires this into post-submit evaluation after #677, and decides whether a missing PR is a checker finding or an infrastructure failure.
Human Review Focus
Please inspect:
app_facts.pyand the secret setting._required_checks,_latest,_conclusion).Update: integrity and security-review fixes
GitHubFactsIncompleteError.html_url,details_urland workflow run id, and whether a commit status was judged.GitHubFactsInconsistentError. Both PR reads are hashed, and check pages for another commit are rejected.html_url.parse_pull_request_urlis the single strict parser chunk 04 must use.CI And Gate Integrity
Human Merge Ownership
The human completes the acceptance/merge checks; agents must not tick them on
the human's behalf or infer approval from a passing CI status.
🤖 Generated with Claude Code