topos.cli.diagnostics¶
Shared CLI renderers for actionable diagnostics (issues #58 + #63).
Bridges the MCP-only security findings, the allowlist overlay, and the
refactor-suggestion engine into the inspect / evaluate commands.
Building the CPG is lazy (only when SECURE actually has something to report)
and degrades gracefully — a CPG build failure skips the sections, it never
crashes the command.
- topos.cli.diagnostics.collect_findings_and_verdict(path, result, config)[source]
Build security findings (lazily) and the raw/adjusted verdict for path.
- topos.cli.diagnostics.render_security_findings(active, acknowledged, *, indent='')[source]
Print the Security Findings section (issue #58 mockup).
- topos.cli.diagnostics.render_verdict_line(verdict, *, indent='')[source]
Print the raw→adjusted SECURE transition and grade-cap note.
- topos.cli.diagnostics.render_suggestions(suggestions, *, indent='')[source]
Print the Suggestions / Next Steps section, grouped by pillar.
- topos.cli.diagnostics.suggestions_for(result, active)[source]
Convenience wrapper used by the CLI commands.
- topos.cli.diagnostics.finding_to_dict(finding)[source]
- topos.cli.diagnostics.suggestion_to_dict(suggestion)[source]
- topos.cli.diagnostics.acknowledged_to_dict(acknowledged)[source]