Skip to content

ADR-0045 W9: migrate WeezTerm to the canonical toolkit#48

Merged
vicondoa merged 7 commits into
mainfrom
adr0045-w9-weezterm
Jul 21, 2026
Merged

ADR-0045 W9: migrate WeezTerm to the canonical toolkit#48
vicondoa merged 7 commits into
mainfrom
adr0045-w9-weezterm

Conversation

@vicondoa

@vicondoa vicondoa commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates the WeezTerm d2b seam to canonical target and client toolkit contracts without enabling unfinished live routing.

Detailed changes

  • Pins d2b and d2b-toolkit through Cargo and explicit Nix flake inputs.\n- Removes copied launcher/socket ownership.\n- Adds source, fmt, and fail-closed scoped clippy checks.\n- Improves malformed-domain diagnostics without echoing rejected identifiers.

Architecture references

Delivery state

  • Base: main @ d461e3f92d9ff7faafc8e6c83a111ca0aa5ae9ca
  • Head: adr0045-w9-weezterm @ 1abba49cc593f3922345d3ca29d2fa4fe7151949
  • Tree: 212ef49eb07ed62dedd6f2d991a9ed8f8b6906e8
  • Checks: Windows, Linux, macOS, Nix, fmt, changelog, and CodeQL checks pass.

vicondoa added 7 commits July 16, 2026 16:52
Pin the canonical v2 client and contract source, and store configured
workload identity as TargetInput. Remove the v1 compatibility transport
and session UI rather than guessing the blocked service APIs.

ADR: 0010, d2b/0045
Follow the corrected shared toolkit contract by pinning the landed d2b
provider-foundation revision and recording its client distribution
fingerprint.

ADR: d2b/0045
Use the 2.0 facade as the sole source of client and contract types, and retain a typed shell-service target without reviving the retired wire implementation. Keep runtime attachment fail-closed until canonical workload routing is integrated.

ADR: 0010, d2b/0045
Follow the canonical toolkit head now that it distributes the frozen control and user-service clients. Pin the exact d2b source inventory and keep endpoint acquisition and workload routing unavailable rather than inventing a local fallback.

ADR: 0010, d2b/0045
Advance the pinned d2b-client-toolkit distribution revision from
3d6b75d47c8df66c1722ea324d64334a127d43ec to
926de54e7320599c373524a10b65aaf13b6ff422 via `cargo update -p
d2b-client-toolkit`, updating Cargo.toml, Cargo.lock,
docs/d2b-provider.md, and CHANGELOG.md. Verified against the upstream
d2b-toolkit repo and the config::d2b test suite that the canonical d2b
source revision (9dc902243cdd7aba7ef269988b96f0aae6e037da) and
fingerprint (5a20cef3a64281df819eeb76bdfe385999755479b467b559653011582fb9c043)
the facade re-exports are unchanged.

Made `nix develop --command make precommit` hermetic: the Nix cargo
in the dev shell has no rustup, so `cargo +nightly fmt` failed with
'no such command: +nightly', and the shell lacked cargo-nextest. `make
fmt` now falls back to bare `cargo fmt` (which resolves to the same
pinned nightly rustfmt already on PATH) only when rustup is absent, so
rustup-based checkouts keep using `cargo +nightly fmt` unchanged.
Added pkgs.cargo-nextest to the flake devShell so nextest runs without
network installs. Updated AGENTS.md's precommit section to document
the nix-shell behavior.
…9fu1 )

Pin explicit d2b/d2b-toolkit flake = false inputs (matching the exact
Cargo.lock git revisions) in flake.nix/nix/flake.nix, and thread their
locked narHash into sourcePackage.cargoLock.outputHashes for the
d2b-client, d2b-contracts, d2b-session, and d2b-client-toolkit crates.
nix build .#source now vendors those four crates through the hermetic
fetchgit fixed-output-derivation path with flake.lock as the narHash
authority, instead of relying solely on cargoLock.allowBuiltinFetchGit's
impure fallback for them. allowBuiltinFetchGit remains set only for the
seam's other, unrelated git dependencies (xcb-imdkit, finl_unicode).
Verified empirically that fetchgit's default-leaveDotGit hash matches
the github flake fetcher's narHash for both pinned revisions before
wiring this in.

Add checks.cargo-fmt and checks.cargo-clippy flake outputs that reuse
sourcePackage's pinned src/patches/vendored cargoLock (no second
fetch). cargo-fmt runs cargo fmt --all -- --check across the tree.
cargo-clippy runs cargo clippy -p config --all-targets --no-deps and
hard-fails only on findings inside config/src/d2b.rs, since the
vendored upstream wezterm/config tree carries extensive pre-existing
clippy findings this seam does not own and must not fix as a side
effect.

Improve config/src/d2b.rs's invalid canonical realm_id/workload_id
error messages to include the configured domain name so a
multi-domain config points at the failing [[d2b_domains]] entry; the
rejected target value itself is still never echoed back.

Update docs/d2b-provider.md and AGENTS.md to describe the new flake
input/outputHashes wiring and the checks' scope, and CHANGELOG.md.
…ors ( W9fu2 )

Remove `|| true` from the cargo-clippy flake check so a genuine
compilation or tooling failure fails the build. To tolerate
pre-existing lint debt in the vendored upstream config crate without
`-D warnings`, run clippy with `-- --cap-lints=warn`, which caps every
lint (including deny-by-default ones) to at most a warning so only a
real compile/tooling failure can make cargo itself exit nonzero.

Extract the file-scoped diagnostic filter into nix/clippy-scope-filter.sh,
which hard-fails on findings inside config/src/d2b.rs and, critically,
also hard-fails if the clippy JSON can't be parsed/filtered instead of
silently treating that as "no findings" (the previous inline `jq -e`
pattern conflated jq's "no match" and "parse error" exit codes). Add a
--self-test mode covering finding/no-finding/malformed/empty-input
cases as a lightweight regression check.
@vicondoa vicondoa changed the title d2b: migrate seam to canonical client targets ADR-0045 W9: migrate WeezTerm to the canonical toolkit Jul 21, 2026
@vicondoa
vicondoa marked this pull request as ready for review July 21, 2026 22:38
@vicondoa
vicondoa merged commit 12fd3ae into main Jul 21, 2026
18 checks passed
@vicondoa
vicondoa deleted the adr0045-w9-weezterm branch July 21, 2026 22:43
vicondoa added a commit that referenced this pull request Jul 23, 2026
## Summary

Restores WeezTerm to the tree before the ADR 0045 W9 canonical toolkit
migration.

## Detailed changes

- Reverts merged PR #48.
- Restores the previous d2b mux/launcher implementation, dependency
pins, Nix checks, and documentation.

## Architecture references

- Reverted d2b decision: ADR 0045

## Delivery state

- Base: `main`
- Rollback baseline: `d461e3f92d9ff7faafc8e6c83a111ca0aa5ae9ca`
- Head: `revert-adr0045-baseline`
- Verification: rollback commit tree exactly equals the baseline tree

Co-authored-by: John Vicondoa <vicondoa@users.noreply.github.com>
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.

1 participant