gentle-pi 1.0.6 → 1.2.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.
Files changed (104) hide show
  1. package/README.md +44 -22
  2. package/assets/agents/jd-judge-a.md +1 -0
  3. package/assets/agents/jd-judge-b.md +1 -0
  4. package/assets/agents/review-readability.md +1 -0
  5. package/assets/agents/review-refuter.md +1 -0
  6. package/assets/agents/review-reliability.md +1 -0
  7. package/assets/agents/review-resilience.md +1 -0
  8. package/assets/agents/review-risk.md +1 -0
  9. package/assets/agents/review-validator.md +1 -0
  10. package/assets/orchestrator-delegation.md +11 -9
  11. package/assets/orchestrator.md +4 -4
  12. package/contracts/review-integration/v1/fixtures/capabilities-v1.1.fixture.json +239 -0
  13. package/contracts/review-integration/v1/fixtures/capabilities.fixture.json +186 -0
  14. package/contracts/review-integration/v1/fixtures/failure.fixture.json +47 -0
  15. package/contracts/review-integration/v1/fixtures/operation.fixture.json +61 -0
  16. package/contracts/review-integration/v1/fixtures/start.fixture.json +27 -0
  17. package/contracts/review-integration/v1/fixtures/status-ambiguous.fixture.json +79 -0
  18. package/contracts/review-integration/v1/fixtures/status-corrupted.fixture.json +76 -0
  19. package/contracts/review-integration/v1/fixtures/status-recover.fixture.json +99 -0
  20. package/contracts/review-integration/v1/fixtures/status-unrelated.fixture.json +72 -0
  21. package/contracts/review-integration/v1/fixtures/status.fixture.json +123 -0
  22. package/contracts/review-integration/v1/schemas/capabilities-v1.1.schema.json +245 -0
  23. package/contracts/review-integration/v1/schemas/capabilities.schema.json +221 -0
  24. package/contracts/review-integration/v1/schemas/failure.schema.json +117 -0
  25. package/contracts/review-integration/v1/schemas/operation.schema.json +67 -0
  26. package/contracts/review-integration/v1/schemas/projection.schema.json +44 -0
  27. package/contracts/review-integration/v1/schemas/result-artifact.schema.json +12 -0
  28. package/contracts/review-integration/v1/schemas/start.schema.json +102 -0
  29. package/contracts/review-integration/v1/schemas/status.schema.json +237 -0
  30. package/docs/native-authority-architecture.md +108 -0
  31. package/docs/review-integration.md +223 -0
  32. package/extensions/gentle-ai.ts +741 -949
  33. package/lib/gentle-ai-binary.ts +1 -1
  34. package/lib/git-commit-transaction.ts +801 -0
  35. package/lib/native-review-cli.ts +699 -15
  36. package/lib/review-candidate-view.ts +138 -19
  37. package/lib/review-compact-contract.ts +10 -1
  38. package/lib/review-integration-v1.ts +795 -0
  39. package/lib/review-lock.ts +15 -1
  40. package/lib/review-object-store.ts +2 -2
  41. package/lib/review-publication-gate.ts +513 -0
  42. package/lib/review-repository.ts +23 -23
  43. package/lib/review-snapshot.ts +0 -59
  44. package/lib/review-transaction.ts +40 -833
  45. package/package.json +7 -2
  46. package/runtime/gentle-ai-binary.mjs +91 -0
  47. package/runtime/git-commit-transaction.mjs +802 -0
  48. package/runtime/native-review-cli.mjs +1511 -0
  49. package/runtime/review-integration-v1.mjs +796 -0
  50. package/scripts/build-git-commit-transaction-runner.mjs +66 -0
  51. package/scripts/gentle-ai-installer.mjs +16 -8
  52. package/scripts/install-gentle-ai.mjs +2 -2
  53. package/scripts/measure-native-authority-slimming.mjs +111 -0
  54. package/scripts/run-git-commit-transaction.mjs +35 -0
  55. package/scripts/test-packed-runner.mjs +66 -0
  56. package/scripts/verify-package-files.mjs +81 -2
  57. package/skills/_shared/review-ledger-contract.md +10 -10
  58. package/skills/gentle-ai/SKILL.md +11 -9
  59. package/tests/gentle-ai-binary.test.ts +25 -18
  60. package/tests/gentle-ai-installer.test.ts +44 -19
  61. package/tests/gentle-ai.test.ts +1 -1
  62. package/tests/git-commit-transaction.test.ts +302 -0
  63. package/tests/native-review-cli.test.ts +76 -7
  64. package/tests/native-review-integration-v1.test.ts +102 -0
  65. package/tests/native-review-parity-runtime.test.ts +36 -11
  66. package/tests/package-manifest.test.ts +56 -5
  67. package/tests/review-actor-tool-deny.test.ts +130 -0
  68. package/tests/review-authority-recovery-docs.test.ts +16 -11
  69. package/tests/review-candidate-view.test.ts +61 -0
  70. package/tests/review-compact-contract.test.ts +53 -0
  71. package/tests/review-controller-lock-status.test.ts +145 -0
  72. package/tests/review-controller-native-recovery.test.ts +786 -0
  73. package/tests/review-controller-native-routing.test.ts +780 -476
  74. package/tests/review-controller-retired-ops.test.ts +54 -0
  75. package/tests/review-controller-workspace-root.test.ts +311 -0
  76. package/tests/review-controller.test.ts +22 -796
  77. package/tests/review-gate.test.ts +16 -7
  78. package/tests/review-integration-v1.test.ts +530 -0
  79. package/tests/review-ledger-contract.test.ts +19 -13
  80. package/tests/review-lock.test.ts +52 -2
  81. package/tests/review-repository.test.ts +15 -1
  82. package/tests/review-snapshot.test.ts +2 -15
  83. package/tests/review-transaction.test.ts +27 -51
  84. package/tests/runtime-harness.mjs +11 -6
  85. package/tests/sdd-agent-tools.test.ts +3 -1
  86. package/lib/review-authority-supersession.ts +0 -1055
  87. package/lib/review-bundle.ts +0 -286
  88. package/lib/review-checkpoint.ts +0 -127
  89. package/lib/review-compact-gate.ts +0 -219
  90. package/lib/review-compact-store.ts +0 -722
  91. package/lib/review-facade.ts +0 -508
  92. package/lib/review-graph-reducer.ts +0 -55
  93. package/lib/review-mirror.ts +0 -46
  94. package/lib/review-reset.ts +0 -261
  95. package/tests/review-authority-supersession.test.ts +0 -581
  96. package/tests/review-bundle.test.ts +0 -253
  97. package/tests/review-checkpoint.test.ts +0 -61
  98. package/tests/review-compact-gate.test.ts +0 -376
  99. package/tests/review-compact-store.test.ts +0 -124
  100. package/tests/review-facade.test.ts +0 -382
  101. package/tests/review-graph.test.ts +0 -27
  102. package/tests/review-mirror.test.ts +0 -20
  103. package/tests/review-reset.test.ts +0 -456
  104. package/tests/review-runtime-contract.test.ts +0 -70
