@nurix/etna 0.18.0 → 0.18.1

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.
Files changed (100) hide show
  1. package/README.md +6 -5
  2. package/data/harness-index.json +1 -1
  3. package/data/harnesses/code/CLAUDE.md +7 -18
  4. package/data/harnesses/code/agents/brainstorm.md +3 -3
  5. package/data/harnesses/code/agents/change-review.md +13 -10
  6. package/data/harnesses/code/agents/harness-manager.md +15 -15
  7. package/data/harnesses/code/agents/maintenance.md +10 -3
  8. package/data/harnesses/code/agents/performance-review.md +5 -0
  9. package/data/harnesses/code/harness.json +1 -1
  10. package/data/harnesses/code/rules/general.md +40 -36
  11. package/data/harnesses/code/skills/boundary/SKILL.md +15 -42
  12. package/data/harnesses/code/skills/boundary/references/boundary-taxonomy.md +366 -304
  13. package/data/harnesses/code/skills/brainstorm/README.md +9 -9
  14. package/data/harnesses/code/skills/brainstorm/SKILL.md +15 -15
  15. package/data/harnesses/code/skills/brainstorm/harvest.md +2 -2
  16. package/data/harnesses/code/skills/brainstorm/templates/backlog.md +2 -2
  17. package/data/harnesses/code/skills/brainstorm/templates/build.md +6 -6
  18. package/data/harnesses/code/skills/brainstorm/templates/decisions.md +3 -3
  19. package/data/harnesses/code/skills/brainstorm/templates/doctrine.md +2 -2
  20. package/data/harnesses/code/skills/brainstorm/templates/domain-model.md +2 -2
  21. package/data/harnesses/code/skills/brainstorm/templates/glossary.md +2 -1
  22. package/data/harnesses/code/skills/brainstorm/templates/non-goals.md +3 -7
  23. package/data/harnesses/code/skills/brainstorm/templates/questions.md +6 -5
  24. package/data/harnesses/code/skills/brainstorm/templates/state.md +1 -8
  25. package/data/harnesses/code/skills/brainstorm/templates/tech.md +6 -6
  26. package/data/harnesses/code/skills/brainstorm/templates/thesis.md +2 -2
  27. package/data/harnesses/code/skills/distiller/SKILL.md +48 -177
  28. package/data/harnesses/code/skills/distiller/references/docs-mode.md +116 -343
  29. package/data/harnesses/code/skills/distiller/references/method.md +37 -109
  30. package/data/harnesses/code/skills/documentation/SKILL.md +9 -6
  31. package/data/harnesses/code/skills/documentation/references/examples.md +30 -61
  32. package/data/harnesses/code/skills/documentation/references/style-guide.md +59 -62
  33. package/data/harnesses/code/skills/documentation/references/templates.md +25 -33
  34. package/data/harnesses/code/skills/workflow-mapper/SKILL.md +32 -11
  35. package/data/harnesses/code/skills/workflow-mapper/references/patterns.md +1 -1
  36. package/data/harnesses/code-fable/CLAUDE.md +12 -23
  37. package/data/harnesses/code-fable/agents/brainstorm.md +3 -3
  38. package/data/harnesses/code-fable/agents/change-review.md +13 -10
  39. package/data/harnesses/code-fable/agents/harness-manager.md +15 -15
  40. package/data/harnesses/code-fable/agents/maintenance.md +10 -3
  41. package/data/harnesses/code-fable/agents/performance-review.md +5 -0
  42. package/data/harnesses/code-fable/harness.json +1 -1
  43. package/data/harnesses/code-fable/rules/general.md +40 -36
  44. package/data/harnesses/code-fable/skills/boundary/SKILL.md +15 -42
  45. package/data/harnesses/code-fable/skills/boundary/references/boundary-taxonomy.md +366 -304
  46. package/data/harnesses/code-fable/skills/brainstorm/README.md +9 -9
  47. package/data/harnesses/code-fable/skills/brainstorm/SKILL.md +15 -15
  48. package/data/harnesses/code-fable/skills/brainstorm/harvest.md +2 -2
  49. package/data/harnesses/code-fable/skills/brainstorm/templates/backlog.md +2 -2
  50. package/data/harnesses/code-fable/skills/brainstorm/templates/build.md +6 -6
  51. package/data/harnesses/code-fable/skills/brainstorm/templates/decisions.md +3 -3
  52. package/data/harnesses/code-fable/skills/brainstorm/templates/doctrine.md +2 -2
  53. package/data/harnesses/code-fable/skills/brainstorm/templates/domain-model.md +2 -2
  54. package/data/harnesses/code-fable/skills/brainstorm/templates/glossary.md +2 -1
  55. package/data/harnesses/code-fable/skills/brainstorm/templates/non-goals.md +3 -7
  56. package/data/harnesses/code-fable/skills/brainstorm/templates/questions.md +6 -5
  57. package/data/harnesses/code-fable/skills/brainstorm/templates/state.md +1 -8
  58. package/data/harnesses/code-fable/skills/brainstorm/templates/tech.md +6 -6
  59. package/data/harnesses/code-fable/skills/brainstorm/templates/thesis.md +2 -2
  60. package/data/harnesses/code-fable/skills/distiller/SKILL.md +48 -177
  61. package/data/harnesses/code-fable/skills/distiller/references/docs-mode.md +116 -343
  62. package/data/harnesses/code-fable/skills/distiller/references/method.md +37 -109
  63. package/data/harnesses/code-fable/skills/documentation/SKILL.md +9 -6
  64. package/data/harnesses/code-fable/skills/documentation/references/examples.md +30 -61
  65. package/data/harnesses/code-fable/skills/documentation/references/style-guide.md +59 -62
  66. package/data/harnesses/code-fable/skills/documentation/references/templates.md +25 -33
  67. package/data/harnesses/code-fable/skills/workflow-mapper/SKILL.md +32 -11
  68. package/data/harnesses/code-fable/skills/workflow-mapper/references/patterns.md +1 -1
  69. package/data/harnesses/discover/CLAUDE.md +41 -109
  70. package/data/harnesses/discover/agents/api.md +11 -28
  71. package/data/harnesses/discover/agents/codebase.md +12 -30
  72. package/data/harnesses/discover/agents/community.md +9 -21
  73. package/data/harnesses/discover/agents/deployed-client-bundle.md +16 -67
  74. package/data/harnesses/discover/agents/distribution-artifacts.md +21 -59
  75. package/data/harnesses/discover/agents/docs.md +11 -20
  76. package/data/harnesses/discover/agents/infra-backend-fingerprint.md +28 -68
  77. package/data/harnesses/discover/agents/packages.md +12 -28
  78. package/data/harnesses/discover/agents/session.md +18 -50
  79. package/data/harnesses/discover/agents/website.md +9 -19
  80. package/data/harnesses/discover/agents/wire-capture.md +22 -72
  81. package/data/harnesses/discover/harness.json +1 -1
  82. package/data/harnesses/discover/rules/discovery.md +73 -182
  83. package/data/harnesses/discover/rules/evaluation.md +90 -98
  84. package/data/harnesses/discover/rules/ingestion.md +123 -322
  85. package/data/harnesses/discover/rules/self-correction.md +67 -92
  86. package/data/harnesses/discover/rules/tradecraft.md +201 -172
  87. package/data/harnesses/hr/CLAUDE.md +21 -51
  88. package/data/harnesses/hr/harness.json +1 -1
  89. package/data/harnesses/hr/skills/interview-eval/SKILL.md +23 -11
  90. package/data/harnesses/hr/skills/interview-eval/TEMPLATE.md +49 -29
  91. package/data/harnesses/hr/skills/interview-eval/rubric.md +30 -30
  92. package/data/harnesses/kb-agi/CLAUDE.md +8 -8
  93. package/data/harnesses/kb-agi/agents/kb-agi-init.md +31 -22
  94. package/data/harnesses/kb-agi/agents/kb-catch-stale.md +1 -1
  95. package/data/harnesses/kb-agi/agents/kb-find-gaps.md +1 -1
  96. package/data/harnesses/kb-agi/agents/kb-fix-links.md +1 -1
  97. package/data/harnesses/kb-agi/agents/kb-refresh-summaries.md +2 -2
  98. package/data/harnesses/kb-agi/agents/kb-sync-metadata.md +2 -2
  99. package/data/harnesses/kb-agi/harness.json +1 -1
  100. package/package.json +1 -1
@@ -282,7 +282,7 @@ Append entries below, oldest at bottom. Format:
282
282
  Memory file initialized during documentation baseline.
283
283
  ```
284
284
 
285
- > The per-actor memory **inbox** (`docs/memory/inbox/`) is *not* a baseline scaffold — the `session-reflect` hook creates it mechanically on the first reflected session. See **§11 Memory inbox entry** for its format.
285
+ > The per-actor memory **inbox** (`docs/memory/inbox/`) is _not_ a baseline scaffold — the `session-reflect` hook creates it mechanically on the first reflected session. See **§11 Memory inbox entry** for its format.
286
286
 
287
287
  ---
288
288
 
@@ -295,12 +295,12 @@ The four research-derived sections (**Affected Modules**, **Conventions to Follo
295
295
  ```yaml
296
296
  ---
297
297
  owns:
298
- - src/feature-name/** # projected at Draft, confirmed at Active
298
+ - src/feature-name/** # projected at Draft, confirmed at Active
299
299
  touches:
300
300
  - src/shared/state/feature.js
301
301
  depends_on:
302
302
  - docs/features/related-feature.md
303
- anchors: # optional — see §3 frontmatter reference
303
+ anchors: # optional — see §3 frontmatter reference
304
304
  - "qmd query: wire envelope invariants"
305
305
  ---
306
306
  ```
@@ -428,7 +428,7 @@ model Resource {
428
428
  Sections fill in across the feature's lifecycle. No template swap — they accumulate in place.
429
429
 
430
430
  | When | Sections written | Source |
431
- |------|------------------|--------|
431
+ | --- | --- | --- |
432
432
  | Status: Draft (design) | Goal, Goals & Non-Goals, Background, Approach, Open Questions, Risks | User interview |
433
433
  | Status: Draft (research) | Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts | spec-mode agent |
434
434
  | Status: Draft → Active (implementation lands) | Architecture, Key Functions, State, Redux, Files; frontmatter `owns`/`touches` confirmed against real code | Main agent (from actual code) |
@@ -635,11 +635,11 @@ Three sections are required: **Decision**, **Context**, **Consequences**. Everyt
635
635
  ```markdown
636
636
  ---
637
637
  title: "ADR-NNN: Short title in sentence case"
638
- status: Accepted # Proposed | Accepted | Deprecated | Superseded by ADR-NNN
638
+ status: Accepted # Proposed | Accepted | Deprecated | Superseded by ADR-NNN
639
639
  date: YYYY-MM-DD
640
640
  decision-owner: Name
641
- reviewers: [] # optional
642
- supersedes: # optional, e.g., ADR-005
641
+ reviewers: [] # optional
642
+ supersedes: # optional, e.g., ADR-005
643
643
  tags: [adr]
644
644
  ---
645
645
 
@@ -656,12 +656,15 @@ tags: [adr]
656
656
  ## Consequences
657
657
 
658
658
  **Positive:**
659
+
659
660
  - [What becomes easier]
660
661
 
661
662
  **Negative:**
663
+
662
664
  - [What becomes harder, what we accept reluctantly]
663
665
 
664
666
  **Risks:**
667
+
665
668
  - [Second-order effects you can already see, with mitigations if known]
666
669
 
667
670
  <!-- Optional sections below. Include only when warranted by the decision's weight. -->
@@ -672,10 +675,10 @@ tags: [adr]
672
675
 
673
676
  ## Options Considered
674
677
 
675
- | Option | Pros | Cons | Outcome |
676
- |---|---|---|---|
677
- | **Option A** | … | … | **CHOSEN** |
678
- | Option B | … | … | Eliminated — [reason] |
678
+ | Option | Pros | Cons | Outcome |
679
+ | ------------ | ---- | ---- | --------------------- |
680
+ | **Option A** | … | … | **CHOSEN** |
681
+ | Option B | … | … | Eliminated — [reason] |
679
682
 
680
683
  ## Deep Comparison
681
684
 
@@ -688,12 +691,12 @@ tags: [adr]
688
691
  ## Implementation Plan
689
692
 
690
693
  | Phase | Scope | Duration |
691
- |---|---|---|
692
- | 1 | … | … |
694
+ | ----- | ----- | -------- |
695
+ | 1 | … | … |
693
696
 
694
697
  ## Open Questions
695
698
 
696
- 1. **[Question]** — *Default*: [stated default until resolved].
699
+ 1. **[Question]** — _Default_: [stated default until resolved].
697
700
 
698
701
  ## Acknowledgements
699
702
 
@@ -757,7 +760,7 @@ Skip any section that doesn't apply. Don't pad to fill the template.
757
760
  - **{Family 2}** — {what's in it.}
758
761
  - **{Family 3}** — {what's in it.}
759
762
 
760
- The full surface lives in [`{path/to/public-index}`]({path/to/public-index}). ← optional pointer for libraries
763
+ The full surface lives in [`{path/to/public-index}`]({path/to/public-index}). ← optional pointer for libraries
761
764
 
762
765
  ## Stack
763
766
 
@@ -767,32 +770,21 @@ The full surface lives in [`{path/to/public-index}`]({path/to/public-index}).
767
770
 
768
771
  ## Getting started
769
772
 
770
- \`\`\`bash
771
- {pm} install
772
- {pm} run dev # what it does (port, URL)
773
- {pm} run build # what it does
774
- {pm} run preview # what it does (omit if not applicable)
775
- \`\`\`
773
+ \`\`\`bash {pm} install {pm} run dev # what it does (port, URL) {pm} run build # what it does {pm} run preview # what it does (omit if not applicable) \`\`\`
776
774
 
777
775
  {Optional one-liner about first-run behavior — e.g., "Dev server lands on /playground."}
778
776
 
779
- ## {Runtime entry point} ← optional; e.g., "The playground", "CLI", "API endpoints"
777
+ ## {Runtime entry point} ← optional; e.g., "The playground", "CLI", "API endpoints"
780
778
 
781
779
  {Brief description of the dev/runtime surface.}
782
780
 
783
- | {Thing} | {What it shows / does} |
784
- | -------------------- | -------------------------- |
785
- | `{route or command}` | {description} |
781
+ | {Thing} | {What it shows / does} |
782
+ | -------------------- | ---------------------- |
783
+ | `{route or command}` | {description} |
786
784
 
787
785
  ## Layout
788
786
 
789
- \`\`\`
790
- src/
791
- ├── {entry-file} # {purpose}
792
- ├── {folder}/ # {purpose}
793
- │ └── ...
794
- └── {folder}/ # {purpose}
795
- \`\`\`
787
+ \`\`\` src/ ├── {entry-file} # {purpose} ├── {folder}/ # {purpose} │ └── ... └── {folder}/ # {purpose} \`\`\`
796
788
 
797
789
  ## Adding a {primary unit}
798
790
 
@@ -801,7 +793,7 @@ src/
801
793
  3. {Wire into the playground / example app / test harness so reviewers can see it render.}
802
794
  4. {Document any divergence from upstream in `docs/{...}`.}
803
795
 
804
- ## Styling ← optional; replace with whichever cross-cutting concern matters most
796
+ ## Styling ← optional; replace with whichever cross-cutting concern matters most
805
797
 
806
798
  {Configuration notes that affect every consumer — design tokens, conventions, opt-outs.}
807
799
 
@@ -45,6 +45,7 @@ Search patterns (adapt to framework):
45
45
  For each route, record: `{ method, path, handler_function, file }`.
46
46
 
47
47
  Filter out trivial CRUD (single DB call + response). Keep routes that:
48
+
48
49
  - Call `startWorkflow`, `addJob`, `enqueue`, `emit`, `publish` (async dispatch)
49
50
  - Call 2+ service functions sequentially
50
51
  - Have transaction blocks (`$transaction`, `BEGIN`, `withTransaction`)
@@ -66,6 +67,7 @@ Search patterns:
66
67
  ```
67
68
 
68
69
  For Temporal specifically, also check:
70
+
69
71
  - `temporal/config/workflowModules.js` — workflow registry with queues and dependencies
70
72
  - `temporal/config/activityModules.js` — activity aggregation
71
73
 
@@ -82,6 +84,7 @@ Search patterns:
82
84
  ```
83
85
 
84
86
  Focus on actions that:
87
+
85
88
  - POST/PUT/PATCH/DELETE to backend (not just GETs)
86
89
  - Dispatch multiple Redux actions in sequence
87
90
  - Start polling loops (`setInterval`, recursive `setTimeout`, retry patterns)
@@ -138,7 +141,7 @@ For each discovered entry point, trace the full execution path. Use one sub-agen
138
141
  Map code actors to diagram participants using this hierarchy:
139
142
 
140
143
  | Code Pattern | Participant Name |
141
- |---|---|
144
+ | --- | --- |
142
145
  | React component, hook, event handler | `User` + `Frontend` |
143
146
  | Express/API route handler | `API` |
144
147
  | Temporal workflow | `Temporal` |
@@ -175,7 +178,7 @@ Not every API route is a "workflow". Classify and filter.
175
178
  ### Workflow Categories
176
179
 
177
180
  | Category | Criteria | Include? |
178
- |---|---|---|
181
+ | --- | --- | --- |
179
182
  | **Orchestration** | Multi-step, multi-service, async handoffs (save, publish, deploy) | Always |
180
183
  | **Auth & Session** | Login, logout, token refresh, SSO flows | Always |
181
184
  | **Real-time** | WebSocket connections, live updates, presence | Always |
@@ -206,9 +209,7 @@ Simple workflows get a compact diagram. Complex workflows get full detail with a
206
209
  ````markdown
207
210
  ### {Workflow Name}
208
211
 
209
- **Trigger:** {What initiates this — button click, API call, cron schedule, event}
210
- **Participants:** {List of systems involved}
211
- **Key files:** {3-5 most important files in the chain}
212
+ **Trigger:** {What initiates this — button click, API call, cron schedule, event} **Participants:** {List of systems involved} **Key files:** {3-5 most important files in the chain}
212
213
 
213
214
  ```mermaid
214
215
  sequenceDiagram
@@ -226,6 +227,7 @@ sequenceDiagram
226
227
  ```
227
228
 
228
229
  **Notes:**
230
+
229
231
  - {Important implementation detail not visible in diagram}
230
232
  - {Performance consideration, timeout, retry policy}
231
233
  - {Known edge cases or failure modes}
@@ -265,11 +267,11 @@ sequenceDiagram
265
267
 
266
268
  Write to the user-specified path, or default to `docs/architecture/workflows.md`. Before writing output files, ensure the target directory exists. Create it with `mkdir -p` if needed.
267
269
 
268
- ````markdown
270
+ ```markdown
269
271
  ---
270
- generated: {YYYY-MM-DD}
271
- scope: {full | feature-name}
272
- workflows_found: {count}
272
+ generated: { YYYY-MM-DD }
273
+ scope: { full | feature-name }
274
+ workflows_found: { count }
273
275
  ---
274
276
 
275
277
  # Codebase Workflows
@@ -279,7 +281,7 @@ Auto-generated workflow map. Traces execution paths from user action to terminal
279
281
  ## Table of Contents
280
282
 
281
283
  | Workflow | Category | Trigger | Participants | Complexity |
282
- |---|---|---|---|---|
284
+ | --- | --- | --- | --- | --- |
283
285
  | [{Name}](#{anchor}) | {Category} | {Trigger} | {Count} | {Simple/Moderate/Complex} |
284
286
 
285
287
  ---
@@ -287,6 +289,7 @@ Auto-generated workflow map. Traces execution paths from user action to terminal
287
289
  ## Orchestration Workflows
288
290
 
289
291
  ### {Workflow Name}
292
+
290
293
  {Diagram + metadata as defined in Phase 4}
291
294
 
292
295
  ---
@@ -294,6 +297,7 @@ Auto-generated workflow map. Traces execution paths from user action to terminal
294
297
  ## Authentication & Session Workflows
295
298
 
296
299
  ### {Workflow Name}
300
+
297
301
  {...}
298
302
 
299
303
  ---
@@ -301,6 +305,7 @@ Auto-generated workflow map. Traces execution paths from user action to terminal
301
305
  ## Real-time Workflows
302
306
 
303
307
  ### {Workflow Name}
308
+
304
309
  {...}
305
310
 
306
311
  ---
@@ -308,6 +313,7 @@ Auto-generated workflow map. Traces execution paths from user action to terminal
308
313
  ## Event-driven Workflows
309
314
 
310
315
  ### {Workflow Name}
316
+
311
317
  {...}
312
318
 
313
319
  ---
@@ -315,6 +321,7 @@ Auto-generated workflow map. Traces execution paths from user action to terminal
315
321
  ## Scheduled Workflows
316
322
 
317
323
  ### {Workflow Name}
324
+
318
325
  {...}
319
326
 
320
327
  ---
@@ -322,8 +329,9 @@ Auto-generated workflow map. Traces execution paths from user action to terminal
322
329
  ## Data Pipeline Workflows
323
330
 
324
331
  ### {Workflow Name}
332
+
325
333
  {...}
326
- ````
334
+ ```
327
335
 
328
336
  ### Section Ordering
329
337
 
@@ -347,6 +355,7 @@ Launch 5 parallel sub-agents for Phase 1 (one per technique). Collect results, d
347
355
  ### Targeted Discovery
348
356
 
349
357
  User specifies a feature name. Skip broad Phase 1 scan. Instead:
358
+
350
359
  1. Find the feature's directory/files (grep for feature name in routes, components, workflows)
351
360
  2. Trace from those entry points only
352
361
  3. Output a single-feature workflow document
@@ -362,56 +371,68 @@ Read the existing workflow map file. For each workflow listed, check if the key
362
371
  ### Payload Storage Detection
363
372
 
364
373
  Look for patterns where large payloads are stored separately and referenced by ID:
374
+
365
375
  ```
366
376
  storePayload|savePayload|workflow_payload|jobData
367
377
  → then: retrievePayload|fetchPayload|getPayload (in the worker/activity)
368
378
  ```
379
+
369
380
  Note this in the diagram as a "Store payload → reference by ID" pattern.
370
381
 
371
382
  ### Optimistic Locking Detection
372
383
 
373
384
  Look for version comparison patterns:
385
+
374
386
  ```
375
387
  version.*!==|version.*conflict|StaleObjectError|OptimisticLock
376
388
  if.*serverVersion.*localVersion|if.*version.*mismatch
377
389
  ```
390
+
378
391
  These indicate conflict branching that should appear as `alt` blocks.
379
392
 
380
393
  ### Polling Loop Detection
381
394
 
382
395
  Look for patterns where the frontend waits for async completion:
396
+
383
397
  ```
384
398
  setInterval|setTimeout.*recursive|poll|retry.*status
385
399
  GET.*status\?.*workflowId|GET.*status\?.*jobId
386
400
  ```
401
+
387
402
  Note the polling interval and timeout in the diagram.
388
403
 
389
404
  ### Child Workflow / Sub-job Detection
390
405
 
391
406
  Look for spawned sub-processes:
407
+
392
408
  ```
393
409
  startChild\(|spawnChild|fork\(|.add\(.*queue
394
410
  Promise\.all.*map.*startWorkflow
395
411
  ```
412
+
396
413
  These should appear as nested sequences or separate linked diagrams.
397
414
 
398
415
  ### Transaction Boundary Detection
399
416
 
400
417
  Look for explicit transaction markers:
418
+
401
419
  ```
402
420
  \$transaction|\$executeRaw|BEGIN|COMMIT|ROLLBACK
403
421
  withTransaction|runInTransaction|atomic
404
422
  ```
423
+
405
424
  Group operations within a transaction using `rect` blocks in the diagram.
406
425
 
407
426
  ### Rate Limiting & Middleware Detection
408
427
 
409
428
  Look for middleware applied to route groups:
429
+
410
430
  ```
411
431
  rateLimit|rateLimiter|throttle
412
432
  authenticate|authorize|requireAuth|requireRole
413
433
  validate|validateBody|validateParams
414
434
  ```
435
+
415
436
  Note these as guards in the diagram using `opt` blocks or notes.
416
437
 
417
438
  ---
@@ -9,7 +9,7 @@ Concrete grep/glob patterns for each discovery technique. Agents should adapt th
9
9
  Identify the tech stack to select the right patterns:
10
10
 
11
11
  | Check | Pattern | Means |
12
- |---|---|---|
12
+ | --- | --- | --- |
13
13
  | `package.json` contains `express` | `"express"` | Express backend |
14
14
  | `package.json` contains `@temporalio` | `"@temporalio"` | Temporal workflows |
15
15
  | `package.json` contains `bullmq` | `"bullmq"` | BullMQ job queues |
@@ -1,46 +1,38 @@
1
1
  # Discover Harness — Orchestrator
2
2
 
3
- This is the **policy** half of the `discover` harness. The plugin ships the capabilities (11
4
- dimension-collector agents + 4 mode rules + a `tradecraft` keyboard reference);
5
- this file drives them. Together they discover a product across every surface it exposes and assemble a
6
- structured, provenance-tracked corpus in the resolved corpus root (default `research/<target>/`).
3
+ This is the **policy** half of the `discover` harness. The plugin ships the capabilities (11 dimension-collector agents + 4 mode rules + a `tradecraft` keyboard reference); this file drives them. Together they discover a product across every surface it exposes and assemble a structured, provenance-tracked corpus in the resolved corpus root (default `research/<target>/`).
7
4
 
8
- A run is four modes, in order: **Discovery → Ingestion → Evaluation → Self-correction.** The main
9
- session drives all four — Ingestion and Evaluation fan out parallel sub-agents (dispatch each via the
10
- Agent/Task tool with `model: opus`), and a sub-agent cannot spawn further sub-agents.
5
+ A run is four modes, in order: **Discovery → Ingestion → Evaluation → Self-correction.** The main session drives all four — Ingestion and Evaluation fan out parallel sub-agents (dispatch each via the Agent/Task tool with `model: opus`), and a sub-agent cannot spawn further sub-agents.
11
6
 
12
7
  ---
13
8
 
14
9
  ## Access is a capability vector (the front gate)
15
10
 
16
- A target's access is four orthogonal axes, each `{value, confidence, evidence}` — and the vector
17
- decides which dimensions are reachable and which extraction method each uses:
11
+ A target's access is four orthogonal axes, each `{value, confidence, evidence}` — and the vector decides which dimensions are reachable and which extraction method each uses:
18
12
 
19
13
  | Axis | Values | Unlocks | Case |
20
- |------|--------|---------|------|
14
+ | --- | --- | --- | --- |
21
15
  | **source** | full · partial · none | codebase, packages | open-source repo |
22
16
  | **runtime** | reachable · gated · none | deployed-client-bundle, api, infra-backend-fingerprint, wire-capture | deployed, no source |
23
17
  | **auth** | have-login · none | session | logged-in SaaS |
24
18
  | **presence** | rich · thin · none | docs, website, community | — |
25
19
 
26
- Targets light several axes at once. The full model + grade→method mapping is in
27
- `.claude/rules/discovery.md`.
20
+ Targets light several axes at once. The full model + grade→method mapping is in `.claude/rules/discovery.md`.
28
21
 
29
22
  ---
30
23
 
31
24
  ## The eleven dimensions → agents
32
25
 
33
- | Dimension / agent | | Dimension / agent |
34
- |---|--|---|
35
- | `codebase` | | `session` ⚠ |
36
- | `docs` | | `deployed-client-bundle` |
37
- | `packages` | | `infra-backend-fingerprint` |
38
- | `api` (+MCP) | | `wire-capture` ⚠ |
39
- | `website` | | `distribution-artifacts` |
40
- | `community` | | |
26
+ | Dimension / agent | | Dimension / agent |
27
+ | ----------------- | --- | --------------------------- |
28
+ | `codebase` | | `session` ⚠ |
29
+ | `docs` | | `deployed-client-bundle` |
30
+ | `packages` | | `infra-backend-fingerprint` |
31
+ | `api` (+MCP) | | `wire-capture` ⚠ |
32
+ | `website` | | `distribution-artifacts` |
33
+ | `community` | | |
41
34
 
42
- Agent name = dimension name. ⚠ = gated (needs user authorization before dispatch). The catalog —
43
- detection signals + strategy + per-dimension artifacts — is in `.claude/rules/discovery.md`.
35
+ Agent name = dimension name. ⚠ = gated (needs user authorization before dispatch). The catalog — detection signals + strategy + per-dimension artifacts — is in `.claude/rules/discovery.md`.
44
36
 
45
37
  ---
46
38
 
@@ -48,116 +40,57 @@ detection signals + strategy + per-dimension artifacts — is in `.claude/rules/
48
40
 
49
41
  Cheap, read-only. Scope the target, grade its access, detect which dimensions it exposes.
50
42
 
51
- **0. Resolve the corpus root** — the folder this run writes into. The harness chooses it *intelligently* rather than hardcoding one: default `research/` at the repo root, but if the project already holds a discovery corpus (any folder with a prior run's `*/00-scope-verdict.md`) under another name (`recon/`, `discovery/`, `teardowns/`, `analysis/`, …) **reuse it**, and honor a folder the user names. **Confirm the chosen root in one line** before writing. Every `research/<target>/` path in this harness is the *default form* — read it as `<corpus>/<target>/`, relative to the resolved root.
43
+ **0. Resolve the corpus root** — the folder this run writes into. The harness chooses it _intelligently_ rather than hardcoding one: default `research/` at the repo root, but if the project already holds a discovery corpus (any folder with a prior run's `*/00-scope-verdict.md`) under another name (`recon/`, `discovery/`, `teardowns/`, `analysis/`, …) **reuse it**, and honor a folder the user names. **Confirm the chosen root in one line** before writing. Every `research/<target>/` path in this harness is the _default form_ — read it as `<corpus>/<target>/`, relative to the resolved root.
52
44
 
53
- 1. **Scope-feasibility gate** — run the `.claude/rules/discovery.md` Part A (scope gate) algorithm: resolve
54
- identity → ambiguity → ethics → suite-size → primitive → reachability. If the verdict isn't
55
- `accept`, **halt** (present the narrowing/redirect prompt, or refuse). Write
56
- `research/<target>/00-scope-verdict.md`.
45
+ 1. **Scope-feasibility gate** — run the `.claude/rules/discovery.md` Part A (scope gate) algorithm: resolve identity → ambiguity → ethics → suite-size → primitive → reachability. If the verdict isn't `accept`, **halt** (present the narrowing/redirect prompt, or refuse). Write `research/<target>/00-scope-verdict.md`.
57
46
  2. **Grade the access vector** (the four axes, with evidence) per `discovery` (Part B).
58
- 3. **Probe each of the 11 dimensions** (cheap signals only); mark ✅ available / ⚠️ partial /
59
- ❌ absent with evidence. An absent dimension is a finding.
60
- 4. Write `research/<target>/00-recon-plan.md` — frontmatter carries `scope:` + the `access_grade`
61
- vector; the body is the dimension-availability table + the per-dimension collection plan (warm entry
62
- points) + the gating/ethics flags.
47
+ 3. **Probe each of the 11 dimensions** (cheap signals only); mark ✅ available / ⚠️ partial / ❌ absent with evidence. An absent dimension is a finding.
48
+ 4. Write `research/<target>/00-recon-plan.md` — frontmatter carries `scope:` + the `access_grade` vector; the body is the dimension-availability table + the per-dimension collection plan (warm entry points) + the gating/ethics flags.
63
49
 
64
50
  ---
65
51
 
66
52
  ## Mode 2 — Ingestion
67
53
 
68
- Dispatch one collector per available dimension; collect exhaustively before context is lost. Every collector
69
- writes `research/<target>/dimensions/<dim>/_summary.md` (with the **provenance frontmatter** —
70
- method · confidence · completeness · gaps) + `raw/`, obeying `.claude/rules/ingestion.md`.
71
-
72
- - **Run independents in parallel** — dispatch `docs`, `packages`, `api`, `website`, `community`,
73
- `deployed-client-bundle`, `infra-backend-fingerprint`, `distribution-artifacts` together
74
- (`subagent_type='<dimension>'`, one message, multiple Agent calls). Seed each collector with **warm
75
- entry points (URLs / repos / hosts), not claimed facts** — any fact **or inference** carried from
76
- Discovery (a price, a tier name, a version — **or a derived hypothesis like "localStorage-key X ⇒
77
- backend is Y"**) is tagged `verify:may-be-stale` so the collector **re-derives it instead of anchoring**
78
- on a possibly-stale (or possibly-wrong) value. A Discovery *inference* is never seeded as a plan fact:
79
- label it a hypothesis in `00-recon-plan.md` and tag it `verify:` in the seed, so a collector that
80
- inherits it reports it hedged rather than echoing it as observed (a real run seeded an
81
- `apolloAnonId ⇒ GraphQL backend` guess that two captures then repeated before the session refuted it).
82
- Only one dimension may drive the browser at a time (see
83
- `ingestion` §7 rule 9): the parallel collectors use WebFetch/curl, leaving Chrome to `session`.
84
- - **Codebase fan-out** — dispatch `codebase`; it clones + maps + returns a per-package work-list;
85
- then the main session fans out one reader per substantial package.
86
- - **Gated dimensions** — `session` and `wire-capture` (rung ≥2) need explicit user authorization
87
- first (see `ingestion` §7). `session` follows `.claude/rules/ingestion.md` §9. When `session`
88
- is authorized, **dispatch the non-browser collectors in the background (`run_in_background`) and drive
89
- the gated browser session in the main session concurrently** — they don't contend (Chrome belongs to
90
- the main session; the collectors use WebFetch/curl), so the whole of Ingestion runs in parallel.
91
- - **Shared seam** — **seed the two shared files `dimensions/_shared/{api-path-catalog.md,
92
- feature-flags.md}` (empty, with a header) once, before the collector fan-out**; bundle/session/wire/
93
- distribution then each *append* a `source:`-tagged section to the same physical file (never their own
94
- copy). One owner dimension per static asset; a second mine of the same asset is one source, not
95
- corroboration (`ingestion` §6).
96
-
97
- Validate each return (`_summary.md` + provenance present). A `blocked`/`partial` return is recorded,
98
- not blindly re-run.
99
-
100
- - **Capability gap = a checkpoint, not a silent fallback** (`ingestion` §8). If a *preferred* capture
101
- capability is found unavailable mid-run (CDP/debugging port closed, browser MCP unreachable, a gated
102
- proxy can't be stood up) and only a **materially weaker** method remains, **pause and confirm** with
103
- the user before continuing on the fallback — naming what's unavailable and the coverage lost. (Distinct
104
- from a planned method pre-grade, which is recorded, not confirmed.)
54
+ Dispatch one collector per available dimension; collect exhaustively before context is lost. Every collector writes `research/<target>/dimensions/<dim>/_summary.md` (with the **provenance frontmatter** — method · confidence · completeness · gaps) + `raw/`, obeying `.claude/rules/ingestion.md`.
55
+
56
+ - **Run independents in parallel** — dispatch `docs`, `packages`, `api`, `website`, `community`, `deployed-client-bundle`, `infra-backend-fingerprint`, `distribution-artifacts` together (`subagent_type='<dimension>'`, one message, multiple Agent calls). Seed each collector with **warm entry points (URLs / repos / hosts), not claimed facts** — any fact **or inference** carried from Discovery (a price, a tier name, a version — **or a derived hypothesis like "localStorage-key X ⇒ backend is Y"**) is tagged `verify:may-be-stale` so the collector **re-derives it instead of anchoring** on a possibly-stale (or possibly-wrong) value. A Discovery _inference_ is never seeded as a plan fact: label it a hypothesis in `00-recon-plan.md` and tag it `verify:` in the seed, so a collector that inherits it reports it hedged rather than echoing it as observed (a real run seeded an `apolloAnonId ⇒ GraphQL backend` guess that two captures then repeated before the session refuted it). Only one dimension may drive the browser at a time (see `ingestion` §7 rule 9): the parallel collectors use WebFetch/curl, leaving Chrome to `session`.
57
+ - **Codebase fan-out** — dispatch `codebase`; it clones + maps + returns a per-package work-list; then the main session fans out one reader per substantial package.
58
+ - **Gated dimensions** — `session` and `wire-capture` (rung ≥2) need explicit user authorization first (see `ingestion` §7). `session` follows `.claude/rules/ingestion.md` §9. When `session` is authorized, **dispatch the non-browser collectors in the background (`run_in_background`) and drive the gated browser session in the main session concurrently** — they don't contend (Chrome belongs to the main session; the collectors use WebFetch/curl), so the whole of Ingestion runs in parallel.
59
+ - **Shared seam** — **seed the two shared files `dimensions/_shared/{api-path-catalog.md, feature-flags.md}` (empty, with a header) once, before the collector fan-out**; bundle/session/wire/ distribution then each _append_ a `source:`-tagged section to the same physical file (never their own copy). One owner dimension per static asset; a second mine of the same asset is one source, not corroboration (`ingestion` §6).
60
+
61
+ Validate each return (`_summary.md` + provenance present). A `blocked`/`partial` return is recorded, not blindly re-run.
62
+
63
+ - **Capability gap = a checkpoint, not a silent fallback** (`ingestion` §8). If a _preferred_ capture capability is found unavailable mid-run (CDP/debugging port closed, browser MCP unreachable, a gated proxy can't be stood up) and only a **materially weaker** method remains, **pause and confirm** with the user before continuing on the fallback — naming what's unavailable and the coverage lost. (Distinct from a planned method pre-grade, which is recorded, not confirmed.)
105
64
 
106
65
  ---
107
66
 
108
67
  ## Mode 3 — Evaluation
109
68
 
110
- Reconcile the collected dimensions into four cross-dimension rollups under `research/<target>/evaluation/`, plus
111
- the run `README.md`, **weighting every claim by how it was obtained**. Follow
112
- `.claude/rules/evaluation.md`: read each dimension's provenance frontmatter first; anchor +
113
- provenance-tag every claim `(api: raw/endpoint-catalog.md · openapi-verbatim · high)`; weight
114
- (max-of-sources, promote one band only on ≥2 *independent* dimensions, never average); present
115
- high→fact, low/single-source→tentative, conflict→flagged. The four rollups: `technology-architecture`,
116
- `product-features`, `data-model-api-surface`, `competitive-positioning`.
69
+ Reconcile the collected dimensions into four cross-dimension rollups under `research/<target>/evaluation/`, plus the run `README.md`, **weighting every claim by how it was obtained**. Follow `.claude/rules/evaluation.md`: read each dimension's provenance frontmatter first; anchor + provenance-tag every claim `(api: raw/endpoint-catalog.md · openapi-verbatim · high)`; weight (max-of-sources, promote one band only on ≥2 _independent_ dimensions, never average); present high→fact, low/single-source→tentative, conflict→flagged. The four rollups: `technology-architecture`, `product-features`, `data-model-api-surface`, `competitive-positioning`.
117
70
 
118
71
  ---
119
72
 
120
73
  ## Mode 4 — Self-correction (the run corrects itself; the harness improves only on approval)
121
74
 
122
- Mode 4 is a loop, not a one-shot. Follow `.claude/rules/self-correction.md` — it carries the
123
- **defect checklist** (A), the **measurement rubric** (B), and the **iterate-or-propose loop** (C).
124
- Three stages, driven by the **main session** (not a sub-agent):
125
-
126
- 1. **Inspect** the finished run (scope verdict, plan, every dimension `_summary.md`, the rollups)
127
- against the **built-in defect checklist** → a concrete list of *behavioral defects* in the prior
128
- steps (mode · defect · severity · evidence anchor · within-run|harness-changing).
129
- 2. **Measure** the run against the **rubric** → a `/100` score + vibe band. Always — every iteration,
130
- including the final one; the self-correcting step ALWAYS evaluates the current run.
131
- 3. **Iterate-or-propose**, splitting each defect by one test — *does the fix require editing a
132
- rule or an agent?*
133
- - **No → within-run:** the main session **auto-iterates** (no approval), re-running the cheapest
134
- affected Mode 1–3 steps on THIS target and re-measuring each round. The loop is **capable of ≥5
135
- iterations** and **stops on regression** (a clear score drop → revert to the best prior run),
136
- **convergence** (no within-run defects left), or the cap. **Read-only / no-cost only** — any fix
137
- needing a Pass-2 / credit-spend / state-change / credential action goes through the
138
- explicit-confirmation gate, never the auto-loop.
139
- - **Yes → harness-changing:** accumulate into `research/<target>/04-self-correction-proposal.md`
140
- (the shape is in `self-correction.md`: run measurement · iteration ledger · defect list ·
141
- within-run fixes applied · the approval-gated harness-change table).
142
-
143
- **Approval gate (unchanged):** present the harness-change table + the iteration ledger and STOP —
144
- nothing in the harness is applied. The user accepts / rejects / defers per item. Then the **main
145
- session** (not a sub-agent) applies accepted items, flips each row to APPLIED, and logs the change.
146
- Promote only what the *next, different* target would also hit; prefer additive edits; structural edits
147
- are flagged, never auto-applied. (For a batch, additionally roll up into a cross-target synthesis that
148
- promotes only patterns ≥2 *independent* targets hit — a homogeneous batch's 6/6 is one vote, not six.)
75
+ Mode 4 is a loop, not a one-shot. Follow `.claude/rules/self-correction.md` — it carries the **defect checklist** (A), the **measurement rubric** (B), and the **iterate-or-propose loop** (C). Three stages, driven by the **main session** (not a sub-agent):
76
+
77
+ 1. **Inspect** the finished run (scope verdict, plan, every dimension `_summary.md`, the rollups) against the **built-in defect checklist** → a concrete list of _behavioral defects_ in the prior steps (mode · defect · severity · evidence anchor · within-run|harness-changing).
78
+ 2. **Measure** the run against the **rubric** → a `/100` score + vibe band. Always — every iteration, including the final one; the self-correcting step ALWAYS evaluates the current run.
79
+ 3. **Iterate-or-propose**, splitting each defect by one test — _does the fix require editing a rule or an agent?_
80
+ - **No → within-run:** the main session **auto-iterates** (no approval), re-running the cheapest affected Mode 1–3 steps on THIS target and re-measuring each round. The loop is **capable of ≥5 iterations** and **stops on regression** (a clear score drop → revert to the best prior run), **convergence** (no within-run defects left), or the cap. **Read-only / no-cost only** — any fix needing a Pass-2 / credit-spend / state-change / credential action goes through the explicit-confirmation gate, never the auto-loop.
81
+ - **Yes → harness-changing:** accumulate into `research/<target>/04-self-correction-proposal.md` (the shape is in `self-correction.md`: run measurement · iteration ledger · defect list · within-run fixes applied · the approval-gated harness-change table).
82
+
83
+ **Approval gate (unchanged):** present the harness-change table + the iteration ledger and STOP — nothing in the harness is applied. The user accepts / rejects / defers per item. Then the **main session** (not a sub-agent) applies accepted items, flips each row to APPLIED, and logs the change. Promote only what the _next, different_ target would also hit; prefer additive edits; structural edits are flagged, never auto-applied. (For a batch, additionally roll up into a cross-target synthesis that promotes only patterns ≥2 _independent_ targets hit — a homogeneous batch's 6/6 is one vote, not six.)
149
84
 
150
85
  ---
151
86
 
152
87
  ## Ethics (non-negotiable)
153
88
 
154
- For spec-writing, integration planning, and competitive analysis — **not** credential theft,
155
- rate-limit bypass, or scraping. Full rules: `.claude/rules/ingestion.md` §7.
89
+ For spec-writing, integration planning, and competitive analysis — **not** credential theft, rate-limit bypass, or scraping. Full rules: `.claude/rules/ingestion.md` §7.
156
90
 
157
91
  - **Never enter credentials.** The user logs in; `session` and `wire-capture` rung 3 are opt-in.
158
92
  - **Redact every secret before writing `raw/`.** Cookies/tokens/JWT-signatures/API-keys never hit disk.
159
- - **wire-capture** climbs the 3-rung ladder (browser-tap → HAR → mitmproxy); rung 3 is user-run,
160
- first-party traffic only. Wireshark is not used (TLS ciphertext).
93
+ - **wire-capture** climbs the 3-rung ladder (browser-tap → HAR → mitmproxy); rung 3 is user-run, first-party traffic only. Wireshark is not used (TLS ciphertext).
161
94
  - **Confirm before any state change or cost.** **No destructive actions, no exfiltration.** Respect TOS/robots.
162
95
 
163
96
  ---
@@ -176,5 +109,4 @@ Output lives under the **resolved corpus root** (default `research/`; chosen per
176
109
  └── 04-self-correction-proposal.md ← Self-correction: proposed harness fixes (approval-gated)
177
110
  ```
178
111
 
179
- Cloned repos live in `source/<target>/`. Provenance is the "self-aware" layer: each collector records
180
- *how* it was obtained; Evaluation weights claims by it. Detailed shapes live in the rules.
112
+ Cloned repos live in `source/<target>/`. Provenance is the "self-aware" layer: each collector records _how_ it was obtained; Evaluation weights claims by it. Detailed shapes live in the rules.