dreamcontext 0.5.4 → 0.7.0

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 (108) hide show
  1. package/LICENSE +201 -21
  2. package/NOTICE +7 -0
  3. package/README.md +79 -13
  4. package/agents/sleep-product.md +48 -10
  5. package/agents/sleep-state.md +43 -22
  6. package/agents/sleep-tasks.md +62 -9
  7. package/dist/agents/sleep-product.md +48 -10
  8. package/dist/agents/sleep-state.md +43 -22
  9. package/dist/agents/sleep-tasks.md +62 -9
  10. package/dist/dashboard/assets/{BrainCanvas3D-1HMiA14F.js → BrainCanvas3D-lFgJbbhZ.js} +1 -1
  11. package/dist/dashboard/assets/{_baseUniq-C7pfRmXz.js → _baseUniq-BpANgc_i.js} +1 -1
  12. package/dist/dashboard/assets/{arc-B5x_GF9Q.js → arc-CX32Jm7E.js} +1 -1
  13. package/dist/dashboard/assets/{architectureDiagram-Q4EWVU46-CWmjaqno.js → architectureDiagram-Q4EWVU46-ARASlGxO.js} +1 -1
  14. package/dist/dashboard/assets/{blockDiagram-DXYQGD6D-B7SyUIdV.js → blockDiagram-DXYQGD6D-BBvsYm9E.js} +1 -1
  15. package/dist/dashboard/assets/{c4Diagram-AHTNJAMY-OeJBWXHU.js → c4Diagram-AHTNJAMY-ChSUfXR9.js} +1 -1
  16. package/dist/dashboard/assets/channel-w_Bp182N.js +1 -0
  17. package/dist/dashboard/assets/{chunk-4BX2VUAB-2Oop1B0M.js → chunk-4BX2VUAB-COHoVEpt.js} +1 -1
  18. package/dist/dashboard/assets/{chunk-4TB4RGXK-Bh7qSu_X.js → chunk-4TB4RGXK-DKJFLaTC.js} +1 -1
  19. package/dist/dashboard/assets/{chunk-55IACEB6-gNeHRO_i.js → chunk-55IACEB6-CKZPWZRu.js} +1 -1
  20. package/dist/dashboard/assets/{chunk-EDXVE4YY-BRniAH53.js → chunk-EDXVE4YY-k1y4mGUJ.js} +1 -1
  21. package/dist/dashboard/assets/{chunk-FMBD7UC4-B5r8U2gJ.js → chunk-FMBD7UC4-ixXe5R10.js} +1 -1
  22. package/dist/dashboard/assets/{chunk-OYMX7WX6-Dd1c17fm.js → chunk-OYMX7WX6-NDFap7xg.js} +1 -1
  23. package/dist/dashboard/assets/{chunk-QZHKN3VN-BIw-OdTn.js → chunk-QZHKN3VN-vY0UpHjB.js} +1 -1
  24. package/dist/dashboard/assets/{chunk-YZCP3GAM-Dl9MlwCW.js → chunk-YZCP3GAM-yztvsKR-.js} +1 -1
  25. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-CcQxcqy9.js +1 -0
  26. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-CcQxcqy9.js +1 -0
  27. package/dist/dashboard/assets/clone-_znoR_ci.js +1 -0
  28. package/dist/dashboard/assets/{cose-bilkent-S5V4N54A-DlrROH5K.js → cose-bilkent-S5V4N54A-DKXM5Fh5.js} +1 -1
  29. package/dist/dashboard/assets/{dagre-KV5264BT-B0GpPXKL.js → dagre-KV5264BT-DN1Nlsmy.js} +1 -1
  30. package/dist/dashboard/assets/{diagram-5BDNPKRD-BBYcDW2Z.js → diagram-5BDNPKRD-DnoJFRqR.js} +1 -1
  31. package/dist/dashboard/assets/{diagram-G4DWMVQ6-BxHxugdp.js → diagram-G4DWMVQ6-CF1_jTNI.js} +1 -1
  32. package/dist/dashboard/assets/{diagram-MMDJMWI5-C9Jc19Wo.js → diagram-MMDJMWI5-D4-bZZEt.js} +1 -1
  33. package/dist/dashboard/assets/{diagram-TYMM5635-Vmo5GAAU.js → diagram-TYMM5635-al8RqVgf.js} +1 -1
  34. package/dist/dashboard/assets/{erDiagram-SMLLAGMA-pskr9x-V.js → erDiagram-SMLLAGMA-MEcC0rwO.js} +1 -1
  35. package/dist/dashboard/assets/{flowDiagram-DWJPFMVM-B1D7Ky0W.js → flowDiagram-DWJPFMVM-DCLyNpW8.js} +1 -1
  36. package/dist/dashboard/assets/{ganttDiagram-T4ZO3ILL-BVJZZV1M.js → ganttDiagram-T4ZO3ILL-DfEvbbJK.js} +1 -1
  37. package/dist/dashboard/assets/{gitGraphDiagram-UUTBAWPF-BiOGN6We.js → gitGraphDiagram-UUTBAWPF-C_YozdVL.js} +1 -1
  38. package/dist/dashboard/assets/{graph-D58deEXr.js → graph-DpIXS1G1.js} +1 -1
  39. package/dist/dashboard/assets/index-Bo5CUa_M.js +480 -0
  40. package/dist/dashboard/assets/index-DrqurW1c.css +1 -0
  41. package/dist/dashboard/assets/{infoDiagram-42DDH7IO-DgJYg1X1.js → infoDiagram-42DDH7IO-AdT6kjzj.js} +1 -1
  42. package/dist/dashboard/assets/{ishikawaDiagram-UXIWVN3A-arJgr-8P.js → ishikawaDiagram-UXIWVN3A-B0_9IZVO.js} +1 -1
  43. package/dist/dashboard/assets/{journeyDiagram-VCZTEJTY-B3DCvb8p.js → journeyDiagram-VCZTEJTY-BveNBswQ.js} +1 -1
  44. package/dist/dashboard/assets/{kanban-definition-6JOO6SKY-B--dN6Ma.js → kanban-definition-6JOO6SKY-CFI8j4jR.js} +1 -1
  45. package/dist/dashboard/assets/{layout-z2qEbZWC.js → layout-DI7XjZy1.js} +1 -1
  46. package/dist/dashboard/assets/{linear-BQu1dwrM.js → linear-CSjp56iw.js} +1 -1
  47. package/dist/dashboard/assets/{min-DkF5b2sh.js → min-pAGUJmEC.js} +1 -1
  48. package/dist/dashboard/assets/{mindmap-definition-QFDTVHPH-Bw04koyq.js → mindmap-definition-QFDTVHPH-C2mBnknr.js} +1 -1
  49. package/dist/dashboard/assets/{pieDiagram-DEJITSTG-vNqz64o8.js → pieDiagram-DEJITSTG-i_phWDqD.js} +1 -1
  50. package/dist/dashboard/assets/{quadrantDiagram-34T5L4WZ-TuVP5Gi6.js → quadrantDiagram-34T5L4WZ-Dv7TGJjw.js} +1 -1
  51. package/dist/dashboard/assets/{requirementDiagram-MS252O5E-D3mS8_ke.js → requirementDiagram-MS252O5E-CB2Jl-O5.js} +1 -1
  52. package/dist/dashboard/assets/{sankeyDiagram-XADWPNL6-BmVRers6.js → sankeyDiagram-XADWPNL6-DxCoN-EI.js} +1 -1
  53. package/dist/dashboard/assets/{sequenceDiagram-FGHM5R23-CTYCgk5P.js → sequenceDiagram-FGHM5R23-BeZyaehJ.js} +1 -1
  54. package/dist/dashboard/assets/{stateDiagram-FHFEXIEX-DNbP2aCg.js → stateDiagram-FHFEXIEX-D3AjQzD1.js} +1 -1
  55. package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-Ci9v--xK.js +1 -0
  56. package/dist/dashboard/assets/{timeline-definition-GMOUNBTQ-DKHJd4z8.js → timeline-definition-GMOUNBTQ-3l_8RFUg.js} +1 -1
  57. package/dist/dashboard/assets/{vennDiagram-DHZGUBPP-ChotNMNq.js → vennDiagram-DHZGUBPP-2QiY25JD.js} +1 -1
  58. package/dist/dashboard/assets/{wardley-RL74JXVD-Dmo2_ksP.js → wardley-RL74JXVD-DNLmFofz.js} +1 -1
  59. package/dist/dashboard/assets/{wardleyDiagram-NUSXRM2D-Z6Wbiv2H.js → wardleyDiagram-NUSXRM2D-BI0tupiS.js} +1 -1
  60. package/dist/dashboard/assets/{xychartDiagram-5P7HB3ND-BJa0AHtN.js → xychartDiagram-5P7HB3ND-CghXPE7_.js} +1 -1
  61. package/dist/dashboard/index.html +2 -2
  62. package/dist/dashboard/media/README.md +29 -0
  63. package/dist/dashboard/media/brain-hero.png +0 -0
  64. package/dist/dashboard/media/brain.mp4 +0 -0
  65. package/dist/dashboard/media/brain.webm +0 -0
  66. package/dist/dashboard/media/shot-disabled.png +0 -0
  67. package/dist/dashboard/media/shot-enabled.png +0 -0
  68. package/dist/index.js +3352 -2035
  69. package/dist/skill-packs/catalog.json +44 -0
  70. package/dist/skill-packs/excalidraw/SKILL.md +202 -0
  71. package/dist/skill-packs/excalidraw/examples/hello.spec.json +14 -0
  72. package/dist/skill-packs/excalidraw/examples/sample.png +0 -0
  73. package/dist/skill-packs/excalidraw/examples/style_board.js +31 -0
  74. package/dist/skill-packs/excalidraw/package.json +5 -0
  75. package/dist/skill-packs/excalidraw/reference/format.md +93 -0
  76. package/dist/skill-packs/excalidraw/scripts/build_excalidraw.js +357 -0
  77. package/dist/skill-packs/excalidraw/scripts/lib/fractional-indexing.LICENSE +121 -0
  78. package/dist/skill-packs/excalidraw/scripts/lib/fractional-indexing.js +311 -0
  79. package/dist/skill-packs/excalidraw/scripts/lib/imagesize.js +65 -0
  80. package/dist/skill-packs/excalidraw/scripts/lib/style.js +130 -0
  81. package/dist/skill-packs/video-watching/SKILL.md +192 -0
  82. package/dist/skill-packs/video-watching/scripts/build_frame_index.py +146 -0
  83. package/dist/skill-packs/video-watching/scripts/transcribe.sh +229 -0
  84. package/dist/templates/init/data-structures/default.md +26 -24
  85. package/package.json +4 -2
  86. package/skill/SKILL.md +31 -12
  87. package/skill-packs/catalog.json +44 -0
  88. package/skill-packs/excalidraw/SKILL.md +202 -0
  89. package/skill-packs/excalidraw/examples/hello.spec.json +14 -0
  90. package/skill-packs/excalidraw/examples/sample.png +0 -0
  91. package/skill-packs/excalidraw/examples/style_board.js +31 -0
  92. package/skill-packs/excalidraw/package.json +5 -0
  93. package/skill-packs/excalidraw/reference/format.md +93 -0
  94. package/skill-packs/excalidraw/scripts/build_excalidraw.js +357 -0
  95. package/skill-packs/excalidraw/scripts/lib/fractional-indexing.LICENSE +121 -0
  96. package/skill-packs/excalidraw/scripts/lib/fractional-indexing.js +311 -0
  97. package/skill-packs/excalidraw/scripts/lib/imagesize.js +65 -0
  98. package/skill-packs/excalidraw/scripts/lib/style.js +130 -0
  99. package/skill-packs/video-watching/SKILL.md +192 -0
  100. package/skill-packs/video-watching/scripts/build_frame_index.py +146 -0
  101. package/skill-packs/video-watching/scripts/transcribe.sh +229 -0
  102. package/dist/dashboard/assets/channel-CbuTKKsM.js +0 -1
  103. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-HXl3A_sM.js +0 -1
  104. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-HXl3A_sM.js +0 -1
  105. package/dist/dashboard/assets/clone-NKHOtdi8.js +0 -1
  106. package/dist/dashboard/assets/index-DK_2-eWY.css +0 -1
  107. package/dist/dashboard/assets/index-Ds-JXWtr.js +0 -476
  108. package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-CfN6kjo8.js +0 -1
@@ -33,9 +33,8 @@ Identity is sacred — a fresh session must immediately understand who the agent
33
33
  | You touch | You don't touch |
34
34
  |---|---|
35
35
  | `core/0-4.*`, `core/6.*` files (Edit, surgical) | task files (sleep-tasks owns) |
36
- | `core/data-structures/<product>.md` (one per product; `default.md` for single-product) | knowledge files (you flag staleness; sleep-product writes) |
37
- | `dreamcontext core changelog add` | feature PRDs (sleep-product owns) |
38
- | `dreamcontext core releases {add,update,active,list,show}` | |
36
+ | `dreamcontext core changelog add` | knowledge files incl. `knowledge/data-structures/<product>.md` (sleep-product owns + writes; you only flag staleness) |
37
+ | `dreamcontext core releases {add,update,active,list,show}` | feature PRDs (sleep-product owns) |
39
38
  | `dreamcontext trigger add` (context-dependent reminders) | |
40
39
 
41
40
  ## Inputs
@@ -89,6 +88,7 @@ dreamcontext core changelog add \
89
88
  --summary "<≤200 char one-liner: what shipped, scannable in snapshot>" \
90
89
  --description "<one paragraph: what changed and why; mention key file/symbol where helpful>" \
91
90
  --references "commit:<sha>,file:<path>,knowledge:<slug>,feature:<slug>,task:<slug>,url:<href>" \
91
+ [--authors "<person-a,person-b>"] \
92
92
  [--supersedes "<date>|<scope>"] \
93
93
  $([ "$BREAKING" = "true" ] && echo "--breaking")
94
94
  ```
@@ -101,6 +101,8 @@ dreamcontext core changelog add \
101
101
 
102
102
  **Supersedes field**: optional, only when a later entry reverses or replaces an earlier one (e.g., a "default-on" flip of a previously "opt-in" flag, or a v0.4 file path being deprecated). Use coarse keys like `"2026-05-23|memory"` (date + scope) — disambiguators only matter when multiple entries share the same date+scope, in which case fall back to the position-from-top index. Most entries do NOT supersede anything; leave the field absent.
103
103
 
104
+ **Authors field (multi-person projects only)**: optional, attributes the change to the person(s) who drove it. Set it ONLY when the project is multi-person (`.config.json` `people` roster has >1 entry — see Pass B.5). Pass comma-separated kebab-case slugs matching the roster (`--authors "mehmet,ada"`). Determine attribution from the same signals Pass B.5 uses (git `%an` on the commits the entry clusters, self-identification in the session transcript). When a single change was driven by distinct people across clusters, attribute each `dreamcontext core changelog add` invocation to its own author(s). Single-person projects: OMIT `--authors` entirely — output stays byte-identical to today. Authors are excluded from the changelog dedup fingerprint, so adding them never re-opens an already-released entry.
105
+
104
106
  #### A3. Releases — surface readiness, never auto-release
105
107
 
106
108
  ```bash
@@ -142,21 +144,20 @@ Be conservative. The default is **no change**. Only update when a pattern is rec
142
144
 
143
145
  #### B0b. Single-observation gate (code-reality files)
144
146
 
145
- Applies to: `3.style_guide_and_branding.md`, `4.tech_stack.md`, files under `core/data-structures/`, and `6.system_flow.md`.
147
+ Applies to: `3.style_guide_and_branding.md`, `4.tech_stack.md`, and `6.system_flow.md`. (Schema/data-model changes are the same kind of single-observation signal, but they now live in `knowledge/data-structures/` **sleep-product** owns that write; flag it for them rather than writing it yourself.)
146
148
 
147
- These files describe code reality, not user preferences. A single session adding/removing a dependency, schema, route, or workflow step MUST be reflected in the same cycle — no pattern repetition required. If the diff or transcript shows the change happened, write it.
149
+ These files describe code reality, not user preferences. A single session adding/removing a dependency, route, or workflow step MUST be reflected in the same cycle — no pattern repetition required. If the diff or transcript shows the change happened, write it.
148
150
 
149
151
  Examples that trigger an immediate write:
150
152
  - A new dependency appears in `package.json` / lockfile → `4.tech_stack.md`.
151
- - A schema change, new table, or new model → relevant file under `core/data-structures/`.
153
+ - A schema change, new table, or new model → flag for **sleep-product** to write `knowledge/data-structures/<product>.md`.
152
154
  - A new route, hook, or system-flow step → `6.system_flow.md`.
153
155
  - A new color token, font, or design primitive → `3.style_guide_and_branding.md`.
154
156
 
155
- **Multi-product routing.** If the active task frontmatter has `product: X`, route any tech_stack or data_structures observation to the matching product's file:
157
+ **Multi-product routing.** If the active task frontmatter has `product: X`, route any tech_stack observation to the matching product's file:
156
158
  - Tech stack scoped to product X → still goes in `4.tech_stack.md` but tagged with the product label inline (single-file convention); if a project-specific convention emerges (per-product tech stacks), revisit.
157
- - Data structures → `core/data-structures/<X>.md`. Create the file if missing.
158
159
 
159
- Otherwise (no `product:` field, single-product project), data structures changes go to `core/data-structures/default.md`.
160
+ Data-structure observations are routed by **sleep-product** to `knowledge/data-structures/<X>.md` (or `default.md`) — flag them for sleep-product, don't write them here.
160
161
 
161
162
  #### B1. Signal → file routing
162
163
 
@@ -167,7 +168,7 @@ Otherwise (no `product:` field, single-product project), data structures changes
167
168
  | New project constraint or warning | `0.soul.md` | Rules / Warnings | two-observation |
168
169
  | Technical decision worth preserving | `2.memory.md` | Technical Decisions | two-observation |
169
170
  | Stack/dependency change | `4.tech_stack.md` | | single-observation |
170
- | Schema / data-model change | `core/data-structures/<product>.md` (or `default.md`) | | single-observation |
171
+ | Schema / data-model change | flag for **sleep-product** → `knowledge/data-structures/<product>.md` (or `default.md`) | | single-observation |
171
172
  | System flow / hook count change | `6.system_flow.md` | | single-observation |
172
173
  | Style/branding token change | `3.style_guide_and_branding.md` | | single-observation |
173
174
 
@@ -181,22 +182,38 @@ dreamcontext trigger add "<when>" "<remind>" # context-dependent reminders
181
182
 
182
183
  Cross-domain catches from your own changelog pass land here naturally — if you wrote a `feat` entry whose description revealed a preference enforced twice, write it into `1.user.md` in the same cycle (no flagging needed; you own both files).
183
184
 
184
- #### B2. Legacy migration `5.data_structures.sql` `data-structures/<product>.md`
185
+ ### Pass B.5People detection (multi-person awareness)
186
+
187
+ dreamcontext defaults to single-person. When you have **corroborated evidence** that more than one human works in this project, record the roster so changelogs/tasks/memory can attribute work per person. This is **AI-driven detection** — there is no manual toggle and no persisted `multiPerson` flag (multi-person status is DERIVED from `people.length > 1`).
188
+
189
+ **Detection gate — require ≥2 corroborated signals** before flipping a project to multi-person (this gate prevents false positives; one weak signal is never enough):
185
190
 
186
- On every cycle, check for the legacy file:
191
+ - **Self-identification in user turns** — a person names themselves or another teammate ("this is Ada", "Mehmet asked me to…", "I'm covering for Lina").
192
+ - **Distinct git authors since the epoch** — `git log --since="$CUTOFF" --format='%an <%ae>' | sort -u` returns more than one real human author (ignore bots/CI like `github-actions`, `dependabot`).
193
+ - **Distinct voice / handoff** — the transcript shows a clear authorship handoff or a different working style/voice than the established user.
187
194
 
188
195
  ```bash
189
- LEGACY=_dream_context/core/5.data_structures.sql
190
- NEW_DEFAULT=_dream_context/core/data-structures/default.md
191
- if [ -f "$LEGACY" ] && [ ! -f "$NEW_DEFAULT" ]; then
192
- mkdir -p _dream_context/core/data-structures
193
- cp "$LEGACY" "$NEW_DEFAULT"
194
- # do NOT delete the legacy file here — leave it for WS-1 manifest cleanup (if system-installed)
195
- # or the user to remove manually. Note the migration in your report.
196
- fi
196
+ # Signal 2: distinct human git authors since the sleep epoch
197
+ git log --since="$CUTOFF" --format='%an' | sort -u
198
+ # Read the existing roster FIRST you append, you never overwrite.
199
+ jq -r '.people // [] | join(", ")' _dream_context/state/.config.json 2>/dev/null
197
200
  ```
198
201
 
199
- Report the migration in your output so the user knows the new location. Do not delete the legacy file yourself.
202
+ When the gate is met:
203
+
204
+ 1. **Additive union to the roster — never overwrite.** Read the current `people` array first, then write the union (existing ∪ newly observed) back. Use kebab-case display-name slugs (`mehmet`, `ada`). A previously recorded person is NEVER dropped because they were quiet this cycle.
205
+
206
+ ```bash
207
+ dreamcontext config # confirm current roster, then edit state/.config.json people[] = union
208
+ ```
209
+
210
+ (There is no CLI writer for `people` yet — edit `_dream_context/state/.config.json` directly with Edit, preserving every existing key. Do NOT add a `multiPerson` key; it is derived.)
211
+
212
+ 2. **Refresh `## People` in `1.user.md`** to enumerate the full roster. Use the `ensurePeopleSection(userMd, people)` helper semantics (idempotent insert/replace of a `## People` block; one bullet per person). This is a no-op for single-person projects.
213
+
214
+ 3. **Attribute this cycle's changelog entries** — re-run Pass A's `dreamcontext core changelog add` with `--authors "<slugs>"` for each entry, attributing it to the person(s) who drove that cluster (Pass A and this pass share the git-author analysis).
215
+
216
+ **Single-person projects (gate NOT met): this entire pass is a NO-OP.** Do not create a roster, do not add a `## People` section, do not pass `--authors`. A solo project's `.config.json`, `1.user.md`, and changelog output must stay byte-identical to today. The cost of a false positive (spuriously attributing a solo user's work to a phantom teammate) is high — stay conservative.
200
217
 
201
218
  ### Pass C — Anti-bloat sweep + knowledge staleness flags
202
219
 
@@ -245,6 +262,10 @@ You do **not** edit knowledge files. Produce flags for `sleep-product` to act on
245
262
  - 4.tech_stack.md: untouched
246
263
  - Triggers added: 0
247
264
 
265
+ ### People (multi-person detection)
266
+ - Roster: single-person (no multi-person signals this cycle) — no changes
267
+ | OR: detected 2 humans (signals: 2 distinct git authors + self-id in transcript) → roster updated mehmet, ada (additive union; ada appended, mehmet preserved); `## People` refreshed in 1.user.md; 3 changelog entries attributed via --authors
268
+
248
269
  ### Anti-bloat & staleness
249
270
  - 2.memory.md at 287 lines — under ceiling, no extraction needed
250
271
  - Knowledge staleness flags (for sleep-product):
@@ -259,7 +280,7 @@ You do **not** edit knowledge files. Produce flags for `sleep-product` to act on
259
280
  1. **Be exhaustive on the diary.** Every meaningful change gets a changelog entry. Skipping is the failure state.
260
281
  2. **Conservative on identity (preferences & decisions).** No-op is the right answer most cycles for `1.user.md` and `2.memory.md`.
261
282
  3. **Two-observation gate for `1.user.md` / `2.memory.md`.** One observation is data; two is a pattern. Don't write a preference or decision from a single mention.
262
- 3a. **Single-observation gate for code-reality files** (`3.*`, `4.*`, `core/data-structures/*`, `6.*`). A diff that adds a dependency, schema, route, or design primitive MUST be reflected in the same cycle. These files mirror code, not opinion.
283
+ 3a. **Single-observation gate for code-reality files** (`3.*`, `4.*`, `6.*`). A diff that adds a dependency, route, or design primitive MUST be reflected in the same cycle. These files mirror code, not opinion. (Schema/data-model changes are the same kind of signal but live in `knowledge/data-structures/` — flag them for **sleep-product**.)
263
284
  4. **Cluster commits, don't enumerate.** Logical groupings beat 1-commit-per-entry.
264
285
  5. **Cover uncommitted work.** Don't wait for the user to commit.
265
286
  6. **Never auto-release.** Surface readiness; the user decides.
@@ -49,8 +49,41 @@ Also read `_dream_context/state/.sleep.json` directly for `sessions[].last_assis
49
49
 
50
50
  For each session:
51
51
 
52
- - **Has `task_slugs`** → those are the task(s) to update.
53
- - **No `task_slugs`** → check `last_assistant_message`, the user hint in the brief, and bookmark messages for a task name. If significant work has no matching task, **create one**:
52
+ - **Has `task_slugs`** → those are the task(s) to update. Go to step 3.
53
+ - **No `task_slugs`** → check `last_assistant_message`, the user hint in the brief, and bookmark messages for what the work was about.
54
+
55
+ **Before creating anything, dedup against existing tasks.** Duplicate tasks — and tasks that are really just a smaller slice of one that already exists — are the #1 consolidation failure mode. A "much smaller piece" of an existing task is **never** its own task. Recall by topic and scan the active list first:
56
+
57
+ ```bash
58
+ dreamcontext memory recall "<topic / feature / area>" --types task
59
+ dreamcontext tasks list --status in_progress
60
+ dreamcontext tasks list --status in_review
61
+ ```
62
+
63
+ Then decide with this rubric — **default to folding in, not forking a new task**:
64
+
65
+ | The session's work is… | Action |
66
+ |---|---|
67
+ | A **smaller piece, sub-step, or follow-up** of a task that already exists (same feature/area, narrower scope) | **Do NOT create a task.** Fold it into the existing one (see below). |
68
+ | The **same work** as an existing task, observed again | Update that task (step 3). No new task. |
69
+ | A **genuinely separate concern** — a different feature/area/deliverable, not a slice of an existing task | Create a new task (below). |
70
+
71
+ **Folding a smaller piece into an existing task** (the case the system keeps getting wrong):
72
+
73
+ 1. If the existing task's scope grew to include this work, **broaden its title/scope** — Edit the frontmatter `description:` (the one-line scope) and the `## Why` so the header reflects the now-wider scope. Don't leave a stale, too-narrow title with the new work buried only in the changelog. (Renaming the slug/`name:` is usually unnecessary and breaks links — only do it if the scope fundamentally changed identity.)
74
+ 2. Add the new work as concrete **sub-items in the body**, not a new file:
75
+
76
+ ```bash
77
+ dreamcontext tasks insert <slug> user_stories "<as a … I want …>"
78
+ dreamcontext tasks insert <slug> acceptance_criteria "<testable criterion>"
79
+ dreamcontext tasks insert <slug> notes "<follow-up / smaller piece>"
80
+ ```
81
+
82
+ 3. Tick/extend the Workflow Mermaid nodes if the task has them.
83
+
84
+ **Sub-tasks (`parent_task`) are for genuinely large decomposition only** — an epic that legitimately splits into separable deliverables. Do not spawn a child task for a slice that fits as a user story or acceptance criterion in the parent. When in doubt, fold in.
85
+
86
+ **Create a new task only when the rubric says "separate concern":**
54
87
 
55
88
  ```bash
56
89
  # Ensure an active planning version exists (orchestrator should have done this; verify)
@@ -63,7 +96,23 @@ dreamcontext tasks create "<descriptive-slug>" --status in_progress --priority m
63
96
  --description "<one-line scope>"
64
97
  ```
65
98
 
66
- Untracked work is invisible to future sessions. Always link.
99
+ Untracked, genuinely-separate work is invisible to future sessions always link it. But a smaller slice of existing work belongs *inside* that task, never in a duplicate.
100
+
101
+ ### 2.5. Person attribution (multi-person projects only)
102
+
103
+ When the project's `.config.json` `people` array has **>1 entry**, the person responsible for a task's progress this cycle must be recorded as a `person:<slug>` tag in the task's frontmatter `tags` array. Slug is kebab-case matching the roster (e.g., `person:mehmet`, `person:ada`). Determine attribution from the same signals sleep-state uses for Pass B.5 (git `%an` on the commits, self-identification in the session transcript).
104
+
105
+ ```bash
106
+ # Read the current roster
107
+ jq -r '.people // [] | join(", ")' _dream_context/state/.config.json 2>/dev/null
108
+ ```
109
+
110
+ - **New task**: pass `--person <name>` to `dreamcontext tasks create` (the CLI injects a `person:<slug>` tag automatically).
111
+ - **Existing task**: add the tag directly via Edit on the task frontmatter `tags:` array, or via `dreamcontext tasks insert`.
112
+
113
+ When the person is already tagged on the task, no action is needed — the tag is additive. Do not remove a previously-set `person:` tag for a person who was quiet this cycle; they remain attributed for prior work.
114
+
115
+ **Single-person projects (`.config.json` `people` has 0 or 1 entry): this step is a NO-OP.** Never inject a `person:` tag on a solo project. The output must stay byte-identical to today.
67
116
 
68
117
  ### 3. Log progress AND reconcile the body — both required
69
118
 
@@ -118,8 +167,10 @@ If every task linked to the active version is `completed` (or only `in_review` r
118
167
  ```
119
168
  ## sleep-tasks report
120
169
  - Updated: <slug> (in_progress → in_review, "<reason>"), <slug> (logged)
121
- - Created: <slug> (status: in_progress, attached to vX.Y.Z)
170
+ - Folded in (no new task): <existing-slug> broadened scope + added 2 user stories / 1 criterion for <smaller-piece> instead of forking a duplicate
171
+ - Created: <slug> (status: in_progress, attached to vX.Y.Z) — genuinely separate concern
122
172
  - Body reconciled: <slug> (dropped phase 1 from User Stories; replaced Technical Details auth section)
173
+ - Person attribution: <slug> tagged person:ada (multi-person project, ada drove this cycle's work) | OR: single-person project — no person tags injected
123
174
  - Version readiness: vX.Y.Z — 4/5 tasks ready for review
124
175
  - Cross-domain mentions: <slug> includes a memory-worthy decision about JWT — flagging for sleep-state
125
176
  - Skipped: <session_id> had no actionable task signal
@@ -127,8 +178,10 @@ If every task linked to the active version is `completed` (or only `in_review` r
127
178
 
128
179
  ## Rules
129
180
 
130
- 1. **Body = current truth, Changelog = history.** Don't let the body lag behind decisions.
131
- 2. **Never auto-complete.** Bump to `in_review`.
132
- 3. **Always attach to a planning version.** No orphan work.
133
- 4. **Stay in your lane.** If you spot non-task work worth preserving, flag it — don't write it.
134
- 5. **CLI first** for status/log/insert; **Edit** for surgical body reconciliation.
181
+ 1. **Dedup before creating.** Recall first; fold a smaller slice into the task that already covers it — broaden its title + insert sub-items — instead of forking a duplicate or a needless sub-task. A new task is only for a genuinely separate concern.
182
+ 2. **Body = current truth, Changelog = history.** Don't let the body lag behind decisions.
183
+ 3. **Never auto-complete.** Bump to `in_review`.
184
+ 4. **Always attach to a planning version.** No orphan work.
185
+ 5. **Stay in your lane.** If you spot non-task work worth preserving, flag it — don't write it.
186
+ 6. **CLI first** for status/log/insert; **Edit** for surgical body reconciliation (including broadening `description:` / `## Why` when scope grows).
187
+ 7. **Person attribution is multi-person only.** Read `.config.json` `people` first. If 0 or 1 entry, step 2.5 is a complete NO-OP — never inject `person:` tags on solo projects. Derived multi-person status comes from `people.length > 1`; there is no `multiPerson` key to check.
@@ -54,8 +54,9 @@ If none apply when you start, no-op cheaply: read the brief, scan for actual sig
54
54
  | You touch | You don't touch |
55
55
  |---|---|
56
56
  | `_dream_context/knowledge/*.md` (create + edit) | core 0-6 files (sleep-state owns) |
57
- | `_dream_context/core/features/*.md` (create + edit) | task files (sleep-tasks owns) |
58
- | `dreamcontext knowledge create --tags "..."` | changelog, releases (sleep-state owns) |
57
+ | `_dream_context/knowledge/data-structures/<product>.md` (schemas, models, API contracts) | task files (sleep-tasks owns) |
58
+ | `_dream_context/core/features/*.md` (create + edit) | changelog, releases (sleep-state owns) |
59
+ | `dreamcontext knowledge create --tags "..."` | |
59
60
  | `dreamcontext features create <name>` | |
60
61
  | `dreamcontext features insert <name> <section>` | |
61
62
  | Frontmatter: `pinned`, `status`, `updated`, `released_version`, `related_tasks` | |
@@ -167,7 +168,7 @@ For each knowledge candidate (research finding, sleep-state flag, extracted over
167
168
 
168
169
  | Signal | Action |
169
170
  |---|---|
170
- | New research or decision worth long-term retention | `dreamcontext knowledge create <slug> --tags "<tag1>,<tag2>"` then Edit body |
171
+ | New research or decision worth long-term retention | Decide create-vs-extend per **B2's consolidation rubric** first, then `dreamcontext knowledge create <slug> --tags "<tag1>,<tag2>"` and Edit body — *or* extend an existing file |
171
172
  | Existing knowledge file gained new findings | Edit the file; update frontmatter `summary:` if drifted |
172
173
  | `sleep-state` flagged stale-archival candidate | Read the file; if no longer load-bearing, append to a top-level `archive/` knowledge file or set `archived: true` in frontmatter (per project convention) |
173
174
  | `sleep-state` flagged frequent-access-not-pinned | Edit frontmatter: `pinned: true` |
@@ -175,9 +176,29 @@ For each knowledge candidate (research finding, sleep-state flag, extracted over
175
176
  | Overflow extracted from core file (one-line reference left there) | `dreamcontext knowledge create <slug>` and paste the extracted content |
176
177
  | Cross-cutting finding from your own features pass | Capture inline (no need to flag — you own both domains this cycle) |
177
178
 
178
- #### B2. Create new knowledge files
179
+ #### B2. Create vs. extend — the consolidation rubric
179
180
 
180
- **Dedup pre-check.** Before creating, run `dreamcontext memory recall "<topic>" --types knowledge,feature` if the top hit is a near-match, extend that file instead of forking the topic across two slugs.
181
+ **A knowledge file is a tag-able identity, not a dumping ground.** Aim for the *fewest* files that keep each topic cleanly findable. Fragmenting one topic across many near-duplicate slugs makes tags noisy and recall worse; cramming unrelated topics into one super-file makes tags meaningless. Pick the boundary on purpose.
182
+
183
+ **Dedup first — recall by the topic AND by its family** (vertical / brand / parent domain), not just the exact phrase:
184
+
185
+ ```bash
186
+ dreamcontext memory recall "<topic>" --types knowledge,feature
187
+ dreamcontext memory recall "<vertical / brand / parent domain>" --types knowledge,feature
188
+ ```
189
+
190
+ Then decide — **default to extending an existing file**:
191
+
192
+ | The finding is… | Action |
193
+ |---|---|
194
+ | The **same vertical / brand / topic family** as an existing file, or a sub-aspect / increment / follow-up of a topic already covered (a *soft* distinction) | **Extend that file** — add a section, update `summary:` if it drifted. Don't fork a near-duplicate slug. Similar brands, similar verticals, similar topics belong together in the fewest files. |
195
+ | A **genuinely separate topic / domain / concern** a future session would expect to find standing alone, where its own tag set sharpens discovery (a *sharp* distinction) | **Create a new file** (below). A clean topical boundary earns its own slug so tagging stays valuable. |
196
+
197
+ The test for sharp-vs-soft: *Would a future recall expect this bundled with the existing file, or standing on its own? Would a separate file make the tag set more discriminating — or just split one topic across two slugs?* If splitting wouldn't sharpen the tags, extend.
198
+
199
+ This is **not** "always make super-files." Distinct topics MUST get distinct files — that's exactly what makes tags worth having. It's the *soft* distinctions (same family, narrower slice, incremental finding) that fold into an existing file.
200
+
201
+ **When the rubric says create:**
181
202
 
182
203
  ```bash
183
204
  dreamcontext knowledge create "<descriptive-slug>" \
@@ -230,6 +251,22 @@ Product-scoped knowledge. Cross-cutting findings still go to top-level `knowledg
230
251
 
231
252
  This is a one-time bootstrap per product; once the file exists, treat it like any other knowledge file (edit on demand, don't recreate).
232
253
 
254
+ #### B6. Data structures (schemas / models / API contracts)
255
+
256
+ Data structures live at `knowledge/data-structures/<product>.md` (`default.md` for single-product). They moved here from `core/` because schemas ARE domain knowledge — this gives them recall indexing, staleness flags, and the knowledge UI for free. **You own these writes now** (sleep-state only flags them for you).
257
+
258
+ **Single-observation gate.** Unlike most knowledge (which waits for repetition), a schema/data-model change is reflected in the *same* cycle — no pattern repetition required. If `sleep-state` flagged a schema/table/model change, or the diff shows one, write it now.
259
+
260
+ **Routing.**
261
+ - Active task has `product: X` → `knowledge/data-structures/X.md` (create if missing).
262
+ - Otherwise (single-product) → `knowledge/data-structures/default.md`.
263
+ - Frontmatter: `type: data-structures`, `product: <name>`, `tags: [data-structures, database, schema]` (add domain tags as relevant).
264
+
265
+ **Migration of the old locations** (idempotent; the dir move runs automatically on `dreamcontext sleep start`, but confirm + handle the legacy file):
266
+ - If `core/data-structures/*.md` still exists and the knowledge copy is absent, it was (or should be) moved to `knowledge/data-structures/` — the `sleep start` migration handles this. Verify it landed.
267
+ - If the even-older `core/5.data_structures.sql` exists and `knowledge/data-structures/default.md` does not, copy it there (add the data-structures frontmatter) — don't delete the legacy file.
268
+ - **Never delete** the old `core/data-structures/` dir or the legacy `.sql` yourself — leave them for the user to remove after confirming (the `doctor` command nags about both). Note any migration in your report.
269
+
233
270
  ## Return — single combined report
234
271
 
235
272
  ```
@@ -247,8 +284,8 @@ This is a one-time bootstrap per product; once the file exists, treat it like an
247
284
  - No-op feature signals: 1 (signal "feature_advanced=marketing-dashboard-v0" — but PRD exists and no criteria moved)
248
285
 
249
286
  ### Knowledge
250
- - Created: knowledge/jwt-rotation-policy.md (tags: security, decisions; from sleep-state flag)
251
- - Updated: knowledge/competitive-analysis-ecc.md (added 2026-05-09 follow-up section)
287
+ - Created: knowledge/jwt-rotation-policy.md (tags: security, decisions; from sleep-state flag) — sharp boundary, new tag-able topic
288
+ - Extended (no new file): knowledge/competitive-analysis-ecc.md — folded the new ECC pricing finding into the existing file (soft distinction, same topic family) instead of forking a near-duplicate slug; updated `summary:`
252
289
  - Pinned: knowledge/project-origin-and-prd.md (frequently accessed)
253
290
  - Archived: 0
254
291
  - No-op knowledge signals: 1 (`research_present` was a one-line decision already captured by sleep-state in 2.memory.md — not knowledge-worthy)
@@ -263,6 +300,7 @@ This is a one-time bootstrap per product; once the file exists, treat it like an
263
300
  5. **Create PRDs for buildable concepts** that don't have one — they will be lost otherwise.
264
301
  6. **Don't create knowledge that already fits in memory.** A short technical decision belongs in `2.memory.md` (sleep-state's domain), not its own knowledge file.
265
302
  7. **Knowledge file threshold**: ≥3 paragraphs of content, or material that will be re-read in future sessions.
266
- 8. **Use standard tags only.** New tags fragment discovery.
267
- 9. **Process all flags from sleep-state** in your report — don't silently drop them.
268
- 10. **No-op cheaply** when signals don't actually warrant work.
303
+ 8. **Fewest files, sharp boundaries (B2 rubric).** Default to extending an existing file. Fold soft distinctions in — same vertical/brand/topic family, a narrower slice, an increment. Create a new file only for a genuinely separate topic whose own tags sharpen discovery. Not super-files, not fragmentation.
304
+ 9. **Use standard tags only.** New tags fragment discovery.
305
+ 10. **Process all flags from sleep-state** in your report — don't silently drop them.
306
+ 11. **No-op cheaply** when signals don't actually warrant work.
@@ -33,9 +33,8 @@ Identity is sacred — a fresh session must immediately understand who the agent
33
33
  | You touch | You don't touch |
34
34
  |---|---|
35
35
  | `core/0-4.*`, `core/6.*` files (Edit, surgical) | task files (sleep-tasks owns) |
36
- | `core/data-structures/<product>.md` (one per product; `default.md` for single-product) | knowledge files (you flag staleness; sleep-product writes) |
37
- | `dreamcontext core changelog add` | feature PRDs (sleep-product owns) |
38
- | `dreamcontext core releases {add,update,active,list,show}` | |
36
+ | `dreamcontext core changelog add` | knowledge files incl. `knowledge/data-structures/<product>.md` (sleep-product owns + writes; you only flag staleness) |
37
+ | `dreamcontext core releases {add,update,active,list,show}` | feature PRDs (sleep-product owns) |
39
38
  | `dreamcontext trigger add` (context-dependent reminders) | |
40
39
 
41
40
  ## Inputs
@@ -89,6 +88,7 @@ dreamcontext core changelog add \
89
88
  --summary "<≤200 char one-liner: what shipped, scannable in snapshot>" \
90
89
  --description "<one paragraph: what changed and why; mention key file/symbol where helpful>" \
91
90
  --references "commit:<sha>,file:<path>,knowledge:<slug>,feature:<slug>,task:<slug>,url:<href>" \
91
+ [--authors "<person-a,person-b>"] \
92
92
  [--supersedes "<date>|<scope>"] \
93
93
  $([ "$BREAKING" = "true" ] && echo "--breaking")
94
94
  ```
@@ -101,6 +101,8 @@ dreamcontext core changelog add \
101
101
 
102
102
  **Supersedes field**: optional, only when a later entry reverses or replaces an earlier one (e.g., a "default-on" flip of a previously "opt-in" flag, or a v0.4 file path being deprecated). Use coarse keys like `"2026-05-23|memory"` (date + scope) — disambiguators only matter when multiple entries share the same date+scope, in which case fall back to the position-from-top index. Most entries do NOT supersede anything; leave the field absent.
103
103
 
104
+ **Authors field (multi-person projects only)**: optional, attributes the change to the person(s) who drove it. Set it ONLY when the project is multi-person (`.config.json` `people` roster has >1 entry — see Pass B.5). Pass comma-separated kebab-case slugs matching the roster (`--authors "mehmet,ada"`). Determine attribution from the same signals Pass B.5 uses (git `%an` on the commits the entry clusters, self-identification in the session transcript). When a single change was driven by distinct people across clusters, attribute each `dreamcontext core changelog add` invocation to its own author(s). Single-person projects: OMIT `--authors` entirely — output stays byte-identical to today. Authors are excluded from the changelog dedup fingerprint, so adding them never re-opens an already-released entry.
105
+
104
106
  #### A3. Releases — surface readiness, never auto-release
105
107
 
106
108
  ```bash
@@ -142,21 +144,20 @@ Be conservative. The default is **no change**. Only update when a pattern is rec
142
144
 
143
145
  #### B0b. Single-observation gate (code-reality files)
144
146
 
145
- Applies to: `3.style_guide_and_branding.md`, `4.tech_stack.md`, files under `core/data-structures/`, and `6.system_flow.md`.
147
+ Applies to: `3.style_guide_and_branding.md`, `4.tech_stack.md`, and `6.system_flow.md`. (Schema/data-model changes are the same kind of single-observation signal, but they now live in `knowledge/data-structures/` **sleep-product** owns that write; flag it for them rather than writing it yourself.)
146
148
 
147
- These files describe code reality, not user preferences. A single session adding/removing a dependency, schema, route, or workflow step MUST be reflected in the same cycle — no pattern repetition required. If the diff or transcript shows the change happened, write it.
149
+ These files describe code reality, not user preferences. A single session adding/removing a dependency, route, or workflow step MUST be reflected in the same cycle — no pattern repetition required. If the diff or transcript shows the change happened, write it.
148
150
 
149
151
  Examples that trigger an immediate write:
150
152
  - A new dependency appears in `package.json` / lockfile → `4.tech_stack.md`.
151
- - A schema change, new table, or new model → relevant file under `core/data-structures/`.
153
+ - A schema change, new table, or new model → flag for **sleep-product** to write `knowledge/data-structures/<product>.md`.
152
154
  - A new route, hook, or system-flow step → `6.system_flow.md`.
153
155
  - A new color token, font, or design primitive → `3.style_guide_and_branding.md`.
154
156
 
155
- **Multi-product routing.** If the active task frontmatter has `product: X`, route any tech_stack or data_structures observation to the matching product's file:
157
+ **Multi-product routing.** If the active task frontmatter has `product: X`, route any tech_stack observation to the matching product's file:
156
158
  - Tech stack scoped to product X → still goes in `4.tech_stack.md` but tagged with the product label inline (single-file convention); if a project-specific convention emerges (per-product tech stacks), revisit.
157
- - Data structures → `core/data-structures/<X>.md`. Create the file if missing.
158
159
 
159
- Otherwise (no `product:` field, single-product project), data structures changes go to `core/data-structures/default.md`.
160
+ Data-structure observations are routed by **sleep-product** to `knowledge/data-structures/<X>.md` (or `default.md`) — flag them for sleep-product, don't write them here.
160
161
 
161
162
  #### B1. Signal → file routing
162
163
 
@@ -167,7 +168,7 @@ Otherwise (no `product:` field, single-product project), data structures changes
167
168
  | New project constraint or warning | `0.soul.md` | Rules / Warnings | two-observation |
168
169
  | Technical decision worth preserving | `2.memory.md` | Technical Decisions | two-observation |
169
170
  | Stack/dependency change | `4.tech_stack.md` | | single-observation |
170
- | Schema / data-model change | `core/data-structures/<product>.md` (or `default.md`) | | single-observation |
171
+ | Schema / data-model change | flag for **sleep-product** → `knowledge/data-structures/<product>.md` (or `default.md`) | | single-observation |
171
172
  | System flow / hook count change | `6.system_flow.md` | | single-observation |
172
173
  | Style/branding token change | `3.style_guide_and_branding.md` | | single-observation |
173
174
 
@@ -181,22 +182,38 @@ dreamcontext trigger add "<when>" "<remind>" # context-dependent reminders
181
182
 
182
183
  Cross-domain catches from your own changelog pass land here naturally — if you wrote a `feat` entry whose description revealed a preference enforced twice, write it into `1.user.md` in the same cycle (no flagging needed; you own both files).
183
184
 
184
- #### B2. Legacy migration `5.data_structures.sql` `data-structures/<product>.md`
185
+ ### Pass B.5People detection (multi-person awareness)
186
+
187
+ dreamcontext defaults to single-person. When you have **corroborated evidence** that more than one human works in this project, record the roster so changelogs/tasks/memory can attribute work per person. This is **AI-driven detection** — there is no manual toggle and no persisted `multiPerson` flag (multi-person status is DERIVED from `people.length > 1`).
188
+
189
+ **Detection gate — require ≥2 corroborated signals** before flipping a project to multi-person (this gate prevents false positives; one weak signal is never enough):
185
190
 
186
- On every cycle, check for the legacy file:
191
+ - **Self-identification in user turns** — a person names themselves or another teammate ("this is Ada", "Mehmet asked me to…", "I'm covering for Lina").
192
+ - **Distinct git authors since the epoch** — `git log --since="$CUTOFF" --format='%an <%ae>' | sort -u` returns more than one real human author (ignore bots/CI like `github-actions`, `dependabot`).
193
+ - **Distinct voice / handoff** — the transcript shows a clear authorship handoff or a different working style/voice than the established user.
187
194
 
188
195
  ```bash
189
- LEGACY=_dream_context/core/5.data_structures.sql
190
- NEW_DEFAULT=_dream_context/core/data-structures/default.md
191
- if [ -f "$LEGACY" ] && [ ! -f "$NEW_DEFAULT" ]; then
192
- mkdir -p _dream_context/core/data-structures
193
- cp "$LEGACY" "$NEW_DEFAULT"
194
- # do NOT delete the legacy file here — leave it for WS-1 manifest cleanup (if system-installed)
195
- # or the user to remove manually. Note the migration in your report.
196
- fi
196
+ # Signal 2: distinct human git authors since the sleep epoch
197
+ git log --since="$CUTOFF" --format='%an' | sort -u
198
+ # Read the existing roster FIRST you append, you never overwrite.
199
+ jq -r '.people // [] | join(", ")' _dream_context/state/.config.json 2>/dev/null
197
200
  ```
198
201
 
199
- Report the migration in your output so the user knows the new location. Do not delete the legacy file yourself.
202
+ When the gate is met:
203
+
204
+ 1. **Additive union to the roster — never overwrite.** Read the current `people` array first, then write the union (existing ∪ newly observed) back. Use kebab-case display-name slugs (`mehmet`, `ada`). A previously recorded person is NEVER dropped because they were quiet this cycle.
205
+
206
+ ```bash
207
+ dreamcontext config # confirm current roster, then edit state/.config.json people[] = union
208
+ ```
209
+
210
+ (There is no CLI writer for `people` yet — edit `_dream_context/state/.config.json` directly with Edit, preserving every existing key. Do NOT add a `multiPerson` key; it is derived.)
211
+
212
+ 2. **Refresh `## People` in `1.user.md`** to enumerate the full roster. Use the `ensurePeopleSection(userMd, people)` helper semantics (idempotent insert/replace of a `## People` block; one bullet per person). This is a no-op for single-person projects.
213
+
214
+ 3. **Attribute this cycle's changelog entries** — re-run Pass A's `dreamcontext core changelog add` with `--authors "<slugs>"` for each entry, attributing it to the person(s) who drove that cluster (Pass A and this pass share the git-author analysis).
215
+
216
+ **Single-person projects (gate NOT met): this entire pass is a NO-OP.** Do not create a roster, do not add a `## People` section, do not pass `--authors`. A solo project's `.config.json`, `1.user.md`, and changelog output must stay byte-identical to today. The cost of a false positive (spuriously attributing a solo user's work to a phantom teammate) is high — stay conservative.
200
217
 
201
218
  ### Pass C — Anti-bloat sweep + knowledge staleness flags
202
219
 
@@ -245,6 +262,10 @@ You do **not** edit knowledge files. Produce flags for `sleep-product` to act on
245
262
  - 4.tech_stack.md: untouched
246
263
  - Triggers added: 0
247
264
 
265
+ ### People (multi-person detection)
266
+ - Roster: single-person (no multi-person signals this cycle) — no changes
267
+ | OR: detected 2 humans (signals: 2 distinct git authors + self-id in transcript) → roster updated mehmet, ada (additive union; ada appended, mehmet preserved); `## People` refreshed in 1.user.md; 3 changelog entries attributed via --authors
268
+
248
269
  ### Anti-bloat & staleness
249
270
  - 2.memory.md at 287 lines — under ceiling, no extraction needed
250
271
  - Knowledge staleness flags (for sleep-product):
@@ -259,7 +280,7 @@ You do **not** edit knowledge files. Produce flags for `sleep-product` to act on
259
280
  1. **Be exhaustive on the diary.** Every meaningful change gets a changelog entry. Skipping is the failure state.
260
281
  2. **Conservative on identity (preferences & decisions).** No-op is the right answer most cycles for `1.user.md` and `2.memory.md`.
261
282
  3. **Two-observation gate for `1.user.md` / `2.memory.md`.** One observation is data; two is a pattern. Don't write a preference or decision from a single mention.
262
- 3a. **Single-observation gate for code-reality files** (`3.*`, `4.*`, `core/data-structures/*`, `6.*`). A diff that adds a dependency, schema, route, or design primitive MUST be reflected in the same cycle. These files mirror code, not opinion.
283
+ 3a. **Single-observation gate for code-reality files** (`3.*`, `4.*`, `6.*`). A diff that adds a dependency, route, or design primitive MUST be reflected in the same cycle. These files mirror code, not opinion. (Schema/data-model changes are the same kind of signal but live in `knowledge/data-structures/` — flag them for **sleep-product**.)
263
284
  4. **Cluster commits, don't enumerate.** Logical groupings beat 1-commit-per-entry.
264
285
  5. **Cover uncommitted work.** Don't wait for the user to commit.
265
286
  6. **Never auto-release.** Surface readiness; the user decides.
@@ -49,8 +49,41 @@ Also read `_dream_context/state/.sleep.json` directly for `sessions[].last_assis
49
49
 
50
50
  For each session:
51
51
 
52
- - **Has `task_slugs`** → those are the task(s) to update.
53
- - **No `task_slugs`** → check `last_assistant_message`, the user hint in the brief, and bookmark messages for a task name. If significant work has no matching task, **create one**:
52
+ - **Has `task_slugs`** → those are the task(s) to update. Go to step 3.
53
+ - **No `task_slugs`** → check `last_assistant_message`, the user hint in the brief, and bookmark messages for what the work was about.
54
+
55
+ **Before creating anything, dedup against existing tasks.** Duplicate tasks — and tasks that are really just a smaller slice of one that already exists — are the #1 consolidation failure mode. A "much smaller piece" of an existing task is **never** its own task. Recall by topic and scan the active list first:
56
+
57
+ ```bash
58
+ dreamcontext memory recall "<topic / feature / area>" --types task
59
+ dreamcontext tasks list --status in_progress
60
+ dreamcontext tasks list --status in_review
61
+ ```
62
+
63
+ Then decide with this rubric — **default to folding in, not forking a new task**:
64
+
65
+ | The session's work is… | Action |
66
+ |---|---|
67
+ | A **smaller piece, sub-step, or follow-up** of a task that already exists (same feature/area, narrower scope) | **Do NOT create a task.** Fold it into the existing one (see below). |
68
+ | The **same work** as an existing task, observed again | Update that task (step 3). No new task. |
69
+ | A **genuinely separate concern** — a different feature/area/deliverable, not a slice of an existing task | Create a new task (below). |
70
+
71
+ **Folding a smaller piece into an existing task** (the case the system keeps getting wrong):
72
+
73
+ 1. If the existing task's scope grew to include this work, **broaden its title/scope** — Edit the frontmatter `description:` (the one-line scope) and the `## Why` so the header reflects the now-wider scope. Don't leave a stale, too-narrow title with the new work buried only in the changelog. (Renaming the slug/`name:` is usually unnecessary and breaks links — only do it if the scope fundamentally changed identity.)
74
+ 2. Add the new work as concrete **sub-items in the body**, not a new file:
75
+
76
+ ```bash
77
+ dreamcontext tasks insert <slug> user_stories "<as a … I want …>"
78
+ dreamcontext tasks insert <slug> acceptance_criteria "<testable criterion>"
79
+ dreamcontext tasks insert <slug> notes "<follow-up / smaller piece>"
80
+ ```
81
+
82
+ 3. Tick/extend the Workflow Mermaid nodes if the task has them.
83
+
84
+ **Sub-tasks (`parent_task`) are for genuinely large decomposition only** — an epic that legitimately splits into separable deliverables. Do not spawn a child task for a slice that fits as a user story or acceptance criterion in the parent. When in doubt, fold in.
85
+
86
+ **Create a new task only when the rubric says "separate concern":**
54
87
 
55
88
  ```bash
56
89
  # Ensure an active planning version exists (orchestrator should have done this; verify)
@@ -63,7 +96,23 @@ dreamcontext tasks create "<descriptive-slug>" --status in_progress --priority m
63
96
  --description "<one-line scope>"
64
97
  ```
65
98
 
66
- Untracked work is invisible to future sessions. Always link.
99
+ Untracked, genuinely-separate work is invisible to future sessions always link it. But a smaller slice of existing work belongs *inside* that task, never in a duplicate.
100
+
101
+ ### 2.5. Person attribution (multi-person projects only)
102
+
103
+ When the project's `.config.json` `people` array has **>1 entry**, the person responsible for a task's progress this cycle must be recorded as a `person:<slug>` tag in the task's frontmatter `tags` array. Slug is kebab-case matching the roster (e.g., `person:mehmet`, `person:ada`). Determine attribution from the same signals sleep-state uses for Pass B.5 (git `%an` on the commits, self-identification in the session transcript).
104
+
105
+ ```bash
106
+ # Read the current roster
107
+ jq -r '.people // [] | join(", ")' _dream_context/state/.config.json 2>/dev/null
108
+ ```
109
+
110
+ - **New task**: pass `--person <name>` to `dreamcontext tasks create` (the CLI injects a `person:<slug>` tag automatically).
111
+ - **Existing task**: add the tag directly via Edit on the task frontmatter `tags:` array, or via `dreamcontext tasks insert`.
112
+
113
+ When the person is already tagged on the task, no action is needed — the tag is additive. Do not remove a previously-set `person:` tag for a person who was quiet this cycle; they remain attributed for prior work.
114
+
115
+ **Single-person projects (`.config.json` `people` has 0 or 1 entry): this step is a NO-OP.** Never inject a `person:` tag on a solo project. The output must stay byte-identical to today.
67
116
 
68
117
  ### 3. Log progress AND reconcile the body — both required
69
118
 
@@ -118,8 +167,10 @@ If every task linked to the active version is `completed` (or only `in_review` r
118
167
  ```
119
168
  ## sleep-tasks report
120
169
  - Updated: <slug> (in_progress → in_review, "<reason>"), <slug> (logged)
121
- - Created: <slug> (status: in_progress, attached to vX.Y.Z)
170
+ - Folded in (no new task): <existing-slug> broadened scope + added 2 user stories / 1 criterion for <smaller-piece> instead of forking a duplicate
171
+ - Created: <slug> (status: in_progress, attached to vX.Y.Z) — genuinely separate concern
122
172
  - Body reconciled: <slug> (dropped phase 1 from User Stories; replaced Technical Details auth section)
173
+ - Person attribution: <slug> tagged person:ada (multi-person project, ada drove this cycle's work) | OR: single-person project — no person tags injected
123
174
  - Version readiness: vX.Y.Z — 4/5 tasks ready for review
124
175
  - Cross-domain mentions: <slug> includes a memory-worthy decision about JWT — flagging for sleep-state
125
176
  - Skipped: <session_id> had no actionable task signal
@@ -127,8 +178,10 @@ If every task linked to the active version is `completed` (or only `in_review` r
127
178
 
128
179
  ## Rules
129
180
 
130
- 1. **Body = current truth, Changelog = history.** Don't let the body lag behind decisions.
131
- 2. **Never auto-complete.** Bump to `in_review`.
132
- 3. **Always attach to a planning version.** No orphan work.
133
- 4. **Stay in your lane.** If you spot non-task work worth preserving, flag it — don't write it.
134
- 5. **CLI first** for status/log/insert; **Edit** for surgical body reconciliation.
181
+ 1. **Dedup before creating.** Recall first; fold a smaller slice into the task that already covers it — broaden its title + insert sub-items — instead of forking a duplicate or a needless sub-task. A new task is only for a genuinely separate concern.
182
+ 2. **Body = current truth, Changelog = history.** Don't let the body lag behind decisions.
183
+ 3. **Never auto-complete.** Bump to `in_review`.
184
+ 4. **Always attach to a planning version.** No orphan work.
185
+ 5. **Stay in your lane.** If you spot non-task work worth preserving, flag it — don't write it.
186
+ 6. **CLI first** for status/log/insert; **Edit** for surgical body reconciliation (including broadening `description:` / `## Why` when scope grows).
187
+ 7. **Person attribution is multi-person only.** Read `.config.json` `people` first. If 0 or 1 entry, step 2.5 is a complete NO-OP — never inject `person:` tags on solo projects. Derived multi-person status comes from `people.length > 1`; there is no `multiPerson` key to check.
@@ -1,4 +1,4 @@
1
- import{bs as jc,bt as I0,aM as pS,bu as xt,bv as Ip,bw as mS,bx as gS,by as _S,bz as xS,bA as yS,bp as vS,bq as bS,bB as B0,aC as SS,bC as TS,bD as MS,bE as ES,bF as xg,bG as yg,bH as AS,bI as k,bJ as $s,bK as wS,bL as RS,bM as CS,bN as NS}from"./index-Ds-JXWtr.js";function PS(r){var e=jc(.1),t,n,i;typeof r!="function"&&(r=jc(r==null?0:+r));function s(a){for(var l=0,c=t.length,u;l<c;++l)u=t[l],u.vz+=(i[l]-u.z)*n[l]*a}function o(){if(t){var a,l=t.length;for(n=new Array(l),i=new Array(l),a=0;a<l;++a)n[a]=isNaN(i[a]=+r(t[a],a,t))?0:+e(t[a],a,t)}}return s.initialize=function(a){t=a,o()},s.strength=function(a){return arguments.length?(e=typeof a=="function"?a:jc(+a),o(),s):e},s.z=function(a){return arguments.length?(r=typeof a=="function"?a:jc(+a),o(),s):r},s}/**
1
+ import{bs as jc,bt as I0,aM as pS,bu as xt,bv as Ip,bw as mS,bx as gS,by as _S,bz as xS,bA as yS,bp as vS,bq as bS,bB as B0,aC as SS,bC as TS,bD as MS,bE as ES,bF as xg,bG as yg,bH as AS,bI as k,bJ as $s,bK as wS,bL as RS,bM as CS,bN as NS}from"./index-Bo5CUa_M.js";function PS(r){var e=jc(.1),t,n,i;typeof r!="function"&&(r=jc(r==null?0:+r));function s(a){for(var l=0,c=t.length,u;l<c;++l)u=t[l],u.vz+=(i[l]-u.z)*n[l]*a}function o(){if(t){var a,l=t.length;for(n=new Array(l),i=new Array(l),a=0;a<l;++a)n[a]=isNaN(i[a]=+r(t[a],a,t))?0:+e(t[a],a,t)}}return s.initialize=function(a){t=a,o()},s.strength=function(a){return arguments.length?(e=typeof a=="function"?a:jc(+a),o(),s):e},s.z=function(a){return arguments.length?(r=typeof a=="function"?a:jc(+a),o(),s):r},s}/**
2
2
  * @license
3
3
  * Copyright 2010-2026 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT