gentle-pi 4.6.0 → 4.8.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 +65 -55
- package/assets/agents/gentle-ai-explore.md +4 -3
- package/assets/agents/gentle-ai-verify.md +23 -6
- package/assets/agents/gentle-ai-worker.md +9 -6
- package/assets/agents/jd-fix-agent.md +1 -0
- package/assets/agents/jd-judge-a.md +2 -3
- package/assets/agents/jd-judge-b.md +2 -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 +456 -0
- package/assets/design-canvas/canvas-boot.js +217 -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 +392 -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 +213 -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 +348 -0
- package/assets/design-canvas/canvas-sizes.js +524 -0
- package/assets/design-canvas/canvas-store.js +164 -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 +759 -16
- package/assets/design-canvas/canvas.js +2 -1497
- package/assets/design-canvas/index.html +117 -36
- package/assets/design-canvas/inspector.js +546 -16
- package/assets/install-wizard/wizard.js +6 -1
- package/assets/migrations/agent-body-history.json +40 -1
- package/assets/orchestrator-delegation-reference.md +10 -16
- package/assets/orchestrator-delegation.md +5 -5
- package/assets/orchestrator-full-delegation-card.md +64 -0
- package/assets/orchestrator-full-delegation.md +34 -0
- package/assets/orchestrator-memory.md +5 -5
- package/assets/orchestrator-prompts.md +2 -2
- package/assets/orchestrator-quota-recovery.md +5 -0
- package/assets/orchestrator-skills.md +14 -13
- package/assets/orchestrator-tracking.md +10 -14
- package/assets/orchestrator-verification.md +12 -8
- package/assets/orchestrator-writer.md +4 -4
- package/assets/orchestrator.md +21 -25
- package/bin/gentle-shell.mjs +292 -65
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +8 -9
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/manifest.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/orchestration/pi.md +1 -0
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/routing/pi.md +6 -6
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/generated/provider-capabilities.baseline.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/generated/provider-roles.baseline.json +1 -1
- package/docs/agent-status.md +61 -0
- package/docs/assets/brand/sponsor-banner.svg +60 -0
- package/docs/bundled-install.md +20 -10
- package/docs/delegated-verification.md +46 -8
- package/docs/desktop-rpc.md +1253 -0
- package/docs/gentle-agents-activity.md +40 -0
- package/docs/gentle-shell.md +91 -30
- package/docs/install-wizard.md +30 -21
- package/docs/odd-preparation-continuity.md +24 -0
- package/docs/permission-modes.md +17 -4
- package/docs/prompt-budget.md +12 -0
- package/docs/rdd-odd-friction-triage-2026-11-07.md +57 -0
- package/docs/readme-reference.md +142 -45
- package/docs/render-cache-performance.md +11 -1
- package/docs/review-coordinator.md +53 -0
- package/docs/review-delivery-preflight.md +22 -0
- package/docs/review-request-context.md +19 -0
- package/docs/review-windows-acl.md +18 -0
- package/docs/voice.md +6 -3
- package/docs/work-continuity.md +11 -1
- package/docs/yolo-mode.md +5 -5
- package/extensions/ask-user-choice.ts +1 -0
- package/extensions/ask-user-question.ts +3 -2
- package/extensions/child-context.ts +21 -7
- package/extensions/child-safety.ts +3 -0
- package/extensions/gentle-agent-status.ts +99 -0
- package/extensions/gentle-agents.ts +559 -66
- package/extensions/gentle-ai.ts +2001 -518
- package/extensions/gentle-design.ts +69 -3
- package/extensions/gentle-desktop-rpc.ts +143 -0
- package/extensions/gentle-guide.ts +3 -0
- package/extensions/gentle-shell.ts +398 -115
- package/extensions/gentle-todo.ts +66 -27
- package/extensions/gentle-tps.ts +48 -0
- package/extensions/quiet-tools.ts +38 -8
- package/extensions/skill-registry.ts +349 -167
- package/extensions/startup-banner.ts +30 -3
- package/lib/agent-assets.ts +30 -6
- package/lib/agent-profile-pin.ts +3 -3
- package/lib/agent-profiles.ts +160 -2
- package/lib/agent-status.ts +105 -0
- package/lib/agent-tool-overlay.ts +117 -0
- package/lib/agents-config.ts +93 -6
- package/lib/agents-history.ts +24 -5
- package/lib/agents-message-delivery.ts +17 -0
- package/lib/agents-messaging.ts +55 -7
- package/lib/agents-protocol.ts +15 -0
- package/lib/agents-report-cap.ts +115 -0
- package/lib/agents-runner.ts +272 -16
- package/lib/agents-session-transport.ts +17 -1
- package/lib/auto-permission-runtime.ts +1 -1
- package/lib/background-jobs-tools.ts +9 -4
- package/lib/bounded-writer-admission.ts +197 -32
- package/lib/card-content-policy.ts +8 -6
- package/lib/child-context-files.ts +21 -6
- package/lib/codemode-renderer.ts +1 -0
- package/lib/command-palette.ts +133 -17
- package/lib/context-backstop.ts +14 -5
- package/lib/delivery-conflict-markers.ts +349 -0
- package/lib/design-canvas-assets.ts +36 -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 +294 -0
- package/lib/desktop-design-service.ts +233 -0
- package/lib/desktop-jobs-service.ts +263 -0
- package/lib/desktop-rpc-agents.ts +294 -0
- package/lib/desktop-rpc-config.ts +731 -0
- package/lib/desktop-rpc-design.ts +138 -0
- package/lib/desktop-rpc-jobs.ts +181 -0
- package/lib/desktop-rpc-permissions.ts +177 -0
- package/lib/desktop-rpc-profiles.ts +196 -0
- package/lib/desktop-rpc-usage.ts +229 -0
- package/lib/desktop-rpc.ts +225 -0
- package/lib/desktop-usage-service.ts +310 -0
- package/lib/destructive-command-guard.ts +236 -17
- package/lib/execution-surface-guard.ts +20 -0
- package/lib/exploration-budget.ts +4 -2
- package/lib/gentle-ai-binary.ts +1 -1
- package/lib/gentle-ai-renderer.ts +13 -1
- package/lib/gentle-design.ts +204 -14
- package/lib/gentle-shell-bundled.ts +106 -28
- package/lib/gentle-shell-launcher.ts +43 -8
- package/lib/herdr-activity.ts +14 -2
- package/lib/herdr-busy.ts +45 -0
- package/lib/hidden-tools.ts +35 -0
- package/lib/image-attachments.ts +33 -0
- package/lib/image-disk-cache.ts +137 -0
- package/lib/inprocess-reviewer.ts +358 -144
- package/lib/jobs-view.ts +198 -11
- package/lib/model-fallback-policy.ts +9 -0
- package/lib/model-routing-authority.ts +31 -4
- package/lib/nan-provider.ts +42 -28
- package/lib/native-choice-list.ts +20 -2
- package/lib/native-review-cli.ts +172 -20
- package/lib/orchestrator-discovery.ts +39 -2
- package/lib/orchestrator-mode-policy.ts +105 -0
- package/lib/questionnaire/questionnaire-view.ts +105 -12
- package/lib/rdd-mode-control.ts +32 -0
- package/lib/reply-language-anchor.ts +129 -0
- package/lib/request-context-placement.ts +53 -0
- package/lib/review-blocker.ts +92 -0
- package/lib/review-candidate-symlink-scan.ts +136 -0
- package/lib/review-candidate-view-owner.ts +81 -44
- package/lib/review-candidate-view.ts +11 -1
- package/lib/review-continuation-registry.ts +116 -0
- package/lib/review-coordinator.ts +407 -0
- package/lib/review-delivery-preflight.ts +85 -0
- package/lib/review-failure-facts.ts +49 -0
- package/lib/review-host-relay.ts +51 -11
- package/lib/review-integration-v2.ts +63 -4
- package/lib/review-relay-phase-timing.ts +45 -0
- package/lib/review-start-context.ts +17 -0
- package/lib/reviewer-stream.ts +87 -0
- package/lib/session-profile-freeze.ts +4 -2
- package/lib/shell-bar.ts +140 -58
- package/lib/shell-changes.ts +2 -0
- package/lib/shell-panel.ts +17 -3
- package/lib/shell-prompt.ts +16 -3
- package/lib/shell-sidebar-layout.ts +112 -40
- package/lib/shell-sidebar.ts +7 -0
- package/lib/shell-todo.ts +10 -3
- package/lib/shell-usage.ts +10 -0
- package/lib/verifier-admission.ts +1 -1
- package/lib/vim-editor-adapter.ts +9 -2
- package/lib/visual-customization-policy.ts +36 -16
- package/lib/visual-customize-view.ts +216 -21
- package/lib/visual-layout-preview.ts +9 -5
- package/lib/visual-profiles.ts +2 -2
- package/lib/windows-session-transport.ts +53 -2
- package/lib/writer-batch-admission.ts +55 -0
- package/lib/yolo-session-policy.ts +46 -16
- package/package.json +3 -2
- package/prompts/skill-creation.md +1 -10
- package/runtime/design-canvas-assets.mjs +37 -0
- package/runtime/gentle-ai-binary.mjs +1 -1
- package/runtime/gentle-shell-bundled.mjs +106 -28
- package/runtime/gentle-shell-launcher.mjs +42 -7
- package/runtime/native-review-cli.mjs +169 -17
- package/runtime/review-integration-v2.mjs +63 -4
- package/scripts/bootstrap.cmd +2 -2
- package/scripts/bootstrap.sh +41 -4
- package/scripts/build-full-delegation-card.mjs +179 -0
- package/scripts/build-runtime-modules.mjs +1 -0
- package/scripts/bundled-install.mjs +38 -8
- package/scripts/download-progress.mjs +68 -0
- package/scripts/gentle-ai-installer.mjs +41 -18
- package/scripts/gentle-ai-proxy.mjs +294 -0
- package/scripts/install-gentle-ai.mjs +14 -1
- package/scripts/installer-downloads.mjs +34 -8
- package/scripts/installer-preflight.mjs +33 -22
- package/scripts/installer-probes.mjs +25 -5
- package/scripts/installer-runner.mjs +27 -12
- package/scripts/installer-server.mjs +46 -16
- package/scripts/installer-windows.mjs +2 -2
- package/scripts/pi-update.mjs +166 -27
- package/scripts/prepare-verifier.mjs +107 -0
- package/scripts/render-cache-host.mjs +72 -0
- package/scripts/render-cache-performance-worker.mjs +5 -4
- package/scripts/render-cache-performance.mjs +6 -1
- package/scripts/run-test-suite.mjs +40 -28
- package/scripts/update-agent-body-history.mjs +55 -8
- package/scripts/verify-package-files.mjs +50 -19
- package/scripts/voice-worker.cjs +32 -6
- package/skills/branch-pr/SKILL.md +16 -16
- package/skills/comment-writer/SKILL.md +1 -1
- package/skills/design/SKILL.md +16 -13
- package/skills/gentle-ai/SKILL.md +7 -7
- package/skills/gentle-ui-design/SKILL.md +46 -0
- package/skills/gentle-ui-design/references/adaptive-interfaces.md +46 -0
- package/skills/gentle-ui-design/references/browse-and-compare.md +62 -0
- package/skills/gentle-ui-design/references/composition-and-feedback.md +56 -0
- package/skills/gentle-ui-design/references/task-and-content.md +60 -0
- package/skills/judgment-day/SKILL.md +2 -2
- package/skills/judgment-day/references/prompts-and-formats.md +1 -1
- package/skills/rdd-defect-workflow/SKILL.md +6 -6
- package/skills/skill-improver/SKILL.md +2 -2
- package/skills/skill-registry/SKILL.md +11 -11
- package/skills/tui-design/SKILL.md +1 -1
- package/skills/work-unit-commits/SKILL.md +10 -11
- package/tests/agent-home.test.ts +28 -9
- package/tests/agent-profiles-workflow.test.ts +163 -0
- package/tests/agent-prompt-diet-contract.test.ts +101 -0
- package/tests/agent-risk-escalation.test.ts +1 -1
- package/tests/agent-status.test.ts +143 -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 +106 -1
- package/tests/agents-history.test.ts +31 -0
- package/tests/agents-jobs-frames.test.ts +93 -0
- package/tests/agents-message-delivery.test.ts +36 -0
- package/tests/agents-prompt-lifecycle-runtime.test.ts +376 -0
- package/tests/agents-queries.test.ts +144 -4
- package/tests/agents-report-cap.test.ts +126 -0
- package/tests/agents-runner-drain.test.ts +193 -0
- package/tests/agents-runner.test.ts +215 -3
- 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 +12 -1
- 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 +4 -3
- package/tests/ask-user-question.test.ts +99 -1
- package/tests/audit-leftovers-contract.test.ts +51 -0
- package/tests/auto-permission-runtime.test.ts +1 -1
- package/tests/autonomous-guard.test.ts +346 -10
- package/tests/bounded-stop-contract.test.ts +51 -3
- package/tests/branch-pr-skill.test.ts +10 -1
- package/tests/bridge-cost.test.ts +19 -4
- package/tests/bundled-install.test.ts +31 -6
- package/tests/card-content-policy.test.ts +3 -3
- package/tests/chained-pr-skill.test.ts +8 -6
- package/tests/child-context-files.test.ts +64 -8
- package/tests/child-safety.test.ts +11 -0
- package/tests/child-skills-catalog.test.ts +56 -0
- package/tests/codegraph-tools.test.ts +11 -5
- package/tests/codemode-rendering.test.ts +4 -1
- package/tests/command-palette.test.ts +284 -1
- package/tests/delegate-for-reason-contract.test.ts +32 -10
- 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 -695
- 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 +526 -0
- package/tests/design-canvas-inspector.test.ts +937 -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 +90 -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 +180 -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-rpc-agents.test.ts +893 -0
- package/tests/desktop-rpc-config.test.ts +1452 -0
- package/tests/desktop-rpc-design.test.ts +662 -0
- package/tests/desktop-rpc-jobs.test.ts +796 -0
- package/tests/desktop-rpc-permissions.test.ts +311 -0
- package/tests/desktop-rpc-profiles.test.ts +140 -0
- package/tests/desktop-rpc-safety.test.ts +119 -0
- package/tests/desktop-rpc-usage.test.ts +697 -0
- package/tests/desktop-rpc.test.ts +252 -0
- package/tests/destructive-command-guard.test.ts +52 -0
- package/tests/devbinary/pi-host-relay.devtest.ts +149 -80
- package/tests/devbinary/review-session-consent.devtest.ts +84 -0
- package/tests/download-progress.test.ts +71 -0
- package/tests/engram-safety.test.ts +111 -0
- package/tests/execution-surface-guard.test.ts +55 -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 +26 -31
- package/tests/fixtures/proxy-tls/proxy.crt +19 -0
- package/tests/fixtures/proxy-tls/proxy.key +28 -0
- package/tests/fixtures/refusal-identity.probe.mjs +139 -0
- package/tests/fixtures/session-profile-v1/gentle-ai-reviewer.ts +89 -0
- package/tests/fixtures/session-profile-v1/replay.ts +53 -6
- package/tests/full-delegation-closure.test.ts +160 -0
- package/tests/full-delegation-notices.test.ts +76 -0
- package/tests/generic-agent-tools.test.ts +3 -3
- package/tests/gentle-agent-status.test.ts +74 -0
- package/tests/gentle-agents-child-jobs.test.ts +237 -0
- package/tests/gentle-agents.test.ts +1403 -20
- package/tests/gentle-ai-binary.test.ts +3 -1
- package/tests/gentle-ai-child-guards.test.ts +1 -0
- package/tests/gentle-ai-elapsed-store.test.ts +19 -0
- package/tests/gentle-ai-exploration-budget.test.ts +18 -2
- package/tests/gentle-ai-installer.test.ts +135 -51
- package/tests/gentle-ai-proxy.test.ts +434 -0
- package/tests/gentle-ai-renderer.test.ts +36 -2
- package/tests/gentle-ai.test.ts +233 -43
- package/tests/gentle-design.test.ts +386 -1
- package/tests/gentle-herdr-activity.test.ts +9 -6
- package/tests/gentle-shell-bin.test.ts +123 -0
- package/tests/gentle-shell-bundled.test.ts +293 -31
- package/tests/gentle-shell-launcher.test.ts +78 -11
- package/tests/gentle-shell.test.ts +1017 -146
- package/tests/gentle-todo.test.ts +51 -11
- package/tests/gentle-tps.test.ts +123 -0
- package/tests/gentle-ui-design-skill.test.ts +59 -0
- package/tests/herdr-busy.test.ts +59 -0
- package/tests/herdr-task-summary-policy.test.ts +8 -4
- package/tests/hidden-tools.test.ts +188 -0
- package/tests/image-disk-cache.test.ts +163 -0
- package/tests/independent-recovery-delivery.test.ts +97 -0
- package/tests/inprocess-reviewer.test.ts +249 -4
- package/tests/install-wizard.test.ts +27 -1
- package/tests/installer-downloads.test.ts +30 -1
- package/tests/installer-posix-bootstrap.test.ts +115 -14
- package/tests/installer-preflight.test.ts +54 -5
- package/tests/installer-probes.test.ts +146 -0
- package/tests/installer-runner.test.ts +79 -44
- package/tests/installer-server.test.ts +215 -13
- package/tests/installer-windows-bootstrap.test.ts +19 -1
- package/tests/jobs-view.test.ts +260 -6
- package/tests/judgment-day-severity-admission.test.ts +46 -0
- package/tests/lazy-module-contradictions-contract.test.ts +158 -0
- package/tests/maintainer/desktop-rpc.maintest.ts +632 -0
- package/tests/maintainer/pi-update-source.maintest.ts +48 -18
- package/tests/modal-mouse-boundaries.test.ts +136 -0
- package/tests/model-fallback-policy.test.ts +26 -7
- package/tests/model-routing-authority.test.ts +178 -2
- package/tests/nan-provider-runtime.test.ts +17 -3
- package/tests/nan-provider.test.ts +111 -56
- package/tests/native-choice-list.test.ts +77 -2
- package/tests/native-review-capability-contract.test.ts +17 -1
- package/tests/native-review-cli-nonblocking-findings.test.ts +165 -0
- package/tests/native-review-cli.test.ts +269 -1
- 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 +13 -2
- package/tests/odd-integration.test.ts +11 -3
- package/tests/odd-routing-canonical-ratchet.test.ts +3 -3
- package/tests/odd-routing-contract.test.ts +80 -28
- package/tests/orchestrator-budget.test.ts +35 -5
- package/tests/orchestrator-consultation-sdk.test.ts +32 -6
- package/tests/orchestrator-delegation-mode.test.ts +154 -0
- package/tests/orchestrator-discovery.test.ts +28 -0
- package/tests/orchestrator-mode-policy.test.ts +175 -0
- package/tests/orchestrator-prompt-budget.test.ts +13 -2
- package/tests/orchestrator-prompt-diet-contract.test.ts +221 -0
- package/tests/orchestrator-rdd-ownership.test.ts +4 -3
- package/tests/orchestrator-work-search.test.ts +4 -2
- package/tests/package-files.test.ts +25 -1
- package/tests/package-manifest.test.ts +16 -13
- package/tests/parallel-reason-contract.test.ts +6 -3
- package/tests/permission-allowlist.test.ts +372 -0
- 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-update-launcher.test.ts +25 -7
- package/tests/pi-update-source.test.ts +113 -6
- package/tests/pi-update.test.ts +294 -19
- package/tests/pnpm-workspace-config.test.ts +58 -0
- 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 +13 -0
- package/tests/profile-pin.test.ts +29 -2
- package/tests/profile-tier-footer.test.ts +5 -0
- package/tests/profiles-panel-delegation-mode.test.ts +422 -0
- package/tests/provider-defect-handoff.test.ts +9 -2
- package/tests/questionnaire-view.test.ts +115 -0
- package/tests/quiet-bash-runtime.test.ts +1 -1
- package/tests/quiet-tool-rendering.test.ts +48 -0
- package/tests/rdd-aware-verification-contract.test.ts +17 -12
- package/tests/rdd-customize.test.ts +287 -0
- package/tests/rdd-mode-cache.test.ts +450 -0
- package/tests/rdd-mode-control.test.ts +407 -0
- package/tests/rdd-mode-scope-regression.test.ts +137 -0
- package/tests/rdd-off-independent-regression.test.ts +69 -0
- package/tests/rdd-status-line.test.ts +112 -1
- package/tests/render-cache-performance.test.ts +171 -2
- package/tests/reply-language-anchor-placement.test.ts +184 -0
- package/tests/reply-language-anchor.test.ts +189 -0
- 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 +80 -2
- package/tests/review-blocker.test.ts +193 -0
- package/tests/review-candidate-owner-retry.test.ts +1 -1
- package/tests/review-candidate-symlink-scan.test.ts +157 -0
- package/tests/review-candidate-view.test.ts +66 -1
- package/tests/review-candidate-windows-boundary.test.ts +131 -0
- package/tests/review-candidate-windows-probe.test.ts +63 -0
- package/tests/review-committed-restart-ack.test.ts +129 -0
- package/tests/review-continuation-registry.test.ts +107 -0
- package/tests/review-contract-prompt.test.ts +1 -1
- package/tests/review-controller-native-routing.test.ts +261 -5
- package/tests/review-controller-workspace-root.test.ts +230 -3
- package/tests/review-controller.test.ts +98 -12
- 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-runtime.test.ts +117 -0
- package/tests/review-coordinator.test.ts +462 -0
- 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 +26 -0
- package/tests/review-failure-facts.test.ts +87 -0
- package/tests/review-host-relay-routing.test.ts +258 -4
- package/tests/review-host-relay.test.ts +39 -0
- package/tests/review-integration-nonblocking-findings.test.ts +108 -0
- package/tests/review-integration-v2.test.ts +46 -3
- package/tests/review-json-arguments.test.ts +105 -11
- package/tests/review-last-event-closure.test.ts +68 -0
- package/tests/review-ledger-contract.test.ts +19 -40
- package/tests/review-loadout-rdd-off-sdk.test.ts +95 -32
- 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-owner-identity.test.ts +60 -24
- package/tests/review-relay-phase-timing.test.ts +128 -0
- package/tests/review-relay-transport-agent.test.ts +39 -2
- package/tests/review-reviewer-evidence.test.ts +223 -0
- package/tests/review-risk-assessment.test.ts +126 -8
- package/tests/review-run-statement-guidance-independent.test.ts +54 -0
- package/tests/review-session-standing-permission-controller.test.ts +53 -3
- package/tests/review-start-context.test.ts +19 -0
- package/tests/review-tool-prose-budget.test.ts +122 -0
- package/tests/reviewer-stream.test.ts +149 -0
- package/tests/run-test-suite.test.ts +122 -1
- package/tests/runtime-harness.mjs +4 -1
- package/tests/sensitive-path-tools.test.ts +181 -5
- package/tests/session-profile-append-controller-pi.test.ts +60 -31
- package/tests/session-profile-binding.test.ts +19 -1
- package/tests/session-profile-disk-reader-pi.test.ts +58 -16
- package/tests/session-profile-extension.test.ts +2 -2
- package/tests/session-profile-v1-compat.test.ts +35 -1
- package/tests/shell-bar.test.ts +186 -42
- package/tests/shell-panel.test.ts +50 -22
- package/tests/shell-prompt.test.ts +17 -0
- package/tests/shell-sidebar-fullscreen.test.ts +5 -5
- package/tests/shell-sidebar-layout.test.ts +294 -23
- package/tests/shell-sidebar-scroll-benchmark.test.ts +1 -1
- package/tests/shell-surface-transparent.test.ts +89 -0
- package/tests/shell-todo.test.ts +12 -0
- package/tests/shell-usage.test.ts +59 -10
- package/tests/skill-contradictions-contract.test.ts +122 -0
- package/tests/skill-registry-watcher.test.ts +216 -2
- package/tests/skill-registry.test.ts +1461 -5
- package/tests/startup-banner.test.ts +152 -1
- package/tests/startup-home-repo.test.ts +2 -0
- package/tests/support/design-canvas-dom.ts +369 -0
- package/tests/support/review-coordinator-runtime.ts +264 -0
- package/tests/task-size-routing-contract.test.ts +45 -12
- 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/update-agent-body-history.test.ts +138 -0
- package/tests/verification-tiers-contract.test.ts +229 -0
- package/tests/verifier-admission.test.ts +49 -0
- package/tests/verifier-preparation.test.ts +229 -0
- package/tests/verify-agent-contract.test.ts +20 -2
- package/tests/verify-first-launch-contract.test.ts +162 -11
- package/tests/vim-editor-adapter.test.ts +2 -2
- package/tests/visual-customization-policy.test.ts +39 -6
- package/tests/visual-customize-view.test.ts +573 -9
- package/tests/visual-layout-preview.test.ts +15 -1
- package/tests/visual-profiles.test.ts +11 -0
- package/tests/voice-worker.test.ts +73 -2
- package/tests/windows-session-transport.test.ts +126 -0
- package/tests/work-continuity-contract.test.ts +77 -6
- 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 +276 -0
- package/tests/yolo-customize.test.ts +27 -4
- package/tests/yolo-mode.test.ts +62 -18
- package/tests/yolo-session-policy.test.ts +270 -1
- package/skills/_shared/review-ledger-contract.md +0 -106
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/README.md +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/lens.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/refuter.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/targeted-validator.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/lens.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/refuter.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/targeted-validator.json +0 -0
|
@@ -4,12 +4,15 @@ import {
|
|
|
4
4
|
isKeyRelease,
|
|
5
5
|
Key,
|
|
6
6
|
matchesKey,
|
|
7
|
+
stripTerminalSequences,
|
|
7
8
|
Text,
|
|
8
9
|
visibleWidth,
|
|
9
10
|
type Focusable,
|
|
10
11
|
type KeybindingsManager,
|
|
11
12
|
type TuiMouseEvent,
|
|
12
13
|
} from "@earendil-works/pi-tui";
|
|
14
|
+
import { NativePointerScope } from "../native-pointer-region.ts";
|
|
15
|
+
import { paintHoverable } from "../shell-hover.ts";
|
|
13
16
|
import { CUSTOM_ROW_LABEL, type QuestionData } from "./schema.ts";
|
|
14
17
|
|
|
15
18
|
/** Minimum terminal width at which the preview pane splits beside the list. */
|
|
@@ -65,6 +68,19 @@ interface LineOwner {
|
|
|
65
68
|
rowIndex: number;
|
|
66
69
|
}
|
|
67
70
|
|
|
71
|
+
interface HoverTarget {
|
|
72
|
+
owner: LineOwner;
|
|
73
|
+
endX: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface PressTarget {
|
|
77
|
+
owner: LineOwner;
|
|
78
|
+
x: number;
|
|
79
|
+
y: number;
|
|
80
|
+
width: number;
|
|
81
|
+
rows: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
68
84
|
/** Small inline text editor for the free-text row; owns an {@link Input}. */
|
|
69
85
|
class CustomTextEditor extends Container {
|
|
70
86
|
private readonly input = new Input({ prompt: "> ", placeholder: "Type your response" });
|
|
@@ -150,6 +166,18 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
150
166
|
private completed = false;
|
|
151
167
|
private result: QuestionnaireResult | undefined;
|
|
152
168
|
private lineOwners: Array<LineOwner | undefined> = [];
|
|
169
|
+
private hoverTargets: Array<HoverTarget | undefined> = [];
|
|
170
|
+
private hovered: LineOwner | undefined;
|
|
171
|
+
private pressed: PressTarget | undefined;
|
|
172
|
+
private readonly pointerScope = new NativePointerScope();
|
|
173
|
+
// The view builds its own rows, so one region tracks motion over its rendered label targets.
|
|
174
|
+
private readonly hoverRegion = this.pointerScope.wrap({ render: () => [], invalidate: () => {} }, {
|
|
175
|
+
onHover: (event) => this.hoverLabel(event),
|
|
176
|
+
onLeave: () => { this.hovered = undefined; },
|
|
177
|
+
});
|
|
178
|
+
private renderedWidth: number | undefined;
|
|
179
|
+
private renderedRows: number | undefined;
|
|
180
|
+
private disposed = false;
|
|
153
181
|
private _focused = false;
|
|
154
182
|
private previewScroll = 0;
|
|
155
183
|
private previewScrollable = false;
|
|
@@ -184,7 +212,7 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
184
212
|
set focused(value: boolean) {
|
|
185
213
|
this._focused = value;
|
|
186
214
|
this.editor.setFocused(value);
|
|
187
|
-
this.invalidate();
|
|
215
|
+
if (this.editingQuestion !== undefined) this.invalidate();
|
|
188
216
|
}
|
|
189
217
|
|
|
190
218
|
/** Current committed result. Safe to call before completion. */
|
|
@@ -198,7 +226,7 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
198
226
|
}
|
|
199
227
|
|
|
200
228
|
handleInput(data: string): void {
|
|
201
|
-
if (this.completed || isKeyRelease(data)) return;
|
|
229
|
+
if (this.disposed || this.completed || isKeyRelease(data)) return;
|
|
202
230
|
|
|
203
231
|
if (this.editingQuestion !== undefined) {
|
|
204
232
|
// Tab still switches questions while editing; the draft is preserved.
|
|
@@ -264,10 +292,31 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
264
292
|
}
|
|
265
293
|
}
|
|
266
294
|
|
|
295
|
+
createMouseObserver(requestRender: () => void) {
|
|
296
|
+
return this.pointerScope.createMouseObserver(requestRender);
|
|
297
|
+
}
|
|
298
|
+
|
|
267
299
|
override handleMouse(event: TuiMouseEvent) {
|
|
268
|
-
if (this.completed) return undefined;
|
|
300
|
+
if (this.disposed || this.completed) return undefined;
|
|
301
|
+
const rows = this.terminalRows();
|
|
302
|
+
const pressed = event.type === "click" && this.pressed && this.pressed.width === event.width &&
|
|
303
|
+
this.pressed.rows === rows && this.pressed.x === event.x && this.pressed.y === event.y
|
|
304
|
+
? this.pressed.owner : undefined;
|
|
305
|
+
if (!pressed && (this.renderedWidth !== event.width || this.renderedRows !== rows)) return undefined;
|
|
306
|
+
if (!Number.isFinite(event.x) || !Number.isFinite(event.y) ||
|
|
307
|
+
event.x < 0 || event.x >= event.width || event.y < 0 || event.y >= event.height) return undefined;
|
|
269
308
|
if (this.editingQuestion !== undefined) return this.editor.handleMouse(event);
|
|
270
309
|
|
|
310
|
+
if (event.type === "move" && event.button === "none") {
|
|
311
|
+
const target = this.hoverTargets[event.y];
|
|
312
|
+
if (target && event.x < target.endX) {
|
|
313
|
+
const result = this.hoverRegion.handleMouse(event);
|
|
314
|
+
return result ? { ...result, handled: true as const, target: this.mouseTarget(event) } : undefined;
|
|
315
|
+
}
|
|
316
|
+
const changed = this.hoverRegion.clearHover(event);
|
|
317
|
+
return changed ? { handled: true as const, render: true, target: this.mouseTarget(event) } : undefined;
|
|
318
|
+
}
|
|
319
|
+
|
|
271
320
|
if (event.type === "wheel") {
|
|
272
321
|
const delta = event.wheelDelta ?? 0;
|
|
273
322
|
if (delta !== 0 && this.previewScrollable) {
|
|
@@ -276,15 +325,17 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
276
325
|
}
|
|
277
326
|
}
|
|
278
327
|
|
|
279
|
-
const owner = this.lineOwners[event.y];
|
|
328
|
+
const owner = pressed ?? this.lineOwners[event.y];
|
|
280
329
|
if (!owner || owner.rowIndex < 0 || event.button !== "left") return undefined;
|
|
281
330
|
|
|
282
331
|
if (event.type === "press") {
|
|
283
332
|
const changed = this.focusRow(owner.questionIndex, owner.rowIndex);
|
|
333
|
+
this.pressed = { owner, x: event.x, y: event.y, width: event.width, rows };
|
|
284
334
|
return { handled: true as const, focus: true, render: changed, target: this.mouseTarget(event) };
|
|
285
335
|
}
|
|
286
336
|
|
|
287
337
|
if (event.type === "click") {
|
|
338
|
+
this.pressed = undefined;
|
|
288
339
|
const question = this.questions[owner.questionIndex];
|
|
289
340
|
this.focusRow(owner.questionIndex, owner.rowIndex);
|
|
290
341
|
// A multiSelect option toggles in place; only single-select (or the
|
|
@@ -303,12 +354,17 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
303
354
|
|
|
304
355
|
override render(width: number): string[] {
|
|
305
356
|
const viewport = Math.max(1, width);
|
|
357
|
+
const terminalRows = this.terminalRows();
|
|
358
|
+
if (this.renderedWidth !== width || this.renderedRows !== terminalRows) this.pointerScope.invalidate();
|
|
359
|
+
if (this.pressed && (this.pressed.width !== width || this.pressed.rows !== terminalRows)) this.pressed = undefined;
|
|
306
360
|
const lines: string[] = [];
|
|
307
361
|
const owners: Array<LineOwner | undefined> = [];
|
|
362
|
+
const hoverTargets: Array<HoverTarget | undefined> = [];
|
|
308
363
|
const push = (text: string, owner?: LineOwner) => {
|
|
309
364
|
for (const line of this.wrap(text, viewport)) {
|
|
310
365
|
lines.push(line);
|
|
311
366
|
owners.push(owner);
|
|
367
|
+
hoverTargets.push(undefined);
|
|
312
368
|
}
|
|
313
369
|
};
|
|
314
370
|
|
|
@@ -320,7 +376,6 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
320
376
|
push(this.renderTabs());
|
|
321
377
|
push("");
|
|
322
378
|
|
|
323
|
-
const terminalRows = this.terminalRows();
|
|
324
379
|
const maxBodyRows = Math.max(6, terminalRows - 6);
|
|
325
380
|
|
|
326
381
|
this.previewScrollable = false;
|
|
@@ -356,27 +411,43 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
356
411
|
for (let index = 0; index < rows; index++) {
|
|
357
412
|
lines.push(`${padTo(left.lines[index] ?? "", leftWidth)}${PREVIEW_GAP}${visibleRight[index] ?? ""}`);
|
|
358
413
|
owners.push(left.owners[index]);
|
|
414
|
+
hoverTargets.push(left.hoverTargets[index]);
|
|
359
415
|
}
|
|
360
416
|
}
|
|
361
417
|
else {
|
|
362
418
|
const body = this.renderBody(viewport, preview !== undefined);
|
|
363
419
|
lines.push(...body.lines);
|
|
364
420
|
owners.push(...body.owners);
|
|
421
|
+
hoverTargets.push(...body.hoverTargets);
|
|
365
422
|
}
|
|
366
423
|
|
|
367
424
|
push("");
|
|
368
425
|
push(this.hint());
|
|
369
426
|
|
|
370
427
|
this.lineOwners = owners;
|
|
428
|
+
this.hoverTargets = hoverTargets;
|
|
429
|
+
this.renderedWidth = width;
|
|
430
|
+
this.renderedRows = terminalRows;
|
|
371
431
|
return lines;
|
|
372
432
|
}
|
|
373
433
|
|
|
374
434
|
override invalidate(): void {
|
|
375
435
|
this.lineOwners = [];
|
|
436
|
+
this.hoverTargets = [];
|
|
437
|
+
this.pointerScope.invalidate();
|
|
438
|
+
this.pressed = undefined;
|
|
439
|
+
this.renderedWidth = undefined;
|
|
440
|
+
this.renderedRows = undefined;
|
|
376
441
|
super.invalidate();
|
|
377
442
|
this.editor.setFocused(this._focused);
|
|
378
443
|
}
|
|
379
444
|
|
|
445
|
+
dispose(): void {
|
|
446
|
+
this.disposed = true;
|
|
447
|
+
this.pointerScope.dispose();
|
|
448
|
+
this.invalidate();
|
|
449
|
+
}
|
|
450
|
+
|
|
380
451
|
/** Compact tab strip: every question is a chip, exactly one is active. */
|
|
381
452
|
private renderTabs(): string {
|
|
382
453
|
const total = this.questions.length;
|
|
@@ -392,19 +463,26 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
392
463
|
}
|
|
393
464
|
|
|
394
465
|
/** Body for the active question only. */
|
|
395
|
-
private renderBody(width: number, inlinePreview: boolean): {
|
|
466
|
+
private renderBody(width: number, inlinePreview: boolean): {
|
|
467
|
+
lines: string[];
|
|
468
|
+
owners: Array<LineOwner | undefined>;
|
|
469
|
+
hoverTargets: Array<HoverTarget | undefined>;
|
|
470
|
+
} {
|
|
396
471
|
const lines: string[] = [];
|
|
397
472
|
const owners: Array<LineOwner | undefined> = [];
|
|
398
|
-
const
|
|
473
|
+
const hoverTargets: Array<HoverTarget | undefined> = [];
|
|
474
|
+
const push = (text: string, owner?: LineOwner, hoverable = false) => {
|
|
399
475
|
for (const line of this.wrap(text, width)) {
|
|
400
476
|
lines.push(line);
|
|
401
477
|
owners.push(owner);
|
|
478
|
+
const visible = stripTerminalSequences(line).trimEnd();
|
|
479
|
+
hoverTargets.push(hoverable && owner && visible.trim() ? { owner, endX: visibleWidth(visible) } : undefined);
|
|
402
480
|
}
|
|
403
481
|
};
|
|
404
482
|
|
|
405
483
|
const question = this.questions[this.focusedQuestion];
|
|
406
484
|
const state = this.states[this.focusedQuestion];
|
|
407
|
-
if (!question || !state) return { lines, owners };
|
|
485
|
+
if (!question || !state) return { lines, owners, hoverTargets };
|
|
408
486
|
|
|
409
487
|
const headerOwner: LineOwner = { questionIndex: this.focusedQuestion, rowIndex: -1 };
|
|
410
488
|
push(this.accent(question.question), headerOwner);
|
|
@@ -413,8 +491,9 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
413
491
|
for (const line of this.editor.render(width)) {
|
|
414
492
|
lines.push(line);
|
|
415
493
|
owners.push(headerOwner);
|
|
494
|
+
hoverTargets.push(undefined);
|
|
416
495
|
}
|
|
417
|
-
return { lines, owners };
|
|
496
|
+
return { lines, owners, hoverTargets };
|
|
418
497
|
}
|
|
419
498
|
|
|
420
499
|
const customIndex = question.options.length;
|
|
@@ -437,7 +516,8 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
437
516
|
const owner: LineOwner = { questionIndex: this.focusedQuestion, rowIndex: optionIndex };
|
|
438
517
|
const cursor = state.cursor === optionIndex ? this.accent("❯ ") : " ";
|
|
439
518
|
const marker = question.multiSelect ? `${state.toggled.has(optionIndex) ? "[x]" : "[ ]"} ` : "";
|
|
440
|
-
|
|
519
|
+
const label = paintHoverable(this.theme, option.label, this.isHovered(owner));
|
|
520
|
+
push(`${cursor}${marker}${label}`, owner, true);
|
|
441
521
|
push(` ${this.theme.fg("dim", option.description)}`, owner);
|
|
442
522
|
if (inlinePreview && state.cursor === optionIndex && option.preview !== undefined) {
|
|
443
523
|
const wrapped = this.wrap(this.theme.fg("dim", option.preview), Math.max(1, width - 4));
|
|
@@ -466,9 +546,22 @@ export class QuestionnaireView extends Container implements Focusable {
|
|
|
466
546
|
const customOwner: LineOwner = { questionIndex: this.focusedQuestion, rowIndex: customIndex };
|
|
467
547
|
const customCursor = state.cursor === customIndex ? this.accent("❯ ") : " ";
|
|
468
548
|
const customDone = state.answer?.kind === "custom" ? "✓ " : "";
|
|
469
|
-
|
|
549
|
+
const customLabel = paintHoverable(this.theme, CUSTOM_ROW_LABEL, this.isHovered(customOwner));
|
|
550
|
+
push(`${customCursor}${customDone}${customLabel}`, customOwner, true);
|
|
551
|
+
|
|
552
|
+
return { lines, owners, hoverTargets };
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
private hoverLabel(event: TuiMouseEvent) {
|
|
556
|
+
const owner = this.hoverTargets[event.y]?.owner;
|
|
557
|
+
if (!owner) return undefined;
|
|
558
|
+
const changed = this.hovered?.questionIndex !== owner.questionIndex || this.hovered?.rowIndex !== owner.rowIndex;
|
|
559
|
+
this.hovered = owner;
|
|
560
|
+
return { handled: true as const, render: changed };
|
|
561
|
+
}
|
|
470
562
|
|
|
471
|
-
|
|
563
|
+
private isHovered(owner: LineOwner): boolean {
|
|
564
|
+
return this.hovered?.questionIndex === owner.questionIndex && this.hovered.rowIndex === owner.rowIndex;
|
|
472
565
|
}
|
|
473
566
|
|
|
474
567
|
/** Bottom hint for the active question's interaction model. */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { NativeReviewModeSource } from "./native-review-cli.ts";
|
|
3
|
+
|
|
4
|
+
/** The owner supplies the live UI; consumers cannot provide a context or a mode setter. */
|
|
5
|
+
export interface RddModeControl {
|
|
6
|
+
read(): Promise<{ effective: "on" | "off"; source: NativeReviewModeSource } | undefined>;
|
|
7
|
+
open(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const RDD_MODE_CONTROL_CHANNEL = "gentle:rdd:host-ui";
|
|
11
|
+
|
|
12
|
+
/** Discover the current session owner for a human-operated UI, if one is available. */
|
|
13
|
+
export function discoverRddModeControl(pi: ExtensionAPI): Promise<RddModeControl | undefined> {
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
let settled = false;
|
|
16
|
+
const timer = setTimeout(() => { settled = true; resolve(undefined); }, 100);
|
|
17
|
+
try {
|
|
18
|
+
pi.events.emit(RDD_MODE_CONTROL_CHANNEL, {
|
|
19
|
+
respond(value: RddModeControl) {
|
|
20
|
+
if (settled || typeof value?.read !== "function" || typeof value?.open !== "function") return;
|
|
21
|
+
settled = true;
|
|
22
|
+
clearTimeout(timer);
|
|
23
|
+
resolve(value);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
} catch {
|
|
27
|
+
settled = true;
|
|
28
|
+
clearTimeout(timer);
|
|
29
|
+
resolve(undefined);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Reply-language anchor (full-delegation-mode-conflicts S9).
|
|
2
|
+
//
|
|
3
|
+
// The primary session replies in the human's language, while subagent results,
|
|
4
|
+
// wakes, job notices and summaries are English and reach the model with the user
|
|
5
|
+
// role. A prompt rule ("reply in the language of the human's own last message")
|
|
6
|
+
// did not hold on its own: in a long session that message sits far up the
|
|
7
|
+
// transcript, and after compaction it is gone. So the harness records the human's
|
|
8
|
+
// own text and, when the model is about to answer right after an automated
|
|
9
|
+
// message, adds one anchor that quotes the start of it. No language detection:
|
|
10
|
+
// the human's words carry their language.
|
|
11
|
+
//
|
|
12
|
+
// The anchor is added only when the context's tail is automated, never mid tool
|
|
13
|
+
// loop, and only when no anchor already follows that tail. The caller persists it
|
|
14
|
+
// once (gentle-shell#1662, #2195), but Pi appends a message sent while streaming
|
|
15
|
+
// only once the turn ends, after the reply and its tool results, so the saved copy
|
|
16
|
+
// lands later than the request's trailing copy did. Each anchor therefore records
|
|
17
|
+
// the message it followed and its own timestamp, and `placePersistedReplyAnchors`
|
|
18
|
+
// moves every saved copy back to that spot: request k+1 then starts with exactly
|
|
19
|
+
// the messages of request k, and the provider's prompt cache keeps its prefix
|
|
20
|
+
// (pi-claude-bridge "Extensions that add a message to every request"). The
|
|
21
|
+
// placement lives in lib/request-context-placement.ts. Pure: no pi imports.
|
|
22
|
+
|
|
23
|
+
import type { ContextEvent } from "@earendil-works/pi-coding-agent";
|
|
24
|
+
import { placePersistedMessages, requestMessagePosition, type PersistedPlacement } from "./request-context-placement.ts";
|
|
25
|
+
|
|
26
|
+
type AgentMessage = ContextEvent["messages"][number];
|
|
27
|
+
|
|
28
|
+
export const REPLY_LANGUAGE_ANCHOR_TYPE = "gentle-pi.reply-language";
|
|
29
|
+
|
|
30
|
+
/** Custom messages that never ask the model to answer, so they neither trigger nor hide an anchor. */
|
|
31
|
+
const PASSIVE_TYPES = new Set(["gentle-todo-state", "gentle-todo-reminder", REPLY_LANGUAGE_ANCHOR_TYPE]);
|
|
32
|
+
/** Every automated wake opens with this disowning prefix (extensions/gentle-agents.ts PARENT_WAKE_TEXT). */
|
|
33
|
+
const AUTOMATED_USER_PREFIX = "[System-generated ";
|
|
34
|
+
const EXCERPT_CHARS = 100;
|
|
35
|
+
|
|
36
|
+
type Message = { role?: unknown; customType?: unknown; content?: unknown };
|
|
37
|
+
|
|
38
|
+
function text(content: unknown): string {
|
|
39
|
+
if (typeof content === "string") return content;
|
|
40
|
+
if (!Array.isArray(content)) return "";
|
|
41
|
+
return content
|
|
42
|
+
.map((part) => (part && typeof part === "object" && (part as { type?: unknown }).type === "text" ? String((part as { text?: unknown }).text ?? "") : ""))
|
|
43
|
+
.join(" ");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Typed by the human: interactive or RPC input, never extension-sent text, commands, or shell escapes. */
|
|
47
|
+
export function isHumanInput(source: string, input: string): boolean {
|
|
48
|
+
const trimmed = input.trim();
|
|
49
|
+
return source !== "extension" && trimmed !== "" && !trimmed.startsWith("/") && !trimmed.startsWith("!");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The start of the human's own words: whitespace collapsed, bounded. */
|
|
53
|
+
export function humanLanguageExcerpt(input: string): string | undefined {
|
|
54
|
+
const collapsed = input.replace(/\s+/g, " ").trim();
|
|
55
|
+
if (collapsed === "") return undefined;
|
|
56
|
+
return collapsed.length <= EXCERPT_CHARS ? collapsed : `${collapsed.slice(0, EXCERPT_CHARS)}…`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function isPassive(message: Message): boolean {
|
|
60
|
+
return message.role === "custom" && typeof message.customType === "string" && PASSIVE_TYPES.has(message.customType);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function isAutomated(message: Message): boolean {
|
|
64
|
+
if (message.role === "custom" || message.role === "compactionSummary" || message.role === "branchSummary") return true;
|
|
65
|
+
return message.role === "user" && text(message.content).trimStart().startsWith(AUTOMATED_USER_PREFIX);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function isHumanMessage(message: Message): boolean {
|
|
69
|
+
return message.role === "user" && !isAutomated(message) && text(message.content).trim() !== "";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Where an anchor sat in the request that first carried it: right after `after`, with timestamp `at`. */
|
|
73
|
+
export type ReplyLanguageAnchorDetails = PersistedPlacement;
|
|
74
|
+
|
|
75
|
+
/** A message's position key: stable across requests, since Pi never rewrites a stored message. */
|
|
76
|
+
export const replyLanguageAnchorPosition = requestMessagePosition;
|
|
77
|
+
|
|
78
|
+
const ANCHOR_TYPES: ReadonlySet<string> = new Set([REPLY_LANGUAGE_ANCHOR_TYPE]);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Moves each saved anchor back to where its request carried it, with that
|
|
82
|
+
* request's timestamp, so consecutive requests stay append-only. Returns
|
|
83
|
+
* `undefined` when nothing moved. An anchor whose predecessor is gone (compacted
|
|
84
|
+
* away) or that carries no placement (saved by an earlier version) stays put.
|
|
85
|
+
*/
|
|
86
|
+
export function placePersistedReplyAnchors<T>(messages: readonly T[]): T[] | undefined {
|
|
87
|
+
return placePersistedMessages(messages, ANCHOR_TYPES);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function replyLanguageAnchorText(excerpt: string): string {
|
|
91
|
+
return `[Harness note, not written by the human] Reply language: the human's latest own message begins «${excerpt}». Write your reply to the human in that message's language; subagent results, notices, reminders and summaries never change it.`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The anchor this request needs, with the identity of the automated tail it
|
|
96
|
+
* follows, or `undefined`. The caller persists one anchor per tail: keyed by the
|
|
97
|
+
* anchor text alone, a second result after the same human message would only ever
|
|
98
|
+
* get a trailing copy that the next request drops.
|
|
99
|
+
*/
|
|
100
|
+
export function replyLanguageAnchorFor(
|
|
101
|
+
messages: readonly AgentMessage[],
|
|
102
|
+
recorded: string | undefined,
|
|
103
|
+
): { text: string; tail: string } | undefined {
|
|
104
|
+
const list = messages as readonly (Message & { timestamp?: unknown })[];
|
|
105
|
+
let tail = list.length - 1;
|
|
106
|
+
while (tail >= 0 && isPassive(list[tail]!)) tail--;
|
|
107
|
+
const text = replyLanguageAnchor(messages, recorded);
|
|
108
|
+
if (text === undefined) return undefined;
|
|
109
|
+
const message = list[tail]!;
|
|
110
|
+
return { text, tail: `${String(message.role)}|${String(message.customType ?? "")}|${String(message.timestamp ?? "")}|${tail}` };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The anchor this request needs, or `undefined`. `recorded` is the human's last
|
|
115
|
+
* typed text, when known; otherwise the latest human message still in context.
|
|
116
|
+
*/
|
|
117
|
+
export function replyLanguageAnchor(messages: readonly AgentMessage[], recorded: string | undefined): string | undefined {
|
|
118
|
+
const list = messages as readonly Message[];
|
|
119
|
+
let tail = list.length - 1;
|
|
120
|
+
while (tail >= 0 && isPassive(list[tail]!)) tail--;
|
|
121
|
+
if (tail < 0 || !isAutomated(list[tail]!)) return undefined;
|
|
122
|
+
const latestHuman = [...list].reverse().find(isHumanMessage);
|
|
123
|
+
const source = recorded ?? (latestHuman === undefined ? undefined : text(latestHuman.content));
|
|
124
|
+
const excerpt = source === undefined ? undefined : humanLanguageExcerpt(source);
|
|
125
|
+
if (excerpt === undefined) return undefined;
|
|
126
|
+
const anchor = replyLanguageAnchorText(excerpt);
|
|
127
|
+
const anchored = list.slice(tail + 1).some((message) => message.customType === REPLY_LANGUAGE_ANCHOR_TYPE && text(message.content) === anchor);
|
|
128
|
+
return anchored ? undefined : anchor;
|
|
129
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Placement of saved request-context messages (cost-speed-painpoints S15, P1 and P1b).
|
|
2
|
+
//
|
|
3
|
+
// A hook that adds a hidden message to one model request and saves it with
|
|
4
|
+
// `pi.sendMessage(..., { triggerTurn: false })` keeps the request list
|
|
5
|
+
// append-only only if the saved copy sits where the request carried it. Pi 1.5.2
|
|
6
|
+
// appends a message sent while streaming only once the turn ends, after the
|
|
7
|
+
// assistant reply and its tool results, so the saved copy lands later. Each such
|
|
8
|
+
// message therefore records the message it followed and its own timestamp
|
|
9
|
+
// (`details: { after, at }`), and `placePersistedMessages` moves every saved copy
|
|
10
|
+
// back to that spot on later requests: request k+1 then starts with exactly the
|
|
11
|
+
// messages of request k, and the provider's prompt cache keeps its prefix.
|
|
12
|
+
// Pure: no pi imports.
|
|
13
|
+
|
|
14
|
+
/** Where a saved message sat in the request that first carried it: right after `after`, with timestamp `at`. */
|
|
15
|
+
export type PersistedPlacement = { after: string; at: number };
|
|
16
|
+
|
|
17
|
+
type Placed = { role?: unknown; customType?: unknown; timestamp?: unknown; details?: unknown };
|
|
18
|
+
|
|
19
|
+
/** A message's position key: stable across requests, since Pi never rewrites a stored message. */
|
|
20
|
+
export function requestMessagePosition(message: Placed | undefined): string {
|
|
21
|
+
return message === undefined ? "" : `${String(message.role)}|${String(message.customType ?? "")}|${String(message.timestamp ?? "")}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function placement(message: Placed, types: ReadonlySet<string>): PersistedPlacement | undefined {
|
|
25
|
+
if (message.role !== "custom" || typeof message.customType !== "string" || !types.has(message.customType)) return undefined;
|
|
26
|
+
const details = message.details as Partial<PersistedPlacement> | undefined;
|
|
27
|
+
return typeof details?.after === "string" && typeof details.at === "number" ? { after: details.after, at: details.at } : undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Moves each saved custom message of `types` back to where its request carried
|
|
32
|
+
* it, with that request's timestamp, so consecutive requests stay append-only.
|
|
33
|
+
* Returns `undefined` when nothing moved. A message whose predecessor is gone
|
|
34
|
+
* (compacted away) or that carries no placement (saved by an earlier version)
|
|
35
|
+
* stays put. A message is only ever placed right after an earlier one, so the
|
|
36
|
+
* leading message keeps its place.
|
|
37
|
+
*/
|
|
38
|
+
export function placePersistedMessages<T>(messages: readonly T[], types: ReadonlySet<string>): T[] | undefined {
|
|
39
|
+
let list: T[] | undefined;
|
|
40
|
+
const current = () => list ?? messages;
|
|
41
|
+
for (let index = 0; index < current().length; index++) {
|
|
42
|
+
const message = current()[index] as Placed;
|
|
43
|
+
const where = placement(message, types);
|
|
44
|
+
if (where === undefined) continue;
|
|
45
|
+
let target = index - 1;
|
|
46
|
+
while (target >= 0 && requestMessagePosition(current()[target] as Placed) !== where.after) target--;
|
|
47
|
+
if (target < 0 || (target === index - 1 && message.timestamp === where.at)) continue;
|
|
48
|
+
list ??= [...messages];
|
|
49
|
+
list.splice(index, 1);
|
|
50
|
+
list.splice(target + 1, 0, { ...message, timestamp: where.at } as T);
|
|
51
|
+
}
|
|
52
|
+
return list;
|
|
53
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export const REVIEW_BLOCKER_GUIDANCE = "When blocker is present, explain its category, actor and next_step in the user's language. It describes only this review step: native continuations, stop/no-retry rules, consent and ordinary repository delivery policy remain authoritative. Do not infer a need to contact a remote maintainer from maintainerAuthorization alone.";
|
|
2
|
+
|
|
3
|
+
/** Informational host diagnosis; native continuations and repository policy remain authoritative. */
|
|
4
|
+
export interface ReviewBlocker {
|
|
5
|
+
category: "configuration" | "input" | "consent" | "continuation" | "stale-binding" | "provider-capability" | "provider-unavailable" | "admission-refused" | "generation-invalid" | "authority-unavailable" | "provider-stop" | "diagnosis-required";
|
|
6
|
+
scope: "review-step";
|
|
7
|
+
actor: "user" | "caller" | "authorized-operator" | "unknown";
|
|
8
|
+
next_step: string;
|
|
9
|
+
automatic_retry: false;
|
|
10
|
+
native_next_action?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Read object-shaped diagnostic fields without interpreting scalars or arrays. */
|
|
14
|
+
function record(value: unknown): Record<string, unknown> {
|
|
15
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Classify structured facts only, never provider prose, prompts or stderr. */
|
|
19
|
+
export function withReviewBlocker(result: Record<string, unknown>): Record<string, unknown> {
|
|
20
|
+
if (result.status !== "blocked") return result;
|
|
21
|
+
const native = record(result.native_failure);
|
|
22
|
+
const transition = record(record(result.result).next_transition);
|
|
23
|
+
const failure = record(result.failure);
|
|
24
|
+
const nativeAction = typeof native.next_action === "string" ? native.next_action : undefined;
|
|
25
|
+
const diagnose = (category: ReviewBlocker["category"], actor: ReviewBlocker["actor"], next_step: string): Record<string, unknown> => ({
|
|
26
|
+
...result,
|
|
27
|
+
blocker: { category, scope: "review-step", actor, next_step, automatic_retry: false,
|
|
28
|
+
...(nativeAction === undefined ? {} : { native_next_action: nativeAction }) } satisfies ReviewBlocker,
|
|
29
|
+
});
|
|
30
|
+
// Uncertainty takes precedence over convenient local remedies. A diagnosis
|
|
31
|
+
// must not suggest re-running an operation that may already have committed.
|
|
32
|
+
if (result.mutation_outcome === "unknown" || result.mutation_outcome === "partial_unknown") {
|
|
33
|
+
return diagnose("authority-unavailable", "unknown", "Follow the returned native reconciliation or stop action. Do not replay an operation with an unknown outcome.");
|
|
34
|
+
}
|
|
35
|
+
if (nativeAction === "explicit-maintainer-action") {
|
|
36
|
+
return diagnose("authority-unavailable", "authorized-operator", "Use the provider-supported maintenance route with its required fresh authorization. Do not infer permission to repair or replay.");
|
|
37
|
+
}
|
|
38
|
+
if (nativeAction !== "stop" && transition.kind !== "stop" && (result.outcome === "native-status-unsupported" || result.outcome === "request-context-unsupported" || failure.kind === "relay-unavailable" || failure.kind === "handshake-refused" || result.outcome === "pi-host-relay-handshake-refused" || result.outcome === "pi-host-relay-unavailable" || result.outcome === "pi-host-relay-transport-unavailable")) {
|
|
39
|
+
return diagnose("provider-capability", "user", "Check the package-selected native provider, its supported capabilities and the host handshake; reload the host after a supported installation change. Escalate only if the required capability is still unavailable.");
|
|
40
|
+
}
|
|
41
|
+
if (result.outcome === "native-status-package-binary-missing" || native.code === "managed_assets_outdated") {
|
|
42
|
+
return diagnose("configuration", "user", "Use the returned installation or managed-asset remediation. Keep any provider stop and authorization requirements in force.");
|
|
43
|
+
}
|
|
44
|
+
if (["reviewer-config-invalid", "reviewer-model-not-found", "reviewer-thinking-invalid"].includes(String(failure.kind))) {
|
|
45
|
+
return diagnose("configuration", "user", "Configure the indicated review routing key with an available model and supported thinking setting. Then follow the returned continuation; this does not authorize a model run or retry.");
|
|
46
|
+
}
|
|
47
|
+
if (failure.kind === "reviewer-auth-unavailable") {
|
|
48
|
+
return diagnose("configuration", "user", "Resolve authentication for the configured reviewer provider, then follow the returned continuation without replaying an uncertain submission.");
|
|
49
|
+
}
|
|
50
|
+
if (failure.kind === "submission-refused") {
|
|
51
|
+
return diagnose("admission-refused", "caller", "The provider refused the generated submission. Preserve its evidence and exact next action; do not strip fields, fabricate a verdict or retry automatically.");
|
|
52
|
+
}
|
|
53
|
+
if (["reviewer-tool-call-attempted", "reviewer-empty-output", "reviewer-output-too-large"].includes(String(failure.kind))) {
|
|
54
|
+
return diagnose("generation-invalid", "caller", "The completion did not satisfy the reviewer boundary. Follow the returned native continuation; do not substitute a result or assume another generation is authorized.");
|
|
55
|
+
}
|
|
56
|
+
if (result.outcome === "native-review-consent-required" || result.outcome === "reviewer-model-run-forecast" || result.outcome === "consent-binding-invalid") {
|
|
57
|
+
return diagnose("consent", "user", "Resolve the returned consent or model-run confirmation through the host using its current binding. This diagnostic grants no consent.");
|
|
58
|
+
}
|
|
59
|
+
if (result.outcome === "consent-binding-stale" || (result.outcome === "intended-untracked-selection-binding-rejected" && ["binding-mismatch", "status-field-mismatch"].includes(String(result.reason)))) {
|
|
60
|
+
return diagnose("stale-binding", "caller", "Do not resend this binding. Follow the host's current continuation to obtain the exact binding for the current candidate, preserving any stop or authorization requirement.");
|
|
61
|
+
}
|
|
62
|
+
// A blocked facade response can be a normal offer awaiting its next host
|
|
63
|
+
// operation. Do not diagnose a ready ACK or collect offer as an unknown error.
|
|
64
|
+
if (result.outcome === undefined && result.failure === undefined && result.native_failure === undefined && result.reconciliation_failure === undefined && result.reconciliation === undefined && transition.kind === "collect" && transition.reason_code === "empty_candidate_base_ref_required") {
|
|
65
|
+
return diagnose("input", "caller", "The current candidate needs an explicit baseRef with committedOnly: true if a committed range is intended. To check a previously acknowledged candidate, use ASSESS with its original committed range and follow the returned evidence. This input request does not establish that an earlier review failed or remains open; it does not authorize another review, acknowledgement or maintenance operation.");
|
|
66
|
+
}
|
|
67
|
+
if (result.outcome === undefined && result.failure === undefined && result.native_failure === undefined && result.reconciliation_failure === undefined && result.reconciliation === undefined && (
|
|
68
|
+
(transition.kind === "execute" && ["review.start", "review.status", "review.acknowledge-approved"].includes(String(record(transition.execute).operation))) ||
|
|
69
|
+
(Array.isArray(result.collectBindings) && result.collectBindings.length > 0)
|
|
70
|
+
)) {
|
|
71
|
+
return diagnose("continuation", "caller", "Follow the exact offered host continuation and its required model-run confirmation or consent. This is a pending review step, not an unknown failure or a new execution permission.");
|
|
72
|
+
}
|
|
73
|
+
if (native.code === "invalid_request" || typeof result.selectionBinding === "string" || Array.isArray(result.collectBindings) || result.outcome === "capture-binding-rejected" || result.outcome === "capture-group-rejected" || (typeof result.outcome === "string" && result.outcome.startsWith("native-start-"))) {
|
|
74
|
+
return diagnose("input", "caller", "Supply the exact requested fields or current host-issued binding. Follow any native stop or no-retry action; a corrected input is not automatic replay permission.");
|
|
75
|
+
}
|
|
76
|
+
if (nativeAction === "stop" || transition.kind === "stop") {
|
|
77
|
+
return diagnose("provider-stop", "unknown", "The provider stopped this review step. Use only a recovery or continuation it explicitly offers; otherwise preserve the diagnostic for investigation.");
|
|
78
|
+
}
|
|
79
|
+
if (result.outcome === "native-status-timed-out") {
|
|
80
|
+
return diagnose("provider-unavailable", "user", "The read-only review inventory read timed out before it completed. Nothing was mutated; rerun the returned remediation_command when ready. Pi does not retry automatically.");
|
|
81
|
+
}
|
|
82
|
+
if (record(result.diagnostics).timed_out === true) {
|
|
83
|
+
return diagnose("provider-unavailable", "unknown", "The native process timed out; its internal phase is not established. Follow the returned action without assuming lock contention, deleting locks or retrying automatically.");
|
|
84
|
+
}
|
|
85
|
+
if (result.outcome === "capture-route-registration-rejected" || result.inventory_complete === false) {
|
|
86
|
+
return diagnose("authority-unavailable", "unknown", "The current authority or routing evidence is incomplete. Preserve the diagnostic and use only the supported native continuation; do not reset or rebuild authority locally.");
|
|
87
|
+
}
|
|
88
|
+
if (failure.kind === "pi-timed-out" || failure.kind === "materialize-failed" || failure.kind === "pi-failed" || result.outcome === "native-operation-failed" || result.outcome === "native-status-unavailable" || result.outcome === "native-status-failed") {
|
|
89
|
+
return diagnose("provider-unavailable", "unknown", "Inspect the returned phase and sanitized diagnostics. A timeout alone does not identify a lock or permit a retry; follow the returned native action.");
|
|
90
|
+
}
|
|
91
|
+
return diagnose("diagnosis-required", "unknown", "Use the structured diagnostic and the supported continuation to identify the cause. No maintainer intervention, retry or authority mutation is implied.");
|
|
92
|
+
}
|