@pmelab/gtd 40.0.0 → 42.0.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/.claude-plugin/plugin.json +1 -1
- package/README.md +41 -30
- package/dist/chunks/{reserved-Qt5FM6Ia.mjs → reserved-D7MNY9QJ.mjs} +66 -18
- package/dist/chunks/{steering-DVILanVf.mjs → steering-oCDdQlpP.mjs} +1 -1
- package/dist/chunks/tail-D2o2h5cc.mjs +246 -0
- package/dist/flows.mjs +11 -1
- package/dist/gtd.bundle.mjs +12 -2
- package/dist/steering.mjs +1 -1
- package/dist/testkit.mjs +15 -3
- package/dist/web/main.js +1 -1
- package/dist/workflow-kit.mjs +30 -12
- package/dist/workflows/cleanup.mjs +2 -2
- package/dist/workflows/feature.mjs +44 -24
- package/dist/workflows/fix.mjs +3 -3
- package/dist/workflows/review.mjs +2 -2
- package/dist/workflows/rollout.mjs +1 -1
- package/dist/workflows.mjs +282 -51
- package/package.json +1 -1
- package/src/flows/scripts.ts +15 -0
- package/src/steering/review.test.ts +2 -20
- package/src/steering/review.ts +2 -1
- package/src/testkit/FlowScripts.test.ts +17 -0
- package/src/testkit/FlowScripts.ts +15 -0
- package/src/testkit/steps.ts +27 -0
- package/src/workflow-kit/health.ts +42 -13
- package/src/workflows/feature/coverage.feature +3 -3
- package/src/workflows/feature/fast-path.feature +2 -2
- package/src/workflows/feature/feature.test.ts +2 -37
- package/src/workflows/feature/feature.ts +12 -14
- package/src/workflows/feature/flag-mode.feature +2 -2
- package/src/workflows/feature/lens-review.feature +234 -0
- package/src/workflows/feature/one-step-land.feature +2 -2
- package/src/workflows/feature/quality-unresolved.feature +47 -32
- package/src/workflows/feature/refactor-absorbs.feature +3 -3
- package/src/workflows/feature/refactor-first.feature +5 -5
- package/src/workflows/feature/refactor-rebuild.feature +7 -7
- package/src/workflows/feature/refactor-review.feature +19 -100
- package/src/workflows/feature/refactor.test.ts +12 -27
- package/src/workflows/feature/refactor.ts +0 -1
- package/src/workflows/feature/review-gate.feature +6 -6
- package/src/workflows/feature/review.test.ts +29 -25
- package/src/workflows/feature/review.ts +53 -10
- package/src/workflows/feature/seam-rejection.feature +2 -2
- package/src/workflows/feature/seam.feature +2 -2
- package/src/workflows/feature/seam.test.ts +1 -1
- package/src/workflows/feature/slicing.feature +6 -6
- package/src/workflows/index.ts +1 -0
- package/src/workflows/shared/health.test.ts +30 -0
- package/src/workflows/shared/health.ts +12 -9
- package/src/workflows/shared/lenses.test.ts +39 -0
- package/src/workflows/shared/lenses.ts +176 -0
- package/src/workflows/shared/options.ts +1 -0
- package/src/workflows/shared/progress.feature +124 -0
- package/src/workflows/shared/tail.ts +19 -4
- package/src/workflows/shared/text.test.ts +68 -1
- package/src/workflows/shared/text.ts +126 -13
- package/src/workflows/shared/vars.ts +1 -0
- package/dist/chunks/tail-tAHx_AHe.mjs +0 -112
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { read, refuse, removeScript, run, scope, showScript, vars } from "../flows.mjs";
|
|
2
|
-
import { fixFindings, lensEntriesOf, lensOf, qualityLap as qualityLap$1, reviewToHandOff } from "../workflow-kit.mjs";
|
|
3
|
-
import { C as fixCheck, D as reviewMissing, O as reviewQuality, T as fixRisks, Y as handOffAwaitReviewMessage, d as guarded, f as healthy, h as QUALITY, k as reviewing, l as escalation, w as fixQuality, x as awaitReview, y as REVIEW } from "./reserved-Qt5FM6Ia.mjs";
|
|
4
|
-
//#region src/workflows/shared/tail.ts
|
|
5
|
-
/** The reviewer's own `.gtd/REVIEW.md`, kept beside the human's notes so `fix` can tell them apart. */
|
|
6
|
-
const REVIEW_ORIG = ".gtd/REVIEW.orig.md";
|
|
7
|
-
/**
|
|
8
|
-
* One review turn per lens over the whole change, each appending every
|
|
9
|
-
* finding to `.gtd/QUALITY.md`. Resolves `"findings"` when that file
|
|
10
|
-
* has any.
|
|
11
|
-
*/
|
|
12
|
-
const qualityLap = (guard, lenses, base) => qualityLap$1(lenses ?? lensEntriesOf(vars.qualityReviews ?? ""), guarded((entry) => {
|
|
13
|
-
const { lens, model } = lensOf(entry);
|
|
14
|
-
return reviewQuality(lens, base, model);
|
|
15
|
-
}, guard), QUALITY);
|
|
16
|
-
/** Resolves `true` once `.gtd/QUALITY.md` is resolved, `false` when the fix cap escalated instead. */
|
|
17
|
-
const fixQualityFindings = (escalations, guard, guardRests = true, rules) => fixFindings({
|
|
18
|
-
fix: guarded(() => fixQuality(rules), guard),
|
|
19
|
-
findings: QUALITY,
|
|
20
|
-
cap: 3,
|
|
21
|
-
escalate: () => escalation(escalations, guard, guardRests, rules)
|
|
22
|
-
});
|
|
23
|
-
/** `.gtd/REVIEW.md` removed at the end of a round at commit `round`. */
|
|
24
|
-
const closeReview = (round) => run("review.closing", removeScript([REVIEW, REVIEW_ORIG]), {
|
|
25
|
-
label: "Closing the review",
|
|
26
|
-
base: round
|
|
27
|
-
});
|
|
28
|
-
/** Refuses while a reviewer's notes still await `gtd door fix`. */
|
|
29
|
-
const refusePendingHandOff = () => {
|
|
30
|
-
if (read(".gtd/REVIEW.orig.md") !== void 0) refuse(`gtd: ${REVIEW_ORIG} is a pending hand-off — run \`gtd door fix\`, or remove ${REVIEW} and ${REVIEW_ORIG}.`);
|
|
31
|
-
};
|
|
32
|
-
function tail(first, second, ...rest) {
|
|
33
|
-
const form = tailForm(first, second, rest);
|
|
34
|
-
if (form === void 0) return Promise.reject(/* @__PURE__ */ new Error("tail takes tail(finish, options?) or the deprecated tail(fixFirst, finish, green?, guard?, lenses?, guardRests?, lensBase?, rules?); this call fits neither"));
|
|
35
|
-
const [finish, options] = form;
|
|
36
|
-
return runTail(finish, options);
|
|
37
|
-
}
|
|
38
|
-
const isOptionalObject = (value) => value == null || typeof value === "object" && !Array.isArray(value) && typeof value.then !== "function";
|
|
39
|
-
const tailForm = (first, second, rest) => {
|
|
40
|
-
if (typeof second === "function" && typeof first !== "function") {
|
|
41
|
-
const [green, guard, lenses, guardRests, lensBase, rules] = rest;
|
|
42
|
-
return [second, {
|
|
43
|
-
fixFirst: first,
|
|
44
|
-
green,
|
|
45
|
-
guard,
|
|
46
|
-
lenses,
|
|
47
|
-
guardRests,
|
|
48
|
-
lensBase,
|
|
49
|
-
rules
|
|
50
|
-
}];
|
|
51
|
-
}
|
|
52
|
-
if (typeof first === "function" && isOptionalObject(second) && rest.every((v) => v == null)) return [first, second ?? {}];
|
|
53
|
-
};
|
|
54
|
-
const runTail = (finish, options) => scope("build", async () => {
|
|
55
|
-
const { guard, lenses, lensBase, rules } = options;
|
|
56
|
-
const guardRests = options.guardRests === void 0 ? true : options.guardRests;
|
|
57
|
-
const escalations = { rounds: 0 };
|
|
58
|
-
const fix = () => fixCheck(rules);
|
|
59
|
-
const repair = async () => {
|
|
60
|
-
await guarded(fix, guard)();
|
|
61
|
-
await healthy(fix, {
|
|
62
|
-
fixesSoFar: 1,
|
|
63
|
-
escalations,
|
|
64
|
-
guard,
|
|
65
|
-
guardRests,
|
|
66
|
-
rules
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
if (options.fixFirst) await repair();
|
|
70
|
-
else if (!options.green) await healthy(fix, {
|
|
71
|
-
escalations,
|
|
72
|
-
guard,
|
|
73
|
-
guardRests,
|
|
74
|
-
rules
|
|
75
|
-
});
|
|
76
|
-
if (await qualityLap(guard, lenses, lensBase) === "findings") if (await fixQualityFindings(escalations, guard, guardRests, rules)) await healthy(fix, {
|
|
77
|
-
escalations,
|
|
78
|
-
guard,
|
|
79
|
-
guardRests,
|
|
80
|
-
rules
|
|
81
|
-
});
|
|
82
|
-
else await repair();
|
|
83
|
-
return finish(escalations);
|
|
84
|
-
});
|
|
85
|
-
/**
|
|
86
|
-
* The review and fix workflows' human review since `base`: a sign-off closes
|
|
87
|
-
* `.gtd/REVIEW.md`; a note leaves it, with the reviewer's own version as
|
|
88
|
-
* `REVIEW_ORIG`, for the next `fix` to read — never a re-plan.
|
|
89
|
-
*/
|
|
90
|
-
const handOffReview = (base, escalations, guard) => reviewToHandOff(base, {
|
|
91
|
-
file: REVIEW,
|
|
92
|
-
reviewing: guarded((b, carry) => reviewing(b, carry), guard),
|
|
93
|
-
fixRisks: guarded(fixRisks, guard),
|
|
94
|
-
keepGreen: () => healthy(fixCheck, {
|
|
95
|
-
escalations,
|
|
96
|
-
guard
|
|
97
|
-
}),
|
|
98
|
-
awaitReview: (b) => awaitReview(b, handOffAwaitReviewMessage(b)),
|
|
99
|
-
reviewMissing,
|
|
100
|
-
close: closeReview,
|
|
101
|
-
handOff: (reviewed) => run("review.handing-off", showScript(reviewed, REVIEW, REVIEW_ORIG), { label: "Handing your notes to fix" }),
|
|
102
|
-
threadsPending: "gtd land: open-threads: a thread in .gtd/REVIEW.md or an `H:` code comment waits on the agent — nothing answers it here; delete it, or turn it into a note for fix.",
|
|
103
|
-
unparsed: "gtd land: review-doc: your edit to .gtd/REVIEW.md contains no note fix can read — restore the deleted chunk, or write the note as a line under its entry.",
|
|
104
|
-
deleted: "gtd land: review-doc: .gtd/REVIEW.md was deleted — restore it, or leave a note to hand to fix."
|
|
105
|
-
});
|
|
106
|
-
/** The tail the review and fix workflows run: ends at the hand-off review since `base`. */
|
|
107
|
-
const handOffTail = (fixFirst, base, guard) => tail((escalations) => handOffReview(base, escalations, guard), {
|
|
108
|
-
fixFirst,
|
|
109
|
-
guard
|
|
110
|
-
});
|
|
111
|
-
//#endregion
|
|
112
|
-
export { refusePendingHandOff as a, isOptionalObject as i, closeReview as n, tail as o, handOffTail as r, REVIEW_ORIG as t };
|