Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- **fix(sidebar): the rail is built with the cursor and hands it straight back.** A bare `chief` opened the company with the cursor in the sidebar instead of in the person's pane, so the first thing the operator typed went to furniture. Both rail-mint sites — the attach frame (`attach.rs::rail_mint_argv`) and the actuator's repair batch (`actuate/interpret.rs`) — run `split-window` with no `-d`, which is deliberate: every write that follows names a WINDOW, and tmux resolves a window target to its active pane, so the new rail must be active while it is tagged and resized. The frame therefore ends, and only ends, with `select-pane -l` at that window: the last pane, which a split makes the pane that was active before it — measured on tmux 3.7c, and true even when the split targeted some other pane, so the cursor returns to the operator and never to the split target.

Pinned at both sites by an argv test that fails if the selection is dropped or moved ahead of the tag, and by two REAL-tmux tests that ask the server which pane is active after the frame runs (`a_real_rail_mint_leaves_the_person_pane_active`, `real_rail_repair_leaves_the_person_pane_active_and_not_the_rail`). Both were run as controls with the selection removed and both fail there, reporting the rail as the active pane — which is the operator's report reproduced exactly.

- **chore(deps): the three open dependabot branches land as one batch, with the lockfile they never carried.** The npm minor-and-patch group (`@typescript-eslint/*` 8.67.0 to 8.68.0, `eslint` 10.9.0 to 10.9.1, `@types/react-dom` 19.2.4 to 19.2.5, `typebox` 1.3.16 to 1.3.18), `jsdom` 29.0.2 to 30.0.1, and `eslint-plugin-simple-import-sort` 12.1.1 to 14.0.0 are merged together on one branch, because three separate merges of the same lockfile serialize into three conflicts that say nothing.
**Dependabot edited only the manifests.** Every one of its three commits touches `package.json` files and no `bun.lock`, and every CI job installs with `--frozen-lockfile` — so each of those branches was individually unmergeable and would have failed at the install step before running one test. The lockfile is regenerated once here, over all three bumps at the same time, and the frozen install is verified against it.
**The instrument was checked against the lockfile, not remembered.** `eslint --version` reports 10.9.1 in the tree that lints, which is the check that separates a real lint result from a confident answer given by the wrong binary.
Expand Down
1 change: 1 addition & 0 deletions DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@
- 2026-08-25 — CI has ONE tier. Every workspace member gates; there is no non-gating tier and no quarantine, so a suite is either run and required to pass or it does not exist. A suite that cannot hold the bar is fixed or deleted. Pinned by `excluded-suites-are-runnable.test.mjs`, which is what stops a suite excluded from the ordinary shards from quietly running nowhere.
- 2026-08-25 — The licence is Apache-2.0, single: not MIT, not MIT/Apache dual, not source-available, and with a DCO rather than a CLA. The Rust dependency licence allowlist is permissive-only and names no denials. `apps/web` ships MARKED as a non-working example rather than deleted — it is the only worked example of the second host the daemon/client split exists for, so deleting the broken app destroys the reference implementation of the hardest part of the architecture. Relicensing costs nothing today with one rights holder and needs unanimous consent the moment there is a second contributor. Enforced by the LICENSE and NOTICE files and by `apps/chiefd/deny.toml`; there is no test, and this is the one entry that does not name one, deliberately — the decision is about a legal instrument, not about code behaviour.
- 2026-08-25 — CHANGELOG.md and DECISIONS.md start FRESH in the public tree, and the private ledger is archived rather than published. Those two files had grown to about 16,800 lines of internal narrative — detailed incident write-ups, named hosts, and roughly thirty-six leaked machine names — written for the people who were in the room. The rejected alternative was a mass rewording of shipped entries through the `doc-append-only` guard's per-entry exception registry, which would have taught every future contributor that an append-only file may be reworded when the reason seems good enough. That is a repeal of the rule, not an exception to it. The same philosophy as the `plans/` ruling, applied to the same kind of content: the history is kept, and it is kept private. What still BINDS the code is carried forward as new dated entries below; `CLAUDE.md` and `AGENTS.md` already carry the organization model, the operator wake lease and the placement rule, and duplicating them here would create two sources for one rule. The guard treats this as a ONE-TIME reset, detected by the first line of this entry and of the changelog's, so ordinary append-only resumes from the very next commit with no exception left behind to rot.
- 2026-09-03 — The sidebar rail is furniture and never takes the operator's cursor. It is minted active on purpose — the tag and the resize that follow the split name a WINDOW, which tmux resolves to the active pane — so every mint frame ends with `select-pane -l`, restoring the pane that was active before the split. The rejected alternative was `split-window -d`, which cannot work without a second tmux invocation to name the pane the split has not reported yet, and a rail that is observable untagged is the gap that once put two rails in one window. Pinned by `the_rail_frame_hands_the_cursor_back_after_every_other_write` and `a_real_rail_mint_leaves_the_person_pane_active` (`attach.rs`) and by `a_repaired_rail_gives_the_cursor_back_after_it_is_tagged` and `real_rail_repair_leaves_the_person_pane_active_and_not_the_rail` (`actuate/interpret/tests.rs`).
14 changes: 14 additions & 0 deletions apps/chiefd/crates/chief-cli/src/actuate/interpret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,20 @@ fn repair_session_rails_with(
window.clone(),
tags::SIDEBAR.into(),
"1".into(),
";".into(),
// AND THE CURSOR GOES BACK, LAST. A repair
// pass that mints a missing rail must not
// leave the operator typing into furniture.
// `-l` is the window's last pane, which a
// split makes the pane that was active before
// it — not the split target. It follows the
// tag because the tag resolves a WINDOW target
// to the active pane, which must still be the
// new rail.
"select-pane".into(),
"-l".into(),
"-t".into(),
window.clone(),
],
},
)
Expand Down
118 changes: 118 additions & 0 deletions apps/chiefd/crates/chief-cli/src/actuate/interpret/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ fn missing_sidebar_is_repaired_with_bare_chief_in_the_company_directory() {
"@2",
"@organization_sidebar",
"1",
";",
// And the batch ends by handing the cursor back to the pane the
// split took it from, so a repair never moves the operator into
// the sidebar. It is last because the tag above names a WINDOW.
"select-pane",
"-l",
"-t",
"@2",
],
"the current sidebar verb takes no company argument and resolves the company from cwd, \
and the pane is tagged in the same command sequence that creates it"
Expand Down Expand Up @@ -310,6 +318,55 @@ fn a_repaired_rail_is_never_observable_before_it_carries_its_tag() {
);
}

