Skip to content

docs: add operator-seat orchestration guide - #57

Closed
cdonovan-abtex wants to merge 1 commit into
kunchenguid:mainfrom
cdonovan-abtex:docs/operator-seat
Closed

cdonovan-abtex wants to merge 1 commit into
kunchenguid:mainfrom
cdonovan-abtex:docs/operator-seat

Conversation

@cdonovan-abtex

@cdonovan-abtex cdonovan-abtex commented Jun 23, 2026 •

Copy link
Copy Markdown

Hi — I adopted firstmate a while back and it's become the backbone of how I run a fleet of repos.
This doc is a small bit back.

Where I'm coming from, since it's the angle: I'm a Navy veteran and the GM of a manufacturing company — I own a P&L, and I also build the software the business runs on (CS/Math undergrad, MBA).
So I use firstmate from a seat that isn't the usual one: not an engineer managing parallel projects, but an operator commanding agents against systems where a mistake is a business event, not a failed test.

docs/operator-seat.md writes that seat up.
It builds on your design, not over it — the core (orchestrator conducts not codes, escalate only judgment, isolation, reliability-as-the-whole-game) is yours, and I think you nailed it.
The doc adds (1) the operator lens and why it raises the scrutiny bar, and (2) the CAPTAINS-INTENT pattern: a committed CAPTAINS-INTENT.md per repo — north star, a Toyota-style 5 Whys, boundaries, a tie-back test — that turns "use good judgment" into something testable, plus two security lessons that seat taught me the hard way (review must weigh repo visibility; security-clear ≠ intent-correct).

Aside: you and I seem to have derived a lot of the same principles independently — I was sold enough by your execution to adopt yours rather than keep building my own.
Hopefully a useful addition from the operator end.
Happy to revise to fit the project's voice.

What Changed

  • Adds docs/operator-seat.md (+104 lines), a conceptual essay describing the "operator's seat" — intent-governed orchestration for someone accountable for business outcomes who also commands a crew of coding agents.
  • Introduces the CAPTAINS-INTENT.md pattern (north star, Toyota-style 5 Whys, heart, boundaries, tie-back test) and the firstmate/helmsman duty split, with a runway-guard enforcement layer that hard-stops on drift.
  • The doc is new and currently unlinked from README or any docs index; surfacing it is left as a maintainer decision.

Risk Assessment

✅ Low: The change adds a single standalone documentation file with no code, scripts, or shared-machinery impact, and it explicitly distinguishes aspirational concepts from what is built today.

Testing

There is no automated test surface for this documentation-only change, so I validated it the way a reviewer would: I audited the prose against every element of the author's intent (all present and consistent), confirmed the file is valid GitHub-flavored markdown by rendering it with pandoc (no warnings), and captured a full-page screenshot of the rendered document to show it displays correctly — title, all five sections, lists, inline code, and emphasis all render as intended. Worktree left clean.

  • Evidence: Rendered operator-seat.md (full-page screenshot) (local file: /var/folders/l8/htqy6t0j6hd9y084y1jqmqbr0000gn/T/no-mistakes-evidence/01KVV3MYX3XB14JQG30FCDP1KA/operator-seat-rendered.png)
  • Evidence: Rendered operator-seat.md (HTML) (local file: /var/folders/l8/htqy6t0j6hd9y084y1jqmqbr0000gn/T/no-mistakes-evidence/01KVV3MYX3XB14JQG30FCDP1KA/operator-seat.html)

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.

  • git show --stat HEAD — confirmed the change is one new file, docs/operator-seat.md (+104 lines), no code
  • grep keyword audit of docs/operator-seat.md — confirmed presence of CAPTAINS-INTENT, 5 Whys, helmsman, runway-guard, eight-hour/eight minutes origin, north star, tie-back test, blast radius, and the 'Straight talk' built-vs-target section
  • Verified markdown structure: title + 5 well-formed ## sections, numbered/bulleted lists, inline code, bold/italic emphasis
  • pandoc docs/operator-seat.md -f gfm -s — rendered to HTML with no warnings, confirming valid GFM
  • Opened the rendered HTML in Chrome and captured a full-page screenshot to confirm the document displays cleanly end-to-end
  • git status --short — worktree clean, no transient artifacts left behind
⚠️ **Document** - 1 info
  • ℹ️ docs/operator-seat.md - docs/operator-seat.md is added with no inbound link from README.md, CONTRIBUTING.md, or any docs index (none exists). It is not factually out of sync with the code, but it is currently undiscoverable. Whether to link it — and where — is a judgment call: README is a curated overview and this is a first-person conceptual essay, so surfacing it should be the maintainer's decision rather than an automatic edit.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@cdonovan-abtex

cdonovan-abtex commented Jul 2, 2026 •

Copy link
Copy Markdown
Author

Ready on my end — no changes pending. Pull it in whenever works for you.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: closing this as stale. It has been waiting on a contributor update for 14+ days with no author push or comment. Reopen if you want to pick it back up.

@spirispark

Copy link
Copy Markdown

Response to the "Stale Window Snapshot" focus area (guide comment)

Checked against the code at 8352f36 and against a scratch run of the real module under the flake's pinned lua5_4. Not applying this one: the suggested diff is byte-for-byte the refresh() that is already there, and the retirement it asks for brings back the failure this PR fixes.

1. "restore windows that are no longer present" cannot happen. restoreOnce walks the snapshot and looks every entry up in the live list (local w = live[e.id]); an entry with no live window is skipped and never moved. Run: after a cycle where the owner closed window 2 and moved window 1, one poll tick re-seeded the snapshot to exactly the two live ids (3 -> 2, ids 1,3), the next lock logged snapshot: 2 windows (pre-lock), and the restore made 2 setFrame calls, for those two live windows and none for the closed id.

2. Staleness is bounded by one poll tick, not by cycle count. refresh() runs every 5s whenever phase is idle and the Mac is unlocked, so an open, close or move is picked up within 5 seconds (same run: after moving a window the next tick reported preLockSnapshot x=300 (was 100); a 10s window-list outage kept the last known good layout and recovered on the next healthy tick). The pre-lock copy therefore only survives while refresh keeps failing, and in that state a stale-but-known layout is strictly better than none.

3. Retiring it at cycle end regresses the reported bug. Replaying the same cycle with preLockSnapshot cleared where the grace timer drops the snapshot: snapshot=nil preLockSnapshot=nil, then a lock at which macOS reports 0 windows logs snapshot: 0 windows followed by restore pass: moved 0, unsettled 0, and the window is not put back. That is the exact log the owner reported for this issue.

The retained pre-lock snapshot is the mechanism that makes "apps go back to their places before the lock" work when the window list is unusable at lock time, so it is deliberately a last-known-good value rather than a per-cycle one.

Noted, not fixed, as a real but very unlikely edge: no test covers a snapshot entry whose window id macOS later hands to a different window. Say the word and I will add that case.

@Huzaifa-Saleem

Copy link
Copy Markdown

Package summary (W2-03): merge conditions, evidence and trailers

The pipeline-generated description above does not carry these; the description could not be edited from this account, so they are recorded here.

What this does

Adds Runs fraud clawbacks end to end (work package W2-03): the App API routes that queue and execute a clawback through the app's CoinHub key, the queued-clawback read model staff and Guardians see, and a tracker that follows each clawback to its final state from its operations and the chain mirror. Execution happens only after the contract's 1-hour delay and a Guardian's on-chain confirmation (ADR-0005 AC-16, AC-25, K2 to K4).

  • POST /v1/app/clawbacks (E-08), GET /v1/app/clawbacks/{reference} (E-09), POST /v1/app/clawbacks/{reference}/execute (E-10): request signature, Idempotency-Key, Runs kill switch, mirror reads; each request and execution is a clawback_queue or clawback_execute operation of the shared Runs operations store (W2-02), which submits through chain-tx and sends runs.operation.*; this module adds runs.clawback.guardian_confirmed.
  • Not yet available to apps: the end-user addresses feature (fm/runs-w1-endusers) is not bound, so runs:clawback stays in INACTIVE_API_KEY_SCOPES (listed in SCOPES_AWAITING_DEPENDENCY), POST /v1/app/clawbacks answers a non-retryable 501 END_USERS_NOT_AVAILABLE before any other check, and OpenAPI and the Portal mark the routes as not yet available. The read route (runs:read) and the staff queue are available. Activation follows once the end-user addresses feature is bound: replace PendingClawbackUserDirectory with an adapter over its service and activate the scope.
  • GET /v1/platform/clawbacks and GET /v1/platform/clawbacks/{id} (platform.clawbacks.read): the queue with on-chain facts (user address, confirming Guardian, advisory clawable amount, confirmClawback calldata), never the app's user id.
  • Migration 0019-runs-clawbacks (runs_clawbacks, referencing runs_operations), data-dictionary rows, CLAWBACK_* settings validated at startup, webhook event runs.clawback.guardian_confirmed, Partner Portal guide "Clawbacks", regenerated OpenAPI and api-client types.
  • Docs: apps/api/src/clawbacks/README.md (design, Mermaid diagrams, configuration, failure modes, design choices), draft spec docs/specs/runs-clawbacks-v1.md (CB-01 to CB-19), draft threat model docs/security/threat-model-runs-clawbacks.md.

