@nac3/forge-cli 0.2.0-alpha.10 → 0.2.0-alpha.12
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/bin/yf.d.ts.map +1 -1
- package/dist/bin/yf.js +7 -0
- package/dist/bin/yf.js.map +1 -1
- package/dist/commands/discover.d.ts +30 -0
- package/dist/commands/discover.d.ts.map +1 -0
- package/dist/commands/discover.js +178 -0
- package/dist/commands/discover.js.map +1 -0
- package/dist/commands/legacy-audit.d.ts +34 -0
- package/dist/commands/legacy-audit.d.ts.map +1 -0
- package/dist/commands/legacy-audit.js +270 -0
- package/dist/commands/legacy-audit.js.map +1 -0
- package/dist/commands/triage.d.ts +34 -0
- package/dist/commands/triage.d.ts.map +1 -0
- package/dist/commands/triage.js +228 -0
- package/dist/commands/triage.js.map +1 -0
- package/dist/commands/vault-inventory.d.ts +30 -0
- package/dist/commands/vault-inventory.d.ts.map +1 -0
- package/dist/commands/vault-inventory.js +214 -0
- package/dist/commands/vault-inventory.js.map +1 -0
- package/dist/commands/vault.d.ts.map +1 -1
- package/dist/commands/vault.js +5 -0
- package/dist/commands/vault.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflow/state.d.ts +190 -0
- package/dist/workflow/state.d.ts.map +1 -0
- package/dist/workflow/state.js +119 -0
- package/dist/workflow/state.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Yujin Forge -- Product Workflow state.
|
|
3
|
+
*
|
|
4
|
+
* Shared persistence layer for the 18-step methodology defined
|
|
5
|
+
* in docs/PRODUCT_WORKFLOW.md. State lives in the project's
|
|
6
|
+
* yujin.forge.json under `workflow.*` so it survives across
|
|
7
|
+
* sessions + can be inspected + shared via the git repo.
|
|
8
|
+
*
|
|
9
|
+
* Every command in the workflow (yf triage, yf discover, yf
|
|
10
|
+
* clarify, yf spec, yf approve, yf bootstrap, yf block dev, yf
|
|
11
|
+
* deploy, yf manual, yf metrics, yf iterate) reads + writes
|
|
12
|
+
* through this module. The chat tool surface (forge_triage,
|
|
13
|
+
* forge_discover, etc) does the same -- the underlying state
|
|
14
|
+
* is identical regardless of entry point.
|
|
15
|
+
*
|
|
16
|
+
* Schema:
|
|
17
|
+
*
|
|
18
|
+
* workflow: {
|
|
19
|
+
* tier: 'simple' | 'medium' | 'full' | null,
|
|
20
|
+
* tier_reason: string,
|
|
21
|
+
* tier_decided_at: ISO,
|
|
22
|
+
*
|
|
23
|
+
* intent: { ... } // Phase I step 3
|
|
24
|
+
* legacy_audit: { ... } // Phase I step 3.5
|
|
25
|
+
* vault_inventory: { ... } // Phase I step 2 audit
|
|
26
|
+
*
|
|
27
|
+
* clarification: {
|
|
28
|
+
* functional: { done_at, summary, doc_path }, // step 4
|
|
29
|
+
* nfr_quantitative: { done_at, summary, doc_path }, // step 5
|
|
30
|
+
* nfr_structural: { done_at, summary, doc_path }, // step 6
|
|
31
|
+
* nfr_governance: { done_at, summary, doc_path }, // step 7
|
|
32
|
+
* nfr_operational: { done_at, summary, doc_path }, // step 8
|
|
33
|
+
* blocks: { done_at, blocks: [...] }, // step 9
|
|
34
|
+
* },
|
|
35
|
+
*
|
|
36
|
+
* specs: {
|
|
37
|
+
* rfp: { done_at, version, doc_path, sha256 }, // step 10
|
|
38
|
+
* arch: { done_at, version, doc_path, sha256 }, // step 11
|
|
39
|
+
* design: { done_at, version, doc_path, sha256 }, // step 12
|
|
40
|
+
* },
|
|
41
|
+
*
|
|
42
|
+
* approvals: {
|
|
43
|
+
* rfp: { approved_at, version_sha256 }, // step 13
|
|
44
|
+
* arch: { approved_at, version_sha256 }, // step 13
|
|
45
|
+
* design: { approved_at, version_sha256 }, // step 13
|
|
46
|
+
* },
|
|
47
|
+
*
|
|
48
|
+
* bootstrap: { done_at, stack, ci_set }, // step 14
|
|
49
|
+
*
|
|
50
|
+
* blocks_progress: [ // step 15
|
|
51
|
+
* { block_id, status, tests_green_at, deployed_at }
|
|
52
|
+
* ],
|
|
53
|
+
*
|
|
54
|
+
* deploy: { ... } // step 16
|
|
55
|
+
* postlaunch:{ ... } // step 17
|
|
56
|
+
* iterations:[{ at, type, summary }] // step 18
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* ASCII-only.
|
|
60
|
+
*/
|
|
61
|
+
export type WorkflowTier = 'simple' | 'medium' | 'full';
|
|
62
|
+
export interface IntentState {
|
|
63
|
+
operation: 'migrate' | 'new' | 'modify' | null;
|
|
64
|
+
target: 'desktop' | 'mobile' | 'responsive' | 'web-and-mobile' | null;
|
|
65
|
+
input_channel: 'chat-text' | 'voice' | 'document-paste' | null;
|
|
66
|
+
project_state: 'no-code' | 'local-repo' | 'remote-repo' | 'deployed' | null;
|
|
67
|
+
legacy_framework: string | null;
|
|
68
|
+
preferred_stack: string | null;
|
|
69
|
+
use_case: 'hobby' | 'poc' | 'internal' | 'commercial' | null;
|
|
70
|
+
decided_at: string;
|
|
71
|
+
}
|
|
72
|
+
export interface LegacyAuditState {
|
|
73
|
+
ran_at: string;
|
|
74
|
+
framework: string;
|
|
75
|
+
framework_version: string;
|
|
76
|
+
total_files: number;
|
|
77
|
+
tsx_files: number;
|
|
78
|
+
has_tests: boolean;
|
|
79
|
+
nac3_readiness: number;
|
|
80
|
+
tech_debt_signals: string[];
|
|
81
|
+
deprecated_deps: string[];
|
|
82
|
+
}
|
|
83
|
+
export interface VaultInventoryState {
|
|
84
|
+
ran_at: string;
|
|
85
|
+
/** Per family: configured | skipped | unknown.
|
|
86
|
+
* Skipped families are flagged as debt for step 16 (deploy). */
|
|
87
|
+
families: Record<string, 'configured' | 'skipped' | 'unknown'>;
|
|
88
|
+
}
|
|
89
|
+
export interface ClarificationRoundState {
|
|
90
|
+
done_at: string;
|
|
91
|
+
summary: string;
|
|
92
|
+
doc_path?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface BlockPlanItem {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
effort: 'S' | 'M' | 'L' | 'XL';
|
|
98
|
+
dependencies: string[];
|
|
99
|
+
mvp: boolean;
|
|
100
|
+
}
|
|
101
|
+
export interface ClarificationState {
|
|
102
|
+
functional?: ClarificationRoundState;
|
|
103
|
+
nfr_quantitative?: ClarificationRoundState;
|
|
104
|
+
nfr_structural?: ClarificationRoundState;
|
|
105
|
+
nfr_governance?: ClarificationRoundState;
|
|
106
|
+
nfr_operational?: ClarificationRoundState;
|
|
107
|
+
blocks?: {
|
|
108
|
+
done_at: string;
|
|
109
|
+
blocks: BlockPlanItem[];
|
|
110
|
+
mvp_path: string[];
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export interface SpecDocState {
|
|
114
|
+
done_at: string;
|
|
115
|
+
version: number;
|
|
116
|
+
doc_path: string;
|
|
117
|
+
sha256: string;
|
|
118
|
+
}
|
|
119
|
+
export interface ApprovalState {
|
|
120
|
+
approved_at: string;
|
|
121
|
+
version_sha256: string;
|
|
122
|
+
}
|
|
123
|
+
export interface BootstrapState {
|
|
124
|
+
done_at: string;
|
|
125
|
+
stack: string;
|
|
126
|
+
ci_set: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface BlockProgressState {
|
|
129
|
+
block_id: string;
|
|
130
|
+
status: 'pending' | 'in_progress' | 'green' | 'failed';
|
|
131
|
+
tests_green_at?: string;
|
|
132
|
+
deployed_at?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface DeployState {
|
|
135
|
+
done_at: string;
|
|
136
|
+
pipeline: string;
|
|
137
|
+
url: string;
|
|
138
|
+
smoke_at: string;
|
|
139
|
+
}
|
|
140
|
+
export interface PostLaunchState {
|
|
141
|
+
manual_at: string;
|
|
142
|
+
dashboards_at: string;
|
|
143
|
+
feedback_channel: string;
|
|
144
|
+
}
|
|
145
|
+
export interface IterationEntry {
|
|
146
|
+
at: string;
|
|
147
|
+
type: 'bug' | 'feature_small' | 'feature_large' | 'nfr_change' | 'pivot';
|
|
148
|
+
summary: string;
|
|
149
|
+
}
|
|
150
|
+
export interface WorkflowState {
|
|
151
|
+
tier?: WorkflowTier;
|
|
152
|
+
tier_reason?: string;
|
|
153
|
+
tier_decided_at?: string;
|
|
154
|
+
intent?: IntentState;
|
|
155
|
+
legacy_audit?: LegacyAuditState;
|
|
156
|
+
vault_inventory?: VaultInventoryState;
|
|
157
|
+
clarification?: ClarificationState;
|
|
158
|
+
specs?: {
|
|
159
|
+
rfp?: SpecDocState;
|
|
160
|
+
arch?: SpecDocState;
|
|
161
|
+
design?: SpecDocState;
|
|
162
|
+
};
|
|
163
|
+
approvals?: {
|
|
164
|
+
rfp?: ApprovalState;
|
|
165
|
+
arch?: ApprovalState;
|
|
166
|
+
design?: ApprovalState;
|
|
167
|
+
};
|
|
168
|
+
bootstrap?: BootstrapState;
|
|
169
|
+
blocks_progress?: BlockProgressState[];
|
|
170
|
+
deploy?: DeployState;
|
|
171
|
+
postlaunch?: PostLaunchState;
|
|
172
|
+
iterations?: IterationEntry[];
|
|
173
|
+
}
|
|
174
|
+
interface ProjectConfig {
|
|
175
|
+
workflow?: WorkflowState;
|
|
176
|
+
[key: string]: unknown;
|
|
177
|
+
}
|
|
178
|
+
export declare function loadConfig(projectRoot: string): Promise<ProjectConfig>;
|
|
179
|
+
export declare function saveConfig(projectRoot: string, cfg: ProjectConfig): Promise<void>;
|
|
180
|
+
export declare function readWorkflow(projectRoot: string): Promise<WorkflowState>;
|
|
181
|
+
export declare function writeWorkflow(projectRoot: string, patch: Partial<WorkflowState>): Promise<WorkflowState>;
|
|
182
|
+
/** Update a NESTED key under workflow.<group> (clarification,
|
|
183
|
+
* specs, approvals, blocks_progress) without overwriting sibling
|
|
184
|
+
* keys at the same level. */
|
|
185
|
+
export declare function patchWorkflowGroup<K extends keyof WorkflowState>(projectRoot: string, group: K, patch: Partial<NonNullable<WorkflowState[K]>>): Promise<WorkflowState>;
|
|
186
|
+
/** Append to workflow.iterations[]. Idempotent: callers should
|
|
187
|
+
* generate a unique-ish `at` per call so duplicates do not stack. */
|
|
188
|
+
export declare function appendIteration(projectRoot: string, entry: IterationEntry): Promise<WorkflowState>;
|
|
189
|
+
export {};
|
|
190
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/workflow/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAOH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC;IACnD,MAAM,EAAS,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAC7E,aAAa,EAAE,WAAW,GAAG,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAC/D,aAAa,EAAE,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,UAAU,GAAG,IAAI,CAAC;IAC5E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,EAAG,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAS,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,YAAY,GAAG,IAAI,CAAC;IACpE,UAAU,EAAO,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAY,MAAM,CAAC;IACzB,SAAS,EAAS,MAAM,CAAC;IACzB,iBAAiB,EAAC,MAAM,CAAC;IACzB,WAAW,EAAO,MAAM,CAAC;IACzB,SAAS,EAAS,MAAM,CAAC;IACzB,SAAS,EAAS,OAAO,CAAC;IAC1B,cAAc,EAAI,MAAM,CAAC;IACzB,iBAAiB,EAAC,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAG,MAAM,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
* in docs/PRODUCT_WORKFLOW.md. State lives in the project's
|
|
6
|
+
* yujin.forge.json under `workflow.*` so it survives across
|
|
7
|
+
* sessions + can be inspected + shared via the git repo.
|
|
8
|
+
*
|
|
9
|
+
* Every command in the workflow (yf triage, yf discover, yf
|
|
10
|
+
* clarify, yf spec, yf approve, yf bootstrap, yf block dev, yf
|
|
11
|
+
* deploy, yf manual, yf metrics, yf iterate) reads + writes
|
|
12
|
+
* through this module. The chat tool surface (forge_triage,
|
|
13
|
+
* forge_discover, etc) does the same -- the underlying state
|
|
14
|
+
* is identical regardless of entry point.
|
|
15
|
+
*
|
|
16
|
+
* Schema:
|
|
17
|
+
*
|
|
18
|
+
* workflow: {
|
|
19
|
+
* tier: 'simple' | 'medium' | 'full' | null,
|
|
20
|
+
* tier_reason: string,
|
|
21
|
+
* tier_decided_at: ISO,
|
|
22
|
+
*
|
|
23
|
+
* intent: { ... } // Phase I step 3
|
|
24
|
+
* legacy_audit: { ... } // Phase I step 3.5
|
|
25
|
+
* vault_inventory: { ... } // Phase I step 2 audit
|
|
26
|
+
*
|
|
27
|
+
* clarification: {
|
|
28
|
+
* functional: { done_at, summary, doc_path }, // step 4
|
|
29
|
+
* nfr_quantitative: { done_at, summary, doc_path }, // step 5
|
|
30
|
+
* nfr_structural: { done_at, summary, doc_path }, // step 6
|
|
31
|
+
* nfr_governance: { done_at, summary, doc_path }, // step 7
|
|
32
|
+
* nfr_operational: { done_at, summary, doc_path }, // step 8
|
|
33
|
+
* blocks: { done_at, blocks: [...] }, // step 9
|
|
34
|
+
* },
|
|
35
|
+
*
|
|
36
|
+
* specs: {
|
|
37
|
+
* rfp: { done_at, version, doc_path, sha256 }, // step 10
|
|
38
|
+
* arch: { done_at, version, doc_path, sha256 }, // step 11
|
|
39
|
+
* design: { done_at, version, doc_path, sha256 }, // step 12
|
|
40
|
+
* },
|
|
41
|
+
*
|
|
42
|
+
* approvals: {
|
|
43
|
+
* rfp: { approved_at, version_sha256 }, // step 13
|
|
44
|
+
* arch: { approved_at, version_sha256 }, // step 13
|
|
45
|
+
* design: { approved_at, version_sha256 }, // step 13
|
|
46
|
+
* },
|
|
47
|
+
*
|
|
48
|
+
* bootstrap: { done_at, stack, ci_set }, // step 14
|
|
49
|
+
*
|
|
50
|
+
* blocks_progress: [ // step 15
|
|
51
|
+
* { block_id, status, tests_green_at, deployed_at }
|
|
52
|
+
* ],
|
|
53
|
+
*
|
|
54
|
+
* deploy: { ... } // step 16
|
|
55
|
+
* postlaunch:{ ... } // step 17
|
|
56
|
+
* iterations:[{ at, type, summary }] // step 18
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* ASCII-only.
|
|
60
|
+
*/
|
|
61
|
+
import { promises as fs } from 'node:fs';
|
|
62
|
+
import path from 'node:path';
|
|
63
|
+
const CONFIG_FILE = 'yujin.forge.json';
|
|
64
|
+
function configPath(projectRoot) {
|
|
65
|
+
return path.join(projectRoot, CONFIG_FILE);
|
|
66
|
+
}
|
|
67
|
+
export async function loadConfig(projectRoot) {
|
|
68
|
+
try {
|
|
69
|
+
const raw = await fs.readFile(configPath(projectRoot), 'utf-8');
|
|
70
|
+
const parsed = JSON.parse(raw);
|
|
71
|
+
if (parsed && typeof parsed === 'object')
|
|
72
|
+
return parsed;
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
if (err.code !== 'ENOENT'
|
|
76
|
+
&& !(err instanceof SyntaxError)) {
|
|
77
|
+
throw err;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
export async function saveConfig(projectRoot, cfg) {
|
|
83
|
+
const text = JSON.stringify(cfg, null, 2) + '\n';
|
|
84
|
+
await fs.writeFile(configPath(projectRoot), text, 'utf-8');
|
|
85
|
+
}
|
|
86
|
+
export async function readWorkflow(projectRoot) {
|
|
87
|
+
const cfg = await loadConfig(projectRoot);
|
|
88
|
+
return cfg.workflow ?? {};
|
|
89
|
+
}
|
|
90
|
+
export async function writeWorkflow(projectRoot, patch) {
|
|
91
|
+
const cfg = await loadConfig(projectRoot);
|
|
92
|
+
cfg.workflow = { ...(cfg.workflow ?? {}), ...patch };
|
|
93
|
+
await saveConfig(projectRoot, cfg);
|
|
94
|
+
return cfg.workflow;
|
|
95
|
+
}
|
|
96
|
+
/** Update a NESTED key under workflow.<group> (clarification,
|
|
97
|
+
* specs, approvals, blocks_progress) without overwriting sibling
|
|
98
|
+
* keys at the same level. */
|
|
99
|
+
export async function patchWorkflowGroup(projectRoot, group, patch) {
|
|
100
|
+
const cfg = await loadConfig(projectRoot);
|
|
101
|
+
const wf = cfg.workflow ?? {};
|
|
102
|
+
const prev = (wf[group] ?? {});
|
|
103
|
+
const merged = { ...prev, ...patch };
|
|
104
|
+
cfg.workflow = { ...wf, [group]: merged };
|
|
105
|
+
await saveConfig(projectRoot, cfg);
|
|
106
|
+
return cfg.workflow;
|
|
107
|
+
}
|
|
108
|
+
/** Append to workflow.iterations[]. Idempotent: callers should
|
|
109
|
+
* generate a unique-ish `at` per call so duplicates do not stack. */
|
|
110
|
+
export async function appendIteration(projectRoot, entry) {
|
|
111
|
+
const cfg = await loadConfig(projectRoot);
|
|
112
|
+
const wf = cfg.workflow ?? {};
|
|
113
|
+
const list = Array.isArray(wf.iterations) ? wf.iterations : [];
|
|
114
|
+
list.push(entry);
|
|
115
|
+
cfg.workflow = { ...wf, iterations: list };
|
|
116
|
+
await saveConfig(projectRoot, cfg);
|
|
117
|
+
return cfg.workflow;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/workflow/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,M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G,CAAC,QAAQ,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC3C,MAAM,UAAU,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,GAAG,CAAC,QAAQ,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nac3/forge-cli",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.12",
|
|
4
4
|
"description": "Yujin Forge -- voice-first NAC-3 React development framework. CLI + chat panel + spec ingest + 10-format document reader + voice loop.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pablo Kuschnirof <pablo@rpaforce.com>",
|