Documentation
Archive shift history and retention
File finished punch-list items, logs, snags, answered decisions, and receipts into dated archives, keep live files lean, and prune only on an explicit yes.
Updated
How do I keep shift history without letting the live files grow?
Archive files the paperwork of a finished shift under the archive root, grouped by date or by shift, and leaves the live files small. Filing is a copy: nothing is removed unless a retention rule is set and the owner confirms the exact paths Archive previews first.
What moves and what stays
Archive reads the punch list and the records before naming anything, because a shift can end with items still open and a terminal marker says nothing about a particular record. Rejected work is filed with its rejection, never erased, and anything an open item or unanswered decision still needs stays live.
- Ticked items move to shipped.md; open items, the contract, and the gates stay exactly where they are.
- The shift log moves whole and a fresh one starts with the same header.
- Snag log entries with a disposition move; findings still awaiting the owner stay.
- Answered parking-lot decisions move; unanswered ones stay.
- Product research files after its shift; only shipped and rejected opportunities leave the map.
Where it goes
The archive block in rules.json sets the root, relative to .nightshift and never outside it, and the layout: a date folder groups a night, a shift folder gives each shift its own directory. The shift id names the files either way, so two shifts on one day never collide. Changing the root never moves or hides what was already filed.
- Receipts are copied into the dated folder and the live copies stay in place.
- A moved receipt keeps working: its links are repointed and the untouched original is preserved beside it.
- An absolute path, a path containing .., or a symlink is refused rather than followed.
Automatic filing at clock-out
With archive.automatic set to true, the gate ends the shift, then holds the session once and says filing is due. The Archive skill runs, decides from the punch list what belongs to finished work, files it, and clears the marker. A second stop releases whether or not filing succeeded, so a session that could not file leaves the marker for the next explicit Archive rather than being stuck. The default is false: filing stays something the owner asks for.
Retention is a separate decision
Two retention rules exist, runtimeLogDays and archiveDays, and both default to zero, which keeps everything forever. A positive number is an opt-in age. Archive prints every eligible path with its age and the governing rule, and deletes only after the owner confirms in that interactive session. Nothing prunes from a hook, Start, Status, Doctor, or recovery.
"$NIGHTSHIFT_PLUGIN_ROOT/runtime/ns" retain-historyStart with a bounded prompt
This prompt names the outcome and preserves Nightshift’s review boundary. Paste it into the supported coding host from the project you want to change.
Preview what Nightshift Archive would file for the last finished shift and what retention would prune. Move and delete nothing.What this workflow does not claim
- Filing copies records; only the retention rules the owner set can remove anything, and only after a printed preview and an explicit yes.
- Archive never resets the shift contract or gates; a finished campaign's text still binds the next cut until the owner edits it.
Evidence and sources
These links support the released behavior, public outcomes, or problem language described on this page.
Frequently asked questions
Does Archive delete anything?
Not by itself. Filing copies records. Deletion needs a retention rule above zero, a printed preview of the exact paths, and an explicit yes in the same session.
Does Archive reset the punch-list contract?
No. Ticked items move out, but the contract and the gates above the items stay and still bind the next Hunt or Start cut. Archive adds a reminder note when a campaign is fully filed.
Can I archive while a shift is running?
Archive says so and asks first. The ticked lines are the night's scoreboard, and the owner may want the morning review to see them in place before they are filed.