@quantod/qq 1.0.8 → 1.0.9
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.
|
@@ -53,6 +53,8 @@ Answer all five questions before writing anything.
|
|
|
53
53
|
|
|
54
54
|
One sentence. If you need more than one sentence, the scope is unclear — break it down or narrow it.
|
|
55
55
|
|
|
56
|
+
The description should include the project name — it's the primary way to identify which project a pipeline belongs to. Keep it short: `[ProjectName] — [what it does]`.
|
|
57
|
+
|
|
56
58
|
**Pipelines are global** — all projects share the same store. Always prefix the pipeline name with the current project identifier (e.g. `myapp_`, `proj_`) to avoid collisions. Use `make_pipeline` with an explicit `name` like `myapp_scrape_products`. Auto-generated names (`MMDD_xxxxxx`) are safe for one-off tasks but not for named, reusable pipelines.
|
|
57
59
|
|
|
58
60
|
### 2. What are the stages?
|
|
@@ -70,7 +72,9 @@ Sub-stages (`review/approved`, `enriched/shortlisted`) are valid — use them wh
|
|
|
70
72
|
|
|
71
73
|
### 3. What are the valid transitions?
|
|
72
74
|
|
|
73
|
-
For each transition:
|
|
75
|
+
For each transition: from stage, to stage, the condition on the source item that triggers it, and the action the agent takes.
|
|
76
|
+
|
|
77
|
+
Columns: **from**, **to**, **condition** (what must be true of the item), **action** (what the agent does), **notes**.
|
|
74
78
|
|
|
75
79
|
**Terminal stages** are stages with no outbound transitions — `done`, `failed`, `discarded`. Be explicit about which stages are terminal.
|
|
76
80
|
|
|
@@ -80,11 +84,13 @@ For each transition: which stage does it come from, which stage does it go to, a
|
|
|
80
84
|
|
|
81
85
|
The `id` is the deduplication primitive. An item can only be pushed once per pipeline per id. Choose it carefully.
|
|
82
86
|
|
|
87
|
+
**Prefer extracted IDs over URLs.** URLs are unstable — the same resource may appear at a mobile URL, a REST API endpoint, a CDN path, or a redirect. Extract the platform's native object ID from the URL and use that instead. A numeric or slug ID survives URL structure changes; a URL does not.
|
|
88
|
+
|
|
83
89
|
| Situation | Use |
|
|
84
90
|
|-----------|-----|
|
|
85
|
-
| Items come from an external system | The
|
|
91
|
+
| Items come from an external system | The platform's native object ID (e.g. post ID, product SKU) — extract from URL if needed |
|
|
86
92
|
| Items have no upstream identifier | Omit `id` — the pipeline assigns a sequence number |
|
|
87
|
-
| Items must be globally unique across runs | A hash or composite key (e.g., `sha256(
|
|
93
|
+
| Items must be globally unique across runs | A hash or composite key (e.g., `sha256(source_id + date)`) |
|
|
88
94
|
|
|
89
95
|
Never use a generated UUID as the id unless items genuinely have no stable identity.
|
|
90
96
|
|
|
@@ -92,10 +98,18 @@ Never use a generated UUID as the id unless items genuinely have no stable ident
|
|
|
92
98
|
|
|
93
99
|
Payload is append-only history by default. Each stage appends its output.
|
|
94
100
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
Document the payload as a YAML example that mirrors the actual structure. Use inline comments for fields that need explanation. No need to enumerate which stage adds each field — the structure itself is the schema.
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
# Example payload schema
|
|
105
|
+
id: "12345"
|
|
106
|
+
title: "Product name"
|
|
107
|
+
price: 29.99
|
|
108
|
+
tags: [electronics, sale]
|
|
109
|
+
summary: "One-paragraph AI summary" # optional, added after enrichment
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Is any field ever replaced rather than appended? Note it with a comment (`# replaced, not appended`).
|
|
99
113
|
|
|
100
114
|
---
|
|
101
115
|
|
|
@@ -124,7 +138,7 @@ PIPELINES.md lives in the project root. One file documents all pipelines in the
|
|
|
124
138
|
```markdown
|
|
125
139
|
## [Pipeline Name]
|
|
126
140
|
|
|
127
|
-
**Description:**
|
|
141
|
+
**Description:** `[ProjectName] — [what it does]`
|
|
128
142
|
|
|
129
143
|
**Purpose:** 2-3 sentences. Why does this pipeline exist? What triggers it?
|
|
130
144
|
|
|
@@ -139,22 +153,23 @@ PIPELINES.md lives in the project root. One file documents all pipelines in the
|
|
|
139
153
|
|
|
140
154
|
### Payload Schema
|
|
141
155
|
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
```yaml
|
|
157
|
+
# YAML example mirroring the actual payload structure
|
|
158
|
+
```
|
|
144
159
|
|
|
145
160
|
---
|
|
146
161
|
|
|
147
162
|
### Stages
|
|
148
163
|
|
|
149
|
-
| Stage | Meaning |
|
|
150
|
-
|
|
164
|
+
| Stage | Meaning |
|
|
165
|
+
|-------|---------|
|
|
151
166
|
|
|
152
167
|
---
|
|
153
168
|
|
|
154
169
|
### Transitions
|
|
155
170
|
|
|
156
|
-
| From | To |
|
|
157
|
-
|
|
171
|
+
| From | To | Condition | Action | Notes |
|
|
172
|
+
|------|----|-----------|--------|-------|
|
|
158
173
|
|
|
159
174
|
---
|
|
160
175
|
|
|
@@ -185,8 +200,8 @@ stateDiagram-v2
|
|
|
185
200
|
- [ ] Every stage has a defined meaning in the Stages table
|
|
186
201
|
- [ ] Every valid transition appears in both the Transitions table and the Mermaid diagram
|
|
187
202
|
- [ ] Terminal stages are identified
|
|
188
|
-
- [ ] ID strategy is explicit and justified
|
|
189
|
-
- [ ] Payload schema
|
|
203
|
+
- [ ] ID strategy is explicit and justified — stable object ID preferred over URL
|
|
204
|
+
- [ ] Payload schema is a YAML example that reflects the actual structure
|
|
190
205
|
- [ ] Retry logic is documented
|
|
191
206
|
- [ ] Orchestrator and subagent responsibilities are separated and complete
|
|
192
207
|
- [ ] Process notes cover what happens to `failed` items
|
package/package.json
CHANGED
|
@@ -53,6 +53,8 @@ Answer all five questions before writing anything.
|
|
|
53
53
|
|
|
54
54
|
One sentence. If you need more than one sentence, the scope is unclear — break it down or narrow it.
|
|
55
55
|
|
|
56
|
+
The description should include the project name — it's the primary way to identify which project a pipeline belongs to. Keep it short: `[ProjectName] — [what it does]`.
|
|
57
|
+
|
|
56
58
|
**Pipelines are global** — all projects share the same store. Always prefix the pipeline name with the current project identifier (e.g. `myapp_`, `proj_`) to avoid collisions. Use `make_pipeline` with an explicit `name` like `myapp_scrape_products`. Auto-generated names (`MMDD_xxxxxx`) are safe for one-off tasks but not for named, reusable pipelines.
|
|
57
59
|
|
|
58
60
|
### 2. What are the stages?
|
|
@@ -70,7 +72,9 @@ Sub-stages (`review/approved`, `enriched/shortlisted`) are valid — use them wh
|
|
|
70
72
|
|
|
71
73
|
### 3. What are the valid transitions?
|
|
72
74
|
|
|
73
|
-
For each transition:
|
|
75
|
+
For each transition: from stage, to stage, the condition on the source item that triggers it, and the action the agent takes.
|
|
76
|
+
|
|
77
|
+
Columns: **from**, **to**, **condition** (what must be true of the item), **action** (what the agent does), **notes**.
|
|
74
78
|
|
|
75
79
|
**Terminal stages** are stages with no outbound transitions — `done`, `failed`, `discarded`. Be explicit about which stages are terminal.
|
|
76
80
|
|
|
@@ -80,11 +84,13 @@ For each transition: which stage does it come from, which stage does it go to, a
|
|
|
80
84
|
|
|
81
85
|
The `id` is the deduplication primitive. An item can only be pushed once per pipeline per id. Choose it carefully.
|
|
82
86
|
|
|
87
|
+
**Prefer extracted IDs over URLs.** URLs are unstable — the same resource may appear at a mobile URL, a REST API endpoint, a CDN path, or a redirect. Extract the platform's native object ID from the URL and use that instead. A numeric or slug ID survives URL structure changes; a URL does not.
|
|
88
|
+
|
|
83
89
|
| Situation | Use |
|
|
84
90
|
|-----------|-----|
|
|
85
|
-
| Items come from an external system | The
|
|
91
|
+
| Items come from an external system | The platform's native object ID (e.g. post ID, product SKU) — extract from URL if needed |
|
|
86
92
|
| Items have no upstream identifier | Omit `id` — the pipeline assigns a sequence number |
|
|
87
|
-
| Items must be globally unique across runs | A hash or composite key (e.g., `sha256(
|
|
93
|
+
| Items must be globally unique across runs | A hash or composite key (e.g., `sha256(source_id + date)`) |
|
|
88
94
|
|
|
89
95
|
Never use a generated UUID as the id unless items genuinely have no stable identity.
|
|
90
96
|
|
|
@@ -92,10 +98,18 @@ Never use a generated UUID as the id unless items genuinely have no stable ident
|
|
|
92
98
|
|
|
93
99
|
Payload is append-only history by default. Each stage appends its output.
|
|
94
100
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
Document the payload as a YAML example that mirrors the actual structure. Use inline comments for fields that need explanation. No need to enumerate which stage adds each field — the structure itself is the schema.
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
# Example payload schema
|
|
105
|
+
id: "12345"
|
|
106
|
+
title: "Product name"
|
|
107
|
+
price: 29.99
|
|
108
|
+
tags: [electronics, sale]
|
|
109
|
+
summary: "One-paragraph AI summary" # optional, added after enrichment
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Is any field ever replaced rather than appended? Note it with a comment (`# replaced, not appended`).
|
|
99
113
|
|
|
100
114
|
---
|
|
101
115
|
|
|
@@ -124,7 +138,7 @@ PIPELINES.md lives in the project root. One file documents all pipelines in the
|
|
|
124
138
|
```markdown
|
|
125
139
|
## [Pipeline Name]
|
|
126
140
|
|
|
127
|
-
**Description:**
|
|
141
|
+
**Description:** `[ProjectName] — [what it does]`
|
|
128
142
|
|
|
129
143
|
**Purpose:** 2-3 sentences. Why does this pipeline exist? What triggers it?
|
|
130
144
|
|
|
@@ -139,22 +153,23 @@ PIPELINES.md lives in the project root. One file documents all pipelines in the
|
|
|
139
153
|
|
|
140
154
|
### Payload Schema
|
|
141
155
|
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
```yaml
|
|
157
|
+
# YAML example mirroring the actual payload structure
|
|
158
|
+
```
|
|
144
159
|
|
|
145
160
|
---
|
|
146
161
|
|
|
147
162
|
### Stages
|
|
148
163
|
|
|
149
|
-
| Stage | Meaning |
|
|
150
|
-
|
|
164
|
+
| Stage | Meaning |
|
|
165
|
+
|-------|---------|
|
|
151
166
|
|
|
152
167
|
---
|
|
153
168
|
|
|
154
169
|
### Transitions
|
|
155
170
|
|
|
156
|
-
| From | To |
|
|
157
|
-
|
|
171
|
+
| From | To | Condition | Action | Notes |
|
|
172
|
+
|------|----|-----------|--------|-------|
|
|
158
173
|
|
|
159
174
|
---
|
|
160
175
|
|
|
@@ -185,8 +200,8 @@ stateDiagram-v2
|
|
|
185
200
|
- [ ] Every stage has a defined meaning in the Stages table
|
|
186
201
|
- [ ] Every valid transition appears in both the Transitions table and the Mermaid diagram
|
|
187
202
|
- [ ] Terminal stages are identified
|
|
188
|
-
- [ ] ID strategy is explicit and justified
|
|
189
|
-
- [ ] Payload schema
|
|
203
|
+
- [ ] ID strategy is explicit and justified — stable object ID preferred over URL
|
|
204
|
+
- [ ] Payload schema is a YAML example that reflects the actual structure
|
|
190
205
|
- [ ] Retry logic is documented
|
|
191
206
|
- [ ] Orchestrator and subagent responsibilities are separated and complete
|
|
192
207
|
- [ ] Process notes cover what happens to `failed` items
|