@sun-asterisk/sungen 3.2.2-beta.5 → 3.2.2-beta.7
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/cli/commands/journey.d.ts +3 -0
- package/dist/cli/commands/journey.d.ts.map +1 -0
- package/dist/cli/commands/journey.js +92 -0
- package/dist/cli/commands/journey.js.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/harness/journey.d.ts +34 -0
- package/dist/harness/journey.d.ts.map +1 -0
- package/dist/harness/journey.js +251 -0
- package/dist/harness/journey.js.map +1 -0
- package/package.json +3 -3
- package/src/cli/commands/journey.ts +55 -0
- package/src/cli/index.ts +2 -0
- package/src/harness/journey.ts +233 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/journey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsC7D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.registerJourneyCommand = registerJourneyCommand;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const journey_1 = require("../../harness/journey");
|
|
40
|
+
const unit_paths_1 = require("../../harness/unit-paths");
|
|
41
|
+
function findScreenDir(name) {
|
|
42
|
+
const candidates = [
|
|
43
|
+
path.join(process.cwd(), 'qa', 'screens', name),
|
|
44
|
+
path.join(process.cwd(), 'qa', 'flows', name),
|
|
45
|
+
path.join(process.cwd(), 'qa', 'api', name),
|
|
46
|
+
];
|
|
47
|
+
for (const c of candidates)
|
|
48
|
+
if (fs.existsSync(c))
|
|
49
|
+
return c;
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
function registerJourneyCommand(program) {
|
|
53
|
+
program
|
|
54
|
+
.command('journey')
|
|
55
|
+
.description('Durable "you are here" board (#381): obligations + what-to-review + next, synthesised read-only from the audit report + ledger already on disk.')
|
|
56
|
+
.option('-s, --screen <name>', 'Screen / flow / api unit name')
|
|
57
|
+
.option('--waive <obligation>', 'Waive an obligation (e.g. OB-coverage) — requires --reason')
|
|
58
|
+
.option('--reason <text>', 'The reason a waived obligation is acceptable (mandatory with --waive)')
|
|
59
|
+
.option('--json', 'Output the raw JSON report')
|
|
60
|
+
.action((options) => {
|
|
61
|
+
try {
|
|
62
|
+
const name = options.screen;
|
|
63
|
+
if (!name)
|
|
64
|
+
throw new Error('Provide --screen <name>');
|
|
65
|
+
if (!findScreenDir(name))
|
|
66
|
+
throw new Error(`Not found: qa/screens/${name}, qa/flows/${name}, or qa/api/${name}`);
|
|
67
|
+
const report = options.waive
|
|
68
|
+
? (0, journey_1.waive)(process.cwd(), name, options.waive, options.reason || '')
|
|
69
|
+
: (0, journey_1.runJourney)(process.cwd(), name);
|
|
70
|
+
const outDir = path.join(process.cwd(), '.sungen', 'journey');
|
|
71
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
72
|
+
const slug = (0, unit_paths_1.reportSlug)(name);
|
|
73
|
+
fs.writeFileSync(path.join(outDir, `${slug}.json`), JSON.stringify(report, null, 2), 'utf-8');
|
|
74
|
+
const board = (0, journey_1.renderJourneyBoard)(report);
|
|
75
|
+
fs.writeFileSync(path.join(outDir, `${slug}.board.md`), board, 'utf-8');
|
|
76
|
+
if (options.json) {
|
|
77
|
+
console.log(JSON.stringify(report, null, 2));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.log('');
|
|
81
|
+
console.log(board);
|
|
82
|
+
console.log(` Board: ${path.relative(process.cwd(), path.join(outDir, `${slug}.board.md`))}`);
|
|
83
|
+
console.log('');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error('Error:', error instanceof Error ? error.message : error);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=journey.js.map
|
|
@@ -0,0 +1 @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,CAAC,KAAK,CAAC,CAAC;gBACnB,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC/F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -17,6 +17,7 @@ const add_flow_1 = require("./commands/add-flow");
|
|
|
17
17
|
const dashboard_1 = require("./commands/dashboard");
|
|
18
18
|
const audit_1 = require("./commands/audit");
|
|
19
19
|
const depth_lint_1 = require("./commands/depth-lint");
|
|
20
|
+
const journey_1 = require("./commands/journey");
|
|
20
21
|
const ingest_1 = require("./commands/ingest");
|
|
21
22
|
const eval_1 = require("./commands/eval");
|
|
22
23
|
const manifest_1 = require("./commands/manifest");
|
|
@@ -55,6 +56,7 @@ async function main() {
|
|
|
55
56
|
(0, dashboard_1.registerDashboardCommand)(program);
|
|
56
57
|
(0, audit_1.registerAuditCommand)(program);
|
|
57
58
|
(0, depth_lint_1.registerDepthLintCommand)(program);
|
|
59
|
+
(0, journey_1.registerJourneyCommand)(program);
|
|
58
60
|
(0, manifest_1.registerManifestCommand)(program);
|
|
59
61
|
(0, ledger_1.registerLedgerCommand)(program);
|
|
60
62
|
(0, feedback_1.registerFeedbackCommand)(program);
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type ObStatus = 'satisfied' | 'needs-work' | 'pending' | 'waived';
|
|
2
|
+
export interface Obligation {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
status: ObStatus;
|
|
6
|
+
detail: string;
|
|
7
|
+
waivedReason?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface JourneyReport {
|
|
10
|
+
unit: string;
|
|
11
|
+
generatedFrom: string[];
|
|
12
|
+
youAreHere: string;
|
|
13
|
+
phasesDone: string[];
|
|
14
|
+
gateStatus: string | null;
|
|
15
|
+
score: number | null;
|
|
16
|
+
obligations: Obligation[];
|
|
17
|
+
needsYou: string[];
|
|
18
|
+
nextSuggested: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The public entry: compute fresh, then RECONCILE with the persisted state —
|
|
22
|
+
* - auto-close is automatic (fresh recompute reflects the current artifacts);
|
|
23
|
+
* - an active waiver (evidence unchanged) sets status='waived' (carries the reason);
|
|
24
|
+
* - a STALE waiver (audit changed since it was waived) is re-surfaced for re-decision (anti-amnesia).
|
|
25
|
+
* Then persist the current evidence cursor.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runJourney(projectRoot: string, unit: string): JourneyReport;
|
|
28
|
+
/**
|
|
29
|
+
* Waive an obligation — REQUIRES a reason (anti-amnesia: a waiver leaves a recorded "why").
|
|
30
|
+
* Records the current evidence cursor so reconcile can invalidate it if the audit changes.
|
|
31
|
+
*/
|
|
32
|
+
export declare function waive(projectRoot: string, unit: string, obId: string, reason: string): JourneyReport;
|
|
33
|
+
export declare function renderJourneyBoard(r: JourneyReport): string;
|
|
34
|
+
//# sourceMappingURL=journey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../src/harness/journey.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AA0HD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAqB3E;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAepG;AAID,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,CAkB3D"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.runJourney = runJourney;
|
|
37
|
+
exports.waive = waive;
|
|
38
|
+
exports.renderJourneyBoard = renderJourneyBoard;
|
|
39
|
+
/**
|
|
40
|
+
* Journey board (epic #381, story S1) — the durable, read-only "you are here" view.
|
|
41
|
+
*
|
|
42
|
+
* Reconstructs the QA's position from artifacts ALREADY on disk (no recomputation, no context
|
|
43
|
+
* needed): the audit report (`.sungen/reports/<slug>-audit.json`) supplies the obligation status
|
|
44
|
+
* via its calibration axes + gate + findings; the ledger (`.sungen/ledger/<slug>.jsonl`) supplies
|
|
45
|
+
* the phase history ("you are here"). The output answers the three QA questions — what's next /
|
|
46
|
+
* what to review / what's doubtful — and persists `.sungen/journey/<slug>.{json,board.md}`.
|
|
47
|
+
*
|
|
48
|
+
* S1 = the read-only synthesis. S2 (this file) adds the **writable lifecycle**: persisted
|
|
49
|
+
* waivers (reason-required, anti-amnesia), reconcile (auto-close satisfied; re-surface a waiver
|
|
50
|
+
* when its evidence changed), via `runJourney` + `waive`. Gate-bound predicates + inter-phase
|
|
51
|
+
* gates are S3. Pure-deterministic, no AI.
|
|
52
|
+
*/
|
|
53
|
+
const fs = __importStar(require("fs"));
|
|
54
|
+
const path = __importStar(require("path"));
|
|
55
|
+
const crypto = __importStar(require("crypto"));
|
|
56
|
+
const unit_paths_1 = require("./unit-paths");
|
|
57
|
+
function readJSON(p) {
|
|
58
|
+
try {
|
|
59
|
+
return fs.existsSync(p) ? JSON.parse(fs.readFileSync(p, 'utf-8')) : null;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function readLedgerPhases(p) {
|
|
66
|
+
if (!fs.existsSync(p))
|
|
67
|
+
return [];
|
|
68
|
+
const out = [];
|
|
69
|
+
for (const line of fs.readFileSync(p, 'utf-8').split('\n')) {
|
|
70
|
+
if (!line.trim())
|
|
71
|
+
continue;
|
|
72
|
+
try {
|
|
73
|
+
const d = JSON.parse(line);
|
|
74
|
+
if (d.step)
|
|
75
|
+
out.push(String(d.step));
|
|
76
|
+
}
|
|
77
|
+
catch { /* skip */ }
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/** Findings that ask for HUMAN judgment (the review-queue seed), vs pure machine-repair targets. */
|
|
82
|
+
function isHumanFinding(f) {
|
|
83
|
+
return /@manual|MANUAL-|DEPTH-DEFERRED|UNSOURCEABLE|CAPABILITY-SUGGESTION|judgment|oracle|review/i.test(f);
|
|
84
|
+
}
|
|
85
|
+
const SAT = 0.8; // axis at/above this = satisfied (below = needs-work)
|
|
86
|
+
function computeFresh(projectRoot, unit) {
|
|
87
|
+
const slug = (0, unit_paths_1.reportSlug)(unit);
|
|
88
|
+
const audit = readJSON(path.join(projectRoot, '.sungen', 'reports', `${slug}-audit.json`));
|
|
89
|
+
const phases = readLedgerPhases(path.join(projectRoot, '.sungen', 'ledger', `${slug}.jsonl`));
|
|
90
|
+
const from = [];
|
|
91
|
+
if (audit)
|
|
92
|
+
from.push('audit');
|
|
93
|
+
if (phases.length)
|
|
94
|
+
from.push('ledger');
|
|
95
|
+
const youAreHere = phases.length ? phases[phases.length - 1] : 'not started';
|
|
96
|
+
const ran = (p) => phases.some((s) => s === p || s.startsWith(p));
|
|
97
|
+
const obligations = [];
|
|
98
|
+
const needsYou = [];
|
|
99
|
+
if (!audit) {
|
|
100
|
+
// Nothing measured yet — the journey hasn't really begun.
|
|
101
|
+
obligations.push({ id: 'OB-create', title: 'Generate test cases', status: 'pending', detail: 'No audit report yet — run /sungen:create-test.' });
|
|
102
|
+
return {
|
|
103
|
+
unit, generatedFrom: from, youAreHere, phasesDone: phases, gateStatus: null, score: null,
|
|
104
|
+
obligations, needsYou, nextSuggested: 'Run `/sungen:create-test ' + unit + '` to begin.',
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const ax = (audit.calibration && audit.calibration.axes) || {};
|
|
108
|
+
const depthThreshold = (audit.depth && audit.depth.threshold) || SAT;
|
|
109
|
+
const ob = (id, title, val, thr, detail) => ({
|
|
110
|
+
id, title,
|
|
111
|
+
status: val === undefined ? 'pending' : val >= thr ? 'satisfied' : 'needs-work',
|
|
112
|
+
detail: val === undefined ? detail : `${Math.round(val * 100)}% (need ${Math.round(thr * 100)}%) — ${detail}`,
|
|
113
|
+
});
|
|
114
|
+
obligations.push(ob('OB-spec', 'Spec readiness', ax.specFR, 1, 'FR/sections sufficient to design from'));
|
|
115
|
+
obligations.push(ob('OB-coverage', 'Viewpoint coverage', ax.coverage, SAT, 'critical themes covered'));
|
|
116
|
+
obligations.push(ob('OB-depth', 'Assertion depth', ax.businessDepth, depthThreshold, 'business-critical scenarios assert data'));
|
|
117
|
+
obligations.push(ob('OB-trace', 'Traceability', ax.taxonomy ?? ax.traceability, SAT, 'scenarios trace to viewpoints'));
|
|
118
|
+
// Automation obligation: automatable @manual still pending a driver = needs-work.
|
|
119
|
+
const autoPending = audit.automatableManual && audit.automatableManual.automatable > 0;
|
|
120
|
+
obligations.push({
|
|
121
|
+
id: 'OB-automation', title: 'Automation coverage',
|
|
122
|
+
status: autoPending ? 'needs-work' : 'satisfied',
|
|
123
|
+
detail: autoPending ? `${audit.automatableManual.automatable} @manual scenario(s) a driver could automate` : 'no capability-pending automatable cases',
|
|
124
|
+
});
|
|
125
|
+
// Human sign-off: always pending until S5 explicit signoff; carries the review-queue count.
|
|
126
|
+
const manualCount = (audit.manualOracle && audit.manualOracle.total) || 0;
|
|
127
|
+
obligations.push({
|
|
128
|
+
id: 'OB-signoff', title: 'Human sign-off', status: 'pending',
|
|
129
|
+
detail: `${needsYou.length} item(s) queued for your review (single sign-off at the end)`,
|
|
130
|
+
});
|
|
131
|
+
// Needs-you: human-judgment findings (the review-queue seed), with their anchors (titles) intact.
|
|
132
|
+
for (const f of (audit.findings || []))
|
|
133
|
+
if (isHumanFinding(f))
|
|
134
|
+
needsYou.push(f);
|
|
135
|
+
// Re-stamp the signoff detail now that needsYou is filled.
|
|
136
|
+
const signoff = obligations.find((o) => o.id === 'OB-signoff');
|
|
137
|
+
if (signoff)
|
|
138
|
+
signoff.detail = `${needsYou.length} item(s) queued for your review · ${manualCount} @manual scenario(s)`;
|
|
139
|
+
// Next suggested = first non-satisfied obligation; if all satisfied but run-test not done → run.
|
|
140
|
+
const firstGap = obligations.find((o) => o.status !== 'satisfied' && o.id !== 'OB-signoff');
|
|
141
|
+
let nextSuggested;
|
|
142
|
+
if (firstGap)
|
|
143
|
+
nextSuggested = `Repair "${firstGap.title}" (${firstGap.detail}).`;
|
|
144
|
+
else if (!ran('run'))
|
|
145
|
+
nextSuggested = `Quality satisfied — run \`/sungen:run-test ${unit}\`.`;
|
|
146
|
+
else
|
|
147
|
+
nextSuggested = `All obligations satisfied — review the ${needsYou.length} queued item(s), then sign off & deliver.`;
|
|
148
|
+
return {
|
|
149
|
+
unit, generatedFrom: from, youAreHere, phasesDone: phases,
|
|
150
|
+
gateStatus: audit.gateStatus ?? null, score: (audit.score && audit.score.overall) ?? null,
|
|
151
|
+
obligations, needsYou, nextSuggested,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function statePath(projectRoot, slug) {
|
|
155
|
+
return path.join(projectRoot, '.sungen', 'journey', `${slug}.state.json`);
|
|
156
|
+
}
|
|
157
|
+
/** Evidence cursor: the audit report's content hash. A waiver is invalidated when this changes. */
|
|
158
|
+
function auditHashOf(projectRoot, slug) {
|
|
159
|
+
const p = path.join(projectRoot, '.sungen', 'reports', `${slug}-audit.json`);
|
|
160
|
+
return fs.existsSync(p) ? crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex') : '';
|
|
161
|
+
}
|
|
162
|
+
function loadState(p) { return readJSON(p); }
|
|
163
|
+
function saveState(p, s) {
|
|
164
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
165
|
+
fs.writeFileSync(p, JSON.stringify(s, null, 2), 'utf-8');
|
|
166
|
+
}
|
|
167
|
+
/** Recompute nextSuggested AFTER waivers are applied (a waived obligation is not a gap). */
|
|
168
|
+
function computeNext(r, unit) {
|
|
169
|
+
const gap = r.obligations.find((o) => o.status !== 'satisfied' && o.status !== 'waived' && o.id !== 'OB-signoff');
|
|
170
|
+
if (gap)
|
|
171
|
+
return `Repair "${gap.title}" (${gap.detail}).`;
|
|
172
|
+
if (!r.phasesDone.some((s) => s === 'run' || s.startsWith('run')))
|
|
173
|
+
return `Quality satisfied — run \`/sungen:run-test ${unit}\`.`;
|
|
174
|
+
return `All obligations satisfied/waived — review the ${r.needsYou.length} queued item(s), then sign off & deliver.`;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The public entry: compute fresh, then RECONCILE with the persisted state —
|
|
178
|
+
* - auto-close is automatic (fresh recompute reflects the current artifacts);
|
|
179
|
+
* - an active waiver (evidence unchanged) sets status='waived' (carries the reason);
|
|
180
|
+
* - a STALE waiver (audit changed since it was waived) is re-surfaced for re-decision (anti-amnesia).
|
|
181
|
+
* Then persist the current evidence cursor.
|
|
182
|
+
*/
|
|
183
|
+
function runJourney(projectRoot, unit) {
|
|
184
|
+
const slug = (0, unit_paths_1.reportSlug)(unit);
|
|
185
|
+
const report = computeFresh(projectRoot, unit);
|
|
186
|
+
const sp = statePath(projectRoot, slug);
|
|
187
|
+
const state = loadState(sp) || { unit, auditHash: '', waivers: {} };
|
|
188
|
+
const curHash = auditHashOf(projectRoot, slug);
|
|
189
|
+
for (const ob of report.obligations) {
|
|
190
|
+
const w = state.waivers[ob.id];
|
|
191
|
+
if (!w)
|
|
192
|
+
continue;
|
|
193
|
+
if (w.auditHashAtWaive === curHash) {
|
|
194
|
+
ob.status = 'waived';
|
|
195
|
+
ob.waivedReason = w.reason;
|
|
196
|
+
ob.detail = `waived — ${w.reason}`;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
report.needsYou.unshift(`⚠️ Waiver on "${ob.title}" is STALE (evidence changed since ${w.at}) — re-decide. Was: ${w.reason}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
report.nextSuggested = computeNext(report, unit);
|
|
203
|
+
saveState(sp, { unit, auditHash: curHash, waivers: state.waivers });
|
|
204
|
+
return report;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Waive an obligation — REQUIRES a reason (anti-amnesia: a waiver leaves a recorded "why").
|
|
208
|
+
* Records the current evidence cursor so reconcile can invalidate it if the audit changes.
|
|
209
|
+
*/
|
|
210
|
+
function waive(projectRoot, unit, obId, reason) {
|
|
211
|
+
if (!reason || !reason.trim()) {
|
|
212
|
+
throw new Error('A reason is required to waive (anti-amnesia: a waiver must record WHY). Use --reason "...".');
|
|
213
|
+
}
|
|
214
|
+
const slug = (0, unit_paths_1.reportSlug)(unit);
|
|
215
|
+
const fresh = computeFresh(projectRoot, unit);
|
|
216
|
+
const valid = fresh.obligations.map((o) => o.id);
|
|
217
|
+
if (!valid.includes(obId)) {
|
|
218
|
+
throw new Error(`Unknown obligation "${obId}". Valid: ${valid.join(', ')}`);
|
|
219
|
+
}
|
|
220
|
+
const sp = statePath(projectRoot, slug);
|
|
221
|
+
const state = loadState(sp) || { unit, auditHash: '', waivers: {} };
|
|
222
|
+
state.waivers[obId] = { reason: reason.trim(), at: new Date().toISOString(), auditHashAtWaive: auditHashOf(projectRoot, slug) };
|
|
223
|
+
saveState(sp, state);
|
|
224
|
+
return runJourney(projectRoot, unit);
|
|
225
|
+
}
|
|
226
|
+
const ICON = { satisfied: '✅', 'needs-work': '⚠️ ', pending: '⏳', waived: '🚫' };
|
|
227
|
+
function renderJourneyBoard(r) {
|
|
228
|
+
const L = [];
|
|
229
|
+
L.push(`# Journey — ${r.unit}`);
|
|
230
|
+
L.push('');
|
|
231
|
+
L.push(`📍 **You are here:** ${r.youAreHere}` + (r.phasesDone.length ? ` (phases: ${r.phasesDone.join(' → ')})` : ''));
|
|
232
|
+
if (r.gateStatus)
|
|
233
|
+
L.push(` gate: **${r.gateStatus}** · score: ${r.score ?? '—'}/10`);
|
|
234
|
+
L.push('');
|
|
235
|
+
L.push('## What must still be true');
|
|
236
|
+
for (const o of r.obligations)
|
|
237
|
+
L.push(`- ${ICON[o.status]} **${o.title}** — ${o.detail}`);
|
|
238
|
+
L.push('');
|
|
239
|
+
L.push(`## 🔎 Needs your judgment (${r.needsYou.length})`);
|
|
240
|
+
if (r.needsYou.length)
|
|
241
|
+
for (const f of r.needsYou.slice(0, 20))
|
|
242
|
+
L.push(`- ${f}`);
|
|
243
|
+
else
|
|
244
|
+
L.push('- (nothing queued)');
|
|
245
|
+
L.push('');
|
|
246
|
+
L.push(`## → Next`);
|
|
247
|
+
L.push(`${r.nextSuggested}`);
|
|
248
|
+
L.push('');
|
|
249
|
+
return L.join('\n');
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey.js","sourceRoot":"","sources":["../../src/harness/journey.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwKA,gCAqBC;AAMD,sBAeC;AAID,gDAkBC;AAxOD;;;;;;;;;;;;;GAaG;AACH,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,6CAA0C;AAwB1C,SAAS,QAAQ,CAAC,CAAS;IACzB,IAAI,CAAC;QAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AAC1G,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAS;IACjC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,SAAS;QAC3B,IAAI,CAAC;YAAC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAAC,IAAI,CAAC,CAAC,IAAI;gBAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,G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AAM;QAAE,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;;QAC5E,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAClC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACX,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACX,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sun-asterisk/sungen",
|
|
3
|
-
"version": "3.2.2-beta.
|
|
3
|
+
"version": "3.2.2-beta.7",
|
|
4
4
|
"description": "Deterministic E2E Test Compiler - Gherkin + Selectors → Playwright tests",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"copy-templates": "mkdir -p dist/generators/test-generator/adapters/playwright/templates/steps && mkdir -p dist/generators/test-generator/templates && mkdir -p dist/orchestrator/templates && mkdir -p dist/dashboard/templates && cp -r src/generators/test-generator/adapters/playwright/templates/*.hbs dist/generators/test-generator/adapters/playwright/templates/ 2>/dev/null || true && cp -r src/generators/test-generator/adapters/playwright/templates/steps dist/generators/test-generator/adapters/playwright/templates/ && mkdir -p dist/generators/test-generator/adapters/appium/templates/steps && cp -r src/generators/test-generator/adapters/appium/templates/*.hbs dist/generators/test-generator/adapters/appium/templates/ 2>/dev/null || true && cp -r src/generators/test-generator/adapters/appium/templates/steps dist/generators/test-generator/adapters/appium/templates/ && cp src/generators/test-generator/templates/*.hbs dist/generators/test-generator/templates/ 2>/dev/null || true && cp -r src/orchestrator/templates/* dist/orchestrator/templates/ && cp src/dashboard/templates/index.html dist/dashboard/templates/index.html && mkdir -p dist/harness/catalog && cp src/harness/catalog/*.yaml dist/harness/catalog/",
|
|
13
13
|
"build:dashboard": "cd ../../dashboard && npm install --silent && npm run build && cd - && cp ../../dashboard/dist/index.html src/dashboard/templates/index.html",
|
|
14
14
|
"dev": "tsx src/cli/index.ts",
|
|
15
|
-
"test": "tsx tests/golden/run.ts && tsx tests/audit/run.ts && tsx tests/ingest/run.ts && tsx tests/eval/run.ts && tsx tests/exporter/run.ts && tsx tests/exporter/feature-parser-category.run.ts && tsx tests/exporter/api-detail-sheet.run.ts && tsx tests/api-runtime/base-path-url-join.run.ts && tsx tests/capabilities/run.ts && tsx tests/openapi/run.ts && tsx tests/packaging/run.ts",
|
|
15
|
+
"test": "tsx tests/golden/run.ts && tsx tests/audit/run.ts && tsx tests/ingest/run.ts && tsx tests/eval/run.ts && tsx tests/exporter/run.ts && tsx tests/exporter/feature-parser-category.run.ts && tsx tests/exporter/api-detail-sheet.run.ts && tsx tests/api-runtime/base-path-url-join.run.ts && tsx tests/capabilities/run.ts && tsx tests/openapi/run.ts && tsx tests/packaging/run.ts && tsx tests/journey/run.ts",
|
|
16
16
|
"test:update": "tsx tests/golden/run.ts --update && tsx tests/audit/run.ts --update && tsx tests/ingest/run.ts --update",
|
|
17
17
|
"prepublishOnly": "npm run build:dashboard && npm run build"
|
|
18
18
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=18.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sungen/driver-ui": "3.2.2-beta.
|
|
36
|
+
"@sungen/driver-ui": "3.2.2-beta.7",
|
|
37
37
|
"@anthropic-ai/sdk": "^0.71.0",
|
|
38
38
|
"@babel/parser": "^7.28.5",
|
|
39
39
|
"@babel/traverse": "^7.28.5",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import { runJourney, waive, renderJourneyBoard } from '../../harness/journey';
|
|
5
|
+
import { reportSlug } from '../../harness/unit-paths';
|
|
6
|
+
|
|
7
|
+
function findScreenDir(name: string): string | null {
|
|
8
|
+
const candidates = [
|
|
9
|
+
path.join(process.cwd(), 'qa', 'screens', name),
|
|
10
|
+
path.join(process.cwd(), 'qa', 'flows', name),
|
|
11
|
+
path.join(process.cwd(), 'qa', 'api', name),
|
|
12
|
+
];
|
|
13
|
+
for (const c of candidates) if (fs.existsSync(c)) return c;
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function registerJourneyCommand(program: Command): void {
|
|
18
|
+
program
|
|
19
|
+
.command('journey')
|
|
20
|
+
.description('Durable "you are here" board (#381): obligations + what-to-review + next, synthesised read-only from the audit report + ledger already on disk.')
|
|
21
|
+
.option('-s, --screen <name>', 'Screen / flow / api unit name')
|
|
22
|
+
.option('--waive <obligation>', 'Waive an obligation (e.g. OB-coverage) — requires --reason')
|
|
23
|
+
.option('--reason <text>', 'The reason a waived obligation is acceptable (mandatory with --waive)')
|
|
24
|
+
.option('--json', 'Output the raw JSON report')
|
|
25
|
+
.action((options) => {
|
|
26
|
+
try {
|
|
27
|
+
const name = options.screen;
|
|
28
|
+
if (!name) throw new Error('Provide --screen <name>');
|
|
29
|
+
if (!findScreenDir(name)) throw new Error(`Not found: qa/screens/${name}, qa/flows/${name}, or qa/api/${name}`);
|
|
30
|
+
|
|
31
|
+
const report = options.waive
|
|
32
|
+
? waive(process.cwd(), name, options.waive, options.reason || '')
|
|
33
|
+
: runJourney(process.cwd(), name);
|
|
34
|
+
|
|
35
|
+
const outDir = path.join(process.cwd(), '.sungen', 'journey');
|
|
36
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
37
|
+
const slug = reportSlug(name);
|
|
38
|
+
fs.writeFileSync(path.join(outDir, `${slug}.json`), JSON.stringify(report, null, 2), 'utf-8');
|
|
39
|
+
const board = renderJourneyBoard(report);
|
|
40
|
+
fs.writeFileSync(path.join(outDir, `${slug}.board.md`), board, 'utf-8');
|
|
41
|
+
|
|
42
|
+
if (options.json) {
|
|
43
|
+
console.log(JSON.stringify(report, null, 2));
|
|
44
|
+
} else {
|
|
45
|
+
console.log('');
|
|
46
|
+
console.log(board);
|
|
47
|
+
console.log(` Board: ${path.relative(process.cwd(), path.join(outDir, `${slug}.board.md`))}`);
|
|
48
|
+
console.log('');
|
|
49
|
+
}
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error('Error:', error instanceof Error ? error.message : error);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
package/src/cli/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { registerAddFlowCommand } from './commands/add-flow';
|
|
|
16
16
|
import { registerDashboardCommand } from './commands/dashboard';
|
|
17
17
|
import { registerAuditCommand } from './commands/audit';
|
|
18
18
|
import { registerDepthLintCommand } from './commands/depth-lint';
|
|
19
|
+
import { registerJourneyCommand } from './commands/journey';
|
|
19
20
|
import { registerIngestCommand } from './commands/ingest';
|
|
20
21
|
import { registerEvalCommand } from './commands/eval';
|
|
21
22
|
import { registerManifestCommand } from './commands/manifest';
|
|
@@ -59,6 +60,7 @@ async function main() {
|
|
|
59
60
|
registerDashboardCommand(program);
|
|
60
61
|
registerAuditCommand(program);
|
|
61
62
|
registerDepthLintCommand(program);
|
|
63
|
+
registerJourneyCommand(program);
|
|
62
64
|
registerManifestCommand(program);
|
|
63
65
|
registerLedgerCommand(program);
|
|
64
66
|
registerFeedbackCommand(program);
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Journey board (epic #381, story S1) — the durable, read-only "you are here" view.
|
|
3
|
+
*
|
|
4
|
+
* Reconstructs the QA's position from artifacts ALREADY on disk (no recomputation, no context
|
|
5
|
+
* needed): the audit report (`.sungen/reports/<slug>-audit.json`) supplies the obligation status
|
|
6
|
+
* via its calibration axes + gate + findings; the ledger (`.sungen/ledger/<slug>.jsonl`) supplies
|
|
7
|
+
* the phase history ("you are here"). The output answers the three QA questions — what's next /
|
|
8
|
+
* what to review / what's doubtful — and persists `.sungen/journey/<slug>.{json,board.md}`.
|
|
9
|
+
*
|
|
10
|
+
* S1 = the read-only synthesis. S2 (this file) adds the **writable lifecycle**: persisted
|
|
11
|
+
* waivers (reason-required, anti-amnesia), reconcile (auto-close satisfied; re-surface a waiver
|
|
12
|
+
* when its evidence changed), via `runJourney` + `waive`. Gate-bound predicates + inter-phase
|
|
13
|
+
* gates are S3. Pure-deterministic, no AI.
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from 'fs';
|
|
16
|
+
import * as path from 'path';
|
|
17
|
+
import * as crypto from 'crypto';
|
|
18
|
+
import { reportSlug } from './unit-paths';
|
|
19
|
+
|
|
20
|
+
export type ObStatus = 'satisfied' | 'needs-work' | 'pending' | 'waived';
|
|
21
|
+
|
|
22
|
+
export interface Obligation {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
status: ObStatus;
|
|
26
|
+
detail: string;
|
|
27
|
+
waivedReason?: string; // S2 — set when the QA explicitly waived this obligation
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface JourneyReport {
|
|
31
|
+
unit: string;
|
|
32
|
+
generatedFrom: string[]; // which artifacts were available
|
|
33
|
+
youAreHere: string; // last ledger phase, or 'not started'
|
|
34
|
+
phasesDone: string[];
|
|
35
|
+
gateStatus: string | null;
|
|
36
|
+
score: number | null;
|
|
37
|
+
obligations: Obligation[];
|
|
38
|
+
needsYou: string[]; // located findings / human-judgment items (the review queue seed)
|
|
39
|
+
nextSuggested: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function readJSON(p: string): any {
|
|
43
|
+
try { return fs.existsSync(p) ? JSON.parse(fs.readFileSync(p, 'utf-8')) : null; } catch { return null; }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function readLedgerPhases(p: string): string[] {
|
|
47
|
+
if (!fs.existsSync(p)) return [];
|
|
48
|
+
const out: string[] = [];
|
|
49
|
+
for (const line of fs.readFileSync(p, 'utf-8').split('\n')) {
|
|
50
|
+
if (!line.trim()) continue;
|
|
51
|
+
try { const d = JSON.parse(line); if (d.step) out.push(String(d.step)); } catch { /* skip */ }
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Findings that ask for HUMAN judgment (the review-queue seed), vs pure machine-repair targets. */
|
|
57
|
+
function isHumanFinding(f: string): boolean {
|
|
58
|
+
return /@manual|MANUAL-|DEPTH-DEFERRED|UNSOURCEABLE|CAPABILITY-SUGGESTION|judgment|oracle|review/i.test(f);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const SAT = 0.8; // axis at/above this = satisfied (below = needs-work)
|
|
62
|
+
|
|
63
|
+
function computeFresh(projectRoot: string, unit: string): JourneyReport {
|
|
64
|
+
const slug = reportSlug(unit);
|
|
65
|
+
const audit = readJSON(path.join(projectRoot, '.sungen', 'reports', `${slug}-audit.json`));
|
|
66
|
+
const phases = readLedgerPhases(path.join(projectRoot, '.sungen', 'ledger', `${slug}.jsonl`));
|
|
67
|
+
|
|
68
|
+
const from: string[] = [];
|
|
69
|
+
if (audit) from.push('audit');
|
|
70
|
+
if (phases.length) from.push('ledger');
|
|
71
|
+
|
|
72
|
+
const youAreHere = phases.length ? phases[phases.length - 1] : 'not started';
|
|
73
|
+
const ran = (p: string) => phases.some((s) => s === p || s.startsWith(p));
|
|
74
|
+
|
|
75
|
+
const obligations: Obligation[] = [];
|
|
76
|
+
const needsYou: string[] = [];
|
|
77
|
+
|
|
78
|
+
if (!audit) {
|
|
79
|
+
// Nothing measured yet — the journey hasn't really begun.
|
|
80
|
+
obligations.push({ id: 'OB-create', title: 'Generate test cases', status: 'pending', detail: 'No audit report yet — run /sungen:create-test.' });
|
|
81
|
+
return {
|
|
82
|
+
unit, generatedFrom: from, youAreHere, phasesDone: phases, gateStatus: null, score: null,
|
|
83
|
+
obligations, needsYou, nextSuggested: 'Run `/sungen:create-test ' + unit + '` to begin.',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const ax = (audit.calibration && audit.calibration.axes) || {};
|
|
88
|
+
const depthThreshold = (audit.depth && audit.depth.threshold) || SAT;
|
|
89
|
+
const ob = (id: string, title: string, val: number | undefined, thr: number, detail: string): Obligation => ({
|
|
90
|
+
id, title,
|
|
91
|
+
status: val === undefined ? 'pending' : val >= thr ? 'satisfied' : 'needs-work',
|
|
92
|
+
detail: val === undefined ? detail : `${Math.round(val * 100)}% (need ${Math.round(thr * 100)}%) — ${detail}`,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
obligations.push(ob('OB-spec', 'Spec readiness', ax.specFR, 1, 'FR/sections sufficient to design from'));
|
|
96
|
+
obligations.push(ob('OB-coverage', 'Viewpoint coverage', ax.coverage, SAT, 'critical themes covered'));
|
|
97
|
+
obligations.push(ob('OB-depth', 'Assertion depth', ax.businessDepth, depthThreshold, 'business-critical scenarios assert data'));
|
|
98
|
+
obligations.push(ob('OB-trace', 'Traceability', ax.taxonomy ?? ax.traceability, SAT, 'scenarios trace to viewpoints'));
|
|
99
|
+
|
|
100
|
+
// Automation obligation: automatable @manual still pending a driver = needs-work.
|
|
101
|
+
const autoPending = audit.automatableManual && audit.automatableManual.automatable > 0;
|
|
102
|
+
obligations.push({
|
|
103
|
+
id: 'OB-automation', title: 'Automation coverage',
|
|
104
|
+
status: autoPending ? 'needs-work' : 'satisfied',
|
|
105
|
+
detail: autoPending ? `${audit.automatableManual.automatable} @manual scenario(s) a driver could automate` : 'no capability-pending automatable cases',
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Human sign-off: always pending until S5 explicit signoff; carries the review-queue count.
|
|
109
|
+
const manualCount = (audit.manualOracle && audit.manualOracle.total) || 0;
|
|
110
|
+
obligations.push({
|
|
111
|
+
id: 'OB-signoff', title: 'Human sign-off', status: 'pending',
|
|
112
|
+
detail: `${needsYou.length} item(s) queued for your review (single sign-off at the end)`,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Needs-you: human-judgment findings (the review-queue seed), with their anchors (titles) intact.
|
|
116
|
+
for (const f of (audit.findings || [])) if (isHumanFinding(f)) needsYou.push(f);
|
|
117
|
+
// Re-stamp the signoff detail now that needsYou is filled.
|
|
118
|
+
const signoff = obligations.find((o) => o.id === 'OB-signoff');
|
|
119
|
+
if (signoff) signoff.detail = `${needsYou.length} item(s) queued for your review · ${manualCount} @manual scenario(s)`;
|
|
120
|
+
|
|
121
|
+
// Next suggested = first non-satisfied obligation; if all satisfied but run-test not done → run.
|
|
122
|
+
const firstGap = obligations.find((o) => o.status !== 'satisfied' && o.id !== 'OB-signoff');
|
|
123
|
+
let nextSuggested: string;
|
|
124
|
+
if (firstGap) nextSuggested = `Repair "${firstGap.title}" (${firstGap.detail}).`;
|
|
125
|
+
else if (!ran('run')) nextSuggested = `Quality satisfied — run \`/sungen:run-test ${unit}\`.`;
|
|
126
|
+
else nextSuggested = `All obligations satisfied — review the ${needsYou.length} queued item(s), then sign off & deliver.`;
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
unit, generatedFrom: from, youAreHere, phasesDone: phases,
|
|
130
|
+
gateStatus: audit.gateStatus ?? null, score: (audit.score && audit.score.overall) ?? null,
|
|
131
|
+
obligations, needsYou, nextSuggested,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ---------------- S2: writable lifecycle — persisted waivers + reconcile ----------------
|
|
136
|
+
|
|
137
|
+
interface Waiver { reason: string; at: string; auditHashAtWaive: string; }
|
|
138
|
+
interface JourneyState { unit: string; auditHash: string; waivers: Record<string, Waiver>; }
|
|
139
|
+
|
|
140
|
+
function statePath(projectRoot: string, slug: string): string {
|
|
141
|
+
return path.join(projectRoot, '.sungen', 'journey', `${slug}.state.json`);
|
|
142
|
+
}
|
|
143
|
+
/** Evidence cursor: the audit report's content hash. A waiver is invalidated when this changes. */
|
|
144
|
+
function auditHashOf(projectRoot: string, slug: string): string {
|
|
145
|
+
const p = path.join(projectRoot, '.sungen', 'reports', `${slug}-audit.json`);
|
|
146
|
+
return fs.existsSync(p) ? crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex') : '';
|
|
147
|
+
}
|
|
148
|
+
function loadState(p: string): JourneyState | null { return readJSON(p); }
|
|
149
|
+
function saveState(p: string, s: JourneyState): void {
|
|
150
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
151
|
+
fs.writeFileSync(p, JSON.stringify(s, null, 2), 'utf-8');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Recompute nextSuggested AFTER waivers are applied (a waived obligation is not a gap). */
|
|
155
|
+
function computeNext(r: JourneyReport, unit: string): string {
|
|
156
|
+
const gap = r.obligations.find((o) => o.status !== 'satisfied' && o.status !== 'waived' && o.id !== 'OB-signoff');
|
|
157
|
+
if (gap) return `Repair "${gap.title}" (${gap.detail}).`;
|
|
158
|
+
if (!r.phasesDone.some((s) => s === 'run' || s.startsWith('run'))) return `Quality satisfied — run \`/sungen:run-test ${unit}\`.`;
|
|
159
|
+
return `All obligations satisfied/waived — review the ${r.needsYou.length} queued item(s), then sign off & deliver.`;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The public entry: compute fresh, then RECONCILE with the persisted state —
|
|
164
|
+
* - auto-close is automatic (fresh recompute reflects the current artifacts);
|
|
165
|
+
* - an active waiver (evidence unchanged) sets status='waived' (carries the reason);
|
|
166
|
+
* - a STALE waiver (audit changed since it was waived) is re-surfaced for re-decision (anti-amnesia).
|
|
167
|
+
* Then persist the current evidence cursor.
|
|
168
|
+
*/
|
|
169
|
+
export function runJourney(projectRoot: string, unit: string): JourneyReport {
|
|
170
|
+
const slug = reportSlug(unit);
|
|
171
|
+
const report = computeFresh(projectRoot, unit);
|
|
172
|
+
const sp = statePath(projectRoot, slug);
|
|
173
|
+
const state = loadState(sp) || { unit, auditHash: '', waivers: {} };
|
|
174
|
+
const curHash = auditHashOf(projectRoot, slug);
|
|
175
|
+
|
|
176
|
+
for (const ob of report.obligations) {
|
|
177
|
+
const w = state.waivers[ob.id];
|
|
178
|
+
if (!w) continue;
|
|
179
|
+
if (w.auditHashAtWaive === curHash) {
|
|
180
|
+
ob.status = 'waived';
|
|
181
|
+
ob.waivedReason = w.reason;
|
|
182
|
+
ob.detail = `waived — ${w.reason}`;
|
|
183
|
+
} else {
|
|
184
|
+
report.needsYou.unshift(`⚠️ Waiver on "${ob.title}" is STALE (evidence changed since ${w.at}) — re-decide. Was: ${w.reason}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
report.nextSuggested = computeNext(report, unit);
|
|
188
|
+
saveState(sp, { unit, auditHash: curHash, waivers: state.waivers });
|
|
189
|
+
return report;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Waive an obligation — REQUIRES a reason (anti-amnesia: a waiver leaves a recorded "why").
|
|
194
|
+
* Records the current evidence cursor so reconcile can invalidate it if the audit changes.
|
|
195
|
+
*/
|
|
196
|
+
export function waive(projectRoot: string, unit: string, obId: string, reason: string): JourneyReport {
|
|
197
|
+
if (!reason || !reason.trim()) {
|
|
198
|
+
throw new Error('A reason is required to waive (anti-amnesia: a waiver must record WHY). Use --reason "...".');
|
|
199
|
+
}
|
|
200
|
+
const slug = reportSlug(unit);
|
|
201
|
+
const fresh = computeFresh(projectRoot, unit);
|
|
202
|
+
const valid = fresh.obligations.map((o) => o.id);
|
|
203
|
+
if (!valid.includes(obId)) {
|
|
204
|
+
throw new Error(`Unknown obligation "${obId}". Valid: ${valid.join(', ')}`);
|
|
205
|
+
}
|
|
206
|
+
const sp = statePath(projectRoot, slug);
|
|
207
|
+
const state = loadState(sp) || { unit, auditHash: '', waivers: {} };
|
|
208
|
+
state.waivers[obId] = { reason: reason.trim(), at: new Date().toISOString(), auditHashAtWaive: auditHashOf(projectRoot, slug) };
|
|
209
|
+
saveState(sp, state);
|
|
210
|
+
return runJourney(projectRoot, unit);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const ICON: Record<ObStatus, string> = { satisfied: '✅', 'needs-work': '⚠️ ', pending: '⏳', waived: '🚫' };
|
|
214
|
+
|
|
215
|
+
export function renderJourneyBoard(r: JourneyReport): string {
|
|
216
|
+
const L: string[] = [];
|
|
217
|
+
L.push(`# Journey — ${r.unit}`);
|
|
218
|
+
L.push('');
|
|
219
|
+
L.push(`📍 **You are here:** ${r.youAreHere}` + (r.phasesDone.length ? ` (phases: ${r.phasesDone.join(' → ')})` : ''));
|
|
220
|
+
if (r.gateStatus) L.push(` gate: **${r.gateStatus}** · score: ${r.score ?? '—'}/10`);
|
|
221
|
+
L.push('');
|
|
222
|
+
L.push('## What must still be true');
|
|
223
|
+
for (const o of r.obligations) L.push(`- ${ICON[o.status]} **${o.title}** — ${o.detail}`);
|
|
224
|
+
L.push('');
|
|
225
|
+
L.push(`## 🔎 Needs your judgment (${r.needsYou.length})`);
|
|
226
|
+
if (r.needsYou.length) for (const f of r.needsYou.slice(0, 20)) L.push(`- ${f}`);
|
|
227
|
+
else L.push('- (nothing queued)');
|
|
228
|
+
L.push('');
|
|
229
|
+
L.push(`## → Next`);
|
|
230
|
+
L.push(`${r.nextSuggested}`);
|
|
231
|
+
L.push('');
|
|
232
|
+
return L.join('\n');
|
|
233
|
+
}
|