InMemoryJobInventory stores every job ever submitted in an unbounded ConcurrentHashMap<JobId, JobRecord> at lib/src/main/kotlin/dev/arcp/runtime/JobInventory.kt:38. The runtime calls updateStatus(jobId, status) on terminal transitions in ARCPRuntime.terminalCleanup at lib/src/main/kotlin/dev/arcp/runtime/ARCPRuntime.kt:375, but nothing ever removes the record afterward. A long-running runtime that accepts many short jobs accumulates them indefinitely, both consuming heap and growing the per-call sort cost in list at lib/src/main/kotlin/dev/arcp/runtime/JobInventory.kt:54. The JobInventory interface at lib/src/main/kotlin/dev/arcp/runtime/JobInventory.kt:13 also has no evict or prune hook, so callers cannot opt into a retention policy without writing their own implementation.
Fix prompt: Add an evict(jobId) or pruneCompletedOlderThan(duration) method to JobInventory and call it from ARCPRuntime.terminalCleanup once events have drained, or implement a configurable retention window (default a few hours) inside InMemoryJobInventory using an LRU or time-based eviction structure. Document the retention contract in the interface KDoc. Add a test that records 1000 terminal jobs and asserts the inventory size stays bounded by the configured limit.
InMemoryJobInventorystores every job ever submitted in an unboundedConcurrentHashMap<JobId, JobRecord>atlib/src/main/kotlin/dev/arcp/runtime/JobInventory.kt:38. The runtime callsupdateStatus(jobId, status)on terminal transitions inARCPRuntime.terminalCleanupatlib/src/main/kotlin/dev/arcp/runtime/ARCPRuntime.kt:375, but nothing ever removes the record afterward. A long-running runtime that accepts many short jobs accumulates them indefinitely, both consuming heap and growing the per-call sort cost inlistatlib/src/main/kotlin/dev/arcp/runtime/JobInventory.kt:54. TheJobInventoryinterface atlib/src/main/kotlin/dev/arcp/runtime/JobInventory.kt:13also has noevictorprunehook, so callers cannot opt into a retention policy without writing their own implementation.Fix prompt: Add an
evict(jobId)orpruneCompletedOlderThan(duration)method toJobInventoryand call it fromARCPRuntime.terminalCleanuponce events have drained, or implement a configurable retention window (default a few hours) insideInMemoryJobInventoryusing an LRU or time-based eviction structure. Document the retention contract in the interface KDoc. Add a test that records 1000 terminal jobs and asserts the inventory size stays bounded by the configured limit.