Must not merge until

Design choices for review

See the module README's table. In short: OQ-11 execution by the app by default, auto configurable; D-12 asynchronous 202 with the operation; request and execution on the shared operations store; on-chain app found from the lane key; readiness by the last final block's time; a failed execution stays confirmed with its error (retryable) rather than terminal; a registered user with no address is 422 NOTHING_TO_CLAW_BACK (no address is issued); end users behind a fail-closed port with runs:clawback inactive until bound; in auto mode the execute operation is attributed to the API key that requested the clawback.

Risk tier

RED (money path; default tier for apps/api/src/clawbacks/; also access/, config/, database/). Contracts are not changed.

Verification

  • apps/api (before the review fix rounds, on 45e6df7): typecheck, ESLint, all unit tests (1163 passed, 2 skipped), including the clawback rules, views, configuration, tracker, service, fail-closed directory, catalogue and route-policy specs.
  • Integration on throwaway loopback PostgreSQL 17 and a private anvil (Foundry v1.8.5, CoinHub built by forge): clawbacks-anvil.int-spec.ts (28 tests: AC-16, AC-25, K2, auto mode, every refusal before storage, with the end-users port stubbed) and clawbacks-unbound.int-spec.ts (4 tests: the real wiring answers 501, the scope cannot be granted, read routes stay available, OpenAPI marks the routes).
  • Live evidence on the validated head (0d444da, after the review fix rounds): Foundry v1.8.5 from the official release (tarball SHA-256 56049728e25e44a61c7f2e49438023b0890cb45850ffcb7c882f90cd998baf83, matching the GitHub release digest), unpacked outside the worktree; CoinHub built with that forge; anvil on 127.0.0.1 started by the chain harness; ANVIL_REQUIRED=true integration run of clawbacks-anvil (28/28) and clawbacks-unbound (4/4): 32/32 pass. The auto-mode retry-after-failure rules added in review (attempts-only bound, no attempts used while the kill switch or a suspension is on, no resubmission while a transaction may have landed, needs_attention with one alert) are covered by unit tests only; no anvil scenario exercises them.
  • Full test:integration run on 45e6df7 (before the review fix rounds): 21 suites passed, 6 skipped (459 tests passed, 37 skipped, 0 failed). Not repeated on the final head; the no-mistakes test step and the live anvil run above cover the final head.
  • packages/api-client typecheck and tests; apps/portal typecheck and ESLint; Prettier.

Not verified

  • Jenkins (no CI reports to GitHub); Docker image build; any WireFluid RPC or real AWS KMS; the Portal Playwright e2e (docs.spec.ts updated, not run).
  • The clawback routes with the real end-users service (not merged; covered with a stub through the port).
  • Integration suites gated on ANVIL_RPC_URL or an extra Redis (chain-tx-anvil, chain-tx-worker, the three chain-mirror suites, webhook-queue-redis) were skipped in the full run; they belong to the foundation branches and this PR does not change them.
  • pnpm itself (the pinned pnpm 12.14.0 cannot run on this machine; tools ran from node_modules/.bin with Node 24.14.1, so pnpm --filter @walee-runs/api test:integration -- clawbacks-anvil was run as the equivalent jest command in apps/api).
  • The auto-mode retry-after-failure rules end to end on anvil (unit-tested only).

