Skip to content

feat(logbook): group monorepo sub-projects on the attention board - #4

Merged
SchokoShake merged 2 commits into
mainfrom
fm/logbook-subprojects-feed-c2
Jul 15, 2026
Merged

SchokoShake merged 2 commits into
mainfrom
fm/logbook-subprojects-feed-c2

Conversation

@SchokoShake

Copy link
Copy Markdown
Owner

Intent

Build the firstmate feed side of logbook sub-project support so the attention board can render display-only sub-project groupings under a project (the board/tool side is already merged and out of scope). Motivating case: a monorepo (zeigmal_mono) whose work splits across integration branches (placement-tool off feat/placement-tool, outdoor-tour-navigation off feat-outdoor-tour-navigation). Three parts, all in bin/fm-logbook-compose.sh plus docs and tests:

  1. Declaration syntax: sub-projects are firstmate-declared per project in data/projects.md as ordered {key,name,branch} triples, one per indented non-dash 'sub' continuation line ('sub | | ', space-pipe-space delimited). The non-dash leading token was a deliberate choice for backward-compatibility: an indented '- sub' list item would have collided with the existing $1=='-' awk registry parsers in BOTH fm-project-mode.sh and fm-home-seed.sh (the latter collects $2 of every dash line as a project entry, which would have broken its --no-projects seed guard). A 'sub' leading token is invisible to every $1=='-' parser, so those scripts needed ZERO changes and projects without sub-projects parse byte-identically as before. Field parse is robust: key first, branch last, name is the middle so a display name may itself contain the ' | ' delimiter. Malformed lines, invalid-slug keys (validated with logbook_valid_id, the one-owner safe-slug rule), and empty name/branch are dropped with a stderr warning and never emitted, so an item can only ever map to a valid declared key.

  2. Per-item tagging by base/integration branch: a new optional base_branch= field in state/.meta records the branch a task's PR targets; compose maps it to the parent project's matching sub-project key. Deliberately OUT of scope (per the task): wiring the dispatch-time recording of base_branch into fm-spawn and back-filling in-flight items - firstmate does that after this lands. Documented the field and recording path instead.

  3. Emission: compose emits per-project an ordered 'subprojects' array of {key,name,branch} (empty when none, capped at the tool's 100/project limit) and per-item an optional 'subproject' key, only when base_branch matches a declared sub-project; most items target the default branch, carry no base_branch, and stay ungrouped. Sub-projects have no independent active/toggle state - grouping only.

Knowledge placement follows firstmate-coding-guidelines: docs/configuration.md (Logbook -> Sub-projects) is the single owner of the schema and base_branch recording path; the script header carries a concise mechanics summary plus a one-line cross-reference to docs; AGENTS.md deliberately left untouched (nameable-situation reference detail, not every-session knowledge). Tests colocated in tests/fm-logbook.test.sh following the existing curl-mocking compose pattern, covering a project with sub-projects, an item mapped by branch, an ungrouped item, the no-declaration backward-compatible path, malformed-line skipping, and fm-project-mode.sh non-breakage. Verified locally: full logbook suite 58 ok/0 fail, and bin/fm-lint.sh clean under the pinned shellcheck 0.11.0. This is firstmate's own repo shipping through its own no-mistakes gate.

What Changed

  • fm-logbook-compose.sh now reads firstmate-declared, ordered sub <key> | <name> | <branch> continuation lines under each project in data/projects.md and emits a per-project subprojects array (declaration-ordered, capped at the tool's 100/project limit, empty when none); the sub leading token keeps these lines invisible to the $1=="-" registry parsers so declaration-free projects compose byte-identically as before.
  • Each item is tagged with an optional subproject key by mapping a new base_branch= meta field (the branch a task's PR targets) to the parent project's matching declared branch, carried internally as _base_branch and stripped before output; items with no base branch or no match stay ungrouped, and malformed lines, invalid-slug keys, or empty name/branch fields are dropped with stderr warnings.
  • logbook_valid_id in fm-logbook-lib.sh is documented as the single owner of the safe-slug rule for both item ids and sub-project keys; docs/configuration.md gains the sub-project schema and base_branch recording path, and tests/fm-logbook.test.sh adds coverage for ordered declarations, branch-based tagging, the no-declaration path, malformed-line skipping, and fm-project-mode.sh non-breakage. Only the POST /api/sync baseline carries sub-project grouping; rich POST /api/items pushes are unchanged.

Risk Assessment

✅ Low: The change is additive, display-only, well-bounded, thoroughly tested, verified backward-compatible with the sibling $1=="-" registry parsers, and the single prior-round concern was already resolved by a doc-only fix.

Testing

The configured e2e baseline command already passed; I then ran the full logbook suite (bash tests/fm-logbook.test.sh, 58 ok / 0 fail incl. the 5 new sub-project tests) and demonstrated the feed end-to-end by composing the real POST /api/sync board body from a fleet-state home matching the motivating zeigmal_mono monorepo — the payload shows ordered per-project subprojects arrays, items tagged onto sub-projects by base_branch, ungrouped default-branch/plain-project items, malformed declarations dropped with stderr warnings, and byte-identical output to the base commit when nothing is declared. No board screenshot was produced because this is a bash JSON-feed change (not a UI change), the actual rendering board is the separate already-merged tool that isn't cloned in this worktree, and no browser executable is installed to render; the product surface of this change — the emitted feed JSON — is captured directly, plus a reviewer-openable HTML preview of the resulting grouping. All checks pass with no actionable findings.

Evidence: Composed POST /api/sync board body (motivating zeigmal_mono monorepo case)

projects[0] zeigmal_mono → subprojects: [ {key:placement-tool, name:"Placement Tool", branch:feat/placement-tool}, {key:outdoor-tour-navigation, name:"Outdoor Tour Navigation", branch:feat-outdoor-tour-navigation} ]; projects[1] solo → subprojects: [] items: place-x1 → subproject:"placement-tool"; tour-x3 → subproject:"outdoor-tour-navigation"; main-x2 (default branch) → no subproject; solo-x4 (no sub-projects) → no subproject; no _base_branch helper leaked on any item

{
  "projects": [
    {
      "name": "zeigmal_mono",
      "repo": "zeigmal_mono",
      "mode": "no-mistakes",
      "active": true,
      "subprojects": [
        {
          "key": "placement-tool",
          "name": "Placement Tool",
          "branch": "feat/placement-tool"
        },
        {
          "key": "outdoor-tour-navigation",
          "name": "Outdoor Tour Navigation",
          "branch": "feat-outdoor-tour-navigation"
        }
      ]
    },
    {
      "name": "solo",
      "repo": "solo",
      "mode": "direct-PR",
      "active": true,
      "subprojects": []
    }
  ],
  "items": [
    {
      "id": "main-x2",
      "project": "zeigmal_mono",
      "kind": "fyi",
      "title": "Fix the shared header",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "main-x2"
      }
    },
    {
      "id": "place-x1",
      "project": "zeigmal_mono",
      "kind": "fyi",
      "title": "Wire the placement endpoint",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "place-x1"
      },
      "subproject": "placement-tool"
    },
    {
      "id": "solo-x4",
      "project": "solo",
      "kind": "fyi",
      "title": "Tidy the solo app",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "solo-x4"
      }
    },
    {
      "id": "tour-x3",
      "project": "zeigmal_mono",
      "kind": "fyi",
      "title": "Add the tour route",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "tour-x3"
      },
      "subproject": "outdoor-tour-navigation"
    }
  ]
}
Evidence: Malformed sub-project declarations dropped with stderr warnings

