Skip to content

refactor(commands): adopt portable config shapes for the complete config group (FEAT-028) - #6973

Open
aboimpinto wants to merge 6 commits into
codewhale-hq:mainfrom
aboimpinto:feat/FEAT-028-adopt-command-shapes-in-tui-config-main-slice
Open

aboimpinto wants to merge 6 commits into
codewhale-hq:mainfrom
aboimpinto:feat/FEAT-028-adopt-command-shapes-in-tui-config-main-slice

Conversation

@aboimpinto

@aboimpinto aboimpinto commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refs #5316

This is a large, behavior-preserving refactor: remove the config Slash Command Group's concrete App/TUI dependencies and replace them with Shapes connections. The PR is large because the existing Slash Command Group is large—that is how it was designed. No product-behavior change is intended.

The migration covers all 19 current registrations, including upstream's /connect and /disconnect. The physical crate move remains separate work.

What changed

  • Portable command contracts, narrow facets, capability declarations and shared actions replace direct App/TUI dependencies.
  • Parsing and command rendering live in the portable group; adapters retain concrete observation, persistence and host effects.
  • Typed settings/audit/subagent reports and import outcomes cross the boundary.
  • Prepared templates validate message contracts; malformed replies fail without a successful action. Host-contract violations remain explicitly outside the prepared-message guarantee.
  • The proof compiles the actual group root as an independent library; the migration frontier becomes ["core"].
  • Upstream behavior retained includes plugin-provider connect/disconnect, pet style/language, localized Work/Full Access receipts and legacy sandbox-token cleanup.

Historical contributor status and verification (599119aa5)

The original contributor verification below belongs to 599119aa5; the current draft/head status is recorded in the maintainer update below.

Head 599119aa5 fixes the five failures reported on 593d7d717 by both the macOS job and the Linux job:

  • /mode metadata now shares the handler's Work-mode usage, restoring help filtering.
  • /login again directs plugin-provider sign-in to /connect.
  • The migrated-command test inventory includes /connect and /disconnect.
  • The moved YOLO test expects upstream's Full Access (Work) receipt, retaining all permission/state assertions.

These were real reconciliation defects, not unrelated upstream failures. Earlier broad local verification did not establish that those fixes were present in the pushed tree; this follow-up records the committed repair explicitly.

Verification for 599119aa5

Check Result
Five CI regressions reproduced before editing 5 run, 0 passed, 5 failed
Same five after repair 5 run, 5 passed
Commands, help and settings test scope 1,357 run, 1,357 passed
Independent portable-config proof PASS; 35 run, 35 passed
Proof negative controls 7 passed
Migration-manifest tests 63 passed
Formatting and diff whitespace check Passed
Hosted platform checks on the new head Pending

Local execution was on Linux. A passing macOS/Windows run, full hosted CI approval, merge and release are not yet claimed.

Paulo Aboim Pinto

Current maintainer repair — 2026-10-14

Current head b323af876b preserves Paulo's original commits and all19 command registrations. The existing bridge runs import copying off Tokio workers and the protected no-replace writer keeps concurrently created standing instructions intact. Normal TUI import is /import-claude --apply on the multithread composition runtime; unsupported current-thread embedding keeps its explicit copy-failed outcome. Current main's215 dead-code budget and the contributor's portable proof workflow remain.

The predecessor d7b5a4c completed full own-head CI: macOS19,084 passed/0failed/33skipped, Ubuntu19,081/0/34 plus a separate35-case portable proof, Windows18,350 passed(one recorded browser-launcher leak)/0failed/27skipped. Named owner recovery passed on allthree. Actual CI-flags Clippy9m23 and all ratchets passed. These raw results were audited and remain historical evidence.

A fresh review then identified five gaps in the existing authority checks. This six-file correction includes both LOGIN/WORK_SURFACE identity bits and explicitly rejects CONFIG/PET/TRUST/LOGIN/WORK_SURFACE from unrelated debug/export/structcopy/config-policy envelopes. All old assertions remain; no production capability change, new test function or code comment. The five finding threads remain open pending exact new-head verification.

Focused local execution used a separate frozen combined canonical source, with allsix corrected files equal to this commit: command-contract2passed/0failed; TUI63passed/0failed/15,356outsidefilter including both export helper callers; the additional config-policy case1passed/0failed/15,418outsidefilter. All66 unique test identities/ordinals were audited. npm1,312passed/0failed/7skipped and web/fmt/diff passed. The existing macOS linker warning remains visible. This is not a clean own-head binary, new-head Windows run, live provider call or final distribution proof.

Fresh exact-head CI38548061013 is running on b323af8. Complete current CI, every review and the merge gate remain required. Prior a424 advisory ratchet failures and d7 reviews are retained; neither is waived or relabeled as current approval. The source branch and original human history will remain. 0.10.2 has not shipped.

