office: usage text, no session before the project is known good; commands on PATH

This commit is contained in:
Sam
2026-11-12 12:10:57 +11:00
parent 7b2cccf2ff
commit a129c4e0c3
9 changed files with 616 additions and 5 deletions

View File

@@ -1335,3 +1335,104 @@ Caveat: `bin/office` dry runs create the TUIOS session and need manual kill (see
- session: [[packs/paperclip-harness/80-sessions/paperclip-harness-new-existing-dry-runs-clean-test-plan-pi-v|paperclip-harness: --new/--existing dry runs, clean test plan, Pi version dry-run on .13/.27]]
- session: [[packs/paperclip-harness/80-sessions/rich-discovery-root-2026-11-11-22-37-01|Rich discovery: root 2026-11-11 22:37:01]]
- context: [[packs/paperclip-harness/20-context/paperclip-harness|root]]
---
## Update (2026-11-12 00:35:25)
Trigger: applying config changes in /etc/nixos, or the .27 fontconfig evaluation failure.
Prerequisites: ssh access by IP (BatchMode probe `ssh -o BatchMode=yes <addr> true`), sudo on target host.
Steps (on .13, known good):
1. Dry run to see scope: `sudo nixos-rebuild dry-build --flake /etc/nixos#nixos-desktop` (expected ~465 derivations / 5.5 GiB).
2. Apply: `sudo nixos-rebuild switch --flake /etc/nixos#nixos-desktop`.
3. Verify: check `pi --version` (evaluated vs running) after switch.
Fix path for .27 (fontconfig eval error at `… fonts.fontconfig.configFile.fonts.settings`): bump nixpkgs only in flake.lock, keep home-manager pinned, re-evaluate; do NOT change font config first. If it still fails, inspect home-manager fontconfig settings against newer nixpkgs attrsets (nixpkgs lib/attrsets.nix head).
Rollback: revert flake.lock and the initContent/initExtra edits in /etc/nixos (git tracked), then rebuild. Safe edits: home.nix Pi option name, flake.lock. Dangerous: font package removal, home-manager version bumps without testing.
Troubleshooting: 'already applied' claims must be verified — only edits in /etc/nixos count; /tmp copies are not applied.
## Detailed procedure from completed turn
You are right that I was inconsistent. Here is the exact state, then the simple rule for `office`.
## What is applied, precisely
| | `/etc/nixos` changed? | Evaluates to pi | Running pi | Needs |
|---|---|---|---|---|
| **`.13`** | **yes, now**: lock bumped to 2026-11-07, `initExtra` → `initContent` | **1.5.0** | 0.82.1 | one `sudo nixos-rebuild switch` |
| **`.27`** | **yes, now**: same two edits | 1.5.0 | 0.82.1 | a fix first — see below |
| **`.51`** | no | 0.87.1 | 0.87.1 | the same two edits, then rebuild |
Earlier I said "applied" when I had only tested a copy in `/tmp`. That was wrong wording on my part: nothing had been written to `/etc/nixos`. It has been now, on `.13` and `.27`, and `.13`'s dry-run build passes with 465 derivations to build and 5.5 GiB to fetch.
On `.13`, the rebuild is:
```sh
sudo nixos-rebuild switch --flake /etc/nixos#nixos-desktop
```
**`.27` cannot be rebuilt yet.** Its evaluation fails in home-manager's fontconfig code:
```
… while evaluating the option `home-manager.users.sam.fonts.fontconfig.configFile.fonts.settings':
error: … head values (attrsets.nix:1711)
```
That is home-manager 2026-11-10 disagreeing with something in `.27`'s font configuration, not the Pi change. The smaller next attempt is to bump **nixpkgs only** on `.27` and leave home-manager where it is — I would try that before touching fonts.
`.51` would need the same two edits to reach 1.5.0. Say whether you want `.51` aligned in the same pass, or left at 0.87.1 until `.13` is proven.
## Your notes, adopted — and the commands simplified
I read `docs/STARTUP-COMMANDS.md`. Four things from it are now in our `bin/office`:
- **A host name → address table** (`nixos-desktop`/`.13` → `192.168.20.13`, and so on), because the old version broke on names ssh could not resolve.
- **A check whether the named host is this machine**, before any ssh. I hit exactly that trap tonight: `office --remote 192.168.20.13` from `.13` tried to log in to itself.
- **An ssh probe** (`ssh -o BatchMode=yes <addr> true`) before doing anything remote, so a missing key says so instead of half-working.
- **`bin/board --reset`** — closes every pane, waits until the session is empty, clears the workspace names, then builds. `--replace` alone can run out of workspace slots on a half-built session.
One thing is *simpler* than the old design: it needed `tuios new --host …` plus `office … --host …`, because `office` could not create a session. Ours can, through the daemon's own verb. So it is one command.
## The rule, in one table
| Situation | Command |
|---|---|
| folder on this machine, shell on this machine | `bin/office <folder> --project "<Name>"` |
| folder Paperclip has not seen yet | `bin/office <folder> --new "<Name>"` |
| folder on another machine | `bin/office <folder> --project "<Name>" --host nixos-desktop` |
| repair / rebuild | `bin/board`, `bin/board --replace`, `bin/board --reset` |
| start again from nothing | `bin/project-reset <folder>` |
And the rule that removes the confusion: **the folder and the session live on the same machine.** If you are typing inside the session, on the machine that owns the folder, it is just `bin/office <folder>`. `--host` is only for the case where those two differ.
Written into `docs/STARTUP.md`, committed as `7b2cccf` and pushed.
## Your `email_agent` case, concretely
The folder is on `.13`, the Paperclip project is **Email Agent** (`local_path`, so no worktree policy), and the session must live on `.13`. From `.27`:
```sh
bin/office /home/sam/paseo/projects/email_agent --project "Email Agent" --host nixos-desktop --session email-agent
```
That runs the work on `.13` over ssh, creates the session there, and builds eight panes. Then `tuios attach --host nixos-desktop email-agent`. No program can move your client, so that last step is always yours.
## Evidence
- Confidence: 80%
- Reason: Repeatable procedure with commands, failure handling and a validation caveat.; enriched with final-answer detail because persistence should be reusable
## Related learned memories <!-- same-turn-2026-11-12 00:35:25 -->
- context: [[packs/paperclip-harness/20-context/tmp|NixOS /etc/nixos flake: hosts, Pi CLI versions, office workflow]]
- observation: [[packs/paperclip-harness/60-observations/tmp-repository-structure-and-configuration-patterns|NixOS fleet: Pi CLI version state and .27 fontconfig evaluation failure]]
- runbook: [[packs/paperclip-harness/70-runbooks/tmp-deployment-operations|Rebuild/switch a NixOS host and fix home-manager fontconfig eval error]]
- action: [[packs/paperclip-harness/40-actions/2026-11-10-wrote-docs-ui-layout-md-and-three-live-layout-mockups|Pi 1.5.0 edits in /etc/nixos, simplified office/board scripts, docs/STARTUP.md]]
- decision: [[packs/paperclip-harness/50-decisions/paperclip-harness-ui-six-workspaces-spec-first-four-panel-li|Convention: folder and session must live on the same machine; --host only when they differ]]
- session: [[packs/paperclip-harness/80-sessions/rich-discovery-home-2026-11-12-00-35-25|Rich discovery: home 2026-11-12 00:35:25]]
- context: [[packs/paperclip-harness/20-context/home|home]]