GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(usage): read connected hub usage scoped to the enrolled client key by lidge-jun · Pull Request #4373 · lidge-jun/opencodex

feat(usage): read connected hub usage scoped to the enrolled client key #4373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
lidge-jun merged 113 commits into codex/260912-60plus-operations-totals from codex/260912-60plus-operations-client-usage
Sep 13, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat(usage): read connected hub usage scoped to the enrolled client key #4373

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
9cab1ae
fix(start): report auxiliary listener failures without public-port re…
lidge-jun Sep 12, 2026
c597591
fix(start): retain degraded-listener evidence in salvage diagnostics
lidge-jun Sep 12, 2026
d95743b
test(config): activate routing-profile salvage in listener regression
lidge-jun Sep 12, 2026
dcd2d07
fix(search): retry clean empty answers without masking truncation
lidge-jun Sep 12, 2026
45f703f
test(search): narrow terminal fixture projection
lidge-jun Sep 12, 2026
3652da7
test(search): exercise live output truncation without duplicate replay
lidge-jun Sep 12, 2026
3bf0ae1
feat(remote): carry bounded executor and hub runtime adapters
lidge-jun Sep 12, 2026
59ec04b
fix(cursor): preserve first overflow and bound stable-thread remints
lidge-jun Sep 12, 2026
a318218
style(remote): remove trailing blank line in runner
lidge-jun Sep 12, 2026
b2d239e
fix: bound multipart encrypted agent task recovery
lidge-jun Sep 12, 2026
36625c7
test(cursor): activate remint guards after first overflow
lidge-jun Sep 12, 2026
a7b41aa
test: cover multipart boundary and input mutation cases
lidge-jun Sep 12, 2026
321b9b1
fix(live): validate sideband upstream before client upgrade
lidge-jun Sep 12, 2026
115e347
docs: synchronize shared V2 roadmap and review outcomes
lidge-jun Sep 12, 2026
d3b3b6d
feat(remote): integrate opt-in workspace dashboard and admission
lidge-jun Sep 12, 2026
3565b90
feat(usage): read connected hub usage within the enrolled client key
lidge-jun Sep 12, 2026
132403d
docs: place recovery contract away from shared append points
lidge-jun Sep 12, 2026
c9544c1
docs: separate sibling contract references in single-section owners
lidge-jun Sep 12, 2026
bf369d9
test(usage): ground account redaction and hub read deadlines
lidge-jun Sep 12, 2026
5c462fe
fix(remote): close startup cleanup races and preserve dashboard intent
lidge-jun Sep 12, 2026
e5ce931
fix(config): identify the actual malformed hub field in listener warn…
lidge-jun Sep 12, 2026
46f90d3
Merge latest dev and preserve sideband runtime contract
lidge-jun Sep 12, 2026
a1b8f96
fix(usage): restrict client-key transport and prevent response caching
lidge-jun Sep 12, 2026
7cccab3
fix(dashboard): guide hub pairing without restarting healthy clients
lidge-jun Sep 12, 2026
673ee8c
fix(openai-chat): normalize oversized inline images before serialization
lidge-jun Sep 12, 2026
b110d63
fix(openai-chat): retain synchronous under-budget image construction
lidge-jun Sep 12, 2026
1898bba
merge: reconcile current dev documentation for search recovery
lidge-jun Sep 12, 2026
14e93ca
merge: preserve current dev contracts for #4378
lidge-jun Sep 12, 2026
2be548a
merge: preserve current dev contracts for #4353
lidge-jun Sep 12, 2026
06fc280
Merge remote-tracking branch 'origin/dev' into codex/260912-finish-4363
lidge-jun Sep 12, 2026
eca7ce9
fix(cursor): preserve isolated recovery state and active cap retention
lidge-jun Sep 12, 2026
e2fc5ab
fix(remote): bound runtime admission and retain cleanup ownership
lidge-jun Sep 12, 2026
2056305
merge: carry refreshed usage foundation into client usage
lidge-jun Sep 12, 2026
379cf25
merge: carry runtime bounds while preserving integration shutdown han…
lidge-jun Sep 12, 2026
8cafec9
Merge remote-tracking branch 'origin/dev' into codex/260912-finish-4367
lidge-jun Sep 12, 2026
3ad908f
docs: synchronize live sideband handshake ownership
lidge-jun Sep 12, 2026
47d07d5
fix(remote): surface late resumed runtime cleanup failures
lidge-jun Sep 12, 2026
efb3936
fix(search): reject malformed truncated calls before replay
lidge-jun Sep 12, 2026
63bba2f
fix(remote): start owned socket cleanup before graceful drain
lidge-jun Sep 12, 2026
dbeade7
fix(remote): acknowledge prompt admission before model completion
lidge-jun Sep 12, 2026
4124a64
fix(dashboard): retain access errors across compound poll failures
lidge-jun Sep 12, 2026
4ad1d1c
fix(remote): align admission contracts and fallback session cursors
lidge-jun Sep 12, 2026
57b3057
docs: describe cancelled live sideband handshakes
lidge-jun Sep 12, 2026
52c8e8a
fix(pairing): use erasable types and explicit JSX event handlers
lidge-jun Sep 12, 2026
d1a922a
test(remote): repair admission fixtures and deferred cleanup assertions
lidge-jun Sep 12, 2026
3e73ca4
docs: record operations resume and remaining verification
lidge-jun Sep 12, 2026
36ab8cd
fix(opencode): separate local management catalog authority from infer…
lidge-jun Sep 12, 2026
535884e
docs: pin operations final verification and reconciliation scope
lidge-jun Sep 12, 2026
c5e9737
merge: reconcile listener candidate with the shared fixture repair ba…
lidge-jun Sep 12, 2026
eb409d0
merge: carry the verified usage foundation into the client usage tip
lidge-jun Sep 12, 2026
f67d4f0
merge: reconcile pairing candidate with the shared repair baseline
lidge-jun Sep 12, 2026
9b55626
test(remote): use portable subprocess fixtures on Windows
lidge-jun Sep 12, 2026
25c70d5
test(clients): retain bounded phase evidence for coordinator refusal …
lidge-jun Sep 12, 2026
c720dc5
test(clients): preserve spawn failures without captured stderr
lidge-jun Sep 12, 2026
31a96b2
docs(devlog): diff-level roadmap for the unimplemented trio stack (#4…
lidge-jun Sep 12, 2026
0268727
docs(devlog): fold wp1 audit findings into trio stack roadmap
lidge-jun Sep 12, 2026
2b533a5
docs(devlog): revalidate folded audit citations against source in wp1 B
lidge-jun Sep 12, 2026
da54017
docs(devlog): fold wp2 audit FAIL findings into L1 emission design
lidge-jun Sep 12, 2026
1893eec
docs(devlog): fold wp2 re-audit residual into L1 adoption points
lidge-jun Sep 12, 2026
923ca3c
feat(responses): persist content-free Codex WS upstream stage records…
lidge-jun Sep 12, 2026
07beb73
docs(structure): record the durable Codex WS stage record ownership (…
lidge-jun Sep 12, 2026
49dba44
fix(responses): refresh the WS stage record with final counters at te…
lidge-jun Sep 13, 2026
77dba07
docs(devlog): fold wp3 audit residual into L2 design
lidge-jun Sep 12, 2026
2c5022c
feat(codex): native-main device reauth API for headless hubs (#3898)
lidge-jun Sep 12, 2026
647e52f
feat(cli): ocx account main reauth --device with registry, docs, and …
lidge-jun Sep 12, 2026
4eed49e
fix(codex): close the cancel/commit race and fence the reauth commit …
lidge-jun Sep 12, 2026
584dadd
test(oauth): name the composite-signal proof and bound the fetch dead…
lidge-jun Sep 12, 2026
d666aef
test(codex): allow the transient cancelled read before publication wi…
lidge-jun Sep 13, 2026
4500ea0
docs(devlog): fold wp4 audit residual into L3 design
lidge-jun Sep 13, 2026
4d56932
fix(opencode-go): publish DeepSeek V4.1 context
martinbcg Sep 13, 2026
d111f8d
feat(gui): main-card Re-login with device code on the native reauth n…
lidge-jun Sep 13, 2026
7ab4cd4
merge: carry current dev into L1 WS stage instrumentation [skip ci]
lidge-jun Sep 13, 2026
e8ce186
merge: carry L1 WS stage instrumentation and current dev into L2 reau…
lidge-jun Sep 13, 2026
d420a46
merge: carry L2 reauth API and current dev into L3 main-card relogin …
lidge-jun Sep 13, 2026
247dc53
merge: carry the native-main trio and current dev into the remote run…
lidge-jun Sep 13, 2026
cf60fcc
merge: carry the refreshed remote runtime foundation into the integra…
lidge-jun Sep 13, 2026
a7514f2
merge: carry the remote/hub stack into the client-scoped usage tip
lidge-jun Sep 13, 2026
b4cc99e
[skip ci] chore(stack): merge origin/dev into codex/260912-60plus-str…
lidge-jun Sep 13, 2026
4f260b7
[skip ci] chore(stack): merge codex/260912-60plus-stream-search into …
lidge-jun Sep 13, 2026
37bc1a0
[skip ci] chore(stack): merge codex/260912-60plus-stream-cursor into …
lidge-jun Sep 13, 2026
c240534
[skip ci] chore(stack): merge codex/260912-60plus-stream-sideband int…
lidge-jun Sep 13, 2026
90667e5
[skip ci] chore(stack): merge codex/260912-60plus-models-images into …
lidge-jun Sep 13, 2026
00f8567
[skip ci] chore(stack): merge codex/260912-60plus-operations-pairing …
lidge-jun Sep 13, 2026
8acd73b
[skip ci] chore(stack): merge codex/260912-60plus-operations-transpor…
lidge-jun Sep 13, 2026
388c9d1
[skip ci] chore(stack): merge codex/260912-operations-client-probe in…
lidge-jun Sep 13, 2026
d7a3acc
chore(stack): merge codex/260912-60plus-operations-listeners into cod…
lidge-jun Sep 13, 2026
b324beb
test(gui): select the Re-login CTA by label and stop awaiting a pendi…
lidge-jun Sep 13, 2026
0c8d9d3
fix(gui): give the reauth poll loop an explicit abort condition [skip…
lidge-jun Sep 13, 2026
d2b0cb1
merge: carry the repaired native-main trio into the remote runtime fo…
lidge-jun Sep 13, 2026
ae79519
merge: carry the repaired runtime foundation into the integration lay…
lidge-jun Sep 13, 2026
6df609f
merge: carry the repaired remote/hub stack into the client-scoped usa…
lidge-jun Sep 13, 2026
81f58a4
merge: refresh the stack tip against current dev
lidge-jun Sep 13, 2026
ec29d80
merge: carry the refreshed #4357 usage-totals base into the client us…
lidge-jun Sep 13, 2026
f65b8eb
merge: carry current dev into L1 WS stage instrumentation [skip ci]
lidge-jun Sep 13, 2026
300ad2d
merge: carry L1 and current dev into L2 reauth API [skip ci]
lidge-jun Sep 13, 2026
d42d873
merge: carry L2 and current dev into L3 main-card relogin UI [skip ci]
lidge-jun Sep 13, 2026
0c4f962
merge: carry the native-main trio and current dev into the remote run…
lidge-jun Sep 13, 2026
19601ea
merge: carry the refreshed runtime foundation into the integration la…
lidge-jun Sep 13, 2026
c20abd0
chore(stack): merge origin/dev into codex/260912-60plus-v2-recovery
lidge-jun Sep 13, 2026
7874900
merge: carry the refreshed remote/hub stack into the client-scoped us…
lidge-jun Sep 13, 2026
4a252f5
fix: keep stacked live handshake with audio sideband and unbreak cata…
lidge-jun Sep 13, 2026
b32df5f
docs: capture stacked hub pairing panel for the tip PR screenshot gate
lidge-jun Sep 13, 2026
5eb6e73
docs(devlog): capture the Remote Workspace hub dashboard for the stac…
lidge-jun Sep 13, 2026
c4e5f20
fix: plant sidecar fixture and drop Bun HTTP_PROXY catalog control
lidge-jun Sep 13, 2026
f059251
chore(stack): merge origin/dev into codex/260912-60plus-v2-recovery
lidge-jun Sep 13, 2026
d2a7dc0
merge: refresh the stack tip against current dev
lidge-jun Sep 13, 2026
c9b73a4
merge: carry the refreshed #4357 usage-totals base into the client us…
lidge-jun Sep 13, 2026
0a96f88
Merge pull request #4440 from martinbcg/fix/opencode-go-deepseek-v41-…
lidge-jun Sep 13, 2026
2ba5a54
fix(gui): check reauth response status before reading its body
lidge-jun Sep 13, 2026
beb2e12
merge: refresh the stack tip against current dev
lidge-jun Sep 13, 2026
2c2223b
Merge pull request #4364 from lidge-jun/codex/260912-60plus-v2-recovery
lidge-jun Sep 13, 2026
7d280d6
test(server): stop reading a pure delegation guard as an unresolved r…
lidge-jun Sep 13, 2026
8ccd80d
merge: refresh the stack tip against current dev
lidge-jun Sep 13, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix: bound multipart encrypted agent task recovery
Preserve ordered whole-token parts and input identity through one admitted recovery request. Detect split-token structure without authorizing reconstruction. Local tests NOT RUN by maintainer instruction; hosted CI follows.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@lidge-jun
lidge-jun committed Sep 12, 2026
commit b2d239ea172f92d65bab206d3301931eb3b9bfd9

There are no files selected for viewing

26 changes: 26 additions & 0 deletions 26 devlog/_plan/260912_v2_contracts/000_plan.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# V2 delegation contracts

This unit reconciles plaintext prevention (#2495) separately from encrypted task recovery (#3661). Eligible native parents may opt into plaintext V2 calls; recovery continues to use its existing authenticated, bounded path. The replacement candidates #4242/#4243 are compared against the exact issue contract before any adoption.

Loop: satisfy-spec, triggered by the authorized v2 lane. Goal: scoped carry PRs and final cumulative hosted CI evidence. Non-goals: merges, issue closure, releases, installed service/config changes, native GitHub stacks, local product tests/build/typecheck/install. Local tests are NOT RUN by explicit instruction. Verification: source/diff checks during each cycle; Cross-platform CI on the final published head, with run IDs and conclusions retained. Stop: implementation, audit and CI evidence handed to the integration owner; no claim of integration. Outcomes: DONE with evidence, or an explicit unresolved acceptance/gate. Artifacts: this unit plus ignored `.tmp/v2/` evidence. Escalation: real tool denials and unresolved security/contract blockers are recorded; no new access/settings. Resource bounds: available account/tool permissions, this worktree only, no user token/time/agent-count cap.

| Cycle | Outcome | Design |
|---|---|---|
| wp0 | Docs-only roadmap locked by independent design reflection and A review | this document |
| wp1 | Exact plaintext request/response contract and regression coverage | [010](010_plaintext.md) |
| wp2 | Bounded encrypted envelope handling and residual disposition | [020](020_recovery.md) |
| wp3 | Final cumulative hosted verification and durable handoff | [030](030_verification.md) |

wp1 and wp2 are distinct capabilities; execution order does not itself create a PR dependency. Use independent dev-based PRs if neither consumes the other's changes. A shared final cumulative verification branch may be needed to prove composition; do not silently call intermediate CI final-tip evidence.

Existing owners: `src/adapters/openai-responses.ts`, `src/server/responses/core.ts`, `src/server/responses/agent-task-recovery.ts`; tests remain under domain directories. Source-of-truth pages are mapped by `structure/INDEX.md`. Reuse these owners, not a second server/recovery subsystem. Do-nothing/config-only alternatives cannot provide the missing wire behavior.

Generic supported inherited-model subagents provide independent design consultation and separate review. Native architect selection is unavailable and is not claimed. Original contributor attribution follows the adopted source, including Sigurd-git for #2496 and SB Yoon if any #4242 code is carried. Source PRs/issues remain open or closed in their current state until the integration owner decides.

## Cycle record

wp0: P entered with own session binding; roadmap in progress. Product validation NOT RUN.

wp0 A: Gauss GO-WITH-FIXES (blockers=0); WP1-A01 cache ordering and WP2-A01 fragment owner folded into decade docs. Pasteur reflection ALIGNED; generic inherited-model consultation, native architect not selected.

wp0 check correction: initial D was refused because the roadmap task had not yet been marked done. The subsequent P command re-entered planning; no completed cycle is claimed for that attempt. Re-audit retains the unchanged independent verdict, and a fresh docs-only B/C/D closes the actual cycle after recording its task outcome.
38 changes: 38 additions & 0 deletions 38 devlog/_plan/260912_v2_contracts/010_plaintext.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Plaintext V2 prevention

Class C4 public wire/retention boundary; consumes wp0. Source proposal: #2496 at 1a4cb4aab14200ec2efa71aea00d2a55fc90aca7. Exact public patch is the starting implementation specification, ported to current owners below. #4242 and #4243 are alternatives, not automatically dependencies.

| Action | Path | Before → after |
|---|---|---|
| NEW | `src/responses/plaintext-v2-agent-messages.ts` | no explicit canonical exception → #2496 request compiler and bounded restoration helper, corrected by D2–D4 below |
| MODIFY | `src/types/config.ts`, `src/config.ts` | absent flag → optional `plaintextV2AgentMessages?: boolean`, unset default; malformed reads drop only field, candidate writes reject |
| MODIFY | `src/types/request.ts` | absent route marker → optional request-local `_plaintextV2AgentMessages` |
| MODIFY | `src/adapters/base.ts`, `src/adapters/openai-responses.ts` | no alias capabilities → adapter-produced request-owned tool-name sets after canonical opt-in rewrite |
| MODIFY | `src/server/responses/core.ts` | direct native passthrough → final-route opt-in preparation, alias metadata refreshed after each build, restoration before client/cache on every JSON/SSE/WS path |
| MODIFY | `src/server/index.ts` | recovery-only warning → separate opt-in plaintext retention warning |
| NEW | `tests/responses/plaintext-v2-agent-messages.test.ts`, `tests/server/plaintext-v2-agent-messages-server.test.ts` | absent → port #2496 tests and add refusal/collision cases |
| MODIFY | `tests/server/config.test.ts`, `tests/server/agent-task-recovery.test.ts`, `tests/responses/ws-upstream.test.ts` | existing adjacent contracts → port applicable #2496 regression deltas |
| MODIFY | `scripts/test-layout/layout.json`, `tests/fixtures/test-layout-expected.json` | no new tests → register both new domain paths |
| MODIFY | English and zh-cn `guides/sub-agent-surface.md`, `reference/configuration/agents.md` under `docs-site/src/content/docs/` | recovery/V1 alternatives → config-only experimental plaintext contract and retention warning |
| MODIFY | applicable `structure/` owners from INDEX | current ownership descriptions → point to canonical plaintext contract without duplicating unrelated subsystem behavior |

D1: preserve the explicit issue option; no management toggle or routed mirror catalog.
D2: `shouldPreparePlaintextV2AgentMessages`: true only for Responses wire, final canonical ChatGPT forward destination and default top-level collaboration catalog; additional_tools-only catalogs do not activate it.
D3: `preparePlaintextV2AgentMessages`: copy-on-write namespace + three tool aliases. Only `message.encrypted === true` is removed. Scan declaration/reference identity positions, including nested catalogs and qualified alias names, before any rewrite. Refuse all on any collision; foreign namespaces stay untouched.
D4: `restorePlaintextV2AgentMessageCalls*`: restore only request-generated identity capabilities. Preserve marker `encrypted_function_args: []`. Treat malformed JSON, unknown private identities, binding conflict and >10,000 identities as refusal. Bounded JSON returns 502; streams emit response.failed; refusal has no retry and no continuation write. Refresh state per turn/build; no connection/global alias state.

Field chain: config type → config schema/save → config load/candidate validation → final route marker → adapter body serialization and AdapterRequest metadata → response restoration. Metadata is in-process only, never serialized as response fields or persisted with previous_response_id. Startup consumes config for warning. No new public state enum.

Activation matrix: disabled/malformed flag, noncanonical/key/Anthropic/routed parent/V1/custom namespace unchanged; true canonical declaration rewritten without input mutation; each collision location leaves whole request unchanged; known aliases restored for JSON/SSE/WS and snapshots; same aliases under foreign namespace unchanged; malformed/overlimit/conflict terminal refused and not cached; next turn disabled and concurrent requests do not inherit prior metadata. Use hosted tests only; no live-account canary is claimed.

Guard strength: runtime explicit option + compiler/restorer are code-path controls; operator can disable the option, which selects ordinary encrypted behavior. No credential authorization is added. Residual undocumented upstream behavior and plaintext retention are documented, not described as encryption guarantees.

Port mapping verified against current tree: old `tests/config.test.ts` is now `tests/server/config.test.ts`; old `tests/ws-upstream.test.ts` is now `tests/responses/ws-upstream.test.ts`. A `git apply --check` of supporting #2496 hunks fails at current adapter/config/startup context; manual semantic port is required, not blind cherry-pick. Pure helper and new tests can use their full public source bodies with adjusted imports. Existing test helper `repo-root.ts` supplies repository paths instead of legacy relative directory inference.

Exact integration replacements: `refreshRoutedNamespaceToolAliases` at core line 4702 becomes `refreshRequestToolAliases`, assigning both alias sets from each AdapterRequest or fresh empty sets. All seven current callers are renamed. At core `rememberPassthroughResponseChecked`, change `const restoredResponse = normalized...` to an intermediate normalized value; run plaintext restoration and return immediately on refusal before `rememberPassthroughResponse`. In blockRewrites, insert plaintext restoration immediately after `createResponsesSnapshotBlockRewrite`, before field backfill and guard. In bounded JSON, apply restoration after `normalizeFunctionCompletionJson` and before model rewrite; a refusal short-circuits before `rememberPassthroughResponseChecked`. At unsupported passthrough fallback, cancel response body and return safe 502 whenever request alias sets are nonempty.

A synthesis WP1-A01: early raw inspection cannot authorize continuation for plaintext turns. Disable its cache callbacks when aliases are active. Publish only from a post-restoration/post-guard client block observer, and only after shared request-local stream validation accepts the terminal. Bounded JSON caches only its final restored value. Stream malformed/conflicting/overlimit rejection permanently prevents publication.

WP1 implementation-P revalidation: prior D locked the roadmap. Reuse `createSseInspector` for restored client blocks: append a final block observer after the alias restorer and undeclared-tool guard, feed `${block}\n\n`, and dispose with the composed rewrite. Raw inspector callbacks are suppressed only for active plaintext aliases. The existing collector reconstructs output from accepted events. This gives one validated publication path rather than parallel raw/client cache decisions. Keep the final marker-preserving restorer before this collector. Unknown private identities throw before collection; terminal-only valid complete snapshots are accepted, so there is no invented requirement for prior added frames.

Exact source-of-truth canonical owner is `structure/subagents.md`; add concise links from the mapped affected owners `runtime.md`, `config.md`, `overview.md`, `catalog.md`, `transports/responses.md`, `transports/streaming-health.md`, `transports/inventory.md`, `data-planes/images.md`, `data-planes/inbound-compat.md`, `providers/openai-tiers.md`, `providers/cursor.md`, `providers/chat-compat.md`, `providers/kiro.md`, `providers/xai-grok.md`, `adapters/registry.md`, `gui-and-management-api.md`, `clients/claude-desktop.md`, `ops/service-and-sidecars.md`, and `ops/docs-and-release.md` where the source-area map requires same-change synchronization. Links distinguish unchanged surfaces from the canonical new contract.
50 changes: 50 additions & 0 deletions 50 devlog/_plan/260912_v2_contracts/020_recovery.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Encrypted envelope recovery

Class C4 authenticated plaintext boundary; consumes roadmap and independent envelope design. #3794 diagnostics and MESSAGE support are already present. This phase preserves them and never adds automatic outage retries.

| Action | Path | Before → after |
|---|---|---|
| MODIFY | `src/server/responses/agent-task-recovery.ts` | single encryptedIndex/ciphertext → ordered bounded part descriptors and exact envelope snapshot; single backend recovery request; atomic input revalidation before replacement |
| MODIFY | `tests/server/agent-task-recovery.test.ts` | single-part coverage → ordered multipart, invalid/ambiguous fragments, size/count cap, input mutation and cache isolation cases |
| MODIFY | `docs-site/src/content/docs/reference/configuration/agents.md` | narrow recovery description → exact supported multipart shape, no blind retries and residual fragment limitations |
| MODIFY | relevant `structure/` owners | current single-part invariant → canonical bounded envelope contract |

D5 proposal for design audit: accept a contiguous run of complete structurally valid Fernet strings, at most 32 parts and 2 MiB combined. Keep routing header singular and author/recipient equal to sender/task. Forward original complete token parts in their order to the same fixed backend endpoint once. Partial token strings remain unsupported unless source evidence establishes an unambiguous join contract; do not infer authentication from a plausible Fernet shape.

`AgentEnvelope` replaces encryptedIndex with an ordered part list. The cache key hashes a length-delimited serialized token array (not ambiguous string concatenation). `recoveryPayload` maps these parts into its one input message. `injectAssignment` reruns envelope parsing and compares the full admitted snapshot (header, identities, positions, all ciphertext parts) before one content splice, then removes agent routing identity fields exactly as today. Existing admission is still before every cache read. Input mutation causes input_changed and cache discard.

Creation → serialization → consumption: parser builds ordered part descriptors; recoveryPayload emits each validated whole part; cache key binds their order and boundaries; injection validates the original current input and writes one assignment. No new stored config or failure enum is needed; unsupported_envelope remains not attempted and existing typed request failures remain attempted/capacity outcomes.

Activation matrix: one complete part unchanged; two complete ordered parts reach exactly one mocked backend call and one plaintext replacement; swapped tokens have distinct cache identity; wrong sender/recipient/header rejected without fetch; interleaved plaintext/noncontiguous encrypted parts rejected; empty, malformed, excessive count or total bytes rejected; delayed input mutation refuses assignment; HTTP 5xx yields the existing typed reason after one call; no retry budget increase. Reuse existing helper fixtures; no test execution locally.

Fragment disposition: this unit does not concatenate split tokens. #3661 contains no fragment association or representation evidence. The runtime's existing plaintext-in-encrypted-slot compatibility must remain. Add end-to-end regression coverage for a consecutive encrypted run whose exact concatenation is structurally one Fernet token: classify that narrowly as unreadable and refuse without recovery, while ordinary plaintext slots still normalize. If no sound discriminator is found, retain the issue residual explicitly; never claim full #3661 closure from whole-token support.


Concrete replacement contract:

```ts
// AgentEnvelope
// - encryptedIndex: number; ciphertext: string;
// + encryptedStartIndex: number; ciphertexts: readonly string[];
// + inputSnapshot: string;
// Parser: collect {index, token} only when token list has exactly one member
// and that member === raw encrypted_content. Reject missing header,
// >32 entries, >2 MiB aggregate, and nonconsecutive indexes. Capture
// JSON.stringify(item) at admission after all identity checks.
// Cache replaces .update(envelope.ciphertext) with
.update(JSON.stringify(envelope.ciphertexts))
// Fixed recovery endpoint content replaces its single encrypted part with
...envelope.ciphertexts.map(encrypted_content => ({
type: "encrypted_content", encrypted_content,
}))
// Injection verifies original item bytes before touching content:
if (JSON.stringify(item) !== envelope.inputSnapshot) return false;
content.splice(envelope.encryptedStartIndex, envelope.ciphertexts.length,
{ type: "input_text", text: assignment });
```

The snapshot is request-local and not logged/persisted. JSON request parsing is the input boundary, so getters/cycles are not supported client states. Tests use the existing Request/recovery public entrypoints, not exported parser internals.

Reflection amendment: also MODIFY `src/server/responses/encrypted-payload.ts` only for the narrow multi-slot discriminator and MODIFY `tests/server/agent-task-recovery.test.ts` with `post()` integration assertions that recovery is not attempted and routed fetch is absent. Whole-token recovery tests remain at the recovery API. The discriminator runs before sanitization; for otherwise unreadable envelopes, matched fragments do not reach the routed provider. General malformed payload detection remains outside this claim.

wp2 reflection synthesis: preserve only identified fragment objects during sanitization, not an entire content array. Independent plaintext slots still normalize. Fragment refusal applies only when no independent readable task text remains, retaining current mixed-content policy; mixed input is explicitly outside the refusal claim. All encrypted slots in a recovery envelope must be valid consecutive whole tokens, including malformed non-string slots (which refuse). MODIFY `tests/server/agent-task-recovery-security.test.ts`: replace formerly unsupported duplicate-whole-token fixture with a genuinely noncontiguous encrypted run; keep fragment and admission-negative coverage, add positive multipart regression separately.
9 changes: 9 additions & 0 deletions 9 devlog/_plan/260912_v2_contracts/030_verification.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Final hosted verification and handoff

Consumes published implementation heads. No product change is planned unless exact hosted failure or independent audit identifies a defect; then amend this design with the concrete source delta before repair.

MODIFY this unit's cycle records with actual outcomes. MODIFY ignored `.tmp/v2/handoff.md` and NEW ignored `.tmp/v2/final-ci.json` with own branch/worktree/session, original dispositions, credit, carry PR URLs, exact heads, chain order if any, remaining issue acceptance, unresolved review/security judgments and local NOT RUN.

Commands: `git diff --check` observes whitespace only. `gh pr view` observes live head/base/reviews. `gh run list --commit <sha>` finds hosted runs; `gh run view <id> --json headSha,status,conclusion,jobs,url` provides final evidence. Inspect `.github/workflows/ci.yml` or actual workflow source for full lane dispatch. Do not claim skipped/cancelled jobs passed. CI failure repairs are additional PABCD cycles when they form a separate work-phase.

Before publish, inspect exact diff and original contributor commits; push only owned branches using `git push --no-verify`. Populate Summary/Verification/Checklist template honestly with NOT RUN local tests. No closure or merge. Capture remote PR head equality with local final SHA and final Cross-platform CI result. A source scan or receipt wrapper is not product test evidence. Independent review has a source SHA and limitations. Any live upstream canary absent remains explicit.
13 changes: 13 additions & 0 deletions 13 docs-site/src/content/docs/reference/configuration/agents.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,19 @@ Admission and retention are deliberately narrow:
fail-closed error; client cancellation returns 499. Neither path forwards ciphertext to the
routed provider.

Recovery accepts one consecutive run of up to 32 complete Fernet-shaped encrypted parts, with
at most 2 MiB of combined ciphertext. Parts retain their order and boundaries in one authenticated
request. Cache identity includes the sequence; the original input is revalidated before assignment
replacement. HTTP failures retain the existing bounded diagnostic reason and do not trigger an
internal retry.

Split tokens are not reconstructed for recovery. A bounded run whose exact concatenation has
Fernet structure stays classified as ciphertext through plaintext-slot normalization. If the task
has no independent readable text, it fails closed without a recovery or routed-provider request.
Independent readable text retains the existing mixed-content policy. Other fragment representations
remain unsupported; this does not establish general token-split recovery or upstream multipart
fidelity.

### Threat model

This path assumes the local native Codex caller already holds a valid ChatGPT credential and that
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.