dreamcontext 0.14.1 → 0.15.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 (125) hide show
  1. package/README.md +15 -20
  2. package/dist/dashboard/assets/{BrainCanvas3D-iDGz4HV0.js → BrainCanvas3D-D4YivUjx.js} +1 -1
  3. package/dist/dashboard/assets/{_baseUniq-BKTLnguK.js → _baseUniq--w3QZgRc.js} +1 -1
  4. package/dist/dashboard/assets/{ar-SA-G6X2FPQ2-WxRw8CvG.js → ar-SA-G6X2FPQ2-BS1K06dI.js} +1 -1
  5. package/dist/dashboard/assets/{arc-CXFvfgn5.js → arc-DvE6lN6F.js} +1 -1
  6. package/dist/dashboard/assets/{architectureDiagram-Q4EWVU46-CgpaMT3q.js → architectureDiagram-Q4EWVU46-BuLHJd-J.js} +1 -1
  7. package/dist/dashboard/assets/{az-AZ-76LH7QW2-Tml7S2e-.js → az-AZ-76LH7QW2-DcxZHidu.js} +1 -1
  8. package/dist/dashboard/assets/{bg-BG-XCXSNQG7-C3fv9p_Z.js → bg-BG-XCXSNQG7-t9W3DG9h.js} +1 -1
  9. package/dist/dashboard/assets/{blockDiagram-DXYQGD6D-CeVR1IHD.js → blockDiagram-DXYQGD6D-D1yosf_d.js} +1 -1
  10. package/dist/dashboard/assets/{bn-BD-2XOGV67Q-qnJuYH4H.js → bn-BD-2XOGV67Q-CbBSwTYP.js} +1 -1
  11. package/dist/dashboard/assets/{c4Diagram-AHTNJAMY-xcFu2zZM.js → c4Diagram-AHTNJAMY-Ck_IThhw.js} +1 -1
  12. package/dist/dashboard/assets/{ca-ES-6MX7JW3Y-4tyHbEgd.js → ca-ES-6MX7JW3Y-CULIknat.js} +1 -1
  13. package/dist/dashboard/assets/channel-C4zP-AEe.js +1 -0
  14. package/dist/dashboard/assets/{chunk-4BX2VUAB-J7mFJb__.js → chunk-4BX2VUAB-FhSNTeOM.js} +1 -1
  15. package/dist/dashboard/assets/{chunk-4TB4RGXK-DqrxE_QA.js → chunk-4TB4RGXK-B-0fS7DN.js} +1 -1
  16. package/dist/dashboard/assets/{chunk-55IACEB6-D8eCITwq.js → chunk-55IACEB6-CgZcHbxh.js} +1 -1
  17. package/dist/dashboard/assets/{chunk-EDXVE4YY-DBzJ4Kk6.js → chunk-EDXVE4YY-Cgtb_QhN.js} +1 -1
  18. package/dist/dashboard/assets/{chunk-FMBD7UC4-5rx_crEA.js → chunk-FMBD7UC4-CiPyOehc.js} +1 -1
  19. package/dist/dashboard/assets/{chunk-OYMX7WX6-CLE6jH1t.js → chunk-OYMX7WX6-sCPqGdKS.js} +1 -1
  20. package/dist/dashboard/assets/{chunk-QZHKN3VN-OS-irsoP.js → chunk-QZHKN3VN-BVWImlQ_.js} +1 -1
  21. package/dist/dashboard/assets/{chunk-YZCP3GAM-Bucdr9No.js → chunk-YZCP3GAM-BuBIza_r.js} +1 -1
  22. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-DfKte-F8.js +1 -0
  23. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-DfKte-F8.js +1 -0
  24. package/dist/dashboard/assets/clone-BSgKpRTm.js +1 -0
  25. package/dist/dashboard/assets/{cose-bilkent-S5V4N54A-0zXaPrUS.js → cose-bilkent-S5V4N54A-CCaC8B1u.js} +1 -1
  26. package/dist/dashboard/assets/{cs-CZ-2BRQDIVT-BTejWsyZ.js → cs-CZ-2BRQDIVT-CY3a2n17.js} +1 -1
  27. package/dist/dashboard/assets/{da-DK-5WZEPLOC-DWf9m3vM.js → da-DK-5WZEPLOC-G83I7akJ.js} +1 -1
  28. package/dist/dashboard/assets/{dagre-KV5264BT-B_fWcb4P.js → dagre-KV5264BT-BWnfN5tG.js} +1 -1
  29. package/dist/dashboard/assets/{de-DE-XR44H4JA-6DFCnmxt.js → de-DE-XR44H4JA-u7RaXwaD.js} +1 -1
  30. package/dist/dashboard/assets/{diagram-5BDNPKRD-BDjjAQT6.js → diagram-5BDNPKRD-0oefz_jx.js} +1 -1
  31. package/dist/dashboard/assets/{diagram-G4DWMVQ6-CgDZIIvU.js → diagram-G4DWMVQ6-EQ_FZox4.js} +1 -1
  32. package/dist/dashboard/assets/{diagram-MMDJMWI5-OsjvtQBN.js → diagram-MMDJMWI5-B_EeT5hu.js} +1 -1
  33. package/dist/dashboard/assets/{diagram-TYMM5635-DOB390r8.js → diagram-TYMM5635-DdJP7clT.js} +1 -1
  34. package/dist/dashboard/assets/{el-GR-BZB4AONW-BCXqQAzU.js → el-GR-BZB4AONW-D569CbUE.js} +1 -1
  35. package/dist/dashboard/assets/{erDiagram-SMLLAGMA-uT8z1D4S.js → erDiagram-SMLLAGMA-Mc1WtRaS.js} +1 -1
  36. package/dist/dashboard/assets/{es-ES-U4NZUMDT-daNwi4rl.js → es-ES-U4NZUMDT-C-1lvm0Q.js} +1 -1
  37. package/dist/dashboard/assets/{eu-ES-A7QVB2H4-CP2B7v-S.js → eu-ES-A7QVB2H4-Dpl_ROTp.js} +1 -1
  38. package/dist/dashboard/assets/{fa-IR-HGAKTJCU-B7fyLZjD.js → fa-IR-HGAKTJCU--9CvY3M7.js} +1 -1
  39. package/dist/dashboard/assets/{fi-FI-Z5N7JZ37--r4W4BJL.js → fi-FI-Z5N7JZ37-BRF_h6SA.js} +1 -1
  40. package/dist/dashboard/assets/{flowDiagram-DWJPFMVM-BAfgGiph.js → flowDiagram-DWJPFMVM-B8O0N5R8.js} +1 -1
  41. package/dist/dashboard/assets/{fr-FR-RHASNOE6-D_z2sz4o.js → fr-FR-RHASNOE6-H03i3895.js} +1 -1
  42. package/dist/dashboard/assets/{ganttDiagram-T4ZO3ILL-C493I8Kn.js → ganttDiagram-T4ZO3ILL-Be4tXepX.js} +1 -1
  43. package/dist/dashboard/assets/{gitGraphDiagram-UUTBAWPF-DD3Jw4hy.js → gitGraphDiagram-UUTBAWPF-Bk-0Ou0k.js} +1 -1
  44. package/dist/dashboard/assets/{gl-ES-HMX3MZ6V-3iPIpzVQ.js → gl-ES-HMX3MZ6V-DmNNXC49.js} +1 -1
  45. package/dist/dashboard/assets/{graph-CJvnKdzN.js → graph-ie2aMk7l.js} +1 -1
  46. package/dist/dashboard/assets/{he-IL-6SHJWFNN-BnseHvRA.js → he-IL-6SHJWFNN-DwA4-t4e.js} +1 -1
  47. package/dist/dashboard/assets/{hi-IN-IWLTKZ5I-Cdvylq2s.js → hi-IN-IWLTKZ5I-DZuYYdfu.js} +1 -1
  48. package/dist/dashboard/assets/{hu-HU-A5ZG7DT2-cYA2nqI5.js → hu-HU-A5ZG7DT2-CvmzKZoP.js} +1 -1
  49. package/dist/dashboard/assets/{id-ID-SAP4L64H-ByI8qeN-.js → id-ID-SAP4L64H-D_c7p2Dj.js} +1 -1
  50. package/dist/dashboard/assets/{index-CdlG9S--.css → index-Chy9TZYk.css} +2 -2
  51. package/dist/dashboard/assets/{index-DRgJ1sc2.js → index-Ddhkf24Q.js} +1 -1
  52. package/dist/dashboard/assets/{index-D85kugqO.js → index-QrTsw4kJ.js} +202 -202
  53. package/dist/dashboard/assets/{infoDiagram-42DDH7IO-BJyNzQje.js → infoDiagram-42DDH7IO-9TyCWaBY.js} +1 -1
  54. package/dist/dashboard/assets/{ishikawaDiagram-UXIWVN3A-DWwmai-U.js → ishikawaDiagram-UXIWVN3A-C3E82MOu.js} +1 -1
  55. package/dist/dashboard/assets/{it-IT-JPQ66NNP-Cm3-aA2z.js → it-IT-JPQ66NNP-H3GcetvH.js} +1 -1
  56. package/dist/dashboard/assets/{ja-JP-DBVTYXUO-BtKUGXop.js → ja-JP-DBVTYXUO-BKyK1SLw.js} +1 -1
  57. package/dist/dashboard/assets/{journeyDiagram-VCZTEJTY-CWpo_QlB.js → journeyDiagram-VCZTEJTY-DNJlbWgo.js} +1 -1
  58. package/dist/dashboard/assets/{kaa-6HZHGXH3-Cz-3C5qm.js → kaa-6HZHGXH3-DRxI1mkF.js} +1 -1
  59. package/dist/dashboard/assets/{kab-KAB-ZGHBKWFO-CquppFs3.js → kab-KAB-ZGHBKWFO-Dc14HtoS.js} +1 -1
  60. package/dist/dashboard/assets/{kanban-definition-6JOO6SKY-CZisoM6K.js → kanban-definition-6JOO6SKY-B6NjvJyd.js} +1 -1
  61. package/dist/dashboard/assets/{kk-KZ-P5N5QNE5-B2l0aVOL.js → kk-KZ-P5N5QNE5-ACq-tnbt.js} +1 -1
  62. package/dist/dashboard/assets/{km-KH-HSX4SM5Z-gnd97XjM.js → km-KH-HSX4SM5Z-DGxP4MY7.js} +1 -1
  63. package/dist/dashboard/assets/{ko-KR-MTYHY66A-CZ7y0WRr.js → ko-KR-MTYHY66A-D9wPf-mq.js} +1 -1
  64. package/dist/dashboard/assets/{ku-TR-6OUDTVRD-cJLiwVTI.js → ku-TR-6OUDTVRD-BUpYZsl-.js} +1 -1
  65. package/dist/dashboard/assets/{layout-ZskR1t-z.js → layout-BtCeXA1s.js} +1 -1
  66. package/dist/dashboard/assets/{linear-nhlpqszd.js → linear-D3Noa1lq.js} +1 -1
  67. package/dist/dashboard/assets/{lt-LT-XHIRWOB4-Ij6EZ9jl.js → lt-LT-XHIRWOB4-BLQA9Nda.js} +1 -1
  68. package/dist/dashboard/assets/{lv-LV-5QDEKY6T-o1fSS6fk.js → lv-LV-5QDEKY6T-BhK_4waX.js} +1 -1
  69. package/dist/dashboard/assets/{min-DWO9jrZ-.js → min-laN3ibId.js} +1 -1
  70. package/dist/dashboard/assets/{mindmap-definition-QFDTVHPH-hvcnCi0m.js → mindmap-definition-QFDTVHPH-Ij7b5o63.js} +1 -1
  71. package/dist/dashboard/assets/{mr-IN-CRQNXWMA-CbMNXet8.js → mr-IN-CRQNXWMA-DsA56L97.js} +1 -1
  72. package/dist/dashboard/assets/{my-MM-5M5IBNSE-BLZNRrAe.js → my-MM-5M5IBNSE-CPfcm668.js} +1 -1
  73. package/dist/dashboard/assets/{nb-NO-T6EIAALU-B3vJdKTo.js → nb-NO-T6EIAALU-B5MPTVpt.js} +1 -1
  74. package/dist/dashboard/assets/{nl-NL-IS3SIHDZ-B6D5z-iI.js → nl-NL-IS3SIHDZ-DaAOOzMv.js} +1 -1
  75. package/dist/dashboard/assets/{nn-NO-6E72VCQL-5zTuWq4x.js → nn-NO-6E72VCQL-8eqdmBWq.js} +1 -1
  76. package/dist/dashboard/assets/{oc-FR-POXYY2M6-CjWsH2WL.js → oc-FR-POXYY2M6-B0qF57BV.js} +1 -1
  77. package/dist/dashboard/assets/{pa-IN-N4M65BXN-BoIcIn-E.js → pa-IN-N4M65BXN-DDtpE07e.js} +1 -1
  78. package/dist/dashboard/assets/{percentages-BXMCSKIN-F5X-Tg4w.js → percentages-BXMCSKIN-CFEd2naP.js} +7 -7
  79. package/dist/dashboard/assets/{pica-kqAcDU9z.js → pica-DhmMmpov.js} +1 -1
  80. package/dist/dashboard/assets/{pieDiagram-DEJITSTG-nYd2z-pn.js → pieDiagram-DEJITSTG-Cmj6uNO2.js} +1 -1
  81. package/dist/dashboard/assets/{pl-PL-T2D74RX3-GchO6UuX.js → pl-PL-T2D74RX3-BhmMlvaA.js} +1 -1
  82. package/dist/dashboard/assets/{pt-BR-5N22H2LF-BUsepHJF.js → pt-BR-5N22H2LF-C9RdtZTM.js} +1 -1
  83. package/dist/dashboard/assets/{pt-PT-UZXXM6DQ-CCrWB7t1.js → pt-PT-UZXXM6DQ-Cs09dbxz.js} +1 -1
  84. package/dist/dashboard/assets/{quadrantDiagram-34T5L4WZ-CyQyFV43.js → quadrantDiagram-34T5L4WZ-CBhsDpDm.js} +1 -1
  85. package/dist/dashboard/assets/{requirementDiagram-MS252O5E-DzDNbaAz.js → requirementDiagram-MS252O5E-UqGmmvOP.js} +1 -1
  86. package/dist/dashboard/assets/{ro-RO-JPDTUUEW-Bg8qasSV.js → ro-RO-JPDTUUEW-BT0bLGb1.js} +1 -1
  87. package/dist/dashboard/assets/{ru-RU-B4JR7IUQ-l7KGf_aH.js → ru-RU-B4JR7IUQ-Ddg0_XYY.js} +1 -1
  88. package/dist/dashboard/assets/{sankeyDiagram-XADWPNL6-t78W7pty.js → sankeyDiagram-XADWPNL6-B2YpfOz1.js} +1 -1
  89. package/dist/dashboard/assets/{sequenceDiagram-FGHM5R23-C-A4YWsY.js → sequenceDiagram-FGHM5R23-DR-Ef2wv.js} +1 -1
  90. package/dist/dashboard/assets/{si-LK-N5RQ5JYF-Bvh5jeZQ.js → si-LK-N5RQ5JYF-DHNfYMV2.js} +1 -1
  91. package/dist/dashboard/assets/{sk-SK-C5VTKIMK-Cw6feZYR.js → sk-SK-C5VTKIMK-Ca43AL1V.js} +1 -1
  92. package/dist/dashboard/assets/{sl-SI-NN7IZMDC-B-NqJ9YS.js → sl-SI-NN7IZMDC-BIa1taRD.js} +1 -1
  93. package/dist/dashboard/assets/{stateDiagram-FHFEXIEX-DIcQEopN.js → stateDiagram-FHFEXIEX-DkoV190G.js} +1 -1
  94. package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-b_Rafygl.js +1 -0
  95. package/dist/dashboard/assets/{subset-shared.chunk-w-9tnfIy.js → subset-shared.chunk-CaY7_SwS.js} +1 -1
  96. package/dist/dashboard/assets/{subset-worker.chunk-BF01ymYz.js → subset-worker.chunk-BeRMJAeA.js} +1 -1
  97. package/dist/dashboard/assets/{sv-SE-XGPEYMSR-Ktas5ybY.js → sv-SE-XGPEYMSR-CefYINk3.js} +1 -1
  98. package/dist/dashboard/assets/{ta-IN-2NMHFXQM-WVntmT4J.js → ta-IN-2NMHFXQM-B9shz2rt.js} +1 -1
  99. package/dist/dashboard/assets/{th-TH-HPSO5L25-DP9jkhxy.js → th-TH-HPSO5L25-C4_khwyk.js} +1 -1
  100. package/dist/dashboard/assets/{timeline-definition-GMOUNBTQ-CQLRxE6-.js → timeline-definition-GMOUNBTQ-kDfiGIlx.js} +1 -1
  101. package/dist/dashboard/assets/{tr-TR-DEFEU3FU-DUBzAzD0.js → tr-TR-DEFEU3FU-BbWvclxA.js} +1 -1
  102. package/dist/dashboard/assets/{uk-UA-QMV73CPH-DBIjqvxV.js → uk-UA-QMV73CPH-rptFf1AT.js} +1 -1
  103. package/dist/dashboard/assets/{vennDiagram-DHZGUBPP-ChnhJ1dN.js → vennDiagram-DHZGUBPP-DwN27hmj.js} +1 -1
  104. package/dist/dashboard/assets/{vi-VN-M7AON7JQ-D47IGQ3F.js → vi-VN-M7AON7JQ-DD1C1F-4.js} +1 -1
  105. package/dist/dashboard/assets/{wardley-RL74JXVD-CnuAa4Oy.js → wardley-RL74JXVD-Bb5eAxHk.js} +1 -1
  106. package/dist/dashboard/assets/{wardleyDiagram-NUSXRM2D-D63qjR_j.js → wardleyDiagram-NUSXRM2D-bogdMmS3.js} +1 -1
  107. package/dist/dashboard/assets/{xychartDiagram-5P7HB3ND-BUdyr5Wc.js → xychartDiagram-5P7HB3ND-562jKD97.js} +1 -1
  108. package/dist/dashboard/assets/{zh-CN-LNUGB5OW-_ICN38Lj.js → zh-CN-LNUGB5OW-D0fnJQNq.js} +1 -1
  109. package/dist/dashboard/assets/{zh-HK-E62DVLB3-Bjez10pk.js → zh-HK-E62DVLB3-CyHkLQXi.js} +1 -1
  110. package/dist/dashboard/assets/{zh-TW-RAJ6MFWO-Do-CPv3_.js → zh-TW-RAJ6MFWO-BCkW9UHn.js} +1 -1
  111. package/dist/dashboard/index.html +2 -2
  112. package/dist/index.js +3013 -2488
  113. package/package.json +1 -1
  114. package/skill/SKILL.md +4 -3
  115. package/skill/references/brain-sync.md +119 -0
  116. package/skill/references/cli-reference.md +3 -6
  117. package/skill/references/integrations.md +22 -29
  118. package/skill/references/sleep.md +1 -1
  119. package/skill-sync/SKILL.md +2 -3
  120. package/skill-sync/references/merge-rules.md +101 -39
  121. package/dist/dashboard/assets/channel-CTaS69UP.js +0 -1
  122. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-DYWavBQh.js +0 -1
  123. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-DYWavBQh.js +0 -1
  124. package/dist/dashboard/assets/clone-Dpdgvgqp.js +0 -1
  125. package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-CFAZrDsQ.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dreamcontext",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "dreamcontext — the persistent brain for your AI agents. Remembers what you built, knows how your project works.",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -91,7 +91,7 @@ dreamcontext is **more than memory files**. Every capability below is real and s
