Skip to content

docs: document mock API module boundaries and consumer contract (Clos… - #394

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
soma-enyi:feat/390-mock-api-boundary-docs
Aug 19, 2026
Merged

docs: document mock API module boundaries and consumer contract (Clos…#394
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
soma-enyi:feat/390-mock-api-boundary-docs

Conversation

@soma-enyi

Copy link
Copy Markdown
Contributor

Document mock API module boundaries and consumer contract

Summary

Add comprehensive documentation (docs/mock-api-boundaries.md) for the in-memory mock API module architecture, explicitly defining module responsibilities, public boundaries, and consumer contracts.

Changes

  • Created docs/mock-api-boundaries.md with:
    • Module structure and responsibilities (lib/api/index.ts, mock-boundary.ts, mock.ts, mock-storage.ts, types.ts, live.ts)
    • Clear distinction between fixtures (static data) and behavior (simulation logic)
    • Public application entry point contract: all consumers import from @/lib/api only
    • Stable boundary definition: developer controls exposed via mock-boundary.ts and re-exported from index.ts
    • Complete developer control reference (resetMockData, applyMockScenario, replayMockEvent, setMockRoleMutationFailure, setMockMetaVersion)
    • Fixture maintenance rules and behavior implementation guidelines
    • Safe vs. risky changes guidance for refactoring
    • Example data flow tracing and migration guidance

Acceptance Criteria ✅

  • Public mock API boundary identification
  • Clear distinction between fixture and behavior responsibilities
  • Documentation of relationship between lib/api/index.ts and internal mock modules
  • Documentation reflecting actual implementation (grounded, not speculative)

Testing

No code changes; documentation-only PR. Verify that docs/mock-api-boundaries.md:

  • Correctly describes module layout
  • Accurately reflects current exports from lib/api/index.ts and mock-boundary.ts
  • Matches implementation in lib/api/mock.ts

Closes #390

Adamantine-guild#390)

Add docs/mock-api-boundaries.md describing:
- Module structure and responsibilities (index.ts, mock-boundary.ts, mock.ts, mock-storage.ts, types.ts)
- Clear distinction between fixtures (static data) and behavior (simulation logic)
- Public application entry point (lib/api/index.ts) and stable boundary (mock-boundary.ts)
- Developer control functions (resetMockData, applyMockScenario, replayMockEvent, etc.)
- Fixture maintenance and behavior implementation rules
- Data flow tracing and migration guidance for refactoring

This explicitly clarifies that components import only from @/lib/api and never from internal modules, preventing unintended coupling to implementation details.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012fDJWYcNXhWgWNb4xrjvkz
@Lakes41
Lakes41 merged commit 0a7ebc4 into Adamantine-guild:main Aug 19, 2026
1 check passed
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.

Document the mock API module boundaries and consumer contract

2 participants