@quantod/qq 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # QQ — Complete Reference
2
2
 
3
- QQ is a persistent, crash-safe pipeline for multi-stage agentic workflows. It is a **state machine with concurrency guarantees**: stages are states, items move through them, and `claim → release` is an atomic transition only one agent can hold at a time. State survives session restarts and crashes.
3
+ QQ is a persistent, crash-safe pipeline for multi-stage agentic workflows. It is a **state machine with concurrency guarantees**: stages are states, items move through them, and `claim → process → release` is the atomic unit of work — only one agent holds a claim at a time. State survives session restarts and crashes.
4
4
 
5
5
  Use QQ when work fans out: web crawling, bulk API enrichment, research pipelines (find → filter → enrich), batch transforms, any task where multiple items move through multiple stages, possibly with concurrent agents working in parallel.
6
6
 
@@ -33,7 +33,7 @@ Items have:
33
33
  make_pipeline → create a pipeline, get its name, once per setup
34
34
  push (N times) → load items into a stage
35
35
  claim → atomically lock one item (returns seq + payload)
36
- ... do work ...
36
+ ... process the claimed item ...
37
37
  release → unlock item, move to next stage, append payload
38
38
  status → monitor progress
39
39
  unstick → recover stuck/lost items
@@ -41,7 +41,7 @@ unstick → recover stuck/lost items
41
41
 
42
42
  **Orchestrator** creates the pipeline, pushes items, spawns subagents, monitors with `status`, calls `batch_read` to collect results, calls `unstick` after.
43
43
 
44
- **Subagent** claims one item, does its work, releases to the next stage, repeats until "no items to claim" — then stops and reports back.
44
+ **Subagent** claims one item, processes it, releases to the next stage, repeats until "no items to claim" — then stops and reports back. Never process an item before claiming it: another agent could claim and modify it concurrently.
45
45
 
46
46
  ---
47
47
 
@@ -327,6 +327,8 @@ Parameters:
327
327
  - `deleteAfter` (boolean, optional) — delete the file after loading. Default: true.
328
328
  - `duplicates` (`ignore` | `append` | `replace`, optional, default `ignore`) — how to handle records whose `id` already exists in the pipeline. `ignore`: skip silently (existing item unchanged). `append`: append the new record's payload to the existing item's payload and bump `seq` (invalidates any live claim). `replace`: replace the existing item's payload entirely and bump `seq`.
329
329
 
330
+ **⚠ Avoid `append` and `replace` in production pipelines.** Both modes write to items outside the normal `claim → process → release` cycle, bypassing QQ's concurrency control. Any agent currently holding a claim on an affected item will find its `seq` token expired and lose its work. `replace` is especially destructive — it silently discards the existing payload with no recovery path. The correct way to update an item's payload is to `claim` it, process it, and `release` it with new content. Use `append`/`replace` only for offline data preparation before a pipeline has active workers.
331
+
330
332
  **Record format** (all fields optional):
331
333
  ```yaml
332
334
  id: item-1
@@ -367,7 +369,7 @@ Parameters:
367
369
  - `format` (`jsonl` | `json` | `yaml` | `csv`) — data format (explicit, no file extension to infer from)
368
370
  - `pipeline` (string)
369
371
  - `stage` (string, optional) — default stage. Defaults to empty string.
370
- - `duplicates` (`ignore` | `append` | `replace`, optional, default `ignore`) — same semantics as `load_file`
372
+ - `duplicates` (`ignore` | `append` | `replace`, optional, default `ignore`) — same semantics as `load_file`. The same warning applies: prefer `claim → process → release` over `append`/`replace` whenever workers may be active.
371
373
 
372
374
  Returns the same shape as `load_file` (`summary` + `items`), without the `deleteAfter` behaviour.
373
375
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantod/qq",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Persistent queue for multi-stage Claude agent pipelines",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
@@ -1,6 +1,6 @@
1
1
  # QQ — Complete Reference
2
2
 
3
- QQ is a persistent, crash-safe pipeline for multi-stage agentic workflows. It is a **state machine with concurrency guarantees**: stages are states, items move through them, and `claim → release` is an atomic transition only one agent can hold at a time. State survives session restarts and crashes.
3
+ QQ is a persistent, crash-safe pipeline for multi-stage agentic workflows. It is a **state machine with concurrency guarantees**: stages are states, items move through them, and `claim → process → release` is the atomic unit of work — only one agent holds a claim at a time. State survives session restarts and crashes.
4
4
 
5
5
  Use QQ when work fans out: web crawling, bulk API enrichment, research pipelines (find → filter → enrich), batch transforms, any task where multiple items move through multiple stages, possibly with concurrent agents working in parallel.
6
6
 
@@ -33,7 +33,7 @@ Items have:
33
33
  make_pipeline → create a pipeline, get its name, once per setup
34
34
  push (N times) → load items into a stage
35
35
  claim → atomically lock one item (returns seq + payload)
36
- ... do work ...
36
+ ... process the claimed item ...
37
37
  release → unlock item, move to next stage, append payload
38
38
  status → monitor progress
39
39
  unstick → recover stuck/lost items
@@ -41,7 +41,7 @@ unstick → recover stuck/lost items
41
41
 
42
42
  **Orchestrator** creates the pipeline, pushes items, spawns subagents, monitors with `status`, calls `batch_read` to collect results, calls `unstick` after.
43
43
 
44
- **Subagent** claims one item, does its work, releases to the next stage, repeats until "no items to claim" — then stops and reports back.
44
+ **Subagent** claims one item, processes it, releases to the next stage, repeats until "no items to claim" — then stops and reports back. Never process an item before claiming it: another agent could claim and modify it concurrently.
45
45
 
46
46
  ---
47
47
 
@@ -327,6 +327,8 @@ Parameters:
327
327
  - `deleteAfter` (boolean, optional) — delete the file after loading. Default: true.
328
328
  - `duplicates` (`ignore` | `append` | `replace`, optional, default `ignore`) — how to handle records whose `id` already exists in the pipeline. `ignore`: skip silently (existing item unchanged). `append`: append the new record's payload to the existing item's payload and bump `seq` (invalidates any live claim). `replace`: replace the existing item's payload entirely and bump `seq`.
329
329
 
330
+ **⚠ Avoid `append` and `replace` in production pipelines.** Both modes write to items outside the normal `claim → process → release` cycle, bypassing QQ's concurrency control. Any agent currently holding a claim on an affected item will find its `seq` token expired and lose its work. `replace` is especially destructive — it silently discards the existing payload with no recovery path. The correct way to update an item's payload is to `claim` it, process it, and `release` it with new content. Use `append`/`replace` only for offline data preparation before a pipeline has active workers.
331
+
330
332
  **Record format** (all fields optional):
331
333
  ```yaml
332
334
  id: item-1
@@ -367,7 +369,7 @@ Parameters:
367
369
  - `format` (`jsonl` | `json` | `yaml` | `csv`) — data format (explicit, no file extension to infer from)
368
370
  - `pipeline` (string)
369
371
  - `stage` (string, optional) — default stage. Defaults to empty string.
370
- - `duplicates` (`ignore` | `append` | `replace`, optional, default `ignore`) — same semantics as `load_file`
372
+ - `duplicates` (`ignore` | `append` | `replace`, optional, default `ignore`) — same semantics as `load_file`. The same warning applies: prefer `claim → process → release` over `append`/`replace` whenever workers may be active.
371
373
 
372
374
  Returns the same shape as `load_file` (`summary` + `items`), without the `deleteAfter` behaviour.
373
375