Skip to content

Fix first worktree card top border cutoff - #15

Merged
nwparker merged 1 commit into
mainfrom
nwparker/first-card-cuttoff
Mar 22, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/first-card-cuttoff

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • Add pt-px (1px top padding) to the worktree list scroll container to prevent overflow-auto from clipping the top border/ring of the first card

Test plan

  • Verify the first card in the worktree list no longer has its top border clipped
  • Verify scrolling behavior is unaffected

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nwparker
nwparker merged commit 7af384c into main Mar 22, 2026
Jinwoo-H added a commit that referenced this pull request May 4, 2026
…reamble+ask, QoL (#1403)

* feat(orchestration): transport keepalive + delivered_at split for check --wait

Implements the four §3 fixes from the check-wait design doc:

- §3.1 Transport keepalive: long-poll RPCs (orchestration.check --wait) emit
  `{"_keepalive":true}` frames every 10s so neither server nor client tears
  the socket down on idle. A `longPoll` admission counter capped at 16 fails
  fast with `runtime_busy` when saturated; an AbortController wired through
  the RPC dispatcher cancels the inner waiter the moment the socket closes.
- §3.2 delivered_at split: push-on-idle now stamps `delivered_at` instead of
  flipping `read`, so the check caller remains the sole consumer of its
  queue. Adds a synchronous idempotent schema migration that hard-fails on
  error.
- §3.3 inbox/check parity: `orchestration inbox --terminal <handle>` and
  `orchestration check --all` agree on the same rows (sequence DESC, no
  mark-read). `check --unread=false` kept for one release as a compat shim.
- §3.4 CLI heartbeat: `orca orchestration check --wait` emits JSON heartbeat
  lines to stderr every 15s so Claude Code's Bash tool sees continuous
  output and doesn't auto-background the subprocess.

Tests: extends runtime-rpc, orca-runtime, envelope-schema, orchestration
method, and formatter suites; adds a subprocess test that spawns the built
CLI and verifies stderr line-flushing, heartbeat cadence, and stdout
cleanliness end-to-end.

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): preamble rules + heartbeat schema

- Preamble (#7, #15, #9): worker_done body ("3-sentence summary" + reportPath),
  BEHAVIOR RULE #1 forbidding AskUserQuestion, heartbeat every 5 minutes with
  taskId+dispatchId payload, AFTER YOU SEND grace window.
- Schema v2 migration: adds 'heartbeat' to messages.type CHECK, adds
  dispatch_contexts.last_heartbeat_at, gated by user_version PRAGMA with
  transactional rebuild + explicit CREATE INDEX to avoid silent perf regress.
- DB helpers: recordHeartbeat (dispatched-only), getStaleDispatches,
  getThreadMessagesFor (thread+handle scoped for ask).

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): coordinator heartbeat + stale detector

Handle incoming 'heartbeat' messages by calling recordHeartbeat keyed on
payload.dispatchId (strict — log-and-skip if missing, no taskId fallback so
a straggler heartbeat from a previously-failed dispatch cannot mask a hung
retry per §5.3.4). On every tick after the 10-minute threshold, emit one
log per stale dispatched row — no auto-fail.

Also threads dispatchId through buildDispatchPreamble so workers can
attribute their heartbeats back to the correct dispatch context.

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): orca orchestration ask verb

Adds a CLI verb that sends a decision_gate message and blocks on the
coordinator's reply, scoped to the outbound message's thread. Group
addresses (@ALL, @idle, …) are rejected — fan-out questions must use
send --type decision_gate explicitly.

--json emits bare single-line JSON (bypassing printResult) so workers can
pipe `orca orchestration ask … --json | jq -r .answer` without unwrapping
an RPC envelope; human mode prints just the answer. On timeout the verb
exits 1 and returns {answer: null, timedOut: true}.

This is the CLI surface BEHAVIOR RULE #1 in the dispatch preamble points
workers at instead of AskUserQuestion.

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): QoL bundle — preamble visibility, status enum, dispatch cross-ref, inbox --full

Addresses four items from ORCHESTRATOR_FEEDBACK:

- #5 preamble visibility: `dispatch-show --preamble` regenerates the preamble
  text for a task; `dispatch --inject --dry-run` previews without mutating
  state; `dispatch --return-preamble` echoes the injected preamble in the JSON
  response so coordinators can audit what a worker received.
- #6 status enum validation: CLI rejects unknown `task-update --status` values
  with `invalid status '<x>', expected one of: pending, ready, dispatched,
  completed, failed, blocked` before the RPC's generic Zod message. Valid
  statuses are listed under Notes in `task-update --help`.