package/README.md CHANGED
@@ -58,7 +58,7 @@ Most coding-agent sessions fail for operational reasons, not model reasons:
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
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. |
61
+ | **Verified native runtime** | Provisions the exact package-local Gentle AI v2.1.11 binary, verifies pinned archive/binary integrity, negotiates `review-integration/v1`, and rejects PATH, global, sibling, symlink, and mode fallbacks. |
62
62
  | **Runtime safety** | Blocks destructive shell commands, asks for confirmation for sensitive operations, and blocks direct read/write/edit access to sensitive paths. |
63
63
 
64
64
  ## Install
@@ -67,7 +67,7 @@ Most coding-agent sessions fail for operational reasons, not model reasons:
67
67
  pi install npm:gentle-pi
68
68
  ```
69
69
 
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.
70
+ The npm postinstall downloads the exact platform-specific official Gentle AI v2.1.11 archive into this package's private `.gentle-ai/v2.1.11/` directory and verifies its pinned archive and executable SHA-256 values 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.
71
71
 
72
72
  Recommended companion packages:
73
73
 
@@ -99,6 +99,8 @@ pi
99
99
  /gentle:models Assign global model/effort routing to SDD/custom agents.
100
100
  /gentle:persona Switch between gentleman and neutral persona modes.
101
101
  /gentle:banner Configure startup rose, text logo, and color preset.
102
+ /gentle:commit-status Inspect an unresolved durable commit transaction.
103
+ /gentle:commit-abort Abandon safe recovery state without changing HEAD or the index.
102
104
  ```
103
105
 
104
106
  Typical flow:
@@ -155,13 +157,21 @@ Review actors are dispatched only through parent `subagent_run` calls in `mode:
155
157
 
156
158
  ### Review authority recovery and reset safety
157
159
 
158
- Legacy pre-graph authority is never migrated. `gentle_review inspect` reports an exact repository-bound destructive reset challenge; only that authorized RESET or RECOVER can quarantine graph-v1 and compact-v2 authority, initialize an empty graph-v1 incarnation, and require fresh review. Interrupted destructive recovery remains blocked until explicit forward recovery. Existing graph-v1 ordinary lineages remain readable, gate-validatable, and exportable but are read-only; Judgment Day remains mutable on graph-v1.
160
+ Legacy pre-graph authority is never migrated. `gentle_review inspect` reports an exact repository-bound destructive reset challenge for legacy corruption; after that fresh interactive authorization, RESET and RECOVER_LOCK route to the audited native `gentle-ai review reclaim` operation and RECOVER routes to native `gentle-ai review recover`, so every destructive transition is executed and audited by the native authority store. Native inputs the request did not carry return a `native-input-required` envelope instead of being invented. Existing graph-v1 ordinary lineages remain readable and gate-validatable but are read-only; Judgment Day remains mutable on graph-v1.
159
161
 
160
- A **non-destructive supersession** is available only for an eligible, immutable graph-v1 source and an independently approved compact-v2 successor with identical repository, change, target, scope, untracked, policy, ledger, and receipt bindings. First call `prepare-supersession`, review its exact English challenge, then call `supersede` only after fresh interactive approval. Headless approval, a changed challenge, a stale binding, unsupported data, or ambiguous authority fails closed and leaves the change `resolve-review` blocked.
162
+ `gentle_review abandon`, `quarantine-legacy`, and `reconcile-authority` remain explicit v2.1.11 maintenance routes. Pi derives and displays the published six-line abandon binding only for a caller-specified compact lineage, revision, and snapshot identity; the native CLI re-derives pristine compact-v2 eligibility. Legacy quarantine accepts only `historical findings freeze changed unrelated transaction state` with disposition `quarantine-malformed-freeze-event` and uses its exact eight-line binding. Both require fresh interactive approval and fail closed headlessly.
161
163
 
162
- Supersession records are append-only under `authority-supersession-v1`; they do not rewrite graph-v1 history. An exact retry is idempotent. A divergent retry or conflict fails closed and requires a new operation. RESET/RECOVER stay destructive and never run as a fallback from supersession. Rollback can stop recognizing a record but does not delete it, re-enable graph-v1 mutation, or select another successor.
164
+ `gentle_review reconcile-authority` accepts one predecessor lineage and revision, one successor lineage and revision, an actor, and a reason. Pi derives the exact seven-line `gentle-ai.review-reconcile-authorization/v1` binding, or appends exactly `anomalies=unchanged_target,malformed_recovery_authorization` for the published dual anomaly in that order. Native code re-derives every anomaly; malformed bindings, changed revisions, unavailable native support, cancellation, and native refusal fail closed through typed envelopes.
163
165
 
164
- Pre-commit, pre-push, pre-PR, and release gates revalidate the recovered source, successor, receipt, policy, scope, intended-untracked proof, and live target. Recovery does not grant a new budget or bypass dangerous-command authorization, publication checks, historical graph-v1 receipt validation, or graph export.
166
+ Reconciliation is intentionally narrow: native code may quarantine only the bound invalid compact-v2 recovery successor and persists the returned audit record; the predecessor stays untouched. Pi never recreates the retired `prepare-supersession`/`supersede` authority writer and never falls back to RESET or RECOVER.
167
+
168
+ `gentle_review repair-legacy-alias` is the sole v2.1.11 route for `unsupported historical v1 operation alias`. The model supplies only lineage, actor, and reason. Pi freshly reads the native inventory, derives the canonical repository, exact legacy revision, fixed diagnostic, and fixed `quarantine-approved-historical-alias` disposition, displays the LF-only eight-line binding, and requires a new interactive approval. Native re-derives eligibility and quarantines rather than rewriting or validating the historical chain.
169
+
170
+ `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.
171
+
172
+ Native ordinary gates revalidate provider-selected authority, receipt, scope, intended-untracked proof, and the live target. Pi preserves a graph-v1 gate path only for explicit Judgment Day and historical graph receipt validation. Recovery grants no new budget and cannot bypass dangerous-command or publication checks. Legacy graph bundle export/import is retired.
173
+
174
+ 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.
165
175
 
166
176
  `reviewer` is not an installed subagent name. It is a routing intent. Select the concrete lens by risk profile:
167
177
 
@@ -189,9 +199,9 @@ flowchart TD
189
199
  D --> F
190
200
  E --> F
191
201
  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"]
202
+ G --> H["Target-scoped native status"]
203
+ H -->|Ambiguous or corrupted| X["Blocked: native maintainer action"]
204
+ H -->|Unrelated| I["START freezes candidate, scope, tier, lenses, and budget"]
195
205
 
196
206
  subgraph Ordinary_review["Ordinary bounded review"]
197
207
  I --> R["reviewing"]
@@ -203,16 +213,17 @@ flowchart TD
203
213
  C2 --> C3["Apply scoped fix"]
204
214
  C3 --> V["validating"]
205
215
  V -->|Validator passes| A1
206
- V -->|Fails; attempt and budget remain| C1
207
- V -->|Malformed, out of scope, or exhausted| E1["escalated"]
216
+ V -->|Fails, malformed, or out of scope| E1["escalated"]
208
217
  end
209
218
 
210
219
  A1 --> P["Receipt binds the exact candidate tree"]
211
220
  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
221
+ PC --> G1{"durable commit transaction"}
222
+ G1 --> HK["Run effective pre-commit hook once"]
223
+ HK --> NV{"validate exact post-hook tree"}
224
+ NV -->|allow| CM["Commit through hook proxies and prove HEAD tree"]
225
+ NV -->|scope changed| N["Review post-hook tree; exact retry skips completed hook"]
226
+ NV -->|invalidated or escalated| X
216
227
  CM --> G2{"pre-push validate"}
217
228
  G2 -->|allow| PS["Push"]
218
229
  G2 -->|deny| X
@@ -230,9 +241,13 @@ flowchart TD
230
241
 
231
242
  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
