Skip to content

refactor(autocon5): restructure Part 3 automation as one flow per diagram block - #111

Open
davidban77 wants to merge 1 commit into
mainfrom
claude/workshops-part3-lab-commands-yhau3h
Open

refactor(autocon5): restructure Part 3 automation as one flow per diagram block#111
davidban77 wants to merge 1 commit into
mainfrom
claude/workshops-part3-lab-commands-yhau3h

Conversation

@davidban77

Copy link
Copy Markdown
Contributor

Make the Prefect run graph mirror the Part 3 teaching diagram one-to-one:
each block in alert → evidence → policy → action is now a flow, and each
step inside a block is a task.

  • evidence_flow: fetch_sot / fetch_metrics / fetch_logs submitted
    concurrently (independent sources; a retry on one no longer re-fetches
    the other two), then assemble_evidence decodes enums and bundles.
  • policy_flow: the two policy stages become visible tasks —
    evaluate_sot_gate always runs, evaluate_metrics_gate only when stage 1
    doesn't short-circuit, then annotate_decision writes the audit record.
  • action_flow: AI narrative (ai_rca / ai_rca_skipped) plus the
    deterministic quarantine + annotate_action on proceed only.
  • quarantine_bgp_flow shrinks to pure orchestration; audit-record labels,
    decision values, and the flow's return shape are unchanged, so the
    guide's LogQL queries and try-it checks keep working as-is.

The block subflows carry the same device/peer parameters as the parent,
so nobs autocon5 cycle's flow-runs panel would have flooded with rows;
it now resolves each subflow's parent via the Prefect task-run linkage
and renders children indented under their quarantine_bgp run, falling
back to the flat list if the lookup fails.

Verified offline against an ephemeral Prefect 3 server with the SDK's
HTTP clients mocked: proceed, maintenance-skip (incl. ai_rca_skipped),
and resolved paths all complete with the expected audit records.

https://claude.ai/code/session_01Dn67fTBA32o1Hsyg3HYthf

…gram block

Make the Prefect run graph mirror the Part 3 teaching diagram one-to-one:
each block in alert → evidence → policy → action is now a flow, and each
step inside a block is a task.

- evidence_flow: fetch_sot / fetch_metrics / fetch_logs submitted
  concurrently (independent sources; a retry on one no longer re-fetches
  the other two), then assemble_evidence decodes enums and bundles.
- policy_flow: the two policy stages become visible tasks —
  evaluate_sot_gate always runs, evaluate_metrics_gate only when stage 1
  doesn't short-circuit, then annotate_decision writes the audit record.
- action_flow: AI narrative (ai_rca / ai_rca_skipped) plus the
  deterministic quarantine + annotate_action on proceed only.
- quarantine_bgp_flow shrinks to pure orchestration; audit-record labels,
  decision values, and the flow's return shape are unchanged, so the
  guide's LogQL queries and try-it checks keep working as-is.

The block subflows carry the same device/peer parameters as the parent,
so `nobs autocon5 cycle`'s flow-runs panel would have flooded with rows;
it now resolves each subflow's parent via the Prefect task-run linkage
and renders children indented under their quarantine_bgp run, falling
back to the flat list if the lookup fails.

Verified offline against an ephemeral Prefect 3 server with the SDK's
HTTP clients mocked: proceed, maintenance-skip (incl. ai_rca_skipped),
and resolved paths all complete with the expected audit records.

https://claude.ai/code/session_01Dn67fTBA32o1Hsyg3HYthf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants