Skip to content

t1408.3: Add lineage context to worker dispatch prompts#2989

Merged
marcusquinn merged 6 commits intomainfrom
feature/t1408.3-lineage-context
Mar 7, 2026
Merged

t1408.3: Add lineage context to worker dispatch prompts#2989
marcusquinn merged 6 commits intomainfrom
feature/t1408.3-lineage-context

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Mar 6, 2026

Summary

  • Add structured TASK LINEAGE block format for worker dispatch prompts when dispatching subtasks (task IDs with dots like t1408.3)
  • Workers receive parent task description, sibling task descriptions, and scope-focusing rules to prevent drift and duplicate work across parallel workers
  • Covers both regular subtask dispatch and mission feature dispatch

Changes

.agents/tools/ai-assistants/headless-dispatch.md

New "Lineage Context for Subtask Workers" section with:

  • When to include lineage context (subtask detection via dot in task ID)
  • Lineage block format specification (TASK LINEAGE: + LINEAGE RULES:)
  • Shell script for assembling lineage from TODO.md
  • Dispatch prompt template with lineage
  • Worker behavior rules (scope boundary, stub dependencies, PR body lineage section)
  • Integration point for future task-decompose-helper.sh format-lineage (t1408.1)

.agents/scripts/commands/full-loop.md

New Step 1.7 "Parse Lineage Context" for workers to:

  • Detect TASK LINEAGE: block in dispatch arguments
  • Follow 5 worker rules: scope boundary, stub dependencies, no sibling work, PR body lineage section, blocked-by-sibling exit

.agents/scripts/commands/pulse.md

  • Updated regular dispatch rules with lineage context for subtasks (with assembly example)
  • Updated mission feature dispatch with milestone-as-parent lineage context

Task Lineage

This task is part of a decomposed parent task:

  • Parent: t1408 — Recursive task decomposition for dispatch
  • This task: t1408.3 — Add lineage context to worker dispatch prompts
  • Siblings: t1408.1 (classify/decompose helper), t1408.2 (dispatch integration), t1408.4 (batch strategies), t1408.5 (testing)

Cross-task stubs

  • References task-decompose-helper.sh format-lineage as a future integration point (t1408.1) — documented as optional fallback, not a hard dependency

Testing

  • All three modified files pass markdown linting
  • Acceptance criteria pattern sibling tasks|lineage context|ancestor chain verified present in headless-dispatch.md
  • No shell scripts modified (documentation-only change) — no ShellCheck needed

Closes #2986

Summary by CodeRabbit

  • Documentation
    • Expanded lineage context documentation to provide clearer guidance on task relationships and worker coordination
    • Introduced standardized lineage block format for subtask and feature dispatch prompts
    • Added explicit rules to guide worker focus and prevent cross-task duplication

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions bot added the enhancement Auto-created from TODO.md tag label Mar 6, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

Walkthrough

Documentation updates to three dispatch guidance files that introduce structured lineage context blocks for worker prompts. When dispatching subtasks or mission features with parent/sibling relationships, prompts now include parent task descriptions, sibling task listings, and explicit rules to prevent duplication and maintain focus on the current task.

Changes

Cohort / File(s) Summary
Lineage Context Dispatch Guidance
.agents/scripts/commands/full-loop.md, .agents/scripts/commands/pulse.md, .agents/tools/ai-assistants/headless-dispatch.md
Added structured lineage context blocks (parent task, sibling tasks, lineage rules) to worker dispatch prompts. Introduces TASK LINEAGE formatting, "focus only on your specific task" directives, and integration with task-decompose-helper.sh. Expanded headless-dispatch with assembling lineage workflow, dispatch prompt templates with lineage injection, and worker behavior steps for consuming lineage context.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

