Skip to content

test(odetovibe): close extract domain test gaps#65

Open
scorpevans wants to merge 3 commits intomainfrom
test/20260304-2007-odetovibe-extract-gaps
Open

test(odetovibe): close extract domain test gaps#65
scorpevans wants to merge 3 commits intomainfrom
test/20260304-2007-odetovibe-extract-gaps

Conversation

@scorpevans
Copy link
Owner

Summary

  • parseYaml error handling: adds three new tests — ENOENT (non-existent file), malformed YAML (key: [unclosed), and empty file (yaml.load returns null/undefined); all expected to throw
  • imports field at parse level: verifies parseYaml correctly captures the imports map from YAML and defaults to {} when absent
  • externalTypeKeys validation compatibility: proves that commands whose baseType/objectType/returnType/subjectUnion reference external types pass *-ref validation — external types land in subjectTypes/plainTypes at parse time so findDomainType() finds them
  • Multiple simultaneous errors on one entry: confirms CommandValidator accumulates all rule violations without short-circuiting (both baseType-ref and objectType-ref reported for one command)
  • validateYaml orchestration: exercises the abstractTemplates (line 190) and strategies (line 196) loops — the two previously uncovered loops in validateYaml

Test plan

  • All 157 odetovibe tests pass (pnpm --filter odetovibe test)
  • 8 new test cases added, each targeting a documented gap from test-analysis.md
  • No changes to source files — tests only

🤖 Generated with Claude Code

…externalTypeKeys, multi-error, validateYaml orchestration)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scorpevans
Copy link
Owner Author

Reviewed. Checked: (1) multiple-error test correctly uses both unknown types against the same index — exactly 2 errors, no false extras from dispatch; (2) externalTypeKeys test constructs the index correctly to match how parseYaml populates both maps simultaneously; (3) validateYaml orchestration test count of 8 is correct (2 subjectTypes + 3 plainTypes + 1 command + 1 abstractTemplate + 1 strategy, no concreteTemplates); (4) all three parseYaml error paths (ENOENT, malformed, empty) are expected to throw for different reasons — all verified; (5) no source changes.

…test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scorpevans
Copy link
Owner Author

Follow-up commit: added [dispatch-coverage + dispatch-extra] both fire when dispatch has wrong subjects — subjectUnion=[Student, Professor], dispatch={Student, Ghost}: Professor missing fires dispatch-coverage, Ghost extra fires dispatch-extra. Both accumulate in the same result without short-circuit.

…ndValidator

Two command keys that normalize to the same file name (e.g. "AccessBuildingCommand"
and "AccessBuilding" both → "access-building.ts") would silently collide at emit
time. The new rule detects this at validate time, before any files are written.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scorpevans
Copy link
Owner Author

Follow-up commit: added commandName-file-unique validation rule to CommandValidator in validate-entry.ts. Two command keys that normalize to the same file name (e.g. AccessBuildingCommand and AccessBuilding both → access-building.ts) would silently collide at emit time; the new rule catches this at validate time. Includes two new tests: one asserting both colliding commands are flagged, one asserting non-colliding commands pass. The normalization logic (normalizeCommandKey) mirrors the transform domain's commandFilePath function.

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.

1 participant