fix(ci): correct image digest separator
This commit is contained in:
123
.wave/pipelines/ops-rewrite.yaml
Normal file
123
.wave/pipelines/ops-rewrite.yaml
Normal file
@@ -0,0 +1,123 @@
|
||||
kind: WavePipeline
|
||||
metadata:
|
||||
name: ops-rewrite
|
||||
description: "Analyze and rewrite poorly documented issues"
|
||||
release: true
|
||||
|
||||
skills:
|
||||
- gh-cli
|
||||
- software-design
|
||||
|
||||
requires:
|
||||
tools:
|
||||
- gh
|
||||
|
||||
input:
|
||||
source: cli
|
||||
example: "re-cinq/wave 42 or https://github.com/re-cinq/wave/issues/42"
|
||||
schema:
|
||||
type: string
|
||||
description: "GitHub repo with optional issue number, or full issue URL"
|
||||
|
||||
steps:
|
||||
- id: scan-and-score
|
||||
persona: "gitea-analyst"
|
||||
model: claude-haiku
|
||||
workspace:
|
||||
type: worktree
|
||||
branch: "{{ pipeline_id }}"
|
||||
exec:
|
||||
type: prompt
|
||||
source: |
|
||||
Input: {{ input }}
|
||||
|
||||
Step 1: Parse the input format.
|
||||
- If URL (https://github.com/OWNER/REPO/issues/NUM) → extract <REPO> and <NUM>
|
||||
- If "owner/repo NUM" → extract <REPO> and <NUM>
|
||||
- If "owner/repo" alone → batch mode, use {{ input }} as <REPO>
|
||||
|
||||
Step 2: Fetch issues via {{ forge.cli_tool }}.
|
||||
- Single: {{ forge.cli_tool }} issue view <NUM> --repo <REPO> --json number,title,body,labels,url
|
||||
- Batch: {{ forge.cli_tool }} issue list --repo {{ input }} --limit 10 --json number,title,body,labels,url
|
||||
|
||||
IMPORTANT: If a specific issue number was parsed from the input but the fetch
|
||||
fails (not found, permissions error), STOP. Output JSON with repository set
|
||||
to <REPO>, issues_to_enhance as empty array, and total_to_enhance: 0.
|
||||
Do NOT fall back to batch mode when a specific issue was requested.
|
||||
|
||||
Step 3: Score each issue quality (0-100) on title clarity, description completeness, labels, and acceptance criteria.
|
||||
|
||||
Step 4: For issues scoring below 70, create an enhancement plan with:
|
||||
- suggested_title, body_template (preserving original content), suggested_labels, enhancements list
|
||||
|
||||
Output JSON with repository (owner/repo string), issues_to_enhance array, and total_to_enhance.
|
||||
output_artifacts:
|
||||
- name: enhancement_plan
|
||||
path: .wave/artifact.json
|
||||
type: json
|
||||
required: true
|
||||
retry:
|
||||
policy: none
|
||||
max_attempts: 1
|
||||
handover:
|
||||
contract:
|
||||
type: json_schema
|
||||
schema_path: .wave/contracts/enhancement-plan.schema.json
|
||||
validate: true
|
||||
must_pass: true
|
||||
on_failure: retry
|
||||
allow_recovery: true
|
||||
recovery_level: progressive
|
||||
progressive_validation: false
|
||||
|
||||
- id: apply-enhancements
|
||||
persona: "gitea-enhancer"
|
||||
dependencies: [scan-and-score]
|
||||
memory:
|
||||
inject_artifacts:
|
||||
- step: scan-and-score
|
||||
artifact: enhancement_plan
|
||||
as: impl_plan
|
||||
workspace:
|
||||
type: worktree
|
||||
branch: "{{ pipeline_id }}"
|
||||
exec:
|
||||
type: prompt
|
||||
source: |
|
||||
Read the "repository" field from the plan artifact to get <REPO>.
|
||||
|
||||
For each issue in issues_to_enhance:
|
||||
1. Apply title: {{ forge.cli_tool }} issue edit <NUM> --repo <REPO> --title 'suggested_title'
|
||||
2. Apply body — write to temp file first, then apply:
|
||||
cat > /tmp/issue-body.md <<'BODY_EOF'
|
||||
<body_template content>
|
||||
BODY_EOF
|
||||
{{ forge.cli_tool }} issue edit <NUM> --repo <REPO> --body-file /tmp/issue-body.md
|
||||
3. Add labels: {{ forge.cli_tool }} issue edit <NUM> --repo <REPO> --add-label "label1,label2"
|
||||
4. Capture URL: {{ forge.cli_tool }} issue view <NUM> --repo <REPO> --json url --jq .url
|
||||
|
||||
Output JSON with enhanced_issues (issue_number, success, changes_made, url),
|
||||
total_attempted, total_successful.
|
||||
output_artifacts:
|
||||
- name: enhancement_results
|
||||
path: .wave/artifact.json
|
||||
type: json
|
||||
required: true
|
||||
outcomes:
|
||||
- type: issue
|
||||
extract_from: .wave/artifact.json
|
||||
json_path: .enhanced_issues[*].url
|
||||
label: "Enhanced Issue"
|
||||
retry:
|
||||
policy: none
|
||||
max_attempts: 1
|
||||
handover:
|
||||
contract:
|
||||
type: json_schema
|
||||
schema_path: .wave/contracts/enhancement-results.schema.json
|
||||
validate: true
|
||||
must_pass: true
|
||||
on_failure: retry
|
||||
allow_recovery: true
|
||||
recovery_level: progressive
|
||||
progressive_validation: false
|
||||
Reference in New Issue
Block a user