Skip to content

build: generate the RPC params catalog and bundled skill guides at build time - #30644

Closed
brennanb2025 wants to merge 30 commits into
mainfrom
brennanb2025/generated-files-build-time
Closed

brennanb2025 wants to merge 30 commits into
mainfrom
brennanb2025/generated-files-build-time

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​27 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​115 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1750 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1635

Problem and result

The RPC parameter catalog and embedded CLI skill guides duplicated source already in the repository. Developers had to regenerate and commit those copies; omissions failed CI, and large generated lines caused merge conflicts. This PR generates the copies before supported build and validation commands, so developers no longer commit them. Shipped guide output, RPC messages, saved data and user defaults retain their existing contracts.

The common pattern is to generate derived build inputs before their consumers. Raw tools and editor sessions still require pnpm run build:packages after checkout or input changes (pnpm --dir .. run build:packages from mobile); supported package commands prepare automatically. Installable skill guides stay tracked and checked.

Changes

  • Ignore both derived TypeScript modules and generate them through the existing build:packages owner, including installation and CI installation.
  • Prepare nine root and four mobile consumer entry points, preserving arguments, working directories and failure behavior. The aggregate prepares once before its 14 raw children.
  • Publish generated files through temporary siblings and rename, retaining modification times for unchanged content.
  • In cross-version tests, generate a missing catalog from the extracted release’s own declarations. Preserve existing catalogs and releases from before the catalog existed.

Validation and review

Full review path: two rounds and the KEEP architecture ruling are complete. The final independent mechanical-merge review found no proven P0/P1/P2 issue on 69ed57f086978449efbf4873bf84d712bbc13e6c, including main 89e93cfa387188ac63b0ec711da4bf02873225bf. Incoming non-PR source and lockfiles match main; no dependency fix is authored here.

Current-head full PR workflow passed all 23 executed jobs with seven scoped skips. The complete check snapshot has 51 successes and 11 policy skips, including successful dependency security and WSL checks. Its synthetic tree equals the pushed head. CI owns full lint/typecheck. Focused tests cover missing/stale output, unchanged modification times, invalid-input publication, command arguments/working directories and failure propagation.

The successful packaged QA ran on 1adf535936e18c23d6bcf50d937831de0623d80d against main 54acda1d127b076abd00cafe86e361051f5ff7af: both normal unsigned arm64 packages passed startup, four byte-equal shipped guide commands, authenticated schema-validated RPC, normal Terminal 1 isolation, rendered Settings and one new real native Codex reply each. The catalog matched pinned main after only the approved header and formatter normalization. All 788 sanitized evidence records were independently verified, package inventories stayed unchanged, and recorded process/listener cleanup passed.

Only five mechanical main merges followed that QA head. The October 23 ruling carries this evidence forward; current-head CI and independent merge review cover integration, with no merge-broken flow found. The later collector failure was a rig bug; it does not invalidate the earlier successful run. A redundant October 23 build attempt was stopped by the lane owner before any app or driver launched. The single review comment names all five merges and retains the 18 original whole-renderer screenshots.

Scope and observations

Both QA refs lose the displayed Low label after replying without changing controls; effective effort and cause are unverified. Main alone logged an at-rest slash-discovery SQLite warning while its app and successful provider were alive; slash functionality was not tested. The branch’s optional post-driver backend snapshot failed in its collector; earlier live isolation and named closure were independently verified. A preliminary package containing QA scratch was excluded, and the complete assigned flow passed on the corrected normal package.

Generation work was source-reviewed, not benchmarked. Unreproduced external Windows sharing, abrupt-temp cleanup and cancellation concerns remain deferred after bounded traces. Rendered QA is macOS only; cross-platform and mixed-version contracts passed CI. This PR changes no agent/native-chat implementation. No all-provider, resume/upgrade, phone/remote UI, signed installation or updater coverage is claimed.

Checklist

  • Two-round review and final independent merge/performance checks complete
  • Current-head full workflow green
  • Successful packaged QA and normalized catalog comparison retained across mechanical main merges
  • Final status marker and readiness gate confirmed

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source is copied or translated.

…ild time

Both files were derived from in-repo source, checked in, and compared by CI,
so forgetting to regenerate cost a CI round and every guide edit conflicted on
one JSON-string line. build:packages (postinstall, every test, typecheck, dev
and build script, and CI's install action) now writes them; they are gitignored.
The cross-version harness derives the catalog for release trees that lack it.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 19, 2026 08:07
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0850a6ac-69f3-414d-8eec-113dc78eab8e
📥 Commits

Reviewing files that changed from the base of the PR and between 13b1e35 and 272777b.

⛔ Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing: 1
  • config/scripts/check-e2e-typecheck-ratchet.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Package builds now generate the RPC parameter catalog and embedded skill guides. The catalog generator can target a supplied repository root and writes only when its output changes. Several checks now build packages before running. Release checkout materialization generates a catalog when its directory exists but the catalog file is missing. The RPC catalog verification step was removed from lint, workflow, and preflight checks.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 27277

A failed generated-file replacement can leave temporary artifacts behind, but normal replacement and application behavior are otherwise unaffected.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the problem, implementation, validation, scope, and checklist in detail. It does not follow the required template fully: it omits the required Linked Issue entry, the Visual P… Add an actual issue reference in a Fixes #<issue> entry, add the required Visual Proof section with N/A and a reason if no visual change exists, and add the Testing section with completed or explained test checkboxes. Reconcile the vali…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: generating the RPC parameter catalog and bundled skill guides during builds.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, implementation, validation, scope, and checklist in detail. It does not follow the required template fully: it omits the required Linked Issue entry, the Visual Proof section with an explicit N/A statement, and the Testing section with the required test checkboxes. The description also reports current-head success, while the provided objectives report an unresolved current workflow failure and merge conflicts.

Resolution

Add an actual issue reference in a Fixes #&lt;issue&gt; entry, add the required Visual Proof section with N/A and a reason if no visual change exists, and add the Testing section with completed or explained test checkboxes. Reconcile the validation claims with the latest CI status and document the current merge-conflict and end-to-end typecheck-ratchet state.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The path-literal ratchet rejects src/ paths that name no tracked file. oxlint
already skips gitignored files.
…owaway cache

Deriving loads the release's whole RPC registry, so it runs in its own process
rather than the test worker. The HEAD test uses a temporary cache so it doesn't
leave one extracted tree per commit.
… the catalog

A concurrent typecheck, test run or dev watcher now never reads a half-written
module. The cross-version harness derives the catalog only for releases whose
tree has its directory, since both arrived together.
@brennanb2025
brennanb2025 marked this pull request as draft October 19, 2026 09:36
@brennanb2025
brennanb2025 marked this pull request as ready for review October 19, 2026 09:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ee82c60c-61f0-494a-8507-0f4d097ee684
📥 Commits

Reviewing files that changed from the base of the PR and between 59a9da2 and 675f748.

⛔ Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing: 15
  • .gitattributes
  • .github/workflows/pr.yml
  • .gitignore
  • .oxlintrc.json
  • config/oxlint-anti-slop.json
  • config/scripts/generate-bundled-skill-guides.mjs
  • config/scripts/generate-bundled-skill-guides.test.mjs
  • config/scripts/generate-rpc-params-catalog.mjs
  • config/scripts/pr-preflight-gates.test.mjs
  • mobile/README.md
  • mobile/package.json
  • package.json
  • src/cli/bundled-skill-guides.ts
  • tests/e2e/cross-version-wire/release-checkout.ts
  • tests/e2e/cross-version-wire/release-checkout.unit.test.ts
💤 Files with no reviewable changes: 5
  • .oxlintrc.json
  • config/scripts/pr-preflight-gates.test.mjs
  • config/oxlint-anti-slop.json
  • .github/workflows/pr.yml
  • .gitattributes

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@brennanb2025

brennanb2025 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Two checked-in generated modules duplicated their source inputs, causing drift failures and merge conflicts. This PR generates the RPC parameter catalog and embedded CLI guides before supported commands, so developers no longer commit those copies. Packaged guide output and RPC behavior keep their existing contracts.

Current state: review is complete on 69ed57f086978449efbf4873bf84d712bbc13e6c, including main 89e93cfa387188ac63b0ec711da4bf02873225bf. Two review rounds and the KEEP architecture ruling remain complete. The independent final merge review found no proven P0/P1/P2 issue and verified all incoming non-PR paths and lockfiles against main. Both generated modules remain deleted from Git. No open confirmed production finding remains.

Fixed: nine root and four mobile entry points prepare missing or stale output through the existing build owner while retaining arguments, working directories and failure behavior. The aggregate prepares once before 14 raw children. Both producers publish through temporary sibling files and rename; identical content retains its modification time. Installable guide projections stay tracked and checked. Cross-version tests derive missing catalogs from the extracted release's own declarations, preserving existing catalogs and releases from before the catalog existed.

CI passed on the current head: full PR workflow, 23 successful jobs and seven scoped skips. The complete current-head check snapshot has 51 successes and 11 policy skips, none pending or failing; dependency security and WSL also pass. The synthetic CI tree exactly equals 69ed57f086978449efbf4873bf84d712bbc13e6c. No dependency fix was authored in this PR. CI remains the lint/typecheck gate.

Packaged QA: fresh normal unsigned arm64 packages on exact 1adf5359 and pinned main 54acda1d completed startup, four shipped guide commands with identical stdout/stderr/exit codes, authenticated schema-validated RPC, normal terminal isolation, rendered Settings, and one new native Codex chat returning exactly QA_CODEX_FINAL_OK on each. The generated catalog equals pinned main byte for byte after only the approved two-line header and formatter normalization. All 788 sanitized evidence files verified against their pinned manifest and archive (788 records, 22,727,739 bytes). The complete inventories of both packages remained unchanged, and recorded process/listener cleanup passed.

QA carried forward: the tested branch is 1adf535936e18c23d6bcf50d937831de0623d80d, against main 54acda1d127b076abd00cafe86e361051f5ff7af. Only mechanical main merges followed: 6b31470f3655018380d368e923dae0011ce4b539, db87b8c27a00bfdaa5753f870190cf9790901baf, 466c2a0fe267acc7b443e3aedea0bd3a89259e06, 765689ec29e411bab7648e52a78909e4a6c003a0, 69ed57f086978449efbf4873bf84d712bbc13e6c. Under the October 23 ruling, main merges retain this successful evidence; current-head CI and independent merge review cover integration. No merge-broken flow was found. The later collector failure was a QA rig defect, not a product failure or a withdrawal of the successful October 22 run. The redundant October 23 build attempt was stopped on the lane owner’s instruction before any app or driver launched. The screenshots below are the original successful run, not new-head screenshots.

QA observations: both refs lose the displayed Low label after the reply without changing controls; effective effort and cause remain unverified. Main alone logs an at-rest slash-discovery SQLite initialization warning while the app and successful provider are alive; no slash-functionality pass is claimed. Real config changes are hash-only observations without writer attribution. The branch's optional post-driver backend snapshot failed in the collector; earlier live backend isolation and named closure are retained separately. A QA scratch file initially entered the preliminary package; that package is excluded from final evidence, and a normal corrected package ran the complete assigned flow. No product fix or extra provider flow was added.

Deferred and limits: raw tools/editors need build preparation after checkout or input changes; supported package commands prepare automatically. Unreproduced external Windows sharing, abrupt-temp cleanup and cancellation concerns remain deferred after bounded source traces. Generation overhead was source-reviewed, not benchmarked. No all-provider, resume/upgrade, phone/remote UI, signed installation or updater-action coverage is claimed. This PR adds no agent/native-chat implementation change.

For Brennan's review

The same fixture, prompt and defaults on pinned main 54acda1d and corrected branch 1adf5359. These are immutable whole-renderer originals from the final packages. IDs, paths, titles and live footer values differ between isolated runs.

Flow Pinned main 54acda1 Branch 1adf535
Packaged startup startup.png startup.png
Normal Terminal1 terminal-created.png terminal-created.png
Actual pane isolation terminal-env.png terminal-env.png
Chat UI initially off before.png before.png
Chat UI enabled after.png after.png
Codex already enabled provider-settings.png provider-settings.png
New native Codex chat new-chat.png new-chat.png
Same prompt, before send prompt-input.png prompt-input.png
Visible real reply provider-reply.png provider-reply.png

…2025/generated-files-build-time

# Conflicts:
#	src/shared/rpc-contract/rpc-params-catalog.generated.ts
@brennanb2025
brennanb2025 requested a review from Jinwoo-H October 22, 2026 17:50
…2025/generated-files-build-time

# Conflicts:
#	src/shared/rpc-contract/rpc-params-catalog.generated.ts
…2025/generated-files-build-time

# Conflicts:
#	src/cli/bundled-skill-guides.ts
#	src/shared/rpc-contract/rpc-params-catalog.generated.ts
…2025/generated-files-build-time

# Conflicts:
#	src/shared/rpc-contract/rpc-params-catalog.generated.ts
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing in favor of #33712.

Two independent reviewers, one Claude and one Codex, looked at whether this was still worth merging, and over two rounds they agreed it is not.

Why not:

  • Main has since moved the package-build step this PR hooks into (perf(test): faster local test loop and cold-worktree changed runs #33421). Merging main now conflicts in 8 files, and several commands would skip generating the files.
  • Every new command has to remember to generate the files first, and review already caught gaps in that twice.
  • Most of the real conflict cost comes from one thing: each skill guide is written as a single line of up to about 49,000 characters.

#33712 keeps both generated files committed, along with their CI check. It writes each guide one line per markdown line, with the strings byte-identical, so concurrent guide edits merge the way their markdown sources do.

@brennanb2025
brennanb2025 deleted the brennanb2025/generated-files-build-time branch October 26, 2026 00:50
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.

1 participant