docs: document malformed .git pointer fallback in agents-config#57
Merged
Conversation
211ee9e to
db2d5fe
Compare
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.
db2d5fe to
cf736be
Compare
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.
Summary
Codex follow-up nit on #53 (SPEC-042 Track A). When
.gitexists as a file (linked worktree marker) but its contents are unparseable,resolveEffectiveRootfalls back toprojectRoot. 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 theresolveEffectiveRootdocblock 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 (nogitdir:line; non-matching gitdir shape) forloafConfigPath,readLoafConfig, andmergeLoafConfigIntegrations.CHANGELOG.md: bullet under### Changedin 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).Notes
Releases v2.0.0-dev.48.