Files
2025-09-06 23:20:03 +10:00

1.1 KiB

Implementation Tasks

1. Test Isolation

  • 1.1 Create temp fixture roots per suite (openspec/changes, openspec/specs)
  • 1.2 Use process.chdir to temp root within tests
  • 1.3 Restore original cwd and clean temp dirs after each

2. Deterministic Discovery

  • 2.1 Implement getActiveChangeIds(root?) to only include dirs with proposal.md
  • 2.2 Implement getSpecIds(root?) to only include dirs with spec.md
  • 2.3 Return sorted results to avoid fs.readdir ordering variance

3. Command Integration

  • 3.1 Ensure change/show/validate rely on cwd and discovery helpers
  • 3.2 Keep runtime behavior unchanged for end users

4. Validation

  • 4.1 Convert affected command tests (show, spec, validate, change) to isolated fixtures
  • 4.2 Verify tests pass consistently across environments
  • 4.3 Confirm no reads from real repo state during tests

5. Optional (Not Needed Now)

  • 5.1 Add optional root param to discovery helpers (default process.cwd())
  • 5.2 Consider threading root through command constructors if ever required