Applied tester feedback to fix 5 test failures:
1. Updated error message format from "Node not found" to "CAS node not found"
for consistency with existing tests in variable-store.test.ts and var.test.ts
2. Fixed CLI tests R9 and R10 to use bootstrap() directly instead of
non-existent "types" command. Added imports for bootstrap and createFsStore.
3. Fixed render test 6.5 to pass actual schema Hash instead of entire
bootstrap object (Record<string, Hash>)
4. Updated test expectations in render.test.ts (tests 1.5, 10.1, 10.2) to
match new error message format
All 390 tests now pass. Core functionality verified:
- Missing root hash detection working correctly
- CLI exits with code 1 on missing hash
- Error message includes hash: "CAS node not found: <hash>"
- Nested nodes still render as cas: references (preserved behavior)
- Resolution decay behavior preserved
Fixes#53
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When rendering a non-existent hash, the CLI now exits with code 1 and
displays an error message instead of silently outputting "cas:<hash>"
with exit code 0.
Changes:
- Updated CasNodeNotFoundError constructor signature to store hash
- Added root hash existence check in render() and renderAsync()
- Updated CLI error handling to catch CasNodeNotFoundError
- Added comprehensive test suite for missing hash error handling
- Updated existing incorrect tests (R2 and test 1.5)
The fix distinguishes between:
- Root hash (user-requested): Must exist or throw error
- Nested hash (during traversal): Renders as cas: reference (existing behavior)
- Resolution below epsilon: Renders as cas: reference (existing behavior)
Fixes#53
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>