Skip to content

fix(start): suggest gate commands only from exactly named files (#249, #251) - #252

Merged
memtomem merged 1 commit into
mainfrom
fix/249-251-case-and-flaky
Nov 4, 2026
Merged

memtomem merged 1 commit into
mainfrom
fix/249-251-case-and-flaky

Conversation

@memtomem

@memtomem memtomem commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Closes #249
Closes #251

What changes

syncmill start gate discovery (#249)

  • discover_gate_commands opened its well-known files by name. On a case-insensitive filesystem (the macOS default), opening makefile found Makefile, so a repository with only a Makefile showed make test as coming from makefile. The same applied to the other files: PACKAGE.JSON was read as package.json.
  • It now lists the repository root once (os.scandir) and reads a file only when a directory entry has exactly its name. This covers pyproject.toml, package.json, GNUmakefile/makefile/Makefile (still in GNU make's order), Cargo.toml and go.mod.
  • Each suggestion now names a file that is on disk, and the result is the same on every filesystem. A file stored under another capitalization is no longer suggested from on macOS, as on Linux. The existing _read safeguards (regular file, no symlink, bounded read) are unchanged.
  • CHANGELOG: one Fixed entry under Unreleased.

Flaky TUI test (#251)

  • test_details_and_compare_share_wording_with_the_cli_json checked the raw apply-blocker string inside the Details text. The blocker carries git's stderr. On a runner where git stops at a filesystem boundary that stderr is two lines; Details escapes the newline as \x0a, so the raw string no longer matched. That is the 3.14 failure on Send approved project lessons to Room rounds (#174) #250.
  • The test now pins the source-check failure (repository_fingerprint raises a one-line or a two-line reason). It checks that the JSON keeps the raw reason and that Details shows each blocker as one escaped line (printable_name). Test-only, so no CHANGELOG entry.

Tests

  • test_discovery_names_the_makefile_as_it_is_stored (Makefile / makefile / GNUmakefile) and test_discovery_ignores_a_file_whose_name_differs_only_in_case (5 files). Both make opening case-insensitive, so they bite on case-sensitive Linux too.
  • test_discovery_reads_known_files_and_never_runs_them, which failed on macOS before, now passes.
  • Mutation checks: dropping the exact-name guard fails 6 tests; reverting the TUI assertion to the raw-string check fails the two-line case.
  • Full suite via suite-run: CLEAN, exit 0, no failures on macOS. ruff check . passes.
  • Codex review, three rounds, all SHIP:
    • R1 had one Minor: the other discovery files had the same capitalization problem. Fixed here, at the maintainer's choice.
    • R2 (diff only) and R3 (after that change) had no findings.

🤖 Generated with Claude Code

…#251)

discover_gate_commands opened its well-known files by name, so on a
case-insensitive filesystem opening "makefile" found "Makefile" and the
suggestion named a file that is not on disk (and "PACKAGE.JSON" was read
as package.json). It now reads a file only when a directory entry has
exactly its name, so the source is true to the disk and the result is the
same on every filesystem. This also fixes the test that failed on macOS.

The TUI Details test (#251) depended on git's error being one line: on a
runner where git stops at a filesystem boundary the error is two lines,
Details escapes the newline, and the raw string no longer matched. The
test now pins the source-check failure (one-line and two-line) and
compares the escaped form Details shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@memtomem
memtomem merged commit 5ed4564 into main Nov 4, 2026
11 checks passed
@memtomem
memtomem deleted the fix/249-251-case-and-flaky branch November 4, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant