osuite 2.9.6 → 2.9.8

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 CHANGED
@@ -1,4 +1,4 @@
1
- # OSuite SDK (v2.9.6)
1
+ # OSuite SDK (v2.9.8)
2
2
 
3
3
  **Governed action SDK for AI agents.**
4
4
 
@@ -128,6 +128,39 @@ The v2 SDK exposes the core governance loop plus first-class PCAA, replay, proof
128
128
  - `events()` -- Subscribe to live approval and governance events over SSE.
129
129
  - `PCAA_CHECKPOINTS` / `buildPcaaCheckpointStates(...)` -- Reuse the portable checkpoint contract in your own tooling.
130
130
 
131
+ ### External Verifier Network
132
+ - `getExternalVerifierConfig()` -- Read provider-neutral external verifier status, configured providers, usage, and copy-paste setup commands.
133
+ - `configureExternalVerifier(config)` -- Configure a verifier provider such as Baby Blue / invinoveritas from SDK code or an agent-run terminal task.
134
+ - `disableExternalVerifier(providerId)` -- Disable one verifier provider without deleting OSuite proof or billing history.
135
+
136
+ CLI setup:
137
+
138
+ ```bash
139
+ osuite external status
140
+ osuite external configure \
141
+ --provider babyblue_invinoveritas \
142
+ --mode shadow \
143
+ --account-model customer_managed \
144
+ --api-key "$BABYBLUE_IVV_BEARER" \
145
+ --account-id "$BABYBLUE_IVV_AGENT_ID"
146
+ ```
147
+
148
+ SDK setup:
149
+
150
+ ```javascript
151
+ await osuite.configureExternalVerifier({
152
+ enabled: true,
153
+ providers: [{
154
+ provider_id: 'babyblue_invinoveritas',
155
+ enabled: true,
156
+ mode: 'shadow',
157
+ account_model: 'customer_managed',
158
+ api_key: process.env.BABYBLUE_IVV_BEARER,
159
+ account_id: process.env.BABYBLUE_IVV_AGENT_ID,
160
+ }],
161
+ });
162
+ ```
163
+
131
164
  ### External Governor Receipts
132
165
  - `governance_stage_receipts` -- Preserve runtime-stage decisions such as `pre_input`, `pre_tool`, `post_tool`, and `pre_output`.
133
166
  - `approval_receipts` -- Preserve human approval workflow receipts alongside legacy approval fields.
package/cli.js CHANGED
@@ -25,6 +25,16 @@ const PROTECTED_REFS = new Set(['main', 'master', 'prod', 'production', 'stable'
25
25
  const OBSERVE_OPS = new Set(['get', 'describe', 'logs', 'top', 'version', 'diff']);
26
26
  const PLAN_OPS = new Set(['plan', 'show', 'validate', 'output', 'fmt', 'providers', 'graph']);
27
27
  const MUTATION_OPS = new Set(['apply', 'destroy', 'delete', 'create', 'replace', 'taint', 'untaint', 'import', 'upgrade', 'rollback', 'install', 'uninstall']);
28
+ const GIT_OBSERVATION_RISKS = {
29
+ status: 10,
30
+ log: 10,
31
+ branch: 10,
32
+ show: 12,
33
+ remote: 14,
34
+ diff: 18,
35
+ };
36
+ const PUBLIC_FILE_HOST_HINTS = ['transfer.sh', 'file.io', 'tmpfiles.org', '0x0.st', 'ufile.io', 'gofile.io', 'wetransfer.com'];
37
+ const SECURITY_CONTROL_WEAKENING_RE = /(\bspctl\b[\s\S]*(--master-disable|--global-disable|--disable)|\bcsrutil\b[\s\S]*\bdisable\b|Set-MpPreference[\s\S]*Disable(?:RealtimeMonitoring|BehaviorMonitoring|IOAVProtection)[\s\S]*(true|\$true|1)|netsh\s+advfirewall\s+set\s+allprofiles\s+state\s+off|\bsystemctl\b[\s\S]*\b(stop|disable|mask)\b[\s\S]*(auditd|falcon|crowdstrike|osquery|defender|mdatp|sentinel|carbonblack|firewalld|ufw)|\bufw\b[\s\S]*\bdisable\b)/i;
28
38
  const DEFAULT_BASE_URL = 'https://studio.osuite.ai';
29
39
  const PROJECT_BOOTSTRAPS = {
30
40
  codex: {
@@ -396,6 +406,8 @@ function printHelp() {
396
406
  write(' osuite review <actionId> Render the decision review card');
397
407
  write(' osuite approve <actionId> --reason "Looks safe"');
398
408
  write(' osuite deny <actionId> --reason "Outside change window"');
409
+ write(' osuite external status Show external verifier network setup and usage');
410
+ write(' osuite external configure --provider babyblue_invinoveritas --mode shadow --api-key <key>');
399
411
  write(' osuite connect [auto|codex|claude|sdk|mcp] Detect runtime and start browser handoff');
400
412
  write(' osuite init [sdk|codex|claude|mcp] Print setup steps for a runtime lane');
401
413
  write('');
@@ -420,6 +432,28 @@ function protectedGitTarget(tokens) {
420
432
  return null;
421
433
  }
422
434
 
435
+ function hostFromCommand(command) {
436
+ const match = String(command || '').match(/https?:\/\/([^/\s"'<>]+)/i);
437
+ return match ? match[1].toLowerCase() : null;
438
+ }
439
+
440
+ function hasPublicFileHost(command) {
441
+ const normalized = String(command || '').toLowerCase();
442
+ return PUBLIC_FILE_HOST_HINTS.some((hint) => normalized.includes(hint));
443
+ }
444
+
445
+ function semanticPattern(id, label, severity, detail) {
446
+ return { id, label, severity, detail };
447
+ }
448
+
449
+ function scoreBreakdown(components, formula = 'local CAVA preview rubric') {
450
+ return {
451
+ model_version: 'osuite.decision_score.v2.1',
452
+ formula,
453
+ components,
454
+ };
455
+ }
456
+
423
457
  function classifyCommand(command) {
424
458
  const tokens = tokenize(command);
425
459
  const executable = tokens[0] || '';
@@ -429,6 +463,72 @@ function classifyCommand(command) {
429
463
  return { category: 'unknown', operation: 'unknown', risk: 20, reversible: true, summary: 'No command provided.' };
430
464
  }
431
465
 
466
+ if (SECURITY_CONTROL_WEAKENING_RE.test(command)) {
467
+ return {
468
+ category: 'policy_degradation',
469
+ operation: executable === 'sudo' ? (tokens[1] || 'security_control_change') : executable,
470
+ risk: 95,
471
+ reversible: false,
472
+ systems: ['security_posture'],
473
+ summary: 'Security-control weakening command. CAVA treats this as a posture degradation pattern, not a generic shell action.',
474
+ notes: ['block by default', 'requires security-owner review before retry'],
475
+ patterns: [
476
+ semanticPattern('security_control_weakening', 'Security-control weakening', 'critical', 'Disables or weakens endpoint, firewall, audit, EDR, or OS runtime protection.'),
477
+ ],
478
+ breakdown: scoreBreakdown([
479
+ { id: 'base_action', label: 'Base action', value: 65, detail: 'Security posture change baseline.', direction: 'base' },
480
+ { id: 'cava_pattern_security_control_weakening', label: 'CAVA pattern', value: 30, detail: 'Security-control weakening raises the local preview to block-level risk.', direction: 'increase' },
481
+ ]),
482
+ };
483
+ }
484
+
485
+ if (['curl', 'wget'].includes(executable) || (executable === 'sudo' && ['curl', 'wget'].includes(tokens[1]))) {
486
+ const host = hostFromCommand(command);
487
+ const publicHost = hasPublicFileHost(command);
488
+ const uploadLike = /\s(-F|--form|-T|--upload-file|--post-file)\b|upload|share/i.test(command);
489
+ const risk = publicHost && uploadLike ? 86 : 62;
490
+ const patterns = [
491
+ ...(publicHost && uploadLike ? [
492
+ semanticPattern('hidden_externality', 'Hidden externality', 'high', 'The command creates an external side effect that is stronger than a normal local task.'),
493
+ semanticPattern('public_persistent_egress', 'Public persistent egress', 'critical', 'Data is being uploaded to a public or link-accessible file host.'),
494
+ ] : []),
495
+ ];
496
+ return {
497
+ category: 'network_egress',
498
+ operation: executable === 'sudo' ? tokens[1] : executable,
499
+ risk,
500
+ reversible: false,
501
+ systems: ['network', host || 'external_endpoint'],
502
+ summary: publicHost
503
+ ? `Network egress to public file host ${host || 'unknown host'}.`
504
+ : `Network egress to ${host || 'external endpoint'}.`,
505
+ notes: publicHost ? ['public link or file host', 'approval or block depends on policy profile'] : ['external network boundary'],
506
+ patterns,
507
+ breakdown: scoreBreakdown([
508
+ { id: 'base_action', label: 'Base action', value: 45, detail: 'Network egress baseline.', direction: 'base' },
509
+ ...(publicHost ? [{ id: 'public_destination', label: 'Public destination', value: 23, detail: 'Public file/link destination detected.', direction: 'increase' }] : []),
510
+ ...(uploadLike ? [{ id: 'external_write', label: 'External write', value: 18, detail: 'Upload or form-post semantics detected.', direction: 'increase' }] : []),
511
+ ]),
512
+ };
513
+ }
514
+
515
+ if (executable === 'git' && Object.hasOwn(GIT_OBSERVATION_RISKS, operation)) {
516
+ const risk = GIT_OBSERVATION_RISKS[operation];
517
+ return {
518
+ category: 'observation',
519
+ operation,
520
+ risk,
521
+ reversible: true,
522
+ systems: ['git'],
523
+ summary: `Git ${operation} read-only workspace observation.`,
524
+ notes: ['read-only CAVA operation', 'usually does not require approval'],
525
+ breakdown: scoreBreakdown([
526
+ { id: 'base_action', label: 'Base action', value: risk, detail: `git ${operation} read-only observation baseline.`, direction: 'base' },
527
+ { id: 'cava_operation', label: 'CAVA operation', value: 0, detail: 'Parsed as read-only/reversible git observation.', direction: 'evidence' },
528
+ ]),
529
+ };
530
+ }
531
+
432
532
  if (executable === 'git' && operation === 'push') {
433
533
  const protectedTarget = protectedGitTarget(tokens);
434
534
  const target = protectedTarget || tokens.filter((token) => !token.startsWith('-')).at(-1) || 'remote';
@@ -442,6 +542,11 @@ function classifyCommand(command) {
442
542
  ? `Git push to protected target ${protectedTarget}.`
443
543
  : `Git push to ${target}.`,
444
544
  notes: protectedTarget ? ['protected target', 'approval recommended before side effects'] : ['feature branch target'],
545
+ breakdown: scoreBreakdown([
546
+ { id: 'base_action', label: 'Base action', value: protectedTarget ? 80 : 62, detail: protectedTarget ? 'Protected git push baseline.' : 'Remote git push baseline.', direction: 'base' },
547
+ ...(protectedTarget ? [{ id: 'protected_target', label: 'Protected target', value: 2, detail: `Target ${protectedTarget} raises review posture.`, direction: 'increase' }] : []),
548
+ { id: 'cava_operation', label: 'CAVA operation', value: 0, detail: 'Parsed as state-changing deployment.', direction: 'evidence' },
549
+ ]),
445
550
  };
446
551
  }
447
552
 
@@ -454,6 +559,10 @@ function classifyCommand(command) {
454
559
  systems: ['local_workspace'],
455
560
  summary: 'Local build or compilation step.',
456
561
  notes: ['usually does not require approval unless chained with deployment'],
562
+ breakdown: scoreBreakdown([
563
+ { id: 'base_action', label: 'Base action', value: 30, detail: 'Local build baseline.', direction: 'base' },
564
+ { id: 'cava_operation', label: 'CAVA operation', value: 0, detail: 'Parsed as reversible local build.', direction: 'evidence' },
565
+ ]),
457
566
  };
458
567
  }
459
568
 
@@ -468,6 +577,10 @@ function classifyCommand(command) {
468
577
  systems: [executable],
469
578
  summary: `${executable} observation command.`,
470
579
  notes: ['read-oriented runtime action'],
580
+ breakdown: scoreBreakdown([
581
+ { id: 'base_action', label: 'Base action', value: 28, detail: `${executable} read-oriented operation baseline.`, direction: 'base' },
582
+ { id: 'cava_operation', label: 'CAVA operation', value: 0, detail: 'Parsed as observation.', direction: 'evidence' },
583
+ ]),
471
584
  };
472
585
  }
473
586
  if (PLAN_OPS.has(op)) {
@@ -479,6 +592,10 @@ function classifyCommand(command) {
479
592
  systems: [executable],
480
593
  summary: `${executable} planning command.`,
481
594
  notes: ['plan evidence can improve approval confidence'],
595
+ breakdown: scoreBreakdown([
596
+ { id: 'base_action', label: 'Base action', value: 38, detail: `${executable} planning baseline.`, direction: 'base' },
597
+ { id: 'cava_operation', label: 'CAVA operation', value: 0, detail: 'Parsed as reversible plan/preflight evidence.', direction: 'evidence' },
598
+ ]),
482
599
  };
483
600
  }
484
601
  if (MUTATION_OPS.has(op)) {
@@ -490,6 +607,10 @@ function classifyCommand(command) {
490
607
  systems: [executable],
491
608
  summary: `${executable} infrastructure mutation.`,
492
609
  notes: ['approval recommended', 'capture plan/output as evidence'],
610
+ breakdown: scoreBreakdown([
611
+ { id: 'base_action', label: 'Base action', value: op === 'apply' || op === 'destroy' ? 90 : 78, detail: `${executable} mutation baseline.`, direction: 'base' },
612
+ { id: 'cava_operation', label: 'CAVA operation', value: 0, detail: 'Parsed as state-changing infrastructure action.', direction: 'evidence' },
613
+ ]),
493
614
  };
494
615
  }
495
616
  }
@@ -503,6 +624,10 @@ function classifyCommand(command) {
503
624
  systems: ['azure_key_vault'],
504
625
  summary: 'Azure Key Vault secret access.',
505
626
  notes: ['sensitive read', 'approval may be required by policy'],
627
+ breakdown: scoreBreakdown([
628
+ { id: 'base_action', label: 'Base action', value: 74, detail: 'Secret access baseline.', direction: 'base' },
629
+ { id: 'secret_data', label: 'Secret/data signal', value: 0, detail: 'Key Vault secret operation detected.', direction: 'evidence' },
630
+ ]),
506
631
  };
507
632
  }
508
633
 
@@ -515,6 +640,10 @@ function classifyCommand(command) {
515
640
  systems: ['workspace'],
516
641
  summary: 'Potentially destructive operation.',
517
642
  notes: ['approval strongly recommended'],
643
+ breakdown: scoreBreakdown([
644
+ { id: 'base_action', label: 'Base action', value: 72, detail: 'Unknown destructive shell baseline.', direction: 'base' },
645
+ { id: 'destructive_text', label: 'Destructive intent', value: 20, detail: 'Command text matched destructive patterns.', direction: 'increase' },
646
+ ]),
518
647
  };
519
648
  }
520
649
 
@@ -526,6 +655,10 @@ function classifyCommand(command) {
526
655
  systems: ['shell'],
527
656
  summary: 'General shell command. OSuite will use runtime context and policy to decide.',
528
657
  notes: ['provide declared_goal and evidence for better scoring'],
658
+ breakdown: scoreBreakdown([
659
+ { id: 'base_action', label: 'Base action', value: 20, detail: 'Generic shell baseline.', direction: 'base' },
660
+ { id: 'moderate_system', label: 'System boundary', value: 25, detail: 'Unknown shell command lacks CAVA-specific parser evidence.', direction: 'increase' },
661
+ ]),
529
662
  };
530
663
  }
531
664
 
@@ -555,6 +688,23 @@ function printExplanation(command) {
555
688
  write(c('Decision hints', ANSI.bold));
556
689
  result.notes.forEach((note) => write(` - ${note}`));
557
690
  }
691
+ if (result.breakdown?.components?.length) {
692
+ write('');
693
+ write(c('Score breakdown', ANSI.bold));
694
+ write(` Model ${result.breakdown.model_version}`);
695
+ result.breakdown.components.forEach((component) => {
696
+ const value = component.value ?? component.score ?? '-';
697
+ const sign = typeof value === 'number' && value > 0 && component.direction !== 'base' ? `+${value}` : String(value);
698
+ write(` ${(component.label || component.id).padEnd(18)} ${String(sign).padStart(4)} ${component.detail || ''}`);
699
+ });
700
+ }
701
+ if (result.patterns?.length) {
702
+ write('');
703
+ write(c('CAVA patterns', ANSI.bold));
704
+ result.patterns.forEach((pattern) => {
705
+ write(` - ${pattern.label} (${pattern.severity}): ${pattern.detail}`);
706
+ });
707
+ }
558
708
  }
559
709
 
560
710
  async function doctor() {
@@ -667,6 +817,109 @@ async function decide(actionId, decision, args) {
667
817
  if (result?.action?.status) write(`New status ${result.action.status}`);
668
818
  }
669
819
 
820
+ function printExternalVerifierProvider(provider = {}) {
821
+ const status = provider.enabled ? c('enabled', ANSI.green) : c('disabled', ANSI.yellow);
822
+ write(` ${provider.display_name || provider.provider_id}`);
823
+ write(` id ${provider.provider_id}`);
824
+ write(` status ${status}`);
825
+ write(` mode ${provider.mode || 'off'}`);
826
+ write(` account model ${provider.account_model || 'osuite_managed'}`);
827
+ if (provider.account_id) write(` account id ${provider.account_id}`);
828
+ if (provider.api_key_preview || provider.has_api_key) {
829
+ write(` verifier key ${provider.api_key_preview || 'present'}`);
830
+ }
831
+ if (provider.base_url) write(` endpoint ${provider.base_url}`);
832
+ }
833
+
834
+ function printExternalVerifierStatus(payload = {}) {
835
+ const config = payload.config || {};
836
+ const usage = payload.usage || {};
837
+ write(c('External Verifier Network', `${ANSI.bold}${ANSI.cyan}`));
838
+ write(c('Provider-neutral checkpoint configuration for signed, challengeable proof references.', ANSI.dim));
839
+ write('');
840
+ write(`Workspace state ${config.enabled ? c('enabled', ANSI.green) : c('disabled', ANSI.yellow)}`);
841
+ if (usage.resource) {
842
+ write(`Usage ${usage.current ?? 0} / ${usage.limit ?? 0} ${usage.resource}`);
843
+ }
844
+ write('');
845
+ const providers = Array.isArray(config.providers) ? config.providers : [];
846
+ if (!providers.length) {
847
+ write('No provider has been configured yet.');
848
+ } else {
849
+ providers.forEach(printExternalVerifierProvider);
850
+ }
851
+ if (payload.commands?.cli) {
852
+ write('');
853
+ write(c('Copy-paste setup', ANSI.bold));
854
+ payload.commands.cli.split('\n').forEach((line) => write(` ${line}`));
855
+ }
856
+ }
857
+
858
+ function buildExternalVerifierProviderPayload(args = {}) {
859
+ const providerId = String(args.provider || args._?.[1] || 'babyblue_invinoveritas').trim();
860
+ const mode = String(args.mode || 'shadow').trim();
861
+ const accountModel = String(args['account-model'] || args.accountModel || 'customer_managed').trim();
862
+ const provider = {
863
+ provider_id: providerId,
864
+ enabled: args.enabled === undefined ? true : args.enabled !== 'false',
865
+ mode,
866
+ account_model: accountModel,
867
+ };
868
+ if (args['api-key']) provider.api_key = String(args['api-key']);
869
+ if (args['account-id']) provider.account_id = String(args['account-id']);
870
+ if (args['base-url']) provider.base_url = String(args['base-url']);
871
+ if (args['expected-source-class']) provider.expected_source_class = String(args['expected-source-class']);
872
+ return provider;
873
+ }
874
+
875
+ async function external(args = {}) {
876
+ const subcommand = args._[0] || 'status';
877
+ const client = requireClient();
878
+
879
+ if (subcommand === 'status' || subcommand === 'providers') {
880
+ const payload = await client.getExternalVerifierConfig();
881
+ if (args.json) return write(JSON.stringify(payload, null, 2));
882
+ printExternalVerifierStatus(payload);
883
+ return;
884
+ }
885
+
886
+ if (subcommand === 'configure') {
887
+ const provider = buildExternalVerifierProviderPayload(args);
888
+ const request = {
889
+ enabled: true,
890
+ providers: [provider],
891
+ };
892
+ if (args['dry-run']) {
893
+ write(c('External Verifier Network', `${ANSI.bold}${ANSI.cyan}`));
894
+ write('Dry run: would POST this configuration to Studio.');
895
+ write(JSON.stringify(request, null, 2));
896
+ return;
897
+ }
898
+ const payload = await client.configureExternalVerifier(request);
899
+ write(c('External Verifier Network configured', ANSI.green));
900
+ write(`Provider ${provider.provider_id}`);
901
+ write(`Mode ${provider.mode}`);
902
+ write(`Account model ${provider.account_model}`);
903
+ write('');
904
+ printExternalVerifierStatus(payload);
905
+ return;
906
+ }
907
+
908
+ if (subcommand === 'disable') {
909
+ const providerId = String(args.provider || args._[1] || 'babyblue_invinoveritas');
910
+ const payload = await client.disableExternalVerifier(providerId);
911
+ write(c('External Verifier Network provider disabled', ANSI.yellow));
912
+ write(`Provider ${providerId}`);
913
+ write('');
914
+ printExternalVerifierStatus(payload);
915
+ return;
916
+ }
917
+
918
+ write(`Unknown external verifier command: ${subcommand}`);
919
+ write('Usage: osuite external [status|configure|disable]');
920
+ process.exit(1);
921
+ }
922
+
670
923
  async function init(target = 'generic', args = {}) {
671
924
  write(c('OSuite init', `${ANSI.bold}${ANSI.cyan}`));
672
925
  if (PROJECT_BOOTSTRAPS[target]) {
@@ -800,6 +1053,7 @@ async function main() {
800
1053
  if (command === 'review') return review(args._[0]);
801
1054
  if (command === 'approve') return decide(args._[0], 'allow', args);
802
1055
  if (command === 'deny') return decide(args._[0], 'deny', args);
1056
+ if (command === 'external') return external(args);
803
1057
  if (command === 'connect') return connect(args._[0] || 'auto', args);
804
1058
  if (command === 'init') return init(args._[0] || 'generic', args);
805
1059
 
package/osuite.js CHANGED
@@ -242,6 +242,20 @@ class OSuite {
242
242
  });
243
243
  }
244
244
 
245
+ async getExternalVerifierConfig() {
246
+ return this._request('/api/external-verifiers/config');
247
+ }
248
+
249
+ async configureExternalVerifier(config = {}) {
250
+ return this._request('/api/external-verifiers/config', 'POST', config);
251
+ }
252
+
253
+ async disableExternalVerifier(providerId = 'babyblue_invinoveritas') {
254
+ return this._request('/api/external-verifiers/config', 'DELETE', null, {
255
+ provider: providerId,
256
+ });
257
+ }
258
+
245
259
  async getComplianceEvidence(params = {}) {
246
260
  return this._request('/api/compliance/evidence', 'GET', null, params);
247
261
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osuite",
3
- "version": "2.9.6",
3
+ "version": "2.9.8",
4
4
  "description": "OSuite governed action SDK for AI agents. Approve, replay, prove, and verify runtime decisions.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -37,6 +37,15 @@
37
37
  "guardrails",
38
38
  "osuite"
39
39
  ],
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/OndCo/osuite.git",
43
+ "directory": "sdk"
44
+ },
45
+ "homepage": "https://ond.cc",
46
+ "bugs": {
47
+ "url": "https://github.com/OndCo/osuite/issues"
48
+ },
40
49
  "author": "OSuite",
41
50
  "license": "MIT",
42
51
  "engines": {
package/reviewSurface.js CHANGED
@@ -49,11 +49,14 @@ function normalizeDecisionSummary(action = {}) {
49
49
  const evidence = summary.evidenceConfidence || summary.evidence_confidence || {};
50
50
  const control = summary.controlSummary || summary.control_summary || {};
51
51
  const dimensions = summary.dimensions || summary.scoreDimensions || summary.score_dimensions || [];
52
+ const scoreBreakdown = summary.scoreBreakdown || summary.score_breakdown || {};
52
53
 
53
54
  return {
54
55
  understood,
55
56
  evidence,
56
57
  control,
58
+ scoreModel: summary.scoreModel || summary.score_model || scoreBreakdown.model_version,
59
+ scoreBreakdown,
57
60
  dimensions: asArray(dimensions),
58
61
  missingEvidence: asArray(summary.missingEvidence || summary.missing_evidence),
59
62
  };
@@ -87,6 +90,7 @@ export function buildReviewSurface(action = {}, options = {}) {
87
90
  line('Agent', action.agent_name || action.agent_id),
88
91
  line('Action type', action.action_type),
89
92
  line('Decision', action.effective_decision || action.decision || action.status),
93
+ line('Score model', summary.scoreModel),
90
94
  line('Score', `${scoreText} (${colorize(grade, gradeColor, color)})`),
91
95
  line('OSuite understood', understoodSummary),
92
96
  line('Evidence confidence', evidenceLabel),
@@ -106,6 +110,21 @@ export function buildReviewSurface(action = {}, options = {}) {
106
110
  ]
107
111
  : [];
108
112
 
113
+ const scoreComponents = asArray(summary.scoreBreakdown.components);
114
+ const breakdownLines = scoreComponents.length
115
+ ? [
116
+ '',
117
+ colorize('Score breakdown', BOLD, color),
118
+ ...scoreComponents.map((component) => {
119
+ const label = component.label || component.id || 'component';
120
+ const value = component.value ?? component.score ?? component.contribution ?? '-';
121
+ const sign = typeof value === 'number' && value > 0 && component.direction !== 'base' ? `+${value}` : String(value);
122
+ const reason = component.detail || component.reason || component.summary || '';
123
+ return ` ${label.padEnd(18)} ${String(sign).padStart(4)}${reason ? ` ${colorize(reason, DIM, color)}` : ''}`;
124
+ }),
125
+ ]
126
+ : [];
127
+
109
128
  const missingEvidenceLines = summary.missingEvidence.length
110
129
  ? [
111
130
  '',
@@ -122,6 +141,7 @@ export function buildReviewSurface(action = {}, options = {}) {
122
141
  colorize('Route. Review. Prove.', DIM, color),
123
142
  '',
124
143
  ...rows,
144
+ ...breakdownLines,
125
145
  ...dimensionLines,
126
146
  ...missingEvidenceLines,
127
147
  ...footer,