mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-20 15:21:30 +02:00
Repo-wide sweep of every user-facing string: frontend components, routes, config and stores; API details and route docs; shared definitions and models; stage config help; report prose; MCP, toolbox, interest and connector text; notification and worker messages. Descriptions that explained, reassured, justified or restated their title are deleted. Confirm dialogs name what is removed and stop. Failed actions read "<Noun> not <verbed>", successes "<Noun> <verbed>". No reader address, no product-as-subject, no em-dashes or parentheticals in prose. Mirrors updated on both sides: EPSS band help, compare refusal reasons, interest labels. Four tests asserting on old wording follow the new text. The rules are condensed into CLAUDE.md under Writing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SK5o8xR96cbSnAfjYSTPSe
57 lines
1.9 KiB
Python
57 lines
1.9 KiB
Python
from __future__ import annotations
|
|
|
|
from reports.base import RenderContext, Section
|
|
from reports.config import SectionConfig, flag, limit
|
|
from shared.definitions.reports import SectionGroup
|
|
from shared.definitions.surface import SURFACE_LABELS, SURFACE_NOUN
|
|
|
|
|
|
class ChangesConfig(SectionConfig):
|
|
list_added: bool = flag(True, title="List added")
|
|
list_gone: bool = flag(True, title="List removed")
|
|
max_items: int = limit(
|
|
20, title="Items listed per dimension", minimum=1, maximum=200
|
|
)
|
|
show_new_findings: bool = flag(True, title="List new findings")
|
|
|
|
|
|
class ChangesSection(Section):
|
|
name = "changes"
|
|
title = "Changes"
|
|
description = "The difference against the previous run."
|
|
group = SectionGroup.SUMMARY.value
|
|
order = 50
|
|
config_model = ChangesConfig
|
|
|
|
def build(self, ctx: RenderContext, cfg: ChangesConfig) -> dict | None:
|
|
if ctx.data.previous_scan is None:
|
|
return {"first_run": True, "rows": [], "new_findings": []}
|
|
rows = [
|
|
{
|
|
"label": SURFACE_LABELS[line.dimension],
|
|
"noun": SURFACE_NOUN[line.dimension][1],
|
|
"added": line.added,
|
|
"gone": line.gone,
|
|
"added_sample": line.added_sample[: cfg.max_items]
|
|
if cfg.list_added
|
|
else [],
|
|
"gone_sample": line.gone_sample[: cfg.max_items]
|
|
if cfg.list_gone
|
|
else [],
|
|
}
|
|
for line in ctx.brief.changes
|
|
]
|
|
new_findings = (
|
|
[f for f in ctx.data.findings if f.is_new][:25]
|
|
if cfg.show_new_findings
|
|
else []
|
|
)
|
|
if not rows and not new_findings:
|
|
return None
|
|
return {
|
|
"first_run": False,
|
|
"rows": rows,
|
|
"new_findings": new_findings,
|
|
"previous": ctx.data.previous_scan,
|
|
}
|