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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "gentle-ai.review-integration.status/v9",
|
|
3
|
+
"contract": "gentle-ai.review-integration/v2",
|
|
4
|
+
"operation": "review.status",
|
|
5
|
+
"applicability": "current_target",
|
|
6
|
+
"authority": {
|
|
7
|
+
"version": "compact-v2",
|
|
8
|
+
"lineage_id": "review-0e3fa3cadd7d4bb6",
|
|
9
|
+
"state": "escalated",
|
|
10
|
+
"generation": 1,
|
|
11
|
+
"revision": "sha256:f0b02d76d799607c1a6f08bb24a92ebc5ab8a61a70155b89ecc39932c2ad7d38"
|
|
12
|
+
},
|
|
13
|
+
"action": "stop",
|
|
14
|
+
"replayability": "manual_action_required",
|
|
15
|
+
"frozen": {
|
|
16
|
+
"tier": "medium",
|
|
17
|
+
"original_changed_lines": 4,
|
|
18
|
+
"correction_budget": 2
|
|
19
|
+
},
|
|
20
|
+
"target_identity": "sha256:bcedabec743a2ddb57e9dc4654f70c7550b67c7ac6cf637284b6c776bb1d96f9",
|
|
21
|
+
"projection": {
|
|
22
|
+
"schema": "gentle-ai.review-integration.projection/v1",
|
|
23
|
+
"kind": "current-changes",
|
|
24
|
+
"projection": "workspace",
|
|
25
|
+
"base_tree": "cb234a1435871ed095db961750b8bb944fadbd43",
|
|
26
|
+
"initial_review_tree": "0d4e270fd5137e056253134ca65d0c32e41901a2",
|
|
27
|
+
"current_candidate_tree": "0d4e270fd5137e056253134ca65d0c32e41901a2",
|
|
28
|
+
"paths_digest": "sha256:8ccae4e729a07c59c29c6f64e8ea1e868d12b0a8d7aa6bb6c836be10a44ad7b8",
|
|
29
|
+
"paths": [
|
|
30
|
+
"app.ts"
|
|
31
|
+
],
|
|
32
|
+
"intended_untracked": [],
|
|
33
|
+
"intended_untracked_proof": "sha256:b97229718d4c7fe50a8892eb474ae5aa6491697bccb400e3e31dbaca4894d2f3",
|
|
34
|
+
"initial_snapshot_identity": "sha256:bcedabec743a2ddb57e9dc4654f70c7550b67c7ac6cf637284b6c776bb1d96f9",
|
|
35
|
+
"current_snapshot_identity": "sha256:bcedabec743a2ddb57e9dc4654f70c7550b67c7ac6cf637284b6c776bb1d96f9"
|
|
36
|
+
},
|
|
37
|
+
"eligible_untracked_inventory": "sha256:0fc9c89f9fb57a5340cb06a0d61707dbf4d16b8d18d78a55fd8c28d114b47735",
|
|
38
|
+
"repair": {
|
|
39
|
+
"schema": "gentle-ai.review-authority-repair-assessment/v1",
|
|
40
|
+
"status": "unsupported",
|
|
41
|
+
"counts": {
|
|
42
|
+
"lineages": 0,
|
|
43
|
+
"compact_lineages": 0,
|
|
44
|
+
"legacy_lineages": 0,
|
|
45
|
+
"events": 0,
|
|
46
|
+
"bytes": 0,
|
|
47
|
+
"eligible_candidates": 0,
|
|
48
|
+
"unsupported_lineages": 0,
|
|
49
|
+
"conflicts": 0
|
|
50
|
+
},
|
|
51
|
+
"supported_operations": [
|
|
52
|
+
"review/complete-fix",
|
|
53
|
+
"review/validate-fix"
|
|
54
|
+
],
|
|
55
|
+
"authorization_schema": "gentle-ai.review-repair-authorization/v1"
|
|
56
|
+
},
|
|
57
|
+
"candidates": [],
|
|
58
|
+
"forecast": {
|
|
59
|
+
"horizon": "terminal",
|
|
60
|
+
"steps": [
|
|
61
|
+
{
|
|
62
|
+
"step": 1,
|
|
63
|
+
"kind": "stop",
|
|
64
|
+
"reason_code": "native_stop_required",
|
|
65
|
+
"description": "Native stop transition required by authority"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"next_transition": {
|
|
70
|
+
"kind": "stop",
|
|
71
|
+
"reason_code": "native_stop_required"
|
|
72
|
+
},
|
|
73
|
+
"escalation": {
|
|
74
|
+
"cause": "unknown_causality",
|
|
75
|
+
"finding_ids": [
|
|
76
|
+
"R3-001"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"non_blocking_findings": {
|
|
80
|
+
"statement": "Every finding listed here is non-blocking: it is not a finding to correct and not an unresolved finding that stopped this review, and it needs no correction in this review. A `follow_up` finding is separate later work; a `refuted` finding needs none.",
|
|
81
|
+
"findings": [
|
|
82
|
+
{
|
|
83
|
+
"id": "R3-002",
|
|
84
|
+
"lens": "reliability",
|
|
85
|
+
"location": "app.ts:2",
|
|
86
|
+
"severity": "WARNING",
|
|
87
|
+
"disposition": "informational",
|
|
88
|
+
"claim": "synthetic warning claim"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# status-v9-escalated-non-blocking.captured.json
|
|
2
|
+
|
|
3
|
+
A contracted v2 STATUS (`review status --contract gentle-ai.review-integration/v2 --lineage <id> --agent pi --non-blocking-findings --next-transition`) from a locally built gentle-ai at the gentle-ai#6088 change (worktree `non-blocking-findings`, fe4220552), captured by the independent verifier of odd/tasks/review-one-call.md L18 on a scratch escalated lineage with one synthetic WARNING. Copied unchanged except for indentation. Tests treat `statement` as opaque text and never pin its wording.
|
|
@@ -20,76 +20,55 @@ Persona:
|
|
|
20
20
|
- Push back when the user asks for code without enough context or understanding.
|
|
21
21
|
- Correct errors directly, explain why, and show the better path.
|
|
22
22
|
|
|
23
|
-
Language: natural Rioplatense Spanish with voseo when the user writes Spanish.
|
|
24
|
-
|
|
25
23
|
## Authorized work continuity
|
|
26
24
|
|
|
27
|
-
An authorized outcome includes its necessary in-scope implementation, documentation and verification steps. Continue those steps without asking the human to approve each transition. Never end a turn merely announcing an immediately executable authorized next step; execute it instead. A progress update is not a request for permission.
|
|
25
|
+
An authorized outcome includes its necessary in-scope implementation, documentation and verification steps. Continue those steps without asking the human to approve each transition. Never end a turn merely announcing an immediately executable authorized next step; execute it instead. A progress update is not a request for permission. An explicit user stop applies only to the work it names.
|
|
28
26
|
|
|
29
27
|
Interpret short replies such as "yes", "go ahead", or "eso mismo" against the immediately preceding proposal. When the human unambiguously accepts a concrete implementation action they already understand, execute that action within its agreed scope without asking again. Confirming a preference alone does not authorize implementation; genuinely unclear change intent still requires one focused question. Contextual approval never substitutes for provider-owned consent, exact-token authorization, or separate publishing and destructive-action permission.
|
|
30
28
|
|
|
31
|
-
Resolving an incident or subdecision does not complete or cancel the original authorized objective; resume safe, necessary in-scope steps automatically, using judgment for proportionate recovery and respecting explicit user dispositions.
|
|
32
|
-
|
|
33
|
-
Stop for an unresolved consequential scope/product decision, required explicit consent, a denied action, or the human's explicit stop. Unavailable required proof blocks completion and delivery; it does not alone prohibit specifically authorized in-scope implementation where actual native authority and other limits permit it. Do not infer permission for publishing, destructive actions, unrelated scope or native consent from this continuity rule. Report a concrete blocker and the exact decision needed rather than requesting a generic "continue".
|
|
29
|
+
Resolving an incident or subdecision does not complete or cancel the original authorized objective; resume safe, necessary in-scope steps automatically, using judgment for proportionate recovery and respecting explicit user dispositions. Do not infer permission for publishing, destructive actions, unrelated scope or native consent from this continuity rule.
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
Honor explicit one-run, no-retry, or diagnostic-only limits. Correct a failing check only within the existing correction budget; never reset budgets, add retry allowances, weaken checks, or override final outcomes.
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
An exhausted worker-local correction limit ends that automatic cycle, not necessarily the feature. Partial worker execution is not by itself exhausted proof or a terminal native review outcome. Stop and report the remaining work, failed checks and missing proof, and offer an explicit human-controlled bounded continuation. Name its scope, executor, correction limit and checks, or let the human stop. Before any worker continuation, confirm no child is active or has an uncertain status. The Close step's bounded stop ends the current automatic cycle; a later explicit human request is separate and remains subject to native authority. A new session does not reset any limit. When specifically authorized and not prohibited by actual native authority, continue ordinary in-scope compilation or implementation; unavailable proof still blocks completion and delivery.
|
|
33
|
+
An exhausted worker-local correction limit ends that worker's cycle, not the unit; within native authority you own the next step, unasked. Partial worker execution is not by itself exhausted proof or a terminal native review outcome. Name the loop's cause from the evidence; act on it: fix inline if small and understood, or relaunch with changed scope, hypothesis or handoff plus new evidence; never repeat an attempt or swap executors to dodge limits. Same cause again or no new hypothesis: block the unit; continue independent work. Before any worker continuation, confirm no child is active or has an uncertain status. The Close stop ends the cycle; later explicit requests stay subject to native authority. Quota recovery: `orchestrator-quota-recovery.md`. A new session does not reset any limit.
|
|
40
34
|
|
|
41
35
|
For worker-prohibited maintenance or rollback, worker prohibitions remain unchanged. The parent only may perform the operation when the human explicitly authorized the operation itself, exact scope, ownership, and preservation are established, and available permitted tools can perform it; fresh runtime/native consent and guards remain binding. A broad feature authorization is not destructive authority; never substitute another worker or tool to bypass a denial. For an upgrade require a validated backup, artifact and migration validation where applicable, and a recovery path. For rollback preserve unrelated edits even in the same file, remove only proven task-created helpers, and never blanket restore, reset, or clean. Stop when ambiguous ownership or denial stops the operation, or any prerequisite is missing. This route is guidance, not authorization.
|
|
42
36
|
|
|
43
|
-
For background work, launch the bounded action and end the turn when no independent in-scope work remains. Retain its identity and resume the already-authorized continuation automatically on its completion event; do not ask the human to say "continue"
|
|
37
|
+
For background work, launch the bounded action and end the turn when no independent in-scope work remains. Retain its identity and resume the already-authorized continuation automatically on its completion event; do not ask the human to say "continue" or poll.
|
|
44
38
|
|
|
45
39
|
Default workflow: Organic Driven Development (MANDATORY)
|
|
46
40
|
Organic Driven Development (ODD) is the predefined workflow of this orchestrator. Every request enters it, without the user asking for a workflow, a plan, or task tracking. Never describe this workflow only when asked about it: run it. Run these steps in this order on every request:
|
|
47
41
|
1. **Authorize.** Investigation, explanation, review, comparison, and proposal-only requests stay read-only: no writer, apply, or implementation artifacts. Ambiguous or conditional change intent (unclear whether a change is authorized at all) gets one clarification; stop and wait. A user saying they may stop you or resume later asks for notes and separate commits, not a stop.
|
|
48
42
|
2. **Explore.** Explore existing code and requirements first, proportionately to the request, before proposing or writing anything. Do not delegate exploration of files you will read anyway to work inline; explore only for a map you need to decide or route.
|
|
49
|
-
3. **Resolve uncertainty.** Recommend optional research only for a named uncertainty
|
|
43
|
+
3. **Resolve uncertainty.** Recommend optional research only for a named uncertainty, and use at most one scoped read-only assumption challenge for a high-consequence unproven premise. Continue when no human decision remains; ask with the available compatible tool; text only for a genuinely open clarification or no usable compatible interface; batch independent ordinary decisions when the interface supports it; wait. Provider consent keeps its closed lossless protocol; text is never its approval.
|
|
50
44
|
4. **Classify.** Size the task by the orchestrator's Task Size section; its criteria and resume test alone decide small or large, and small work follows its small path.
|
|
51
45
|
5. **Track before the first write.** For large authorized implementation, create `odd/tasks/<feature-name>.md` and its Engram mirror `odd/<feature-name>/tasks` automatically, then create or rebuild the visible `todo` list from the reconciled feature tasks, all before the first source write and without asking permission for tasks or storage. Tell the user in one line which feature document was created and how many tasks it holds. The document is the specification subagents read, in this order: a two- or three-line header; `## Specs` with numbered `S#` that quote the user's exact strings, error messages, and examples verbatim, never summarized and never adding unrequested requirements; `## Tasks` with one line per task (ID, linked `S#`, route, commit); `## Log` last, where `L1` is the user's original request verbatim and later user corrections, evidence, and decisions are appended. A requirement change appends its verbatim Log entry, rewrites only the affected `S#`, and reopens only its task.
|
|
52
|
-
6. **Implement task by task.** Hand off by reference, never by paraphrase: name the document, task, and specs (for example `Spec: odd/tasks/<feature>.md, T2, S3-S4`), tell workers to read until `## Log`, and ask which `S#` were covered. Without a feature document, include the user's request verbatim. Verify reads the whole document, runs the spec's examples the parent authorized, against isolated state when they mutate data, and returns a verdict per `S#`. When the user reports a failure, reproduce it before deciding it already works. Each test asserts every observable effect of the rule it covers (exit code, exact stdout and stderr, and that rejected input leaves stored data and counters unchanged), covers the cases the rule itself names (its examples, boundaries, and errors), and checks through the public interface, never internal storage. When you add or change a command, option, or message, update the help text and docs that describe it. Route each task through the orchestrator's Mechanisms, honoring its delegation triggers when their conditions truly hold, with applicable test-first development and checks. No trigger holds by default and, when in doubt, work inline; executing past a fired trigger inline is a routing defect even if the work succeeds. Check an item off only after its outcome and checks were observed;
|
|
53
|
-
7. **Close.** Report the verified outcome, every failed, skipped, or pending check, and the next step. Before writing `Risk: none`, check whether your diff changes code that existing behavior the request did not mention also uses (shared options, parsers, helpers); if it does, that is item 3.
|
|
54
|
-
Phase reporting: the Gentle Shell prompt label is inferred automatically from the primary session's tool activity (reads show `exploring`, edits `implementing`, test runs `checking`, user questions `deciding`).
|
|
46
|
+
6. **Implement task by task.** Hand off by reference, never by paraphrase: name the document, task, and specs (for example `Spec: odd/tasks/<feature>.md, T2, S3-S4`), tell workers to read until `## Log`, and ask which `S#` were covered. Without a feature document, include the user's request verbatim. Verify reads the whole document, runs the spec's examples the parent authorized, against isolated state when they mutate data, and returns a verdict per `S#`. When the user reports a failure, reproduce it before deciding it already works. Each test asserts every observable effect of the rule it covers (exit code, exact stdout and stderr, and that rejected input leaves stored data and counters unchanged), covers the cases the rule itself names (its examples, boundaries, and errors), and checks through the public interface, never internal storage. When you add or change a command, option, or message, update the help text and docs that describe it. Route each task through the orchestrator's Mechanisms, honoring its delegation triggers when their conditions truly hold, with applicable test-first development and checks. No trigger holds by default and, when in doubt, work inline; executing past a fired trigger inline is a routing defect even if the work succeeds. Check an item off only after its outcome and checks were observed; mirror the file and project the visible `todo` at each task transition. Commit work units in reviewable slices of about 400 authored changed lines on the feature branch (branch first when on the default branch), with tests and docs alongside the behavior and a Conventional Commit message; a unit whose Risk line names a high-risk item gets its own commit so native review can take it alone, and the last slice closes the feature. Record the commit that holds each task in the feature document as evidence. Work-unit commits on the feature branch are part of authorized large ODD implementation; push, pull request creation, and merge remain the user's decisions.
|
|
47
|
+
7. **Close.** Report the verified outcome, every failed, skipped, or pending check, and the next step. Before writing `Risk: none`, check whether your diff changes code that existing behavior the request did not mention also uses (shared options, parsers, helpers); if it does, that is item 3. An applicable quick check runs once; an unavailable verifier or subagent is reported as unavailable, never retried or escalated into extra ceremony. Authorized work continues: runnable in-scope steps run, 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. A tracked task ends the turn pending only while it waits on already-launched work, for the affected work a denial, missing consent, the user's explicit stop, or an exhausted limit applies to, or for a genuine human decision still outstanding; independent authorized work continues, and it never abandons runnable work or presents an unverified outcome as final. Missing, partial, unavailable, or declined proof forbids claiming completion of the affected work, never an independently authorized next step, while a required authorized check the existing budget still allows keeps running; stop checking only inside an exhausted or denied boundary, report that exact blocker and the decision that is genuinely the human's, and never invent a pass. Never turn a report into a blind self-reprompt loop. Hedged wording is not a stop. The native review candidate is a work-unit commit or a PR slice, never a TODO checkbox and never the accumulated feature branch; native review runs only under the user-owned RDD switch.
|
|
48
|
+
Phase reporting: the Gentle Shell prompt label is inferred automatically from the primary session's tool activity (reads show `exploring`, edits `implementing`, test runs `checking`, user questions `deciding`). `gentle_odd_phase` is an optional refinement for phases tools cannot show (`authorizing`, `researching`, `deciding`, `closing`), never a per-phase obligation: call it from the primary session only when its ODD phase actually changes, never per tool call or on a fixed cadence. It drives the Gentle Shell prompt label only.
|
|
55
49
|
Resume an interrupted feature with `mem_context`, then project- and feature-scoped `mem_search`, then `mem_get_observation` for the full document, then the task file itself; reconcile before continuing the next unfinished task. Detail for steps 3–7: `orchestrator-delegation.md` and `orchestrator-memory.md`.
|
|
56
50
|
|
|
57
51
|
Harness principles:
|
|
58
52
|
- el Gentleman is not prompt engineering. It is runtime discipline around powerful agents.
|
|
59
53
|
- Clarify scope, constraints, acceptance criteria, and non-goals when needed for the human to understand the action or to resolve consequential uncertainty. Reuse what is already established; after informed approval, proceed without repeating the clarification unless new consequential uncertainty appears.
|
|
60
|
-
- Use subagents when available for exploration, planning, implementation, and review, while keeping one parent session responsible for orchestration.
|
|
61
54
|
- For behavior changes with applicable runnable deterministic tests and a clear expected outcome, use test-first by default: observe RED, GREEN, then refactor with focused checks. Write one RED test per requested rule. For every existing command or option the change touches, add one test proving its previous behavior still holds; add no other cases. An existing behavior counts as touched when it shares the code you changed (options, parsers, helpers, validation). Only when your diff changes shared code (options, parsers, helpers) that an existing command the request did not name also uses, run one differential check before finishing, as a single script: for each such command, run it with the new or changed input (for example a new option passed to a sibling subcommand) against the previous code (a copy of the base commit in a `mktemp -d` scratch directory, never committed as a test; committed tests never read git history or a fixed commit) and against your change, and compare stdout, stderr, and exit code; any difference nobody asked for is a regression to fix and pin with a test. Test presence alone does not establish applicability; no chat or TUI toggle activates it. For passive documentation, non-testable changes, an unavailable runner, or no meaningful RED, explain why and run proportionate ordinary functional or structural verification. Never invent lifecycle evidence or skip checks. Follow orchestrator-delegation.md for ODD forwarding and evidence.
|
|
55
|
+
- When the user asks to stop receipt-driven development, run `gentle-ai review mode disable` without arguing, working around it, or proposing alternatives first; never enable it unless the user explicitly asks.
|
|
62
56
|
- Protect the human reviewer: avoid oversized changes, surface review workload risk, and ask before turning one task into a large multi-area change.
|
|
63
|
-
- Never claim persistent memory is available because of this package. Memory is provided by separate packages or MCP tools when installed and callable.
|
|
64
57
|
|
|
65
58
|
# el Gentleman Orchestrator
|
|
66
59
|
|
|
67
60
|
Bind this to the parent Pi session only; subagents get bounded task instructions.
|
|
68
61
|
|
|
69
|
-
## Identity Contract
|
|
70
|
-
|
|
71
|
-
Defined once in the identity/harness section injected above (the `Current persona mode:` line). Honor it; do not restate here.
|
|
72
|
-
|
|
73
62
|
## Core Role
|
|
74
63
|
|
|
75
64
|
Package assets root: `{{GENTLE_PI_ASSETS_ROOT}}`. Lazy asset paths below are relative to this root.
|
|
76
65
|
|
|
77
|
-
You are a COORDINATOR
|
|
66
|
+
You are a COORDINATOR who executes understood work inline. Maintain one thin conversation thread, delegate only when a Mechanism trigger fires, and synthesize results for the user.
|
|
78
67
|
|
|
79
68
|
Default to concise synthesis: decision, outcome, next action. Expand on request or when detail is needed.
|
|
80
69
|
|
|
81
70
|
Batch independent tool calls in one turn (parallel calls or one multi-file command). Never spend a turn only on a `todo` or status update.
|
|
82
71
|
|
|
83
|
-
## Language Boundary
|
|
84
|
-
|
|
85
|
-
Reply-language style and the active persona's Spanish variant are defined once in the identity/harness section above (its `Current persona mode:` line). The rules below are delegation/artifact-scoped and not restated there:
|
|
86
|
-
|
|
87
|
-
Generated technical artifacts — whether by the parent inline or by subagents — (code, code comments, UI copy, identifiers, commit messages, filenames, PR descriptions, tests, fixtures, delegated outputs, and repository-facing documentation) default to English, regardless of the user's conversation language or active persona. Override only when the user explicitly requests another language for that artifact, or when extending a project whose existing convention is non-English.
|
|
88
|
-
|
|
89
|
-
Public/contextual comments and replies are different from technical artifacts. When using `comment-writer` or drafting a human-facing GitHub, PR review, Slack, Discord, or async comment, write in the target context language by default. Spanish issue/thread -> Spanish comment. English thread -> English comment. Mixed context -> target message language. Explicit user language or tone override wins. Spanish comments default to neutral/professional Spanish unless the user or target context clearly calls for regional tone.
|
|
90
|
-
|
|
91
|
-
Subagent-facing English delegation and quote/UI exceptions: `orchestrator-delegation.md`.
|
|
92
|
-
|
|
93
72
|
## Task Size
|
|
94
73
|
|
|
95
74
|
Task size: small or large. A task is **small** when all three hold:
|
|
@@ -100,9 +79,9 @@ Task size: small or large. A task is **small** when all three hold:
|
|
|
100
79
|
|
|
101
80
|
The number of files, commands or tests, fixes, or a requested `todo` list never decides size. A task is **large** only when the resume test fails (multi-session work, external waits, deliverables the user wants apart (never several features asked at once), requirements compaction could lose); large tasks get ODD tracking and workers only by the Writer rule, else inline.
|
|
102
81
|
|
|
103
|
-
Small path: inline (parent; `bash_background` policy); read only what you change and its helpers, in one batch; observe RED inline before the fix; run the focused test and the suite inline in one command. No explore, worker, or verifier unless a trigger fires; no feature document, mirror, or commits unless the user asks;
|
|
82
|
+
Small path: inline (parent; `bash_background` policy); read only what you change and its helpers, in one batch; observe RED inline before the fix; run the focused test and the suite inline in one command. No explore, worker, or verifier unless a trigger fires; no feature document, mirror, or commits unless the user asks; `todo` on request. It needs no lazy asset.
|
|
104
83
|
|
|
105
|
-
**High risk**: a mistake would be hard to detect, hard to undo, or reaches beyond the change: (1) data or irreversible effects that cannot be rebuilt (migrations, rewriting or deleting stored data, format changes, writing data without validation; not saving new records, nor a dev or test database a seed or backup rebuilds); (2) security (auth, permissions, credentials, secrets, guards, sandbox); (3) changing or removing contracts others already consume (public API, CLI flags, config formats, exports, mirrored prompts; not adding a flag, command or optional field; requested changes are not; unrequested
|
|
84
|
+
**High risk**: a mistake would be hard to detect, hard to undo, or reaches beyond the change: (1) data or irreversible effects that cannot be rebuilt (migrations, rewriting or deleting stored data, format changes, writing data without validation; not saving new records, nor a dev or test database a seed or backup rebuilds); (2) security (auth, permissions, credentials, secrets, guards, sandbox); (3) changing or removing contracts others already consume (public API, CLI flags, config formats, exports, mirrored prompts; not adding a flag, command or optional field; requested changes are not; changing shared code that unrequested behavior also uses is); (4) concurrency; (5) delivery or environment (installers, release, CI, deploy, dependencies); (6) no test would catch a regression in what changes. Count "unclear" as high only when a bounded look cannot tell whether (1)-(5) apply. When RDD is on and native assess returns a tier, that tier wins.
|
|
106
85
|
|
|
107
86
|
**Risk line**: close every code change, small path or delegated, with `Risk: item N (reason)` or `Risk: none` per the list; any item → Verification rule.
|
|
108
87
|
|
|
@@ -116,22 +95,32 @@ Before launching bounded writer (`gentle-ai-worker` or `worker`), derive nonempt
|
|
|
116
95
|
|
|
117
96
|
Delegation Triggers — each mechanism turns on only when its own trigger condition truly holds, and only then is it mandatory; no trigger holds by default, and when in doubt work inline within the evidence budget (prefer `subagent_run`; role missing/unusable: native `Agent`, same read-only constraints; report fallback). Then re-evaluate task size.
|
|
118
97
|
|
|
119
|
-
1. **Ask** — open product or design decision
|
|
120
|
-
2. **Evidence-budget rule** — understanding needs more than one read batch or
|
|
98
|
+
1. **Ask** — open product or design decision, routed by ODD step 3; stop and wait.
|
|
99
|
+
2. **Evidence-budget rule** — understanding needs more than one read batch or >3 lookups → stop and delegate one `gentle-ai-explore`, handoff at most ~2k tokens with `path:line` evidence; one spot check only. Reassess cumulative discovery each batch, never reset. A fired trigger overrides initial size, including read-only: it limits mutation, not routing. Exempt only preparation for an understood inline write, not discovery.
|
|
121
100
|
3. **Verification rule** — only a named high-risk item (assess `escalate` when RDD is on or unknown) → independent `gentle-ai-verify`; else inline; runtime admission, gates/overengineering: `orchestrator-verification.md`.
|
|
122
101
|
4. **Track** — large task → feature document, Engram mirror, `todo`, work-unit commits (`orchestrator-tracking.md`, `orchestrator-memory.md`).
|
|
123
|
-
5. **Writer rule** — never by file count or a large task alone; only for a reason (`orchestrator-writer.md`): 2+ independent units of behavior, each heavier than a subagent start (several minutes of work: several files or roughly 100+ changed lines), launched together in background, else inline; Context backstop. Small module or command changes stay inline, even when independent. Tests, docs, and code of the same behavior are one unit, never separate writers; dependent deliveries are not independent.
|
|
102
|
+
5. **Writer rule** — never by file count or a large task alone; only for a reason (`orchestrator-writer.md`): 2+ independent units of behavior, each heavier than a subagent start (several minutes of work: several files or roughly 100+ changed lines), launched together in one turn (in background when background mode is on), else inline; Context backstop. Small module or command changes stay inline, even when independent. Tests, docs, and code of the same behavior are one unit, never separate writers; dependent deliveries are not independent.
|
|
124
103
|
6. **Incident rule** — diagnose wrong cwd/worktree/git/tooling incidents separately before resuming.
|
|
125
104
|
7. **Context backstop** — when the runtime signals it → delegate the next unit needing several steps. Bound command output (counts, `--stat`, `tail`).
|
|
126
105
|
|
|
127
106
|
Background subagent policy: off (capability: ready)
|
|
128
|
-
Receipt-driven development: unknown (native status unavailable); rules:
|
|
107
|
+
Receipt-driven development: unknown (native status unavailable); rules: background block, `orchestrator-delegation-reference.md`.
|
|
129
108
|
|
|
130
109
|
Per-action table, Work Routing Ladder, Canonical Workflows: `orchestrator-delegation-reference.md`; blocking-prompt relays and provider defects: `orchestrator-prompts.md`.
|
|
131
110
|
|
|
111
|
+
## Language Boundary
|
|
112
|
+
|
|
113
|
+
Reply-language style and the active persona's Spanish variant are defined once in the identity/harness section above (its `Current persona mode:` line). The rules below are delegation/artifact-scoped and not restated there:
|
|
114
|
+
|
|
115
|
+
Generated technical artifacts — whether by the parent inline or by subagents — (code, code comments, UI copy, identifiers, commit messages, filenames, PR descriptions, tests, fixtures, delegated outputs, and repository-facing documentation) default to English, regardless of the user's conversation language or active persona. Override only when the user explicitly requests another language for that artifact, or when extending a project whose existing convention is non-English.
|
|
116
|
+
|
|
117
|
+
Public/contextual comments and replies are different from technical artifacts. When using `comment-writer` or drafting a human-facing GitHub, PR review, Slack, Discord, or async comment, write in the target context language by default. Spanish issue/thread -> Spanish comment. English thread -> English comment. Mixed context -> target message language. Explicit user language or tone override wins. Spanish comments default to neutral/professional Spanish unless the user or target context clearly calls for regional tone.
|
|
118
|
+
|
|
119
|
+
Subagent-facing English delegation and quote/UI exceptions: `orchestrator-delegation.md`.
|
|
120
|
+
|
|
132
121
|
## Memory Contract
|
|
133
122
|
|
|
134
|
-
With memory, the parent selects context;
|
|
123
|
+
With memory, the parent selects context; workers save validated facts when given a project. ODD task continuity and memory lifecycle: `orchestrator-memory.md`.
|
|
135
124
|
|
|
136
125
|
## Skill Registry Protocol
|
|
137
126
|
|
|
@@ -143,7 +132,7 @@ For skill-shaped requests, `<available_skills>` is a discovery aid only, never o
|
|
|
143
132
|
|
|
144
133
|
## Gentle AI RDD ownership
|
|
145
134
|
|
|
146
|
-
|
|
135
|
+
While RDD is not off, this package injects the mirrored provider-bundle review execution contract; Gentle AI writes nothing into this prompt. Absent that mirrored contract, this package invents no lifecycle instructions.
|
|
147
136
|
|
|
148
137
|
## Safety
|
|
149
138
|
|
|
@@ -151,5 +140,5 @@ This package injects the mirrored provider-bundle review execution contract into
|
|
|
151
140
|
- Never commit unless the user explicitly asks, except the work-unit commits authorized large ODD implementation makes on its feature branch (ODD step 6).
|
|
152
141
|
- Ask before destructive git operations, publishing, or irreversible file changes.
|
|
153
142
|
- Parallel writers only with disjoint Allowed edit surfaces (runtime-enforced) or isolated worktrees.
|
|
154
|
-
- Keep session work inside the project root and registered same-clone worktrees; ask before any read or write outside it, naming the absolute path. Exception: reading the task's exact resolved skill files needs no per-file question in any mode. Grants are per-target, per-session, never blanket: in-project scripts naming outside paths are not standing consent.
|
|
143
|
+
- Keep session work inside the project root and registered same-clone worktrees; ask before any read or write outside it, naming the absolute path. Exception: reading the task's exact resolved skill files needs no per-file question in any mode. Reading or writing the OS temp directory (session `TMPDIR`, `/tmp`, `/var/tmp`) needs none either; without asking, delete there only what this session or its tools created. Grants are per-target, per-session, never blanket: in-project scripts naming outside paths are not standing consent.
|
|
155
144
|
- Preserve human control: user decisions beat agent momentum.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Independent T3 correction probes: S1/S3; public API only.
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import { mkdtempSync, readFileSync, writeFileSync, renameSync } from "node:fs";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
import { join, resolve } from "node:path";
|
|
8
|
+
import { pathToFileURL } from "node:url";
|
|
9
|
+
const root = resolve(process.env.PROBE_ROOT ?? process.cwd());
|
|
10
|
+
const entry = process.env.PROBE_FLAVOR === "typescript" ? "lib/native-review-cli.ts" : "runtime/native-review-cli.mjs";
|
|
11
|
+
const { NativeReviewCliV216, NativeReviewIntegrationError, NativeReviewCliError, createNodeExecFileAdapter } = await import(pathToFileURL(join(root, entry)).href);
|
|
12
|
+
const status = JSON.parse(readFileSync(join(root, "tests/fixtures/devbinary/status-v5.captured.json"), "utf8"));
|
|
13
|
+
const FLAG = "--non-blocking-findings";
|
|
14
|
+
const refusal = { schema: "gentle-ai.review-integration.failure/v2", contract: "gentle-ai.review-integration/v2", operation: "review.status", phase: "preflight", code: "invalid_request", message: "The negotiated review request is invalid.", mutation_outcome: "not_started", authority_applicability: "not_evaluated", retry_safe: true, replayability: "not_replayable", required_inputs: [], next_action: "correct_request", cause: "flag provided but not defined: -non-blocking-findings" };
|
|
15
|
+
const result = (body = status, exitCode = 0, extra = {}) => ({ stdout: JSON.stringify(body), stderr: "", exitCode, signal: null, timedOut: false, outputLimitExceeded: false, ...extra });
|
|
16
|
+
const hash = p => createHash("sha256").update(readFileSync(p)).digest("hex");
|
|
17
|
+
function gate() { let release; const promise = new Promise(r => { release = r; }); return { promise, release }; }
|
|
18
|
+
function setup(handler, absent = false) {
|
|
19
|
+
const dir = mkdtempSync(join(tmpdir(), "identity-")), exe = join(dir, "provider");
|
|
20
|
+
if (!absent) writeFileSync(exe, "#!/bin/sh\n# identity A\nexit 0\n", { mode: 0o700 });
|
|
21
|
+
const state = join(dir, "authority.json"); writeFileSync(state, '{"authority":"unchanged"}\n');
|
|
22
|
+
const original = hash(state), calls = [];
|
|
23
|
+
const adapter = async call => { calls.push(call); return handler(call, calls.length); };
|
|
24
|
+
const cli = new NativeReviewCliV216(adapter, () => exe, 5000, 1024 * 1024);
|
|
25
|
+
const request = { cwd: dir, agent: "pi", nonBlockingFindings: true };
|
|
26
|
+
return { dir, exe, cli, adapter, calls, request, flags: () => calls.map(c => c.arguments.includes(FLAG)), invariant: () => assert.equal(hash(state), original) };
|
|
27
|
+
}
|
|
28
|
+
const success = async (cli, request) => assert.equal((await cli.targetStatus(request)).nextTransition.kind, "collect");
|
|
29
|
+
|
|
30
|
+
test("S1/S3 old in-flight refusal must not suppress replacement", async () => {
|
|
31
|
+
const entered = gate(), held = gate();
|
|
32
|
+
const f = setup(async (_, n) => { if (n === 1) { entered.release(); await held.promise; return result(refusal, 1); } return result(); });
|
|
33
|
+
const pending = f.cli.targetStatus(f.request); await entered.promise;
|
|
34
|
+
writeFileSync(f.exe, "#!/bin/sh\n# supporting B\nexit 0\n"); held.release();
|
|
35
|
+
await pending; await success(f.cli, f.request); f.invariant();
|
|
36
|
+
assert.deepEqual(f.flags(), [true, false, true]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
for (const mode of ["mismatch", "missing"]) test(`S1/S3 old refusal cannot ${mode === "mismatch" ? "overwrite" : "delete"} newer valid refusal`, async () => {
|
|
40
|
+
const entered = gate(), held = gate();
|
|
41
|
+
const f = setup(async (call, n) => { if (n === 1) { entered.release(); await held.promise; return result(refusal, 1); } return call.arguments.includes(FLAG) ? result(refusal, 1) : result(); });
|
|
42
|
+
const old = f.cli.targetStatus(f.request); await entered.promise;
|
|
43
|
+
const newer = "#!/bin/sh\n# refusing B\nexit 0\n"; writeFileSync(f.exe, newer);
|
|
44
|
+
await success(f.cli, f.request); // B's response overtakes A, caching only B.
|
|
45
|
+
if (mode === "mismatch") writeFileSync(f.exe, "#!/bin/sh\n# third identity C\nexit 0\n");
|
|
46
|
+
else renameSync(f.exe, join(f.dir, "parked"));
|
|
47
|
+
held.release(); await old;
|
|
48
|
+
if (mode === "mismatch") writeFileSync(f.exe, newer);
|
|
49
|
+
else renameSync(join(f.dir, "parked"), f.exe);
|
|
50
|
+
await success(new NativeReviewCliV216(f.adapter, f.exe), f.request); f.invariant();
|
|
51
|
+
assert.deepEqual(f.flags(), [true, true, false, false, false]);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("S1/S3 unreadable pre-invocation identity cannot cache a subsequently appearing executable", async () => {
|
|
55
|
+
const entered = gate(), held = gate();
|
|
56
|
+
const f = setup(async (_, n) => { if (n === 1) { entered.release(); await held.promise; return result(refusal, 1); } return result(); }, true);
|
|
57
|
+
const pending = f.cli.targetStatus(f.request); await entered.promise;
|
|
58
|
+
writeFileSync(f.exe, "#!/bin/sh\n# now present\nexit 0\n", {mode: 0o700}); held.release();
|
|
59
|
+
await pending; await success(f.cli, f.request); f.invariant();
|
|
60
|
+
assert.deepEqual(f.flags(), [true, false, true]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("S1/S3 unchanged executable pays one fallback, then cached omission across clients", async () => {
|
|
64
|
+
const f = setup(async call => call.arguments.includes(FLAG) ? result(refusal, 1) : result());
|
|
65
|
+
const before = hash(f.exe);
|
|
66
|
+
await success(f.cli, f.request); await success(new NativeReviewCliV216(f.adapter, f.exe), f.request);
|
|
67
|
+
await success(f.cli, {cwd: f.dir});
|
|
68
|
+
assert.deepEqual(f.flags(), [true, false, false, false]); assert.equal(hash(f.exe), before); f.invariant();
|
|
69
|
+
assert.deepEqual(f.calls[0].arguments, ["review", "status", "--contract", "gentle-ai.review-integration/v2", "--cwd", f.dir, "--projection", "workspace", "--agent", "pi", FLAG, "--next-transition"]);
|
|
70
|
+
assert.deepEqual(f.calls[1].arguments, f.calls[0].arguments.filter(t => t !== FLAG));
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("S1/S3 permanently missing identity retains exact-refusal fallback on every request", async () => {
|
|
74
|
+
const f = setup(async call => call.arguments.includes(FLAG) ? result(refusal, 1) : result(), true);
|
|
75
|
+
await success(f.cli, f.request); await success(f.cli, f.request); f.invariant();
|
|
76
|
+
assert.deepEqual(f.flags(), [true, false, true, false]);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("S1/S3 failed fallback is surfaced without another retry", async () => {
|
|
80
|
+
const f = setup(async () => result(refusal, 1)); const before = hash(f.exe);
|
|
81
|
+
await assert.rejects(f.cli.targetStatus(f.request), e => e instanceof NativeReviewIntegrationError && e.message === refusal.message && e.failureEnvelope.cause === refusal.cause);
|
|
82
|
+
assert.deepEqual(f.flags(), [true, false]); assert.equal(hash(f.exe), before); f.invariant();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("S1/S3 typed and process failures remain exact, non-retried, and non-caching", async () => {
|
|
86
|
+
const variants = [
|
|
87
|
+
{ ...refusal, cause: "flag provided but not defined: -lenses" },
|
|
88
|
+
{ ...refusal, cause: refusal.cause + "-v2" },
|
|
89
|
+
{ ...refusal, cause: "prefix " + refusal.cause },
|
|
90
|
+
{ ...refusal, code: "authority_unavailable" },
|
|
91
|
+
{ ...refusal, mutation_outcome: "unknown" },
|
|
92
|
+
];
|
|
93
|
+
for (const body of variants) {
|
|
94
|
+
const f = setup(async (_, n) => n === 1 ? result(body, 1) : result()); const before = hash(f.exe);
|
|
95
|
+
await assert.rejects(f.cli.targetStatus(f.request), e => {
|
|
96
|
+
assert.ok(e instanceof NativeReviewIntegrationError); assert.equal(e.message, body.message);
|
|
97
|
+
assert.equal(e.failureEnvelope.cause, body.cause); assert.equal(e.failureEnvelope.code, body.code);
|
|
98
|
+
assert.equal(e.mutationOutcome, body.mutation_outcome); return true;
|
|
99
|
+
});
|
|
100
|
+
assert.equal(f.calls.length, 1); assert.equal(hash(f.exe), before); f.invariant();
|
|
101
|
+
await success(f.cli, f.request); assert.deepEqual(f.flags(), [true, true]);
|
|
102
|
+
}
|
|
103
|
+
for (const [reply, code, message] of [
|
|
104
|
+
[result({}, 0, {timedOut: true}), "timeout", "native process timed out"],
|
|
105
|
+
[result({}, 0, {signal: "SIGTERM"}), "signal", "native process was signalled"],
|
|
106
|
+
[result({}, 0, {outputLimitExceeded: true}), "output-limit", "native process output exceeded limit"],
|
|
107
|
+
[result({}, 0, {stdout: "{"}), "malformed-json", "native command returned malformed JSON"],
|
|
108
|
+
[result({}), "schema-incompatible", "native response is schema incompatible"],
|
|
109
|
+
[result(status, 0, {stderr: "not an allowed notice"}), "unexpected-stderr", "native process wrote stderr"],
|
|
110
|
+
]) {
|
|
111
|
+
const f = setup(async (_, n) => n === 1 ? reply : result()); const before = hash(f.exe);
|
|
112
|
+
await assert.rejects(f.cli.targetStatus(f.request), e => e instanceof NativeReviewCliError && e.code === code && e.message === message);
|
|
113
|
+
assert.equal(f.calls.length, 1); assert.equal(hash(f.exe), before); f.invariant();
|
|
114
|
+
await success(f.cli, f.request); assert.deepEqual(f.flags(), [true, true]);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test("S1/S3 provider-issued STATUS selection is unchanged and never retried for opt-in refusal", async () => {
|
|
119
|
+
for (const refused of [false, true]) {
|
|
120
|
+
const f = setup(async () => refused ? result(refusal, 1) : result()); const before = hash(f.exe);
|
|
121
|
+
const tokens = ["--contract=gentle-ai.review-integration/v2", "--agent=pi", "--next-transition=true", "--intended-untracked-selection={{value}}"];
|
|
122
|
+
const request = { ...f.request, intendedUntrackedSelection: { argumentTokens: tokens, value: '{"paths":[]}' } };
|
|
123
|
+
if (refused) await assert.rejects(f.cli.targetStatus(request), e => e instanceof NativeReviewIntegrationError && e.failureEnvelope.cause === refusal.cause);
|
|
124
|
+
else await success(f.cli, request);
|
|
125
|
+
assert.equal(f.calls.length, 1); assert.deepEqual(f.calls[0].arguments, ["review", "status", "--cwd", f.dir, ...tokens.map(t => t.replace("{{value}}", '{"paths":[]}'))]);
|
|
126
|
+
assert.equal(hash(f.exe), before); f.invariant();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test("S1/S3 real fixture process plus held adapter response survives executable replacement", async () => {
|
|
131
|
+
const entered = gate(), held = gate(), real = createNodeExecFileAdapter();
|
|
132
|
+
const f = setup(async (call, n) => { const response = await real({ ...call, file: process.execPath, arguments: [f.exe, ...call.arguments] }); if (n === 1) { entered.release(); await held.promise; } return response; });
|
|
133
|
+
const script = body => `#!${process.execPath}\nprocess.stdout.write(${JSON.stringify(JSON.stringify(body))}); process.exitCode=${body === refusal ? 1 : 0};\n`;
|
|
134
|
+
writeFileSync(f.exe, script(refusal));
|
|
135
|
+
const old = f.cli.targetStatus(f.request); await entered.promise;
|
|
136
|
+
writeFileSync(f.exe, script(status)); held.release();
|
|
137
|
+
await old; await success(f.cli, f.request); f.invariant();
|
|
138
|
+
assert.deepEqual(f.flags(), [true, false, true]);
|
|
139
|
+
});
|
|
@@ -34,6 +34,8 @@ export interface Transcript {
|
|
|
34
34
|
defaults: TranscriptDefaults;
|
|
35
35
|
/** The resumed process environment, e.g. follow mode; empty by default. */
|
|
36
36
|
env?: NodeJS.ProcessEnv;
|
|
37
|
+
/** Replay the session's own start instead of a resume. */
|
|
38
|
+
ownStart?: boolean;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export interface ReplayObservation {
|
|
@@ -118,7 +120,8 @@ function resume<T>(version: Version, transcript: Transcript, observe: (resumed:
|
|
|
118
120
|
const manager = writeSession(base, transcript.records);
|
|
119
121
|
const authority = modules.authority.readSessionProfileAuthority(manager);
|
|
120
122
|
const options = { sessionId: SESSION_ID, cwd: home.root, configHome, resolveWorktree: () => home, env: transcript.env ?? {} };
|
|
121
|
-
|
|
123
|
+
if (transcript.ownStart && version === "current") currentFreeze.freezeSessionProfileAtOwnStart(options);
|
|
124
|
+
else modules.freeze.freezeSessionProfileAtStartup(options);
|
|
122
125
|
return observe({ authority: authority.available, options, foreign, agentHome: join(base, "agent-home") });
|
|
123
126
|
} finally {
|
|
124
127
|
rmSync(base, { recursive: true, force: true });
|
|
@@ -79,6 +79,35 @@ test("S2/S6: no lazy asset reachable from the full delegation prompt carries an
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
+
// cost-speed P6 (X9): the full delegation parent gets tracking and verification detail from modules that are clean
|
|
83
|
+
// for a parent that never implements, and the parallel-launch form inline in its own prompt, never through the
|
|
84
|
+
// organic writer or delegation cards.
|
|
85
|
+
test("P6 (X9): full delegation reaches tracking and verification, not the organic writer cards, and states the launch rules", () => {
|
|
86
|
+
const prompt = render("full-delegation");
|
|
87
|
+
const named = namedAssets(prompt);
|
|
88
|
+
for (const name of ["orchestrator-tracking.md", "orchestrator-verification.md"]) assert.ok(named.includes(name), `the closure must reach ${name}`);
|
|
89
|
+
for (const name of ["orchestrator-writer.md", "orchestrator-delegation.md", "orchestrator-delegation-reference.md", "orchestrator.md"]) assert.ok(!named.includes(name), `the closure must not reach ${name}`);
|
|
90
|
+
assert.ok(prompt.includes("tracked work: `orchestrator-tracking.md`"));
|
|
91
|
+
assert.ok(prompt.includes("verification, handoffs, verifier setup failure: `orchestrator-verification.md`"));
|
|
92
|
+
assert.ok(prompt.includes(PARALLEL_LAUNCH_RULE), "the parallel-launch sentence");
|
|
93
|
+
assert.ok(prompt.includes("In-limit fixes continue the worker (`subagent_continue`), never a new worker per fix."));
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// cost-speed P6b: "in one message with no other tool call" read as "each call in a message of its own" (F3: three
|
|
97
|
+
// writers in three messages, no overlap, 887-1,092 s vs 393-478 s from one codemode script). Both routes are admitted
|
|
98
|
+
// and overlap in full delegation (real Pi probes); the sequential tools are those declaring `executionMode: "sequential"`.
|
|
99
|
+
const PARALLEL_LAUNCH_RULE = "Independent units with disjoint surfaces launch together: all their `subagent_run` calls in the same assistant message or one `codemode` script, never one launch per message nor beside a sequential `todo`, `ask_user_*`, `codegraph` or `gentle_review*` (it serializes them); units needing the same file run one at a time.";
|
|
100
|
+
|
|
101
|
+
test("P6b: full delegation launches independent units in the same assistant message or one codemode script, never one per message", () => {
|
|
102
|
+
const prompt = render("full-delegation");
|
|
103
|
+
assert.ok(prompt.includes("in the same assistant message"), "same assistant message");
|
|
104
|
+
assert.ok(prompt.includes("or one `codemode` script"), "codemode route");
|
|
105
|
+
assert.ok(prompt.includes("never one launch per message"), "never one launch per message");
|
|
106
|
+
for (const tool of ["`todo`", "`ask_user_*`", "`codegraph`", "`gentle_review*`"]) assert.ok(prompt.includes(tool), `sequential tool ${tool}`);
|
|
107
|
+
assert.ok(!prompt.includes("in one message with no other tool call"), "the ambiguous clause is gone");
|
|
108
|
+
assert.ok(!prompt.includes("as direct `subagent_run` calls"), "codemode is no longer excluded");
|
|
109
|
+
});
|
|
110
|
+
|
|
82
111
|
test("S3: full delegation keeps a Task Size that decides tracking and risk, never who writes", () => {
|
|
83
112
|
const prompt = render("full-delegation");
|
|
84
113
|
assert.match(prompt, /## Task Size/);
|
|
@@ -113,6 +142,25 @@ test("S2: the projected ODD steps keep every unchanged step and the shared tail
|
|
|
113
142
|
}
|
|
114
143
|
});
|
|
115
144
|
|
|
145
|
+
test("S3: both modes keep the canonical authorized-work boundary and a legitimate pending child", () => {
|
|
146
|
+
const canonical = [
|
|
147
|
+
"Authorized work continues: runnable in-scope steps run, a pending child is a wait event whose completion resumes the turn without asking the human",
|
|
148
|
+
"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",
|
|
149
|
+
"A tracked task ends the turn pending only while it waits on already-launched work, for the affected work a denial, missing consent, the user's explicit stop, or an exhausted limit applies to, or for a genuine human decision still outstanding",
|
|
150
|
+
"Missing, partial, unavailable, or declined proof forbids claiming completion of the affected work, never an independently authorized next step",
|
|
151
|
+
"while a required authorized check the existing budget still allows keeps running",
|
|
152
|
+
"Never turn a report into a blind self-reprompt loop.",
|
|
153
|
+
"Hedged wording is not a stop.",
|
|
154
|
+
];
|
|
155
|
+
for (const mode of ["organic", "full-delegation"] as const) {
|
|
156
|
+
const prompt = render(mode);
|
|
157
|
+
for (const clause of canonical) assert.ok(prompt.includes(clause), `[${mode}] canonical Close is missing: ${clause}`);
|
|
158
|
+
assert.ok(prompt.includes("An explicit user stop applies only to the work it names."), `[${mode}] explicit-stop coverage`);
|
|
159
|
+
assert.ok(!prompt.includes("Needs your decision"), `[${mode}] no generic terminal phrase`);
|
|
160
|
+
assert.ok(!prompt.includes("never more verification"), `[${mode}] no broad verification stop`);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
116
164
|
test("S8: the organic render still carries the mirrored steps unprojected", () => {
|
|
117
165
|
const organic = render("organic");
|
|
118
166
|
assert.match(organic, /4\. \*\*Classify\.\*\* Size the task by the orchestrator's Task Size section; its criteria and resume test alone decide small or large, and small work follows its small path\./);
|