packageJson(...).stringify(...) crashes in resolveDeps when a dependency map contains an undefined value. The crash is an unstructured TypeError, so the generated failure does not identify the malformed dependency entry.
Reproduction
https://github.com/schickling-repros/2026-06-genie-undefined-dependency-version
The repro uses a synthetic package and imports the public Genie source at commit b0d1daea4e21468f9813f39a234732456d8e2764.
Expected
Genie should report a structured validation/generation error that identifies the dependency key whose version is not a string.
Actual
TypeError: undefined is not an object (evaluating 'version.startsWith')
at resolveDeps (.../packages/@overeng/genie/src/runtime/package-json/mod.ts:414:9)
at buildPackageJson (.../packages/@overeng/genie/src/runtime/package-json/mod.ts:521:21)
at stringify (.../packages/@overeng/genie/src/runtime/package-json/mod.ts:722:11)
Minimal trigger
packageJson({
name: 'synthetic-package',
version: '1.0.0',
dependencies: {
valid: '1.0.0',
malformed: undefined,
} as unknown as Record<string, string>,
}).stringify({ location: '.', cwd: process.cwd() })
Versions
overengineeringstudio/effect-utils: b0d1daea4e21468f9813f39a234732456d8e2764
- Bun:
1.3.13
- OS: Linux x64
Posted on behalf of @schickling
| field |
value |
agent_name |
🦤 co1-ibis |
agent_session_id |
76ea16d2-32cf-409e-ba81-7933fe38952b |
agent_tool |
Codex CLI |
agent_tool_version |
0.131.0 |
agent_runtime |
Codex CLI 0.131.0 |
agent_model |
unknown |
worktree |
2026-06-genie-undefined-dependency-version/main |
machine |
dev3 |
tooling_profile |
dotfiles@e5e8d75 |
packageJson(...).stringify(...)crashes inresolveDepswhen a dependency map contains an undefined value. The crash is an unstructuredTypeError, so the generated failure does not identify the malformed dependency entry.Reproduction
https://github.com/schickling-repros/2026-06-genie-undefined-dependency-version
The repro uses a synthetic package and imports the public Genie source at commit
b0d1daea4e21468f9813f39a234732456d8e2764.Expected
Genie should report a structured validation/generation error that identifies the dependency key whose version is not a string.
Actual
Minimal trigger
Versions
overengineeringstudio/effect-utils:b0d1daea4e21468f9813f39a234732456d8e27641.3.13Posted on behalf of @schickling
agent_nameagent_session_idagent_toolagent_tool_versionagent_runtimeagent_modelworktreemachinetooling_profile