Repository navigation
feat: keep the review guide's request in the review artifact - #177
Conversation
A review now saves the body it POSTs to /v1/review-guide, the same xz-compressed bytes, as closed/bundle.json.xz in the review artifact. The artifact held the analyses and the guide but not the call graphs the guide is generated from, so no guide could be generated again on the same inputs. With the request kept, any change to the guide can be compared old against new on real pull requests. It is written only when the guide's request goes out, so never in sync mode, never for a provider the service cannot call, and never when the inputs are missing or over the service's limit. Writing it never fails the run or changes the guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeBoarding reviewStatus: 1 changed component See the full change in CodeBoarding. graph LR
n_Action_Workflow_and_Analysis_Execution["Action Workflow and Analysis Execution"]
n_Remote_Review_and_Problem_Ledger["Remote Review and Problem Ledger"]
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Remote_Review_and_Problem_Ledger modified;
|
Single-letter names in the new review-bundle tests become what they hold (request, path, body, written). No behaviour changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis 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: 124edde971
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| path = artifact / "closed" / BUNDLE_NAME | ||
| path.parent.mkdir(parents=True, exist_ok=True) | ||
| path.write_bytes(data) |
There was a problem hiding this comment.
Account for the bundle in the artifact download cap
When a review artifact was already within 4.3 MB of the 50 MiB limit, this new member can push its size_in_bytes over MAX_ARTIFACT_BYTES. I checked sync's findings reader in scripts/problem_history.py:572-579: it skips the entire archive before opening closed/architecture.json, so once all retained runs use this format, problem history will stop receiving architecture findings for affected repositories. Please increase or decouple that limit so the added bundle does not make the architecture result unreadable.
Useful? React with 👍 / 👎.
| raise Skip(f"{len(data) / 1e6:.1f} MB is over the service's limit") | ||
| path = artifact / "closed" / BUNDLE_NAME | ||
| path.parent.mkdir(parents=True, exist_ok=True) | ||
| path.write_bytes(data) |
There was a problem hiding this comment.
Remove a partially written bundle after write failures
If write_bytes fails after writing part of the data—for example, because the runner exhausts its disk quota—it leaves closed/bundle.json.xz on disk, while this catch only logs the failure. The subsequent artifact upload can therefore publish a truncated member rather than the promised byte-for-byte request, and consumers will be unable to decompress or replay it. Write through a temporary file and replace atomically, or remove the destination in the exception path.
Useful? React with 👍 / 👎.
What
In review mode,
scripts/remote_features.pynow saves the body it POSTs to/v1/review-guideinto the review artifact asclosed/bundle.json.xz. It is the same bytes the service receives (xz-compressed JSON, so the name says.xz, not.gz), not a re-encoding.Why
Review artifacts carry
analysis.json,metadata.json,health_report.json,review_guide.jsonandclosed/architecture.json, but not the call graphs the guide is generated from, so no guide can be generated again on the same inputs. Keeping the request lets every guide change (starting with the prompt and packet change in licensing-aws) be compared old against new on real pull requests. A separate job will copy bundles into CodeBoarding-evals before they expire.This adds no closed logic: it stores the inputs the action already sends, nothing more.
When it is written
mode == 'review'; sync's one remote call (problem_history.py,/v1/briefing) writes no artifact. A test checks both._encodealready refuses these before anything is sent, and the existing notice says why).keep_bundlealso refuses an empty body or one overMAX_COMPRESSED_BYTESitself, with one::notice::line.source.json. Architecture's body (which may carry the repository's source) is not kept.Size
Measured by running this branch's collection and encoding path, with the pinned engine (
codeboarding==0.15.6), on real baselines and with the POST stubbed:The service caps the body at 4.3 MB, so that is the most it can add. xz output does not shrink further in the artifact zip. The review artifact keeps its 14-day
retention-days; nothing about retention changes.problem_history.pydownloads review artifacts only up to 50 MB, far above this.The webview ignores it
CodeBoarding-webview inflates only the names in
PR_ARTIFACT_FILES(src/lib/pr-artifact.ts:562onmainat 569db1c:analysis.json,metadata.json,base_analysis.json,health_report.json,review_guide.json,closed/review-guide.json,closed/architecture.json), via thereadZipEntriesfilter. No other reader there walksclosed/. The new file is never read or inflated.Tests
KeptBundleTestsintests/test_remote_features.py:problem_history.py)Full suite: 359 tests pass.
Draft: not to be merged or released from here; the
v1tag is untouched.🤖 Generated with Claude Code