Fix hera plan-DAG hygiene: orphaned planned nodes + silent materialize retry - #914
Merged
Conversation
…e retry Bug A: heragater polled planned nodes forever after their orchestrator was archived/nuked (ListHeraPlannedNodes never checked the parent). Fixed with a belt-and-braces pair: ArchiveHeraOrchestrator/NukeHeraOrchestrator now cascade-cancel still-planned child roles, and ListHeraPlannedNodes also joins hera_orchestrators to exclude nodes under an ended orchestrator regardless of cause — retroactive with no data migration. Bug B: materializeNode retried a permanently-broken planned node (e.g. blank argus_project) in total silence forever. Fixed with a bounded consecutive-failure counter that escalates to the coordinator once, mirroring holdAndPing's ping-once dedup shape. Never auto-cancels or reconfigures the node — advisory only. Bug C (freelance roles stuck in the rail's flat Freelance section) is confirmed data-hygiene, not a display defect — no code change; see design.md. OpenSpec change fix-hera-plan-dag-hygiene archived in this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
1 task
anutron
added a commit
that referenced
this pull request
Jul 30, 2026
…ollow-up) (#915) Aaron decided (relayed via the hera-leaks coordinator) to cancel planned node 184 ("2a-team" under sherlock-mvp) rather than assign it a project. Folds into the retroactive Part 2 cleanup already planned for fix-hera-plan-dag-hygiene (#914) — no code change, CancelHeraPlannedNode already exists. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
Three independently-verified hera plan-DAG / rail data-hygiene bugs were found live in
~/.argus/data.sql. This PR fixes the two genuine code defects and documents why the third is data-hygiene only.heragaterpolled planned nodes forever after their orchestrator was archived/nuked (ListHeraPlannedNodesnever checked the parent). Fixed with a belt-and-braces pair:ArchiveHeraOrchestrator/NukeHeraOrchestratornow cascade-cancel still-planned child roles, andListHeraPlannedNodesalso joinshera_orchestratorsto exclude nodes under an ended orchestrator regardless of cause — retroactive, no data migration needed for the code fix itself.materializeNoderetried a permanently-broken planned node (e.g. blankargus_project) in total silence, forever. Fixed with a bounded consecutive-failure counter that escalates to the coordinator exactly once, mirroringholdAndPing's ping-once dedup shape. Never auto-cancels or reconfigures the node — advisory only.design.md.OpenSpec change
fix-hera-plan-dag-hygieneis archived in this PR (deltas merged intoopenspec/specs/task-orchestration/spec.md).Part 2 (retroactive DB cleanup) — BLOCKED, needs host execution
The task also asked for a one-shot cleanup of the specific broken rows already in the live
~/.argus/data.sql(cancel planned nodes 343/358, archive freelance roles 813/814, close bindings 803/804 — node 184 intentionally untouched, see the open question below).This hera worker's sandbox has no write access outside its own worktree — confirmed via
EPERMon every attempt, including a plaintouch ~/.argus/_probe.tmp, not just the DB write itself. There is no MCP tool (iris/hera/plannotator) that exposes generic host file/DB access for this. This is a hard, correct security boundary (worker isolation), not something to route around.A ready-to-run, backup-first migration snippet using only pre-existing
internal/dbstore methods (CancelHeraPlannedNode,ArchiveHeraRole,EndHeraBinding— works against current master, no dependency on this branch) has been handed to the coordinator for someone with host access (Aaron) to run. Seehera_sendfor the snippet and exact steps.Test plan
internal/db/hera_plan_test.go: planned node under an archived/nuked orchestrator excluded fromListHeraPlannedNodes, including when the node itself carries nocancelled_at.internal/db/hera_test.go: archiving/nuking cascadescancelled_atto still-planned children; a materialized (bound) child is untouched; an already-archived/cancelled child is left as-is.internal/heragater/heragater_test.go: under-threshold silence, one-time escalation notice at the threshold, no repeat notice, counter/escalation-state clears on success, sweep on node removal.make pre-pr: build/vet/fmt-check/lint-pr clean; vuln gate stdlib-only (advisory, CIcontinue-on-error); test-cover-gate 88.7% filtered (floor 88%) — the twointernal/agentprofile-env test failures are the documented pre-existing hera-worker-sandbox env-contamination artifact (unrelated package, confirmed viago run ./scripts/coverfilteragainst the run's own coverage.out).🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com