anomalyco / anomalyco/opencode
LayerNode graph should fail with a named error when a dependency is undefined
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When a layer node's deps array (or a LayerNode.group item) contains undefined, the layer graph walker crashes with:
TypeError: undefined is not an object (evaluating 'node.name')
The stack points into Effect internals rather than the broken node, which makes this hard to diagnose. I hit it in a compiled build where a module export was undefined because of a runtime import cycle; finding the offending node required temporarily patching the walker.
Request
Validate dependencies in LayerNode.make and LayerNode.group and fail with an error that names the owner node and the dependency index, for example:
LayerNode @opencode/v2/FileSystem: invalid dependency at index 2 (undefined)
This is a diagnosability guard; the existing behavior for valid graphs is unchanged.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the TypeScript sources for LayerNode.make, LayerNode.group, and the layer graph walker. Trace how dependency entries are read, then add validation that reports the owner node and dependency index for undefined entries while preserving valid-graph behavior. Verify the resulting error includes the requested diagnostic details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100