/// A REPAIR PASS DOES NOT TAKE THE CURSOR AWAY FROM THE PERSON.
///
/// The mint batch has no `-d`, so the new rail is active for the tag that
/// follows it. The batch therefore ends by giving the cursor back with
/// `select-pane -l` — the window's last pane, which the split makes the pane
/// that was active before it. Without it, a rail repaired under an operator
/// who is typing moves them into the sidebar mid-sentence.
#[test]
fn a_repaired_rail_gives_the_cursor_back_after_it_is_tagged() {
let scripted = ScriptedTmux::new([
ScriptedReply::ok("@1\t%1\t1\n@2\t%2"),
ScriptedReply::ok(""),
ScriptedReply::ok(""),
ScriptedReply::ok("%9"),
ScriptedReply::ok(""),
])
.recording_viewport_authority();
let exec = executor(scripted);

repair_session_rails_with(
&exec,
&socket(),
"cobalt-session",
"/data/cobalt",
std::path::Path::new("/opt/chief/bin/chief"),
)
.expect("the missing rail is repaired");

let calls = exec.tmux_host().runner().calls();
let split = calls
.iter()
.find(|call| call.first().is_some_and(|verb| verb == "split-window"))
.expect("the mint batch");
let commands: Vec<&[String]> = split.split(|arg| arg == ";").collect();
assert_eq!(
commands.last().expect("the batch is not empty"),
&["select-pane".to_owned(), "-l".to_owned(), "-t".to_owned(), "@2".to_owned()],
"the batch ends by restoring the pane the split took the cursor from: {split:?}"
);
let tag = commands
.iter()
.position(|command| command.iter().any(|arg| arg == "@organization_sidebar"))
.expect("the tag");
assert!(
tag < commands.len() - 1,
"the tag names a WINDOW, so it must land while the rail is still active: {split:?}"
);
}

