Skip to content

fix(pi): match stock tool rendering across Pi versions - #9

Merged
ryannmicua merged 4 commits into
mainfrom
fm/fm-pi1-ci-compat
Oct 5, 2026
Merged

ryannmicua merged 4 commits into
mainfrom
fm/fm-pi1-ci-compat

Conversation

@ryannmicua

@ryannmicua ryannmicua commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Intent

Continue resolving #8 (retry exact pending steering doorbells).

Context: PR 8's CI has two failing behavior shards that are unrelated to its change: "Behavior portable serial 2" fails in the Pi Calm renderer test with "grep disappeared from /export calm.html HTML while calm mode was on", and "Behavior portable serial 4" fails with "Calm-off ToolExecutionComponent rendering differs from Pi stock". CI installs the Pi package unpinned; the last green main run on 2026-09-28 installed @earendil-works/pi-coding-agent 0.87.1, while PR 8's run installed 1.0.2. Upstream kunchenguid/firstmate already fixed this breakage, in commits e2668de (kunchenguid#6162, portable CI behavior across Pi rendering), 349e189 (kunchenguid#6338, preserve Pi calm transcript captures with Pi 1.0) and fede619 (kunchenguid#6530, accept Pi 1.0.1's renamed HTML export renderer lookup). This fork is 164 commits behind upstream, so a full upstream sync is not part of this task.

What Changed

  • Made supervision tool call headers follow the loaded Pi version, including argument display in collapsed and expanded calls on Pi 0.99+.
  • Updated Pi compatibility checks for regular TUI mode, both HTML renderer lookup APIs, and export rows that may be omitted or hidden by default.
  • Updated Calm documentation and regression coverage for fm_branch_processed and Pi’s version-dependent rendering.

Risk Assessment

⚠️ Medium: The source change is narrowly scoped, but the new export guard can miss visible hidden-message rows and is brittle to equivalent Pi rendering changes.

Testing

The focused Calm E2E runs passed against isolated Pi 1.0.1 and 1.0.2, and live Pi TUI runs confirmed the supervision header behavior on 0.87.1 and 1.0.2. The Pi 1.0.2 call/result blocks matched stock rendering when collapsed and expanded. Early Chrome attempts hit a Unix socket path limit caused by the long worktree TMPDIR; a worktree-local wrapper set TMPDIR to . and the completed reruns passed. Temporary test data was removed from the worktree.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Export a Calm session in Pi 1.0.2: genuine conversation stays visible, generated operational entries remain hidden by default, and session-tree entries are retained. ✅ pass live Pi 1.0.2 Calm live run; Pi 1.0.2 rendered Calm export screenshot
Export a Calm session in Pi 1.0.1: the renamed renderer lookup still produces the expected visible and hidden transcript behavior. ✅ pass live Pi 1.0.1 Calm live run; Pi 1.0.1 exported HTML
Open a session containing both supervision tools: Pi 1.0.2 Firstmate call and result rows match stock rendering in collapsed and expanded states, while Pi 0.87.1 keeps title-only call headers. ✅ pass live Pi 1.0.2 live stock comparison, collapsed and expanded; Pi 1.0.2 and Pi 0.87.1 branch tool TUI transcripts

Pi 1.0.2 rendered Calm export screenshot

Evidence: Pi 1.0.2 exported HTML

Source: Pi 1.0.2 exported HTML

<!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

... [289906 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>
Evidence: Pi 1.0.2 Calm live run

Source: Pi 1.0.2 Calm live run

ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
ok - Pi calm centralizes transcript visibility, preserves execution/export data, keeps Pi's stock working row visible while no run is active, and persists its choice across session starts
ok - Pi calm on collapses mid-turn assistant working notes to zero height while Calm off keeps them, leaves streaming, truncated-final, and genuine final replies untouched, never mutates the messages, ignores every /calm argument, and restores a legacy persisted max as ordinary Calm on
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
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
ok - Pi Calm working ship keeps its centered two-row asymmetric Unicode boat inside a deterministic long-wave trough, paints all water standard blue and the whole boat standard yellow with balanced resets, keeps ANSI-stripped width exact, reverses cleanly at both edges and every width, clamps visible and hidden resizes, falls back deterministically when narrow, freezes and resumes across settle/start without hidden-time jumps or duplicate timers, resets only on a fresh session, and leaves Calm-off visibility untouched
ok - the rendered-export-DOM guard renders in one pass, retries a bounded number of Chrome start-up failures, and reports the Chrome binary, Chrome version, Pi version, exit status, and Chrome diagnostic when every attempt fails
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: Pi 1.0.1 Calm live run

Source: Pi 1.0.1 Calm live run

ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
ok - Pi calm centralizes transcript visibility, preserves execution/export data, keeps Pi's stock working row visible while no run is active, and persists its choice across session starts
ok - Pi calm on collapses mid-turn assistant working notes to zero height while Calm off keeps them, leaves streaming, truncated-final, and genuine final replies untouched, never mutates the messages, ignores every /calm argument, and restores a legacy persisted max as ordinary Calm on
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
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
ok - Pi Calm working ship keeps its centered two-row asymmetric Unicode boat inside a deterministic long-wave trough, paints all water standard blue and the whole boat standard yellow with balanced resets, keeps ANSI-stripped width exact, reverses cleanly at both edges and every width, clamps visible and hidden resizes, falls back deterministically when narrow, freezes and resumes across settle/start without hidden-time jumps or duplicate timers, resets only on a fresh session, and leaves Calm-off visibility untouched
ok - the rendered-export-DOM guard renders in one pass, retries a bounded number of Chrome start-up failures, and reports the Chrome binary, Chrome version, Pi version, exit status, and Chrome diagnostic when every attempt fails
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: Pi 1.0.2 live stock comparison, collapsed and expanded

Source: Pi 1.0.2 live stock comparison, collapsed and expanded

collapsed: Firstmate fm_branch_outcomes and fm_branch_processed call/result rows match Pi 1.0.2 stock
expanded: Firstmate fm_branch_outcomes and fm_branch_processed call/result rows match Pi 1.0.2 stock
Evidence: Pi 1.0.2 branch tool TUI transcript

Source: Pi 1.0.2 branch tool TUI transcript


 ▀▀█  v1.0.2
 █▀ █ 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-branch-supervision.ts


 Inspect the pending supervision state.



 fm_branch_outcomes recent=2
 No supervision outcomes.



 fm_branch_processed through=1
 acknowledged through 1


 Both supervision checks are complete.

 Warning: No models available. Use /login to log into a provider via OAuth or API key. See:

 ~/.no-mistakes/worktrees/ff5e17b6f5de/01M44MQ3XAX2M58C71XCP62V1X/.tmp-validation/pi-1.0.2/node_modules/@earendil-works/pi-coding-a
 gent/docs/providers.md

 ~/.no-mistakes/worktrees/ff5e17b6f5de/01M44MQ3XAX2M58C71XCP62V1X/.tmp-validation/pi-1.0.2/node_modules/@earendil-works/pi-coding-a
 gent/docs/models.md

 Warning: tmux extended-keys is off. Modified Enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.

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

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
~/.no-mistakes/worktrees/ff5e17b6f5de/01M44MQ3XAX2M58C71XCP62V1X/.tmp-validation/branch-live-project (detached)
↑24 ↓9 0.0%/0 (auto)                                                                                                                 unknown
Evidence: Pi 0.87.1 branch tool TUI transcript

Source: Pi 0.87.1 branch tool TUI transcript


 pi v0.87.1
 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-branch-supervision.ts


 Inspect the pending supervision state.



 fm_branch_outcomes
 No supervision outcomes.



 fm_branch_processed
 acknowledged through 1


 Both supervision checks are complete.

 Warning: No models available. Use /login to log into a provider via OAuth or API key. See:
   ~/.pi/agent/install/releases/0.87.1/node_modules/@earendil-works/pi-coding-agent/docs/providers.md
   ~/.pi/agent/install/releases/0.87.1/node_modules/@earendil-works/pi-coding-agent/docs/models.md

 Warning: tmux extended-keys is off. Modified Enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.

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

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
~/.no-mistakes/worktrees/ff5e17b6f5de/01M44MQ3XAX2M58C71XCP62V1X/.tmp-validation/branch-live-project (detached)
↑24 ↓9 0.0%/0 (auto)                                                                                                                 unknown
Evidence: Pi branch extension regression run

Source: Pi branch extension regression run

ok - fm_branch_outcomes and fm_branch_processed call headers match stock on Pi before and from 0.99
skip: installed @earendil-works/pi-coding-agent package not found
skip: installed @earendil-works/pi-coding-agent package not found
ok - branch owns accepted wakes with a stable prefix and deterministic verdict-driven delivery
ok - a captain outcome reaches main's model as one typed, sequence-keyed processing request while routine notes stay plain
ok - requested and unsolicited healthy outcomes keep distinct delivery and event ownership
ok - captain outcomes are exact and exactly once across crash, reload, busy main, compaction, and an unrelated assistant response
ok - a captain outcome opens one sequence-keyed processing turn, survives empty and unrelated answers, is re-presented at run end and session start, and closes only on its acknowledgement
ok - scopeForUnreadWake excludes every main-only class without vetoing eligible task-local rows, and writes the eligible snapshot
ok - branch prompt_cache_key is stable per home across sessions and distinct between homes
ok - branch default-on eligibility (task-scoped, heartbeat, legacy flag ignored) binds and a broken branch rejects to watcher fallback
ok - under the away-posture record the wake carries the verbatim read-back tail, claims every row, opens no processing turn, cancels a pending request, and presents the accumulated rows after archive
ok - an accepted away-only wake rejects after archive, while a drained task-local wake stays a quiet no-op
ok - a claimed heartbeat row on a non-heartbeat away wake lifts task scoping for the fleet report
ok - a heartbeat review survives a check row arriving before its drain
ok - fm_branch_report refuses a task the wake did not name, fleet included, while a heartbeat is unscoped
ok - pre-drain eligibility re-check excludes a newly main-owned row without deferring eligible work
ok - a co-present needs-decision row neither vetoes nor falsely settles routine branch delivery
ok - a settled branch turn without a durable outcome falls back and releases its grant for main replay
ok - provider-error latches cool down, re-probe once with backoff, and recover through a durable report
ok - selection changes preserve in-flight transcript ownership and reset provider-error streaks
ok - a stale main claim returns the durable wake to watcher delivery
ok - pre-drain eligibility re-check no-ops an already-drained wake
ok - dialog mirror filters tool and operational traffic, lands before wakes, and keeps a durable cursor
ok - the dialog mirror re-anchors for each session's new branch conversation and stays incremental within it
ok - every main session start begins a new branch conversation while one session keeps its own
ok - the current pin state binds every branch build, and clearing it returns the branch to main's model
ok - unpinned branches follow main model changes live while pinned branches stay fixed
ok - supervision-model command persists the captain's pick and rebinds the live branch
ok - supervision-model opens a bounded searchable list, follow main first, and pins the branch alone
ok - branch model picker keeps follow main first and filters the eligible catalog
ok - the effort pin binds every branch build, and clearing it returns the branch to main's effort
ok - unpinned branches follow main effort changes live while pinned branches stay fixed
ok - an extension-registered provider resolves in the isolated branch runtime
ok - supervision-model runs an effort picker after the model picker and persists both independently
ok - an unusable model pin rejects to watcher fallback and an unparseable one is treated as no pin
ok - replacement activation cleans old branch leases and retries failed cleanup
ok - branch activates on a cold start once the lock is acquired, never before
ok - queued wakes and mirrors stop mutating branch state after lock ownership is lost
ok - stale reports, shells, mirrors, cursors, leases, and prompts perform no side effects
ok - a Pi session that does not own the lock accepts nothing and mutates no branch state
ok - an extension rebind re-mirrors undelivered dialog instead of dropping it
ok - outcome delivery keeps the event loop running and interleaved reports stay ordered and exactly once
ok - a session replaced mid-delivery cancels cleanly and the stored outcome still arrives exactly once
ok - a failing store script surfaces to the branch and its outcome is neither lost nor delivered twice
ok - a failed cursor write re-delivers a routine note exactly once more while a captain outcome stays deduplicated

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning
  • ⚠️ .pi/extensions/fm-branch-supervision.ts:2178 - The primitive/array argument fallback is outside the stated compatibility need: both consumers use Type.Object schemas (.pi/extensions/fm-branch-supervision.ts:2202, :2264) and call this helper at :2210 and :2272; the new header test also supplies object arguments (tests/fm-pi-branch-extension.test.sh:4582). Remove this fallback to keep the helper scoped to its actual inputs; retaining generic invalid-argument behavior would need authorization.

🔧 Fix applied.
1 warning still open:

  • ⚠️ tests/fm-calm-pi-extension.test.sh:3880 - This newly added export guard infers default-hidden behavior from serialized markup and CSS text at :3876 and :3880, then strips rows by class at :3894–3920 without checking their rendered visibility. A row can therefore be visible if the matching CSS rule is overridden, yet be removed from the leak check. Check each row’s computed visibility in Chrome instead of relying on the CSS text.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Export a Calm session in Pi 1.0.2: genuine conversation stays visible, generated operational entries remain hidden by default, and session-tree entries are retained. ✅ pass live Pi 1.0.2 Calm live run; Pi 1.0.2 rendered Calm export screenshot
Export a Calm session in Pi 1.0.1: the renamed renderer lookup still produces the expected visible and hidden transcript behavior. ✅ pass live Pi 1.0.1 Calm live run; Pi 1.0.1 exported HTML
Open a session containing both supervision tools: Pi 1.0.2 Firstmate call and result rows match stock rendering in collapsed and expanded states, while Pi 0.87.1 keeps title-only call headers. ✅ pass live Pi 1.0.2 live stock comparison, collapsed and expanded; Pi 1.0.2 and Pi 0.87.1 branch tool TUI transcripts
  • Installed disposable Pi 1.0.1 and 1.0.2 packages under the worktree and ran tests/fm-calm-pi-extension.test.sh against each with Chrome rendering the generated exports.
  • Ran tests/fm-pi-branch-extension.test.sh.
  • Started Pi TUI sessions at 140×36 with saved supervision tool calls on Pi 0.87.1 and 1.0.2; captured collapsed and expanded output.
  • Compared the same Pi 1.0.2 TUI call/result transcript with Firstmate renderers and with a temporary stock-renderer probe; both states matched.
  • Rendered the Pi 1.0.2 export in headless Chrome and captured a screenshot.
  • Removed temporary package installs, profiles, fixtures, and caches; the worktree is clean.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

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.
…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
@ryannmicua
ryannmicua merged commit 1eae634 into main Oct 5, 2026
19 checks passed
@ryannmicua
ryannmicua deleted the fm/fm-pi1-ci-compat branch October 5, 2026 04:17
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