8000 feat(drip): add drip history --clear and a history size setting by jrnxf · Pull Request #100 · jrnxf/drip · GitHub
[go: up one dir, main page]

Skip to content

feat(drip): add drip history --clear and a history size setting - #100

Merged
jrnxf merged 3 commits into
mainfrom
launch/c-history-clear
Nov 10, 2026
Merged

jrnxf merged 3 commits into
mainfrom
launch/c-history-clear

Conversation

@jrnxf
@jrnxf jrnxf commented Nov 10, 2026
Copy link
Copy Markdown
Owner

Users can now empty their card history with drip history --clear. They can also set its size, or stop recording, with history = 0..1000 in the config or with DRIP_HISTORY.

To review (about 15 min): read History.swift and how the limit reaches deliver() in CLI.swift and Delivery.swift.

Manual check (2 min, after CI is green):

  1. drip history --clear; echo $? prints 0, and drip history lists nothing.
  2. Set history = 0 in the config and run drip hi. drip history still lists nothing.
  3. Hold a card with history = 0. It still comes back.

What changed:

  • --clear empties history.jsonl under the file lock. Used with any other history option, it is a usage error. A failed clear exits 1.
  • The limit is resolved once, as DRIP_HISTORY, then config, then 1000. It goes to the recorder with the card, so nothing reads the config again.
  • 0 records nothing and leaves the file as it is. --clear deletes the cards from before. A lower number above 0 trims the file when the next card is recorded.
  • Held cards use their own file, so 0 does not affect them.
  • Docs: config.md, usage.md, and the troubleshooting privacy section.

Evidence: before, drip history --clear printed unknown option '--clear' and exited 2. After, it exits 0 and the file is empty. history = 5000 exits 4 with "history: must be between 0 and 1000". swift build passes. The tests did not compile locally (the Testing module is missing), so CI is the first test run. /code-review ran twice, and all 18 findings are fixed.

Risk: two-way door. Blast radius: history.

@cloudflare-workers-and-pages
cloudflare-workers-and-pages Bot commented Nov 10, 2026 •
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
drip-web a9c21f7 Nov 10 2026, 06:52 PM

history = 0..1000 in the config and DRIP_HISTORY set how many cards the
history keeps. 0 keeps none. Cards held for a locked screen or a pause
use their own file and still play back.
The foreground drip resolves history (DRIP_HISTORY, then the config, then
1000) and hands it to the background drip, so a drip that records no longer
reads the config itself. An invalid DRIP_HISTORY is a usage error like
DRIP_STACK_MAX. A lower limit trims the file on the next record, and 0
empties it. Integer settings share one ranged helper in the config and the
environment.
deliver() gets the size the command's own resolver gave instead of reading
the environment and the config again, and nil means a replay that records
nothing. A size of 0 stops recording and leaves history.jsonl alone, and
only drip history --clear deletes it. LockedScreen has no default size,
BackgroundRequest.historyLimit holds the fallback, CardHistory.limit is
gone, and clear() returns before it takes the lock when there is no file.
@jrnxf
jrnxf force-pushed the launch/c-history-clear branch from 3de415f to a9c21f7 Compare November 10, 2026 18:49
@jrnxf
jrnxf merged commit e548485 into main Nov 10, 2026
16 checks passed
@jrnxf
jrnxf deleted the launch/c-history-clear branch November 10, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0