v6.8 Part 1: integrative-review gate walks transitive descendants (#73) - #16
Merged
jarvis-stark-ops merged 2 commits intoJun 11, 2026
Merged
Conversation
…endants
The v6.7 validation chain (2026-06-10 on hermes-dashboard) exposed
that ``_v6_7_should_spawn_integrative_review`` checked ``task_links
WHERE parent_id = umbrella_id`` — direct children only. The validation
chain shape was:
umbrella → pepper → friday → tony → friday-rem → tony-rev → tchalla
…where each task's parent was the PREVIOUS task, not the umbrella.
The gate saw exactly 1 direct child (Pepper, non-review) → no spawn.
In production today, integrative review at archive does NOT fire for
chains that fan out via task chaining — the common shape.
Closes hermes-jarvis#73.
## Fix
Replace direct-child SQL with a recursive CTE in a new helper
``_v6_7_walk_descendants``. Walks ``task_links`` transitively from
the umbrella down. Cycle-safe (sqlite's recursive CTE with UNION
deduplicates so cyclic graphs don't infinite-loop). Both
``has_review_child`` and ``has_non_review_child`` now consider any
descendant.
The previous fan-out behavior is preserved because direct children
are also transitive descendants.
## Tests
7 new tests in ``TestTransitiveDescendantWalk``:
- chained shape (2026-06-10 validation case) now triggers spawn
- fan-out shape (original v6.7 design) still triggers
- mixed shape (some direct, some chained) triggers
- in-flight chained descendant blocks spawn (existing semantics)
- cyclic links don't infinite-loop
- _v6_7_walk_descendants returns all levels
- _v6_7_walk_descendants empty on orphan umbrella
37/37 in test_v6_7_integrative_review.py pass. 183/183 across v6.7 +
adjacent regression set — zero failures.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…edge-case tests Independent review of the transitive-walk fix flagged three polish items. All addressed: - Docstring claimed "visited set prevents infinite loop" — false (no Python set exists). Cycle safety actually comes from sqlite's UNION dedup in the recursive CTE's working table. Replaced the lying comment and added a note that link_tasks rejects cycles at insert time so this defense is defensive-only. - Return type was bare `list`. Now `list[sqlite3.Row]`. - Added multi-parent caveat to the docstring — schema allows it and the walk is unaware of distinct-umbrella context. 3 new tests for edge cases the reviewer flagged: - test_diamond_shape_dedups_descendant — UNION correctly returns shared diamond-target exactly once. - test_deep_integrative_review_descendant_is_skipped — the title- prefix skip in the gate's iteration works at any depth, not just direct children. The test stubs a deep integrative review with a reject verdict and confirms archive evaluates cleanly without treating the deep IR as a regular review-role descendant. - test_shared_descendant_across_umbrellas_documented — pins the current (accepted) behavior that multi-parent descendants leak across umbrellas, so future readers aren't surprised. Real production chains don't share live descendants across distinct umbrellas. 40/40 in test_v6_7_integrative_review.py pass. Co-Authored-By: Claude Opus 4.7 (1M context) <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
The v6.7 validation chain (2026-06-10 on hermes-dashboard) exposed that the integrative-review-at-archive gate (v6.7 NousResearch#30) walked direct children only and missed the common chained shape:
```
umbrella → pepper → friday → tony → tchalla
```
…where each task's parent is the PREVIOUS task, not the umbrella. The gate saw 1 direct child (Pepper, non-review) → `has_review_child=False` → no spawn. In production today, integrative review at archive does NOT fire for chains that fan out via task chaining — the common shape.
Closes hermes-jarvis#73 (the highest-impact of the 6 v6.8 findings from validation).
Fix
New helper `_v6_7_walk_descendants` uses a recursive CTE on `task_links` to walk transitive descendants. Cycle-safe via sqlite's UNION dedup. Both `has_review_child` and `has_non_review_child` now consider any descendant.
Fan-out behavior preserved (direct children are also transitive descendants).
Tests
7 new tests in `TestTransitiveDescendantWalk`:
37/37 in `test_v6_7_integrative_review.py` pass. 183/183 across full v6.7 regression set — zero failures.
Manual validation
After merge, can manually verify with:
```bash
hermes kanban create "test umbrella" --goal ...
spawn child build, child review chained off build, archive umbrella
integrative review should auto-spawn
```
🤖 Generated with Claude Code