Skip to content

feat(catalog): clone-on-first-run — remove bundled corpus baseline#67

Open
msitarzewski wants to merge 1 commit into
mainfrom
feat/catalog-clone-first-run
Open

feat(catalog): clone-on-first-run — remove bundled corpus baseline#67
msitarzewski wants to merge 1 commit into
mainfrom
feat/catalog-clone-first-run

Conversation

@msitarzewski

Copy link
Copy Markdown
Owner

Summary

The app bundled a snapshot of the agent catalog (resources/corpus-baseline, ~210 files) and seeded it as the default Bundled source. That snapshot perpetually drifted — this week it was 29 agents behind and missed a flat→nested game-dev restructure — and re-vendoring it by hand still shipped stale on fresh installs.

This drops the bundle entirely and makes the app clone the live catalog instead. Replaces the closed #61 (re-vendoring) with a fix at the root.

Changes

  • Remove CatalogSource::Bundled (Rust + TS) and the baseline seed path (seed_from_baseline, baseline_dir, the resolve_active baseline param). Default source is now a managed clone at ~/.agency-agents, empty until provisioned; resolve_active indexes the active root and degrades to an empty "no agents" corpus (never panics) before the first clone.
  • Delete resources/corpus-baseline/ + its tauri.conf.json bundle entry. Both existing fallbacks (git clone, codeload tarball) already fetch from GitHub, so nothing else used it. ~58k fewer lines, smaller binary.
  • First run: CatalogFirstRun now offers Download from GitHub (emphasized default; needs network) and Use my own clone (offline/existing escape hatch). Bundled card + the Settings switcher's Bundled option removed.
  • Migration: catalog_configured returns false when the persisted source can't parse as a current variant, so a pre-existing {"kind":"bundled"} re-shows the first-run picker instead of stranding the user in an empty app.

Why

Eliminates baseline drift at the root — a fresh clone always has every division (gis/healthcare/strategy included), so empty divisions and Runbooks "sync to unlock" simply don't occur — and dissolves the app↔catalog snapshot-coordination question.

Tradeoff: first run needs network (or a local clone), by design. Small user base, clear consent prompt.

Verification

  • Backend: cargo test270 passing. New resolve_active_indexes_the_clone, unprovisioned_source_serves_empty_corpus, and a {"kind":"bundled"}→re-prompt migration assertion. Clean build, no warnings.
  • Frontend: npm run check 0 errors; build clean.
  • Modal: reworked first-run verified visually against the component's real styles (Download-primary + folder option, no Bundled).
  • Not covered here (honest): the full GUI click-through on a fresh machine (launch → Download → clone → agents populate) needs a real WKWebView run, which isn't CDP-drivable from here — worth a manual smoke on a clean profile before release. The clone→index mechanic itself is unit-tested and uses the same git clone that already works.

Related

🤖 Generated with Claude Code

The app bundled a snapshot of the agent catalog (`resources/corpus-baseline`,
~210 files) and seeded it into app-data as the default `Bundled` source. That
snapshot perpetually drifted from the catalog — it had fallen 29 agents behind
and missed a flat→nested game-dev restructure — and re-vendoring it by hand was
a recurring chore that still shipped stale on fresh installs.

Drop the bundle entirely and make the app clone the live catalog instead:

- Remove `CatalogSource::Bundled` (backend + TS) and the baseline seed path
  (`seed_from_baseline`, `baseline_dir`, the `resolve_active` baseline param).
  The default source is now a managed clone at `~/.agency-agents`, empty until
  provisioned. `resolve_active` just indexes the active root and degrades to an
  empty "no agents" corpus (never panics) before the first clone completes.
- Delete `resources/corpus-baseline/` and its bundle entry in tauri.conf.json
  (both `git clone` and the codeload tarball fallback already fetch from
  GitHub, so nothing else used it). ~58k fewer lines in the repo/binary.
- First run: `CatalogFirstRun` now offers "Download from GitHub" (the emphasized
  default; needs network) and "Use my own clone" (offline/existing escape
  hatch). The Bundled card + the Settings switcher's Bundled option are gone.
- Migration: `catalog_configured` now returns false when the persisted source
  can't be parsed as a current variant, so a pre-existing `{"kind":"bundled"}`
  re-shows the first-run picker instead of stranding the user in an empty app.

This eliminates baseline drift at the root (fresh clones always have every
division, incl. gis/healthcare/strategy — so the empty-division + Runbooks
"sync to unlock" problems simply don't occur) and removes the app↔catalog
snapshot-coordination question.

Tradeoff: first run now needs network (or a local clone), by design.

Tests: replace the bundled-baseline tests with resolve_active_indexes_the_clone,
unprovisioned_source_serves_empty_corpus, and a migration assertion in the
source-persistence test. cargo test 270 passing; npm run check clean; build
clean. Reworked first-run modal verified visually against the component styles.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WdX6PvnCfRgYD11yVpXVor
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