@sun-asterisk/sungen 3.0.0-beta.79 → 3.0.0-beta.81

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.
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyEpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmC3D"}
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+EpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmC3D"}
@@ -111,6 +111,14 @@ function render(r) {
111
111
  L(' ✓ every MUST FR + per-constraint trigger covered');
112
112
  L('');
113
113
  }
114
+ if (r.ledger.hasViewpoint && r.ledger.total > 0) {
115
+ L(` ⑧ Viewpoint atomic coverage — ${r.ledger.covered}/${r.ledger.total} items (${(r.ledger.ratio * 100).toFixed(0)}%)`);
116
+ for (const m of r.ledger.missing.slice(0, 8))
117
+ L(` ○ missing: ${m.id ? m.id + ' — ' : ''}${m.text.slice(0, 70)}`);
118
+ if (r.ledger.missing.length > 8)
119
+ L(` … +${r.ledger.missing.length - 8} more`);
120
+ L('');
121
+ }
114
122
  L(' ── Findings (Repair targets) ──');
115
123
  if (r.findings.length === 0)
116
124
  L(' ✓ none — output passes the harness');
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,oDAmCC;AA3GD,2CAA6B;AAC7B,uCAAyB;AACzB,+CAA4D;AAE5D,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,MAA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EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,aAAa,CAAC,CAAC;YACxD,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAEpE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,MAAM,CAAC,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;gBAClE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClB,CAAC;YACD,kEAAkE;YAClE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,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"}
@@ -3,6 +3,7 @@ import { IntentProfile } from './intent';
3
3
  import { Provenance } from './provenance';
4
4
  import { SpecCoverageResult } from './spec-coverage';
5
5
  import { DownstreamResult, ManualOracleResult } from './quality-gates';
6
+ import { LedgerResult } from './viewpoint-ledger';
6
7
  export interface AuditReport {
7
8
  screen: string;
8
9
  scenarioCount: number;
@@ -16,6 +17,7 @@ export interface AuditReport {
16
17
  taxonomyMismatch: boolean;
17
18
  downstream: DownstreamResult;
18
19
  manualOracle: ManualOracleResult;
20
+ ledger: LedgerResult;
19
21
  score: {
20
22
  overall: number;
21
23
  coverage: number;
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/harness/audit.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EACvG,MAAM,WAAW,CAAC;AACnB,OAAO,EAAwC,aAAa,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAiB,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAgB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAA2C,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEhH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,kBAAkB,CAAC;IACjC,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;KACjB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AAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAkH3E"}
@@ -50,6 +50,7 @@ const intent_1 = require("./intent");
50
50
  const provenance_1 = require("./provenance");
51
51
  const spec_coverage_1 = require("./spec-coverage");
52
52
  const quality_gates_1 = require("./quality-gates");
53
+ const viewpoint_ledger_1 = require("./viewpoint-ledger");
53
54
  function runAudit(screenDir, screenName) {
54
55
  const featurePath = path.join(screenDir, 'features', `${screenName}.feature`);
55
56
  const viewpointPath = path.join(screenDir, 'requirements', 'test-viewpoint.md');
@@ -73,6 +74,7 @@ function runAudit(screenDir, screenName) {
73
74
  // #2 downstream-scope + #4 manual-oracle
74
75
  const downstream = (0, quality_gates_1.downstreamScope)((0, quality_gates_1.readText)(specPath), scenarios);
75
76
  const manualOracleResult = (0, quality_gates_1.manualOracle)(featureText);
77
+ const ledger = (0, viewpoint_ledger_1.viewpointLedger)(viewpointPath, scenarios, featureText);
76
78
  // Sub-scores
77
79
  const coverage = gate.coverageRatio;
78
80
  const businessDepth = depth.bcDepthRatio;
@@ -128,6 +130,10 @@ function runAudit(screenDir, screenName) {
128
130
  for (const m of manualOracleResult.insufficient.slice(0, 8)) {
129
131
  findings.push(`MANUAL-STEPS-INSUFFICIENT: "${m}" — a @manual scenario needs setup · action · observable expected · oracle/tool (not just a one-line note).`);
130
132
  }
133
+ if (ledger.hasViewpoint && ledger.missing.length) {
134
+ const sample = ledger.missing.slice(0, 6).map((m) => m.id || `"${m.text}"`).join(', ');
135
+ findings.push(`VIEWPOINT-ITEM-MISSING: ${ledger.missing.length}/${ledger.total} atomic viewpoint items have no covering scenario (${(ledger.ratio * 100).toFixed(0)}% covered) — e.g. ${sample}. Cover each item or mark it deferred/spec-gap.`);
136
+ }
131
137
  // Gate spans coverage (viewpoint themes), depth, claim-proof, spec-clause coverage,
132
138
  // AND taxonomy-match (scenarios must use the project's viewpoint IDs when defined).
133
139
  const gateStatus = gate.gaps.length === 0 && depth.verdict !== 'fail' && claim.verdict !== 'fail' && spec.verdict !== 'fail' && !taxonomyMismatch ? 'PASS' : 'FAIL';
@@ -135,7 +141,7 @@ function runAudit(screenDir, screenName) {
135
141
  screen: screenName,
136
142
  scenarioCount: scenarios.length,
137
143
  gate, depth, claim, taxonomy, balance, duplicates, trace, spec,
138
- taxonomyMismatch, downstream, manualOracle: manualOracleResult,
144
+ taxonomyMismatch, downstream, manualOracle: manualOracleResult, ledger,
139
145
  score: {
140
146
  overall: Math.round(overall * 10) / 10,
141
147
  coverage: Math.round(coverage * 100) / 100,
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/harness/audit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,4BA6GC;AA7JD;;;;;;;GAOG;AACH,2CAA6B;AAC7B,uCAAyB;AACzB,mCAA8F;AAC9F,uCAGmB;AACnB,qCAA+E;AAC/E,6CAAyD;AACzD,mDAAmE;AACnE,mDAAgH;AA8BhH,SAAgB,QAAQ,CAAC,SAAiB,EAAE,UAAkB;IAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,UAAU,UAAU,CAAC,CAAC;IAC9E,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC;IAEhF,MA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AG,GAAG;YAC7C,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,GAAG;YAChD,OAAO,EAAE,sFAAsF;SAChG;QACD,UAAU;QACV,QAAQ;QACR,MAAM;QACN,UAAU,EAAE,IAAA,0BAAa,GAAE;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ScenarioInfo } from './parse';
2
+ export interface LedgerItem {
3
+ id?: string;
4
+ text: string;
5
+ covered: boolean;
6
+ }
7
+ export interface LedgerResult {
8
+ hasViewpoint: boolean;
9
+ total: number;
10
+ covered: number;
11
+ ratio: number;
12
+ missing: {
13
+ id?: string;
14
+ text: string;
15
+ }[];
16
+ }
17
+ /** Extract atomic checklist items from a viewpoint file (format-tolerant). */
18
+ export declare function parseViewpointItems(viewpointPath: string): {
19
+ id?: string;
20
+ text: string;
21
+ }[];
22
+ export declare function viewpointLedger(viewpointPath: string, scenarios: ScenarioInfo[], featureText: string): LedgerResult;
23
+ //# sourceMappingURL=viewpoint-ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewpoint-ledger.d.ts","sourceRoot":"","sources":["../../src/harness/viewpoint-ledger.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,UAAU;IAAG,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE;AAE3E,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1C;AAKD,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CA4B1F;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,YAAY,CAsBnH"}
@@ -0,0 +1,118 @@
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.parseViewpointItems = parseViewpointItems;
37
+ exports.viewpointLedger = viewpointLedger;
38
+ /**
39
+ * Viewpoint Atomic Coverage Ledger (harness #2).
40
+ *
41
+ * The project's `test-viewpoint.md` IS the coverage contract. This parses it into ATOMIC
42
+ * items (each bullet / table row / ID-prefixed line) and reports the status of EACH —
43
+ * covered / missing — instead of the coarse "viewpoint mentioned" signal. It is fully
44
+ * project-driven (works on any project's viewpoint file, any domain), which is why it
45
+ * scales where a hardcoded domain catalog does not. Advisory: it surfaces the per-item
46
+ * gaps that inflate a "looks-covered" score; it does not fail the gate.
47
+ */
48
+ const fs = __importStar(require("fs"));
49
+ const ID_RE = /\b([A-Z]{1,5}\d{0,2}(?:[.\-][A-Za-z0-9]+)*-?\d{0,3})\b/; // VP0.Title, VP7-002, MS-HP-001, TV-01
50
+ const GENERIC = new Set(['display', 'shown', 'value', 'field', 'input', 'page', 'screen', 'button', 'link', 'text', 'check', 'verify', 'should', 'with', 'when', 'then', 'user', 'this', 'that', 'each', 'item', 'items']);
51
+ /** Extract atomic checklist items from a viewpoint file (format-tolerant). */
52
+ function parseViewpointItems(viewpointPath) {
53
+ if (!fs.existsSync(viewpointPath))
54
+ return [];
55
+ const lines = fs.readFileSync(viewpointPath, 'utf-8').split('\n');
56
+ const items = [];
57
+ let inFence = false;
58
+ for (const raw of lines) {
59
+ const line = raw.trim();
60
+ if (line.startsWith('```')) {
61
+ inFence = !inFence;
62
+ continue;
63
+ }
64
+ if (inFence || !line)
65
+ continue;
66
+ if (/^#{1,6}\s/.test(line))
67
+ continue; // markdown heading
68
+ let text = '';
69
+ const bullet = line.match(/^(?:[-*+]|\d+[.)])\s+(.*)$/);
70
+ if (bullet)
71
+ text = bullet[1];
72
+ else if (line.startsWith('|')) { // table data row
73
+ if (/^\|[\s|:-]+\|?$/.test(line))
74
+ continue; // separator
75
+ const cells = line.split('|').map((c) => c.trim()).filter(Boolean);
76
+ if (/^(vp|id|viewpoint|priority|reason|no\.?|category|item|trigger|#|pattern|applicable|notes|field|constraint|code|description|status)$/i.test(cells[0] || ''))
77
+ continue; // header
78
+ text = cells.join(' — ');
79
+ }
80
+ else
81
+ continue;
82
+ text = text.replace(/[*`]/g, '').trim();
83
+ if (!text)
84
+ continue;
85
+ const idM = text.match(ID_RE);
86
+ const id = idM && /\d/.test(idM[1]) ? idM[1] : undefined; // require a digit so prose words aren't IDs
87
+ const words = (text.toLowerCase().match(/[a-z][a-z-]{3,}/g) || []).filter((w) => !GENERIC.has(w));
88
+ if (!id && words.length < 2)
89
+ continue; // not substantive enough to track
90
+ items.push({ id, text: text.slice(0, 100) });
91
+ }
92
+ return items;
93
+ }
94
+ function viewpointLedger(viewpointPath, scenarios, featureText) {
95
+ const items = parseViewpointItems(viewpointPath);
96
+ if (!fs.existsSync(viewpointPath) || items.length === 0) {
97
+ return { hasViewpoint: fs.existsSync(viewpointPath), total: 0, covered: 0, ratio: 1, missing: [] };
98
+ }
99
+ const featLower = featureText.toLowerCase();
100
+ const missing = [];
101
+ let covered = 0;
102
+ for (const item of items) {
103
+ let isCovered = false;
104
+ if (item.id && featLower.includes(item.id.toLowerCase()))
105
+ isCovered = true;
106
+ else {
107
+ const words = [...new Set((item.text.toLowerCase().match(/[a-z][a-z-]{3,}/g) || []).filter((w) => !GENERIC.has(w)))];
108
+ const need = Math.min(2, words.length);
109
+ isCovered = words.length > 0 && scenarios.some((s) => words.filter((w) => s.haystack.includes(w)).length >= need);
110
+ }
111
+ if (isCovered)
112
+ covered++;
113
+ else
114
+ missing.push({ id: item.id, text: item.text });
115
+ }
116
+ return { hasViewpoint: true, total: items.length, covered, ratio: items.length ? covered / items.length : 1, missing };
117
+ }
118
+ //# sourceMappingURL=viewpoint-ledger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewpoint-ledger.js","sourceRoot":"","sources":["../../src/harness/viewpoint-ledger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,kDA4BC;AAED,0CAsBC;AA/ED;;;;;;;;;GASG;AACH,uCAAyB;AAazB,MAAM,KAAK,GAAG,wDAAwD,CAAC,CAAC,uCAAuC;AAC/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AI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;QACpH,CAAC;QACD,IAAI,SAAS;YAAE,OAAO,EAAE,CAAC;;YACpB,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AACzH,CAAC"}
@@ -105,6 +105,9 @@ Auto-detected by `create-test` before invoking this skill:
105
105
  2. Each row / bullet / item = 1 viewpoint → add to `Viewpoint items` in Coverage Map.
106
106
  3. Do NOT pre-classify into buckets before scanning — classify only when
107
107
  writing the scenario.
108
+ 4. **If it declares viewpoint IDs** (e.g. `VP0`, `VP1`…`VP12`, `MS-HP-001`), capture each
109
+ item WITH its ID and **reuse that ID as the scenario code** — do not invent a generic
110
+ `VP-<CAT>` scheme (the harness Taxonomy-match gate FAILs on mismatch).
108
111
  - `qa/context.md` — project-wide context set by the QA lead. Read ONCE before building the Coverage Map; apply to every screen. Extraction rules:
109
112
  - **Roles** → for each role in the table: add to the `@auth:X` tag pool; generate a VP-SEC blocked-access scenario for every role boundary relevant to this screen.
110
113
  - **Testing strategy → Focus areas** → if `security` listed: VP-SEC is mandatory Tier 1 for every free-text input regardless of spec risk level; if `ui` not listed: all VP-UI scenarios move to Tier 2 minimum.
@@ -260,6 +263,26 @@ Security: [S1 – admin only]
260
263
 
261
264
  **Balance:** cover all the above (deep) BEFORE expanding subscription / UI-presence / extra validation edge cases. Do not over-invest in subscription while cart/detail/filter correctness are shallow.
262
265
 
266
+ #### Harness gates — satisfy on the FIRST pass (don't make the repair loop fix them)
267
+
268
+ `sungen audit` enforces these. Generate compliant output up front:
269
+
270
+ 1. **Taxonomy-match** (`VP-TAXONOMY-MISMATCH`, gate-FAIL) — when `test-viewpoint.md` declares its own viewpoint IDs (e.g. `VP0`, `VP1`, … `VP12`, `MS-HP-001`, `MS-EH-001`), **reuse those IDs verbatim as the scenario codes**. Do NOT invent a generic `VP-UI / VP-LOGIC / VP-VAL` scheme — that breaks the coverage matrix. Only fall back to `VP-<CATEGORY>-<NNN>` when the viewpoint file declares no IDs.
271
+ 2. **Spec-coverage triggers** (`TRIGGER-UNCOVERED`, gate-FAIL) — the Validation-Rules table lists a **trigger** per constraint (e.g. `blur, submit`). Generate one scenario **per (constraint × trigger)** — a `format` rule validating *on blur AND on submit* needs BOTH a blur scenario (`press Tab`) and a submit scenario (`click [Submit]` / `press Enter`). Never collapse the trigger × input matrix to one representative case.
272
+ 3. **Claim-Proof** (`CLAIM-UNPROVEN`) — a title claiming `all`/`only`/`every`/`single`/`correct`/`same`/`changes`/`hidden`/`cleared`/`restored`/`independent`/`sanitized`/`announces` MUST have the matching assertion (`see all …`, count, `remember`+compare, `is hidden`, return-and-assert-empty, etc.). If the title promises it, the steps must prove it.
273
+ 4. **Downstream-scope** (`DOWNSTREAM-SCOPE-MISSING`) — when the spec's Navigation Flow / success target is **another screen** (e.g. a confirmation/sent page), don't stop at a terminal `see [X] page`. Either cover that screen's content/guards (if its viewpoint items are in scope — they often have their own `MS-*` IDs), or scaffold it (`sungen add --screen <name>`) and note the handoff. Do not silently drop the downstream surface.
274
+ 5. **Manual-oracle** (`MANUAL-STEPS-INSUFFICIENT`) — every `@manual` scenario needs **setup · action · observable expected · oracle/tool**, not a one-line note. Use this comment shape:
275
+ ```gherkin
276
+ @high @manual
277
+ Scenario: VP-… <claim>
278
+ # MANUAL: <why it can't be automated — needs network capture / inbox / screen-reader / multi-tab>
279
+ # Tester verifies:
280
+ # 1. <setup> e.g. seed a registered email; throttle the network
281
+ # 2. <action> e.g. click [Submit] with the request in flight
282
+ # 3. <observable> e.g. only ONE POST is dispatched
283
+ # 4. Oracle: <tool> e.g. DevTools Network panel / mail-catcher / NVDA
284
+ ```
285
+
263
286
  #### Tier 1 guard — minimum before writing scenarios
264
287
 
265
288
  | Spec section | Minimum requirement | Tag |
@@ -376,7 +399,7 @@ Add cleanup tags per the `sungen-gherkin-syntax` Cleanup table. Key rules:
376
399
  **Files:** `qa/screens/<screen>/features/<screen>.feature` + `qa/screens/<screen>/test-data/<screen>.yaml`
377
400
 
378
401
  Use step patterns and element types from `sungen-gherkin-syntax`.
379
- **Naming**: `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
402
+ **Naming**: reuse the **project's `test-viewpoint.md` IDs** when it declares them (e.g. `VP0`, `MS-HP-001`); otherwise `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
380
403
 
381
404
  **Test data** — grouped by section, loaded at runtime:
382
405
 
@@ -105,6 +105,17 @@ Auto-detected by `create-test` before invoking this skill:
105
105
  2. Each row / bullet / item = 1 viewpoint → add to `Viewpoint items` in Coverage Map.
106
106
  3. Do NOT pre-classify into buckets before scanning — classify only when
107
107
  writing the scenario.
108
+ 4. **If it declares viewpoint IDs** (e.g. `VP0`, `VP1`…`VP12`, `MS-HP-001`), capture each
109
+ item WITH its ID and **reuse that ID as the scenario code** — do not invent a generic
110
+ `VP-<CAT>` scheme (the harness Taxonomy-match gate FAILs on mismatch).
111
+ - `qa/context.md` — project-wide context set by the QA lead. Read ONCE before building the Coverage Map; apply to every screen. Extraction rules:
112
+ - **Roles** → for each role in the table: add to the `@auth:X` tag pool; generate a VP-SEC blocked-access scenario for every role boundary relevant to this screen.
113
+ - **Testing strategy → Focus areas** → if `security` listed: VP-SEC is mandatory Tier 1 for every free-text input regardless of spec risk level; if `ui` not listed: all VP-UI scenarios move to Tier 2 minimum.
114
+ - **Testing strategy → Mandatory coverage** → each line is a hard override applied to this screen regardless of spec risk; document in `Context constraints` of the Coverage Map.
115
+ - **Testing strategy → Deprioritize/skip** → record in `Context constraints`; suppress those VP categories from Tier 1 generation.
116
+ - **Global business rules** → add each to the `Business rules` section tagged `[G]` (e.g. `[G1 – soft-delete only]`); treat as `HIGH` risk unless stated otherwise.
117
+ - **Error patterns** → use as fallback only when `spec.md` does not give exact error text; never override spec-specified messages.
118
+ - If `qa/context.md` is absent: proceed without it — no impact on the generation flow.
108
119
 
109
120
  **Single screen focus**: one URL = one screen. Modals on same page = part of this screen.
110
121
  This means: do not test other screens' UI layout or navigation. It does NOT mean skip documenting business outcomes that your screen's actions cause on other surfaces. Those cross-surface outcomes must appear in the Coverage Map and be covered by at least `@manual` scenarios.
@@ -129,6 +140,11 @@ Read `spec.md` fully, then extract into a Coverage Map **before writing any scen
129
140
  **Risk tags:** HIGH = complex business rules, cascading fields, multi-step state changes, auth/integration. LOW = display-only, static labels, read-only fields.
130
141
 
131
142
  ```
143
+ Context constraints: [populated from qa/context.md before writing any scenario]
144
+ roles: [list roles, e.g. admin / manager / staff]
145
+ strategy: [active overrides, e.g. "VP-SEC mandatory T1", "VP-UI → T2 only"]
146
+ global rules: [G1 – ...] → also appear in Business rules below tagged [G]
147
+ → leave empty if qa/context.md is absent or has no entries applicable to this screen
132
148
  User journeys: [J1 – ...], [J2 – ...]
133
149
  Validation rules: [V1 – field → "exact error text"], [V2 – ...]
134
150
  Business rules: [B1 HIGH – ...], [B2 LOW – ...]
@@ -221,7 +237,7 @@ Security: [S1 – admin only]
221
237
  | **auth** | valid-login · invalid-credential · access-control |
222
238
 
223
239
  **Required assertion shapes (use these, not bare visibility):**
224
- - Card info: assert at **card level** (image+name+price together), e.g. `User see all [Product Card] contain {{...}}` — not `see [Section]`.
240
+ - Card info: assert at **card level** (image+name+price together), e.g. `User see all [Product Card] contain {{...}}` — not `see [Section]` (section-level passes even if one card lacks price).
225
241
  - Cross-screen consistency (detail/cart): **capture then compare** —
226
242
  ```gherkin
227
243
  When User remember [Product Name] text as {{selected_product_name}}
@@ -239,13 +255,33 @@ Security: [S1 – admin only]
239
255
  - **If the spec lacks the concrete value** a deep assertion needs (exact message, price, count): still write the deep shape with a `{{var}}` placeholder and leave a `# SPEC-GAP: <field> value not in spec` comment — do **not** downgrade to `see [X] section`. A visible gap is better than a silent shallow pass.
240
256
  - **Blind-Spot Memory:** before finishing, run `sungen blindspot list --prompt` (Bash) and make sure the suite satisfies each recorded pattern (e.g. "for any Add/Create action: check success + resulting data state + duplicate/double-submit"). These are gaps QA hit before — don't repeat them.
241
257
 
242
- **First-pass anti-patterns (exactly what the gate/reviewer reject — avoid them):**
243
- - Title↔steps mismatch (e.g. a "no-result" scenario that clicks a query which returns products).
244
- - Tautology `Then`: `click [Next Slide]` → `see [Carousel] section` (proves nothing).
245
- - Business-critical scenario ending at `see [Added] modal` / `see [Cart] page` with no data assertion.
258
+ **First-pass anti-patterns (these are exactly what the gate/reviewer reject — avoid them):**
259
+ - Title↔steps mismatch: e.g. a "no-result state" scenario that clicks a query which **returns** products. Steps must create the condition the title claims.
260
+ - Tautology `Then`: `click [Next Slide]` → `see [Carousel] section` (always visible, proves nothing). Assert the change (new slide title differs).
261
+ - Business-critical scenario ending at `see [Added] modal` / `see [Cart] page` / `see [Category Products] page` with no data assertion.
246
262
  - Brand filter covered only as navigation (must assert products belong to the brand).
247
263
 
248
- **Balance:** cover all the above (deep) BEFORE expanding subscription / UI-presence / extra validation edge cases.
264
+ **Balance:** cover all the above (deep) BEFORE expanding subscription / UI-presence / extra validation edge cases. Do not over-invest in subscription while cart/detail/filter correctness are shallow.
265
+
266
+ #### Harness gates — satisfy on the FIRST pass (don't make the repair loop fix them)
267
+
268
+ `sungen audit` enforces these. Generate compliant output up front:
269
+
270
+ 1. **Taxonomy-match** (`VP-TAXONOMY-MISMATCH`, gate-FAIL) — when `test-viewpoint.md` declares its own viewpoint IDs (e.g. `VP0`, `VP1`, … `VP12`, `MS-HP-001`, `MS-EH-001`), **reuse those IDs verbatim as the scenario codes**. Do NOT invent a generic `VP-UI / VP-LOGIC / VP-VAL` scheme — that breaks the coverage matrix. Only fall back to `VP-<CATEGORY>-<NNN>` when the viewpoint file declares no IDs.
271
+ 2. **Spec-coverage triggers** (`TRIGGER-UNCOVERED`, gate-FAIL) — the Validation-Rules table lists a **trigger** per constraint (e.g. `blur, submit`). Generate one scenario **per (constraint × trigger)** — a `format` rule validating *on blur AND on submit* needs BOTH a blur scenario (`press Tab`) and a submit scenario (`click [Submit]` / `press Enter`). Never collapse the trigger × input matrix to one representative case.
272
+ 3. **Claim-Proof** (`CLAIM-UNPROVEN`) — a title claiming `all`/`only`/`every`/`single`/`correct`/`same`/`changes`/`hidden`/`cleared`/`restored`/`independent`/`sanitized`/`announces` MUST have the matching assertion (`see all …`, count, `remember`+compare, `is hidden`, return-and-assert-empty, etc.). If the title promises it, the steps must prove it.
273
+ 4. **Downstream-scope** (`DOWNSTREAM-SCOPE-MISSING`) — when the spec's Navigation Flow / success target is **another screen** (e.g. a confirmation/sent page), don't stop at a terminal `see [X] page`. Either cover that screen's content/guards (if its viewpoint items are in scope — they often have their own `MS-*` IDs), or scaffold it (`sungen add --screen <name>`) and note the handoff. Do not silently drop the downstream surface.
274
+ 5. **Manual-oracle** (`MANUAL-STEPS-INSUFFICIENT`) — every `@manual` scenario needs **setup · action · observable expected · oracle/tool**, not a one-line note. Use this comment shape:
275
+ ```gherkin
276
+ @high @manual
277
+ Scenario: VP-… <claim>
278
+ # MANUAL: <why it can't be automated — needs network capture / inbox / screen-reader / multi-tab>
279
+ # Tester verifies:
280
+ # 1. <setup> e.g. seed a registered email; throttle the network
281
+ # 2. <action> e.g. click [Submit] with the request in flight
282
+ # 3. <observable> e.g. only ONE POST is dispatched
283
+ # 4. Oracle: <tool> e.g. DevTools Network panel / mail-catcher / NVDA
284
+ ```
249
285
 
250
286
  #### Tier 1 guard — minimum before writing scenarios
251
287
 
@@ -363,7 +399,7 @@ Add cleanup tags per the `sungen-gherkin-syntax` Cleanup table. Key rules:
363
399
  **Files:** `qa/screens/<screen>/features/<screen>.feature` + `qa/screens/<screen>/test-data/<screen>.yaml`
364
400
 
365
401
  Use step patterns and element types from `sungen-gherkin-syntax`.
366
- **Naming**: `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
402
+ **Naming**: reuse the **project's `test-viewpoint.md` IDs** when it declares them (e.g. `VP0`, `MS-HP-001`); otherwise `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
367
403
 
368
404
  **Test data** — grouped by section, loaded at runtime:
369
405
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sun-asterisk/sungen",
3
- "version": "3.0.0-beta.79",
3
+ "version": "3.0.0-beta.81",
4
4
  "description": "Deterministic E2E Test Compiler - Gherkin + Selectors → Playwright tests",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -65,6 +65,12 @@ function render(r: AuditReport): void {
65
65
  if (!r.spec.triggerGaps.length && !r.spec.uncoveredMust.length) L(' ✓ every MUST FR + per-constraint trigger covered');
66
66
  L('');
67
67
  }
68
+ if (r.ledger.hasViewpoint && r.ledger.total > 0) {
69
+ L(` ⑧ Viewpoint atomic coverage — ${r.ledger.covered}/${r.ledger.total} items (${(r.ledger.ratio * 100).toFixed(0)}%)`);
70
+ for (const m of r.ledger.missing.slice(0, 8)) L(` ○ missing: ${m.id ? m.id + ' — ' : ''}${m.text.slice(0, 70)}`);
71
+ if (r.ledger.missing.length > 8) L(` … +${r.ledger.missing.length - 8} more`);
72
+ L('');
73
+ }
68
74
  L(' ── Findings (Repair targets) ──');
69
75
  if (r.findings.length === 0) L(' ✓ none — output passes the harness');
70
76
  for (const f of r.findings) L(` • ${f}`);
@@ -17,6 +17,7 @@ import { readIntent, projectRootFromScreenDir, IntentProfile } from './intent';
17
17
  import { getProvenance, Provenance } from './provenance';
18
18
  import { specCoverage, SpecCoverageResult } from './spec-coverage';
19
19
  import { downstreamScope, manualOracle, readText, DownstreamResult, ManualOracleResult } from './quality-gates';
20
+ import { viewpointLedger, LedgerResult } from './viewpoint-ledger';
20
21
 
21
22
  export interface AuditReport {
22
23
  screen: string;
@@ -28,9 +29,10 @@ export interface AuditReport {
28
29
  balance: BalanceResult;
29
30
  duplicates: DuplicateResult;
30
31
  trace: TraceResult;
31
- taxonomyMismatch: boolean; // #1 — scenarios use IDs not in the project's test-viewpoint.md
32
- downstream: DownstreamResult; // #2 — downstream screens referenced but under-covered
33
- manualOracle: ManualOracleResult; // #4 — @manual scenarios lacking setup/action/oracle
32
+ taxonomyMismatch: boolean; // scenarios use IDs not in the project's test-viewpoint.md
33
+ downstream: DownstreamResult; // downstream screens referenced but under-covered
34
+ manualOracle: ManualOracleResult; // @manual scenarios lacking setup/action/oracle
35
+ ledger: LedgerResult; // atomic viewpoint-item coverage (per-bullet status)
34
36
  score: {
35
37
  overall: number; // 0..10, business-weighted
36
38
  coverage: number; // 0..1
@@ -72,6 +74,7 @@ export function runAudit(screenDir: string, screenName: string): AuditReport {
72
74
  // #2 downstream-scope + #4 manual-oracle
73
75
  const downstream = downstreamScope(readText(specPath), scenarios);
74
76
  const manualOracleResult = manualOracle(featureText);
77
+ const ledger = viewpointLedger(viewpointPath, scenarios, featureText);
75
78
 
76
79
  // Sub-scores
77
80
  const coverage = gate.coverageRatio;
@@ -131,6 +134,10 @@ export function runAudit(screenDir: string, screenName: string): AuditReport {
131
134
  for (const m of manualOracleResult.insufficient.slice(0, 8)) {
132
135
  findings.push(`MANUAL-STEPS-INSUFFICIENT: "${m}" — a @manual scenario needs setup · action · observable expected · oracle/tool (not just a one-line note).`);
133
136
  }
137
+ if (ledger.hasViewpoint && ledger.missing.length) {
138
+ const sample = ledger.missing.slice(0, 6).map((m) => m.id || `"${m.text}"`).join(', ');
139
+ findings.push(`VIEWPOINT-ITEM-MISSING: ${ledger.missing.length}/${ledger.total} atomic viewpoint items have no covering scenario (${(ledger.ratio * 100).toFixed(0)}% covered) — e.g. ${sample}. Cover each item or mark it deferred/spec-gap.`);
140
+ }
134
141
 
135
142
  // Gate spans coverage (viewpoint themes), depth, claim-proof, spec-clause coverage,
136
143
  // AND taxonomy-match (scenarios must use the project's viewpoint IDs when defined).
@@ -141,7 +148,7 @@ export function runAudit(screenDir: string, screenName: string): AuditReport {
141
148
  screen: screenName,
142
149
  scenarioCount: scenarios.length,
143
150
  gate, depth, claim, taxonomy, balance, duplicates, trace, spec,
144
- taxonomyMismatch, downstream, manualOracle: manualOracleResult,
151
+ taxonomyMismatch, downstream, manualOracle: manualOracleResult, ledger,
145
152
  score: {
146
153
  overall: Math.round(overall * 10) / 10,
147
154
  coverage: Math.round(coverage * 100) / 100,
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Viewpoint Atomic Coverage Ledger (harness #2).
3
+ *
4
+ * The project's `test-viewpoint.md` IS the coverage contract. This parses it into ATOMIC
5
+ * items (each bullet / table row / ID-prefixed line) and reports the status of EACH —
6
+ * covered / missing — instead of the coarse "viewpoint mentioned" signal. It is fully
7
+ * project-driven (works on any project's viewpoint file, any domain), which is why it
8
+ * scales where a hardcoded domain catalog does not. Advisory: it surfaces the per-item
9
+ * gaps that inflate a "looks-covered" score; it does not fail the gate.
10
+ */
11
+ import * as fs from 'fs';
12
+ import { ScenarioInfo } from './parse';
13
+
14
+ export interface LedgerItem { id?: string; text: string; covered: boolean }
15
+
16
+ export interface LedgerResult {
17
+ hasViewpoint: boolean;
18
+ total: number;
19
+ covered: number;
20
+ ratio: number;
21
+ missing: { id?: string; text: string }[];
22
+ }
23
+
24
+ const ID_RE = /\b([A-Z]{1,5}\d{0,2}(?:[.\-][A-Za-z0-9]+)*-?\d{0,3})\b/; // VP0.Title, VP7-002, MS-HP-001, TV-01
25
+ const GENERIC = new Set(['display', 'shown', 'value', 'field', 'input', 'page', 'screen', 'button', 'link', 'text', 'check', 'verify', 'should', 'with', 'when', 'then', 'user', 'this', 'that', 'each', 'item', 'items']);
26
+
27
+ /** Extract atomic checklist items from a viewpoint file (format-tolerant). */
28
+ export function parseViewpointItems(viewpointPath: string): { id?: string; text: string }[] {
29
+ if (!fs.existsSync(viewpointPath)) return [];
30
+ const lines = fs.readFileSync(viewpointPath, 'utf-8').split('\n');
31
+ const items: { id?: string; text: string }[] = [];
32
+ let inFence = false;
33
+ for (const raw of lines) {
34
+ const line = raw.trim();
35
+ if (line.startsWith('```')) { inFence = !inFence; continue; }
36
+ if (inFence || !line) continue;
37
+ if (/^#{1,6}\s/.test(line)) continue; // markdown heading
38
+ let text = '';
39
+ const bullet = line.match(/^(?:[-*+]|\d+[.)])\s+(.*)$/);
40
+ if (bullet) text = bullet[1];
41
+ else if (line.startsWith('|')) { // table data row
42
+ if (/^\|[\s|:-]+\|?$/.test(line)) continue; // separator
43
+ const cells = line.split('|').map((c) => c.trim()).filter(Boolean);
44
+ if (/^(vp|id|viewpoint|priority|reason|no\.?|category|item|trigger|#|pattern|applicable|notes|field|constraint|code|description|status)$/i.test(cells[0] || '')) continue; // header
45
+ text = cells.join(' — ');
46
+ } else continue;
47
+ text = text.replace(/[*`]/g, '').trim();
48
+ if (!text) continue;
49
+ const idM = text.match(ID_RE);
50
+ const id = idM && /\d/.test(idM[1]) ? idM[1] : undefined; // require a digit so prose words aren't IDs
51
+ const words = (text.toLowerCase().match(/[a-z][a-z-]{3,}/g) || []).filter((w) => !GENERIC.has(w));
52
+ if (!id && words.length < 2) continue; // not substantive enough to track
53
+ items.push({ id, text: text.slice(0, 100) });
54
+ }
55
+ return items;
56
+ }
57
+
58
+ export function viewpointLedger(viewpointPath: string, scenarios: ScenarioInfo[], featureText: string): LedgerResult {
59
+ const items = parseViewpointItems(viewpointPath);
60
+ if (!fs.existsSync(viewpointPath) || items.length === 0) {
61
+ return { hasViewpoint: fs.existsSync(viewpointPath), total: 0, covered: 0, ratio: 1, missing: [] };
62
+ }
63
+ const featLower = featureText.toLowerCase();
64
+ const missing: { id?: string; text: string }[] = [];
65
+ let covered = 0;
66
+
67
+ for (const item of items) {
68
+ let isCovered = false;
69
+ if (item.id && featLower.includes(item.id.toLowerCase())) isCovered = true;
70
+ else {
71
+ const words = [...new Set((item.text.toLowerCase().match(/[a-z][a-z-]{3,}/g) || []).filter((w) => !GENERIC.has(w)))];
72
+ const need = Math.min(2, words.length);
73
+ isCovered = words.length > 0 && scenarios.some((s) => words.filter((w) => s.haystack.includes(w)).length >= need);
74
+ }
75
+ if (isCovered) covered++;
76
+ else missing.push({ id: item.id, text: item.text });
77
+ }
78
+
79
+ return { hasViewpoint: true, total: items.length, covered, ratio: items.length ? covered / items.length : 1, missing };
80
+ }
@@ -105,6 +105,9 @@ Auto-detected by `create-test` before invoking this skill:
105
105
  2. Each row / bullet / item = 1 viewpoint → add to `Viewpoint items` in Coverage Map.
106
106
  3. Do NOT pre-classify into buckets before scanning — classify only when
107
107
  writing the scenario.
108
+ 4. **If it declares viewpoint IDs** (e.g. `VP0`, `VP1`…`VP12`, `MS-HP-001`), capture each
109
+ item WITH its ID and **reuse that ID as the scenario code** — do not invent a generic
110
+ `VP-<CAT>` scheme (the harness Taxonomy-match gate FAILs on mismatch).
108
111
  - `qa/context.md` — project-wide context set by the QA lead. Read ONCE before building the Coverage Map; apply to every screen. Extraction rules:
109
112
  - **Roles** → for each role in the table: add to the `@auth:X` tag pool; generate a VP-SEC blocked-access scenario for every role boundary relevant to this screen.
110
113
  - **Testing strategy → Focus areas** → if `security` listed: VP-SEC is mandatory Tier 1 for every free-text input regardless of spec risk level; if `ui` not listed: all VP-UI scenarios move to Tier 2 minimum.
@@ -260,6 +263,26 @@ Security: [S1 – admin only]
260
263
 
261
264
  **Balance:** cover all the above (deep) BEFORE expanding subscription / UI-presence / extra validation edge cases. Do not over-invest in subscription while cart/detail/filter correctness are shallow.
262
265
 
266
+ #### Harness gates — satisfy on the FIRST pass (don't make the repair loop fix them)
267
+
268
+ `sungen audit` enforces these. Generate compliant output up front:
269
+
270
+ 1. **Taxonomy-match** (`VP-TAXONOMY-MISMATCH`, gate-FAIL) — when `test-viewpoint.md` declares its own viewpoint IDs (e.g. `VP0`, `VP1`, … `VP12`, `MS-HP-001`, `MS-EH-001`), **reuse those IDs verbatim as the scenario codes**. Do NOT invent a generic `VP-UI / VP-LOGIC / VP-VAL` scheme — that breaks the coverage matrix. Only fall back to `VP-<CATEGORY>-<NNN>` when the viewpoint file declares no IDs.
271
+ 2. **Spec-coverage triggers** (`TRIGGER-UNCOVERED`, gate-FAIL) — the Validation-Rules table lists a **trigger** per constraint (e.g. `blur, submit`). Generate one scenario **per (constraint × trigger)** — a `format` rule validating *on blur AND on submit* needs BOTH a blur scenario (`press Tab`) and a submit scenario (`click [Submit]` / `press Enter`). Never collapse the trigger × input matrix to one representative case.
272
+ 3. **Claim-Proof** (`CLAIM-UNPROVEN`) — a title claiming `all`/`only`/`every`/`single`/`correct`/`same`/`changes`/`hidden`/`cleared`/`restored`/`independent`/`sanitized`/`announces` MUST have the matching assertion (`see all …`, count, `remember`+compare, `is hidden`, return-and-assert-empty, etc.). If the title promises it, the steps must prove it.
273
+ 4. **Downstream-scope** (`DOWNSTREAM-SCOPE-MISSING`) — when the spec's Navigation Flow / success target is **another screen** (e.g. a confirmation/sent page), don't stop at a terminal `see [X] page`. Either cover that screen's content/guards (if its viewpoint items are in scope — they often have their own `MS-*` IDs), or scaffold it (`sungen add --screen <name>`) and note the handoff. Do not silently drop the downstream surface.
274
+ 5. **Manual-oracle** (`MANUAL-STEPS-INSUFFICIENT`) — every `@manual` scenario needs **setup · action · observable expected · oracle/tool**, not a one-line note. Use this comment shape:
275
+ ```gherkin
276
+ @high @manual
277
+ Scenario: VP-… <claim>
278
+ # MANUAL: <why it can't be automated — needs network capture / inbox / screen-reader / multi-tab>
279
+ # Tester verifies:
280
+ # 1. <setup> e.g. seed a registered email; throttle the network
281
+ # 2. <action> e.g. click [Submit] with the request in flight
282
+ # 3. <observable> e.g. only ONE POST is dispatched
283
+ # 4. Oracle: <tool> e.g. DevTools Network panel / mail-catcher / NVDA
284
+ ```
285
+
263
286
  #### Tier 1 guard — minimum before writing scenarios
264
287
 
265
288
  | Spec section | Minimum requirement | Tag |
@@ -376,7 +399,7 @@ Add cleanup tags per the `sungen-gherkin-syntax` Cleanup table. Key rules:
376
399
  **Files:** `qa/screens/<screen>/features/<screen>.feature` + `qa/screens/<screen>/test-data/<screen>.yaml`
377
400
 
378
401
  Use step patterns and element types from `sungen-gherkin-syntax`.
379
- **Naming**: `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
402
+ **Naming**: reuse the **project's `test-viewpoint.md` IDs** when it declares them (e.g. `VP0`, `MS-HP-001`); otherwise `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
380
403
 
381
404
  **Test data** — grouped by section, loaded at runtime:
382
405
 
@@ -105,6 +105,17 @@ Auto-detected by `create-test` before invoking this skill:
105
105
  2. Each row / bullet / item = 1 viewpoint → add to `Viewpoint items` in Coverage Map.
106
106
  3. Do NOT pre-classify into buckets before scanning — classify only when
107
107
  writing the scenario.
108
+ 4. **If it declares viewpoint IDs** (e.g. `VP0`, `VP1`…`VP12`, `MS-HP-001`), capture each
109
+ item WITH its ID and **reuse that ID as the scenario code** — do not invent a generic
110
+ `VP-<CAT>` scheme (the harness Taxonomy-match gate FAILs on mismatch).
111
+ - `qa/context.md` — project-wide context set by the QA lead. Read ONCE before building the Coverage Map; apply to every screen. Extraction rules:
112
+ - **Roles** → for each role in the table: add to the `@auth:X` tag pool; generate a VP-SEC blocked-access scenario for every role boundary relevant to this screen.
113
+ - **Testing strategy → Focus areas** → if `security` listed: VP-SEC is mandatory Tier 1 for every free-text input regardless of spec risk level; if `ui` not listed: all VP-UI scenarios move to Tier 2 minimum.
114
+ - **Testing strategy → Mandatory coverage** → each line is a hard override applied to this screen regardless of spec risk; document in `Context constraints` of the Coverage Map.
115
+ - **Testing strategy → Deprioritize/skip** → record in `Context constraints`; suppress those VP categories from Tier 1 generation.
116
+ - **Global business rules** → add each to the `Business rules` section tagged `[G]` (e.g. `[G1 – soft-delete only]`); treat as `HIGH` risk unless stated otherwise.
117
+ - **Error patterns** → use as fallback only when `spec.md` does not give exact error text; never override spec-specified messages.
118
+ - If `qa/context.md` is absent: proceed without it — no impact on the generation flow.
108
119
 
109
120
  **Single screen focus**: one URL = one screen. Modals on same page = part of this screen.
110
121
  This means: do not test other screens' UI layout or navigation. It does NOT mean skip documenting business outcomes that your screen's actions cause on other surfaces. Those cross-surface outcomes must appear in the Coverage Map and be covered by at least `@manual` scenarios.
@@ -129,6 +140,11 @@ Read `spec.md` fully, then extract into a Coverage Map **before writing any scen
129
140
  **Risk tags:** HIGH = complex business rules, cascading fields, multi-step state changes, auth/integration. LOW = display-only, static labels, read-only fields.
130
141
 
131
142
  ```
143
+ Context constraints: [populated from qa/context.md before writing any scenario]
144
+ roles: [list roles, e.g. admin / manager / staff]
145
+ strategy: [active overrides, e.g. "VP-SEC mandatory T1", "VP-UI → T2 only"]
146
+ global rules: [G1 – ...] → also appear in Business rules below tagged [G]
147
+ → leave empty if qa/context.md is absent or has no entries applicable to this screen
132
148
  User journeys: [J1 – ...], [J2 – ...]
133
149
  Validation rules: [V1 – field → "exact error text"], [V2 – ...]
134
150
  Business rules: [B1 HIGH – ...], [B2 LOW – ...]
@@ -221,7 +237,7 @@ Security: [S1 – admin only]
221
237
  | **auth** | valid-login · invalid-credential · access-control |
222
238
 
223
239
  **Required assertion shapes (use these, not bare visibility):**
224
- - Card info: assert at **card level** (image+name+price together), e.g. `User see all [Product Card] contain {{...}}` — not `see [Section]`.
240
+ - Card info: assert at **card level** (image+name+price together), e.g. `User see all [Product Card] contain {{...}}` — not `see [Section]` (section-level passes even if one card lacks price).
225
241
  - Cross-screen consistency (detail/cart): **capture then compare** —
226
242
  ```gherkin
227
243
  When User remember [Product Name] text as {{selected_product_name}}
@@ -239,13 +255,33 @@ Security: [S1 – admin only]
239
255
  - **If the spec lacks the concrete value** a deep assertion needs (exact message, price, count): still write the deep shape with a `{{var}}` placeholder and leave a `# SPEC-GAP: <field> value not in spec` comment — do **not** downgrade to `see [X] section`. A visible gap is better than a silent shallow pass.
240
256
  - **Blind-Spot Memory:** before finishing, run `sungen blindspot list --prompt` (Bash) and make sure the suite satisfies each recorded pattern (e.g. "for any Add/Create action: check success + resulting data state + duplicate/double-submit"). These are gaps QA hit before — don't repeat them.
241
257
 
242
- **First-pass anti-patterns (exactly what the gate/reviewer reject — avoid them):**
243
- - Title↔steps mismatch (e.g. a "no-result" scenario that clicks a query which returns products).
244
- - Tautology `Then`: `click [Next Slide]` → `see [Carousel] section` (proves nothing).
245
- - Business-critical scenario ending at `see [Added] modal` / `see [Cart] page` with no data assertion.
258
+ **First-pass anti-patterns (these are exactly what the gate/reviewer reject — avoid them):**
259
+ - Title↔steps mismatch: e.g. a "no-result state" scenario that clicks a query which **returns** products. Steps must create the condition the title claims.
260
+ - Tautology `Then`: `click [Next Slide]` → `see [Carousel] section` (always visible, proves nothing). Assert the change (new slide title differs).
261
+ - Business-critical scenario ending at `see [Added] modal` / `see [Cart] page` / `see [Category Products] page` with no data assertion.
246
262
  - Brand filter covered only as navigation (must assert products belong to the brand).
247
263
 
248
- **Balance:** cover all the above (deep) BEFORE expanding subscription / UI-presence / extra validation edge cases.
264
+ **Balance:** cover all the above (deep) BEFORE expanding subscription / UI-presence / extra validation edge cases. Do not over-invest in subscription while cart/detail/filter correctness are shallow.
265
+
266
+ #### Harness gates — satisfy on the FIRST pass (don't make the repair loop fix them)
267
+
268
+ `sungen audit` enforces these. Generate compliant output up front:
269
+
270
+ 1. **Taxonomy-match** (`VP-TAXONOMY-MISMATCH`, gate-FAIL) — when `test-viewpoint.md` declares its own viewpoint IDs (e.g. `VP0`, `VP1`, … `VP12`, `MS-HP-001`, `MS-EH-001`), **reuse those IDs verbatim as the scenario codes**. Do NOT invent a generic `VP-UI / VP-LOGIC / VP-VAL` scheme — that breaks the coverage matrix. Only fall back to `VP-<CATEGORY>-<NNN>` when the viewpoint file declares no IDs.
271
+ 2. **Spec-coverage triggers** (`TRIGGER-UNCOVERED`, gate-FAIL) — the Validation-Rules table lists a **trigger** per constraint (e.g. `blur, submit`). Generate one scenario **per (constraint × trigger)** — a `format` rule validating *on blur AND on submit* needs BOTH a blur scenario (`press Tab`) and a submit scenario (`click [Submit]` / `press Enter`). Never collapse the trigger × input matrix to one representative case.
272
+ 3. **Claim-Proof** (`CLAIM-UNPROVEN`) — a title claiming `all`/`only`/`every`/`single`/`correct`/`same`/`changes`/`hidden`/`cleared`/`restored`/`independent`/`sanitized`/`announces` MUST have the matching assertion (`see all …`, count, `remember`+compare, `is hidden`, return-and-assert-empty, etc.). If the title promises it, the steps must prove it.
273
+ 4. **Downstream-scope** (`DOWNSTREAM-SCOPE-MISSING`) — when the spec's Navigation Flow / success target is **another screen** (e.g. a confirmation/sent page), don't stop at a terminal `see [X] page`. Either cover that screen's content/guards (if its viewpoint items are in scope — they often have their own `MS-*` IDs), or scaffold it (`sungen add --screen <name>`) and note the handoff. Do not silently drop the downstream surface.
274
+ 5. **Manual-oracle** (`MANUAL-STEPS-INSUFFICIENT`) — every `@manual` scenario needs **setup · action · observable expected · oracle/tool**, not a one-line note. Use this comment shape:
275
+ ```gherkin
276
+ @high @manual
277
+ Scenario: VP-… <claim>
278
+ # MANUAL: <why it can't be automated — needs network capture / inbox / screen-reader / multi-tab>
279
+ # Tester verifies:
280
+ # 1. <setup> e.g. seed a registered email; throttle the network
281
+ # 2. <action> e.g. click [Submit] with the request in flight
282
+ # 3. <observable> e.g. only ONE POST is dispatched
283
+ # 4. Oracle: <tool> e.g. DevTools Network panel / mail-catcher / NVDA
284
+ ```
249
285
 
250
286
  #### Tier 1 guard — minimum before writing scenarios
251
287
 
@@ -363,7 +399,7 @@ Add cleanup tags per the `sungen-gherkin-syntax` Cleanup table. Key rules:
363
399
  **Files:** `qa/screens/<screen>/features/<screen>.feature` + `qa/screens/<screen>/test-data/<screen>.yaml`
364
400
 
365
401
  Use step patterns and element types from `sungen-gherkin-syntax`.
366
- **Naming**: `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
402
+ **Naming**: reuse the **project's `test-viewpoint.md` IDs** when it declares them (e.g. `VP0`, `MS-HP-001`); otherwise `VP-<CATEGORY>-<NNN>`. Scenario name must use the **same element type** as the steps.
367
403
 
368
404
  **Test data** — grouped by section, loaded at runtime:
369
405