Skip to content

fix(#1195): sequant://install recomputes on every read and reports a broken manifest as {error} - #1225

Merged
admarble merged 5 commits into
mainfrom
feature/1195-fix-mcp-sequant-install-is-computed-once-at-server
Sep 30, 2026
Merged

admarble merged 5 commits into
mainfrom
feature/1195-fix-mcp-sequant-install-is-computed-once-at-server

Conversation

@admarble

@admarble admarble commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

sequant://install was a snapshot taken once when sequant serve started, and any read error was swallowed into {installed: false}. Now:

  • AC-1: recomputed on every read. ResourceContext.install is a provider, not a value (src/mcp/resources.ts). serve builds it through serveResourceContext() (src/commands/serve.ts), so a manifest written after the server started is seen on the next read without a restart. The startup stderr warning is still a one-shot snapshot that swallows errors, so it can never stop the server from starting.
  • AC-2: a broken manifest reports {error}. The resource catches provider errors and returns { error }. The first exec pass stopped there, and QA's AC_NOT_MET was right: the lenient getManifest() (src/lib/manifest.ts) caught read and parse errors and turned them into null before they ever reached the resource. A new readManifestStrict() throws when the manifest exists but can't be read or parsed. getSkillsInstallStatus uses it by default. getManifest() now wraps it and keeps its lenient behaviour for every other caller, including the per-command pre-flight.
  • AC-3 (skills presence) was dropped by owner decision. See the issue.

Scope note: src/lib/manifest.ts is outside the issue's "May touch" list. It's the smallest place to fix AC-2's real path, where the error was being swallowed. The alternative was duplicating the manifest read inside version-preflight.ts.

AC verification

AC Status Evidence
AC-1 ✅ npx vitest run src/mcp/install-resource.test.ts. The test goes through serveResourceContext(): {installed:false}, then a manifest is written, then {installed:true} from the same server. Mutation-verified below.
AC-2 ✅ Same file, through the real getSkillsInstallStatus provider. A corrupt manifest gives {error}, a chmod 0 manifest gives {error}, and an absent manifest still gives {installed:false}. Mutation-verified below.

Mutation-verified: AC-2 — pointed getSkillsInstallStatus's default deps back at the lenient defaultDeps; src/mcp/install-resource.test.ts > #988 AC-3: sequant://install > through the real provider (AC-1, AC-2) > reports a corrupt manifest as { error }, not { installed: false } failed, together with the unreadable-manifest case (2 failed / 8 passed); restored.

Mutation-verified: AC-1 — made serveResourceContext() return a snapshot taken when it's created (const snapshot = getSkillsInstallStatus(); return { install: () => snapshot }); src/mcp/install-resource.test.ts > #988 AC-3: sequant://install > through the real provider (AC-1, AC-2) > AC-1: one server sees a manifest written after it started failed (1 failed / 10 passed); restored.

(The AC-2 mutation ran before the describe block was renamed from "AC-2 through the real getSkillsInstallStatus provider" to its current name. The test cases themselves are unchanged.)

Runner verification (graph #1203)

  • First QA pass: AC_NOT_MET. AC-2 had been proven only against a synthetic throwing provider, and a probe of the real path showed that a corrupt or unreadable manifest still gave {installed:false}. Fixed by the runner in d1f9beae.
  • QA re-run: AC_MET_BUT_NOT_A_PLUS, with two gaps:
    • The serve wiring was untested (QA's own mutation passed 170/170). Fixed in 136e17cb/d800467d by adding the serveResourceContext() factory, which the AC-1 test now calls directly.
    • The out-of-scope manifest.ts change wasn't called out. It is now, in the scope note above.
  • Targeted suites: install-resource, serve.integration, version-preflight (20 passed). Every test file that imports lib/manifest (9 files, 355 passed). tsc --noEmit and npm run lint are clean.

Test plan

  • timeout 600 npx vitest run src/mcp/install-resource.test.ts src/commands/serve.integration.test.ts src/commands/version-preflight.test.ts: 20 passed
  • Manifest-dependent suites (init, sync, update ×2, run, run-preflight-exit, doctor, unmanaged-skill-safety, version-preflight): 355 passed
  • npx tsc --noEmit, npm run lint

Fixes #1195
Refs #1203

🤖 Generated with Claude Code

…e as {error}

install is now an injected provider (ResourceContext.install: () => Promise<...>) invoked inside the resource's read handler instead of a value computed once at server start. A manifest written after start is seen without a restart, and a thrown/rejected read returns {error} instead of collapsing into {installed:false}.

Entire-Checkpoint: d17f76d50d15
…nifest reports {error}

QA AC_NOT_MET: getManifest() swallowed read/parse errors into null before the resource's catch; AC-2 was only proven against a synthetic provider. Adds readManifestStrict for getSkillsInstallStatus and real-provider tests.

Entire-Checkpoint: 608fecc0966c
… serveResourceContext

Entire-Checkpoint: fddbb6f2e07b
@admarble admarble changed the title fix(#1195): fix(mcp): sequant://install is computed once at server start and swallows errors — reports "not installed" after a later init or on any read error fix(#1195): sequant://install recomputes on every read and reports a broken manifest as {error} Sep 30, 2026
@admarble
admarble merged commit 66ce8c4 into main Sep 30, 2026
7 checks passed
@admarble
admarble deleted the feature/1195-fix-mcp-sequant-install-is-computed-once-at-server branch September 30, 2026 06:10
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.

fix(mcp): sequant://install is computed once at server start and swallows errors — reports "not installed" after a later init or on any read error

1 participant