forge-cc 0.1.9 → 0.1.11
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 +253 -178
- package/dist/cli.js +109 -8
- package/dist/cli.js.map +1 -1
- package/dist/gates/codex-gate.d.ts +51 -0
- package/dist/gates/codex-gate.js +121 -0
- package/dist/gates/codex-gate.js.map +1 -0
- package/dist/go/auto-chain.d.ts +13 -23
- package/dist/go/auto-chain.js +29 -101
- package/dist/go/auto-chain.js.map +1 -1
- package/dist/go/executor.d.ts +5 -0
- package/dist/go/executor.js +43 -5
- package/dist/go/executor.js.map +1 -1
- package/dist/go/finalize.d.ts +50 -1
- package/dist/go/finalize.js +122 -0
- package/dist/go/finalize.js.map +1 -1
- package/dist/go/prd-queue.d.ts +43 -0
- package/dist/go/prd-queue.js +67 -0
- package/dist/go/prd-queue.js.map +1 -0
- package/dist/go/prd-selector.d.ts +57 -0
- package/dist/go/prd-selector.js +101 -0
- package/dist/go/prd-selector.js.map +1 -0
- package/dist/go/verify-loop.d.ts +18 -1
- package/dist/go/verify-loop.js +119 -2
- package/dist/go/verify-loop.js.map +1 -1
- package/dist/spec/templates.d.ts +2 -2
- package/dist/state/prd-status.d.ts +59 -0
- package/dist/state/prd-status.js +121 -0
- package/dist/state/prd-status.js.map +1 -0
- package/dist/state/reader.d.ts +2 -24
- package/dist/state/reader.js +4 -77
- package/dist/state/reader.js.map +1 -1
- package/dist/state/writer.d.ts +2 -41
- package/dist/state/writer.js +14 -130
- package/dist/state/writer.js.map +1 -1
- package/dist/team/consensus.d.ts +28 -0
- package/dist/team/consensus.js +130 -0
- package/dist/team/consensus.js.map +1 -0
- package/dist/team/index.d.ts +4 -0
- package/dist/team/index.js +5 -0
- package/dist/team/index.js.map +1 -0
- package/dist/team/lifecycle.d.ts +37 -0
- package/dist/team/lifecycle.js +92 -0
- package/dist/team/lifecycle.js.map +1 -0
- package/dist/team/reviewer.d.ts +10 -0
- package/dist/team/reviewer.js +345 -0
- package/dist/team/reviewer.js.map +1 -0
- package/dist/team/types.d.ts +269 -0
- package/dist/team/types.js +70 -0
- package/dist/team/types.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils/browser.d.ts +1 -1
- package/dist/utils/browser.js +8 -1
- package/dist/utils/browser.js.map +1 -1
- package/dist/worktree/session.d.ts +3 -0
- package/dist/worktree/session.js +1 -0
- package/dist/worktree/session.js.map +1 -1
- package/package.json +2 -1
- package/skills/forge-go.md +176 -62
- package/skills/forge-spec.md +30 -5
package/dist/spec/templates.d.ts
CHANGED
|
@@ -259,6 +259,7 @@ export declare const PRDSchema: z.ZodObject<{
|
|
|
259
259
|
}>;
|
|
260
260
|
}, "strip", z.ZodTypeAny, {
|
|
261
261
|
status: string;
|
|
262
|
+
project: string;
|
|
262
263
|
branch: string;
|
|
263
264
|
milestones: {
|
|
264
265
|
number: number;
|
|
@@ -277,7 +278,6 @@ export declare const PRDSchema: z.ZodObject<{
|
|
|
277
278
|
maxContextWindowFit: boolean;
|
|
278
279
|
dependsOn: number[];
|
|
279
280
|
}[];
|
|
280
|
-
project: string;
|
|
281
281
|
assignedTo: string;
|
|
282
282
|
created: string;
|
|
283
283
|
overview: string;
|
|
@@ -306,6 +306,7 @@ export declare const PRDSchema: z.ZodObject<{
|
|
|
306
306
|
linearProject?: string | undefined;
|
|
307
307
|
}, {
|
|
308
308
|
status: string;
|
|
309
|
+
project: string;
|
|
309
310
|
branch: string;
|
|
310
311
|
milestones: {
|
|
311
312
|
number: number;
|
|
@@ -324,7 +325,6 @@ export declare const PRDSchema: z.ZodObject<{
|
|
|
324
325
|
maxContextWindowFit?: boolean | undefined;
|
|
325
326
|
dependsOn?: number[] | undefined;
|
|
326
327
|
}[];
|
|
327
|
-
project: string;
|
|
328
328
|
assignedTo: string;
|
|
329
329
|
created: string;
|
|
330
330
|
overview: string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MilestoneStatusSchema: z.ZodObject<{
|
|
3
|
+
status: z.ZodEnum<["pending", "in_progress", "complete"]>;
|
|
4
|
+
date: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
status: "pending" | "in_progress" | "complete";
|
|
7
|
+
date?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
status: "pending" | "in_progress" | "complete";
|
|
10
|
+
date?: string | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const PRDStatusSchema: z.ZodObject<{
|
|
13
|
+
project: z.ZodString;
|
|
14
|
+
slug: z.ZodString;
|
|
15
|
+
branch: z.ZodString;
|
|
16
|
+
createdAt: z.ZodString;
|
|
17
|
+
milestones: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
18
|
+
status: z.ZodEnum<["pending", "in_progress", "complete"]>;
|
|
19
|
+
date: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
status: "pending" | "in_progress" | "complete";
|
|
22
|
+
date?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
status: "pending" | "in_progress" | "complete";
|
|
25
|
+
date?: string | undefined;
|
|
26
|
+
}>>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
project: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
branch: string;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
milestones: Record<string, {
|
|
33
|
+
status: "pending" | "in_progress" | "complete";
|
|
34
|
+
date?: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
}, {
|
|
37
|
+
project: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
branch: string;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
milestones: Record<string, {
|
|
42
|
+
status: "pending" | "in_progress" | "complete";
|
|
43
|
+
date?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
}>;
|
|
46
|
+
export type PRDStatus = z.infer<typeof PRDStatusSchema>;
|
|
47
|
+
export type MilestoneStatus = z.infer<typeof MilestoneStatusSchema>;
|
|
48
|
+
export declare function readPRDStatus(projectDir: string, slug: string): Promise<PRDStatus | null>;
|
|
49
|
+
export declare function writePRDStatus(projectDir: string, slug: string, status: PRDStatus): Promise<void>;
|
|
50
|
+
export declare function updateMilestoneStatus(projectDir: string, slug: string, milestoneNumber: number, status: "pending" | "in_progress" | "complete"): Promise<void>;
|
|
51
|
+
export declare function discoverPRDs(projectDir: string): Promise<Array<{
|
|
52
|
+
slug: string;
|
|
53
|
+
status: PRDStatus;
|
|
54
|
+
}>>;
|
|
55
|
+
export declare function findNextPendingMilestone(projectDir: string, slug: string): Promise<{
|
|
56
|
+
number: number;
|
|
57
|
+
status: MilestoneStatus;
|
|
58
|
+
} | null>;
|
|
59
|
+
export declare function countPendingMilestones(projectDir: string, slug?: string): Promise<number>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { readFile, writeFile, readdir, mkdir } from "node:fs/promises";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// Schemas
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
export const MilestoneStatusSchema = z.object({
|
|
8
|
+
status: z.enum(["pending", "in_progress", "complete"]),
|
|
9
|
+
date: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
export const PRDStatusSchema = z.object({
|
|
12
|
+
project: z.string(),
|
|
13
|
+
slug: z.string(),
|
|
14
|
+
branch: z.string(),
|
|
15
|
+
createdAt: z.string(),
|
|
16
|
+
milestones: z.record(z.string(), MilestoneStatusSchema),
|
|
17
|
+
});
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Helpers
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
function statusDir(projectDir) {
|
|
22
|
+
return join(projectDir, ".planning", "status");
|
|
23
|
+
}
|
|
24
|
+
function statusFilePath(projectDir, slug) {
|
|
25
|
+
return join(statusDir(projectDir), `${slug}.json`);
|
|
26
|
+
}
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// readPRDStatus
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
export async function readPRDStatus(projectDir, slug) {
|
|
31
|
+
const filePath = statusFilePath(projectDir, slug);
|
|
32
|
+
try {
|
|
33
|
+
const raw = await readFile(filePath, "utf-8");
|
|
34
|
+
const parsed = JSON.parse(raw);
|
|
35
|
+
return PRDStatusSchema.parse(parsed);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// writePRDStatus
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
export async function writePRDStatus(projectDir, slug, status) {
|
|
45
|
+
const filePath = statusFilePath(projectDir, slug);
|
|
46
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
47
|
+
const content = JSON.stringify(status, null, 2) + "\n";
|
|
48
|
+
await writeFile(filePath, content, "utf-8");
|
|
49
|
+
}
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// updateMilestoneStatus
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
export async function updateMilestoneStatus(projectDir, slug, milestoneNumber, status) {
|
|
54
|
+
const current = await readPRDStatus(projectDir, slug);
|
|
55
|
+
if (!current) {
|
|
56
|
+
throw new Error(`PRD status file not found for slug: ${slug}`);
|
|
57
|
+
}
|
|
58
|
+
const key = String(milestoneNumber);
|
|
59
|
+
const milestoneEntry = { status };
|
|
60
|
+
if (status === "complete") {
|
|
61
|
+
milestoneEntry.date = new Date().toISOString().slice(0, 10);
|
|
62
|
+
}
|
|
63
|
+
current.milestones[key] = milestoneEntry;
|
|
64
|
+
await writePRDStatus(projectDir, slug, current);
|
|
65
|
+
}
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
// discoverPRDs
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
export async function discoverPRDs(projectDir) {
|
|
70
|
+
const dir = statusDir(projectDir);
|
|
71
|
+
let files;
|
|
72
|
+
try {
|
|
73
|
+
files = await readdir(dir);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
const results = [];
|
|
79
|
+
for (const file of files) {
|
|
80
|
+
if (!file.endsWith(".json"))
|
|
81
|
+
continue;
|
|
82
|
+
const slug = file.replace(/\.json$/, "");
|
|
83
|
+
const status = await readPRDStatus(projectDir, slug);
|
|
84
|
+
if (status) {
|
|
85
|
+
results.push({ slug, status });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
results.sort((a, b) => a.slug.localeCompare(b.slug));
|
|
89
|
+
return results;
|
|
90
|
+
}
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// findNextPendingMilestone
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
export async function findNextPendingMilestone(projectDir, slug) {
|
|
95
|
+
const prd = await readPRDStatus(projectDir, slug);
|
|
96
|
+
if (!prd)
|
|
97
|
+
return null;
|
|
98
|
+
const entries = Object.entries(prd.milestones)
|
|
99
|
+
.map(([key, value]) => ({ number: parseInt(key, 10), status: value }))
|
|
100
|
+
.filter((e) => e.status.status === "pending")
|
|
101
|
+
.sort((a, b) => a.number - b.number);
|
|
102
|
+
return entries.length > 0 ? entries[0] : null;
|
|
103
|
+
}
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// countPendingMilestones
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
export async function countPendingMilestones(projectDir, slug) {
|
|
108
|
+
if (slug) {
|
|
109
|
+
const prd = await readPRDStatus(projectDir, slug);
|
|
110
|
+
if (!prd)
|
|
111
|
+
return 0;
|
|
112
|
+
return Object.values(prd.milestones).filter((m) => m.status === "pending").length;
|
|
113
|
+
}
|
|
114
|
+
const allPRDs = await discoverPRDs(projectDir);
|
|
115
|
+
let count = 0;
|
|
116
|
+
for (const entry of allPRDs) {
|
|
117
|
+
count += Object.values(entry.status.milestones).filter((m) => m.status === "pending").length;
|
|
118
|
+
}
|
|
119
|
+
return count;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=prd-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prd-status.js","sourceRoot":"","sources":["../../src/state/prd-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,qBAAqB,CAAC;CACxD,CAAC,CAAC;AAKH,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,SAAS,CAAC,UAAkB;IACnC,OAAO,IAAI,CAAC,UAAU,EAAE,W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IAAI,EAAE,CAAC;QACT,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG;YAAE,OAAO,CAAC,CAAC;QACnB,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,MAAM,CACzC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAC9B,CAAC,MAAM,CAAC;IACX,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CACpD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAC9B,CAAC,MAAM,CAAC;IACX,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/state/reader.d.ts
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
export interface StateInfo {
|
|
2
|
-
currentMilestone: {
|
|
3
|
-
number: number;
|
|
4
|
-
name: string;
|
|
5
|
-
} | null;
|
|
6
|
-
branch: string | null;
|
|
7
|
-
lastSession: string | null;
|
|
8
|
-
nextActions: string[];
|
|
9
|
-
raw: string;
|
|
10
|
-
}
|
|
11
|
-
export interface MilestoneProgress {
|
|
12
|
-
number: number;
|
|
13
|
-
name: string;
|
|
14
|
-
status: string;
|
|
15
|
-
}
|
|
16
|
-
export interface RoadmapInfo {
|
|
17
|
-
milestones: MilestoneProgress[];
|
|
18
|
-
raw: string;
|
|
19
|
-
}
|
|
20
1
|
export interface SessionContext {
|
|
21
|
-
|
|
22
|
-
roadmap: RoadmapInfo | null;
|
|
2
|
+
prdSlug: string;
|
|
23
3
|
currentMilestoneSection: string | null;
|
|
24
4
|
estimatedTokens: number;
|
|
25
5
|
}
|
|
26
|
-
export declare function readStateFile(projectDir: string): Promise<StateInfo | null>;
|
|
27
|
-
export declare function readRoadmapProgress(projectDir: string): Promise<RoadmapInfo | null>;
|
|
28
6
|
export declare function readCurrentMilestone(prdPath: string, milestoneNumber: number): Promise<string | null>;
|
|
29
|
-
export declare function readSessionContext(projectDir: string, prdPath: string, milestoneNumber: number): Promise<SessionContext>;
|
|
7
|
+
export declare function readSessionContext(projectDir: string, prdPath: string, milestoneNumber: number, prdSlug: string): Promise<SessionContext>;
|
package/dist/state/reader.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
2
|
// ---------------------------------------------------------------------------
|
|
4
3
|
// Helpers
|
|
5
4
|
// ---------------------------------------------------------------------------
|
|
@@ -20,74 +19,6 @@ function estimateTokens(...texts) {
|
|
|
20
19
|
return Math.ceil(chars / 4);
|
|
21
20
|
}
|
|
22
21
|
// ---------------------------------------------------------------------------
|
|
23
|
-
// readStateFile
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
export async function readStateFile(projectDir) {
|
|
26
|
-
const raw = await safeRead(join(projectDir, ".planning", "STATE.md"));
|
|
27
|
-
if (raw === null)
|
|
28
|
-
return null;
|
|
29
|
-
// Extract milestone: "Milestone 2 — Linear Integration + Triage Skill"
|
|
30
|
-
let currentMilestone = null;
|
|
31
|
-
const milestoneMatch = raw.match(/\*\*Milestone:\*\*\s*Milestone\s+(\d+)\s*[—–-]\s*(.+)/);
|
|
32
|
-
if (milestoneMatch) {
|
|
33
|
-
currentMilestone = {
|
|
34
|
-
number: parseInt(milestoneMatch[1], 10),
|
|
35
|
-
name: milestoneMatch[2].trim(),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// Extract branch
|
|
39
|
-
let branch = null;
|
|
40
|
-
const branchMatch = raw.match(/\*\*Branch:\*\*\s*`?([^\s`]+)`?/);
|
|
41
|
-
if (branchMatch) {
|
|
42
|
-
branch = branchMatch[1];
|
|
43
|
-
}
|
|
44
|
-
// Extract last session date
|
|
45
|
-
let lastSession = null;
|
|
46
|
-
const sessionMatch = raw.match(/\*\*Last Session:\*\*\s*(\S+)/);
|
|
47
|
-
if (sessionMatch) {
|
|
48
|
-
lastSession = sessionMatch[1];
|
|
49
|
-
}
|
|
50
|
-
// Extract next actions — numbered list items after "## Next Actions"
|
|
51
|
-
const nextActions = [];
|
|
52
|
-
const actionsSection = raw.match(/##\s*Next Actions\s*\n([\s\S]*?)(?=\n##\s|\n---|\s*$)/);
|
|
53
|
-
if (actionsSection) {
|
|
54
|
-
const lines = actionsSection[1].split("\n");
|
|
55
|
-
for (const line of lines) {
|
|
56
|
-
const item = line.match(/^\s*\d+\.\s+(.+)/);
|
|
57
|
-
if (item) {
|
|
58
|
-
nextActions.push(item[1].trim());
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return { currentMilestone, branch, lastSession, nextActions, raw };
|
|
63
|
-
}
|
|
64
|
-
// ---------------------------------------------------------------------------
|
|
65
|
-
// readRoadmapProgress
|
|
66
|
-
// ---------------------------------------------------------------------------
|
|
67
|
-
export async function readRoadmapProgress(projectDir) {
|
|
68
|
-
const raw = await safeRead(join(projectDir, ".planning", "ROADMAP.md"));
|
|
69
|
-
if (raw === null)
|
|
70
|
-
return null;
|
|
71
|
-
const milestones = [];
|
|
72
|
-
// Match table rows: | 1 | Core CLI + Verification Engine | Complete (2026-02-15) |
|
|
73
|
-
const tableRowRe = /^\|\s*(\d+)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|/gm;
|
|
74
|
-
let match;
|
|
75
|
-
while ((match = tableRowRe.exec(raw)) !== null) {
|
|
76
|
-
// Skip the header separator row (contains dashes)
|
|
77
|
-
if (match[2].includes("---"))
|
|
78
|
-
continue;
|
|
79
|
-
// Skip the header row itself
|
|
80
|
-
if (match[1] === "Milestone" || match[2] === "Name")
|
|
81
|
-
continue;
|
|
82
|
-
milestones.push({
|
|
83
|
-
number: parseInt(match[1], 10),
|
|
84
|
-
name: match[2].trim(),
|
|
85
|
-
status: match[3].trim(),
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return { milestones, raw };
|
|
89
|
-
}
|
|
90
|
-
// ---------------------------------------------------------------------------
|
|
91
22
|
// readCurrentMilestone
|
|
92
23
|
// ---------------------------------------------------------------------------
|
|
93
24
|
export async function readCurrentMilestone(prdPath, milestoneNumber) {
|
|
@@ -104,13 +35,9 @@ export async function readCurrentMilestone(prdPath, milestoneNumber) {
|
|
|
104
35
|
// ---------------------------------------------------------------------------
|
|
105
36
|
// readSessionContext
|
|
106
37
|
// ---------------------------------------------------------------------------
|
|
107
|
-
export async function readSessionContext(projectDir, prdPath, milestoneNumber) {
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
readCurrentMilestone(prdPath, milestoneNumber),
|
|
112
|
-
]);
|
|
113
|
-
const estimatedTokens = estimateTokens(state?.raw, roadmap?.raw, currentMilestoneSection);
|
|
114
|
-
return { state, roadmap, currentMilestoneSection, estimatedTokens };
|
|
38
|
+
export async function readSessionContext(projectDir, prdPath, milestoneNumber, prdSlug) {
|
|
39
|
+
const currentMilestoneSection = await readCurrentMilestone(prdPath, milestoneNumber);
|
|
40
|
+
const estimatedTokens = estimateTokens(currentMilestoneSection);
|
|
41
|
+
return { prdSlug, currentMilestoneSection, estimatedTokens };
|
|
115
42
|
}
|
|
116
43
|
//# sourceMappingURL=reader.js.map
|
package/dist/state/reader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader.js","sourceRoot":"","sources":["../../src/state/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"reader.js","sourceRoot":"","sources":["../../src/state/reader.ts"],"names":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AAM,oBAAoB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACrF,MAAM,eAAe,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC;IAEhE,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,CAAC;AAC/D,CAAC"}
|
package/dist/state/writer.d.ts
CHANGED
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
export interface StateWriteInput {
|
|
2
|
-
project: string;
|
|
3
|
-
milestone: {
|
|
4
|
-
number: number;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
branch: string;
|
|
8
|
-
activePrd: string;
|
|
9
|
-
lastSession: string;
|
|
10
|
-
milestoneTable: Array<{
|
|
11
|
-
number: number;
|
|
12
|
-
name: string;
|
|
13
|
-
status: string;
|
|
14
|
-
}>;
|
|
15
|
-
nextActions: string[];
|
|
16
|
-
}
|
|
17
|
-
export interface SessionMemoryInput {
|
|
18
|
-
date: string;
|
|
19
|
-
developer: string;
|
|
20
|
-
workingOn: string;
|
|
21
|
-
status: string;
|
|
22
|
-
next: string;
|
|
23
|
-
blockers: string;
|
|
24
|
-
}
|
|
25
|
-
export declare function writeStateFile(projectDir: string, info: StateWriteInput): Promise<void>;
|
|
26
|
-
export declare function updateRoadmapMilestone(projectDir: string, milestoneNumber: number, status: string): Promise<void>;
|
|
27
|
-
export declare function writeSessionMemory(projectDir: string, branch: string, data: SessionMemoryInput): Promise<void>;
|
|
28
1
|
export interface CommitOptions {
|
|
29
2
|
projectDir: string;
|
|
30
3
|
milestoneNumber: number;
|
|
@@ -39,22 +12,10 @@ export interface CommitResult {
|
|
|
39
12
|
}
|
|
40
13
|
export interface MilestoneUpdateOptions {
|
|
41
14
|
projectDir: string;
|
|
42
|
-
|
|
15
|
+
prdSlug: string;
|
|
43
16
|
milestoneNumber: number;
|
|
44
17
|
milestoneName: string;
|
|
45
|
-
branch: string;
|
|
46
|
-
activePrd: string;
|
|
47
|
-
developer: string;
|
|
48
|
-
nextMilestone?: {
|
|
49
|
-
number: number;
|
|
50
|
-
name: string;
|
|
51
|
-
};
|
|
52
|
-
milestoneTable: Array<{
|
|
53
|
-
number: number;
|
|
54
|
-
name: string;
|
|
55
|
-
status: string;
|
|
56
|
-
}>;
|
|
57
18
|
}
|
|
58
19
|
export declare function commitMilestoneWork(options: CommitOptions): CommitResult;
|
|
59
|
-
export declare function isLastMilestone(projectDir: string, milestoneNumber: number): Promise<boolean>;
|
|
20
|
+
export declare function isLastMilestone(projectDir: string, prdSlug: string, milestoneNumber: number): Promise<boolean>;
|
|
60
21
|
export declare function updateMilestoneProgress(options: MilestoneUpdateOptions): Promise<void>;
|
package/dist/state/writer.js
CHANGED
|
@@ -1,80 +1,5 @@
|
|
|
1
|
-
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
2
1
|
import { execSync } from "node:child_process";
|
|
3
|
-
import {
|
|
4
|
-
import { readRoadmapProgress } from "./reader.js";
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
// Helpers
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
async function ensureDir(filePath) {
|
|
9
|
-
await mkdir(dirname(filePath), { recursive: true });
|
|
10
|
-
}
|
|
11
|
-
function branchSlug(branch) {
|
|
12
|
-
return branch.replace(/\//g, "-").toLowerCase();
|
|
13
|
-
}
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
|
-
// writeStateFile
|
|
16
|
-
// ---------------------------------------------------------------------------
|
|
17
|
-
export async function writeStateFile(projectDir, info) {
|
|
18
|
-
const milestoneRows = info.milestoneTable
|
|
19
|
-
.map((m) => `| ${m.number} | ${m.name} | ${m.status} |`)
|
|
20
|
-
.join("\n");
|
|
21
|
-
const nextActions = info.nextActions
|
|
22
|
-
.map((a, i) => `${i + 1}. ${a}`)
|
|
23
|
-
.join("\n");
|
|
24
|
-
const content = `# ${info.project} — Project State
|
|
25
|
-
|
|
26
|
-
## Current Position
|
|
27
|
-
- **Project:** ${info.project} (build phase)
|
|
28
|
-
- **Milestone:** Milestone ${info.milestone.number} — ${info.milestone.name}
|
|
29
|
-
- **Branch:** ${info.branch}
|
|
30
|
-
- **Active PRD:** \`${info.activePrd}\`
|
|
31
|
-
- **Last Session:** ${info.lastSession}
|
|
32
|
-
|
|
33
|
-
## Milestone Progress
|
|
34
|
-
| Milestone | Name | Status |
|
|
35
|
-
|-----------|------|--------|
|
|
36
|
-
${milestoneRows}
|
|
37
|
-
|
|
38
|
-
## Next Actions
|
|
39
|
-
${nextActions}
|
|
40
|
-
`;
|
|
41
|
-
const filePath = join(projectDir, ".planning", "STATE.md");
|
|
42
|
-
await ensureDir(filePath);
|
|
43
|
-
await writeFile(filePath, content, "utf-8");
|
|
44
|
-
}
|
|
45
|
-
// ---------------------------------------------------------------------------
|
|
46
|
-
// updateRoadmapMilestone
|
|
47
|
-
// ---------------------------------------------------------------------------
|
|
48
|
-
export async function updateRoadmapMilestone(projectDir, milestoneNumber, status) {
|
|
49
|
-
const filePath = join(projectDir, ".planning", "ROADMAP.md");
|
|
50
|
-
const raw = await readFile(filePath, "utf-8");
|
|
51
|
-
// Match the specific milestone row and replace its status
|
|
52
|
-
const pattern = new RegExp(`^(\\|\\s*${milestoneNumber}\\s*\\|\\s*.+?\\s*\\|)\\s*.+?\\s*\\|`, "m");
|
|
53
|
-
const match = raw.match(pattern);
|
|
54
|
-
if (!match) {
|
|
55
|
-
throw new Error(`Milestone ${milestoneNumber} not found in ROADMAP.md table`);
|
|
56
|
-
}
|
|
57
|
-
const updated = raw.replace(pattern, `$1 ${status} |`);
|
|
58
|
-
await writeFile(filePath, updated, "utf-8");
|
|
59
|
-
}
|
|
60
|
-
// ---------------------------------------------------------------------------
|
|
61
|
-
// writeSessionMemory
|
|
62
|
-
// ---------------------------------------------------------------------------
|
|
63
|
-
export async function writeSessionMemory(projectDir, branch, data) {
|
|
64
|
-
const slug = branchSlug(branch);
|
|
65
|
-
const filePath = join(projectDir, ".claude", "memory", `session-${slug}.md`);
|
|
66
|
-
const content = `# Session State
|
|
67
|
-
**Date:** ${data.date}
|
|
68
|
-
**Developer:** ${data.developer}
|
|
69
|
-
**Branch:** ${branch}
|
|
70
|
-
**Working On:** ${data.workingOn}
|
|
71
|
-
**Status:** ${data.status}
|
|
72
|
-
**Next:** ${data.next}
|
|
73
|
-
**Blockers:** ${data.blockers}
|
|
74
|
-
`;
|
|
75
|
-
await ensureDir(filePath);
|
|
76
|
-
await writeFile(filePath, content, "utf-8");
|
|
77
|
-
}
|
|
2
|
+
import { readPRDStatus, updateMilestoneStatus } from "./prd-status.js";
|
|
78
3
|
// ---------------------------------------------------------------------------
|
|
79
4
|
// commitMilestoneWork — commits and optionally pushes milestone work
|
|
80
5
|
// ---------------------------------------------------------------------------
|
|
@@ -158,65 +83,24 @@ export function commitMilestoneWork(options) {
|
|
|
158
83
|
// ---------------------------------------------------------------------------
|
|
159
84
|
// isLastMilestone — detects if this is the final pending milestone
|
|
160
85
|
// ---------------------------------------------------------------------------
|
|
161
|
-
export async function isLastMilestone(projectDir, milestoneNumber) {
|
|
162
|
-
const
|
|
163
|
-
if (!
|
|
164
|
-
return true; // No roadmap data — treat as last by default
|
|
165
|
-
}
|
|
166
|
-
const maxMilestone = Math.max(...roadmap.milestones.map((m) => m.number));
|
|
167
|
-
// If this IS the highest milestone number, it's the last
|
|
168
|
-
if (milestoneNumber >= maxMilestone) {
|
|
86
|
+
export async function isLastMilestone(projectDir, prdSlug, milestoneNumber) {
|
|
87
|
+
const status = await readPRDStatus(projectDir, prdSlug);
|
|
88
|
+
if (!status)
|
|
169
89
|
return true;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
90
|
+
const milestoneNumbers = Object.keys(status.milestones).map((k) => parseInt(k, 10));
|
|
91
|
+
const maxMilestone = Math.max(...milestoneNumbers);
|
|
92
|
+
if (milestoneNumber >= maxMilestone)
|
|
93
|
+
return true;
|
|
94
|
+
// Check if all milestones after this one are complete
|
|
95
|
+
const remaining = milestoneNumbers.filter((n) => n > milestoneNumber &&
|
|
96
|
+
status.milestones[String(n)].status !== "complete");
|
|
174
97
|
return remaining.length === 0;
|
|
175
98
|
}
|
|
176
99
|
// ---------------------------------------------------------------------------
|
|
177
|
-
// updateMilestoneProgress —
|
|
100
|
+
// updateMilestoneProgress — marks a milestone as complete in PRD status
|
|
178
101
|
// ---------------------------------------------------------------------------
|
|
179
102
|
export async function updateMilestoneProgress(options) {
|
|
180
|
-
const { projectDir,
|
|
181
|
-
|
|
182
|
-
// 1. Mark this milestone as complete in ROADMAP.md
|
|
183
|
-
await updateRoadmapMilestone(projectDir, milestoneNumber, `Complete (${today})`);
|
|
184
|
-
// 2. Build next actions based on whether there's a next milestone
|
|
185
|
-
const nextActions = nextMilestone
|
|
186
|
-
? [
|
|
187
|
-
`Begin Milestone ${nextMilestone.number} — ${nextMilestone.name}`,
|
|
188
|
-
"Read PRD for next milestone scope",
|
|
189
|
-
"Spawn agent team for next milestone",
|
|
190
|
-
]
|
|
191
|
-
: [
|
|
192
|
-
"All milestones complete — final review and cleanup",
|
|
193
|
-
"Merge feature branch to main",
|
|
194
|
-
"Archive planning docs",
|
|
195
|
-
];
|
|
196
|
-
// 3. Update STATE.md with current position
|
|
197
|
-
const stateTarget = nextMilestone ?? {
|
|
198
|
-
number: milestoneNumber,
|
|
199
|
-
name: milestoneName,
|
|
200
|
-
};
|
|
201
|
-
await writeStateFile(projectDir, {
|
|
202
|
-
project,
|
|
203
|
-
milestone: stateTarget,
|
|
204
|
-
branch,
|
|
205
|
-
activePrd,
|
|
206
|
-
lastSession: today,
|
|
207
|
-
milestoneTable,
|
|
208
|
-
nextActions,
|
|
209
|
-
});
|
|
210
|
-
// 4. Write session memory for this branch
|
|
211
|
-
await writeSessionMemory(projectDir, branch, {
|
|
212
|
-
date: today,
|
|
213
|
-
developer,
|
|
214
|
-
workingOn: `Milestone ${milestoneNumber} — ${milestoneName}`,
|
|
215
|
-
status: "Complete",
|
|
216
|
-
next: nextMilestone
|
|
217
|
-
? `Milestone ${nextMilestone.number} — ${nextMilestone.name}`
|
|
218
|
-
: "All milestones complete",
|
|
219
|
-
blockers: "None",
|
|
220
|
-
});
|
|
103
|
+
const { projectDir, prdSlug, milestoneNumber } = options;
|
|
104
|
+
await updateMilestoneStatus(projectDir, prdSlug, milestoneNumber, "complete");
|
|
221
105
|
}
|
|
222
106
|
//# sourceMappingURL=writer.js.map
|
package/dist/state/writer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/state/writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/state/writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA2BvE,8EAA8E;AAC9E,qEAAqE;AACrE,8EAA8E;AAE9E,MAAM,UAAU,mBAAmB,CAAC,OAAsB;IACxD,MAAM,EACJ,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,MAAM,GACP,GAAG,OAAO,CAAC;IAEZ,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;IACJ,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC;QACH,QAAQ,CAAC,eAAe,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IAED,0BAA0B;IAC1B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,QAAQ,CAAC,uBAAuB,EAAE;YAChD,GAAG,EAAE,UAAU;Y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AI,eAAe,IAAI,YAAY;QAAE,OAAO,IAAI,CAAC;IAEjD,sDAAsD;IACtD,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CACvC,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,GAAG,eAAe;QACnB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,UAAU,CACrD,CAAC;IAEF,OAAO,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAE9E,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAA+B;IAE/B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IACzD,MAAM,qBAAqB,CAAC,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Finding, ConsensusRound, ConsensusResult } from "./types.js";
|
|
2
|
+
export interface ConsensusState {
|
|
3
|
+
finding: Finding;
|
|
4
|
+
rounds: ConsensusRound[];
|
|
5
|
+
maxRounds: number;
|
|
6
|
+
resolved: boolean;
|
|
7
|
+
result: ConsensusResult | null;
|
|
8
|
+
}
|
|
9
|
+
export interface BuilderResponse {
|
|
10
|
+
builderName: string;
|
|
11
|
+
response: "agree" | "disagree" | "alternative";
|
|
12
|
+
reason?: string;
|
|
13
|
+
alternativeProposal?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface EscalationDecision {
|
|
16
|
+
decision: string;
|
|
17
|
+
accepted: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function createConsensusState(finding: Finding, maxRounds?: number): ConsensusState;
|
|
20
|
+
export declare function recordBuilderResponse(state: ConsensusState, response: BuilderResponse): ConsensusState;
|
|
21
|
+
export declare function needsEscalation(state: ConsensusState): boolean;
|
|
22
|
+
export declare function escalateToExecutive(state: ConsensusState, decision: EscalationDecision): ConsensusState;
|
|
23
|
+
export declare function runConsensusProtocol(findings: Finding[], responses: Map<string, BuilderResponse[]>): {
|
|
24
|
+
results: ConsensusResult[];
|
|
25
|
+
needsEscalation: Finding[];
|
|
26
|
+
};
|
|
27
|
+
export declare function formatFindingForReview(finding: Finding): string;
|
|
28
|
+
export declare function formatConsensusResult(result: ConsensusResult, finding: Finding): string;
|