Skip to content

feat: keep the review guide's request in the review artifact - #177

Merged
Svilen-Stefanov merged 2 commits into
mainfrom
claude/keep-guide-bundle-a6b690
Nov 24, 2026
Merged

Svilen-Stefanov merged 2 commits into
mainfrom
claude/keep-guide-bundle-a6b690

Conversation

@Svilen-Stefanov

Copy link
Copy Markdown
Contributor

What

In review mode, scripts/remote_features.py now saves the body it POSTs to /v1/review-guide into the review artifact as closed/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.json and closed/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

  • Only when the guide's request goes out: written just before the POST, so a request the service answers with an error is still kept.
  • Never in sync mode. The only step that runs this script is gated on mode == 'review'; sync's one remote call (problem_history.py, /v1/briefing) writes no artifact. A test checks both.
  • Not written when no request is sent: inputs missing (no call graph), a provider the service cannot call, or a body over the service's limit (_encode already refuses these before anything is sent, and the existing notice says why). keep_bundle also refuses an empty body or one over MAX_COMPRESSED_BYTES itself, with one ::notice:: line.
  • It is the guide's body, which never carries source.json. Architecture's body (which may carry the repository's source) is not kept.
  • Writing it can never fail the run or change the guide: any error becomes one notice line, and the guide and architecture results are written as before.

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:

Pull request Bundle Review artifact today (zipped)
CodeBoarding-action #175 (25 KB analysis) 24 KB about 12 KB
CodeBoarding-webview #323 (1.7 MB analysis, 8 MB call graph) 214 KB about 510 KB
crate (large, figure from the module docstring) about 1.4 MB

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.py downloads 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:562 on main at 569db1c: analysis.json, metadata.json, base_analysis.json, health_report.json, review_guide.json, closed/review-guide.json, closed/architecture.json), via the readZipEntries filter. No other reader there walks closed/. The new file is never read or inflated.

Tests

KeptBundleTests in tests/test_remote_features.py:

  • written as the exact bytes the guide sent, and without architecture's source
  • kept when the guide's request went out but the service answered 500
  • not written when inputs are missing, the provider cannot be called, or the body is over the limit
  • an empty or oversized body is skipped with exactly one log line
  • a failed write leaves the guide and architecture results unchanged
  • never in sync mode (action.yml wiring and problem_history.py)

Full suite: 359 tests pass.

Draft: not to be merged or released from here; the v1 tag is untouched.

🤖 Generated with Claude Code

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-review

codeboarding-review Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

CodeBoarding review

Status: 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;
Loading

download artifacts · run 45307307872

@ivanmilevtues
ivanmilevtues self-requested a review November 24, 2026 01:03

@ivanmilevtues ivanmilevtues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems good to me.

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>
@Svilen-Stefanov
Svilen-Stefanov marked this pull request as ready for review November 24, 2026 01:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T02:01:17.175046Z 124edde Draft marked ready
ℹ️ 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: 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".

Comment on lines +690 to +692
path = artifact / "closed" / BUNDLE_NAME
path.parent.mkdir(parents=True, exist_ok=True)
path.write_bytes(data)

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 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)

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 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 👍 / 👎.

@Svilen-Stefanov
Svilen-Stefanov merged commit af787db into main Nov 24, 2026
5 checks passed
@Svilen-Stefanov
Svilen-Stefanov deleted the claude/keep-guide-bundle-a6b690 branch November 24, 2026 02:01
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.

2 participants