feat(cli): load official catalog registry per command - #282
Conversation
🦋 Changeset detectedLatest commit: a6dc65b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Caution
The configured production registry currently returns HTTP 404, so catalog-dependent commands fail on a fresh installation. Publish and verify the registry asset before shipping this CLI cutover.
Reviewed changes The command-scoped catalog loading, CLI composition, cache persistence, config metadata, and controlled test harness were reviewed against the stacked publication and loader implementations.
- Command lifecycle: Loads the official HTTP catalog after parsing and shares it across command services while keeping help and version offline.
- Cache and configuration: Adds a user-level atomic catalog cache, stderr warnings, distinct configuration errors, and
$schemafor newly created configs. - Verification: Uses injected HTTP fixtures in unit and E2E paths; scoped CLI tests pass, but a real
graph --format mermaidinvocation fails against the current endpoint.
GPT Sol | 𝕏
| import { Console, Context, DateTime, Effect, Layer } from "effect"; | ||
|
|
||
| export const OFFICIAL_CATALOG_URL = | ||
| "https://stack-effect.lloydrichards.dev/registry/v1/catalog.json"; |
There was a problem hiding this comment.
This endpoint currently returns HTTP 404, and bun run --cwd apps/cli start -- graph --format mermaid exits with Catalog server returned HTTP 404; a fresh user has no cache, so init, create, add, plan, graph, and schema cannot run. Please publish and verify the production asset before releasing the CLI cutover; the controlled test fixture does not exercise this dependency.
Technical details
# Production catalog unavailable
## Affected sites
- `apps/cli/src/service/CatalogProvider.ts:6` — points all production catalog loads to the currently missing asset.
- `apps/cli/src/command.ts:40-65` — requires a successful load for the catalog-dependent commands.
- `apps/docs/scripts/catalog-registry-assets.ts:5,25` — defines the asset expected to be published by the docs deployment.
## Required outcome
- Deploy the docs registry asset and confirm an unauthenticated GET of `https://stack-effect.lloydrichards.dev/registry/v1/catalog.json` returns a valid catalog with HTTP 200 before this CLI version can ship. A new installation has no stale cache to fall back to, and HTTP 404 is not a transient fallback condition in `CatalogLoader`.50731d9 to
6fd142c
Compare
6fd142c to
4a58800
Compare
4a58800 to
621ae8b
Compare
621ae8b to
a6dc65b
Compare

Goals/Scope
Move catalog-dependent CLI commands to the official HTTP source for #273. Review the load-before-write boundary and user-cache behavior.
Description
Each command loads one validated catalog after parsing and keeps it through generation. The user cache replaces complete entries atomically; stale warnings go to stderr so JSON stdout stays parseable. Help and version remain offline. New configs include the hosted
$schemaURL without a catalog payload or pin, formatted consistently with Recipe Builder output.For example,
stack-effect add --target package/db:package-db-sqlitechecks current definitions before planning. Thestack-effectminor changeset records this user-facing change.Comments
Tracks #273. Pullfrog correctly found that fresh users cannot run catalog commands while the production URL returns 404. Publish and verify #272 before this CLI version ships or #273 closes.