#[test]
fn failed_sidebar_split_still_refreshes_after_the_epoch_fence() {
let scripted = ScriptedTmux::new([
Expand Down Expand Up @@ -1233,6 +1290,67 @@ fn real_viewport_repair_never_publishes_a_one_column_rail() {
assert_eq!(remembered, "31", "viewport repair never writes the sidebar preference");
}

/// THE OPERATOR KEEPS THE CURSOR, PROVED AGAINST A REAL TMUX SERVER.
///
/// The argv tests above pin the frame; only tmux can answer what the frame
/// DOES. A real window that is missing its rail is repaired here, and the pane
/// left active afterwards must be the person's pane and not the rail tmux made
/// active when it split. `remain-on-exit` keeps the rail pane after its
/// stand-in program exits, so the question this test asks stays askable.
#[test]
fn real_rail_repair_leaves_the_person_pane_active_and_not_the_rail() {
let raw = SystemTmuxRunner::default();
let socket = Socket(format!("chiefd-rail-cursor-{}", std::process::id()));
let session = format!("chiefd-rail-cursor-{}", std::process::id());
real_tmux_ok(
&raw,
&socket,
&["new-session", "-d", "-s", &session, "-x", "240", "-y", "56", "sleep", "120"],
);
real_tmux_ok(
&raw,
&socket,
&["set-option", "-w", "-t", &session, "@organization_window_id", "executive"],
);
real_tmux_ok(&raw, &socket, &["set-option", "-t", &session, "@organization_id", "cobalt"]);
real_tmux_ok(&raw, &socket, &["set-option", "-w", "-t", &session, "remain-on-exit", "on"]);
let person = real_tmux_ok(&raw, &socket, &["list-panes", "-t", &session, "-F", "#{pane_id}"])
.trim()
.to_owned();

let exec = RealHostExecutor::new(
TmuxHost::new(raw, RecordingWaiter::default()),
ProcReader::default(),
);
let repaired = repair_session_rails_with(
&exec,
&socket,
&session,
"/tmp",
std::path::Path::new("/bin/false"),
);
let panes = real_tmux_ok(
exec.tmux_host().runner(),
&socket,
&[
"list-panes",
"-t",
&session,
"-F",
"#{pane_id}\t#{pane_active}\t#{@organization_sidebar}",
],
);
real_tmux_ok(exec.tmux_host().runner(), &socket, &["kill-server"]);

assert_eq!(repaired.expect("the rail is repaired"), 1, "one rail was missing: {panes}");
let rows: Vec<Vec<&str>> = panes.lines().map(|line| line.split('\t').collect()).collect();
assert_eq!(rows.len(), 2, "the person pane and its new rail: {panes}");
let active: Vec<&str> = rows.iter().filter(|row| row[1] == "1").map(|row| row[0]).collect();
assert_eq!(active, vec![person.as_str()], "the operator is left in their own pane: {panes}");
let rail = rows.iter().find(|row| row[0] != person).expect("the minted rail");
assert_eq!(rail[2], "1", "and the rail it did not move to is tagged: {panes}");
}

/// A browser-like attached client must not publish tmux's proportional split.
///
/// The old test accepted that bad frame and only checked that a later repair
Expand Down
Loading