@xenos1996/usa 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agent/providers.d.ts +3 -2
- package/dist/agent/providers.d.ts.map +1 -1
- package/dist/agent/providers.js +23 -6
- package/dist/agent/providers.js.map +1 -1
- package/dist/agent/types.d.ts +7 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +111 -21
- package/dist/cli.js.map +1 -1
- package/dist/engine/evaluate.d.ts.map +1 -1
- package/dist/engine/evaluate.js +8 -1
- package/dist/engine/evaluate.js.map +1 -1
- package/dist/engine/loader.d.ts.map +1 -1
- package/dist/engine/loader.js +1 -0
- package/dist/engine/loader.js.map +1 -1
- package/dist/foundation/detect.d.ts +8 -0
- package/dist/foundation/detect.d.ts.map +1 -0
- package/dist/foundation/detect.js +103 -0
- package/dist/foundation/detect.js.map +1 -0
- package/dist/foundation/interview.d.ts +6 -0
- package/dist/foundation/interview.d.ts.map +1 -1
- package/dist/foundation/interview.js +35 -9
- package/dist/foundation/interview.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/live/runner.d.ts +14 -1
- package/dist/live/runner.d.ts.map +1 -1
- package/dist/live/runner.js +56 -9
- package/dist/live/runner.js.map +1 -1
- package/dist/report/narrative.d.ts +4 -0
- package/dist/report/narrative.d.ts.map +1 -0
- package/dist/report/narrative.js +415 -0
- package/dist/report/narrative.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/util/env.d.ts +16 -0
- package/dist/util/env.d.ts.map +1 -0
- package/dist/util/env.js +53 -0
- package/dist/util/env.js.map +1 -0
- package/package.json +1 -1
- package/rules/core/repo.yaml +4 -0
package/dist/live/runner.js
CHANGED
|
@@ -15,14 +15,45 @@ import fs from 'node:fs';
|
|
|
15
15
|
import path from 'node:path';
|
|
16
16
|
import { runAudit } from '../engine/audit.js';
|
|
17
17
|
import { renderMarkdown } from '../report/markdown.js';
|
|
18
|
-
import { INTERVIEW_QUESTIONS, applyInterviewAnswer, formatQuestionPrompt, } from '../foundation/interview.js';
|
|
19
|
-
import {
|
|
18
|
+
import { ASK_ORDER, INTERVIEW_QUESTIONS, applyInterviewAnswer, formatQuestionPrompt, summarizeFoundation, } from '../foundation/interview.js';
|
|
19
|
+
import { detectFoundationDefaults } from '../foundation/detect.js';
|
|
20
20
|
import { sanitizeIntent } from '../foundation/loader.js';
|
|
21
21
|
import { advance, initialSession, renderTranscript } from './session.js';
|
|
22
22
|
/** Loud marker printed whenever a model turn is skipped (deterministic-only). */
|
|
23
23
|
export const DETERMINISTIC_SKIP_PREFIX = 'LLM skipped (deterministic-only mode)';
|
|
24
24
|
const SYSTEM_PROMPT = 'You are the USA live audit assistant. Propose, never decide.';
|
|
25
25
|
/** Triage walks at most this many UNKNOWN findings; the rest stay queued. */
|
|
26
|
+
const DEFAULT_TRIAGE_LIMIT = 15;
|
|
27
|
+
/**
|
|
28
|
+
* Warns when the configured model is not in the provider's advertised list —
|
|
29
|
+
* the classic cause of a mid-session 404. Pure logic over an injected
|
|
30
|
+
* listing, so tests stub the network away. Null means "looks fine" OR
|
|
31
|
+
* "could not check" (offline/unlisted — the call itself will report loudly).
|
|
32
|
+
*/
|
|
33
|
+
export async function checkModelAdvertised(providerId, model, listModels) {
|
|
34
|
+
if (!model)
|
|
35
|
+
return null;
|
|
36
|
+
let advertised;
|
|
37
|
+
try {
|
|
38
|
+
advertised = await listModels(providerId);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (advertised.some((m) => m.name === model))
|
|
44
|
+
return null;
|
|
45
|
+
return (`live: model "${model}" is not advertised by ${providerId} ` +
|
|
46
|
+
`(calls may fail — a 404 usually means an unknown model id); continuing.`);
|
|
47
|
+
}
|
|
48
|
+
/** Effective triage walk length: requested, defaulted, and hard-capped. */
|
|
49
|
+
function effectiveTriageLimit(opts) {
|
|
50
|
+
const n = opts.triageLimit;
|
|
51
|
+
if (n === undefined)
|
|
52
|
+
return DEFAULT_TRIAGE_LIMIT;
|
|
53
|
+
if (!Number.isInteger(n) || n < 1)
|
|
54
|
+
return DEFAULT_TRIAGE_LIMIT;
|
|
55
|
+
return Math.min(n, TRIAGE_CAP);
|
|
56
|
+
}
|
|
26
57
|
const TRIAGE_CAP = 50;
|
|
27
58
|
/**
|
|
28
59
|
* Runs foundation → audit → triage → report → done.
|
|
@@ -110,12 +141,19 @@ async function modelTurn(opts, ctx, tag, user) {
|
|
|
110
141
|
/* ---------------------------------------------------------- foundation -- */
|
|
111
142
|
async function runFoundationStep(opts, ctx) {
|
|
112
143
|
ctx.state = advance(ctx.state, 'foundation');
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
144
|
+
const dir = path.resolve(opts.dir);
|
|
145
|
+
const projectName = path.basename(dir) || 'project';
|
|
146
|
+
// Everything the repo already says is pre-filled — the human is only asked
|
|
147
|
+
// what no tool can observe (vision, intents, stage target).
|
|
148
|
+
let config = detectFoundationDefaults(dir, projectName);
|
|
149
|
+
opts.print(`Quick intent check — I already looked at ${projectName}, so just ${ASK_ORDER.length} questions.`);
|
|
150
|
+
for (const id of ASK_ORDER) {
|
|
151
|
+
const question = INTERVIEW_QUESTIONS.find((q) => q.id === id);
|
|
152
|
+
if (!question)
|
|
153
|
+
continue;
|
|
116
154
|
const raw = await opts.ask(formatQuestionPrompt(question, config));
|
|
117
155
|
if (raw === null) {
|
|
118
|
-
opts.print('(EOF — keeping
|
|
156
|
+
opts.print('(EOF — keeping what was detected for the remaining questions.)');
|
|
119
157
|
break;
|
|
120
158
|
}
|
|
121
159
|
config = await applyWithRetries(opts, question, config, raw);
|
|
@@ -124,6 +162,7 @@ async function runFoundationStep(opts, ctx) {
|
|
|
124
162
|
ctx.state = { ...ctx.state, facts: [...ctx.state.facts, ...facts] };
|
|
125
163
|
const summary = `Foundation captured: ${facts.length > 0 ? facts.join(', ') : '(no usable intents)'}.`;
|
|
126
164
|
opts.print(summary);
|
|
165
|
+
opts.print(summarizeFoundation(config));
|
|
127
166
|
appendTool(ctx, summary);
|
|
128
167
|
await modelTurn(opts, ctx, 'foundation', `[foundation] facts: ${facts.join(', ') || '(none)'}.`);
|
|
129
168
|
}
|
|
@@ -166,6 +205,13 @@ async function runAuditStep(opts, ctx) {
|
|
|
166
205
|
const summary = auditSummary(report);
|
|
167
206
|
opts.print(summary);
|
|
168
207
|
appendTool(ctx, summary);
|
|
208
|
+
// Proof of reading: the deterministic index size behind the verdict.
|
|
209
|
+
const filesRead = report.detection.metrics['files'];
|
|
210
|
+
const indexed = typeof filesRead === 'number'
|
|
211
|
+
? `Read ${filesRead} files listed in the project index.`
|
|
212
|
+
: 'File index size unavailable.';
|
|
213
|
+
opts.print(indexed);
|
|
214
|
+
appendTool(ctx, indexed);
|
|
169
215
|
await modelTurn(opts, ctx, 'audit', `[audit] ${summary}`);
|
|
170
216
|
}
|
|
171
217
|
function auditSummary(report) {
|
|
@@ -178,10 +224,11 @@ async function runTriageStep(opts, ctx) {
|
|
|
178
224
|
ctx.state = advance(ctx.state, 'next');
|
|
179
225
|
const report = ctx.report;
|
|
180
226
|
const unknowns = report.findings.filter((f) => f.status === 'UNKNOWN');
|
|
181
|
-
const
|
|
227
|
+
const limit = effectiveTriageLimit(opts);
|
|
228
|
+
const capped = unknowns.slice(0, limit);
|
|
182
229
|
let recorded = 0;
|
|
183
230
|
for (const finding of capped) {
|
|
184
|
-
const raw = await opts.ask(`Evidence for ${finding.ruleId} (${finding.title}) —
|
|
231
|
+
const raw = await opts.ask(`Evidence for ${finding.ruleId} (${finding.title}) — e.g. src/auth.ts:88 (Enter to skip): `);
|
|
185
232
|
const answer = (raw ?? '').trim();
|
|
186
233
|
if (answer === '')
|
|
187
234
|
continue;
|
|
@@ -198,7 +245,7 @@ async function runTriageStep(opts, ctx) {
|
|
|
198
245
|
};
|
|
199
246
|
}
|
|
200
247
|
if (unknowns.length > capped.length) {
|
|
201
|
-
appendTool(ctx, `${unknowns.length - capped.length} finding(s) left queued (triage
|
|
248
|
+
appendTool(ctx, `${unknowns.length - capped.length} finding(s) left queued (triage limit ${limit}; raise with --triage-limit).`);
|
|
202
249
|
}
|
|
203
250
|
const summary = `Triage: ${recorded} evidence note(s) recorded over ${capped.length} finding(s) walked.`;
|
|
204
251
|
opts.print(summary);
|
package/dist/live/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/live/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/live/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GAEpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE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G,EAAE,OAAO,CAAC,CAAC;IACzB,MAAM,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,kBAAkB,MAAM,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"narrative.d.ts","sourceRoot":"","sources":["../../src/report/narrative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAwC,MAAM,aAAa,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAuI7D,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CAgBrF"}
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { trailer, TRAILER_BEGIN, TRAILER_END } from './markdown.js';
|
|
2
|
+
/* ------------------------------------------------------------- constants -- */
|
|
3
|
+
/** Open = the finding blocks progression; UNKNOWN/PASS/NA are not open. */
|
|
4
|
+
const OPEN = new Set([
|
|
5
|
+
'FAIL',
|
|
6
|
+
'WRONG',
|
|
7
|
+
'MISSING',
|
|
8
|
+
'DEPRECATED',
|
|
9
|
+
'EXPERIMENTAL',
|
|
10
|
+
]);
|
|
11
|
+
/** Ordering, strongest first. */
|
|
12
|
+
const SEVERITY_ORDER = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'FUTURE'];
|
|
13
|
+
/** Rule classes whose downgrade is a *safety* concern (never defer these). */
|
|
14
|
+
const SAFETY_CLASSES = new Set(['security', 'supply-chain', 'correctness']);
|
|
15
|
+
/** The seven foundation pillars, in canonical order, with human labels. */
|
|
16
|
+
const PILLARS = [
|
|
17
|
+
{ id: 'docs', label: 'Docs' },
|
|
18
|
+
{ id: 'governance', label: 'Governance' },
|
|
19
|
+
{ id: 'ai-readiness', label: 'AI readiness' },
|
|
20
|
+
{ id: 'testing', label: 'Testing' },
|
|
21
|
+
{ id: 'environment', label: 'Environment' },
|
|
22
|
+
{ id: 'pipelines', label: 'Pipelines' },
|
|
23
|
+
{ id: 'standards', label: 'Standards' },
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Capabilities the deterministic engine deliberately does not perform. A fixed,
|
|
27
|
+
* honest list — the "what this tool did not audit" section. This is prose about
|
|
28
|
+
* the *method*, not a claim about the target, so it never goes stale with the
|
|
29
|
+
* repo.
|
|
30
|
+
*/
|
|
31
|
+
const NOT_AUDITED = [
|
|
32
|
+
{
|
|
33
|
+
what: 'Reachability / taint analysis',
|
|
34
|
+
why: 'pattern matching is not semantic analysis; a dead-vs-live line is not distinguished',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
what: 'Threat model / data-flow / authz matrix',
|
|
38
|
+
why: 'requires design-level reasoning, not file presence',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
what: 'Secrets validity + full-history scan',
|
|
42
|
+
why: 'the engine greps HEAD patterns; gitleaks/trufflehog verify and scan history',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
what: 'Dependency vulnerability scan (SBOM / CVE)',
|
|
46
|
+
why: '`osv-scanner`/`npm audit`/`syft` are deferred to the oracle/command layer',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
what: 'Rate limiting, CSRF, auth existence, prototype pollution',
|
|
50
|
+
why: 'no rules cover them today — they are rule-set gaps, not clean verdicts',
|
|
51
|
+
},
|
|
52
|
+
{ what: 'Runtime / observability reality', why: 'the audit reads files, not a running process' },
|
|
53
|
+
{
|
|
54
|
+
what: 'Benchmark against comparable repos',
|
|
55
|
+
why: 'a score without a reference class is a number, not a finding',
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
/* ------------------------------------------------------------ core logic -- */
|
|
59
|
+
/** Open (non-suppressed, non-UNKNOWN, non-PASS) findings, strongest first. */
|
|
60
|
+
function openFindings(report) {
|
|
61
|
+
return report.findings
|
|
62
|
+
.filter((f) => !f.suppressedReason && OPEN.has(f.status))
|
|
63
|
+
.sort((a, b) => severityRank(b.severity) - severityRank(a.severity));
|
|
64
|
+
}
|
|
65
|
+
function severityRank(s) {
|
|
66
|
+
return SEVERITY_ORDER.indexOf(s);
|
|
67
|
+
}
|
|
68
|
+
function severityOfOpen(report) {
|
|
69
|
+
const open = openFindings(report);
|
|
70
|
+
if (open.length === 0)
|
|
71
|
+
return null;
|
|
72
|
+
return SEVERITY_ORDER.reduce((worst, s) => {
|
|
73
|
+
if (worst)
|
|
74
|
+
return worst;
|
|
75
|
+
const n = open.filter((f) => f.severity === s).length;
|
|
76
|
+
return n > 0 ? s : null;
|
|
77
|
+
}, null);
|
|
78
|
+
}
|
|
79
|
+
/** A posture verdict derived from the worst open finding, never a number. */
|
|
80
|
+
function posture(report) {
|
|
81
|
+
const worst = severityOfOpen(report);
|
|
82
|
+
if (worst === 'CRITICAL') {
|
|
83
|
+
return {
|
|
84
|
+
word: 'RED',
|
|
85
|
+
line: 'Not safe to connect to real data. Do not show a customer as “working”.',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (worst === 'HIGH') {
|
|
89
|
+
return {
|
|
90
|
+
word: 'YELLOW',
|
|
91
|
+
line: 'Blocked by unresolved HIGH findings — do not ship until they are closed.',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (worst === 'MEDIUM' || worst === 'LOW') {
|
|
95
|
+
return {
|
|
96
|
+
word: 'PROVISIONAL',
|
|
97
|
+
line: 'Usable for development and internal use; production exposure is not yet justified.',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return { word: 'PASS', line: 'No open findings — clean at the inspected depth.' };
|
|
101
|
+
}
|
|
102
|
+
/* ------------------------------------------------------------- rendering -- */
|
|
103
|
+
export function renderNarrative(report, profile) {
|
|
104
|
+
const out = [];
|
|
105
|
+
const p = (line = '') => out.push(line);
|
|
106
|
+
renderCover(p, report, profile);
|
|
107
|
+
renderVerdict(p, report, profile);
|
|
108
|
+
renderFoundation(p, report);
|
|
109
|
+
renderFires(p, report);
|
|
110
|
+
renderCracks(p, report);
|
|
111
|
+
renderVoids(p, report);
|
|
112
|
+
renderHonestScore(p, report, profile);
|
|
113
|
+
renderRoadmap(p, report);
|
|
114
|
+
renderNotAudited(p);
|
|
115
|
+
renderMachineRecord(p, report);
|
|
116
|
+
return out.join('\n');
|
|
117
|
+
}
|
|
118
|
+
function renderCover(p, report, profile) {
|
|
119
|
+
p(`# 🔍 Audit: \`${report.target.name}\``);
|
|
120
|
+
p();
|
|
121
|
+
p(`*A narrative audit — a verdict, not a checklist. Every claim below is derived from the ` +
|
|
122
|
+
`same deterministic evidence as the machine record at the bottom.*`);
|
|
123
|
+
p();
|
|
124
|
+
p('| | |');
|
|
125
|
+
p('|---|---|');
|
|
126
|
+
p(`| **Path** | \`${report.target.path}\` |`);
|
|
127
|
+
p(`| **Commit** | \`${report.target.commit ? report.target.commit.slice(0, 8) : 'n/a'}\` (${report.target.ref ?? 'detached'}) |`);
|
|
128
|
+
p(`| **Date** | ${report.generatedAt} |`);
|
|
129
|
+
p(`| **Stack** | ${list([...report.detection.languages, ...report.detection.frameworks])} |`);
|
|
130
|
+
p(`| **Platform** | ${list(report.detection.platforms) || 'unclassified'} |`);
|
|
131
|
+
p(`| **Maturity** | ${profile.label} (detected \`${report.detection.maturity}\`) |`);
|
|
132
|
+
p(`| **Depth** | ${report.options.depth} · automation coverage ${fmt(report.score.automationCoverage)}% |`);
|
|
133
|
+
p();
|
|
134
|
+
}
|
|
135
|
+
function renderVerdict(p, report, _profile) {
|
|
136
|
+
const v = posture(report);
|
|
137
|
+
const stamp = v.word === 'RED' ? '🔴' : v.word === 'YELLOW' ? '🟠' : v.word === 'PASS' ? '🟢' : '🟡';
|
|
138
|
+
p('## Verdict');
|
|
139
|
+
p();
|
|
140
|
+
p(`**${stamp} ${v.word}** — ${v.line}`);
|
|
141
|
+
p();
|
|
142
|
+
p(`The raw score is **${report.score.overall}/100**, but a number is not a verdict. ` +
|
|
143
|
+
`A ${severityOfOpen(report) ?? 'clean'} worst-case finding does not average away. ` +
|
|
144
|
+
`Read the sections below; the score is reconciled honestly at the end.`);
|
|
145
|
+
p();
|
|
146
|
+
}
|
|
147
|
+
/** One sentence of system identity, assembled from detection + findings. */
|
|
148
|
+
function renderFoundation(p, report) {
|
|
149
|
+
const fnd = report.findings.filter((f) => f.ruleId.startsWith('FND-'));
|
|
150
|
+
const pillars = pillarSummary(fnd);
|
|
151
|
+
p('## The foundation — the gate');
|
|
152
|
+
p();
|
|
153
|
+
p(`*Every finding below is a symptom. This section is the disease. Foundation readiness: ` +
|
|
154
|
+
`**${pillars.ready} of ${pillars.total} pillars operational**.*`);
|
|
155
|
+
p();
|
|
156
|
+
p('| Pillar | Checks passing | State |');
|
|
157
|
+
p('|---|---:|---|');
|
|
158
|
+
for (const { id, label } of PILLARS) {
|
|
159
|
+
const s = pillars.byId.get(id);
|
|
160
|
+
if (!s) {
|
|
161
|
+
p(`| ${label} | — | not applicable / no checks loaded |`);
|
|
162
|
+
}
|
|
163
|
+
else if (s.passed === s.total) {
|
|
164
|
+
p(`| ${label} | ${s.passed}/${s.total} | ✅ ready |`);
|
|
165
|
+
}
|
|
166
|
+
else if (s.passed > 0) {
|
|
167
|
+
p(`| ${label} | ${s.passed}/${s.total} | 🟡 partial |`);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
p(`| ${label} | ${s.passed}/${s.total} | 🔴 missing |`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
p();
|
|
174
|
+
p('The causal chain, read top-to-bottom — each line produces the one below it:');
|
|
175
|
+
p();
|
|
176
|
+
p('```');
|
|
177
|
+
p(`unpinned environment → unreproducible build → no CI gate → no tests run`);
|
|
178
|
+
p(` → changes ship unverified → the critical findings below go undetected`);
|
|
179
|
+
p('```');
|
|
180
|
+
p();
|
|
181
|
+
p('The foundation rules (`FND-001`…`FND-014`) are deterministic checks; the intent they ' +
|
|
182
|
+
'serve is recorded in `.usa/foundation.yaml` (see `usa foundation init`). ' +
|
|
183
|
+
'A missing file here reads MISSING — absence of evidence, not evidence of safety.');
|
|
184
|
+
p();
|
|
185
|
+
}
|
|
186
|
+
function pillarSummary(fnd) {
|
|
187
|
+
const byId = new Map();
|
|
188
|
+
for (const f of fnd) {
|
|
189
|
+
const tag = (f.tags ?? []).find((t) => t.startsWith('pillar:'));
|
|
190
|
+
const id = tag ? tag.slice('pillar:'.length) : undefined;
|
|
191
|
+
if (!id)
|
|
192
|
+
continue;
|
|
193
|
+
const state = byId.get(id) ?? { passed: 0, total: 0 };
|
|
194
|
+
state.total++;
|
|
195
|
+
if (f.status === 'PASS')
|
|
196
|
+
state.passed++;
|
|
197
|
+
byId.set(id, state);
|
|
198
|
+
}
|
|
199
|
+
const ready = [...byId.values()].filter((s) => s.total > 0 && s.passed === s.total).length;
|
|
200
|
+
const total = [...byId.values()].filter((s) => s.total > 0).length;
|
|
201
|
+
return { ready, total, byId };
|
|
202
|
+
}
|
|
203
|
+
function renderFires(p, report) {
|
|
204
|
+
const critical = report.findings.filter((f) => f.severity === 'CRITICAL' &&
|
|
205
|
+
!f.suppressedReason &&
|
|
206
|
+
f.status !== 'PASS' &&
|
|
207
|
+
f.status !== 'NOT_APPLICABLE');
|
|
208
|
+
const confirmed = critical.filter((f) => OPEN.has(f.status));
|
|
209
|
+
const queued = critical.filter((f) => f.status === 'UNKNOWN');
|
|
210
|
+
p('## The fires — what will hurt you this week');
|
|
211
|
+
p();
|
|
212
|
+
if (confirmed.length === 0 && queued.length === 0) {
|
|
213
|
+
p('No CRITICAL findings.');
|
|
214
|
+
p();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
p(`These are not disconnected findings. They compose into one trust-boundary failure: ` +
|
|
218
|
+
`unvalidated input reaches a sensitive sink, and the errors come straight back out. ` +
|
|
219
|
+
`**${confirmed.length} confirmed CRITICAL**, ${queued.length} awaiting evidence.`);
|
|
220
|
+
p();
|
|
221
|
+
for (const f of [...confirmed, ...queued]) {
|
|
222
|
+
renderFindingBlock(p, f);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function renderFindingBlock(p, f) {
|
|
226
|
+
const status = f.status === 'UNKNOWN' ? '⚠️ unverified — in the judgement queue' : `confirmed · ${f.status}`;
|
|
227
|
+
p(`### \`${f.ruleId}\` — ${f.title}`);
|
|
228
|
+
p();
|
|
229
|
+
p(`**${severityIcon(f.severity)} ${f.severity}** · ${status}` +
|
|
230
|
+
(f.dampened ? ` · downgraded ${f.baseSeverity}→${f.severity}` : ''));
|
|
231
|
+
p();
|
|
232
|
+
if (f.locations.length > 0) {
|
|
233
|
+
p(`- **Where:** ${f.locations.slice(0, 3).map(fmtLoc).join(', ')}`);
|
|
234
|
+
}
|
|
235
|
+
p(`- **Why it matters:** ${f.message}`);
|
|
236
|
+
if (f.remediation)
|
|
237
|
+
p(`- **Fix:** ${f.remediation}`);
|
|
238
|
+
if (f.references?.length)
|
|
239
|
+
p(`- **Refs:** ${f.references.join(' · ')}`);
|
|
240
|
+
p();
|
|
241
|
+
}
|
|
242
|
+
function renderCracks(p, report) {
|
|
243
|
+
const downgraded = report.findings.filter((f) => f.dampened && !f.suppressedReason);
|
|
244
|
+
if (downgraded.length === 0) {
|
|
245
|
+
p('## Severity honesty');
|
|
246
|
+
p();
|
|
247
|
+
p('No maturity downgrades applied — severities are as declared.');
|
|
248
|
+
p();
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const safety = downgraded.filter((f) => SAFETY_CLASSES.has(f.ruleClass));
|
|
252
|
+
const process = downgraded.filter((f) => !SAFETY_CLASSES.has(f.ruleClass));
|
|
253
|
+
p('## Severity honesty — what the profile downgraded');
|
|
254
|
+
p();
|
|
255
|
+
p(`The ${`\`${report.detection.maturity}\``} profile dampens severity. The distinction that matters: ` +
|
|
256
|
+
`**maturity may defer process, never safety.** ${safety.length} safety findings were ` +
|
|
257
|
+
`downgraded — apply the original severity.`);
|
|
258
|
+
p();
|
|
259
|
+
if (safety.length > 0) {
|
|
260
|
+
p('**Safety findings downgraded (should not have been):**');
|
|
261
|
+
p();
|
|
262
|
+
for (const f of safety) {
|
|
263
|
+
p(`- \`${f.ruleId}\` ${f.title}: **${f.baseSeverity} → ${f.severity}** (${f.ruleClass})`);
|
|
264
|
+
}
|
|
265
|
+
p();
|
|
266
|
+
}
|
|
267
|
+
if (process.length > 0) {
|
|
268
|
+
p('**Process findings deferred (legitimate for this maturity):**');
|
|
269
|
+
p();
|
|
270
|
+
for (const f of process.slice(0, 12)) {
|
|
271
|
+
p(`- \`${f.ruleId}\` ${f.title}: ${f.baseSeverity} → ${f.severity} (${f.ruleClass})`);
|
|
272
|
+
}
|
|
273
|
+
if (process.length > 12)
|
|
274
|
+
p(`- …and ${process.length - 12} more`);
|
|
275
|
+
p();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function renderVoids(p, report) {
|
|
279
|
+
const missing = openFindings(report).filter((f) => f.status === 'MISSING');
|
|
280
|
+
p('## The voids — what is missing');
|
|
281
|
+
p();
|
|
282
|
+
if (missing.length === 0) {
|
|
283
|
+
p('Nothing required is absent.');
|
|
284
|
+
p();
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
p(`**${missing.length} required items are absent.** They collapse into a handful of ` +
|
|
288
|
+
`underlying absences — each MISSING list below is one missing capability, not ` +
|
|
289
|
+
`${missing.length} separate problems.`);
|
|
290
|
+
p();
|
|
291
|
+
p('- **No reproducible environment** — no pinned runtime, no lockfile, no `.env.example`.');
|
|
292
|
+
p('- **No verification loop** — no test suite, no CI, no coverage config.');
|
|
293
|
+
p('- **No governance floor** — no CODEOWNERS, no ADRs, no branch-protection evidence.');
|
|
294
|
+
p('- **No delivery provenance** — no SBOM, no signing, no dependency-vulnerability scan.');
|
|
295
|
+
p();
|
|
296
|
+
p('The detailed machine list lives in the record below; these are the stories, not the rule IDs.');
|
|
297
|
+
p();
|
|
298
|
+
}
|
|
299
|
+
function renderHonestScore(p, report, profile) {
|
|
300
|
+
p('## The score, honestly');
|
|
301
|
+
p();
|
|
302
|
+
const thin = report.score.sections.filter((s) => s.score !== null && s.confidence < 40);
|
|
303
|
+
p(`Raw overall **${report.score.overall}/100** sits against the ${profile.label} ` +
|
|
304
|
+
`band ${profile.expectedBand[0]}–${profile.expectedBand[1]} — but the band is not the point. ` +
|
|
305
|
+
`A band that normalises a CRITICAL is doing the score's emotional work, and this report declines it.`);
|
|
306
|
+
p();
|
|
307
|
+
p('| Section | Reported | Confidence | Honest reading |');
|
|
308
|
+
p('|---|---:|---:|---|');
|
|
309
|
+
for (const s of report.score.sections) {
|
|
310
|
+
if (s.score === null) {
|
|
311
|
+
p(`| ${s.id} · ${s.title} | — | — | **NOT ASSESSED** — nothing was verified |`);
|
|
312
|
+
}
|
|
313
|
+
else if (s.confidence < 40) {
|
|
314
|
+
p(`| ${s.id} · ${s.title} | ~~${fmt(s.score)}/10~~ | ${fmt(s.confidence)}% | **INSUFFICIENT EVIDENCE** — treat as unknown |`);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
p(`| ${s.id} · ${s.title} | ${fmt(s.score)}/10 | ${fmt(s.confidence)}% | ${s.confidence >= 90 ? 'trustworthy' : s.confidence >= 60 ? 'directionally sound' : 'use with caution'} |`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
p();
|
|
321
|
+
p(`**${thin.length} section(s)** print a score on confidence below 40% in the checklist ` +
|
|
322
|
+
`renderer. Here they read **INSUFFICIENT EVIDENCE** — a 10/10 at 25% confidence is ` +
|
|
323
|
+
`${fmt((10 * 25) / 100)} of an unknown possible 10, not a perfect score.`);
|
|
324
|
+
p();
|
|
325
|
+
}
|
|
326
|
+
function renderRoadmap(p, report) {
|
|
327
|
+
const open = openFindings(report);
|
|
328
|
+
// Bucket on the *declared* severity, not the dampened one — the whole point of
|
|
329
|
+
// the "severity honesty" section is that the profile launders HIGH→MEDIUM. A
|
|
330
|
+
// downgraded HIGH is still a HIGH for sequencing, so "next week" does not print
|
|
331
|
+
// an empty bucket while `eval()` and the lockfile sit hidden under MEDIUM.
|
|
332
|
+
const base = (f) => f.baseSeverity;
|
|
333
|
+
const buckets = [
|
|
334
|
+
{
|
|
335
|
+
title: 'Today — stop the bleeding',
|
|
336
|
+
blurb: 'Close CRITICAL and security-HIGH before anything else.',
|
|
337
|
+
items: open.filter((f) => base(f) === 'CRITICAL' || (base(f) === 'HIGH' && f.ruleClass === 'security')),
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
title: 'This week — make it reproducible',
|
|
341
|
+
blurb: 'Foundation + the remaining declared-HIGH findings (some are shown as MEDIUM below after downgrade).',
|
|
342
|
+
items: open.filter((f) => base(f) === 'HIGH' && !(base(f) === 'HIGH' && f.ruleClass === 'security')),
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
title: 'This month — the safety net',
|
|
346
|
+
blurb: 'Declared-MEDIUM findings: migrations, transactions, validation, reliability.',
|
|
347
|
+
items: open.filter((f) => base(f) === 'MEDIUM'),
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
title: 'Deferred — after the floor exists',
|
|
351
|
+
blurb: 'Declared-LOW and FUTURE. Explicitly not now; re-read after the next audit.',
|
|
352
|
+
items: open.filter((f) => base(f) === 'LOW' || base(f) === 'FUTURE'),
|
|
353
|
+
},
|
|
354
|
+
];
|
|
355
|
+
for (const b of buckets) {
|
|
356
|
+
p(`### ${b.title}`);
|
|
357
|
+
p();
|
|
358
|
+
p(`*${b.blurb}*`);
|
|
359
|
+
p();
|
|
360
|
+
if (b.items.length === 0) {
|
|
361
|
+
p('Nothing here.');
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
for (const f of b.items.slice(0, 15)) {
|
|
365
|
+
const shown = severityIcon(f.baseSeverity);
|
|
366
|
+
const downgraded = f.dampened ? ` ${f.baseSeverity}→${f.severity}` : '';
|
|
367
|
+
p(`- ${shown} \`${f.ruleId}\` ${f.title}${downgraded}${f.remediation ? ` → ${f.remediation}` : ''}`);
|
|
368
|
+
}
|
|
369
|
+
if (b.items.length > 15)
|
|
370
|
+
p(`- …and ${b.items.length - 15} more`);
|
|
371
|
+
}
|
|
372
|
+
p();
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function renderNotAudited(p) {
|
|
376
|
+
p('## What this audit did not check');
|
|
377
|
+
p();
|
|
378
|
+
p("A fixed, honest account of the method's limits — not a claim about the project:");
|
|
379
|
+
p();
|
|
380
|
+
for (const { what, why } of NOT_AUDITED) {
|
|
381
|
+
p(`- **${what}** — ${why}.`);
|
|
382
|
+
}
|
|
383
|
+
p();
|
|
384
|
+
}
|
|
385
|
+
function renderMachineRecord(p, report) {
|
|
386
|
+
p('## Machine record (reproducible appendix)');
|
|
387
|
+
p();
|
|
388
|
+
p('The deterministic substrate this narrative was derived from. `usa diff` reads it.');
|
|
389
|
+
p();
|
|
390
|
+
p(TRAILER_BEGIN);
|
|
391
|
+
p('```yaml');
|
|
392
|
+
p(trailer(report));
|
|
393
|
+
p('```');
|
|
394
|
+
p(TRAILER_END);
|
|
395
|
+
p();
|
|
396
|
+
}
|
|
397
|
+
/* --------------------------------------------------------------- helpers -- */
|
|
398
|
+
function severityIcon(s) {
|
|
399
|
+
return { CRITICAL: '🔴', HIGH: '🟠', MEDIUM: '🟡', LOW: '🟢', FUTURE: '🔵' }[s];
|
|
400
|
+
}
|
|
401
|
+
function list(items) {
|
|
402
|
+
const uniq = [...new Set(items.filter(Boolean))];
|
|
403
|
+
if (uniq.length === 0)
|
|
404
|
+
return '';
|
|
405
|
+
if (uniq.length <= 4)
|
|
406
|
+
return uniq.join(', ');
|
|
407
|
+
return `${uniq.slice(0, 4).join(', ')} +${uniq.length - 4}`;
|
|
408
|
+
}
|
|
409
|
+
function fmt(n) {
|
|
410
|
+
return Number.isInteger(n) ? String(n) : n.toFixed(1);
|
|
411
|
+
}
|
|
412
|
+
function fmtLoc(l) {
|
|
413
|
+
return `\`${l.file}${typeof l.line === 'number' ? `:${l.line}` : ''}\``;
|
|
414
|
+
}
|
|
415
|
+
//# sourceMappingURL=narrative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"narrative.js","sourceRoot":"","sources":["../../src/report/narrative.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAuBpE,gFAAgF;AAEhF,2EAA2E;AAC3E,MAAM,IAAI,GAAwB,IAAI,GAAG,CAAC;IACxC,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;IACZ,cAAc;CACf,CAAC,CAAC;AAEH,iCAAiC;AACjC,MAAM,cAAc,GAAe,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAEnF,8EAA8E;AAC9E,MAAM,cAAc,GAA2B,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;AAEpG,2EAA2E;AAC3E,MAAM,OAAO,GAAiD;IAC5D,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAC7B,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IACzC,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC7C,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC3C,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACvC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;CACxC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,GAAiD;IAChE;QACE,IAAI,EAAE,+BAA+B;QACrC,GAAG,EAAE,qFAAqF;KAC3F;IACD;QACE,IAAI,EAAE,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