- #13 task-list dispatch cross-ref: `task-list --json` now includes
  `assignee_handle` and `dispatch_id` for tasks in status=dispatched via a
  read-only LEFT JOIN on dispatch_contexts. Non-dispatched rows keep their
  legacy shape so existing consumers are unaffected.
- #14 inbox body visibility: `inbox --full` prints body + payload verbatim;
  default output is unchanged (id/from/to/subject only).

No DB migrations; join-only change on dispatch_contexts so the sibling
preamble PR's `last_heartbeat_at` column addition will not conflict.

Co-authored-by: Orca <help@stably.ai>

* fix(worktree): prevent stale-base worktree creation and dispatch

Addresses feedback #16 per DESIGN_DOC_STALE_BASE_FIX.md §0. Four v1
components coordinated by a single shared fetch cache on the runtime:

1. Concurrent-fetch-with-gate in UI create path: `createLocalWorktree`
   fires `git fetch` BEFORE the suffix loop / PR probe / path
   resolution, then awaits right before `addWorktree` so the new branch
   always spawns from a fresh remote tip. Renderer sees a two-phase
   spinner via the new `createWorktree:progress` IPC event. The cache
   is a `Map<repoPath::remote, Promise<void>>` + 30s success-only
   timestamp on `OrcaRuntimeService` (§7.1 — shared with dispatch).
2. Dispatch pre-flight drift guard in `Coordinator.dispatchTask`:
   probes `rev-list --left-right --count` against the target worktree
   and silently returns (preserves `ready`, no circuit-breaker burn)
   when `behind > 20` unless the task spec carries
   `allow-stale-base: true`. Parsing strips the flag so it never leaks
   into the worker's `--- TASK ---` block.
3. Preamble drift section: populated only when dispatch detected drift.
   Workers see `--- BASE DRIFT ---` with the N-most-recent subjects
   they don't have, so they can pull them in before running.
4. §3.3 Lifecycle: `.finally()` evicts Map entries on BOTH success and
   rejection; timestamp is written ONLY on success. Prevents a single
   DNS hiccup from wedging every future create on the repo until
   restart, and keeps the freshness window honest.

Defers the DB `allow_stale_base` column (§0.2) and the create-time
warn toast; both can layer in later without migration.

Tests: 35 new/updated unit tests covering drift preamble, dispatch
refusal, spec-text flag parsing, fetch Map eviction after rejection,
freshness-window short-circuit, and concurrent-caller serialization.

Co-authored-by: Orca <help@stably.ai>

* test(orchestration): seed v2 DB in migration hard-fail test

After consolidating the schema bump, fresh DBs are initialized directly at
v3 via createTables(), so the v2→v3 ALTER TABLE is skipped on new installs
and the prior test's stub never fired. Seed a v2-shape file on disk so the
guarded ALTER actually runs and the "simulated migration failure" stub
propagates as intended.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
Jinwoo-H added a commit that referenced this pull request Sep 4, 2026
scolety1 added a commit to scolety1/orca that referenced this pull request Sep 10, 2026
…oncurrency, Lane H property, finding stablyai#15)

Updates the morning report to reflect 3 real commits that landed after
the CONTROL_PLANE_STABLE_V1 milestone it was first written at:
- RESUME's own genuine-concurrency proof (SHA 7b2c3aa, Lane E)
- A hold-precedence property test (SHA 5b12e88, Lane H)
- Finding stablyai#15 (SHA edb9fb6, P2): real project-execution holds were
  never surfaced by GET /api/attention

None of the three are P0/P1, so the stability declaration remains
explicitly unchanged. Also documents a real OS-level OOM kill hit on a
post-stability full-suite confidence run (current host strain, not a
regression signal) and updates the adopted-SHAs list, final worktree
inventory, final tsf/main SHA, and terminal declarations accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdU7C6R8tKG5diqfdjNCPp
scolety1 added a commit to scolety1/orca that referenced this pull request Sep 10, 2026
…ect as READY_FOR_ADOPTION

domain/work-feed-summary.mjs's summarizeWorkFromRuns gains a
canonicalBases param (defaults {}, backward compatible): a COMPLETE run
whose missionId has a real ADVANCED entry in project-canonical-base-
store.mjs's own durable history is now reclassified from
readyForAdoption to recentlyCompleted, with an honest reason. Gated
once at the one real aggregation choke point both the Work page and
the attention feed read from (same pattern as finding stablyai#17's own
resource-pressure-governor gate), rather than widening
projectLiveWorkFeedState's contract (~10 other real call sites depend
on its exact vocabulary).

domain/fleet-attention-status.mjs's completedRecentlyItems was
structurally dead code for every real Keep-Going-run project
(confirmed by direct code reading: it filtered on a live-feed state
projectLiveWorkFeedState never actually emits). Rewritten to consume
work-feed-summary.mjs's own now-adoption-aware recentlyCompleted list.
buildFleetAttentionItems gains a projectCanonicalBases param, threaded
through every real production call site: project-catalog.mjs -> the
real GET /api/work route (http-server.mjs) -> attention-status-
reconciler.mjs (mirrors finding stablyai#15's own pattern) -> command-fleet-
attention-bridge.mjs ("what just finished?") -> command-multi-action-
bridge.mjs's reportAdoptionCandidate ("is X ready?") -> command-self-
improvement-bridge.mjs's READY_FOR_ADOPTION branch.

Self-caught regression during this fix's own verification: the first
draft of completedRecentlyItems started reading the unified
recentlyCompleted list unconditionally, silently re-including legacy
ADOPTED (candidate-decision) projects that a pre-existing, deliberate
exclusion (and its own pre-existing test) kept out of the
COMPLETED_RECENTLY attention category -- the operator already knows
about those, having just clicked ADOPT directly. Fixed by tagging each
recentlyCompletedEntry with a sourceKind (LEGACY_CANDIDATE_DECISION vs
KEEP_GOING_RUN_ADOPTED) and skipping the legacy kind in
completedRecentlyItems, restoring the original exclusion while still
fixing the real gap for run-based adoptions.

9 new tests (work-feed-summary, fleet-attention-status,
command-fleet-attention-bridge), 239 relevant tests run clean across
work-feed-summary/fleet-attention-status/command-fleet-attention-
bridge/command-multi-action-bridge/command-self-improvement-bridge/
attention-status-reconciler/attention-http-routes/command-adoption-
execution/live-work-feed/fleet-work-status (http-work-summary's own
dispatch-tick test excluded from that count -- real, sustained host
resource pressure this tick, ~85-89% used vs the ~76-80% PRESSURED
baseline, reproduced identically in isolation; a pre-existing, already
well-documented resource-contention-sensitive test, unrelated to this
change). Mutation-verified: disabling the override reproduces exactly
the 2 new tests targeting it failing, 0 others.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdU7C6R8tKG5diqfdjNCPp
scolety1 added a commit to scolety1/orca that referenced this pull request Sep 11, 2026
…radicted the operator

Live-reproduced before fixing: "X is being handled by another agent,
leave it alone" (which really, durably records the hold) immediately
followed by "why is it stuck?" answered "nothing is stuck, there's
just nothing in flight" -- directly contradicting what the operator
themselves just told the system and the system itself just durably
recorded.

Root cause: command-followup-context.mjs's explainProjectState derived
its whole explanation from the Keep Going run's own live feed state
alone, zero awareness of a real, active project execution hold. Same
bug class as findings stablyai#15/stablyai#17 (a hold not surfaced in a relevant read
path), a new location.

Fix: explainProjectState gains a hold parameter, checked via the same
isProjectExecutionHoldActive every other real hold-aware read path
uses. Two honest branches: no run yet -> the hold IS the explanation;
a run with its own real state -> the hold is reported additively,
never replacing the run's own real reason. The real call site
(explainPriorAnswer, reached from both Global Command and the real
per-project chat route) already receives the full opState with
projectExecutionHolds populated, so this is a plain honest read, no
new plumbing.

2 new dogfood-style regression tests (dogfood H/H2), covering both
branches. Mutation-verified: forcing held=false reproduced exactly
these 2 tests failing, 0 others. 84 relevant tests clean across
command-dogfood-sequences/command-followup-context/command-multi-
action-bridge/command-responder/project-execution-hold. Also fixes 5
pre-existing, unrelated oxlint curly violations the pre-commit hook
caught in the 2 touched files (mechanical, zero behavior change).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdU7C6R8tKG5diqfdjNCPp
scolety1 added a commit to scolety1/orca that referenced this pull request Sep 11, 2026
Documents the fresh 2-pass stability sequence run after finding stablyai#18
reset the counter: 3 consecutive real OOM kills (runs stablyai#13/stablyai#14/stablyai#15,
each retried per the owner's own explicit >95%-used-only memory rule,
never blindly), then Pass stablyai#1 (run stablyai#16, PASS) and Pass stablyai#2 (run stablyai#17,
PASS -- 2 new-signature failures isolated-confirmed clean, 7/7,
before being accepted as resource-contention artifacts, never
hand-waved). Updates the session-status header, §12 stability
declaration, §13 SHA ledger, §17 next-highest-value work, and the
terminal declaration block to reflect STABILITY_PASS = 2 of 2 at
current tip SHA c51e61c.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdU7C6R8tKG5diqfdjNCPp
sinkerine pushed a commit to sinkerine/orca that referenced this pull request Sep 12, 2026
…workspace-group-filter

fix(sidebar): scope folder workspaces to the project-group filter
scolety1 added a commit to scolety1/orca that referenced this pull request Sep 15, 2026
… -- resolved, verified, adoption status

Moves Findings stablyai#2-stablyai#11 to Resolved with real worktree commit SHAs and live
browser-dogfood evidence (isolated disposable runtime, real owner instance
never touched); re-verifies Findings stablyai#12/stablyai#13/stablyai#14/stablyai#16 as still Good As-Is;
honestly flags stablyai#15 as not independently re-exercised (no active research
mission in the fixture data used) but unregressed (no file in this diff
touches that code path).

Records adoption status: implemented and tested in the isolated worktree,
not yet merged to canonical tsf/main. Discloses three real, pre-existing
gaps found while verifying this batch, none introduced by it: the
Projects-grid LifecycleBadge still computing a separate 8-bucket
vocabulary (Findings stablyai#5/stablyai#11's own "apply consistently everywhere"
requirement, not fully met on that one surface); a divergence between
Command's NEEDS_YOU_QUERY and HQ's own Needs You count (two separate,
pre-existing aggregation systems); and a genuine-directive/question-
awareness gap in domain/command-act-model.mjs's VERB_REGISTRY decomposer,
found via a real Codex adversarial-review dispatch and independently
re-verified live (a question like "Should I put X on hold?" can set a
real hold) -- pre-existing across the whole mechanism, not specific to
this batch's own two new hold-phrase additions, and out of scope for a
UI-findings batch to fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdU7C6R8tKG5diqfdjNCPp
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…reamble+ask, QoL (stablyai#1403)

* feat(orchestration): transport keepalive + delivered_at split for check --wait

Implements the four §3 fixes from the check-wait design doc:

- §3.1 Transport keepalive: long-poll RPCs (orchestration.check --wait) emit
  `{"_keepalive":true}` frames every 10s so neither server nor client tears
  the socket down on idle. A `longPoll` admission counter capped at 16 fails
  fast with `runtime_busy` when saturated; an AbortController wired through
  the RPC dispatcher cancels the inner waiter the moment the socket closes.
- §3.2 delivered_at split: push-on-idle now stamps `delivered_at` instead of
  flipping `read`, so the check caller remains the sole consumer of its
  queue. Adds a synchronous idempotent schema migration that hard-fails on
  error.
- §3.3 inbox/check parity: `orchestration inbox --terminal <handle>` and
  `orchestration check --all` agree on the same rows (sequence DESC, no
  mark-read). `check --unread=false` kept for one release as a compat shim.
- §3.4 CLI heartbeat: `orca orchestration check --wait` emits JSON heartbeat
  lines to stderr every 15s so Claude Code's Bash tool sees continuous
  output and doesn't auto-background the subprocess.

Tests: extends runtime-rpc, orca-runtime, envelope-schema, orchestration
method, and formatter suites; adds a subprocess test that spawns the built
CLI and verifies stderr line-flushing, heartbeat cadence, and stdout
cleanliness end-to-end.

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): preamble rules + heartbeat schema

- Preamble (stablyai#7, stablyai#15, stablyai#9): worker_done body ("3-sentence summary" + reportPath),
  BEHAVIOR RULE stablyai#1 forbidding AskUserQuestion, heartbeat every 5 minutes with
  taskId+dispatchId payload, AFTER YOU SEND grace window.
- Schema v2 migration: adds 'heartbeat' to messages.type CHECK, adds
  dispatch_contexts.last_heartbeat_at, gated by user_version PRAGMA with
  transactional rebuild + explicit CREATE INDEX to avoid silent perf regress.
- DB helpers: recordHeartbeat (dispatched-only), getStaleDispatches,
  getThreadMessagesFor (thread+handle scoped for ask).

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): coordinator heartbeat + stale detector

Handle incoming 'heartbeat' messages by calling recordHeartbeat keyed on
payload.dispatchId (strict — log-and-skip if missing, no taskId fallback so
a straggler heartbeat from a previously-failed dispatch cannot mask a hung
retry per §5.3.4). On every tick after the 10-minute threshold, emit one
log per stale dispatched row — no auto-fail.

