Skip to content

fix(sdd-apply): move Executor Override before Orchestrator Gate#1105

Open
chrisssp wants to merge 1 commit into
Gentleman-Programming:mainfrom
chrisssp:fix/sdd-apply-executor-override-order
Open

fix(sdd-apply): move Executor Override before Orchestrator Gate#1105
chrisssp wants to merge 1 commit into
Gentleman-Programming:mainfrom
chrisssp:fix/sdd-apply-executor-override-order

Conversation

@chrisssp

@chrisssp chrisssp commented Jul 10, 2026

Copy link
Copy Markdown

🔗 Linked Issue

Closes #721


🏷️ PR Type

What kind of change does this PR introduce?

  • type:bug — Bug fix (non-breaking change that fixes an issue)
  • type:feature — New feature (non-breaking change that adds functionality)
  • type:docs — Documentation only
  • type:refactor — Code refactoring (no functional changes)
  • type:chore — Build, CI, or tooling changes
  • type:breaking-change — Breaking change (fix or feature that changes existing behavior)

📝 Summary

The Executor Override block in skills/sdd-apply/SKILL.md was placed after the ORCHESTRATOR GATE. LLMs are autoregressive — they process instructions sequentially. When the sdd-apply sub-agent reads the skill, the first imperative instruction it encounters is "STOP. Delegate to the dedicated sdd-apply sub-agent". By the time it reaches the Executor Override (which says the gate does NOT apply), it has already locked onto the delegate action.

This causes the sub-agent to attempt self-delegation, resulting in loops or no action taken.

The fix moves the Executor Override above the ORCHESTRATOR GATE so the sub-agent reads "you are the executor — execute" before encountering the gate instruction. The internal reference is also updated ("the gate above" → "the gate below").


📂 Changes

File / Area What Changed
internal/assets/skills/sdd-apply/SKILL.md Moved ## Executor Override block above ORCHESTRATOR GATE; updated "the gate above" → "the gate below"

🧪 Test Plan

Unit Tests

go test ./...

E2E Tests (Docker required)

cd e2e && ./docker-test.sh
  • Unit tests pass (go test ./...)
  • E2E tests pass (cd e2e && ./docker-test.sh) — Ubuntu: 79 passed, 0 failed, 2 skipped
  • Manually tested locally

🤖 Automated Checks

The following checks run automatically on this PR:

Check Status Description
Check PR Cognitive Load PR should stay within 400 changed lines (additions + deletions) or use size:exception
Check Issue Reference PR body must contain Closes/Fixes/Resolves #N
Check Issue Has status:approved Linked issue must have been approved before work began
Check PR Has type:* Label Exactly one type:* label must be applied
Unit Tests go test ./... must pass
E2E Tests cd e2e && ./docker-test.sh must pass

✅ Contributor Checklist

  • PR is linked to an issue with status:approved
  • PR stays within 400 changed lines, or I have requested/obtained maintainer-applied size:exception with rationale documented
  • I have added the appropriate type:* label to this PR (needs maintainer to add via UI)
  • Unit tests pass (go test ./...)
  • E2E tests pass (cd e2e && ./docker-test.sh)
  • I have updated documentation if necessary
  • My commits follow Conventional Commits format
  • My commits do not include Co-Authored-By trailers

💬 Notes for Reviewers

E2E tests ran successfully in Docker (Ubuntu: 79 passed, 0 failed, 2 skipped). The change is purely a Markdown block reordering inside an embedded skill asset — no Go code or behavioral logic was modified.

The Executor Override block was placed after the ORCHESTRATOR GATE,
causing LLMs to process the delegation instruction first (due to
autoregressive decoding) before reaching the override that tells
them they ARE the executor.

Moving the override above the gate ensures the sub-agent reads
'you are the executor — execute' before encountering the gate,
preventing self-delegation loops.

Closes Gentleman-Programming#721
Copilot AI review requested due to automatic review settings July 10, 2026 22:54
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The sdd-apply skill now places the executor override before the orchestrator gate and clarifies that the dedicated sub-agent should execute the phase without delegating or invoking the Skill tool.

Changes

sdd-apply execution gating

Layer / File(s) Summary
Executor override and orchestrator gate ordering
internal/assets/skills/sdd-apply/SKILL.md
The executor instruction appears before the orchestrator gate and explicitly reiterates executor-only behavior, including continuing phase work without delegation or Skill tool calls.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: type:bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change matches issue #721 by reordering the override above the gate and updating the gate reference accordingly.
Out of Scope Changes check ✅ Passed The PR only adjusts the sdd-apply skill markdown ordering and wording, with no unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change: moving the Executor Override before the Orchestrator Gate.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Reorders the sdd-apply skill’s front-matter instructions so the Executor Override is read before the ORCHESTRATOR GATE, preventing the executor sub-agent from incorrectly self-delegating due to instruction ordering.

Changes:

  • Moved ## Executor Override above the ORCHESTRATOR GATE block in internal/assets/skills/sdd-apply/SKILL.md.
  • Updated wording from “gate above” to “gate below” to match the new ordering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/assets/skills/sdd-apply/SKILL.md`:
- Line 14: Change the “Executor Override” heading in SKILL.md from ATX syntax to
the repository’s configured setext heading style, unless ATX headings are
intentionally supported; in that case, update the markdownlint MD003
configuration accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 12936d4e-bd07-4bb9-be52-9ee1756ffe1d

📥 Commits

Reviewing files that changed from the base of the PR and between 4bd9af7 and d3f0866.

📒 Files selected for processing (1)
  • internal/assets/skills/sdd-apply/SKILL.md

delegate_only: true
---

## Executor Override

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the configured Markdown heading style.

## Executor Override triggers markdownlint MD003 because this repository expects setext headings. Convert it to the configured style, or update the markdownlint configuration if ATX headings are intentional.

Suggested fix
-## Executor Override
+Executor Override
+-----------------
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Executor Override
Executor Override
-----------------
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 14-14: Heading style
Expected: setext; Actual: atx

(MD003, heading-style)

🪛 SkillSpector (2.3.7)

[error] 1: [P2] Hidden Instructions: Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Remediation: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.

(Prompt Injection (P2))


[error] 276: [P2] Hidden Instructions: Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Remediation: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.

(Prompt Injection (P2))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/assets/skills/sdd-apply/SKILL.md` at line 14, Change the “Executor
Override” heading in SKILL.md from ATX syntax to the repository’s configured
setext heading style, unless ATX headings are intentionally supported; in that
case, update the markdownlint MD003 configuration accordingly.

Source: Linters/SAST tools

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.

fix(sdd-apply): Executor Override is ignored because ORCHESTRATOR GATE precedes it — sub-agent still loops delegating to itself

2 participants