gentle-pi 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -44
- package/assets/agents/gentle-ai-explore.md +3 -3
- package/assets/agents/gentle-ai-verify.md +20 -6
- package/assets/agents/gentle-ai-worker.md +14 -13
- package/assets/agents/jd-judge-a.md +1 -3
- package/assets/agents/jd-judge-b.md +1 -3
- package/assets/agents/review-readability.md +1 -5
- package/assets/agents/review-reliability.md +1 -5
- package/assets/agents/review-resilience.md +1 -5
- package/assets/agents/review-risk.md +1 -5
- package/assets/design-canvas/canvas-api.js +45 -0
- package/assets/design-canvas/canvas-boards.js +476 -0
- package/assets/design-canvas/canvas-boot.js +219 -0
- package/assets/design-canvas/canvas-checks.js +491 -0
- package/assets/design-canvas/canvas-comments.js +315 -0
- package/assets/design-canvas/canvas-compare.js +159 -0
- package/assets/design-canvas/canvas-events.js +75 -0
- package/assets/design-canvas/canvas-export.js +393 -0
- package/assets/design-canvas/canvas-focus.js +203 -0
- package/assets/design-canvas/canvas-handoffs.js +150 -0
- package/assets/design-canvas/canvas-i18n-es.js +397 -0
- package/assets/design-canvas/canvas-i18n.js +108 -0
- package/assets/design-canvas/canvas-layout.js +526 -0
- package/assets/design-canvas/canvas-menu.js +219 -0
- package/assets/design-canvas/canvas-messages.js +86 -0
- package/assets/design-canvas/canvas-minimap.js +163 -0
- package/assets/design-canvas/canvas-parts.js +401 -0
- package/assets/design-canvas/canvas-popover.js +234 -0
- package/assets/design-canvas/canvas-rail.js +351 -0
- package/assets/design-canvas/canvas-sizes.js +524 -0
- package/assets/design-canvas/canvas-store.js +167 -0
- package/assets/design-canvas/canvas-theme.js +69 -0
- package/assets/design-canvas/canvas-tokens.js +674 -0
- package/assets/design-canvas/canvas-ui.js +24 -0
- package/assets/design-canvas/canvas-view.js +184 -0
- package/assets/design-canvas/canvas.css +773 -17
- package/assets/design-canvas/canvas.js +2 -1506
- package/assets/design-canvas/index.html +120 -36
- package/assets/design-canvas/inspector.js +574 -21
- package/assets/design-canvas/theme-early.js +10 -0
- package/assets/install-wizard/wizard.js +5 -1
- package/assets/migrations/agent-body-history.json +30 -0
- package/assets/orchestrator-delegation-reference.md +8 -14
- package/assets/orchestrator-delegation.md +5 -9
- package/assets/orchestrator-full-delegation-card.md +11 -16
- package/assets/orchestrator-full-delegation.md +9 -9
- package/assets/orchestrator-memory.md +4 -4
- package/assets/orchestrator-prompts.md +3 -31
- package/assets/orchestrator-quota-recovery.md +5 -0
- package/assets/orchestrator-skills.md +13 -12
- package/assets/orchestrator-tracking.md +13 -17
- package/assets/orchestrator-verification.md +12 -10
- package/assets/orchestrator-writer.md +13 -13
- package/assets/orchestrator.md +20 -24
- package/bin/gentle-shell.mjs +205 -10
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +8 -9
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/manifest.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/orchestration/pi.md +2 -1
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/routing/pi.md +16 -16
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/generated/provider-capabilities.baseline.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/generated/provider-roles.baseline.json +1 -1
- package/docs/assets/brand/sponsor-banner.svg +60 -0
- package/docs/assets/features/gentle-tower.png +0 -0
- package/docs/auto-permission-answers.md +1 -1
- package/docs/bundled-install.md +14 -6
- package/docs/delegated-verification.md +23 -5
- package/docs/desktop-feed.md +303 -0
- package/docs/desktop-rpc.md +1931 -0
- package/docs/fast-mode.md +2 -2
- package/docs/gentle-agents-activity.md +26 -0
- package/docs/gentle-shell-desktop.md +465 -0
- package/docs/gentle-shell.md +102 -17
- package/docs/images/desktop/chat.png +0 -0
- package/docs/images/desktop/palette.png +0 -0
- package/docs/images/desktop/todo.png +0 -0
- package/docs/install-wizard.md +30 -21
- package/docs/odd-preparation-continuity.md +24 -0
- package/docs/permission-modes.md +9 -1
- package/docs/prompt-budget.md +12 -0
- package/docs/rdd-odd-friction-triage-2026-11-07.md +57 -0
- package/docs/readme-reference.md +113 -32
- package/docs/review-coordinator.md +29 -9
- package/docs/review-delivery-preflight.md +22 -0
- package/docs/work-continuity.md +19 -6
- package/extensions/ask-user-choice.ts +36 -18
- package/extensions/ask-user-question.ts +48 -9
- package/extensions/child-context.ts +21 -7
- package/extensions/gentle-agents.ts +436 -66
- package/extensions/gentle-ai.ts +809 -158
- package/extensions/gentle-design.ts +69 -3
- package/extensions/gentle-desktop-feed.ts +778 -0
- package/extensions/gentle-desktop-rpc.ts +276 -0
- package/extensions/gentle-guide.ts +3 -0
- package/extensions/gentle-herdr-desktop-status.ts +275 -0
- package/extensions/gentle-shell.ts +174 -59
- package/extensions/gentle-stats.ts +30 -1
- package/extensions/gentle-todo.ts +48 -25
- package/extensions/gentle-tower.ts +305 -0
- package/extensions/skill-registry.ts +260 -225
- package/herdr/RECIPE.md +157 -0
- package/herdr/keys.json +14 -0
- package/herdr/layouts/gentle-shell.json +202 -0
- package/herdr/mods/gentle-agents/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-agents/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-agents/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-agents/main.js +190 -0
- package/herdr/mods/gentle-agents/mod.json +1 -0
- package/herdr/mods/gentle-agents/snapshot.js +469 -0
- package/herdr/mods/gentle-agents/tokens.js +273 -0
- package/herdr/mods/gentle-chat/MINIMAL.md +69 -0
- package/herdr/mods/gentle-chat/actions.js +180 -0
- package/herdr/mods/gentle-chat/feed.js +321 -0
- package/herdr/mods/gentle-chat/icons/branch.svg +1 -0
- package/herdr/mods/gentle-chat/icons/chat.svg +1 -0
- package/herdr/mods/gentle-chat/icons/check.svg +1 -0
- package/herdr/mods/gentle-chat/icons/chev.svg +1 -0
- package/herdr/mods/gentle-chat/icons/clip.svg +1 -0
- package/herdr/mods/gentle-chat/icons/down.svg +1 -0
- package/herdr/mods/gentle-chat/icons/folder.svg +1 -0
- package/herdr/mods/gentle-chat/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-chat/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-chat/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-chat/icons/mark.svg +1 -0
- package/herdr/mods/gentle-chat/icons/send.svg +1 -0
- package/herdr/mods/gentle-chat/icons/shield.svg +1 -0
- package/herdr/mods/gentle-chat/icons/stop.svg +1 -0
- package/herdr/mods/gentle-chat/icons/term.svg +1 -0
- package/herdr/mods/gentle-chat/icons/user.svg +1 -0
- package/herdr/mods/gentle-chat/icons/x.svg +1 -0
- package/herdr/mods/gentle-chat/main.js +968 -0
- package/herdr/mods/gentle-chat/mod.json +1 -0
- package/herdr/mods/gentle-chat/session.js +212 -0
- package/herdr/mods/gentle-chat/snapshot.js +469 -0
- package/herdr/mods/gentle-chat/tokens.js +137 -0
- package/herdr/mods/gentle-chat/ui.js +883 -0
- package/herdr/mods/gentle-confirm/main.js +60 -0
- package/herdr/mods/gentle-confirm/mod.json +1 -0
- package/herdr/mods/gentle-inspector/actions.js +180 -0
- package/herdr/mods/gentle-inspector/icons/bolt.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/bot.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/check.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/db.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/diff.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/jobs.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/plug.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/review.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/stats.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/stop.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/todo.svg +1 -0
- package/herdr/mods/gentle-inspector/main.js +500 -0
- package/herdr/mods/gentle-inspector/mod.json +1 -0
- package/herdr/mods/gentle-inspector/snapshot.js +469 -0
- package/herdr/mods/gentle-inspector/tokens.js +273 -0
- package/herdr/mods/gentle-palette/actions.js +180 -0
- package/herdr/mods/gentle-palette/icons/bolt.svg +1 -0
- package/herdr/mods/gentle-palette/icons/bot.svg +1 -0
- package/herdr/mods/gentle-palette/icons/chat.svg +1 -0
- package/herdr/mods/gentle-palette/icons/check.svg +1 -0
- package/herdr/mods/gentle-palette/icons/cmd.svg +1 -0
- package/herdr/mods/gentle-palette/icons/diff.svg +1 -0
- package/herdr/mods/gentle-palette/icons/jobs.svg +1 -0
- package/herdr/mods/gentle-palette/icons/plus.svg +1 -0
- package/herdr/mods/gentle-palette/icons/review.svg +1 -0
- package/herdr/mods/gentle-palette/icons/search.svg +1 -0
- package/herdr/mods/gentle-palette/icons/shield.svg +1 -0
- package/herdr/mods/gentle-palette/icons/stats.svg +1 -0
- package/herdr/mods/gentle-palette/icons/stop.svg +1 -0
- package/herdr/mods/gentle-palette/icons/term.svg +1 -0
- package/herdr/mods/gentle-palette/icons/todo.svg +1 -0
- package/herdr/mods/gentle-palette/main.js +333 -0
- package/herdr/mods/gentle-palette/mod.json +1 -0
- package/herdr/mods/gentle-palette/snapshot.js +469 -0
- package/herdr/mods/gentle-palette/tokens.js +273 -0
- package/herdr/mods/gentle-pane/icons/chat.svg +1 -0
- package/herdr/mods/gentle-pane/icons/close.svg +1 -0
- package/herdr/mods/gentle-pane/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-pane/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-pane/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-pane/icons/split-down.svg +1 -0
- package/herdr/mods/gentle-pane/icons/split-right.svg +1 -0
- package/herdr/mods/gentle-pane/icons/term.svg +1 -0
- package/herdr/mods/gentle-pane/icons/unzoom.svg +1 -0
- package/herdr/mods/gentle-pane/icons/zoom.svg +1 -0
- package/herdr/mods/gentle-pane/main.js +91 -0
- package/herdr/mods/gentle-pane/mod.json +1 -0
- package/herdr/mods/gentle-pane/snapshot.js +469 -0
- package/herdr/mods/gentle-pane/tokens.js +273 -0
- package/herdr/mods/gentle-sidebar/actions.js +180 -0
- package/herdr/mods/gentle-sidebar/icons/gear.svg +1 -0
- package/herdr/mods/gentle-sidebar/icons/mark.svg +1 -0
- package/herdr/mods/gentle-sidebar/icons/refresh.svg +1 -0
- package/herdr/mods/gentle-sidebar/icons/server-plus.svg +1 -0
- package/herdr/mods/gentle-sidebar/main.js +171 -0
- package/herdr/mods/gentle-sidebar/mod.json +1 -0
- package/herdr/mods/gentle-sidebar/snapshot.js +469 -0
- package/herdr/mods/gentle-sidebar/tokens.js +273 -0
- package/herdr/mods/gentle-spaces/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/monitor.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/plus.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/server.svg +1 -0
- package/herdr/mods/gentle-spaces/machines.js +31 -0
- package/herdr/mods/gentle-spaces/main.js +299 -0
- package/herdr/mods/gentle-spaces/mod.json +1 -0
- package/herdr/mods/gentle-spaces/snapshot.js +469 -0
- package/herdr/mods/gentle-spaces/tokens.js +273 -0
- package/herdr/mods/gentle-status/actions.js +180 -0
- package/herdr/mods/gentle-status/main.js +192 -0
- package/herdr/mods/gentle-status/mod.json +1 -0
- package/herdr/mods/gentle-status/snapshot.js +469 -0
- package/herdr/mods/gentle-status/tokens.js +273 -0
- package/herdr/mods/gentle-tabs/icons/close.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/plus.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-close.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-max.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-min.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-restore.svg +1 -0
- package/herdr/mods/gentle-tabs/main.js +171 -0
- package/herdr/mods/gentle-tabs/mod.json +1 -0
- package/herdr/mods/gentle-tabs/snapshot.js +469 -0
- package/herdr/mods/gentle-tabs/tokens.js +273 -0
- package/herdr/mods/gentle-tokens/main.js +20 -0
- package/herdr/mods/gentle-tokens/mod.json +1 -0
- package/herdr/mods/gentle-tokens/snapshot.js +469 -0
- package/herdr/mods/gentle-tokens/tokens.js +273 -0
- package/herdr/preview.png +0 -0
- package/herdr/themes/gentle-shell-dark.json +33 -0
- package/herdr/themes/gentle-shell-light.json +34 -0
- package/lib/agent-assets.ts +30 -6
- package/lib/agent-tool-overlay.ts +117 -0
- package/lib/agents-config.ts +47 -6
- package/lib/agents-message-delivery.ts +17 -0
- package/lib/agents-messaging.ts +8 -2
- package/lib/agents-protocol.ts +17 -0
- package/lib/agents-report-cap.ts +115 -0
- package/lib/agents-rpc-publisher.ts +39 -12
- package/lib/agents-runner.ts +92 -6
- package/lib/agents-session-transport.ts +17 -1
- package/lib/auto-permission-answers.ts +2 -1
- package/lib/background-jobs-tools.ts +9 -4
- package/lib/background-jobs.ts +22 -2
- package/lib/bounded-writer-admission.ts +184 -31
- package/lib/change-diff.ts +104 -0
- package/lib/child-context-files.ts +21 -6
- package/lib/codemode-renderer.ts +1 -0
- package/lib/commit-slice-signal.ts +1 -1
- package/lib/delivery-conflict-markers.ts +349 -0
- package/lib/design-canvas-assets.ts +38 -0
- package/lib/design-canvas-server.ts +241 -23
- package/lib/design-comments.ts +94 -4
- package/lib/design-handoffs.ts +2 -1
- package/lib/design-layout.ts +125 -0
- package/lib/design-parts.ts +281 -0
- package/lib/design-system-tokens.ts +111 -0
- package/lib/desktop-agents-service.ts +315 -0
- package/lib/desktop-changes-service.ts +171 -0
- package/lib/desktop-design-service.ts +233 -0
- package/lib/desktop-feed-actions.ts +804 -0
- package/lib/desktop-feed-answers.ts +129 -0
- package/lib/desktop-feed-sources.ts +184 -0
- package/lib/desktop-feed-stats.ts +98 -0
- package/lib/desktop-feed-store.ts +124 -0
- package/lib/desktop-feed.ts +788 -0
- package/lib/desktop-jobs-service.ts +290 -0
- package/lib/desktop-review-service.ts +187 -0
- package/lib/desktop-rpc-agents.ts +403 -0
- package/lib/desktop-rpc-changes.ts +223 -0
- package/lib/desktop-rpc-config-watch.ts +285 -0
- package/lib/desktop-rpc-config.ts +885 -0
- package/lib/desktop-rpc-design.ts +138 -0
- package/lib/desktop-rpc-jobs.ts +290 -0
- package/lib/desktop-rpc-permissions.ts +328 -0
- package/lib/desktop-rpc-profiles.ts +196 -0
- package/lib/desktop-rpc-review.ts +180 -0
- package/lib/desktop-rpc-session.ts +203 -0
- package/lib/desktop-rpc-sessions.ts +250 -0
- package/lib/desktop-rpc-stats.ts +187 -0
- package/lib/desktop-rpc-updates.ts +143 -0
- package/lib/desktop-rpc-usage.ts +229 -0
- package/lib/desktop-rpc.ts +336 -0
- package/lib/desktop-session-service.ts +223 -0
- package/lib/desktop-sessions-service.ts +249 -0
- package/lib/desktop-stats-service.ts +142 -0
- package/lib/desktop-updates-service.ts +268 -0
- package/lib/desktop-usage-service.ts +310 -0
- package/lib/destructive-command-guard.ts +188 -13
- package/lib/gentle-ai-renderer.ts +13 -1
- package/lib/gentle-design.ts +201 -14
- package/lib/gentle-shell-bundled.ts +100 -9
- package/lib/gentle-shell-desktop.ts +1370 -0
- package/lib/gentle-shell-launcher.ts +45 -3
- package/lib/herdr-desktop-events.ts +40 -0
- package/lib/herdr-desktop-status.ts +229 -0
- package/lib/hidden-tools.ts +35 -0
- package/lib/inprocess-reviewer.ts +96 -12
- package/lib/jobs-sidebar-state.ts +5 -0
- package/lib/model-fallback-policy.ts +9 -0
- package/lib/model-routing-authority.ts +9 -0
- package/lib/nan-provider.ts +42 -28
- package/lib/native-review-cli.ts +86 -4
- package/lib/openai-fast-tier.ts +1 -0
- package/lib/orchestrator-discovery.ts +39 -2
- package/lib/reply-language-anchor.ts +27 -2
- package/lib/request-context-placement.ts +53 -0
- package/lib/review-candidate-view.ts +11 -1
- package/lib/review-continuation-registry.ts +17 -0
- package/lib/review-coordinator.ts +252 -8
- package/lib/review-delivery-preflight.ts +85 -0
- package/lib/review-host-relay.ts +5 -1
- package/lib/review-integration-v2.ts +56 -3
- package/lib/reviewer-stream.ts +87 -0
- package/lib/session-profile-freeze.ts +13 -5
- package/lib/shell-prompt.ts +16 -3
- package/lib/shell-usage.ts +10 -0
- package/lib/stats-collector.ts +56 -27
- package/lib/tower-actions.ts +100 -0
- package/lib/tower-hub.ts +73 -0
- package/lib/tower-launch.ts +111 -0
- package/lib/tower-open.ts +99 -0
- package/lib/tower-presence.ts +70 -0
- package/lib/tower-server.ts +234 -0
- package/lib/tower-snapshot.ts +298 -0
- package/lib/update-status.ts +238 -0
- package/lib/verifier-settle-reminder.ts +1 -1
- package/lib/vim-editor-adapter.ts +9 -2
- package/lib/writer-batch-admission.ts +55 -0
- package/lib/yolo-session-policy.ts +6 -1
- package/package.json +14 -5
- package/prompts/skill-creation.md +1 -10
- package/runtime/design-canvas-assets.mjs +39 -0
- package/runtime/gentle-shell-bundled.mjs +100 -9
- package/runtime/gentle-shell-desktop.mjs +1371 -0
- package/runtime/gentle-shell-launcher.mjs +44 -2
- package/runtime/native-review-cli.mjs +86 -4
- package/runtime/review-integration-v2.mjs +56 -3
- package/runtime/tower-actions.mjs +101 -0
- package/runtime/tower-hub.mjs +74 -0
- package/runtime/tower-launch.mjs +112 -0
- package/runtime/tower-open.mjs +100 -0
- package/runtime/tower-presence.mjs +71 -0
- package/runtime/tower-server.mjs +234 -0
- package/runtime/tower-snapshot.mjs +299 -0
- package/scripts/bootstrap.cmd +2 -2
- package/scripts/bootstrap.sh +41 -4
- package/scripts/build-full-delegation-card.mjs +5 -21
- package/scripts/build-runtime-modules.mjs +10 -0
- package/scripts/gentle-ai-installer.mjs +10 -10
- package/scripts/gentle-ai-proxy.mjs +1 -1
- package/scripts/installer-downloads.mjs +34 -8
- package/scripts/installer-preflight.mjs +28 -17
- package/scripts/installer-probes.mjs +25 -5
- package/scripts/installer-server.mjs +38 -9
- package/scripts/installer-windows.mjs +2 -2
- package/scripts/pi-update.mjs +166 -27
- package/scripts/prepare-verifier.mjs +107 -0
- package/scripts/update-agent-body-history.mjs +55 -8
- package/scripts/verify-package-files.mjs +61 -20
- package/skills/branch-pr/SKILL.md +16 -16
- package/skills/comment-writer/SKILL.md +1 -1
- package/skills/design/SKILL.md +6 -6
- package/skills/gentle-ai/SKILL.md +5 -5
- package/skills/judgment-day/SKILL.md +2 -2
- package/skills/judgment-day/references/prompts-and-formats.md +1 -1
- package/skills/provider-defect-report/SKILL.md +61 -0
- package/skills/rdd-defect-workflow/SKILL.md +6 -6
- package/skills/skill-improver/SKILL.md +2 -2
- package/skills/skill-registry/SKILL.md +11 -13
- package/skills/tui-design/SKILL.md +1 -1
- package/skills/work-unit-commits/SKILL.md +5 -5
- package/tests/agent-prompt-diet-contract.test.ts +101 -0
- package/tests/agent-tool-overlay-acceptance.test.ts +158 -0
- package/tests/agent-tool-overlay.test.ts +89 -0
- package/tests/agents-config.test.ts +10 -1
- package/tests/agents-message-delivery.test.ts +36 -0
- package/tests/agents-queries.test.ts +144 -4
- package/tests/agents-report-cap.test.ts +126 -0
- package/tests/agents-runner.test.ts +37 -1
- package/tests/agents-session-transport.test.ts +34 -0
- package/tests/always-on-prompt-verdicts-contract.test.ts +188 -0
- package/tests/append-system-prompt-route.test.ts +26 -7
- package/tests/approved-text-leftovers-contract.test.ts +136 -0
- package/tests/artifact-language.test.ts +1 -1
- package/tests/ask-user-choice.test.ts +78 -21
- package/tests/ask-user-question.test.ts +61 -6
- package/tests/audit-leftovers-contract.test.ts +51 -0
- package/tests/auto-permission-answers.test.ts +12 -1
- package/tests/background-jobs.test.ts +12 -0
- package/tests/bounded-stop-contract.test.ts +148 -27
- package/tests/branch-pr-skill.test.ts +10 -1
- package/tests/bundled-install.test.ts +1 -1
- package/tests/change-diff.test.ts +75 -0
- package/tests/child-context-files.test.ts +64 -8
- package/tests/child-skills-catalog.test.ts +56 -0
- package/tests/codemode-rendering.test.ts +4 -1
- package/tests/commit-slice-signal.test.ts +3 -2
- package/tests/decision-routing-contract.test.ts +390 -0
- package/tests/delegate-for-reason-contract.test.ts +30 -8
- package/tests/delegated-key-learnings-contract.test.ts +21 -28
- package/tests/delivery-b-rendered-surfaces.test.ts +32 -0
- package/tests/delivery-conflict-markers.test.ts +348 -0
- package/tests/design-canvas-all-sizes.test.ts +631 -0
- package/tests/design-canvas-allowlist.test.ts +32 -0
- package/tests/design-canvas-assets.test.ts +11 -878
- package/tests/design-canvas-boards.test.ts +77 -0
- package/tests/design-canvas-checks.test.ts +655 -0
- package/tests/design-canvas-compare.test.ts +79 -0
- package/tests/design-canvas-events.test.ts +59 -0
- package/tests/design-canvas-export.test.ts +1168 -0
- package/tests/design-canvas-focus.test.ts +113 -0
- package/tests/design-canvas-handoffs.test.ts +59 -0
- package/tests/design-canvas-i18n-review.test.ts +513 -0
- package/tests/design-canvas-i18n-views.test.ts +259 -0
- package/tests/design-canvas-i18n.test.ts +528 -0
- package/tests/design-canvas-inspector.test.ts +1004 -0
- package/tests/design-canvas-layout.test.ts +1222 -0
- package/tests/design-canvas-minimap.test.ts +413 -0
- package/tests/design-canvas-modules.test.ts +91 -0
- package/tests/design-canvas-parts.test.ts +721 -0
- package/tests/design-canvas-rail.test.ts +799 -0
- package/tests/design-canvas-server.test.ts +855 -17
- package/tests/design-canvas-sizes.test.ts +548 -0
- package/tests/design-canvas-store.test.ts +189 -0
- package/tests/design-canvas-theme.test.ts +198 -0
- package/tests/design-canvas-tokens.test.ts +965 -0
- package/tests/design-canvas-view.test.ts +299 -0
- package/tests/design-comments.test.ts +201 -1
- package/tests/design-handoffs.test.ts +20 -0
- package/tests/design-layout.test.ts +100 -0
- package/tests/design-parts.test.ts +260 -0
- package/tests/design-system-tokens.test.ts +215 -0
- package/tests/desktop-feed-actions-guards.test.ts +595 -0
- package/tests/desktop-feed-actions.test.ts +761 -0
- package/tests/desktop-feed-live-work.test.ts +209 -0
- package/tests/desktop-feed-performance.test.ts +369 -0
- package/tests/desktop-feed-plan-profiles.test.ts +509 -0
- package/tests/desktop-feed-send-prompt.test.ts +303 -0
- package/tests/desktop-feed-tool-summaries.test.ts +69 -0
- package/tests/desktop-feed.test.ts +615 -0
- package/tests/desktop-rpc-agents.test.ts +1319 -0
- package/tests/desktop-rpc-changes.test.ts +608 -0
- package/tests/desktop-rpc-config-watch.test.ts +1159 -0
- package/tests/desktop-rpc-config.test.ts +1462 -0
- package/tests/desktop-rpc-design.test.ts +672 -0
- package/tests/desktop-rpc-jobs.test.ts +1193 -0
- package/tests/desktop-rpc-permissions.test.ts +321 -0
- package/tests/desktop-rpc-profiles.test.ts +140 -0
- package/tests/desktop-rpc-review.test.ts +678 -0
- package/tests/desktop-rpc-safety.test.ts +119 -0
- package/tests/desktop-rpc-session.test.ts +642 -0
- package/tests/desktop-rpc-sessions.test.ts +647 -0
- package/tests/desktop-rpc-stats.test.ts +431 -0
- package/tests/desktop-rpc-updates.test.ts +525 -0
- package/tests/desktop-rpc-usage.test.ts +707 -0
- package/tests/desktop-rpc.test.ts +293 -0
- package/tests/devbinary/pi-host-relay.devtest.ts +149 -80
- package/tests/devbinary/review-session-consent.devtest.ts +84 -0
- package/tests/engram-safety.test.ts +111 -0
- package/tests/fixtures/devbinary/status-v9-escalated-non-blocking.captured.json +92 -0
- package/tests/fixtures/devbinary/status-v9-escalated-non-blocking.provenance.md +3 -0
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +30 -41
- package/tests/fixtures/refusal-identity.probe.mjs +139 -0
- package/tests/fixtures/session-profile-v1/replay.ts +4 -1
- package/tests/full-delegation-closure.test.ts +48 -0
- package/tests/gentle-agents.test.ts +848 -8
- package/tests/gentle-ai-binary.test.ts +1 -1
- package/tests/gentle-ai-child-guards.test.ts +1 -0
- package/tests/gentle-ai-installer.test.ts +52 -51
- package/tests/gentle-ai-renderer.test.ts +36 -2
- package/tests/gentle-ai.test.ts +195 -21
- package/tests/gentle-design.test.ts +365 -1
- package/tests/gentle-fast.test.ts +15 -0
- package/tests/gentle-herdr-desktop-status.test.ts +595 -0
- package/tests/gentle-shell-bundled.test.ts +91 -5
- package/tests/gentle-shell-desktop-bin.test.ts +125 -0
- package/tests/gentle-shell-desktop.test.ts +927 -0
- package/tests/gentle-shell-launcher-tower.test.ts +104 -0
- package/tests/gentle-shell-launcher.test.ts +1 -1
- package/tests/gentle-shell.test.ts +121 -87
- package/tests/gentle-todo.test.ts +32 -9
- package/tests/gentle-tower.test.ts +578 -0
- package/tests/herdr-desktop-status.test.ts +285 -0
- package/tests/hidden-tools.test.ts +188 -0
- package/tests/independent-recovery-delivery.test.ts +35 -9
- package/tests/inprocess-reviewer.test.ts +73 -0
- package/tests/install-wizard.test.ts +27 -1
- package/tests/installer-downloads.test.ts +30 -1
- package/tests/installer-posix-bootstrap.test.ts +114 -13
- package/tests/installer-preflight.test.ts +49 -1
- package/tests/installer-probes.test.ts +146 -0
- package/tests/installer-server.test.ts +203 -4
- package/tests/installer-windows-bootstrap.test.ts +19 -1
- package/tests/judgment-day-severity-admission.test.ts +46 -0
- package/tests/lazy-module-contradictions-contract.test.ts +181 -0
- package/tests/maintainer/desktop-rpc.maintest.ts +907 -0
- package/tests/maintainer/pi-update-source.maintest.ts +48 -18
- package/tests/model-fallback-policy.test.ts +26 -7
- package/tests/nan-provider-runtime.test.ts +17 -3
- package/tests/nan-provider.test.ts +111 -56
- package/tests/native-review-capability-contract.test.ts +19 -1
- package/tests/native-review-cli-nonblocking-findings.test.ts +165 -0
- package/tests/native-review-parity.test.ts +24 -5
- package/tests/native-review-refusal-identity.test.ts +25 -0
- package/tests/no-self-pause-contract.test.ts +33 -15
- package/tests/odd-integration.test.ts +11 -3
- package/tests/odd-routing-canonical-ratchet.test.ts +10 -0
- package/tests/odd-routing-contract.test.ts +99 -31
- package/tests/orchestrator-budget.test.ts +32 -5
- package/tests/orchestrator-consultation-sdk.test.ts +32 -6
- package/tests/orchestrator-delegation-mode.test.ts +2 -1
- package/tests/orchestrator-discovery.test.ts +28 -0
- package/tests/orchestrator-prompt-budget.test.ts +12 -2
- package/tests/orchestrator-prompt-diet-contract.test.ts +249 -0
- package/tests/orchestrator-rdd-ownership.test.ts +2 -1
- package/tests/orchestrator-work-search.test.ts +4 -2
- package/tests/package-files.test.ts +25 -1
- package/tests/package-manifest.test.ts +15 -14
- package/tests/parallel-reason-contract.test.ts +6 -3
- package/tests/permission-allowlist.test.ts +200 -30
- package/tests/persona-neutral-voseo.test.ts +4 -4
- package/tests/persona-reply-language.test.ts +1 -1
- package/tests/persona-single-channel.test.ts +13 -5
- package/tests/pi-routing-measured-values.test.ts +24 -0
- package/tests/pi-update-launcher.test.ts +17 -7
- package/tests/pi-update-source.test.ts +113 -6
- package/tests/pi-update.test.ts +294 -19
- package/tests/pnpm-workspace-policy.test.ts +47 -0
- package/tests/primary-context-files.test.ts +233 -0
- package/tests/primary-context-three-files.test.ts +174 -0
- package/tests/primary-session-prompt.test.ts +25 -0
- package/tests/profile-fast-tier.test.ts +66 -1
- package/tests/provider-defect-handoff.test.ts +124 -99
- package/tests/rdd-aware-verification-contract.test.ts +1 -1
- package/tests/rdd-status-line.test.ts +94 -1
- package/tests/reply-language-anchor-placement.test.ts +184 -0
- package/tests/reply-language-anchor.test.ts +17 -1
- package/tests/request-context-append-only.test.ts +218 -0
- package/tests/request-context-placement.test.ts +148 -0
- package/tests/review-agent-end-preflight.test.ts +79 -1
- package/tests/review-candidate-view.test.ts +65 -0
- package/tests/review-continuation-registry.test.ts +31 -0
- package/tests/review-contract-prompt.test.ts +2 -1
- package/tests/review-controller.test.ts +2 -1
- package/tests/review-coordinator-correction-gate.test.ts +105 -0
- package/tests/review-coordinator-findings.test.ts +206 -0
- package/tests/review-coordinator-nonblocking-scope.test.ts +169 -0
- package/tests/review-coordinator.test.ts +271 -4
- package/tests/review-delivery-preflight.test.ts +462 -0
- package/tests/review-due-compaction.test.ts +31 -0
- package/tests/review-due-public-boundary.test.ts +27 -0
- package/tests/review-integration-nonblocking-findings.test.ts +108 -0
- package/tests/review-json-arguments.test.ts +41 -2
- package/tests/review-ledger-contract.test.ts +19 -40
- package/tests/review-loadout-rdd-off-sdk.test.ts +30 -1
- package/tests/review-one-call-findings.test.ts +131 -0
- package/tests/review-one-call-followups.test.ts +308 -0
- package/tests/review-one-call-reviewer-requests.test.ts +207 -0
- package/tests/review-one-call.test.ts +452 -0
- package/tests/review-relay-transport-agent.test.ts +28 -1
- package/tests/review-reviewer-evidence.test.ts +41 -1
- package/tests/review-risk-assessment.test.ts +52 -5
- package/tests/review-run-statement-guidance-independent.test.ts +54 -0
- package/tests/review-session-standing-permission-controller.test.ts +32 -2
- package/tests/review-tool-prose-budget.test.ts +1 -0
- package/tests/reviewer-stream.test.ts +149 -0
- package/tests/sensitive-path-tools.test.ts +138 -4
- package/tests/session-profile-extension.test.ts +312 -18
- package/tests/session-profile-freeze.test.ts +26 -0
- package/tests/session-profile-v1-compat.test.ts +20 -0
- package/tests/shell-prompt.test.ts +17 -0
- package/tests/shell-usage.test.ts +59 -10
- package/tests/skill-collision-prefixes.test.ts +1 -0
- package/tests/skill-contradictions-contract.test.ts +124 -0
- package/tests/skill-registry-watcher.test.ts +216 -2
- package/tests/skill-registry.test.ts +983 -306
- package/tests/stats-collector.test.ts +109 -2
- package/tests/support/design-canvas-dom.ts +386 -0
- package/tests/support/review-coordinator-runtime.ts +212 -17
- package/tests/task-size-routing-contract.test.ts +49 -14
- package/tests/test-strength-contract.test.ts +2 -1
- package/tests/todo-request-append-only.test.ts +214 -0
- package/tests/tool-batching-contract.test.ts +3 -1
- package/tests/tower-actions.test.ts +247 -0
- package/tests/tower-artifacts.test.ts +114 -0
- package/tests/tower-open.test.ts +97 -0
- package/tests/tower-presence.test.ts +175 -0
- package/tests/tower-server.test.ts +122 -0
- package/tests/tower-snapshot.test.ts +236 -0
- package/tests/tower-web-echo.test.ts +125 -0
- package/tests/tower-web-hover.test.ts +251 -0
- package/tests/update-agent-body-history.test.ts +138 -0
- package/tests/verification-scoped-stop-contract.test.ts +32 -0
- package/tests/verification-tiers-contract.test.ts +229 -0
- package/tests/verifier-preparation.test.ts +229 -0
- package/tests/verifier-settle-reminder.test.ts +2 -2
- package/tests/verify-agent-contract.test.ts +20 -2
- package/tests/verify-first-launch-contract.test.ts +88 -12
- package/tests/vim-editor-adapter.test.ts +2 -2
- package/tests/work-continuity-contract.test.ts +136 -27
- package/tests/writer-admission-messages.test.ts +232 -0
- package/tests/writer-batch-admission.test.ts +66 -0
- package/tests/writer-edit-surface-scope.test.ts +52 -20
- package/tests/writer-feature-document-admission.test.ts +184 -0
- package/tests/writer-rejection-next-step.test.ts +55 -0
- package/tests/writer-surface-authority-contract.test.ts +158 -0
- package/tests/yolo-mode.test.ts +39 -0
- package/skills/_shared/review-ledger-contract.md +0 -106
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/README.md +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/schemas/lens.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/schemas/refuter.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/schemas/targeted-validator.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/vectors/lens.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/vectors/refuter.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.6.0}/bundle/vectors/targeted-validator.json +0 -0
|
@@ -5,8 +5,10 @@ import test from "node:test";
|
|
|
5
5
|
import type { Api, AssistantMessage, Context, Model, SimpleStreamOptions } from "@earendil-works/pi-ai";
|
|
6
6
|
import type { completeSimple } from "@earendil-works/pi-ai/compat";
|
|
7
7
|
import {
|
|
8
|
+
INPROCESS_REVIEWER_EMPTY_OUTPUT_CAUSE,
|
|
8
9
|
INPROCESS_REVIEWER_FAILURE,
|
|
9
10
|
INPROCESS_REVIEWER_OUTPUT_MAX_BYTES,
|
|
11
|
+
classifyEmptyOutput,
|
|
10
12
|
runInProcessReviewer,
|
|
11
13
|
openCodeSessionAttributionHeaders,
|
|
12
14
|
type InProcessReviewerOutcome,
|
|
@@ -239,6 +241,7 @@ test("refuses empty assistant text with safe completion evidence", async () => {
|
|
|
239
241
|
assert.deepEqual(withoutRunTiming(refused.evidence), {
|
|
240
242
|
phase: "completion", provider: "openai",
|
|
241
243
|
reviewerModel: "openai/gpt-5", stopReason: "stop",
|
|
244
|
+
cause: INPROCESS_REVIEWER_EMPTY_OUTPUT_CAUSE.EMPTY_COMPLETION,
|
|
242
245
|
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0 },
|
|
243
246
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
244
247
|
content: { blocks: 0, textBlocks: 0, thinkingBlocks: 0, textChars: 0, thinkingChars: 0 },
|
|
@@ -261,6 +264,7 @@ test("empty-output diagnostics allowlist facts, not provider secrets, and comple
|
|
|
261
264
|
assert.deepEqual(withoutRunTiming(refused.evidence), {
|
|
262
265
|
phase: "completion", provider: "nan",
|
|
263
266
|
reviewerModel: "nan/deepseek-v4-flash", stopReason: "length",
|
|
267
|
+
cause: INPROCESS_REVIEWER_EMPTY_OUTPUT_CAUSE.REASONING_EXHAUSTED_OUTPUT_BUDGET,
|
|
264
268
|
usage: { input: 12, output: 64, reasoning: 64, cacheRead: 0, cacheWrite: 0, totalTokens: 76 },
|
|
265
269
|
content: { blocks: 2, textBlocks: 1, thinkingBlocks: 1, textChars: 0, thinkingChars: 16 },
|
|
266
270
|
});
|
|
@@ -295,6 +299,75 @@ test("empty-output evidence does not invent usage or missing thinking lengths",
|
|
|
295
299
|
assert.deepEqual(refused.evidence?.content, { blocks: 1, textBlocks: 0, thinkingBlocks: 1, textChars: 0 });
|
|
296
300
|
});
|
|
297
301
|
|
|
302
|
+
// gentle-ai#6095: an empty completion is attributed to whatever the completion
|
|
303
|
+
// itself proves — the model's spent output budget, or a provider response with
|
|
304
|
+
// no completion at all — instead of the generic "produced no text", which left
|
|
305
|
+
// the recorded facts uninterpreted. None of these refusals infers a candidate
|
|
306
|
+
// issue: a generation failure is a transport outcome, not a review finding.
|
|
307
|
+
|
|
308
|
+
test("attributes an empty verdict to a reviewer model that spent its output budget on reasoning", async () => {
|
|
309
|
+
const model = fakeModel({ provider: "nan", id: "glm5.3", maxTokens: 16_384 });
|
|
310
|
+
const assistant = assistantText("", {
|
|
311
|
+
content: [{ type: "thinking", thinking: "x".repeat(74_755), thinkingSignature: "PRIVATE SIGNATURE" }],
|
|
312
|
+
stopReason: "length", errorMessage: "PRIVATE ERROR",
|
|
313
|
+
usage: { input: 901, output: 16_384, reasoning: 16_384, cacheRead: 0, cacheWrite: 0, totalTokens: 17_285 } as never,
|
|
314
|
+
});
|
|
315
|
+
const refused = expectRefused(await runInProcessReviewer(baseRequest(), {
|
|
316
|
+
registry: { ...fakeRegistry([model]), find: () => model }, complete: async () => assistant,
|
|
317
|
+
}));
|
|
318
|
+
assert.equal(refused.code, INPROCESS_REVIEWER_FAILURE.EMPTY_OUTPUT);
|
|
319
|
+
assert.equal(refused.evidence?.cause, INPROCESS_REVIEWER_EMPTY_OUTPUT_CAUSE.REASONING_EXHAUSTED_OUTPUT_BUDGET);
|
|
320
|
+
assert.match(refused.message, /^Reviewer model nan\/glm5\.3 exhausted its 16384-token output budget on reasoning before emitting a verdict for review-risk \(stopReason: length; output: 16384; reasoning: 16384\)\./);
|
|
321
|
+
assert.match(refused.message, /Route this lens to a reviewer model with a sufficient output ceiling, raise the output budget, or reduce reasoning\./);
|
|
322
|
+
assert.match(refused.message, /No candidate issue is inferred from this generation failure\./);
|
|
323
|
+
// The facts that make the attribution checkable stay in the record.
|
|
324
|
+
assert.equal(refused.evidence?.reviewerModel, "nan/glm5.3");
|
|
325
|
+
assert.equal(refused.evidence?.stopReason, "length");
|
|
326
|
+
assert.deepEqual(refused.evidence?.usage, { input: 901, output: 16_384, reasoning: 16_384, cacheRead: 0, cacheWrite: 0, totalTokens: 17_285 });
|
|
327
|
+
assert.equal((refused.evidence?.content as Record<string, number>).textBlocks, 0);
|
|
328
|
+
assert.doesNotMatch(JSON.stringify(refused), /PRIVATE|Signature|errorMessage/);
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
test("attributes an empty completion with zero output tokens to the provider response", async () => {
|
|
332
|
+
const model = fakeModel({ provider: "nan", id: "glm5.3" });
|
|
333
|
+
const assistant = assistantText("", {
|
|
334
|
+
content: [], stopReason: "stop",
|
|
335
|
+
usage: { input: 901, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 901 } as never,
|
|
336
|
+
});
|
|
337
|
+
const refused = expectRefused(await runInProcessReviewer(baseRequest(), {
|
|
338
|
+
registry: { ...fakeRegistry([model]), find: () => model }, complete: async () => assistant,
|
|
339
|
+
}));
|
|
340
|
+
assert.equal(refused.code, INPROCESS_REVIEWER_FAILURE.EMPTY_OUTPUT);
|
|
341
|
+
assert.equal(refused.evidence?.cause, INPROCESS_REVIEWER_EMPTY_OUTPUT_CAUSE.EMPTY_COMPLETION);
|
|
342
|
+
assert.equal(
|
|
343
|
+
refused.message,
|
|
344
|
+
"The provider returned no completion for review-risk from reviewer model nan/glm5.3 (stopReason: stop; output: 0). Retry the slot. No candidate issue is inferred from this generation failure.",
|
|
345
|
+
);
|
|
346
|
+
assert.equal(refused.evidence?.reviewerModel, "nan/glm5.3");
|
|
347
|
+
assert.equal(refused.evidence?.stopReason, "stop");
|
|
348
|
+
assert.deepEqual(refused.evidence?.usage, { input: 901, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 901 });
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
test("keeps the generic empty-output refusal for shapes it cannot attribute", async () => {
|
|
352
|
+
const unattributed: Array<{ name: string; assistant: AssistantMessage }> = [
|
|
353
|
+
{ name: "length with no reasoning reported", assistant: assistantText("", { content: [], stopReason: "length", usage: { input: 5, output: 64, cacheRead: 0, cacheWrite: 0, totalTokens: 69 } as never }) },
|
|
354
|
+
{ name: "length with zero output tokens", assistant: assistantText("", { content: [], stopReason: "length", usage: { input: 5, output: 0, reasoning: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 5 } as never }) },
|
|
355
|
+
{ name: "stop with no usage reported", assistant: assistantText("", { content: [], stopReason: "stop", usage: undefined }) },
|
|
356
|
+
{ name: "partial reasoning below the budget", assistant: assistantText("", { content: [], stopReason: "length", usage: { input: 5, output: 64, reasoning: 63, cacheRead: 0, cacheWrite: 0, totalTokens: 69 } as never }) },
|
|
357
|
+
{ name: "unrecognized stop reason", assistant: assistantText("", { content: [], stopReason: "deferred" }) },
|
|
358
|
+
];
|
|
359
|
+
for (const { name, assistant } of unattributed) {
|
|
360
|
+
const refused = expectRefused(await runInProcessReviewer(baseRequest(), {
|
|
361
|
+
registry: fakeRegistry([fakeModel()]), complete: async () => assistant,
|
|
362
|
+
}));
|
|
363
|
+
assert.equal(refused.code, INPROCESS_REVIEWER_FAILURE.EMPTY_OUTPUT, name);
|
|
364
|
+
assert.ok(!Object.hasOwn(refused.evidence!, "cause"), name);
|
|
365
|
+
assert.match(refused.message, /^Reviewer produced no text for review-risk \(stopReason: /, name);
|
|
366
|
+
assert.doesNotMatch(refused.message, /No candidate issue is inferred/, name);
|
|
367
|
+
assert.equal(classifyEmptyOutput(assistant), undefined, name);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
|
|
298
371
|
test("refuses with PROVIDER_FAILED when the provider itself reports an aborted completion", async () => {
|
|
299
372
|
const assistant = assistantText("", { content: [], stopReason: "aborted", errorMessage: "provider aborted mid-turn" });
|
|
300
373
|
const outcome = await runInProcessReviewer(baseRequest(), {
|
|
@@ -366,6 +366,30 @@ test("planModel discloses the PATH change and runtime persistence before consent
|
|
|
366
366
|
[[false, true], [false, true]]);
|
|
367
367
|
});
|
|
368
368
|
|
|
369
|
+
test("the consent screen does not promise no replacements for a pnpm-managed Node", async () => {
|
|
370
|
+
for (const pi of [{ available: false }, { available: true, version: "0.99.0", usable: true, owner: "pnpm" }]) {
|
|
371
|
+
const view = await serverPlanView({ node: { available: true, version: "24.21.0", usable: true, persistent: false, npm: false,
|
|
372
|
+
found: "23.5.9", foundInGlobalBin: true }, pi });
|
|
373
|
+
const screen = wizard.renderPlan(new FakeDocument(), wizard.planModel(view), { install() {}, reload() {}, close() {} });
|
|
374
|
+
assert.match(screen.textContent, /Node\.js 23\.5\.9 is managed by pnpm under \$PNPM_HOME and will be replaced by the pinned Node\.js 24\.21\.0/);
|
|
375
|
+
assert.doesNotMatch(screen.textContent, /left unchanged|Existing installations are not replaced/);
|
|
376
|
+
}
|
|
377
|
+
const plain = wizard.renderPlan(new FakeDocument(), wizard.planModel(await serverPlanView()), { install() {}, reload() {}, close() {} });
|
|
378
|
+
assert.match(plain.textContent, /The installer runs only the steps listed above\. Existing installations are not replaced\./);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
test("the consent screen distinguishes an unchanged PATH Node from the destination Node being replaced", async () => {
|
|
382
|
+
for (const pi of [{ available: false }, { available: true, version: "0.99.0", usable: true, owner: "pnpm" }]) {
|
|
383
|
+
const view = await serverPlanView({ node: { available: true, version: "24.21.0", usable: true, persistent: false, npm: false,
|
|
384
|
+
found: "23.5.9", globalBinNode: true }, pi });
|
|
385
|
+
const screen = wizard.renderPlan(new FakeDocument(), wizard.planModel(view), { install() {}, reload() {}, close() {} });
|
|
386
|
+
assert.doesNotMatch(screen.textContent, /Existing installations are not replaced/);
|
|
387
|
+
assert.match(screen.textContent, /Your Node\.js 23\.5\.9 found first on PATH is left unchanged\./);
|
|
388
|
+
assert.match(screen.textContent, /The Node\.js already in \$PNPM_HOME will be replaced by the pinned Node\.js 24\.21\.0\./);
|
|
389
|
+
assert.match(screen.textContent, /The installer runs only the steps listed above\./);
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
|
|
369
393
|
// A missing Git is noted on the review screen, never as a blocker: the plan stays installable.
|
|
370
394
|
test("the review screen notes a missing Git and stays installable", async () => {
|
|
371
395
|
const model = wizard.planModel(await serverPlanView({ git: { available: false } }));
|
|
@@ -422,7 +446,9 @@ test("planModel turns preflight blockers into guidance and offers no install", a
|
|
|
422
446
|
assert.equal(model.kind, "blocked");
|
|
423
447
|
assert.equal(model.blockers.length, 1);
|
|
424
448
|
assert.equal(model.blockers[0].toolLabel, "Node.js");
|
|
425
|
-
assert.equal(model.blockers[0].guidance, "Node.js 18.0.0 is installed, but this installer needs 22.19.0 or newer. Nothing was replaced. Update it, then select Check again.");
|
|
449
|
+
assert.equal(model.blockers[0].guidance, "Node.js 18.0.0 is installed, but this installer needs 22.19.0 or a later 22.x release, or 23.6.0 or newer. Nothing was replaced. Update it, then select Check again.");
|
|
450
|
+
const node23 = wizard.planModel(await serverPlanView({ node: { available: true, version: "23.3.0", usable: true, persistent: true, npm: true } }));
|
|
451
|
+
assert.equal(node23.blockers[0].guidance, "Node.js 23.3.0 is installed, but this installer needs 22.19.0 or a later 22.x release, or 23.6.0 or newer. Nothing was replaced. Update it, then select Check again.");
|
|
426
452
|
for (const code of Object.keys(guidance.blockers)) {
|
|
427
453
|
const rendered = wizard.planModel({ planId: "p", ready: false, actions: [], blockers: [{ code, tool: "pnpm", guidance: guidance.blockers[code] }],
|
|
428
454
|
profileChange: { changesProfile: false, binDir: null, description: "x" }, persistence: { tools: [], pnpmHome: null, description: "y" } });
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import { artifactFor, uvPinVersion } from "../scripts/installer-downloads.mjs";
|
|
3
|
+
import { artifactFor, engramPinVersion, uvPinVersion } from "../scripts/installer-downloads.mjs";
|
|
4
|
+
|
|
5
|
+
// The Engram core the bundled install ships (S9), from its checksums.txt and
|
|
6
|
+
// the published asset digests; every archive was downloaded and re-hashed.
|
|
7
|
+
const engramPins = {
|
|
8
|
+
"darwin-arm64": ["darwin_arm64.tar.gz", "f96e08db8f47ca49ebc034eba30e468db81eb56df98f9bf21a73366b510695e4", 8001813],
|
|
9
|
+
"darwin-x64": ["darwin_amd64.tar.gz", "d35623443a5d85e8f78338cda5d0bb73b2f7ec6217a57e4abb71904a3e0d6287", 8488340],
|
|
10
|
+
"linux-x64": ["linux_amd64.tar.gz", "8db9d5db1c1574b8b830aac4ffbe86c024014aed6b9a3f0406ac3361a152cdf0", 8365851],
|
|
11
|
+
"linux-arm64": ["linux_arm64.tar.gz", "cdbbcb68d3e842d3e52e27edccef55e6fe98ce3cdbc90cd79894323b029efb50", 7712574],
|
|
12
|
+
"win32-x64": ["windows_amd64.zip", "515a716ce966202058d4b9f310626fde72583cfc64ccefbf0dcc81456260089c", 8582764],
|
|
13
|
+
"win32-arm64": ["windows_arm64.zip", "01e4f5dab2f941cf810d1373e7c6998c014499bee9c2d5783e34da94c70ac7f2", 7780232],
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
test("fixed Engram descriptors are the published 3.7.2 core archives and checksums, and nothing else", () => {
|
|
17
|
+
assert.equal(engramPinVersion, "3.7.2");
|
|
18
|
+
for (const [target, [suffix, sha256, size]] of Object.entries(engramPins)) {
|
|
19
|
+
const [platform, arch] = target.split("-");
|
|
20
|
+
const artifact = artifactFor("engram", platform, arch);
|
|
21
|
+
assert.equal(artifact.name, "engram");
|
|
22
|
+
assert.equal(artifact.version, "3.7.2");
|
|
23
|
+
assert.equal(artifact.url, `https://github.com/Gentleman-Programming/engram/releases/download/v3.7.2/engram_3.7.2_${suffix}`);
|
|
24
|
+
assert.equal(artifact.integrity, `sha256-${sha256}`);
|
|
25
|
+
assert.deepEqual([artifact.size, artifact.maxBytes], [size, size]);
|
|
26
|
+
assert.deepEqual(artifact.redirectHosts, ["objects.githubusercontent.com", "release-assets.githubusercontent.com"]);
|
|
27
|
+
assert.ok(Object.isFrozen(artifact));
|
|
28
|
+
}
|
|
29
|
+
for (const [platform, arch] of [["linux", "ia32"], ["freebsd", "x64"], ["win32", "ia32"], ["darwin", "ppc64"]]) {
|
|
30
|
+
assert.throws(() => artifactFor("engram", platform, arch), /Unsupported/);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
4
33
|
|
|
5
34
|
// The uv the /gentle:music offer installs inside a bundled prefix (S5): the
|
|
6
35
|
// astral-sh/uv release archives, each re-hashed after download before pinning.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, existsSync, symlinkSync, readdirSync, rmSync, lstatSync, unlinkSync, realpathSync } from "node:fs";
|
|
2
|
+
import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, existsSync, symlinkSync, readlinkSync, readdirSync, rmSync, lstatSync, unlinkSync, realpathSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
import { spawn, spawnSync } from "node:child_process";
|
|
@@ -9,7 +9,7 @@ import test, { type TestContext } from "node:test";
|
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import { syncBuiltinESMExports } from "node:module";
|
|
11
11
|
import { crc32, deflateRawSync, gzipSync } from "node:zlib";
|
|
12
|
-
import { artifactFor, verifiedDownload, compatibleEngine, ensurePnpm, launchWizard, bootstrap, removeOwnedTools, acquireGo, installedGo } from "../scripts/installer-downloads.mjs";
|
|
12
|
+
import { artifactFor, verifiedDownload, compatibleEngine, nodeRequirementSatisfied, ensurePnpm, launchWizard, bootstrap, removeOwnedTools, acquireGo, installedGo } from "../scripts/installer-downloads.mjs";
|
|
13
13
|
|
|
14
14
|
const script = resolve("scripts/bootstrap.sh");
|
|
15
15
|
const helper = resolve("scripts/installer-downloads.mjs");
|
|
@@ -17,8 +17,9 @@ const node = process.execPath;
|
|
|
17
17
|
// Shell and private-tools fixtures need POSIX sh, stock utilities and uids.
|
|
18
18
|
const posixHost = process.platform === "win32" ? "POSIX shell bootstrap fixtures need a POSIX host" : false;
|
|
19
19
|
const posixTest = (name: string, fn: (t: TestContext) => void | Promise<void>) => test(name, { skip: posixHost }, fn);
|
|
20
|
-
// macOS keeps several stock utilities only in /bin.
|
|
21
|
-
const systemUtility = (name: string) =>
|
|
20
|
+
// macOS keeps several stock utilities only in /bin. Allow an explicit awk for portability checks.
|
|
21
|
+
const systemUtility = (name: string) => name === "awk" && process.env.INSTALLER_TEST_AWK ? process.env.INSTALLER_TEST_AWK
|
|
22
|
+
: ["/usr/bin", "/bin"].map((dir) => join(dir, name)).find((path) => existsSync(path)) ?? `/usr/bin/${name}`;
|
|
22
23
|
function fixture() {
|
|
23
24
|
// The bootstrap refuses symlinked HOME ancestors, such as macOS /var -> /private/var.
|
|
24
25
|
const root = mkdtempSync(join(realpathSync(tmpdir()), "bootstrap space ü-"));
|
|
@@ -28,7 +29,7 @@ function fixture() {
|
|
|
28
29
|
for (const dir of [bin, home, join(bundle, "scripts"), join(bundle, "bin")]) mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
29
30
|
writeFileSync(join(bundle, "scripts/bootstrap.sh"), readFileSync(script));
|
|
30
31
|
writeFileSync(join(bundle, "scripts/installer-downloads.mjs"), readFileSync(helper));
|
|
31
|
-
writeFileSync(join(bundle, "package.json"), JSON.stringify({ engines: { node: "
|
|
32
|
+
writeFileSync(join(bundle, "package.json"), JSON.stringify({ engines: { node: "^22.19.0 || >=23.6.0" }, packageManager: "pnpm@11.1.1" }));
|
|
32
33
|
for (const name of ["dirname", "pwd", "awk", "mkdir", "mktemp", "chmod", "mv", "rm", "sleep", "wc", "cat", "id", "ls"])
|
|
33
34
|
symlinkSync(systemUtility(name), join(bin, name));
|
|
34
35
|
const executable = (name: string, body: string) => {
|
|
@@ -83,6 +84,13 @@ test("engine evidence supports stable lower bounds, not guessed ranges", () => {
|
|
|
83
84
|
assert.equal(compatibleEngine("*", "24.21.0"), false);
|
|
84
85
|
assert.equal(compatibleEngine(">=22.13.0", "24.0.0-rc.1"), false);
|
|
85
86
|
});
|
|
87
|
+
test("the repository Node requirement accepts 22.19 or a later 22.x, or 23.6 and newer", () => {
|
|
88
|
+
const range = "^22.19.0 || >=23.6.0";
|
|
89
|
+
for (const version of ["22.19.0", "22.99.99", "23.6.0", "24.22.2", "25.0.0", "v24.21.0"]) assert.equal(nodeRequirementSatisfied(range, version), true, version);
|
|
90
|
+
for (const version of ["21.99.99", "22.18.9", "23.0.0", "23.5.9", "24.0.0-rc.1", "banana"]) assert.equal(nodeRequirementSatisfied(range, version), false, version);
|
|
91
|
+
assert.equal(nodeRequirementSatisfied(">=22.19.0", "23.0.0"), true);
|
|
92
|
+
for (const bad of ["*", "", "^22.19", ">=22.19.0 <25.0.0", "^0.1.0", "^22.19.0 ||", "~22.19.0", undefined]) assert.equal(nodeRequirementSatisfied(bad, "24.22.2"), false, String(bad));
|
|
93
|
+
});
|
|
86
94
|
test("pnpm descriptor preserves the literal upstream Node engine", () => {
|
|
87
95
|
assert.equal(artifactFor("pnpm").engine, ">=22.13");
|
|
88
96
|
});
|
|
@@ -161,6 +169,83 @@ test("download helper validates bytes before returning them", async () => {
|
|
|
161
169
|
assert.notEqual(createHash("sha512").update(bytes).digest("base64"), artifactFor("pnpm").integrity.slice(7));
|
|
162
170
|
});
|
|
163
171
|
|
|
172
|
+
for (const version of ["23.5.9", "24.21.0"]) {
|
|
173
|
+
posixTest(`malformed repository Node ranges fail before acquisition with Node ${version}`, () => {
|
|
174
|
+
const invalid = ["^0.1.0 || >=23.6.0", ">=23.6.0 || ^0.1.0", "^00.1.0 || >=23.6.0",
|
|
175
|
+
"^22.019.0 || >=23.6.0", "^22.19.00 || >=23.6.0", "^22.19.0 || >=023.6.0",
|
|
176
|
+
"^22.19.0 || >=9007199254740992.0.0", ">=23.6.0 || >=1.9007199254740992.0",
|
|
177
|
+
">=23.6.0 || >=1.0.9007199254740992", "^22.19.0 ||", ">=23.6.0 || ~22.0.0"];
|
|
178
|
+
for (const range of invalid) {
|
|
179
|
+
assert.equal(nodeRequirementSatisfied(range, version), false, range);
|
|
180
|
+
const f = fixture();
|
|
181
|
+
try {
|
|
182
|
+
f.addPnpm(); f.wizard();
|
|
183
|
+
writeFileSync(join(f.bundle, "package.json"), JSON.stringify({ engines: { node: range }, packageManager: "pnpm@11.1.1" }));
|
|
184
|
+
const ownNode = `#!/bin/sh\nprintf x >> "$NODE_PROBE_COUNT"\nprintf '%s\\n' 'v${version}'\n`;
|
|
185
|
+
writeFileSync(join(f.bin, "node"), ownNode, { mode: 0o755 });
|
|
186
|
+
f.executable("curl", 'printf x >> "$DOWNLOAD_COUNT"; exit 1');
|
|
187
|
+
const before = readdirSync(f.root).sort();
|
|
188
|
+
const result = f.run({ NODE_PROBE_COUNT: join(f.root, "node-count"), DOWNLOAD_COUNT: join(f.root, "download-count") });
|
|
189
|
+
assert.equal(result.status, 1, range);
|
|
190
|
+
assert.equal(result.stdout, "", range);
|
|
191
|
+
assert.equal(result.stderr, "Bootstrap: Cannot establish repository Node requirement\n", range);
|
|
192
|
+
assert.deepEqual(readdirSync(f.root).sort(), before, `${range}: no probes, downloads, or files`);
|
|
193
|
+
assert.deepEqual(readdirSync(f.home), [], range);
|
|
194
|
+
assert.equal(readFileSync(join(f.bin, "node"), "utf8"), ownNode, range);
|
|
195
|
+
} finally { f.cleanup(); }
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
posixTest("noncanonical whitespace and JSON escapes remain rejected before probing or download", () => {
|
|
201
|
+
const cases = [
|
|
202
|
+
{ range: " ^22.19.0 || >=23.6.0 " },
|
|
203
|
+
{ range: "\t^22.19.0\n||\r>=23.6.0\u00a0" },
|
|
204
|
+
{ range: "^22.19.0 || >=23.6.0", json: '"\\u005e22.19.0 || >=23.6.0"' },
|
|
205
|
+
{ range: "^22.19.0\u00a0||\u00a0>=23.6.0" },
|
|
206
|
+
];
|
|
207
|
+
for (const { range, json = JSON.stringify(range) } of cases) {
|
|
208
|
+
assert.equal(nodeRequirementSatisfied(range, "24.21.0"), true, JSON.stringify(range));
|
|
209
|
+
const f = fixture();
|
|
210
|
+
try {
|
|
211
|
+
f.addPnpm(); f.wizard();
|
|
212
|
+
writeFileSync(join(f.bundle, "package.json"), `{"engines":{"node":${json}},"packageManager":"pnpm@11.1.1"}`);
|
|
213
|
+
f.executable("node", 'printf x >> "$NODE_PROBE_COUNT"; printf "v24.21.0\\n"');
|
|
214
|
+
f.executable("curl", 'printf x >> "$DOWNLOAD_COUNT"; exit 1');
|
|
215
|
+
const snapshot = () => readdirSync(f.root, { recursive: true }).sort().map((name) => {
|
|
216
|
+
const path = join(f.root, name);
|
|
217
|
+
const info = lstatSync(path);
|
|
218
|
+
return [name, info.isFile() ? readFileSync(path, "utf8") : info.isSymbolicLink() ? readlinkSync(path) : null];
|
|
219
|
+
});
|
|
220
|
+
const before = snapshot();
|
|
221
|
+
const result = f.run({ NODE_PROBE_COUNT: join(f.root, "node-count"), DOWNLOAD_COUNT: join(f.root, "download-count") });
|
|
222
|
+
assert.equal(result.status, 1, json);
|
|
223
|
+
assert.equal(result.stdout, "", json);
|
|
224
|
+
assert.equal(result.stderr, "Bootstrap: Cannot establish repository Node requirement\n", json);
|
|
225
|
+
assert.equal(existsSync(join(f.root, "node-count")), false, json);
|
|
226
|
+
assert.equal(existsSync(join(f.root, "download-count")), false, json);
|
|
227
|
+
assert.deepEqual(snapshot(), before, `${json}: no files written`);
|
|
228
|
+
} finally { f.cleanup(); }
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
posixTest("valid canonical ranges, including safe integer floors, still start the wizard", () => {
|
|
233
|
+
for (const range of [">=0.0.0", "^1.0.0 || >=23.6.0", ">=23.6.0 || ^9007199254740991.0.0",
|
|
234
|
+
"^22.19.0 || >=23.6.0"]) {
|
|
235
|
+
assert.equal(nodeRequirementSatisfied(range, "24.21.0"), true, range);
|
|
236
|
+
const f = fixture();
|
|
237
|
+
try {
|
|
238
|
+
f.addNode(); f.addPnpm(); f.wizard();
|
|
239
|
+
writeFileSync(join(f.bundle, "package.json"), JSON.stringify({ engines: { node: range }, packageManager: "pnpm@11.1.1" }));
|
|
240
|
+
const result = f.run();
|
|
241
|
+
assert.equal(result.status, 0, `${JSON.stringify(range)}: ${result.stderr}`);
|
|
242
|
+
assert.equal(result.stderr, "", range);
|
|
243
|
+
assert.match(result.stdout, /wizard-child:/, range);
|
|
244
|
+
assert.deepEqual(readdirSync(f.home), [], range);
|
|
245
|
+
} finally { f.cleanup(); }
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
164
249
|
posixTest("compatible existing tools are reused with whitespace and Unicode paths", () => {
|
|
165
250
|
const f = fixture();
|
|
166
251
|
try {
|
|
@@ -314,6 +399,22 @@ posixTest("an older stable Node is left unchanged and a verified Node runs the h
|
|
|
314
399
|
assert.deepEqual(readdirSync(f.home), [], "successful wizard exit removes the owned tools");
|
|
315
400
|
} finally { f.cleanup(); }
|
|
316
401
|
});
|
|
402
|
+
for (const [version, reused] of [["v22.19.0", true], ["v23.6.0", true], ["v23.0.0", false], ["v23.5.9", false]] as const) {
|
|
403
|
+
posixTest(`existing Node ${version} is ${reused ? "reused" : "left unchanged while a verified Node runs the wizard"}`, () => {
|
|
404
|
+
const f = fixture();
|
|
405
|
+
try {
|
|
406
|
+
f.addPnpm(); f.wizard();
|
|
407
|
+
const user = `#!/bin/sh\nif [ "$1" = --version ]; then echo ${version}; else ${reused ? `exec '${node}' "$@"` : "echo user-node-ran >&2; exit 9"}; fi\n`;
|
|
408
|
+
writeFileSync(join(f.bin, "node"), user, { mode: 0o755 });
|
|
409
|
+
const result = f.run();
|
|
410
|
+
assert.equal(result.status, 0, result.stderr);
|
|
411
|
+
if (reused) assert.doesNotMatch(result.stdout, /\.gentle-shell-bootstrap-tools\.[^:\n]*\/node\/bin/);
|
|
412
|
+
else assert.match(result.stdout, /wizard-child:[^:\n]*\.gentle-shell-bootstrap-tools\.[^:\n]*\/node\/bin:/);
|
|
413
|
+
assert.doesNotMatch(result.stderr, /user-node-ran/);
|
|
414
|
+
assert.equal(readFileSync(join(f.bin, "node"), "utf8"), user);
|
|
415
|
+
} finally { f.cleanup(); }
|
|
416
|
+
});
|
|
417
|
+
}
|
|
317
418
|
posixTest("existing pnpm with unknown engine blocks instead of acquisition", () => {
|
|
318
419
|
const f = fixture();
|
|
319
420
|
try {
|
|
@@ -994,19 +1095,19 @@ test("Go has no descriptor for other targets", () => {
|
|
|
994
1095
|
// The Engram release the bundled install ships (S9), from its checksums.txt and
|
|
995
1096
|
// the GitHub asset digests; every archive was downloaded and re-hashed.
|
|
996
1097
|
const engramPins = {
|
|
997
|
-
"darwin-arm64": ["darwin_arm64.tar.gz", "
|
|
998
|
-
"darwin-x64": ["darwin_amd64.tar.gz", "
|
|
999
|
-
"linux-x64": ["linux_amd64.tar.gz", "
|
|
1000
|
-
"linux-arm64": ["linux_arm64.tar.gz", "
|
|
1001
|
-
"win32-x64": ["windows_amd64.zip", "
|
|
1002
|
-
"win32-arm64": ["windows_arm64.zip", "
|
|
1098
|
+
"darwin-arm64": ["darwin_arm64.tar.gz", "f96e08db8f47ca49ebc034eba30e468db81eb56df98f9bf21a73366b510695e4", 8001813],
|
|
1099
|
+
"darwin-x64": ["darwin_amd64.tar.gz", "d35623443a5d85e8f78338cda5d0bb73b2f7ec6217a57e4abb71904a3e0d6287", 8488340],
|
|
1100
|
+
"linux-x64": ["linux_amd64.tar.gz", "8db9d5db1c1574b8b830aac4ffbe86c024014aed6b9a3f0406ac3361a152cdf0", 8365851],
|
|
1101
|
+
"linux-arm64": ["linux_arm64.tar.gz", "cdbbcb68d3e842d3e52e27edccef55e6fe98ce3cdbc90cd79894323b029efb50", 7712574],
|
|
1102
|
+
"win32-x64": ["windows_amd64.zip", "515a716ce966202058d4b9f310626fde72583cfc64ccefbf0dcc81456260089c", 8582764],
|
|
1103
|
+
"win32-arm64": ["windows_arm64.zip", "01e4f5dab2f941cf810d1373e7c6998c014499bee9c2d5783e34da94c70ac7f2", 7780232],
|
|
1003
1104
|
} as const;
|
|
1004
1105
|
test("fixed Engram descriptors are the GitHub release archives and checksums, and nothing else", () => {
|
|
1005
1106
|
for (const [target, [suffix, sha256, size]] of Object.entries(engramPins)) {
|
|
1006
1107
|
const [platform, arch] = target.split("-");
|
|
1007
1108
|
const artifact = artifactFor("engram", platform, arch);
|
|
1008
|
-
assert.equal(artifact.version, "3.
|
|
1009
|
-
assert.equal(artifact.url, `https://github.com/Gentleman-Programming/engram/releases/download/v3.
|
|
1109
|
+
assert.equal(artifact.version, "3.7.2");
|
|
1110
|
+
assert.equal(artifact.url, `https://github.com/Gentleman-Programming/engram/releases/download/v3.7.2/engram_3.7.2_${suffix}`);
|
|
1010
1111
|
assert.equal(artifact.integrity, `sha256-${sha256}`);
|
|
1011
1112
|
assert.deepEqual([artifact.size, artifact.maxBytes], [size, size]);
|
|
1012
1113
|
// GitHub serves release assets from its asset hosts.
|
|
@@ -25,7 +25,7 @@ const ids = (inventory: object) => planPreflight(inventory).actions.map((action:
|
|
|
25
25
|
|
|
26
26
|
test("requirements follow repository metadata and native installer pin", () => {
|
|
27
27
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
28
|
-
assert.equal(requirements.node, pkg.engines.node
|
|
28
|
+
assert.equal(requirements.node, pkg.engines.node);
|
|
29
29
|
assert.equal(requirements.pi, pkg.peerDependencies["@earendil-works/pi-coding-agent"].slice(2));
|
|
30
30
|
assert.equal(requirements.pnpm, pkg.packageManager.split("@")[1]);
|
|
31
31
|
assert.equal(requirements.shell, pkg.version);
|
|
@@ -515,6 +515,19 @@ test("a bootstrap-only Node next to a persistent pnpm persists Node and npm only
|
|
|
515
515
|
// An older Node or an incompatible pnpm on the user's PATH: the bootstrap's
|
|
516
516
|
// pinned copy runs the installer (the probe's version) and the probe reports
|
|
517
517
|
// the user's version as `found`. That copy is persisted; the user's stays.
|
|
518
|
+
test("Node follows the supported range: 22.19 or a later 22.x, or 23.6 and newer", () => {
|
|
519
|
+
for (const version of ["21.99.99", "22.18.9", "23.0.0", "23.3.0", "23.5.9"]) {
|
|
520
|
+
const plan = planPreflight({ ...installed(), node: tool(version) });
|
|
521
|
+
assert.equal(plan.tools.node.status, "incompatible", version);
|
|
522
|
+
assert.deepEqual(plan.blockers, [{ code: "incompatible-tool", tool: "node" }], version);
|
|
523
|
+
assert.deepEqual(plan.actions, [], version);
|
|
524
|
+
}
|
|
525
|
+
for (const version of ["22.19.0", "22.99.99", "23.6.0", "24.22.2", "25.0.0"]) {
|
|
526
|
+
const plan = planPreflight({ ...installed(), node: tool(version) });
|
|
527
|
+
assert.deepEqual(plan.tools.node, { status: "reusable", required: "^22.19.0 || >=23.6.0" }, version);
|
|
528
|
+
assert.deepEqual(plan.blockers, [], version);
|
|
529
|
+
}
|
|
530
|
+
});
|
|
518
531
|
const runtimeStack = (node: object, pnpm: object) => ({ ...clean(), node, pnpm,
|
|
519
532
|
globalBin: { available: true, path: "/disposable/bin", writable: true, onPath: true } });
|
|
520
533
|
const pinnedNode = (found?: string) => ({ ...tool("24.21.0"), persistent: false, npm: false, ...(found ? { found } : {}) });
|
|
@@ -529,6 +542,41 @@ test("an older Node is left as it is: the pinned Node is persisted alongside ins
|
|
|
529
542
|
assert.deepEqual(updateIds(plan), ["persist-node", "persist-npm", "configure-npm-prefix", ...rest]);
|
|
530
543
|
assert.deepEqual(updateIds(planPreflight(runtimeStack(pinnedNode("22.18.0"), pinnedPnpm()))), ["persist-node", "persist-package-managers", "configure-npm-prefix", ...rest]);
|
|
531
544
|
});
|
|
545
|
+
test("a Node 23 below 23.6 is left as it is, and a supported 22.x or 23.6 found Node is not replaced", () => {
|
|
546
|
+
for (const found of ["23.0.0", "23.5.9"]) {
|
|
547
|
+
assert.deepEqual(planPreflight(runtimeStack(pinnedNode(found), { ...pinnedPnpm(), persistent: true })).tools.node,
|
|
548
|
+
{ status: "reusable", required: requirements.node, found, version: "24.21.0" }, found);
|
|
549
|
+
}
|
|
550
|
+
for (const found of ["22.19.0", "23.6.0"]) {
|
|
551
|
+
assert.deepEqual(planPreflight(runtimeStack(pinnedNode(found), { ...pinnedPnpm(), persistent: true })).tools.node,
|
|
552
|
+
{ status: "reusable", required: requirements.node }, found);
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
test("preflight carries a different global-bin Node only when it persists Node", () => {
|
|
557
|
+
const pnpm = pinnedPnpm();
|
|
558
|
+
for (const found of ["23.5.9", undefined]) {
|
|
559
|
+
const node = { ...pinnedNode(found), globalBinNode: true };
|
|
560
|
+
const input = runtimeStack(node, pnpm);
|
|
561
|
+
const before = structuredClone(input);
|
|
562
|
+
const plan = planPreflight(input);
|
|
563
|
+
const original = planPreflight(runtimeStack(pinnedNode(found), pnpm));
|
|
564
|
+
assert.deepEqual(plan.tools.node, { ...original.tools.node, globalBinNode: true });
|
|
565
|
+
assert.deepEqual(plan.actions, original.actions);
|
|
566
|
+
assert.deepEqual(plan.blockers, original.blockers);
|
|
567
|
+
assert.deepEqual(input, before);
|
|
568
|
+
}
|
|
569
|
+
const supported = { ...tool("23.6.0"), persistent: true, npm: true, globalBinNode: true };
|
|
570
|
+
assert.deepEqual(planPreflight(runtimeStack(supported, pnpm)).tools.node, { status: "reusable", required: requirements.node });
|
|
571
|
+
// Recovery, updates and blockers do not persist Node and must not change their plans.
|
|
572
|
+
for (const inventory of [partial({ node: pinnedNode("23.5.9") }),
|
|
573
|
+
{ ...installed(), node: pinnedNode(), shell: owned("3.9.0"), gentleAi: unchecked, setup: unchecked },
|
|
574
|
+
{ ...installed(), node: pinnedNode("23.5.9"), shell: owned("3.9.0"), gentleAi: unchecked, setup: unchecked }]) {
|
|
575
|
+
const original = planPreflight(inventory);
|
|
576
|
+
assert.equal(original.actions.some((action: { id: string }) => action.id === "persist-node"), false);
|
|
577
|
+
assert.deepEqual(planPreflight({ ...inventory, node: { ...inventory.node, globalBinNode: true } }), original);
|
|
578
|
+
}
|
|
579
|
+
});
|
|
532
580
|
|
|
533
581
|
test("an incompatible pnpm is left as it is: the pinned pnpm is persisted alongside instead of blocking", () => {
|
|
534
582
|
for (const found of ["10.27.0", "12.0.0", "11.0.0"]) {
|
|
@@ -202,6 +202,7 @@ test("an older Node on the user's PATH is left as it is: the bootstrap's Node is
|
|
|
202
202
|
assert.equal(node.version, "24.21.0");
|
|
203
203
|
assert.equal(node.persistent, false);
|
|
204
204
|
assert.equal(node.found, "22.18.0");
|
|
205
|
+
assert.equal(node.foundInGlobalBin, undefined);
|
|
205
206
|
// A current user Node is reused as before, and an older one without a bootstrap copy is reported as it is.
|
|
206
207
|
const current = probes({ files: [...userNode.files, ...bootstrapNode.files], realpaths: userNode.realpaths, texts: userNode.texts,
|
|
207
208
|
results: { ...userNode.results, [`${TOOLS_NODE} --version`]: { code: 0, stdout: "v24.21.0\n" } } });
|
|
@@ -214,6 +215,151 @@ test("an older Node on the user's PATH is left as it is: the bootstrap's Node is
|
|
|
214
215
|
assert.equal((await stale.probes.node()).found, undefined);
|
|
215
216
|
});
|
|
216
217
|
|
|
218
|
+
test("a user Node 23 below 23.6 is swapped for the bootstrap's Node; 22.19 and 23.6 are reused", async () => {
|
|
219
|
+
const withUser = (version: string) => probes({ files: [...userNode.files, ...bootstrapNode.files], realpaths: { ...userNode.realpaths, ...bootstrapNode.realpaths },
|
|
220
|
+
texts: { ...userNode.texts, ...bootstrapNode.texts }, results: { ...userNode.results, [`${USER_NODE} --version`]: { code: 0, stdout: `v${version}\n` },
|
|
221
|
+
[`${TOOLS_NODE} --version`]: { code: 0, stdout: "v24.21.0\n" }, [`${TOOLS_NODE} ${USER_NPM_CLI} --version`]: { code: 0, stdout: "10.9.2\n" } } });
|
|
222
|
+
for (const version of ["23.0.0", "23.5.9"]) {
|
|
223
|
+
const node = await withUser(version).probes.node();
|
|
224
|
+
assert.equal(node.version, "24.21.0", version);
|
|
225
|
+
assert.equal(node.found, version);
|
|
226
|
+
}
|
|
227
|
+
for (const version of ["22.19.0", "23.6.0"]) {
|
|
228
|
+
const node = await withUser(version).probes.node();
|
|
229
|
+
assert.equal(node.version, version);
|
|
230
|
+
assert.equal(node.persistent, true, version);
|
|
231
|
+
assert.equal(node.found, undefined, version);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test("the swapped Node records when the found executable is in pnpm's global bin on POSIX and Windows", async () => {
|
|
236
|
+
const cases = [
|
|
237
|
+
{ platform: "linux", env: { HOME, PNPM_HOME, PATH: `${TOOLS}/node/bin:${BIN}:/usr/bin` },
|
|
238
|
+
own: `${BIN}/node`, bootstrap: TOOLS_NODE },
|
|
239
|
+
{ platform: "win32", env: { LOCALAPPDATA: "C:\\Users\\u\\AppData\\Local", PNPM_HOME: "C:\\Users\\u\\pnpm",
|
|
240
|
+
Path: "C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node;c:\\users\\U\\PNPM\\bin", PATHEXT: ".EXE" },
|
|
241
|
+
own: "c:\\users\\U\\PNPM\\bin\\node.exe", bootstrap: "C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node\\node.exe" },
|
|
242
|
+
];
|
|
243
|
+
for (const { platform, env, own, bootstrap } of cases) {
|
|
244
|
+
for (const version of ["23.5.9", "22.18.0"]) {
|
|
245
|
+
const h = probes({ platform, env, files: [own, bootstrap], results: {
|
|
246
|
+
[`${own} --version`]: { code: 0, stdout: `v${version}\n` },
|
|
247
|
+
[`${bootstrap} --version`]: { code: 0, stdout: "v24.21.0\n" },
|
|
248
|
+
} });
|
|
249
|
+
const node = await h.probes.node();
|
|
250
|
+
assert.equal(node.found, version, platform);
|
|
251
|
+
assert.equal(node.foundInGlobalBin, true, platform);
|
|
252
|
+
}
|
|
253
|
+
const supported = probes({ platform, env, files: [own, bootstrap], results: {
|
|
254
|
+
[`${own} --version`]: { code: 0, stdout: "v23.6.0\n" },
|
|
255
|
+
[`${bootstrap} --version`]: { code: 0, stdout: "v24.21.0\n" },
|
|
256
|
+
} });
|
|
257
|
+
assert.deepEqual(await supported.probes.node(), { available: true, version: "23.6.0", usable: true, persistent: true, npm: false }, platform);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
for (const platform of ["linux", "win32"]) {
|
|
262
|
+
test(`${platform}: a swapped PATH Node records a different Node at the global-bin destination`, async () => {
|
|
263
|
+
const windows = platform === "win32";
|
|
264
|
+
const bin = windows ? "C:\\Users\\u\\pnpm\\bin" : BIN;
|
|
265
|
+
const bootstrap = windows ? "C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node\\node.exe" : TOOLS_NODE;
|
|
266
|
+
const own = windows ? "C:\\System\\node.exe" : USER_NODE;
|
|
267
|
+
const destination = windows ? `${bin}\\node.exe` : `${bin}/node`;
|
|
268
|
+
const env = windows
|
|
269
|
+
? { PNPM_HOME: "C:\\Users\\u\\pnpm", Path: `C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node;C:\\System;${bin}`, PATHEXT: ".CMD;.COM;.EXE;.BAT" }
|
|
270
|
+
: { HOME, PNPM_HOME, PATH: `${TOOLS}/node/bin:/usr/bin:${bin}` };
|
|
271
|
+
const h = probes({ platform, env, files: [own, bootstrap, destination, ...(windows ? [`${bin}\\node.cmd`] : [])], results: {
|
|
272
|
+
[`${own} --version`]: { code: 0, stdout: "v23.5.9\n" },
|
|
273
|
+
[`${bootstrap} --version`]: { code: 0, stdout: "v24.21.0\n" },
|
|
274
|
+
} });
|
|
275
|
+
assert.deepEqual(await h.probes.node(), { available: true, version: "24.21.0", usable: true, persistent: false, npm: false,
|
|
276
|
+
found: "23.5.9", globalBinNode: true });
|
|
277
|
+
assert.deepEqual(h.unexpected, []);
|
|
278
|
+
assert.equal(h.calls.some((call) => call.command === destination), false);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
test("a destination Node is recorded without reading its version", async () => {
|
|
283
|
+
for (const result of [{ code: 1 }, { code: 0, timedOut: true, stdout: "v20.19.0" },
|
|
284
|
+
{ code: 0, truncated: true, stdout: "v20.19.0" }, { code: 0, stdout: "v20.19.0-rc.1" }, () => { throw new Error("unreadable"); }]) {
|
|
285
|
+
const destination = `${BIN}/node`;
|
|
286
|
+
const h = probes({ env: { HOME, PNPM_HOME, PATH: `${TOOLS}/node/bin:/usr/bin:${BIN}` }, files: [USER_NODE, TOOLS_NODE, destination], results: {
|
|
287
|
+
[`${USER_NODE} --version`]: { code: 0, stdout: "v23.5.9\n" },
|
|
288
|
+
[`${TOOLS_NODE} --version`]: { code: 0, stdout: "v24.21.0\n" }, [`${destination} --version`]: result,
|
|
289
|
+
} });
|
|
290
|
+
assert.deepEqual(await h.probes.node(), { available: true, version: "24.21.0", usable: true, persistent: false, npm: false,
|
|
291
|
+
found: "23.5.9", globalBinNode: true });
|
|
292
|
+
assert.equal(h.calls.some((call) => call.command === destination), false);
|
|
293
|
+
assert.deepEqual(h.unexpected, []);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
test("Windows neither runs nor walks a destination Node", async () => {
|
|
298
|
+
const bin = "C:\\Users\\u\\pnpm\\bin";
|
|
299
|
+
const own = "C:\\System\\node.exe";
|
|
300
|
+
const bootstrap = "C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node\\node.exe";
|
|
301
|
+
const destination = `${bin}\\node.exe`;
|
|
302
|
+
const walked: string[] = [];
|
|
303
|
+
const h = probes({ platform: "win32", env: { PNPM_HOME: "C:\\Users\\u\\pnpm",
|
|
304
|
+
Path: `C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node;C:\\System;${bin}`, PATHEXT: ".EXE" },
|
|
305
|
+
files: [own, bootstrap, destination], storage: (file) => { walked.push(file); throw new Error("untrusted"); }, results: {
|
|
306
|
+
[`${own} --version`]: { code: 0, stdout: "v23.5.9\n" },
|
|
307
|
+
[`${bootstrap} --version`]: { code: 0, stdout: "v24.21.0\n" },
|
|
308
|
+
} });
|
|
309
|
+
assert.deepEqual(await h.probes.node(), { available: true, version: "24.21.0", usable: true, persistent: false, npm: false,
|
|
310
|
+
found: "23.5.9", globalBinNode: true });
|
|
311
|
+
assert.deepEqual(walked, []);
|
|
312
|
+
assert.equal(h.calls.some((call) => call.command === destination), false);
|
|
313
|
+
assert.deepEqual(h.unexpected, []);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
test("a bootstrap-only Node records a global-bin destination even when that bin is not on PATH", async () => {
|
|
317
|
+
const destination = `${BIN}/node`;
|
|
318
|
+
const h = probes({ env: { HOME, PNPM_HOME, PATH: `${TOOLS}/node/bin:/usr/bin` }, files: [TOOLS_NODE, destination], results: {
|
|
319
|
+
[`${TOOLS_NODE} --version`]: { code: 0, stdout: "v24.21.0\n" },
|
|
320
|
+
} });
|
|
321
|
+
assert.deepEqual(await h.probes.node(), { available: true, version: "24.21.0", usable: true, persistent: false, npm: false,
|
|
322
|
+
globalBinNode: true });
|
|
323
|
+
assert.equal(h.calls.some((call) => call.command === destination), false);
|
|
324
|
+
assert.deepEqual(h.unexpected, []);
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
test("a supported PATH Node is reused without probing another Node at the destination", async () => {
|
|
328
|
+
const destination = `${BIN}/node`;
|
|
329
|
+
const h = probes({ env: { HOME, PNPM_HOME, PATH: `${TOOLS}/node/bin:/usr/bin:${BIN}` }, files: [USER_NODE, TOOLS_NODE, destination],
|
|
330
|
+
results: { [`${USER_NODE} --version`]: { code: 0, stdout: "v23.6.0\n" } } });
|
|
331
|
+
assert.deepEqual(await h.probes.node(), { available: true, version: "23.6.0", usable: true, persistent: true, npm: false });
|
|
332
|
+
assert.equal(h.calls.some((call) => call.command === destination), false);
|
|
333
|
+
assert.deepEqual(h.unexpected, []);
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
test("a swapped Node reached through a directory alias keeps its pnpm global-bin provenance", async () => {
|
|
337
|
+
const windowsBin = "C:\\Users\\u\\pnpm\\bin";
|
|
338
|
+
const cases = [
|
|
339
|
+
{ platform: "linux", bin: BIN, alias: `${HOME}/pnpm-link/bin`, bootstrap: TOOLS_NODE,
|
|
340
|
+
env: { HOME, PNPM_HOME, PATH: `${TOOLS}/node/bin:${HOME}/pnpm-link/bin:/usr/bin` },
|
|
341
|
+
realBin: BIN, realAlias: BIN, separator: "/" },
|
|
342
|
+
{ platform: "win32", bin: windowsBin, alias: "C:\\Users\\u\\pnpm-link\\bin",
|
|
343
|
+
bootstrap: "C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node\\node.exe",
|
|
344
|
+
env: { PNPM_HOME: "C:\\Users\\u\\pnpm", Path: "C:\\Users\\u\\.gentle-shell-bootstrap-tools.1\\node;C:\\Users\\u\\pnpm-link\\bin", PATHEXT: ".EXE" },
|
|
345
|
+
realBin: "C:\\Users\\u\\pnpm\\bin", realAlias: "c:\\users\\U\\PNPM\\BIN", separator: "\\" },
|
|
346
|
+
];
|
|
347
|
+
for (const { platform, bin, alias, bootstrap, env, realBin, realAlias, separator } of cases) {
|
|
348
|
+
const own = `${alias}${separator}node${platform === "win32" ? ".exe" : ""}`;
|
|
349
|
+
for (const version of ["23.5.9", "22.18.0"]) {
|
|
350
|
+
const destination = `${bin}${separator}node${platform === "win32" ? ".exe" : ""}`;
|
|
351
|
+
const h = probes({ platform, env, files: [own, bootstrap, destination], dirs: [alias, bin], realpaths: {
|
|
352
|
+
[alias]: realAlias, [bin]: realBin, [own]: `${bin}${separator}..${separator}runtime${separator}node`,
|
|
353
|
+
}, results: {
|
|
354
|
+
[`${own} --version`]: { code: 0, stdout: `v${version}\n` },
|
|
355
|
+
[`${bootstrap} --version`]: { code: 0, stdout: "v24.21.0\n" },
|
|
356
|
+
} });
|
|
357
|
+
assert.deepEqual(await h.probes.node(), { available: true, version: "24.21.0", usable: true, persistent: false,
|
|
358
|
+
npm: false, found: version, foundInGlobalBin: true }, `${platform} ${version}`);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
|
|
217
363
|
test("node absent, unparseable, failing, timed out or truncated", async () => {
|
|
218
364
|
assert.deepEqual(await probes({ env: { HOME, PATH: "/usr/bin" } }).probes.node(), { available: false });
|
|
219
365
|
for (const result of [{ code: 0, stdout: "v24\n" }, { code: 0, stdout: "v24.18.0-nightly\n" }, { code: 1, stdout: "v24.18.0" },
|