Uh oh!
There was an error while loading. Please reload this page.
refactor(node): W1b-1 — seam content, ContentServer trait/handle carve (#1285) - #66
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
…e (#1285, #1298) Carves content_serve.rs's Node methods into the ContentServer trait (seam 5's public surface), implemented by Node with the EXISTING method bodies unchanged (serve_content_plaintext, manifest_paths, resource_generation) — behaviour- preserving trait extraction, not a new implementation. async_trait-boxed (matching shared::AnchoredRootResolver's pattern) so it stays dyn-compatible for the Arc<dyn ContentServer> handle the W1c composition root will hold. Private serve-tier helpers (decrypt_local, peer_serve_plaintext, proxy_full_content) stay as an inherent impl Node block alongside the trait impl — they are implementation details of this seam, not part of its public surface. Every caller of the 3 trait methods (dig-node-core's own tests, dig-node-service's server.rs) now brings `ContentServer` into scope; no signature, behaviour, or call-site logic changed. Depends on W1b-0 (merged, #1285). Co-Authored-By: Claude <noreply@anthropic.com>
MichaelTaylor3d
marked this pull request as ready for review
July 20, 2026 19:47
MichaelTaylor3d
left a comment
ContributorAuthor
There was a problem hiding this comment.
PASS (single correctness gate, medium effort) — behaviour-preserving trait extraction, zero logic change.
Verified by reading (no rebuild; CI already green):
- Zero logic change:
serve_content_plaintext,manifest_paths,resource_generationmoved fromimpl Nodeintopub trait ContentServer+impl ContentServer for Node(seams/content/content_serve.rs) with byte-identical bodies.git diff -won lib.rs collapses to 12 ins / 4 del (module re-exports +use crate::ContentServerin 6 unit tests); the full-file textual diff is trailing-whitespace/EOL noise only (Rustfmt gate green). Private helpers stay inimpl Node. - Callers resolve, blast radius bounded: production use-site = dig-node-service/src/server.rs (adds
ContentServerto thedig_node_coreimport); back-compatcrate::content_serve/dig_node_core::content_servepaths preserved via re-export. content.rs and tests/content_serve.rs only reference the methods in doc comments — no import needed. No other callers. - Cross-seam field reaches (chain/rpc/capsule on Node inside
serve_content_plaintext) unchanged — the expected-at-W1b pattern, isolated at W1c. Not a violation. - Versions: dig-node-core 0.13.3, dig-node-service 0.47.3, Cargo.lock agree; version-increment check green.
- Gates green (Rustfmt/Clippy/Test+coverage/commitlint/CodeQL/version); platform .deb/.pkg/.msi builds still running (packaging, non-correctness). Zero review threads open.
Merge-ready once the pending packaging builds finish.
Uh oh!
There was an error while loading. Please reload this page.
MichaelTaylor3d added a commit
that referenced
this pull request
Aug 6, 2026
…tadata (#185) Closes dig_ecosystem#2145. Hardens two DoS gaps on the anonymous, internet-reachable public-manifest read path. The ticket's fix#1 (the manifest-memo byte budget: MANIFEST_MEMO_MAX_BYTES=32 MiB + MANIFEST_ENTRY_MAX_BYTES=4 MiB + LRU) was already on main; this closes the two remaining gaps: 1. cache.clear now drains the process-lifetime manifest memo (it previously left it intact, so an operator couldn't reclaim it). 2. dig.getMetadata gets a 3 MiB response ceiling. It was the only public-tier read with no response cap (~200 B in -> up to ~100 MB out). A whole JSON object can't be windowed, so an oversized section is refused with a bounded -32015 METADATA_TOO_LARGE. read_metadata_manifest_json returns the rendered Arc<str> so get_metadata checks the raw length BEFORE parsing, so the oversized body is never parsed + re-serialized. Normal metadata serves byte-identically. Both gates PASS: loop-reviewer (correctness) + loop-security (the getMetadata ceiling is a hard pre-parse bound on every render path, no bypass; cache.clear is control-token-gated, not anonymous-reachable; every arm fails closed). The -32015 error is catalogued in docs.dig.net (companion PR #66). Non-gating follow-ups: #2217 (error-code drift), #2218 (gitnexus runner), #2219 (encoded-length pre-filter). root [workspace.package].version 0.99.1 -> 0.99.2 (patch, fix). Closes #2145 Co-Authored-By: Claude <noreply@anthropic.com>
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 freeto 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.
What
W1b-1 (2nd of the 7 W1b sub-PRs, #1285): carve `content_serve.rs`'s `impl Node` methods
into a `ContentServer` trait + handle under `seams/content/`, using the W1a `shared/`
types (`ContentResponse` etc.) as the only cross-seam vocabulary. Behaviour-preserving —
relocate + trait-extract only, no logic/algorithm change.
Depends on W1b-0 (merged, origin/main @ 0d58c7f).
Closes nothing yet (tracking #1285).