Skip to content

ci(release): produce ag-rledger as a release artifact - #1600

Merged
robcohen merged 2 commits into
mainfrom
perf/release-ag-rledger
Jun 25, 2026
Merged

robcohen merged 2 commits into
mainfrom
perf/release-ag-rledger

Conversation

@robcohen

Copy link
Copy Markdown
Member

What

Builds the agent-native CLI (ag-rledger) in CI releases and includes it in the release archives, alongside rledger + rledger-lsp.

Why

ag-rledger (the #1291 agent-native CLI, gated behind the ag-rledger feature → pulls agcli/tokio) was never built or shipped — release archives only contained rledger + rledger-lsp, so there was no way to obtain ag-rledger from a release.

How

In release-build.yml, build ag-rledger in all three build paths (PGO Unix, PGO Windows, cross/native) exactly like rledger-lsp — separately, feature-gated, no PGO:

cargo build --release --target <T> -p rustledger --bin ag-rledger --no-default-features --features ag-rledger

and add it to the Unix tar.gz + Windows zip archives.

Verification

  • Build invocation verified locally: cargo check -p rustledger --bin ag-rledger --no-default-features --features ag-rledger is clean.
  • release-build.yml is valid YAML.
  • Non-breaking: the extra binary doesn't affect the Docker/AUR/binstall consumers, which extract rledger by name.
  • The release pipeline runs only on tag push, so the full cross-compiled ag-rledger build is first exercised at the next release; this mirrors the proven rledger-lsp build/package pattern.

🤖 Generated with Claude Code

The agent-native CLI (ag-rledger, gated behind the ag-rledger feature) wasn't
built or shipped in releases — only rledger + rledger-lsp were. Build it in all
three release paths (PGO Unix, PGO Windows, cross/native) the same way as
rledger-lsp (feature-gated, no PGO) and include it in the Unix tar.gz + Windows
zip archives. Build invocation verified with cargo check; mirrors the existing
LSP build/package pattern.
Copilot AI review requested due to automatic review settings June 25, 2026 20:51
@robcohen
robcohen requested a review from a team as a code owner June 25, 2026 20:51

Copilot AI 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.

Pull request overview

Adds the agent-native ag-rledger CLI binary to the release build pipeline so it is built for all release targets and included in the published release archives alongside rledger and rledger-lsp.

Changes:

  • Build ag-rledger as a separate, feature-gated binary (--no-default-features --features ag-rledger) in the PGO Unix, PGO Windows, and non-PGO (cross/native) build paths.
  • Include ag-rledger/ag-rledger.exe in the Unix tar.gz and Windows zip release archives.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release-build.yml Resolved
@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100%
Full AST Match 100%
Total Files 792
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@robcohen

Copy link
Copy Markdown
Member Author

Thanks — but the agent-native binary is exercised in normal CI: ci.yml runs cargo check/clippy --all-features --all-targets and cargo nextest run --all-features, and --all-features enables the ag-rledger feature, which satisfies the bin's required-features — so the binary is compile-checked + clippy-linted and its tests/ag_rledger_test.rs integration test runs on every PR (the search only missed it because it matched --all-features, not the literal --features ag-rledger).

What is release-only is cross-target builds (musl / Windows-ARM / etc.) — but that is true of rledger and rledger-lsp too; none of the binaries are cross-compiled in PR CI. So this change keeps ag-rledger at exactly the same pre-release coverage as the existing binaries, rather than introducing a new gap. Adding cross-builds to PR CI would be a separate (and broad) change applying to all three binaries.

@robcohen
robcohen merged commit f2ff224 into main Jun 25, 2026
37 checks passed
@robcohen
robcohen deleted the perf/release-ag-rledger branch June 25, 2026 21:28
robcohen added a commit that referenced this pull request Jun 25, 2026
…1601)

* ci(release): enable mimalloc in release rledger binaries (-7% load)

Follow-up to #1599 (mimalloc opt-in feature) + #1600. The release builds use
--no-default-features, so the opt-in feature wasn't reaching shipped binaries.
Add --features mimalloc to the rledger builds (PGO Unix/Windows + native
non-cross) so released binaries get the ~7% lower-load allocator win.

Cross-compiled targets are intentionally excluded: mimalloc's vendored C build
isn't validated under cross here, and a release shouldn't hinge on it — they
ship without the allocator. Feature resolution verified locally (cargo build
--no-default-features --features mimalloc resolves at the virtual workspace
root); rledger output is unchanged (allocator-only).

* ci(release): clarify mimalloc cross-vs-native comments (review)
robcohen added a commit that referenced this pull request Jun 26, 2026
* docs(readme): explain ag-rledger (agent-native CLI) next to the MCP server

Adds an 'AI & agents' section documenting the two AI integration surfaces:
the MCP server (interactive assistants) and ag-rledger (headless agents /
pipelines, structured JSON envelopes). ag-rledger now ships in release archives
(#1600) but was undocumented. Envelope shape + example taken from the binary's
integration test (ok / exit_code / result.data / next_action).

* docs(readme): fix ag-rledger example per review

- build command: add --no-default-features (matches release; avoids pulling
  wasmtime/cranelift via the default python-plugin-wasm feature)
- example: use 'check --json' (result.data is only structured when the inner
  command emits JSON) and make the envelope valid JSON (drop trailing ', …')
- subcommands: 'extract' (the real import command, alias x), not 'import'
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