Skip to content

fix(vscode): treat missing dependencies as a state, not an error - #29

Merged
fi3ework merged 5 commits into
mainfrom
fix/not-installed-uniform-status
Aug 24, 2026
Merged

fix(vscode): treat missing dependencies as a state, not an error#29
fi3ework merged 5 commits into
mainfrom
fix/not-installed-uniform-status

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Summary

Opening a repository that contains nested rstack.config.* files whose own dependencies are never installed — e.g. create-rstack's template-* directories beside their generator — made the Rstest stack log [error] Failed to initialize project config with a full stack trace per template, on every detection pass. The dependencies-not-installed situation is the normal state of a fresh clone and of scaffolded templates, not an error.

This PR makes "not installed" a state, reported uniformly by all three stacks (new AGENTS.md rule): a disabled status whose reason names the restart command as the way out, plus one warn line in the output channel — never a crashed status, a stack trace, or a notification.

  • Shared wordingshared/notInstalled.ts owns the status and log sentences for all three stacks (the formatVersionMismatch precedent). The restart hint derives from the new stackCommandTitle in types.ts, and tests/extension.test.ts checks it against the manifest so a renamed command cannot drift silently.
  • Rstest: classification in the worker — a config import failure is classified on Node's own error code inside the worker (the IPC channel's advanced serialization drops code), and the verdict travels as data (NormalizedConfigResult) end to end; Project branches on it and latches a per-project disabled status that a successful resolution clears and dispose forgets.
  • Rstest: status latchStatusHolder gains a notInstalled latch ranked below crashed and version-mismatch (matching the fmt/lint folds), idempotent across refresh repaints. A missing @rstest/core and a bridge directory without rstack now report through the same path.
  • Rslint — the failure report moves wholly into the onDocumentFailure hook in stacks/lint/index.ts, so the upstream-tracked RuntimeManager only defers to it; a bridged folder without rstack logs one warn line instead of an error with a stack.

Related Links

N/A

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

A nested rstack.config.* whose own dependencies are never installed
(create-rstack's template-* beside their generator) made the Rstest
stack log '[error] Failed to initialize project config' with a full
stack trace per template, on every detection pass.

'Not installed' is now reported uniformly across the three stacks
(new AGENTS.md rule): a disabled status whose reason names the restart
command as the way out, plus one warn line in the output channel —
never a crashed status, a stack trace, or a notification.

- shared/notInstalled.ts owns the wording for all three stacks (the
  formatVersionMismatch precedent); the restart hint derives from the
  new stackCommandTitle, checked against the manifest in tests.
- The Rstest worker classifies a config import failure on Node's own
  error code (the IPC channel drops it) and returns the verdict as
  data (NormalizedConfigResult); Project branches on it and latches a
  per-project disabled status that installs clear and dispose forgets.
- StatusHolder gains a notInstalled latch ranked below crash and
  version mismatch, idempotent across refresh repaints.
- Lint's report moves wholly into the onDocumentFailure hook, so the
  upstream-tracked RuntimeManager only defers to it; missing rstack
  logs one warn line instead of an error with a stack.
- Missing @rstest/core now reports through the same path (warn +
  disabled status) at all three master resolution sites.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6230de53f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vscode/src/stacks/lint/status.ts Outdated
Comment thread packages/vscode/src/stacks/lint/index.ts Outdated
Comment thread packages/vscode/src/stacks/test/worker/index.ts Outdated
Comment thread packages/vscode/src/stacks/test/bridge.ts
Review follow-ups on the uniform not-installed policy:

- lint: a missing native @rslint/core is the not-installed state, not a
  crash; the code-to-package mapping (missingPackageOf) is shared by the
  status and the warn line, and the warn names the runtime a document
  keeps. A misconfigured rslint corePath now throws invalid-package so a
  wrong setting is never reported as "install your dependencies".
- rstest worker: @rstest/core is loaded before the classified config
  load, so a broken core install reports its real error instead of
  "a config dependency is missing".
- rstest bridge: the not-installed latch clears the moment the rstack
  package resolves, and an install that ships no Rstest shim latches a
  version-mismatch instead of painting the folder healthy.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a35984a528

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vscode/src/stacks/test/coreResolution.ts Outdated
Comment thread packages/vscode/src/stacks/test/coreResolution.ts Outdated
Comment thread packages/vscode/src/stacks/test/worker/index.ts Outdated
Comment thread packages/vscode/src/stacks/test/bridge.ts
Second review round on the uniform not-installed policy:

- worker: missingDependencyCauseOf replaces isMissingDependencyError —
  Node's code alone also covers a typo'd relative import or a missing
  generated file, which installing dependencies cannot fix, so only a
  bare (package-name) specifier counts and anything else keeps the full
  error report. The returned cause is the message's first line, keeping
  the warn to one line without the CJS require stack.
- shared: the config-dependency log line moves into shared/notInstalled
  (formatConfigDependencyMissingLog), deriving its consequence from
  STACK_LABELS, so no stack owns its own wording.
- rstest status: StatusHolder latches now supersede each other per
  source (one source, one verdict) — a stale higher-ranked crash or
  mismatch can no longer paint over a newer not-installed observation,
  and raise sites need no manual cross-latch cleanup.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9066a5b1dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vscode/src/stacks/test/bridge.ts
Comment thread packages/vscode/src/stacks/test/status.ts
Comment thread packages/vscode/src/stacks/test/coreResolution.ts
Third review round on the uniform not-installed policy:

- rstest bridge: the missing-rstack warning goes through the shared
  formatNotInstalledLog instead of its own sentence.
- rstest status: a package-state observation (mismatch or not-installed)
  restates its root — it retires the other kind AND a stale crash,
  whose only other exit (workerSpawned) cannot fire while the package
  is unusable. The config-dependency verdict moves to its own
  config-deps: latch key (the nodeRuntimeStatusSource precedent), so it
  coexists with the core version check instead of erasing it.
- worker classifier: a bare-looking subpath of an installed package
  (require('pkg/missing')) is a source error, not the not-installed
  state — confirmed against the physical node_modules with the same
  uncached walk-up the rest of the stack resolves packages with.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b832e7612

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vscode/src/stacks/lint/index.ts
Comment thread packages/vscode/src/stacks/fmt/index.ts
@fi3ework
fi3ework merged commit 4e568f9 into main Aug 24, 2026
3 checks passed
@fi3ework
fi3ework deleted the fix/not-installed-uniform-status branch August 24, 2026 10:45
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.

1 participant