Skip to content

feat(emulators,qa): add stateful Anthropic /v1/messages emulator and 33 account/calendar/inbox story tests - #2400

Open
NubsCarson wants to merge 1 commit into
developfrom
feat/anthropic-emulator-and-qa-stories
Open

NubsCarson wants to merge 1 commit into
developfrom
feat/anthropic-emulator-and-qa-stories

Conversation

@NubsCarson

Copy link
Copy Markdown
Collaborator

Summary

Builds on the service emulation and story QA framework in #2382 (and cleanly stacks on merged #2396) with two self-contained improvements:

  1. Stateful Anthropic /v1/messages loopback emulator (@repo/eliza-harness):

    • Adds packages/eliza-harness/src/providers/anthropic-provider.ts built on vibestack/emulate (createEmulatorServer), replacing the canned-fixture entry for anthropic in emulators/manifest.json with a dedicated vibestack-custom emulator (contractHash updated, 4 verified services untouched).
    • Implements GET /v1/models, GET /v1/models/:id, POST /v1/messages/count_tokens, and POST /v1/messages (non-streaming JSON and wire-faithful Anthropic SSE streams: message_start, ping, content_block_start, content_block_delta for text_delta and input_json_delta, content_block_stop, message_delta, message_stop), multi-turn tool_use/tool_result, strict x-api-key + anthropic-version + max_tokens + 405 validation, Anthropic error envelopes (429 rate_limit_error + retry-after, 529 overloaded_error, 401 authentication_error, 500 api_error), x-vibestack-namespace isolation, FaultArmory (/__control/fault), and /__control/{script,messages,reset,requests,state}.
    • Re-exports startAnthropicProvider, DEFAULT_ANTHROPIC_MODELS, DEFAULT_ANTHROPIC_VERSION, and types from packages/eliza-harness/src/index.ts.
    • Adds offline integration tests in packages/eliza-harness/test/anthropic-provider.test.ts (including assertNoSecrets).
  2. Deterministic story-cited QA tests closing all 33 uncovered account, calendar, and inbox stories:

    • apps/app/test/account-stories.test.ts (16 stories across change, google, index, outside, plan, provider, records, session, signIn).
    • apps/app/test/calendar-stories.test.ts (7 stories across agent, editor, index, reminderReopen, sharing, writing).
    • apps/app/test/inbox-stories.test.ts (10 stories across access, drafts, index, letter, sending, shelf).
    • Raises overall pnpm cli qa status story coverage from 494/634 (77.9%) to 527/634 (83.1%) with 126/126 (100%, 0 uncovered) across spec/app/{account,calendar,inbox}/* and 0 dangling citations. Zero edits to spec/, gen/, or spec/lock.json.

Verification

  • pnpm exec node vibestack/spec.ts tasks @repo/eliza-harness#build @repo/eliza-harness#typecheck @repo/app#typecheck @repo/cloud#build: PASS
  • pnpm --filter @repo/eliza-harness test: PASS (4/4 files, 26/26 tests, including test/anthropic-provider.test.ts 3/3)
  • pnpm --filter @repo/app exec vitest run --project node test/account-stories.test.ts test/calendar-stories.test.ts test/inbox-stories.test.ts: PASS (3/3 files, 33/33 tests)
  • pnpm cli emulate audit --json: PASS (ok: true, 946 files scanned, 0 uncovered, 0 stale)
  • pnpm cli emulate status --json: PASS (ok: true, 4 verified, 9 unverified, 0 stale)
  • pnpm cli qa status --summary --json: PASS (527/634 covered = 83.1%, 126/126 in account/calendar/inbox, 0 dangling citations)
  • NODE_OPTIONS=--max-old-space-size=4096 pnpm exec eslint --max-warnings 0 on all 6 touched/added .ts files: PASS (0 errors, 0 warnings)
  • pnpm exec jscpd --silent --threshold 0 on touched files and whole repo (1475 files): PASS (0 clones, 0.00%)
  • pnpm exec knip: PASS
  • pnpm exec madge --circular vibestack packages apps: PASS (2477 files, 0 circular dependencies)
  • pnpm run no-bun: PASS

Copilot AI balanced review requested due to automatic review settings December 4, 2026 20:31
@NubsCarson
NubsCarson requested a deployment to turbo-cache-read December 4, 2026 20:31 — with GitHub Actions In progress

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch was previously deployed

1 inactive deployment
turbo-cache-read — bbf45fc0 Deployed Dec 4, 2026 by NubsCarson via selftest-rest #1628
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.

2 participants