Skip to content

[transitive deps] apply transitive dep to root node - #21

Merged
neilverc merged 1 commit into
mainfrom
multihop/apply-transitive-dependency-to-root-node
Aug 27, 2026
Merged

[transitive deps] apply transitive dep to root node#21
neilverc merged 1 commit into
mainfrom
multihop/apply-transitive-dependency-to-root-node

Conversation

@neilverc

Copy link
Copy Markdown
Collaborator

Transitive dependencies need to be applied to the root node, ie the initiating resource, not the intermediate resource

@vercel-eddie vercel-eddie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamp

neilverc added a commit that referenced this pull request Aug 27, 2026
…e immediate parent

Per #21: a target's dependent hook must run with ctx.consumer set to
the render root, never the intermediate resource that actually
declared the edge. The FS a dependent hook can mutate is always the
render root's bundle, so keeping ctx.consumer as the root keeps the
two consistent, and it means a target kind's `dependents` list is
keyed by the render-root kinds that can reach it rather than needing
an entry for every pass-through kind in between — dynamo-table's
existing `[service, subscriber]` entries already cover a service
reaching it through any number of intermediate packages.

Updates SPEC.md and the render.go doc comments accordingly, and fixes
the three dependency tests that assumed ctx.consumer was the immediate
parent:
- multi-hop test: dynamo-table now accepts "service" (the root), not
  "package".
- cycle test: alpha's dependents entry now accepts its own kind (the
  root), not "beta".
- diamond test: since ctx.consumer is now identical (the root) for
  both edges into the shared leaf, the two firings are distinguished
  by their own params instead of consumer identity.
@neilverc
neilverc force-pushed the multihop/apply-transitive-dependency-to-root-node branch from 5710dd5 to f16772b Compare August 27, 2026 17:38
…e immediate parent

Per #21: a target's dependent hook must run with ctx.consumer set to
the render root, never the intermediate resource that actually
declared the edge. The FS a dependent hook can mutate is always the
render root's bundle, so keeping ctx.consumer as the root keeps the
two consistent, and it means a target kind's `dependents` list is
keyed by the render-root kinds that can reach it rather than needing
an entry for every pass-through kind in between — dynamo-table's
existing `[service, subscriber]` entries already cover a service
reaching it through any number of intermediate packages.

Updates SPEC.md and the render.go doc comments accordingly, and fixes
the three dependency tests that assumed ctx.consumer was the immediate
parent:
- multi-hop test: dynamo-table now accepts "service" (the root), not
  "package".
- cycle test: alpha's dependents entry now accepts its own kind (the
  root), not "beta".
- diamond test: since ctx.consumer is now identical (the root) for
  both edges into the shared leaf, the two firings are distinguished
  by their own params instead of consumer identity.
@neilverc
neilverc force-pushed the multihop/apply-transitive-dependency-to-root-node branch from f16772b to 3adddf5 Compare August 27, 2026 17:39
@neilverc
neilverc merged commit 599dc67 into main Aug 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants