Skip to content

docs: document malformed .git pointer fallback in agents-config#57

Merged
levifig merged 1 commit into
mainfrom
docs/agents-config-malformed-pointer
May 31, 2026
Merged

docs: document malformed .git pointer fallback in agents-config#57
levifig merged 1 commit into
mainfrom
docs/agents-config-malformed-pointer

Conversation

@levifig

@levifig levifig commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Codex follow-up nit on #53 (SPEC-042 Track A). When .git exists as a file (linked worktree marker) but its contents are unparseable, resolveEffectiveRoot falls back to projectRoot. This is distinct from the "main removed" case #53 fixed — a malformed pointer has no actionable remedy and the resolver is best-effort.

Decision (no behavior change): keep the fallback, document it, lock it down with tests. The planned SQLite/XDG state move further shrinks the residual shadow-config risk window, so investing in a throw path here doesn't pay off.

  • cli/lib/config/agents-config.ts: extend the resolveEffectiveRoot docblock with a new Case-4 paragraph naming the malformed-pointer fallback and the reasoning.
  • cli/lib/config/agents-config.test.ts: 4 new tests covering both malformed shapes (no gitdir: line; non-matching gitdir shape) for loafConfigPath, readLoafConfig, and mergeLoafConfigIntegrations.
  • CHANGELOG.md: bullet under ### Changed in the new [2.0.0-dev.48] section.

Test plan

  • npm run test -- cli/lib/config/agents-config.test.ts — all 17 tests pass (13 prior + 4 new).
  • Diff inspected — no behavior change, only docs/tests/CHANGELOG.

Notes

Releases v2.0.0-dev.48.

@levifig levifig force-pushed the docs/agents-config-malformed-pointer branch 2 times, most recently from 211ee9e to db2d5fe Compare May 31, 2026 19:17
Codex follow-up on #53. When `.git` exists as a file (linked worktree
marker) but its contents are unparseable, `resolveEffectiveRoot` falls
back to `projectRoot`. This is distinct from the "main removed" case #53
fixed (which still throws): a malformed pointer has no actionable
remedy, and the resolver is best-effort.

Extend the Case-3 docblock with a new Case-4 paragraph that names the
behavior and the reasoning, add four targeted tests covering both
malformed shapes (no `gitdir:` line; non-matching gitdir shape), and
record the decision in `CHANGELOG.md` under `[Unreleased] / Changed`.

No behavior change.
@levifig levifig force-pushed the docs/agents-config-malformed-pointer branch from db2d5fe to cf736be Compare May 31, 2026 19:22
@levifig levifig merged commit 6653d3a into main May 31, 2026
1 check passed
@levifig levifig deleted the docs/agents-config-malformed-pointer branch May 31, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant