D31 — Rebase conflict handling: unversioned side registry + degraded marker + guided skill¶
Decision. When git pull --rebase --autostash hits a conflict during SyncIn or SyncOut, Cartographer does NOT lock the KB into a rigid state. Instead:
gitx.PullRebaseAutostashrunsrebase --abortand returns a structured*RebaseConflictError(conflicting files,LocalSHA,RemoteSHA,Remote,Branch).errors.Is(err, ErrRebaseConflict)remainstruefor backward compatibility.gitWrapingitwrap.godetects the*RebaseConflictErrorviaerrors.As, and for each file callskb.RegisterConflict(persisted in<root>/.cartographer/conflicts.json) andkb.MarkDegraded(addsstatus: degradedto the frontmatter, uncommitted — best-effort)..cartographer/is gitignored (added bykb.Initand byensureCartographerDir): the registry is local, unversioned.- The
conflicts_listtool (read-only, not wrapped bygitWrap) exposes the registry to the agent. sync_checkincludes theopen_conflictsfield (count) for the SessionStart hook.- The bundled
kb-conflict-resolveskill guides the agent step by step through reconciliation viaconcept_read+concept_write.
Rationale. A rebase conflict is a normal event in a multi-clone model: locking the KB into a needs-resolution state with Retry-After (per AD8/old design) was too rigid and required privileged tools. The new approach brings conflicts into the agent's domain as first-class data (degraded + registry), without halting operations. Side persistence (outside the git working tree) prevents the registry from showing up in diffs and commits. The degraded marker is reversible: the agent reconciles and rewrites without status: degraded to close the conflict.