Skip to content

test: preserve Pi calm transcript captures with Pi 1.0 - #6338

Merged
kunchenguid merged 2 commits into
mainfrom
fm/fm-calm-pi-1-0-ci-break-r1
Oct 1, 2026
Merged

kunchenguid merged 2 commits into
mainfrom
fm/fm-calm-pi-1-0-ci-break-r1

Conversation

@kunchenguid

@kunchenguid kunchenguid commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Intent

Standing instruction: "Apply that same high standard to engineering excellence: lint, test failures, and test flakiness. If you see one, even if it is not caused by what you are working on right now, still get it fixed."

Context: this test failure blocks the merge of the authorized watcher-arm leak fix #6335. Firstmate CI installs the latest public Pi. The 6335 run at 18:51Z installed @earendil-works/[email protected] and Behavior portable serial 6 passed; the run at 19:33Z installed @earendil-works/[email protected] and tests/fm-calm-pi-extension.test.sh failed at about line 4196 with "not ok - calm mode was not off by default (missing: 'CALM_E2E_OUTPUT')" - the initial Pi 1.0.0 TUI capture omitted the earlier CALM_E2E_OUTPUT row. The 6335 worker reproduced the identical failure locally with Pi 1.0.0 on main's base tree 8f756bb (14 ok, 1 not ok), while the file passes with Pi 0.82.0. Failing job: https://github.com/kunchenguid/firstmate/actions/runs/36915119154/job/110547082399. Main's next CI run and every open PR are expected to hit it.

What Changed

  • Select --tui-mode regular for Pi calm test launches when supported, preserving terminal scrollback for transcript assertions while retaining older-version launch arguments.
  • Remove the Pi harness reference's outdated statement about the default TUI mode.

Root Cause

