gentle-pi 2.2.0 → 2.3.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 +51 -80
- 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-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 +54 -248
- package/assets/orchestrator-memory.md +2 -0
- package/assets/orchestrator.md +22 -38
- 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/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 +1778 -3673
- package/extensions/quiet-tools.ts +515 -32
- package/extensions/sdd-init.ts +4 -8
- package/lib/gentle-ai-renderer.ts +70 -0
- package/lib/model-routing-authority.ts +133 -0
- package/lib/native-review-cli.ts +372 -940
- package/lib/opaque-pi-reviewer-adapter.ts +284 -0
- package/lib/review-candidate-view.ts +341 -132
- package/lib/review-host-relay.ts +210 -68
- package/lib/review-integration-v2.ts +839 -307
- package/lib/review-last-event-controller.ts +35 -0
- package/lib/sdd-preflight.ts +177 -66
- 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 +322 -890
- package/runtime/review-integration-v2.mjs +789 -257
- 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 +12 -13
- package/skills/_shared/review-ledger-contract.md +8 -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/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/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 +820 -131
- package/tests/gentle-theme.test.ts +133 -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 +28 -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 +37 -35
- package/tests/provider-defect-handoff.test.ts +15 -118
- package/tests/quiet-tool-rendering.test.ts +1055 -28
- 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-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 +117 -82
- package/tests/review-host-relay.test.ts +242 -8
- package/tests/review-integration-v2-forward.test.ts +576 -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 +361 -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 +230 -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
|
@@ -30,6 +30,7 @@ const requiredPaths = [
|
|
|
30
30
|
"assets/agents/sdd-init.md",
|
|
31
31
|
"assets/agents/sdd-onboard.md",
|
|
32
32
|
"assets/agents/sdd-proposal.md",
|
|
33
|
+
"assets/agents/sdd-research.md",
|
|
33
34
|
"assets/agents/sdd-spec.md",
|
|
34
35
|
"assets/agents/sdd-status.md",
|
|
35
36
|
"assets/agents/sdd-sync.md",
|
|
@@ -52,7 +53,6 @@ const requiredPaths = [
|
|
|
52
53
|
"extensions/sdd-init.ts",
|
|
53
54
|
"extensions/skill-registry.ts",
|
|
54
55
|
"lib/gentle-ai-binary.ts",
|
|
55
|
-
"lib/git-commit-transaction.ts",
|
|
56
56
|
"lib/native-review-cli.ts",
|
|
57
57
|
"lib/provider-contract-bundle.ts",
|
|
58
58
|
"lib/review-host-relay.ts",
|
|
@@ -60,17 +60,13 @@ const requiredPaths = [
|
|
|
60
60
|
"lib/review-relay-contract.ts",
|
|
61
61
|
"lib/sdd-preflight.ts",
|
|
62
62
|
"runtime/gentle-ai-binary.mjs",
|
|
63
|
-
"runtime/git-commit-transaction.mjs",
|
|
64
63
|
"runtime/native-review-cli.mjs",
|
|
65
64
|
"runtime/review-integration-v2.mjs",
|
|
66
65
|
"runtime/review-relay-contract.mjs",
|
|
67
|
-
"scripts/build-git-commit-transaction-runner.mjs",
|
|
68
66
|
"scripts/check-provider-contract.mjs",
|
|
69
67
|
"scripts/gentle-ai-installer.mjs",
|
|
70
68
|
"scripts/install-gentle-ai.mjs",
|
|
71
69
|
"scripts/mirror-provider-contract.mjs",
|
|
72
|
-
"scripts/run-git-commit-transaction.mjs",
|
|
73
|
-
"scripts/test-packed-runner.mjs",
|
|
74
70
|
"tests/fixtures/native-review-cli/v2.1.3/start.json",
|
|
75
71
|
"tests/fixtures/provider-contract-bundle/v1.1.0/README.md",
|
|
76
72
|
"tests/fixtures/provider-contract-bundle/v1.1.0/manifest.json",
|
|
@@ -162,6 +158,7 @@ const contractHashes = {
|
|
|
162
158
|
"contracts/review-integration/v1/schemas/status-v2.schema.json": "dd9914b647a1d9edc4ecdcbed4f0c800b39ec290912d5c2a4cc6ba3098d5f21e",
|
|
163
159
|
"contracts/review-integration/v1/schemas/status.schema.json": "250d2c646b8822b38eaefafd2bfdefa1134cc23a00e553a7201f33257573149a",
|
|
164
160
|
"contracts/review-integration/v1/schemas/targeted-validation-request.schema.json": "52b91154693b4dd66983fc91ecf7197503555f2c9e85cac626cffd3035c53d65",
|
|
161
|
+
"contracts/review-integration/v1/schemas/transition-execution.schema.json": "ddee03bd0c1b6e70f21c399bae7fe528aa4ad46cebb5a48ec72b6e6b3694aa2d",
|
|
165
162
|
"contracts/review-integration/v1/schemas/verification-evidence.schema.json": "fd15890bf2ef1db95d771ee7f468e9e64014351d7940f65604eb24f41e68a22f",
|
|
166
163
|
"contracts/review-integration/v2/fixtures/capabilities.fixture.json": "17c150d851c15b3f0c20d18c2e2741eb2232ffa24f35aa71d6d30e90a85e42b7",
|
|
167
164
|
"contracts/review-integration/v2/fixtures/consent.fixture.json": "203cc96d5c29ba0f27b5c4db04c2e88566e0a923d3a0cdb317f78d9065349075",
|
|
@@ -172,11 +169,13 @@ const contractHashes = {
|
|
|
172
169
|
"contracts/review-integration/v2/schemas/capabilities.schema.json": "7ab061ed27bd3b929d6033cc20f56097e851f4454ca14a815255748b50191248",
|
|
173
170
|
"contracts/review-integration/v2/schemas/consent.schema.json": "b2b4465338497f11927de91cb2e5da12b6cb4a1039afe05aebe1abbf53b21858",
|
|
174
171
|
"contracts/review-integration/v2/schemas/failure.schema.json": "a56a2f715c3138d6f2cee37257cd6e758a15d4e0b1215745951d85831d148967",
|
|
172
|
+
"contracts/review-integration/v2/schemas/last-event-closure.schema.json": "612531204afa5941e4927c38e868c720a4519fe4b9a5a4ffd29f021dc053001d",
|
|
173
|
+
"contracts/review-integration/v2/schemas/opencode-provider-role.schema.json": "c6b9f216f89c044f8e844b55e7200114850cfbc16642bca0677f30a399d8aa9b",
|
|
175
174
|
"contracts/review-integration/v2/schemas/operation.schema.json": "1c0128a0576064d4338ee0a1945e9d0d0569c1a7a2140217b2539af5d1a9ed1e",
|
|
176
175
|
"contracts/review-integration/v2/schemas/repair.schema.json": "98a85fd45a8ae7f6211ffeeb3f9c478fa1dd1c17f385751f15f2111e6c3ab167",
|
|
177
176
|
"contracts/review-integration/v2/schemas/start.schema.json": "2991e3fcca672d9257d61b6a336fb34e58b15a8e03f8a09a7adf892cae6a8085",
|
|
178
177
|
"contracts/review-integration/v2/schemas/status.schema.json": "c4dcc736cfc6300560a3c4262d2d982368529d5c49d58d499552a3b0beef9212",
|
|
179
|
-
"docs/review-integration.md": "
|
|
178
|
+
"docs/review-integration.md": "0a2a415e8bd24be61f5c6090bd0efccde0ed1b4561261be11bba197aa081f336",
|
|
180
179
|
};
|
|
181
180
|
|
|
182
181
|
requiredPaths.push(...Object.keys(contractHashes));
|
|
@@ -247,7 +246,7 @@ export function gentleAiVersionPinMismatches({ installerVersion, releaseBaseUrl,
|
|
|
247
246
|
// so this script never needs the generator to export anything it doesn't
|
|
248
247
|
// already export for its own `--write`/`--check` CLI use.
|
|
249
248
|
export function extractGeneratedRuntimeSources(packageRoot) {
|
|
250
|
-
const generatorPath = join(packageRoot, "scripts/build-
|
|
249
|
+
const generatorPath = join(packageRoot, "scripts/build-runtime-modules.mjs");
|
|
251
250
|
const generatorSource = readFileSync(generatorPath, "utf8");
|
|
252
251
|
const sourcesMatch = generatorSource.match(/const sources = \[([\s\S]*?)\];/);
|
|
253
252
|
if (!sourcesMatch) {
|
|
@@ -316,7 +315,7 @@ async function main() {
|
|
|
316
315
|
const generatedRuntimeSources = extractGeneratedRuntimeSources(root);
|
|
317
316
|
const { drifted } = reconcileGeneratedRuntimeSources(root, generatedRuntimeSources, requiredPaths);
|
|
318
317
|
if (drifted.length > 0) {
|
|
319
|
-
console.error("gentle-pi generated
|
|
318
|
+
console.error("gentle-pi generated runtime sources, runtime/*.mjs, and requiredPaths have drifted apart:");
|
|
320
319
|
for (const entry of drifted) {
|
|
321
320
|
const where = [];
|
|
322
321
|
if (!entry.inSources) where.push("missing from generator sources");
|
|
@@ -334,7 +333,7 @@ async function main() {
|
|
|
334
333
|
});
|
|
335
334
|
|
|
336
335
|
if (driftedContracts.length > 0) {
|
|
337
|
-
console.error("gentle-pi packaged review-integration/v1 and review-integration/v2 contract bytes drifted from the
|
|
336
|
+
console.error("gentle-pi packaged review-integration/v1 and review-integration/v2 contract bytes drifted from the pinned v2.5.0 runtime's vendored Gentle AI contract artifacts:");
|
|
338
337
|
for (const drift of driftedContracts) console.error(`- ${drift.relativePath}: expected ${drift.expected}, got ${drift.actual}`);
|
|
339
338
|
process.exit(1);
|
|
340
339
|
}
|
|
@@ -351,17 +350,17 @@ async function main() {
|
|
|
351
350
|
if (unpinnedDigests.length > 0) {
|
|
352
351
|
console.error("gentle-pi Gentle AI release digests are not pinned SHA-256 values:");
|
|
353
352
|
for (const entry of unpinnedDigests) console.error(`- ${entry}`);
|
|
354
|
-
console.error("Refusing to pack/publish until scripts/gentle-ai-installer.mjs pins the published checksums.txt
|
|
353
|
+
console.error("Refusing to pack/publish until scripts/gentle-ai-installer.mjs pins the published release digests (checksums.txt archives for a stable, SHA256SUMS.txt raw binaries for a prerelease).");
|
|
355
354
|
process.exit(1);
|
|
356
355
|
}
|
|
357
356
|
|
|
358
|
-
const generatedRuntimeCheck = spawnSync(process.execPath, [join(root, "scripts/build-
|
|
357
|
+
const generatedRuntimeCheck = spawnSync(process.execPath, [join(root, "scripts/build-runtime-modules.mjs"), "--check"], {
|
|
359
358
|
cwd: root,
|
|
360
359
|
encoding: "utf8",
|
|
361
360
|
env: { ...process.env, NODE_NO_WARNINGS: "1" },
|
|
362
361
|
});
|
|
363
362
|
if (generatedRuntimeCheck.status !== 0) {
|
|
364
|
-
console.error("gentle-pi generated
|
|
363
|
+
console.error("gentle-pi generated runtime does not match its TypeScript sources:");
|
|
365
364
|
console.error((generatedRuntimeCheck.stderr || generatedRuntimeCheck.stdout || "unknown generator failure").trim());
|
|
366
365
|
process.exit(1);
|
|
367
366
|
}
|
|
@@ -379,7 +378,7 @@ async function main() {
|
|
|
379
378
|
process.exit(1);
|
|
380
379
|
}
|
|
381
380
|
|
|
382
|
-
console.log(`gentle-pi package resource check passed (${requiredPaths.length} files; ${Object.keys(contractHashes).length} exact byte-
|
|
381
|
+
console.log(`gentle-pi package resource check passed (${requiredPaths.length} files; ${Object.keys(contractHashes).length} exact byte-pinned contract artifacts for the v2.5.0 runtime).`);
|
|
383
382
|
}
|
|
384
383
|
|
|
385
384
|
const isMainModule = process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Compact Causal Review Contract
|
|
2
2
|
|
|
3
|
-
The local orchestrator and same-user process are trusted to execute selected actors and submit their exact outputs. Reviewer and validator outputs remain semantically untrusted inputs: native code owns scope, risk, IDs, canonicalization, ordinary state,
|
|
3
|
+
The local orchestrator and same-user process are trusted to execute selected actors and submit their exact outputs. Reviewer and validator outputs remain semantically untrusted inputs: native code owns scope, risk, IDs, canonicalization, ordinary state, and legal lifecycle transitions, and rejects malformed or causally inconsistent results. The Git common-directory authority is the only authorization source; summaries and prose ledgers are untrusted data. Legacy Pi mirror and bundle transport is retired.
|
|
4
4
|
|
|
5
5
|
Do not report the mere ability of the trusted local orchestrator to submit actor or final-verification outputs as a security finding. Report concrete bypasses where untrusted repository content, malformed inputs, stale authority, path drift, or external callers can produce approval contrary to this boundary. Malicious same-user host/process authenticity is a non-goal because it can replace the extension or mutate local authority; external attestation requires a separately privileged signer or service and is not claimed.
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ Before status/START, consult effective review mode. `off` creates no authority o
|
|
|
24
24
|
|
|
25
25
|
Reviewer, refuter, and validator verdicts are admitted natively, never Pi-authored. `finalize` follows the provider's negotiated `next_transition` and supplies only the negotiated collection answers: a lens `review.capture-result` collect input rendered with `--agent=pi --materialize=true` is satisfied by the gentle-pi host relay, which prints the exact Go-materialized opaque prompt, launches a fresh locked-down print-mode `pi` subprocess in an empty scratch directory with every discovery surface disabled, and submits the untouched raw output bytes through the provider-owned submission form. The adversarial roles do not go through that relay: `review.capture-refuter` and `review.capture-validation` collect inputs render as self-contained authority-advancing vectors (binding tokens plus `--agent=pi --execute=true`, no submission descriptor); executing the exact rendered invocation makes Go materialize the role prompt, spawn its own locked-down `pi` process, and admit the raw verdict. Native Go owns validation, canonicalization, missing lens/finding ID assignment, persistence, and hashing, and performs only the legal transition from the current compact state. The five states are `reviewing`, `correction_required`, `validating`, `approved`, and `escalated`.
|
|
26
26
|
|
|
27
|
-
`validate`
|
|
27
|
+
`validate` is informational and runs with zero actors. It never mutates compact authority or controls delivery.
|
|
28
28
|
|
|
29
29
|
## Causal findings
|
|
30
30
|
|
|
@@ -41,7 +41,7 @@ Only severe `introduced`, `behavior-activated`, or `worsened` findings with vali
|
|
|
41
41
|
|
|
42
42
|
Refuter rows may cite independent concrete proof and do not need to repeat reviewer `proof_refs`. `pre-existing` and `base-only` findings become non-blocking follow-ups. `unknown`, insufficient evidence, malformed severe claims, empty/malformed proof, missing/duplicate/extra refuter rows, and inconclusive severe outcomes escalate. `WARNING` and `SUGGESTION` remain informational.
|
|
43
43
|
|
|
44
|
-
Actor output cannot authorize transitions, corrections,
|
|
44
|
+
Actor output cannot authorize transitions, corrections, or delivery.
|
|
45
45
|
|
|
46
46
|
## Correction
|
|
47
47
|
|
|
@@ -59,21 +59,15 @@ Final verification evidence is supplied and hashed only during finalization. Fai
|
|
|
59
59
|
|
|
60
60
|
The negotiated native provider owns compact-v2 storage and its private paths. Pi consumes only typed START, FINALIZE, target status, validation, recovery, reconciliation, and SDD-binding results. Content-derived revisions, compare-and-swap replacement, exact retry idempotency, stale/semantic retry rejection, semantic validation, terminal immutability, atomic publication, and receipt readback remain provider guarantees.
|
|
61
61
|
|
|
62
|
-
Existing graph-v1 ordinary lineages remain readable
|
|
62
|
+
Existing graph-v1 ordinary lineages remain readable for compatibility but reject new mutation. Legacy graph bundle export/import is retired. Judgment Day remains mutable on graph-v1. Pre-graph numbered authority remains destructive-reset-only, while native target status owns mixed-authority ambiguity and the required maintainer action.
|
|
63
63
|
|
|
64
|
-
Permanent Pi-owned consumer infrastructure is limited to canonical identity primitives, repository/common-directory binding, immutable candidate views
|
|
64
|
+
Permanent Pi-owned consumer infrastructure is limited to canonical identity primitives, repository/common-directory binding, and immutable candidate views. These modules are not authority mirrors.
|
|
65
65
|
|
|
66
|
-
##
|
|
66
|
+
## Delivery boundary
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Commit, push, pull-request creation, and release creation are not RDD gates. Review outcomes and receipt state are informational and never authorize, consume, rewrite, or block a Bash delivery command; ordinary repository policy owns delivery. Pi does not inspect RDD mode or native authority for those commands.
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Pi additionally registers one one-shot authorization for the exact subsequent command. Successful `/gentle:review-mode disable` clears pending lifecycle authorization; each lifecycle command rechecks mode, so out-of-band disable discards stale authorization and proceeds organically, never as approval. Full target/publication derivation runs after controller-time native allow, before bash-time native validation, and again after that validation before command allow. `gh pr create` binds repository precedence (`--repo`, `GH_REPO`, local inference), the effective source/value, and the exact advertised remote head commit equal to reviewed local `HEAD`; pre-PR keeps fetch-side repository/base/head semantics. Existing native push destinations bind the command remote, destination ref, old/new objects, exact destination selector, and advertised old commit in one rederived fingerprint only when effective push and fetch URL/identity match. Split fetch/push pre-push is an upstream v2.1.1 contract limitation: `<remote>/<branch>` resolves through fetch-side remote-tracking state even when Pi probes `pushurl`, so Pi fails closed before native validation with `native-split-fetch-push-unsupported-until-upstream-supports-explicit-push-base`. Native first-push authorization remains unsupported until a separate follow-up adds a persisted explicit advertised-base source, so a missing destination fails closed instead of inferring an upstream, default branch, or nearest ancestor. Publication probes are shell-free, bounded, and cancellation-aware, and the complete bash-time publication/native revalidation has one aggregate bounded deadline combined with Pi's cancellation signal when available. Repository identity, first-push destination, push destination, exact PR base/head, release evidence, protected-main release fast path, and fail-closed dangerous-command interception remain mandatory. Base advancement is unsupported without a receipt-bound signed CI trust root and therefore fails closed.
|
|
73
|
-
|
|
74
|
-
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 independently proven successful, the remote head is rechecked before tag push, and no fresh risk evidence exists. Major and post-incident releases require explicit extraordinary review.
|
|
75
|
-
|
|
76
|
-
Review transactions, validation, and SDD never commit, push, create a PR, release, or publish.
|
|
70
|
+
Dangerous-command confirmation/safety and destructive-review-maintenance consent remain independent. Review transactions, validation, and SDD never perform delivery commands themselves.
|
|
77
71
|
|
|
78
72
|
## Judgment Day
|
|
79
73
|
|
|
@@ -14,6 +14,8 @@ Load this skill when a planned PR may exceed **400 changed lines**, SDD forecast
|
|
|
14
14
|
## Hard Rules
|
|
15
15
|
|
|
16
16
|
- Split PRs over **400 changed lines** unless a maintainer explicitly accepts `size:exception`.
|
|
17
|
+
- 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 budget.
|
|
18
|
+
- Slicing is bounded: make **one** honest slicing pass. If no cohesive split brings every slice within budget, stop iterating, keep the best cohesive split, and report the final line count with a `size:exception` recommendation.
|
|
17
19
|
- Keep each PR reviewable in about **≤60 minutes**.
|
|
18
20
|
- Use one deliverable work unit per PR; keep tests/docs with the unit they verify.
|
|
19
21
|
- State start, end, prior dependencies, follow-up work, and out-of-scope items in every chained PR.
|
|
@@ -30,6 +32,7 @@ Load this skill when a planned PR may exceed **400 changed lines**, SDD forecast
|
|
|
30
32
|
| PR >400, each slice can land independently | Use Stacked PRs to main. |
|
|
31
33
|
| PR >400, feature must integrate before main | Use Feature Branch Chain with tracker. |
|
|
32
34
|
| Generated/vendor/migration diff cannot split cleanly | Ask maintainer for `size:exception`. |
|
|
35
|
+
| No cohesive split fits the budget after one slicing pass | Stop; deliver the best split, report the overage and why it cannot shrink further, and recommend `size:exception`. |
|
|
33
36
|
| SDD provides `delivery_strategy` | Follow it before apply/PR creation. |
|
|
34
37
|
|
|
35
38
|
## Execution Steps
|
|
@@ -17,11 +17,9 @@ When asked who or what you are, answer as el Gentleman: a Pi-specific coding-age
|
|
|
17
17
|
- Use OpenSpec-style artifacts for proposal, specs, design, tasks, apply progress, verify report, and archive notes.
|
|
18
18
|
- If tests exist, follow strict TDD: RED, GREEN, TRIANGULATE, REFACTOR, and record evidence.
|
|
19
19
|
- Keep one parent session responsible for orchestration; child subagents should receive concrete phase work and must not spawn more subagents.
|
|
20
|
-
- Parent-only delegation triggers apply after complexity appears: 4+ files for understanding, 2+ non-trivial files to write,
|
|
21
|
-
- As parent, prefer `scout`/`context-builder` for context-heavy exploration and one forked `worker` for implementation. Review lenses run only when selected by ordinary transaction start; do not call a generic `reviewer` or add lifecycle review actors.
|
|
20
|
+
- Parent-only delegation triggers apply after complexity appears: 4+ files for understanding, 2+ non-trivial files to write, tooling/worktree incidents, or long sessions with accumulating complexity.
|
|
22
21
|
- Keep writes single-threaded unless the user explicitly approves isolated parallel worktrees.
|
|
23
22
|
- Forecast review workload before large changes; ask before producing oversized or multi-area diffs.
|
|
24
|
-
- Start review routing only inside a bound ordinary transaction; lifecycle commands use approved receipts and exact typed targets instead of ambient-diff advice.
|
|
25
23
|
- Keep dangerous-command safety independent and authoritative.
|
|
26
24
|
- Never claim persistent memory is available because of el Gentleman itself; memory is provided by separate packages/tools when active.
|
|
27
25
|
- For skill-shaped requests, check the registry/filesystem for a more specific skill before generic execution; use it only if it improves the immediate task without adding ceremony.
|
|
@@ -46,87 +44,22 @@ clarify → explore → proposal → spec → design → tasks → apply → ver
|
|
|
46
44
|
For bounded implementation with subagents:
|
|
47
45
|
|
|
48
46
|
```text
|
|
49
|
-
clarify → scout/context-builder when context-heavy → one worker →
|
|
47
|
+
clarify → scout/context-builder when context-heavy → one worker → verify
|
|
50
48
|
```
|
|
51
49
|
|
|
52
50
|
Hard delegation triggers:
|
|
53
51
|
|
|
54
52
|
- **4-file rule**: reading 4+ files to understand means delegate exploration.
|
|
55
|
-
- **Multi-file write rule**: touching 2+ non-trivial files means use one worker
|
|
56
|
-
- **
|
|
57
|
-
- **Incident rule**: after wrong cwd, accidental worktree/repo mutation, merge recovery, confusing test command, or environment workaround, diagnose separately without reopening a closed lineage or resetting its budget.
|
|
53
|
+
- **Multi-file write rule**: touching 2+ non-trivial files means use one worker.
|
|
54
|
+
- **Incident rule**: after wrong cwd, accidental worktree/repo mutation, merge recovery, confusing test command, or environment workaround, diagnose separately.
|
|
58
55
|
- **Long-session rule**: after roughly 20 tool calls, 5 exploratory reads, or 2 non-mechanical edits with no delegation and accumulating complexity, pause and choose a non-review subagent or justify not doing so.
|
|
59
56
|
|
|
60
57
|
## Review Lens Selection
|
|
61
58
|
|
|
62
|
-
|
|
59
|
+
`review-risk`, `review-reliability`, `review-resilience`, and `review-readability` are Gentle AI review-lens vocabulary. This injected skill does not select, invoke, sequence, or retry those lenses; any applicable runtime uses only its dynamically supplied instructions.
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
| --- | --- |
|
|
66
|
-
| Clear naming, structure, maintainability, small refactors | `review-readability` |
|
|
67
|
-
| Behavior, state, tests, determinism, regressions | `review-reliability` |
|
|
68
|
-
| Shell/process integration, partial failures, recovery, degraded dependencies | `review-resilience` |
|
|
69
|
-
| Security, permissions, data exposure/loss, architecture, dependencies | `review-risk` |
|
|
70
|
-
| Large PR, hot path, or >400 changed lines | Full 4R: `review-risk`, `review-resilience`, `review-readability`, `review-reliability` |
|
|
61
|
+
## Gentle AI RDD Ownership
|
|
71
62
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
## Bounded Review Transaction Contract
|
|
75
|
-
|
|
76
|
-
Call `gentle_review` INSPECT before START. The package-local Gentle AI v2.4.0 executable negotiates `gentle-ai.review-integration/v2`; INSPECT is target-scoped status, not a Pi-built authority inventory. New ordinary review uses native compact-v2 `start -> finalize -> validate`. START receives a JSON-serialized ordinary input; an optional repository-local `policyPath` and an explicit `baseRef` paired with `committedOnly: true` are the only selectors. Native code derives Git scope, untracked paths, lineage, risk tier/reasons, lenses, authored lines, and correction budget. `judgment-day` remains explicit and separate.
|
|
77
|
-
|
|
78
|
-
If INSPECT or START reports `blocked-legacy` or `blocked-mixed`, explain that legacy authority cannot be migrated and request explicit user authorization for the exact destructive-reset challenge. RESET and RECOVER each require fresh operation-bound confirmation through the interactive Pi UI and fail closed headlessly. The UI cannot cryptographically attest the human's identity; its residual trust is the operator controlling that Pi session, while exact challenge binding remains runtime-enforced. Only after authorization, the controller routes RESET and RECOVER_LOCK to the audited native `gentle-ai review reclaim` operation and RECOVER to native `gentle-ai review recover`; supply the exact native inputs (`lineage`/`actor`/`reason`, or the predecessor lineage, expected predecessor revision, successor lineage, disposition, actor, and reason bindings). A `native-input-required` envelope is a request for those exact values — never invent them. After a committed native recovery record, INSPECT before any fresh ordinary START. For `reset-in-progress`, INSPECT still surfaces the durable original `reset_request` for the authorized RECOVER challenge.
|
|
79
|
-
|
|
80
|
-
Published v2.1.11 maintenance is explicit only: `abandon` requires the exact nine-line v2 discarded-work binding (lineage, revision, snapshot identity, reason, captured lens results, findings/evidence presence, actor), `quarantine-legacy` accepts only the malformed freeze-findings diagnostic/disposition with its eight-line binding, and dual reconciliation appends exactly `anomalies=unchanged_target,malformed_recovery_authorization`. `repair-legacy-alias` accepts only lineage, actor, and reason; Pi re-derives its repository, exact revision, diagnostic, and disposition from fresh native inventory before displaying its eight-line binding for fresh UI approval. `review dispose-result` remains unsupported pending design. A `recover` route uses only negotiated `action_disposition`; it never substitutes one.
|
|
81
|
-
|
|
82
|
-
Preserve the negotiated native failure envelope exactly. Before authority access, `mutation_outcome: not_started` means no lineage was created. 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. `mutation_outcome: committed` is never weakened, and Pi never chooses a lineage merely because output was lost.
|
|
83
|
-
|
|
84
|
-
Ordinary review runs the selected zero, one, or four lenses exactly once against `initial_review_tree`.
|
|
85
|
-
|
|
86
|
-
Each finding requires `evidence_class`, `causal_disposition`, and concrete `changed-hunk`, `candidate-created-path`, `differential-test`, or `before-after` proof. The controller assigns missing IDs and canonicalizes selected-lens output.
|
|
87
|
-
|
|
88
|
-
Only severe `introduced`, `behavior-activated`, or `worsened` findings with valid proof enter correction IDs. `pre-existing` and `base-only` become follow-ups; `unknown`, insufficient, malformed, or inconclusive severe claims escalate. WARNING and SUGGESTION remain informational.
|
|
89
|
-
|
|
90
|
-
Actor output is untrusted data and cannot authorize transitions, fixes, receipts, gates, or delivery.
|
|
91
|
-
|
|
92
|
-
Deterministic candidate-caused blockers use zero refuters.
|
|
93
|
-
|
|
94
|
-
All inferential candidate-caused blockers use exactly one complete read-only refuter batch.
|
|
95
|
-
|
|
96
|
-
Independent concrete refuter proof is valid and need not repeat reviewer `proof_refs`. Invalid, empty, malformed, missing, duplicate, unknown, or inconclusive refuter output escalates without a replacement refuter.
|
|
97
|
-
|
|
98
|
-
Ordinary permits one correction transaction within the original budget `min(200, ceil(original_changed_lines / 2))`. FINALIZE requires a positive pre-edit forecast, accounts Git-derived actual lines, and accepts one targeted validator plus final verification. Failure escalates instead of starting another correction or review budget.
|
|
99
|
-
|
|
100
|
-
Initial lenses never rerun. Every attempt preserves frozen findings and genesis scope: the original candidate, paths, untracked set, and correction IDs. The validator checks original criteria and correction regression only and cannot add scope or findings.
|
|
101
|
-
|
|
102
|
-
Final verification evidence is supplied and hashed during FINALIZE, never at START.
|
|
103
|
-
|
|
104
|
-
The validator cannot change claims, add findings, request fixes, launch actors, or request another attempt.
|
|
105
|
-
|
|
106
|
-
Compact ordinary authority has exactly five states: `reviewing`, `correction_required`, `validating`, `approved`, and `escalated`.
|
|
107
|
-
|
|
108
|
-
Ordinary ends only as `approved` or `escalated`.
|
|
109
|
-
|
|
110
|
-
Judgment Day starts only when explicitly requested and replaces ordinary review for that lineage.
|
|
111
|
-
|
|
112
|
-
Judgment Day starts with exactly two blind judges and zero refuters.
|
|
113
|
-
|
|
114
|
-
Judgment Day alone may iterate discovery and scoped re-judgment, for at most two rounds.
|
|
115
|
-
|
|
116
|
-
Findings surviving round two escalate; no third-round transition exists.
|
|
117
|
-
|
|
118
|
-
Existing graph-v1 and legacy-v1 ordinary lineages remain compatibility-readable but reject ordinary mutation. Every new ordinary START, status, FINALIZE, gate, and SDD binding uses native compact-v2. Ambiguous or corrupted target status requires the single native maintainer action; Pi never resets, quarantines, migrates, or selects authority implicitly. Judgment Day remains explicit and separate.
|
|
119
|
-
|
|
120
|
-
PR #1216 introduced the v2.1.1 `<remote>/<branch>` selector contract that v2.1.2 inherits unchanged.
|
|
121
|
-
|
|
122
|
-
Native gates are read-only and always pass `--contract gentle-ai.review-integration/v2`. Pi registers one exact one-shot command authorization and rederives before and after bash-time native validation. Authorized direct `git commit` is rewritten through the package-owned durable transaction: run the effective pre-commit hook once, derive the post-hook index tree, validate that exact tree natively, preserve remaining hooks through proxies, commit without rerunning pre-commit, then prove `HEAD^{tree}`. An unresolved transaction blocks push, PR, and release; recovery never resets Git content automatically. Native pre-PR binds GitHub CLI repository precedence plus the exact advertised remote head equal to reviewed local `HEAD`. Publication probes remain shell-free, bounded, cancellation-aware, and fail closed on unsupported topology.
|
|
123
|
-
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.
|
|
124
|
-
Major and post-incident releases require explicit extraordinary review even when fast-path checks pass.
|
|
63
|
+
Gentle AI dynamically supplies runtime-specific RDD instructions at runtime. Treat them as the sole lifecycle authority. This skill never defines a review route, command sequence, state machine, approval or gate policy, recovery path, or fallback; when no native instruction is available, follow ordinary repository policy without inventing one.
|
|
125
64
|
|
|
126
65
|
Dangerous-command safety remains independent and authoritative.
|
|
127
|
-
|
|
128
|
-
SDD completion adds no review or Judgment Day pass.
|
|
129
|
-
|
|
130
|
-
Review operations, validation, and SDD perform no push, PR creation, release, or publication. Only the separate durable commit runner may create one local commit after exact native authorization and HEAD proof.
|
|
131
|
-
|
|
132
|
-
The package ensures SDD agents and chains are available as global Pi runtime assets. Adversarial review roles (refuter, targeted validator) are never Pi-authored: the provider renders self-contained capture vectors and Go runs its own locked-down `pi` process on them. Project/user agent definitions are overrides and may shadow package assets; never rewrite or claim their effective permissions. Use `/gentle:install-sdd --force` only for recovery or intentional global refresh.
|
|
@@ -11,9 +11,11 @@ metadata:
|
|
|
11
11
|
|
|
12
12
|
Load this skill only when the user explicitly requests Judgment Day, Judgement Day, dual/adversarial review, or an equivalent trigger. Resolve one exact target before starting.
|
|
13
13
|
|
|
14
|
-
Judgment Day is a standalone developer tool: judges run whenever asked, on any runtime, and need no review transaction, runtime identity, or delivery-receipt machinery to start. It replaces ordinary 4R
|
|
14
|
+
Judgment Day is a standalone developer tool: judges run whenever asked, on any runtime, and need no review transaction, runtime identity, or delivery-receipt machinery to start. It neither enables nor replaces an ordinary 4R lifecycle; a separately requested ordinary review remains independent.
|
|
15
15
|
|
|
16
|
-
Judgment Day starts only when explicitly requested
|
|
16
|
+
Judgment Day starts only when explicitly requested. It does not start, configure, or consume ordinary review for that lineage.
|
|
17
|
+
|
|
18
|
+
Historical compatibility note (obsolete): Judgment Day starts only when explicitly requested and replaces ordinary review for that lineage. Current behavior is the independent lifecycle above.
|
|
17
19
|
|
|
18
20
|
## Transaction Rules
|
|
19
21
|
|
|
@@ -63,11 +65,7 @@ Each scoped fix returns candidate-tree and fix-diff evidence. It cannot mint aut
|
|
|
63
65
|
|
|
64
66
|
## Lifecycle Boundary
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Pre-commit, pre-push, and PR gates validate approved receipts and exact typed targets with zero actors.
|
|
69
|
-
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.
|
|
70
|
-
Major and post-incident releases require explicit extraordinary review even when fast-path checks pass.
|
|
68
|
+
Judgment Day is independent: it creates no delivery authority, enables no ordinary review, and changes no commit, push, PR, or release policy. A separately requested ordinary review remains an independent lifecycle and cannot consume a Judgment Day result as a receipt or authority. Ordinary repository policy owns delivery.
|
|
71
69
|
|
|
72
70
|
Dangerous-command safety remains independent and authoritative.
|
|
73
71
|
|
|
@@ -15,13 +15,13 @@ This skill guides public collaboration. It does not grant issue approval, label,
|
|
|
15
15
|
|
|
16
16
|
## Hard Rules
|
|
17
17
|
|
|
18
|
-
-
|
|
18
|
+
- Review and Judgment Day evidence is review-only. Pi never mints delivery authority: ordinary commit, push, PR, and release always follow repository policy, regardless of RDD mode.
|
|
19
19
|
- Require an approved issue (`status:approved`) and clean current `main` reproduction before implementation. Audit existing PRs for supersession or conflict; stop or narrow stale claims.
|
|
20
20
|
- Group by causal authority invariant. Use one issue and one PR or explicit chain per independent invariant and rollback boundary. Split independent causes; never merge a superseded or conflicting authority line.
|
|
21
21
|
- Inventory every operator flow claimed by the issue or PR, including entry, mode, environment, expectation, and negative controls. Require one truthful black-box bench journey per CLI or lifecycle flow, or actual runtime E2E proof when the core bench cannot represent it. Synthetic proxy coverage never proves another runtime.
|
|
22
22
|
- Use CodeGraph-first impact mapping, a dedicated worktree, and behavior-first tests. Run source-mutating normalization before candidate freeze.
|
|
23
23
|
- Forecast authored changes before edits. The hard limit is 400 additions plus deletions; above it, STOP for a chain or explicit maintainer-approved exception.
|
|
24
|
-
-
|
|
24
|
+
- When RDD is enabled, bind review receipts, lineage, correction, and recovery evidence to the exact candidate. Keep bounded review defects in one correction transaction; never treat that evidence as delivery authority.
|
|
25
25
|
- Require independent read-only candidate validation before publication. Validation cannot edit source or authority; findings require a new candidate.
|
|
26
26
|
- Keep communication humane and evidence-based. Repository labels and workflow metadata are maintainer-owned, never evidence of contributor blame.
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ This skill guides public collaboration. It does not grant issue approval, label,
|
|
|
29
29
|
|
|
30
30
|
| Condition | Action |
|
|
31
31
|
| --- | --- |
|
|
32
|
-
| RDD
|
|
32
|
+
| Any RDD mode | Review evidence remains review-only; ordinary commit, push, PR, and release follow repository policy with no Pi delivery authority. |
|
|
33
33
|
| Issue gate or reproduction fails | Wait, stop, or narrow with evidence. |
|
|
34
34
|
| Invariant or rollback is independent | Separate issue and authoritative PR line. |
|
|
35
35
|
| Core bench fits / does not fit | Bench journey / actual runtime E2E; never proxy. |
|
package/skills/release/SKILL.md
CHANGED
|
@@ -17,8 +17,8 @@ Use this skill when preparing, publishing, or verifying a `gentle-pi` release.
|
|
|
17
17
|
- npm publishing MUST go through the GitHub Actions workflow `.github/workflows/publish.yml` so provenance, environment protection, and registry credentials are controlled by GitHub.
|
|
18
18
|
- Dispatch the trusted workflow definition from protected default `main`, never from a release tag. Its only caller input is the exact annotated version tag.
|
|
19
19
|
- Use a clean worktree for release commits. Do not package unrelated local files or scratch artifacts.
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- Review outcomes are informational. Release delivery follows ordinary repository policy and must not be blocked, authorized, or rewritten by RDD.
|
|
21
|
+
- Never infer the release tag target from local `HEAD`; use the freshly fetched `origin/main` commit and the repository's normal release safeguards.
|
|
22
22
|
- Never skip package verification. The publish workflow runs verification again, but local validation should still pass before tagging.
|
|
23
23
|
|
|
24
24
|
## Release Procedure
|
|
@@ -114,7 +114,7 @@ Use this skill when preparing, publishing, or verifying a `gentle-pi` release.
|
|
|
114
114
|
|
|
115
115
|
## Failure Handling
|
|
116
116
|
|
|
117
|
-
- A publication failure
|
|
117
|
+
- A publication failure is handled through ordinary repository policy. It does not reopen or alter a review lineage.
|
|
118
118
|
- Never attempt or retry `npm publish` locally. Re-dispatch from trusted `main` only when the same tag still targets the current remote `main` and the failure was publication-only.
|
|
119
119
|
- If remote `main` advances, do not move or recreate the existing tag. Prepare a new release commit/version and create a new annotated version tag.
|
|
120
120
|
- If the workflow fails, inspect logs with:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: work-unit-commits
|
|
2
|
+
name: gentle-ai-work-unit-commits
|
|
3
3
|
description: "Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code."
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
@@ -30,6 +30,7 @@ Use it for:
|
|
|
30
30
|
| Tell a story | A reviewer should understand why each commit exists from its diff and message. |
|
|
31
31
|
| Future PR-ready | Each commit should be a candidate chained PR when the change grows. |
|
|
32
32
|
| SDD workload guard | If SDD tasks forecast a >400-line change, group commits into chained PR slices before implementation. |
|
|
33
|
+
| Budget is not code-golf | Never shrink a diff by deleting comments, blank lines, docs, or tests, or by compressing code, to fit the review budget (400 by default, or the session `review_budget_lines`). Slice by work unit or report the overage. |
|
|
33
34
|
|
|
34
35
|
## Work Unit Checklist
|
|
35
36
|
|
|
@@ -66,6 +67,7 @@ When `sdd-tasks` produces a Review Workload Forecast:
|
|
|
66
67
|
- Low risk: keep work-unit commits inside one PR.
|
|
67
68
|
- Medium risk: commit by work unit and monitor changed lines before PR creation.
|
|
68
69
|
- High risk: follow SDD `delivery_strategy` — ask on `ask-on-risk`, auto-slice on `auto-chain`, require `size:exception` on over-budget `single-pr`, or record accepted `size:exception` on `exception-ok`.
|
|
70
|
+
- Splitting is bounded: after one honest slicing pass, if no cohesive work-unit split fits the budget, stop and report the smallest honest count with a `size:exception` recommendation. Do not iterate shrinking the code to reach the number.
|
|
69
71
|
|
|
70
72
|
Each SDD work unit should map cleanly to a commit or PR with:
|
|
71
73
|
|
|
@@ -67,14 +67,15 @@ test("rendered SDD preflight prompt is English artifact copy", () => {
|
|
|
67
67
|
const prefs: SddPreflightPreferences = {
|
|
68
68
|
executionMode: "interactive",
|
|
69
69
|
artifactStore: "openspec",
|
|
70
|
-
chainedPrStrategy: "ask-
|
|
70
|
+
chainedPrStrategy: "ask-on-risk",
|
|
71
71
|
reviewBudgetLines: 400,
|
|
72
72
|
engramAvailable: false,
|
|
73
73
|
prompted: true,
|
|
74
74
|
};
|
|
75
75
|
const prompt = renderSddPreflightPrompt(prefs);
|
|
76
76
|
|
|
77
|
-
assert.match(prompt, /
|
|
77
|
+
assert.match(prompt, /These SDD preferences are explicit current-session choices/);
|
|
78
|
+
assert.match(prompt, /Delivery strategy: ask-on-risk/);
|
|
78
79
|
assert.match(prompt, /Review budget: 400 changed lines/);
|
|
79
80
|
assert.match(prompt, /complete only the current SDD phase/i);
|
|
80
81
|
assert.match(prompt, /Do not start the next SDD phase/i);
|
|
@@ -82,9 +83,15 @@ test("rendered SDD preflight prompt is English artifact copy", () => {
|
|
|
82
83
|
assert.match(prompt, /offer the user a proposal question round/i);
|
|
83
84
|
assert.match(prompt, /business rules, implications, impact, edge cases/i);
|
|
84
85
|
assert.match(prompt, /second question round/i);
|
|
86
|
+
assert.match(prompt, /explicit acceptance of `size:exception`/);
|
|
87
|
+
assert.match(prompt, /human-controlled consent, authorization, security, destructive\/publishing/);
|
|
85
88
|
for (const pattern of SPANISH_PREFLIGHT_COPY) {
|
|
86
89
|
assert.doesNotMatch(prompt, pattern);
|
|
87
90
|
}
|
|
91
|
+
|
|
92
|
+
const headless = renderSddPreflightPrompt({ ...prefs, executionMode: "auto", prompted: false });
|
|
93
|
+
assert.match(headless, /canonical defaults or persisted choices/);
|
|
94
|
+
assert.match(headless, /ambiguous-scope/);
|
|
88
95
|
});
|
|
89
96
|
|
|
90
97
|
test("orchestrator Memory Contract carries the Engram memory lifecycle rule", async () => {
|
|
@@ -159,7 +166,12 @@ test("orchestrator lazy-loads detailed SDD workflow", async () => {
|
|
|
159
166
|
const workflow = await readFile(join(ROOT, "assets/sdd-orchestrator-workflow.md"), "utf8");
|
|
160
167
|
|
|
161
168
|
assert.match(orchestrator, /## SDD Workflow \(lazy-loaded\)/);
|
|
162
|
-
assert.match(orchestrator,
|
|
169
|
+
assert.match(orchestrator, /Package assets root: `\{\{GENTLE_PI_ASSETS_ROOT\}\}`\. Lazy asset paths below are relative to this root\./);
|
|
170
|
+
assert.match(orchestrator, /`sdd-orchestrator-workflow\.md`/);
|
|
171
|
+
assert.doesNotMatch(orchestrator, /\{\{GENTLE_PI_SDD_WORKFLOW_PATH\}\}/);
|
|
172
|
+
assert.match(orchestrator, /injected `## SDD Session Preflight` block or a canonical-authority resolution/);
|
|
173
|
+
assert.match(orchestrator, /Defaults and capability constraints may resolve fields without confirmation prompts/);
|
|
174
|
+
assert.doesNotMatch(orchestrator, /or an explicit user answer covering the preflight choices/);
|
|
163
175
|
assert.doesNotMatch(orchestrator, /## Native SDD Dispatcher/);
|
|
164
176
|
assert.match(workflow, /## Native SDD Dispatcher/);
|
|
165
177
|
assert.match(workflow, /## SDD Status Contract/);
|
|
@@ -188,7 +200,7 @@ test("persistent harness prompt assets do not hardcode Spanish SDD artifact copy
|
|
|
188
200
|
assert.deepEqual(failures, []);
|
|
189
201
|
});
|
|
190
202
|
|
|
191
|
-
test("SDD assets
|
|
203
|
+
test("SDD assets route completed implementation directly through verify, sync, and archive", async () => {
|
|
192
204
|
const [tasks, apply, status, contract, chain] = await Promise.all([
|
|
193
205
|
readFile(join(ROOT, "assets/agents/sdd-tasks.md"), "utf8"),
|
|
194
206
|
readFile(join(ROOT, "assets/agents/sdd-apply.md"), "utf8"),
|
|
@@ -196,15 +208,16 @@ test("SDD assets define ownership markers and yield post-apply lifecycle to the
|
|
|
196
208
|
readFile(join(ROOT, "assets/support/sdd-status-contract.md"), "utf8"),
|
|
197
209
|
readFile(join(ROOT, "assets/chains/sdd-full.chain.md"), "utf8"),
|
|
198
210
|
]);
|
|
211
|
+
const assets = [tasks, apply, status, contract, chain].join("\n");
|
|
199
212
|
|
|
200
213
|
assert.match(tasks, /<!-- sdd-owner: implementation -->/);
|
|
201
|
-
assert.match(
|
|
202
|
-
assert.match(
|
|
203
|
-
assert.match(
|
|
204
|
-
assert.match(
|
|
205
|
-
assert.
|
|
206
|
-
assert.
|
|
207
|
-
assert.
|
|
214
|
+
assert.match(apply, /next_recommended: "sdd-verify"/);
|
|
215
|
+
assert.match(status, /verify.*ready/i);
|
|
216
|
+
assert.match(contract, /apply.*verify.*sync.*archive/is);
|
|
217
|
+
assert.match(chain, /apply.*verification/is);
|
|
218
|
+
assert.doesNotMatch(assets, /<!-- sdd-owner: parent -->/);
|
|
219
|
+
assert.doesNotMatch(assets, /parent-lifecycle/);
|
|
220
|
+
assert.doesNotMatch(assets, /approved receipt|bounded review/i);
|
|
208
221
|
assert.doesNotMatch(chain, /## sdd-review/);
|
|
209
222
|
});
|
|
210
223
|
|