@edjbarron/ux-guard 0.6.0 → 0.7.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.
@@ -0,0 +1,44 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="referrer" content="no-referrer">
7
+ <title>ux-guard use-case review</title>
8
+ <link rel="stylesheet" href="/app.css">
9
+ <script type="module" src="/app.js"></script>
10
+ </head>
11
+ <body>
12
+ <a class="skip-link" href="#main">Skip to review content</a>
13
+ <header class="app-header">
14
+ <div>
15
+ <h1>Use-case review</h1>
16
+ <p id="repo-line" class="muted">Loading the local review…</p>
17
+ </div>
18
+ <div class="header-actions">
19
+ <span id="save-state" class="save-state" role="status" aria-live="polite">Not saved</span>
20
+ <button id="save" type="button" class="primary" aria-keyshortcuts="Control+S Meta+S" disabled>Save review</button>
21
+ <button id="close" type="button">Close review</button>
22
+ </div>
23
+ </header>
24
+ <p class="notice"><strong>Saving records review decisions only.</strong> It does not approve, adopt, check in, or enforce anything. Changing the active catalog is a separate owner command.</p>
25
+ <div id="save-confirmation" class="save-confirmation" role="status" aria-live="polite" tabindex="-1" hidden></div>
26
+ <div id="identity-banner" class="banner" hidden></div>
27
+ <div id="error" class="banner danger" role="alert" hidden></div>
28
+ <div id="status" class="status" role="status" aria-live="polite"></div>
29
+ <nav aria-label="Review sections">
30
+ <div class="tabs" role="tablist" aria-label="Review sections">
31
+ <button type="button" role="tab" id="tab-summary" aria-controls="panel-summary" aria-selected="true">Summary</button>
32
+ <button type="button" role="tab" id="tab-use-cases" aria-controls="panel-use-cases" aria-selected="false" tabindex="-1">Use cases</button>
33
+ <button type="button" role="tab" id="tab-coverage" aria-controls="panel-coverage" aria-selected="false" tabindex="-1">Surfaces and workflows</button>
34
+ <button type="button" role="tab" id="tab-preview" aria-controls="panel-preview" aria-selected="false" tabindex="-1">Catalog preview</button>
35
+ </div>
36
+ </nav>
37
+ <main id="main" tabindex="-1">
38
+ <section id="panel-summary" role="tabpanel" aria-labelledby="tab-summary" tabindex="0"></section>
39
+ <section id="panel-use-cases" role="tabpanel" aria-labelledby="tab-use-cases" tabindex="0" hidden></section>
40
+ <section id="panel-coverage" role="tabpanel" aria-labelledby="tab-coverage" tabindex="0" hidden></section>
41
+ <section id="panel-preview" role="tabpanel" aria-labelledby="tab-preview" tabindex="0" hidden></section>
42
+ </main>
43
+ </body>
44
+ </html>
@@ -0,0 +1,514 @@
1
+ export const REVIEW_AUDIT_KIND = 'ux-guard-review-audit';
2
+ export const REVIEW_AUDIT_VERSION = 1;
3
+
4
+ const REMEDIATION_PATHS = Object.freeze([
5
+ 'Fix candidate product or source code, regenerate compatible evidence, and rerun the same trusted-base audit.',
6
+ 'Prepare an explicit catalog, workflow, control-policy, target, or baseline candidate with a visible diff for separate human review; never let the candidate replace its own trusted judge.',
7
+ ]);
8
+
9
+ export function createReviewAudit({
10
+ context,
11
+ state,
12
+ trust,
13
+ previewFile,
14
+ activeCatalog,
15
+ previewCatalog,
16
+ patterns,
17
+ journeys,
18
+ visuals,
19
+ verdict,
20
+ } = {}) {
21
+ const useCases = useCaseAssessments(
22
+ previewCatalog.report,
23
+ activeCatalog.report,
24
+ verdict,
25
+ journeys,
26
+ );
27
+ const policyFindings = [
28
+ ...activeCatalog.findings.map((finding) => ({
29
+ source: 'active-catalog',
30
+ ...structuredClone(finding),
31
+ })),
32
+ ...previewCatalog.findings.map((finding) => ({
33
+ source: 'unapproved-preview',
34
+ ...structuredClone(finding),
35
+ })),
36
+ ...patterns.summary.findings.map((finding) => ({
37
+ source: 'candidate-source-patterns',
38
+ ...structuredClone(finding),
39
+ })),
40
+ ];
41
+ const evidenceStatus = journeys.summary.evidence?.status ?? (
42
+ journeys.summary.reportPresent ? 'compatible' : 'missing'
43
+ );
44
+ const evidenceReason = journeys.summary.evidence?.reason ?? (
45
+ journeys.summary.reportPresent
46
+ ? 'The configured journey evidence is compatible with this ux-guard version.'
47
+ : 'Current journey evidence is not available.'
48
+ );
49
+ const executionTrust =
50
+ verdict?.regression?.journeyComparison?.trust?.execution ??
51
+ (evidenceStatus === 'compatible' ? 'candidate-untrusted' : 'unknown');
52
+ const assessmentStatus =
53
+ evidenceStatus === 'compatible'
54
+ ? 'available'
55
+ : evidenceStatus === 'unconfigured'
56
+ ? 'not-configured'
57
+ : 'unknown';
58
+ const guard = guardRecommendation({
59
+ policyFindings,
60
+ evidenceStatus,
61
+ executionTrust,
62
+ verdict,
63
+ reviewPending: state.summary.unresolvedDecisions,
64
+ });
65
+ const recommendations = auditRecommendations({
66
+ state,
67
+ previewCatalog,
68
+ policyFindings,
69
+ evidenceStatus,
70
+ evidenceReason,
71
+ executionTrust,
72
+ verdict,
73
+ });
74
+
75
+ return {
76
+ kind: REVIEW_AUDIT_KIND,
77
+ version: REVIEW_AUDIT_VERSION,
78
+ command: 'review audit',
79
+ status: recommendations.length ? 'attention' : 'clear',
80
+ approval: {
81
+ state: 'unapproved',
82
+ activeCatalog: 'reviewed-active-policy',
83
+ previewCatalog: 'unapproved-review-preview',
84
+ reviewDecisionsChanged: false,
85
+ policyChanged: false,
86
+ enforcementChanged: false,
87
+ },
88
+ provenance: {
89
+ trustedBase: { ref: trust.ref, commit: trust.commit },
90
+ candidate: {
91
+ path: context.candidatePath,
92
+ sha256: context.candidateSha256,
93
+ identity: structuredClone(context.identity),
94
+ },
95
+ review: {
96
+ path: context.reviewPath,
97
+ sha256: context.reviewSha256,
98
+ revision: context.review.revision,
99
+ saved: context.reviewSha256 !== null,
100
+ },
101
+ preview: {
102
+ path: context.previewPath,
103
+ sha256: previewFile.sha256,
104
+ matchesSavedReview: true,
105
+ },
106
+ journeyEvidence: structuredClone(journeys.summary.evidence),
107
+ },
108
+ review: {
109
+ definitions: structuredClone(state.summary.definitions),
110
+ proposals: structuredClone(state.summary.proposals),
111
+ mappings: {
112
+ discovered: state.summary.discovered,
113
+ mapped: state.summary.mapped,
114
+ awaitingPendingProposals: state.summary.proposed,
115
+ excluded: state.summary.excluded,
116
+ unresolved: state.summary.unresolved,
117
+ surfaces: structuredClone(state.summary.surfaces),
118
+ workflows: structuredClone(state.summary.workflows),
119
+ },
120
+ unresolvedDecisions: state.summary.unresolvedDecisions,
121
+ blockingIssues: state.summary.blockingIssues,
122
+ readyForOwnerApproval: state.summary.readyForOwnerApproval,
123
+ unresolved: structuredClone(state.unresolved),
124
+ issues: structuredClone(state.issues),
125
+ },
126
+ catalogs: {
127
+ active: {
128
+ approval: 'reviewed-active-policy',
129
+ path: state.catalog.path,
130
+ sha256: state.catalog.activeSha256,
131
+ ...structuredClone(activeCatalog.summary),
132
+ },
133
+ preview: {
134
+ approval: 'unapproved-review-preview',
135
+ path: context.previewPath,
136
+ sha256: previewFile.sha256,
137
+ entries: state.catalog.entries,
138
+ unboundUseCases: [...state.catalog.unbound],
139
+ omitted: structuredClone(state.catalog.omitted),
140
+ ...structuredClone(previewCatalog.summary),
141
+ },
142
+ },
143
+ controls: {
144
+ sourcePatterns: structuredClone(patterns.summary),
145
+ findings: policyFindings,
146
+ },
147
+ assessment: {
148
+ status: assessmentStatus,
149
+ evidence: {
150
+ status: evidenceStatus,
151
+ reason: evidenceReason,
152
+ executionTrust,
153
+ },
154
+ journeys: structuredClone(journeys.summary),
155
+ visuals: structuredClone(visuals),
156
+ quality: verdict
157
+ ? structuredClone(verdict.quality)
158
+ : unavailable('Compatible journey measurements are required for a quality verdict.'),
159
+ targetAttainment: verdict
160
+ ? structuredClone(verdict.targetAttainment)
161
+ : unavailable('Compatible journey measurements and reviewed targets are required.'),
162
+ regression: verdict
163
+ ? structuredClone(verdict.regression)
164
+ : unavailable('Compatible journey measurements and a reviewed trusted baseline are required.'),
165
+ scoring: verdict
166
+ ? structuredClone(verdict.scoring)
167
+ : {
168
+ status: 'not-scored',
169
+ score: null,
170
+ reason: 'Compatible measurements and reviewed at-most targets are required.',
171
+ },
172
+ useCases,
173
+ },
174
+ guard,
175
+ recommendations,
176
+ safety: {
177
+ readOnly: true,
178
+ advisory: true,
179
+ approved: false,
180
+ adopted: false,
181
+ filesWritten: [],
182
+ },
183
+ };
184
+ }
185
+
186
+ export function renderReviewAuditMarkdown(audit) {
187
+ const lines = [
188
+ '# ux-guard review audit',
189
+ '',
190
+ '> Unapproved, read-only assessment. This report does not approve review decisions, adopt the preview, change policy, promote evidence, or enable enforcement.',
191
+ '',
192
+ '## Provenance',
193
+ '',
194
+ `- Trusted base: \`${audit.provenance.trustedBase.ref}\` at \`${audit.provenance.trustedBase.commit}\``,
195
+ `- Candidate: \`${audit.provenance.candidate.path}\` (\`${audit.provenance.candidate.sha256}\`, ${audit.provenance.candidate.identity.status})`,
196
+ `- Saved review: revision ${audit.provenance.review.revision}, \`${audit.provenance.review.sha256}\``,
197
+ `- Preview: \`${audit.provenance.preview.path}\` (\`${audit.provenance.preview.sha256}\`, exact saved-review match)`,
198
+ `- Journey evidence: ${audit.assessment.evidence.status}, ${audit.assessment.evidence.executionTrust} — ${audit.assessment.evidence.reason}`,
199
+ '',
200
+ '## Review readiness',
201
+ '',
202
+ `- Definitions: ${audit.review.definitions.completeProposals} complete proposals, ${audit.review.definitions.incompleteDrafts} incomplete drafts`,
203
+ `- Decisions: ${audit.review.proposals.decided} decided, ${audit.review.proposals.pending} pending`,
204
+ `- Mappings: ${audit.review.mappings.mapped} mapped, ${audit.review.mappings.awaitingPendingProposals} awaiting pending proposals, ${audit.review.mappings.excluded} excluded, ${audit.review.mappings.unresolved} unresolved`,
205
+ `- Blocking issues: ${audit.review.blockingIssues}`,
206
+ `- Ready for owner approval: ${audit.review.readyForOwnerApproval ? 'yes' : 'no'}`,
207
+ '',
208
+ '## Active policy and unapproved preview',
209
+ '',
210
+ `- Active catalog: ${audit.catalogs.active.useCases.length} use cases, ${audit.catalogs.active.inventory} inventory, ${audit.catalogs.active.unmapped.length} unmapped navigation surfaces`,
211
+ `- Unapproved preview: ${audit.catalogs.preview.useCases.length} use cases, ${audit.catalogs.preview.inventory} inventory, ${audit.catalogs.preview.unmapped.length} unmapped navigation surfaces`,
212
+ `- Preview implementation bindings: ${audit.catalogs.preview.unboundUseCases.length} use cases have unknown or unbound entry points`,
213
+ '- The preview is assessed in memory and remains separate from active policy.',
214
+ '',
215
+ '## Source and control policy',
216
+ '',
217
+ `- Source files scanned: ${audit.controls.sourcePatterns.files}`,
218
+ `- Result: ${audit.controls.sourcePatterns.status}`,
219
+ `- Findings: ${audit.controls.findings.length}`,
220
+ '',
221
+ '## UX evidence',
222
+ '',
223
+ `- Assessment: ${audit.assessment.status}`,
224
+ `- Quality: ${valueLabel(audit.assessment.quality, 'verdict')}`,
225
+ `- Target attainment: ${valueLabel(audit.assessment.targetAttainment, 'status')}`,
226
+ `- Regression: ${valueLabel(audit.assessment.regression, 'status')}`,
227
+ `- Numerical scoring: ${valueLabel(audit.assessment.scoring, 'status')}`,
228
+ '',
229
+ '## Per-use-case assessment',
230
+ '',
231
+ ];
232
+ for (const useCase of audit.assessment.useCases) {
233
+ lines.push(
234
+ `### ${useCase.title} (\`${useCase.id}\`)`,
235
+ '',
236
+ `- Catalog state: ${useCase.catalogState}`,
237
+ `- Entry points: ${useCase.implementation.entryPoints} (${useCase.implementation.status})`,
238
+ `- Evidence: ${useCase.evidence.status} — ${useCase.evidence.reason}`,
239
+ `- Quality: ${useCase.quality.status} — ${useCase.quality.reason}`,
240
+ `- Target attainment: ${useCase.targetAttainment.status} — ${useCase.targetAttainment.reason}`,
241
+ `- Regression: ${useCase.regression.status} — ${useCase.regression.reason}`,
242
+ `- Score: ${useCase.scoring.score === null ? 'not scored' : useCase.scoring.score} — ${useCase.scoring.reason}`,
243
+ '',
244
+ );
245
+ }
246
+ lines.push(
247
+ '## Check-in guard recommendation',
248
+ '',
249
+ `- Recommended result: ${audit.guard.status} (exit ${audit.guard.recommendedExit})`,
250
+ `- Reason: ${audit.guard.reason}`,
251
+ '- This is a recommendation only. Enforcement remains disabled until a separate reviewed CI decision makes a trusted-base command required.',
252
+ '',
253
+ 'Two explicit remediation paths:',
254
+ '',
255
+ ...audit.guard.remediationPaths.map((item, index) => `${index + 1}. ${item}`),
256
+ '',
257
+ '## Next actions',
258
+ '',
259
+ );
260
+ if (audit.recommendations.length === 0) lines.push('- No follow-up was generated.');
261
+ else lines.push(...audit.recommendations.map((item) => `- ${item}`));
262
+ lines.push('');
263
+ return `${lines.join('\n')}\n`;
264
+ }
265
+
266
+ function useCaseAssessments(catalog, activeCatalog, verdict, journeys) {
267
+ const verdictCases = new Map(
268
+ (verdict?.useCases ?? []).map((item) => [item.useCaseId, item]),
269
+ );
270
+ const scoreCases = new Map(
271
+ (verdict?.scoring?.useCases ?? []).map((item) => [item.useCaseId, item]),
272
+ );
273
+ const targetJourneys = verdict?.targetAttainment?.journeys ?? [];
274
+ const policyIds = new Set(
275
+ journeys.policy?.coverage?.map(({ useCaseId }) => useCaseId) ?? [],
276
+ );
277
+ const activeIds = new Set(activeCatalog.useCases.map(({ id }) => id));
278
+ const evidenceStatus = journeys.summary.evidence?.status ?? (
279
+ journeys.summary.reportPresent ? 'compatible' : 'missing'
280
+ );
281
+ return catalog.useCases.map((entry) => {
282
+ const quality = verdictCases.get(entry.id);
283
+ const score = scoreCases.get(entry.id);
284
+ const targets = targetJourneys.filter(({ journeyRef }) =>
285
+ journeyRef.startsWith(`journey.${entry.id}.`)
286
+ );
287
+ const starts = Array.isArray(entry.starts) ? entry.starts : [];
288
+ const hasPolicy = policyIds.has(entry.id);
289
+ const targetStatus = hasPolicy
290
+ ? aggregateTargetStatus(targets, verdict?.targetAttainment)
291
+ : {
292
+ status: 'not-evaluated',
293
+ reason: 'Reviewed journey coverage policy is required before targets apply.',
294
+ };
295
+ const evidence = evidenceForUseCase({
296
+ hasPolicy,
297
+ evidenceStatus,
298
+ quality,
299
+ reason: journeys.summary.evidence?.reason,
300
+ });
301
+ return {
302
+ id: entry.id,
303
+ title: entry.title,
304
+ catalogState: activeIds.has(entry.id)
305
+ ? 'active-reviewed-and-preview'
306
+ : 'accepted-unapproved-preview',
307
+ implementation: {
308
+ status: starts.length ? 'bound' : 'unknown',
309
+ entryPoints: starts.length,
310
+ navigation: starts.filter((start) => typeof start.nav_id === 'string').length,
311
+ directRoutes: starts.filter((start) => start.entry === 'route').length,
312
+ assistant: starts.filter((start) => start.entry === 'assistant').length,
313
+ },
314
+ evidence,
315
+ quality: quality
316
+ ? {
317
+ status: quality.verdict,
318
+ reason: quality.reason,
319
+ }
320
+ : {
321
+ status: 'not-evaluated',
322
+ reason: hasPolicy
323
+ ? evidence.reason
324
+ : 'No reviewed journey coverage policy at the trusted base names this use case.',
325
+ },
326
+ targetAttainment: targetStatus,
327
+ regression: verdict && hasPolicy
328
+ ? {
329
+ status: verdict.regression.status,
330
+ reason: `Shared trusted comparison: ${verdict.regression.reason}`,
331
+ }
332
+ : {
333
+ status: 'not-evaluated',
334
+ reason: 'Compatible measurements and a reviewed trusted baseline are required.',
335
+ },
336
+ scoring: score
337
+ ? structuredClone(score)
338
+ : {
339
+ status: 'not-scored',
340
+ score: null,
341
+ reason: hasPolicy
342
+ ? 'No target-backed numerical score is available.'
343
+ : 'Reviewed journey coverage and reviewed at-most targets are required.',
344
+ },
345
+ };
346
+ });
347
+ }
348
+
349
+ function evidenceForUseCase({ hasPolicy, evidenceStatus, quality, reason }) {
350
+ if (!hasPolicy) {
351
+ return {
352
+ status: 'unknown',
353
+ reason: 'No reviewed journey coverage policy at the trusted base names this use case.',
354
+ };
355
+ }
356
+ if (evidenceStatus !== 'compatible') {
357
+ return {
358
+ status: 'unknown',
359
+ reason: reason ?? 'Compatible journey evidence is not available.',
360
+ };
361
+ }
362
+ if (!quality) {
363
+ return {
364
+ status: 'unknown',
365
+ reason: 'No evaluated journey evidence is available for this use case.',
366
+ };
367
+ }
368
+ return {
369
+ status: quality.coverage.status === 'complete' ? 'measured' : 'incomplete',
370
+ reason: quality.reason,
371
+ };
372
+ }
373
+
374
+ function aggregateTargetStatus(targets, overall) {
375
+ if (!overall || !['met', 'breached', 'partial'].includes(overall.status)) {
376
+ return {
377
+ status: 'not-evaluated',
378
+ reason: overall?.reason ?? 'Reviewed targets and compatible measurements are required.',
379
+ };
380
+ }
381
+ if (targets.length === 0) {
382
+ return {
383
+ status: 'not-targeted',
384
+ reason: 'No reviewed metric target is configured for this use case.',
385
+ };
386
+ }
387
+ const metrics = targets.flatMap(({ metrics }) => metrics);
388
+ const status = metrics.some(({ status }) => status === 'breached')
389
+ ? 'breached'
390
+ : metrics.every(({ status }) => status === 'met')
391
+ ? 'met'
392
+ : 'partial';
393
+ return {
394
+ status,
395
+ reason: `${metrics.length} reviewed metric target${metrics.length === 1 ? '' : 's'} evaluated.`,
396
+ };
397
+ }
398
+
399
+ function guardRecommendation({
400
+ policyFindings,
401
+ evidenceStatus,
402
+ executionTrust,
403
+ verdict,
404
+ reviewPending,
405
+ }) {
406
+ if (evidenceStatus !== 'compatible') {
407
+ return {
408
+ status: 'block-unknown-evidence',
409
+ recommendedExit: 2,
410
+ reason: 'Required runtime evidence is missing, incompatible, invalid, or not configured; it cannot be treated as a pass.',
411
+ reviewPending,
412
+ remediationPaths: [...REMEDIATION_PATHS],
413
+ };
414
+ }
415
+ if (executionTrust !== 'trusted-base') {
416
+ return {
417
+ status: 'block-untrusted-execution',
418
+ recommendedExit: 2,
419
+ reason: 'Compatible candidate diagnostics are available, but a pinned-base authoritative runner has not regenerated them as trusted execution.',
420
+ reviewPending,
421
+ remediationPaths: [...REMEDIATION_PATHS],
422
+ };
423
+ }
424
+ if (['partial', 'incompatible', 'not-evaluated'].includes(verdict?.targetAttainment?.status)) {
425
+ return {
426
+ status: 'block-unknown-target-evidence',
427
+ recommendedExit: 2,
428
+ reason: 'One or more reviewed targets could not be evaluated from trusted evidence.',
429
+ reviewPending,
430
+ remediationPaths: [...REMEDIATION_PATHS],
431
+ };
432
+ }
433
+ if (policyFindings.length) {
434
+ return {
435
+ status: 'block-policy-findings',
436
+ recommendedExit: 1,
437
+ reason: `${policyFindings.length} catalog or source-control policy finding(s) require remediation or separate policy review.`,
438
+ reviewPending,
439
+ remediationPaths: [...REMEDIATION_PATHS],
440
+ };
441
+ }
442
+ if (
443
+ verdict?.regression?.status === 'regression' ||
444
+ verdict?.targetAttainment?.status === 'breached'
445
+ ) {
446
+ return {
447
+ status: 'block-regression-or-target-breach',
448
+ recommendedExit: 1,
449
+ reason: 'Trusted comparison found a regression or reviewed-target breach.',
450
+ reviewPending,
451
+ remediationPaths: [...REMEDIATION_PATHS],
452
+ };
453
+ }
454
+ return {
455
+ status: 'eligible-after-explicit-enforcement-approval',
456
+ recommendedExit: 0,
457
+ reason: 'No blocking finding was observed in the available trusted-base evidence.',
458
+ reviewPending,
459
+ remediationPaths: [...REMEDIATION_PATHS],
460
+ };
461
+ }
462
+
463
+ function auditRecommendations({
464
+ state,
465
+ previewCatalog,
466
+ policyFindings,
467
+ evidenceStatus,
468
+ evidenceReason,
469
+ executionTrust,
470
+ verdict,
471
+ }) {
472
+ const recommendations = [];
473
+ if (state.summary.unresolvedDecisions) {
474
+ recommendations.push(
475
+ `Complete ${state.summary.unresolvedDecisions} remaining review decision(s) before requesting catalog adoption.`,
476
+ );
477
+ }
478
+ if (state.catalog.unbound.length) {
479
+ recommendations.push(
480
+ `Keep implementation coverage unknown for ${state.catalog.unbound.length} unbound preview use case(s) until evidence-backed entry points are known.`,
481
+ );
482
+ }
483
+ if (previewCatalog.report.unmapped.length) {
484
+ recommendations.push(
485
+ `Review ${previewCatalog.report.unmapped.length} unmapped navigation surface(s); partial inventory keeps them visible without claiming coverage.`,
486
+ );
487
+ }
488
+ if (policyFindings.length) {
489
+ recommendations.push(
490
+ 'Fix candidate source/catalog findings or prepare a visible policy candidate for separate approval; do not update the trusted baseline merely to make the result green.',
491
+ );
492
+ }
493
+ if (evidenceStatus !== 'compatible') {
494
+ recommendations.push(`Regenerate current compatible journey evidence before scoring: ${evidenceReason}`);
495
+ } else if (executionTrust !== 'trusted-base') {
496
+ recommendations.push(
497
+ 'Use the pinned-base authoritative runner before treating this compatible candidate evidence as a check-in result.',
498
+ );
499
+ }
500
+ if (verdict?.scoring?.status === 'not-scored') {
501
+ recommendations.push(
502
+ 'Do not invent thresholds. Numerical scores require reviewed at-most targets plus successful compatible measurements.',
503
+ );
504
+ }
505
+ return recommendations;
506
+ }
507
+
508
+ function unavailable(reason) {
509
+ return { status: 'not-evaluated', reason };
510
+ }
511
+
512
+ function valueLabel(value, field) {
513
+ return value?.[field] ?? 'not evaluated';
514
+ }