Pi 1.0.0 changed the default TUI to a fullscreen alternate-screen mode (--tui-mode <mode>, fullscreen (default); TuiAltScreen enters \x1b[?1049h). The scrollable transcript is application-owned: rows that leave the viewport stay reachable through Pi's own scroll keys but never enter terminal scrollback, so tmux capture-pane -S can no longer see them. Confirmed directly on the failing fixture: the pane ran with tmux #{alternate_on}=1, and scrolling Pi's own viewport to the top (tui.altScreen.top, Home) showed every asserted row, including CALM_E2E_OUTPUT. The transcript rendered correctly; only the capture path lost reachability.

This is a test-harness assumption broken by Pi 1.0.0's rendering, not a Calm behavior regression. Verified manually under Pi 1.0.0 fullscreen on the same fixture: /calm persisted on and correctly hid the collapsed thinking labels, the mid-turn working note, the Firstmate watcher tool call and result rows, and the synthetic presentation row, while keeping the documented pre-activation built-in tool rows and every genuine near-miss prompt. The Calm presentation adapters operate on the shared document/component layer, so they apply identically under both TUI modes.

Follow-up (not in scope)

Fullscreen is now Pi's default TUI mode, but these e2e tests pin regular, so Calm under fullscreen has no automated coverage. It was verified by hand on 1.0.0 as described above; a dedicated fullscreen-path check would be the follow-up.

Risk Assessment

✅ Low: The bounded test-only change preserves transcript assertions by selecting regular TUI rendering when supported, while retaining compatibility with older Pi versions.

Testing

Reproduced the baseline failure, then passed all affected live TUI scenarios on Pi 1.0.0 and 0.82.0, including fresh-process repeat checks. Corrected a fixture-reuse setup error. Captured terminal, HTML, and screenshot evidence and cleaned up. No pre-run baseline commands were supplied; no full suite or lint was run.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Restore a Pi 1.0.0 transcript and retain earlier tool output in terminal captures ✅ pass live baseline-pi100/run.log reproduces the failure; fixed-pi100/default.txt contains CALM_E2E_OUTPUT. Fresh isolated repeat runs also passed.
Deliver operational notifications once while Calm hides them and restart preserves semantics ✅ pass live test_operational_followup_turn_e2e in fixed-pi100/run.log and fixed-pi082/run.log
Press Escape with queued operational input without losing or duplicating delivery ✅ pass live test_queued_operational_escape_e2e in fixed-pi100/run.log and fixed-pi082/run.log
Expand, navigate, and restart hidden transcript blocks without introducing layout gaps ✅ pass live test_hidden_block_geometry_e2e in fixed-pi100/run.log and fixed-pi082/run.log; geometry terminal captures
Toggle Calm, resize and abort working turns, export the session, and preserve the choice across restart ✅ pass live test_interactive_terminal_e2e on both Pi versions; terminal captures, calm-export.html, and calm-export.png
Run the affected TUI checks on older Pi without passing an unsupported mode flag ✅ pass live fixed-pi082/run.log records Pi 0.82.0, no TUI mode arguments, and all four affected scenarios passing.
Evidence: Exact baseline Pi 1.0.0 failure reproduction

Source: Exact baseline Pi 1.0.0 failure reproduction

Pi version: 1.0.0
Selected TUI args: <none>
SCENARIO test_interactive_terminal_e2e
not ok - calm mode was not off by default (missing: 'CALM_E2E_OUTPUT')
--- output ---


 Thinking...


 fm_watch_arm_pi
 watcher: started Pi extension arm child 1



 FIRSTMATE WATCHER WAKE: signal: /tmp/probe.status

 Run bin/fm-wake-drain.sh first and handle the queued wake. Watcher continuity is extension-owned.



 FIRSTMATE WATCHER WAKE: can you explain this phrase?



 Captain quote: ⁣FIRSTMATE_OP: v1 watcher: QUOTED_CURRENT_NEAR_MISS



 FIRSTMATE_OP: v1 watcher: ASCII_ONLY_NEAR_MISS



 Ordinary captain text before ⁣FIRSTMATE_OP: v1 watcher: EMBEDDED_CURRENT_NEAR_MISS



 ⁣ordinary captain text after unrelated separator


 The deterministic tool example is complete.

 Warning: Could not restore model anthropic/claude-sonnet-4-5. Using calm-e2e/delayed

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
~/.no-mistakes/worktrees/52b07e9083e7/01M3WJ3SHSTCND9FGB0DAE76B6/.validation/tmp/fm-calm-pi-extension.FS1xxj/e2e-project (main)
↑7 ↓4 0.1%/4.1k (auto)                                                                                                                                                       delayed
Evidence: Affected live scenarios passing on Pi 1.0.0

Source: Affected live scenarios passing on Pi 1.0.0

Pi version: 1.0.0
Selected TUI args: --tui-mode regular
SCENARIO test_operational_followup_turn_e2e
ok - Pi operational follow-up E2E processes exact user-role notifications once while Calm hides current and adjacent rows, Calm off and absent render them, and restart preserves semantics
SCENARIO test_queued_operational_escape_e2e
ok - Pi 1.0.0 with Calm on hides and retains queued Firstmate input through Escape, delivers it once, and leaves Calm off stock
SCENARIO test_hidden_block_geometry_e2e
ok - Pi Calm native /skill:ahoy geometry keeps every collapsed thinking and tool block at zero height while preserving expansion, history, restart, and Calm-off rendering
SCENARIO test_interactive_terminal_e2e
ok - Pi calm native E2E replaces the stock working row with a moving, resize-clamped working ship that freezes and resumes across two working periods in one Pi session, clears on abort, keeps captain turns visible, hides exact operational user rows without changing persistence, restores stock rendering Calm-off, survives restart, and preserves export plus Ctrl+O behavior
Evidence: Affected live scenarios passing on Pi 0.82.0

Source: Affected live scenarios passing on Pi 0.82.0

Pi version: 0.82.0
Selected TUI args: <none>
SCENARIO test_operational_followup_turn_e2e
ok - Pi operational follow-up E2E processes exact user-role notifications once while Calm hides current and adjacent rows, Calm off and absent render them, and restart preserves semantics
SCENARIO test_queued_operational_escape_e2e
ok - Pi 0.82.0 with Calm on hides and retains queued Firstmate input through Escape, delivers it once, and leaves Calm off stock
SCENARIO test_hidden_block_geometry_e2e
ok - Pi Calm native /skill:ahoy geometry keeps every collapsed thinking and tool block at zero height while preserving expansion, history, restart, and Calm-off rendering
SCENARIO test_interactive_terminal_e2e
ok - Pi calm native E2E replaces the stock working row with a moving, resize-clamped working ship that freezes and resumes across two working periods in one Pi session, clears on abort, keeps captain turns visible, hides exact operational user rows without changing persistence, restores stock rendering Calm-off, survives restart, and preserves export plus Ctrl+O behavior
Evidence: Restored terminal transcript includes CALM_E2E_OUTPUT

Source: Restored terminal transcript includes CALM_E2E_OUTPUT


 ▀▀█  v1.0.0
 █▀ █ escape interrupt · ctrl+c/ctrl+d clear/exit · / commands · ! bash · ctrl+o more
 Press ctrl+o to show full startup help and loaded resources.

 Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.

[Extensions]
  fm-calm-e2e-inject.ts, fm-calm.ts, fm-primary-pi-watch.ts, fm-primary-turnend-guard.ts


 Show a deterministic tool example.


 Thinking...

 I will run one command.


 $ printf 'CALM_E2E_OUTPUT
 '

 CALM_E2E_OUTPUT


 Thinking...


 grep /CALM_EXPORT_GREP/ in .

 sample.txt:1:CALM_EXPORT_GREP



 find CALM_EXPORT_FIND* in .

 CALM_EXPORT_FIND.txt


 Thinking...


 fm_watch_arm_pi
 watcher: started Pi extension arm child 1



 FIRSTMATE WATCHER WAKE: signal: /tmp/probe.status

 Run bin/fm-wake-drain.sh first and handle the queued wake. Watcher continuity is extension-owned.



 FIRSTMATE WATCHER WAKE: can you explain this phrase?



 Captain quote: ⁣FIRSTMATE_OP: v1 watcher: QUOTED_CURRENT_NEAR_MISS



 FIRSTMATE_OP: v1 watcher: ASCII_ONLY_NEAR_MISS



 Ordinary captain text before ⁣FIRSTMATE_OP: v1 watcher: EMBEDDED_CURRENT_NEAR_MISS



 ⁣ordinary captain text after unrelated separator


 The deterministic tool example is complete.

 Warning: Could not restore model anthropic/claude-sonnet-4-5. Using calm-e2e/delayed

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
~/.no-mistakes/worktrees/52b07e9083e7/01M3WJ3SHSTCND9FGB0DAE76B6/.validation/tmp/fm-calm-pi-extension.8hJ4Fl/e2e-project (main)
↑7 ↓4 0.1%/4.1k (auto)                                                                                                                                                       delayed
Evidence: Real Pi-generated session export

Source: Real Pi-generated session export

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Session Export</title>
  <style>
    :root {
      --accent: #800080;
      --borderAccent: #800080;
      --customMessageLabel: #800080;
      --mdCode: #800080;
      --mdListBullet: #800080;
      --syntaxType: #800080;
      --border: #000080;
      --mdLink: #000080;
      --syntaxKeyword: #000080;
      --syntaxVariable: #008080;
      --success: #008000;
      --mdCodeBlock: #008000;
      --toolDiffAdded: #008000;
      --bashMode: #008000;
      --syntaxNumber: #800080;
      --error: #800000;
      --toolDiffRemoved: #800000;
      --warning: #808000;
      --mdHeading: #808000;
      --syntaxFunction: #808000;
      --syntaxString: #008000;
      --thinkingMinimal: #000080;
      --thinkingLow: #000080;
      --thinkingMedium: #008080;
      --thinkingHigh: #800080;
      --thinkingXhigh: #ff00ff;
      --thinkingMax: #800000;
      --text: #e5e5e7;
      --userMessageText: #e5e5e7;
      --customMessageText: #727273;
      --toolTitle: #e5e5e7;
      --syntaxOperator: #727273;
      --syntaxPunctuation: #727273;
      --muted: #727273;
      --dim: #727273;
      --thinkingText: #727273;
      --toolOutput: #727273;
      --mdLinkUrl: #727273;
      --mdQuote: #727273;
      --mdQuoteBorder: #727273;
      --mdHr: #727273;
      --mdCodeBlockBorder: #727273;
      --toolDiffContext: #727273;
      --syntaxComment: #727273;
      --scrollbarTrack: #727273;
      --scrollbarThumb: #727273;
      --searchMatchText: #727273;
      --borderMuted: #727273;
      --thinkingOff: #727273;
      --selectedBg: #000000;
      --searchMatchBg: #000000;
      --userMessageBg: #000000;
      --customMessageBg: #000000;
      --toolPendingBg: #000000;
      --toolSuccessBg: #000000;
      --toolErrorBg: #000000;
      --exportPageBg: rgb(0, 0, 0);
      --exportCardBg: rgb(0, 0, 0);
      --exportInfoBg: rgb(20, 15, 0);
      --body-bg: rgb(0, 0, 0);
      --container-bg: rgb(0, 0, 0);
      --info-bg: rgb(20, 15, 0);
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }

    :root {
      --line-height: 18px; /* 12px font * 1.5 */
      --sidebar-width: 400px;
      --sidebar-min-width: 240px;
      --sidebar-max-width: 840px;
      --sidebar-resizer-width: 6px;
    }

    body {
      font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
      font-size: 12px;
      line-height: var(--line-height);
      color: var(--text);
      background: var(--body-bg);
    }

    body.sidebar-resizing {
      cursor: col-resize;
      user-select: none;
    }

    #app {
      display: flex;
      min-height: 100vh;
    }

    /* Sidebar */
    #sidebar {
      width: var(--sidebar-width);
      min-width: var(--sidebar-width);
      max-width: var(--sidebar-width);
      background: var(--container-bg);
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      position: sticky;
      top: 0;
      height: 100vh;
      border-right: 1px solid var(--dim);
    }

    #sidebar-resizer {
      width: var(--sidebar-resizer-width);
      flex-shrink: 0;
      position: sticky;
      top: 0;
      height: 100vh;
      cursor: col-resize;
      touch-action: none;
      background: transparent;
      border-right: 1px solid transparent;
    }

    #sidebar-resizer:hover,
    body.sidebar-resizing #sidebar-resizer {
      background: var(--selectedBg);
      border-right-color: var(--dim);
    }

    .sidebar-header {
      padding: 8px 12px;
      flex-shrink: 0;
    }

    .sidebar-controls {
      padding: 8px 8px 4px 8px;
    }

    .sidebar-search {
      width: 100%;
      box-sizing: border-box;
      padding: 4px 8px;
      font-size: 11px;
      font-family: inherit;
      background: var(--body-bg);
      color: var(--text);
      border: 1px solid var(--dim);
      border-radius: 3px;
    }

    .sidebar-filters {
      display: flex;
      padding: 4px 8px 8px 8px;
      gap: 4px;
      align-items: center;
      flex-wrap: wrap;
    }

    .sidebar-search:focus {
      outline: none;
      border-color: var(--accent);
    }

    .sidebar-search::placeholder {
      color: var(--muted);
    }

    .filter-btn {
      padding: 3px 8px;
      font-size: 10px;
      font-family: inherit;
      background: transparent;
      color: var(--muted);
      border: 1px solid var(--dim);
      border-radius: 3px;
      cursor: pointer;
    }

    .filter-btn:hover {
      color: var(--text);
      border-color: var(--text);
    }

    .filter-btn.active {
      background: var(--accent);
      color: var(--body-bg);
      border-color: var(--accent);
    }

    .sidebar-close {
      display: none;
      padding: 3px 8px;
      font-size: 12px;
      font-family: inherit;
      background: transparent;
      color: var(--muted);
      border: 1px solid var(--dim);
      border-radius: 3px;
      cursor: pointer;
      margin-left: auto;
    }

    .sidebar-close:hover {
      color: var(--text);
      border-color: var(--text);
    }

    .tree-container {
      flex: 1;
      overflow: auto;
      padding: 4px 0;
    }

    .tree-node {
      padding: 0 8px;
      cursor: pointer;
      display: flex;
      align-items: baseline;
      font-size: 11px;
      line-height: 13px;
      white-space: nowrap;
    }

    .tree-node:hover {
      background: var(--selectedBg);
    }

    .tree-node.active {
      background: var(--selectedBg);
    }

    .tree-node.active .tree-content {
      font-weight: bold;
    }

    .tree-node.in-path {
      background: color-mix(in srgb, var(--accent) 10%, transparent);
    }

    .tree-node:not(.in-path) {
      opacity: 0.5;
    }

    .tree-node:not(.in-path):hover {
      opacity: 1;
    }

    .tree-prefix {
      color: var(--muted);
      flex-shrink: 0;
      font-family: monospace;
      white-space: pre;
    }

    .tree-marker {
      color: var(--accent);
      flex-shrink: 0;
    }

    .tree-content {
      color: var(--text);
    }

    .tree-role-user {
      color: var(--accent);
    }

    .tree-role-skill {
      color: var(--customMessageLabel);
    }

    .tree-role-assistant {
      color: var(--success);
    }

    .tree-role-tool {
      color: var(--muted);
    }

    .tree-muted {
      color: var(--muted);
    }

    .tree-error {
      color: var(--error);
    }

    .tree-compaction {
      color: var(--borderAccent);
    }

    .tree-branch-summary {
      color: var(--warning);
    }

    .tree-custom-message {
      color: var(--customMessageLabel);
    }

    .tree-status {
      padding: 4px 12px;
      font-size: 10px;
      color: var(--muted);
      flex-shrink: 0;
    }

    /* Main content */
    #content {
      flex: 1;
      min-width: 0;
      overflow-y: auto;
      padding: var(--line-height) calc(var(--line-height) * 2);
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    #content > * {
      width: 100%;
      max-width: 800px;
    }

    /* Help bar */
    .help-bar {
      font-size: 11px;
      color: var(--warning);
      margin-bottom: var(--line-height);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
    }

    .help-hint {
      flex: 1 1 240px;
    }

    .help-actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .header-toggle-btn,
    .download-json-btn {
      font-size: 10px;
      padding: 2px 8px;
      background: var(--container-bg);
      border: 1px solid var(--border);
      border-radius: 3px;
      color: var(--text);
      cursor: pointer;
      font-family: inherit;
    }

    .header-toggle-btn:hover,
    .download-json-btn:hover {
      background: var(--hover);
      border-color: var(--borderAccent);
    }

    .header-toggle-btn[aria-pressed="true"] {
      color: var(--accent);
      border-color: var(--accent);
      font-weight: bold;
    }

    /* Header */
    .header {
      background: var(--container-bg);
      border-radius: 4px;
      paddin

... [289894 bytes truncated] ...

hare:v1:sidebar-width';
      const MIN_CONTENT_WIDTH = 320;

      function isMobileLayout() {
        return window.matchMedia('(max-width: 900px)').matches;
      }

      function getSidebarBounds() {
        const rootStyles = getComputedStyle(document.documentElement);
        const minWidth = parseFloat(rootStyles.getPropertyValue('--sidebar-min-width')) || 240;
        const maxWidth = parseFloat(rootStyles.getPropertyValue('--sidebar-max-width')) || 720;
        const viewportMaxWidth = window.innerWidth - MIN_CONTENT_WIDTH;
        return {
          minWidth,
          maxWidth: Math.max(minWidth, Math.min(maxWidth, viewportMaxWidth))
        };
      }

      function clampSidebarWidth(width) {
        const { minWidth, maxWidth } = getSidebarBounds();
        return Math.max(minWidth, Math.min(maxWidth, width));
      }

      function applySidebarWidth(width) {
        document.documentElement.style.setProperty('--sidebar-width', `${Math.round(clampSidebarWidth(width))}px`);
      }

      function loadSidebarWidth() {
        try {
          const raw = localStorage.getItem(SIDEBAR_WIDTH_STORAGE_KEY);
          if (raw === null) return null;
          const width = Number(raw);
          return Number.isFinite(width) ? width : null;
        } catch {
          return null;
        }
      }

      function saveSidebarWidth(width) {
        try {
          localStorage.setItem(SIDEBAR_WIDTH_STORAGE_KEY, String(Math.round(clampSidebarWidth(width))));
        } catch {
          // Ignore storage failures (e.g. private browsing restrictions)
        }
      }

      function setupSidebarResize() {
        const savedWidth = loadSidebarWidth();
        if (savedWidth !== null) {
          applySidebarWidth(savedWidth);
        }

        if (!sidebarResizer) return;

        let cleanupDrag = null;

        const stopDrag = (pointerId) => {
          if (cleanupDrag) {
            cleanupDrag(pointerId);
            cleanupDrag = null;
          }
        };

        sidebarResizer.addEventListener('pointerdown', (e) => {
          if (isMobileLayout()) return;

          e.preventDefault();
          const startX = e.clientX;
          const startWidth = sidebar.getBoundingClientRect().width;
          document.body.classList.add('sidebar-resizing');
          sidebarResizer.setPointerCapture?.(e.pointerId);

          const onPointerMove = (event) => {
            applySidebarWidth(startWidth + (event.clientX - startX));
          };

          cleanupDrag = (pointerIdToRelease) => {
            document.body.classList.remove('sidebar-resizing');
            sidebarResizer.releasePointerCapture?.(pointerIdToRelease);
            window.removeEventListener('pointermove', onPointerMove);
            window.removeEventListener('pointerup', onPointerUp);
            window.removeEventListener('pointercancel', onPointerCancel);
            saveSidebarWidth(sidebar.getBoundingClientRect().width);
          };

          const onPointerUp = (event) => stopDrag(event.pointerId);
          const onPointerCancel = (event) => stopDrag(event.pointerId);

          window.addEventListener('pointermove', onPointerMove);
          window.addEventListener('pointerup', onPointerUp);
          window.addEventListener('pointercancel', onPointerCancel);
        });

        sidebarResizer.addEventListener('dblclick', () => {
          if (isMobileLayout()) return;
          applySidebarWidth(400);
          saveSidebarWidth(400);
        });

        window.addEventListener('resize', () => {
          if (isMobileLayout()) return;
          applySidebarWidth(sidebar.getBoundingClientRect().width);
        });
      }

      setupSidebarResize();

      hamburger.addEventListener('click', () => {
        sidebar.classList.add('open');
        overlay.classList.add('open');
        hamburger.style.display = 'none';
      });

      const closeSidebar = () => {
        sidebar.classList.remove('open');
        overlay.classList.remove('open');
        hamburger.style.display = '';
      };

      overlay.addEventListener('click', closeSidebar);
      document.getElementById('sidebar-close').addEventListener('click', closeSidebar);

      // Toggle states
      let thinkingExpanded = true;
      let toolOutputsExpanded = false;
      let showHiddenMessages = false;

      function setHiddenMessagesVisible(visible) {
        showHiddenMessages = visible;
        document.body.classList.toggle('show-hidden-messages', visible);
        const button = document.querySelector('[data-action="toggle-hidden-messages"]');
        if (button) {
          button.setAttribute('aria-pressed', String(visible));
          button.textContent = visible ? 'Hide hidden messages' : 'Show hidden messages';
        }
      }

      function setThinkingExpanded(expanded) {
        thinkingExpanded = expanded;
        document.querySelector('[data-action="toggle-thinking"]')?.setAttribute('aria-pressed', String(expanded));
        document.querySelectorAll('.thinking-text').forEach(el => {
          el.style.display = thinkingExpanded ? '' : 'none';
        });
        document.querySelectorAll('.thinking-collapsed').forEach(el => {
          el.style.display = thinkingExpanded ? 'none' : 'block';
        });
      }

      function setToolOutputsExpanded(expanded) {
        toolOutputsExpanded = expanded;
        document.querySelector('[data-action="toggle-tools"]')?.setAttribute('aria-pressed', String(expanded));
        document.querySelectorAll('.tool-output.expandable').forEach(el => {
          el.classList.toggle('expanded', toolOutputsExpanded);
        });
        document.querySelectorAll('.compaction').forEach(el => {
          el.classList.toggle('expanded', toolOutputsExpanded);
        });
        document.querySelectorAll('.skill-invocation').forEach(el => {
          el.classList.toggle('expanded', toolOutputsExpanded);
        });
      }

      const attachHeaderHandlers = () => {
        document.querySelector('[data-action="toggle-thinking"]')?.addEventListener('click', () => {
          setThinkingExpanded(!thinkingExpanded);
        });
        document.querySelector('[data-action="toggle-tools"]')?.addEventListener('click', () => {
          setToolOutputsExpanded(!toolOutputsExpanded);
        });
        document.querySelector('[data-action="toggle-hidden-messages"]')?.addEventListener('click', () => {
          setHiddenMessagesVisible(!showHiddenMessages);
        });
      };

      const isEditableTarget = (element) => {
        if (!element) return false;
        const tagName = element.tagName;
        if (tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT' || tagName === 'BUTTON') {
          return true;
        }
        return element.isContentEditable || Boolean(element.closest?.('[contenteditable="true"]'));
      };

      // Keyboard shortcuts
      document.addEventListener('keydown', (e) => {
        if (e.key === 'Escape') {
          searchInput.value = '';
          searchQuery = '';
          navigateTo(leafId, 'bottom');
        }

        if (e.ctrlKey || e.metaKey || e.altKey || isEditableTarget(document.activeElement)) {
          return;
        }

        const key = e.key.toLowerCase();
        if (key === 't') {
          e.preventDefault();
          setThinkingExpanded(!thinkingExpanded);
        } else if (key === 'o') {
          e.preventDefault();
          setToolOutputsExpanded(!toolOutputsExpanded);
        } else if (key === 'h') {
          e.preventDefault();
          setHiddenMessagesVisible(!showHiddenMessages);
        }
      });

      // Initial render
      // If URL has targetId, scroll to that specific message; otherwise stay at top
      if (leafId) {
        if (urlTargetId && byId.has(urlTargetId)) {
          // Deep link: navigate to leaf and scroll to target message
          navigateTo(leafId, 'target', urlTargetId);
        } else {
          navigateTo(leafId, 'none');
        }
      } else if (entries.length > 0) {
        // Fallback: use last entry if no leafId
        navigateTo(entries[entries.length - 1].id, 'none');
      }
    })();

  </script>
