Skip to content

fix(build): bundle archetype-catalog.json into the wheel + desktop sidecar#2115

Merged
mabry1985 merged 1 commit into
mainfrom
fix/bundle-archetype-catalog
Jul 21, 2026
Merged

fix(build): bundle archetype-catalog.json into the wheel + desktop sidecar#2115
mabry1985 merged 1 commit into
mainfrom
fix/bundle-archetype-catalog

Conversation

@mabry1985

@mabry1985 mabry1985 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Cowork is missing from the new-agent picker on the desktop app and on pip install, but present in Docker.

The archetype was never broken. config/archetype-catalog.json simply never reached either packaged build.

Evidence

The published 0.106.0 wheel contains:

config/soul-presets/cowork.md      ← the persona ships
config/plugin-catalog.json         ✓
config/mcp-catalog.json            ✓
config/archetype-catalog.json      ✗ MISSING

So the SOUL preset was there and the entry that makes it selectable wasn't. Neither hand-maintained asset list had it:

  • hatch_build.py::_SEEDS — the wheel (PyPI, and the desktop sidecar built from it)
  • apps/desktop/sidecar/build_sidecar.py::BUNDLED_DATA — PyInstaller

Why nobody caught it

_load_archetype_catalog (operator_api/fleet_routes.py:307) falls back to Basic + Custom when the file is absent, and logs nothing. The picker renders fine and just quietly offers less than the source tree does.

Docker was unaffected — its image copies the repo wholesale — so it reproduced only on desktop/PyPI, which reads as a platform quirk rather than a packaging bug.

This is the third time

build_sidecar.py's own comments record the other two:

catalog symptom fixed
plugin-catalog.json "0 official plugins" in Discover reactively, + comment
mcp-catalog.json "no servers match" in MCP Browse reactively, + comment
archetype-catalog.json Cowork unselectable this PR

The pattern is structural: catalogs are data, so adding one means editing the repo (Docker keeps working) while forgetting two lists whose readers fail soft.

The guard

