Commit a750b8f
fix: batch of correctness, performance, and API fixes
Addresses these open issues with the noted change:
- #23 sessions map key stability: key sessions by stable pendingKey()
so removeSession() finds the entry after handshake flips the id.
- #24 concurrent submit correlation: pendingSubmits is now a FIFO
Deque keyed by request order; submitLock serializes put-and-send.
- #25 transport failAll path: failAll() drains every outstanding
future and live subscription on transport error, unexpected
onComplete, and heartbeat loss.
- #26 list_jobs pagination: server respects req.limit() and
req.cursor() with stable ordering by (createdAt, jobId); cursor
is opaque url-safe base64.
- #27 canonical idempotency fingerprint: SHA-256 over canonical JSON
of (agent, input, lease_request, lease_constraints, max_runtime_sec)
replaces the 32-bit hashCode payload hash.
- #28 SubmissionPublisher executor lifecycle: MemoryTransport,
WebSocketTransport, ReplayingPublisher, and ArcpClient.subscribe
now own their virtual-thread executors and shut them down on close.
- #29 close() respects external executor ownership: ArcpRuntime and
ArcpClient track owned vs externally supplied scheduler/workerPool
and only shut down the ones they created.
- #30 empty feature set: safeFeatureCopy(Set.of()) returns an empty
EnumSet instead of throwing IllegalArgumentException.
- #31 advertised exposes mutable state: ArcpRuntime.advertised is
wrapped in Collections.unmodifiableSet at construction.
- #32 Session/Page mutable aliases: compact constructors defensively
copy collection components into immutable views.
- #34 partial Javadoc on named public APIs.
- #35 Capabilities Javadoc now accurately documents drop behavior.
- #36 CONFORMANCE.md stdio + version 1.1 entries refreshed.
- #37 BudgetCounters Javadoc corrected to describe void semantics.
- #38 WebSocket middleware send synchronization: writeLock added to
Spring, Jakarta, Vert.x, and Jetty WebSocket transports.
- #42 WebSocketTransport pre-attach frame race: listener captures
transport directly and buffers inbound frames; send() gates on
socket attachment.
- #43 ReplayingPublisher Reactive Streams §1.9: onSubscribe is the
first downstream signal; live items queued during replay.
- #46 LeaseGuard regex cache: per-guard ConcurrentHashMap caches
compiled glob Patterns; matchesCached used on the hot path.
- #47 JobRecord credentials atomic ops: synchronized lock around
credentials list; drainCredentials, replaceCredential, and
setCredentials are atomic.
- #48 BearerVerifier constant-time compare + SHA-256 acceptAny.
- #50 SessionLoop shutdown atomic: phase is now AtomicReference;
only the first caller runs cleanup.
- #51 ArcpOtel guards extensions cast: returns envelope unchanged
when extensions exists but is not an object.
- #52 ArcpMapper.shared Javadoc revised to document mutable contract.
- #53 fromWire lookup maps: O(1) BY_WIRE maps replace stream walks
on Message.Type, EventBody.Kind, and Feature.
- #55 IdempotencyStore scheduled prune: prune moved off the claim
hot path; runs every minute under the runtime's scheduler.
- #56 FileCredentialRevocationStore durable journal: long-lived
RandomAccessFile in rwd mode with explicit FD sync per append.
- #57 ArcpClient.listJobs typed exceptions: declared InterruptedException,
TimeoutException, ArcpException; restores interrupt flag.
- #59 ArcpClient.subscribe idempotent: JOB_SUBSCRIBE sent only on
publisher insert; unsubscribe() closes local publisher and
notifies the runtime. Server-side handleSubscribe is idempotent.
- #60 CredentialBinding retry/backoff: narrowed catch, log full
cause, exponential sleep between attempts, markRevocationFailed.
- #61 JobRecord.subscribers encapsulation: unmodifiable view +
addSubscriber/removeSubscribersWhere mutators.
- #63 MemoryTransport.pair record: typed Pair(runtime, client)
replaces the array return; all callers updated.
- #64 WebSocketTransport HttpClient close: HttpClient stored as
field and closed in close() to release selector threads.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d911452 commit a750b8f
58 files changed
Lines changed: 954 additions & 308 deletions
File tree
- arcp-client/src
- main/java/dev/arcp/client
- test/java/dev/arcp/client
- credentials
- arcp-core/src
- main/java/dev/arcp/core
- auth
- capabilities
- events
- messages
- transport
- test/java/dev/arcp/core
- auth
- capabilities
- arcp-middleware-jakarta/src/main/java/dev/arcp/middleware/jakarta
- arcp-middleware-spring-boot/src/main/java/dev/arcp/middleware/spring
- arcp-middleware-vertx/src/main/java/dev/arcp/middleware/vertx
- arcp-otel/src
- main/java/dev/arcp/otel
- test/java/dev/arcp/otel
- arcp-runtime-jetty/src/main/java/dev/arcp/runtime/jetty
- arcp-runtime/src
- main/java/dev/arcp/runtime
- credentials
- idempotency
- lease
- session
- test/java/dev/arcp/runtime/lease
- arcp-tck/src/test/java/dev/arcp/tck
- examples
- ack-backpressure/src/main/java/dev/arcp/examples/ackbackpressure
- agent-versions/src/main/java/dev/arcp/examples/agentversions
- cancel/src/main/java/dev/arcp/examples/cancel
- cost-budget/src/main/java/dev/arcp/examples/costbudget
- custom-auth/src/main/java/dev/arcp/examples/customauth
- delegate/src/main/java/dev/arcp/examples/delegate
- heartbeat/src/main/java/dev/arcp/examples/heartbeat
- idempotent-retry/src/main/java/dev/arcp/examples/idempotentretry
- lease-expires-at/src/main/java/dev/arcp/examples/leaseexpiresat
- lease-violation/src/main/java/dev/arcp/examples/leaseviolation
- list-jobs/src/main/java/dev/arcp/examples/listjobs
- progress/src/main/java/dev/arcp/examples/progress
- provisioned-credentials/src/main/java/dev/arcp/examples/provisionedcredentials
- result-chunk/src/main/java/dev/arcp/examples/resultchunk
- resume/src/main/java/dev/arcp/examples/resume
- submit-and-stream/src/main/java/dev/arcp/examples/submitandstream
- subscribe/src/main/java/dev/arcp/examples/subscribe
- tracing/src/main/java/dev/arcp/examples/tracing
- vendor-extensions/src/main/java/dev/arcp/examples/vendorextensions
- recipes
- email-vendor-leases/src/main/java/dev/arcp/recipes/emailvendorleases
- mcp-skill/src/main/java/dev/arcp/recipes/mcpskill
- multi-agent-budget/src/main/java/dev/arcp/recipes/multiagentbudget
- stream-resume/src/main/java/dev/arcp/recipes/streamresume
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
| |||
Lines changed: 174 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
88 | 97 | | |
89 | 98 | | |
90 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
91 | 105 | | |
92 | 106 | | |
93 | 107 | | |
| |||
103 | 117 | | |
104 | 118 | | |
105 | 119 | | |
106 | | - | |
| 120 | + | |
107 | 121 | | |
108 | 122 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
116 | 134 | | |
117 | 135 | | |
118 | 136 | | |
| |||
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
133 | | - | |
| 151 | + | |
| 152 | + | |
134 | 153 | | |
135 | 154 | | |
136 | 155 | | |
137 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
138 | 161 | | |
139 | 162 | | |
140 | 163 | | |
| |||
144 | 167 | | |
145 | 168 | | |
146 | 169 | | |
147 | | - | |
148 | | - | |
149 | 170 | | |
150 | | - | |
151 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
152 | 183 | | |
153 | 184 | | |
154 | 185 | | |
155 | | - | |
156 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
157 | 199 | | |
158 | 200 | | |
159 | 201 | | |
160 | 202 | | |
161 | 203 | | |
162 | 204 | | |
163 | 205 | | |
164 | | - | |
165 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
166 | 220 | | |
167 | 221 | | |
168 | 222 | | |
169 | 223 | | |
| 224 | + | |
| 225 | + | |
170 | 226 | | |
171 | 227 | | |
172 | 228 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
178 | 241 | | |
179 | 242 | | |
180 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
181 | 272 | | |
182 | 273 | | |
183 | 274 | | |
| |||
204 | 295 | | |
205 | 296 | | |
206 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
207 | 302 | | |
208 | 303 | | |
209 | 304 | | |
210 | 305 | | |
211 | 306 | | |
212 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
213 | 310 | | |
214 | 311 | | |
215 | 312 | | |
| |||
248 | 345 | | |
249 | 346 | | |
250 | 347 | | |
251 | | - | |
| 348 | + | |
252 | 349 | | |
253 | 350 | | |
254 | 351 | | |
255 | 352 | | |
256 | 353 | | |
257 | | - | |
258 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
259 | 358 | | |
260 | 359 | | |
261 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
262 | 394 | | |
263 | 395 | | |
264 | 396 | | |
| |||
338 | 470 | | |
339 | 471 | | |
340 | 472 | | |
| 473 | + | |
341 | 474 | | |
342 | 475 | | |
343 | 476 | | |
344 | 477 | | |
345 | | - | |
346 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
347 | 483 | | |
348 | 484 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 485 | + | |
| 486 | + | |
358 | 487 | | |
359 | 488 | | |
| 489 | + | |
360 | 490 | | |
361 | 491 | | |
362 | 492 | | |
| |||
395 | 525 | | |
396 | 526 | | |
397 | 527 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
406 | 533 | | |
407 | 534 | | |
408 | 535 | | |
| |||
536 | 663 | | |
537 | 664 | | |
538 | 665 | | |
539 | | - | |
| 666 | + | |
540 | 667 | | |
541 | 668 | | |
542 | 669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
0 commit comments