Refs #6973

@aboimpinto
aboimpinto force-pushed the feat/FEAT-028-adopt-command-shapes-in-tui-config-main-slice branch from 10fe2a8 to 57d09b0 Compare October 13, 2026 15:43
@aboimpinto
aboimpinto marked this pull request as ready for review October 13, 2026 15:43
@aboimpinto
aboimpinto requested a review from Hmbown as a code owner October 13, 2026 15:43

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@aboimpinto
aboimpinto force-pushed the feat/FEAT-028-adopt-command-shapes-in-tui-config-main-slice branch from 57d09b0 to c622222 Compare October 13, 2026 17:26
…fig group

Reconciled onto current origin/main (39f0733). The config Slash Command Group
no longer depends on App/TUI: every command parses, branches and renders in the
portable group, and the host returns typed facts and operation outcomes.

Carries upstream behavior added since the original base:
- /connect and /disconnect (now portable commands in the group inventory, 19
  registrations);
- /pet style and /pet language (new portable pet appearance controls);
- mode receipts use the localized display name and the Full Access (Work) label;
- legacy sandbox token clearing (LEGACY_SANDBOX_TOKEN_SLOT) instead of Daytona.

Contract: capability bits and facet traits for the group; unified ConfigAction
with portable payload mirrors; ConfigReply with keyed/literal ConfigMessage
(self-recursive, no Box).

Safe rendering: capabilities and required templates are validated before any
effect; prepared rendering substitutes validated templates and never re-translates
after a mutation; a missing capability, invalid replacement contract or
unprepared key fails loudly with no action; the interactive reply renderer shares
the same policy. /settings, the audit and the subagent report return structured
rows the group renders; /workbar surfaces setter errors; /import-claude plans use
the host display projection.

Guards: the migration frontier advances from [config, core] to [core], and the
live-gate expectation moves with it.

CI lane fixes: the portable proof imports, the moved test helper path, the
settings row formatting (to_string instead of a useless format!), the contributor
credit surface, and the preflight large-Err allowance.

