refactor: take back what only this side used from core - #41
Merged
Merged
Conversation
Core's shared layer now holds only what both gateways use. This side
depends on tw-dialect, tw-guard and tw-breaker, and takes back the rest:
- `tw-crypto` becomes `think_watch_common::{crypto, json_secret}`.
`JsonSecret` returns `AppError` directly; the separate `SecretError`
only existed to keep core from knowing this crate's error type.
- `GatewayError` and `parse_retry_after_seconds` become
`think_watch_gateway::error`; `CallCtx` and `substitute_template` become
`think_watch_gateway::call_ctx` (the unused `CallCtx::trace` is gone).
- SigV4 signing and eventstream unframing become
`think_watch_gateway::bedrock`, with core's end-to-end Converse stream
test moved alongside.
- Usage sniffing is `tw_dialect::usage` and `upstream_url` is
`tw_dialect::url`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fylorn
force-pushed
the
refactor/shared-layer-one-side
branch
from
September 24, 2026 07:13
30ec1c5 to
8616b82
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Counterpart of ThinkWatchProject/ThinkWatch-Core#164, which keeps only what both gateways use in core's shared layer. This side now depends on tw-dialect, tw-guard and tw-breaker only, pinned to core v0.42.0.
Moved here
tw-crypto→think_watch_common::{crypto, json_secret}.JsonSecretreturnsAppErrordirectly;SecretErrorand itsFromimpl are gone (they only existed so core would not know this crate's error type).tw_types::{GatewayError, parse_retry_after_seconds}→think_watch_gateway::error;tw_types::{CallCtx, substitute_template}→think_watch_gateway::call_ctx. The unusedCallCtx::traceis dropped.tw_upstream::{sigv4, eventstream}→think_watch_gateway::bedrock, comments translated, with core's end-to-end Converse-stream test (wire frames → SSE → Chat client + usage sniffing) moved in as a unit test.Switched to core's new homes
tw_wire::{Sniffer, Usage}→tw_dialect::usage. The sniffer now parses each usage object with the dialect's own per-format parser; numbers are unchanged, andUsageadditionally carriesreasoning.tw_upstream::upstream_url→tw_dialect::url::upstream_url.Rebased onto dev after #40 (usage estimate):
Completed::usagestays a plainUsageplususage_estimated, now typed astw_dialect::usage::Usage.Checks
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo clippy --workspace --lib -- -D warnings, unit tests (677) — green.aws_docs_tools_list_round_trips_through_the_proxy, which calls a public AWS MCP endpoint that was unreachable from this machine.🤖 Generated with Claude Code