Repository navigation
docs: rewrite habit snooze spec for humans - #197
Conversation
There was a problem hiding this comment.
First of all, thanks for the effort put into this! Bellow are some notes on what should still be changed.
I read up until "## An entry that records nothing keeps holding" but I think I would be repeating the same things a couple of times.
The initial plan to keep all of the examples was sound, but looking at the PR it seems to me that some of them need to be converted into unit tests and removed from the document.
In general keep what the user (human or agent) needs to understand, and remove implementation details that might actually change in the future. Those should be more unit level test.
| ] | ||
| } | ||
| ] | ||
| [{"smell": "loose-equality", "details": { "maxAllowed": 0 }, "issues": [{"key": "src/x.ts", "details": { "file": "src/x.ts", "line": 1 }}]}] |
There was a problem hiding this comment.
I'd keep the formatting, so as to make sure the result is easy to parse for the human eye
| An entry written before approvals were recorded — a bare key — cannot be contradicted, so it keeps holding however the file changes, until the next `--snooze` records it. A project upgrading therefore never finds its existing snoozes re-arming on their own; each one arms the first time it is approved again. | ||
|
|
||
| The file here is edited after the index was written, and the issue stays dropped. | ||
| An entry written as a bare key has no file content to compare, so it keeps holding regardless of file edits until updated by `--snooze`. |
There was a problem hiding this comment.
"bare key" needs explanation here. I also wonder if the naming could be improved here.
There was a problem hiding this comment.
Looking at it more, I think this whole section really needs clarification. This seems like relevant nuance to how snooze works, but the explanation needs to be more user focused.
| A snooze records the **approved content**: `--snooze` stores, per file the key is anchored to, the content that file held, and an issue stays dropped only while its file still holds it. Editing the file brings its issues back, and `--snooze` again approves what is there now — described [below](#an-edited-file-brings-its-issues-back-until-it-is-approved-again). The `snooze-until-changed` transformer is kept as a deprecated alias of `snooze`: what it was the opt-in for is the only behaviour. | ||
| `--snooze` records the approved content of each anchored file. An issue stays snoozed while its normalized content hash (converting CRLF to LF) matches; editing the file reactivates the issue. Running `--snooze` again approves the current state. The `snooze-until-changed` transformer is a deprecated alias of `snooze`. | ||
|
|
||
| ## An unsnoozed issue passes through |
There was a problem hiding this comment.
I feel like the section headers could also use some improvement. They should be a bit more user benefit focused. For example this one could be "By default items pass through"
| @@ -57,71 +40,36 @@ habit-snooze | jq . | |||
|
|
|||
| ## `--snooze` records an issue's key into the index | |||
| # habit-snooze — ignoring findings you have approved | ||
|
|
||
| Snoozing is a **transformer** ([architecture.md](architecture.md)): a `findings → findings` step that drops the issues a project has chosen to ignore and passes everything else through. It sits at the outermost level of the run, where it sees every finding. | ||
| `habit-snooze` is a transformer ([architecture.md](architecture.md)) that removes approved issues and passes everything else through. |
There was a problem hiding this comment.
I'd add one leading paragraph about the user benefit. Something like:
"When installing habit-hooks for the first time, or tightening the rules you may end up with more warnings then what you want to fix in one go. In these situations you can snooze them, and they will come back the first time the file is changed again. This allows you to fix them gradually."
| src/x.ts | ||
| ``` | ||
|
|
||
| ## A snoozed issue is dropped from its finding |
There was a problem hiding this comment.
This should be converted into a unit test. The agent has treated the documentation as unit level tests, which resulted in examples that show implementation details. From a user perspective the mechanics of how the snoozes are stored are not as relevant.
| @@ -145,115 +93,65 @@ habit-snooze | jq . | |||
|
|
|||
| ## A finding loses its only issue and disappears | |||
|
Thanks for this, Ashwath — the rewrite made the doc much easier to follow, and the PR is now rebased and merged. You did the hard part of filtering the document down to the important parts. I still decided to edit it further, but that was more restructuring than cutting. Below is a list of things I did and why I did them. In case you wish to pick up similar issues, this might help.
|
Summary
docs/habit-snooze.spec.mdfor human consumption.habit-snoozebehavior and executable examples intact.What changed
The spec now explains the user-visible behavior through focused examples covering:
--prune--listNo application behavior or source code was changed.