SC-2 Render-to-disk pipeline (agent-env-sync renderForInstance) #624
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#624
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
User story
As a platform engineer, I want the per-agent env directory to mirror the agent-config resolver's output, so that DB writes propagate to claude-code (which reads
settings.json/.claude.jsonfrom disk) on boot, on every config change, and just-in-time before each dispatch.Acceptance criteria
Renderer
apps/server/src/infrastructure/agent-env-sync/render-for-instance.tsexportsrenderForInstance(agent: ResolvedAgent): Promise<void>.${SECRET:NAME}placeholders by reading from thesecrettable (decrypts; logs each read intosecret_access_logwith the supplied accessor + reason).settings.json::enabledPluginsfromresolvePlugins(agent).settings.json::extraKnownMarketplacesfromresolveMarketplaces(agent)..claude.json::mcpServersfromresolveMcpServers(agent)with secrets baked in.<env-dir>/system-prompt.mdfromresolveSystemPrompt(agent).Triggers
agentstable,renderForInstanceeach.skill,system_prompt,plugin_binding,plugin_marketplace,mcp_server,agent_type_config): enqueue the affected instances. Agent-type writes affect every instance of the type; global writes affect every instance.Errors
MissingSecretError(name). Pre-dispatch path surfaces as a cleartask_failedSSE event with the secret name. Boot path logs and skips (do not crash the service — let the operator fix the secret in the dashboard).Tests
${SECRET:FOO}→ ciphertext-decrypted value; logs the access.plugin_bindingrow triggers exactly one re-render for the affected instance.Out of scope
agents.jsonconsumers — handled in SC-3 / SC-4 / SC-5.References
specs/agent-config-customization.md§Render-to-disk and §Story SC-2apps/server/src/infrastructure/agent-env-sync/— existing materialiser (today copies plugins from agents.json into settings.json)apps/server/src/infrastructure/container/container-reconcile.ts— drift detector that also reads the rendered files