feat(preflight): report each problem as data, with a stable code - #47
Merged
Conversation
`PreflightError` carried its findings as a list of sentences. A test that
wanted to assert "this plan has a captive dependency" had to match prose, and
a script reading the error had nothing to branch on. The information was there
and being thrown away: the service-graph validator reports a code, a token and
the dependency path, and runtime preflight reports a code and a module -- both
were reduced to their messages at the throw.
`problems` keeps them: `{ code, message, subject, moduleId, path }` for every
finding, in the order found. `compileApplication` names each of its own checks
the same way -- `COMMAND_HANDLER_CONFLICT`, `STORAGE_SYNCABLE_WORKSPACE`,
`HOSTED_SERVICE_EMPTY` and so on -- and the graph validator's codes join that
vocabulary rather than keeping their own. `issues` is unchanged as the list of
messages, and the error's own message is the same text as before.
`PreflightError` is exported from the root. It is the error a consumer already
receives from `defineExtension` at import time and from `activate` when the
host fails a requirement; exporting it means `instanceof` instead of comparing
`name`.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kkdev92
force-pushed
the
feat/preflight-problems-4.1.0
branch
from
August 29, 2026 14:01
2b6e038 to
5d12e21
Compare
Merged
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.
Summary
Preflight throws before VS Code is touched and reports every problem it found. Until now it reported them as sentences only, so a test asserting "this plan has a captive dependency" matched prose, and a script reading the error had nothing to branch on.
PreflightError.problemsnow carries each finding as data:What was being lost
The information existed and was dropped at the throw. The service-graph validator reports a code, the token it is about and the dependency path it walked; runtime preflight reports a code and the module. Both were reduced to
messageon the way out.compileApplication's own checks — duplicate ids, a handler conflict, a hosted service with no lifecycle,syncableon a workspace-scoped key — were built as sentences from the start.Each check now produces a
PreflightProblemwith a stable code. The graph validator's codes join the same vocabulary (SERVICE_DUPLICATE,SERVICE_MISSING_DEPENDENCY,SERVICE_CIRCULAR_DEPENDENCY,SERVICE_CAPTIVE_DEPENDENCY) so a reader ofproblemssees one. The full list is oncompileApplication's documentation; the runtime codes are onRuntimeIssue.Compatibility
Additive.
issuesremains the list of messages in the same order, and the error's own message is the same text as before, so nothing changes for anyone reading the console or matching onmessage.PreflightErroris now exported from the root. It is the error consumers already receive; exporting it meansinstanceofinstead of comparingerror.name.Two JSDoc examples that showed the old constructor were updated with it.
Verification
npm run quality(1043 tests) andnpm run verify:packagepass. New assertions pin the code, subject and module of every finding kind, the dependency path on a graph problem, the runtime code surviving activation failure, andissuesequallingproblemsreduced to messages.A published extension built on this package was run against this build with its own sources untouched: type-check, lint and 271 tests pass.
🤖 Generated with Claude Code