fix(concierge): declare molecule-platform-mcp via gitea:// source so the box actually fetches it #3049
Reference in New Issue
Block a user
Delete Branch "fix/concierge-mcp-gitea-source"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #3044. Root-caused why
create_workspacewasn't landing on a fresh provision.Bug
#3044 declared the management MCP with a bare name (
molecule-platform-mcp). The box's boot-install (runtime-image entrypoint) only fetchesgitea://sources and silently skips everything else (*) skip unsupported source). A bare name parses to thelocalscheme (image-baked plugins only). Sincemolecule-ai-plugin-molecule-platform-mcpis a brand-new Gitea-only repo, the bare-name source was skipped → plugin never fetched → nomolecule-platformMCP → nocreate_workspace.Fix
Declare it with a pinned
gitea://source so the box fetches the repo:conciergePlatformMCPSource = "gitea://molecule-ai/molecule-ai-plugin-molecule-platform-mcp#main"(passed toseedTemplatePlugins). The#mainpin is required: the gitea resolver rejects unpinned specs in production (PLUGIN_ALLOW_UNPINNEDunset), so an unpinned source would record the declaration but fail to fetch → hollow.conciergePlatformMCPName = "molecule-ai-plugin-molecule-platform-mcp"— the install namePluginNameFromSourcederives (repo segment; the#refdoes not affect it). TherecordDeclaredPluginentitlement gate matches on this derived name, so it keeps fail-closing for non-platform workspaces.Tests updated: entitlement-gate test uses the derived name + gitea source. gofmt-clean.
SOP checklist
go build ./...clean; targeted unit tests green (TestRecordDeclaredPlugin_PrivilegedPluginEntitlement, concierge-provision);PluginNameFromSource("…#main")derivation verified empirically ==conciergePlatformMCPName; two independent reviews (QA + security).Handlers Postgres Integration (pull_request)green on head; this is a pure handler/const change (no schema/migration).docker pullcompletes (0× 403), container Up,Registered with platform: 200. Thecreate_workspacestaging-smoke is scheduled post-merge (requires #3049 deployed to staging), then prod verify.#main).conciergePlatformMCPPluginconst was removed cleanly (no dangling refs); the source/name split is the real fix.feedback_no_such_thing_as_flakes(named the ECR-403 mechanism instead of dismissing the e2e as flaky),feedback_follow_dev_sop_phase1_evidence_first(SSM ground-truth on a live box),reference_local_reviewer_gitea_identities.Verify after merge
Re-provision a fresh tenant → boot-install fetches
gitea://…/molecule-ai-plugin-molecule-platform-mcp#main→MCPServerAdaptorwiresmolecule-platform→ introspectcreate_workspacepresent. (Task #52.)🤖 Generated with Claude Code
QA / correctness review — APPROVE
Independent review of the gitea:// plugin-source fix.
PluginNameFromSource("gitea://molecule-ai/molecule-ai-plugin-molecule-platform-mcp#main")derivesmolecule-ai-plugin-molecule-platform-mcp==conciergePlatformMCPName(verified empirically, ref does not affect derivation).seedTemplatePluginsderivespluginNameviaPluginNameFromSource, passes torecordDeclaredPlugin, which keys the entitlement gate on the same derived name.conciergePlatformMCPPluginconst.gofmtclean (fixed trailing-blank-line on the 3 files);go build ./...clean; targeted tests green.Security review — APPROVE
Privileged management-MCP (create/delete workspaces). Adversarial pass on the name-keyed entitlement gate.
recordDeclaredPlugincomparespluginName == conciergePlatformMCPNameand INSERTs that samepluginNameintoworkspace_declared_plugins.plugin_name— no name/source split to exploit.seedTemplatePlugins,org_import) derive the name from the source viaPluginNameFromSource; derivation is deterministic and == the gitea Fetch install key, so privileged code cannot install under a name the gate does not see. No realistic aliasing bypass (whole-repo install is forced to name==repo==gated name).molecule-ai/...org, PAT viaMOLECULE_TEMPLATE_REPO_TOKEN), not a public/typosquattable source.014af619(pinned#main). Re-confirmed derived name unchanged.Acking SOP-checklist items after independent review (security pass + QA pass). Boot verified on a fresh staging concierge; create_workspace staging-smoke scheduled post-merge.
/sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack root-cause
/sop-ack five-axis-review
/sop-ack no-backwards-compat
/sop-ack memory-consulted
APPROVED. Five-axis review complete on current head
014af619.Correctness: the concierge now records a fetchable, pinned gitea:// source instead of the unsupported bare name. plugins.PluginNameFromSource derives molecule-ai-plugin-molecule-platform-mcp from that source, matching conciergePlatformMCPName and the workspace_declared_plugins/plugin entitlement path. The #main ref does not affect name derivation and is required for production fetches because unpinned Gitea sources are rejected unless PLUGIN_ALLOW_UNPINNED=true.
Security/robustness: recordDeclaredPlugin continues to fail-close on the derived privileged name for non-platform workspaces, while the kind=platform concierge path may declare it. No broadening of entitlement or user-controlled declaration path found. Performance/readability: constant split is clear and no runtime hot-path cost. Visible statuses are not fully green: template-delivery-e2e and some gate/SOP contexts are failing/pending, apparently outside this code delta and expected to be unblocked by #3055 per dispatch. No code blockers found.