refactor(autocon5): restructure Part 3 automation as one flow per diagram block - #111
Open
davidban77 wants to merge 1 commit into
Open
refactor(autocon5): restructure Part 3 automation as one flow per diagram block#111davidban77 wants to merge 1 commit into
davidban77 wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
concurrently (independent sources; a retry on one no longer re-fetches
the other two), then assemble_evidence decodes enums and bundles.
evaluate_sot_gate always runs, evaluate_metrics_gate only when stage 1
doesn't short-circuit, then annotate_decision writes the audit record.
deterministic quarantine + annotate_action on proceed only.
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