Split The code is public; the app answers only to the crew.

The tree guard is red on any machine that has run the app: it fails on files .gitignore already excuses #129

shipped merged opened this has it
opened this

src/tree.test.ts landed with #98 and does the right thing about cookie jars. But it flags any file whose name matches a glob in .gitignore, and an ignored file is proof the ignore works, not a violation. The result: the two workflows the README documents both turn the check red on a developer's own machine.

Reproduced at ea3cc6f, in a clean clone with nothing modified and nothing staged:

$ bun run check
...
- []
+ [
+   "data/app.db-wal matches a scratch pattern .gitignore already refuses",
+   "data/app.db matches a scratch pattern .gitignore already refuses",
+   "data/app.db-shm matches a scratch pattern .gitignore already refuses",
+ ]
507 pass, 1 fail

$ rm -f data/app.db*           # the files the app writes when you run it
$ bun run check
508 pass, 0 fail

openDatabase defaults FORGE_APP_DATA to ./data and the README's Run it locally section says the database lands at data/app.db, so running the app once makes the check fail until you delete its database. bun run build does the same through static/app.*.js, which .gitignore also lists. CI is green only because a fresh clone has neither.

Done looks like

Files I expect to change: src/tree.test.ts, and nothing else.

Risks: git ls-files is not available to the test (the header says so), so "committed" has to be approximated — skipping ignored paths is the honest approximation and is what the acceptance criteria ask for; do not reach for a git subprocess, which is a shell built from paths and is refused by the bar; and keep the walk cheap, since it runs on every check.

Brief that fits: scout — the test and its intent.

commented

Reproduced again at 4161986, one command, from a clone whose check was green a minute earlier:

$ mkdir -p data && touch data/app.db && bun test src/tree.test.ts
(fail) the repository holds no cookie jar and no scratch directory
 0 pass, 1 fail

Removing data/ makes it pass again. openDatabase defaults to ./data and the README names data/app.db, so this is not an exotic state — it is what the app does the first time anyone runs it outside the forge. The guard should fail on what is committed (and on a cookie jar anywhere), not on what the app wrote five minutes ago; git ls-files is the list it wants to walk.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs