Skip to content

docs(adr): record proxy-warming vs origin-only policy composition (#1990) - #2055

Merged
alpergundogdu merged 2 commits into
mainfrom
claude/1990-options-simplification-9fbe3d
Sep 18, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
claude/1990-options-simplification-9fbe3d

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Closes #1990.

What

#1990 flags an undocumented interaction between two deliberate policies:

A has_blob: false probe answer is identical on the wire for an origin-only node and a relay edge, so the client's fallback can route a warming attempt to a node that categorically declines it.

Decision (from spec discipline)

Ran all three options from the issue through decdn-spec-discipline. The sharper finding: the two policies compose correctly — there is no conflict to resolve. Proxy warming is a relay-edge mechanism by construction; an origin-only node declining a warming pull is #1759 functioning, not a warming failure. The decline collapses to NotFound, the client fails over over the shared pool at the cost of one round-trip, and pays nothing.

The two options that would add a mechanism stay out, each failing a gate:

Changes (documentation only)

  • ADR 037 gains a ### Warming is a relay-edge mechanism section and a Cross-ADR Impact bullet for ADR 002.
  • ADR 002 § Retrieval by namespace gains the canonical statement of the relay_foreign_namespaces role-derived policy — previously code-only, referenced obliquely by ADR 041 as "a separate policy, outside this decision."

Present-tense canon; no mechanism added.

On the "add counters" ask

The observability the issue asks for already exists where a counter is meaningful, so no new counter is added:

  • Node side already has it. decdn_serve_stream_rejected_foreign_declined_total is defined, wired to the decline path (wire.rs), and tested (metrics.rs) — added with feat(node): origin-only node policy — decline foreign relay via cached backend probe (#1759) #1766. This is the population-level signal ("how often origin-only policy fires"). The issue's "no counter on either side" is stale for the node.
  • Client side can't have a live one. Proxy-warming selection is CLI-only (decdn fetch / bundle pull); the daemon's miss-leg does a plain holder pull, never warming. decdn fetch is an ephemeral one-shot with no /metrics endpoint, so a Prometheus counter there would be dead instrumentation (fails the enforcement / live-consumer gates). The client events are already logged: warming-lead info!, cold-fallback info!, decline→failover warn!.

The new ADR text points at exactly these — the decline counter and the client logs — as the answer to the issue's "nothing measures" concern.

Verification

  • make -C adr check-refs — passes (all anchor links resolve, no bare refs)
  • markdownlint — passes
  • pre-commit hooks — pass

🤖 Generated with Claude Code

)

Two deliberate policies interact in a way neither ADR documented: the
client's cold-blob / warming fallback (ADR 037) targets RTT-nearest
non-holders, and an origin-configured node defaults to origin-only
(`relay_foreign_namespaces = false`, #1759) and declines a foreign miss.
The fallback can therefore route a warming attempt to a node that
categorically declines it.

Run through spec discipline, the two policies compose correctly rather
than conflict: proxy warming is a relay-edge mechanism by construction,
and an origin-only node declining a warming pull is the origin-only
policy holding, not a warming failure. The decline collapses to
`NotFound`, the client fails over over the shared pool at the cost of one
round-trip, and pays nothing.

Document the composition:
- ADR 037 gains a "Warming is a relay-edge mechanism" section and a
  Cross-ADR Impact bullet for ADR 002.
- ADR 002 § Retrieval by namespace gains the canonical statement of the
  `relay_foreign_namespaces` role-derived policy (previously code-only,
  referenced obliquely by ADR 041 as "a separate policy").

No mechanism is added. The two options that would (a self-attested probe
flag to pre-filter origin-only nodes, and reversing the #1759 default)
stay out — both add surface to force an optimization that is correctly
not firing. The interaction is already observable: the serving node
counts declines in `decdn_serve_stream_rejected_foreign_declined_total`
(exists since #1766) and the client logs its warming lead and each
failover; the client is an ephemeral CLI with no scrape endpoint, so a
client-side counter would be dead instrumentation.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 18, 2026 15:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new ADR 037 text incorrectly states the probe has_blob answer is unsigned (it is signed), and ADR 002 wording risks implying the serve/decline decision is based on namespaceId rather than backend-authoritative presence.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Documents how ADR 037 proxy-warming composes with the ADR 002 origin-only (cache.relay_foreign_namespaces) policy, clarifying that origin-only nodes declining warming pulls is expected behavior (and observable via existing metrics/logs).

Changes:

  • Add a new “Warming is a relay-edge mechanism” section to ADR 037, plus an explicit cross-ADR impact bullet referencing ADR 002.
  • Add a canonical description of cache.relay_foreign_namespaces role-derived defaults and decline semantics to ADR 002’s “Retrieval by namespace” section.
File summaries
File Description
adr/037-regional-proxy-warming.md Adds explicit composition/observability text for proxy warming vs. origin-only relay policy.
adr/002-content-addressing.md Documents cache.relay_foreign_namespaces policy defaults and how declines surface on the wire.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

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

Comment thread adr/002-content-addressing.md Resolved
Comment thread adr/037-regional-proxy-warming.md Resolved
…review)

Two accuracy fixes from PR review:
- ADR 037 said the probe `has_blob` answer is "unsigned"; it is signed
  (EIP-712 `slash_sig` over `{hash, has_blob, rate_per_mb, timestamp_us}`).
  The real point is that `ProbeResponse` carries no policy/role field, so a
  client cannot tell an origin-only node from a relay edge — reworded to say
  exactly that.
- ADR 002 described the origin-only decline in namespace terms, risking the
  implication that `namespaceId` drives the serve/decline decision. The gate
  is backend-authoritative (`origin_probe_presence(hash)`) and never consults
  `namespaceId`, which stays a routing hint (#1525). Reworded to backend
  presence and stated the non-consultation explicitly.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@alpergundogdu
alpergundogdu merged commit 68b31c3 into main Sep 18, 2026
25 checks passed
@alpergundogdu
alpergundogdu deleted the claude/1990-options-simplification-9fbe3d branch September 18, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants