Skip to content

feat(cli): add --cloud mode to recce init for CLL pre-computation#1284

Open
even-wei wants to merge 2 commits intomainfrom
feature/drc-3181-session-cll-computation-after-artifact-upload
Open

feat(cli): add --cloud mode to recce init for CLL pre-computation#1284
even-wei wants to merge 2 commits intomainfrom
feature/drc-3181-session-cll-computation-after-artifact-upload

Conversation

@even-wei
Copy link
Copy Markdown
Contributor

@even-wei even-wei commented Apr 9, 2026

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?

Feature -- adds recce init --cloud for CLL pre-computation

What this PR does / why we need it:

Adds --cloud mode to recce init so it can download artifacts from Recce Cloud, compute CLL, and upload results (cll_map.json + cll_cache.db) back to the session S3 bucket.

This enables the Cloud server to serve /cll data before a Recce instance is available (DRC-3183).

Key behaviors:

  • Downloads manifests + catalogs for both current and base sessions
  • CLL cache warm-start fallback: current session -> base (production) session -> compute from scratch
  • Builds full CLL map and serializes to cll_map.json
  • Uploads both cache and map to Cloud via presigned URLs
  • Also adds cll_map.json generation to local (non-cloud) recce init

Which issue(s) this PR fixes:

Resolves DRC-3181

Special notes for your reviewer:

  • Tested locally with jaffle-shop-expand (1058 models): cold start 207s, warm cache 0.4s, CLL map build 13s
  • Cloud upload not yet testable until the companion cloud-infra PR is deployed
  • The --cloud flag reuses the same recce_cloud_options as recce server --cloud

Does this PR introduce a user-facing change?:

Added `recce init --cloud --session-id <id>` for pre-computing CLL data in Recce Cloud.

Generated with Claude Code

Add `recce init --cloud --session-id <id>` that:
1. Downloads manifests + catalogs from Recce Cloud session
2. Downloads existing CLL cache (current session → base session fallback)
3. Computes per-node CLL and builds full CLL map
4. Uploads cll_map.json + cll_cache.db back to session S3

This enables the Cloud instance to pre-compute CLL data so the /cll
endpoint can serve it without a running Recce instance (DRC-3183).

The cache fallback chain (current → base → scratch) means the 200s+
cold-start only happens once per project on production metadata upload.
Subsequent PR sessions reuse the warm cache.

Also adds cll_map.json generation to local `recce init` (non-cloud),
saved alongside the SQLite cache for local development use.

Resolves DRC-3181

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: even-wei <evenwei@infuseai.io>
@even-wei even-wei self-assigned this Apr 9, 2026
- Handle get_session 403 error explicitly (was producing misleading
  "missing org_id" error instead of "access denied")
- Fix state_file_host override (was setting nonexistent .host attribute;
  now correctly overrides base_url and base_url_v2)
- Wrap get_download_urls and get_base_session_download_urls in
  try/except for graceful error handling
- Remove duplicate import requests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: even-wei <evenwei@infuseai.io>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 20.30075% with 106 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
recce/cli.py 20.30% 106 Missing ⚠️
Files with missing lines Coverage Δ
recce/cli.py 56.95% <20.30%> (-4.68%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@even-wei even-wei requested a review from wcchang1115 April 9, 2026 09:34
@even-wei even-wei marked this pull request as ready for review April 9, 2026 09:34
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