</body>
</html>
![Rendered Pi session export](https://github.com/user-attachments/assets/038fd395-1f6f-41f8-9471-8beb0e874ce4) - Evidence: [Rendered Pi session export](https://github.com/kunchenguid/firstmate/blob/151145baf0ce8c3193c1e90d3ae9e7051932e548/.no-mistakes/evidence/fm/fm-calm-pi-1-0-ci-break-r1/fixed-pi100/calm-export.png)
Evidence: Isolation, repeat-check correction, and evidence notes

Source: Isolation, repeat-check correction, and evidence notes

Targeted live validation of e58f3d0d58d26695cea9b3ed1c3216b5b4ebd5ec against base 8f756bbc287c5bdfacc64a7cc09e8516c64fc919.

Used the real Pi CLI on private fm-calm-<pid> tmux sockets with the test's explicit nonzero terminal sizes and disposable project/config/session/home directories inside the worktree. No live fleet or production credentials were used. Existing deterministic provider extensions supply responses, not a replacement Pi UI.

Baseline Pi 1.0.0: test_interactive_terminal_e2e reproduced the exact missing CALM_E2E_OUTPUT failure. This is an expected regression reproduction, not a target failure.
Fixed Pi 1.0.0 and installed Pi 0.82.0: operational follow-up, queued Escape, hidden-block geometry, and interactive terminal/export/restart scenarios all passed. Pi 1.0.0 selected --tui-mode regular; Pi 0.82.0 selected no mode flag.

Repeat-check setup correction: repeat-pi100/run.log first passed, then failed when the same non-reentrant test function was invoked twice inside one process. The function leaves its private session alive until the process EXIT trap and reuses fixture paths. This driver misuse was corrected by invoking fresh processes with fresh fixture roots/sockets. Both repeat-isolated-pi100-1 and repeat-isolated-pi100-2 passed; no product flakiness was reproduced.

Product evidence: actual tmux captures, Pi-generated session HTML, Chrome-rendered export DOM, and calm-export.png. The standalone Chrome screenshot command wrote the verified image but did not exit before its 60-second command deadline; no process using its disposable profile remained afterward. The scenario's own bounded Chrome DOM rendering completed successfully on both Pi versions.

No baseline pipeline commands were supplied in this turn. No full suite, lint, formatter, static-analysis, push, PR, CI, or pipeline-control commands were run. Temporary local Pi 1.0.0 installation, driver files, profiles, and fixtures were removed after validation.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Restore a Pi 1.0.0 transcript and retain earlier tool output in terminal captures ✅ pass live baseline-pi100/run.log reproduces the failure; fixed-pi100/default.txt contains CALM_E2E_OUTPUT. Fresh isolated repeat runs also passed.
Deliver operational notifications once while Calm hides them and restart preserves semantics ✅ pass live test_operational_followup_turn_e2e in fixed-pi100/run.log and fixed-pi082/run.log
Press Escape with queued operational input without losing or duplicating delivery ✅ pass live test_queued_operational_escape_e2e in fixed-pi100/run.log and fixed-pi082/run.log
Expand, navigate, and restart hidden transcript blocks without introducing layout gaps ✅ pass live test_hidden_block_geometry_e2e in fixed-pi100/run.log and fixed-pi082/run.log; geometry terminal captures
Toggle Calm, resize and abort working turns, export the session, and preserve the choice across restart ✅ pass live test_interactive_terminal_e2e on both Pi versions; terminal captures, calm-export.html, and calm-export.png
Run the affected TUI checks on older Pi without passing an unsupported mode flag ✅ pass live fixed-pi082/run.log records Pi 0.82.0, no TUI mode arguments, and all four affected scenarios passing.
  • npm install --prefix "$PWD/.validation/pi100" --no-audit --no-fund @earendil-works/[email protected]
  • Executed base-commit test_interactive_terminal_e2e against real Pi 1.0.0; reproduced the exact missing CALM_E2E_OUTPUT failure.
  • Executed test_operational_followup_turn_e2e, test_queued_operational_escape_e2e, test_hidden_block_geometry_e2e, and test_interactive_terminal_e2e against real Pi 1.0.0 and 0.82.0 using temporary targeted drivers.
  • Repeated test_interactive_terminal_e2e in two fresh isolated Pi 1.0.0 processes; both passed after correcting an invalid same-process fixture reuse.
  • Preserved tmux captures, Pi-generated HTML, Chrome-rendered DOM, and a visually inspected export screenshot. The standalone screenshot command produced its image before reaching its exit deadline.
  • Removed temporary installations, drivers, profiles, and fixtures; verified the worktree was clean.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…llback

Pi 1.0.0 defaults its TUI to a fullscreen alternate-screen mode whose
scrollable transcript is application-owned, so rows that leave the viewport
never enter terminal scrollback and tmux capture-pane -S can no longer see
them. The Pi Calm e2e launches now pass --tui-mode regular wherever the flag
exists so the transcript assertions keep reading real scrollback on both the
Pi 1.0.0 line and earlier Pi lines, which have no such flag and render
regular-only anyway.
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test harness adjusts for Pi 1.0 transcript capture behavior.

The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "no-mistakes(document): Correct Pi TUI do..."

@kunchenguid
kunchenguid merged commit 349e189 into main Oct 1, 2026
21 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-calm-pi-1-0-ci-break-r1 branch October 1, 2026 20:58
NewAiCoder pushed a commit to NewAiCoder/firstmate that referenced this pull request Oct 1, 2026
…ly called tests/fm-calm-pi-extension.test.sh "identical to upstream"; it was not. The current upstream main carries kunchenguid#6338 ("preserve Pi calm transcript captures with Pi 1.0"), which pins `pi --tui-mode regular` when the flag exists. Pi 1.0.0 defaults to a fullscreen alternate-screen TUI, so rows leave the viewport and tmux `capture-pane -S` never sees them. That is why the snapshot showed only the last ~44 rows and missed `CALM_E2E_OUTPUT`. I replaced the file with upstream's current version (23-line diff, only the `PI_TUI_MODE_ARGS` probe and its two launch lines). `bash -n` passes. I could not run it locally because `pi` is not installed here, so the proof will be the CI rerun. No bin/ or .pi/ change. Nothing committed or pushed. Herdr (ci-2): no code change, per the standing instruction to report and change nothing if the same lock error recurred. It did: `fm-backend-herdr-presentation-e2e.test.sh` fails again at "concurrent secondmate recovery" with "could not acquire its session lock" (5 s bounded wait). The test, lock code (fm-lock.sh, fm-backend.sh, the acquire loop in fm-spawn.sh) are byte-identical to upstream. The only fork-only work inside the lock's critical section is the memory-scope/systemd and MCP-config setup in fm-spawn.sh. This job passed on the aadb78b run and failed on c4da835 and cf1ac1f, so it is a timing race sensitive to hold time, and I cannot reproduce it here (local herdr is 0.9.0, not the pinned 0.7.4, and the test touches live herdr sessions). If it fails again after the Pi fix lands, the next step is to measure how long a resume spawn holds the session lock on the runner, and either move the fork's memory-scope setup out of the locked section or raise the 5 s wait
dscott98 added a commit to Simplifying-Cloud/firstmate that referenced this pull request Oct 2, 2026
…fix (upstream kunchenguid#6338 via PR 12) into the sandbox PR's CI base
ChristianAlexanderDiaz added a commit to ChristianAlexanderDiaz/firstmate that referenced this pull request Oct 2, 2026
…needed hunks from Kun's upstream commits e2668de (kunchenguid#6162) and 349e189 (kunchenguid#6338). Each hunk is copied exactly from upstream. None of the 8 custom commits were touched, and the PR diff never touched these files. Invariants and fixes: 1. **Pi tool header (`tests/fm-pi-branch-extension.test.sh`).** Invariant: with Calm off, a Firstmate self-rendered tool call header must match the installed Pi's stock header, and since Pi 0.99 that header includes the call's arguments. Two places must hold it: the `renderCall` for `fm_branch_outcomes` and the one for `fm_branch_processed`. I ported the `VERSION` import, the `stockToolCallHeader` helper, and the change to both `renderCall`s in `.pi/extensions/fm-branch-supervision.ts`. I also ported the test hunks: the stub's `VERSION` export (without it, every stub-based case would fail when the import is resolved), a new stubbed header test for Pi 0.87 and 0.99, and a stock-render comparison for `fm_branch_processed`. 2. **Git 2.55 local-clone race (`tests/fm-spawn-compact-adviser-disable-remote.test.sh`).** Invariant: provisioning a remote home must not fail on the loose-object copy of a local clone. Both clone sites in `bin/fm-remote-home-provision.sh` now use `--no-local` (the home clone and the project clone). 3. **Pi 1.0 Calm capture (`tests/fm-calm-pi-extension.test.sh`).** Invariant: transcript assertions that read tmux scrollback need Pi's regular TUI mode. I ported kunchenguid#6338's `PI_TUI_MODE_ARGS` and six of its seven launch lines. Once that cleared, a second Pi 0.99+ failure showed up (`rendered export DOM violated the Calm conversation boundary`), so I also ported kunchenguid#6162's export-DOM hunk, which handles the hidden hook-message rows. - I left the queued-escape launch line alone. Upstream's version of that line also carries kunchenguid#6162's status-log rework, which no failure needs, and pinning the mode by itself would conflict on the next merge. That case passes on Pi 1.0.0 in both modes: fullscreen in CI and locally, regular in 2 of 2 local runs. Not ported: the docs, `fm-dispatch-resolve`, `fm-brief-heading`, and `fm-supervision-host` hunks, kunchenguid#6162's queued-escape and older-Pi `makeHost` hunks, and kunchenguid#6338's `pi.md` hunk. Separately, `bin/fm-home-seed.sh:418` still does a local clone, as it does on upstream main where CI is green, so I didn't change it. Verification, run locally against Pi 1.0.0 (installed into a temp directory, the version CI uses): - **Before the fix:** the calm and branch-extension failures reproduced exactly as in CI. - **After the fix:** - The calm test exits 0 with 15 of 15 cases passing. - The branch-extension test exits 0 with 51 cases passing and none skipped. - The new header test fails without the extension fix and passes with it. - `fm-pi-primary-types` typechecks clean against Pi 1.0.0. - The remote seed test (`fm-spawn-compact-adviser-disable-remote`) passes 2 of 2, `fm-remote-secondmate-parent-binding` 6 of 6, `fm-secondmate-sync` 32 of 32, and `fm-remote-secondmate-lifecycle-e2e` 31 of 31. - The pinned ShellCheck lint passes, and `bash -n` passes under Bash 3.2. - **Not reproducible here:** the Git 2.55 race. Local Git is 2.54, so that fix is verified only by tests passing and by matching upstream. - **Merge check:** a simulated 3-way merge of all four files against both 349e and upstream main 8690c41 gives zero conflicts, and the result is byte-identical to upstream
d-ploutarchos added a commit to OK-LG/firstmate that referenced this pull request Oct 2, 2026
* test: preserve Pi calm transcript captures with Pi 1.0 (kunchenguid#6338)

* test(calm): pin Pi's regular TUI mode where pane assertions read scrollback

Pi 1.0.0 defaults its TUI to a fullscreen alternate-screen mode whose
scrollable transcript is application-owned, so rows that leave the viewport
never enter terminal scrollback and tmux capture-pane -S can no longer see
them. The Pi Calm e2e launches now pass --tui-mode regular wherever the flag
exists so the transcript assertions keep reading real scrollback on both the
Pi 1.0.0 line and earlier Pi lines, which have no such flag and render
regular-only anyway.

* no-mistakes(document): Correct Pi TUI documentation and scrollback rationale

* fix(bin): preserve hold reasons and reject invalid completion inventories (kunchenguid#6331)

* fix(bin): encode captain-hold reasons and reject self-inventory in complete

hold now stores a reason with parentheses, line breaks, or percent signs
through a reversible percent encoding that every reader decodes, instead of
refusing it. hold --origin records the origin on the held task, and complete
refuses the origin as its own inventory entry and an entry held for a
different origin; holds with no recorded origin are accepted and flagged.

* fix(review): Decode marked hold reasons consistently across readers

* fix(review): Remove unnecessary lifecycle test dispatch

* fix(review): Correct hold origin identity and inventory recovery

* fix(review): Record origins before placing backend holds

* fix(document): Clarify captain-hold validation and reason reader documentation

* fix(ci): Fixed both findings: failed backend holds restore the previous origin, and invalid base64/UTF-8 reasons remain verbatim. Added regressions and documented valid-literal ambiguity. Both failures were reproduced before fixes. Verification: 54 lifecycle tests and 9 wrapper tests passed; 7 Beads-specific cases skipped because tasks-axi is markdown-only. Focused lint and diff checks passed. No pipeline or publication actions performed

* fix: reclaim orphaned watcher arms on the next park (kunchenguid#6335)

* fix(bin): take over the watcher cycle a main-only pass-through leaves

An attended main-only pass-through leaves a successor watcher cycle
running through main's handling turn. The session's next park attached
to that cycle instead of owning it, so the successor's arm, orphaned by
its host's exit, kept owning the watcher while the new park's arm polled
it twice a second until the next close or the park boundary, hours later
in a quiet second mate. A second-mate restart hit this every time, since
its persist request is a main-only close.

The host now records the successor it leaves for main, and the next
host's first cycle runs bin/fm-watch-arm.sh --take-over on it: when that
arm still owns the healthy watcher, the new arm stops it, reports a
reason the cycle delivered first, and otherwise owns a fresh cycle. The
stop's own downtime publication is undone over an acknowledged episode
when no wake was appended in between, so the handover wakes nobody.

* no-mistakes(review): Keep left-arm record until the orphaned arm is gone

* no-mistakes(review): Relinquish successor arm only after durably recording it

* no-mistakes(review): Relinquish successor only after its record reads back

* no-mistakes(document): Clarify successor takeover guarantees and authoritative documentation

* no-mistakes(ci): Fixed ci-1: acknowledgement restore now requires the exact taken-over arm/watcher ledger row with signal=TERM, awaited within a short bound. Otherwise takeover proceeds without erasing downtime. Added a self-exit regression confirmed failing before the fix and passing afterward; ordinary takeover tests and the full watcher-arm suite pass. Updated Generation reuse documentation. Syntax, diff checks, and ShellCheck pass with existing SC1091/SC2034 warnings excluded. ci-2 remains unchanged

* no-mistakes(document): Clarify watcher take-over recovery and restart limits

* fix(bin): restore downtime on supervision-host hand-back when the successor already closed (kunchenguid#6355)

* fix(bin): restore supervision host hand-back continuity

* no-mistakes(review): Scope host hand-back failure fallback to lost pending:handling

* no-mistakes(review): Remove stray scratch test copy tests/.tmp-rest.test.sh

* no-mistakes(test): Initialise successor globals so early hand-back survives set -u

* no-mistakes(document): Document host hand-back downtime failure and Claude lost-handback notice

* no-mistakes(ci): I fixed the Greptile finding. The rule that must hold: when the supervision host hands back an actionable wake, its rewake is refused, and no watcher is healthy, the hand-back still has to reach main as a delivered notice. That must be true whether the recovery marker is `pending:handling` or `announced:handling`. Only one place applies this check: the lost hand-back fallback in `bin/fm-claude-stop-autoarm.sh`. **Fix:** that check now accepts both `pending:handling:*` and `announced:handling:*` tokens (a one-line change). Nothing else in the fallback changed: - Refusals on any other marker, such as an already acknowledged one, still exit 0 silently and open no failure episode. - The notice is still sent once per episode, and repeats are recorded as `failed-suppressed`. **Tests:** - `tests/fm-claude-stop-autoarm.test.sh`: the lost hand-back test now runs as a shared helper with two variants, one writing a `pending:handling` marker and a new one writing `announced:handling` (`test_host_lost_announced_handback_notifies_once_per_episode`). - `tests/fm-supervision-host.test.sh`: the end-to-end test where downtime restoration fails is now a shared helper too, with a new `announced` variant (`test_claude_stop_hook_notifies_when_closed_announced_successor_downtime_restore_fails`). It moves the handling episode to `announced` before the host hands back. Without the fix the hook would exit 0 here; the test requires exit 2, `outcome=failed` and a delivered failure notice. **Verification (all under nice -n 10):** - The full `tests/fm-claude-stop-autoarm.test.sh` suite passed (rc=0), including both lost hand-back variants and the benign-refusal test. - In `tests/fm-supervision-host.test.sh` I ran only the four hand-back test functions, all passing (rc=0). The suite can't run single functions, so I used a temporary copy with a trimmed test list and deleted it afterwards; `git status` shows only the 3 intended files changed. - shellcheck is clean on all three changed files. I did not run `bin/fm-lint.sh`. - I did not run the new tests against the unfixed code; the claim that they fail without the fix comes from reading the old check

---------

Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Mickaël Rémond <[email protected]>
Co-authored-by: Tiago <[email protected]>
Hozzy02 added a commit to Hozzy02/firstmate that referenced this pull request Oct 2, 2026
…n scrollback (#30)

Pi 1.0.0 puts call arguments on the stock tool header and defaults to a fullscreen TUI, so the unpinned CI install broke the stock-render comparison and the Calm e2e pane captures.
Port the upstream fixes (kunchenguid/firstmate kunchenguid#6162 Pi parts, kunchenguid#6338): version-gated call headers for fm_branch_outcomes and fm_branch_processed, and --tui-mode regular for Calm e2e launches where the flag exists.
bramdokman pushed a commit to bramdokman/firstmate that referenced this pull request Oct 3, 2026
Upstream advanced by 30 commits. They include upstream's own fixes for
CI drift that turned this branch's CI red after b5fdf74: Pi 0.99/1.0
rendering in the Calm and branch-supervision Pi tests (kunchenguid#6162, kunchenguid#6338) and
the Git 2.55 local-clone race in remote home provisioning (kunchenguid#6162).

The only conflict is the portable-serial weight-hint table in
bin/fm-test-run.sh, which upstream regenerated (kunchenguid#6192). Upstream's table
is taken as-is, with the duration hints for the two fork-only suites
(fm-issue-closure, fm-task-bootstrap) re-added in sorted position.
Every other fork hunk merges unchanged.
adriantoczydlowski added a commit to adriantoczydlowski/firstmate that referenced this pull request Oct 3, 2026
* fix(ci): follow Pi 1.0 in the Pi extension suites and pin CI's Pi install

CI installed the Pi package unpinned, so Pi 0.99 and 1.0.0 turned the
portable serial shards red with no change in this repository. Every change
was a deliberate, changelog-documented Pi feature:

- 0.99: tool calls without a custom call renderer show their arguments in
  the stock header, so fm_branch_outcomes and fm_branch_processed no longer
  matched stock while Calm is off.
- 0.99: HTML exports render display:false custom messages as rows hidden by
  default (H toggle), instead of omitting them.
- 1.0.0: the TUI defaults to fullscreen, whose transcript never enters
  terminal scrollback, so pane-capture assertions lost their rows.

Port the Pi-only parts of upstream's fixes (kunchenguid#6162, kunchenguid#6338): match the stock
call header by loaded Pi version, assert the export boundary on the visible
column, launch the Calm e2e Pi with --tui-mode regular where the flag
exists, and correct the docs those changes made wrong.

Pin CI's Pi install to one exact version (1.0.0) owned by the workflow env,
warn on each run while npm has a newer Pi, and guard in
tests/fm-ci-workflow.test.sh that every CI Pi install requests exactly
that pin.

* no-mistakes: apply CI fixes

* fix(quota): read the single-provider table from a here-string

The lookup returns at its first match, so the process-substituted table
writer could hit EPIPE and print a write error where SIGPIPE is ignored,
as on CI runners, adding a stray stderr line to fm-dispatch-resolve.

---------

Co-authored-by: Adrian Toczydłowski <[email protected]>
jredgard pushed a commit to jredgard/firstmate that referenced this pull request Oct 3, 2026
)

* test(calm): pin Pi's regular TUI mode where pane assertions read scrollback

Pi 1.0.0 defaults its TUI to a fullscreen alternate-screen mode whose
scrollable transcript is application-owned, so rows that leave the viewport
never enter terminal scrollback and tmux capture-pane -S can no longer see
them. The Pi Calm e2e launches now pass --tui-mode regular wherever the flag
exists so the transcript assertions keep reading real scrollback on both the
Pi 1.0.0 line and earlier Pi lines, which have no such flag and render
regular-only anyway.

* no-mistakes(document): Correct Pi TUI documentation and scrollback rationale

(cherry picked from commit 349e189)
jredgard pushed a commit to jredgard/firstmate that referenced this pull request Oct 3, 2026
)

* test(calm): pin Pi's regular TUI mode where pane assertions read scrollback

Pi 1.0.0 defaults its TUI to a fullscreen alternate-screen mode whose
scrollable transcript is application-owned, so rows that leave the viewport
never enter terminal scrollback and tmux capture-pane -S can no longer see
them. The Pi Calm e2e launches now pass --tui-mode regular wherever the flag
exists so the transcript assertions keep reading real scrollback on both the
Pi 1.0.0 line and earlier Pi lines, which have no such flag and render
regular-only anyway.

* no-mistakes(document): Correct Pi TUI documentation and scrollback rationale

(cherry picked from commit 349e189)
jredgard added a commit to jredgard/firstmate that referenced this pull request Oct 3, 2026
* Resolve no-mistakes skips explicitly at task intake

Carry nmskip registry preferences through brief, spawn, promotion, and relaunch contracts without changing repository lint configuration. Limit intake skips to lint, test, and document and merge Gerrit publication skips into the driving instruction.

Verified 2026-10-03: five focused behavior suites pass (FM_TEST_SUMMARY total=5 failed=0 skipped_gate=0); canonical local and explicit source-aware fm-lint pass with ShellCheck 0.11.0 and actionlint 1.7.12; documentation audience and coverage guards pass. Existing no-skip renderer output remains byte-identical across five delivery/forge combinations and both wait settings.

* no-mistakes(review): Restrict intake no-mistakes skips to lint only

* no-mistakes(review): Scope lint skip notices and align intake contracts

* no-mistakes(document): Document nmskip=lint in scripts, Gerrit, project-management docs

* test: preserve Pi calm transcript captures with Pi 1.0 (kunchenguid#6338)

* test(calm): pin Pi's regular TUI mode where pane assertions read scrollback

Pi 1.0.0 defaults its TUI to a fullscreen alternate-screen mode whose
scrollable transcript is application-owned, so rows that leave the viewport
never enter terminal scrollback and tmux capture-pane -S can no longer see
them. The Pi Calm e2e launches now pass --tui-mode regular wherever the flag
exists so the transcript assertions keep reading real scrollback on both the
Pi 1.0.0 line and earlier Pi lines, which have no such flag and render
regular-only anyway.

* no-mistakes(document): Correct Pi TUI documentation and scrollback rationale

(cherry picked from commit 349e189)

* no-mistakes(ci): The CI failure was in tests/fm-calm-pi-extension.test.sh, not in this PR's code. CI installs the latest Pi, and this run got 1.0.1. The base commit passed CI on Pi 0.99.2, and upstream main passes on 1.0.0. In 1.0.1, Pi renamed the lookup that `createToolHtmlRenderer` reads from `deps.getToolDefinition` to `deps.getToolRenderers`. The tests passed only `getToolDefinition`. Under 1.0.1, the lookup call throws, the renderer catches the error and returns `undefined`, and the test fails with "grep disappeared from /export calm.html HTML while calm mode was on". Invariant: every renderer the tests build must give the installed Pi its tool lookup under the name that version reads. Four test sites build this renderer, and I changed all four the same way: each passes the same lookup under both `getToolDefinition` (Pi before 1.0.1) and `getToolRenderers` (1.0.1). Older versions ignore the new name, so nothing changes for them. Two sites are in tests/fm-calm-pi-extension.test.sh: `assertStockHtmlRendering` and `unmatchedRenderer`. They share one `findTool` lookup. The other two are in tests/fm-pi-branch-extension.test.sh (`stockHtml` and `actualHtml`). That test expects `undefined`, and under 1.0.1 it was passing only because the lookup threw. Now it passes because the renderer really defers to Pi's own fallback. I changed no production code. Verification: I installed Pi 1.0.1 under /tmp in the same layout a global npm install uses and pointed `FM_PI_PACKAGE_DIR` at it. Before the fix, the CI failure reproduced exactly. After the fix, 14 steps of fm-calm-pi-extension pass, including the export step that failed in CI and the tmux follow-up, queued-row and geometry cases. fm-pi-branch-extension passes in full (51 ok, rc=0). Under the local Pi 0.87.1, both tests give the same results: 14 ok, and 51 ok with rc=0. Two local-only limits: 1. My ~/.tmux.conf sets `default-shell /bin/fish`, which can't parse the test's bash launch command, so the tmux cases fail locally whatever the change. I ran with `HOME` pointed at an empty temp directory to avoid that. This explains the "did not reach the ready composer" failure reported in the previous round. 2. No Chrome or Chromium is on PATH here, so the last rendered-export-DOM step in fm-calm-pi-extension did not run locally. Under both Pi versions it stops at that step with "Chrome or Chromium is required". The CI runner has Chrome, so CI will be the first run of that step under 1.0.1

---------

Co-authored-by: johannesr <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
jredgard added a commit to jredgard/firstmate that referenced this pull request Oct 3, 2026
…eway (#23)

* fix: bind Claude worker settings to the home LiteLLM gateway

* no-mistakes(review): Select Claude gateway projects exclusively by URL port

* no-mistakes(review): Isolate test gateway environment and cover empty URL refusal

* no-mistakes(test): Pre-validate Claude gateway binding before relaunch stops agent

* no-mistakes(document): Document gateway refuse-before-stop check in relaunch transaction

* no-mistakes(lint): Suppress intentional SC2016 in Claude gateway key helper

* test: preserve Pi calm transcript captures with Pi 1.0 (kunchenguid#6338)

* test(calm): pin Pi's regular TUI mode where pane assertions read scrollback

Pi 1.0.0 defaults its TUI to a fullscreen alternate-screen mode whose
scrollable transcript is application-owned, so rows that leave the viewport
never enter terminal scrollback and tmux capture-pane -S can no longer see
them. The Pi Calm e2e launches now pass --tui-mode regular wherever the flag
exists so the transcript assertions keep reading real scrollback on both the
Pi 1.0.0 line and earlier Pi lines, which have no such flag and render
regular-only anyway.

* no-mistakes(document): Correct Pi TUI documentation and scrollback rationale

(cherry picked from commit 349e189)

---------

Co-authored-by: johannesr <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
ryannmicua added a commit to ryannmicua/firstmate that referenced this pull request Oct 5, 2026
* test(pi): port Pi 1.0 compatibility from upstream firstmate

Ports the Pi rendering hunks of upstream kunchenguid/firstmate commits
e2668de (kunchenguid#6162), 349e189 (kunchenguid#6338) and fede619 (kunchenguid#6530): regular TUI mode
pin for captured scrollback, getToolRenderers lookup for Pi 1.0.1 HTML export,
hidden hook-message tolerant export DOM check, and the branch-supervision
renderer header match.

* no-mistakes(review): Remove generic fallback from Pi tool headers

* no-mistakes(document): Documented Calm branch-tool visibility

* no-mistakes(ci): Kept the Pi test assertions in separate .mjs files, reducing ShellCheck’s shell input. Both lint partitions passed once; 1of2 peaked near 5.8 GiB RSS, and 2of2 near 11.6 GiB. `git diff --check` passed. Changes remain uncommitted because committing would write to the gate repository outside the permitted worktree
max-metaplanet pushed a commit to max-metaplanet/firstmate that referenced this pull request Oct 6, 2026
)

* test(calm): pin Pi's regular TUI mode where pane assertions read scrollback

Pi 1.0.0 defaults its TUI to a fullscreen alternate-screen mode whose
scrollable transcript is application-owned, so rows that leave the viewport
never enter terminal scrollback and tmux capture-pane -S can no longer see
them. The Pi Calm e2e launches now pass --tui-mode regular wherever the flag
exists so the transcript assertions keep reading real scrollback on both the
Pi 1.0.0 line and earlier Pi lines, which have no such flag and render
regular-only anyway.

* no-mistakes(document): Correct Pi TUI documentation and scrollback rationale