[PR #8774] [MERGED] fix(ci): keep the head's Claude Code configuration out of Dottore repairs #8796

Closed
opened 2026-11-07 17:39:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8774
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/hardening-dottore-autofix-settings


📝 Commits (1)

  • 5ef120f fix(ci): keep the head's Claude Code configuration out of Dottore repairs

📊 Changes

3 files changed (+101 additions, -4 deletions)

View changed files

📝 .github/dottore-review/README.md (+3 -3)
📝 .github/workflows/dottore-review.yml (+5 -1)
➕ scripts/regressions/dottore-repair-isolation.regression.mjs (+93 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #8769

Why this change

The Dottore repair job runs Claude Code in the pull request's own checkout, with the small model's API key in that step's environment. In print mode Claude Code skips the workspace trust prompt, so it loaded any Claude Code project settings, hooks and MCP configuration the head contained. --allowedTools only pre-approved the file tools; it did not remove the other tools. So the documented boundary (only file tools, no shell, no GitHub write token) depended on what the head contained. This hardening makes that boundary independent of the head. No linked issue exists yet: one should be opened, or the description should say why there is none, before the PR is submitted.

What changed

  • Nothing that worked before stops working. Repairs still edit files with Read, Edit, Write, Grep and Glob. Two things the head supplies are now ignored: its .claude settings and .mcp.json, and its project CLAUDE.md, which is no longer loaded automatically. The repair prompt already tells the model to read AGENTS.md and CLAUDE.md itself. The autofix.validate step now runs on a tree without the head's .claude and .mcp.json; neither Engine nor Marinara-Agents tracks those files.
  • The repair step removes the head's .claude and .mcp.json before Claude Code starts. It now runs Claude Code with --setting-sources user, --strict-mcp-config, --settings '{"disableAllHooks":true}' and --tools "Read,Edit,Write,Grep,Glob". The pinned 2.1.295 supports all four.
  • The repair patch now leaves out .mcp.json as well as .claude, so removing them never becomes part of the patch.
  • The Dottore README's repair description now says that none of the head's own Claude Code settings, hooks or MCP servers are used.
  • New regression scripts/regressions/dottore-repair-isolation.regression.mjs runs the repair step's real Bash with a stand-in claude. It checks the startup flags, that the head's agent configuration is gone when Claude Code starts, and that the patch contains only the repair.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • After merge, on a test PR with the Dottore autofix box ticked, check in the Actions log that the "Repair the open findings" step still produces a repair ("Autofix: success turns=...") and that the patch is pushed as before.
  • In the same run, check that a repair on a head without .claude or .mcp.json produces the same patch shape as before, with no unexpected deletions, and that autofix.validate still passes.
  • Follow-up after merge: Marinara-Agents pins this workflow by SHA. Open a small Marinara-Agents PR against its staging that bumps the pin in .github/workflows/dottore-review.yml to the merged commit, so its repairs get the same boundary.
  • When the pinned @anthropic-ai/claude-code version is next bumped, check that --setting-sources, --strict-mcp-config, --settings and --tools still exist and behave the same. The regression checks only the arguments, not the CLI's behaviour.

Agent-run checks (for reference; each regression was shown to fail without its fix):

  • git fetch --dry-run; git rev-parse origin/staging; git status: origin/staging is still aed5e3578d and the branch is 1 commit ahead. The working tree is clean.
  • gh api repos/Pasta-Devs/Marinara-Agents/contents/.github/workflows/dottore-review.yml?ref=staging (read-only) + git show 5b19d45dc1:.github/workflows/dottore-re: Confirmed. Agents pins Engine@5b19d45dc1 and passes DOTTORE_SMALL_API_KEY. That commit's repair step has only --allowedTools, so the reviewer's issue 1 holds.
  • node ./scripts/pnpm-runner.mjs build:shared: succeeded
  • node ./scripts/run-regressions.mjs --filter dottore: 8/8 passed
  • Workflow replaced with origin/staging's copy; node ./scripts/run-regressions.mjs --filter dottore-repair-isolation; fixed workflow restored and re-run: FAILED without the fix (visible ['.claude', '.mcp.json']) and PASSED (1/1) with it. git status is clean afterwards.
  • node_modules/.bin/prettier --check scripts/regressions/dottore-repair-isolation.regression.mjs .github/workflows/dottore-review.yml: clean
  • git diff --check origin/staging: clean
  • ruby -ryaml load of dottore-review.yml: parses
  • Earlier round: probe of the pinned @anthropic-ai/claude-code 2.1.295 against a local stub API, with old and new flags: With the new flags no hook ran, no MCP server started, and the tools offered were exactly Edit, Glob, Grep, Read and Write. The reviewer confirmed this independently.
  • TypeScript type-check / pnpm check / pnpm localization:check / eslint: Not run: no package source, TypeScript or client copy changed, and no ESLint config covers scripts/regressions or .github.

Independent adversarial review: changes, 2 issue(s), all addressed in a fix-up pass.

Known limits and risks:

The CLI checks ran against the pinned 2.1.295 on macOS arm64 and by inspecting strings in the linux-x64 build, not on the Actions runner itself. Marinara-Agents runs this workflow pinned to an older Engine commit, so its repairs get this boundary only after its pin is bumped (listed as a follow-up). Further hardening of the repair step is tracked separately. CLAUDE_CODE_SUBPROCESS_ENV_SCRUB was left unset on purpose: in 2.1.295 it changes the permission mode and turns on a subprocess sandbox, and neither effect has been checked for this job. Outside this PR: the relayed request to lower the Otome Hearth outfit show-off affection from +20 to +5 belongs to the otome-forge package in Marinara-Agents, not to this Engine worktree. It was not handled in this step and still needs its own change there.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8774 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/3/2026 **Status:** ✅ Merged **Merged:** 11/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/hardening-dottore-autofix-settings` --- ### 📝 Commits (1) - [`5ef120f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5ef120f6b27bd84247f9af75c945864aef27ab8b) fix(ci): keep the head's Claude Code configuration out of Dottore repairs ### 📊 Changes **3 files changed** (+101 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.github/dottore-review/README.md` (+3 -3) 📝 `.github/workflows/dottore-review.yml` (+5 -1) ➕ `scripts/regressions/dottore-repair-isolation.regression.mjs` (+93 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Closes #8769 ## Why this change The Dottore repair job runs Claude Code in the pull request's own checkout, with the small model's API key in that step's environment. In print mode Claude Code skips the workspace trust prompt, so it loaded any Claude Code project settings, hooks and MCP configuration the head contained. `--allowedTools` only pre-approved the file tools; it did not remove the other tools. So the documented boundary (only file tools, no shell, no GitHub write token) depended on what the head contained. This hardening makes that boundary independent of the head. No linked issue exists yet: one should be opened, or the description should say why there is none, before the PR is submitted. ## What changed - Nothing that worked before stops working. Repairs still edit files with Read, Edit, Write, Grep and Glob. Two things the head supplies are now ignored: its .claude settings and .mcp.json, and its project CLAUDE.md, which is no longer loaded automatically. The repair prompt already tells the model to read AGENTS.md and CLAUDE.md itself. The `autofix.validate` step now runs on a tree without the head's .claude and .mcp.json; neither Engine nor Marinara-Agents tracks those files. - The repair step removes the head's .claude and .mcp.json before Claude Code starts. It now runs Claude Code with `--setting-sources user`, `--strict-mcp-config`, `--settings '{"disableAllHooks":true}'` and `--tools "Read,Edit,Write,Grep,Glob"`. The pinned 2.1.295 supports all four. - The repair patch now leaves out .mcp.json as well as .claude, so removing them never becomes part of the patch. - The Dottore README's repair description now says that none of the head's own Claude Code settings, hooks or MCP servers are used. - New regression scripts/regressions/dottore-repair-isolation.regression.mjs runs the repair step's real Bash with a stand-in claude. It checks the startup flags, that the head's agent configuration is gone when Claude Code starts, and that the patch contains only the repair. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - After merge, on a test PR with the Dottore autofix box ticked, check in the Actions log that the "Repair the open findings" step still produces a repair ("Autofix: success turns=...") and that the patch is pushed as before. - In the same run, check that a repair on a head without .claude or .mcp.json produces the same patch shape as before, with no unexpected deletions, and that `autofix.validate` still passes. - Follow-up after merge: Marinara-Agents pins this workflow by SHA. Open a small Marinara-Agents PR against its staging that bumps the pin in .github/workflows/dottore-review.yml to the merged commit, so its repairs get the same boundary. - When the pinned @anthropic-ai/claude-code version is next bumped, check that `--setting-sources`, `--strict-mcp-config`, `--settings` and `--tools` still exist and behave the same. The regression checks only the arguments, not the CLI's behaviour. Agent-run checks (for reference; each regression was shown to fail without its fix): - `git fetch --dry-run; git rev-parse origin/staging; git status`: origin/staging is still aed5e3578d and the branch is 1 commit ahead. The working tree is clean. - `gh api repos/Pasta-Devs/Marinara-Agents/contents/.github/workflows/dottore-review.yml?ref=staging (read-only) + git show 5b19d45dc1:.github/workflows/dottore-re`: Confirmed. Agents pins Engine@5b19d45dc1 and passes DOTTORE_SMALL_API_KEY. That commit's repair step has only --allowedTools, so the reviewer's issue 1 holds. - `node ./scripts/pnpm-runner.mjs build:shared`: succeeded - `node ./scripts/run-regressions.mjs --filter dottore`: 8/8 passed - `Workflow replaced with origin/staging's copy; node ./scripts/run-regressions.mjs --filter dottore-repair-isolation; fixed workflow restored and re-run`: FAILED without the fix (visible ['.claude', '.mcp.json']) and PASSED (1/1) with it. git status is clean afterwards. - `node_modules/.bin/prettier --check scripts/regressions/dottore-repair-isolation.regression.mjs .github/workflows/dottore-review.yml`: clean - `git diff --check origin/staging`: clean - `ruby -ryaml load of dottore-review.yml`: parses - `Earlier round: probe of the pinned @anthropic-ai/claude-code 2.1.295 against a local stub API, with old and new flags`: With the new flags no hook ran, no MCP server started, and the tools offered were exactly Edit, Glob, Grep, Read and Write. The reviewer confirmed this independently. - `TypeScript type-check / pnpm check / pnpm localization:check / eslint`: Not run: no package source, TypeScript or client copy changed, and no ESLint config covers scripts/regressions or .github. Independent adversarial review: changes, 2 issue(s), all addressed in a fix-up pass. Known limits and risks: The CLI checks ran against the pinned 2.1.295 on macOS arm64 and by inspecting strings in the linux-x64 build, not on the Actions runner itself. Marinara-Agents runs this workflow pinned to an older Engine commit, so its repairs get this boundary only after its pin is bumped (listed as a follow-up). Further hardening of the repair step is tracked separately. CLAUDE_CODE_SUBPROCESS_ENV_SCRUB was left unset on purpose: in 2.1.295 it changes the permission mode and turns on a subprocess sandbox, and neither effect has been checked for this job. Outside this PR: the relayed request to lower the Otome Hearth outfit show-off affection from +20 to +5 belongs to the otome-forge package in Marinara-Agents, not to this Engine worktree. It was not handled in this step and still needs its own change there. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:46 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8796
No description provided.