Close WP-0035 and count declared sink evidence in automation status
The status surface queried only four fixed State Hub event types, so bounded-operation evidence (Forgejo prune, CNPG, SBOM) showed evidence=0 despite successful runs. Default queries now include every state-hub-progress event type the definitions' report/evidence sinks declare. Three natural prune fires (2026-09-06/13/20) supply the last missing bounded-operation evidence, so ACTIVITY-WP-0035-T08 and the workplan finish. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: opus Assistant-Process: 241500@bnt-lap001 Assistant-Session: 4a77db80-b523-4a03-83c4-e3da08755c30
This commit is contained in:
parent
6b3c4222dd
commit
0c403d2239
3 changed files with 87 additions and 8 deletions
|
|
@ -150,6 +150,7 @@ def file_definitions() -> list[dict[str, Any]]:
|
|||
"trigger_type": trigger_type,
|
||||
"trigger_config": trigger,
|
||||
"instructions": list(definition.instructions or []),
|
||||
"context_sources": list(definition.context_sources or []),
|
||||
"source": "files",
|
||||
})
|
||||
return sorted(records, key=lambda item: item["name"])
|
||||
|
|
@ -166,7 +167,7 @@ def filter_definitions(definitions: list[dict[str, Any]], ids: list[str], names:
|
|||
]
|
||||
|
||||
|
||||
def progress_event_types(args: argparse.Namespace) -> list[str | None]:
|
||||
def progress_event_types(args: argparse.Namespace, definitions: list[dict[str, Any]] | None = None) -> list[str | None]:
|
||||
raw = args.progress_event_type
|
||||
if raw is None:
|
||||
env_value = os.environ.get("AUTOMATION_STATUS_PROGRESS_EVENT_TYPES")
|
||||
|
|
@ -175,11 +176,31 @@ def progress_event_types(args: argparse.Namespace) -> list[str | None]:
|
|||
"schedule_miss",
|
||||
"ops_inventory_probe",
|
||||
"legacy_meter_weekly_review",
|
||||
*declared_progress_event_types(definitions or []),
|
||||
]
|
||||
values = [item.strip() for item in raw if item and item.strip()]
|
||||
values = list(dict.fromkeys(item.strip() for item in raw if item and item.strip()))
|
||||
return [None if item == "all" else item for item in values]
|
||||
|
||||
|
||||
def declared_progress_event_types(definitions: list[dict[str, Any]]) -> list[str]:
|
||||
"""Event types the definitions' State Hub report/evidence sinks write."""
|
||||
sinks: list[Any] = []
|
||||
for definition in definitions:
|
||||
for instruction in definition.get("instructions") or []:
|
||||
if isinstance(instruction, dict):
|
||||
sinks.extend(instruction.get("report_sinks") or [])
|
||||
for source in definition.get("context_sources") or []:
|
||||
params = source.get("params") if isinstance(source, dict) else None
|
||||
if isinstance(params, dict):
|
||||
raw = params.get("evidence_sinks") or params.get("evidence_sink") or []
|
||||
sinks.extend(raw if isinstance(raw, list) else [raw])
|
||||
found: list[str] = []
|
||||
for sink in sinks:
|
||||
if isinstance(sink, dict) and sink.get("type") == "state-hub-progress" and sink.get("event_type"):
|
||||
found.append(str(sink["event_type"]))
|
||||
return list(dict.fromkeys(found))
|
||||
|
||||
|
||||
def expected_fires(definition: dict[str, Any], window: dict[str, Any]) -> list[str]:
|
||||
cfg = definition.get("trigger_config") or {}
|
||||
if definition.get("trigger_type") == "scheduled":
|
||||
|
|
@ -252,7 +273,7 @@ async def db_definitions(db_url: str) -> list[dict[str, Any]]:
|
|||
try:
|
||||
async with engine.connect() as conn:
|
||||
result = await conn.execute(text(
|
||||
"select id, name, enabled, trigger_type, trigger_config, instructions_json, version "
|
||||
"select id, name, enabled, trigger_type, trigger_config, instructions_json, context_sources, version "
|
||||
"from activity_definitions where trigger_type in ('cron', 'scheduled') order by name"
|
||||
))
|
||||
return [{
|
||||
|
|
@ -262,6 +283,7 @@ async def db_definitions(db_url: str) -> list[dict[str, Any]]:
|
|||
"trigger_type": row["trigger_type"],
|
||||
"trigger_config": dict(row["trigger_config"] or {}),
|
||||
"instructions": list(row["instructions_json"] or []),
|
||||
"context_sources": list(row["context_sources"] or []),
|
||||
"version": row["version"],
|
||||
"source": "db",
|
||||
} for row in result.mappings().all()]
|
||||
|
|
@ -544,7 +566,7 @@ async def build_report(args: argparse.Namespace) -> tuple[dict[str, Any], int]:
|
|||
window,
|
||||
limit=args.progress_limit,
|
||||
timeout_seconds=timeout,
|
||||
event_types=progress_event_types(args),
|
||||
event_types=progress_event_types(args, definitions),
|
||||
)
|
||||
wm_evidence, sources["working_memory"] = load_working_memory_evidence(args.working_memory_dir, window)
|
||||
temporal_by_activity, sources["temporal"] = await load_temporal_visibility(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue