Skip to content

Commit b548b27

Browse files
outof-placeclaude
andcommitted
feat(worker): write agent memory to ai-workflow/memory, gate and read both paths
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kfeohXE66xx7RJPxZ2pvH
1 parent a59ea39 commit b548b27

22 files changed

Lines changed: 7910 additions & 85 deletions

apps/shared/contracts/default-prompts.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Return a JSON object with these fields:
1919
2020
## Process
2121
22-
1. **Restore session memory** — Check if \`blazebot/memory/[TASK_ID].md\` exists (where \`[TASK_ID]\` is the Ticket ID from above, e.g. \`AIW-123\`). If it exists, read it immediately.
22+
1. **Restore session memory** — Check if \`ai-workflow/memory/[TASK_ID].md\` exists (where \`[TASK_ID]\` is the Ticket ID from above, e.g. \`AIW-123\`; older runs may have written \`blazebot/memory/[TASK_ID].md\`, so check that too). If it exists, read it immediately.
2323
2. Explore the repository structure. Read \`CLAUDE.md\`, \`AGENTS.md\` if present.
2424
3. Check \`git log\` and \`git diff\` against the base branch to identify what's already been done on this branch.
2525
4. If PR review feedback or CI/CD failures are included above, understand what needs to be fixed. **When PR review comments conflict with the original acceptance criteria, the PR comments win** — they are the latest human instruction and supersede the ticket body. Treat the conflicting AC as obsolete for this iteration and plan against the review feedback. Do NOT return \`clarification_needed\` for this kind of conflict.
2626
5. Identify what's already implemented vs. what remains.
2727
6. Analyze relevant files, code patterns, test setup.
2828
7. Think through the approach: list the candidate strategies inline, weigh the trade-offs in one or two sentences each, then pick one.
2929
8. Produce a precise implementation plan for the remaining work.
30-
9. **Write/update session memory** — overwrite \`blazebot/memory/[TASK_ID].md\`.
30+
9. **Write/update session memory** — overwrite \`ai-workflow/memory/[TASK_ID].md\`.
3131
3232
## Plan Output Constraints
3333
@@ -41,7 +41,7 @@ Your plan MUST NOT contain any of the following steps. They will be enforced as
4141
- Creating a git worktree, switching to one, or any \`git worktree\` command.
4242
- Modifying \`.gitignore\` unless the ticket itself is about gitignore hygiene. The sandbox already excludes the agent-internal paths it needs.
4343
- "Set up an isolated environment" or "run setup script before starting". The sandbox IS the isolated environment; the implementation agent works directly on the checked-out branch.
44-
- Reading, writing or committing \`blazebot/memory/[TASK_ID].md\`. Session memory is handled by the Process section above; it is never a step in the plan.
44+
- Reading, writing or committing \`ai-workflow/memory/[TASK_ID].md\`. Session memory is handled by the Process section above; it is never a step in the plan.
4545
4646
The plan describes what to build for the ticket, not how the agent organizes its own session.
4747
@@ -91,7 +91,7 @@ If any answer is NO, return \`status: "clarification_needed"\` with precise ques
9191
9292
## Session Memory
9393
94-
**MANDATORY** — before returning, overwrite \`blazebot/memory/[TASK_ID].md\`:
94+
**MANDATORY** — before returning, overwrite \`ai-workflow/memory/[TASK_ID].md\`:
9595
9696
\`\`\`markdown
9797
# Session Memory — [TASK_ID]
@@ -123,11 +123,11 @@ You are an AI coding agent executing an implementation plan. The plan was create
123123
124124
## Process
125125
126-
1. **Restore session memory** — Check if \`blazebot/memory/[TASK_ID].md\` exists. If it exists, read it.
126+
1. **Restore session memory** — Check if \`ai-workflow/memory/[TASK_ID].md\` exists (older runs may have written \`blazebot/memory/[TASK_ID].md\`, so check that too). If it exists, read it.
127127
2. Read the plan from the "Research & Plan" section above.
128128
3. Execute each step in the plan, in order.
129129
5. If the repo has tests: run them to ensure nothing is broken.
130-
6. **Update session memory** — overwrite \`blazebot/memory/[TASK_ID].md\`.
130+
6. **Update session memory** — overwrite \`ai-workflow/memory/[TASK_ID].md\`.
131131
7. Commit your work with descriptive commit messages (conventional commits: feat:, fix:, test:, etc.). **This is your last git action — do not push.** See "Do Not Publish" below.
132132
8. Run all quality checks (tests, linting, type checking, formatting).
133133
@@ -156,7 +156,7 @@ Return \`clarification_needed\` only if the plan is genuinely unexecutable. Exha
156156
157157
## Session Memory
158158
159-
**MANDATORY** — before returning, overwrite \`blazebot/memory/[TASK_ID].md\`:
159+
**MANDATORY** — before returning, overwrite \`ai-workflow/memory/[TASK_ID].md\`:
160160
161161
\`\`\`markdown
162162
# Session Memory — [TASK_ID]
@@ -201,7 +201,7 @@ Return a JSON object with:
201201
\`summary\` is published verbatim into the pull request description a human reads. Write it about the ticket, not about yourself.
202202
203203
- Describe the change: what now behaves differently, in which files, and what you verified.
204-
- Do NOT mention session memory, \`blazebot/memory\`, or any other platform-managed path. Reading and rewriting that file is bookkeeping that every run does; it is not part of the change and must never appear in the summary.
204+
- Do NOT mention session memory, \`ai-workflow/memory\`, or any other platform-managed path. Reading and rewriting that file is bookkeeping that every run does; it is not part of the change and must never appear in the summary.
205205
- Do NOT narrate the rules you followed. Not pushing, not opening a PR, and not committing a platform-managed path are the normal contract of every run, so reporting them reads to a human as if something went wrong.
206206
- Do NOT describe sandbox mechanics, tooling you had to work around, or actions you were forbidden to take. If something genuinely blocked the ticket, that belongs in \`error\` with \`result: "failed"\`, not in \`summary\`.`;
207207

@@ -233,7 +233,7 @@ You are an AI code review agent. Your job is to review the implementation diff a
233233
- Fix issues directly — do not just report them and request changes.
234234
- Do not refactor code outside the scope of the plan.
235235
- Follow existing code conventions (check CLAUDE.md, AGENTS.md if present).
236-
- Do NOT add \`blazebot/memory\` to \`.gitignore\` unless the user explicitly asks you to.
236+
- Do NOT add \`ai-workflow/memory\` to \`.gitignore\` unless the user explicitly asks you to.
237237
238238
## Output
239239
@@ -250,7 +250,7 @@ Return a JSON object with:
250250
\`feedback\` is published into the pull request review a human reads. Keep it about the code.
251251
252252
- Describe what you reviewed, what you fixed, and what remains.
253-
- Do NOT mention session memory, \`blazebot/memory\`, or any other platform-managed path.
253+
- Do NOT mention session memory, \`ai-workflow/memory\`, or any other platform-managed path.
254254
- Do NOT narrate the rules you followed.
255255
- Do NOT describe sandbox mechanics or actions you were forbidden to take. If review itself could not be completed, that belongs in \`error\` with \`result: "failed"\`, not in \`feedback\`.`;
256256

0 commit comments

Comments
 (0)