Tier: RED
Spec: docs/specs/runs-clawbacks-v1.md (draft; App API spec PR #37 E-08 to E-10)
AI-Assisted: Claude Code, model claude-opus-5-5
Authorized-by: Huzaifa Saleem
Verification: apps/api/src/clawbacks/README.md (Verification)
Rollback: revert; migration 0019 down drops runs_clawbacks

@raffay-wire please review.

@noebrito

Copy link
Copy Markdown

Browser evidence: rivals take the inside of Zoomies bends

Evidence branch: fm/purrfect-lap-rival-racing-lines-evidence (.pr-evidence/purrfect-lap-rival-racing-lines/).

These are from a debug web export of 44c9e13, driven in headless Chrome from a fresh Home (Big Paws, Zoomies, 3 laps, Poe) on Cushion Circuit with ?seed=3, at 1194 × 740. The player drives the centreline and never presses Meow, so the rivals stay ahead and in view. The values come from the read-only window.purrfectDebug snapshot.

Into the first right-hander (7.2 s): the black rival is 4.39 units inside, with a line factor of 1.33.

Rival on the inside of a right-hander

Left-hander (95.6 s): one rival holds the inside (lane −2.57, factor 1.15). The other, pushed to the outside at +4.39, is slowed by the same geometry (factor 0.86).

Rival on the inside of a left-hander

Final lap (90.2 s): a rival 4.39 units inside a right-hander (factor 1.33).

Final-lap inside line

Result: the two rivals finished 1st and 2nd, 0.21 s apart, and the player finished 3rd, 2.7 s behind the winner, with no contacts and no recoveries. Each frame's telemetry is in cushion-moments.json, and the frame index is in the evidence README.

fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
… test header (kunchenguid#57)

* fix(gitignore): anchor the config/ ignore rule to the repo root

The config/ rule from the upstream port is unanchored, so gitignore
semantics match any directory named config at any depth. A nested
config-named path elsewhere in the tree is silently ignored, the same
bare-glob incident class that swallowed a source file in another repo.

Anchor the rule to /config/ and add a behavioral git check-ignore test
proving a config-named directory elsewhere in the tree stays visible.
The test fails against the unanchored rule and passes against the
anchored one. Nothing under config/ is tracked, so no negation is
needed; the comment records the deliberate anchoring.

* no-mistakes(review): map .gitignore to its test owners, attribute check-ignore source

* no-mistakes(review): complete .gitignore owner mapping, reject negated ignore matches

* no-mistakes(document): document root-anchored config ignore in test header
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 18, 2026
…puts change (kunchenguid#57)

* fix(bin): keep Factory pane rebuilds to one at a time and only when their inputs change

A read of the pending reconcile requests moved the owner's calls signal,
so every rebuild asked for the next and an open pane rebuilt for as long
as it stayed open; several panes then ran rebuilds side by side.

- fm-captain-hold.sh reconcile list no longer moves the calls signal
- one rebuild lock per home, held by the rebuild until it exits
- a whole refresh waits for a changed status, record or backlog file,
  or the record's longest age (FM_FACTORY_MAX_AGE)
- after a rebuild the next waits as long as it took, at least a minute
  on a busy machine
- question shapes read by a calls rebuild are kept for the next one

* no-mistakes(review): Exempt calls rebuilds from rest, rarer safety refresh, drop last-look

* no-mistakes(review): Rest the no-basis calls fallback like a full refresh

* no-mistakes(review): Build first pane record under lock; no no-basis respawns

* no-mistakes(review): Check basis.json with one stat in the pane

* no-mistakes(document): Forward FM_FACTORY_MAX_AGE to Factory tabs and live copies

* no-mistakes(lint): Return None from refresh_calls instead of NoBasis exception
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 18, 2026
Brings in the Mothership room-card reports (kunchenguid#56) and the one-at-a-time
Factory pane rebuild (kunchenguid#57), so the fresh pipeline run starts on top of
current main and keeps the upstream merge commit.
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.

5 participants