Repository navigation
fix(repository): accept GitHub's spelling of the repository in native draft PR receipts - #3280
Conversation
… draft PR receipts The native broker checks GitHub's draft reply, and every stored receipt it re-reads, against https://github.com/<lowercased registry name>/pull/N. GitHub answers with the repository's own spelling, so a draft created in a repository with capitals could never settle as created (finding 2236). The shipped client compared the broker's receipt URL the same way. Both checks, and the OpenShell client check from #3278, now share isGitHubPullUrl and isSameGitHubRepository in client-contracts.ts: only the repository's ASCII letter case may differ; host, path shape and number stay exact. Stored lowercase receipts still validate. Finding 2233: the OpenShell Git route's credential path match is case-sensitive in Git and OpenShell, and OCE only learns GitHub's spelling from the token reply after the provider is registered. Document that agents use the lowercase URL OCE gives the Sandbox.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
…RL docs isGitHubPullUrl now also requires a positive PR number, so the native receipt check gets it too. The docs name the exact lowercase clone URL with .git and both ways Git can fail. Tests pin a trailing slash, a query and number zero.
|
Codex review: needs maintainer review before merge. What this changesThis PR accepts ASCII case differences in GitHub draft receipt repository names and documents the lowercase clone URL required by protected OpenShell access. Example: The registered repository is acme/kit and GitHub returns https://github.com/Acme/Kit/pull/8.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: main still rejects valid native draft receipts when GitHub capitalizes the repository name, and this PR provides a focused fix with no concrete introduced defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe repository credential broker authorizes an Agent's draft creation, validates GitHub's response, persists a safe receipt in PostgreSQL, and returns it to oce-github. flowchart TB
A[Agent oce-github client] --> B[Repository credential broker]
B --> C[GitHub draft creation]
C --> D[Draft projection validation]
D --> E[PostgreSQL receipt]
E --> F[Validated client output]
Technical reviewBest possible solution: Land the shared receipt comparison fix through the existing broker and client owners while retaining the documented OpenShell clone URL restriction. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically rejects https://github.com/Acme/Kit/pull/8 for registered acme/kit; the added tests cover that input, but no target code was executed during this read-only review. Is this the best way to solve the issue? The fix uses the existing shared client module and updates both native validators without introducing a parallel receipt path or weakening repository ID and ref checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2b11514b7a82. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 23, 2026, 3:02 AM ET / 07:02 UTC. |
Problem
The registry stores repository names in lowercase (
Acme/Widgetsbecomesacme/widgets), but GitHub answers with the repository's own spelling.https://github.com/<lowercased name>/pull/Nexactly (validateDraftProjection). For a repository whose GitHub name has capitals, GitHub creates the draft, the check refuses itshtml_url, and the create never settles as created. The shippedoce-github pr-createcompared the broker's receipt URL the same way. fix(repository): accept GitHub's spelling of the repository in draft PR replies #3278 fixed only the OpenShell client path.https://github.com/Acme/Widgets.git) gets no credential. The Sandbox's Git credential helper key and the OpenShell provider endpoint path both use the lowercase name, and Git and OpenShell match that path case-sensitively, so Git stops withcould not read Username.Change
isSameGitHubRepositoryandisGitHubPullUrltoclient-contracts.ts, the module the controller and the isolated client bundle already share. Only the repository's ASCII letter case may differ; the host, path shape and PR number stay exact, and a non-ASCII letter that lowercases to ASCII (the Kelvin sign) is refused.validateDraftProjection(GitHub's reply and stored receipts), in the client's native receipt check, and in the OpenShell client check from fix(repository): accept GitHub's spelling of the repository in draft PR replies #3278 (replacing its inline copy). The receipt keeps GitHub's spelling of the URL. Stored receipts carry the lowercase URL, which still matches.https://github.com/$OCE_OPENSHELL_GIT_REPOSITORY.git, with.git).Verification
repository-credentials-contracts.test.mjs): lowercase, mixed-case and uppercase URLs validate unchanged; another repository, owner, longer path, PR number, host, plain HTTP and a non-ASCII lookalike are refused, as are a trailing slash, a query and number zero. Fails on main (the mixed-case and uppercase cases).prepared draft pull: created in GitHub's spelling(postgres-prepared-repository-git-broker.test.mjs): the fake GitHub answers with an uppercasehtml_url; the shipping client prints that receipt and a repeated send returns the same stored receipt. Fails on main (the operation never settles)..gitin the docs, extra URL cases). Its one follow-up, the same exactfull_namecomparison in the metadata reads, is tracked separately.repository-credentials-draft-pr-cli.test.mjsstill passes (OpenShell client path).taskset, local): the contracts conformance file,repository-credentials-draft-pr-cli.test.mjsand the full broker file against a prepared PostgreSQL.verify-repository-credentials-boundary.mjspasses.tsc --build(controller), eslint and prettier on the touched files.Risks
Low. The comparison only widens to ASCII case of the repository name, as GitHub names ignore case; IDs, refs, host and number are unchanged. Docs-only for 2233: a mixed-case clone URL still gets no credential.