diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 8c78465..41a8a34 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -78,7 +78,8 @@ workflows// | `createCursorRole` | Needs file system access (code generation, planning) | planner, coder | | `createHermesRole` | Needs shell + tools (testing, reviewing) | tester, reviewer | | `createLlmRole` | Pure LLM reasoning, no tools | analysis roles | -| Direct `Role` | No LLM needed, scripted logic | committer | +| `createRole(hermesAdapter, …)` | Agent role with LLM + shell (branch/commit/push from thread context) | solve-issue committer, publish | +| Direct `Role` | No LLM needed, scripted logic | thin wrappers only | ### Meta Convention @@ -87,7 +88,8 @@ Meta is a **routing signal only** — one boolean per role: - `{ done: boolean }` — coder - `{ approved: boolean }` — reviewer - `{ passed: boolean }` — tester -- `{ success: boolean }` — committer +- `{ committed: boolean }` — committer (solve-issue: branch created, pushed) +- `{ success: boolean }` — publish (PR opened) ### Standard Flow diff --git a/workflows/solve-issue/roles/committer/prompt.ts b/workflows/solve-issue/roles/committer/prompt.ts index dd703ee..18e2a40 100644 --- a/workflows/solve-issue/roles/committer/prompt.ts +++ b/workflows/solve-issue/roles/committer/prompt.ts @@ -22,16 +22,17 @@ In the thread, locate \`---SOLVE_ISSUE_PARSE---\` and \`---SOLVE_ISSUE_REPO---\` ## Steps (in order) 1. \`cd\` to the repo **path** from SOLVE_ISSUE_REPO. -2. Run \`git status\`. There should be **uncommitted** changes from implement. If the tree is clean with nothing to commit, set **committed** to false and explain. -3. Create a feature branch (do not work on the default branch directly): +2. Run \`git rev-parse --abbrev-ref HEAD\` and compare with **defaultBranch** from SOLVE_ISSUE_REPO. Implement leaves changes **uncommitted** on the default branch — you should be on that branch with a dirty working tree. If you are not on the default branch, or the tree is clean with nothing to commit when you expected changes, set **committed** to false and explain (avoids empty PRs from wrong state). +3. Run \`git status\`. There should be **uncommitted** changes from implement. If the tree is clean with nothing to commit, set **committed** to false and explain. +4. Create a feature branch (do not work on the default branch directly): - Name: \`fix/-\` for fixes, or \`feat/-\` if the issue is clearly a feature. - **number** from SOLVE_ISSUE_PARSE. - **slug**: lowercase, hyphens only, short (from issue title words). - Example: \`git checkout -b fix/42-auth-timeout\` -4. \`git add -A\` -5. Write a **conventional commit** message (e.g. \`fix(scope): summary\` or \`feat(scope): summary\`) describing **what** changed and **why**, using the thread (plan + implement context). -6. \`git commit -m ""\` — use a single \`-m\` for a one-line message, or multiple \`-m\` for body paragraphs if needed. -7. \`git push -u origin \` +5. \`git add -A\` +6. Write a **conventional commit** message (e.g. \`fix(scope): summary\` or \`feat(scope): summary\`) describing **what** changed and **why**, using the thread (plan + implement context). +7. \`git commit -m ""\` — use a single \`-m\` for a one-line message, or multiple \`-m\` for body paragraphs if needed. Do **not** pass \`--author\` — always use the repo's local git config identity. +8. \`git push -u origin \` **committed=true** only if you created the branch, committed successfully, and **push** succeeded. diff --git a/workflows/solve-issue/roles/implement/prompt.ts b/workflows/solve-issue/roles/implement/prompt.ts index 8fee642..4260a12 100644 --- a/workflows/solve-issue/roles/implement/prompt.ts +++ b/workflows/solve-issue/roles/implement/prompt.ts @@ -13,7 +13,7 @@ Your cwd is the target repository. 2. Run the project **build** (\`pnpm build\`, \`npm run build\`, etc.) and fix issues until build passes. 3. Multi-step: if you cannot finish this round, explain why and set **done** to false. -Do **not** run \`git checkout -b\`, \`git add\`, \`git commit\`, or \`git push\`. Branching and commits are handled by the **committer** step after you finish. +Do **not** run \`git checkout -b\`, \`git add\`, \`git commit\`, or \`git push\`. **Never** create commits on any branch — branching and commits are handled by the **committer** step after you finish. Then close with JSON: \`\`\`json diff --git a/workflows/solve-issue/roles/publish/prompt.ts b/workflows/solve-issue/roles/publish/prompt.ts index df353f2..a610e8c 100644 --- a/workflows/solve-issue/roles/publish/prompt.ts +++ b/workflows/solve-issue/roles/publish/prompt.ts @@ -23,7 +23,7 @@ Find \`---SOLVE_ISSUE_PARSE---\` and \`---SOLVE_ISSUE_REPO---\` in prior message - **## What** — one short paragraph: what this PR does - **## Why** — one short paragraph: motivation / issue - **## Changes** — bullet list of notable changes - - **## Ref** — the issue link above + - **## Ref** — include one line \`Fixes #\` (same \`number\` from SOLVE_ISSUE_PARSE; closes/links the issue where supported) **and** the issue URL \`https://///issues/\` 4. Create the PR with **tea** (not curl/fetch to Gitea): - \`tea pr create --repo / --base --head --title "" --body \` - You may use a heredoc or a temp file for \`--body\` if the shell requires it; keep the four sections in the body.