gentle-pi 4.6.0 → 4.7.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 +10 -11
- package/assets/agents/gentle-ai-explore.md +1 -0
- package/assets/agents/gentle-ai-verify.md +5 -2
- package/assets/agents/gentle-ai-worker.md +3 -0
- package/assets/agents/jd-fix-agent.md +1 -0
- package/assets/agents/jd-judge-a.md +1 -0
- package/assets/agents/jd-judge-b.md +1 -0
- package/assets/design-canvas/canvas.css +13 -1
- package/assets/design-canvas/canvas.js +11 -2
- package/assets/install-wizard/wizard.js +1 -0
- package/assets/migrations/agent-body-history.json +16 -1
- package/assets/orchestrator-delegation-reference.md +4 -4
- package/assets/orchestrator-delegation.md +1 -1
- package/assets/orchestrator-full-delegation-card.md +65 -0
- package/assets/orchestrator-full-delegation.md +34 -0
- package/assets/orchestrator-memory.md +3 -3
- package/assets/orchestrator-prompts.md +1 -1
- package/assets/orchestrator-skills.md +1 -1
- package/assets/orchestrator-verification.md +7 -5
- package/assets/orchestrator.md +3 -3
- package/bin/gentle-shell.mjs +164 -56
- package/docs/agent-status.md +61 -0
- package/docs/bundled-install.md +7 -5
- package/docs/delegated-verification.md +29 -7
- package/docs/gentle-agents-activity.md +14 -0
- package/docs/gentle-shell.md +54 -16
- package/docs/install-wizard.md +1 -1
- package/docs/permission-modes.md +9 -4
- package/docs/readme-reference.md +75 -30
- package/docs/render-cache-performance.md +11 -1
- package/docs/review-coordinator.md +33 -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/yolo-mode.md +5 -5
- package/extensions/ask-user-choice.ts +1 -0
- package/extensions/ask-user-question.ts +1 -0
- package/extensions/child-safety.ts +3 -0
- package/extensions/gentle-agent-status.ts +99 -0
- package/extensions/gentle-agents.ts +326 -34
- package/extensions/gentle-ai.ts +1496 -454
- package/extensions/gentle-shell.ts +293 -63
- package/extensions/gentle-todo.ts +18 -2
- package/extensions/gentle-tps.ts +48 -0
- package/extensions/quiet-tools.ts +38 -8
- package/extensions/skill-registry.ts +175 -18
- package/extensions/startup-banner.ts +30 -3
- package/lib/agent-profile-pin.ts +3 -3
- package/lib/agent-profiles.ts +160 -2
- package/lib/agent-status.ts +105 -0
- package/lib/agents-config.ts +46 -0
- package/lib/agents-history.ts +24 -5
- package/lib/agents-messaging.ts +47 -5
- package/lib/agents-runner.ts +183 -12
- package/lib/auto-permission-runtime.ts +1 -1
- package/lib/bounded-writer-admission.ts +13 -1
- package/lib/card-content-policy.ts +8 -6
- package/lib/command-palette.ts +133 -17
- package/lib/context-backstop.ts +14 -5
- package/lib/destructive-command-guard.ts +48 -4
- 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-design.ts +3 -0
- package/lib/gentle-shell-bundled.ts +6 -19
- package/lib/gentle-shell-launcher.ts +43 -8
- package/lib/herdr-activity.ts +14 -2
- package/lib/herdr-busy.ts +45 -0
- package/lib/image-attachments.ts +33 -0
- package/lib/image-disk-cache.ts +137 -0
- package/lib/inprocess-reviewer.ts +270 -140
- package/lib/jobs-view.ts +198 -11
- package/lib/model-routing-authority.ts +22 -4
- package/lib/native-choice-list.ts +20 -2
- package/lib/native-review-cli.ts +96 -19
- 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 +104 -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-continuation-registry.ts +99 -0
- package/lib/review-coordinator.ts +163 -0
- package/lib/review-failure-facts.ts +49 -0
- package/lib/review-host-relay.ts +46 -10
- package/lib/review-integration-v2.ts +7 -1
- package/lib/review-relay-phase-timing.ts +45 -0
- package/lib/review-start-context.ts +17 -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-sidebar-layout.ts +112 -40
- package/lib/shell-sidebar.ts +7 -0
- package/lib/shell-todo.ts +10 -3
- package/lib/verifier-admission.ts +1 -1
- 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/yolo-session-policy.ts +40 -15
- package/package.json +2 -1
- package/runtime/gentle-ai-binary.mjs +1 -1
- package/runtime/gentle-shell-bundled.mjs +6 -19
- package/runtime/gentle-shell-launcher.mjs +42 -7
- package/runtime/native-review-cli.mjs +93 -16
- package/runtime/review-integration-v2.mjs +7 -1
- package/scripts/build-full-delegation-card.mjs +175 -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-preflight.mjs +5 -5
- package/scripts/installer-runner.mjs +27 -12
- package/scripts/installer-server.mjs +8 -7
- 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/verify-package-files.mjs +12 -2
- package/scripts/voice-worker.cjs +32 -6
- package/skills/design/SKILL.md +11 -8
- package/skills/gentle-ai/SKILL.md +2 -2
- 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/skill-registry/SKILL.md +4 -2
- package/skills/work-unit-commits/SKILL.md +6 -7
- package/tests/agent-home.test.ts +28 -9
- package/tests/agent-profiles-workflow.test.ts +163 -0
- package/tests/agent-risk-escalation.test.ts +1 -1
- package/tests/agent-status.test.ts +143 -0
- package/tests/agents-config.test.ts +96 -0
- package/tests/agents-history.test.ts +31 -0
- package/tests/agents-jobs-frames.test.ts +93 -0
- package/tests/agents-prompt-lifecycle-runtime.test.ts +376 -0
- package/tests/agents-runner-drain.test.ts +193 -0
- package/tests/agents-runner.test.ts +178 -2
- package/tests/append-system-prompt-route.test.ts +4 -1
- package/tests/ask-user-choice.test.ts +4 -3
- package/tests/ask-user-question.test.ts +97 -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 +43 -3
- package/tests/bridge-cost.test.ts +19 -4
- package/tests/bundled-install.test.ts +30 -5
- package/tests/card-content-policy.test.ts +3 -3
- package/tests/chained-pr-skill.test.ts +8 -6
- package/tests/child-safety.test.ts +11 -0
- package/tests/codegraph-tools.test.ts +11 -5
- package/tests/command-palette.test.ts +284 -1
- package/tests/delegate-for-reason-contract.test.ts +3 -3
- package/tests/design-canvas-assets.test.ts +185 -2
- package/tests/destructive-command-guard.test.ts +52 -0
- package/tests/download-progress.test.ts +71 -0
- package/tests/execution-surface-guard.test.ts +55 -0
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +9 -5
- package/tests/fixtures/proxy-tls/proxy.crt +19 -0
- package/tests/fixtures/proxy-tls/proxy.key +28 -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 +131 -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 +1070 -12
- package/tests/gentle-ai-binary.test.ts +3 -1
- 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 +134 -51
- package/tests/gentle-ai-proxy.test.ts +434 -0
- package/tests/gentle-ai.test.ts +113 -38
- package/tests/gentle-design.test.ts +21 -0
- 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 +207 -31
- package/tests/gentle-shell-launcher.test.ts +77 -10
- package/tests/gentle-shell.test.ts +899 -59
- package/tests/gentle-todo.test.ts +19 -2
- 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/image-disk-cache.test.ts +163 -0
- package/tests/independent-recovery-delivery.test.ts +83 -0
- package/tests/inprocess-reviewer.test.ts +176 -4
- package/tests/installer-posix-bootstrap.test.ts +1 -1
- package/tests/installer-preflight.test.ts +5 -4
- package/tests/installer-runner.test.ts +79 -44
- package/tests/installer-server.test.ts +14 -11
- package/tests/jobs-view.test.ts +260 -6
- package/tests/modal-mouse-boundaries.test.ts +136 -0
- package/tests/model-routing-authority.test.ts +178 -2
- package/tests/native-choice-list.test.ts +77 -2
- package/tests/native-review-capability-contract.test.ts +7 -1
- package/tests/native-review-cli.test.ts +269 -1
- package/tests/no-self-pause-contract.test.ts +4 -1
- package/tests/odd-routing-canonical-ratchet.test.ts +3 -3
- package/tests/orchestrator-budget.test.ts +7 -2
- package/tests/orchestrator-delegation-mode.test.ts +153 -0
- package/tests/orchestrator-mode-policy.test.ts +175 -0
- package/tests/orchestrator-prompt-budget.test.ts +3 -1
- package/tests/orchestrator-rdd-ownership.test.ts +2 -2
- package/tests/package-manifest.test.ts +11 -9
- package/tests/permission-allowlist.test.ts +202 -0
- package/tests/pi-update-launcher.test.ts +8 -0
- package/tests/pnpm-workspace-config.test.ts +58 -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/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 +16 -11
- 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 +18 -0
- package/tests/render-cache-performance.test.ts +171 -2
- package/tests/reply-language-anchor.test.ts +173 -0
- package/tests/review-agent-end-preflight.test.ts +1 -1
- 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 +1 -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 +76 -0
- 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 +96 -11
- package/tests/review-coordinator-runtime.test.ts +117 -0
- package/tests/review-coordinator.test.ts +195 -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-v2.test.ts +46 -3
- package/tests/review-json-arguments.test.ts +65 -10
- package/tests/review-last-event-closure.test.ts +68 -0
- package/tests/review-loadout-rdd-off-sdk.test.ts +65 -31
- 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 +12 -2
- package/tests/review-reviewer-evidence.test.ts +183 -0
- package/tests/review-risk-assessment.test.ts +74 -3
- package/tests/review-session-standing-permission-controller.test.ts +21 -1
- package/tests/review-start-context.test.ts +19 -0
- package/tests/review-tool-prose-budget.test.ts +121 -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-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-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/skill-registry.test.ts +838 -5
- package/tests/startup-banner.test.ts +152 -1
- package/tests/startup-home-repo.test.ts +2 -0
- package/tests/support/review-coordinator-runtime.ts +69 -0
- package/tests/task-size-routing-contract.test.ts +5 -3
- package/tests/verifier-admission.test.ts +49 -0
- package/tests/verify-first-launch-contract.test.ts +78 -3
- 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 +28 -0
- package/tests/writer-feature-document-admission.test.ts +92 -0
- package/tests/yolo-customize.test.ts +27 -4
- package/tests/yolo-mode.test.ts +23 -18
- package/tests/yolo-session-policy.test.ts +270 -1
package/assets/orchestrator.md
CHANGED
|
@@ -12,7 +12,7 @@ Package assets root: `{{GENTLE_PI_ASSETS_ROOT}}`. Lazy asset paths below are rel
|
|
|
12
12
|
|
|
13
13
|
You are a COORDINATOR, not the default executor for substantial work. Maintain one thin conversation thread, delegate real phase work to Pi subagents when available, and synthesize results for the user.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Default to concise synthesis: decision, outcome, next action. Expand on request or when detail is needed.
|
|
16
16
|
|
|
17
17
|
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.
|
|
18
18
|
|
|
@@ -54,7 +54,7 @@ Delegation Triggers — each mechanism turns on only when its own trigger condit
|
|
|
54
54
|
|
|
55
55
|
1. **Ask** — open product or design decision → one focused question; stop and wait.
|
|
56
56
|
2. **Evidence-budget rule** — understanding needs more than one read batch or >~5 sequential 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.
|
|
57
|
-
3. **Verification rule** — only a named high-risk item (assess `escalate`) → independent `gentle-ai-verify`; else inline; runtime admission, gates/overengineering: `orchestrator-verification.md`.
|
|
57
|
+
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`.
|
|
58
58
|
4. **Track** — large task → feature document, Engram mirror, `todo`, work-unit commits (`orchestrator-tracking.md`, `orchestrator-memory.md`).
|
|
59
59
|
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.
|
|
60
60
|
6. **Incident rule** — diagnose wrong cwd/worktree/git/tooling incidents separately before resuming.
|
|
@@ -86,5 +86,5 @@ This package injects the mirrored provider-bundle review execution contract into
|
|
|
86
86
|
- Never commit unless the user explicitly asks, except the work-unit commits authorized large ODD implementation makes on its feature branch (ODD step 6).
|
|
87
87
|
- Ask before destructive git operations, publishing, or irreversible file changes.
|
|
88
88
|
- Parallel writers only with disjoint Allowed edit surfaces (runtime-enforced) or isolated worktrees.
|
|
89
|
-
- Keep session work inside the project root and registered same-clone worktrees; ask before any read or write outside it, naming the absolute path. Grants are per-target, per-session, never blanket: in-project scripts naming outside paths are not standing consent.
|
|
89
|
+
- Keep session work inside the project root and registered same-clone worktrees; ask before any read or write outside it, naming the absolute path. Exception: reading the task's exact resolved skill files needs no per-file question in any mode. Grants are per-target, per-session, never blanket: in-project scripts naming outside paths are not standing consent.
|
|
90
90
|
- Preserve human control: user decisions beat agent momentum.
|
package/bin/gentle-shell.mjs
CHANGED
|
@@ -26,9 +26,9 @@ import {
|
|
|
26
26
|
writeFileSync,
|
|
27
27
|
} from "node:fs";
|
|
28
28
|
import { constants as osConstants, homedir, tmpdir } from "node:os";
|
|
29
|
-
import { delimiter, dirname, join, resolve as resolvePath } from "node:path";
|
|
29
|
+
import { delimiter, dirname, isAbsolute, join, relative, resolve as resolvePath } from "node:path";
|
|
30
30
|
import { spawn, spawnSync } from "node:child_process";
|
|
31
|
-
import { fileURLToPath } from "node:url";
|
|
31
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
32
32
|
import {
|
|
33
33
|
buildPiInvocation,
|
|
34
34
|
checkPiVersion,
|
|
@@ -83,7 +83,6 @@ import {
|
|
|
83
83
|
bundledPi,
|
|
84
84
|
bundledSetupEnv,
|
|
85
85
|
bundledUpdateNext,
|
|
86
|
-
bundledUpdateNotice,
|
|
87
86
|
bundledUpdatePlan,
|
|
88
87
|
nodeBundledFs,
|
|
89
88
|
parseBundledUpgradeArgs,
|
|
@@ -138,14 +137,14 @@ function resolveBundledCli() {
|
|
|
138
137
|
const expectedEntry = join(root, "dist", "index.js");
|
|
139
138
|
const metadata = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
140
139
|
if (entry !== expectedEntry || metadata.name !== "@earendil-works/pi-coding-agent" ||
|
|
141
|
-
metadata.bin?.pi !== "dist/bundle/cli.js") {
|
|
140
|
+
metadata.bin?.pi !== "dist/bundle/cli.js" || typeof metadata.version !== "string") {
|
|
142
141
|
throw new Error("Unsupported adjacent Pi package entry/name/bin metadata");
|
|
143
142
|
}
|
|
144
143
|
const cliPath = join(root, metadata.bin.pi);
|
|
145
144
|
if (realpathSync(cliPath) !== cliPath || !statSync(cliPath).isFile()) {
|
|
146
145
|
throw new Error("Unsupported adjacent Pi CLI path");
|
|
147
146
|
}
|
|
148
|
-
return cliPath;
|
|
147
|
+
return { path: cliPath, version: metadata.version };
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
function findOnPath(name) {
|
|
@@ -263,9 +262,71 @@ async function startSharedEngram() {
|
|
|
263
262
|
return failed;
|
|
264
263
|
}
|
|
265
264
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
const LEGACY_ENGRAM_COMPANION_SOURCE = "npm:gentle-engram@0.4.2";
|
|
266
|
+
const companionSource = (entry) => typeof entry === "string" ? entry : entry?.source;
|
|
267
|
+
|
|
268
|
+
function ownsCompanionHome(home, homeHadContentBeforeBootstrap) {
|
|
269
|
+
if (home.mode === "link") return false;
|
|
270
|
+
const previous = provisionedEntry(readRawConfig(resolveConfigPath()), safeRealpath(home.dir));
|
|
271
|
+
return !homeIsForeign(home, previous, homeHadContentBeforeBootstrap);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// The old launcher itself registered this exact pin. In a Shell-owned home,
|
|
275
|
+
// migrate only that legacy selection, using the selected Pi's own package
|
|
276
|
+
// manager to keep source identity, filters, ordering and settings locking. This
|
|
277
|
+
// changes configuration only: Pi's normal startup notice and explicit update
|
|
278
|
+
// command remain responsible for discovering and installing newer packages.
|
|
279
|
+
async function migrateManagedEngramCompanion(home, homeHadContentBeforeBootstrap) {
|
|
280
|
+
if (!ownsCompanionHome(home, homeHadContentBeforeBootstrap)) return { ok: true };
|
|
281
|
+
try {
|
|
282
|
+
const settingsPath = join(home.dir, "settings.json");
|
|
283
|
+
const packages = JSON.parse(readJsonIfExists(settingsPath) ?? "{}").packages ?? [];
|
|
284
|
+
if (!Array.isArray(packages)) return { ok: true };
|
|
285
|
+
const npmSources = packages.map(companionSource).filter((source) => typeof source === "string" && /^npm:gentle-engram(?:@|$)/.test(source));
|
|
286
|
+
if (npmSources.length !== 1 || npmSources[0] !== LEGACY_ENGRAM_COMPANION_SOURCE) return { ok: true };
|
|
287
|
+
// Do not take over an explicitly selected local companion, or infer
|
|
288
|
+
// ownership from a missing/unverified npm installation.
|
|
289
|
+
if (packages.some((entry) => {
|
|
290
|
+
const source = companionSource(entry);
|
|
291
|
+
return typeof source === "string" && !source.startsWith("npm:") && readPackageName(resolvePath(home.dir, source)) === "gentle-engram";
|
|
292
|
+
})) return { ok: true };
|
|
293
|
+
const metadata = join(home.dir, "npm", "node_modules", "gentle-engram", "package.json");
|
|
294
|
+
const metadataText = readJsonIfExists(metadata);
|
|
295
|
+
if (!supportsEngramStartupPolicy(metadataText) || JSON.parse(metadataText).version !== "0.4.2") throw new Error("the legacy companion installation could not be verified");
|
|
296
|
+
const piRoot = dirname(dirname(dirname(bundledCli)));
|
|
297
|
+
const main = JSON.parse(readJsonIfExists(join(piRoot, "package.json")) ?? "{}").main;
|
|
298
|
+
if (typeof main !== "string" || !main) throw new Error("the selected Pi does not expose its package manager");
|
|
299
|
+
const sdkPath = resolvePath(piRoot, main);
|
|
300
|
+
const sdkRelative = relative(piRoot, sdkPath);
|
|
301
|
+
if (!sdkRelative || sdkRelative === ".." || sdkRelative.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || isAbsolute(sdkRelative)) throw new Error("the selected Pi package manager is outside its package");
|
|
302
|
+
const { DefaultPackageManager, SettingsManager } = await import(pathToFileURL(sdkPath).href);
|
|
303
|
+
const settings = SettingsManager.create(process.cwd(), home.dir, { projectTrusted: false });
|
|
304
|
+
const loadErrors = settings.drainErrors();
|
|
305
|
+
if (loadErrors.length) throw loadErrors[0].error;
|
|
306
|
+
const selected = settings.getGlobalSettings().packages ?? [];
|
|
307
|
+
const currentNpmSources = selected.map(companionSource).filter((source) => typeof source === "string" && /^npm:gentle-engram(?:@|$)/.test(source));
|
|
308
|
+
const localSelected = selected.some((entry) => {
|
|
309
|
+
const source = companionSource(entry);
|
|
310
|
+
return typeof source === "string" && !source.startsWith("npm:") && readPackageName(resolvePath(home.dir, source)) === "gentle-engram";
|
|
311
|
+
});
|
|
312
|
+
if (localSelected || currentNpmSources.length !== 1 || currentNpmSources[0] !== LEGACY_ENGRAM_COMPANION_SOURCE) throw new Error("companion selection changed");
|
|
313
|
+
const manager = new DefaultPackageManager({ cwd: process.cwd(), agentDir: home.dir, settingsManager: settings });
|
|
314
|
+
manager.addSourceToSettings(ENGRAM_COMPANION_SOURCE);
|
|
315
|
+
await settings.flush();
|
|
316
|
+
const errors = settings.drainErrors();
|
|
317
|
+
if (errors.length) throw errors[0].error;
|
|
318
|
+
const persisted = JSON.parse(readJsonIfExists(settingsPath) ?? "{}").packages;
|
|
319
|
+
if (!Array.isArray(persisted) || !persisted.some((entry) => companionSource(entry) === ENGRAM_COMPANION_SOURCE)) throw new Error("companion selection was not saved");
|
|
320
|
+
return { ok: true };
|
|
321
|
+
} catch (error) {
|
|
322
|
+
return { ok: false, exitCode: 1, message: `gentle-shell: could not prepare the managed gentle-engram package for updates (${error.message}); review its selection before retrying` };
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Use Pi's install command, never an alternate extension loader. A user's
|
|
327
|
+
// selected companion stays selected; missing or unverified capability is only
|
|
328
|
+
// warned about, while the guard continues to protect unverified stores.
|
|
329
|
+
async function ensureEngramCompanion(home, runtime, stdio, timeoutMs, homeHadContentBeforeBootstrap) {
|
|
269
330
|
const metadata = join(home.dir, "npm", "node_modules", "gentle-engram", "package.json");
|
|
270
331
|
let packages;
|
|
271
332
|
try {
|
|
@@ -274,15 +335,12 @@ async function ensureEngramCompanion(home, runtime, stdio, timeoutMs) {
|
|
|
274
335
|
return { ok: false, exitCode: 1, message: "gentle-shell: cannot verify Engram startupPolicy from malformed settings; repair settings and recheck" };
|
|
275
336
|
}
|
|
276
337
|
if (!Array.isArray(packages)) return { ok: false, exitCode: 1, message: "gentle-shell: cannot verify Engram startupPolicy from non-array packages" };
|
|
277
|
-
let pinned = false;
|
|
278
338
|
let local = false;
|
|
279
|
-
|
|
339
|
+
const npmSelections = [];
|
|
280
340
|
for (const entry of packages) {
|
|
281
|
-
const source =
|
|
282
|
-
if (source ===
|
|
283
|
-
if (typeof source === "string" && /^npm:gentle-engram(?:@|$)/.test(source)) npmSelected = true;
|
|
341
|
+
const source = companionSource(entry);
|
|
342
|
+
if (typeof source === "string" && /^npm:gentle-engram(?:@|$)/.test(source)) npmSelections.push(source);
|
|
284
343
|
if (typeof source !== "string" || source.startsWith("npm:")) continue;
|
|
285
|
-
// Preserve an explicit local companion selection rather than overwrite it.
|
|
286
344
|
const selected = resolvePath(home.dir, source);
|
|
287
345
|
if (readPackageName(selected) !== "gentle-engram") continue;
|
|
288
346
|
if (!supportsEngramStartupPolicy(readJsonIfExists(join(selected, "package.json")))) {
|
|
@@ -290,14 +348,25 @@ async function ensureEngramCompanion(home, runtime, stdio, timeoutMs) {
|
|
|
290
348
|
}
|
|
291
349
|
local = true;
|
|
292
350
|
}
|
|
293
|
-
if (
|
|
294
|
-
|
|
351
|
+
if (npmSelections.length) {
|
|
352
|
+
const metadataText = readJsonIfExists(metadata);
|
|
353
|
+
if (supportsEngramStartupPolicy(metadataText)) {
|
|
354
|
+
const installedVersion = JSON.parse(metadataText).version;
|
|
355
|
+
const mismatch = npmSelections.some((source) => {
|
|
356
|
+
const exact = /^npm:gentle-engram@v?((?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/.exec(source);
|
|
357
|
+
return exact && exact[1] !== installedVersion;
|
|
358
|
+
});
|
|
359
|
+
if (!mismatch) return { ok: true };
|
|
360
|
+
return { ok: false, exitCode: 1, message: "gentle-shell: selected gentle-engram does not match its installed version; recheck its startupPolicy (selection preserved)" };
|
|
361
|
+
}
|
|
362
|
+
return { ok: false, exitCode: 1, message: "gentle-shell: selected gentle-engram lacks engram.startupPolicy=1; update it and recheck (selection preserved)" };
|
|
363
|
+
}
|
|
364
|
+
if (local || !ownsCompanionHome(home, homeHadContentBeforeBootstrap)) return { ok: true };
|
|
295
365
|
process.stderr.write(`gentle-shell: installing policy-capable companion ${ENGRAM_COMPANION_SOURCE} through Pi\n`);
|
|
296
366
|
const result = await spawnAndWait(runtime.command, [...runtime.args, "install", ENGRAM_COMPANION_SOURCE], buildSetupEnv(home, runtime), stdio, timeoutMs);
|
|
297
367
|
let declared = false;
|
|
298
368
|
try {
|
|
299
|
-
declared = JSON.parse(readJsonIfExists(join(home.dir, "settings.json")) ?? "{}").packages?.some((entry) =>
|
|
300
|
-
(typeof entry === "string" ? entry : entry?.source) === ENGRAM_COMPANION_SOURCE) === true;
|
|
369
|
+
declared = JSON.parse(readJsonIfExists(join(home.dir, "settings.json")) ?? "{}").packages?.some((entry) => companionSource(entry) === ENGRAM_COMPANION_SOURCE) === true;
|
|
301
370
|
} catch { /* Missing or malformed readback cannot establish enforcement. */ }
|
|
302
371
|
if (!result.ok || result.timedOut || !declared || !supportsEngramStartupPolicy(readJsonIfExists(metadata))) {
|
|
303
372
|
return { ok: false, exitCode: 1, message: "gentle-shell: companion installation did not establish engram.startupPolicy=1; the Engram guard still keeps unverified stores closed. Repair gentle-engram, then restart Shell." };
|
|
@@ -318,6 +387,22 @@ function ownPackageVersion() {
|
|
|
318
387
|
return packageJson.version;
|
|
319
388
|
}
|
|
320
389
|
|
|
390
|
+
// The real spawn, only ever needed for a runtime with no in-memory version
|
|
391
|
+
// (env override, PATH pi): kind "bundled" always has runtime.version set and
|
|
392
|
+
// skips this entirely (#2096).
|
|
393
|
+
function probePiVersion(runtime) {
|
|
394
|
+
const versionProbePlan = planSpawn({ command: runtime.command, args: [...runtime.args, "--version"], platform: process.platform });
|
|
395
|
+
const versionProbe = spawnSync(versionProbePlan.command, versionProbePlan.args, {
|
|
396
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
397
|
+
timeout: 15000,
|
|
398
|
+
encoding: "utf8",
|
|
399
|
+
shell: versionProbePlan.shell,
|
|
400
|
+
env: bundledEnv ?? process.env,
|
|
401
|
+
});
|
|
402
|
+
if (versionProbe.error) fail(`Could not run the pi runtime at "${runtime.command}": ${versionProbe.error.message}`, 1);
|
|
403
|
+
return checkPiVersion(versionProbe.stdout ?? "");
|
|
404
|
+
}
|
|
405
|
+
|
|
321
406
|
function emptyArgs() {
|
|
322
407
|
return {
|
|
323
408
|
link: false,
|
|
@@ -1133,7 +1218,7 @@ function ensureBuiltinCodemodeExcluded(settingsPath) {
|
|
|
1133
1218
|
// rpc`/`-p` consumers. `timeoutMs` is threaded into every child this flow
|
|
1134
1219
|
// spawns (see spawnAndWait's own doc comment) — manual `setup` never passes
|
|
1135
1220
|
// it, so it never times out; the automatic flow does (S9).
|
|
1136
|
-
async function runSetupFlow(home, runtime, { dryRun, stdio, timeoutMs }) {
|
|
1221
|
+
async function runSetupFlow(home, runtime, { dryRun, stdio, timeoutMs, homeHadContentBeforeBootstrap }) {
|
|
1137
1222
|
const pinnedVersion = resolveSetupGentleAiPin();
|
|
1138
1223
|
if (!isSetupCapablePin(pinnedVersion)) {
|
|
1139
1224
|
return {
|
|
@@ -1203,19 +1288,43 @@ async function runSetupFlow(home, runtime, { dryRun, stdio, timeoutMs }) {
|
|
|
1203
1288
|
process.stderr.write(`gentle-shell: kept your Pi theme unchanged (gentle-ai rewrote ${settingsPath}; tracked upstream)\n`);
|
|
1204
1289
|
}
|
|
1205
1290
|
}
|
|
1206
|
-
if (installResult.timedOut) {
|
|
1207
|
-
return { ok: false, exitCode: 1, message: `gentle-shell: gentle-ai install timed out after ${formatTimeoutCeiling(timeoutMs)}` };
|
|
1208
|
-
}
|
|
1209
1291
|
if (installResult.error) {
|
|
1210
1292
|
return { ok: false, exitCode: 1, message: `Could not start the gentle-ai binary: ${installResult.error.message}` };
|
|
1211
1293
|
}
|
|
1212
|
-
if (!installResult.ok
|
|
1294
|
+
if (!installResult.ok || installResult.timedOut) {
|
|
1295
|
+
// Run post-install cleanup even on failure or timeout so a failed setup
|
|
1296
|
+
// does not leave npm:gentle-pi declared in settings.json, which would make
|
|
1297
|
+
// subsequent launches silently run the published npm package instead of
|
|
1298
|
+
// the launcher's own package (#1647).
|
|
1299
|
+
if (!dryRun && !installResult.interrupted) {
|
|
1300
|
+
// A cleanup that throws (e.g. an unreadable settings.json) must not
|
|
1301
|
+
// replace the install's own failure; it only adds a diagnostic.
|
|
1302
|
+
let cleanupResult;
|
|
1303
|
+
try {
|
|
1304
|
+
cleanupResult = await runPostInstallCleanup(home, runtime, false, stdio, timeoutMs);
|
|
1305
|
+
} catch (error) {
|
|
1306
|
+
cleanupResult = { ok: false, exitCode: 1, message: `gentle-shell: post-install cleanup failed: ${error.message}` };
|
|
1307
|
+
}
|
|
1308
|
+
if (cleanupResult.interrupted) return cleanupResult;
|
|
1309
|
+
if (!cleanupResult.ok && cleanupResult.message !== undefined) {
|
|
1310
|
+
const baseMessage = installResult.timedOut
|
|
1311
|
+
? `gentle-shell: gentle-ai install timed out after ${formatTimeoutCeiling(timeoutMs)}`
|
|
1312
|
+
: installResult.message;
|
|
1313
|
+
const message = baseMessage ? `${baseMessage}\n${cleanupResult.message}` : cleanupResult.message;
|
|
1314
|
+
return { ok: false, exitCode: installResult.exitCode, message };
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
if (installResult.timedOut) {
|
|
1318
|
+
return { ok: false, exitCode: 1, message: `gentle-shell: gentle-ai install timed out after ${formatTimeoutCeiling(timeoutMs)}` };
|
|
1319
|
+
}
|
|
1320
|
+
return installResult;
|
|
1321
|
+
}
|
|
1213
1322
|
|
|
1214
1323
|
const cleanupResult = await runPostInstallCleanup(home, runtime, dryRun, stdio, timeoutMs);
|
|
1215
1324
|
if (cleanupResult.ok && !dryRun) {
|
|
1216
1325
|
warnDisabledMCP(home);
|
|
1217
1326
|
// The guard and policy protect memory, so the companion check only warns.
|
|
1218
|
-
const companion = bundledInstall ? await ensureEngramCompanion(home, runtime, stdio, timeoutMs) : { ok: true };
|
|
1327
|
+
const companion = bundledInstall ? await ensureEngramCompanion(home, runtime, stdio, timeoutMs, homeHadContentBeforeBootstrap) : { ok: true };
|
|
1219
1328
|
if (!companion.ok) process.stderr.write(`${companion.message}\n`);
|
|
1220
1329
|
}
|
|
1221
1330
|
return cleanupResult;
|
|
@@ -1361,7 +1470,7 @@ async function handleSetupCommand(commandArgs, home, runtime, { homeHadContentBe
|
|
|
1361
1470
|
fail(`Unrecognized argument for 'gentle-shell setup': ${arg}\nRun 'gentle-shell --help' for usage.`, 2);
|
|
1362
1471
|
}
|
|
1363
1472
|
|
|
1364
|
-
const result = await runSetupFlow(home, runtime, { dryRun, stdio: "inherit" });
|
|
1473
|
+
const result = await runSetupFlow(home, runtime, { dryRun, stdio: "inherit", homeHadContentBeforeBootstrap });
|
|
1365
1474
|
if (!result.ok && result.message !== undefined) process.stderr.write(`${result.message}\n`);
|
|
1366
1475
|
if (result.ok && !dryRun && (home.mode === "isolated" || home.mode === "path")) {
|
|
1367
1476
|
const configPath = resolveConfigPath();
|
|
@@ -1599,7 +1708,7 @@ async function maybeAutoProvisionHome(home, runtime, { homeHadContentBeforeBoots
|
|
|
1599
1708
|
}
|
|
1600
1709
|
}
|
|
1601
1710
|
|
|
1602
|
-
const result = await runSetupFlow(home, runtime, { dryRun: false, stdio: ["ignore", 2, 2], timeoutMs: resolveAutoSetupTimeoutMs() });
|
|
1711
|
+
const result = await runSetupFlow(home, runtime, { dryRun: false, stdio: ["ignore", 2, 2], timeoutMs: resolveAutoSetupTimeoutMs(), homeHadContentBeforeBootstrap });
|
|
1603
1712
|
// Abort the whole launch only for a launcher-forwarded interrupt
|
|
1604
1713
|
// (R3-002); a child that exited via signal on its own (crash, OOM kill,
|
|
1605
1714
|
// external kill) falls through to the ordinary-failure branch below,
|
|
@@ -1712,7 +1821,7 @@ async function handleBundledUpgrade(bundled, commandArgs) {
|
|
|
1712
1821
|
}
|
|
1713
1822
|
}
|
|
1714
1823
|
|
|
1715
|
-
// `gentle-shell update
|
|
1824
|
+
// `gentle-shell update` in a bundled install: the newest published
|
|
1716
1825
|
// Pi installed with this Gentle Shell beside the active version, without the
|
|
1717
1826
|
// release's verified lockfile (after a warning), verified, then `current`
|
|
1718
1827
|
// switched. Returns the exit code like handleBundledUpgrade; a failure leaves
|
|
@@ -1948,7 +2057,7 @@ async function main() {
|
|
|
1948
2057
|
// S8: only the version's own Pi, never GENTLE_SHELL_PI, an adjacent fallback or PATH.
|
|
1949
2058
|
const pi = bundledPi(bundled, { platform: process.platform, fs: bundledFs });
|
|
1950
2059
|
if (!pi.ok) fail(pi.message, 1);
|
|
1951
|
-
runtime = { kind: "bundled", command: process.execPath, args: [pi.cli] };
|
|
2060
|
+
runtime = { kind: "bundled", command: process.execPath, args: [pi.cli], version: pi.version };
|
|
1952
2061
|
bundledInstall = bundled;
|
|
1953
2062
|
bundledCli = pi.cli;
|
|
1954
2063
|
bundledMemory = engramQuiet ? { policy: "disabled", notice: ENGRAM_RECOVERY_NOTICE } : await classifyBundledMemory();
|
|
@@ -1964,16 +2073,11 @@ async function main() {
|
|
|
1964
2073
|
if (runtime === undefined) fail(missingPiMessage(), 1);
|
|
1965
2074
|
}
|
|
1966
2075
|
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
shell: versionProbePlan.shell,
|
|
1973
|
-
env: bundledEnv ?? process.env,
|
|
1974
|
-
});
|
|
1975
|
-
if (versionProbe.error) fail(`Could not run the pi runtime at "${runtime.command}": ${versionProbe.error.message}`, 1);
|
|
1976
|
-
const versionCheck = checkPiVersion(versionProbe.stdout ?? "");
|
|
2076
|
+
// Bundled runtimes already carry their version in memory (package.json /
|
|
2077
|
+
// the pinned dependency): spawning a whole process just to print it back
|
|
2078
|
+
// is the redundant cost issue #2096 reports, so only env/path runtimes
|
|
2079
|
+
// (which have no such in-memory source) still pay for a real probe.
|
|
2080
|
+
const versionCheck = runtime.version !== undefined ? checkPiVersion(runtime.version) : probePiVersion(runtime);
|
|
1977
2081
|
// A managed self update is how an old Pi gets replaced, so the minimum-version
|
|
1978
2082
|
// gate must not block it; everything else still requires the minimum.
|
|
1979
2083
|
const managedSelfUpdate = !bundled && args.piSubcommand === "update" && versionCheck.version !== undefined
|
|
@@ -1985,24 +2089,16 @@ async function main() {
|
|
|
1985
2089
|
process.exit(0);
|
|
1986
2090
|
}
|
|
1987
2091
|
|
|
1988
|
-
//
|
|
1989
|
-
//
|
|
1990
|
-
// otherwise), or with `--latest` the newest published Pi without the
|
|
1991
|
-
// release's lockfile (run even when not interactive: it was asked for);
|
|
1992
|
-
// package updates still reach Pi.
|
|
2092
|
+
// Self updates select the latest published Pi in a bundled prefix; package
|
|
2093
|
+
// updates still go to Pi. A self failure must survive a successful child.
|
|
1993
2094
|
let passthrough = args.passthrough;
|
|
2095
|
+
let updateExitCode = 0;
|
|
1994
2096
|
if (bundled && args.piSubcommand === "update") {
|
|
1995
2097
|
const plan = bundledUpdatePlan(args.passthrough);
|
|
1996
2098
|
if (plan.self) {
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
} else {
|
|
2001
|
-
const interactive = process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
2002
|
-
for (const line of bundledUpdateNotice({ piVersion: versionCheck.version, interactive })) process.stdout.write(`${line}\n`);
|
|
2003
|
-
code = interactive ? await handleBundledUpgrade(bundled, []) : undefined;
|
|
2004
|
-
}
|
|
2005
|
-
const next = bundledUpdateNext(plan, code);
|
|
2099
|
+
if (args.passthrough.includes("--force")) fail("gentle-shell update: --force is not supported for managed Pi updates.", 2);
|
|
2100
|
+
updateExitCode = await handleBundledPiLatest(bundled);
|
|
2101
|
+
const next = bundledUpdateNext(plan, updateExitCode);
|
|
2006
2102
|
if ("exitCode" in next) process.exit(next.exitCode);
|
|
2007
2103
|
if (next.note) process.stderr.write(`${next.note}\n`);
|
|
2008
2104
|
}
|
|
@@ -2011,9 +2107,10 @@ async function main() {
|
|
|
2011
2107
|
const { managedUpdatePlan, updateSelectedPi } = await import("../scripts/pi-update.mjs");
|
|
2012
2108
|
const plan = managedUpdatePlan(args.passthrough);
|
|
2013
2109
|
if (plan.self) {
|
|
2014
|
-
|
|
2110
|
+
if (args.passthrough.includes("--force")) fail("gentle-shell update: --force is not supported for managed Pi updates.", 2);
|
|
2111
|
+
updateExitCode = await updateSelectedPi({ runtime, packageRoot, platform: process.platform, currentVersion: versionCheck.version, cwd: tmpdir(), env: process.env, home: homedir(),
|
|
2015
2112
|
adapters: await packageManagerAdapters(), out: (line) => process.stdout.write(`${line}\n`) });
|
|
2016
|
-
if (plan.piArgs === undefined) return;
|
|
2113
|
+
if (plan.piArgs === undefined) { process.exitCode = updateExitCode; return; }
|
|
2017
2114
|
}
|
|
2018
2115
|
passthrough = plan.piArgs;
|
|
2019
2116
|
}
|
|
@@ -2067,6 +2164,15 @@ async function main() {
|
|
|
2067
2164
|
}
|
|
2068
2165
|
}
|
|
2069
2166
|
|
|
2167
|
+
// Only a valid extension-only update gets the configuration migration. All
|
|
2168
|
+
// rejected forms must reach Pi without changing a package selection.
|
|
2169
|
+
const extensionUpdate = args.piSubcommand === "update" && passthrough?.[0] === "update" && passthrough.includes("--extensions")
|
|
2170
|
+
&& passthrough.slice(1).every((arg) => ["--extensions", "--approve", "-a", "--no-approve", "-na", "--force"].includes(arg));
|
|
2171
|
+
if (bundled && extensionUpdate) {
|
|
2172
|
+
const migrated = await migrateManagedEngramCompanion(home, homeHadContentBeforeBootstrap);
|
|
2173
|
+
if (!migrated.ok) fail(migrated.message, migrated.exitCode);
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2070
2176
|
if (args.command === "setup") {
|
|
2071
2177
|
await handleSetupCommand(args.commandArgs, home, runtime, { homeHadContentBeforeBootstrap });
|
|
2072
2178
|
return;
|
|
@@ -2204,7 +2310,9 @@ async function main() {
|
|
|
2204
2310
|
bundledEnv = bundledProcessEnv();
|
|
2205
2311
|
// The guard protects memory whatever provider loads, so a companion that
|
|
2206
2312
|
// could not be verified is reported, never a reason to stop Shell.
|
|
2207
|
-
const
|
|
2313
|
+
const migrated = await migrateManagedEngramCompanion(home, homeHadContentBeforeBootstrap);
|
|
2314
|
+
if (!migrated.ok) process.stderr.write(`${migrated.message}\n`);
|
|
2315
|
+
const companion = await ensureEngramCompanion(home, runtime, ["ignore", 2, 2], 10000, homeHadContentBeforeBootstrap);
|
|
2208
2316
|
if (!companion.ok) process.stderr.write(`${companion.message}\n`);
|
|
2209
2317
|
// Only this final decision starts the shared server, and Pi gets its
|
|
2210
2318
|
// URL only once the server verified.
|
|
@@ -2264,7 +2372,7 @@ async function main() {
|
|
|
2264
2372
|
fail(`Could not start pi: ${error.message}`, 1);
|
|
2265
2373
|
});
|
|
2266
2374
|
child.on("exit", (code, signal) => {
|
|
2267
|
-
const exitCode = signal ? signalExitCode(signal) : (code ?? 1);
|
|
2375
|
+
const exitCode = signal ? signalExitCode(signal) : ((code ?? 1) || updateExitCode);
|
|
2268
2376
|
if (resumeHandoff) {
|
|
2269
2377
|
const hint = planResumeHint({
|
|
2270
2378
|
handoff: resumeHandoff.read(),
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Read per-session agent status
|
|
2
|
+
|
|
3
|
+
Any terminal tool can read Gentle Shell's status without Herdr or a socket.
|
|
4
|
+
Interactive top-level Pi sessions publish JSON under
|
|
5
|
+
`<gentlePiConfigHome()>/agent-status/<sha256-of-session-id>.json`.
|
|
6
|
+
Use the active Gentle Shell profile's config home; no `XDG_RUNTIME_DIR` is needed.
|
|
7
|
+
The packaged `gentle-agent-status` extension loads automatically.
|
|
8
|
+
|
|
9
|
+
## Format: `gentle-shell.agent-status/v1`
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"schema": "gentle-shell.agent-status/v1",
|
|
14
|
+
"agent": "gentle-shell",
|
|
15
|
+
"session": "session-123",
|
|
16
|
+
"pid": 12345,
|
|
17
|
+
"cwd": "/work/project",
|
|
18
|
+
"state": "working",
|
|
19
|
+
"task": { "title": "Implement status adapter" },
|
|
20
|
+
"updatedAt": "2026-07-17T12:34:56.000Z"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- `schema`: version identifier; readers should ignore unsupported versions.
|
|
25
|
+
- `agent`: `gentle-shell` when the launcher owns agent reporting, otherwise `pi`.
|
|
26
|
+
- `session`: stable Pi session ID; `pid`: publisher process ID; `cwd`: session workspace.
|
|
27
|
+
- `state`: `working`, `blocked` (attention takes precedence), or `idle`.
|
|
28
|
+
- `task`: sanitized first `in_progress` Todo title, or `null` when absent, inactive,
|
|
29
|
+
invalid, or task summaries are disabled. Live preference changes apply immediately.
|
|
30
|
+
Titles are bounded to a 4096 UTF-16-unit sample, preserve whole graphemes,
|
|
31
|
+
and strip terminal/control/bidi sequences; no icon, row layout or added ellipsis.
|
|
32
|
+
- `updatedAt`: ISO 8601 UTC heartbeat, refreshed at least every 10 seconds.
|
|
33
|
+
|
|
34
|
+
## Minimal adapter
|
|
35
|
+
|
|
36
|
+
Set `STATUS_DIR` to the active config home's `agent-status` directory. For example,
|
|
37
|
+
this `jq` reader prints fresh sessions and tolerates missing files during shutdown:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
jq -r 'select(.schema == "gentle-shell.agent-status/v1") |
|
|
41
|
+
select((now - (.updatedAt | sub("\\.[0-9]+Z$"; "Z") | fromdateiso8601)) <= 30) |
|
|
42
|
+
[.agent, .session, .state, (.task.title // "")] | @tsv' "$STATUS_DIR"/*.json 2>/dev/null
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Treat timestamps older than 30 seconds as stale, even if the PID exists. Files
|
|
46
|
+
are replaced atomically on coalesced status changes and heartbeats, then removed
|
|
47
|
+
on shutdown. Crashes may leave stale files. Failed writes/removals never interrupt
|
|
48
|
+
Pi. Children and noninteractive sessions do not publish. Herdr remains unchanged.
|
|
49
|
+
|
|
50
|
+
## Privacy
|
|
51
|
+
|
|
52
|
+
A symlinked config home, status directory, or status file is refused (nothing is
|
|
53
|
+
written). Directories above the config home are trusted and may be symlinks.
|
|
54
|
+
On POSIX the status directory is created 0700 and files 0600; an existing status
|
|
55
|
+
directory with any group/other permissions, or a config home owned by another
|
|
56
|
+
account or writable by group or others, is refused. Windows has no extra ACL
|
|
57
|
+
check: the files inherit the config home's
|
|
58
|
+
permissions, which are private under the default user profile. The files contain workspace paths,
|
|
59
|
+
session IDs and Todo titles: do not put secrets in titles or expose this directory
|
|
60
|
+
through a public server. Prompts, tool arguments/results and Todo notes are not
|
|
61
|
+
published. Disabling task summaries hides titles, not the remaining status fields.
|
package/docs/bundled-install.md
CHANGED
|
@@ -243,7 +243,7 @@ Dropped: inherited npm and pnpm settings, `NODE_OPTIONS`, `NODE_PATH`, and the w
|
|
|
243
243
|
- **No `--prefix`.** A `--prefix` flag on the command line also sets npm's local prefix (`loadLocalPrefix` in `@npmcli/config`). Pi installs a git extension's dependencies with `npm install` in the clone and passes no `--prefix` of its own, so that install would land in the prefix and fail. Pi's `npm:` installs and removals pass `--prefix <agent home>/npm` themselves.
|
|
244
244
|
- The only global read is `npm root -g` (Pi's lookup of packages an older Pi installed globally). It then resolves to the user's `npm_config_prefix` or our node folder's `lib/node_modules`. It only prints a path and creates nothing.
|
|
245
245
|
- **Setup.** `gentle-shell setup` runs Gentle AI, which finds `pi` on `PATH`. pnpm's `.bin/pi` shim runs the first `node` on `PATH`. So setup alone gets our node's folder, then the version's `node_modules/.bin`, ahead of the user's `PATH` (`bundledSetupEnv`). It also gets Gentle AI's isolation variables. Everything else in its environment is the same as Pi's.
|
|
246
|
-
- **Pi updates (S5).**
|
|
246
|
+
- **Pi updates (S5).** `gentle-shell update` with no target, `--self`, `self` or `pi`, `--all`, or `self`/`pi` with `--extensions` selects the newest published stable Pi for the current Shell. `--latest` is an alias. It warns before installing without the release's verified lockfile, verifies the new pair, and keeps the old pair for rollback. An "all" form still sends `update --extensions` to Pi if the Pi update fails, and exits nonzero for the failure. Explicit extension pins stay pinned. Package targets, `--models`, help, and forms Pi refuses go to Pi unchanged; `--force` on a managed self update is rejected.
|
|
247
247
|
- **What cannot be intercepted.** A `pi update` that someone runs directly with the bundled `pi` (for example the agent's shell, which finds it through `node_modules/.bin`) is Pi's own command. In Pi 1.1.0, `PI_SKIP_VERSION_CHECK` hides only the startup "Update Available" notice (`utils/version-check.js`). For the update itself, `package-manager-cli.js` detects a pnpm install from the `.pnpm` path, and `config.js` (`getSelfUpdateCommand`) finds no global pnpm root that owns `versions/<id>`. Pi then prints `cannot self-update this installation` and changes nothing.
|
|
248
248
|
|
|
249
249
|
### Engram startup safety
|
|
@@ -286,7 +286,9 @@ When the running server's `/health` reports a valid 32-hex `instance_id` and a c
|
|
|
286
286
|
|
|
287
287
|
Engram 3.3.2 does not expose `/compatibility`, so reinstalling that version cannot authorize reuse of an existing global store. [Engram 3.4.0](https://github.com/Gentleman-Programming/engram/releases/tag/v3.4.0) includes the endpoint from PR #1792. Back up the existing store before updating its server through its own installation method, then restart that server and Shell. Updating Shell's bundled binary does not replace an already-running global server. Reuse still requires a valid ready response, not just the version number; a token-protected server cannot provide it to Shell's unauthenticated probe. Do not disable authentication to bypass this policy or use an unpublished build.
|
|
288
288
|
|
|
289
|
-
The memory decision never skips or fails setup: `gentle-shell setup`
|
|
289
|
+
The memory decision never skips or fails setup: `gentle-shell setup` publishes the verified core and runs Gentle AI. Gentle AI 4.0.0 `install --agent pi` runs no `engram setup` for Pi, and `pi-engram init` only edits settings, so neither opens a store. Setup reclassifies after publishing the core, and the decision only selects the Engram environment its children and the launched Pi receive. On a new machine the wizard publishes the runtime without Engram, so the first `gentle-shell setup` publishes the core and the following launch starts the shared server.
|
|
290
|
+
|
|
291
|
+
In a Shell-owned home, a missing companion is installed through Pi as `npm:gentle-engram` and checked for `engram.startupPolicy: 1`; a failed check is reported and Shell still starts, protected by the guard. Shell migrates its old `npm:gentle-engram@0.4.2` registration to the unversioned source using Pi's package manager without installing an update. Pi then includes it in its normal startup package-update notice; run `gentle-shell update --extensions` to update it. An existing selection is not automatically reinstalled on launch, and linked/foreign homes, local companions, other companion pins and unrelated extension pins are not rewritten. This changes the Pi package, not the separately pinned native Engram core. `setup --dry-run` installs nothing.
|
|
290
292
|
|
|
291
293
|
#### Explicit recovery after a core upgrade
|
|
292
294
|
|
|
@@ -337,7 +339,7 @@ S9. Everything Gentle AI and gentle-pi keep lives in the prefix, except Engram's
|
|
|
337
339
|
- **gentle-engram.** The gentle-engram Pi extension finds Engram only through `ENGRAM_BIN`, read once when it loads, and otherwise runs `engram` from `PATH`. So Pi gets `ENGRAM_BIN` (the guard; memory reaches the shared server through `ENGRAM_URL`), and no `PATH` entry is added. An `ENGRAM_BIN` the user set is kept. The agent's shell inherits `ENGRAM_BIN` too, so an Engram MCP launcher started there through `ENGRAM_BIN` uses the same guard.
|
|
338
340
|
- **Personas.** Setup snapshots and restores the persona Gentle AI may rewrite: the prefix's `config/gentle-ai/persona.json`, and also the user's `~/.pi/gentle-ai/persona.json`. A Gentle AI release without the variables still writes the user's file, and restoring an unchanged file does nothing. The managed-asset record is restored only in the user's `~/.gentle-ai/state.json`; the prefix's record belongs to the pinned Gentle AI.
|
|
339
341
|
- **pi-pretty and prompt history.** In bundled mode only, the pi-pretty wrapper passes `deps.sdk` with Pi's five tool factories and `getAgentDir`, so its FFF database lands in `<agent home>/pi-pretty/fff`, and prompt history keeps its store under `<agent home>/history` ([Prompt history](prompt-history.md)). Elsewhere both keep their existing locations: Pi's deps reach pi-pretty unchanged (`$HOME/.pi/agent/pi-pretty/fff`, or no store without `HOME`), and history stays under `~/.pi/agent/history`, also in the isolated home of a pnpm or npm install, so existing histories are not left behind.
|
|
340
|
-
- **Effective with a later Gentle AI.** gentle-pi pins Gentle AI 4.
|
|
342
|
+
- **Effective with a later Gentle AI.** gentle-pi pins Gentle AI 4.4.0 today (`INSTALLER_VERSION`); the following are historical compatibility notes for Gentle AI 4.0.0, which ignores the four `GENTLE_AI_*` variables. Whether 4.4.0 includes gentle-ai#5462 is unverified here. Until gentle-pi pins a Gentle AI release that contains gentle-ai#5462:
|
|
341
343
|
- Setup still writes `~/.gentle-ai` and `~/.pi/gentle-ai`, with the restores above, and still acquires Engram its own way.
|
|
342
344
|
- The persona goes to the user's `~/.pi/gentle-ai/persona.json` (Gentle AI 4.0.0 resolves it from the OS home) and is restored there. The prefix's `config/gentle-ai/persona.json` is not created by setup.
|
|
343
345
|
- The background-subagents policy already lands in `<prefix>/config/gentle-ai/` through `GENTLE_PI_CONFIG_HOME=<prefix>/config` (see above).
|
|
@@ -359,7 +361,7 @@ A rose-colored panel shows the current and available Shell versions and a link t
|
|
|
359
361
|
- **Not now** (the default; also Escape or end of input) opens normally without saving a preference.
|
|
360
362
|
- **Skip this version** stores only the offered version as `skippedStartupRelease` in the launcher’s `config.json` (or `GENTLE_SHELL_CONFIG` override), preserving unrelated settings. Another newer release can prompt again. A malformed or unwritable file is not replaced; the launcher warns and continues without saving.
|
|
361
363
|
|
|
362
|
-
Ctrl+C cancels opening (exit 130). No update runs without explicit confirmation. The startup check does not update additional extensions; use `gentle-shell update --extensions` for those. Restarting does not change the working directory, startup arguments, or agent home. Pi
|
|
364
|
+
Ctrl+C cancels opening (exit 130). No update runs without explicit confirmation. The startup check does not update additional extensions; use `gentle-shell update --extensions` for those. Restarting does not change the working directory, startup arguments, or agent home. A newer independently updated Pi is kept across Shell releases.
|
|
363
365
|
|
|
364
366
|
### `gentle-shell upgrade` in a bundled install
|
|
365
367
|
|
|
@@ -367,7 +369,7 @@ Ctrl+C cancels opening (exit 130). No update runs without explicit confirmation.
|
|
|
367
369
|
|
|
368
370
|
1. The latest release comes from the npm registry, as on the ordinary release channel (`latestRelease`). Its two assets come from `fetchDistribution` (identity encoding, size bounds), and `readDistribution` checks the exact versions, the workspace files and the lockfile sha256. A release without assets stops with its version, and nothing changes.
|
|
369
371
|
2. When that release is the active version, the command says it is already current and changes nothing.
|
|
370
|
-
3. Otherwise `ensureRuntime` runs (with Go on Windows), and `installVersion` installs the release in place beside the active version.
|
|
372
|
+
3. Otherwise `ensureRuntime` runs (with Go on Windows), and `installVersion` installs the release in place beside the active version. If the active Pi is newer than the release's verified Pi, Shell keeps that Pi and warns that it installs without the release's lockfile. The release lockfile is used only for its exact pair.
|
|
371
373
|
4. The new version's own `scripts/bundled-install.mjs` is loaded, only from that freshly installed folder, and only when its real path stays inside it. Its `prefixLayout`, `ensureRuntime` and `ensureLauncher` must all be functions; otherwise the upgrade stops. Its `ensureRuntime` installs that release's pinned Node and pnpm beside ours when the pins moved, and reuses them otherwise.
|
|
372
374
|
5. The new version's launcher must print exactly `gentle-shell <shell>` and `pi <pi>`. It runs with the release's Node, in the pnpm environment, with no `GENTLE_*` or `PI_*` overrides. It runs in bundled mode for that version, with its exact Pi: the only extra variable, `GENTLE_SHELL_VERIFY_VERSION=<id>`, makes `resolveBundledInstall` treat that id as current. The launcher honors it for `--version` only, and never passes it to a child. A `pi` on `PATH` cannot pass this check.
|
|
373
375
|
6. Only then does `current` switch (`activateVersion`, one rename), and the release's own `ensureLauncher` writes the launcher for its Node. If the launcher cannot be written, `current` switches back and the command fails.
|
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
# Delegated verification
|
|
2
2
|
|
|
3
|
-
How the Gentle Pi orchestrator decides who verifies a bounded writer's work. The always-on parent prompt renders a `Receipt-driven development: on|off|unknown` line; the verification module (`assets/orchestrator-verification.md`, Verification rule) keys the verification rule on it. Because the line sits in the cached system-prompt prefix, a session keeps the first line it rendered and re-renders it
|
|
3
|
+
How the Gentle Pi orchestrator decides who verifies a bounded writer's work. The always-on parent prompt renders a `Receipt-driven development: on|off|unknown` line; the verification module (`assets/orchestrator-verification.md`, Verification rule) keys the verification rule on it. Because the line sits in the cached system-prompt prefix, a session keeps the first line it rendered and re-renders it when the off state changes (which also drops or restores the review execution contract); an `unknown` to `on` flip or a deciding-source change keeps the original text. Off is freshly confirmed for each run; a failed read after off renders unknown rather than relying on a stale off status. Review tools always read the live mode. While the pinned line reads `off`, the parent request also carries a lean review loadout: `gentle_review` keeps its schema but its snippet, guidelines, and description cover only `assess`, and the `gentle_review_capture`, `gentle_review_capture_group`, and `gentle_review_scope` declarations are hidden (they stay registered and active). The loadout follows the pinned line, so it changes only at the next run after RDD turns off or back on, together with the review execution contract; `on` and `unknown` keep the full registered text. This page is package-owned; `docs/review-integration.md` mirrors the Gentle AI contract and must stay byte-identical to it.
|
|
4
4
|
|
|
5
5
|
## Verifier preparation
|
|
6
6
|
|
|
7
7
|
The independent verifier makes one isolated preparation attempt. At the first inability to prepare a required copy, environment, dependency, or helper, it stops setup and reports one concrete blocker, the exact checks left unrun as unverified, not passed, and any scratch directories created. It does not retry setup or chain helper repairs; the parent stops with one **Needs your decision** result identifying the missing prerequisite and exact unrun checks, without continuing helper repairs or automatically relaunching for the same prerequisite. Setup or infrastructure failure is distinct from a code finding, whose existing correction allowance remains; auxiliary tooling defects remain subject to the existing correction bound, which setup failure does not reset. Successful preparation continues to authorized checks and independent probes within the existing isolation and permission boundaries.
|
|
8
8
|
|
|
9
|
+
### Explicit recovery after a setup failure
|
|
10
|
+
|
|
11
|
+
A failed setup is not the same as an unavailable verifier capability. After the missing prerequisite is repaired, the human can explicitly request one new bounded attempt. Preserve the failed attempt and its zero-test result; static inspection and parent tests do not replace the missing independent runtime proof. Before dispatch, confirm the previous child has finished without uncertain status and establish the required payload, dependencies, and scratch capacity (space and inodes where relevant). A smaller system-temp copy is allowed only when it contains every input needed for the authorized probes; workspace symlinks, network access, and dependency installs remain prohibited for the verifier.
|
|
12
|
+
|
|
13
|
+
This request does not permit automatic retries, reset native budgets, override a denial or terminal native outcome, or bypass consent or an explicit one-run/no-retry limit. If the prerequisite is still missing, report the exact blocker rather than repeating the failed setup.
|
|
14
|
+
|
|
15
|
+
### Explicit recovery after worker correction exhaustion
|
|
16
|
+
|
|
17
|
+
A worker-local correction limit ends its automatic cycle, not necessarily the feature. The partial report must preserve the failed commands, output, remaining implementation work, and missing proof. The parent can offer a concrete continuation for explicit human authorization, naming its scope, executor, correction limit, and checks; the human can also stop. A later conversation is not a budget reset, and an active or uncertain child prevents continuation.
|
|
18
|
+
|
|
19
|
+
Specifically authorized compilation or implementation can continue only when actual native authority and other applicable limits permit it. A read-only inspection with no instantiated native budget does not itself prohibit ordinary edits; it also grants no review approval. Missing required proof still blocks completion and delivery. Native recovery, consent, and terminal-outcome rules remain separate and unchanged.
|
|
20
|
+
|
|
9
21
|
This is prompt policy, not a runtime-enforced limit; contract tests establish instruction delivery, not agent compliance or a measured speedup.
|
|
10
22
|
|
|
23
|
+
## Verifier launch admission and post-denial disposition (gentle-shell#2478)
|
|
24
|
+
|
|
25
|
+
The `gentle-ai-verify` launch is admitted only when its `task` or `context` declares a named high-risk item, names a task of an existing feature document, or the parent's measured context reaches the backstop. The declaration grammar is strict: `Risk: item N (reason)` must start a line (optionally after a list marker like `- `) or start a sentence (after `.`, `!` or `?` and a space). A declaration after another separator such as `; ` or `,` inside a sentence is not recognized. Keep the risk evidence tied to the actual change; never add a Risk line only to gain admission.
|
|
26
|
+
|
|
27
|
+
Assessment and admission are separate gates. A `gentle_review assess` plan (or its native `review assess` source) may name an independent verifier in the verification plan; it does not grant launch admission. Admission re-validates the actual launch envelope at `tool_call` time and does not receive the assessment result, so a plan that names the verifier can still be rejected when the envelope carries no supported declaration.
|
|
28
|
+
|
|
29
|
+
After a rejection, no gate-level disposition exists for the same launch: do not retry it, and do not substitute another agent for the verifier. The rejection is launch-scoped, not feature-scoped: it does not make the verifier unavailable for the whole feature, does not mean the change has no risk, and does not by itself keep later required proof unavailable. A new verifier launch requires the user's explicit decision in a new prompt, with a conforming envelope whose risk declaration reflects the actual change. Inline tests, the writer's self-verification, and a user's visual approval never replace the missing independent verification; when it stays unavailable, close with **Needs your decision** naming the missing proof.
|
|
30
|
+
|
|
11
31
|
## Background capability admission
|
|
12
32
|
|
|
13
|
-
An explicit agent `tools` declaration containing `bash_background` requires the background-subagents policy to resolve to `on` at dispatch, for both task and background launches. Otherwise the runner fails the task before spawn and reports the policy file, opt-in schema, and `/gentle:background-subagents enable|disable|status`. Fix the deciding policy explicitly; automation must not toggle it. Passing admission
|
|
33
|
+
An explicit agent `tools` declaration containing `bash_background` requires the background-subagents policy to resolve to `on` at dispatch, for both task and background launches. Otherwise the runner fails the task before spawn and reports the policy file, opt-in schema, and `/gentle:background-subagents enable|disable|status`. Fix the deciding policy explicitly; automation must not toggle it. Passing admission forwards the job capability to the child, which registers `bash_background`, `job_list`, and `job_stop` for its own session; the runner then gives a running child job one bounded drain window at settlement instead of killing it immediately. The `monitor` tool stays parent-only, child jobs are never routed through the parent, and no new persisted state is added. Ordinary missing-tool reporting remains the backstop. See the [policy contract](readme-reference.md#capability-reference).
|
|
14
34
|
|
|
15
35
|
## Receipt-driven development on
|
|
16
36
|
|
|
17
|
-
|
|
37
|
+
The bounded writer runs the exact commands the parent lists under `## Verification`, in the foreground, and reports each as `<command>: <observed result>`. With RDD on or unknown, the parent calls `assess` after it returns and follows the risk tier below. With validated RDD off, assessment is not required: self-verification and a separate verifier for a named high-risk item remain required. The native review is an additional outside view of the change: it never replaces or skips the tier's verification, and the tier's verifier runs before review. A declined consent, a clone-local disable, or a refused START/STATUS therefore changes nothing about required verification.
|
|
18
38
|
|
|
19
39
|
### How `assess` resolves the review outcome (gentle-pi#1175)
|
|
20
40
|
|
|
@@ -41,9 +61,11 @@ When native reports them, `assess` projects `reviewDue`, `reviewDueReason`, `can
|
|
|
41
61
|
|
|
42
62
|
## Receipt-driven development off or unknown (gentle-pi#662)
|
|
43
63
|
|
|
44
|
-
|
|
64
|
+
With validated RDD off, a direct `assess` request remains read-only but skips native assessment and assessment-only target status. It returns `nativeRisk: unassessable`, a medium plan unless explicitly escalated, `candidate: null`, and no native review-due or continuation fields. The compatible zero changed-path and changed-line counts mean not measured, not a passive candidate; the skip reason says so. No native approval or candidate evidence is invented.
|
|
65
|
+
|
|
66
|
+
When RDD is on or unknown, the host exposes one read-only native operation: `gentle-ai review assess --cwd <repo> [--base-ref <ref> --committed-only] --json` (gentle-ai#4295). It is decoded by `lib/review-risk-assessment.ts` and wired through `lib/native-review-cli.ts` exactly like the existing `reviewMode` STATUS reader -- a bounded subprocess with a typed decode, never a mutation. A non-zero exit, a failure envelope, or an older binary without the verb all report native risk `unassessable`, which informs only: the plan is medium and adds no independent verifier unless the agent escalates.
|
|
45
67
|
|
|
46
|
-
The `gentle_review` tool's `assess` operation (`extensions/gentle-ai.ts`) combines
|
|
68
|
+
The `gentle_review` tool's `assess` operation (`extensions/gentle-ai.ts`) combines the available assessment with the live `Receipt-driven development:` line to decide whether a delegated writer's change needs a separate `gentle-ai-verify` run, following this tier table. The passive row requires native evidence and therefore cannot be inferred when off:
|
|
47
69
|
|
|
48
70
|
| Tier | Verification when RDD is `off`/`unknown` |
|
|
49
71
|
| --- | --- |
|
|
@@ -54,9 +76,9 @@ The `gentle_review` tool's `assess` operation (`extensions/gentle-ai.ts`) combin
|
|
|
54
76
|
|
|
55
77
|
The plan risk (`risk`) is high only with an escalation; otherwise a native passive stays passive and every other native tier is medium. The native tier stays visible as `nativeRisk`. The independent verifier is for concrete occasions: the plan adds it only when `escalate` names a Task Size high-risk item, never for size, a native tier alone, a failed assessment, or the model or effort that wrote the change.
|
|
56
78
|
|
|
57
|
-
With RDD off,
|
|
79
|
+
With RDD off, do not require ASSESS to run the writer's applicable functional checks or the named-risk independent verifier. A direct plan request does not run native assessment or provide a review continuation; it never enables RDD or authorizes a review lifecycle operation.
|
|
58
80
|
|
|
59
|
-
This table applies in every RDD state; a closed native review never removes a verifier the tier requires. An unknown RDD line never
|
|
81
|
+
This table applies in every RDD state; a closed native review never removes a verifier the tier requires. An unknown RDD line never waives named-risk verification. The parent's own spot check (re-running one reported command before delivery) stays required in every tier.
|
|
60
82
|
|
|
61
83
|
A native code review is not a substitute for applicable functional checks: tests, builds, and functional verification such as browser checks for UI changes still run when applicable. Review outcomes never authorize delivery; human consent for native review and the user-owned RDD switch are unchanged.
|
|
62
84
|
|