Verification: clippy (workspace, all-targets, all-features, -D warnings with the
project's allowances) clean; config-proof PASS (35 portable tests) + 7 negative
controls; migration-manifest tests PASS; boundary guard PASS; 353 config/settings
tests pass; broad commands/app/ui/settings 2796 pass with only the pre-existing
upstream failure tui::ui::tests::persisted_queued_native_skill_is_denied_after_host_withdrawal
(reproduces on clean origin/main); cargo fmt clean.
@aboimpinto
aboimpinto force-pushed the feat/FEAT-028-adopt-command-shapes-in-tui-config-main-slice branch from c622222 to 593d7d7 Compare October 13, 2026 17:43
@aboimpinto
aboimpinto marked this pull request as draft October 13, 2026 18:22
Refs codewhale-hq#5316; CI follow-up for PR codewhale-hq#6973.

Use the same Work-mode usage string in the portable handler and metadata,
restoring help filtering by "mode [work". Restore upstream login guidance
pointing plugin-provider sign-in to /connect. Include connect/disconnect in
the migrated registry test inventory and align the moved YOLO test with
the existing Full Access (Work) receipt; keep all permission/state assertions.

Reproduced all five failures from macOS job 115447780813 and Linux job
115447780694 locally before editing: 5 tests run, 0 passed, 5 failed.
After the fix: 5 tests run, 5 passed. Related commands/help/settings scope:
1357 tests run, 1357 passed. Portable config proof: 35 tests run, 35 passed;
7 proof negative controls and 63 migration-manifest tests passed.
Formatting and git diff --check passed. Hosted confirmation remains pending.
PR intentionally remains draft.

Signed-off-by: Paulo Aboim Pinto <paulo.aboim.pinto@gmail.com>
@Hmbown

Hmbown commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

I can't thank you enough for the quality of care you bring to Codewhale. This is so wonderful and helpful.

Registration slot10 is status; slot12 is mode. Preserve the nineteen-command migration, declared mode capabilities and whole-config proof. Strengthen two existing fixtures through the actual /jihua and /zidong dispatcher without adding test functions or comment text.

The separate proposed cold-build CI/debug settings patch is retained as an artifact: GitHub rejected its push because the current OAuth App lacks workflow scope. This source-only commit leaves the workflow unchanged; no deadline, gate or assertion is disabled.

Exact scoped source review and artifact Rustfmt parsing passed. Full own-branch compilation, before/after alias execution, npm/web and actual native CI are pending; no Windows or release acceptance claim. Draft readiness unchanged.

Refs codewhale-hq#6973
CodeWhale Bot added 2 commits October 13, 2026 23:29
…tion debt

Preserve @aboimpinto's original command-shape work. Remove the obsolete config-host dead-code blanket. Reuse the existing runtime bridge to run import I/O off Tokio workers and the protected no-replace writer so instructions created concurrently remain intact. Strengthen the existing import fixture to execute its first copy on a multithreaded runtime. No new test function or code comment.

Scoped frozen canonical ECD+63-path Mac evidence:
Summary [1.183s] 129 tests run: 129 passed, 15219 skipped.
Summary [0.478s] 35 tests run: 35 passed, 0 skipped.
Existing Python harnesses: 34 + 7 + 63 tests; 0 failed.
npm: 540 Node + 772 Vitest = 1312 passed; 0 failed; 7 skipped.
Web, fmt, diff and actual CI-flags workspace/all-target/all-feature Clippy (9m58s) passed; existing linker warning retained.

Only the three repaired source files match those frozen verified bytes. The own-PR tree uses main's older private-directory helper and dependency graph; fresh hosted own-head CI is required. Windows no-clobber/package acceptance has not been run locally. Original a424 native greens and actual fork-advisory ratchet failures remain historical.

Refs codewhale-hq#6973
Retain the original command-shape commits and verified three-file import/ratchet repair, plus current main's five removed suppressions and exact 215 dead-code budget. The original portable-config workflow rename remains; no new timeout or debug setting is added. All non-PR paths equal current main. Canonical scoped Mac evidence is recorded in the repair commit; complete new own-head hosted CI/reviews remain required before merge.

Refs codewhale-hq#6973
@Hmbown

Hmbown commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you, @aboimpinto, for carrying all19 config-group registrations onto portable command contracts while keeping persistence and host effects in their owning adapters. Your original commits remain in this PR. The d7 head completed allthree native suites (macOS19,084/0, Ubuntu19,081/0, Windows18,350passed/0failed with one recorded browser-launcher leak), plus35portable cases and CI-flags Clippy. The fresh review found gaps in the existing capability checks; b323af876b restores exhaustive identity/facet assertions, including the analogous config-policy check. Local changed-surface checks passed66existing cases and npm1,312/0/7; new exact-head CI is running. Your branch will remain, and I will finish the verified work as this PR. 0.10.2 is still an unshipped candidate; current-head Windows/package acceptance is not yet claimed.

@Hmbown
Hmbown marked this pull request as ready for review October 14, 2026 09:11
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-14T09:20:26.500066Z d7b5a4c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Exact-authority tests now wildcard away the newly introduced config facets, weakening capability-boundary regression coverage.

5 open findings
What changed in this PR

Refactors all 19 config commands behind portable contracts while retaining TUI-specific effects in host adapters.

Changes:

  • Adds config facets, actions, typed reports, and portable handlers.
  • Expands the portability proof from config policy to the complete config group.
  • Migrates Claude import, settings rendering, registration, and capability wiring.
File Description
.github/​workflows/​ci.yml Runs the complete config portability proof.
Cargo.lock Renames the portability package.
Cargo.toml Updates the workspace proof member.
crates/​command-contract/​src/​config.rs Defines portable config facets and payloads.
crates/​command-contract/​src/​facets.rs Extends mode-policy operations.
crates/​command-contract/​src/​handler.rs Adds config capability slots and contexts.
crates/​command-contract/​src/​lib.rs Exports the config contract module.
crates/​command-contract/​src/​outcome.rs Adds the unified config action vocabulary.
crates/​command-contract/​src/​tests.rs Tests capability identities and contexts.
crates/​command-contract/​src/​types.rs Adds portable mode, screen, and workbar types.
crates/​tui/​src/​commands/​config_group.rs Registers portable config handlers.
crates/​tui/​src/​commands/​config_host.rs Converts portable replies and actions.
crates/​tui/​src/​commands/​config_main_import_host.rs Hosts Claude import I/O and application.
crates/​tui/​src/​commands/​config_main_host.rs Hosts concrete config operations.
crates/​tui/​src/​commands/​config_policy_host.rs Reuses unified config action conversion.
crates/​tui/​src/​commands/​config_policy_host_tests.rs Updates config registry tests.
crates/​tui/​src/​commands/​config_policy_permissions_tests.rs Exercises permissions through the contract.
crates/​tui/​src/​commands/​contract/​config_main.rs Implements concrete config facets.
crates/​tui/​src/​commands/​contract/​config_messages.rs Resolves portable localization keys.
crates/​tui/​src/​commands/​contract.rs Wires config facets into context bundles.
crates/​tui/​src/​commands/​debug_diagnostics_surface_tests.rs Adapts diagnostics authority checks.
crates/​tui/​src/​commands/​debug_mutation_host_tests.rs Adapts debug authority checks.
crates/​tui/​src/​commands/​groups/​config/​import_claude.rs Moves Claude plan rendering into portable code.
crates/​tui/​src/​commands/​groups/​config/​mod.rs Defines the 19-command portable inventory.
crates/​tui/​src/​commands/​groups/​config/​policy.rs Exposes portable policy modules.
crates/​tui/​src/​commands/​groups/​config/​status.rs Exposes the safety-message helper.
crates/​tui/​src/​commands/​groups/​core/​workflow.rs Routes workflow settings to the host adapter.
crates/​tui/​src/​commands/​groups/​mod.rs Registers the new config group adapter.
crates/​tui/​src/​commands/​mod.rs Integrates portable config dispatch.
crates/​tui/​src/​commands/​session_export_test_support.rs Updates export context destructuring.
crates/​tui/​src/​commands/​session_structcopy_host_tests.rs Updates structcopy context checks.
crates/​tui/​src/​import_claude.rs Produces contract-owned import plans.
crates/​tui/​src/​settings.rs Produces typed settings reports.
scripts/​check-command-config-proof.py Validates the complete portable group.
scripts/​check-portable-config-policy.sh Removes the policy-only proof runner.
scripts/​check-portable-config.sh Adds the complete-group proof runner.
scripts/​command-migration-topology.json Removes config from the migration frontier.
scripts/​dev-test.sh Renames the portable-config test target.
scripts/​test_check_command_config_policy_proof.py Removes policy-only negative controls.
scripts/​test_check_command_config_proof.py Adds complete-group negative controls.
scripts/​test_check_command_migration_manifest.py Updates the expected frontier.
tests/​portable-config-policy/​src/​lib.rs Removes the narrow proof root.
tests/​portable-config/​Cargo.toml Configures the complete-group proof crate.
tests/​portable-config/​src/​lib.rs Mounts the actual config group root.
web/​lib/​release-credits.ts Adds the unreleased contributor credit.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/command-contract/src/tests.rs
Comment thread crates/tui/src/commands/debug_diagnostics_surface_tests.rs Outdated
Comment thread crates/tui/src/commands/debug_mutation_host_tests.rs Outdated
Comment thread crates/tui/src/commands/session_export_test_support.rs Outdated
Comment thread crates/tui/src/commands/session_structcopy_host_tests.rs Outdated
Refs codewhale-hq#6973

The new config/login/work-surface slots were omitted from five existing authority guards. Include both new identity bits, destructure every facet and reject all unrelated slots; the analogous config-policy guard now checks the same five slots. Production capabilities and existing assertions remain unchanged. No new test functions or code comments.

Verified in the frozen combined canonical source, with all six repaired file hashes equal to this commit: Summary 2 tests run: 2 passed, 77 skipped (command-contract); Summary 63 tests run: 63 passed, 15356 skipped (TUI including both export helper callers); Summary 1 test run: 1 passed, 15418 skipped (config-policy). All 66 result ordinals and identities audited. Existing macOS __eh_frame linker warning retained. npm: 540 Node plus 772 Vitest passed; 0 failed; 7 skipped. Web, fmt and diff checks pass. No clean own-head binary or new-head Windows run claimed; fresh hosted CI/review remain required. Prior d7 full three-platform pass is retained as historical evidence, not qualification of this new head.

Source review matched the six existing test files to immutable d7 preimages. Original contributor history and branch are preserved.
@aboimpinto

Copy link
Copy Markdown
Contributor Author

Thank you, @Hmbown, for the kind words, the careful follow-through, and for preserving my commits and branch.

I have fast-forwarded to your b323af876b head and checked all five Copilot findings against the actual assertions. Your repair covers every finding, including both export-helper callers and the analogous config-policy check. I replied to each thread with the fixing commit and verification, and resolved all five; no duplicate source patch or history rewrite was necessary.

I also read the completed logs from exact-head CI 38548061013, rather than relying on the predecessor's results:

  • Linux: 19,100 passed, 34 skipped; separate portable proof 35 passed.
  • macOS: 19,103 passed, 33 skipped.
  • Windows: 18,356 passed, 27 skipped, with one recorded browser-launcher leak (external_url_launcher_does_not_wait_for_browser_process). This caveat remains visible despite the job passing.
  • Lint, Safety gate and the architectural guards passed.

Claude's automated review was disabled for the fork; the Codex review run reports failure without a code finding. Neither is being counted as a successful review. The five actionable Copilot findings are addressed and verified.

I am leaving your current head and ready-for-review state unchanged for your merge decision. This confirms the tested PR source, not a release or final packaged-Windows acceptance.

Paulo Aboim Pinto

@Hmbown Hmbown left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving at b323af8 after reviewing the maintainer follow-ups; all required checks green on macOS, Ubuntu and Windows.

— Written by Claude Opus 5.5 (AI agent) on behalf of the maintainers.

This branch has not been deployed

No deployments
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.

3 participants