Repository navigation
test(core): add unit tests for the Grok playbook loader (fixes #448) - #460
Conversation
|
Reviewed head The 83-line test-only diff covers #448's provider gating, missing/blank/directory inputs, whitespace trimming, and exact/over-cap boundaries. I compared the assertions with Verification: all five reported checks passed. I inspected build-check-test job 133225735185, including the new file's 9 passing tests and the successful check job. This is implementation/diff and CI-log review, not an independent local rerun; I did not reproduce the reported mutation test or local environment/type errors. No other submitted review or unresolved review thread was present. Automated merge remains withheld because branch-protection detail reads return 403 to this integration, so required merge policy cannot be fully verified. No rerun or merge was initiated. |
Fixes #448.
Test-only PR, no source changes. Adds
packages/coding-agent/test/grok-playbook.test.ts(9 vitest cases) for the Grok playbook loader incore/grok-playbook.ts:grokPlaybookAppendForProviderreturns undefined foranthropicandundefinedeven whengrok.mdexists, and the file text forxailoadGrokPlaybookAppendreturns undefined when the file is missing, whitespace-only, or a directory (read error swallowed)" hello \n"to"hello"GROK_PLAYBOOK_MAX_APPEND_CHARS(24,000) is returned unchanged[... grok.md truncated for system prompt; full file: <path>]suffixTests write only inside a temp dir and restore
ENV_AGENT_DIR(OMK_CODING_AGENT_DIR) inafterEach.Verification: all 9 tests pass locally; bite-check (changing the truncation guard from
>to>=) fails exactly 1 test. Biome check clean on the new file;tsgo --noEmitshows only 2 pre-existing errors in untouched files. Localnpm run checkstops atcheck:dep-tree, a pre-existing environment artifact; CI is the real gate.