PAN-4541 - #4542
Merged
Merged
PAN-4541#4542
Conversation
Plan-Finalized: 575c90ab23823ee5dc23d78deb47bedc57f3d0399ead604ec15482e54d76d7f2
The PAN-4508 JSDoc comment on JEV_ZEN_BASE_URL contained the text from "custom", which rolldown preserves into dist/dashboard/server.js. The boot preflight's unresolvedBundleImports regex scanner matches that text as an unresolvable bare import, so dashboardServerBootFailure aborts every pan reload. Reword the comment so it no longer contains import-shaped from-quote text. Item: reword-jev-comment Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…eal lexer unresolvedBundleImports (src/lib/bundle-imports.ts) used a regex that matched the words from/import next to a quoted string anywhere in the bundle text, including inside comments and string literals. A JSDoc example in a bundled comment was indistinguishable from a real import, so a single wrong-looking comment could block every pan reload. Replace the regex with es-module-lexer, which tokenizes the bundle so only genuine static imports, export-from re-exports, and dynamic imports with a literal specifier are read; a package name mentioned in a comment, string, template literal, or regex literal never counts. es-module-lexer is a devDependency only (never a runtime dependency of a consumer install) and is inlined into both the root CLI bundle and the dashboard server bundle via deps.alwaysBundle, so the boot preflight that detects an incomplete node_modules never itself needs node_modules to run. Verified: npm run build + lint:dist-externals show the lexer is inlined everywhere (no bare es-module-lexer import in dist); the old pre-fix regex scanner also passes the new dist/dashboard/server.js (the installed CLI still runs it on the next reload); and a standalone tsdown bundle of bundle-imports.ts (lexer inlined via the embedded WASM) resolves the same dist/dashboard/server.js to []. Item: lexer-scanner Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add a "Boot preflight before switchover" subsection to docs/MERGE-WORKFLOW.md (end of "Deploy progress on the project row") covering what supervisorDeploymentFailure/dashboardServerBootFailure check, that the check now tokenizes with es-module-lexer so only real import/export specifiers count, that a refused reload leaves the old dashboard running, and that the reload deploying a change runs the already-installed CLI. Add one sentence to docs/BUILD.md's PAN-3209 externals section naming bundle-imports.ts and es-module-lexer's devDependency/alwaysBundle status. Also includes .overdeck/context/codebase/concerns.md, a pre-existing uncommitted change from this issue's planning/discovery session describing the same PAN-4541 landmine — carried along since it documents this exact fix and the tree must be clean for `pan done`. Item: docs-boot-preflight Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Lifecycle status fields only (status, sequence, updated), written by pan task as items were claimed/completed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
All acceptance criteria below were verified during the item commits that implemented them (894941c for lexer-scanner, 976e8e7 for reword-jev-comment, d821e6c for docs-boot-preflight) and in this session's verification run: npx vitest run tests/unit/lib/bundle-imports.test.ts tests/unit/lib/deploy/dashboard-bundle-integrity.test.ts and src/lib/channels/__tests__/pty-supervisor-locate.test.ts all passed; npm run build + npm run lint:dist-externals showed es-module-lexer inlined and not a bare dist import; the tsx one-liner and the old-regex scan one-liner both printed [] against the freshly built dist/dashboard/server.js; the standalone tsdown-bundled lexer probe also printed []; and docs/MERGE-WORKFLOW.md and docs/BUILD.md were grepped for the required headings and references. Item: reword-jev-comment.ac1 Item: reword-jev-comment.ac2 Item: lexer-scanner.ac1 Item: lexer-scanner.ac2 Item: lexer-scanner.ac3 Item: lexer-scanner.ac4 Item: lexer-scanner.ac5 Item: lexer-scanner.ac6 Item: docs-boot-preflight.ac1 Item: docs-boot-preflight.ac2 Item: docs-boot-preflight.ac3 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 tasks
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.
Issue: #4541
Acceptance Criteria