Siblings work in parallel, yet drift apart— ✨
Now lineage whispers "stay true to your part,"
A structured breadcrumb of kin and of kin,
Keeps workers united from start to the end.
🧬 Focus, coordination, no tangled mess—
Just lineage and rules: decomposed success.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding lineage context to worker dispatch prompts for task t1408.3, which directly matches the PR's primary objective.
Linked Issues check ✅ Passed The PR fully implements the requirements from issue #2986: adds lineage block format with parent/sibling context and focus rules, updates headless-dispatch.md and full-loop.md documentation, and integrates lineage into subtask and mission feature dispatch.
Out of Scope Changes check ✅ Passed All changes are within scope: three markdown documentation files updated to implement lineage context assembly, templates, and worker behavior rules as specified in issue #2986 objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t1408.3-lineage-context

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 05:38:10 UTC 2026: Code review monitoring started
Fri Mar 6 05:38:10 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 05:38:12 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn
Copy link
Owner Author

This PR appears orphaned — no active worker process found and no activity for 6+ hours. Flagging for re-dispatch. If work is still in progress, remove the status:orphaned label.

When dispatching workers for subtasks (task IDs with dots like t1408.3),
dispatchers now include a structured TASK LINEAGE block in the prompt
containing parent task description, sibling task descriptions, and
scope-focusing rules. This prevents scope drift and duplicate work
across parallel workers.

Changes:
- headless-dispatch.md: New 'Lineage Context for Subtask Workers' section
  with format spec, assembly instructions, and worker behavior rules
- full-loop.md: New Step 1.7 for workers to parse and follow lineage
  context including stub dependency and PR body lineage sections
- pulse.md: Updated dispatch templates for both regular subtasks and
  mission features to include lineage blocks when applicable
@marcusquinn marcusquinn force-pushed the feature/t1408.3-lineage-context branch from b0de8a2 to 48b8af2 Compare March 6, 2026 17:09
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 17:09:38 UTC 2026: Code review monitoring started
Fri Mar 6 17:09:38 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 17:09:41 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn
Copy link
Owner Author

The Wait for AI Review Bots check is failing due to a systemic workflow issue — bots are rate-limited and the workflow treats rate-limit notices as non-reviews. Tracked in #3005. This is not a code issue with this PR.

@marcusquinn
Copy link
Owner Author

Re-ran 'Wait for AI Review Bots' check (stale failure from pre-fix workflow). PR #3006 merged the review-bot-gate rate-limit fix — this re-run uses the updated workflow on main.

@marcusquinn
Copy link
Owner Author

Re-triggering review-bot-gate after GH#3007 fix (bidirectional prefix matching for CodeRabbit status context).

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 20:40:51 UTC 2026: Code review monitoring started
Fri Mar 6 20:40:51 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 20:40:54 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 20:42:59 UTC 2026: Code review monitoring started
Fri Mar 6 20:43:00 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 20:43:02 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 20:46:53 UTC 2026: Code review monitoring started
Fri Mar 6 20:46:54 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 20:46:56 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 20:50:59 UTC 2026: Code review monitoring started
Fri Mar 6 20:51:00 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 20:51:02 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn added the skip-review-gate Bypass review-bot-gate check label Mar 6, 2026
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 108 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 6 20:53:13 UTC 2026: Code review monitoring started
Fri Mar 6 20:53:13 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 108

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 108
  • VULNERABILITIES: 0

Generated on: Fri Mar 6 20:53:16 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn removed the skip-review-gate Bypass review-bot-gate check label Mar 6, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

@marcusquinn
Copy link
Owner Author

@coderabbitai review

Review bots were rate-limited when this PR was created (affected: coderabbitai gemini-code-assist). Requesting a review retry.

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

@marcusquinn Sure! Kicking off a fresh review of PR #2989 now. 🚀