fm-logbook-compose: skipping sub-project with invalid key "bad key" under mono fm-logbook-compose: skipping sub-project "emptyname" under mono (empty name or branch) fm-logbook-compose: skipping malformed sub-project line under mono: sub nodelims just words here → surviving keys: ["good-key","piped"]; piped keeps name "Display | With | Pipes" with branch feat/piped

fm-logbook-compose: skipping sub-project with invalid key "bad key" under mono
fm-logbook-compose: skipping sub-project "emptyname" under mono (empty name or branch)
fm-logbook-compose: skipping malformed sub-project line under mono: sub nodelims just words here
Evidence: Surviving well-formed declarations after malformed-line skip
{
  "projects": [
    {
      "name": "mono",
      "repo": "mono",
      "mode": "no-mistakes",
      "active": false,
      "subprojects": [
        {
          "key": "good-key",
          "name": "Good Name",
          "branch": "feat/good"
        },
        {
          "key": "piped",
          "name": "Display | With | Pipes",
          "branch": "feat/piped"
        }
      ]
    }
  ],
  "items": []
}
Evidence: Rendered HTML preview of the feed's sub-project grouping (built from the actual composed payload; no browser available to export a PNG)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Logbook feed — sub-project grouping preview</title>
<style>
  :root { color-scheme: light; }
  * { box-sizing: border-box; }
  body { margin: 0; padding: 32px; background: #0f172a; color: #e2e8f0;
         font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; }
  h1 { font-size: 20px; margin: 0 0 4px; }
  .sub { color: #94a3b8; font-size: 13px; margin: 0 0 24px; max-width: 820px; }
  .note { color:#64748b; font-size:12px; margin: 0 0 24px; }
  .board { display: grid; gap: 20px; max-width: 860px; }
  .project { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 18px 20px; }
  .project > header { display:flex; align-items:center; gap:10px; margin-bottom: 14px; }
  .pname { font-size: 16px; font-weight: 700; }
  .badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
  .mode { background:#334155; color:#cbd5e1; }
  .active { background:#064e3b; color:#6ee7b7; }
  .group { border-left: 3px solid #38bdf8; padding: 4px 0 4px 14px; margin: 12px 0; }
  .group.ungrouped { border-left-color: #475569; }
  .gname { font-size: 13px; font-weight: 700; color:#7dd3fc; margin-bottom: 8px; }
  .group.ungrouped .gname { color:#94a3b8; }
  .gbranch { font-weight: 400; color:#64748b; font-family: ui-monospace, monospace; font-size: 12px; }
  .card { background:#0f172a; border:1px solid #334155; border-radius: 8px; padding: 10px 12px; margin: 6px 0; }
  .ctitle { font-weight: 600; }
  .cmeta { color:#64748b; font-size: 12px; margin-top: 2px; font-family: ui-monospace, monospace; }
  .empty { color:#64748b; font-style: italic; font-size: 13px; }
</style>
</head>
<body>
<h1>Logbook attention board — how the emitted feed groups items</h1>
<p class="sub">A faithful preview of the <code>POST /api/sync</code> body produced by
<code>bin/fm-logbook-compose.sh</code>. Sub-projects are a <strong>display-only</strong> grouping level:
each project carries an ordered <code>subprojects</code> array, and each item is placed under a sub-project
only when its <code>base_branch</code> matches a declared branch. Everything else stays ungrouped.</p>
<p class="note">This is a rendering of the feed's grouping semantics for reviewer readability — the actual
board is the separate, already-merged logbook tool (out of scope, not cloned in this worktree).</p>
<div class="board" id="board"></div>
<script>
const payload = {
  "projects": [
    {
      "name": "zeigmal_mono",
      "repo": "zeigmal_mono",
      "mode": "no-mistakes",
      "active": true,
      "subprojects": [
        {
          "key": "placement-tool",
          "name": "Placement Tool",
          "branch": "feat/placement-tool"
        },
        {
          "key": "outdoor-tour-navigation",
          "name": "Outdoor Tour Navigation",
          "branch": "feat-outdoor-tour-navigation"
        }
      ]
    },
    {
      "name": "solo",
      "repo": "solo",
      "mode": "direct-PR",
      "active": true,
      "subprojects": []
    }
  ],
  "items": [
    {
      "id": "main-x2",
      "project": "zeigmal_mono",
      "kind": "fyi",
      "title": "Fix the shared header",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "main-x2"
      }
    },
    {
      "id": "place-x1",
      "project": "zeigmal_mono",
      "kind": "fyi",
      "title": "Wire the placement endpoint",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "place-x1"
      },
      "subproject": "placement-tool"
    },
    {
      "id": "solo-x4",
      "project": "solo",
      "kind": "fyi",
      "title": "Tidy the solo app",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "solo-x4"
      }
    },
    {
      "id": "tour-x3",
      "project": "zeigmal_mono",
      "kind": "fyi",
      "title": "Add the tour route",
      "body": "Work is underway.",
      "options": [],
      "source": {
        "task": "tour-x3"
      },
      "subproject": "outdoor-tour-navigation"
    }
  ]
};
const board = document.getElementById('board');
for (const p of payload.projects) {
  const el = document.createElement('div'); el.className = 'project';
  const modeBadge = p.mode ? '<span class="badge mode">'+p.mode+'</span>' : '';
  const activeBadge = p.active ? '<span class="badge active">active</span>' : '';
  el.innerHTML = '<header><span class="pname">'+p.name+'</span>'+modeBadge+activeBadge+'</header>';
  const items = payload.items.filter(i => i.project === p.name);
  const subs = p.subprojects || [];
  if (subs.length === 0) {
    el.innerHTML += '<div class="empty">no sub-projects declared — all items ungrouped</div>';
  }
  for (const s of subs) {
    const g = document.createElement('div'); g.className = 'group';
    g.innerHTML = '<div class="gname">'+s.name+' <span class="gbranch">('+s.branch+')</span></div>';
    const gi = items.filter(i => i.subproject === s.key);
    if (!gi.length) g.innerHTML += '<div class="empty">— no items on this branch —</div>';
    for (const i of gi) g.innerHTML += card(i);
    el.appendChild(g);
  }
  const ungrouped = items.filter(i => !i.subproject);
  if (ungrouped.length) {
    const g = document.createElement('div'); g.className = 'group ungrouped';
    g.innerHTML = '<div class="gname">Ungrouped</div>';
    for (const i of ungrouped) g.innerHTML += card(i);
    el.appendChild(g);
  }
  board.appendChild(el);
}
function card(i) {
  const sp = i.subproject ? 'subproject: '+i.subproject : 'no subproject (ungrouped)';
  return '<div class="card"><div class="ctitle">'+i.title+'</div>'+
         '<div class="cmeta">'+i.id+' · '+sp+'</div></div>';
}
</script>
</body>
</html>

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed ✅
  • ⚠️ docs/configuration.md:367 - Sub-project grouping only reaches the board on the compose->fm-logbook-sync.sh baseline (POST /api/sync). The rich cards firstmate escalates via fm-logbook-push.sh (POST /api/items) are unchanged and carry no subproject; docs lines 332-333 describe that upsert as a whole-item replace with full validation, so an item drops out of its sub-project group the moment it is enriched. Doc line 367 claims fm-logbook-compose.sh emits into the /api/items payloads, but compose only produces the /api/sync body and nothing sets subproject on a push. Confirm whether the board's /api/items upsert preserves an existing item's subproject on a partial re-upsert; if it does not, the most attention-worthy (decision/action) cards will be ungrouped, and either fm-logbook-push.sh should carry subproject or the doc's /api/items claim should be corrected.
  • ℹ️ bin/fm-logbook-compose.sh:278 - The new sub continuation-line format relies on each sub line immediately following its project's dash line so cur_project attributes it correctly. fm-home-seed.sh's sync_project_registry (line 754) reorders selected projects' dash lines to the end of the registry while passing non-dash sub lines through in place, which would detach/misattribute them in compose. This is latent-only today because sub-project declarations are never propagated into secondmate homes by seeding (registry_line_for_project emits only the dash line), so it is unreachable through normal flows; noting it so the invariant is recorded should sub declarations ever be added to a re-seeded home.

🔧 Fix: correct logbook sub-project doc to only feed /api/sync
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • bash tests/fm-logbook.test.sh — full logbook suite, 58 ok / 0 fail, including the 5 new sub-project tests (declares-ordered-subprojects, tags-item-by-base-branch, no-declaration-backward-compatible, skips-malformed-lines, project-mode-unaffected)
  • End-to-end: built a realistic zeigmal_mono monorepo fleet home and ran FM_HOME=... LOGBOOK_ENABLE=1 bin/fm-logbook-compose.sh, capturing the actual POST /api/sync body — verified ordered subprojects arrays, place-x1→placement-tool and tour-x3→outdoor-tour-navigation tagging, ungrouped main-x2/solo-x4, and stripped _base_branch helper
  • Malformed-line robustness: composed a registry with a bad-slug key, empty name, and missing-delimiter line — confirmed the 3 are dropped with skipping ... stderr warnings while the 2 valid ones (incl. a name containing |) survive with branch as the last field
  • Parser non-breakage: bin/fm-project-mode.sh zeigmal_mono → no-mistakes on and bin/fm-project-mode.sh solo → direct-PR off through the sub lines; awk &#39;$1==&#34;-&#34; &amp;&amp; $2!=&#34;&#34; {print $2}&#39; (fm-home-seed registry parse) collects only zeigmal_mono/solo, no sub keys
  • Backward-compat: composed the same no-declaration fleet under base commit 830c27d and the target commit — items byte-identical, projects differ only by the additive subprojects: []
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed (4) ✅
  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint issues found; scripts pass shellcheck 0.11.0
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint issues; scripts pass ShellCheck 0.11.0 clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint issues; scripts pass shellcheck 0.11.0 clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint issues; fm-lint.sh passes shellcheck 0.11.0 clean
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

Declare sub-projects per project in data/projects.md via non-dash "sub"
continuation lines ({key, name, branch}), tag each item by its base_branch
meta field, and emit the board's per-project subprojects arrays and per-item
subproject keys from fm-logbook-compose.sh. The "sub" leading token keeps the
existing $1=="-" registry parsers (fm-project-mode.sh, fm-home-seed.sh)
unaffected, so projects without declarations compose exactly as before.

docs/configuration.md owns the schema and the base_branch recording path.
@SchokoShake
SchokoShake merged commit 28b741d into main Jul 15, 2026
@SchokoShake
SchokoShake deleted the fm/logbook-subprojects-feed-c2 branch July 15, 2026 14:34
SchokoShake added a commit that referenced this pull request Jul 21, 2026
…awn reuse

Address the review on PR #7:

- treehouse_reservation replaces the boolean holds-check and captures the
  `treehouse status` exit code separately, so a treehouse outage reports
  could-not-ask instead of a false "no longer reserves" on every respawn (#1).
- Match the leased `(held by <holder>)` against this task's fm-<id>, so a
  worktree treehouse re-leased to a different task is caught, not silently
  adopted; an in-use row carries no holder, so the gate only strengthens (#3).
- Cover the lease-release trap for a turn-end hook-block failure between the
  lease and the meta write, the leak class new to this change (#2).
- Record the deliberate readiness-barrier trade at the cd site, marking the
  brief's isolation assertion load-bearing and forbidding a re-added pane probe (#4).
- Make the two treehouse human-text couplings a conscious v2.0.0 assumption;
  v2.0.0 has no --json/--porcelain and both fail loud-but-wrong (#5).

The test treehouse stub now records the real --lease-holder so status renders
the caller's fm-<id>, exercising the holder match faithfully.
SchokoShake added a commit that referenced this pull request Jul 22, 2026
…ane-cwd discovery (#7)

* fix(spawn): capture crew worktree via treehouse get --lease; guard against $FM_HOME

Every projects/* spawn recorded worktree=$FM_HOME (the primary checkout) in
state/<id>.meta instead of the crew's real ~/.treehouse/... worktree, forcing a
manual repair each time and risking teardown/review on the wrong path. The crew
itself was always fine; firstmate-self spawns were immune.

Root cause: worktree discovery sent `treehouse get` into the pane and polled
#{pane_current_path} until it differed from the project dir, taking that as the
worktree. Right after `tmux new-window -c <project>`, the pane process is still
the forked tmux-server child (the shell has not yet exec'd and chdir'd), so
#{pane_current_path} transiently reports the tmux SERVER's own cwd - $FM_HOME
(the server was started there) - before settling on the -c dir a moment later.
The poll's "any path != project dir" exit latched that transient $FM_HOME on the
first iteration of a projects/* spawn ($FM_HOME != $FM_HOME/projects/<repo>),
before `treehouse get` even ran; a firstmate-self spawn ($FM_HOME == project dir)
kept polling to the real worktree - the exact projects/*-only signature. kunchenguid#134's
stable-window-id targeting could not help: the correctly-targeted pane
transiently reports the server cwd.

Fix (bin/fm-spawn.sh):
- Capture authoritatively: lease from fm-spawn itself with `treehouse get
  --lease` (prints only the ~/.treehouse/... path to stdout, banners to stderr)
  and cd the pane into that exact path. No poll, no startup-transient race.
  worktree= and the turn-end hook use the leased path; fm-teardown's existing
  `treehouse return --force <worktree=>` releases it, same as before. Consistent
  with fm-home-seed.sh's existing lease pattern. Applies to every non-orca
  backend and to batch (which re-execs the single path per pair).
- Loud backstop in validate_spawn_worktree: assert the worktree is not the
  primary checkout ($FM_HOME/$FM_ROOT). Because firstmate is a git repo of
  itself, $FM_HOME is a valid git toplevel that cleared every prior clause
  silently; now a regression aborts loudly instead of corrupting meta.

Tests updated to the lease-based capture; new cases pin real-worktree capture
(never $FM_HOME) and the $FM_HOME abort. Docs: tmux-backend.md gains a
root-cause/verification section; architecture.md and herdr-backend.md corrected.
Root cause reproduced with tmux 3.6; fix verified end-to-end against real
treehouse (worktree= records a real .treehouse/... path, pane cd's into it).

Refs fm-spawn-wt-batch-x5.

* test(spawn): strengthen symlinked-prefix test with a tangle case guarding PROJ_ABS_REAL

Review (decision A, captain rule: fix the root cause, do not soften) found the
reframed test_spawn_symlinked_project_prefix_avoids_false_refusal no longer
exercised the PROJ_ABS_REAL canonicalization its comment claimed to guard: its
leased worktree was entirely distinct from the project, so validate_spawn_worktree's
only project-dependent clause (wt_real == proj_real) was never near-triggered and
the test would pass even if PROJ_ABS_REAL regressed to a logical PROJ_ABS.

Add a tangle case: the treehouse stub leases the PROJECT ITSELF reached back
through the symlinked prefix (physical path equal to the project), and the spawn
must be REFUSED with "did not yield an isolated worktree". That refusal holds
ONLY because validate_spawn_worktree resolves both sides with pwd -P; were
PROJ_ABS_REAL the logical PROJ_ABS the physical worktree path would compare
unequal and the tangle would be wrongly allowed. Test-only; bin/fm-spawn.sh
unchanged.

Refs fm-spawn-wt-batch-x5.

* no-mistakes(review): fix(spawn): release treehouse lease on abort; drop dead current_path ops

* no-mistakes(review): fix(spawn): reuse recorded worktree on respawn; refresh stale adapter docs

* no-mistakes(review): fix(spawn): gate respawn reuse on meta identity and lease reservation

* no-mistakes(review): extend respawn identity gate to recorded backend

* no-mistakes(review): scope respawn backend refusal to orca; derive --help range

* no-mistakes(document): sync backend docs with treehouse-lease worktree capture and respawn

* fix(spawn): distinguish treehouse-status failure and re-lease on respawn reuse

Address the review on PR #7:

- treehouse_reservation replaces the boolean holds-check and captures the
  `treehouse status` exit code separately, so a treehouse outage reports
  could-not-ask instead of a false "no longer reserves" on every respawn (#1).
- Match the leased `(held by <holder>)` against this task's fm-<id>, so a
  worktree treehouse re-leased to a different task is caught, not silently
  adopted; an in-use row carries no holder, so the gate only strengthens (#3).
- Cover the lease-release trap for a turn-end hook-block failure between the
  lease and the meta write, the leak class new to this change (#2).
- Record the deliberate readiness-barrier trade at the cd site, marking the
  brief's isolation assertion load-bearing and forbidding a re-added pane probe (#4).
- Make the two treehouse human-text couplings a conscious v2.0.0 assumption;
  v2.0.0 has no --json/--porcelain and both fail loud-but-wrong (#5).

The test treehouse stub now records the real --lease-holder so status renders
the caller's fm-<id>, exercising the holder match faithfully.

* no-mistakes(document): sync tmux worktree-capture doc with --lease-holder flag

---------

Co-authored-by: SchokoShake <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant