fix(sync): no false warnings outside a project; stop the Codex claude-flow re-import loop - #233
Merged
Merged
Conversation
…-flow re-import loop `ak sync` run from a non-project folder (e.g. ~/.claude) reported a hard failure and warnings that were not true, and every sync repeated a Codex repair that never stayed fixed. Project scope: - The AQE embedding projection now uses the enclosing git repository root, the same project gate as every other project writer. Outside a repository only the user Codex target applies; values an earlier version wrote there are relinquished by receipt. The .mcp.json AQE registration is required only in an AQE-initialized project (.agentic-qe/ present). - helperStampStale follows ruflo's own precondition: no hook-handler.cjs means ruflo never refreshes that folder, so it is not stale. - runHelperRefresh reports refreshed/current/failed from ruflo's actual result; a no-op no longer prints "helpers refreshed". - A location with no ruflo helpers gets an info line, not a statusline warning. Helpers and statusline resolve at the repository root. Codex: - Codex's Claude config import (re-run on a schedule, most likely by the desktop app) adds any Claude MCP server whose name Codex lacks, so the deleted legacy [mcp_servers.claude-flow] came back within hours (14 repairs 2026-09-04 → 2026-09-23). The alias is now replaced in place by a disabled placeholder (enabled = false), with backup and verification. The name stays taken, nothing launches, and the placeholder is never a repair target. - Removing a table now also removes its own child tables, instead of leaving an orphaned [mcp_servers.<name>.env]. Docs: ADR-0033, ADR-0055, SETUP.md, UPGRADING.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
ak syncrun from~/.claude(not a git repository) ended with a hard failure, plus warnings that weren't true:✗ AQE embedding projections: … missing registrations~/.claude/.mcp.jsonto register AQE. An earlier sync had also written a stray~/.claude/.claude/settings.local.json.⚠ statusline: no statusline.cjs⚠ statusline: helper stamp still stale after healhook-handler.cjs.✓ ruflo helpers: signed generated helpers refreshedrefreshed: false.[mcp_servers.claude-flow]The Codex loop
Codex keeps a log of its Claude imports (
~/.codex/state_5.sqlite, tableexternal_agent_config_imports). It shows the import re-running about every 12 hours and adding Claude's user-scopeclaude-flowback each time. The repair had run 14 times between 2026-09-04 and 2026-09-23.In Codex's source (
rust-v0.156.1,external-agent-migration/src/config_values.rsmerge_missing_mcp_servers), a server is imported only when Codex has no server with that name. Codex has no setting to turn the import off. The schedule most likely comes from the closed-source desktop app; that part is inferred.Fix
Project scope
paths.repoRoot, the same project gate every other project writer uses..mcp.jsonmust register AQE only in a project where AQE has been set up (.agentic-qe/present).helperStampStalefollows ruflo's own precondition: withouthook-handler.cjs, a folder is not stale. Ruflo's test "is a safe no-op outside a ruflo project" shows the same behavior.runHelperRefreshreturnsrefreshed,currentorfailedbased on what ruflo actually did (either the project result or theglobalresult).refreshRufloHelperskeeps its boolean contract.Codex
codex mcp listshows it asdisabled. The name stays taken, nothing launches, and the placeholder is never itself a repair target:[mcp_servers.<name>.env].Docs: ADR-0033 and ADR-0055 (Updated notes),
docs/SETUP.md,docs/UPGRADING.md.Verification
pnpm run check: exit 0. Tests: 4320 pass, 0 fail, 6 skipped. Lint: 0 errors; the warnings are the same as onmain(71).mainand pass here:.mcp.jsonmust register AQE only in an AQE-initialized repo;codex mcp remove claude-flowcalls and now assert the disabled placeholder.~/.claude, the repository root andsrc/libon the affected machine:~/.claudeit plans only the stray-value cleanup.~/.claude, the statusline is marked absent (info line) and not stale.🤖 Generated with Claude Code