feat(marketplace): shre-hub catalog source behind flag + internal read API#186
Open
Nirpat3 wants to merge 1 commit into
Open
feat(marketplace): shre-hub catalog source behind flag + internal read API#186Nirpat3 wants to merge 1 commit into
Nirpat3 wants to merge 1 commit into
Conversation
…d API
Capability-hub mission Phase 2 (dev-kit docs/missions/capability-hub.md),
AROS leg. Flag OFF by default — no behavior or journey change until the
operator enables it; stated per the journey gate.
- SHRE_HUB_CATALOG_ENABLED routes GET /api/apps catalog through shre-hub
(:5537); grants stay local ALWAYS; any hub failure (or empty read-back)
falls back to the local platform_apps query — roll-back safe, no
dual-write window. Response gains additive `capabilities` (fleet registry
manifests) + `catalog_source`.
- GET /api/internal/catalog/{apps,entitlements}: system-of-record read
endpoints for the hub. Serve LOCAL data unconditionally (recursion-safe),
bearer-gated by HUB_INTERNAL_TOKEN (constant-time, fail-closed 503),
entitlements sanitized via publicServiceConfig.
- Pure logic in src/marketplace/hub-catalog.ts; 11 new vitest cases.
Gates: vitest src 310/310; tsc errors in touched files: 0 (repo baseline
unchanged at 66 pre-existing aros-ai errors).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capability-hub mission Phase 2 — AROS leg (contract: shre-dev-kit
docs/missions/capability-hub.md, founder GO 2026-07-22). Pairs with the shre-hub service PR in shreai.What
SHRE_HUB_CATALOG_ENABLED(default off) routes theGET /api/appscatalog through shre-hub (:5537). Grants stay local always; any hub failure — including an empty apps read-back — falls back to the localplatform_appsquery. Roll-back = unset the flag; entitlement writes never leave AROS, so there is no dual-write window (the contract's transition mandate).capabilities(fleet capability manifests from the dev-kit registry, for the Phase-4 UI) andcatalog_source(shre-hub|local) — existing web clients ignore both.GET /api/internal/catalog/{apps,entitlements}: read endpoints the hub proxies as system-of-record. They serve local data unconditionally (the marketplace→hub→AROS chain terminates by construction), bearer-gated byHUB_INTERNAL_TOKEN(constant-time compare, fail-closed 503 when unset), entitlements sanitized throughpublicServiceConfig(no service_config secret leak — consistent with fix(marketplace): harden entitlement API + install/profile UX (review findings) #182).src/marketplace/hub-catalog.ts(functional core) with 11 tests.Journey gate
Flag off by default ⇒ no journey is altered by this PR. The J7 marketplace journey re-walk against the hub-backed catalog happens at the operator beta-deploy step (mission Verification), before the flag is ever enabled anywhere.
Verification
src: 310/310 (11 new)aros-ai/errors, identical with the diff stashed)Operator preconditions before enabling (per contract)
vault-provision
shre-hub-token+shre-hub-aros-token; setHUB_INTERNAL_TOKEN(AROS) =SHRE_HUB_AROS_TOKEN(hub); deploy shre-hub; then J7 journey-walk on beta → 0 FAIL before flippingSHRE_HUB_CATALOG_ENABLED.🤖 Generated with Claude Code