gentle-pi 4.7.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 +55 -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 +6 -6
- 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 +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 +746 -15
- package/assets/design-canvas/canvas.js +2 -1506
- package/assets/design-canvas/index.html +117 -36
- package/assets/design-canvas/inspector.js +546 -16
- package/assets/install-wizard/wizard.js +5 -1
- package/assets/migrations/agent-body-history.json +24 -0
- package/assets/orchestrator-delegation-reference.md +8 -14
- package/assets/orchestrator-delegation.md +4 -4
- package/assets/orchestrator-full-delegation-card.md +4 -5
- package/assets/orchestrator-full-delegation.md +8 -8
- package/assets/orchestrator-memory.md +2 -2
- package/assets/orchestrator-prompts.md +1 -1
- package/assets/orchestrator-quota-recovery.md +5 -0
- package/assets/orchestrator-skills.md +13 -12
- package/assets/orchestrator-tracking.md +10 -14
- package/assets/orchestrator-verification.md +10 -8
- package/assets/orchestrator-writer.md +4 -4
- package/assets/orchestrator.md +18 -22
- package/bin/gentle-shell.mjs +128 -9
- 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/assets/brand/sponsor-banner.svg +60 -0
- package/docs/bundled-install.md +14 -6
- package/docs/delegated-verification.md +18 -2
- package/docs/desktop-rpc.md +1253 -0
- package/docs/gentle-agents-activity.md +26 -0
- package/docs/gentle-shell.md +39 -16
- 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 +76 -24
- package/docs/review-coordinator.md +29 -9
- package/docs/review-delivery-preflight.md +22 -0
- package/docs/work-continuity.md +11 -1
- package/extensions/ask-user-question.ts +2 -2
- package/extensions/child-context.ts +21 -7
- package/extensions/gentle-agents.ts +234 -33
- package/extensions/gentle-ai.ts +576 -135
- 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 +105 -52
- package/extensions/gentle-todo.ts +48 -25
- package/extensions/skill-registry.ts +248 -223
- 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 +15 -0
- package/lib/agents-report-cap.ts +115 -0
- package/lib/agents-runner.ts +91 -6
- package/lib/agents-session-transport.ts +17 -1
- package/lib/background-jobs-tools.ts +9 -4
- package/lib/bounded-writer-admission.ts +184 -31
- package/lib/child-context-files.ts +21 -6
- package/lib/codemode-renderer.ts +1 -0
- 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 +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/hidden-tools.ts +35 -0
- package/lib/inprocess-reviewer.ts +96 -12
- 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 +79 -4
- 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/shell-prompt.ts +16 -3
- package/lib/shell-usage.ts +10 -0
- 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 +2 -2
- package/prompts/skill-creation.md +1 -10
- package/runtime/design-canvas-assets.mjs +37 -0
- package/runtime/gentle-shell-bundled.mjs +100 -9
- package/runtime/native-review-cli.mjs +79 -4
- package/runtime/review-integration-v2.mjs +56 -3
- package/scripts/bootstrap.cmd +2 -2
- package/scripts/bootstrap.sh +41 -4
- package/scripts/build-full-delegation-card.mjs +4 -0
- package/scripts/build-runtime-modules.mjs +1 -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 +40 -19
- 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/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 +10 -2
- package/tests/approved-text-leftovers-contract.test.ts +136 -0
- package/tests/artifact-language.test.ts +1 -1
- package/tests/ask-user-question.test.ts +2 -1
- package/tests/audit-leftovers-contract.test.ts +51 -0
- package/tests/bounded-stop-contract.test.ts +9 -1
- package/tests/branch-pr-skill.test.ts +10 -1
- package/tests/bundled-install.test.ts +1 -1
- 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/delegate-for-reason-contract.test.ts +30 -8
- 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 +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/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 +20 -29
- package/tests/fixtures/refusal-identity.probe.mjs +139 -0
- package/tests/full-delegation-closure.test.ts +29 -0
- package/tests/gentle-agents.test.ts +329 -4
- 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 +121 -6
- package/tests/gentle-design.test.ts +365 -1
- package/tests/gentle-shell-bundled.test.ts +91 -5
- package/tests/gentle-shell-launcher.test.ts +1 -1
- package/tests/gentle-shell.test.ts +118 -87
- package/tests/gentle-todo.test.ts +32 -9
- package/tests/hidden-tools.test.ts +188 -0
- package/tests/independent-recovery-delivery.test.ts +19 -5
- 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 +158 -0
- package/tests/maintainer/desktop-rpc.maintest.ts +632 -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 +11 -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 +11 -3
- package/tests/odd-integration.test.ts +11 -3
- package/tests/odd-routing-contract.test.ts +80 -28
- package/tests/orchestrator-budget.test.ts +30 -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 +11 -2
- package/tests/orchestrator-prompt-diet-contract.test.ts +221 -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 +11 -10
- 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-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/provider-defect-handoff.test.ts +9 -2
- 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 +1 -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 +26 -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/session-profile-extension.test.ts +2 -2
- package/tests/shell-prompt.test.ts +17 -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 +929 -306
- package/tests/support/design-canvas-dom.ts +369 -0
- package/tests/support/review-coordinator-runtime.ts +212 -17
- package/tests/task-size-routing-contract.test.ts +42 -11
- 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-preparation.test.ts +229 -0
- package/tests/verify-agent-contract.test.ts +20 -2
- package/tests/verify-first-launch-contract.test.ts +87 -11
- package/tests/vim-editor-adapter.test.ts +2 -2
- package/tests/work-continuity-contract.test.ts +54 -11
- 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/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.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
|
@@ -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,8 +20,6 @@ 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
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.
|
|
@@ -34,9 +32,7 @@ Stop for an unresolved consequential scope/product decision, required explicit c
|
|
|
34
32
|
|
|
35
33
|
Before a terminal bounded-stop outcome, distinguish a recoverable technical or harness failure from genuinely inaccessible required proof. A failed test or harness check may be corrected and rerun without another authorization only within the authorized scope and existing correction budget, subject to every applicable limit. Honor explicit one run, no retries, or diagnostic-only limits; stop for permission denial, required new consent, or exhausted budget. Do not propose diagnostic-only or single-attempt authorization unless the human requested it. Respect terminal review and verification outcomes and existing bounded-stop rules: never reset budgets, add retry allowances, weaken checks, or override final outcomes.
|
|
36
34
|
|
|
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.
|
|
35
|
+
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 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. When specifically authorized and not prohibited by actual native authority, continue ordinary in-scope compilation or implementation; unavailable proof still blocks completion and delivery.
|
|
40
36
|
|
|
41
37
|
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
38
|
|
|
@@ -57,39 +53,24 @@ Resume an interrupted feature with `mem_context`, then project- and feature-scop
|
|
|
57
53
|
Harness principles:
|
|
58
54
|
- el Gentleman is not prompt engineering. It is runtime discipline around powerful agents.
|
|
59
55
|
- 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
56
|
- 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.
|
|
57
|
+
- 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
58
|
- 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
59
|
|
|
65
60
|
# el Gentleman Orchestrator
|
|
66
61
|
|
|
67
62
|
Bind this to the parent Pi session only; subagents get bounded task instructions.
|
|
68
63
|
|
|
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
64
|
## Core Role
|
|
74
65
|
|
|
75
66
|
Package assets root: `{{GENTLE_PI_ASSETS_ROOT}}`. Lazy asset paths below are relative to this root.
|
|
76
67
|
|
|
77
|
-
You are a COORDINATOR
|
|
68
|
+
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
69
|
|
|
79
70
|
Default to concise synthesis: decision, outcome, next action. Expand on request or when detail is needed.
|
|
80
71
|
|
|
81
72
|
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
73
|
|
|
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
74
|
## Task Size
|
|
94
75
|
|
|
95
76
|
Task size: small or large. A task is **small** when all three hold:
|
|
@@ -100,9 +81,9 @@ Task size: small or large. A task is **small** when all three hold:
|
|
|
100
81
|
|
|
101
82
|
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
83
|
|
|
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;
|
|
84
|
+
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
85
|
|
|
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
|
|
86
|
+
**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
87
|
|
|
107
88
|
**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
89
|
|
|
@@ -117,21 +98,31 @@ Before launching bounded writer (`gentle-ai-worker` or `worker`), derive nonempt
|
|
|
117
98
|
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
99
|
|
|
119
100
|
1. **Ask** — open product or design decision → one focused question; stop and wait.
|
|
120
|
-
2. **Evidence-budget rule** — understanding needs more than one read batch or
|
|
101
|
+
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
102
|
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
103
|
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.
|
|
104
|
+
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
105
|
6. **Incident rule** — diagnose wrong cwd/worktree/git/tooling incidents separately before resuming.
|
|
125
106
|
7. **Context backstop** — when the runtime signals it → delegate the next unit needing several steps. Bound command output (counts, `--stat`, `tail`).
|
|
126
107
|
|
|
127
108
|
Background subagent policy: off (capability: ready)
|
|
128
|
-
Receipt-driven development: unknown (native status unavailable); rules:
|
|
109
|
+
Receipt-driven development: unknown (native status unavailable); rules: background block, `orchestrator-delegation-reference.md`.
|
|
129
110
|
|
|
130
111
|
Per-action table, Work Routing Ladder, Canonical Workflows: `orchestrator-delegation-reference.md`; blocking-prompt relays and provider defects: `orchestrator-prompts.md`.
|
|
131
112
|
|
|
113
|
+
## Language Boundary
|
|
114
|
+
|
|
115
|
+
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:
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
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.
|
|
120
|
+
|
|
121
|
+
Subagent-facing English delegation and quote/UI exceptions: `orchestrator-delegation.md`.
|
|
122
|
+
|
|
132
123
|
## Memory Contract
|
|
133
124
|
|
|
134
|
-
With memory, the parent selects context;
|
|
125
|
+
With memory, the parent selects context; workers save validated facts when given a project. ODD task continuity and memory lifecycle: `orchestrator-memory.md`.
|
|
135
126
|
|
|
136
127
|
## Skill Registry Protocol
|
|
137
128
|
|
|
@@ -143,7 +134,7 @@ For skill-shaped requests, `<available_skills>` is a discovery aid only, never o
|
|
|
143
134
|
|
|
144
135
|
## Gentle AI RDD ownership
|
|
145
136
|
|
|
146
|
-
|
|
137
|
+
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
138
|
|
|
148
139
|
## Safety
|
|
149
140
|
|
|
@@ -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
|
+
});
|
|
@@ -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("Fixes to one unit continue its 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/);
|