Skip to content

test: replace gitignore source assertion with behavioral coverage - #1304

Merged
kunchenguid merged 1 commit into
mainfrom
fm/fm-gitignore-config-behavior-test-r1
Jul 30, 2026
Merged

kunchenguid merged 1 commit into
mainfrom
fm/fm-gitignore-config-behavior-test-r1

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Ship the captain-authorized bounded Firstmate test correction identified by the completed source-content-test audit at /Users/kunchen/github/kunchenguid/firstmate/data/nm-source-content-tests-audit-r1/report.md.

Remove only the brittle source-content assertion added by Firstmate PR 1261 from tests/fm-gitignore-config.test.sh. The test must never inspect .gitignore source bytes, line spelling, regex matches, parser proxies, snapshots, or other implementation-source text. Retain and strengthen real behavior coverage by invoking Git's public check-ignore consumer against generated unpredictable direct and nested paths under config/, plus a generated unrelated-path control that must remain visible. The coverage must accept semantically equivalent ignore patterns such as config/ and config/**, preserve shell portability and existing test style, and include regression counterfactual evidence that it fails when arbitrary config paths become visible while passing with equivalent semantic patterns.

Keep the change limited to tests/fm-gitignore-config.test.sh. Do not edit .gitignore, AGENTS.md, documentation, product code, generated files, unrelated tests, or conduct broader source-content-test cleanup. Follow firstmate-coding-guidelines, run the focused test and relevant repository lint/test checks, and require a clean no-mistakes review, PR, and green CI. Never merge the PR from the worker.

What Changed

  • Replace the .gitignore source-text assertion with behavioral checks through Git's check-ignore interface.
  • Exercise generated direct and nested paths under config/, plus an unrelated-path control that must remain visible.

Risk Assessment

✅ Low: The change is tightly scoped to the requested test, replaces source-text inspection with Git behavior checks, covers generated direct and nested config paths plus an unrelated-path control, and remains compatible with semantically equivalent ignore patterns.

Testing

The focused test passed under Bash 3.2 and the current Bash, while isolated end-to-end Git fixtures proved canonical and equivalent ignore patterns accept generated direct and nested config paths, the generated unrelated control remains visible, and visible arbitrary config paths trigger the expected regression failure.

Evidence: Git ignore semantic matrix

config/ and config/** both passed. With no config ignore rule, the test failed on a generated config/unlisted-key-* path as expected.

CASE: canonical semantic pattern config/
ok - config/ is ignored as a directory, covering unlisted and nested paths
ok - an unrelated path outside config/ remains visible to git
RESULT: PASS

CASE: equivalent semantic pattern config/**
ok - config/ is ignored as a directory, covering unlisted and nested paths
ok - an unrelated path outside config/ remains visible to git
RESULT: PASS

CASE: counterfactual with arbitrary config paths visible
not ok - git does not ignore config/unlisted-key-74752-14478-18949 (config/ must be ignored as a directory)
RESULT: EXPECTED FAILURE

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Inspected git diff e595611291247368b982eb729097c54f2b45aa78..93dc5355be26bfb8be260293bd6217f991e34e18 -- tests/fm-gitignore-config.test.sh
  • bash tests/fm-gitignore-config.test.sh
  • /bin/bash tests/fm-gitignore-config.test.sh using macOS-compatible GNU Bash 3.2.57
  • Ran the committed test unchanged in isolated Git repositories using config/, equivalent config/**, and an unrelated-only ignore rule
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…al coverage

The second assertion in fm-gitignore-config.test.sh (added by #1261) greps
.gitignore for a specific spelling of the config/ ignore pattern. It fails
on a semantically equivalent pattern like config/** and does not prove Git
actually ignores anything, per the completed source-content-test audit.

Replace it with a real git check-ignore control test on a generated
unrelated path, and strengthen the existing directory-coverage test with
generated unpredictable direct and nested config/ paths.
@kunchenguid
kunchenguid merged commit a53ffc1 into main Jul 30, 2026
10 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-gitignore-config-behavior-test-r1 branch July 30, 2026 09:32
quinnbot-ai pushed a commit to quinnbot-ai/firstmate that referenced this pull request Jul 30, 2026
…al coverage (kunchenguid#1304)

The second assertion in fm-gitignore-config.test.sh (added by kunchenguid#1261) greps
.gitignore for a specific spelling of the config/ ignore pattern. It fails
on a semantically equivalent pattern like config/** and does not prove Git
actually ignores anything, per the completed source-content-test audit.

Replace it with a real git check-ignore control test on a generated
unrelated path, and strengthen the existing directory-coverage test with
generated unpredictable direct and nested config/ paths.
quinnbot-ai added a commit to quinnbot-ai/firstmate that referenced this pull request Jul 30, 2026