fix(core): resolve review findings across util, storage, job-queue, task-graph#602
Open
sroussey wants to merge 5 commits into
Open
fix(core): resolve review findings across util, storage, job-queue, task-graph#602sroussey wants to merge 5 commits into
sroussey wants to merge 5 commits into
Conversation
…ask-graph
Addresses correctness, DX, and simplicity findings from a subsystem review
of the core execution stack (util -> storage -> job-queue -> task-graph),
each verified against source and covered by tests.
util:
- BaseError now extends native Error (restores `instanceof Error`, adds cause
support) so the library's own errors get full diagnostics/telemetry
- EventEmitter: fix once/removeAllListeners re-entrancy during dispatch
- Container: honor re-register after a singleton is instantiated; isolate
child-container disposal from parent-owned instances
- SchemaUtils: type-check optional shared object props; compare the full
multi-segment format narrowing (not just the first segment)
- graph: visited-set in canReachFrom (no stack overflow on cycles); deep-copy
state in fromDirectedGraph; dedup edges by identity; typed GraphInvariantError
- DirectedGraph.addEdge: drop the boolean param (moved to a protected method)
storage:
- Atomic putBulk + rollback in the in-memory tabular base; route post-commit
mutation emits through safeEmit and correct its doc
- FsFolder KV: idempotent delete (swallow ENOENT); typed StorageUnsupportedError
for getAll/size instead of a bare Error
- mapPostgresType: widen signed/large-maximum integers to BIGINT
- typedArrayCtors: add Float16Array to match the documented vector set
- CachedTabularStorage: surface cache-init failures; serialize subscription
cache updates instead of floating async work
- vector: default scoreThreshold to -Infinity; null-safe metadata filter;
emit the declared similaritySearch event
job-queue:
- Log errors in the worker main loop instead of swallowing them
- TelemetryQueueStorage: pass through optional findActiveByFingerprint so the
decorator doesn't silently degrade dedup to an O(n) scan
- Unify IClaim.ack(undefined) semantics (overwrite with null) across backends
- ConcurrencyLimiter: guard complete() against foreign tokens; bound the
processingTimes buffer; per-instance scan-exhaustion warning
task-graph:
- ConditionalBuilder: wire the conditional's input from the preceding task
(Blocker: predicate no longer sees {}); guard ambiguous two-arm continuation
- Derive the run id from caller config so run-scoped job cancellation matches
- serialGraph: correct source/target port order
- TaskGraphRunner: guard preview against a concurrent run; restore the registry
after preview
- StreamPump: close the stream and detach listeners on error/abort; guard
cross-graph emits against throwing consumers
- IteratorTask/WhileTask: throw TaskAbortedError on mid-iteration abort instead
of returning partial results as COMPLETED
- CacheCoordinator: treat an undecodable cache entry as a miss, not a hard fail
- Workflow: emit the declared abort event; public addTask throws on
auto-connect failure instead of silently dropping the task
Plus assorted minor fixes and regression tests across all four packages.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N57Pgeeqgsf4dYBEdijLdq
…er backends
Follow-up to the core review fixes, applying the same storage contracts to the
remaining backends so behavior no longer diverges when swapping implementations.
indexeddb:
- IndexedDbVectorStorage: default scoreThreshold to -Infinity (stop silently
dropping negatively-correlated hits), coalesce a present-but-null metadata
value to {} under a filter (no throw), and emit the declared
similaritySearch event
- IndexedDbQueueStorage: complete()/saveProgress() silently no-op on a missing
job instead of throwing, matching the documented IQueueStorage contract
(lease-expiry races can legitimately remove the row between claim and write)
sqlite / postgres / supabase tabular backends:
- Route post-commit mutation/read emits through safeEmit so a throwing
subscriber cannot turn an already-committed write into a rejection
- Emit the rollback event on putBulk failure (putBulk is already atomic via the
backend transaction / server-side upsert, so no rows persist: ids: [])
Adds IndexedDbVectorStorage result-behavior tests mirroring the in-memory suite.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N57Pgeeqgsf4dYBEdijLdq
…able
The run-private output cache namespaced entries by prepending `__run:${runId}::`
to the `taskType` axis and cleaned up via full-table scans + per-row deletes
(`deleteByTaskTypePrefix` and friends), which ran on every successful run
(`RunPrivateCacheRepo.clearRun`) and in the janitor sweep — O(all cached rows).
The run-private and deterministic caches are now separate CacheRegistry slots
(separate tables), so the prefix only distinguished runs within the private
table. Give the private cache its own shape instead:
- New RunPrivateTaskOutputSchema: a first-class `runId` column with a
runId-leading primary key [runId, key, taskType]. clearRun and the janitor
sweep become indexed deleteSearch({ runId }) / deleteSearch({ createdAt: "<" })
rather than table scans, and two runs with identical (taskType, inputs) no
longer collide.
- RunPrivateTaskOutputRepository implements run-scoped saveOutputForRun /
getOutputForRun / deleteRun / deleteRunOlderThan / sizeForRun; the base
TaskOutputRepository declares these (default-throw) in place of the removed
taskType-prefix methods, and the deterministic TaskOutputTabularRepository
drops the three scan methods.
- RunPrivateCacheRepo delegates to the backing's run-scoped methods (no prefix);
CacheJanitor.sweepStaleRunPrivate is an indexed createdAt delete over the
dedicated table. Stale "deterministic cache entries" docs corrected.
- Shared output encode/decode extracted to taskOutputCodec.
No backward compatibility with the old prefixed rows: the private cache is
ephemeral and ages out, so consumers point the private slot at a
RunPrivate* repository (RunPrivateInMemoryTaskOutputRepository binding added)
and clear any old prefixed store on upgrade.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N57Pgeeqgsf4dYBEdijLdq
From a max-effort review of the previous commit:
- taskOutputCodec: the uncompressed decode path called `.toString()` on the raw
value, which yields comma-separated byte numbers (not JSON) when a durable
backend (SQL/IndexedDB) hands the blob back as a Uint8Array — JSON.parse then
crashed. Decode the bytes as UTF-8 instead; shape-normalization shared with the
compressed path. Adds a round-trip + plain-Uint8Array regression test.
- RunPrivateTaskOutputRepository.sizeForRun: use storage.count({ runId }) instead
of query({ runId }).length, which materialized and decoded every row's blob
just to take a length.
- CacheJanitor: type `privateBacking` as RunPrivateTaskOutputRepository (not the
base TaskOutputRepository) so a per-run RunPrivateCacheRepo wrapper — whose
clearOlderThan is scoped to one run — can't be passed by mistake, which would
leave other runs' stale rows un-swept.
- README / EXECUTION_MODEL: the cache-wiring example wired a TaskOutputTabularRepository
as the private slot (now throws saveOutputForRun) and described the removed
`__run:` key prefix. Updated to RunPrivateTaskOutputRepository + the runId-column
model, and corrected the janitor's "deterministic never affected" note.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N57Pgeeqgsf4dYBEdijLdq
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies a broad set of correctness and DX fixes across the core execution stack (util → storage → job-queue → task-graph), with a particular focus on safer event emission, more consistent runtime semantics (abort/caching/preview), and improved schema/graph correctness, backed by new regression tests.
Changes:
- Standardize “post-commit” event emission via
safeEmitacross storage implementations and improve batch rollback signaling. - Fix/clarify task-graph runtime behaviors (conditional wiring, abort semantics, preview/run isolation, stream teardown, cache decode miss behavior).
- Introduce a dedicated run-private cache backing (
RunPrivateTaskOutputRepository+ schema) and update docs/tests accordingly.
Reviewed changes
Copilot reviewed 117 out of 117 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| providers/supabase/src/storage/SupabaseTabularStorage.ts | Use safeEmit for events; emit rollback on failed upsert. |
| providers/sqlite/src/storage/SqliteTabularStorage.ts | Use safeEmit; emit rollback on transaction failure. |
| providers/postgres/src/storage/PostgresTabularStorage.ts | Use safeEmit; emit rollback on tx rollback. |
| packages/util/src/worker/Worker.node.ts | Forward WorkerServerBase options to base constructor. |
| packages/util/src/worker/Worker.bun.ts | Forward WorkerServerBase options to base constructor. |
| packages/util/src/worker/Worker.browser.ts | Forward WorkerServerBase options to base constructor. |
| packages/util/src/utilities/BaseError.ts | Make BaseError extend native Error; add cause support. |
| packages/util/src/resource/ResourceScope.ts | Log disposer failures while keeping best-effort semantics. |
| packages/util/src/json-schema/SchemaValidation.ts | Tighten format docs; reject array-as-schema; clarify pattern. |
| packages/util/src/json-schema/SchemaUtils.ts | Improve format narrowing compare; optional prop checks; tuple semantics. |
| packages/util/src/json-schema/parsePartialJson.ts | Improve streamed-first-property trailing-token cleanup. |
| packages/util/src/graph/graph.ts | Avoid .map side-effects; dedup edges by identity; fix removeEdge emits. |
| packages/util/src/graph/errors.ts | Add typed GraphInvariantError for structural invariant violations. |
| packages/util/src/graph/directedGraph.ts | Add visited-set DFS to avoid cycles/stack overflow. |
| packages/util/src/graph/directedAcyclicGraph.ts | Deep-copy backing state; avoid redundant cycle-check; invariant errors. |
| packages/util/src/events/EventEmitter.ts | Fix re-entrancy around once/removeAllListeners during emit. |
| packages/util/src/di/ServiceRegistry.ts | Make container readonly. |
| packages/util/src/di/Container.ts | Fix re-register singleton behavior; prevent child disposing parent-owned instances. |
| packages/test/src/test/vector/InMemoryVectorStorage.validation.test.ts | Add similaritySearch behavior + event emission tests. |
| packages/test/src/test/vector/IndexedDbVectorStorage.validation.test.ts | Add similaritySearch behavior + event emission tests. |
| packages/test/src/test/util/WorkerServerBase.race.test.ts | Add race regression for abort/call dedupe window. |
| packages/test/src/test/util/SchemaValidation.test.ts | Add test for array property values being invalid schema nodes. |
| packages/test/src/test/util/SchemaUtils.test.ts | Add tests for optional shared props, tuple rules, multi-segment format tails. |
| packages/test/src/test/util/parsePartialJson.test.ts | Add tests for first-property incomplete bare tokens. |
| packages/test/src/test/util/graph.test.ts | Add tests for removeEdge event correctness. |
| packages/test/src/test/util/EventEmitter.test.ts | Add tests for emit re-entrancy and removeAllListeners behavior. |
| packages/test/src/test/util/directedGraph.test.ts | Add tests ensuring canReachFrom terminates on cycles/diamonds. |
| packages/test/src/test/util/directedAcyclicGraph.test.ts | Add test ensuring DAG conversion doesn’t share backing state. |
| packages/test/src/test/util/Container.test.ts | Add tests for re-registration and child disposal isolation. |
| packages/test/src/test/util/BaseError.test.ts | Add tests for instanceof Error/BaseError and cause propagation. |
| packages/test/src/test/task/IteratorTask.test.ts | Add regression test for abort mid-iteration throwing. |
| packages/test/src/test/task/ConditionalTaskCondition.test.ts | Add test for non-numeric operands in ordering operators. |
| packages/test/src/test/task-graph/Workflow.test.ts | Ensure public addTask throws on auto-connect failure; abort event semantics. |
| packages/test/src/test/task-graph/TaskGraph.test.ts | Fix serialGraph edge direction expectation + assertions. |
| packages/test/src/test/task-graph/ResourceScope.test.ts | Add test ensuring disposeAll is best-effort and non-throwing. |
| packages/test/src/test/task-graph/ConditionalBuilder.test.ts | Add tests for mid-chain if wiring and ambiguous join validation. |
| packages/test/src/test/task-graph-cache/TaskGraphRunnerPrivate.test.ts | Switch tests to run-private in-memory repo binding. |
| packages/test/src/test/task-graph-cache/TaskGraphRunnerDurabilityWarning.test.ts | Switch tests to run-private in-memory repo binding. |
| packages/test/src/test/task-graph-cache/TaskGraphRunnerCleanup.test.ts | Switch tests to run-private in-memory repo binding. |
| packages/test/src/test/task-graph-cache/RunPrivateOutputCodec.test.ts | New tests for run-private output codec shapes (Uint8Array etc). |
| packages/test/src/test/task-graph-cache/RunPrivateCacheRepo.test.ts | Update pruning semantics for dedicated run-private table. |
| packages/test/src/test/task-graph-cache/RunPrivateCacheKeyFallback.test.ts | Update tests to run-private in-memory repo binding types. |
| packages/test/src/test/task-graph-cache/PrivateRequiresRunId.test.ts | Update expectations for run-private table semantics. |
| packages/test/src/test/task-graph-cache/CacheJanitor.test.ts | Update janitor sweep semantics for dedicated run-private table. |
| packages/test/src/test/task-graph-cache/AbstractRepoCapabilities.test.ts | Update tests for new run-scoped default-throwing methods. |
| packages/test/src/test/storage-util/sqlTypeMapping.test.ts | New tests for BIGINT mapping + Float16Array ctor presence. |
| packages/test/src/test/storage-tabular/InMemoryTabularStorage.test.ts | Add tests for putBulk atomicity, rollback events, pagination validation. |
| packages/test/src/test/storage-tabular/CachedTabularStorage.integration.test.ts | Warm-up failures now surfaced + retry behavior. |
| packages/test/src/test/storage-kv/FsFolderKvRepository.integration.test.ts | Add idempotent delete tests + typed unsupported errors. |
| packages/test/src/test/job-queue/TelemetryQueueStorage.test.ts | Test optional passthrough findActiveByFingerprint behavior. |
| packages/test/src/test/job-queue/Limiters.test.ts | Add ConcurrencyLimiter complete-token safety tests. |
| packages/test/src/test/job-queue/JobQueueWorker.test.ts | Ensure server job_error includes errorCode. |
| packages/test/src/binding/RunPrivateInMemoryTaskOutputRepository.ts | New in-memory run-private backing for tests. |
| packages/task-graph/src/task/WhileTask.ts | Throw TaskAbortedError on abort; unify condition error wrapping. |
| packages/task-graph/src/task/TaskRunner.ts | Document process-global warning set behavior. |
| packages/task-graph/src/task/Task.ts | Use logger instead of console; clarify undefined merge semantics. |
| packages/task-graph/src/task/IteratorTaskRunner.ts | Throw TaskAbortedError on abort instead of partial success. |
| packages/task-graph/src/task/iterationSchema.ts | Remove unused removeIterationProperties alias. |
| packages/task-graph/src/task/FallbackTaskRunner.ts | Document event bubbling limitations in task-mode fallback. |
| packages/task-graph/src/task/FallbackTask.ts | Thread TaskGraphJsonOptions through toJSON. |
| packages/task-graph/src/task/ConditionUtils.ts | Warn + false on non-numeric operands for ordering operators. |
| packages/task-graph/src/task/ConditionalTask.ts | Clarify dual output shapes vs declared output schema. |
| packages/task-graph/src/task/CacheCoordinator.ts | Treat cache decode/read failures as cache-miss (log + recompute). |
| packages/task-graph/src/task-graph/WorkflowEventBridge.ts | Update docs: beginRun returns teardown token (no endRun). |
| packages/task-graph/src/task-graph/Workflow.ts | Emit abort vs error; make fluent addTask throw on auto-connect failure. |
| packages/task-graph/src/task-graph/TaskGraphRunner.ts | Prevent preview/run overlap; restore registry after preview; thread runId. |
| packages/task-graph/src/task-graph/TaskGraphEvents.ts | Document repeated task_complete emits for reused subgraphs. |
| packages/task-graph/src/task-graph/TaskGraph.ts | Optimize getDataflow lookup; fix serialGraph edge direction. |
| packages/task-graph/src/task-graph/StreamPump.ts | Guard stream event emits; ensure teardown on error/abort; drop phase events. |
| packages/task-graph/src/task-graph/RunScheduler.ts | Record scheduler-iterator failures so graph run fails correctly. |
| packages/task-graph/src/task-graph/RunContext.ts | Accept caller-provided runId to align run-scoped operations. |
| packages/task-graph/src/task-graph/LoopBuilderContext.ts | Warn on empty loop template graph. |
| packages/task-graph/src/task-graph/Dataflow.ts | Relax DataflowArrow parsing to match createId grammar; doc update needed. |
| packages/task-graph/src/task-graph/ConditionalBuilder.ts | Wire prior task output into conditional input; validate ambiguous join continuation. |
| packages/task-graph/src/storage/TaskOutputTabularRepository.ts | Centralize encoding/decoding via taskOutputCodec; normalize blob shapes. |
| packages/task-graph/src/storage/TaskOutputRepository.ts | Replace prefix-based helpers with run-scoped methods (default-throwing). |
| packages/task-graph/src/storage/taskOutputCodec.ts | New encode/decode helpers for compressed/uncompressed blob payloads. |
| packages/task-graph/src/storage/RunPrivateTaskOutputSchema.ts | New dedicated run-private cache table schema + PK. |
| packages/task-graph/src/storage/RunPrivateTaskOutputRepository.ts | New run-private backing repo with run-scoped CRUD + janitor sweep. |
| packages/task-graph/src/storage/ITaskOutputStorage.ts | Clarify blob payload typing/round-trip shapes in docs. |
| packages/task-graph/src/EXECUTION_MODEL.md | Update docs for run-private cache to use runId column (not prefix). |
| packages/task-graph/src/common.ts | Export new run-private repo + schema. |
| packages/task-graph/src/cache/RunPrivateCacheRepo.ts | Use run-scoped backing methods; scope clear/size per runId. |
| packages/task-graph/src/cache/CacheJanitor.ts | Sweep stale run-private rows via dedicated backing repo. |
| packages/task-graph/README.md | Document run-private backing requirement + usage example. |
| packages/storage/src/vector/README.md | Document default scoreThreshold = -Infinity for cosine similarity. |
| packages/storage/src/vector/InMemoryVectorStorage.ts | Default scoreThreshold; null-safe metadata; emit similaritySearch; reuse atomicPutBulk. |
| packages/storage/src/util/HybridSubscriptionManager.ts | Use logger instead of console on BroadcastChannel init failure. |
| packages/storage/src/tabular/SharedInMemoryTabularStorage.ts | Use safeEmit and logger for forwarded events & channel init. |
| packages/storage/src/tabular/ITabularStorage.ts | Clarify getBulk/get and rollback semantics + backend differences. |
| packages/storage/src/tabular/InMemoryTabularStorage.ts | Add atomic putBulk with rollback; safeEmit on events; validate getOffsetPage args. |
| packages/storage/src/tabular/HuggingFaceTabularStorage.ts | Use safeEmit for get/query events. |
| packages/storage/src/tabular/HttpTabularProxyStorage.ts | Use safeEmit for forwarded events. |
| packages/storage/src/tabular/FsFolderTabularStorage.ts | Use safeEmit + logger; idempotent delete; validate getOffsetPage args. |
| packages/storage/src/tabular/CachedTabularStorage.ts | Surface warm-up failures; serialize subscription cache updates; safeEmit forwarding. |
| packages/storage/src/tabular/BaseTabularStorage.ts | safeEmit for getBulk. |
| packages/storage/src/sql/typedArrayCtors.ts | Add Float16Array ctor conditionally to match documented vectors. |
| packages/storage/src/sql/mapPostgresType.ts | Map large signed/unsigned ints to BIGINT more correctly. |
| packages/storage/src/kv/TelemetryKvStorage.ts | Change Key constraint to string-only (breaking surface). |
| packages/storage/src/kv/KvViaTabularStorage.ts | safeEmit; log JSON parse failures; removeAllListeners on destroy. |
| packages/storage/src/kv/IKvStorage.ts | Change Key constraint to string-only (breaking surface). |
| packages/storage/src/kv/FsFolderKvStorage.ts | safeEmit; idempotent delete; typed unsupported errors for getAll/size. |
| packages/storage/src/events/safeEmit.ts | Clarify rationale: post-commit emits should not fail operations. |
| packages/job-queue/src/queue-storage/wrapQueueStorage.ts | Make scan-exhaustion warning per-instance instead of module-global. |
| packages/job-queue/src/queue-storage/TelemetryQueueStorage.ts | Conditionally expose findActiveByFingerprint only when inner supports it. |
| packages/job-queue/src/queue-storage/IQueueStorage.ts | Document missing-id no-op contracts for complete/progress. |
| packages/job-queue/src/queue-storage/InMemoryMessageQueue.ts | Align ack/fail semantics to overwrite with null on undefined inputs. |
| packages/job-queue/src/limiter/ConcurrencyLimiter.ts | Guard complete() against foreign tokens. |
| packages/job-queue/src/job/JobQueueWorker.ts | Rate-limit loop error logs; bound processing time samples; log loop errors. |
| packages/job-queue/src/job/JobQueueServer.ts | Forward errorCode in job_error; improve logging; clarify totalJobs semantics. |
| packages/job-queue/src/job/JobQueueClient.ts | Implement real sendBatch using IMessageQueue.sendBatch; preserve options. |
| packages/job-queue/src/job/JobErrorRegistry.ts | Use logger instead of console for overwrites. |
| packages/indexeddb/src/storage/IndexedDbVectorStorage.ts | Default scoreThreshold; null-safe metadata; emit similaritySearch via safeEmit. |
| packages/indexeddb/src/job-queue/IndexedDbQueueStorage.ts | Make complete() missing-id a no-op; progress missing-id logs+no-op. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+15
to
+21
| export async function encodeTaskOutput( | ||
| output: TaskOutput, | ||
| outputCompression: boolean | ||
| ): Promise<Uint8Array> { | ||
| const value = JSON.stringify(output); | ||
| return outputCompression ? await compress(value) : Buffer.from(value); | ||
| } |
Comment on lines
24
to
25
| const constructor = this.constructor as typeof BaseError; | ||
| this.name = constructor.type ?? this.constructor.name; |
Comment on lines
+477
to
+480
| // Match the id grammar `id[port] ==> id[port]` produced by Dataflow.createId, | ||
| // which imposes no character restriction on ids/ports (underscores, camelCase, | ||
| // and the `*` all-ports sentinel are all valid). Accept any character except | ||
| // the structural delimiters so the parser is the exact inverse of createId. |
Comment on lines
57
to
60
| export interface IKvStorage< | ||
| Key extends string | number = string, | ||
| Key extends string = string, | ||
| Value = any, | ||
| Combined = { key: Key; value: Value }, |
Comment on lines
15
to
19
| export class TelemetryKvStorage< | ||
| Key extends string | number = string, | ||
| Key extends string = string, | ||
| Value = any, | ||
| Combined = { key: Key; value: Value }, | ||
| > implements IKvStorage<Key, Value, Combined> { |
- taskOutputCodec.encodeTaskOutput: use TextEncoder instead of Buffer.from for the uncompressed path so it works in browser builds (Buffer is undefined there); mirrors the TextDecoder decode fix. - BaseError: derive `name` from the subclass's OWN `static type` (hasOwnProperty) and otherwise fall back to the runtime constructor name. The inherited `BaseError.type` made the documented constructor-name fallback unreachable, so a subclass that forgot to declare `type` was mislabeled "BaseError". - Dataflow: correct the DataflowArrow comment — ids/ports may contain any character except the structural `[` `]` delimiters (the old comment claimed no restriction). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N57Pgeeqgsf4dYBEdijLdq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses correctness, DX, and simplicity findings from a subsystem review
of the core execution stack (util -> storage -> job-queue -> task-graph),
each verified against source and covered by tests.
util:
instanceof Error, adds causesupport) so the library's own errors get full diagnostics/telemetry
child-container disposal from parent-owned instances
multi-segment format narrowing (not just the first segment)
state in fromDirectedGraph; dedup edges by identity; typed GraphInvariantError
storage:
mutation emits through safeEmit and correct its doc
for getAll/size instead of a bare Error
cache updates instead of floating async work
emit the declared similaritySearch event
job-queue:
decorator doesn't silently degrade dedup to an O(n) scan
processingTimes buffer; per-instance scan-exhaustion warning
task-graph:
(Blocker: predicate no longer sees {}); guard ambiguous two-arm continuation
after preview
cross-graph emits against throwing consumers
of returning partial results as COMPLETED
auto-connect failure instead of silently dropping the task
Plus assorted minor fixes and regression tests across all four packages.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01N57Pgeeqgsf4dYBEdijLdq