@forge-core/types 0.1.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/dist/index.d.mts +333 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +94 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
//#region src/state.d.ts
|
|
2
|
+
interface ProjectState {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
goals: string[];
|
|
6
|
+
constraints: string[];
|
|
7
|
+
current_phase: string;
|
|
8
|
+
current_status: ProjectStatus;
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
}
|
|
12
|
+
type ProjectStatus = 'intake' | 'planning' | 'executing' | 'reviewing' | 'shipping' | 'shipped';
|
|
13
|
+
interface ArchitectureState {
|
|
14
|
+
design_summary: string;
|
|
15
|
+
technical_decisions: Decision[];
|
|
16
|
+
open_questions: string[];
|
|
17
|
+
dependencies: Dependency[];
|
|
18
|
+
risk_register: Risk[];
|
|
19
|
+
updated_at: string;
|
|
20
|
+
}
|
|
21
|
+
interface Decision {
|
|
22
|
+
decision_id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
rationale: string;
|
|
26
|
+
status: DecisionStatus;
|
|
27
|
+
created_at: string;
|
|
28
|
+
}
|
|
29
|
+
type DecisionStatus = 'proposed' | 'accepted' | 'superseded';
|
|
30
|
+
interface Dependency {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string | null;
|
|
33
|
+
type: 'runtime' | 'dev' | 'peer' | 'optional';
|
|
34
|
+
notes: string;
|
|
35
|
+
}
|
|
36
|
+
interface Risk {
|
|
37
|
+
id: string;
|
|
38
|
+
description: string;
|
|
39
|
+
severity: RiskSeverity;
|
|
40
|
+
mitigation: string;
|
|
41
|
+
status: RiskStatus;
|
|
42
|
+
}
|
|
43
|
+
type RiskSeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
44
|
+
type RiskStatus = 'open' | 'mitigated' | 'accepted';
|
|
45
|
+
interface ExecutionState {
|
|
46
|
+
phases: Phase[];
|
|
47
|
+
current_wave: number;
|
|
48
|
+
total_tasks: number;
|
|
49
|
+
tasks_done: number;
|
|
50
|
+
tasks_in_progress: number;
|
|
51
|
+
tasks_blocked: number;
|
|
52
|
+
updated_at: string;
|
|
53
|
+
}
|
|
54
|
+
interface Phase {
|
|
55
|
+
phase_id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
description: string;
|
|
58
|
+
task_ids: string[];
|
|
59
|
+
status: PhaseStatus;
|
|
60
|
+
}
|
|
61
|
+
type PhaseStatus = 'pending' | 'active' | 'complete';
|
|
62
|
+
interface ContextState {
|
|
63
|
+
session_id: string;
|
|
64
|
+
estimated_tokens_used: number;
|
|
65
|
+
budget_warning_threshold: number;
|
|
66
|
+
context_window_estimate: number;
|
|
67
|
+
last_snapshot: string | null;
|
|
68
|
+
last_digest_at: string;
|
|
69
|
+
recent_actions: string[];
|
|
70
|
+
updated_at: string;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/task.d.ts
|
|
74
|
+
type TaskStatus = 'draft' | 'planned' | 'ready' | 'in_progress' | 'blocked' | 'in_review' | 'qa_pending' | 'done' | 'rejected';
|
|
75
|
+
declare const TASK_TRANSITIONS: Record<TaskStatus, TaskStatus[]>;
|
|
76
|
+
type OwnerRole = 'builder' | 'manager' | 'executive';
|
|
77
|
+
interface AcceptanceCriterion {
|
|
78
|
+
id: string;
|
|
79
|
+
description: string;
|
|
80
|
+
verified: boolean;
|
|
81
|
+
evidence_ref: string | null;
|
|
82
|
+
}
|
|
83
|
+
type TestType = 'unit' | 'integration' | 'e2e';
|
|
84
|
+
type TestStatus = 'pending' | 'written' | 'passing' | 'failing';
|
|
85
|
+
interface TestRequirement {
|
|
86
|
+
type: TestType;
|
|
87
|
+
description: string;
|
|
88
|
+
test_file: string | null;
|
|
89
|
+
status: TestStatus;
|
|
90
|
+
}
|
|
91
|
+
type EvidenceType = 'test_result' | 'screenshot' | 'review' | 'log' | 'manual';
|
|
92
|
+
interface Evidence {
|
|
93
|
+
type: EvidenceType;
|
|
94
|
+
description: string;
|
|
95
|
+
artifact_path: string;
|
|
96
|
+
created_at: string;
|
|
97
|
+
}
|
|
98
|
+
interface FileChange {
|
|
99
|
+
path: string;
|
|
100
|
+
operation: 'added' | 'modified' | 'deleted';
|
|
101
|
+
}
|
|
102
|
+
interface TestRunResult {
|
|
103
|
+
test_file: string;
|
|
104
|
+
passed: number;
|
|
105
|
+
failed: number;
|
|
106
|
+
skipped: number;
|
|
107
|
+
duration_ms: number;
|
|
108
|
+
output: string | null;
|
|
109
|
+
}
|
|
110
|
+
type CriterionStatus = {
|
|
111
|
+
criterion_id: string;
|
|
112
|
+
passed: boolean;
|
|
113
|
+
notes: string | null;
|
|
114
|
+
};
|
|
115
|
+
interface Task {
|
|
116
|
+
task_id: string;
|
|
117
|
+
title: string;
|
|
118
|
+
description: string;
|
|
119
|
+
rationale: string;
|
|
120
|
+
phase: string;
|
|
121
|
+
owner_role: OwnerRole;
|
|
122
|
+
dependencies: string[];
|
|
123
|
+
files_in_scope: string[];
|
|
124
|
+
constraints: string[];
|
|
125
|
+
acceptance_criteria: AcceptanceCriterion[];
|
|
126
|
+
test_requirements: TestRequirement[];
|
|
127
|
+
review_requirements: string[];
|
|
128
|
+
qa_requirements: string[];
|
|
129
|
+
status: TaskStatus;
|
|
130
|
+
evidence: Evidence[];
|
|
131
|
+
result: ExecutorResult | null;
|
|
132
|
+
created_at: string;
|
|
133
|
+
updated_at: string;
|
|
134
|
+
}
|
|
135
|
+
interface ExecutorResult {
|
|
136
|
+
task_id: string;
|
|
137
|
+
status: 'completed' | 'failed' | 'partial';
|
|
138
|
+
summary: string;
|
|
139
|
+
files_changed: FileChange[];
|
|
140
|
+
tests_added: string[];
|
|
141
|
+
tests_run: TestRunResult[];
|
|
142
|
+
acceptance_criteria_status: CriterionStatus[];
|
|
143
|
+
issues: string[];
|
|
144
|
+
merge_recommendation: 'merge' | 'revise' | 'reject';
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/executor.d.ts
|
|
148
|
+
interface ExecutorConfig {
|
|
149
|
+
name: string;
|
|
150
|
+
options: Record<string, unknown>;
|
|
151
|
+
}
|
|
152
|
+
interface TaskContext {
|
|
153
|
+
task_id: string;
|
|
154
|
+
context_pack: ContextPackRef;
|
|
155
|
+
working_directory: string;
|
|
156
|
+
}
|
|
157
|
+
interface ContextPackRef {
|
|
158
|
+
pack_id: string;
|
|
159
|
+
estimated_tokens: number;
|
|
160
|
+
content: string;
|
|
161
|
+
}
|
|
162
|
+
interface Executor {
|
|
163
|
+
readonly name: string;
|
|
164
|
+
initialize(config: ExecutorConfig): Promise<void>;
|
|
165
|
+
dispatch(context: TaskContext): Promise<ExecutorResult>;
|
|
166
|
+
dispose(): Promise<void>;
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/verifier.d.ts
|
|
170
|
+
type VerificationType = 'unit' | 'integration' | 'e2e' | 'browser';
|
|
171
|
+
interface VerifierConfig {
|
|
172
|
+
name: string;
|
|
173
|
+
options: Record<string, unknown>;
|
|
174
|
+
}
|
|
175
|
+
interface VerificationPlan {
|
|
176
|
+
plan_id: string;
|
|
177
|
+
task_ids: string[];
|
|
178
|
+
scope: 'task' | 'phase' | 'full';
|
|
179
|
+
changed_files: string[];
|
|
180
|
+
acceptance_criteria_ids: string[];
|
|
181
|
+
strategies: VerificationType[];
|
|
182
|
+
}
|
|
183
|
+
interface CheckResult {
|
|
184
|
+
name: string;
|
|
185
|
+
type: VerificationType;
|
|
186
|
+
status: 'pass' | 'fail' | 'skip';
|
|
187
|
+
duration_ms: number;
|
|
188
|
+
output: string | null;
|
|
189
|
+
}
|
|
190
|
+
interface EvidenceArtifact {
|
|
191
|
+
type: 'screenshot' | 'console_log' | 'network_log' | 'test_output' | 'coverage';
|
|
192
|
+
path: string;
|
|
193
|
+
description: string;
|
|
194
|
+
}
|
|
195
|
+
interface Issue {
|
|
196
|
+
severity: 'critical' | 'major' | 'minor' | 'info';
|
|
197
|
+
description: string;
|
|
198
|
+
file: string | null;
|
|
199
|
+
task_id: string | null;
|
|
200
|
+
auto_reopen: boolean;
|
|
201
|
+
}
|
|
202
|
+
interface VerificationResult {
|
|
203
|
+
plan_id: string;
|
|
204
|
+
status: 'pass' | 'fail' | 'partial';
|
|
205
|
+
checks: CheckResult[];
|
|
206
|
+
evidence: EvidenceArtifact[];
|
|
207
|
+
issues: Issue[];
|
|
208
|
+
summary: string;
|
|
209
|
+
created_at: string;
|
|
210
|
+
}
|
|
211
|
+
interface Verifier {
|
|
212
|
+
readonly name: string;
|
|
213
|
+
readonly supports: VerificationType[];
|
|
214
|
+
initialize(config: VerifierConfig): Promise<void>;
|
|
215
|
+
verify(plan: VerificationPlan): Promise<VerificationResult>;
|
|
216
|
+
dispose(): Promise<void>;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/context.d.ts
|
|
220
|
+
type DigestType = 'state' | 'decision' | 'changes' | 'next_step';
|
|
221
|
+
interface ContextPackSections {
|
|
222
|
+
objective: string;
|
|
223
|
+
task: Task | null;
|
|
224
|
+
constraints: string[];
|
|
225
|
+
relevant_decisions: Decision[];
|
|
226
|
+
relevant_files: string[];
|
|
227
|
+
recent_changes: string[];
|
|
228
|
+
open_issues: string[];
|
|
229
|
+
state_digest: string;
|
|
230
|
+
}
|
|
231
|
+
interface ContextPack {
|
|
232
|
+
pack_id: string;
|
|
233
|
+
generated_at: string;
|
|
234
|
+
target_role: OwnerRole;
|
|
235
|
+
target_task: string | null;
|
|
236
|
+
estimated_tokens: number;
|
|
237
|
+
sections: ContextPackSections;
|
|
238
|
+
}
|
|
239
|
+
interface ContextBudget {
|
|
240
|
+
estimated_tokens_used: number;
|
|
241
|
+
context_window_estimate: number;
|
|
242
|
+
budget_warning_threshold: number;
|
|
243
|
+
warning_active: boolean;
|
|
244
|
+
recommendation: string | null;
|
|
245
|
+
}
|
|
246
|
+
interface Digest {
|
|
247
|
+
type: DigestType;
|
|
248
|
+
content: string;
|
|
249
|
+
generated_at: string;
|
|
250
|
+
}
|
|
251
|
+
interface Snapshot {
|
|
252
|
+
snapshot_id: string;
|
|
253
|
+
label: string | null;
|
|
254
|
+
created_at: string;
|
|
255
|
+
data: SnapshotData;
|
|
256
|
+
}
|
|
257
|
+
interface SnapshotData {
|
|
258
|
+
project: unknown;
|
|
259
|
+
architecture: unknown;
|
|
260
|
+
execution: unknown;
|
|
261
|
+
context: unknown;
|
|
262
|
+
task_index: Record<string, unknown>;
|
|
263
|
+
decision_index: Record<string, unknown>;
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/review.d.ts
|
|
267
|
+
type ReviewType = 'architecture' | 'implementation' | 'qa' | 'ship';
|
|
268
|
+
type ReviewVerdict = 'approved' | 'rejected' | 'conditional';
|
|
269
|
+
interface ChecklistItem {
|
|
270
|
+
item: string;
|
|
271
|
+
passed: boolean;
|
|
272
|
+
note: string | null;
|
|
273
|
+
}
|
|
274
|
+
interface ReviewArtifact {
|
|
275
|
+
review_id: string;
|
|
276
|
+
type: ReviewType;
|
|
277
|
+
task_ids: string[];
|
|
278
|
+
reviewer_role: 'executive';
|
|
279
|
+
verdict: ReviewVerdict;
|
|
280
|
+
checklist: ChecklistItem[];
|
|
281
|
+
findings: string[];
|
|
282
|
+
required_actions: string[];
|
|
283
|
+
created_at: string;
|
|
284
|
+
}
|
|
285
|
+
declare const REVIEW_CHECKLISTS: Record<ReviewType, string[]>;
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/config.d.ts
|
|
288
|
+
interface VerifierConfigEntry {
|
|
289
|
+
name: string;
|
|
290
|
+
package: string | null;
|
|
291
|
+
options: Record<string, unknown>;
|
|
292
|
+
}
|
|
293
|
+
interface ForgeConfig {
|
|
294
|
+
project: {
|
|
295
|
+
name: string;
|
|
296
|
+
description: string;
|
|
297
|
+
goals: string[];
|
|
298
|
+
};
|
|
299
|
+
adapter: {
|
|
300
|
+
executor: string;
|
|
301
|
+
executor_options: Record<string, unknown>;
|
|
302
|
+
};
|
|
303
|
+
verification: {
|
|
304
|
+
verifiers: VerifierConfigEntry[];
|
|
305
|
+
default_strategy: VerificationType[];
|
|
306
|
+
};
|
|
307
|
+
context: {
|
|
308
|
+
budget_warning_threshold: number;
|
|
309
|
+
context_window_estimate: number;
|
|
310
|
+
auto_digest_on_merge: boolean;
|
|
311
|
+
};
|
|
312
|
+
testing: {
|
|
313
|
+
test_command: string;
|
|
314
|
+
test_pattern: string;
|
|
315
|
+
coverage_command: string | null;
|
|
316
|
+
};
|
|
317
|
+
review: {
|
|
318
|
+
require_architecture_review: boolean;
|
|
319
|
+
require_qa_before_ship: boolean;
|
|
320
|
+
auto_review_on_merge: boolean;
|
|
321
|
+
};
|
|
322
|
+
ids: {
|
|
323
|
+
task_counter: number;
|
|
324
|
+
decision_counter: number;
|
|
325
|
+
review_counter: number;
|
|
326
|
+
qa_counter: number;
|
|
327
|
+
snapshot_counter: number;
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
declare const DEFAULT_CONFIG: ForgeConfig;
|
|
331
|
+
//#endregion
|
|
332
|
+
export { AcceptanceCriterion, ArchitectureState, CheckResult, ChecklistItem, ContextBudget, ContextPack, ContextPackRef, ContextPackSections, ContextState, CriterionStatus, DEFAULT_CONFIG, Decision, DecisionStatus, Dependency, Digest, DigestType, Evidence, EvidenceArtifact, EvidenceType, ExecutionState, Executor, ExecutorConfig, type ExecutorResult, FileChange, ForgeConfig, Issue, OwnerRole, Phase, PhaseStatus, ProjectState, ProjectStatus, REVIEW_CHECKLISTS, ReviewArtifact, ReviewType, ReviewVerdict, Risk, RiskSeverity, RiskStatus, Snapshot, SnapshotData, TASK_TRANSITIONS, Task, TaskContext, TaskStatus, TestRequirement, TestRunResult, TestStatus, TestType, VerificationPlan, VerificationResult, VerificationType, Verifier, VerifierConfig, VerifierConfigEntry };
|
|
333
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/state.ts","../src/task.ts","../src/executor.ts","../src/verifier.ts","../src/context.ts","../src/review.ts","../src/config.ts"],"mappings":";UACiB,YAAA;EACf,IAAA;EACA,WAAA;EACA,KAAA;EACA,WAAA;EACA,aAAA;EACA,cAAA,EAAgB,aAAA;EAChB,UAAA;EACA,UAAA;AAAA;AAAA,KAGU,aAAA;AAAA,UASK,iBAAA;EACf,cAAA;EACA,mBAAA,EAAqB,QAAA;EACrB,cAAA;EACA,YAAA,EAAc,UAAA;EACd,aAAA,EAAe,IAAA;EACf,UAAA;AAAA;AAAA,UAGe,QAAA;EACf,WAAA;EACA,KAAA;EACA,WAAA;EACA,SAAA;EACA,MAAA,EAAQ,cAAA;EACR,UAAA;AAAA;AAAA,KAGU,cAAA;AAAA,UAEK,UAAA;EACf,IAAA;EACA,OAAA;EACA,IAAA;EACA,KAAA;AAAA;AAAA,UAGe,IAAA;EACf,EAAA;EACA,WAAA;EACA,QAAA,EAAU,YAAA;EACV,UAAA;EACA,MAAA,EAAQ,UAAA;AAAA;AAAA,KAGE,YAAA;AAAA,KACA,UAAA;AAAA,UAGK,cAAA;EACf,MAAA,EAAQ,KAAA;EACR,YAAA;EACA,WAAA;EACA,UAAA;EACA,iBAAA;EACA,aAAA;EACA,UAAA;AAAA;AAAA,UAGe,KAAA;EACf,QAAA;EACA,IAAA;EACA,WAAA;EACA,QAAA;EACA,MAAA,EAAQ,WAAA;AAAA;AAAA,KAGE,WAAA;AAAA,UAGK,YAAA;EACf,UAAA;EACA,qBAAA;EACA,wBAAA;EACA,uBAAA;EACA,aAAA;EACA,cAAA;EACA,cAAA;EACA,UAAA;AAAA;;;KCzFU,UAAA;AAAA,cAYC,gBAAA,EAAkB,M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
+
planned: ["ready"],
|
|
5
|
+
ready: ["in_progress"],
|
|
6
|
+
in_progress: ["blocked", "in_review"],
|
|
7
|
+
blocked: ["in_progress"],
|
|
8
|
+
in_review: ["rejected", "qa_pending"],
|
|
9
|
+
rejected: ["in_progress"],
|
|
10
|
+
qa_pending: ["done", "in_progress"],
|
|
11
|
+
done: []
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/review.ts
|
|
15
|
+
const REVIEW_CHECKLISTS = {
|
|
16
|
+
architecture: [
|
|
17
|
+
"Design is coherent and matches stated goals",
|
|
18
|
+
"Risks are identified and have mitigations",
|
|
19
|
+
"Dependencies are justified and minimal",
|
|
20
|
+
"Scope is appropriate — not over- or under-engineered",
|
|
21
|
+
"Test strategy covers the implementation",
|
|
22
|
+
"No unresolved design questions block execution"
|
|
23
|
+
],
|
|
24
|
+
implementation: [
|
|
25
|
+
"Code matches the task specification",
|
|
26
|
+
"No scope creep — only files_in_scope were modified",
|
|
27
|
+
"Tests exist for all acceptance criteria",
|
|
28
|
+
"All tests pass",
|
|
29
|
+
"No obvious defects or unhandled error paths",
|
|
30
|
+
"Evidence is attached"
|
|
31
|
+
],
|
|
32
|
+
qa: [
|
|
33
|
+
"All acceptance criteria are verified with evidence",
|
|
34
|
+
"No regressions introduced",
|
|
35
|
+
"Error handling works correctly",
|
|
36
|
+
"Edge cases are covered",
|
|
37
|
+
"Evidence artifacts are present and readable"
|
|
38
|
+
],
|
|
39
|
+
ship: [
|
|
40
|
+
"All tasks are in done status",
|
|
41
|
+
"All implementation reviews are approved",
|
|
42
|
+
"All QA reviews are passed",
|
|
43
|
+
"No open blockers remain",
|
|
44
|
+
"Decision log is complete",
|
|
45
|
+
"State is consistent and accurate"
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/config.ts
|
|
50
|
+
const DEFAULT_CONFIG = {
|
|
51
|
+
project: {
|
|
52
|
+
name: "",
|
|
53
|
+
description: "",
|
|
54
|
+
goals: []
|
|
55
|
+
},
|
|
56
|
+
adapter: {
|
|
57
|
+
executor: "claude-code",
|
|
58
|
+
executor_options: {}
|
|
59
|
+
},
|
|
60
|
+
verification: {
|
|
61
|
+
verifiers: [{
|
|
62
|
+
name: "test-runner",
|
|
63
|
+
package: null,
|
|
64
|
+
options: {}
|
|
65
|
+
}],
|
|
66
|
+
default_strategy: ["unit"]
|
|
67
|
+
},
|
|
68
|
+
context: {
|
|
69
|
+
budget_warning_threshold: 8e4,
|
|
70
|
+
context_window_estimate: 128e3,
|
|
71
|
+
auto_digest_on_merge: true
|
|
72
|
+
},
|
|
73
|
+
testing: {
|
|
74
|
+
test_command: "npm test",
|
|
75
|
+
test_pattern: "**/*.test.ts",
|
|
76
|
+
coverage_command: null
|
|
77
|
+
},
|
|
78
|
+
review: {
|
|
79
|
+
require_architecture_review: true,
|
|
80
|
+
require_qa_before_ship: true,
|
|
81
|
+
auto_review_on_merge: false
|
|
82
|
+
},
|
|
83
|
+
ids: {
|
|
84
|
+
task_counter: 0,
|
|
85
|
+
decision_counter: 0,
|
|
86
|
+
review_counter: 0,
|
|
87
|
+
qa_counter: 0,
|
|
88
|
+
snapshot_counter: 0
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { DEFAULT_CONFIG, REVIEW_CHECKLISTS, TASK_TRANSITIONS };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/task.ts","../src/review.ts","../src/config.ts"],"sourcesContent":["export type TaskStatus =\n | 'draft'\n | 'planned'\n | 'ready'\n | 'in_progress'\n | 'blocked'\n | 'in_review'\n | 'qa_pending'\n | 'done'\n | 'rejected'\n\n// Valid transitions: key status -> array of allowed next statuses\nexport const TASK_TRANSITIONS: Record<TaskStatus, TaskStatus[]> = {\n draft: ['planned'],\n planned: ['ready'],\n ready: ['in_progress'],\n in_progress: ['blocked', 'in_review'],\n blocked: ['in_progress'],\n in_review: ['rejected', 'qa_pending'],\n rejected: ['in_progress'],\n qa_pending: ['done', 'in_progress'],\n done: [],\n}\n\nexport type OwnerRole = 'builder' | 'manager' | 'executive'\n\nexport interface AcceptanceCriterion {\n id: string\n description: string\n verified: boolean\n evidence_ref: string | null\n}\n\nexport type TestType = 'unit' | 'integration' | 'e2e'\nexport type TestStatus = 'pending' | 'written' | 'passing' | 'failing'\n\nexport interface TestRequirement {\n type: TestType\n description: string\n test_file: string | null\n status: TestStatus\n}\n\nexport type EvidenceType = 'test_result' | 'screenshot' | 'review' | 'log' | 'manual'\n\nexport interface Evidence {\n type: EvidenceType\n description: string\n artifact_path: string\n created_at: string // ISO 8601\n}\n\nexport interface FileChange {\n path: string\n operation: 'added' | 'modified' | 'deleted'\n}\n\nexport interface TestRunResult {\n test_file: string\n passed: number\n failed: number\n skipped: number\n duration_ms: number\n output: string | null\n}\n\nexport type CriterionStatus = {\n criterion_id: string\n passed: boolean\n notes: string | null\n}\n\nexport interface Task {\n task_id: string // e.g., \"TASK-001\"\n title: string\n description: string\n rationale: string\n phase: string // phase_id reference\n owner_role: OwnerRole\n dependencies: string[] // task_id references\n files_in_scope: string[]\n constraints: string[]\n acceptance_criteria: AcceptanceCriterion[]\n test_requirements: TestRequirement[]\n review_requirements: string[]\n qa_requirements: string[]\n status: TaskStatus\n evidence: Evidence[]\n result: ExecutorResult | null // populated when worker completes\n created_at: string\n updated_at: string\n}\n\n// Forward reference — ExecutorResult will be defined in executor.ts\n// We need a minimal inline type here to avoid circular imports\nexport interface ExecutorResult {\n task_id: string\n status: 'completed' | 'failed' | 'partial'\n summary: string\n files_changed: FileChange[]\n tests_added: string[]\n tests_run: TestRunResult[]\n acceptance_criteria_status: CriterionStatus[]\n issues: string[]\n merge_recommendation: 'merge' | 'revise' | 'reject'\n}\n","export type ReviewType = 'architecture' | 'implementation' | 'qa' | 'ship'\nexport type ReviewVerdict = 'approved' | 'rejected' | 'conditional'\n\nexport interface ChecklistItem {\n item: string\n passed: boolean\n note: string | null\n}\n\nexport interface ReviewArtifact {\n review_id: string // e.g., \"REV-001\"\n type: ReviewType\n task_ids: string[]\n reviewer_role: 'executive'\n verdict: ReviewVerdict\n checklist: ChecklistItem[]\n findings: string[]\n required_actions: string[]\n created_at: string\n}\n\n// Checklist templates — the canonical items for each review type\nexport const REVIEW_CHECKLISTS: Record<ReviewType, string[]> = {\n architecture: [\n 'Design is coherent and matches stated goals',\n 'Risks are identified and have mitigations',\n 'Dependencies are justified and minimal',\n 'Scope is appropriate — not over- or under-engineered',\n 'Test strategy covers the implementation',\n 'No unresolved design questions block execution',\n ],\n implementation: [\n 'Code matches the task specification',\n 'No scope creep — only files_in_scope were modified',\n 'Tests exist for all acceptance criteria',\n 'All tests pass',\n 'No obvious defects or unhandled error paths',\n 'Evidence is attached',\n ],\n qa: [\n 'All acceptance criteria are verified with evidence',\n 'No regressions introduced',\n 'Error handling works correctly',\n 'Edge cases are covered',\n 'Evidence artifacts are present and readable',\n ],\n ship: [\n 'All tasks are in done status',\n 'All implementation reviews are approved',\n 'All QA reviews are passed',\n 'No open blockers remain',\n 'Decision log is complete',\n 'State is consistent and accurate',\n ],\n}\n","import type { VerificationType } from './verifier.js'\n\nexport interface VerifierConfigEntry {\n name: string\n package: string | null\n options: Record<string, unknown>\n}\n\nexport interface ForgeConfig {\n project: {\n name: string\n description: string\n goals: string[]\n }\n adapter: {\n executor: string\n executor_options: Record<string, unknown>\n }\n verification: {\n verifiers: VerifierConfigEntry[]\n default_strategy: VerificationType[]\n }\n context: {\n budget_warning_threshold: number\n context_window_estimate: number\n auto_digest_on_merge: boolean\n }\n testing: {\n test_command: string\n test_pattern: string\n coverage_command: string | null\n }\n review: {\n require_architecture_review: boolean\n require_qa_before_ship: boolean\n auto_review_on_merge: boolean\n }\n ids: {\n task_counter: number\n decision_counter: number\n review_counter: number\n qa_counter: number\n snapshot_counter: number\n }\n}\n\nexport const DEFAULT_CONFIG: ForgeConfig = {\n project: {\n name: '',\n description: '',\n goals: [],\n },\n adapter: {\n executor: 'claude-code',\n executor_options: {},\n },\n verification: {\n verifiers: [{ name: 'test-runner', package: null, options: {} }],\n default_strategy: ['unit'],\n },\n context: {\n budget_warning_threshold: 80000,\n context_window_estimate: 128000,\n auto_digest_on_merge: true,\n },\n testing: {\n test_command: 'npm test',\n test_pattern: '**/*.test.ts',\n coverage_command: null,\n },\n review: {\n require_architecture_review: true,\n require_qa_before_ship: true,\n auto_review_on_merge: false,\n },\n ids: {\n task_counter: 0,\n decision_counter: 0,\n review_counter: 0,\n qa_counter: 0,\n snapshot_counter: 0,\n },\n}\n"],"mappings":";AAYA,MAAa,mBAAqD;CAChE,OAAa,CAAC,UAAU;CACxB,SAAa,CAAC,QAAQ;CACtB,OAAa,CAAC,cAAc;CAC5B,aAAa,CAAC,WAAW,YAAY;CACrC,SAAa,CAAC,cAAc;CAC5B,WAAa,CAAC,YAAY,aAAa;CACvC,UAAa,CAAC,cAAc;CAC5B,YAAa,CAAC,QAAQ,cAAc;CACpC,MAAa,EAAE;CAChB;;;ACAD,MAAa,oBAAkD;CAC7D,cAAc;EACZ;EACA;EACA;EACA;EACA;EACA;EACD;CACD,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;EACD;CACD,IAAI;EACF;EACA;EACA;EACA;EACA;EACD;CACD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACD;CACF;;;ACRD,MAAa,iBAA8B;CACzC,SAAS;EACP,MAAM;EACN,aAAa;EACb,OAAO,EAAE;EACV;CACD,SAAS;EACP,UAAU;EACV,kBAAkB,EAAE;EACrB;CACD,cAAc;EACZ,WAAW,CAAC;GAAE,MAAM;GAAe,SAAS;GAAM,SAAS,EAAE;GAAE,CAAC;EAChE,kBAAkB,CAAC,OAAO;EAC3B;CACD,SAAS;EACP,0BAA0B;EAC1B,yBAAyB;EACzB,sBAAsB;EACvB;CACD,SAAS;EACP,cAAc;EACd,cAAc;EACd,kBAAkB;EACnB;CACD,QAAQ;EACN,6BAA6B;EAC7B,wBAAwB;EACxB,sBAAsB;EACvB;CACD,KAAK;EACH,cAAc;EACd,kBAAkB;EAClB,gBAAgB;EAChB,YAAY;EACZ,kBAAkB;EACnB;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@forge-core/types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared TypeScript types for the Forge AI coding agent",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"forge",
|
|
7
|
+
"ai",
|
|
8
|
+
"coding-agent"
|
|
9
|
+
],
|
|
10
|
+
"author": "Forge",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/Fchery87/FORGE"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "./dist/index.mjs",
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/index.mjs",
|
|
22
|
+
"types": "./dist/index.d.mts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsdown",
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"dev": "tsup --watch",
|
|
33
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
34
|
+
"prepublishOnly": "npm run build"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
}
|
|
42
|
+
}
|