gentle-pi 2.2.0 → 2.4.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 +76 -79
- package/assets/agents/review-readability.md +0 -2
- package/assets/agents/review-reliability.md +0 -2
- package/assets/agents/review-resilience.md +0 -2
- package/assets/agents/review-risk.md +0 -2
- package/assets/agents/sdd-apply.md +5 -3
- package/assets/agents/sdd-explore.md +1 -0
- package/assets/agents/sdd-proposal.md +2 -0
- package/assets/agents/sdd-research.md +54 -0
- package/assets/agents/sdd-status.md +4 -4
- package/assets/agents/sdd-tasks.md +2 -3
- package/assets/agents/sdd-verify.md +21 -1
- package/assets/chains/sdd-full.chain.md +1 -1
- package/assets/chains/sdd-verify.chain.md +1 -1
- package/assets/orchestrator-delegation.md +56 -249
- package/assets/orchestrator-memory.md +2 -0
- package/assets/orchestrator.md +20 -40
- package/assets/sdd-orchestrator-workflow.md +30 -37
- package/assets/support/sdd-status-contract.md +7 -7
- package/contracts/review-integration/v1/schemas/transition-execution.schema.json +42 -0
- package/contracts/review-integration/v2/schemas/last-event-closure.schema.json +66 -0
- package/contracts/review-integration/v2/schemas/opencode-provider-role.schema.json +14 -0
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +8 -7
- package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/bundle/README.md +10 -0
- package/contracts/review-provider-contract-mirror/v1.2.0/bundle/manifest.json +74 -0
- package/contracts/review-provider-contract-mirror/v1.2.0/bundle/orchestration/pi.md +53 -0
- package/contracts/review-provider-contract-mirror/v1.2.0/bundle/schemas/targeted-validator.schema.json +1 -0
- package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/generated/provider-capabilities.baseline.json +9 -2
- package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/generated/provider-roles.baseline.json +2 -2
- package/docs/native-authority-architecture.md +9 -11
- package/docs/review-integration.md +27 -373
- package/extensions/ask-user-choice.ts +151 -0
- package/extensions/gentle-ai.ts +2349 -3785
- package/extensions/quiet-tools.ts +515 -32
- package/extensions/sdd-init.ts +4 -8
- package/lib/agent-home.ts +8 -0
- package/lib/gentle-ai-renderer.ts +70 -0
- package/lib/model-routing-authority.ts +133 -0
- package/lib/native-review-cli.ts +387 -940
- package/lib/opaque-pi-reviewer-adapter.ts +284 -0
- package/lib/provider-contract-bundle.ts +88 -6
- package/lib/review-candidate-view.ts +341 -132
- package/lib/review-host-relay.ts +324 -96
- package/lib/review-integration-v2.ts +868 -307
- package/lib/review-last-event-controller.ts +35 -0
- package/lib/sdd-preflight.ts +179 -68
- package/lib/sdd-status.ts +66 -111
- package/lib/terminal-theme.ts +1 -1
- package/package.json +83 -82
- package/runtime/gentle-ai-binary.mjs +1 -1
- package/runtime/native-review-cli.mjs +337 -890
- package/runtime/review-integration-v2.mjs +816 -255
- package/runtime/review-relay-contract.mjs +1 -1
- package/scripts/{build-git-commit-transaction-runner.mjs → build-runtime-modules.mjs} +4 -5
- package/scripts/gentle-ai-installer.mjs +75 -22
- package/scripts/maintainer/provider-relay-matrix.mjs +195 -11
- package/scripts/test-packed-runner.mjs +4 -7
- package/scripts/verify-package-files.mjs +23 -23
- package/skills/_shared/review-ledger-contract.md +14 -14
- package/skills/chained-pr/SKILL.md +3 -0
- package/skills/cognitive-doc-design/SKILL.md +1 -1
- package/skills/comment-writer/SKILL.md +1 -1
- package/skills/gentle-ai/SKILL.md +7 -74
- package/skills/issue-creation/SKILL.md +53 -93
- package/skills/judgment-day/SKILL.md +5 -7
- package/skills/rdd-defect-workflow/SKILL.md +3 -3
- package/skills/release/SKILL.md +3 -3
- package/skills/skill-registry/SKILL.md +1 -1
- package/skills/work-unit-commits/SKILL.md +3 -1
- package/tests/artifact-language.test.ts +24 -11
- package/tests/ask-user-choice.test.ts +264 -0
- package/tests/codegraph-tools.test.ts +3 -3
- package/tests/crosslane/cross-lane.mjs +15 -1168
- package/tests/delegated-key-learnings-contract.test.ts +8 -6
- package/tests/devbinary/native-review-parity.devtest.ts +167 -250
- package/tests/devbinary/pi-host-relay.devtest.ts +867 -0
- package/tests/fixtures/devbinary/last-event-capture-correction-plan.captured.json +10 -0
- package/tests/fixtures/devbinary/last-event-capture-refuter-approved.captured.json +20 -0
- package/tests/fixtures/devbinary/last-event-capture-refuter-correction-required.captured.json +26 -0
- package/tests/fixtures/devbinary/last-event-capture-result-approved.captured.json +8 -0
- package/tests/fixtures/devbinary/last-event-capture-result-correction-required.captured.json +26 -0
- package/tests/fixtures/devbinary/last-event-capture-validation-approved.captured.json +8 -0
- package/tests/fixtures/devbinary/last-event-closure.provenance.md +13 -0
- package/tests/fixtures/devbinary/review-acknowledged-v1.captured.json +9 -0
- package/tests/fixtures/devbinary/review-acknowledged.provenance.md +31 -0
- package/tests/fixtures/devbinary/start-v3-zero-lens-closed.captured.json +21 -0
- package/tests/fixtures/native-review-cli/v2.5.0-rc.1/PROVENANCE.txt +15 -0
- package/tests/fixtures/provider-contract-bundle/v1.2.0/README.md +22 -0
- package/{contracts/review-provider-contract-mirror/v1.1.0/bundle → tests/fixtures/provider-contract-bundle/v1.2.0}/manifest.json +11 -2
- package/tests/fixtures/provider-contract-bundle/v1.2.0/orchestration/pi.md +97 -0
- package/tests/fixtures/provider-contract-bundle/v1.2.0/schemas/lens.schema.json +16 -0
- package/tests/fixtures/provider-contract-bundle/v1.2.0/schemas/refuter.schema.json +1 -0
- package/tests/fixtures/provider-contract-bundle/v1.2.0/vectors/lens.json +1 -0
- package/tests/fixtures/provider-contract-bundle/v1.2.0/vectors/refuter.json +1 -0
- package/tests/fixtures/provider-contract-bundle/v1.2.0/vectors/targeted-validator.json +1 -0
- package/tests/gentle-ai-binary.test.ts +83 -13
- package/tests/gentle-ai-dev-binary.test.ts +51 -228
- package/tests/gentle-ai-installer.test.ts +137 -47
- package/tests/gentle-ai.test.ts +821 -131
- package/tests/gentle-theme.test.ts +133 -0
- package/tests/issue-creation-skill.test.ts +103 -0
- package/tests/maintainer/provider-relay.maintest.ts +340 -4
- package/tests/model-routing-authority.test.ts +257 -0
- package/tests/native-review-capability-contract.test.ts +45 -1
- package/tests/native-review-cli.test.ts +586 -962
- package/tests/native-review-consent.test.ts +150 -66
- package/tests/native-review-parity-runtime.test.ts +80 -359
- package/tests/native-review-parity.test.ts +674 -925
- package/tests/opaque-pi-reviewer-adapter.test.ts +266 -0
- package/tests/orchestrator-budget.test.ts +132 -88
- package/tests/orchestrator-rdd-ownership.test.ts +103 -0
- package/tests/package-manifest.test.ts +152 -36
- package/tests/provider-contract-bundle.test.ts +76 -0
- package/tests/provider-contract-mirror.test.ts +19 -0
- package/tests/provider-defect-handoff.test.ts +15 -118
- package/tests/quiet-tool-rendering.test.ts +1055 -28
- package/tests/review-agent-end-preflight.test.ts +408 -0
- package/tests/review-authority-recovery-docs.test.ts +1 -2
- package/tests/review-candidate-view.test.ts +409 -3
- package/tests/review-compact-contract.test.ts +4 -30
- package/tests/review-contract-prompt.test.ts +139 -0
- package/tests/review-controller-lock-status.test.ts +2 -2
- package/tests/review-controller-native-recovery.test.ts +363 -1450
- package/tests/review-controller-native-routing.test.ts +1251 -5642
- package/tests/review-controller-retired-ops.test.ts +1 -1
- package/tests/review-controller-workspace-root.test.ts +222 -71
- package/tests/review-controller.test.ts +26 -816
- package/tests/review-corrected-finalize-binding.test.ts +112 -153
- package/tests/review-dispatch-hydration-gap.test.ts +1 -53
- package/tests/review-gate.test.ts +0 -45
- package/tests/review-host-relay-restart-parity.test.ts +360 -0
- package/tests/review-host-relay-routing.test.ts +328 -91
- package/tests/review-host-relay.test.ts +436 -14
- package/tests/review-integration-v2-forward.test.ts +623 -553
- package/tests/review-integration-v2.test.ts +239 -165
- package/tests/review-last-event-closure.test.ts +408 -0
- package/tests/review-ledger-contract.test.ts +97 -35
- package/tests/review-recovered-lineage-routing.test.ts +0 -47
- package/tests/review-relay-transport-agent.test.ts +119 -46
- package/tests/review-snapshot.test.ts +3 -2
- package/tests/runtime-harness.mjs +362 -196
- package/tests/sdd-agent-tools.test.ts +36 -0
- package/tests/sdd-preflight.test.ts +81 -15
- package/tests/sdd-status.test.ts +109 -110
- package/tests/skill-collision-prefixes.test.ts +5 -8
- package/tests/writer-edit-surface-scope.test.ts +366 -0
- package/themes/Gentleman-Cute.json +94 -0
- package/themes/Gentleman-Sexy.json +92 -0
- package/lib/git-commit-transaction.ts +0 -861
- package/runtime/git-commit-transaction.mjs +0 -862
- package/scripts/run-git-commit-transaction.mjs +0 -35
- package/tests/fixtures/native-review-cli/v2.1.3/sdd-status-engram.json +0 -139
- package/tests/fixtures/native-review-cli/v2.1.3/sdd-status.json +0 -200
- package/tests/git-commit-transaction.test.ts +0 -530
- /package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/bundle/schemas/lens.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/bundle/schemas/refuter.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/bundle/vectors/lens.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/bundle/vectors/refuter.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.1.0 → v1.2.0}/bundle/vectors/targeted-validator.json +0 -0
- /package/{contracts/review-provider-contract-mirror/v1.1.0/bundle → tests/fixtures/provider-contract-bundle/v1.2.0}/schemas/targeted-validator.schema.json +0 -0
package/README.md
CHANGED
|
@@ -11,14 +11,38 @@
|
|
|
11
11
|
[](#sddopenspec-flow)
|
|
12
12
|
[](#what-it-adds)
|
|
13
13
|
|
|
14
|
+
**[Gentle-AI website](https://gentle-ai.gentlemanprogramming.com/)** • **[Gentle-AI wiki](https://gentle-ai-wiki.gentlemanprogramming.com/)** • **[Engram](https://engram.gentlemanprogramming.com/)**
|
|
15
|
+
|
|
16
|
+
<div align="center">
|
|
17
|
+
|
|
18
|
+
<!--
|
|
19
|
+
sealed_token is a GitHub fine-grained token encrypted against Star History's
|
|
20
|
+
public key, so only the encrypted value is published here. It is required
|
|
21
|
+
because GitHub restricted the stargazers API to a repository's admins and
|
|
22
|
+
collaborators on 2026-06-30; without it the chart renders an error placeholder.
|
|
23
|
+
Regenerate it at https://www.star-history.com/?repos=Gentleman-Programming%2Fgentle-pi&type=date&legend=top-left
|
|
24
|
+
-->
|
|
25
|
+
|
|
26
|
+
<a href="https://www.star-history.com/?repos=Gentleman-Programming%2Fgentle-pi&type=date&legend=top-left">
|
|
27
|
+
<picture>
|
|
28
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=Gentleman-Programming%2Fgentle-pi&type=date&theme=dark&legend=top-left&sealed_token=zwrd_DfwYZeJU7nhGYNtREEheKWYEslW_uzrqORlZ36v-JSMepdqGLkKExp1M-xbNq6t-ebVS5iM3WoPDO26tXbSGkjXC2Jo3kHQ3uNzlRkCrWoqRHkPVQXvosKciY109ObiwGV1z8aajyedcloppmekCGrvVKJb6KWxGLXW_mHcRAVIBZUOa4SzW75D" />
|
|
29
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=Gentleman-Programming%2Fgentle-pi&type=date&legend=top-left&sealed_token=zwrd_DfwYZeJU7nhGYNtREEheKWYEslW_uzrqORlZ36v-JSMepdqGLkKExp1M-xbNq6t-ebVS5iM3WoPDO26tXbSGkjXC2Jo3kHQ3uNzlRkCrWoqRHkPVQXvosKciY109ObiwGV1z8aajyedcloppmekCGrvVKJb6KWxGLXW_mHcRAVIBZUOa4SzW75D" />
|
|
30
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=Gentleman-Programming%2Fgentle-pi&type=date&legend=top-left&sealed_token=zwrd_DfwYZeJU7nhGYNtREEheKWYEslW_uzrqORlZ36v-JSMepdqGLkKExp1M-xbNq6t-ebVS5iM3WoPDO26tXbSGkjXC2Jo3kHQ3uNzlRkCrWoqRHkPVQXvosKciY109ObiwGV1z8aajyedcloppmekCGrvVKJb6KWxGLXW_mHcRAVIBZUOa4SzW75D" />
|
|
31
|
+
</picture>
|
|
32
|
+
</a>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
14
36
|
**Turn Pi from a powerful coding agent into a controlled development harness.**
|
|
15
37
|
|
|
16
38
|
`gentle-pi` installs **el Gentleman** in Pi: a senior-architect operating layer for Spec-Driven Development, focused subagents, strict TDD evidence, reviewable work units, safety guards, project/user skill discovery, and bounded native review.
|
|
17
39
|
|
|
18
|
-
Pi already has strong tools. `gentle-pi` adds the discipline for using them well,
|
|
40
|
+
Pi already has strong tools. `gentle-pi` adds the discipline for using them well, keeps review evidence Git-derived instead of agent narration, and leaves delivery decisions to ordinary repository policy.
|
|
19
41
|
|
|
20
42
|
`gentle-pi` is the Pi-native package from the [Gentle-AI ecosystem](https://github.com/Gentleman-Programming/gentle-ai), built by [Gentleman Programming](https://github.com/Gentleman-Programming): the broader open-source project for turning AI coding agents into disciplined engineering environments with SDD workflows, skills, memory integrations, model routing, and review guardrails across multiple agents.
|
|
21
43
|
|
|
44
|
+
> **Trademark notice:** The gentle-pi name and logo are trademarks of Alan Buscaglia. The MIT License applies to the code; it does not permit implying endorsement or official affiliation. See [TRADEMARKS.md](TRADEMARKS.md).
|
|
45
|
+
|
|
22
46
|
Follow the project and the community around it:
|
|
23
47
|
|
|
24
48
|
- GitHub: [Gentleman-Programming](https://github.com/Gentleman-Programming)
|
|
@@ -49,7 +73,7 @@ Most coding-agent sessions fail for operational reasons, not model reasons:
|
|
|
49
73
|
| **Configurable startup intro** | Adds a rose/text-logo startup intro, compact runtime panel, color presets, and commands to hide or show the decorative parts. |
|
|
50
74
|
| **Work routing discipline** | Small tasks stay inline. Context-heavy exploration can be delegated. Large or risky changes go through SDD/OpenSpec. |
|
|
51
75
|
| **SDD/OpenSpec assets** | Installs phase agents and chains for `init`, `onboard`, `explore`, `proposal`, `spec`, `design`, `tasks`, `apply`, `verify`, `sync`, and `archive`. |
|
|
52
|
-
| **Lazy SDD preflight** |
|
|
76
|
+
| **Lazy SDD preflight** | Resolves SDD mode, artifact store, delivery strategy, and review budget once per session; prompts only when a choice is genuinely unresolved. |
|
|
53
77
|
| **Subagent orchestration** | Keeps one parent session responsible while child agents explore, implement, test, or review with focused context. |
|
|
54
78
|
| **Strict TDD support** | When project config declares a test command, apply/verify phases must record RED → GREEN → TRIANGULATE → REFACTOR evidence. |
|
|
55
79
|
| **Reviewer protection** | Surfaces review workload risk before a task turns into an oversized PR. |
|
|
@@ -57,10 +81,12 @@ Most coding-agent sessions fail for operational reasons, not model reasons:
|
|
|
57
81
|
| **Skill discovery registry** | Maintains `.atl/skill-registry.md` from project and user skills so review/comment/PR workflows do not silently miss the right skill. |
|
|
58
82
|
| **Skill creation workflow** | Provides the `gentle-ai-skill-creator`/`gentle-ai-skill-improver` skills, `/skill-creation` prompt, and packaged style guide for LLM-first skills. |
|
|
59
83
|
| **Delivery skills** | Includes issue-first PRs, chained PRs, work-unit commits, cognitive docs, comment writing, and Judgment Day review. |
|
|
60
|
-
| **Bounded native review** | Freezes one candidate, dispatches only controller-selected lenses, records native authority
|
|
61
|
-
| **Verified native runtime** | Provisions the exact package-local Gentle AI v2.
|
|
84
|
+
| **Bounded native review** | Freezes one candidate, dispatches only controller-selected lenses, and records native authority. Review outcomes are informational; delivery follows ordinary repository policy. |
|
|
85
|
+
| **Verified native runtime** | Provisions the exact package-local Gentle AI v2.6.0 runtime: signed, SHA-256-pinned release archives on Darwin/Linux and a Go SumDB-verified source build on Windows x64/arm64. It validates package-local integrity and rejects PATH, global, sibling, symlink, and mode fallbacks. |
|
|
62
86
|
| **Runtime safety** | Blocks destructive shell commands, asks for confirmation for sensitive operations, and blocks direct read/write/edit access to sensitive paths. |
|
|
63
87
|
|
|
88
|
+
**Migration note:** Do not enable `pi-tool-cards` and `quiet-tools` together: Pi rejects duplicate `bash`, `read`, `edit`, and `write` registrations. Disable or remove the standalone package during migration; gentle-pi does not alter user configuration or delete that repository.
|
|
89
|
+
|
|
64
90
|
## Install
|
|
65
91
|
|
|
66
92
|
```bash
|
|
@@ -79,7 +105,7 @@ pi install npm:gentle-pi@0.14.0
|
|
|
79
105
|
pi install npm:gentle-pi@latest
|
|
80
106
|
```
|
|
81
107
|
|
|
82
|
-
The latest RDD package installs Gentle AI only into its private `.gentle-ai/` directory. Darwin and Linux use pinned
|
|
108
|
+
The latest RDD package installs Gentle AI only into its private `.gentle-ai/` directory. Darwin and Linux use pinned release assets with asset and executable SHA-256 verification (signed archives for stable pins such as the current v2.6.0; raw prerelease binaries only under a prerelease pin). Windows x64 and arm64 build the exact `v2.6.0` source tag with a local Go 1.25.10+ toolchain, a sealed Go environment, `GOTOOLCHAIN=local`, and `GOSUMDB=sum.golang.org`; it does not download Go automatically. Windows provenance is Go-toolchain plus SumDB evidence and postinstall tamper detection, **not** Authenticode or protection against a malicious joint binary-and-manifest replacement. Package-private locks coordinate cooperative concurrent or crashed installers; their tombstones fail closed. A malicious same-user process with write access to package-private `node_modules` is outside that protocol because it can already replace package code, binary, or manifest, and portable Node has no pathname-delete CAS. It never uses `PATH` or a global `gentle-ai` installation. For development or offline installs only, set `GENTLE_PI_SKIP_GENTLE_AI_INSTALL=1`; native review operations then fail closed with an actionable `package-local-binary-missing` error until the package is reinstalled normally.
|
|
83
109
|
|
|
84
110
|
Recommended companion packages:
|
|
85
111
|
|
|
@@ -107,20 +133,18 @@ pi
|
|
|
107
133
|
/gentle:status Check package, SDD assets, OpenSpec, and global model config.
|
|
108
134
|
/gentle:doctor Run read-only diagnostics for SDD assets, config, tools, and guards.
|
|
109
135
|
/gentle:sdd-preflight Run or reuse the session SDD preflight explicitly.
|
|
110
|
-
/sdd-init
|
|
136
|
+
/gentle-sdd-init Create or refresh openspec/config.yaml (openspec/both stores only).
|
|
111
137
|
/gentle:models Assign global model/effort routing to SDD/custom agents.
|
|
112
138
|
/gentle:persona Switch between gentleman and neutral persona modes.
|
|
113
139
|
/gentle:background-subagents Show or set the managed background-subagents policy, with its deciding source.
|
|
114
140
|
/gentle:banner Configure startup rose, text logo, and color preset.
|
|
115
|
-
/gentle:commit-status Inspect an unresolved durable commit transaction.
|
|
116
|
-
/gentle:commit-abort Abandon safe recovery state without changing HEAD or the index.
|
|
117
141
|
```
|
|
118
142
|
|
|
119
143
|
Typical flow:
|
|
120
144
|
|
|
121
145
|
1. Open Pi in your repo.
|
|
122
146
|
2. Run `/gentle:status`.
|
|
123
|
-
3. Run `/sdd-init` once per project, or when test/project capabilities change. This also runs the session SDD preflight.
|
|
147
|
+
3. Run `/gentle-sdd-init` once per project, or when test/project capabilities change. This also runs the session SDD preflight.
|
|
124
148
|
4. For a substantial change, ask Pi to use SDD. Natural-language requests are classified by the parent agent, not by brittle runtime regexes.
|
|
125
149
|
5. Review the phase artifacts instead of trusting floating chat context.
|
|
126
150
|
|
|
@@ -129,10 +153,10 @@ Typical flow:
|
|
|
129
153
|
1. **Install and inspect.** Install `gentle-pi`, open Pi in the target repository, then run `/gentle:status` or `/gentle:doctor`.
|
|
130
154
|
2. **Plan when risk justifies it.** Small work stays direct; substantial work uses SDD with Engram, OpenSpec, or both so requirements and decisions survive compaction.
|
|
131
155
|
3. **Build with evidence.** One focused writer implements the approved scope. When Strict TDD is available, apply and verify preserve RED → GREEN → TRIANGULATE → REFACTOR evidence.
|
|
132
|
-
4. **
|
|
133
|
-
5. **Deliver
|
|
156
|
+
4. **Use runtime-owned RDD when available.** Gentle AI supplies any runtime-specific review instructions; this package does not recreate a lifecycle in documentation or prompts.
|
|
157
|
+
5. **Deliver through ordinary repository policy.** Review and Judgment Day evidence is informational only; Pi never creates a delivery route, authorization, target rederivation, or receipt gate.
|
|
134
158
|
|
|
135
|
-
> **Trust what the system can derive, not what an agent claims.** Agents analyze the candidate. The package-local Gentle AI runtime owns scope, risk, findings,
|
|
159
|
+
> **Trust what the system can derive, not what an agent claims.** Agents analyze the candidate. The package-local Gentle AI runtime owns scope, risk, findings, and review authority. Review outcomes inform delivery; ordinary repository policy decides delivery commands. Dangerous-command safety and destructive-review consent remain independent. See Gentle AI's [review authority threat model](https://github.com/Gentleman-Programming/gentle-ai/blob/main/docs/review-authority-threat-model.md) and [Chapter 21 — Verifiable Trust](https://the-amazing-gentleman-programming-book.vercel.app/en/book/Chapter21_Verifiable-Trust).
|
|
136
160
|
|
|
137
161
|
## How the harness decides what to do
|
|
138
162
|
|
|
@@ -154,19 +178,17 @@ The goal is not ceremony. The goal is to avoid accidental chaos. Once a task sto
|
|
|
154
178
|
| --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
155
179
|
| Reading 4+ files to understand a flow | Launch `scout`, `context-builder`, or the closest read-only mapping subagent. |
|
|
156
180
|
| Touching 2+ non-trivial code files | Delegate one writer; do not continue inline unless delegation is unavailable. |
|
|
157
|
-
| Commit, push, or PR after code changes |
|
|
158
|
-
| Wrong cwd, worktree/git accident, merge recovery, confusing test/env issue | Stop, preserve the
|
|
181
|
+
| Commit, push, or PR after code changes | Follow the loaded native instruction, or ordinary repository policy when none is supplied. |
|
|
182
|
+
| Wrong cwd, worktree/git accident, merge recovery, confusing test/env issue | Stop, preserve the affected scope, and investigate separately before resuming. |
|
|
159
183
|
| Long monolithic session with accumulating complexity, roughly 20 tool calls, 5 exploratory reads, or 2 non-mechanical edits | Pause and delegate the remaining work, or stop and explain the exact blocker. |
|
|
160
184
|
|
|
161
185
|
The intended balanced loop for a bounded bugfix is:
|
|
162
186
|
|
|
163
187
|
```text
|
|
164
|
-
parent git/status + clarify →
|
|
188
|
+
parent git/status + clarify → one worker writes authorized fixes → focused verification → parent reports
|
|
165
189
|
```
|
|
166
190
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
Review actors are dispatched only through parent `subagent_run` calls in `mode: "task"`. Before execution, the controller verifies every entry, content hash, mode, root, and index in one selected immutable candidate tree per requested lens, then appends one bounded controller-owned block containing only the Git-derived base-to-candidate changed scope. Readable scopes group paths by exact candidate mode and list deletions explicitly. Larger scopes use a canonical gzip/base64url manifest plus SHA-256; the read-only `gentle_review_scope` actor tool validates and paginates every changed path without traversing the ambient or full candidate tree. Oversized compressed transport, decompressed manifests, or response pages fail closed. Mixed batches, unselected/missing/stale views, user-supplied candidate-view text, unsafe paths, and non-task dispatches also fail closed; review actors retain no shell or mutation tools.
|
|
191
|
+
`scout`/`context-builder` save parent context by compressing broad exploration. `worker` preserves a single writer thread. Any RDD-specific actor behavior belongs to the runtime instruction supplied by Gentle AI, not to this README.
|
|
170
192
|
|
|
171
193
|
### Review authority recovery and reset safety
|
|
172
194
|
|
|
@@ -182,11 +204,13 @@ Reconciliation is intentionally narrow: native code may quarantine only the boun
|
|
|
182
204
|
|
|
183
205
|
`review dispose-result` is deliberately unsupported by Pi pending a separate design; it has no controller operation or fallback. All maintenance routes fail closed headlessly and never auto-run against legacy history.
|
|
184
206
|
|
|
185
|
-
Native
|
|
207
|
+
Native lifecycle status remains informational. VALIDATE does not authorize delivery; commit, push, PR, and release commands follow ordinary repository policy. Recovery grants no new budget, and legacy graph bundle export/import is retired.
|
|
186
208
|
|
|
187
209
|
This is the post-U8 boundary, not the final architecture. [Issue #191](https://github.com/Gentleman-Programming/gentle-pi/issues/191) is the immediate final unit in this same delivery: extract the remaining Pi command-projection and lifecycle-gate surface from `review-transaction.ts`, repoint runtime enforcement, then delete only dependencies proven unreachable without weakening graph-v1 Judgment Day. The branch-wide High-tier 4R runs after that extraction, before the single size-exception PR.
|
|
188
210
|
|
|
189
|
-
|
|
211
|
+
### Review Lens Selection (architecture reference)
|
|
212
|
+
|
|
213
|
+
`reviewer` is not an installed subagent name. It is historical routing vocabulary, not a static instruction. When a runtime-specific Gentle AI instruction applies, it alone determines whether any concrete lens is used:
|
|
190
214
|
|
|
191
215
|
| Context | Review lens |
|
|
192
216
|
| --- | --- |
|
|
@@ -196,11 +220,13 @@ This is the post-U8 boundary, not the final architecture. [Issue #191](https://g
|
|
|
196
220
|
| Security, permissions, data exposure/loss, architecture, dependencies | `review-risk` |
|
|
197
221
|
| Large PR, hot path, or >400 changed lines | Full 4R: `review-risk`, `review-resilience`, `review-readability`, `review-reliability` |
|
|
198
222
|
|
|
199
|
-
|
|
223
|
+
The former compact controller classified documentation/comment/formatting-only changes as zero-lens, standard changes as one dominant lens, and higher-risk paths as full 4R. This describes compatibility architecture only; never derive or run those choices from this README.
|
|
200
224
|
|
|
201
|
-
###
|
|
225
|
+
### Review authority architecture (reference only)
|
|
202
226
|
|
|
203
|
-
|
|
227
|
+
Gentle AI dynamically supplies runtime-specific RDD instructions. `gentle-pi` does not define an RDD lifecycle, command route, approval path, recovery sequence, or fallback. The historical compact-controller material below documents architecture and compatibility boundaries only; it is not an operator instruction.
|
|
228
|
+
|
|
229
|
+
Concretely: `gentle-pi` mirrors the Gentle AI provider contract bundle's `orchestration/pi.md` locally (`contracts/review-provider-contract-mirror/`, verified against the mirror lock's recorded SHA-256 before injection) and injects that mirrored text into the primary session's system prompt at session start. Gentle AI does not write anything into Pi's system prompt; when the mirrored contract is absent, unreadable, or fails digest verification, `gentle-pi` invents no fallback lifecycle.
|
|
204
230
|
|
|
205
231
|
```mermaid
|
|
206
232
|
flowchart TD
|
|
@@ -229,44 +255,23 @@ flowchart TD
|
|
|
229
255
|
V -->|Fails, malformed, or out of scope| E1["escalated"]
|
|
230
256
|
end
|
|
231
257
|
|
|
232
|
-
A1 -->
|
|
233
|
-
|
|
234
|
-
PC --> G1{"durable commit transaction"}
|
|
235
|
-
G1 --> HK["Run effective pre-commit hook once"]
|
|
236
|
-
HK --> NV{"validate exact post-hook tree"}
|
|
237
|
-
NV -->|allow| CM["Commit through hook proxies and prove HEAD tree"]
|
|
238
|
-
NV -->|scope changed| N["Review post-hook tree; exact retry skips completed hook"]
|
|
239
|
-
NV -->|invalidated or escalated| X
|
|
240
|
-
CM --> G2{"pre-push validate"}
|
|
241
|
-
G2 -->|allow| PS["Push"]
|
|
242
|
-
G2 -->|deny| X
|
|
243
|
-
PS --> CI["Required CI on exact remote SHA"]
|
|
244
|
-
CI -->|success| RL{"Release gate"}
|
|
245
|
-
CI -->|pending or failed| X
|
|
246
|
-
RL -->|Exact patch tag on protected main; no fresh risk evidence| FP["Zero-actor release fast path"]
|
|
247
|
-
RL -->|Receipt-bound release evidence| RV["Native receipt validation"]
|
|
248
|
-
RL -->|Major, post-incident, stale, or unprovable| X
|
|
249
|
-
FP --> PUB["Publish release"]
|
|
250
|
-
RV -->|allow| PUB
|
|
251
|
-
RV -->|deny| X
|
|
252
|
-
N --> H
|
|
258
|
+
A1 --> O["Review outcome is informational"]
|
|
259
|
+
E1 --> O
|
|
253
260
|
```
|
|
254
261
|
|
|
255
|
-
|
|
262
|
+
VALIDATE is informational. Commit, push, PR, and release commands follow ordinary repository policy; RDD never authorizes, rewrites, consumes review state for, or blocks them. Dangerous-command safety and destructive-review consent remain independent.
|
|
256
263
|
|
|
257
|
-
Native contract pairing is exact: this adapter resolves only the integrity-verified package-local Gentle AI v2.
|
|
264
|
+
Native contract pairing is exact: this adapter resolves only the integrity-verified package-local Gentle AI v2.6.0 executable, independently hashes it, then negotiates `gentle-ai.review-integration/v2` outside the repository. Capabilities are cached by that executable digest. Every START, target status, FINALIZE, validate, and BIND-SDD request passes the same contract identifier. Negotiated envelopes decode exactly against the vendored schemas; `recover` routes only the provider-selected `action_disposition`, and optional additions require a future compatible schema/minor that the provider explicitly advertises and the consumer negotiates.
|
|
258
265
|
|
|
259
266
|
Contract `/v2` replaces the Base64 `candidate_diff` reviewer transport of `/v1` with immutable `base_tree`/`candidate_tree` plus an ordered `changed_path_manifest` and never an inline patch. `gentle-pi` negotiates `/v2` only, with no dual-lane fallback; the cutover landed as one atomic commit against gentle-ai v2.2.2 (tracked by the `migrate-review-integration-v2` change), and the `/v1` schemas stay packaged because the `/v2` schemas `$ref` into their fragments. This provider contract version is unrelated to Pi's own internal "compact-v2" review-authority naming used below — the shared digit is coincidental, not a version pairing.
|
|
260
267
|
|
|
261
268
|
Target status owns `current_target`, `unrelated`, `ambiguous`, and `corrupted` applicability and returns one native action. Pi does not reconstruct ordinary authority from provider-private files or choose a lineage from repository-wide history. Restart recovery rebuilds only the derived candidate view from the native Git/content projection, including intended-untracked paths, symlinks, and immutable gitlink identities. Native failure envelopes retain their exact mutation outcome, replayability, required inputs, request digest, and next action. After an unknown or lost mutating result, Pi calls target status before any replay decision and returns only the provider-declared action.
|
|
262
269
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
Once the pinned gentle-ai runtime (currently v2.4.0) has written review authority, rollback MUST preserve every native store and receipt and MUST NOT run a downgraded binary against that repository. Disable the Pi route or roll forward to a compatible authority-aware release instead; deleting authority data or reinstalling an older binary is not a rollback path.
|
|
270
|
+
Once the pinned gentle-ai runtime (currently v2.6.0) has written review authority, rollback MUST preserve every native store and receipt and MUST NOT run a downgraded binary against that repository. Disable the Pi route or roll forward to a compatible authority-aware release instead; deleting authority data or reinstalling an older binary is not a rollback path.
|
|
266
271
|
|
|
267
272
|
### FINALIZE wrapper input
|
|
268
273
|
|
|
269
|
-
`gentle_review` accepts `input` as a JSON-serialized object string. For initial results, provide `review_result.lens_results[]`; each selected lens appears exactly once with `lens`, `findings`, and non-empty `evidence`. A clean lens uses `findings: []`. `final_evidence`
|
|
274
|
+
`gentle_review` accepts `input` as a JSON-serialized object string. For initial results, provide `review_result.lens_results[]`; each selected lens appears exactly once with `lens`, `findings`, and non-empty `evidence`. A clean lens uses `findings: []`. Pair `final_evidence` with exactly one of `final_verification_passed` or `final_verification_outcome`.
|
|
270
275
|
|
|
271
276
|
```json
|
|
272
277
|
{
|
|
@@ -320,20 +325,15 @@ Judgment Day alone may iterate discovery and scoped re-judgment, for at most two
|
|
|
320
325
|
|
|
321
326
|
Findings surviving round two escalate; no third-round transition exists.
|
|
322
327
|
|
|
323
|
-
Native
|
|
324
|
-
|
|
325
|
-
Pi also registers one one-shot authorization for the exact command and rederives its full publication target before registration, before bash-time native validation, and again after that validation before allowing the command. The Pi-owned `lib/review-publication-gate.ts` module owns typed publication targets, configured push-destination binding, release projection, release fast-path evaluation, and publication rechecks without depending on graph-v1 authority storage. For `gh pr create`, the effective repository follows GitHub CLI precedence (`--repo`, then `GH_REPO`, then local inference), and both that source/value and the exact advertised remote head commit are bound and rechecked against reviewed local `HEAD`. Publication `ls-remote` probes are shell-free, output-bounded, time-bounded, and cancellation-aware. The complete bash-time publication/native revalidation uses one aggregate bounded deadline combined with Pi's cancellation signal when available. First-push, push destination, exact PR base/head, repository identity, release, and dangerous-command protections remain fail closed.
|
|
326
|
-
Native pre-push to an existing branch is supported only when the effective push URL and repository identity equal the fetch URL and identity used by the exact `<remote>/<destination-branch>` selector, and its advertised commit equals the command update's old object. Split fetch/push topology is unsupported because PR #1216 introduced the upstream v2.1.1 `--base-ref` contract that v2.1.3 inherits unchanged: that contract resolves the selector through fetch-side remote-tracking state, and probing `pushurl` does not change selector resolution. Pi fails closed before native validation with `native-split-fetch-push-unsupported-until-upstream-supports-explicit-push-base`. Native pre-PR remains fetch-side and may use advertised remote selectors. Residual gap (separate follow-up): native first-push authorization remains unsupported until Pi has a persisted explicit advertised-base source. A missing destination fails closed with `native-first-push-unsupported-until-persisted-advertised-base-exists`; Pi never guesses a base from an upstream, default branch, or nearest ancestor.
|
|
328
|
+
Native review mode and candidate-scoped consent remain provider-owned lifecycle semantics. Pi relays the exact provider-owned lifecycle inputs and outputs; it does not create a clone-local consent latch or infer a delivery decision.
|
|
327
329
|
|
|
328
|
-
|
|
329
|
-
Release from protected `main` may bypass receipt validation only when the tag targets the current immutable `origin/main` SHA, required CI for that exact SHA is successful, the remote head is rechecked before tag push, and no fresh risk evidence exists; otherwise release fails closed through native receipt validation.
|
|
330
|
-
Major and post-incident releases require explicit extraordinary review even when fast-path checks pass.
|
|
330
|
+
When RDD is on and an agent loop ends with an unreviewed candidate, `gentle-pi` sends one read-only reminder pointing the agent back to `gentle_review {"operation":"inspect"}` before it reports completion. This nudge is idempotent (at most once per target identity per session), never fires for a headless session or a subagent's own loop, and never runs START or answers consent itself. At session start, `gentle-pi` records the current target identity as a baseline, so a candidate that already existed before the session began (the user's own prior work, not this session's output) never draws the reminder.
|
|
331
331
|
|
|
332
|
-
|
|
332
|
+
Review outcomes and receipt state are informational; commit, push, pull-request, and release delivery follow ordinary repository policy. No one-shot command authorization, publication-target revalidation, or receipt gate is required for delivery, and Pi does not inspect RDD mode or native authority to decide a Bash delivery command.
|
|
333
333
|
|
|
334
|
-
|
|
334
|
+
Dangerous-command safety remains independent and authoritative. Destructive-review-maintenance consent remains separate from delivery. Review operations, informational VALIDATE, and SDD perform no commit, push, pull-request, release, or publication operation.
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
The Pi host relay bounds each locked-down reviewer subprocess by materialized prompt size rather than by one fixed number: a 15-minute floor plus 15 minutes per mebibyte of prompt, clamped to a 2-hour ceiling. Set `GENTLE_PI_REVIEW_RELAY_PI_TIMEOUT_MS` to a positive decimal to replace that derived bound with your own; malformed values are ignored and the same 2-hour ceiling still applies, so no configuration turns a foreground finalize into an unbounded child process. A reviewer killed by the bound reports `pi-host-relay-timeout` with the elapsed time and the limit it was measured against, and it explicitly does not ask you to relaunch the identical slot — that would re-spend the model tokens to reach the same wall. Reviewer results admitted earlier in the same finalize stay admitted and are not re-run.
|
|
337
337
|
|
|
338
338
|
Adversarial review roles (the refuter and the targeted validator) are never Pi-authored: the provider renders self-contained `review.capture-refuter` / `review.capture-validation` vectors and Go runs its own locked-down `pi` process on them. Package agent assets remain a package-managed isolated installation. Project and user overrides may shadow a package asset; `gentle-pi` preserves those definitions and does not claim their effective permissions are package-compliant.
|
|
339
339
|
|
|
@@ -342,8 +342,8 @@ Adversarial review roles (the refuter and the targeted validator) are never Pi-a
|
|
|
342
342
|
```text
|
|
343
343
|
init
|
|
344
344
|
↓
|
|
345
|
-
explore → proposal → spec ─┬→ design ─┐
|
|
346
|
-
|
|
345
|
+
explore → research (optional) → proposal → spec ─┬→ design ─┐
|
|
346
|
+
└─────────┴→ tasks → apply → verify → sync → archive
|
|
347
347
|
```
|
|
348
348
|
|
|
349
349
|
The main loop is intentionally file-backed when you choose `openspec` or `both`:
|
|
@@ -416,7 +416,7 @@ Engram-only mode is different by design: Engram is working memory and does not m
|
|
|
416
416
|
|
|
417
417
|
## SDD preflight and project files
|
|
418
418
|
|
|
419
|
-
`gentle-pi` does not require SDD agents to be copied into every project. The package ensures global Pi SDD assets exist under the Pi agent home and treats project-local files only as overrides/debug copies. Slash SDD flows such as `/sdd-*`, `/sdd-init`, and the explicit `/gentle:sdd-preflight` command run a lazy preflight and
|
|
419
|
+
`gentle-pi` does not require SDD agents to be copied into every project. The package ensures global Pi SDD assets exist under the Pi agent home and treats project-local files only as overrides/debug copies. Slash SDD flows such as `/sdd-*`, `/gentle-sdd-init`, and the explicit `/gentle:sdd-preflight` command run a lazy preflight and resolve session-scoped SDD preferences. For natural-language requests, the parent agent decides whether the work should use SDD and must run/reuse `/gentle:sdd-preflight` before continuing.
|
|
420
420
|
|
|
421
421
|
```text
|
|
422
422
|
~/.pi/agent/agents/sdd-*.md
|
|
@@ -424,12 +424,9 @@ Engram-only mode is different by design: Engram is working memory and does not m
|
|
|
424
424
|
~/.pi/agent/gentle-ai/support/strict-tdd*.md
|
|
425
425
|
```
|
|
426
426
|
|
|
427
|
-
|
|
427
|
+
Preflight values resolve in this order: explicit current user/session choice, valid persisted preference, capability or already-selected strategy constraint, canonical default, then a prompt only when genuinely unresolved. Resolved values are reused for later SDD flows in the session.
|
|
428
428
|
|
|
429
|
-
|
|
430
|
-
- artifact store: `openspec`, or `engram`/`both` when callable memory tools are available;
|
|
431
|
-
- PR chaining strategy: `auto-forecast`, `ask-always`, `single-pr-default`, or `force-chained`;
|
|
432
|
-
- review budget line threshold.
|
|
429
|
+
Canonical values are `auto` execution mode, `openspec` artifact store, `ask-on-risk` delivery strategy, and a `400` changed-line review threshold. The delivery strategy domain is `ask-on-risk`, `auto-chain`, `single-pr`, or `exception-ok`; `chain_strategy` remains deferred until chaining is selected. `exception-ok` requires explicit `size:exception` acceptance and is never inferred. Consent, authorization, security, destructive/publishing, interactive phase approval, and ambiguous-scope gates remain human-controlled.
|
|
433
430
|
|
|
434
431
|
It does **not** overwrite existing global assets unless you explicitly run:
|
|
435
432
|
|
|
@@ -503,7 +500,7 @@ Skill discovery is a guardrail, not a workflow router: it helps Pi load the righ
|
|
|
503
500
|
|
|
504
501
|
Packaged skills include `cognitive-doc-design`, `comment-writer`, `gentle-ai-judgment-day`, `gentle-ai-skill-creator`, `gentle-ai-skill-improver`, and the other delivery/review skills under `skills/`. SDD init is installed as the packaged `sdd-init` runtime agent under `assets/agents/` and refreshed with the SDD assets.
|
|
505
502
|
|
|
506
|
-
Compatibility: the package keeps the existing skill folders (`skills/branch-pr`, `skills/judgment-day`, `skills/skill-creator`) but their exported frontmatter names are prefixed to avoid collisions with user/global skills. Treat former package names such as `branch-pr`, `judgment-day`,
|
|
503
|
+
Compatibility: the package keeps the existing skill folders (`skills/branch-pr`, `skills/cognitive-doc-design`, `skills/comment-writer`, `skills/judgment-day`, `skills/skill-creator`, `skills/skill-registry`, and `skills/work-unit-commits`) but their exported frontmatter names are prefixed to avoid collisions with user/global skills. Treat former package names such as `branch-pr`, `cognitive-doc-design`, `comment-writer`, `judgment-day`, `skill-creator`, `skill-registry`, and `work-unit-commits` as legacy aliases in prose; runtime skill selection should use `gentle-ai-branch-pr`, `gentle-ai-cognitive-doc-design`, `gentle-ai-comment-writer`, `gentle-ai-judgment-day`, `gentle-ai-skill-creator`, `gentle-ai-skill-registry`, and `gentle-ai-work-unit-commits`.
|
|
507
504
|
|
|
508
505
|
Delegation contract:
|
|
509
506
|
|
|
@@ -600,7 +597,7 @@ Legacy string entries are still accepted and treated as `model`-only config.
|
|
|
600
597
|
| `/gentle:toggle-rose` | Toggles the startup rose. |
|
|
601
598
|
| `/gentle:toggle-text-logo` | Toggles the startup text logo. |
|
|
602
599
|
| `/gentle:banner-color` | Selects a startup banner color preset. |
|
|
603
|
-
| `/sdd-init`
|
|
600
|
+
| `/gentle-sdd-init` | Initializes or refreshes `openspec/config.yaml` (openspec/both stores only). |
|
|
604
601
|
| `/gentle:install-sdd` | Repairs missing global SDD runtime assets without overwriting files. |
|
|
605
602
|
| `/gentle:install-sdd --force` | Force-refreshes installed global SDD assets. |
|
|
606
603
|
| `/skill-registry:refresh` | Regenerates `.atl/skill-registry.md`. |
|
|
@@ -677,10 +674,9 @@ Memory contract for SDD delegation:
|
|
|
677
674
|
|
|
678
675
|
| Path | Purpose |
|
|
679
676
|
| ------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
680
|
-
| `extensions/gentle-ai.ts` | Injects identity, orchestrates native review authority
|
|
677
|
+
| `extensions/gentle-ai.ts` | Injects identity, orchestrates native review authority, refreshes global SDD assets, registers commands, applies model/persona config, and enforces runtime safety. |
|
|
681
678
|
| `lib/native-review-cli.ts` | Strict package-local adapter for Gentle AI START, FINALIZE, VALIDATE, SDD binding, and status contracts. |
|
|
682
679
|
| `lib/review-integration-v2.ts` | Strict consumer decoder for negotiated capabilities, operations, target status, projections, repair, and failures against contract `review-integration/v2` (active today). |
|
|
683
|
-
| `lib/git-commit-transaction.ts` | Durable hook/native-validation/commit/recovery transaction with publication blocking and HEAD proof. |
|
|
684
680
|
| `lib/review-candidate-view.ts` | Builds immutable changed-scope actor views while preserving full-tree, path, mode, symlink, and index integrity. |
|
|
685
681
|
| `lib/review-canonical.ts` | Permanent Pi-owned canonical JSON and domain-hash primitives for consumer-side identities. |
|
|
686
682
|
| `lib/review-repository.ts` | Permanent Pi-owned Git common-directory identity, safe Git environment, and authority-root binding. |
|
|
@@ -689,7 +685,7 @@ Memory contract for SDD delegation:
|
|
|
689
685
|
| `contracts/review-integration/v1/` | Byte-identical provider schemas and conformance fixtures for contract `review-integration/v1`, hash-checked before packaging; retained on disk permanently because `/v2`'s schemas `$ref` into these fragments. |
|
|
690
686
|
| `contracts/review-integration/v2/` | Byte-identical provider schemas and conformance fixtures for contract `review-integration/v2` (immutable `base_tree`/`candidate_tree`, ordered `changed_path_manifest`, no inline candidate diff), hash-checked before packaging. |
|
|
691
687
|
| `extensions/startup-banner.ts` | Shows and configures the startup intro, color presets, compact runtime panel, and collaboration credit. |
|
|
692
|
-
| `extensions/sdd-init.ts` | Registers `/sdd-init` for OpenSpec initialization. |
|
|
688
|
+
| `extensions/sdd-init.ts` | Registers `/gentle-sdd-init` for OpenSpec initialization. |
|
|
693
689
|
| `extensions/skill-registry.ts` | Maintains `.atl/skill-registry.md` from project/user skills and closes file watchers on shutdown. |
|
|
694
690
|
| `assets/orchestrator.md` | Parent-session orchestration contract (always-on core). |
|
|
695
691
|
| `assets/orchestrator-delegation.md` | Lazy-loaded delegation/routing/review detail, including the mirrored gentle-ai canon. |
|
|
@@ -735,21 +731,22 @@ pnpm test:cross-lane --with-model # adds the real Go-owned pi reviewer run (mo
|
|
|
735
731
|
|
|
736
732
|
What it checks, against live scratch repositories:
|
|
737
733
|
|
|
738
|
-
- a low-risk lifecycle
|
|
734
|
+
- a low-risk lifecycle: START → native-approved FINALIZE → terminal burn; the `pre-commit` gate is informational and unmanaged, not an allow decision or retained receipt;
|
|
739
735
|
- the medium-risk `consent/v3` granted round-trip through the direct decoder lane;
|
|
740
|
-
- controller sequencing:
|
|
741
|
-
- the audited abandon end to end, asserting the adapter builds the exact nine-line `gentle-ai.review-abandon-authorization/v2` discarded-work binding and the native gate commits the quarantine record;
|
|
736
|
+
- controller sequencing: each decoded offered next step equals the native transition; correction evidence precedes Go-owned targeted validation, then native approval and terminal burn leave no retained receipt;
|
|
737
|
+
- the active audited abandon end to end, asserting the adapter builds the exact nine-line `gentle-ai.review-abandon-authorization/v2` discarded-work binding and the native gate commits the quarantine record;
|
|
738
|
+
- after a scope change, a burned approved predecessor exposes no recoverable authority; recovered-successor hydration remains covered at unit level;
|
|
742
739
|
- forward-decoder freshness: every live envelope captured from the binary must decode without unknown-key rejection, the early warning that gentle-ai main grew a field gentle-pi lacks;
|
|
743
|
-
-
|
|
740
|
+
- the default no-model lane: 13 of 14 checks pass while the real-model check is intentionally skipped; Go-owned validation uses a deterministic scratch fake `pi`, and only `--with-model` runs the real locked-down reviewer with model spend.
|
|
744
741
|
|
|
745
742
|
Prerequisites:
|
|
746
743
|
|
|
747
744
|
- A real `gentle-ai` binary selected through the dev-binary override; there is no PATH or pinned-binary fallback, and the battery refuses to run without one. Either export `GENTLE_PI_GENTLE_AI_DEV_BINARY=<absolute path>` for the session, or register a persistent override with `/gentle:dev-binary <absolute path>` (stored at `~/.pi/gentle-ai/dev-binary.json` with schema `gentle-pi.dev-binary/v1`; the environment variable takes precedence over the registration, and the binary is re-validated and re-hashed on every resolution). Any real build works: an installed release binary or a locally built gentle-ai main.
|
|
748
745
|
- A Git checkout or worktree of this repository. The battery is a contributor tool wired to the repository layout and is excluded from `pnpm test` and CI by construction; run it from the repo, not from an installed Pi package.
|
|
749
746
|
|
|
750
|
-
The battery
|
|
747
|
+
The battery owns one throwaway scratch root under the OS temp directory and never touches the enclosing repository. Before any review lifecycle it creates private `HOME`, XDG config/cache/data/state, temporary, and RDD state directories inside that root; it proves RDD starts `off/default`, explicitly opts in with sandbox-global RDD, and removes the complete root after the run. It never requires or changes the user's ambient RDD mode. The default run spends no model tokens; `--with-model` launches one real reviewer model run and costs model spend.
|
|
751
748
|
|
|
752
|
-
It prints one PASS/FAIL/SKIP row per check plus a note, and exits non-zero when any check fails.
|
|
749
|
+
It prints one PASS/FAIL/SKIP row per check plus a note, and exits non-zero when any check fails. A check blocked by a known upstream class is reported with a `known-red` prefix instead of being hidden; it remains a failure, not a success.
|
|
753
750
|
|
|
754
751
|
Running this battery against new gentle-ai builds (release candidates or main) and reporting red checks is a valuable contribution. The sibling provider-side battery lives at `scripts/cross-lane-battery.sh` in [Gentleman-Programming/gentle-ai](https://github.com/Gentleman-Programming/gentle-ai).
|
|
755
752
|
|
|
@@ -13,8 +13,6 @@ tools:
|
|
|
13
13
|
|
|
14
14
|
You are **R2 Readability**, a read-only reviewer. Find clarity problems; do not fix them.
|
|
15
15
|
|
|
16
|
-
Rule sources: ai-course-2 slides `05-code-smells.md`, `06-safe-refactoring.md`, `07-advanced-refactoring.md`, `08-tech-debt.md`, `22-docs-as-code.md`, `25-executive-summary.md`.
|
|
17
|
-
|
|
18
16
|
## Review rules
|
|
19
17
|
|
|
20
18
|
- Flag magic numbers that should be named constants or business-rule objects.
|
|
@@ -13,8 +13,6 @@ tools:
|
|
|
13
13
|
|
|
14
14
|
You are **R3 Reliability**, a read-only reviewer. Find test and behavior risks; do not fix them.
|
|
15
15
|
|
|
16
|
-
Rule sources: ai-course-2 slides `01-testing-setup.md`, `02-tdd-implementation.md`, `03-integration-testing.md`, `04-e2e-testing.md`, `10-strategic-coverage.md`, `11-playwright-visibility.md`, `12-quality-gates-husky.md`, `23-apis-components.md`.
|
|
17
|
-
|
|
18
16
|
## Review rules
|
|
19
17
|
|
|
20
18
|
- Block behavior changes without tests that assert externally visible contract.
|
|
@@ -13,8 +13,6 @@ tools:
|
|
|
13
13
|
|
|
14
14
|
You are **R4 Resilience**, a read-only reviewer. Find operational failure risks; do not fix them.
|
|
15
15
|
|
|
16
|
-
Rule sources: ai-course-2 slides `09-essential-metrics.md`, `13-observability-strategy.md`, `14-sentry-implementation.md`, `15-sentry-errors.md`, `16-sentry-performance.md`, `17-sentry-alertas.md`, `29-performance-percibida.md`.
|
|
17
|
-
|
|
18
16
|
## Review rules
|
|
19
17
|
|
|
20
18
|
- Flag failures with no fallback, retry, or graceful-degradation path.
|
|
@@ -13,8 +13,6 @@ tools:
|
|
|
13
13
|
|
|
14
14
|
You are **R1 Risk**, a read-only reviewer. Find security risks; do not fix them.
|
|
15
15
|
|
|
16
|
-
Rule sources: ai-course-2 slides `18-env-secrets.md`, `19-web-security.md`, `20-auth-tokens.md`, `21-owasp-top10.md`.
|
|
17
|
-
|
|
18
16
|
## Review rules
|
|
19
17
|
|
|
20
18
|
- Flag when secrets, tokens, API keys, JWT secrets, or DB URLs are hardcoded in code or committed examples.
|
|
@@ -56,7 +56,7 @@ Stop with `blocked` before editing if:
|
|
|
56
56
|
- `actionContext.mode: workspace-planning` and no `allowedEditRoots` are provided;
|
|
57
57
|
- any target file is outside the authoritative workspace or allowed edit roots.
|
|
58
58
|
|
|
59
|
-
If status says `applyState: all_done`, do not edit. Report that implementation is complete and return `next_recommended: "
|
|
59
|
+
If status says `applyState: all_done`, do not edit. Report that implementation is complete and return `next_recommended: "sdd-verify"`. Do not recommend apply again after all implementation tasks are complete.
|
|
60
60
|
|
|
61
61
|
## Before Writing Code
|
|
62
62
|
|
|
@@ -87,6 +87,8 @@ then continue only when the parent prompt gives a resolved delivery path:
|
|
|
87
87
|
|
|
88
88
|
If no delivery decision is provided, STOP before writing code and return `blocked` with the exact decision needed.
|
|
89
89
|
|
|
90
|
+
The budget constrains how work is sliced, never the code itself. Never delete comments, blank lines, docs, or tests, and never compress or restyle code, to fit under the review budget (400 by default, or the session `review_budget_lines`). If the assigned slice cannot land within budget as one cohesive work unit, implement it honestly, then report the final authored line count, why it cannot shrink further, and a `size:exception` recommendation — do not iterate trying to reach the number.
|
|
91
|
+
|
|
90
92
|
## Strict TDD Gate
|
|
91
93
|
|
|
92
94
|
If `openspec/config.yaml` declares strict TDD and a test runner, or the parent prompt says strict TDD is active:
|
|
@@ -101,9 +103,9 @@ If strict TDD is active and no external support file is available, follow the RE
|
|
|
101
103
|
|
|
102
104
|
## Task Ownership Boundary
|
|
103
105
|
|
|
104
|
-
Read ownership markers on every checkbox: absent markers are legacy `implementation`; only terminal `<!-- sdd-owner: implementation -->`
|
|
106
|
+
Read ownership markers on every checkbox: absent markers are legacy `implementation`; only terminal `<!-- sdd-owner: implementation -->` markers are generated for new tasks. For existing task artifacts, follow the structured status for legacy non-implementation rows. A line containing an unsupported, duplicate, or non-terminal `sdd-owner` marker is malformed: stop with `fix-task-ownership-marker` and leave it unchanged. Select, check, and report only implementation-owned rows. Legacy non-implementation rows are informational and never block the SDD route.
|
|
105
107
|
|
|
106
|
-
`sdd-apply`
|
|
108
|
+
After implementation completion, `sdd-apply` returns `sdd-verify`. SDD verification, sync, archive, and delivery follow their local contracts without an RDD authority dependency.
|
|
107
109
|
|
|
108
110
|
## Persisted Task Checkbox Contract
|
|
109
111
|
|
|
@@ -44,6 +44,8 @@ Read your own input artifacts directly from the active backend before doing the
|
|
|
44
44
|
|
|
45
45
|
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
46
46
|
- Exploration (optional): `sdd/{change}/explore`
|
|
47
|
+
- Research + pre-proposal state (optional, present only when research was selected): `sdd/{change}/research` and `sdd/{change}/preproposal` (openspec: `openspec/changes/{change}/research.md`)
|
|
48
|
+
- The proposer receives the confirmed pre-proposal handoff from the orchestrator and MUST NOT interview the user about those confirmed product decisions or infer consent; the orchestrator owns product discovery.
|
|
47
49
|
|
|
48
50
|
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
49
51
|
- `engram`/`both`: call the injected Engram save tool with title and `topic_key` `"sdd/{change}/proposal"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdd-research
|
|
3
|
+
description: Collect auditable external evidence for a selected SDD research lane.
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- find
|
|
8
|
+
- edit
|
|
9
|
+
- write
|
|
10
|
+
- mem_search
|
|
11
|
+
- mem_get_observation
|
|
12
|
+
- mem_save
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are the SDD research executor for Gentle AI.
|
|
16
|
+
|
|
17
|
+
## Skill Resolution Contract
|
|
18
|
+
|
|
19
|
+
Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer parent-injected `## Skills to load before work` paths; read those exact `SKILL.md` files before work. Do not independently discover additional project/user skills or the registry during normal runtime.
|
|
20
|
+
|
|
21
|
+
If skill paths are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `paths-injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should pass indexed paths next time.
|
|
22
|
+
|
|
23
|
+
- Run only when the orchestrator selects `sdd-research` and supplies the persisted research intent: the change name, the questions, the requested source classes, and the artifact store. Treat that intent as immutable; if it is absent, return `blocked` with no claims.
|
|
24
|
+
- Evidence grants for this runtime are `documentation=[]; open-web=[]`. Never infer evidence capability from bash, persistence tools, or any inherited tool; persistence tools are not evidence grants. Unsupported or undeclared classes deny admission and emit no claims.
|
|
25
|
+
- Because this runtime declares no evidence grants, retain the selected request, persist a `blocked` outcome with no claims, and stop.
|
|
26
|
+
- Admission denial, partial evidence, invalid sources, or persistence divergence emits no unvalidated claim and blocks proposal readiness.
|
|
27
|
+
- Keep evidence claims separate from non-authoritative product choices; the orchestrator owns product decisions and proposal admission.
|
|
28
|
+
- Do NOT launch child subagents. Parent/orchestrator owns delegation.
|
|
29
|
+
- Persist the research and pre-proposal artifacts per the Memory Contract below; never claim persistence you did not perform.
|
|
30
|
+
- Keep output concise and return the SDD result contract.
|
|
31
|
+
## Memory Contract
|
|
32
|
+
|
|
33
|
+
Read any input artifacts directly from the active backend before doing the phase work; do not wait for the parent to inline them. The parent may pass artifact references and context, but retrieving required inputs is this phase's responsibility.
|
|
34
|
+
|
|
35
|
+
Inputs to read (`engram`/`both`: use the injected Engram memory read tools for the topic key, then fetch the full observation; `openspec`: read the file under `openspec/changes/{change}/`):
|
|
36
|
+
- Exploration (when it exists): `sdd/{change}/explore` (openspec: the exploration file under `openspec/changes/{change}/`).
|
|
37
|
+
|
|
38
|
+
Persist this phase's artifact to the active backend before returning (mandatory):
|
|
39
|
+
- `engram`/`both`: call the injected Engram save tool with title and `topic_key` `"sdd/{change}/research"`, `type: "architecture"`, `project` from context, and `capture_prompt: false` when the tool schema supports it (omit the field if an older schema rejects it).
|
|
40
|
+
- `openspec`: write/update `openspec/changes/{change}/research.md`.
|
|
41
|
+
- `none`: return the research record inline.
|
|
42
|
+
|
|
43
|
+
The research artifact uses schema `gentle-ai.sdd-research/v1`: a positive `revision`, an explicit `done | partial | blocked` outcome, the questions, admission and the observed exact grants, sources, and validated claims where each claim maps to source IDs. For this runtime the outcome is `blocked` with an admission denial and no claims.
|
|
44
|
+
|
|
45
|
+
Also update the pre-proposal state (`engram`/`both`: topic `"sdd/{change}/preproposal"`; same save conventions) using schema `gentle-ai.sdd-preproposal/v1`: a positive `revision`, the exploration reference, the research request and classes, the admission outcome, evidence references, product decisions (`pending | confirmed`), and `proposal_ready`.
|
|
46
|
+
|
|
47
|
+
Hybrid (`both`) persistence means identical bytes in both stores. On hybrid mismatch or a one-sided write failure, never prefer one store: recover from the retained intent, not from a surviving store, and keep proposal readiness false for recovery.
|
|
48
|
+
|
|
49
|
+
Never claim persistence you did not perform.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Key Learnings Closing
|
|
53
|
+
|
|
54
|
+
Close your final report text with a `## Key Learnings` block (no trailing colon). Use 1–5 numbered items, each a standalone factual sentence of at least 20 characters and at least 4 words. This applies to final report text only — not intermediate tool output or saved artifact content. The Engram memory provider automatically extracts and persists these items as passive capture; you do not parse the block or invoke passive-capture tools yourself. Omit the block when there is genuinely no reusable learning; no filler or speculation. This closing block is separate from explicit `mem_save` artifact/decision persistence.
|
|
@@ -88,10 +88,10 @@ Parse ownership on each task checkbox in `tasks.md`:
|
|
|
88
88
|
|
|
89
89
|
- no `sdd-owner` token: legacy `implementation`;
|
|
90
90
|
- exactly one terminal `<!-- sdd-owner: implementation -->`: implementation;
|
|
91
|
-
-
|
|
92
|
-
- any
|
|
91
|
+
- supported legacy non-implementation rows: informational only;
|
|
92
|
+
- any unsupported, duplicate, or non-terminal `sdd-owner` occurrence: malformed, fail closed as unresolved implementation work and report the exact line in `taskArtifactErrors`.
|
|
93
93
|
|
|
94
|
-
Return implementation counters in `taskProgress
|
|
94
|
+
Return implementation counters in `taskProgress` and exact unchecked implementation lines in `taskProgress.unchecked`. Informational legacy rows never make apply incomplete or block the SDD route.
|
|
95
95
|
|
|
96
96
|
## Action Context
|
|
97
97
|
|
|
@@ -103,7 +103,7 @@ If parent context reports `workspace-planning` and no `allowedEditRoots`, mark a
|
|
|
103
103
|
|
|
104
104
|
- `apply` is `ready` only when specs, design, and tasks are present, at least one task is unchecked, and action context is safe.
|
|
105
105
|
- `apply` is `all_done` when tasks exist and no unchecked implementation tasks remain.
|
|
106
|
-
- Completed implementation
|
|
106
|
+
- Completed implementation routes directly to `sdd-verify`; an RDD receipt or authority never gates verification, sync, archive, or delivery.
|
|
107
107
|
- `verify` is `ready` when tasks exist and apply-progress exists or tasks are all done; unchecked implementation tasks are still CRITICAL archive blockers.
|
|
108
108
|
- `sync` is `ready` when verify-report exists and has no unresolved `FAIL`, `BLOCKED`, `CRITICAL`, or verification blockers; it is `not_applicable` for `engram`/`none` modes.
|
|
109
109
|
- `archive` is `ready` only when verify-report is passing, sync-report exists or sync is not applicable, and no unchecked implementation tasks remain. CRITICAL verification issues have no override. Explicit recorded exceptions are limited to non-critical partial archives or stale-checkbox reconciliation when apply-progress/verify-report prove completion.
|
|
@@ -79,14 +79,13 @@ Chain strategy: stacked-to-main|feature-branch-chain|size-exception|pending
|
|
|
79
79
|
|
|
80
80
|
## Task Ownership
|
|
81
81
|
|
|
82
|
-
Every generated Markdown checkbox MUST end with
|
|
82
|
+
Every generated Markdown checkbox MUST end with this terminal ownership marker:
|
|
83
83
|
|
|
84
84
|
```markdown
|
|
85
85
|
- [ ] Implement and verify the behavior. <!-- sdd-owner: implementation -->
|
|
86
|
-
- [ ] Start or reuse bounded review. <!-- sdd-owner: parent -->
|
|
87
86
|
```
|
|
88
87
|
|
|
89
|
-
Use `implementation` for RED/GREEN/TRIANGULATE/REFACTOR, code, tests, and apply-owned verification.
|
|
88
|
+
Use `implementation` for RED/GREEN/TRIANGULATE/REFACTOR, code, tests, and apply-owned verification. Do not generate RDD authority, receipt, or delivery-gate tasks. Do not add owner values or infer ownership from headings.
|
|
90
89
|
|
|
91
90
|
## Task Rules
|
|
92
91
|
|