Skip to content

test(grok): Grok Build compatibility golden fixtures#9345

Open
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:bbingz/test-grok-compat-fixtures
Open

test(grok): Grok Build compatibility golden fixtures#9345
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:bbingz/test-grok-compat-fixtures

Conversation

@bbingz

@bbingz bbingz commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a shared fixture pack under src/shared/fixtures/grok/ so Orca’s Grok integration can lock open-source / wire contracts without reinventing payloads:

  • Billing goldens: weekly percent, proto3 zero-omitted weekly, credits→monthly fallback pair
  • Stop hook camelCase envelope
  • chat_history.jsonl sample rows (user_query, bootstrap skip, tool_calls)
  • encode_cwd_dirname oracle vectors from xai-org/grok-build (ready for fix(grok): O(1) session path via encode_cwd_dirname parity #9267’s encoder)

Fixture-driven Vitest covers rate-limit mapping and native-chat decoding.

Testing

  • vitest src/shared/fixtures/grok/grok-fixtures.test.ts (6 passed)
  • full CI

Notes

Independent of #9265/#9267/#8391. Encode goldens are documented until the encoder lands on main.

Centralize billing, Stop-hook envelope, chat_history sample lines, and
encode_cwd_dirname oracle vectors under src/shared/fixtures/grok/ so Orca’s
Grok integration can lock contracts without inventing payloads per test.

Fixture-driven coverage for weekly credits (incl. proto3 zero omission),
monthly unified fallback, and native-chat transcript decoding.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5152e491-a016-45b3-b1e8-4d1683214fa9

📥 Commits

Reviewing files that changed from the base of the PR and between d8629c4 and 23ffd91.

📒 Files selected for processing (10)
  • src/shared/fixtures/grok/README.md
  • src/shared/fixtures/grok/billing-credits-no-weekly.json
  • src/shared/fixtures/grok/billing-monthly-unified.json
  • src/shared/fixtures/grok/billing-weekly-42.json
  • src/shared/fixtures/grok/billing-weekly-zero-omitted.json
  • src/shared/fixtures/grok/chat_history-sample.jsonl
  • src/shared/fixtures/grok/encode-cwd-goldens.json
  • src/shared/fixtures/grok/grok-fixtures.test.ts
  • src/shared/fixtures/grok/hook-stop-envelope.json
  • src/shared/fixtures/grok/load-grok-fixtures.ts

📝 Walkthrough

Walkthrough

Adds Grok golden fixtures for billing, chat history, stop hooks, and CWD encoding, along with ESM-compatible fixture loading helpers. Adds Vitest coverage using mocked network, filesystem, and home-directory inputs to validate rate-limit mapping, transcript decoding, hook envelope preservation, and encoding outputs. Documents the fixture files and their associated contract behaviors.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description omits required Screenshots, AI Review Report, and Security Audit sections from the template. Add those sections and summarize the AI review, cross-platform checks, security review, and note no visual change if applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the Grok compatibility fixture changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang AmethystLiang self-assigned this Jul 18, 2026
@AmethystLiang
AmethystLiang self-requested a review July 18, 2026 16:46
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