From 08cbb9e95910d34d80f17439b9a133bb80e2ccf7 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 11:55:47 +0700 Subject: [PATCH 01/10] chore(porch): bugfix-1154 init bugfix --- .../status.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml diff --git a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml new file mode 100644 index 000000000..016f965d0 --- /dev/null +++ b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml @@ -0,0 +1,14 @@ +id: bugfix-1154 +title: vscode-prepublish-filter-misse +protocol: bugfix +phase: investigate +plan_phases: [] +current_plan_phase: null +gates: + pr: + status: pending +iteration: 1 +build_complete: false +history: [] +started_at: '2026-07-08T04:55:47.036Z' +updated_at: '2026-07-08T04:55:47.037Z' From 3b569b011c643d3d29925b73619ee4b55721dc0d Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 11:57:43 +0700 Subject: [PATCH 02/10] chore(porch): bugfix-1154 fix phase-transition --- .../bugfix-1154-vscode-prepublish-filter-misse/status.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml index 016f965d0..743bd3245 100644 --- a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml +++ b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml @@ -1,7 +1,7 @@ id: bugfix-1154 title: vscode-prepublish-filter-misse protocol: bugfix -phase: investigate +phase: fix plan_phases: [] current_plan_phase: null gates: @@ -11,4 +11,4 @@ iteration: 1 build_complete: false history: [] started_at: '2026-07-08T04:55:47.036Z' -updated_at: '2026-07-08T04:55:47.037Z' +updated_at: '2026-07-08T04:57:43.427Z' From c62d4b9f02ced71cc6785efe61a1add724779a18 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:00:35 +0700 Subject: [PATCH 03/10] [Bugfix #1154] Fix: build all workspace deps in vscode:prepublish via topological filter --- packages/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode/package.json b/packages/vscode/package.json index d8ba836af..5fd689111 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -1038,7 +1038,7 @@ ] }, "scripts": { - "vscode:prepublish": "pnpm --filter @cluesmith/codev-core --filter @cluesmith/codev-types build && pnpm package", + "vscode:prepublish": "pnpm --filter 'codev-vscode^...' build && pnpm package", "compile": "pnpm check-types && pnpm lint && node esbuild.js", "watch": "pnpm run --parallel '/^watch:/'", "watch:esbuild": "node esbuild.js --watch", From 475588f71f7635c46c6604a317a83d42d9de1a81 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:00:46 +0700 Subject: [PATCH 04/10] [Bugfix #1154] Test: assert vscode:prepublish covers every workspace:* dep --- .../prepublish-workspace-deps.test.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 packages/vscode/src/__tests__/prepublish-workspace-deps.test.ts diff --git a/packages/vscode/src/__tests__/prepublish-workspace-deps.test.ts b/packages/vscode/src/__tests__/prepublish-workspace-deps.test.ts new file mode 100644 index 000000000..ef8b8e697 --- /dev/null +++ b/packages/vscode/src/__tests__/prepublish-workspace-deps.test.ts @@ -0,0 +1,48 @@ +/** + * Regression for issue #1154: `vscode:prepublish` must build every + * `workspace:*` dependency before type-checking and bundling. The script + * once listed `--filter` targets by hand and missed + * `@cluesmith/codev-artifact-canvas`, so a fresh clone failed check-types + * with TS2307 on the markdown-preview webview's imports. + * + * The topological form (`--filter 'codev-vscode^...'`) selects all + * workspace deps transitively and passes trivially. If the script ever + * reverts to an explicit `--filter` list, this asserts the list covers + * every `workspace:*` dep so a newly added dep cannot silently regress. + */ + +import { describe, it, expect } from 'vitest'; +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; + +const PKG = JSON.parse( + readFileSync(resolve(__dirname, '../../package.json'), 'utf8'), +); + +const workspaceDeps = Object.entries({ + ...(PKG.dependencies ?? {}), + ...(PKG.devDependencies ?? {}), +}) + .filter(([, version]) => String(version).startsWith('workspace:')) + .map(([name]) => name); + +describe('vscode:prepublish workspace dep coverage (issue #1154)', () => { + const script: string = PKG.scripts['vscode:prepublish']; + + it('has workspace:* deps to guard (sanity)', () => { + expect(workspaceDeps.length).toBeGreaterThan(0); + }); + + it('builds every workspace:* dependency before packaging', () => { + if (/--filter\s+['"]?codev-vscode\^\.\.\.['"]?/.test(script)) { + // Topological form: pnpm builds all workspace deps transitively. + return; + } + const filters = [...script.matchAll(/--filter\s+['"]?([^\s'"]+)['"]?/g)].map( + (m) => m[1], + ); + for (const dep of workspaceDeps) { + expect(filters, `prepublish must build ${dep}`).toContain(dep); + } + }); +}); From 81d21f6226862c2108002a51abcd0c041f9a9433 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:00:52 +0700 Subject: [PATCH 05/10] [Bugfix #1154] Add builder thread log --- codev/state/bugfix-1154_thread.md | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 codev/state/bugfix-1154_thread.md diff --git a/codev/state/bugfix-1154_thread.md b/codev/state/bugfix-1154_thread.md new file mode 100644 index 000000000..c33d077f0 --- /dev/null +++ b/codev/state/bugfix-1154_thread.md @@ -0,0 +1,39 @@ +# Builder thread — bugfix-1154 + +## Investigate + +Issue #1154: `vscode:prepublish` in `packages/vscode/package.json` builds only +`@cluesmith/codev-core` and `@cluesmith/codev-types`, missing +`@cluesmith/codev-artifact-canvas` (a third `workspace:*` dep genuinely imported +by the markdown-preview webview at `src/markdown-preview/webview/main.ts:34-35`). + +Reproduction in this worktree (fresh, no dists built): +- `pnpm --filter codev-vscode run check-types` fails with TS2307 on + `@cluesmith/codev-core/*` subpath imports (no .d.ts emitted yet) — confirms + the fresh-clone failure class. +- Next step: build core+types only (what the current prepublish filter does), + re-run check-types, expect the surviving error to be the artifact-canvas + TS2307 — that isolates the exact bug. + +Planned fix (per issue, future-proof flavor): switch the prepublish filter to +pnpm's topological form `pnpm --filter 'codev-vscode^...' build`, which builds +all workspace deps of codev-vscode transitively. + +Investigation results: +- Reproduced: with no dists built, check-types fails on codev-core subpath + imports; after building core+types only (the old prepublish set), the + surviving error is exactly `TS2307: Cannot find module + '@cluesmith/codev-artifact-canvas'` at main.ts:34. Bug isolated. +- Confirmed `pnpm --filter 'codev-vscode^...'` selects exactly + {artifact-canvas, types, core} and artifact-canvas has a tsup build script. + +## Fix + +- `packages/vscode/package.json`: `vscode:prepublish` now uses + `pnpm --filter 'codev-vscode^...' build && pnpm package`. +- Verified from fresh-clone state (all three dists removed): the new dep + build emits all dists and `check-types` passes both tsc passes. +- Regression test `src/__tests__/prepublish-workspace-deps.test.ts`: + accepts the topological filter form; if the script reverts to an explicit + `--filter` list, asserts the list covers every `workspace:*` dep. + Verified red without the fix, green with it. From b4bef42bf51088cf686d948a9d4411def8abc505 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:01:27 +0700 Subject: [PATCH 06/10] chore(porch): bugfix-1154 pr phase-transition --- .../bugfix-1154-vscode-prepublish-filter-misse/status.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml index 743bd3245..24df48c19 100644 --- a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml +++ b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml @@ -1,7 +1,7 @@ id: bugfix-1154 title: vscode-prepublish-filter-misse protocol: bugfix -phase: fix +phase: pr plan_phases: [] current_plan_phase: null gates: @@ -11,4 +11,4 @@ iteration: 1 build_complete: false history: [] started_at: '2026-07-08T04:55:47.036Z' -updated_at: '2026-07-08T04:57:43.427Z' +updated_at: '2026-07-08T05:01:27.942Z' From 90a84bd58dc3202678fd15bb83a1b7615b3de070 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:04:52 +0700 Subject: [PATCH 07/10] [Bugfix #1154] Update thread log: PR + CMAP results --- codev/state/bugfix-1154_thread.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/codev/state/bugfix-1154_thread.md b/codev/state/bugfix-1154_thread.md index c33d077f0..debbba5b8 100644 --- a/codev/state/bugfix-1154_thread.md +++ b/codev/state/bugfix-1154_thread.md @@ -37,3 +37,11 @@ Investigation results: accepts the topological filter form; if the script reverts to an explicit `--filter` list, asserts the list covers every `workspace:*` dep. Verified red without the fix, green with it. + +## PR + +- Porch fix-phase checks passed (build 5.9s, tests 20.6s). +- PR #1155 opened with Summary / Root Cause / Fix / Test Plan, `Fixes #1154`. +- CMAP (3-way, `--issue 1154`): gemini=APPROVE, codex=APPROVE, claude=APPROVE, + all HIGH confidence, no key issues raised. +- Requested `pr` gate via `porch done`; waiting on human approval. From 135e0b2f5cb5776af404aa726091fe3386c84ac6 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:05:09 +0700 Subject: [PATCH 08/10] chore(porch): bugfix-1154 pr gate-requested --- .../bugfix-1154-vscode-prepublish-filter-misse/status.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml index 24df48c19..bc80eb381 100644 --- a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml +++ b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml @@ -7,8 +7,10 @@ current_plan_phase: null gates: pr: status: pending + requested_at: '2026-07-08T05:05:09.146Z' iteration: 1 build_complete: false history: [] started_at: '2026-07-08T04:55:47.036Z' -updated_at: '2026-07-08T05:01:27.942Z' +updated_at: '2026-07-08T05:05:09.147Z' +pr_ready_for_human: true From 4d63472533081494fa810ea06589d7f93508da59 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:05:30 +0700 Subject: [PATCH 09/10] chore(porch): bugfix-1154 pr gate-approved --- .../bugfix-1154-vscode-prepublish-filter-misse/status.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml index bc80eb381..5b8c0501a 100644 --- a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml +++ b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml @@ -6,11 +6,12 @@ plan_phases: [] current_plan_phase: null gates: pr: - status: pending + status: approved requested_at: '2026-07-08T05:05:09.146Z' + approved_at: '2026-07-08T05:05:30.071Z' iteration: 1 build_complete: false history: [] started_at: '2026-07-08T04:55:47.036Z' -updated_at: '2026-07-08T05:05:09.147Z' -pr_ready_for_human: true +updated_at: '2026-07-08T05:05:30.072Z' +pr_ready_for_human: false From bc2e52713c6001e9b5a98fc61535c4ea6844d81c Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Wed, 8 Jul 2026 12:05:38 +0700 Subject: [PATCH 10/10] chore(porch): bugfix-1154 protocol complete --- .../bugfix-1154-vscode-prepublish-filter-misse/status.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml index 5b8c0501a..51bb363e6 100644 --- a/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml +++ b/codev/projects/bugfix-1154-vscode-prepublish-filter-misse/status.yaml @@ -1,7 +1,7 @@ id: bugfix-1154 title: vscode-prepublish-filter-misse protocol: bugfix -phase: pr +phase: verified plan_phases: [] current_plan_phase: null gates: @@ -13,5 +13,5 @@ iteration: 1 build_complete: false history: [] started_at: '2026-07-08T04:55:47.036Z' -updated_at: '2026-07-08T05:05:30.072Z' +updated_at: '2026-07-08T05:05:38.933Z' pr_ready_for_human: false