Skip to content

feat: sub-agent coordination module for Loop 2#72

Merged
fazxes merged 2 commits intomainfrom
feat/sub-agent-coordination
Apr 5, 2026
Merged

feat: sub-agent coordination module for Loop 2#72
fazxes merged 2 commits intomainfrom
feat/sub-agent-coordination

Conversation

@fazxes
Copy link
Copy Markdown
Member

@fazxes fazxes commented Apr 5, 2026

Summary

  • Built nightshift/coordination.py with 8 public functions for pre-wave overlap detection (with prompt injection) and post-wave file conflict detection
  • Added FileOverlap, FileConflict, ConflictReport TypedDicts to types.py
  • Added FILE_REFERENCE_PATTERN regex and COORDINATION_HINT_TEMPLATE to constants.py
  • Wired coordinate_wave() and log_conflicts() into build_feature() wave loop
  • 47 new tests across 10 test classes
  • Coordination is advisory, not blocking -- overlaps generate hints; conflicts are logged but don't fail builds

Tracker Impact

  • Loop 2: 90% -> 100% (sub-agent coordination was the last 0% component)
  • Overall: 87% -> 91%

Tasks

Test plan

  • make check passes (814 tests, all lint/format/mypy clean)
  • All 47 new coordination tests pass
  • No regressions in existing 767 tests
  • Pre-existing integration tests still pass after feature.py wiring

Pre-wave overlap detection with prompt injection and post-wave file
conflict detection for the sub-agent pipeline. Advisory only -- overlaps
generate hints in prompts; conflicts are logged but don't fail builds.

Eight public functions: extract_file_references, detect_overlaps,
generate_coordination_hints, inject_hints, detect_file_conflicts,
format_conflict_report, coordinate_wave, log_conflicts.

47 new tests. Loop 2: 90% -> 100%. Overall: 87% -> 91%.

Task #83. Closes #86 (duplicate).
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0e354dd79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


task_refs: dict[int, set[str]] = {}
for order in wave:
refs: set[str] = set(extract_file_references(order["prompt"]))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude shared prompt boilerplate from overlap detection

detect_overlaps() currently extracts paths from the entire order["prompt"], but work-order prompts include shared repository context (not task-specific targets), so any common path in that boilerplate (for example .github/copilot-instructions.md from build_work_order_prompt) is reported as an overlap for every task in the wave. This creates systematic false-positive hints and drowns out real coordination signals when repos contain slash-based instruction-file paths.

Useful? React with 👍 / 👎.

Comment on lines +127 to +130
for f in tc["files_created"]:
file_to_tasks.setdefault(f, []).append(tc["task_id"])
for f in tc["files_modified"]:
file_to_tasks.setdefault(f, []).append(tc["task_id"])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deduplicate per-task file entries before conflict checks

detect_file_conflicts() appends task_id for both files_created and files_modified without deduplication, then treats len(task_ids) > 1 as a conflict. If one task reports the same file twice (e.g., a newly created file also listed as modified), the function emits a conflict with duplicated IDs like [1, 1] even though only one task touched the file, producing incorrect conflict reports.

Useful? React with 👍 / 👎.

Created tasks #89 (OPERATIONS.md module table sync) and #90
(detect_file_conflicts failed-task scanning) from PR #72 code review.
@fazxes fazxes merged commit a5a3e47 into main Apr 5, 2026
@fazxes fazxes deleted the feat/sub-agent-coordination branch April 5, 2026 09:20
fazxes added a commit that referenced this pull request Apr 9, 2026
When tasks tie on priority, the build operator now prefers the task whose
vision_section targets the lowest-percentage tracker section, preventing
consecutive sessions from advancing only one section while others stagnate.

Closes task #72.
fazxes added a commit that referenced this pull request Apr 9, 2026
When tasks tie on priority and expected tracker impact, the build
operator now prefers the task targeting the lowest-percentage vision
section in TRACKER.md. Rule documented in SKILL.md and GUIDE.md
with a worked example. Advisory only -- no code change required.
fazxes added a commit that referenced this pull request Apr 9, 2026
…reaker

feat: add vision-alignment tiebreaker to task selection (task #72)
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