Skip to content

fix(packaging): ship the marketplace catalog inside the frozen backend - #107

Closed
mlubbad wants to merge 19 commits into
mainfrom
claude/eloquent-joliot-bacaf8
Closed

mlubbad wants to merge 19 commits into
mainfrom
claude/eloquent-joliot-bacaf8

Conversation

@mlubbad

@mlubbad mlubbad commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Resolves the 2026-07-25 review's release blocker: packaged desktop builds had no delivery path for the bundled plugin catalog — the sidecar's per-user data root starts empty, so the marketplace UI was empty in a packaged install.

  • Ship the catalog inside the frozen backend: backend/ocd-backend.spec bundles content/marketplace/ as PyInstaller datas at content/marketplace (and strips stray __pycache__ from datas so a dev-machine build never ships stale bytecode). Chosen over Tauri resources: the backend is the catalog's only consumer, so the asset travels inside its consumer — no resource_dir() plumbing in the shell, no new env var a launcher could forget, and a standalone run of the frozen sidecar (supported by sidecar.py) keeps its catalog too.
  • Frozen resolution: config._default_marketplace_dir() resolves MARKETPLACE_DIR under sys._MEIPASS when sys.frozen is set. The MARKETPLACE_DIR env override still wins; source/dev checkouts keep the repo-root default. Nothing is copied into live installed state — the immutable-catalog / mutable-PLUGINS_DIR boundary enforced by marketplace.py is unchanged.
  • Tests (backend/tests/test_marketplace_packaging.py, 5): spec-datas contract pin, frozen resolution lands in the bundle (never the data root), dev-resolution + env-override pins, and the installed-package smoke test — empty app-data dir → catalog visible with every entry installed=False → install one → run it → uninstall → catalog intact and the bundle byte-identical.
  • Review doc updated to record the blocker as resolved.

Test plan

  • test_marketplace_packaging.py written first (TDD) — new-behavior tests watched failing before the fix
  • All marketplace suites green under Python 3.12.10 (CI interpreter): test_marketplace.py, test_marketplace_plugins.py, test_marketplace_plugin_behavior.py, test_plugins_cache.py, test_marketplace_packaging.py — including the order where prior tests leave content/marketplace/__pycache__ on disk
  • Full backend suite green locally except pre-existing Windows-local failures (CRLF in two test_workspace tests, test_providers_route::test_set_and_delete_key, intermittent test_mcp_transports hang) — all reproduce identically on clean main, green on Linux CI
  • ruff check . clean; spec compile-checked and datas source path verified

🤖 Generated with Claude Code

mlubbad and others added 19 commits July 20, 2026 01:09
…arketplace plugins

Four small text/utility marketplace plugins following the existing plugins/
NAME/DESCRIPTION/CATEGORY/TOOL convention (alongside calculator, json_tool, …).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reverts b2987e5 (feat(plugins): add base64, color-convert, roman-numeral,
word-count marketplace plugins). The four files were byte-identical copies
of content/marketplace/ catalog entries committed into plugins/, the live
installed-plugins directory — silently preinstalling opt-in marketplace
entries in a source checkout, letting the marketplace UI "uninstall"
source-controlled files, and creating drift risk against the canonical
catalog (review F-01).

content/marketplace/ remains the single canonical source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…talog

A clean runtime (empty PLUGINS_DIR) must report every real bundled catalog
entry installed=False, and none of the four catalog names may appear in
integrations.list_plugins() before installation (review F-01 regression
guard).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ader

Each bundled catalog file must load through integrations._load_plugin_module
and expose the NAME / TOOL / run plugin contract, so behavior tests that load
the same files with a plain importlib clone stay faithful to the runtime.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… (F-02)

An unrecognized, empty, or non-string `direction` silently fell through to
the encode branch, returning a plausible-looking encoded value for the
opposite operation (e.g. direction="decoding" re-encoded the input). Use
explicit encode/decode branches and return an error for anything else.
Missing direction still defaults to encode (the schema marks it required;
the default only guards schema-less callers). Strict rejection of
line-wrapped base64 is retained deliberately and now pinned by test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Lines were counted by "\n" alone (missing bare-CR line breaks and counting a
trailing newline as an extra line), and the "no whitespace" figure removed
only ASCII space/newline/tab, so \r, NBSP and other Unicode whitespace were
counted as characters. Use splitlines() for universal line boundaries (a
trailing terminator adds no line) and str.isspace() for the no-whitespace
count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
HEX input returned CSS-style "rgb(30, 144, 255)", but parsing accepted only
a bare "30,144,255" triple — the tool rejected its own output and the most
recognizable RGB input form. Accept a case-insensitive, balanced rgb(...)
wrapper alongside the bare triple, still validating every component as
0-255, and say so in the tool schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 2026-07-25 review exhaustively verified roman_numeral (1-3999 round
trips, malformed forms rejected) and found no defect; pin that verified
behavior as regression coverage so the DoD item "roman numeral regression
coverage remains green" has an actual test behind it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cker

Summarizes the F-01..F-04 remediation (commits, new tests, deliberate
decisions) and records the packaged-release catalog delivery gap as an
explicit unresolved release blocker, per the 2026-07-25 handoff.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A packaged install's per-user data root starts empty, so the bundled catalog
never reached it: MARKETPLACE_DIR defaulted under REPO_ROOT, leaving the
marketplace UI empty in frozen builds (2026-07-25 review release blocker).

Ship content/marketplace as PyInstaller datas inside the ocd-backend sidecar
(chosen over Tauri resources: the backend is the catalog's only consumer, no
shell env plumbing to forget, works for a standalone frozen sidecar too) and
resolve MARKETPLACE_DIR under sys._MEIPASS when sys.frozen is set. The env
override still wins; dev checkouts keep the repo-root default; stray
__pycache__ is stripped from datas so a dev-machine build never ships stale
bytecode. The immutable-catalog/mutable-PLUGINS_DIR boundary is unchanged —
installs still only copy out of the bundle.

test_marketplace_packaging.py pins the spec's datas contract, both resolution
modes, the env override, and an installed-package smoke test (empty app-data
dir: catalog visible + uninstalled, install/run/uninstall, catalog intact,
bundle byte-identical).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mlubbad

mlubbad commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

Merged and shipped as part of the clean-slate VersoWork v0.1.0 open-source release.

@mlubbad mlubbad closed this Nov 21, 2026
@mlubbad
mlubbad deleted the claude/eloquent-joliot-bacaf8 branch November 21, 2026 20:26
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