Skip to content

Harden Entire placement routing and session identity - #192

Draft
zzwong wants to merge 2 commits into
mainfrom
fix/entire-routing-session-identity
Draft

zzwong wants to merge 2 commits into
mainfrom
fix/entire-routing-session-identity

Conversation

@zzwong

@zzwong zzwong commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Summary

Two focused fixes for the existing read-only Entire adapter:

  • Resolve a ready processing placement when its optional apiBaseUrl is omitted. Read the authenticated Core cluster catalog, match a unique cluster slug before falling back to a whole cell host label, and validate the resulting API origin. Never choose the home/default region.
  • Validate the sessions response's repo_full_name against the captured owner/repository or exact placement ULID before displaying session rows or claiming an empty range. Contradictory metadata leaves the diff usable with the existing unavailable notice.

Catalog reads are bounded to 1 MiB and 1,024 rows. Invalid present inline URLs do not fall back. Duplicate mappings fail closed. Existing account, placement, immutable-revision and origin checks remain in place; capture rejects a changed final origin before contacting that replacement region.

Adds regression cases for both Entire-native and GitHub-mirror namespaces, normalized duplicate slugs, conflicting slug/cell matches, inline/catalog transitions, movement, cancellation, and session identity mismatches. No discussion UI, transcript fetching, write capability, dependency or workflow change is included.

Related: #175, #178, #179 and #182. This is partial support work; #178–182 remain open for their broader acceptance.

Contract references

Pinned to Entire CLI v0.12.2 (c4f103d8dfed1f1549db9b2c793f2d7e10f65eb8):

Validation completed

  • Fresh main and all five existing file blobs verified at 7b68d0b6959607ff094745f8ab28a123ef2de2a8.
  • 59 Python fake-CLI output cases passed against the combined fixture: 45 routing and 14 session identity cases.
  • Python syntax, whitespace checks, forward/reverse patch application, and both-order composition of the two fixes passed.
  • Independent static review found no source-level blocker; the added transition tests were rechecked.

The Python checks qualify the fake responses only. They do not execute the Rust adapter, establish cancellation behavior, or validate a live Entire account.

Unrun checks

Rust compilation, unit/integration tests, rustfmt, Clippy, repository core/native checks and native GUI acceptance were not run locally. Cargo, rustc and rustfmt are unavailable in the assistant environment; no Rust toolchain was provisioned. No signed-in Entire service request was made. Hosted CI is separate and must pass for this exact head before merge.

Verification in a complete checkout

Use the repository's pinned Rust 1.99.0 toolchain:

cargo fmt --all -- --check
cargo test --locked -p diffz-adapters --lib entire::routing
cargo test --locked -p diffz-adapters --lib entire_sessions
cargo test --locked -p diffz-adapters --test entire
make check
make check-native

Then qualify with the signed-in CLI and accessible test repositories:

  1. Record app/CLI versions and platform. Check entire version, curl --version and diffz --doctor; use the existing authorized login.
  2. Open real et and gh Change URLs, including a processing placement outside the account's home region and an Entire-only branch on a mirror. Verify the base/head and diff against Git, exact compact-JSON source bytes, reopen and persisted resume.
  3. Where the live directory actually omits apiBaseUrl, verify catalog routing reaches the processing placement. If all available responses include it, report that live case as unobserved; use the new fixtures for omitted/malformed/ambiguous mappings and routing transitions.
  4. Check valid session context and unavailable/partial-history states. The automated fixtures cover contradictory repository identities without requiring live data changes.
  5. Exercise Open panel, positional URL, --trail, --inspect, refresh/cancel and existing-window handoff on Linux/macOS as applicable. Record untested platforms and cases under Entire: qualify signed-in native/mirror workflows on Linux and macOS #182.

Keep this draft until the Rust checks, required check/native CI and applicable signed-in acceptance are recorded.

Resolve omitted placement API origins through the bounded Core catalog.
Validate session envelope repository identity before displaying context.
Add native/mirror routing and identity regressions and document discovery.
Apply the nine formatting hunks reported by the required CI check.
No behavior or fixture-response changes.
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