Implement BDEF v1.1 grading: scoring core, per-deck pipeline, ledger, dashboard, StartOS layer

- Deterministic scoring.py (quant 60 / qual 40 / flags -15, profitability heaviest)
- Per-company JSON ledger with forecast-target chaining deck N-1 -> N
- Single-shot sandbox agent with guided-JSON fallback ladder (no tool loop)
- Portfolio dashboard with sparklines, KPI hit rates, BDEF category bars
- 48 unit tests green; endpoints smoke-tested; npm check+build green

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jonathan Kirkwood
2026-07-06 14:15:12 -05:00
co-authored by Claude Fable 5
parent 1dde915540
commit b1d7aed9f4
48 changed files with 4907 additions and 971 deletions
+21 -14
View File
@@ -2,17 +2,18 @@ import { startSdk } from '@start9labs/start-sdk'
import { sdk } from '../sdk'
/**
* Returns the latest report as a copyable result, so you can read it straight
* from the StartOS service page without opening the Web UI. The job runner saves
* the most recent report (consolidated if synthesis is on, else the panel
* digest) to /data/reports/latest.md on the StartOS host — no Spark round-trip.
* Returns the latest scorecard as a copyable result, so you can read it straight
* from the StartOS service page without opening the dashboard. The job runner
* saves the most recent scorecard to /data/reports/latest-scorecard.md (with
* /data/reports/latest.md as the legacy fallback) on the StartOS host — no
* Spark round-trip.
*/
export const latestReport = sdk.Action.withoutInput(
'latest-report',
export const latestScorecard = sdk.Action.withoutInput(
'latest-scorecard',
async ({ effects }) => ({
name: 'View Latest Report',
description: 'Show the most recent review report produced by the panel.',
name: 'View Latest Scorecard',
description: 'Show the most recent deck scorecard produced by the grading panel.',
warning: null,
allowedStatuses: 'any',
group: null,
@@ -32,19 +33,25 @@ export const latestReport = sdk.Action.withoutInput(
const { stdout } = await startSdk.runCommand<typeof sdk.manifest>(
effects,
{ imageId: 'main' },
['sh', '-c', 'cat /data/reports/latest.md 2>/dev/null || echo "(no report yet — drop documents in the inbox and run a review)"'],
[
'sh',
'-c',
'cat /data/reports/latest-scorecard.md 2>/dev/null || ' +
'cat /data/reports/latest.md 2>/dev/null || ' +
'echo "(no scorecard yet — drop decks into inbox/<company-slug>/ and run Grade Decks)"',
],
{ mounts, env: { BM_DATA_DIR: '/data' } },
'latest-report',
'latest-scorecard',
)
report = (stdout?.toString() || '').trim() || '(no report yet)'
report = (stdout?.toString() || '').trim() || '(no scorecard yet)'
} catch (e: any) {
report = 'Could not read report: ' + (e?.message || String(e))
report = 'Could not read scorecard: ' + (e?.message || String(e))
}
return {
version: '1',
title: 'Latest Boardroom Map Report',
message: 'The panel\'s most recent review.',
title: 'Latest Scorecard',
message: 'The panel\'s most recent deck scorecard.',
result: { type: 'single', value: report, copyable: true, qr: false, masked: false },
}
},