91
91
  | **Web dashboard** | Local React UI: Kanban, Eisenhower matrix, brain graph, sleep tracker, council hall | [integrations.md](references/integrations.md) |
92
92
  | **Desktop app** | macOS Tauri app: multi-vault launcher, federation board, Sleepy notch capture | [integrations.md](references/integrations.md) |
93
93
  | **Federation** | Recall across multiple projects (vaults) live, read-only | [integrations.md](references/integrations.md) |
94
- | **✅ Team brain sync (shared repo)** | **Yes — a team can share ONE brain.** The whole `_dream_context/` becomes its own git repo (separate from the code repo); `sleep done` auto fetch→merge→commit→pushes it, and the `/dream-sync` skill resolves prose conflicts. Different from federation (read-only cross-project recall) and cloud task sync (tasks only). CLI shipped; one-click desktop flow is M2/pending. | [integrations.md](references/integrations.md) |
94
+ | **✅ Team brain sync (whole project)** | **Yes — a team OR one person across machines can share ONE brain.** Cloud sync pushes the WHOLE project (code + `.claude/` + `_dream_context/`) to its GitHub `origin` on the current branch (`full-repo`); when off it's `in-tree` (commit-only). `sleep done` auto fetch→merge→commit→pushes it; the `/dream-sync` skill resolves prose conflicts. Different from federation (read-only cross-project recall) and cloud task sync (tasks only). Each machine needs its own token. | [brain-sync.md](references/brain-sync.md) |
95
95
  | **Council** | Structured multi-persona debates with a synthesized verdict | [integrations.md](references/integrations.md) |
