fix(pipeline): eliminate conflicting schema injection and clean all prompts#150
Merged
nextlevelshit merged 16 commits intomainfrom Feb 24, 2026
Merged
Conversation
Phase 1 of the interactive control plane. Spawns Claude Code in interactive mode with rich context from completed pipeline runs: run summary, step results, artifact inventory, and workspace paths. Read-only permissions enforced via settings.json. Extension points for Phase 2 (step manipulation) and Phase 3 (cascade control).
Phase 2: StepController with continue, extend, revert, and rewrite operations. Chat workspace now supports analysis and manipulate modes with appropriate permission sets. Slash commands provisioned for manipulate mode. Phase 3: CascadeDetector walks inject_artifacts DAG to find stale downstream steps. Supports mtime-based verification and selective cascade targeting. Works with any pipeline (not just prototype). Closes #147, closes #148
…ision When multiple steps in a shared worktree declare the same output path (e.g., .wave/artifact.json), each step overwrites the previous and the DB records identical absolute paths for all steps. Fix: after confirming a file-based artifact exists, copy it to .wave/artifacts/<step-id>/<name> before DB registration. The injection system keeps using the workspace-relative path, but the DB gets the archived copy which survives subsequent step overwrites. Also removes duplicate DB registration from trackStepDeliverables (writeOutputArtifacts already handles it).
buildStepPrompt unconditionally injected "save to .wave/artifact.json" for any step with a json_schema contract, conflicting with the correct output path from OutputArtifacts. Personas got two conflicting paths and sometimes followed the wrong one (distill step writing to artifact.json instead of convergent-proposals.json). - Remove redundant schema injection block from buildStepPrompt - Convert buildContractPrompt to executor method with security validation - Add loadSecureSchemaContent and sanitizeSchemaContent helpers - Auto-generate "Available Artifacts" section from inject_artifacts - Update all executor/contract tests for new behavior
Strip 130+ violations of CLAUDE.md rule #1 across 24 pipeline YAML files and 12 prompt templates. The executor now handles artifact injection and output path guidance via buildContractPrompt, so prompts no longer need to specify where to read/write. Removed: output path directives, artifact read instructions, inline JSON schema examples, and "matching the contract schema" phrases. Kept: semantic task descriptions and field meaning explanations.
The converge step had an inline JSON example but no contract validation. Add a proper json_schema contract so buildContractPrompt generates the correct output guidance and the executor validates the output.
…tadata buildContractPrompt now generates Output Requirements for any step with output_artifacts, even without a handover contract. This ensures personas always know where to write and in what format (JSON/markdown/text). Previously, steps without a contract got zero output guidance, causing personas to write prose instead of JSON (e.g. gh-issue-impl create-pr).
ClassifyFailure matched "rate limit" as a substring of "rate limiting" in security review content, and claude.go re-scanned ResultContent even on exit code 0 (success). This caused successful steps to be marked as rate-limited when their output mentioned rate limiting as a finding. - Remove exit-code-0 content re-scan in claude.go - Tighten rate limit patterns: "rate limit exceeded", "rate limit reached", "rate limited" instead of bare "rate limit" - Add regression test for security review false positive
Two bugs caused `step "" failed:` errors with empty step ID: 1. executeStep never set execution.States to StateFailed on error (non-matrix path). Only saved to store, leaving in-memory state as StateRunning. Fixed by adding the missing state update. 2. Batch error handler only checked StateFailed/StateRunning but missed StateRetrying. Added StateRetrying to the check and a defensive fallback to use ready[0].ID when no state match is found.
Steps with inject_artifacts now explicitly reference their injected artifacts in the prompt text, preventing personas from attempting to fetch data from external sources when the data is already available locally. Also syncs internal/defaults copies and adds missing validated-findings schema to embedded defaults.
…e prompts" This reverts commit 22c6034.
Tell personas that injected artifacts contain ALL needed data and to read them instead of re-fetching from external sources.
… YAMLs Remove inline output path instructions, artifact read commands, and JSON schema examples from all pipeline step prompts. The executor injects schemas and artifact references automatically.
Replace hardcoded JSON output examples with references to the injected output schema. Wave's executor injects schemas at runtime so prompts must not duplicate them.
CLI commands like gh pr create --body-file need literal artifact paths. Clarify that rule #1 permits these while still forbidding inline schemas.
nextlevelshit
added a commit
that referenced
this pull request
Mar 4, 2026
…d-prompt-cleanup fix(pipeline): eliminate conflicting schema injection and clean all prompts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
buildStepPromptinjected "save to.wave/artifact.json" for any step with ajson_schemacontract, conflicting with the correct path fromoutput_artifacts. Personas got two conflicting instructions and sometimes followed the wrong one (e.g.distillstep writing toartifact.jsoninstead ofconvergent-proposals.json).recinqconverge step had an inline JSON example but no validation. Addedvalidated-findings.schema.jsonand a properhandover.contract.Changes
Executor (core fix)
buildStepPrompt—buildContractPromptis now the single source of truthbuildContractPromptto an executor method with access topathValidatorandinputSanitizerloadSecureSchemaContent/sanitizeSchemaContenthelpers for security-validated schema loadingstep.Memory.InjectArtifactsPrompts (cleanup)
.mdfiles cleanedStats
Test plan
go build ./...— cleango test -race ./...— 22 packages, all passingwave run recinqend-to-end to verify distill step writes to correct path