@timqi/pier 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@
16
16
  <meta name="apple-mobile-web-app-capable" content="yes" />
17
17
  <meta name="apple-mobile-web-app-title" content="Pier" />
18
18
  <title>Pier</title>
19
- <script type="module" crossorigin src="/assets/index-B3MvJUJP.js"></script>
19
+ <script type="module" crossorigin src="/assets/index-BAW9Nhaa.js"></script>
20
20
  <link rel="stylesheet" crossorigin href="/assets/index-CwBoxtXP.css">
21
21
  </head>
22
22
  <!-- The document never scrolls: this is a fixed-viewport workbench, and every
package/docs/deploy.md CHANGED
@@ -265,10 +265,10 @@ pier update # installs the latest release; hard-stops/restarts Pier
265
265
  pier update --check # only says whether one exists
266
266
  ```
267
267
 
268
- The workbench footer says the same thing without being asked: the server checks
269
- `registry.npmjs.org` every six hours in the background, and the version turns
270
- into `v0.0.1 → 0.0.2` when there is something newer. A failed check is silent
271
- by design — an offline box is not a broken one.
268
+ The workbench footer says the same thing without being asked: the server asks
269
+ `registry.npmjs.org` at boot and at most every 30 minutes after that, and the
270
+ version turns into `v0.0.1 → 0.0.2` when there is something newer. A failed
271
+ check is silent by design — an offline box is not a broken one.
272
272
 
273
273
  From a checkout instead, stop and back up before replacing the build:
274
274
 
@@ -287,10 +287,12 @@ path do: both drain (new work refused, running turns finished, the rest
287
287
  ledgered for the next boot to report) before the updater unit is started.
288
288
 
289
289
  Either way the updater snapshots the database to
290
- `~/.pier/db/pier.db.release.bak` before npm touches the package. This happens for
291
- every release, including releases with no schema change. If installation or
292
- backup fails, the updater unit still tries to start the previously installed
293
- service and reports the failure in its journal.
290
+ `~/.pier/db/backups/pier.db.release-<version>.bak` before npm touches the
291
+ package `<version>` being the Pier that is being replaced, i.e. the release to
292
+ reinstall if that copy is ever restored. This happens for every release,
293
+ including releases with no schema change. If installation or backup fails, the
294
+ updater unit still tries to start the previously installed service and reports
295
+ the failure in its journal.
294
296
 
295
297
  ### Automatic updates
296
298
 
@@ -313,22 +315,27 @@ pier service install --force # re-records the current node and npm
313
315
  A newer Pier brings its own schema up on the next start: the migrations run in
314
316
  one transaction before the port opens, and the version they leave behind is
315
317
  stamped in the database. It also snapshots the immediately preceding schema to
316
- `~/.pier/db/pier.db.v<N>.bak` (`N` = the schema it was at). **Upgrades only.**
317
- Start an older Pier on a database a newer one has migrated and it refuses to run
318
- rather than write tables it does not understand — the way back down is either
319
- the release backup or that schema snapshot:
318
+ `~/.pier/db/backups/pier.db.v<N>.bak` (`N` = the schema it was at). **Upgrades
319
+ only.** Start an older Pier on a database a newer one has migrated and it
320
+ refuses to run rather than write tables it does not understand — the way back
321
+ down is either a release backup or that schema snapshot:
320
322
 
321
323
  ```sh
322
324
  systemctl --user stop pier
323
- cd ~/.pier/db && rm -f pier.db pier.db-wal pier.db-shm && cp pier.db.release.bak pier.db
324
- # then reinstall the Pier release that created that backup
325
+ ls -t ~/.pier/db/backups/ # newest first
326
+ cd ~/.pier/db && rm -f pier.db pier.db-wal pier.db-shm
327
+ cp backups/pier.db.release-0.0.4.bak pier.db # the version in the name
328
+ # then reinstall that Pier release: npm install -g @timqi/pier@0.0.4
325
329
  ```
326
330
 
327
- The release backup is replaced atomically on each update. The three newest
328
- schema snapshots are also kept and older ones removed as later migrations
329
- supersede them. Each is a full copy of the database. They sit next to the
330
- database and therefore protect against a bad upgrade, not against a lost disk
331
- an off-machine copy is still yours to take.
331
+ Every copy lives in `~/.pier/db/backups/`, written under a temporary name and
332
+ renamed into place, so a `.bak` name only ever refers to a finished copy. The
333
+ three newest of **each kind** are kept three release backups and three schema
334
+ snapshots, counted separately so a run of releases cannot evict the copies taken
335
+ before a migration. Backing up twice at the same version replaces that version's
336
+ copy. Each is a full copy of the database, one directory below it, and therefore
337
+ protects against a bad upgrade, not against a lost disk — an off-machine copy is
338
+ still yours to take.
332
339
 
333
340
  ### Can it update itself?
334
341
 
@@ -390,7 +397,8 @@ Three paths hold everything: `~/.pier/db/pier.db` (tasks, channels, the chat →
390
397
  session map, workbench state, settings, the password hash, and the sealed
391
398
  provider credentials and channel tokens), `~/.pier/master.key` (the key that
392
399
  seals them — without it the database's sealed values are unreadable), and
393
- `~/.pier/boards/`. `pier.db.release.bak` is the latest automatic pre-update copy.
400
+ `~/.pier/boards/`. `~/.pier/db/backups/` holds the automatic pre-update and
401
+ pre-migration copies, named for the release or schema they came from.
394
402
  For off-machine backups, use `sqlite3 ... "VACUUM INTO '…'"` rather than `cp`,
395
403
  which under WAL can miss the most recent commits. Pi's own session history lives
396
404
  under `~/.pier/pi` (Pier sets `PI_CODING_AGENT_DIR` there unless the environment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timqi/pier",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "A self-hosted workspace for coding agents: web workbench and IM channels in front of Pi sessions",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": "github:timqi/pier",