Skip to content

execute tasks hardening#12

Open
sequenzia wants to merge 9 commits intomainfrom
execute-tasks-hardening
Open

execute tasks hardening#12
sequenzia wants to merge 9 commits intomainfrom
execute-tasks-hardening

Conversation

@sequenzia
Copy link
Owner

No description provided.

Comprehensive orchestration hardening with structured context schema, event-driven
completion detection, file conflict detection, produces_for prompt injection, retry
escalation, progress streaming, merge validation, and 44 bats tests.

Key changes:
- Define 6-section structured context schema (Project Setup, File Patterns,
  Conventions, Key Decisions, Known Issues, Task History) for execution_context.md
  and per-task context files with automatic compaction at 10+ entries
- Embed full 4-phase execution workflow in task-executor.md (414 lines) with
  verification rules and result file format validation
- Implement event-driven completion detection (watch-for-results.sh with fswatch)
  with adaptive polling fallback (poll-for-results.sh with configurable intervals)
- Create PostToolUse validation hook (validate-result.sh) for result-task-*.md
  files with .invalid rename for failures
- Add pre-wave file conflict detection using regex pattern matching to prevent
  concurrent file edits
- Implement produces_for prompt injection mechanism for upstream task output
  propagation with "CONTEXT FROM COMPLETED DEPENDENCIES" header
- Add 3-tier retry escalation: Standard → Context Enrichment → User Escalation
  with AskUserQuestion for user involvement
- Add progress streaming at session/wave granularity with completion summaries
- Implement post-wave merge validation with auto-repair and force compaction
  logic for execution_context.md
- Create comprehensive bats test suite: 19 tests for validation hook, 14 for
  polling, 11 for watching (44 total, all passing)
- Update create-tasks skill to 9-phase workflow with Phase 6 for produces_for
  relationship detection

Execution results: 16/16 tasks PASS, 0 retries, 75m 50s execution time,
1,276,713 total tokens. All hardening features validated and 44/44 tests passing.
- Add --phase argument to create-tasks for incremental phase generation
- Implement Phase 4: Select Phases with interactive multi-select for 2-3 phases,
  two-step flow for 4+ phases, and merge mode support
- Phase 2: Extract spec_phase metadata from existing tasks for phase-aware merge
- Phase 3: Add Phase Extraction sub-step to parse Section 9 Implementation Plan
  (headers, deliverables, completion criteria, checkpoint gates, cross-references)
- Phase 5: Hybrid phase-aware decomposition from Section 5 features and Section 9
  deliverables with spec_phase/spec_phase_name metadata on every task
- Phase 6: Implement 3-scenario cross-phase dependency handling (current generation,
  prior generation merge mode, missing predecessor phases)
- Phase 8: Add phase annotations to preview (PHASES, PREREQUISITES sections)
- Phase 10: Add phase-related error handling
- Add --phase filtering to execute-tasks with AND logic for --task-group
- Update session ID generation to incorporate phase (multi-tier resolution)
- Update orchestration.md Step 1 and 5.5 for phase filtering and session IDs
- Update dependency-inference.md Section 9 mapping with 3 scenarios
- Verify cross-file consistency: phase numbering (1-10), metadata field names,
  AskUserQuestion option counts (2-4), scenario alignment
- All changes are backward compatible: spec_phase/spec_phase_name omitted when
  no phases exist
New 947-line reference document for understanding and modifying the execute-tasks orchestration engine. Covers:
- 10-step orchestration loop with full procedures
- Wave-based parallelism and topological task sorting
- Pre-wave file conflict detection
- Event-driven completion detection with polling fallback
- Batch result processing and 3-tier retry escalation
- 6-section structured context merge protocol
- Session management and interrupted session recovery
- Hook integration (auto-approve and validation)
- 5 architectural flow diagrams (Mermaid)
- Appendix with environment variables, critical invariants, and modification reference
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