Also threads dispatchId through buildDispatchPreamble so workers can
attribute their heartbeats back to the correct dispatch context.

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): orca orchestration ask verb

Adds a CLI verb that sends a decision_gate message and blocks on the
coordinator's reply, scoped to the outbound message's thread. Group
addresses (@ALL, @idle, …) are rejected — fan-out questions must use
send --type decision_gate explicitly.

--json emits bare single-line JSON (bypassing printResult) so workers can
pipe `orca orchestration ask … --json | jq -r .answer` without unwrapping
an RPC envelope; human mode prints just the answer. On timeout the verb
exits 1 and returns {answer: null, timedOut: true}.

This is the CLI surface BEHAVIOR RULE stablyai#1 in the dispatch preamble points
workers at instead of AskUserQuestion.

Co-authored-by: Orca <help@stably.ai>

* feat(orchestration): QoL bundle — preamble visibility, status enum, dispatch cross-ref, inbox --full

Addresses four items from ORCHESTRATOR_FEEDBACK:

- stablyai#5 preamble visibility: `dispatch-show --preamble` regenerates the preamble
  text for a task; `dispatch --inject --dry-run` previews without mutating
  state; `dispatch --return-preamble` echoes the injected preamble in the JSON
  response so coordinators can audit what a worker received.
- stablyai#6 status enum validation: CLI rejects unknown `task-update --status` values
  with `invalid status '<x>', expected one of: pending, ready, dispatched,
  completed, failed, blocked` before the RPC's generic Zod message. Valid
  statuses are listed under Notes in `task-update --help`.
- stablyai#13 task-list dispatch cross-ref: `task-list --json` now includes
  `assignee_handle` and `dispatch_id` for tasks in status=dispatched via a
  read-only LEFT JOIN on dispatch_contexts. Non-dispatched rows keep their
  legacy shape so existing consumers are unaffected.
- stablyai#14 inbox body visibility: `inbox --full` prints body + payload verbatim;
  default output is unchanged (id/from/to/subject only).

No DB migrations; join-only change on dispatch_contexts so the sibling
preamble PR's `last_heartbeat_at` column addition will not conflict.

Co-authored-by: Orca <help@stably.ai>

* fix(worktree): prevent stale-base worktree creation and dispatch

Addresses feedback stablyai#16 per DESIGN_DOC_STALE_BASE_FIX.md §0. Four v1
components coordinated by a single shared fetch cache on the runtime:

1. Concurrent-fetch-with-gate in UI create path: `createLocalWorktree`
   fires `git fetch` BEFORE the suffix loop / PR probe / path
   resolution, then awaits right before `addWorktree` so the new branch
   always spawns from a fresh remote tip. Renderer sees a two-phase
   spinner via the new `createWorktree:progress` IPC event. The cache
   is a `Map<repoPath::remote, Promise<void>>` + 30s success-only
   timestamp on `OrcaRuntimeService` (§7.1 — shared with dispatch).
2. Dispatch pre-flight drift guard in `Coordinator.dispatchTask`:
   probes `rev-list --left-right --count` against the target worktree
   and silently returns (preserves `ready`, no circuit-breaker burn)
   when `behind > 20` unless the task spec carries
   `allow-stale-base: true`. Parsing strips the flag so it never leaks
   into the worker's `--- TASK ---` block.
3. Preamble drift section: populated only when dispatch detected drift.
   Workers see `--- BASE DRIFT ---` with the N-most-recent subjects
   they don't have, so they can pull them in before running.
4. §3.3 Lifecycle: `.finally()` evicts Map entries on BOTH success and
   rejection; timestamp is written ONLY on success. Prevents a single
   DNS hiccup from wedging every future create on the repo until
   restart, and keeps the freshness window honest.

Defers the DB `allow_stale_base` column (§0.2) and the create-time
warn toast; both can layer in later without migration.

Tests: 35 new/updated unit tests covering drift preamble, dispatch
refusal, spec-text flag parsing, fetch Map eviction after rejection,
freshness-window short-circuit, and concurrent-caller serialization.

Co-authored-by: Orca <help@stably.ai>

* test(orchestration): seed v2 DB in migration hard-fail test

After consolidating the schema bump, fresh DBs are initialized directly at
v3 via createTables(), so the v2→v3 ALTER TABLE is skipped on new installs
and the prior test's stub never fired. Seed a v2-shape file on disk so the
guarded ALTER actually runs and the "simulated migration failure" stub
propagates as intended.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
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