243
 
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.
244
+ Native contract pairing is exact: this adapter resolves only the integrity-verified package-local Gentle AI v2.1.11 executable, independently hashes it, then negotiates `gentle-ai.review-integration/v1` 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. Current protocol 1.0 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.
245
+
246
+ 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.
247
+
248
+ Direct authorized `git commit` commands use a durable recovery record under the Git common directory. The package runs the effective pre-commit hook once, captures the post-hook index, performs final native validation against that tree, suppresses only the already-completed pre-commit hook while preserving message/post hooks through proxies, and proves `HEAD^{tree}` before the tool result succeeds. Any unresolved, interrupted, failed, or mismatched transaction blocks push, PR, and release. Recovery never resets HEAD or the index automatically.
234
249
 
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.
250
+ Once v2.1.11 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.
236
251
 
237
252
  ### FINALIZE wrapper input
238
253
 
@@ -268,13 +283,13 @@ Refuter proof may be independent concrete reproduction evidence; it does not nee
268
283
 
269
284
  When native IDs are assigned to inferential findings, the first FINALIZE returns their canonical rows and a content-derived request hash without mutation; the second replays identical lens input with that hash and one complete refuter batch.
270
285
 
271
- Ordinary permits up to three failed targeted attempts within the original cumulative budget; each attempt is one correction plus one targeted validator. FINALIZE requires a positive forecast before editing and derives actual correction lines from Git. Initial lenses are never rerun, while frozen findings and genesis scope remain unchanged.
286
+ Ordinary permits one correction transaction within the original budget. FINALIZE requires a positive forecast before editing and derives actual correction lines from Git; one targeted validator and final verification close that transaction. Initial lenses are never rerun, while frozen findings and genesis scope remain unchanged.
272
287
 
273
288
  The validator checks original criteria and correction regression only and cannot add scope or findings. Final evidence is hashed during FINALIZE, never at START.
274
289
 
275
290
  Compact ordinary has five states: `reviewing`, `correction_required`, `validating`, `approved`, and `escalated`.
276
291
 
277
- Each validator invocation cannot change claims, add findings, request fixes, launch actors, or request another attempt. Native FINALIZE alone returns `correction_required` while another bounded attempt remains.
292
+ The validator cannot change claims, add findings, request fixes, launch actors, or request another attempt. A failed correction escalates instead of opening another review budget.
278
293
 
279
294
  Compact authority uses content-derived CAS under the Git common directory. Exact retries are idempotent; stale/semantic retries, terminal mutation, and same-lineage graph-v1/compact-v2 ambiguity fail closed.
280
295
 
@@ -290,9 +305,9 @@ Judgment Day alone may iterate discovery and scoped re-judgment, for at most two
290
305
 
291
306
  Findings surviving round two escalate; no third-round transition exists.
292
307
 
293
- Compact gate validation is read-only. It loads authority and receipt, derives the live target, then reloads authority and rederives target/publication evidence immediately before allow.
308
+ Native compact gate validation is read-only. It loads authority and receipt, derives the live target, then reloads authority and rederives target/publication evidence immediately before allow.
294
309
 
295
- 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. 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.
310
+ 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.
296
311
  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.
297
312
 
298
313
  Native SDD readiness is true only for `verify` or `archive` with empty blockers and a published `reviewGate.result: "allow"`; review/resolve-review, missing gate evidence, and every non-allow or stale result remain blocked.
@@ -303,7 +318,7 @@ Dangerous-command safety remains independent and authoritative.
303
318
 
304
319
  SDD completion adds no review or Judgment Day pass.
305
320
 
306
- Review transactions, validation, and SDD perform no commit, push, PR creation, release, or publication.
321
+ Review operations, validation, and SDD perform no push, PR creation, release, or publication. The separate durable commit runner may create exactly one local commit only after final native pre-commit validation and post-commit tree proof.
307
322
 
308
323
  `review-refuter` uses exactly `read`, `grep`, and `find` in a package-managed isolated installation. Project and user overrides may shadow the package asset; `gentle-pi` preserves those definitions and does not claim their effective permissions are package-compliant.
309
324
 
@@ -625,9 +640,14 @@ Memory contract for SDD delegation:
625
640
  | ------------------------------ | ---------------------------------------------------------------------------------------------------------- |
