mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-08 01:48:20 -10:00
chore(tui): remove uncalled plan and journal helpers [skip ci]
Delete SavedSession::active_entries, PlanState::steps, StepStatus::symbol,
and the never-issued CancelReason::Preempted. These private-module helpers
have no callers or public root re-export; cancellation reasons are typed,
not serialized or numeric. Keep active mailbox/cancellation builders and
remove their obsolete unused-code suppressions. No supported feature is
retired. Hand-ratchet the budget 192->186 and update both changelogs.
Local evidence covers the combined W2a source snapshot (base 916d3227e8,
2,178 input hashes, canonical map sha256
cd34d125770ebfc7f3ebaa921131c54b82781b469eb1cd27fd7c39350476cad0).
Intermediate commit trees were not separately compiled. A pre-follow-up
all-target check passed in 13m42s; final library tests ran 2,116 and passed
2,116 (13,540 skipped). Original 1,309-test selection is accounted for after
mapping four moved test names. Final skill_cli integration: 16 run/16 passed/204 skipped, 0.643s
execution after its 24m08s test-profile build. All recorded source hashes
stayed unchanged through both final runs.
Final batch metrics: tui strict/file lines 634691/943616 -> 634556/943349;
runtime 9526/15121 unchanged; SCC 79 unchanged; tools->core 46->29,
client->tools 5->4; mcp->core 7 held. Dead-code suppressions/budget 195->186;
blocking 543/165 unchanged. G1, G2, ratchets, web facts, provider registry,
changelog sync and diff whitespace checks passed. First check exposed an
over-broad FleetRole import rewrite, corrected in one repair round. Logs
and frozen-source receipts are retained outside the repository.
No new permanent tests or comments, no CI, provider call, deployment or
release. HumanDecision retains the engine-only mint boundary; published
runtime API removals stay held under FD-12. Engineering defaults follow the
coordinating handoff and remain overridable by the founder.
Co-Authored-By: OpenAI Codex <[email protected]>
This commit is contained in:
1 parent
4d4ca25b61
commit
995f2a88f9
7 files changed
+13
-38
No files matched your search
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
posture, strict tool schemas, home resolution, and legacy saved-role migration
|
||||
retain their behavior. The cleanup removes three dead-code suppressions and
|
||||
keeps the engine as the sole owner of human approval attestations.
|
||||
- Removed unused plan/journal accessors, an unused plan-status glyph helper,
|
||||
and a cancellation case that no execution path issued. Active mailbox and
|
||||
cancellation wiring stays in place; its stale unused-code suppressions are
|
||||
removed. No supported command or feature is retired by this cleanup.
|
||||
|
||||
- Local Ollama defaults now come from chat-capable tags, and `/provider ollama`
|
||||
refreshes the live catalog before switching. Exec and Runtime API defaults use
|
||||
|
||||
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
posture, strict tool schemas, home resolution, and legacy saved-role migration
|
||||
retain their behavior. The cleanup removes three dead-code suppressions and
|
||||
keeps the engine as the sole owner of human approval attestations.
|
||||
- Removed unused plan/journal accessors, an unused plan-status glyph helper,
|
||||
and a cancellation case that no execution path issued. Active mailbox and
|
||||
cancellation wiring stays in place; its stale unused-code suppressions are
|
||||
removed. No supported command or feature is retired by this cleanup.
|
||||
|
||||
- Local Ollama defaults now come from chat-capable tags, and `/provider ollama`
|
||||
refreshes the live catalog before switching. Exec and Runtime API defaults use
|
||||
|
||||
@@ -688,9 +688,6 @@ impl Default for EngineConfig {
|
||||
/// Reason the active turn was cancelled. The token from `tokio_util`
|
||||
/// does not carry a cause, so the engine keeps a sibling latch for
|
||||
/// approval and user-input waits that need to explain cancellation.
|
||||
///
|
||||
/// `External`, `Preempted`, and `Internal` are reserved for the
|
||||
/// remaining direct cancellation paths tracked in #1541.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum CancelReason {
|
||||
/// User-initiated cancel (Esc, `/cancel`, click cancel on modal).
|
||||
@@ -698,11 +695,6 @@ pub enum CancelReason {
|
||||
/// External / runtime-API cancel (HTTP `DELETE /v1/threads/...`,
|
||||
/// task manager stop, parent agent cancel).
|
||||
External,
|
||||
/// Cancel triggered when a new turn starts before the previous one
|
||||
/// finished — e.g. plain Enter while busy after the queueing path
|
||||
/// pre-empts the running turn.
|
||||
#[expect(dead_code)]
|
||||
Preempted,
|
||||
/// Engine internals tore down the turn (drop, channel close,
|
||||
/// shutdown). Rare — surfaced as an internal error.
|
||||
Internal,
|
||||
@@ -715,7 +707,6 @@ impl CancelReason {
|
||||
match self {
|
||||
Self::User => "user cancelled the request",
|
||||
Self::External => "request cancelled by external caller",
|
||||
Self::Preempted => "request was preempted by a new turn",
|
||||
Self::Internal => "engine torn down before approval resolved",
|
||||
Self::Stalled => "the turn stalled and was ended by the watchdog",
|
||||
}
|
||||
|
||||
@@ -1293,13 +1293,6 @@ impl SavedSession {
|
||||
self.metadata.updated_at = Utc::now();
|
||||
Ok(())
|
||||
}
|
||||
#[expect(dead_code)]
|
||||
pub fn active_entries(&self) -> Vec<SessionEntry> {
|
||||
self.journal
|
||||
.as_ref()
|
||||
.map(|j| j.root_to_leaf().into_iter().cloned().collect())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
/// `created_at` of the active branch's message entries, in order — the
|
||||
/// stamps a resumed session hands back to the live message log so the
|
||||
/// next save preserves append times instead of rewriting them to resume
|
||||
|
||||
@@ -33,16 +33,6 @@ impl StepStatus {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[expect(dead_code)]
|
||||
pub fn symbol(&self) -> &'static str {
|
||||
match self {
|
||||
StepStatus::Pending => "○",
|
||||
StepStatus::InProgress => "◎",
|
||||
StepStatus::Completed => "●",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Input representation for a plan item.
|
||||
@@ -324,11 +314,6 @@ impl PlanState {
|
||||
state
|
||||
}
|
||||
|
||||
#[allow(dead_code)] // retained for PlanState consumers / older tests
|
||||
pub fn steps(&self) -> &[PlanStep] {
|
||||
&self.steps
|
||||
}
|
||||
|
||||
/// Get counts of steps by status
|
||||
pub fn counts(&self) -> (usize, usize, usize) {
|
||||
let mut pending = 0;
|
||||
|
||||
@@ -3237,7 +3237,6 @@ impl SubAgentRuntime {
|
||||
/// stream. Pair with [`Self::with_cancel_token`] when the mailbox close
|
||||
/// token should match this runtime's cancellation token.
|
||||
#[must_use]
|
||||
#[allow(dead_code)] // wired by #128 (in-transcript cards) when it lands.
|
||||
pub fn with_mailbox(mut self, mailbox: Mailbox) -> Self {
|
||||
self.mailbox = Some(mailbox);
|
||||
self
|
||||
@@ -3263,7 +3262,6 @@ impl SubAgentRuntime {
|
||||
/// Replace the cancellation token (e.g. when the engine constructs the
|
||||
/// runtime alongside a mailbox bound to the same token).
|
||||
#[must_use]
|
||||
#[allow(dead_code)] // wired by #128 alongside `with_mailbox`.
|
||||
pub fn with_cancel_token(mut self, token: CancellationToken) -> Self {
|
||||
self.context.cancel_token = Some(token.clone());
|
||||
self.cancel_token = token;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
"_comment": "Ceiling for dead-code suppressions across crates/, counting both `#[allow(dead_code)]` and `#[expect(dead_code)]`. `total` is the sum and is the ratcheted figure. It may go down freely; raising it needs a reviewer to say why in the PR. Regenerate with: python3 scripts/check-dead-code-budget.py --update",
|
||||
"_issue": "https://github.com/codewhale-hq/CodeWhale/issues/4785",
|
||||
"_expect_blind_spot": "Until #6241 this gate counted only the `allow` spelling, so rewriting an allow as an expect lowered the number without removing any dead code. The ceiling was re-based to the true combined count when that was fixed; it is not a regression.",
|
||||
"total": 192,
|
||||
"allow_total": 121,
|
||||
"expect_total": 71,
|
||||
"total": 186,
|
||||
"allow_total": 118,
|
||||
"expect_total": 68,
|
||||
"per_crate": {
|
||||
"cli": {
|
||||
"allow": 0,
|
||||
@@ -35,8 +35,8 @@
|
||||
"expect": 0
|
||||
},
|
||||
"tui": {
|
||||
"allow": 107,
|
||||
"expect": 67
|
||||
"allow": 104,
|
||||
"expect": 64
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user