feat: validate alias config keys against known workspaces - #701
Merged
Conversation
Add the rule that an object-map alias key must match a known workspace path (root '.' or a sub-workspace relative path); an unmatched key is an error. Function-form aliases are exempt. Bumps spec to 4.1.0. Includes the brainstorming design doc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add validateAliasKeys in @nadle/kernel: an object-map alias key must match a known workspace path (root '.' or a sub-workspace relativePath); an unmatched key now errors instead of being silently ignored. Wired into configureProject, ahead of the existing post-resolution validateWorkspaceLabels (which already covers duplicate-label and label/id-collision cases). Alias validation runs in the zero-dependency kernel and throws a plain Error; options-resolver now translates it to a ConfigurationError so the message is surfaced (the top-level handler only prints NadleError) with the config exit code — this also fixes the previously-swallowed validateWorkspaceLabels messages. Tests: kernel unit tests for validateAliasKeys; integration tests for the three rejection cases. Fixes a latent dead-alias typo in workspaces-list fixtures that the new validation exposed (packages/minusOne -> minusOne). Closes #698 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for nadle ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
nam-hle
enabled auto-merge (squash)
June 20, 2026 06:32
create-nadle
eslint-plugin-nadle
@nadle/kernel
@nadle/language-server
nadle
@nadle/project-resolver
nadle-vscode-extension
commit: |
This was referenced Jun 21, 2026
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.

Closes #698.
What
An object-map alias key must now match a known workspace path — the root path (
.) or a sub-workspace's relative path. A key that matches no workspace was previously silently ignored; it now errors.The other two cases #698 listed (duplicate label, label/id collision) were already handled by the existing
validateWorkspaceLabels— but their messages were being swallowed because the top-level handler only printsNadleError. This PR surfaces all of them.How
@nadle/kernel— newvalidateAliasKeys(aliasOption, workspaces)besidevalidateWorkspaceLabels. No-op forundefined/function aliases (a function only ever receives known paths). Throws a plainError(kernel is zero-dep).@nadle/project-resolver—configureProjectcalls it before resolution, fail-fast on a typo'd key.nadle—options-resolvertranslates the kernelErrorinto aConfigurationErrorso the message is printed with the config exit code (2). This also un-swallows the existing label/id-collision messages.Tests
validateAliasKeys(undefined/function no-op, all-valid no-op, unknown key throws).workspaces-listfixtures (packages/minusOne— no such workspace; the intended target isminusOne). Fixed the key; theoneMinusalias now actually applies (1-line snapshot update).Spec
spec/07-workspace.mdgains the new alias rule; CHANGELOG + version bump to 4.1.0 (committed separately on this branch). Design doc indocs/superpowers/specs/.Verification
nadle build(compile + typecheck + bundle) clean.nadle checkpasses.validateAliasKeysis kernel-internal, not re-exported from nadle).🤖 Generated with Claude Code