Repository navigation
Keep the hooks file to plain uses of $, and call the mod beta - #7
Merged
Merged
Conversation
The directory's second validation flagged the helpers left in the hooks file that hand $ on to another file's function: schedulePrune, keepSeen, refreshOffer, and by the same rule showWorkspace and the timer in the turn-end hook. In a file that declares hooks it reads $ handed to another file's function only from a hook's own body; a function there may use $ only in plain $.noun.method(...) calls and hand it, alone, to another function in the same file. So: - schedulePrune moves to prune.ts, keepSeen and its timer to store.ts, refreshOffer to settings.ts (taking whether summaries are off), and showWorkspace to workspace.ts; the turn-end timer becomes finishTurnLater in turns.ts. Each is called from a hook's body, and each comment moved with its code. - Three calls that passed $ inside a ternary, parentheses or another call are written as plain statements. - dollar_check reads each line with its comments taken off, allows a generic call such as get<T>(, and fails if grep itself fails. The READMEs call sessionpad beta software rather than alpha.
j127
marked this pull request as ready for review
October 29, 2026 20:40
From the review: forgetPaneEdits($).catch(...) handed $ on as the receiver of a chained call, the shape the directory may not read, so it becomes a try block. Plain $ calls that sat inside parentheses, an object or another call's argument (the session id after /clear, the clear's time, and the turn's id and time) now each get a line of their own. finishTurnLater keeps its inline comment beside touchSeen; the ./store import is in order; dollar_check also catches a bare $.noun read, and says what it doesn't see.
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 plugin directory's second validation (of
mainatab5868f) found 3 blocking findings, all of one kind: uses of$inhooks/register.tsit couldn't read. It listed lines 301, 337 and 358, and said there were 7 more it didn't list. This PR fixes that kind of finding throughout the file, and changes the READMEs from "alpha" to "beta".The rule, as the findings show it
In a file that declares hooks:
$handed to another file's function only from a hook's own body;$only in plain$.noun.method(...)calls, and may hand$, alone, only to another function in the same file.The flagged lines were helpers handing
$on to other files:pruneOldfromschedulePrune;touchSeenfromkeepSeen;showOfferfromrefreshOffer, although that one takes$alone.registerCommandshanding$totakenCommands(same file,$alone) passed, as did every hook body that hands$to another file.What changes
schedulePrunetoprune.ts;keepSeenand its timer tostore.ts;refreshOffertosettings.ts, taking whether summary lines are off as an argument, so the module variable added in the last PR goes;showWorkspacetoworkspace.ts;finishTurnLater, toturns.ts.$call inside a ternary (/pad), one inside parentheses (/clear's timeline carry), and one nested in another call (notes_read).dollar_checkreads each line with its comments taken off, allows a generic call such asget<T>(, and fails ifgrepitself fails, as the last review suggested. Its comment says what it doesn't catch.No behaviour changes. The suite is 360 tests, all passing.
Review
A reviewer subagent with fresh context read
dc96e08and found it ready to merge. It confirmed:$handed to a function in the hooks file is in a hook's body, or alone to a function in the same file.Because the directory's seven unlisted findings are only guessed at, its points are taken in
2bd3b63:forgetPaneEdits($).catch(...), which hands$on as the receiver of a chained call, becomes atryblock;$calls inside parentheses, an object or another call's argument each get a line of their own;finishTurnLaterkeeps its inline comment besidetouchSeen;dollar_checkalso catches a bare$.nounread, and says what it doesn't see.Before merging
main, then a re-validation in the portal.