Repository navigation
Made status --check decide .gitignore presence with the writer's CR-blind test - #55
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The shared CR-aware implementation, regression coverage, and lockstep release artifacts are consistent with the repository contracts.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes #45 by aligning status --check with the CRLF-aware .gitignore writer.
Changes:
- Reuses
ignore_file_has_linefor Git policy checks. - Adds unit and end-to-end CRLF regression coverage.
- Updates release artifacts and CR-handling guidance for 0.19.0.
| File | Description |
|---|---|
CHANGELOG.md |
Records the CRLF fix. |
cli/internal/check.sh |
Uses the shared presence test. |
cli/lib/gitignore.sh |
Implements literal, CR-aware line matching. |
cli/tests/e2e-negative.sh |
Covers CRLF lifecycle behavior. |
cli/tests/unit-gitignore.sh |
Tests exact matching and edge cases. |
engine/VERSION |
Advances the engine to 0.19.0. |
intelligence.yaml |
Updates schema and sync package versions. |
intelligence.lock |
Updates locked engine and sync versions. |
intelligence/rules/shell.md |
Corrects CR handling guidance. |
examples/cli-project/intelligence.yaml |
Updates version pins. |
examples/dotnet-api-with-react-frontend/intelligence.yaml |
Updates version pins. |
examples/dotnet-api-with-react-frontend/intelligence.lock |
Updates locked versions. |
examples/go-api/intelligence.yaml |
Updates version pins. |
examples/go-api/intelligence.lock |
Updates locked versions. |
examples/go-api-with-antigravity/intelligence.yaml |
Updates version pins. |
examples/go-api-with-antigravity/intelligence.lock |
Updates locked versions. |
examples/go-api-with-opencode/intelligence.yaml |
Updates version pins. |
examples/go-api-with-opencode/intelligence.lock |
Updates locked versions. |
examples/go-api-with-pi-and-codex/intelligence.yaml |
Updates version pins. |
examples/go-api-with-pi-and-codex/intelligence.lock |
Updates locked versions. |
examples/platform-with-submodules/intelligence.yaml |
Updates version pins. |
examples/platform-with-submodules/intelligence.lock |
Updates locked versions. |
examples/with-remote-skills/intelligence.yaml |
Updates version pins. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Verification - PASShead: 8034dc5 - steps: PR "Verification" section, steps 1-3 (qa_checks: no match, Built from the head commit only:
Negative probes (boundary this change names, beyond the declared steps)
No defects found in the declared steps or the probes. No standing checks applied — profile |
Code review - CLEANhead: 8034dc5 - base: main - files 23, +142/-61 No Critical, Warning, or Suggestion findings. Verified: |
Summary
Closes #45.
status --checkchecked each adapter's.gitignorepatterns with its owngrep -Fqx. On Linux and macOS a CRLF.gitignorekeeps the\ron every line, so present patterns were reported missing, while the.gitignorewriter treats them as present —intelligence initchanged nothing and the finding never cleared. Git Bash on Windows hid it, because MSYSgrepdrops the CR.The writer's presence test,
ignore_file_has_line(cli/lib/gitignore.sh), is now the only one: a Bashreadloop that strips exactly one trailing CR — as Git itself does — compares literally, and handles a last line without a newline.status --checkcalls it for ignore and include patterns. The rule text inintelligence/rules/shell.mdthat claimed "a\ris part of the pattern Git matches" was wrong (Git drops one trailing CR per line; checked on git 2.43 and 2.54) and is corrected, with a pointer to the shared test.Type of change
Public CLI check
intelligence sync(unchanged)Verification
Run on Linux, macOS or WSL — on Git Bash
grephides the CR and the old behaviour cannot be observed. Work in a scratch directory outside this checkout; nothing below moves the checkout or its refs. Lay out this branch's runtime first:mkdir rt && git -C <checkout> archive <this PR's head> cli engine packages | tar -x -C rt, and usebash rt/cli/intelligenceas the CLI.git init projand runinit --targets claudeinproj. Expected: exit 0;status --checkexits 0.proj/.gitignorewith CRLF endings in Bash (while IFS= read -r l; do printf '%s\r\n' "$l"; done < .gitignore > g && mv g .gitignore) and delete itsCLAUDE.mdline. Expected:status --checkexits non-zero and names onlyCLAUDE.mdas missing — not.claude/*or!.claude/settings.json, which are still there.init --no-sync. Expected: exit 0;CLAUDE.mdis back exactly once and every line of.gitignorestill ends in CR;status --checkexits 0. A secondinit --no-syncleaves.gitignorebyte-identical.Automated coverage
e2e-negativesection 15 runs the steps above on a CRLF.gitignorebuilt in Bash; against the oldcheck.shin WSL it fails —status --checkreported three patterns missing and still "3 problem(s)" afterinit.unit-gitignorepinsignore_file_has_line: matches with or without the CR including an unterminated last line, no prefix/substring/glob matching, only one CR stripped, a missing file is false.bash cli/tests/verify.sh(scopeall, run in WSL) printedverify ok.Versioned artifacts
v0.18.1is published, so this selects0.19.0, the version every open release PR sharesCHANGELOG.mdhas its line under## [0.19.0]Notes for reviewers
Other
grep-style presence checks incli/were audited and read LF output the CLI or engine wrote, or validated records; only the.gitignorechecks read a CRLF-capable project file.