fix(delivery): admit PRs on any-language and fork-headed checkouts - #2173
Conversation
The project-open feedback cycle minted its provider seed from the first indexed `.rs` file, so every checkout without Rust failed its advisory mount with `feedback-code-index-rust-document-unavailable` and never reached pull-request discovery. The seed now takes any indexed document of the ready generation; only the cargo compiler publication provider still asks for a Rust document, and mounts only when one exists. The proximity drift check compares generation identity, which already pins the saved document, instead of the arbitrary seed file. Pull-request discovery used GitHub's commit-associated REST route, which answers `[]` for fork heads. It now queries the checkout repository's pull requests by head ref through GraphQL, pins the exact head commit, and resolves the head repository from `headRepositoryOwner` / `headRepository`. The daemon logs the typed discovery outcome. Before a generation mounts the cycle, the explicit advisory cycle names why none can: a disabled linked-worktree index or a checkout with no indexable source is a typed `unsupported` state, not "not mounted yet".
|
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: 2823d1f999
ℹ️ 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 let Some(authorization) = authorization.as_ref() { | ||
| post = post.header("Authorization", authorization.as_str()); | ||
| } |
There was a problem hiding this comment.
Keep public discovery working without a gh login
When a public repository has no registered credential and gh is absent or unauthenticated, public_repository_read_credential_v1 intentionally returns an anonymous credential, so this request omits Authorization; GitHub's GraphQL endpoint rejects anonymous requests, as the new function documentation itself notes, and discovery always returns Denied, preventing the GitHub advisory owner from mounting. The previous REST discovery route supported anonymous public reads, while the fixture server incorrectly accepts this unauthenticated GraphQL request; retain an anonymous-capable fallback or require a real authenticated credential before selecting GraphQL.
AGENTS.md reference: AGENTS.md:L167-L169
Useful? React with 👍 / 👎.
| discover_exact_commit_pull_request_v1( | ||
| &owner, | ||
| &repository, | ||
| &head_ref_name, | ||
| &head_commit_id, |
There was a problem hiding this comment.
Resolve the base repository before querying fork PRs
In the common fork-clone setup where remote.origin.url is the contributor's fork, owner and repository here identify that fork, but repository.pullRequests lists PRs filed against that repository rather than outgoing PRs filed against the upstream project. Consequently the upstream fork-headed PR is never returned. The added fixture bypasses production remote resolution by supplying dtolnay/anyhow directly, so it does not cover this journey; discovery must resolve or search the PR's base repository instead of assuming origin is the base.
AGENTS.md reference: AGENTS.md:L167-L169
Useful? React with 👍 / 👎.
Fixes #2109
Root cause
Language gate.
feedback_document_identity_from_generationincrates/tracedecay-code-index-runtime/src/code_index_scheduler/registry.rsbuilt the project-open feedback cycle's provider seed from the first indexed file with extensionrs. It failed withfeedback-code-index-rust-document-unavailablewhen there was none. Both advisory mount paths (the initial mount and the deferred retry) pass no document. So on any checkout without Rust the deferred mount went terminal, the advisory owner never mounted, and pull-request discovery never ran. The explicit cycle answered "not mounted yet" for the daemon's whole life.Fork lookup.
discover_exact_commit_pull_request_v1usedGET /repos/{owner}/{repo}/commits/{sha}/pulls. GitHub answers[]for a fork-headed commit, so a fork PR was never found.What changed
Language gate removed. The seed now takes any indexed document of the ready generation. Readiness is the same generation-ready ladder every other consumer uses; there is no language test on top of it.
Compiler provider mounts only for Rust. The cargo compiler publication provider was the one consumer that needed a Rust document, via
provider_seed.language == "rust". It now gets its own optionalcompiler_seedfromfeedback_language_document_identity_from_generationand mounts only when the generation has a Rust document.Proximity drift check fixed. The proximity check compared the saved document's file against the arbitrary seed file. It now compares generation identity only. A generation is immutable, so an unchanged generation already pins the saved document's identity.
Fork discovery. Discovery runs one static GraphQL query: the checkout repository's pull requests with
headRefNameequal to the local branch. It pins the exact head commit and resolves the head repository fromheadRepositoryOwner/headRepository. The base repository must equal the checkout's remote; the base repo is no longer assumed to be the head repo. The daemon logs the typed outcome asgithub_pull_request_discovery: found (with the head repository), not found, ambiguous, rate limited, denied, unavailable, or not attempted (with the source-access state).Typed no-index states. Before a generation mounts the cycle, the explicit advisory cycle names why none can:
feedback.advisory-cycle.code-index-disabledfor a disabled linked-worktree index;feedback.advisory-cycle.no-indexable-sourcefor a checkout with no indexable source.Both are kind
unsupported. The retryable warming state keeps its code, with a message that says what it waits for.Fail before / pass after
Both "before" runs used this branch with only the fix reverted: the
.rsseed selection restored inregistry.rs, and master's REST commit-pulls scan swapped into the discovery seam.daemon::production_harness::advisory_cycle_language_journey_test::typescript_only_checkout_runs_the_pull_request_advisory_cyclecallstracedecay_feedback_advisory_cycleover MCP on a TypeScript-only repository. Before:After:
ok. The cycle returns anevidenceoutcome with providersgit_hub_review,ci_localization,proximity.advisory::github_runtime::discovery::tests::fork_headed_pull_request_is_found_with_its_head_repositoryreplays GitHub's cached answers for dtolnay/anyhow#463 (fixtureadvisory/fixtures/fork_head_pull_request.json). Before:After:
ok. The same test also asserts that a local head the PR no longer points at staysNotFound.New typed state:
checkout_without_indexable_source_names_why_the_advisory_cycle_cannot_runasserts kindunsupported, codefeedback.advisory-cycle.no-indexable-source, and legal actionreconcile. On master the same call answers "not mounted yet".Runtime journey
Built binary
tracedecay 1.0.0-beta.53+0bd85ef1fe(debug,--features production). The daemon ran undersystemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=1Gwith an isolatedHOME,TRACEDECAY_DATA_DIRandXDG_*. The profileconfig.tomlregisters[[github_review_sources]] rust-lang/log access="public".Discovery now admits PR #741 and the advisory owner mounts with it. The Delivery
pull_requestslane and the dashboard Journey view still readnot_published, for a separate reason, filed as #2158. The GraphQL review-thread read returns 200, then the decoder drops the whole PR ingest: one comment body startingNit: ...is sniffed as YAML and quarantined by the provider-metadata sanitizer. The GitHub source binding the journey had to add by hand, and the preview/apply ordering mismatch hit while adding it, are filed as #2159.Checks
cargo test -p tracedecay-application --lib: 470 passed.cargo test -p tracedecay -p tracedecay-code-index-runtime --lib -- production_harness project_open_owners feedback_identity advisory feedback_impact: 34 + 1 passed before the rebase.cargo clippy -p tracedecay-code-index-runtime -p tracedecay-application -p tracedecay --all-targets -- -D warnings: clean.cargo fmt --all -- --check: clean.