Add automation inventory surface

This commit is contained in:
2026-07-02 02:15:39 +02:00
parent ffe10f098e
commit 2f55167215
6 changed files with 498 additions and 9 deletions

View File

@@ -4,11 +4,11 @@ type: workplan
title: "Automation schedule inventory Make targets"
domain: infotech
repo: activity-core
status: ready
status: finished
owner: codex
topic_slug: automation-inventory
created: "2026-06-29"
updated: "2026-06-29"
updated: "2026-07-01"
state_hub_workstream_id: "21c73763-9adc-42f6-8fd2-1b8b33c2c770"
---
@@ -45,7 +45,7 @@ coding assistant automation infrastructure.
```task
id: ACTIVITY-WP-0019-T01
status: todo
status: done
priority: high
state_hub_task_id: "8de24590-f9ee-4d0e-8692-b7ada9f232ed"
```
@@ -71,7 +71,7 @@ Acceptance:
```task
id: ACTIVITY-WP-0019-T02
status: todo
status: done
priority: high
state_hub_task_id: "538cb9a5-48f3-470c-8518-29ee66c96678"
```
@@ -98,7 +98,7 @@ Acceptance:
```task
id: ACTIVITY-WP-0019-T03
status: todo
status: done
priority: high
state_hub_task_id: "f2001721-07f3-42f5-a15e-0c7d1b0ed801"
```
@@ -120,7 +120,7 @@ Acceptance:
```task
id: ACTIVITY-WP-0019-T04
status: todo
status: done
priority: medium
state_hub_task_id: "f687743b-3936-413e-ae50-d35484ae9a81"
```
@@ -142,7 +142,7 @@ Acceptance:
```task
id: ACTIVITY-WP-0019-T05
status: todo
status: done
priority: medium
state_hub_task_id: "5317b532-5cef-4eff-b6d8-3e85bbca8e8a"
```
@@ -162,3 +162,43 @@ Acceptance:
than hanging.
- Focused tests pass and the result is recorded in this workplan before the
workplan is moved to `finished`.
## Implementation Result
Completed 2026-07-01: implemented the read-only scheduled automation inventory
surface.
Delivered:
- `scripts/automation_inventory.py` exposes the inventory CLI backed by
`activity_core.automation_status` shared definition and Temporal helpers.
- `make automation-list` and `make automation-list-json` list configured
scheduled ActivityDefinitions with filters for `ENABLED`, `TRIGGER`,
`ACTIVITY_ID`, and `ACTIVITY_NAME`.
- JSON output is script-safe; the Make JSON target suppresses command echo and
recursive make directory chatter.
- `docs/runbook.md` now distinguishes inventory (what is configured) from status
(what happened in a time window).
- Tests cover DB-backed rows, file fallback, disabled filtering, Temporal
unavailable warnings, and JSON CLI output.
Verification:
```bash
/home/worsch/.local/bin/uv run pytest tests/test_automation_status.py tests/test_daily_triage_verifier.py -q
bash -lc 'export PATH="/home/worsch/.local/bin:$PATH"; make automation-list ACTCORE_DB_URL= TEMPORAL_HOST='
bash -lc 'export PATH="/home/worsch/.local/bin:$PATH"; make automation-list-json ACTCORE_DB_URL= TEMPORAL_HOST= > /tmp/activity-core-inventory.json && python3 -m json.tool /tmp/activity-core-inventory.json >/tmp/activity-core-inventory.pretty'
bash -lc 'export PATH="/home/worsch/.local/bin:$PATH"; make automation-list ACTCORE_DB_URL= TEMPORAL_HOST= ENABLED=true TRIGGER=cron'
bash -lc 'export PATH="/home/worsch/.local/bin:$PATH"; make help'
```
Results:
- focused tests: `16 passed`;
- degraded Make inventory run listed 9 file-backed scheduled automations, with
5 enabled and 4 disabled;
- filtered Make run with `ENABLED=true TRIGGER=cron` listed 5 enabled cron
automations;
- `automation-list-json` emitted parseable JSON directly;
- `make help` lists `automation-list` and `automation-list-json`.