Repository navigation
refactor: apply Effect good practice across src - #114
Merged
Merged
Conversation
Nested ternaries in the header's built-ins and the watermark's draft check read as branches, the block opener names its position before the template uses it, allKeys is the service accessor it always was, and forget builds its tracked suffix once instead of once per row. The header's const is registration, because standing is the glossary's word for a session worktree left on disk. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forPr reads the configuration file before forget does anything, and forget was the one command reading it that let ConfigMalformed reach runMain, so a misspelled key printed a stack trace where stamp and findings print the sentence naming the file. One test now runs every command against a bad file, and a command added to the CLI has to say whether it reads the file. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Effect preset ships its idioms at warn - Effect.fn over a wrapped Effect.gen, DateTime over Date, Schema over JSON.parse - and pnpm lint passed no --deny-warnings, so none of them could fail pnpm check. The tree reports no warnings, so holding them costs nothing today and keeps the next change to what node_modules/effect/AGENTS.md asks. ADR 0005 says so, and says a rule the repo disagrees with is switched off by name, not left at warn. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Effect's guide keys a service by the module it lives in, and effecttsgo/deterministic-keys holds that once it is on; the preset leaves it off. ConfigStore and Keys now carry their adapters/ path, Paint follows by hand because the rule does not read a Context.Reference, and both services are built through X.of the way the guide builds one. The keys are in-memory Context keys, so nothing on disk moves. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Four calls spelled the same catchTags, a gh that would not start as
unavailable and one that refused as GhReadFailed. failedAs is that mapping
piped onto capture("gh", [...]), so the vector stays in the call
no-gh-writes reads, and ci.ts no longer reaches for gh.ts internals.
Refs #113
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forPr, the sweep and the picker each read the file, fell back to an empty one and listed the registered repositories their own way. readOrEmpty and registeredIn say it once beside read, so a malformed file still fails every caller the same way and every command lists the repositories in one order. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Effect's guide asks for Effect.fnUntraced over a function that only returns an Effect.gen, and eleven helpers in the suite were that shape. The one that provides its own machine from its argument keeps the pipe, because the argument belongs to the provide rather than the body. The rule for an arrow whose block only returns lands at error, the way deterministic-keys did. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The effort flags restated the Effort literals the term already holds, and ADR 0006 says a word declared twice has stopped being one, so both flags read Effort.literals. resolve takes fix's --print, the three commands that find no registered repository say it from one const, and the two spans whose names did not match their function now do. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forget's suffix was named tracked, which is the glossary's word for a pull request the tool follows, so it is branchGone. failedAs says which error a refused gh call becomes, writes included, and the all-commands test title finishes its sentence. Refs #113 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The gate now holds
src/tonode_modules/effect/AGENTS.md. The Effect preset's style rules sit atwarn, andpnpm lintfailed on none of them. With the gate strict, the next change keeps to the idioms this code already follows.dw-mc forgetanswers a configuration file it cannot read with the sentence every other command prints. The handful of things written more than once are written once.What changes
pnpm lint,lint:fixand the pre-commit hook pass--deny-warnings.effecttsgo/deterministic-keysandeffecttsgo/unnecessary-arrow-blockland aterror. ADR 0005 says a preset rule the repo disagrees with is switched off by name, never left atwarn.src/cli/forget.ts— mapsConfigMalformedto the user-facing sentence.src/cli/cli.test.tsruns every command and the picker against a malformed file. A new command has to say whether it reads the file.src/adapters/gh.ts,src/adapters/config.ts—failedAsmaps a failedghcall once and keeps the vector whereno-gh-writesreads it.readOrEmptyandregisteredInread the configuration file forforPr, the sweep and the picker. Service keys carry theiradapters/path.src/cli/*, tests — the effort flags readEffort.literals.--printand "No repositories registered…" are declared once, and span names match their functions. Eleven test helpers areEffect.fnUntraced.failinginreview.test.tskeeps its pipe, because its argument feeds the provide and not the body.Test plan
pnpm check— pass: lint with--deny-warnings, format, typecheck, 816 tests, build.src/cli/forget.test.ts— the new regression case fails onmainwithexpected 'ConfigMalformed' to equal 'UserError'. It passes here.src/cli/cli.test.ts— without the fix, onlydw-mc forget 28fails. The other 11 commands and the picker pass.node dist/bin.js forget 28with a misspelled key under a scratchXDG_CONFIG_HOMEprints theERRORsentence naming the file and exits 1. Onmainit prints a stack.stamp 28prints the same sentence.src/scratch.tsholdingnew Date()failspnpm lint, exit 1. An old service key put back failsdeterministic-keys."--auto"added to thepr mergevector still tripsdw-mc/no-gh-writesafterfailedAs.--helpforreview,init,fix,resolveandstatusis byte-identical before and after.Risk
A preset rule that fires on a future change now fails the gate instead of warning. The way back is to switch that rule off by name in
.oxlintrc.json, with its reason. The service keys are in-memoryContextkeys, so nothing on disk moves.Closes #113