gentle-pi 1.0.3 → 1.0.5
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 +77 -8
- package/assets/migrations/managed-assets-v0.10.7.json +7 -0
- package/extensions/gentle-ai.ts +669 -111
- package/lib/gentle-ai-binary.ts +2 -1
- package/lib/native-review-authority-quarantine.ts +2 -0
- package/lib/native-review-cli.ts +317 -39
- package/lib/native-review-remediation.ts +49 -0
- package/lib/review-candidate-view.ts +252 -23
- package/lib/review-compact-contract.ts +76 -0
- package/lib/review-reset.ts +4 -1
- package/lib/review-transaction.ts +82 -12
- package/lib/sdd-preflight.ts +9 -5
- package/package.json +1 -1
- package/scripts/gentle-ai-installer.mjs +17 -11
- package/scripts/verify-package-files.mjs +1 -0
- package/tests/fixtures/v0.10.7/assets/agents/sdd-apply.md +132 -0
- package/tests/gentle-ai-binary.test.ts +20 -10
- package/tests/gentle-ai-installer.test.ts +48 -16
- package/tests/native-review-authority-quarantine.test.ts +10 -0
- package/tests/native-review-cli.test.ts +257 -11
- package/tests/native-review-parity-runtime.test.ts +4 -4
- package/tests/package-manifest.test.ts +2 -2
- package/tests/review-candidate-view.test.ts +260 -6
- package/tests/review-controller-native-routing.test.ts +933 -35
- package/tests/review-controller.test.ts +253 -12
- package/tests/review-gate.test.ts +53 -4
- package/tests/review-ledger-contract.test.ts +1 -1
- package/tests/sdd-preflight.test.ts +78 -0
package/README.md
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
**Turn Pi from a powerful coding agent into a controlled development harness.**
|
|
15
15
|
|
|
16
|
-
`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,
|
|
16
|
+
`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
17
|
|
|
18
|
-
Pi already has strong tools. `gentle-pi` adds the discipline for using them well.
|
|
18
|
+
Pi already has strong tools. `gentle-pi` adds the discipline for using them well, then binds review and delivery decisions to Git-derived evidence instead of agent narration.
|
|
19
19
|
|
|
20
20
|
`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
21
|
|
|
@@ -57,6 +57,8 @@ Most coding-agent sessions fail for operational reasons, not model reasons:
|
|
|
57
57
|
| **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
58
|
| **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
59
|
| **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, and reuses the same content-bound receipt at delivery gates. |
|
|
61
|
+
| **Verified native runtime** | Provisions the exact package-local Gentle AI v2.1.5 binary, verifies pinned archive/binary integrity, and rejects PATH, global, sibling, symlink, and mode fallbacks. |
|
|
60
62
|
| **Runtime safety** | Blocks destructive shell commands, asks for confirmation for sensitive operations, and blocks direct read/write/edit access to sensitive paths. |
|
|
61
63
|
|
|
62
64
|
## Install
|
|
@@ -65,7 +67,7 @@ Most coding-agent sessions fail for operational reasons, not model reasons:
|
|
|
65
67
|
pi install npm:gentle-pi
|
|
66
68
|
```
|
|
67
69
|
|
|
68
|
-
The npm postinstall downloads the exact platform-specific official Gentle AI v2.1.
|
|
70
|
+
The npm postinstall downloads the exact platform-specific official Gentle AI v2.1.5 archive into this package's private `.gentle-ai/v2.1.5/` directory and verifies its pinned SHA-256 before extraction. 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.
|
|
69
71
|
|
|
70
72
|
Recommended companion packages:
|
|
71
73
|
|
|
@@ -107,6 +109,16 @@ Typical flow:
|
|
|
107
109
|
4. For a substantial change, ask Pi to use SDD. Natural-language requests are classified by the parent agent, not by brittle runtime regexes.
|
|
108
110
|
5. Review the phase artifacts instead of trusting floating chat context.
|
|
109
111
|
|
|
112
|
+
## Core workflow
|
|
113
|
+
|
|
114
|
+
1. **Install and inspect.** Install `gentle-pi`, open Pi in the target repository, then run `/gentle:status` or `/gentle:doctor`.
|
|
115
|
+
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.
|
|
116
|
+
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.
|
|
117
|
+
4. **Review one candidate.** Native START derives and freezes the Git candidate, risk tier, selected lenses, authored-line budget, and correction allowance. Review actors assess that immutable view; they do not grant authority.
|
|
118
|
+
5. **Deliver the same candidate.** FINALIZE records native authority and an approved receipt. Commit, push, PR, and release gates validate that same receipt and live Git target with zero review actors; they never silently reopen review or reset its budget.
|
|
119
|
+
|
|
120
|
+
> **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, receipts, and lifecycle gates. This protects against accidental scope and identity drift, not a malicious same-user process that can replace local code or authority. 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).
|
|
121
|
+
|
|
110
122
|
## How the harness decides what to do
|
|
111
123
|
|
|
112
124
|
`gentle-pi` routes through the smallest safe workflow:
|
|
@@ -128,7 +140,7 @@ The goal is not ceremony. The goal is to avoid accidental chaos. Once a task sto
|
|
|
128
140
|
| Reading 4+ files to understand a flow | Launch `scout`, `context-builder`, or the closest read-only mapping subagent. |
|
|
129
141
|
| Touching 2+ non-trivial code files | Delegate one writer; do not continue inline unless delegation is unavailable. |
|
|
130
142
|
| Commit, push, or PR after code changes | Validate the approved receipt and exact typed target with zero actors. |
|
|
131
|
-
| Wrong cwd, worktree/git accident, merge recovery, confusing test/env issue | Stop and
|
|
143
|
+
| Wrong cwd, worktree/git accident, merge recovery, confusing test/env issue | Stop, preserve the frozen scope, investigate separately, and validate the existing receipt; never launch a fresh review lens or reopen review as incident handling. |
|
|
132
144
|
| 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. |
|
|
133
145
|
|
|
134
146
|
The intended balanced loop for a bounded bugfix is:
|
|
@@ -161,13 +173,66 @@ Pre-commit, pre-push, pre-PR, and release gates revalidate the recovered source,
|
|
|
161
173
|
| Security, permissions, data exposure/loss, architecture, dependencies | `review-risk` |
|
|
162
174
|
| Large PR, hot path, or >400 changed lines | Full 4R: `review-risk`, `review-resilience`, `review-readability`, `review-reliability` |
|
|
163
175
|
|
|
164
|
-
|
|
176
|
+
Risk selection is deterministic: documentation/comment/formatting-only changes use zero lenses; every other standard change uses exactly one dominant-risk lens; security/auth/update/payment paths, data-loss or exposure risk, shell/process integration, or more than 400 authored changed lines use the full 4R set. A standard review never accumulates multiple lenses ad hoc.
|
|
165
177
|
|
|
166
178
|
### Bounded review transactions
|
|
167
179
|
|
|
168
|
-
New ordinary review uses compact `gentle_review` `start -> finalize -> validate`.
|
|
180
|
+
New ordinary review uses compact `gentle_review` `start -> finalize -> validate`. This diagram shows the complete development-to-delivery path, including every ordinary review state and the fail-closed branches.
|
|
181
|
+
|
|
182
|
+
```mermaid
|
|
183
|
+
flowchart TD
|
|
184
|
+
A["Clarify scope and acceptance criteria"] --> B{"Choose the smallest safe workflow"}
|
|
185
|
+
B -->|Small and local| C["Inline implementation"]
|
|
186
|
+
B -->|Context-heavy or multi-file| D["Focused subagent"]
|
|
187
|
+
B -->|Large or architectural| E["SDD phase artifacts"]
|
|
188
|
+
C --> F["Implement with test evidence"]
|
|
189
|
+
D --> F
|
|
190
|
+
E --> F
|
|
191
|
+
F --> G["Independent verification"]
|
|
192
|
+
G --> H["INSPECT authority"]
|
|
193
|
+
H -->|Applicable invalid authority| X["Blocked: explicit recovery required"]
|
|
194
|
+
H -->|Clean or unrelated history| I["START freezes candidate, scope, tier, lenses, and budget"]
|
|
195
|
+
|
|
196
|
+
subgraph Ordinary_review["Ordinary bounded review"]
|
|
197
|
+
I --> R["reviewing"]
|
|
198
|
+
R --> J["Run each selected lens once"]
|
|
199
|
+
J --> K{"Severe candidate-caused blocker?"}
|
|
200
|
+
K -->|No| A1["approved"]
|
|
201
|
+
K -->|Yes| C1["correction_required"]
|
|
202
|
+
C1 --> C2["Forecast bounded correction"]
|
|
203
|
+
C2 --> C3["Apply scoped fix"]
|
|
204
|
+
C3 --> V["validating"]
|
|
205
|
+
V -->|Validator passes| A1
|
|
206
|
+
V -->|Fails; attempt and budget remain| C1
|
|
207
|
+
V -->|Malformed, out of scope, or exhausted| E1["escalated"]
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
A1 --> P["Receipt binds the exact candidate tree"]
|
|
211
|
+
P --> PC["Stage reviewed paths"]
|
|
212
|
+
PC --> G1{"pre-commit validate"}
|
|
213
|
+
G1 -->|allow| CM["Commit"]
|
|
214
|
+
G1 -->|scope changed| N["Start a new lineage"]
|
|
215
|
+
G1 -->|invalidated or escalated| X
|
|
216
|
+
CM --> G2{"pre-push validate"}
|
|
217
|
+
G2 -->|allow| PS["Push"]
|
|
218
|
+
G2 -->|deny| X
|
|
219
|
+
PS --> CI["Required CI on exact remote SHA"]
|
|
220
|
+
CI -->|success| RL{"Release gate"}
|
|
221
|
+
CI -->|pending or failed| X
|
|
222
|
+
RL -->|Exact patch tag on protected main; no fresh risk evidence| FP["Zero-actor release fast path"]
|
|
223
|
+
RL -->|Receipt-bound release evidence| RV["Native receipt validation"]
|
|
224
|
+
RL -->|Major, post-incident, stale, or unprovable| X
|
|
225
|
+
FP --> PUB["Publish release"]
|
|
226
|
+
RV -->|allow| PUB
|
|
227
|
+
RV -->|deny| X
|
|
228
|
+
N --> H
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Lifecycle gates never launch review actors. They rederive Git and publication targets, validate the existing receipt, and authorize one exact command. Any target drift, stale evidence, malformed authority, or unprovable state blocks delivery instead of silently reopening review.
|
|
232
|
+
|
|
233
|
+
Native contract pairing is exact: this adapter supports `gentle-ai 2.1.5` only from its package-local verified binary and rechecks that version before every native operation. Production native operations resolve an absolute package-owned path and never fall back to `PATH` or a global executable. Once v2.1.5 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.
|
|
169
234
|
|
|
170
|
-
|
|
235
|
+
Gentle AI v2.1.5 supports `gentle-ai review start --projection staged`, and upstream `main` now documents that focused-index workflow. The current `gentle-pi` adapter intentionally submits `projection: "workspace"` and does not expose staged projection yet. Native binary capability is not automatically a Pi adapter contract; package support still requires an adapter update, parity fixtures, and bounded validation.
|
|
171
236
|
|
|
172
237
|
### FINALIZE wrapper input
|
|
173
238
|
|
|
@@ -558,7 +623,11 @@ Memory contract for SDD delegation:
|
|
|
558
623
|
|
|
559
624
|
| Path | Purpose |
|
|
560
625
|
| ------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
561
|
-
| `extensions/gentle-ai.ts` | Injects identity,
|
|
626
|
+
| `extensions/gentle-ai.ts` | Injects identity, orchestrates native review authority and lifecycle gates, refreshes global SDD assets, registers commands, applies model/persona config, and enforces runtime safety. |
|
|
627
|
+
| `lib/native-review-cli.ts` | Strict package-local adapter for Gentle AI START, FINALIZE, VALIDATE, SDD binding, and status contracts. |
|
|
628
|
+
| `lib/review-candidate-view.ts` | Builds immutable changed-scope actor views while preserving full-tree, path, mode, symlink, and index integrity. |
|
|
629
|
+
| `lib/gentle-ai-binary.ts` | Resolves and verifies the confined package-local Gentle AI runtime without global or PATH fallback. |
|
|
630
|
+
| `scripts/gentle-ai-installer.mjs` | Downloads, verifies, extracts, and atomically promotes the pinned native runtime for six platform targets. |
|
|
562
631
|
| `extensions/startup-banner.ts` | Shows and configures the startup intro, color presets, compact runtime panel, and collaboration credit. |
|
|
563
632
|
| `extensions/sdd-init.ts` | Registers `/sdd-init` for OpenSpec initialization. |
|
|
564
633
|
| `extensions/skill-registry.ts` | Maintains `.atl/skill-registry.md` from project/user skills and closes file watchers on shutdown. |
|