feat(assess): migrate run_assess onto the core contract (#363) #366
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.62) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 258 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.332
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #366"
general
weight: 0.35
bosd
Second step of #363 (stacked on #364 — base is
feat/headless-core-contract; rebase tomasteronce #364 merges). Migrates the first real consumer,assess, onto the core contract.What changes
run_assessis decoupled from the console and fromSystemExit. It now raises typed core errors —ConnectErrorwhen the source Odoo is unreachable,NothingToDoErrorwhen nothing can be assessed — instead of printing an error panel and callingraise SystemExit(1)from inside the library. A programmatic caller (a server, a UI, a test) gets a typed exception it can handle, not a process exit.RunReporter(defaultNullReporter), and drives it throughconnecting→discovering models→assessing, with per-model progress. The console-free core never has to check forNone.internal/reporter.pyaddsConsoleReporter, aRunReporterthat writes progress to stderr so stdout stays the clean report (the same discipline a stdio line-protocol consumer will need).assess_cmdpasses it, and wraps the call:except FluvoError → _show_error_panel(...) + raise SystemExit(exc.exit_code). stdout is unchanged; errors still show the same panel and exit 1.Return type is unchanged (
list[dict]), so existing programmatic callers are unaffected.Design note
A read-only capability is request/response, so the heavy parts of the contract (
RunResultenvelope,CancelToken) aren't load-bearing here — the win forassessis typed errors instead of a librarySystemExit, plus the reporter seam. The fullRunResult/CancelTokenstory lands with the import-engine migration, where long-running, mutating, cancellable work actually needs it.compareis the next read-only consumer (PR 3).Checks
tests/test_assess.py: the twoSystemExiterror-path tests now assert the typed errors; added a reporter-phases test and a CLI-maps-error-to-exit-1 test (CliRunner).