🧠 Learnings used
Learnt from: marcusquinn
Repo: marcusquinn/aidevops PR: 0
File: :0-0
Timestamp: 2026-03-03T16:33:18.313Z
Learning: For the marcusquinn/aidevops repository: The daily quality sweep system (pulse-wrapper.sh) should only mention coderabbitai for full codebase review when there are significant changes (Quality Gate failure, +10 issues in one day, etc.), not on every automated sweep with stable metrics.
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/scripts/commands/full-loop.md:
- Around line 418-427: The detection only looks for "TASK LINEAGE:" so the
helper's output ("PROJECT CONTEXT:" and the marker "<-- (this task)") is never
recognized; update the session-start detection that examines ARGUMENTS and sets
HAS_LINEAGE to accept both formats (e.g., look for "TASK LINEAGE:" OR "PROJECT
CONTEXT:" or the "<-- (this task)" marker) or else standardize the helper output
(task-decompose-helper.sh format-lineage) to emit the documented "TASK LINEAGE:"
block; modify the logic that inspects ARGUMENTS and sets HAS_LINEAGE accordingly
so downstream lineage parsing runs for either format.

In @.agents/scripts/commands/pulse.md:
- Around line 326-330: The grep/sed/cut lines that compute PARENT_DESC and
SIBLINGS currently read a bare TODO.md which uses the supervisor CWD; update
these commands to reference the target repository path (e.g., "$path/TODO.md" or
use git -C "$path" for lookups) so PARENT_ID, PARENT_DESC and SIBLINGS are built
from the dispatched repo’s TODO.md rather than the supervisor’s working
directory.

In @.agents/tools/ai-assistants/headless-dispatch.md:
- Around line 665-672: The preferred command shown (`task-decompose-helper.sh
format-lineage "$TASK_ID"`) is incorrect for the current helper (it doesn't
accept a task-id and emits "PROJECT CONTEXT:" not "TASK LINEAGE:"), so revert
this section to use the manual TODO.md assembly as the only supported path for
now (remove or replace the "Preferred" snippet that references format-lineage)
and add a short note saying the helper will be documented here once it accepts
task-id lookup and emits the "TASK LINEAGE:" block; reference the helper script
name (task-decompose-helper.sh), the nonexistent subcommand (format-lineage),
and the manual TODO.md assembly in the doc to make locating the change easy.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 08ae7616-4316-413f-bde8-d775b2eeec77

📥 Commits

Reviewing files that changed from the base of the PR and between 35f34ca and aa0e5ad.

📒 Files selected for processing (3)
  • .agents/scripts/commands/full-loop.md
  • .agents/scripts/commands/pulse.md
  • .agents/tools/ai-assistants/headless-dispatch.md

Comment on lines +418 to +427
If the dispatch prompt contains a `TASK LINEAGE:` block (injected by the pulse or interactive dispatcher for subtasks), parse it at session start. This block tells you your place in a task hierarchy — what the parent task is, what sibling tasks exist, and what your specific scope is.

**Detection:**

```bash
# Check if the dispatch arguments contain lineage context
if echo "$ARGUMENTS" | grep -q "TASK LINEAGE:"; then
HAS_LINEAGE=true
fi
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Accept the helper’s current marker or this parser won’t fire.

Line 424 only detects TASK LINEAGE:, but the current task-decompose-helper.sh format-lineage output uses PROJECT CONTEXT: and <-- (this task). A dispatcher following the documented helper path will never set HAS_LINEAGE, so the new lineage rules are skipped entirely. Please either parse both formats here or align the helper/docs to one canonical block shape.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/commands/full-loop.md around lines 418 - 427, The detection
only looks for "TASK LINEAGE:" so the helper's output ("PROJECT CONTEXT:" and
the marker "<-- (this task)") is never recognized; update the session-start
detection that examines ARGUMENTS and sets HAS_LINEAGE to accept both formats
(e.g., look for "TASK LINEAGE:" OR "PROJECT CONTEXT:" or the "<-- (this task)"
marker) or else standardize the helper output (task-decompose-helper.sh
format-lineage) to emit the documented "TASK LINEAGE:" block; modify the logic
that inspects ARGUMENTS and sets HAS_LINEAGE accordingly so downstream lineage
parsing runs for either format.

Comment on lines +326 to +330
PARENT_ID="${TASK_ID%.*}"
PARENT_DESC=$(grep -E "^- \[.\] ${PARENT_ID} " TODO.md | head -1 \
| sed -E 's/^- \[.\] [^ ]+ //' | sed -E 's/ #[^ ]+//g' | cut -c1-120)
SIBLINGS=$(grep -E "^ - \[.\] ${PARENT_ID}\.[0-9]+" TODO.md \
| sed -E 's/^ - \[.\] ([^ ]+) (.*)/\1: \2/' | sed -E 's/ #[^ ]+//g')
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Build lineage from the target repo, not the supervisor cwd.

This example runs in the pulse supervisor, which dispatches across many repos. Grepping bare TODO.md will read whichever directory the pulse happens to be in, so parent/sibling lineage can come back empty or from the wrong repo. Point the example at "$path/TODO.md" (or use git -C "$path" for the lookup) so the lineage block is assembled from the repo being dispatched.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/commands/pulse.md around lines 326 - 330, The grep/sed/cut
lines that compute PARENT_DESC and SIBLINGS currently read a bare TODO.md which
uses the supervisor CWD; update these commands to reference the target
repository path (e.g., "$path/TODO.md" or use git -C "$path" for lookups) so
PARENT_ID, PARENT_DESC and SIBLINGS are built from the dispatched repo’s TODO.md
rather than the supervisor’s working directory.

Comment on lines +665 to +672
When `task-decompose-helper.sh` (t1408.1) is available, use its `format-lineage` subcommand instead of manual assembly:

```bash
# Preferred: use helper for consistent formatting
LINEAGE_BLOCK=$(task-decompose-helper.sh format-lineage "$TASK_ID")

# Fallback: manual assembly from TODO.md (see above)
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Document the helper exactly as it exists today.

The “preferred” command here does not match the current helper API: task-decompose-helper.sh format-lineage "$TASK_ID" is unsupported, and the helper still emits PROJECT CONTEXT: rather than the TASK LINEAGE: block described above. As written, this path can’t produce the documented format. Please either keep the manual TODO.md assembly as the only supported path for now, or update this section after the helper accepts task-id-based lookup and emits the same block shape.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/tools/ai-assistants/headless-dispatch.md around lines 665 - 672, The
preferred command shown (`task-decompose-helper.sh format-lineage "$TASK_ID"`)
is incorrect for the current helper (it doesn't accept a task-id and emits
"PROJECT CONTEXT:" not "TASK LINEAGE:"), so revert this section to use the
manual TODO.md assembly as the only supported path for now (remove or replace
the "Preferred" snippet that references format-lineage) and add a short note
saying the helper will be documented here once it accepts task-id lookup and
emits the "TASK LINEAGE:" block; reference the helper script name
(task-decompose-helper.sh), the nonexistent subcommand (format-lineage), and the
manual TODO.md assembly in the doc to make locating the change easy.

marcusquinn added a commit that referenced this pull request Mar 7, 2026
When review bots are rate-limited at PR creation time, they post quota
notices instead of formal reviews. The pulse's zero-reviews gate then
blocks the PR indefinitely — bots never come back to retry.

Add a deterministic request-retry command that detects rate-limited bot
comments, posts @coderabbitai review to trigger a retry, and is
idempotent (safe to call every pulse cycle). Validated on PR #2989
which was stuck for 24+ hours due to this gap.
@marcusquinn marcusquinn merged commit 81d382d into main Mar 7, 2026
28 checks passed
@marcusquinn marcusquinn deleted the feature/t1408.3-lineage-context branch March 7, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Auto-created from TODO.md tag status:orphaned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t1408.3: Add lineage context to worker dispatch prompts

1 participant