Skip to content

feat(agentic-epic/graph): same-scope epic de-dup + child in-flight guard [po-formulas-software-dev-2eb]#41

Open
ryanholtschneider2 wants to merge 1 commit into
mainfrom
agentic-po-formulas-software-dev-2eb
Open

feat(agentic-epic/graph): same-scope epic de-dup + child in-flight guard [po-formulas-software-dev-2eb]#41
ryanholtschneider2 wants to merge 1 commit into
mainfrom
agentic-po-formulas-software-dev-2eb

Conversation

@ryanholtschneider2

Copy link
Copy Markdown
Owner

Two hardening items from the soloco-kol8q runaway incident:

  1. Same-scope epic de-dup (agentic_epic.py):

    • _scope_fingerprint(): sha1 of first 400 chars of normalized goal text
    • _acquire_scope_guard(): writes a rig-level sentinel file; returns
      conflicting epic_id if another in-progress epic holds the same scope
    • _release_scope_guard(): removes the sentinel on flow exit (finally block)
    • agentic_epic flow: checks the guard before decomposition; returns
      skipped-same-scope when a duplicate fan-out would happen
    • force_replan=True and dry_run bypass the guard (deliberate re-runs)
  2. graph_run child-level in-flight guard (graph.py):

    • _live_flow_run_count(): queries Prefect for Running flow runs tagged
      with issue_id:; returns 0 on error (graceful degradation)
    • _child_is_in_flight(): two-stage check — bead status then Prefect query
    • _dispatch_nodes(): skips any child that is in_progress + has a live
      flow run; adds it to the skipped dict with an 'already in-flight' reason

…ard [po-formulas-software-dev-2eb]

Two hardening items from the soloco-kol8q runaway incident:

1. Same-scope epic de-dup (agentic_epic.py):
   - _scope_fingerprint(): sha1 of first 400 chars of normalized goal text
   - _acquire_scope_guard(): writes a rig-level sentinel file; returns
     conflicting epic_id if another in-progress epic holds the same scope
   - _release_scope_guard(): removes the sentinel on flow exit (finally block)
   - agentic_epic flow: checks the guard before decomposition; returns
     skipped-same-scope when a duplicate fan-out would happen
   - force_replan=True and dry_run bypass the guard (deliberate re-runs)

2. graph_run child-level in-flight guard (graph.py):
   - _live_flow_run_count(): queries Prefect for Running flow runs tagged
     with issue_id:<id>; returns 0 on error (graceful degradation)
   - _child_is_in_flight(): two-stage check — bead status then Prefect query
   - _dispatch_nodes(): skips any child that is in_progress + has a live
     flow run; adds it to the skipped dict with an 'already in-flight' reason
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.

1 participant