Skip to content

fix(distillery-sync): reframe prompt imperatively to prevent empty-output runs - #316

Merged
norrietaylor merged 2 commits into
mainfrom
fix/distillery-sync-imperative-prompt
Jun 22, 2026
Merged

fix(distillery-sync): reframe prompt imperatively to prevent empty-output runs#316
norrietaylor merged 2 commits into
mainfrom
fix/distillery-sync-imperative-prompt

Conversation

@norrietaylor

Copy link
Copy Markdown
Owner

Closes #315.

Root cause

distillery-sync failed every scheduled/push run with "No Safe Outputs Generated", and the store + status issue went stale. Not connectivity — the Distillery MCP connected and registered tools. The prompt opened third-person ("This agentic workflow keeps the Distillery knowledge store current… It runs when…"), and the pinned Haiku model read it as a spec handed to it for review:

"I dont see an explicit task request in your message. Are you asking me to: 1. Implement this workflow … Please clarify."

It then ended the turn (num_turns=1, zero tool calls), never calling distillery_* or noop → empty output → failure. Evidence in #315.

Fix (prompt-only; model stays pinned)

  • Open with an imperative, second-person directive: this prompt is the task, perform it now.
  • Headless guardrail: non-interactive run, never ask for clarification, act on the documented deterministic defaults.
  • Mandatory terminal action: always upsert the status issue (every run, including a no-op that records "no changes" + advances the cursor); noop only if genuinely unable to act. Never end a turn with no tool calls and no safe output.

Model remains claude-haiku-4-5; only the embedded prompt text changes in the recompiled lock (verified: no other lock touched, safe-outputs config and engine unchanged).

Verify

  • gh aw compile distillery-sync → 0 errors/0 warnings.
  • Lock diff confined to the prompt heredoc; claude-haiku-4-5 still pinned.

After merge: retag v0.3.0 to deploy to consumers (same flow as #309).

🤖 Generated with Claude Code

…tput runs

The agent (pinned to Haiku) read the third-person prompt as a specification
handed to it for review and replied asking for clarification, making zero
tool calls and no safe output — so every scheduled run failed with "No Safe
Outputs Generated" and the store/status issue went stale.

Reframe the opening as an imperative task with a headless directive (never ask
for clarification on a non-interactive run; act on the documented deterministic
defaults) and require a terminal safe output (always upsert the status issue;
noop only if genuinely unable to act). Model stays pinned to claude-haiku-4-5;
only the embedded prompt text changes in the recompiled lock.

Closes #315

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0143kv2BRrRqGxmVwwHskQtS
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 56b0b698-0c8f-43cd-ae94-0594dd9378cc

📥 Commits

Reviewing files that changed from the base of the PR and between a496231 and 7086545.

📒 Files selected for processing (2)
  • .github/workflows/distillery-sync.lock.yml
  • .github/workflows/distillery-sync.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/distillery-sync.md

📝 Walkthrough

Summary by CodeRabbit

  • Chores

    • Regenerated Distillery sync workflow configuration and lock artifacts with updated metadata and prompt wrapper delimiters.
  • Documentation

    • Updated the Distillery-sync agent instructions to run autonomously and non-interactively, avoid clarification, and always terminate with a “safe output” (using the normal persistent status upsert path, with noop only when truly un-actionable).

Walkthrough

Adds an explicit autonomous/non-interactive directive block to the Distillery-sync agent prompt in both the source instructions markdown and the compiled lockfile. The new text forbids clarification requests, enforces deterministic defaults, and mandates that every agent run terminates with a safe output (status-issue upsert or noop). Here-document delimiter IDs and the lockfile metadata hash are regenerated accordingly.

Changes

Distillery-sync Agent Prompt Hardening

Layer / File(s) Summary
Source instructions: autonomous-agent directive block
.github/workflows/distillery-sync.md
Adds preface notes about the noop safe-output contract, then replaces a single descriptive paragraph with a prescriptive block that mandates non-interactive execution, forbids clarification requests, enforces deterministic defaults, and requires every run to terminate with a safe output (status-issue upsert, or noop only if action is impossible).
Compiled lockfile: regenerated prompt and here-doc delimiters
.github/workflows/distillery-sync.lock.yml
Regenerates the lockfile with a new metadata hash, rebuilt prompt-construction here-document with updated delimiter IDs, an expanded system prompt section mirroring the source instruction changes, and refreshed here-doc boundary markers for Safe Outputs config and MCP gateway config blocks. JSON policy contents for configs remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • norrietaylor/spectacles#191: Directly overlaps with the same Distillery-sync safe-output/status-issue upsert termination path being tightened in this PR.
  • norrietaylor/spectacles#248: Modifies the same embedded Distillery-sync agent prompt, including the safe-output and noop guidance in the same lockfile.
  • norrietaylor/spectacles#291: Regenerates the same prompt/template heredoc boundaries in distillery-sync.lock.yml at the same prompt-generation code level.

Poem

🐇 No more asking "what shall I do?"
The rabbit runs headless, the schedule comes due.
Upsert the issue, or noop if stuck —
Never just sit there and run out of luck!
Autonomous hops, every run complete. 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: reframing the distillery-sync prompt imperatively to prevent empty-output runs.
Description check ✅ Passed The description thoroughly explains the root cause (third-person prompt caused model to ask for clarification), the fix (imperative reframing with headless guardrails), and verification steps.
Linked Issues check ✅ Passed The PR directly addresses all objectives from #315: reframing prompt imperatively, adding headless guardrail, mandating terminal safe-output action, and maintaining model pinning.
Out of Scope Changes check ✅ Passed All changes are scoped to the prompt reframing and safe-outputs configuration. The model remains pinned, no other workflow logic or dependencies were altered.
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
  • Commit unit tests in branch fix/distillery-sync-imperative-prompt

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

The reframed prompt's terminal-action guard may call noop as a last resort, so
it must be in the safe-outputs allowlist (test-safe-output-allowlists.py
contract). Declare it; recompile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0143kv2BRrRqGxmVwwHskQtS
@norrietaylor
norrietaylor merged commit 44b9cb8 into main Jun 22, 2026
13 checks passed
@norrietaylor
norrietaylor deleted the fix/distillery-sync-imperative-prompt branch June 22, 2026 21:18
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.

distillery-sync fails every run: Haiku reads the descriptive prompt as a spec and asks for clarification instead of syncing

1 participant