Merge pull request #172 from pejmanjohn/contrib/mvanhorn-last30days-skill-41-rename-last30days-output
last30days: finish runtime/report rename after /last30days plugin rename
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# ruff: noqa: E402
|
# ruff: noqa: E402
|
||||||
"""last30days-3 v3.0.0-alpha CLI."""
|
"""last30days v3.0.0 CLI."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ _FUN_LEVELS = {
|
|||||||
def render_compact(report: schema.Report, cluster_limit: int = 8, fun_level: str = "medium") -> str:
|
def render_compact(report: schema.Report, cluster_limit: int = 8, fun_level: str = "medium") -> str:
|
||||||
non_empty = [s for s, items in sorted(report.items_by_source.items()) if items]
|
non_empty = [s for s, items in sorted(report.items_by_source.items()) if items]
|
||||||
lines = [
|
lines = [
|
||||||
f"# last30days-3 v3.0.0-alpha: {report.topic}",
|
f"# last30days v3.0.0: {report.topic}",
|
||||||
"",
|
"",
|
||||||
f"- Date range: {report.range_from} to {report.range_to}",
|
f"- Date range: {report.range_from} to {report.range_to}",
|
||||||
f"- Sources: {len(non_empty)} active ({', '.join(_source_label(s) for s in non_empty)})" if non_empty else "- Sources: none",
|
f"- Sources: {len(non_empty)} active ({', '.join(_source_label(s) for s in non_empty)})" if non_empty else "- Sources: none",
|
||||||
@@ -81,7 +81,7 @@ def render_full(report: schema.Report) -> str:
|
|||||||
# Start with the same header as compact
|
# Start with the same header as compact
|
||||||
non_empty = [s for s, items in sorted(report.items_by_source.items()) if items]
|
non_empty = [s for s, items in sorted(report.items_by_source.items()) if items]
|
||||||
lines = [
|
lines = [
|
||||||
f"# last30days-3 v3.0.0-alpha: {report.topic}",
|
f"# last30days v3.0.0: {report.topic}",
|
||||||
"",
|
"",
|
||||||
f"- Date range: {report.range_from} to {report.range_to}",
|
f"- Date range: {report.range_from} to {report.range_to}",
|
||||||
f"- Sources: {len(non_empty)} active ({', '.join(_source_label(s) for s in non_empty)})" if non_empty else "- Sources: none",
|
f"- Sources: {len(non_empty)} active ({', '.join(_source_label(s) for s in non_empty)})" if non_empty else "- Sources: none",
|
||||||
|
|||||||
@@ -93,12 +93,13 @@ class CliV3Tests(unittest.TestCase):
|
|||||||
def test_slugify_and_emit_output_cover_supported_modes(self):
|
def test_slugify_and_emit_output_cover_supported_modes(self):
|
||||||
report = self.make_report()
|
report = self.make_report()
|
||||||
self.assertEqual("openclaw-vs-nanoclaw", cli.slugify(report.topic))
|
self.assertEqual("openclaw-vs-nanoclaw", cli.slugify(report.topic))
|
||||||
|
self.assertEqual("last30days v3.0.0 CLI.", cli.__doc__)
|
||||||
|
|
||||||
compact = cli.emit_output(report, "compact")
|
compact = cli.emit_output(report, "compact")
|
||||||
json_output = cli.emit_output(report, "json")
|
json_output = cli.emit_output(report, "json")
|
||||||
context = cli.emit_output(report, "context")
|
context = cli.emit_output(report, "context")
|
||||||
|
|
||||||
self.assertIn("# last30days-3 v3.0.0-alpha", compact)
|
self.assertIn("# last30days v3.0.0", compact)
|
||||||
self.assertIn('"topic": "OpenClaw vs NanoClaw"', json_output)
|
self.assertIn('"topic": "OpenClaw vs NanoClaw"', json_output)
|
||||||
self.assertIsInstance(context, str)
|
self.assertIsInstance(context, str)
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class GenerateSynthesisInputsV3Tests(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertEqual(0, result)
|
self.assertEqual(0, result)
|
||||||
output = (compact_dir / "sample.md").read_text()
|
output = (compact_dir / "sample.md").read_text()
|
||||||
self.assertIn("# last30days-3 v3.0.0-alpha: test topic", output)
|
self.assertIn("# last30days v3.0.0: test topic", output)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ def sample_report() -> schema.Report:
|
|||||||
class RenderV3Tests(unittest.TestCase):
|
class RenderV3Tests(unittest.TestCase):
|
||||||
def test_render_compact_includes_cluster_first_sections(self):
|
def test_render_compact_includes_cluster_first_sections(self):
|
||||||
text = render.render_compact(sample_report())
|
text = render.render_compact(sample_report())
|
||||||
self.assertIn("# last30days-3 v3.0.0-alpha: test topic", text)
|
self.assertIn("# last30days v3.0.0: test topic", text)
|
||||||
self.assertIn("## Ranked Evidence Clusters", text)
|
self.assertIn("## Ranked Evidence Clusters", text)
|
||||||
self.assertIn("## Stats", text)
|
self.assertIn("## Stats", text)
|
||||||
self.assertIn("Total evidence: 2 items across 2 sources", text)
|
self.assertIn("Total evidence: 2 items across 2 sources", text)
|
||||||
|
|||||||
Reference in New Issue
Block a user