626
641
  | `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
642
  | `lib/native-review-cli.ts` | Strict package-local adapter for Gentle AI START, FINALIZE, VALIDATE, SDD binding, and status contracts. |
643
+ | `lib/review-integration-v1.ts` | Strict consumer decoder for negotiated capabilities, operations, target status, projections, and failures. |
644
+ | `lib/git-commit-transaction.ts` | Durable hook/native-validation/commit/recovery transaction with publication blocking and HEAD proof. |
628
645
  | `lib/review-candidate-view.ts` | Builds immutable changed-scope actor views while preserving full-tree, path, mode, symlink, and index integrity. |
646
+ | `lib/review-canonical.ts` | Permanent Pi-owned canonical JSON and domain-hash primitives for consumer-side identities. |
647
+ | `lib/review-repository.ts` | Permanent Pi-owned Git common-directory identity, safe Git environment, and authority-root binding. |
629
648
  | `lib/gentle-ai-binary.ts` | Resolves and verifies the confined package-local Gentle AI runtime without global or PATH fallback. |
630
649
  | `scripts/gentle-ai-installer.mjs` | Downloads, verifies, extracts, and atomically promotes the pinned native runtime for six platform targets. |
650
+ | `contracts/review-integration/v1/` | Byte-identical v2.1.11 provider schemas and conformance fixtures, hash-checked before packaging. |
631
651
  | `extensions/startup-banner.ts` | Shows and configures the startup intro, color presets, compact runtime panel, and collaboration credit. |
632
652
  | `extensions/sdd-init.ts` | Registers `/sdd-init` for OpenSpec initialization. |
633
653
  | `extensions/skill-registry.ts` | Maintains `.atl/skill-registry.md` from project/user skills and closes file watchers on shutdown. |
@@ -638,6 +658,8 @@ Memory contract for SDD delegation:
638
658
  | `skills/` | Gentle AI delivery and collaboration skills. |
639
659
  | `prompts/` | Gentle-prefixed prompt templates, including `/skill-creation`. |
640
660
  | `docs/skill-style-guide.md` | Normative style guide used by the packaged skill creation/improvement skills. |
661
+ | `docs/native-authority-architecture.md` | Post-U8 ownership boundary, reproducible slimming metrics, Windows evidence, and exact #191 seam. |
662
+ | `docs/review-integration.md` | Negotiated provider/consumer contract and the current Gentle Pi adoption boundary. |
641
663
 
642
664
  ## Development
643
665
 
@@ -2,6 +2,7 @@
2
2
  name: jd-judge-a
3
3
  description: Judgment Day blind adversarial reviewer A. Read-only; reports findings and does not fix code.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - glob
@@ -2,6 +2,7 @@
2
2
  name: jd-judge-b
3
3
  description: Judgment Day blind adversarial reviewer B. Read-only; independently reports findings and does not fix code.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - glob
@@ -2,6 +2,7 @@
2
2
  name: review-readability
3
3
  description: R2 Readability reviewer — naming, complexity, intention, maintainability, review size, and context clarity.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - glob
@@ -2,6 +2,7 @@
2
2
  name: review-refuter
3
3
  description: One-shot read-only verifier for the complete inferential-severe frozen-row list.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - find
@@ -2,6 +2,7 @@
2
2
  name: review-reliability
3
3
  description: R3 Reliability reviewer — behavior-first tests, coverage value, edge cases, determinism, contracts, and regressions.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - glob
@@ -2,6 +2,7 @@
2
2
  name: review-resilience
3
3
  description: R4 Resilience reviewer — fallbacks, retry/backoff, graceful degradation, observability, load, rollback, and SLO risks.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - glob
@@ -2,6 +2,7 @@
2
2
  name: review-risk
3
3
  description: R1 Risk reviewer — security, privilege boundaries, data exposure, dependency risks, and merge-blocking vulnerabilities.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - glob
@@ -2,6 +2,7 @@
2
2
  name: review-validator
3
3
  description: Per-attempt targeted proof validator for exact frozen rows.
4
4
  tools:
5
+ - "*": false
5
6
  - read
6
7
  - grep
7
8
  - find
@@ -179,17 +179,19 @@ If multiple rows match, run the narrow set that covers the risk. Example: shell
179
179
 
180
180
  ### Compact Controller Routing
181
181
 
182
- Call `gentle_review` INSPECT before START. On `clean`, new ordinary review uses compact v2:
182
+ Call `gentle_review` INSPECT before START. INSPECT delegates to negotiated target-scoped native status. When applicability is `unrelated` and native action is `start`, new ordinary review uses compact v2:
183
183
 
184
184
  ```json
185
- {"operation":"start","lineageId":"<optional-lineage>","input":"{\"mode\":\"ordinary\",\"policyHash\":\"<hash>\"}"}
185
+ {"operation":"start","input":"{\"mode\":\"ordinary\",\"policyPath\":\"<optional-repository-local-path>\"}"}
186
186
  ```
187
187
 
188
188
  Use `start -> finalize -> validate` for ordinary review. START derives complete Git/untracked scope, lineage, tier, selected lenses, authored changed lines, and the correction budget. Use graph-v1 `judgment-day` only when explicitly selected.
189
189
 
190
- When INSPECT or START reports `blocked-legacy` or `blocked-mixed`, do not retry START and do not present migration as an option. Explain that the old receipts, approvals, ledgers, and lineages will lose authority, then request explicit user authorization for the exact returned `reset_request.confirmation`. RESET and RECOVER independently require a fresh operation-bound confirmation through the interactive Pi UI and fail closed in headless execution. The UI boundary cannot cryptographically attest the human's identity, so its residual trust is the operator controlling that Pi session; challenge freshness and repository/inventory binding remain runtime-enforced. Only after authorization, call RESET with the exact serialized `reset_request`; RESET and RECOVER internally INSPECT authority, and only a returned `clean` inspection with `start-fresh-ordinary-review-after-verified-clean` permits an immediate fresh ordinary START. If INSPECT reports `reset-in-progress`, use its durable original `reset_request` for authorized RECOVER.
190
+ When target status is `current_target`, follow its single native action. `ambiguous` requires native lineage selection and `corrupted` requires native authority repair; Pi never guesses, resets, quarantines, migrates, or creates a lineage implicitly. Legacy/Pi ordinary authority stays compatibility-read-only. A `blocked-legacy` result requires explicit authorization for its exact compatibility challenge. Destructive RESET/RECOVER exists only for that historical lane and requires exact fresh interactive authorization; it is never a normal-lane fallback.
191
191
 
192
- A `lineage_created: false` result or a pre-authority validation error proves no lineage was created. After ambiguous output, replay the exact START or FINALIZE; compact CAS returns the exact committed revision or rejects stale/semantic retry. Never choose a different lineage merely because output was lost.
192
+ Preserve the negotiated failure envelope exactly. `mutation_outcome: not_started` proves no mutation. For `unknown` or lost mutating output, the controller immediately calls target-scoped status and returns its exact action; it never emits a generic replay instruction. Replay the exact START or FINALIZE only when that provider result declares `exact_replay_safe` for the same canonical request and required lineage. Never choose a lineage merely because output was lost.
193
+
194
+ Before authority access, `mutation_outcome: not_started` means no lineage was created. In the historical lane only, authorized RESET and RECOVER route to the audited native `gentle-ai review reclaim` and `gentle-ai review recover` operations; missing native inputs return `native-input-required` and are never invented, and INSPECT follows every committed native recovery record.
193
195
 
194
196
  Ordinary review runs the selected zero, one, or four lenses exactly once against `initial_review_tree`.
195
197
 
@@ -205,13 +207,13 @@ Inferential blockers use exactly one complete read-only refuter batch.
205
207
 
206
208
  Invalid, missing, duplicate, unknown, or inconclusive refuter output escalates without a replacement refuter.
207
209
 
208
- Ordinary permits up to three failed targeted attempts within the original cumulative budget. Each attempt uses one correction and one targeted validator; FINALIZE requires a positive pre-edit forecast and accounts Git-derived actual lines cumulatively.
210
+ Ordinary permits one correction transaction within the original budget. FINALIZE requires a positive pre-edit forecast and accounts Git-derived actual lines. After the bounded edit, run one targeted validator and final verification; failure escalates without another correction or review budget.
209
211
 
210
- Initial lenses never rerun. Every attempt preserves frozen findings and genesis scope: the original candidate, paths, untracked set, and correction IDs. Targeted validation checks original criteria and correction regression only and adds no scope.
212
+ Initial lenses never rerun. The correction preserves frozen findings and genesis scope: the original candidate, paths, untracked set, and correction IDs. Targeted validation checks original criteria and correction regression only and adds no scope.
211
213
 
212
214
  Final evidence is hashed during FINALIZE, not supplied at START.
213
215
 
214
- Each validator invocation cannot change claims, add findings, request fixes, launch actors, or request another attempt. Native FINALIZE alone returns `correction_required` while another bounded attempt remains.
216
+ The validator cannot change claims, add findings, request fixes, launch actors, or request another attempt.
215
217
 
216
218
  Compact ordinary uses only `reviewing`, `correction_required`, `validating`, `approved`, and `escalated`.
217
219
 
@@ -225,9 +227,9 @@ Judgment Day alone may iterate discovery and scoped re-judgment, for at most two
225
227
 
226
228
  Findings surviving round two escalate; no third-round transition exists.
227
229
 
228
- Graph-v1 ordinary authority remains readable/gate-valid/exportable but read-only. Judgment Day remains mutable on graph-v1. Same-lineage graph/compact ambiguity fails closed and reset quarantines both.
230
+ Graph-v1 ordinary authority remains readable and gate-valid but read-only. Legacy graph bundle export/import is retired. Judgment Day remains mutable on graph-v1, and native target status owns mixed-authority ambiguity and maintainer action.
229
231
 
230
- Compact gate validation is read-only and double-checks authority, target, publication refs, and evidence immediately before allow. Pi then registers one exact one-shot command authorization and rederives the target at bash time.
232
+ Native compact gate validation is read-only and double-checks authority, target, publication refs, and evidence immediately before allow. Pi then registers one exact one-shot command authorization and rederives the target at bash time. The Pi-owned publication-gate module isolates typed targets, remote binding, release projection, and publication rechecks from graph-v1 authority storage; graph receipt validation remains reachable only for historical graph authority and explicit Judgment Day.
231
233
  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.
232
234
  Major and post-incident releases require explicit extraordinary review even when fast-path checks pass.
233
235
 
@@ -59,7 +59,7 @@ Mandatory Delegation Triggers — stop rules; once fired, delegate through the b
59
59
 
60
60
  1. **4-file rule** — 4+ files to understand → delegate a scout/mapping task.
61
61
  2. **Multi-file write rule** — 2+ non-trivial files touched → delegate one writer.
62
- 3. **Lifecycle gate rule** — commit/push/PR/release validates an approved receipt and exact typed target with zero actors. Missing or changed authority fails closed; it never launches a same-lineage review.
62
+ 3. **Lifecycle gate rule** — commit/push/PR/release validates one receipt and exact target with zero actors. Direct commit uses the durable native-validated transaction; unresolved state blocks publication. Changed authority fails closed.
63
63
  4. **Incident rule** — diagnose wrong cwd/worktree/git/tooling incidents separately. An incident never reopens a closed review lineage or resets its budget.
64
64
  5. **Verification rule** — executing/delegating verification commands → `gentle-ai-verify`; only the 1-3-file read-only check stays inline.
65
65
  6. **Long-session rule** — ~20 tool calls, 5 exploratory reads, or 2 non-mechanical edits without delegation → pause and delegate.
@@ -108,9 +108,9 @@ For skill-shaped requests, do not treat injected `<available_skills>` as complet
108
108
 
109
109
  ## Bounded Review Transactions
110
110
 
111
- New ordinary review uses `gentle_review` `start -> finalize -> validate`. START freezes scope, findings, genesis, risk, and budget. FINALIZE permits up to three failed targeted attempts inside that cumulative budget without rerunning lenses.
111
+ New ordinary review uses negotiated v1 `gentle_review` `start -> finalize -> validate`. Target status owns one action. START freezes scope, findings, risk, and budget. FINALIZE permits one correction; failure escalates.
112
112
 
113
- Compact gates use zero actors and rederive authority, the exact target, and publication evidence before allow. Pi adds exact one-shot command authorization and bash-time rederivation. Graph-v1 ordinary authority is read-only; Judgment Day remains graph-v1.
113
+ Compact gates use zero actors and rederive authority, target, and evidence. Pi adds one-shot authorization. Legacy authority is read-only; Judgment Day is separate.
114
114
  Release from protected `main` may bypass receipt validation only when its immutable remote SHA and required CI are proven; otherwise native receipt validation applies.
115
115
  Major and post-incident releases require explicit extraordinary review even when fast-path checks pass.
116
116
 
@@ -118,6 +118,6 @@ Dangerous-command safety remains independent and authoritative.
118
118
 
119
119
  SDD completion adds no review or Judgment Day pass.
120
120
 
121
- Review transactions, validation, and SDD never deliver or publish.
121
+ Review/SDD never publish. The durable transaction may create one local commit after native validation and HEAD proof.
122
122
 
123
123
  Controller and actor contract: `{{GENTLE_PI_DELEGATION_PATH}}`.
@@ -0,0 +1,239 @@
1
+ {
2
+ "schema": "gentle-ai.review-integration.capabilities/v1.1",
3
+ "contract": "gentle-ai.review-integration/v1",
4
+ "protocol": {
5
+ "major": 1,
6
+ "minor": 1
7
+ },
8
+ "package": {
9
+ "name": "gentle-ai",
10
+ "version": "2.1.7-test",
11
+ "release_channel": "prerelease"
12
+ },
13
+ "build": {
14
+ "id": "sha256:444a9f0608eb22c4697fd2092f3afcfab040c0918343e7e04087730fd33fd5e1",
15
+ "go_version": "go1.25.10",
16
+ "module_version": "v2.1.7",
17
+ "vcs": "git",
18
+ "vcs_revision": "0123456789abcdef0123456789abcdef01234567",
19
+ "vcs_time": "2026-07-15T18:00:00Z",
20
+ "vcs_modified": "false"
21
+ },
22
+ "executable": {
23
+ "sha256": "sha256:dcc846103b16d365eaeeb9d7f289c23fc4f2897f23def1cb3fe7f05557b64705",
24
+ "evidence": "self-reported",
25
+ "verification": "compare-with-published-manifest"
26
+ },
27
+ "operations": [
28
+ "review.bind_sdd",
29
+ "review.capabilities",
30
+ "review.finalize",
31
+ "review.start",
32
+ "review.status",
33
+ "review.validate"
34
+ ],
35
+ "gates": [
36
+ "post-apply",
37
+ "pre-commit",
38
+ "pre-push",
39
+ "pre-pr",
40
+ "release"
41
+ ],
42
+ "projections": [
43
+ "staged",
44
+ "workspace"
45
+ ],
46
+ "schemas": [
47
+ "gentle-ai.review-authority-status/v1",
48
+ "gentle-ai.review-gate-request/v1",
49
+ "gentle-ai.review-integration.capabilities/v1.1",
50
+ "gentle-ai.review-integration.failure/v1",
51
+ "gentle-ai.review-integration.operation/v1",
52
+ "gentle-ai.review-integration.projection/v1",
53
+ "gentle-ai.review-integration.start/v1",
54
+ "gentle-ai.review-integration.status/v1",
55
+ "gentle-ai.review-receipt/v1",
56
+ "gentle-ai.review-receipt/v2",
57
+ "gentle-ai.review-result-artifact/v1",
58
+ "https://gentle-ai.dev/schema/review/refuter/v1",
59
+ "https://gentle-ai.dev/schema/review/reviewer/v1",
60
+ "https://gentle-ai.dev/schema/review/validator/v1"
61
+ ],
62
+ "features": {
63
+ "mandatory": [
64
+ {
65
+ "name": "compact_v2_authority",
66
+ "supported": true,
67
+ "requires": []
68
+ },
69
+ {
70
+ "name": "exact_receipt_replay",
71
+ "supported": true,
72
+ "requires": [
73
+ "compact_v2_authority"
74
+ ]
75
+ },
76
+ {
77
+ "name": "five_delivery_gates",
78
+ "supported": true,
79
+ "requires": [
80
+ "compact_v2_authority"
81
+ ]
82
+ },
83
+ {
84
+ "name": "immutable_snapshot",
85
+ "supported": true,
86
+ "requires": []
87
+ },
88
+ {
89
+ "name": "legacy_v1_target_scoped_read_only",
90
+ "supported": true,
91
+ "requires": [
92
+ "target_scoped_status"
93
+ ]
94
+ },
95
+ {
96
+ "name": "repository_independent_capabilities",
97
+ "supported": true,
98
+ "requires": []
99
+ },
100
+ {
101
+ "name": "restart_safe_projection",
102
+ "supported": true,
103
+ "requires": [
104
+ "target_scoped_status"
105
+ ]
106
+ },
107
+ {
108
+ "name": "sdd_receipt_binding",
109
+ "supported": true,
110
+ "requires": [
111
+ "compact_v2_authority"
112
+ ]
113
+ },
114
+ {
115
+ "name": "target_scoped_status",
116
+ "supported": true,
117
+ "requires": [
118
+ "repository_independent_capabilities"
119
+ ]
120
+ },
121
+ {
122
+ "name": "uniform_failure_envelope",
123
+ "supported": true,
124
+ "requires": [
125
+ "repository_independent_capabilities"
126
+ ]
127
+ }
128
+ ],
129
+ "optional": [
130
+ {
131
+ "name": "base_ref_workspace_overlay",
132
+ "supported": true,
133
+ "requires": [
134
+ "immutable_snapshot",
135
+ "restart_safe_projection"
136
+ ]
137
+ },
138
+ {
139
+ "name": "bounded_process_waits",
140
+ "supported": true,
141
+ "requires": [
142
+ "uniform_failure_envelope"
143
+ ]
144
+ },
145
+ {
146
+ "name": "exact_gate_receipt_discovery",
147
+ "supported": true,
148
+ "requires": [
149
+ "five_delivery_gates"
150
+ ]
151
+ },
152
+ {
153
+ "name": "native_low_risk_verification",
154
+ "supported": true,
155
+ "requires": [
156
+ "compact_v2_authority"
157
+ ]
158
+ },
159
+ {
160
+ "name": "native_next_transition",
161
+ "supported": true,
162
+ "requires": [
163
+ "target_scoped_status"
164
+ ]
165
+ },
166
+ {
167
+ "name": "risk_reasons",
168
+ "supported": true,
169
+ "requires": [
170
+ "repository_independent_capabilities"
171
+ ]
172
+ },
173
+ {
174
+ "name": "scope_change_diagnostics",
175
+ "supported": true,
176
+ "requires": [
177
+ "uniform_failure_envelope"
178
+ ]
179
+ }
180
+ ]
181
+ },
182
+ "bootstrap": {
183
+ "command": "gentle-ai review status --cwd \u003crepo\u003e --contract gentle-ai.review-integration/v1 --next-transition",
184
+ "target_selector_variants": [
185
+ {
186
+ "target_type": "staged",
187
+ "arguments": [
188
+ "--projection",
189
+ "staged"
190
+ ]
191
+ },
192
+ {
193
+ "target_type": "base_ref",
194
+ "arguments": [
195
+ "--base-ref",
196
+ "\u003cref\u003e"
197
+ ]
198
+ },
199
+ {
200
+ "target_type": "workspace_overlay_base_ref",
201
+ "arguments": [
202
+ "--workspace-overlay",
203
+ "--base-ref",
204
+ "\u003cref\u003e"
205
+ ]
206
+ },
207
+ {
208
+ "target_type": "workspace_overlay_base_tree",
209
+ "arguments": [
210
+ "--workspace-overlay",
211
+ "--base-tree",
212
+ "\u003ctree\u003e"
213
+ ]
214
+ }
215
+ ],
216
+ "required_feature": "native_next_transition",
217
+ "unsupported_outcome": "unsupported-capability",
218
+ "parent_only": true
219
+ },
220
+ "compatibility": {
221
+ "minimum_protocol_major": 1,
222
+ "maximum_protocol_major": 1,
223
+ "additive_minor_policy": "optional-fields-only",
224
+ "unknown_mandatory": "reject",
225
+ "unknown_optional": "ignore",
226
+ "modes": [
227
+ "compact-v2",
228
+ "legacy-v1"
229
+ ],
230
+ "legacy_window": {
231
+ "mode": "legacy-v1",
232
+ "state": "active",
233
+ "read_only": true,
234
+ "deprecation_started": true,
235
+ "removal": "not-scheduled",
236
+ "minimum_compatibility_releases": 1
237
+ }
238
+ }
239
+ }