fix(orchestration): scope Mission Control Shipped to the director's lifetime - #28
Merged
Merged
Conversation
…ifetime A brand-new Orcastrator's "Shipped" section showed shipped PRs from past sessions. Root cause: `.orcastrate/log.jsonl` is committed to the repo (intentional — it's the skill's cross-session decision log), so every new director worktree branched from `main` inherits the full accumulated log. Mission Control derived Shipped from that whole log with no scoping, so it surfaced every historical shipped outcome as if this director shipped it. Fix: thread an optional `sinceMs` into `parseOrchestrateLogOutcomes` — when set, skip `outcome` records whose `ts` parses before `sinceMs`, and exclude outcomes with a missing/unparseable `ts` (can't attribute them to this director → err toward not showing foreign work). Plan records stay unscoped (they only supply descriptions). `OrchestratorMissionControl` passes the director worktree's `createdAt`. Optional, so legacy callers and worktrees discovered on disk (no `createdAt`) keep prior behavior. Result: a brand-new director → empty Shipped; inherited entries filtered out; a director's own shipped outcomes still appear. Out of scope (unchanged): the orcastrate skill, the log format, the committing behavior, and the lineage-based Spawned-work section. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
A brand-new Orcastrator's Shipped section in Mission Control showed shipped PRs from past sessions. Verified against a real repo: a fresh director in
resonantiq-gtmlisted PRs #16/#15/#17/#18 from a 2026-06-20 session.Root cause
.orcastrate/log.jsonlis committed to the repo (intentional — it's the orcastrate skill's cross-session decision log). So every new director worktree, branched frommain, inherits the full accumulated log from all prior sessions. Mission Control derived Shipped by readingdirectorPath/.orcastrate/log.jsonl→parseOrchestrateLogOutcomes→selectShippedWork, which filtered only bytag === 'shipped'with no scoping to the current director. Every historical shipped outcome rendered as if this director shipped it.The fix — scope to the director's own lifetime
The log's
outcomerecords carry ats(ISO timestamp); the director worktree carries acreatedAt(epoch ms).sinceMsintoparseOrchestrateLogOutcomes(content, sinceMs?). When set, skipoutcomerecords whosetsparses beforesinceMs.tscan't be attributed to this director, so it's excluded when scoping (err toward not showing foreign work).OrchestratorMissionControlpasses the director worktree'screatedAt.sinceMsstays optional: legacy callers and worktrees discovered on disk (nocreatedAt) keep prior behavior. Plan records remain unscoped — they only supply descriptions.Result: a brand-new director → no outcomes after its creation → empty Shipped; inherited entries are filtered out; a director's own shipped outcomes (logged during its lifetime) still appear.
Out of scope (unchanged)
Tests
Added lifetime-scoping tests in
orcastrate-log-shipped-work.test.tsthat fail against the pre-fix code (which returns all outcomes):sinceMs = now) over an old-only log → empty;ts→ excluded when scoping;sinceMsomitted → legacy behavior preserved.Full vitest (20495 passed), typecheck, electron-vite build, and oxlint all green.
🤖 Generated with Claude Code