Skip to content

fix(sdd): preserve shared plan constraints in task briefs - #2629

Open
tugrulguner wants to merge 1 commit into
obra:devfrom
tugrulguner:fix/task-brief-global-context-2493
Open

tugrulguner wants to merge 1 commit into
obra:devfrom
tugrulguner:fix/task-brief-global-context-2493

Conversation

@tugrulguner

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the plan's **Spec:** reference, Global Constraints, and Review Focus in every single-file-plan task brief.
  • Copy shared sections verbatim, including nested headings and fenced examples, without copying other tasks or unrelated header sections.
  • Add 13 deterministic regression checks, including the task-start consumer, and register them in the existing test runner.

Closes #2493.

Who is submitting this PR?

Field Value
Your model + version OpenAI gpt-6.1-sol via openai-codex
Harness + version Hermes Agent v0.22.5 (2026.9.24), local bf0203a794a0
All plugins installed Complete same-session inventory: authoring-environment.txt, lines 9–72. MCP catalogs exposed: beehiiv and posthog; neither used for this change.
Human partner who reviewed this diff Not confirmed. This PR does not represent complete human diff review as having occurred.

Human instruction, verbatim: “continue with superpowers then”.

This is an agent-authored fix for another reporter's issue. No maintainer invitation has been received. Those upstream acceptance requirements remain unmet; they are not represented as satisfied by technical testing or the user's submission instruction.

Human-authored summary

Not provided. The technical summary above and this PR body are agent-written, not human-authored.

What problem are you trying to solve?

#2493 documents a mismatch between writing-plans and the brief handed to an implementer: the plan says its Global Constraints apply to every task, but task-brief emits only the numbered task block. The same loss occurs through executing-plans/scripts/task-start. A fresh or compacted executor reading only its brief cannot see requirements such as formal Spanish copy, a Node version floor, or a ban on new runtime dependencies.

This contribution is grounded in a deterministic reproduction of the reporter's example, not a claimed firsthand user session. Against unchanged dev at b58deb3b948d4c305feeac122700100419ee2777, the new suite produces 2 passed, 11 failed because the shared sections/spec reference are absent. With this fix it produces 13 passed, 0 failed.

What does this PR change?

Buffer the relevant pre-task plan metadata in the existing awk extraction pass and emit it once, immediately before the requested task. Section boundaries use heading depth so nested headings remain part of their parent section; CRLF comparisons and closing ATX markers are recognized without rewriting section content. Missing tasks still return exit 3 rather than succeeding with a header-only output.

No skill instructions, model selection, dispatch recipe, workspace naming, or script stdout interfaces are changed.

Is this change appropriate for the core library?

Yes. This repairs the existing shared plan-to-task handoff used by both SDD and inline execution, across project types. It introduces no dependencies or third-party integration.

What alternatives did you consider?

  • Add controller-side instructions to paste constraints at dispatch: leaves task-start and fresh/compacted inline execution dependent on remembering another step.
  • Copy the entire plan preamble: unnecessarily includes unrelated context rather than the explicitly shared requirements and spec reference.
  • Wait for directory plans in Plans as directories (a header file plus one file per task), and a boundary check before each next plan #2340: that proposal prepends 00-header.md for its new directory path, but leaves the existing single-file awk path unchanged. This patch is limited to that existing path and does not compete with the directory-plan implementation.

Does this PR contain multiple unrelated changes?

No. One extraction defect, its regression suite, and a one-line registration in the existing runner. The known atomic-output and broader task-heading/fence-parser issues are not bundled into this change.

Existing PRs

Environments tested

Environment Versions Model
Native macOS shell execution macOS 26.5.2, Bash 3.2.57, Apple Git 2.50.1 None involved in test outputs
Existing Claude Code suite runner, selecting the new shell test Claude Code CLI prerequisite reports 2.1.263; runner invokes Bash No inference session invoked

Commands executed successfully:

bash tests/claude-code/test-task-brief-context.sh
bash tests/claude-code/test-sdd-workspace.sh
bash tests/claude-code/test-executing-plans-scripts.sh
bash tests/claude-code/run-skill-tests.sh --test test-task-brief-context.sh --verbose
bash scripts/lint-shell.sh --strict \
  skills/subagent-driven-development/scripts/task-brief \
  tests/claude-code/test-task-brief-context.sh \
  tests/claude-code/run-skill-tests.sh
git diff --check

The new suite checks shared metadata on early/later tasks, nested sections, CRLF, closing ATX markers, fenced examples, task-local isolation, unchanged legacy extraction, missing-task failure, explicit output paths with spaces, and real task-start output/BASE behavior.

New harness support

Not applicable: no harness added or changed.

Evaluation

Rigor

  • Skills-content pressure testing: not applicable; no SKILL.md content changed.
  • Tested beyond the happy path, including context isolation and missing-task behavior.
  • Did not modify tuned skill wording.
  • Demonstrated the regression suite fails against the exact unchanged dev base in a separate worktree.

Human review

  • A human has reviewed the COMPLETE proposed diff before submission.

This remains unchecked because that review has not been confirmed. Independent technical agent review is not a substitute for human review.

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