96
96
  | **Marketing (`mk`)** | Meta marketing skill: cohorts, campaigns, competitor ingest | [integrations.md](references/integrations.md) |
97
97
  | **Versions / releases** | Planning versions and releases unify in RELEASES.json | [tasks-and-features.md](references/tasks-and-features.md) |
@@ -364,7 +364,7 @@ All sub-agents get a lightweight context briefing via the SubagentStart hook. Wh
364
364
  - `dreamcontext upgrade` — upgrade the CLI, then (one command) update the desktop app if installed and offer to refresh **every registered project** to match (`--yes` does it all non-interactively). **Keeping projects + app updated is the CLI's job — you should not run per-project updates by hand or ask the user to.**
365
365
  - `dreamcontext doctor` — validate `_dream_context/` structure.
366
366
  - `dreamcontext dashboard` — open the web UI. `dreamcontext app install|update|status` — the desktop app.
367
- - **Team collaboration / shared brain** — when the user wants to **use one brain with other people** ("share the brain", "collaborate on tasks/knowledge together", "put the brain in its own repo"), that's the **shared brain repo**: `dreamcontext brain init` (create) / `brain attach <url>` (join) / `brain status`, auto-synced at `sleep done`, prose conflicts resolved by the **`/dream-sync`** skill. **Guide them into it — don't say "unsupported".** Setup is CLI-only today (the one-click desktop login/attach is M2/pending). Full surface → [integrations.md](references/integrations.md).
367
+ - **Team collaboration / shared brain / second machine** — when the user wants to **use one brain with other people or on another computer** ("share the brain", "collaborate on tasks/knowledge together", "sync my project to GitHub", "set it up on my other machine"), that's **whole-project cloud sync**: `dreamcontext brain enable` (turn it on needs a GitHub `origin`) / `brain status`, auto-synced at `sleep done`, prose conflicts resolved by the **`/dream-sync`** skill. **Guide them into it — don't say "unsupported".** Two modes (`full-repo` when on / `in-tree` when off), per-machine token, and cross-OS setup → [brain-sync.md](references/brain-sync.md).
368
368
 
369
369
  ---
370
370
 
@@ -414,5 +414,6 @@ Open these with `Read` when the task needs depth:
414
414
  - **[tasks-and-features.md](references/tasks-and-features.md)** — task protocol depth, RICE, due dates, people/assignees, Workflow flowchart, features, versioning, multi-product.
415
415
  - **[knowledge-and-recall.md](references/knowledge-and-recall.md)** — knowledge files, pinning, recall modes, taxonomy, Excalidraw/diagrams.
416
416
  - **[sleep.md](references/sleep.md)** — full consolidation flow, specialist contracts, deep sleep, epoch safety, reflect, marketing/council passes.
417
- - **[integrations.md](references/integrations.md)** — ClickUp/GitHub task sync (one cloud backend at a time), **team brain sync (shared brain repo `brain init`/`attach`/`sync`, `/dream-sync` conflict resolution)**, dashboard, desktop app, federation/vaults, council, marketing.
417
+ - **[brain-sync.md](references/brain-sync.md)** — **whole-project GitHub cloud sync**: the two modes (full-repo/in-tree), setup, per-machine token + auth, shared vs machine-local config, lifecycle, **cross-OS setup**, and the silent-failure troubleshooting playbook.
418
+ - **[integrations.md](references/integrations.md)** — ClickUp/GitHub task sync (one cloud backend at a time), dashboard, desktop app, federation/vaults, council, marketing. (Brain sync has its own reference above.)
418
419
  - **[improving-dreamcontext.md](references/improving-dreamcontext.md)** — the feedback loop, when and how to file.
