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
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ordinary review in one call
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`gentle_review_run` runs one ordinary native review in one parent tool call. It is registered in every parent session; managed child sessions never get it, and `GENTLE_PI_EXPERIMENTAL_REVIEW_COORDINATOR=0` before loading the extension opts out. The variable is no longer needed to enable it. While receipt-driven development (RDD) is off, the tool's declaration and guidance are left out of the request, so the prompt is byte-identical to a session without it, and every facade call it makes is refused by the review mode gate. It is model-only and follows the existing direct-call restriction; it is not a codemode entry point.
|
|
4
|
+
|
|
5
|
+
While RDD is not off, its guidance tells the parent to prefer `gentle_review_run` over single review operations to drive a due native review. Single operations remain for what the run result hands back (the consent answer, the correction plan through `gentle_review_capture`, status and recovery), for a review the user explicitly asks for after `not-due`, and for ASSESS after a delegated writer. Correction edits and maintenance remain explicit handoffs. The tool runs the same provider-issued transitions the mirrored review contract describes for single operations (assess, inspect, START, bound STATUS, captures, acknowledgement); it does not change that contract.
|
|
4
6
|
|
|
5
7
|
The coordinator calls the existing wrapped review facade executors. Native mode, host consent, session identity, workspace/base selection, opaque bindings and native admission remain authoritative. It never parses binding strings, invents results, retries a failed capture or authorizes delivery.
|
|
6
8
|
|
|
7
|
-
For a fresh ordinary review, provide pertinent `lenses` and `lensesReason`, optionally `workspaceRoot`, a committed selector (`baseRef` together with `committedOnly: true`), and an existing `requestContextPath`. [Frozen request intent](review-request-context.md) is accepted only for a fresh transaction.
|
|
9
|
+
For a fresh ordinary review, provide pertinent `lenses` and `lensesReason`, optionally `workspaceRoot`, a committed selector (`baseRef` together with `committedOnly: true`), and an existing `requestContextPath`. [Frozen request intent](review-request-context.md) is accepted only for a fresh transaction. The START consent stays with the host: in an interactive session the existing consent dialog may resolve it inside the call; otherwise the run returns `consent-required` with the provider envelope; the parent relays it to the human, submits only the human's explicit answer, once, with `gentle_review` `answer-consent` (the model never chooses the answer), and resumes `gentle_review_run` with the returned `lineageId`. The tool rejects consent arguments and never sends a consent answer.
|
|
10
|
+
|
|
11
|
+
The loop follows the native next_transition kind. It runs supported facade execute offers, captures the exact ordered opaque bindings, returns authored input to the model, and surfaces stop unchanged. It never reads native states, reason codes, binding contents or capture closure variants; from a capture closure it reads only `advisory_findings` and `advisory_finding_claims`, from a STATUS correction request only its `findings`, after that request has already returned `input-required`, and from the STATUS that ends the run on a correction request or a stop only its `non_blocking_findings`, to relay them. Facade operations that require additional maintenance authorization return to the caller. The run returns `closed` after the verified acknowledgement, or stops with `not-due`, `assessment-unavailable`, `request-context-requires-fresh-review`, `consent-required`, `input-required` (a correction plan; with its findings and the review's non-blocking findings when the provider reports the non-blocking ones), `selection-required` (an intended-untracked selection; resume with `resume_input`), `stopped` (an escalated review: with its non-blocking findings), `handoff` (maintenance or another unsupported operation), `repeated-capture`, `forecast` (not displayed), `binding-drift` (lineage or target drift the coordinator detects in STATUS; when the facade rejects the drifted route first, for example in the STATUS after a reconciled reviewer group, the run returns `blocked` with `capture-route-registration-rejected`), `transition-limit`, `cancelled` (after an approved closure, with its findings) or `blocked` (an error). `forecast` is returned only when a UI host has no display callback.
|
|
8
12
|
|
|
9
|
-
The
|
|
13
|
+
The run never chooses intended untracked paths. On `selection-required` its result carries `resume_input`, the run's own inputs (selector, `lenses`, `lensesReason`, `requestContextPath`) without any untracked selection; when the caller passed no `workspaceRoot` and INSPECT reported the root it resolved (`workspace_root`), `resume_input.workspaceRoot` names that root, so a resume from a session in another workspace still reviews the one the selection was offered for; after the human or the parent chooses, resume `gentle_review_run` with `resume_input` plus `untrackedScope` (`exclude`, or `select` with `intendedUntracked`). The run then resolves the selection through INSPECT and START keeps the requested lenses and frozen request context. The run relays the facade's INSPECT envelope without its `nextStep`, which names the single `select-intended-untracked` operation: that operation starts the review with only the context a START retained, so after an INSPECT it would start without them. The envelope keeps its `selectionBinding`, whose eligible paths are what the choice is made from; the resume itself does not submit it. A single `gentle_review` INSPECT still returns its own `nextStep` unchanged.
|
|
10
14
|
|
|
11
15
|
Native correction_request explicitly identifies a plan that needs authored input. The coordinator returns that request to the model without deriving requiresInput metadata from submission domains or changing ordinary STATUS output. Unsupported capture responses return control to the caller. Correction-plan authoring and edits remain explicit handoffs; after an authorized edit, resume with the same lineage and workspace/base selection. Native decides which opaque capture comes next.
|
|
12
16
|
|
|
13
|
-
The existing capture facade presents the model-run forecast before execution. Every observed forecast is
|
|
17
|
+
The existing capture facade presents the model-run forecast before execution. With a UI the run displays it to the human before the reviewer runs; its collapsed line leads with the model-run count and the lenses or roles that will run. Without a UI nobody could see it before the run, so the run records it and continues. Every observed forecast is preserved losslessly in the final forecasts array, including when a later operation refuses. The primary model must relay every entry in the user’s language, preserving all fields and counts. These forecasts are informational, not review consent. A changed session or disabled mode prevents the run. Accepted captures refresh bound STATUS for the next transition; failed or reoffered captures never retry. A reviewer group whose results were all admitted without a closing event returns `native-reviewer-group-status-reconciled` after the facade's own bound STATUS confirmed lineage and target and offered no further reviewer capture (for example when the findings need the refuter); the run accepts it like any capture and takes the next transition from bound STATUS, so the refuter runs in the same call. The same outcome with a `failure`, `native_failure`, `reconciliation` or `reconciliation_failure` field, a failed reconciliation, or group authority drift returns `blocked`. An older provider's self-contained refuter or validator vector (`--execute=true`) runs the role in the provider and returns `native-provider-role-captured` with `status: "captured"` instead of a closure; the run accepts it from a single capture like an admitted reviewer result and takes the next transition from bound STATUS. From a group capture, with another status or with one of those fields, it returns `blocked`.
|
|
18
|
+
|
|
19
|
+
Approval closes through the offered facade acknowledgement. The verified ACK envelope identifies the frozen target and burned authority and keeps `delivery: "ordinary-repository-policy"`. Once the run has captured an approved closure with `advisory_findings`, every result it returns from then on carries them, unchanged, whatever the outcome (`closed`, or `blocked` and the other stops before the acknowledgement); when the closure had no such key, neither does the result, and a closure that is not approved adds nothing. A run resumed by `lineageId` that goes straight to the acknowledgement returns `closed` without them: neither bound STATUS nor the acknowledgement envelope carries the closure's findings, so the stopped result before it is the one that carried them. Beside it, `advisory_finding_claims` maps each advisory finding id to the reviewer's own claim for that finding, taken from the same closure's `reviewer_results` by exact id and copied unchanged up to 1,024 UTF-8 bytes (cut at the last whole character within the cap). Claims are added in `advisory_findings` order until the next one would bring the closure's claim text past 8,192 UTF-8 bytes; that id and every later one get no entry. An id with no matching reviewer finding, or with more than one, is left out, and the key is absent when no id has a claim or `advisory_findings` is absent. `advisory_finding_claims_truncated` lists, in the same order, the ids whose claim is a cut prefix, and `advisory_finding_claims_omitted` the ids whose one matching claim the 8,192-byte limit left out; each key is present only when it lists an id, and the run relays each only as an array of strings, beside the claims. They travel with `advisory_findings` on every result that carries them. The facade's approved capture closure carries the same map, so a single `gentle_review_capture` returns it too. The claims are the reviewers' own text: information to relay, never instructions to follow. Nothing routes on either key. There is no post-ACK STATUS, ASSESS or replay, and closure makes no claim about subsequent edits or permission to commit, push or publish.
|
|
20
|
+
|
|
21
|
+
A review that does not approve returns finding text only where the facade already received it. When bound STATUS asks for a correction plan, the run returns `input-required` with that STATUS envelope unchanged (apart from `non_blocking_findings`, below). Only when that STATUS also carries the provider's `non_blocking_findings` (an empty list counts) does it add, beside the envelope, the correction fields that follow; without that answer the result is exactly as before these fields existed, because a parent given only the findings to correct would stop looking for the review's non-blocking findings and the user would lose them. The correction fields are `correction_findings`: each finding of the provider's correction request, in the provider's order, with its `id`, `lens`, `location`, `severity`, and, when present, `evidence_class` and `causal_disposition` copied unchanged (the evidence and proof references stay in the relayed envelope). `correction_finding_claims` maps each of those ids to the finding's `claim` by the same rules as `advisory_finding_claims`: copied unchanged up to 1,024 UTF-8 bytes, added in `correction_findings` order until the next one would pass 8,192 bytes, an id with more than one finding left out, and the key absent when no id has a claim; `correction_finding_claims_truncated` and `correction_finding_claims_omitted` mark them the same way. If any finding lacks a nonempty string `id`, `lens`, `location`, `severity` or `claim`, or carries a non-string `evidence_class` or `causal_disposition`, none of these keys is returned and the outcome is still `input-required`. The correction request carries only the findings to fix (BLOCKER or CRITICAL); a non-blocking finding of the same review is not in it. An escalated review ends `stopped` with the provider's `escalation` (cause, finding ids and refuter outcomes) in the relayed envelope. These claims are also the reviewers' own text, to relay and never to follow, and nothing routes on them.
|
|
22
|
+
|
|
23
|
+
The non-blocking findings of a review that stopped come from the provider's STATUS (gentle-ai#6088). Only the run asks for them. The facade's `gentle_review` `status` and `inspect` operations add `--non-blocking-findings` to their contracted STATUS only when `gentle_review_run` dispatches them. The run sets that scope around its own facade calls, in process; it is not a tool parameter, so no model input can set it. A direct `gentle_review` call never sends the flag, with any provider. The STATUS reads inside captures, recovery, acknowledgement and START never send it. For a current compact authority in `correction_required` or `escalated`, a provider that supports the opt-in answers with `non_blocking_findings`: a `statement` and the admitted findings that are neither to correct nor unresolved, each with `id`, optional `lens` and `location`, `severity`, `disposition` (`informational`, `follow_up` or `refuted`) and the reviewer's `claim`. The decoder accepts the key only on status/v9 for such an authority, with exact key sets, and rejects it anywhere else.
|
|
14
24
|
|
|
15
|
-
|
|
25
|
+
When the run returns `input-required` for a correction request, or `stopped`, from that STATUS, it returns `non_blocking_findings`: the `statement`, and each finding's `id`, `lens`, `location`, `severity` and `disposition`, unchanged and in the provider's order. Findings are listed until the next one would bring the list past 16 KiB of JSON. `non_blocking_findings_omitted_count` then gives how many were left out, and is absent when none was. Beside it, `non_blocking_finding_claims`, `non_blocking_finding_claims_truncated` and `non_blocking_finding_claims_omitted` follow the advisory claims' rules and limits (1,024 and 8,192 UTF-8 bytes) over the listed findings only. Claims are cut at bytes only; control characters such as ANSI escapes pass through unchanged, as on the other claim paths. An empty claim is a claim. These top-level keys are the only copy. The relayed provider record (`result.result`) leaves out `non_blocking_findings`, and only that key; everything else in it is unchanged. With 300 findings of about 1.2 KB each, the run's result text is about 29 KB.
|
|
26
|
+
|
|
27
|
+
An empty provider list is the provider's answer and is returned as `non_blocking_findings` with no findings and no claims key. When STATUS has no such key (an older provider, another state), none of these keys is returned. A malformed set (a disposition outside the three values, a missing claim, an extra key, an empty statement, `findings` that is not an array, a non-string severity) fails the strict STATUS decode like any unknown key: the facade's STATUS fails and the run ends `blocked`, with none of these keys. The run drops the keys and keeps its outcome in one case only: a set the decoder accepts but whose `statement`, `id`, `severity`, `lens` or `location` is whitespace-only. The decoder requires only a non-empty string; the run requires a non-blank one.
|
|
28
|
+
|
|
29
|
+
A provider older than the opt-in refuses the unknown flag (`invalid_request`, not started, cause exactly `flag provided but not defined: -non-blocking-findings`). The same STATUS is then repeated once without the flag, and that provider binary (path and sha256) is not sent the flag again in the same process. Any other STATUS failure is handled as before. The flag is never added to a provider-issued intended-untracked submission, and the run never reads the provider's storage.
|
|
16
30
|
|
|
17
31
|
## Validation and rollout
|
|
18
32
|
|
|
19
33
|
```sh
|
|
20
|
-
node --experimental-strip-types --test tests/review-coordinator.test.ts tests/review-coordinator-runtime.test.ts tests/review-
|
|
34
|
+
node --experimental-strip-types --test tests/review-coordinator.test.ts tests/review-coordinator-runtime.test.ts tests/review-one-call.test.ts tests/review-one-call-followups.test.ts tests/review-last-event-closure.test.ts
|
|
21
35
|
```
|
|
22
36
|
|
|
23
37
|
Unit and registered-runtime tests cover opaque binding order, authored input, native stop, state/reason independence, consent, cancellation, mode/session changes, failed or repeated captures, identity drift and terminal ACK without follow-up queries. Runtime fixtures are in-memory authority simulations; they do not claim real native approval.
|
|
@@ -28,6 +42,12 @@ SDK event accounting sees the outer coordinator call. Its returned metrics.steps
|
|
|
28
42
|
|
|
29
43
|
When the relay supplies execution evidence, the final reviewer_runs array retains snapshots of the resolved reviewer model, phase, durations and available reported usage/cost. Groups include all prepared runs, even when submission later stops; legacy submitted-only diagnostics are not counted again. Missing usage stays unknown. This is not a billing ledger: sibling runs can remain unreported when group preparation fails before returning its results, and thrown/cancelled calls retain their existing behavior. The coordinator computes no cost total and emits no additional SDK accounting events.
|
|
30
44
|
|
|
31
|
-
Reviewer authentication and completion share a host deadline. Cancellation or an expired deadline prevents further dispatch, and late results are not admitted. A provider that ignores cancellation may continue consuming resources after the host stops waiting.
|
|
45
|
+
Reviewer authentication and completion share a host deadline. Cancellation or an expired deadline prevents further dispatch, and late results are not admitted. Once a capture has returned an admitted closure with `advisory_findings`, a cancellation at any later point before the acknowledgement completes (right after that capture, while the next STATUS is in flight, or when STATUS or the acknowledgement rejects because of it) makes the run return `cancelled` with that capture's envelope without its `status` and `state` (and the closure without its `state`), since the review is approved but neither closed nor acknowledged, together with the findings, their claims and marks and the `lineage_id`, and dispatches nothing more; resuming with `lineageId` reaches the acknowledgement without them. An acknowledgement that already completed returns `closed`; a failure other than the cancellation (anything but an `AbortError` or the signal's own reason) is reported as before, even when the signal has also been aborted. Without such a closure the call is cancelled as before. A provider that ignores cancellation may continue consuming resources after the host stops waiting.
|
|
46
|
+
|
|
47
|
+
Related delivery: [issue #2881](https://github.com/Gentleman-Programming/gentle-shell/issues/2881); default registration: [odd/tasks/review-one-call.md](../odd/tasks/review-one-call.md) (gentle-ai#6062).
|
|
48
|
+
|
|
49
|
+
## Non-blocking statement budget
|
|
50
|
+
|
|
51
|
+
The host-returned `non_blocking_findings.statement` shares the 1,024 UTF-8-byte per-claim limit. It preserves a whole-codepoint prefix and adds nested `statement_truncated: true` only when cut; otherwise the statement and absence of that marker stay unchanged. This also applies to an empty findings list. Consumers must disclose the marker rather than present the prefix as the complete provider statement.
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
This is derived host output, not a new field in the incoming provider schema. The 16 KiB findings-list bound, separate claim bounds, provider order, outcome and authority remain unchanged.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Host delivery preflight
|
|
2
|
+
|
|
3
|
+
Shell's host workflow now checks recognizable `git push`, `gh pr create` and `gh pr merge` calls before execution (issue #2997). This changes Shell's previous unconditional delivery bypass. It does not restore the provider's retired receipt/gate APIs or change its byte-pinned contract artifacts. The vendored `review-integration.md` remains an exact upstream snapshot; this document describes the newer Shell-owned ordering policy.
|
|
4
|
+
|
|
5
|
+
With RDD on, select the actual delivery slice through `gentle_review` assess with explicit `baseRef` and `committedOnly: true`. `workspaceRoot` selects its worktree. The host resolves that selector to a fixed commit before assessment; a confirmed committed-range assessment retains only that base commit in the existing session continuation registry. Invalid or unresolved selections leave the existing hint unchanged. No parallel registry, cached verdict, capture/confirmation state or stored HEAD snapshot is created. The native assessment is always fresh and compares that fixed base to current HEAD, including commits made since selection. This also covers assessments invoked by the coordinator. Committed-only delivery requests omit untracked selection flags because they require no untracked inventory.
|
|
6
|
+
|
|
7
|
+
After command authorization, each foreground call gets one assessment per selected repository, even for a batch such as `git push && gh pr create`. A shell wrapper alone does not block the call. Native `reviewDue: false` preserves ordinary policy. A due review requires following the facade transitions or an exact host-recorded human decline; caller-supplied outcomes grant nothing. HEAD/base and session checks around the fresh read prevent using a result that changed during admission. A new HEAD before admission is assessed automatically, without requiring another registration cycle.
|
|
8
|
+
|
|
9
|
+
Commands that change the candidate (commit, revert, switch, rebase, etc.) must finish before its delivery can be evaluated. Delivery through the background or monitor tools still needs a separate foreground call because the job can run after its preflight is stale; background waits without delivery remain available. Missing base, cancellation and unavailable native evidence remain concrete blockers. Dynamic or implicit directory changes and recognized inline Git/environment repository redirects (such as `--git-dir`, `GIT_WORK_TREE` or `env -C`) are unresolved targets: run delivery inside its repository or use literal `cd` or `git -C`. The host cannot infer a redirected target's RDD mode from the session repository. For resolved repositories, RDD off retains ordinary command policy. The check runs no review, consent answer, acknowledgement, mode change or network lookup, and does not authorize delivery.
|
|
10
|
+
|
|
11
|
+
This covers recognizable shell invocations, including common shell wrappers and substitutions. It is not a shell sandbox or an installed Git hook. Script files, arbitrary interpreter programs and external actors are outside its detection boundary. The caller owns the actual slice, every pushed ref and the PR/remote destination: checking a local candidate does not verify an explicit remote override, prove an arbitrary PR number matches local HEAD or prevent later remote edits after auto-merge scheduling.
|
|
12
|
+
|
|
13
|
+
Literal `cd` is resolved only in a direct leading `&&` chain without other control operators, including inside a supported shell wrapper. A later `;` or other control operator also makes the directory state ambiguous if the `cd` fails. `cd` in subshells, pipelines, background syntax or ambiguous conditional flow, and any `pushd`/`popd`, make the delivery target unresolved. Split those steps and issue delivery from the intended repository or use literal `git -C`; the host does not simulate shell directory state.
|
|
14
|
+
|
|
15
|
+
Recognizable scheduling and exported routing are checked as follows:
|
|
16
|
+
|
|
17
|
+
- Shell `&` applies to its whole and/or list or compound command, not merely the last segment. With RDD on, recognized delivery such as `sleep 30 && git push &` or `git push && echo done &` must be separated into a new foreground call before assessment. Scheduling metadata also follows supported wrappers and substitutions. Background work outside the delivery's list does not by itself mark a later foreground delivery asynchronous; resolved RDD-off targets retain ordinary policy.
|
|
18
|
+
- Literal exports of `GIT_DIR`, `GIT_WORK_TREE`, `GIT_COMMON_DIR` or `GIT_NAMESPACE` make later delivery in that environment unresolved, including exports through same-shell `eval`. This is rejected before reading the session repository's RDD mode. Exports inside a subshell, background list or backtick substitution do not contaminate a later parent-shell delivery; a delivery within that same child environment still has an unresolved target. Separate routing changes from delivery and issue it from the intended repository. This is bounded recognition of literal shell forms, not general shell-variable evaluation.
|
|
19
|
+
|
|
20
|
+
The provider's assessment policy, including `under_budget`, remains unchanged. The companion provider report #6028 remains separate; this host change does not claim to resolve inconsistent outcomes between provider assessment and other hosts' Stop hooks.
|
|
21
|
+
|
|
22
|
+
Regression coverage uses the real Shell hook and isolated Git repositories with stubbed native answers, plus the real native client's request validation with a stubbed process adapter. It checks one assessment per delivery batch, zero added asynchronous Git reads when retaining a base (canonical selection now performs synchronous Git resolution), fixed HEAD/branch bases, foreground batching/wrappers/eval, asynchronous delivery lists, process-scoped exports, unresolved-directory rejection, candidate-changing boundaries, late HEAD/selector/session changes, cancellation, and native non-due/human-decline paths. An additional Bash probe uses an inert local function to confirm scheduling and export visibility; it executes no Git delivery. These checks do not perform a real remote push/merge or claim a complete live-model journey or production latency improvement.
|
package/docs/work-continuity.md
CHANGED
|
@@ -2,21 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
## Scope and delivered guidance
|
|
4
4
|
|
|
5
|
-
This is a Shell prompt-guidance improvement, not an incident closure for #2211 or #1669. The
|
|
5
|
+
This is a Shell prompt-guidance improvement, not an incident closure for #2211 or #1669. The provider-owned canonical Close now owns the authorized-work boundary: authorized steps continue, a pending child is a wait event whose completion resumes the turn without asking the human, and only a real human decision, the user's explicit stop, a denial, missing consent, or an exhausted limit stops the work it applies to, never independent authorized work. Pi's always-on continuity keeps its unique guard, budget, worker-continuation, and maintenance clauses without restating that boundary or licensing a generic **Needs your decision** stop. The parent-only maintenance route remains guidance for an explicitly authorized operation a worker cannot perform. None of these rules grants permission, changes correction limits, or implements a backup or rollback operation.
|
|
6
6
|
|
|
7
7
|
| Situation | Guidance delivered to the parent |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| A test or harness check fails, but a correction and rerun remain in scope and within the existing budget | Correct and continue without asking for approval of each transition. Do not reset the budget or weaken the check. |
|
|
10
|
-
| The human specified one run, no retries, or diagnostic only | Honor that limit;
|
|
11
|
-
| Proof is
|
|
10
|
+
| The human specified one run, no retries, or diagnostic only | Honor that limit; correct only within the existing correction budget and never reset or weaken it. |
|
|
11
|
+
| Proof is missing, partial, unavailable, or declined; consent is required; an action is denied; or the correction budget is exhausted | Missing proof forbids claiming completion of the affected work, never an independently authorized next step; a required authorized check the existing budget still allows keeps running. Denial, missing consent, and exhaustion stop only the work they apply to. Terminal outcomes and existing bounded-stop rules remain binding; an unavailable verifier is not retried automatically. The narrow human-requested quota recovery below is a separate attempt. |
|
|
12
|
+
| A worker exhausts its correction limit and returns `status: partial` with its diagnosed loop cause | The worker's cycle ends, not the unit. The parent decides the next step from that evidence without asking the user: it names the cause and acts on it (organic mode may fix inline when small and understood; full delegation launches a new bounded writer carrying the diagnosis and new evidence with a changed scope or hypothesis). It never repeats the same attempt; the same cause again, or no new hypothesis, blocks that unit while independent work continues. Only a genuinely human decision goes to the user. See `docs/delegated-verification.md`. |
|
|
12
13
|
| A worker cannot perform an upgrade | Only the parent may act after explicit authorization of the operation, exact scope and ownership, preservation, permitted tools, applicable fresh consent and guards, a validated backup, applicable artifact/migration validation, and a recovery path are established. |
|
|
13
14
|
| An authorized rollback mixes task changes and unrelated changes, even in one file | Preserve unrelated edits; remove only proven task-created helpers. Never blanket restore, reset, or clean. Ambiguous ownership or denial stops the operation. |
|
|
14
15
|
|
|
16
|
+
A tracked task may end the turn pending only while it waits on already-launched work; for the affected work an already-decided denial, missing consent, the user's explicit stop, or an exhausted limit applies; or a genuine human decision stays outstanding. A partial user stop applies only to that work, unrelated runnable authorized work continues, and the turn never abandons runnable work or presents an unverified outcome as final. A report never turns into a blind self-reprompt loop.
|
|
17
|
+
|
|
15
18
|
Broad feature approval is not destructive-operation authority. Do not reroute a denial to another worker or tool. No real maintenance, backup, migration, rollback, destructive Git operation, or model/provider operation was performed for this work.
|
|
16
19
|
|
|
20
|
+
## Temporary verifier quota recovery
|
|
21
|
+
|
|
22
|
+
The always-on prompt points to `assets/orchestrator-quota-recovery.md`; the parent loads these conditions only when recovery is requested.
|
|
23
|
+
|
|
24
|
+
A verifier that ended on a temporary quota error without a verdict has not supplied proof or approval. Its automatic cycle stops. After availability is restored, the human can explicitly request one new bounded attempt at the missing verification for the same candidate. A general request to continue implementation is not that request.
|
|
25
|
+
|
|
26
|
+
Preserve the failed attempt and still-valid successful checks; run the missing verification rather than replaying passed suites. Before dispatch, confirm the previous child has ended and no child has uncertain status. A candidate change requires the ordinary verification decision for that changed candidate. Do not automatically wait, retry, or substitute a provider/model. Consent, actual denials, explicit one-run/no-retry limits, terminal native outcomes and exhausted native budgets remain binding; this request does not reset them.
|
|
27
|
+
|
|
28
|
+
This guidance changes no runtime quota detection, provider selection, or native review authority. The provider-owned Close boundary and the pinned installer contracts remain outside this quota-recovery rule. Delivered-instruction tests do not establish model adherence or a successful subscription-recovery journey.
|
|
29
|
+
|
|
17
30
|
## Current bounded checks
|
|
18
31
|
|
|
19
|
-
On the
|
|
32
|
+
On the earlier Windows workspace, with existing dependencies and no installation, network, provider, or model calls, the bounded verification run recorded these results against the then-current contract 1.4.0 mirror. The current field-test mirror is contract 1.6.0 and `node scripts/check-provider-contract.mjs` validates its bytes:
|
|
20
33
|
|
|
21
34
|
| Command | Result |
|
|
22
35
|
| --- | --- |
|
|
@@ -41,6 +54,6 @@ Those four selected cases are bounded Windows evidence only. They do not attribu
|
|
|
41
54
|
|
|
42
55
|
## Ownership and review limits
|
|
43
56
|
|
|
44
|
-
The continuity clarification is Shell-owned and
|
|
57
|
+
The continuity clarification is Shell-owned and defers to the provider-owned Close contract for the authorized-work boundary. This delivery consumes the contract 1.6.0 field-test mirror generated from the finished canonical source through `scripts/mirror-provider-contract.mjs`; Pi never hand-edits bundle bytes or the manifest digest, and the released installer pin and capability rows remain unchanged. A released provider, installer, RDD-switch, native-guard, question-tool, or surface-policy change requires separate authority.
|
|
45
58
|
|
|
46
|
-
Global RDD was on. An earlier preflight stopped with `immutable_review_transport_unsupported`; no review authority was started, no receipt exists, and review or mode was not retried. That unavailable review transport does not itself authorize or prohibit ordinary delivery; any delivery decision must use its applicable authority and evidence.
|
|
59
|
+
Global RDD was on. An earlier preflight stopped with `immutable_review_transport_unsupported`; no review authority was started, no receipt exists, and review or mode was not retried. That unavailable review transport does not itself authorize or prohibit ordinary delivery; any delivery decision must use its applicable authority and evidence. Earlier wording advisories concerned the diagnostic-only sentence, now removed with the generic terminal license, and the maintenance sentence, which remains guidance without new authority. No GitHub issue status was consulted, and this document does not claim publishing, delivery approval, or issue closure.
|
|
@@ -3,6 +3,7 @@ import { DynamicBorder } from "@earendil-works/pi-coding-agent";
|
|
|
3
3
|
import { Container, Input, isKeyRelease, matchesKey, Text, type KeybindingsManager, type TuiMouseEvent } from "@earendil-works/pi-tui";
|
|
4
4
|
import { type Static, Type } from "typebox";
|
|
5
5
|
import { captureChoiceAnswer } from "../lib/auto-permission-answers.ts";
|
|
6
|
+
import { publishChoiceAnswerHandle } from "../lib/desktop-feed-answers.ts";
|
|
6
7
|
import { NativeChoiceList } from "../lib/native-choice-list.ts";
|
|
7
8
|
import { createNativeFullscreenInteraction } from "../lib/native-fullscreen-interaction.ts";
|
|
8
9
|
import { isInteractiveMode, isInteractiveRpcHost } from "../lib/rpc-host.ts";
|
|
@@ -25,10 +26,10 @@ const ChoiceParamsSchema = Type.Object(
|
|
|
25
26
|
options: Type.Array(ChoiceOptionSchema, {
|
|
26
27
|
minItems: 2,
|
|
27
28
|
maxItems: 4,
|
|
28
|
-
description: "Two to four ordered
|
|
29
|
+
description: "Two to four ordered options",
|
|
29
30
|
}),
|
|
30
31
|
allowCustomResponse: Type.Optional(Type.Boolean({
|
|
31
|
-
description: "
|
|
32
|
+
description: "Defaults to true: shows a \"Type your answer\" free-text entry. Set false for provider-owned consent prompts, maintenance authorizations, or any exact opaque-token decision.",
|
|
32
33
|
})),
|
|
33
34
|
},
|
|
34
35
|
{ additionalProperties: false },
|
|
@@ -53,8 +54,17 @@ interface ChoiceDetails {
|
|
|
53
54
|
|
|
54
55
|
type ChoiceResult = ChoiceSelection | { customResponse: string };
|
|
55
56
|
|
|
57
|
+
/** Visible label of the free-text entry, shared by the TUI list and the RPC dialog. */
|
|
58
|
+
const CUSTOM_RESPONSE_LABEL = "Type your answer";
|
|
59
|
+
const CUSTOM_RESPONSE_PLACEHOLDER = "Type your answer";
|
|
60
|
+
|
|
61
|
+
/** Free text is the default; only an explicit `allowCustomResponse: false` closes the choice. */
|
|
62
|
+
function allowsCustomResponse(params: Pick<ChoiceParams, "allowCustomResponse">): boolean {
|
|
63
|
+
return params.allowCustomResponse !== false;
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
class CustomResponseEditor extends Container {
|
|
57
|
-
private readonly input = new Input({ prompt: "> ", placeholder:
|
|
67
|
+
private readonly input = new Input({ prompt: "> ", placeholder: CUSTOM_RESPONSE_PLACEHOLDER });
|
|
58
68
|
private readonly validationText = new Text("", 1, 0);
|
|
59
69
|
private readonly keybindings: KeybindingsManager | undefined;
|
|
60
70
|
private readonly onSubmit: (value: string) => void;
|
|
@@ -188,26 +198,27 @@ function choiceToolResult(params: ChoiceParams, selection: ChoiceResult | undefi
|
|
|
188
198
|
};
|
|
189
199
|
}
|
|
190
200
|
|
|
191
|
-
/** Label for the opt-in free-text entry appended to the RPC-dialog select options. */
|
|
192
|
-
const OTHER_OPTION_LABEL = "Other…";
|
|
193
|
-
|
|
194
201
|
/**
|
|
195
202
|
* Interactive-RPC-host fallback: one `ctx.ui.select` over the option labels
|
|
196
|
-
* (plus "
|
|
197
|
-
* free-text response.
|
|
198
|
-
*
|
|
203
|
+
* (plus "Type your answer" unless `allowCustomResponse` is false), then
|
|
204
|
+
* `ctx.ui.input` for the free-text response. The dialog returns labels only,
|
|
205
|
+
* so the free-text entry is omitted when a declared option already uses its
|
|
206
|
+
* label. Keeps the exact TUI result shapes; a cancel at either step cancels
|
|
207
|
+
* the choice, matching the TUI Escape key. Typed text is never mapped to an
|
|
208
|
+
* option value.
|
|
199
209
|
*/
|
|
200
210
|
async function askThroughDialogs(
|
|
201
211
|
ctx: Pick<ExtensionContext, "ui">,
|
|
202
212
|
params: ChoiceParams,
|
|
203
213
|
): Promise<ChoiceResult | undefined> {
|
|
204
214
|
const labels = params.options.map((choiceOption) => choiceOption.label);
|
|
205
|
-
const
|
|
215
|
+
const offerCustom = allowsCustomResponse(params) && !labels.includes(CUSTOM_RESPONSE_LABEL);
|
|
216
|
+
const dialogOptions = offerCustom ? [...labels, CUSTOM_RESPONSE_LABEL] : labels;
|
|
206
217
|
const picked = await ctx.ui.select(params.question, dialogOptions);
|
|
207
218
|
if (picked === undefined) return undefined;
|
|
208
|
-
if (
|
|
209
|
-
const customResponse = await ctx.ui.input(params.question,
|
|
210
|
-
return customResponse === undefined ? undefined : { customResponse };
|
|
219
|
+
if (offerCustom && picked === CUSTOM_RESPONSE_LABEL) {
|
|
220
|
+
const customResponse = await ctx.ui.input(params.question, CUSTOM_RESPONSE_PLACEHOLDER);
|
|
221
|
+
return customResponse === undefined || customResponse.trim() === "" ? undefined : { customResponse };
|
|
211
222
|
}
|
|
212
223
|
const index = params.options.findIndex((choiceOption) => choiceOption.label === picked);
|
|
213
224
|
const option = params.options[index];
|
|
@@ -219,10 +230,15 @@ export default function askUserChoice(pi: ExtensionAPI): void {
|
|
|
219
230
|
name: CHOICE_TOOL_NAME,
|
|
220
231
|
renderShell: "self",
|
|
221
232
|
label: "Ask User Choice",
|
|
222
|
-
description: "Ask one single-select question with two to four ordered options. A
|
|
233
|
+
description: "Ask one single-select question with two to four ordered options. A \"Type your answer\" free-text entry is shown unless allowCustomResponse is false.",
|
|
234
|
+
promptSnippet: "Ask one single-select question with 2-4 options plus a default Type your answer entry",
|
|
223
235
|
promptGuidelines: [
|
|
224
|
-
"Use ask_user_choice only
|
|
225
|
-
"
|
|
236
|
+
"Use ask_user_choice only when a genuine human decision remains and one single-select question with two to four ordered options represents it exactly; when no genuine human decision remains, execute the authorized work without asking, and a technical decision the agent owns never becomes an ask_user_choice call.",
|
|
237
|
+
"When ask_user_choice is available for a genuine human decision it represents, use it instead of asking in text.",
|
|
238
|
+
"ask_user_choice is never a text fallback: text is the route only for a genuinely open clarification or no usable compatible interface.",
|
|
239
|
+
"Ordinary contextual approval of an action the human already understands needs no ask_user_choice call and stays valid as text, never as a provider-owned consent answer.",
|
|
240
|
+
"ask_user_choice shows a \"Type your answer\" free-text entry by default, so keep two to four concrete options and never add an Other option.",
|
|
241
|
+
"Pass allowCustomResponse: false to ask_user_choice for provider-owned consent prompts, maintenance authorizations, or any decision that requires an exact opaque token.",
|
|
226
242
|
],
|
|
227
243
|
parameters: ChoiceParamsSchema,
|
|
228
244
|
executionMode: "sequential",
|
|
@@ -250,8 +266,8 @@ export default function askUserChoice(pi: ExtensionAPI): void {
|
|
|
250
266
|
description: option.description,
|
|
251
267
|
}));
|
|
252
268
|
const customItemId = "choice-custom-response";
|
|
253
|
-
if (params
|
|
254
|
-
items.push({ id: customItemId, label:
|
|
269
|
+
if (allowsCustomResponse(params)) {
|
|
270
|
+
items.push({ id: customItemId, label: CUSTOM_RESPONSE_LABEL, description: "Answer in your own words" });
|
|
255
271
|
}
|
|
256
272
|
let selection: ChoiceResult | undefined;
|
|
257
273
|
try {
|
|
@@ -295,6 +311,8 @@ export default function askUserChoice(pi: ExtensionAPI): void {
|
|
|
295
311
|
}
|
|
296
312
|
};
|
|
297
313
|
list.onCancel = () => finish(undefined);
|
|
314
|
+
// Gentle Shell Desktop answers a session outside Herdr app through this list's own finish.
|
|
315
|
+
publishChoiceAnswerHandle(_toolCallId, params, finish, () => completed);
|
|
298
316
|
container.addChild(new DynamicBorder((text: string) => theme.fg("accent", text)));
|
|
299
317
|
container.addChild(new Text(theme.fg("accent", theme.bold(params.question)), 1, 0));
|
|
300
318
|
container.addChild(view);
|
|
@@ -2,8 +2,9 @@ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-a
|
|
|
2
2
|
import { DynamicBorder } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { Text } from "@earendil-works/pi-tui";
|
|
4
4
|
import { captureQuestionnaireAnswers } from "../lib/auto-permission-answers.ts";
|
|
5
|
+
import { publishQuestionnaireAnswerHandle } from "../lib/desktop-feed-answers.ts";
|
|
5
6
|
import { createNativeFullscreenInteraction } from "../lib/native-fullscreen-interaction.ts";
|
|
6
|
-
import { type QuestionData, type QuestionParams, QuestionParamsSchema } from "../lib/questionnaire/schema.ts";
|
|
7
|
+
import { CUSTOM_ROW_LABEL, type QuestionData, type QuestionParams, QuestionParamsSchema } from "../lib/questionnaire/schema.ts";
|
|
7
8
|
import {
|
|
8
9
|
QuestionnaireView,
|
|
9
10
|
type AnswerRow,
|
|
@@ -64,14 +65,40 @@ function cancelledResult(): QuestionnaireToolResult {
|
|
|
64
65
|
/** Label for the trailing "finish this question" entry in a multiSelect round. */
|
|
65
66
|
const MULTI_SELECT_DONE_LABEL = "Done";
|
|
66
67
|
|
|
67
|
-
/**
|
|
68
|
+
/** Placeholder of the RPC-dialog free-text input behind the CUSTOM_ROW_LABEL entry. */
|
|
69
|
+
const CUSTOM_INPUT_PLACEHOLDER = "Type your answer";
|
|
70
|
+
|
|
71
|
+
/** One toggle round's select prompt: `[x] label` / `[ ] label` plus Done and the free-text row. */
|
|
68
72
|
function multiSelectRoundOptions(question: QuestionData, toggled: readonly boolean[]): string[] {
|
|
69
73
|
return [
|
|
70
74
|
...question.options.map((choiceOption, index) => `${toggled[index] ? "[x]" : "[ ]"} ${choiceOption.label}`),
|
|
71
75
|
MULTI_SELECT_DONE_LABEL,
|
|
76
|
+
CUSTOM_ROW_LABEL,
|
|
72
77
|
];
|
|
73
78
|
}
|
|
74
79
|
|
|
80
|
+
/**
|
|
81
|
+
* RPC-dialog equivalent of the TUI's always-available free-text row. A
|
|
82
|
+
* cancelled or whitespace-only input cancels (the TUI discards it), so no
|
|
83
|
+
* partial answer commits. A multiSelect custom answer keeps its toggles, as
|
|
84
|
+
* in the TUI. Validation reserves CUSTOM_ROW_LABEL, so no option collides.
|
|
85
|
+
*/
|
|
86
|
+
async function askCustomAnswer(
|
|
87
|
+
ctx: Pick<ExtensionContext, "ui">,
|
|
88
|
+
question: QuestionData,
|
|
89
|
+
selected: readonly string[] = [],
|
|
90
|
+
): Promise<AnswerRow | undefined> {
|
|
91
|
+
const text = await ctx.ui.input(`${question.header}: ${question.question}`, CUSTOM_INPUT_PLACEHOLDER);
|
|
92
|
+
if (text === undefined || text.trim().length === 0) return undefined;
|
|
93
|
+
return {
|
|
94
|
+
questionIndex: -1, // overwritten by the caller with the question's position
|
|
95
|
+
question: question.question,
|
|
96
|
+
kind: "custom",
|
|
97
|
+
answer: text,
|
|
98
|
+
...(question.multiSelect && selected.length > 0 ? { selected: [...selected] } : {}),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
75
102
|
/**
|
|
76
103
|
* Floor for the toggle-round safety cap so a misbehaving or chatty host
|
|
77
104
|
* cannot spin this loop forever, and every question -- however few options
|
|
@@ -120,6 +147,9 @@ export async function askMultiSelect(
|
|
|
120
147
|
if (picked === undefined) return undefined;
|
|
121
148
|
const pickedIndex = roundOptions.indexOf(picked);
|
|
122
149
|
if (pickedIndex === question.options.length) return finishMultiSelect(question, toggled); // explicit Done
|
|
150
|
+
if (pickedIndex === question.options.length + 1) {
|
|
151
|
+
return askCustomAnswer(ctx, question, question.options.filter((_choiceOption, index) => toggled[index]).map((choiceOption) => choiceOption.label));
|
|
152
|
+
}
|
|
123
153
|
if (pickedIndex === -1) return undefined; // unrecognised answer: never commit a partial state
|
|
124
154
|
toggled[pickedIndex] = !toggled[pickedIndex];
|
|
125
155
|
if (toggled.every(Boolean)) return finishMultiSelect(question, toggled);
|
|
@@ -135,8 +165,9 @@ async function askSingleSelect(
|
|
|
135
165
|
question: QuestionData,
|
|
136
166
|
): Promise<AnswerRow | undefined> {
|
|
137
167
|
const labels = question.options.map((choiceOption) => choiceOption.label);
|
|
138
|
-
const picked = await ctx.ui.select(`${question.header}: ${question.question}`, labels);
|
|
168
|
+
const picked = await ctx.ui.select(`${question.header}: ${question.question}`, [...labels, CUSTOM_ROW_LABEL]);
|
|
139
169
|
if (picked === undefined) return undefined;
|
|
170
|
+
if (picked === CUSTOM_ROW_LABEL) return askCustomAnswer(ctx, question);
|
|
140
171
|
const chosen = question.options.find((choiceOption) => choiceOption.label === picked);
|
|
141
172
|
return {
|
|
142
173
|
questionIndex: -1, // overwritten by the caller with the question's position
|
|
@@ -151,9 +182,9 @@ async function askSingleSelect(
|
|
|
151
182
|
* Interactive-RPC-host fallback for the TUI questionnaire: one
|
|
152
183
|
* `ctx.ui.select` dialog per question (looped for multiSelect), keeping the
|
|
153
184
|
* exact TUI result shapes. A cancel on any question cancels the whole
|
|
154
|
-
* questionnaire, matching the TUI Escape key.
|
|
155
|
-
* free-text
|
|
156
|
-
*
|
|
185
|
+
* questionnaire, matching the TUI Escape key. Every question also offers
|
|
186
|
+
* the TUI's always-available free-text row (CUSTOM_ROW_LABEL) through
|
|
187
|
+
* `ctx.ui.input`.
|
|
157
188
|
*/
|
|
158
189
|
async function askThroughDialogs(
|
|
159
190
|
ctx: Pick<ExtensionContext, "ui">,
|
|
@@ -246,13 +277,17 @@ export default function askUserQuestion(pi: ExtensionAPI): void {
|
|
|
246
277
|
renderShell: "self",
|
|
247
278
|
label: "Ask User Question",
|
|
248
279
|
description: "Ask one to four structured questions in a single call, each with two to four ordered options, and read the user's answers back in one result.",
|
|
280
|
+
promptSnippet: "Ask one to four structured questions in one call (2-4 ordered options each)",
|
|
249
281
|
promptGuidelines: [
|
|
250
|
-
"Use ask_user_question
|
|
282
|
+
"Use ask_user_question only when a genuine human decision remains and one to four structured questions represent it exactly; when no genuine human decision remains, execute the authorized work without asking, and a technical decision the agent owns never becomes an ask_user_question call.",
|
|
283
|
+
"When ask_user_question is available for a genuine human decision it represents, use it instead of asking in text.",
|
|
284
|
+
"Batch independent ordinary decisions as separate questions in one ask_user_question call, never one ask per decision.",
|
|
285
|
+
"Ordinary contextual approval of an action the human already understands needs no ask_user_question call and stays valid as text, never as a provider-owned consent answer.",
|
|
251
286
|
"Keep each header a short chip of at most 16 characters and each option label at most 60 characters.",
|
|
252
287
|
"Add a preview to an option when the user needs to compare rich detail side-by-side with the options.",
|
|
253
288
|
"Set multiSelect when the choices are not mutually exclusive.",
|
|
254
289
|
"The free-text \"Type something.\" row is always available and is also how the user bails out into a normal conversation; never rely on it as a hidden escape hatch.",
|
|
255
|
-
"
|
|
290
|
+
"Consent, maintenance authorizations and exact-token decisions use ask_user_choice, never this tool.",
|
|
256
291
|
],
|
|
257
292
|
parameters: QuestionParamsSchema,
|
|
258
293
|
executionMode: "sequential",
|
|
@@ -283,11 +318,13 @@ export default function askUserQuestion(pi: ExtensionAPI): void {
|
|
|
283
318
|
try {
|
|
284
319
|
pi.events.emit(ASK_USER_QUESTION_BLOCKED_EVENT, { active: true });
|
|
285
320
|
selection = await ctx.ui.custom<QuestionnaireResult>((tui, theme, keybindings, done) => {
|
|
321
|
+
let completed = false;
|
|
322
|
+
const complete = (result: QuestionnaireResult) => { if (!completed) { completed = true; done(result); } };
|
|
286
323
|
const view = new QuestionnaireView({
|
|
287
324
|
questions: params.questions,
|
|
288
325
|
theme,
|
|
289
326
|
keybindings,
|
|
290
|
-
onComplete:
|
|
327
|
+
onComplete: complete,
|
|
291
328
|
rows: () => tui?.terminal?.rows ?? 24,
|
|
292
329
|
});
|
|
293
330
|
// Native dock swap, never an overlay: the transcript stays scrollable
|
|
@@ -297,6 +334,8 @@ export default function askUserQuestion(pi: ExtensionAPI): void {
|
|
|
297
334
|
requestRender: () => tui.requestRender(),
|
|
298
335
|
mouseObserver: view.createMouseObserver(() => tui.requestRender()),
|
|
299
336
|
});
|
|
337
|
+
// Gentle Shell Desktop answers a session outside Herdr app through the view's own completion.
|
|
338
|
+
publishQuestionnaireAnswerHandle(_toolCallId, params.questions, complete, () => completed);
|
|
300
339
|
container.addChild(new DynamicBorder((text: string) => theme.fg("accent", text)));
|
|
301
340
|
container.addChild(view);
|
|
302
341
|
container.addChild(new DynamicBorder((text: string) => theme.fg("accent", text)));
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { filterChildSessionContextFiles, type ContextFileOptions } from "../lib/child-context-files.ts";
|
|
3
|
-
import { REQUESTED_TOOLS_ENV } from "../lib/agents-runner.ts";
|
|
3
|
+
import { CHILD_SKILLS_CATALOG_ENV, REQUESTED_TOOLS_ENV } from "../lib/agents-runner.ts";
|
|
4
4
|
import { registerCodeGraphTool } from "./codegraph-tools.ts";
|
|
5
5
|
|
|
6
6
|
// gentle-shell#1587: delegated children drop the orchestrator-only gentle-ai
|
|
7
|
-
// managed blocks
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
7
|
+
// managed blocks and the engram-protocol memory block from their context files
|
|
8
|
+
// and keep everything else. Gentle Agents passes this file to every child with
|
|
9
|
+
// --extension because children do not load the gentle-pi package in the
|
|
10
|
+
// isolated Gentle Shell home. At startup it also supplies the existing
|
|
11
|
+
// CodeGraph implementation only when explicitly requested and absent (the full
|
|
12
|
+
// package already registers it). Outside a child session it is inert.
|
|
12
13
|
export function createChildContextExtension(env: NodeJS.ProcessEnv = process.env): (pi: ExtensionAPI) => void {
|
|
13
14
|
return (pi) => {
|
|
14
15
|
const requested = (env[REQUESTED_TOOLS_ENV] ?? "").split(",").map(name => name.trim());
|
|
@@ -22,14 +23,27 @@ export function createChildContextExtension(env: NodeJS.ProcessEnv = process.env
|
|
|
22
23
|
// The filtered copies replace contextFiles on the same options object
|
|
23
24
|
// (pi-claude-bridge rebuilds its prompt from it). This never throws,
|
|
24
25
|
// keeps the original files on any error or malformed markers, and is
|
|
25
|
-
// idempotent: already-filtered content has nothing left to remove.
|
|
26
|
+
// idempotent: already-filtered content has nothing left to remove. The
|
|
27
|
+
// engram-protocol block goes too, because gentle-engram injects its own
|
|
28
|
+
// memory protocol every turn; the file on disk keeps it.
|
|
26
29
|
const options = (event as { systemPromptOptions?: ContextFileOptions | null } | undefined)?.systemPromptOptions;
|
|
27
30
|
filterChildSessionContextFiles(options);
|
|
31
|
+
dropSkillsCatalog(event, env);
|
|
28
32
|
return undefined;
|
|
29
33
|
});
|
|
30
34
|
};
|
|
31
35
|
}
|
|
32
36
|
|
|
37
|
+
// The runner marks the children of the package-owned generic agents, whose
|
|
38
|
+
// parent passes exact skill paths. Emptying the loaded skills in place removes
|
|
39
|
+
// Pi's `<available_skills>` section under every launch form, including skills
|
|
40
|
+
// of a package passed with --extension, which --no-skills keeps.
|
|
41
|
+
function dropSkillsCatalog(event: unknown, env: NodeJS.ProcessEnv): void {
|
|
42
|
+
if (env[CHILD_SKILLS_CATALOG_ENV] !== "1") return;
|
|
43
|
+
const skills = (event as { systemPromptOptions?: { skills?: unknown } | null } | undefined)?.systemPromptOptions?.skills;
|
|
44
|
+
if (Array.isArray(skills)) skills.length = 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
export default function childContextExtension(pi: ExtensionAPI): void {
|
|
34
48
|
createChildContextExtension()(pi);
|
|
35
49
|
}
|