refactor(statusline): delegate the althing segment to althing-statusline
althing 3.4.0 ships the segment as a console script on PATH, so the twelve lines that existed in three hand-maintained copies now exist in one. A script, unlike a document, has somewhere to be installed, and installing it makes drift impossible rather than merely visible. Two real defects left this file with the block, both silent: the handle was resolved as the most recent launch in a directory, so a directory hosting a claude and a codex seat reports the codex handle's unread count to a Claude session as soon as the codex pane relaunches last; and the post-office address was hardcoded, which survives until the post office moves and then reports an outage that is really a stale constant. Taken from the live path rather than pushed to it. ~/.claude/statusline- command.sh had been migrated directly and was AHEAD of this tracked copy, with a better `command -v` guard; a reflexive cp from the repo would have destroyed it. Repo and live are now byte-identical. The deploy instructions and the v3-cutover history move from the file header into docs/runbooks/althing-deploy.md, where they cannot drift against the script they describe, along with the diff-before-you-copy-in-both-directions warning that this near-miss earned.
This commit is contained in:
@@ -272,6 +272,62 @@ and reports it on every run and on `--check` — and **deliberately never sets
|
||||
it.** That file is the operator's permission configuration; a deploy script
|
||||
that edits it is a deploy script granting itself trust.
|
||||
|
||||
## The status-line segment belongs to althing, not to this repo
|
||||
|
||||
From althing **3.4.0** the segment is a console script, `althing-statusline`,
|
||||
installed on PATH by the same `uv tool install --force` as the other seven
|
||||
executables. `scripts/claude-statusline-command.sh` calls it and does not
|
||||
reimplement it:
|
||||
|
||||
althing=$(printf '%s' "$input" | timeout 5 althing-statusline 2>/dev/null)
|
||||
|
||||
⚠ **Keep that outer timeout LOOSER than the program's own 2 s budget.** If the
|
||||
outer one fires first the segment comes back empty, which renders as "not an
|
||||
althing directory" — the outage conflation, reintroduced by the guard meant to
|
||||
prevent a hang.
|
||||
|
||||
**Why a console script rather than the `sync_skill.sh` canonical-file pattern:**
|
||||
a script, unlike a document, has somewhere to be *installed*. Installing it makes
|
||||
drift impossible instead of merely visible.
|
||||
|
||||
**Why it needed solving at all.** On 2026-09-02 the same twelve lines existed in
|
||||
three places — althing's `plugin/scripts/statusline.sh`, the operator's wired
|
||||
`~/.claude/statusline-command.sh`, and this repo's copy — and one audit found a
|
||||
**different defect in each**. All three were fixed separately, by hand, the same
|
||||
day. Two of the defects were in this repo's copy and are worth knowing because
|
||||
they are both silent:
|
||||
|
||||
- the handle was resolved as the most recent launch in the directory, so a
|
||||
directory hosting both a claude and a codex seat (`~/development/Worldtree`)
|
||||
reports the **codex** handle's unread count and reachability to a Claude
|
||||
session the moment the codex pane relaunches last;
|
||||
- the post-office address was hardcoded, so it survives exactly until the post
|
||||
office moves and then reports an outage that is really a stale constant.
|
||||
|
||||
### Deploying it
|
||||
|
||||
`scripts/claude-statusline-command.sh` is the tracked copy of what Claude Code
|
||||
actually runs at `~/.claude/statusline-command.sh` (`settings.json` →
|
||||
`statusLine.command`). Copies, not symlinks — same rule as `stacks/`.
|
||||
|
||||
diff -u scripts/claude-statusline-command.sh ~/.claude/statusline-command.sh
|
||||
cp scripts/claude-statusline-command.sh ~/.claude/statusline-command.sh
|
||||
|
||||
⚠ **Diff before you copy, in both directions.** On 2026-09-02 the live path was
|
||||
edited directly and was *ahead* of the tracked copy; a reflexive `cp` from the
|
||||
repo would have destroyed the better version. The tracked copy is intent, the
|
||||
live path is reality, and reality is sometimes right.
|
||||
|
||||
Smoke test — Claude Code runs it in a **bare shell**, so unset the althing
|
||||
env vars or you will test your own session's identity instead of the resolution
|
||||
logic:
|
||||
|
||||
printf '{"workspace":{"current_dir":"/tmp"}}' \
|
||||
| env -u ALTHING_HANDLE -u ALTHING_POST_OFFICE bash scripts/claude-statusline-command.sh
|
||||
|
||||
Want: empty althing segment for a directory with no identity, `🔔` in a seat's
|
||||
own directory, `📵` against an unreachable address.
|
||||
|
||||
## Rollback
|
||||
|
||||
uv tool install althing-core==3.1.2
|
||||
|
||||
Reference in New Issue
Block a user