@@ -0,0 +1,119 @@
1
+ # Brain sync (GitHub cloud sync for the whole project)
2
+
3
+ The one reference for **cloud sync** — what it is, the two modes, how it's set up, how it authenticates, what it syncs, the cross-machine / cross-OS setup, and how to diagnose it when it silently stops. This is a *different* feature from **cloud task sync** (ClickUp/GitHub Issues — tasks only) and **federation** (read-only recall across your own separate projects — nothing is copied). Say so if the user conflates them.
4
+
5
+ **Guide the user into this** the moment they say *"use this with my team / on another machine," "share the brain," "sync my project to GitHub."* Do NOT answer "we don't support that" — this is the feature.
6
+
7
+ ## What it is
8
+
9
+ The project (your code + `.claude/` + the brain under `_dream_context/`) is synced to the project's **own GitHub repo** and kept in sync across people/machines. Local markdown + JSON on disk stays canonical (local-first); **git is just the transport**, not a new database. Merges are **agent-assisted and semantic**: the CLI auto-resolves deterministic files itself and only defers overlapping *prose* edits to the `/dream-sync` skill.
10
+
11
+ A **master switch** (cloud sync ON/OFF) gates everything: `dreamcontext brain enable` / `brain disable`, resolved and shown by `dreamcontext brain status`. There is one shared, whole-project model — `.claude/` and `_dream_context/` live in the code repo and travel together, so there is no separate brain repo and no symlink layer to maintain.
12
+
13
+ ## The two sync modes
14
+
15
+ Mode lives in `_dream_context/state/.config.json` under `brainRepo.mode`. **Anything not `full-repo` resolves to `in-tree`.**
16
+
17
+ | Mode | Git root | Remote | Branch | What lands on the remote | Auto-push? |
18
+ |---|---|---|---|---|---|
19
+ | **`full-repo`** | the **project root** (the whole project is the repo) | the project's own `origin` | the **current** branch (never assumes `main`) | the **entire project** — code + `.claude/` + `_dream_context/` nested inside it | **Yes** |
20
+ | **`in-tree`** (default) | the project root | — | — | nothing pushed — **commit-only**, stages `_dream_context/` and commits locally | **No, never** |
21
+
22
+ - **`full-repo`** is cloud sync turned ON: the whole project folder is the synced repo (brain nested under `_dream_context/`, plus root `CLAUDE.md` / `.claude/`). It **refuses on a detached HEAD** (`detached-head`) and force-writes machine-local excludes into the project-root `.gitignore` before every sync so secrets/lock files never get staged by `git add -A`.
23
+ - **`in-tree`** is the safe default (cloud sync OFF): it commits the brain alongside your code but **never pushes** — turn cloud sync on to promote it to `full-repo`.
24
+
25
+ **Turning it on/off:** cloud sync is the master switch. Enable it from the **dashboard** (Settings → Brain → Cloud sync toggle; server route `POST /api/brain/settings`) or the CLI (`dreamcontext brain enable`). Enabling requires the project to already have a GitHub `origin` (it errors `no_origin` otherwise) and flips the mode to `full-repo`; disabling reverts to `in-tree`.
26
+
27
+ ## Set it up (CLI)
28
+
29
+ ```bash
30
+ # 0. Token FIRST — every push needs it (see Auth for scope + resolution order).
31
+ dreamcontext config github-token "$(gh auth token)" # per-MACHINE token; gitignored, never travels with the repo
32
+
33
+ # 1. Make sure the project has a GitHub origin (full-repo pushes to it).
34
+ git remote add origin https://github.com/<you-or-org>/<repo>.git # skip if it already has one
35
+
36
+ # 2. Turn cloud sync ON — flips the project to full-repo (whole project → origin, current branch).
37
+ dreamcontext brain enable
38
+
39
+ dreamcontext brain status # verify: mode full-repo, remote, resolved cloud-sync switch
40
+ ```
41
+
42
+ Every push uses the **same resolved token**, so set the token (or be logged into dreamcontext for the global store) *before* enabling. (PowerShell/cmd have no `$(…)` — use `dreamcontext config github-token <token>` or set `GITHUB_TOKEN`.) Because the whole project is the synced unit, `CLAUDE.md` and `.claude/` are already at the project root and sync natively — nothing extra to wire up.
43
+
44
+ ## Auth — how sync authenticates (NOT gh, NOT the keychain)
45
+
46
+ The token is resolved by **`resolveBrainSyncToken`, secrets-first, env-last**:
47
+
48
+ 1. per-project `_dream_context/state/.secrets.json` → `github.token` (set via `dreamcontext config github-token`)
49
+ 2. global `~/.dreamcontext/.secrets.json` → `github.token` (the account you logged into dreamcontext as)
50
+ 3. env `GITHUB_TOKEN`, then `GH_TOKEN`
51
+
52
+ **The `gh` CLI and git credential helpers are never consulted** — helpers are actively disabled on every networked git call (`-c credential.helper=`), and the token is handed to git only through a `GIT_ASKPASS` helper pointed at a fresh **0600** temp file (never in the remote URL or argv). `.secrets.json` is written **gitignore-first** (the write aborts if it can't be ignored) and chmod **0600**.
53
+
54
+ > **Required scope (this bites people):** sync **pushes repo contents**, so the token needs classic **`repo`** scope, or a fine-grained PAT with **Contents: read & write** on the project repo. `config github-token` writes the SAME per-project store the GitHub-Issues *task* backend uses — but a fine-grained **Issues-only** token (enough for task sync) will authenticate that and yet **silently fail every push**. When in doubt, use a classic `repo` token or a fine-grained PAT that includes Contents:write.
55
+
56
+ ## Shared vs machine-local config (important)
57
+
58
+ - **`state/.config.json` — SYNCS** across machines/teammates. It holds the `brainRepo` block: **`mode`, `enabled`, `autoSync`**. Consequence: **an explicit `mode` or `enabled` propagates to everyone** on the next sync — they are a *shared* decision, not per-machine.
59
+ - **`state/.brain-local.json` — MACHINE-LOCAL** (gitignored). Only runtime bookkeeping: `lastFetchAt`, `pulledUpdates`, `pendingAgentMerge`, `needsTaskSync`, `codeRepoPath`. This is what keeps two machines from clobbering each other's sync state.
60
+ - **`enabled` resolution:** an explicit `true`/`false` in `.config.json` wins (and is shared). If **absent**, it's **derived per-machine** — ON iff this machine is GitHub-connected (local `origin` is github.com, OR `taskBackend=github`), else OFF. So the *default* is per-machine; an *explicit* toggle is global.
61
+
62
+ ## Lifecycle — when sync happens
63
+
64
+ - **Session start:** a **detached, non-blocking** `brain sync --pull-only` fires in the background (only when `enabled` + mode `full-repo` + `autoSync`; honors `DREAMCONTEXT_BRAIN_SYNC=0`). Its results land on the **NEXT** session (you see the previous pull's `pulledUpdates`).
65
+ - **`sleep done`:** runs a foreground `brain sync` (fetch → merge → commit → push) when `autoSync` is set. **Sync failure never fails sleep** — but on a prose conflict it pauses with `awaiting-agent` and prints the `/dream-sync` prompt.
66
+ - **Manual, any time:** `dreamcontext brain sync` (flags: `--pull-only`, `--push-only`, `--strict`, `--continue`, `--resume`).
67
+ - **Commit messages** (so you can recognize them): `chore: sync project (dreamcontext)` (full-repo), `chore(brain): sync` (in-tree commit-only), `chore(brain): merge team updates` (auto-merge), `… (agent-resolved)` (after `/dream-sync`).
68
+
69
+ **Conflicts:** deterministic files — JSON (changelog/releases/config/taxonomy) and task `.md` — are auto-merged by the CLI. Only overlapping edits to the **same `##` section of a knowledge/feature (prose) doc** defer to the agent (`awaiting-agent`): a report with base/ours/theirs snapshots is written to `state/.brain-merge/`, the `/dream-sync` skill writes the real merge, and `brain sync --continue` commits it. Real **code** conflicts go to the human with native git markers (never to the agent). A **scrub gate** runs before every commit and push (BLOCK always stops it; WARN stops only under `--strict` or a headless pull-only).
70
+
71
+ ## Cross-machine / cross-OS setup
72
+
73
+ The project is portable, but each machine needs a few things right. **The #1 real-world failure is a machine with no token — sync then silently no-ops.**
74
+
75
+ - **Every machine needs its own token.** `.secrets.json` is gitignored, so the token does **not** travel with the repo. On each new machine run **`dreamcontext config github-token "$(gh auth token)"`** (or set `GITHUB_TOKEN`, or log in so the global `~/.dreamcontext/.secrets.json` is populated). No `gh`/keychain fallback exists — if none of the three token sources is set, push/pull just quietly do nothing.
76
+ - **The project must be its OWN git root (the enclosing-repo trap).** In `full-repo` the repo root must be the project folder. Verify: `git -C <project> rev-parse --show-toplevel` should print *that* folder — **not climb into an enclosing parent repo** (e.g. a home-directory `~/.git`). If sync targets the wrong tree, hunt for a parent `.git` above the folder and remove its stray `origin`.
77
+ - **Windows / WSL — line endings.** dreamcontext does **not** normalize CRLF. On Windows, set `git config core.autocrlf false` (or commit a `.gitattributes` with `* text=lf`) in the project repo to avoid phantom whole-file conflicts on markdown/JSON. A mixed Windows⇄WSL checkout of the *same* folder is the highest-risk setup — pick one.
78
+ - **Node/npx must be on PATH for GUI-launched agents.** The background pull launches via the node binary directly (not a bare `dreamcontext`), so a minimal Finder/Explorer PATH is tolerated — but the CLI itself must be installed on each machine.
79
+ - **Credential helpers are bypassed by design**, so macOS Keychain / Windows Credential Manager / libsecret differences don't matter — auth is only the resolved token via askpass.
80
+ - **No symlinks involved.** Because the whole project syncs natively, `CLAUDE.md`/`.claude/` are plain files at the project root on every OS — no symlink layer, so Windows Developer-Mode / elevation is never required for cloud sync.
81
+
82
+ **Per-OS quick matrix**
83
+
84
+ | | macOS | Linux | Windows / WSL |
85
+ |---|---|---|---|
86
+ | Token | `config github-token "$(gh auth token)"` | same | same (in WSL use the WSL `gh`; native Windows: `GITHUB_TOKEN` or dashboard login) |
87
+ | Line endings | fine | fine | **set `core.autocrlf false`** |
88
+ | Git root check | `rev-parse --show-toplevel` | same | same |
89
+ | Keychain/helper | bypassed | bypassed | bypassed |
90
+ | `CLAUDE.md` / `.claude/` | plain files (sync natively) | native | native (no symlinks, no Developer Mode needed) |
91
+ | Token scope | `repo` / Contents:write | same | same (an Issues-only fine-grained token won't push) |
92
+
93
+ **Operating rule — sleep before you leave a machine.** `sleep done` pushes the consolidated state, so the next machine pulls clean. Skipping it is the main way two machines drift into an avoidable prose conflict.
94
+
95
+ ## Onboarding a second machine (same user) — checklist
96
+
97
+ **On Windows, read the Cross-OS section first** — the token syntax (step 2) and `core.autocrlf` (step 5) differ.
98
+
99
+ 1. `git clone <project-url>` — the whole project (code + `.claude/` + `_dream_context/`).
100
+ 2. `dreamcontext config github-token "$(gh auth token)"` — the per-machine token (Windows: `config github-token <token>` or `GITHUB_TOKEN`; scope must include Contents:write).
101
+ 3. `dreamcontext brain status` — confirm mode `full-repo`, remote, cloud-sync ON, right git root.
102
+ 4. `dreamcontext brain sync --pull-only` — take the latest, verify a clean pull.
103
+ 5. On Windows: `git config core.autocrlf false` first.
104
+
105
+ ## When sync is "silently failing" (troubleshooting)
106
+
107
+ Failures are swallowed by design (they never fail sleep or block a session). When a user says *"my teammate isn't seeing my changes"* / *"the other machine is stale,"* run this, in order:
108
+
109
+ 1. **`dreamcontext brain status`** — is cloud sync ON (and *why* — explicit vs derived)? Right `mode` and `remote`? Any `mergeInProgress` / `pendingAgentMerge`?
110
+ 2. **Token present?** Check `state/.secrets.json` (or global / `GITHUB_TOKEN`). No token = silent no-op — the most common cause. Set it and retry.
111
+ 3. **`dreamcontext brain scrub`** — a scrub-gate BLOCK is the #1 *silent* blocker; it stops the push before anything leaves. Fix the flagged secret/absolute-path and re-sync.
112
+ 4. **`dreamcontext brain sync --push-only`** (foreground) — forces the error to the surface instead of the background swallowing it.
113
+ 5. **Detached HEAD** → `detached-head` refusal. Check out a branch.
114
+ 6. **Wrong git root** → the enclosing-repo trap above (`rev-parse --show-toplevel`).
115
+ 7. **`pendingAgentMerge` / `awaiting-agent`** → a prose conflict is waiting: run **`/dream-sync`**, then `brain sync --continue`.
116
+
117
+ ## `brain` command surface (5 subcommands)
118
+
119
+ `status`, `enable`, `disable`, `scrub`, `sync`. (`sync` flags: `--pull-only`, `--push-only`, `--strict`, `--continue`, `--resume` — the last two are attended-only; never drive them unattended.) `brain enable` turns cloud sync ON (whole-project `full-repo` sync — needs a GitHub `origin`); `brain disable` reverts to `in-tree`. Merge internals live in the `/dream-sync` skill and `skill-sync/references/merge-rules.md`; full feature status in `knowledge/features/brain-repo-sync.md`.
@@ -214,13 +214,10 @@ Sync the WHOLE brain (`_dream_context/`) — tasks, knowledge, features, sleep s
214
214
 
215
215
  | Command | Description |
216
216
  |---|---|
217
- | `brain status` | Show brain-repo mode (`separate`/`in-tree`), remote, sync state, and whether cloud sync is ON. Reports `mergeInProgress` / `pendingAgentMerge` (the `/dream-sync` handoff signals). |
218
- | `brain init` | Create a NEW brain repo on GitHub (**private by default**) and push a scrubbed first commit. `--public` (requires interactive confirm), `--code-repo <url>` (store a pointer to the paired code repo). |
219
- | `brain attach <url>` | Attach an EXISTING team brain repo a **TRUST decision** (S6): prints a trust warning + incoming-diff preview and refuses without confirmation. `-y/--yes` to skip the prompt. |
220
- | `brain discover` | List `dreamcontext-brain`-topic repos you can access on GitHub. |
217
+ | `brain status` | Show sync mode (`full-repo`/`in-tree`), remote, sync state, and whether cloud sync is ON. Reports `mergeInProgress` / `pendingAgentMerge` (the `/dream-sync` handoff signals). |
218
+ | `brain enable` | Turn cloud sync ON sync the WHOLE project (code + `.claude/` + `_dream_context/`) to its GitHub `origin` on the current branch (`full-repo`). Needs a GitHub `origin`. |
219
+ | `brain disable` | Turn cloud sync OFFrevert to `in-tree` (the brain is still committed locally, never pushed). |
221
220
  | `brain sync` | Fetch → semantic-merge-on-conflict → commit → push (or, in `in-tree` mode, commit-only — never auto-pushes). `--pull-only` (take team content in, never push), `--push-only`, `--strict` (WARN scrub hits block too), `--resume` / `--continue` (the attended `/dream-sync` handoff — see below). |
222
- | `brain enable` / `brain disable` | Explicit master switch for cloud sync on this project (v3.3). |
223
- | `brain platform` | Carry the Claude Code layer (CLAUDE.md + `.claude/`) INSIDE the brain repo: moves them into `_dream_context/platform/` and symlinks them back from the project root, so they sync with the team. Missing root symlinks are re-created automatically by every `brain sync` (fresh clones self-wire) and flagged by `doctor`. `--status` reports without changing anything. Machine-local files (`platform/.claude/settings.local.json`, `scheduled_tasks.lock`) never sync. |
224
221
  | `brain scrub` | Dry-run the secrets/absolute-path scrub gate against the current staged tree. |
225
222
 
226
223
  **Automatic sync:** every `dreamcontext sleep done` runs a brain sync (fetch/merge/commit/push); failure never fails sleep. Session-start does a non-blocking background pull. **On an agent-class merge conflict** (two people edited the same prose section) the CLI stops at `already-awaiting-agent` and defers to the **`/dream-sync` skill** — the agent half that reads base/ours/theirs and writes the semantic merge, then `brain sync --continue`. Never drive `--resume`/`--continue` unattended.
@@ -214,56 +214,49 @@ dreamcontext federation purge --dry-run # preview
214
214
 
215
215
  ---
216
216
 
217
- ## ✅ Team brain sync (shared brain repo) — collaborate on ONE brain
217
+ ## ✅ Team brain sync (whole project) — collaborate on ONE brain
218
218
 
219
- **Yes, a team can share a single dreamcontext brain.** The whole `_dream_context/` (tasks, knowledge, features, sleep state) becomes **its own git repo** with its own remote separate from the code repo and the CLI/desktop app push/pull/merge it the way a team collaborates on code. The brain stays plain markdown/JSON on disk (local-first); git is just the sync transport, not a new database.
219
+ **Yes, a team can share a single dreamcontext brain.** Cloud sync pushes the **whole project** your code, `.claude/`, and the brain nested under `_dream_context/` to the project's own GitHub `origin` on the current branch, and the CLI/desktop app push/pull/merge it the way a team collaborates on code. The brain stays plain markdown/JSON on disk (local-first); git is just the sync transport, not a new database. Because `.claude/` and `_dream_context/` already live in the code repo, they travel together — there is no separate brain repo and no symlink layer to maintain.
220
220
 
221
- **Guide the user here** the moment they say *"I want to use this with my team / with other people," "share the brain," "collaborate on tasks/knowledge together,"* or *"put the brain in its own repo."* Do NOT answer "we don't support that" — this is the feature.
221
+ **Guide the user here** the moment they say *"I want to use this with my team / with other people," "share the brain," "collaborate on tasks/knowledge together,"* or *"set it up on my other machine."* Do NOT answer "we don't support that" — this is the feature.
222
+
223
+ > **Full reference → [brain-sync.md](brain-sync.md)** — the two modes (full-repo / in-tree), per-machine token + auth, shared vs machine-local config, **cross-OS setup**, and the silent-failure troubleshooting playbook. The section below is the quick tour.
222
224
 
223
225
  **How it differs from its neighbors** (say this if the user conflates them):
224
226
  - **Cloud task sync** (ClickUp/GitHub Issues) — mirrors only *tasks* to a task manager, one backend at a time.
225
227
  - **Federation** — read-only recall across your OWN separate projects; nothing is ever copied.
226
- - **Shared brain repo (this)** — the *whole* brain is one git-synced artifact several people edit together.
228
+ - **Whole-project sync (this)** — the *whole* project (code + brain) is one git-synced artifact several people edit together.
227
229
 
228
- ### Onboarding a team (M1 — CLI, shipped today)
230
+ ### Onboarding a team
229
231
 
230
232
  ```bash
231
- # Person Acreate a brand-new shared brain repo (PRIVATE by default) and push a scrubbed first commit
232
- dreamcontext brain init --code-repo https://github.com/acme/app # pointer back to the paired code repo
233
+ # Each person / each machine set a per-MACHINE token (gitignored, never travels with the repo)
234
+ dreamcontext config github-token "$(gh auth token)"
233
235
 
234
- # Person B (and every teammate) attach the existing brain repo (a TRUST decision: it loads every session)
235
- dreamcontext brain discover # list dreamcontext-brain-topic repos you can access
236
- dreamcontext brain attach https://github.com/acme/app-brain # trust warning + diff preview, then confirm
236
+ # Make sure the project has a GitHub origin (full-repo pushes to it), then turn cloud sync ON
237
+ git remote add origin https://github.com/acme/app.git # skip if it already has one
238
+ dreamcontext brain enable # flips the project to full-repo (whole project → origin)
237
239
 
238
- dreamcontext brain status # mode (separate/in-tree), remote, sync state, cloud-sync switch
240
+ dreamcontext brain status # mode (full-repo/in-tree), remote, sync state, cloud-sync switch
239
241
  ```
240
242
 
243
+ Teammates just `git clone` the project and run the same two steps (token + `brain enable`). Cloud sync can also be toggled from the dashboard (Settings → Brain → Cloud sync).
244
+
241
245
  ### Day-to-day (mostly automatic)
242
246
 
243
- - **Every `sleep done`** fetches → semantic-merges on conflict → commits → pushes the brain (sync failure never fails sleep). **Session start** does a non-blocking background pull. So teammates' consolidated context reaches everyone without a manual step.
247
+ - **Every `sleep done`** fetches → semantic-merges on conflict → commits → pushes the project (sync failure never fails sleep). **Session start** does a non-blocking background pull. So teammates' consolidated context reaches everyone without a manual step.
244
248
  - **Manual sync any time:** `dreamcontext brain sync` (or `--pull-only` to just take team content in).
245
- - **On a prose merge conflict** (two people edited the same `##` section of a knowledge/feature doc), the CLI resolves every deterministic file itself and stops at `already-awaiting-agent`, deferring the rest to the **`/dream-sync` skill** — the agent reads base/ours/theirs snapshots, writes the real semantic merge, and hands back with `brain sync --continue`. (`--resume`/`--continue` are attended-only; never drive them unattended.)
246
-
247
- ### Platform layer — share CLAUDE.md + .claude with the team
248
-
249
- A separate-mode brain repo is rooted at `_dream_context/`, so the Claude Code files at the
250
- project root (CLAUDE.md, `.claude/` skills/agents/hooks) would never sync on their own.
251
- `dreamcontext brain platform` fixes that: it moves them into `_dream_context/platform/` and
252
- symlinks them back from the project root (Claude Code resolves the links transparently).
253
- From then on they sync with the brain like everything else; every `brain sync` re-creates
254
- missing root symlinks on a fresh clone, and `doctor` flags broken links. Machine-local files
255
- (`platform/.claude/settings.local.json`, `scheduled_tasks.lock`) stay gitignored.
256
- `brain platform --status` reports without changing anything.
249
+ - **On a prose merge conflict** (two people edited the same `##` section of a knowledge/feature doc), the CLI resolves every deterministic file itself and stops at `already-awaiting-agent`, deferring the rest to the **`/dream-sync` skill** — the agent reads base/ours/theirs snapshots, writes the real semantic merge, and hands back with `brain sync --continue`. A real **code** conflict is left for the human's editor with native git markers (never sent to the agent). (`--resume`/`--continue` are attended-only; never drive them unattended.)
257
250
 
258
251
  ### Editing / reconfiguring
259
252
 
260
- - **Turn cloud sync on/off:** `dreamcontext brain enable` / `brain disable`.
261
- - **Modes:** `separate` (own remote, full auto-sync) vs `in-tree` (brain nested in the code repo — commit-only, **never** auto-pushes; the safe default). Both always run the scrub gate.
262
- - **Safety rails (always on):** brain repos default **private** (`--public` needs an explicit confirm); a **scrub gate** blocks secrets / absolute local paths before every commit and push; tokens are supplied via `GIT_ASKPASS` (never embedded in the remote URL); per-machine indexes/caches are gitignored and never pushed.
253
+ - **Turn cloud sync on/off:** `dreamcontext brain enable` / `brain disable`, or the dashboard Settings → Brain toggle.
254
+ - **Modes:** `full-repo` (cloud sync ON — whole project → its own `origin`, on the current branch; needs a GitHub `origin`) · `in-tree` (cloud sync OFF — commit-only, **never** auto-pushes; the safe default). Both run the scrub gate. Full detail + cross-OS setup → [brain-sync.md](brain-sync.md).
255
+ - **Safety rails (always on):** a **scrub gate** blocks secrets / absolute local paths before every commit and push; the project-root `.gitignore` is force-written with the machine-local brain excludes + secrets before every whole-project stage; tokens are supplied via `GIT_ASKPASS` (never embedded in the remote URL); per-machine indexes/caches are gitignored and never pushed.
263
256
 
264
- ### From the desktop app? — M2, PENDING (not yet shipped)
257
+ ### From the desktop app
265
258
 
266
- The one-click UX — **GitHub device-flow login from the Launcher, a repo picker over your `dreamcontext-brain`-topic repos, UI "create"/"attach" with the trust preview, and a team-updates badge** is **M2, still pending**. Today the shared-brain setup is **CLI-only** (a technical user runs `brain init` / `brain attach`). Be honest about this: a non-technical teammate can't yet do the *setup* from the app; once attached, the normal dashboard/app reads the shared brain like any other. (Full status: `knowledge/features/brain-repo-sync.md`; merge internals: `skill-sync/references/merge-rules.md`.)
259
+ **GitHub device-flow login from the Launcher** and the dashboard **Settings Brain Cloud-sync toggle** turn whole-project sync on/off (with a **team-updates badge** and a one-click "Resolve with AI" for a deferred prose merge). (Full status: `knowledge/features/brain-repo-sync.md`; merge internals: `skill-sync/references/merge-rules.md`.)
267
260
 
268
261
  ---
269
262
 
@@ -56,7 +56,7 @@ For non-file-change work (architecture discussion, a decision with no edits): `d
56
56
  **Insight-fed objectives:** if `_dream_context/lab/insights/` is non-empty, also run `dreamcontext lab list` — an objective fed by a bound insight (`binding.objective` in the manifest) has a *measured* KR `current` owned by `lab sync`; no specialist hand-writes it. Surface any bound insight whose cache is stale or errored ("KR for `<objective>` is fed by insight `<slug>`, last synced `<date>` — suggest `dreamcontext lab sync <slug>`"). **Sleep NEVER runs `lab sync`** — credentials, latency, non-determinism; refreshing is always an explicit user/agent action outside sleep.
57
57
  8. **Marketing pass** if `_dream_context/marketing/` exists: `dreamcontext mk rem-sleep`.
58
58
  9. **Council promote check:** `dreamcontext council list --unpromoted` — promote if the user engaged positively.
59
- 10. **`dreamcontext sleep done "<one-paragraph summary stitched from specialist reports>"`** — clears pre-epoch state, resets debt, writes a history entry. (If a remote backend — ClickUp or GitHub — is active and any task pushes failed, this auto-retries once, then errors loudly with the failed slugs.)
59
+ 10. **`dreamcontext sleep done "<one-paragraph summary stitched from specialist reports>"`** — clears pre-epoch state, resets debt, writes a history entry. (If a remote backend — ClickUp or GitHub — is active and any task pushes failed, this auto-retries once, then errors loudly with the failed slugs.) **Brain sync also fires here:** if a shared brain repo is active (`brainRepo.autoSync`), `sleep done` runs a foreground `brain sync` (fetch→merge→commit→push). Sync failure never fails sleep — but on a prose conflict it pauses with `awaiting-agent` and prints the `/dream-sync` prompt; run that skill, then `brain sync --continue`. Full model → [brain-sync.md](brain-sync.md).
60
60
  11. **Report** the consolidated summary to the user.
61
61
 
62
62
  ---
@@ -66,9 +66,8 @@ Read `_dream_context/state/.brain-merge/report.json`. For each entry in `deferre
66
66
  section-by-section — sections only one side touched keep that side's version; sections BOTH
67
67
  touched are the ones you're here for — read them and write prose that keeps both people's point,
68
68
  reconciling wording, not concatenating raw diffs.
69
- 3. Stage it — run `git add <path>` inside the brain repo (in `separate` mode, the brain repo root
70
- IS `_dream_context/`; in `in-tree` mode, it's the code repo root and `path` already carries the
71
- `_dream_context/` prefix).
69
+ 3. Stage it — run `git add <path>` at the project root (the git root is the project folder, so
70
+ `path` carries the `_dream_context/` prefix).
72
71
 
73
72
  Do this for every entry in `deferred` before moving on — `--continue` commits everything staged in
74
73
  one shot.
@@ -5,23 +5,28 @@ plan v3.3). The CLI (`src/lib/git-sync/*`) implements everything on this page.
5
5
 
6
6
  ## 1. Modes
7
7
 
8
- - **`separate`** — the brain (`_dream_context/`) lives in its own git repo + remote. Full
9
- auto-sync: fetch merge commit push. Opt-in (`dreamcontext brain init`/`attach`).
10
- - **`in-tree`** the brain is nested inside the code repo (the default for every existing
11
- project). **Commit-only — NEVER auto-pushes** (a push here would push the code repo). The scrub
12
- gate still runs before every in-tree commitan in-tree commit lands in the code repo's history
13
- and can be pushed to a public OSS remote by the user's own normal `git push`.
8
+ - **`full-repo`** — cloud sync ON: the WHOLE project (code + `.claude/` + `_dream_context/`) is the
9
+ synced unit, pushed to the project's own `origin` on the CURRENT branch. Full auto-sync: fetch
10
+ merge commit push. Enabled via `dreamcontext brain enable` or the Settings toggle (requires a
11
+ GitHub `origin`).
12
+ - **`in-tree`** (default)cloud sync OFF: the brain is nested inside the code repo. **Commit-only —
13
+ NEVER auto-pushes.** The scrub gate still runs before every in-tree commit an in-tree commit
14
+ lands in the code repo's history and can be pushed to a public OSS remote by the user's own normal
15
+ `git push`.
14
16
 
15
17
  ## 2. Cloud-sync master switch (v3.3)
16
18
 
17
19
  `brainRepo.enabled` (explicit) always wins. Absent ⇒ derived: **ON** iff the project is already
18
- GitHub-connected (code repo's `origin` is a `github.com` URL, OR `taskBackend==='github'`, OR a
19
- `brainRepo.remote` is configured) — **OFF** otherwise (new/unconnected projects stay off until the
20
- user runs `dreamcontext brain enable` or flips the Settings toggle). When OFF: `sleep done` skips
21
- the whole block with one dim line, the session-start pull is never spawned, and `brain sync`
22
- returns `action:'disabled'`.
20
+ GitHub-connected (code repo's `origin` is a `github.com` URL, OR `taskBackend==='github'`) **OFF**
21
+ otherwise (new/unconnected projects stay off until the user runs `dreamcontext brain enable` or
22
+ flips the Settings toggle). Enabling flips the mode to `full-repo`; disabling reverts to `in-tree`.
23
+ When OFF: `sleep done` skips the whole block with one dim line, the session-start pull is never
24
+ spawned, and `brain sync` returns `action:'disabled'`.
23
25
 
24
- ## 3. Tracked vs local — the brain repo's own `.gitignore`
26
+ ## 3. Tracked vs local — machine-local excludes under `_dream_context/`
27
+
28
+ In `full-repo` the whole project is staged with `git add -A` at the project root, so the project's
29
+ own `.gitignore` must exclude the machine-local brain runtime + secrets (prefixed `_dream_context/`).
25
30
 
26
31
  | Path | `taskBackend=local` | `taskBackend=github`/`clickup` |
27
32
  |---|---|---|
@@ -33,21 +38,12 @@ returns `action:'disabled'`.
33
38
  | `state/.secrets.json`, `.sleep.json`, `.sleep-history.json`, `.agent-sessions.json`, `.session-digests/`, `.conflicts/`, `.brain-merge/`, `.version-check.json`, `.auto-upgrade.json`, `.brain-local.json`, `.lab-prefs.json`, `.tasks-map.json`, `.tasks-sync.*`, `.tasks-queue.json`, `.obsidian/`, `tmp/`, `**/.env`, `**/.DS_Store` | gitignored | gitignored |
34
39
  | `lab/**` (insights + cache) | tracked | tracked |
35
40
  | `lab/credentials.json` / `lab/credentials.*` (except the tracked `credentials.example.json`) | gitignored | gitignored |
36
- | `platform/**` (Claude Code layer: CLAUDE.md + .claude) | tracked | tracked |
37
- | `platform/.claude/settings.local.json`, `platform/.claude/scheduled_tasks.lock` | gitignored | gitignored |
38
-
39
- Built by `buildBrainGitignore(taskBackend)` (`src/lib/git-sync/brain-repo.ts`) and written on
40
- bootstrap (`brain init`/`attach`); `ensureLocalOnlyArtifacts` re-asserts it after a clone/pull.
41
41
 
42
- ## 3b. Platform layer CLAUDE.md + .claude travel with the brain
43
-
44
- A separate-mode brain repo is rooted at `_dream_context/`, so the Claude Code project files at
45
- the PROJECT root would never sync. `dreamcontext brain platform` migrates them: the real files
46
- move to `_dream_context/platform/{CLAUDE.md,.claude}` and the project root keeps relative
47
- symlinks into it (Claude Code resolves them transparently). On every `runBrainSync` the engine
48
- best-effort re-creates missing root symlinks (`healPlatformLinks`), so a fresh clone of the brain
49
- is fully wired after its first sync; `doctor` flags missing links and root-vs-platform conflicts.
50
- Machine-local runtime files inside `platform/.claude/` (see table) never sync.
42
+ The `_dream_context/.gitignore` is built by `buildBrainGitignore(taskBackend)` and the project-root
43
+ excludes by `ensureFullRepoGitignore(projectRoot, taskBackend)` (both `src/lib/git-sync/brain-repo.ts`),
44
+ written gitignore-first before every whole-project stage; `ensureLocalOnlyArtifacts` re-asserts the
45
+ `_dream_context/.gitignore` after a clone/pull. `CLAUDE.md` and `.claude/` are plain files at the
46
+ project root and sync natively no separate brain repo, no platform-layer symlinks.
51
47
 
52
48
  ## 4. Credential supply (GIT_ASKPASS — decision F)
53
49
 
@@ -74,8 +70,8 @@ global `~/.dreamcontext/.secrets.json` tier between the two.)
74
70
 
75
71
  ## 6. Scrub gate (decisions — BLOCK vs WARN)
76
72
 
77
- Runs before EVERY brain content commit: in-tree, separate, `brain init`'s first commit, `brain
78
- detach`, and after every merge (a merge can reintroduce a secret).
73
+ Runs before EVERY commit: in-tree commits, the full-repo whole-project push, and after every merge
74
+ (a merge can reintroduce a secret).
79
75
 
80
76
  - **BLOCK** (aborts everywhere, loudly, non-zero exit): GitHub PAT/OAuth tokens, AWS/Google/Slack/
81
77
  OpenAI/Anthropic/Stripe keys, private-key headers, 3-part JWTs.
@@ -145,13 +141,20 @@ report is a LIVE handoff — never auto-cleared, consumable only via `--resume`.
145
141
 
146
142
  ## 10. The reentrancy guard — 5-clause precedence (v3.2)
147
143
 
148
- Every `runBrainSync` call (separate mode only — in-tree bypasses this entirely, see §1) checks, in
144
+ Every `runBrainSync` call (full-repo only — in-tree bypasses this entirely, see §1) checks, in
149
145
  order, BEFORE acquiring the lock:
150
146
 
151
147
  1. **Flag misuse** → `invalid-flag` + a guiding `note`: `--continue` without `MERGE_HEAD`;
152
148
  `--resume` with `MERGE_HEAD` present; `--resume` without a pending handoff.
153
- 2. **`MERGE_HEAD` present** → only `--continue` proceeds; everything else (including `--resume`)
154
- returns `already-awaiting-agent`, touching nothing.
149
+ 2. **`MERGE_HEAD` present** → only `--continue` proceeds; everything else disambiguates by the
150
+ **conflict report** (a merge dreamcontext started ALWAYS leaves one; the user's own
151
+ `git merge`/`rebase` — common in `full-repo`, where the git repo IS the project root —
152
+ leaves none):
153
+ - **no report** → `user-merge-in-progress` ("Finish your in-progress git merge first"). Never
154
+ claims a team merge awaits `/dream-sync` (there's nothing for the agent to resolve).
155
+ - **report with `codeConflicts`** → `code-conflict` (a full-repo code file for the human's
156
+ editor — see §16), never an agent job.
157
+ - **report without `codeConflicts`** → `already-awaiting-agent` (a real prose handoff for `/dream-sync`).
155
158
  3. **`pendingAgentMerge && !MERGE_HEAD`** (a LIVE pull-only-deferred handoff) → only `--resume`
156
159
  proceeds; everything else returns `already-awaiting-agent`.
157
160
  4. **Stale report** (`!MERGE_HEAD && !pendingAgentMerge`, and an existing report) → cleared, then
@@ -205,11 +208,70 @@ the fixed `dreamcontext-sync <noreply@dreamcontext.local>` author (passed explic
205
208
  takes zero forward dependency on M3. **M3 tier (adds, does not replace):** once a GitHub login
206
209
  exists, `mapLoginToPerson(login)` swaps in the resolved `person:` identity on top.
207
210
 
208
- ## 15. Manual UI checklist (M2 — appendix)
209
-
210
- When M2 (launcher/dashboard) ships, verify by hand: device-flow login (shows `user_code`, opens
211
- `verification_uri`) AND the PAT-paste fallback, both with the scope disclosure visible; `Discover`
212
- lists only `dreamcontext-brain`-topic repos; `Create` defaults private (public requires a
213
- confirmed toggle); `Attach` shows the trust warning + incoming diff preview and refuses without
214
- confirmation; the team-updates badge shows N after a teammate pushes, driven by a background fetch
215
- (the badge endpoint itself makes no network call in the request path).
211
+ ## 15. Manual UI checklist (dashboard — appendix)
212
+
213
+ Verify by hand: device-flow login (shows `user_code`, opens `verification_uri`) AND the PAT-paste
214
+ fallback, both with the scope disclosure visible; the **Cloud sync toggle** turns whole-project
215
+ sync on (400 `no_origin` if the project has no GitHub `origin`) and off (reverts to `in-tree`);
216
+ the team-updates badge shows N after a teammate pushes, driven by a background fetch (the badge
217
+ endpoint itself makes no network call in the request path); a deferred prose merge surfaces a
218
+ one-click **"Resolve with AI"** banner.
219
+
220
+ ## 16. full-repo hardening (2026-07-08) — refuse/defer/recover, never mangle
221
+
222
+ `full-repo` mode makes the WHOLE project repo the synced unit, so the engine touches real code
223
+ and the user's own git state. Five extra guarantees on top of the base merge contract:
224
+
225
+ - **Detached HEAD → refuse.** `full-repo` syncs the CURRENT branch (`git.currentBranch`); on a
226
+ detached HEAD there is no branch to push. The engine returns **`detached-head`** ("check out a
227
+ branch") instead of falling back to `main` (which would push detached commits onto the team's
228
+ `main`). Brain-only modes keep their fixed `main` and never call `currentBranch`.
229
+ - **The user's own merge ≠ a team handoff.** The reentrancy guard (§10.2) distinguishes them by
230
+ the conflict report's presence. A `MERGE_HEAD` with no report is the user's own `git
231
+ merge`/`rebase` → **`user-merge-in-progress`**, never `already-awaiting-agent`.
232
+ - **Code conflicts defer to the HUMAN, never to the agent.** A conflicted path OUTSIDE
233
+ `_dream_context/` is classified **`code`** (`resolveConflicts({fullRepo:true})` →
234
+ `deferredToHuman`). It is NEVER semantically merged (`merge3Bodies` is for markdown/frontmatter
235
+ and would mangle source) and NEVER sent to `/dream-sync`. Foreground: git's native 3-way markers
236
+ are left in the tree for the editor; the human resolves, `git commit`s the merge, and the next
237
+ sync pushes it (a locally-ahead HEAD now pushes — see below). Headless background pull: aborts to
238
+ a clean tree (never breaks a working tree with no one watching); the next foreground sync
239
+ re-surfaces it. The conflict report **separates `codeConflicts` (human) from `deferred` (agent)** so
240
+ the two never blur → **`code-conflict`** outcome.
241
+ - **Locally-ahead HEAD pushes.** `autoSync` now proceeds (not `noop`) when HEAD is ahead of the
242
+ remote even with a clean tree and remote-not-ahead — e.g. after the human finishes a code-conflict
243
+ merge natively. Without this those commits would be silently stranded.
244
+ - **Auto-checkpoint transparency + opt-out.** The pull-only dirty-tree checkpoint reports
245
+ `checkpointed` + `checkpointSha` (identifiable message, undo via `git reset --soft <sha>^`). The
246
+ dashboard's on-open pull can pass **`noCheckpoint`** (the "auto-checkpoint on open" preference off) →
247
+ a dirty tree is left UNTOUCHED (the pull is skipped) instead of auto-committing WIP.
248
+
249
+ **Failure classification (`src/lib/git-sync/failure.ts`).** Every thrown `GitSyncError` (and a
250
+ token-shaped `no-remote`) maps to a SPECIFIC failure + recovery, never a generic "sync failed":
251
+ `auth` → Reconnect GitHub; `permission` → names the repo + Contents-write scope; `network` →
252
+ "you're offline, will retry" (passive); `push-rejected` (non-fast-forward twice) → Retry sync;
253
+ `unrelated histories` → manual. The `/api/brain/sync` route returns these as `action:'error'` +
254
+ `failure` (200, so the UI renders the recovery affordance). No local work is ever lost — the bar is
255
+ that every failure is surfaced clearly and offers a concrete next step.
256
+
257
+ **Scrub is MANDATORY over EVERYTHING pushed.** In addition to the staged-commit scrub, EVERY pushing
258
+ path runs a pre-push **`scrubCommitRange`** over the commits about to leave: `autoSync` scrubs
259
+ `origin/main..HEAD` when HEAD is locally ahead; `pushOnlySync` (the `--push-only` CLI path) scrubs
260
+ `(revParse(origin/main) ?? EMPTY_TREE)..HEAD`. So commits made OUTSIDE our staged-commit path (a
261
+ human-finished code-conflict merge, any locally-ahead work) can never reach the remote unscrubbed. A
262
+ block there aborts the push, loudly.
263
+
264
+ **Scrub-block guidance.** `blocked-scrub` surfaces each `scrub.blocks` entry (file/line/rule); for a
265
+ file whose name marks it a local secret/config (`.env`, `credentials*`, `*.pem`, …) the dashboard
266
+ offers one-click **add-to-`.gitignore`** (`POST /api/brain/scrub/ignore`, server-revalidated). A real
267
+ source file is refused — the secret must be removed, not the file un-tracked. The path is rejected if it
268
+ contains gitignore metacharacters (`! # * ? [ ]`) or control chars: a leading `!` is a NEGATION that
269
+ would UN-ignore an already-excluded secret, so it can never be written.
270
+
271
+ **Mixed conflicts keep both records.** When one merge conflicts on BOTH a code file (human) and a brain
272
+ prose file (agent), the report records `codeConflicts` AND the agent `deferred` snapshots — the prose
273
+ conflict is never silently dropped.
274
+
275
+ **Status `mergeKind`.** `GET /api/brain/status` returns `mergeKind: 'agent' | 'code' | 'user' | null`
276
+ (+ `codeConflicts[]`) so the dashboard shows the right banner: Resolve-with-AI (agent), resolve-in-editor
277
+ (code), or finish-your-git-merge (user).
@@ -1 +0,0 @@
1
- import{aq as o,ar as n}from"./index-D85kugqO.js";const t=(r,a)=>o.lang.round(n.parse(r)[a]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-DqrxE_QA.js";import{_ as i}from"./index-D85kugqO.js";import"./chunk-FMBD7UC4-5rx_crEA.js";import"./chunk-YZCP3GAM-Bucdr9No.js";import"./chunk-55IACEB6-D8eCITwq.js";import"./chunk-EDXVE4YY-DBzJ4Kk6.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-DqrxE_QA.js";import{_ as i}from"./index-D85kugqO.js";import"./chunk-FMBD7UC4-5rx_crEA.js";import"./chunk-YZCP3GAM-Bucdr9No.js";import"./chunk-55IACEB6-D8eCITwq.js";import"./chunk-EDXVE4YY-DBzJ4Kk6.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{b as r}from"./graph-CJvnKdzN.js";var e=4;function a(o){return r(o,e)}export{a as c};
@@ -1 +0,0 @@
1
- import{s as t,b as r,a,S as s}from"./chunk-OYMX7WX6-CLE6jH1t.js";import{_ as i}from"./index-D85kugqO.js";import"./chunk-55IACEB6-D8eCITwq.js";import"./chunk-EDXVE4YY-DBzJ4Kk6.js";var l={parser:a,get db(){return new s(2)},renderer:r,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{l as diagram};