mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-07 10:36:05 -10:00
The debug group and the diagnostic reports were already portable — they took
`CommandHandler` shapes and owned no `App` — but they lived inside the TUI
crate, so nothing could test or reuse them without linking the whole terminal
stack. They move to a new `codewhale-commands` crate, and the elapsed
formatter moves to `codewhale-command-contract` where the command shapes
already live.
Both moves are relocation, not rewrite: the handlers, their private helpers
and their tests are the same code. `crates/tui/src/commands/groups/debug/`
and `crates/tui/src/diagnostics_reports/` are gone; `crates/commands/` holds
them; the old `tests/portable-debug-diagnostics` crate is deleted because its
only purpose was to prove these files were portable, and the real crate is
that proof now.
`runtime` keeps a `pub use codewhale_command_contract::elapsed` so the
existing `codewhale_runtime::elapsed::…` callers do not move in this slice;
the TUI callers are rewritten to the contract path directly. Sixty-odd call
sites across the TUI move from `crate::elapsed::` / `crate::diagnostics_reports::`
to the two portable owners.
Nothing is left half-migrated: `scripts/check-command-migration-manifest.py`
validates the frontier and the shrink-or-declared-split transition, and
`scripts/check-command-crate-boundaries.py` proves the new crate's dependency
set and that the runtime→UI ratchet still holds. Both are updated to know the
new crate, and `scripts/release/crates.sh` publishes it, so the release set is
29 crates rather than 28.
Verification:
- nextest -p codewhale-commands -p codewhale-command-contract -p codewhale-config
-p codewhale-protocol -p codewhale-tui -p codewhale-cli with the commands,
goldens, fim, file_search, catalog, hooks, activity, parity, pet, codemode,
auto_review, acp and cloud selectors:
Summary [19.602s] 703 tests run: 703 passed, 0 failed, 16139 skipped
- check-command-migration-manifest.py PASS (frontier [config, core])
- check-command-crate-boundaries.py PASS
- check-portable-debug-diagnostics.sh: 28 passed, 0 failed
- test_check_command_migration_manifest.py: 63 tests OK
- check-versions.sh's fixture assertions still hold (no version file moved)
20 lines
927 B
Bash
20 lines
927 B
Bash
#!/bin/sh
|
|
# FEAT-029: compile the complete portable debug closure without TUI.
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Normal graph (not a source-token approximation). A forbidden transitive
|
|
# dependency fails even if the compiler would otherwise accept the facade.
|
|
graph=$(cargo tree --locked -p codewhale-commands --edges normal --prefix none)
|
|
printf '%s\n' "$graph"
|
|
if printf '%s\n' "$graph" | grep -Eq '^codewhale-tui([[:space:]]|$)'; then
|
|
echo '[portable-debug-diagnostics] FAIL: TUI is a normal dependency' >&2
|
|
exit 1
|
|
fi
|
|
printf '%s\n' '[portable-debug-diagnostics] normal dependency graph has no codewhale-tui'
|
|
|
|
# The production crate owns the complete group and its diagnostics helpers.
|
|
# It uses actual contract-owned result/action shapes.
|
|
cargo check --locked -p codewhale-commands --lib --no-default-features
|
|
sh scripts/with-hermetic-test-home.sh cargo test -p codewhale-commands --lib --locked -- --format=pretty
|