Files
taodengandClaude Opus 4.7 1fc3a1be06 docs(adr): Draft ADR 0015 — Session-NAT Layer (Phase 8 candidate)
Forward-looking design proposal triggered by user-side architectural
insight (NAT-routing analogy) and the 2026-06-15 Anthropic billing-pool
split. Captures Option A (per-OAuth rate limit) + Option B (session
persistence) discussion as a unified Session-NAT architecture.

**Status:** Draft (Phase 8 candidate; NOT yet Accepted; spike work
required before transition to Proposed).

**Core insight:** Map (many OLP keys -> one Anthropic OAuth) the way
NAT maps (many internal IPs -> one external IP via stable port
multiplexing). claude CLI's --session-id <uuid> primitive (verified
on v2.1.154) provides the per-conversation tag. OLP holds per-OLP-key
stable session_id in ~/.olp/sessions/<key-id>/ and symlinks the
session log into Phase 7 Solution 1's ephemeral home.

**Anthropic-side observable change:**
- Before: 1 OAuth + infinite ephemeral session_ids (bot-like
  fingerprint)
- After: 1 OAuth + small bounded number of stable session_ids
  (power-user-IDE fingerprint)

**Co-merge requirements documented:**
- ADR 0001 amendment — narrow "no conversation state" to distinguish
  routing/identifier state (allowed; key manifest, cache namespace,
  session_id) from conversation/content state (still excluded; OLP
  doesn't read claude's session log)
- ADR 0009 Amendment 2 — drop --no-session-persistence from Phase 6c
  spawn args; replace with --session-id <stable_uuid>; all other
  Phase 6c flags unchanged (stream-json, --verbose, --system-prompt)
- ADR 0002 Amendment 10 — additive ISOLATION.sessionLayer field
  (optional; anthropic populated, codex/mistral omit)

**Open questions blocking transition to Proposed (7):**
1. Whether --no-session-persistence is required to be ABSENT for
   stream-json without --print (spike empirical question)
2. cwd-encoding stability across claude CLI versions
3. session file format compat across versions
4. Cost prediction validation (-20% to +50% range; needs measurement)
5. Concurrent same-key pool exhaustion behavior
6. Anthropic-side observability for billing-classification validation
7. Operator UX for forced session rotation

**Honest assessment included:** Session-NAT dampens 5 of 9 observable
fingerprint signals. Remaining 4 (per-OAuth request rate, --system-prompt
customization, HTTP headers, concurrent burst) addressed by orthogonal
mechanisms (ratelimit ADR, accepted Phase 6c trade-off, no-spoofing per
AGENTS.md, pool size cap). Not a magic bullet; durable answer remains
multi-provider fallback per ADR 0001.

**Reversibility:** Fully reversible by removing --session-id from spawn
args + deleting ~/.olp/sessions/. ~300 LOC delete. No state migration.

**Authority citations (per ALIGNMENT.md Rule 1):**
- claude CLI v2.1.154 --help capture (PI231, 2026-05-29 11:33 UTC)
- Anthropic billing announcement 2026-05-14
- ADR 0001 / 0002 / 0007 / 0009 / 0014 cross-references
- cc-mem incident_2026_05_27_spawn_cli_security.md § 6, § 9
- Phase 7 PI231 spike (docs/spikes/2026-05-29-ephemeral-home.md)

Doc-only PR. No code change. Existing OLP runtime unaffected.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 17:50:14 +10:00
..