fix(nix): validate leaf workspaces in flake sync check#2155
Open
Sebastianhayashi wants to merge 1 commit into
Open
fix(nix): validate leaf workspaces in flake sync check#2155Sebastianhayashi wants to merge 1 commit into
Sebastianhayashi wants to merge 1 commit into
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
No linked issue — this is a focused CI/build validation bug already documented in
AGENTS.md.Problem
pnpm-workspace.yamlis the source of truth for workspace membership, whileflake.nixmaintains matching hardcodedworkspacePathsandworkspaceNameslists.scripts/check-nix-workspace.mjscurrently validates only the transitive workspace dependency closure of@moonshot-ai/kimi-code. A leaf workspace that is not referenced by the CLI can therefore be omitted fromflake.nixwhile the workspace-sync check still exits successfully.That false green can leave workspace files out of the Nix source set or leave
pnpmConfigHookwithout the workspace dependency metadata it needs.What changed
pnpm-workspace.yaml, rather than only the CLI dependency closure.flake.nix.The existing workspace discovery,
flake.nixparsing, error format, and success/failure exit codes remain unchanged.This intentionally checks for pnpm workspaces missing from
flake.nix; it does not reject stale extra entries that exist only inflake.nix.Verification
pnpm -C apps/kimi-code exec vitest run test/scripts/check-nix-workspace.test.ts(fails on the old implementation withresult.status0 instead of 1; passes after the fix)node scripts/check-nix-workspace.mjs(✅ All 23 workspace packages are present in flake.nix.)pnpm lint(0 errors)pnpm typecheckpnpm test— 2 pre-existing failures inpackages/kosong/test/e2e/google-genai-adapter.test.tsandgoogle-genai-error-mapping.test.ts; both reproduce identically on a cleanupstream/maincheckout and are unrelated to this diff. All other tests pass (15247 passed).git diff --checkChecklist
gen-changesets, or this PR needs no changeset.gen-docs, or this PR needs no user-facing documentation update.