tests/test_bundled_config_assets.py asserts over a glob, not a hardcoded list — every config/*catalog*.json must appear in both asset lists, and the two must agree with each other (drift ships a catalog to PyPI but not desktop, reproducing the bug on exactly one surface). A catalog added tomorrow is covered without anyone remembering the test exists. There's also a guard-the-guard test so a glob that matches nothing can't pass vacuously.

Confirmed it fails on the pre-fix tree (3 failures) and passes after.

Testing

ruff clean · 3908 Python tests · locally rebuilt wheel now contains ['basic', 'cowork', 'custom'].

Not covered by this PR

Three fleet agents (jon, frank, vera) are also missing Cowork, from an unrelated cause: their compose mounts a named volume over /opt/protoagent/config. Docker seeds a named volume from the image only on first creation, so their config froze on Jul 4 — before Cowork landed — and no image update can reach it. langgraph-config.example.yaml is stale there too. That needs a deployment change in homelab-iac, not a code change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • The archetype catalog is now included in packaged desktop applications and standard distribution builds.
    • Catalog availability is kept consistent across supported distribution formats.
  • Tests

    • Added automated checks to verify all catalog assets are included in both packaging formats.
    • Added coverage to detect missing or inconsistent catalog bundles.

…decar

Cowork was missing from the new-agent picker on the desktop app and on any
`pip install` — but present in Docker. The archetype itself was never broken:
`config/archetype-catalog.json` simply never reached either packaged build.

Both asset lists are hand-maintained and neither had it:
  • hatch_build.py::_SEEDS                        — the wheel (PyPI, and the
    desktop sidecar built from it)
  • apps/desktop/sidecar/build_sidecar.py::BUNDLED_DATA  — PyInstaller

Verified against the published 0.106.0 wheel: it ships
`config/soul-presets/cowork.md` (the persona) but no archetype-catalog.json — so
the SOUL was there and the entry that makes it selectable wasn't.

What made it invisible: `_load_archetype_catalog` falls back to Basic + Custom
when the file is absent and logs nothing. The picker renders fine and just
quietly offers less than the source tree does. Docker was unaffected because its
image copies the repo wholesale, so it reproduced only on desktop/PyPI — which
reads as a platform quirk rather than a packaging bug.

This is the THIRD time this exact shape has shipped. The comments in
build_sidecar.py record the other two: plugin-catalog.json ("0 official
plugins") and mcp-catalog.json ("no servers match"), each fixed reactively with
a comment and no guard. The pattern is structural — catalogs are data, adding
one means editing the repo (Docker keeps working) while forgetting two lists
whose readers fail soft.

So tests/test_bundled_config_assets.py asserts over a GLOB, not a hardcoded
list: every config/*catalog*.json must appear in both asset lists, and the two
must agree with each other (drift ships a catalog to PyPI but not desktop, so
the bug reproduces on exactly one surface). A catalog added tomorrow is covered
without anyone remembering the test exists. Confirmed it fails on the
pre-fix tree (3 failures) and passes after.

Locally rebuilt wheel now contains ['basic', 'cowork', 'custom'].

NOTE: this is a packaging fix only. The three fleet agents that mount a named
volume over /opt/protoagent/config (jon, frank, vera) have a separate, unrelated
cause — Docker seeds a named volume from the image once, so their config froze
on Jul 4 — and need a deployment change, not this.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2f5540c4-0d3d-4a0d-9882-702704b46f38

📥 Commits

Reviewing files that changed from the base of the PR and between 0968a42 and 710579c.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !*.md
📒 Files selected for processing (3)
  • apps/desktop/sidecar/build_sidecar.py
  • hatch_build.py
  • tests/test_bundled_config_assets.py

Walkthrough

The archetype catalog is added to Hatch wheel packaging and the desktop sidecar bundle. New tests statically inspect both asset definitions and verify that all catalog files, including archetype-catalog.json, are packaged consistently.

Changes

Catalog packaging

Layer / File(s) Summary
Bundle catalog assets
hatch_build.py, apps/desktop/sidecar/build_sidecar.py
Adds config/archetype-catalog.json to the wheel seed map and sidecar bundled data list.
Validate catalog bundles
tests/test_bundled_config_assets.py
Discovers catalog files, extracts packaging entries with AST parsing, and verifies presence, parity, and the archetype catalog specifically.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately names the main packaging fix and the two build targets affected.
Description check ✅ Passed The description covers the change, rationale, and testing, even though it doesn't use the exact template headings or checklist format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bundle-archetype-catalog

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.

@protoreview protoreview 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.

QA panel review — PASS

code-review-structural · head 710579ceb64d · formal

[review-synthesizer completed: workflow code-review-structural:report]

The PR is low-risk as it primarily involves updating a seed list for the archetype catalog. The verifier refuted the only reported finding, noting that the structural analysis engine flagged a logic error that does not exist within the scope of this diff. No other findings were reported by the panel.

Gaps: No structural analysis findings survived verification; the change is limited to a data update in hatch_build.py.

[]

@mabry1985
mabry1985 merged commit 2306157 into main Jul 21, 2026
10 checks passed
@mabry1985
mabry1985 deleted the fix/bundle-archetype-catalog branch July 21, 2026 21:22
mabry1985 added a commit that referenced this pull request Jul 22, 2026
…rtifacts, fleet inputs/secrets (#2130)

Bump 0.106.0 → 0.107.0 and roll the changelog for the release. Highlights:
- Versioned file artifacts + save_file_artifact (ADR 0092 D2, #2126)
- Document-generation stack baked into the desktop bundle (ADR 0092 D1, #2123)
- Fleet agents accept operator inputs + secrets at create time (#2121/#2122/#2125/#2127)
- Deterministic persona-drift detection (#2116)
- Chat tab context menu Close Others/Left/Right (#2112)
- Fixes: archetype-catalog bundling (#2115), PyPI publishes on tag push (#2113)

Backfilled [Unreleased] entries for the feature PRs that lacked them, rolled to
[0.107.0], scaffolded + polished the marketing changelog. uv.lock: project version
line only (surgical — avoids uv 0.11.13-vs-pinned-0.11.29 marker drift).


Claude-Session: https://claude.ai/code/session_01EVmWoy2TdXdMshNn5WBR2Z

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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