Stop sending users after a package the product does not carry - #304
Merged
Conversation
Closes #303. Found while narrowing whether musl still has an obstacle: the only remaining better-sqlite3 string in the shipped bundle was a user-facing message. index --help documented exit 2 as "conflicting flags, or better-sqlite3 is not installed". ADR-0012 replaced better-sqlite3 with node:sqlite so there would be no native dependency, and package.json declares no runtime dependencies at all. The one place a failing user is sent pointed at a package that is not part of the product and never will be. The message now names what actually produces exit 2 -- conflicting flags, or the SQLite binding being unavailable -- and says what happens then, which is that every read still answers from git with --no-index. That is the useful half a missing-package message never had. The comments in index-db.ts that mention better-sqlite3 stay: they explain why the dependency was dropped, which is worth keeping. The new assertion covers strings that reach a user, not prose that explains a decision. Record-Id: r-idxhelp303 Ruled-out: Deleting the better-sqlite3 mentions in index-db.ts as well | those comments explain why node:sqlite was chosen, and removing the reason leaves a future reader wondering whether the native option was considered Ruled-out: Asserting the package name appears nowhere in src at all | that forbids the explanation along with the defect, so the check reads only lines that reach a user Ruled-out: Naming node:sqlite in the message | the failure a user hits is that the binding is unavailable, and the module name adds nothing they can act on Certainty: firm Blast: local Undo: easy Verified: the assertion seen failing on the shipped string first, then passing; the shipped bundle now contains zero occurrences of the package name; the corrected help text read back from the built CLI; full suite 69 files, 1797 passed, 1 skipped; tsc exit 0; dist rebuilt and committed
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (56)
Ruled out (112)
Warnings (41)
Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
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.
Closes #303. Found while narrowing whether musl still has an obstacle — the only remaining
better-sqlite3string in the shipped bundle was a user-facing message.The defect
index --helpdocumented exit 2 as "conflicting flags, or better-sqlite3 is not installed".package.jsondependencies{}— none at allnode:sqliteADR-0012 replaced
better-sqlite3withnode:sqliteprecisely so there is no native dependency. The one place a failing user is sent pointed at a package that is not part of the product.The message now says something actionable
The second half is the part a missing-package message never had: what happens next.
What is deliberately left alone
index-db.ts's comments still mentionbetter-sqlite3— they explain whynode:sqlitewas chosen, and deleting the reason leaves a future reader wondering whether the native option was considered. The new assertion reads only lines that reach a user (help text, stderr writes, thrown messages, command descriptions), not prose that explains a decision.RED, then GREEN
A second assertion checks the rule has teeth:
better-sqlite3really is undeclared anddependenciesreally is empty, so the first assertion cannot pass vacuously.Verification
Full suite 69 files, 1797 passed, 1 skipped ·
tsc --noEmit0 ·dist/rebuilt and committed · corrected help text read back from the built CLI.