feat: supabase stack seeds a requires on the substrate at create

A stack's substrate dependency now becomes a real encoded `requires` at
`castle program create` time (STACK_REQUIRES), so the relationship graph shows it.
This keeps `stack` uncoupled from the runtime model — the stack declares the edge
once at creation; the graph only ever reads the encoded `requires`, never the stack.
This commit is contained in:
2026-07-05 15:24:18 -07:00
parent b9d38be707
commit d14b9eafa7
3 changed files with 19 additions and 1 deletions

View File

@@ -107,6 +107,9 @@ class TestCreateCommand:
comp = config.programs["guestbook"]
assert comp.stack == "supabase"
assert comp.build is not None and comp.build.outputs == ["public"]
# The supabase stack seeds a `requires` on the substrate so the graph shows
# the dependency (stack stays uncoupled — it just declares the edge once).
assert [(r.kind, r.ref) for r in comp.requires] == [("deployment", "supabase")]
dep = config.deployments["guestbook"]
assert dep.manager == "caddy"
assert dep.root == "public"