Six fixes for the bot review comments landed on PR #2864 head
649d3990. See phase2-playbook.md §7 for the triage rationale.
* persistence.rs: oversized state file now surfaces an InvalidData
error instead of silently returning a default. The old behaviour
would let the next save overwrite the oversized file and destroy
the user's data. Test updated to expect the error.
* persistence.rs: PersistedDelegation gains a `status` field so
in-flight `InProgress` delegations aren't silently demoted to
`Pending` on restart. The snapshot now writes the live status
and restore_from_snapshot honours it. Adds a regression test.
* mention.rs: resolve_tab_mention no longer sorts its input — tab
mentions (@Tab2) must map to the visual order in the tab bar,
not to an arbitrary ID sort. Test updated.
* manager.rs: `pending_tasks` renamed to `completed_delegations`
because the getter returns completed DelegationResults, not
in-flight tasks. Docstring points to the in-flight getter
`pending_delegations` to avoid the same confusion recurring.
* manager.rs: delegate_task and start_meeting now validate that
the from/to tab IDs (or all participant IDs) currently exist
in the manager. Returns `None` on any unknown ID, preventing
orphaned tasks / meetings with stale tab references. Two new
regression tests cover both methods.
Local CI matrix (Windows runner, flags matching ci.yml):
- cargo fmt --all -- --check: exit 0
- cargo clippy --workspace --all-features --locked -- -D warnings: exit 0
- cargo test --workspace --all-features --locked: 4282 pass, 6 fail
(the 6 failures are pre-existing on the baseline; not caused
by this PR)
- git diff --exit-code -- Cargo.lock: exit 0
The three deferred threads (#1 close_tab cleanup, #5 cross_tab_links
snapshot, #8 TabGroup::new collision risk) are explicitly out of
scope here; they belong to the follow-up collab/UI PR per the
narrow-harvest promise to Hmbown.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sister PR to #2753, scoped to the narrow tab-core/persistence slice
Hmbown asked for in the v0.9 stewardship review. Adds the `tab`
module under `crates/tui/src/tui/` and a one-line module registration
in `tui/mod.rs`. Nothing else in the host changes here — the
switcher / picker / meeting UI pass and the host wiring
(`App::tab_manager`, keyboard shortcuts, mouse menu, tab-bar layout
in `ui.rs`) live on #2753 and land in a follow-up PR.
Scope:
* `tab::TabManager` with monotonic `next_tab_id`, max 9 tabs by
default, snapshot/restore round-trip, group assignment,
cross-tab event/links, and persistence integration
* `tab::delegator::TaskDelegator` — bounded pending queue with
`MAX_COMPLETED_RESULTS` auto-prune; `take_pending_for_tab` marks
InProgress in place and returns a clone so subsequent
`start_task` / `complete` / `fail_task` / `cancel_task` can still
find the task (the previous `swap_remove` would have dropped it
on the first call)
* `tab::meeting::MeetingManager` — participants, messages by
type (Regular / Question / Answer / Proposal / Agreement /
Objection / Summary), decisions
* `tab::cross_tab` — `CrossTabEvent` (TaskDelegation / ReviewRequest
/ MeetingInvite / ContextSync / ResultReturn) and `SharedContext`
* `tab::group` — `TabGroup` / `TabGroupManager` /
`GroupColor` (Red/Orange/Yellow/Green/Cyan/Blue/Magenta/Gray)
* `tab::mention` — `@Tab<N>`, `@N`, `@tab<n>` (case-insensitive)
parser, with `resolve_tab_mention` for 1-indexed tab lookups
* `tab::persistence` — JSON file in the user's data dir,
`PersistedTabState` / `PersistedTab` / `PersistedDelegation` /
`PersistedGroup` with schema-version header, atomic save,
bounded file size, corruption-tolerant load
* `tab::benches` and `tab::key_e2e` regression suites (roundtrip,
save/load, end-to-end save→load with keymap)
Lint posture:
* `#![allow(dead_code, unused_imports)]` on `tab/mod.rs` because
the collab/UI pass is not on this branch; the public surface is
intentionally exposed for the follow-up wiring in #2753
* One pre-existing `tools/shell.rs` fix piggy-backed: drop the
redundant `as *mut c_void` cast on `child.as_raw_handle()` (the
return type is already `*mut c_void`). Pre-existing on
`codex/v0.9.0-stewardship`; promoted to `clippy::unnecessary_cast`
by rust 1.95
Local CI matrix on this branch (Windows runner, same flags as
`.github/workflows/ci.yml`):
* `cargo fmt --all -- --check` — pass
* `cargo clippy --workspace --all-features --locked -- -D warnings`
— pass, 0 errors
* `cargo test --bin codewhale-tui tab::` — 63/63 pass
* `git diff --exit-code -- Cargo.lock` — clean
GitHub Actions will run on the standard fork-PR approval gate; the
`on.pull_request` branch filter on this repo matches
`codex/v0.9.0-stewardship` so the same matrix will run on
ubuntu-latest, macos-latest, and windows-latest.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add recorded mock-trace replay coverage for workflows/rlm_cache_change.star and prove missing dogfood records produce ReplayDiverged instead of live fallback.\n\nVerification:\n- cargo test -p codewhale-whaleflow rlm_cache_change --locked\n- cargo fmt --all --check\n- git diff --check\n- cmp -s CHANGELOG.md crates/tui/CHANGELOG.md\n- ./scripts/release/check-versions.sh\n- ./scripts/release/check-ohos-deps.sh
Harvests provider-scoped TLS skip-verify from #1893 by @wavezhang. Disabled by default, active-provider-only, doctor-reported, and keeps SSL_CERT_FILE as the preferred custom CA path.
Add read-only workspace and branch metadata to runtime thread summaries so VS Code Agent View can show when a thread lane is on another branch. Non-git workspaces return null branch metadata instead of failing.
Refs #2580, #2721.
Credits the existing branch-visibility trail from #1217/#2341 in the changelog.
Add a fail-closed Starlark authoring layer that compiles workflow files into WorkflowSpec without exposing runtime execution. Include ctx.* repair aliases, unsupported-construct rejection, and rlm_cache_change / issue_fix_tournament examples.
Refs #2670.
Preserves WhaleFlow direction credit for @AdityaVG13 in changelogs and PR notes.
Add a crate-local mock executor over WorkflowSpec that records leaf, branch, and control-node results for Sequence, BranchSet, Leaf, Reduce, TeacherReview, LoopUntil, Cond, and Expand. Add reducer scaffolding for BranchTournament and ParetoFrontier, plus #2669 acceptance-style tests, without exposing workflow_run, spawning agents, or applying worktrees.
Refs #2669.
Harvests narrow WhaleFlow executor intent from #2482/#2486.
Co-authored-by: AdityaVG13 <44177453+AdityaVG13@users.noreply.github.com>
Harvest the safe GUI-facing snapshot list slice from PR #2808 without exposing restore, retry, patch-undo, or other runtime mutation endpoints. The endpoint is protected by the existing runtime API token middleware and mirrors the /restore list bound.
Refs #2808, #2580.
Co-authored-by: gaord <9567937+gaord@users.noreply.github.com>
Add the explicit WorkflowSpec/WorkflowNode metadata surface requested for the v0.9 WhaleFlow IR, including budget, permission, model, and promotion policy records plus serde roundtrip coverage. Runtime execution, replay, and worktree application remain out of scope.
Refs #2668, #2482, #2486.
Co-authored-by: AdityaVG13 <44177453+AdityaVG13@users.noreply.github.com>
Add a metadata-only provider registry foundation from #2479. The registry exposes canonical lookup, alias-aware resolution, defaults, config table keys, and API-key env candidates without changing runtime routing or activating fallback providers.
Co-authored-by: sximelon <62371427+sximelon@users.noreply.github.com>
Refine the embedder static prompt composer direction from #2786 so it only owns the byte-stable base/personality prompt segment while runtime metadata, Context Management, and the compaction relay stay under CodeWhale prompt assembly.
Co-authored-by: h3c-hexin <13790929+h3c-hexin@users.noreply.github.com>
Adds @AdityaVG13 to the contribution-gate allowlist now that WhaleFlow #2482/#2486 have been harvested into the maintained v0.9 IR/TraceStore foundation with public credit.
Adds README current-track credit for @sximelon's v0.9 saved-session/provider-trait work and @AdityaVG13's WhaleFlow orchestration/cost-tracking drafts that shaped the maintained IR and TraceStore foundation.
Adds a state-store v2 schema migration for WhaleFlow workflow, branch, leaf, control-node, and teacher-candidate trace tables. Keeps workflow execution/replay deferred and preserves @AdityaVG13 WhaleFlow draft credit in the changelog.
Adds serializable WhaleFlow branch, leaf, and control-node result records plus #2668 roundtrip/default-field coverage. Keeps runtime workflow execution deferred and preserves @AdityaVG13 WhaleFlow draft credit in the changelog.