dreamcontext 0.14.1 → 0.14.2

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 (122) hide show
  1. package/dist/dashboard/assets/{BrainCanvas3D-iDGz4HV0.js → BrainCanvas3D-B1Ia2HWN.js} +1 -1
  2. package/dist/dashboard/assets/{_baseUniq-BKTLnguK.js → _baseUniq-B74oJzMc.js} +1 -1
  3. package/dist/dashboard/assets/{ar-SA-G6X2FPQ2-WxRw8CvG.js → ar-SA-G6X2FPQ2-DOKHn365.js} +1 -1
  4. package/dist/dashboard/assets/{arc-CXFvfgn5.js → arc-B-uBpPoM.js} +1 -1
  5. package/dist/dashboard/assets/{architectureDiagram-Q4EWVU46-CgpaMT3q.js → architectureDiagram-Q4EWVU46-D2lyk9NB.js} +1 -1
  6. package/dist/dashboard/assets/{az-AZ-76LH7QW2-Tml7S2e-.js → az-AZ-76LH7QW2-CgyZJLLo.js} +1 -1
  7. package/dist/dashboard/assets/{bg-BG-XCXSNQG7-C3fv9p_Z.js → bg-BG-XCXSNQG7-BPLlwY2s.js} +1 -1
  8. package/dist/dashboard/assets/{blockDiagram-DXYQGD6D-CeVR1IHD.js → blockDiagram-DXYQGD6D-Df8Y7Srr.js} +1 -1
  9. package/dist/dashboard/assets/{bn-BD-2XOGV67Q-qnJuYH4H.js → bn-BD-2XOGV67Q-CY-dhlzi.js} +1 -1
  10. package/dist/dashboard/assets/{c4Diagram-AHTNJAMY-xcFu2zZM.js → c4Diagram-AHTNJAMY-D7TG6J6Q.js} +1 -1
  11. package/dist/dashboard/assets/{ca-ES-6MX7JW3Y-4tyHbEgd.js → ca-ES-6MX7JW3Y-DFf13e9p.js} +1 -1
  12. package/dist/dashboard/assets/channel-CqCT8-qB.js +1 -0
  13. package/dist/dashboard/assets/{chunk-4BX2VUAB-J7mFJb__.js → chunk-4BX2VUAB-DCA-ERlu.js} +1 -1
  14. package/dist/dashboard/assets/{chunk-4TB4RGXK-DqrxE_QA.js → chunk-4TB4RGXK-Bczdxdod.js} +1 -1
  15. package/dist/dashboard/assets/{chunk-55IACEB6-D8eCITwq.js → chunk-55IACEB6-B3649L4a.js} +1 -1
  16. package/dist/dashboard/assets/{chunk-EDXVE4YY-DBzJ4Kk6.js → chunk-EDXVE4YY-Bwj1fYhG.js} +1 -1
  17. package/dist/dashboard/assets/{chunk-FMBD7UC4-5rx_crEA.js → chunk-FMBD7UC4-oY1KO--2.js} +1 -1
  18. package/dist/dashboard/assets/{chunk-OYMX7WX6-CLE6jH1t.js → chunk-OYMX7WX6-B4MPzc-c.js} +1 -1
  19. package/dist/dashboard/assets/{chunk-QZHKN3VN-OS-irsoP.js → chunk-QZHKN3VN-mVSSFcuA.js} +1 -1
  20. package/dist/dashboard/assets/{chunk-YZCP3GAM-Bucdr9No.js → chunk-YZCP3GAM-DeRyq2BY.js} +1 -1
  21. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-C9WQPvu9.js +1 -0
  22. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-C9WQPvu9.js +1 -0
  23. package/dist/dashboard/assets/clone-B0kf3g9o.js +1 -0
  24. package/dist/dashboard/assets/{cose-bilkent-S5V4N54A-0zXaPrUS.js → cose-bilkent-S5V4N54A-BTtdOgy5.js} +1 -1
  25. package/dist/dashboard/assets/{cs-CZ-2BRQDIVT-BTejWsyZ.js → cs-CZ-2BRQDIVT-BzC5Rf0R.js} +1 -1
  26. package/dist/dashboard/assets/{da-DK-5WZEPLOC-DWf9m3vM.js → da-DK-5WZEPLOC-gF4jrIY7.js} +1 -1
  27. package/dist/dashboard/assets/{dagre-KV5264BT-B_fWcb4P.js → dagre-KV5264BT-8Cpaf4My.js} +1 -1
  28. package/dist/dashboard/assets/{de-DE-XR44H4JA-6DFCnmxt.js → de-DE-XR44H4JA-BzHDEugW.js} +1 -1
  29. package/dist/dashboard/assets/{diagram-5BDNPKRD-BDjjAQT6.js → diagram-5BDNPKRD-BUa2eqbA.js} +1 -1
  30. package/dist/dashboard/assets/{diagram-G4DWMVQ6-CgDZIIvU.js → diagram-G4DWMVQ6-CsHVo990.js} +1 -1
  31. package/dist/dashboard/assets/{diagram-MMDJMWI5-OsjvtQBN.js → diagram-MMDJMWI5-CFdSOuIW.js} +1 -1
  32. package/dist/dashboard/assets/{diagram-TYMM5635-DOB390r8.js → diagram-TYMM5635-Cv2e3TBK.js} +1 -1
  33. package/dist/dashboard/assets/{el-GR-BZB4AONW-BCXqQAzU.js → el-GR-BZB4AONW-Bw-xG8H1.js} +1 -1
  34. package/dist/dashboard/assets/{erDiagram-SMLLAGMA-uT8z1D4S.js → erDiagram-SMLLAGMA-Di1x3Ld5.js} +1 -1
  35. package/dist/dashboard/assets/{es-ES-U4NZUMDT-daNwi4rl.js → es-ES-U4NZUMDT-BgdmgnEL.js} +1 -1
  36. package/dist/dashboard/assets/{eu-ES-A7QVB2H4-CP2B7v-S.js → eu-ES-A7QVB2H4-C_-W1jiT.js} +1 -1
  37. package/dist/dashboard/assets/{fa-IR-HGAKTJCU-B7fyLZjD.js → fa-IR-HGAKTJCU-D-Z42ygz.js} +1 -1
  38. package/dist/dashboard/assets/{fi-FI-Z5N7JZ37--r4W4BJL.js → fi-FI-Z5N7JZ37-CKqV9a_l.js} +1 -1
  39. package/dist/dashboard/assets/{flowDiagram-DWJPFMVM-BAfgGiph.js → flowDiagram-DWJPFMVM-C0HsaC5L.js} +1 -1
  40. package/dist/dashboard/assets/{fr-FR-RHASNOE6-D_z2sz4o.js → fr-FR-RHASNOE6-DPDm5F3m.js} +1 -1
  41. package/dist/dashboard/assets/{ganttDiagram-T4ZO3ILL-C493I8Kn.js → ganttDiagram-T4ZO3ILL-T-R79Oea.js} +1 -1
  42. package/dist/dashboard/assets/{gitGraphDiagram-UUTBAWPF-DD3Jw4hy.js → gitGraphDiagram-UUTBAWPF-DmdlPMiD.js} +1 -1
  43. package/dist/dashboard/assets/{gl-ES-HMX3MZ6V-3iPIpzVQ.js → gl-ES-HMX3MZ6V-c2pDP6q3.js} +1 -1
  44. package/dist/dashboard/assets/{graph-CJvnKdzN.js → graph-55sHob5M.js} +1 -1
  45. package/dist/dashboard/assets/{he-IL-6SHJWFNN-BnseHvRA.js → he-IL-6SHJWFNN-QzeRcOiz.js} +1 -1
  46. package/dist/dashboard/assets/{hi-IN-IWLTKZ5I-Cdvylq2s.js → hi-IN-IWLTKZ5I-CmRjYfDv.js} +1 -1
  47. package/dist/dashboard/assets/{hu-HU-A5ZG7DT2-cYA2nqI5.js → hu-HU-A5ZG7DT2-DQS4XtgQ.js} +1 -1
  48. package/dist/dashboard/assets/{id-ID-SAP4L64H-ByI8qeN-.js → id-ID-SAP4L64H-D-BFw5MU.js} +1 -1
  49. package/dist/dashboard/assets/{index-DRgJ1sc2.js → index-C2j0AERU.js} +1 -1
  50. package/dist/dashboard/assets/{index-CdlG9S--.css → index-MPnw9upZ.css} +2 -2
  51. package/dist/dashboard/assets/{index-D85kugqO.js → index-pZP-3m96.js} +205 -205
  52. package/dist/dashboard/assets/{infoDiagram-42DDH7IO-BJyNzQje.js → infoDiagram-42DDH7IO-BaT4J3uc.js} +1 -1
  53. package/dist/dashboard/assets/{ishikawaDiagram-UXIWVN3A-DWwmai-U.js → ishikawaDiagram-UXIWVN3A-DsizYWBB.js} +1 -1
  54. package/dist/dashboard/assets/{it-IT-JPQ66NNP-Cm3-aA2z.js → it-IT-JPQ66NNP-CFAPcTjk.js} +1 -1
  55. package/dist/dashboard/assets/{ja-JP-DBVTYXUO-BtKUGXop.js → ja-JP-DBVTYXUO-Bzs_hBtx.js} +1 -1
  56. package/dist/dashboard/assets/{journeyDiagram-VCZTEJTY-CWpo_QlB.js → journeyDiagram-VCZTEJTY-B9kB5yN9.js} +1 -1
  57. package/dist/dashboard/assets/{kaa-6HZHGXH3-Cz-3C5qm.js → kaa-6HZHGXH3-CqRi76QS.js} +1 -1
  58. package/dist/dashboard/assets/{kab-KAB-ZGHBKWFO-CquppFs3.js → kab-KAB-ZGHBKWFO-wSqF6nkL.js} +1 -1
  59. package/dist/dashboard/assets/{kanban-definition-6JOO6SKY-CZisoM6K.js → kanban-definition-6JOO6SKY-DasidrnL.js} +1 -1
  60. package/dist/dashboard/assets/{kk-KZ-P5N5QNE5-B2l0aVOL.js → kk-KZ-P5N5QNE5-ins4bRlm.js} +1 -1
  61. package/dist/dashboard/assets/{km-KH-HSX4SM5Z-gnd97XjM.js → km-KH-HSX4SM5Z-BjJepDRC.js} +1 -1
  62. package/dist/dashboard/assets/{ko-KR-MTYHY66A-CZ7y0WRr.js → ko-KR-MTYHY66A-Cmak8rUq.js} +1 -1
  63. package/dist/dashboard/assets/{ku-TR-6OUDTVRD-cJLiwVTI.js → ku-TR-6OUDTVRD-Dbz6ljVD.js} +1 -1
  64. package/dist/dashboard/assets/{layout-ZskR1t-z.js → layout-DMQli9Le.js} +1 -1
  65. package/dist/dashboard/assets/{linear-nhlpqszd.js → linear-B6VVSyMW.js} +1 -1
  66. package/dist/dashboard/assets/{lt-LT-XHIRWOB4-Ij6EZ9jl.js → lt-LT-XHIRWOB4-CEmAxA9u.js} +1 -1
  67. package/dist/dashboard/assets/{lv-LV-5QDEKY6T-o1fSS6fk.js → lv-LV-5QDEKY6T-CJR-At7g.js} +1 -1
  68. package/dist/dashboard/assets/{min-DWO9jrZ-.js → min-CqkwiHUc.js} +1 -1
  69. package/dist/dashboard/assets/{mindmap-definition-QFDTVHPH-hvcnCi0m.js → mindmap-definition-QFDTVHPH-bsYCrNtj.js} +1 -1
  70. package/dist/dashboard/assets/{mr-IN-CRQNXWMA-CbMNXet8.js → mr-IN-CRQNXWMA-P4spwjT8.js} +1 -1
  71. package/dist/dashboard/assets/{my-MM-5M5IBNSE-BLZNRrAe.js → my-MM-5M5IBNSE-a1rvArEV.js} +1 -1
  72. package/dist/dashboard/assets/{nb-NO-T6EIAALU-B3vJdKTo.js → nb-NO-T6EIAALU-Dw_J2QCA.js} +1 -1
  73. package/dist/dashboard/assets/{nl-NL-IS3SIHDZ-B6D5z-iI.js → nl-NL-IS3SIHDZ-DyJZtP9s.js} +1 -1
  74. package/dist/dashboard/assets/{nn-NO-6E72VCQL-5zTuWq4x.js → nn-NO-6E72VCQL-4acyfJJj.js} +1 -1
  75. package/dist/dashboard/assets/{oc-FR-POXYY2M6-CjWsH2WL.js → oc-FR-POXYY2M6-D8pDlGpO.js} +1 -1
  76. package/dist/dashboard/assets/{pa-IN-N4M65BXN-BoIcIn-E.js → pa-IN-N4M65BXN-CUXWRM9Z.js} +1 -1
  77. package/dist/dashboard/assets/{percentages-BXMCSKIN-F5X-Tg4w.js → percentages-BXMCSKIN-jDtw9CS_.js} +7 -7
  78. package/dist/dashboard/assets/{pica-kqAcDU9z.js → pica-D2k8QhiT.js} +1 -1
  79. package/dist/dashboard/assets/{pieDiagram-DEJITSTG-nYd2z-pn.js → pieDiagram-DEJITSTG-BY5lDpxM.js} +1 -1
  80. package/dist/dashboard/assets/{pl-PL-T2D74RX3-GchO6UuX.js → pl-PL-T2D74RX3-BTVl1PaU.js} +1 -1
  81. package/dist/dashboard/assets/{pt-BR-5N22H2LF-BUsepHJF.js → pt-BR-5N22H2LF-CRV4c2FR.js} +1 -1
  82. package/dist/dashboard/assets/{pt-PT-UZXXM6DQ-CCrWB7t1.js → pt-PT-UZXXM6DQ-Ciz73XBG.js} +1 -1
  83. package/dist/dashboard/assets/{quadrantDiagram-34T5L4WZ-CyQyFV43.js → quadrantDiagram-34T5L4WZ-CkCyPark.js} +1 -1
  84. package/dist/dashboard/assets/{requirementDiagram-MS252O5E-DzDNbaAz.js → requirementDiagram-MS252O5E-pkDzqMen.js} +1 -1
  85. package/dist/dashboard/assets/{ro-RO-JPDTUUEW-Bg8qasSV.js → ro-RO-JPDTUUEW-B5tB2ZMk.js} +1 -1
  86. package/dist/dashboard/assets/{ru-RU-B4JR7IUQ-l7KGf_aH.js → ru-RU-B4JR7IUQ-CjaSKApe.js} +1 -1
  87. package/dist/dashboard/assets/{sankeyDiagram-XADWPNL6-t78W7pty.js → sankeyDiagram-XADWPNL6-CrziMmSl.js} +1 -1
  88. package/dist/dashboard/assets/{sequenceDiagram-FGHM5R23-C-A4YWsY.js → sequenceDiagram-FGHM5R23-D5zUE04i.js} +1 -1
  89. package/dist/dashboard/assets/{si-LK-N5RQ5JYF-Bvh5jeZQ.js → si-LK-N5RQ5JYF-QK81fzaG.js} +1 -1
  90. package/dist/dashboard/assets/{sk-SK-C5VTKIMK-Cw6feZYR.js → sk-SK-C5VTKIMK-TANqzQvg.js} +1 -1
  91. package/dist/dashboard/assets/{sl-SI-NN7IZMDC-B-NqJ9YS.js → sl-SI-NN7IZMDC-Dht86ddT.js} +1 -1
  92. package/dist/dashboard/assets/{stateDiagram-FHFEXIEX-DIcQEopN.js → stateDiagram-FHFEXIEX-CcR_Q14Z.js} +1 -1
  93. package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-DIVPLDRd.js +1 -0
  94. package/dist/dashboard/assets/{subset-shared.chunk-w-9tnfIy.js → subset-shared.chunk-NAGN_SBv.js} +1 -1
  95. package/dist/dashboard/assets/{subset-worker.chunk-BF01ymYz.js → subset-worker.chunk-wsRwU71V.js} +1 -1
  96. package/dist/dashboard/assets/{sv-SE-XGPEYMSR-Ktas5ybY.js → sv-SE-XGPEYMSR-DidGUaol.js} +1 -1
  97. package/dist/dashboard/assets/{ta-IN-2NMHFXQM-WVntmT4J.js → ta-IN-2NMHFXQM-YZmBodpj.js} +1 -1
  98. package/dist/dashboard/assets/{th-TH-HPSO5L25-DP9jkhxy.js → th-TH-HPSO5L25-CVvvXQFu.js} +1 -1
  99. package/dist/dashboard/assets/{timeline-definition-GMOUNBTQ-CQLRxE6-.js → timeline-definition-GMOUNBTQ-B8I1QieK.js} +1 -1
  100. package/dist/dashboard/assets/{tr-TR-DEFEU3FU-DUBzAzD0.js → tr-TR-DEFEU3FU-DjyXDfoR.js} +1 -1
  101. package/dist/dashboard/assets/{uk-UA-QMV73CPH-DBIjqvxV.js → uk-UA-QMV73CPH-1pRnjZIi.js} +1 -1
  102. package/dist/dashboard/assets/{vennDiagram-DHZGUBPP-ChnhJ1dN.js → vennDiagram-DHZGUBPP-BsBRDs0e.js} +1 -1
  103. package/dist/dashboard/assets/{vi-VN-M7AON7JQ-D47IGQ3F.js → vi-VN-M7AON7JQ-CualwmWX.js} +1 -1
  104. package/dist/dashboard/assets/{wardley-RL74JXVD-CnuAa4Oy.js → wardley-RL74JXVD-BP4Ewc0H.js} +1 -1
  105. package/dist/dashboard/assets/{wardleyDiagram-NUSXRM2D-D63qjR_j.js → wardleyDiagram-NUSXRM2D-B_WTb-rg.js} +1 -1
  106. package/dist/dashboard/assets/{xychartDiagram-5P7HB3ND-BUdyr5Wc.js → xychartDiagram-5P7HB3ND-vB-uMt25.js} +1 -1
  107. package/dist/dashboard/assets/{zh-CN-LNUGB5OW-_ICN38Lj.js → zh-CN-LNUGB5OW-CQjWtZ9Y.js} +1 -1
  108. package/dist/dashboard/assets/{zh-HK-E62DVLB3-Bjez10pk.js → zh-HK-E62DVLB3-DzC49dFs.js} +1 -1
  109. package/dist/dashboard/assets/{zh-TW-RAJ6MFWO-Do-CPv3_.js → zh-TW-RAJ6MFWO-C4KJuhZE.js} +1 -1
  110. package/dist/dashboard/index.html +2 -2
  111. package/dist/index.js +1034 -364
  112. package/package.json +1 -1
  113. package/skill/SKILL.md +4 -3
  114. package/skill/references/brain-sync.md +131 -0
  115. package/skill/references/integrations.md +7 -4
  116. package/skill/references/sleep.md +1 -1
  117. package/skill-sync/references/merge-rules.md +68 -2
  118. package/dist/dashboard/assets/channel-CTaS69UP.js +0 -1
  119. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-DYWavBQh.js +0 -1
  120. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-DYWavBQh.js +0 -1
  121. package/dist/dashboard/assets/clone-Dpdgvgqp.js +0 -1
  122. 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.14.2",
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 (shared repo)** | **Yes — a team OR one person across machines can share ONE brain.** The brain is git-synced to a GitHub remote in one of **three modes** — `separate` (brain in its own repo), `full-repo` (whole project its `origin`), `in-tree` (commit-only default). `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", "put the brain in its own repo", "sync my brain to GitHub", "set it up on my other machine"), 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".** Three modes (separate / full-repo / in-tree), 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)** — **shared brain repo / GitHub cloud sync**: the three modes (separate/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,131 @@
1
+ # Brain sync (GitHub cloud sync for the brain)
2
+
3
+ The one reference for the **shared brain repo** — what it is, the three 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," "put the brain in its own repo," "sync my brain to GitHub."* Do NOT answer "we don't support that" — this is the feature.
6
+
7
+ ## What it is
8
+
9
+ The brain (`_dream_context/`) is mirrored to a **GitHub remote** 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`.
12
+
13
+ ## The three sync modes
14
+
15
+ Mode lives in `_dream_context/state/.config.json` under `brainRepo.mode`. **Anything not `separate`/`full-repo` resolves to `in-tree`.**
16
+
17
+ | Mode | Git root | Remote | Branch | What lands on the remote | Auto-push? |
18
+ |---|---|---|---|---|---|
19
+ | **`separate`** | `_dream_context/` (the brain is its OWN repo) | a dedicated brain repo (`brainRepo.remote`) | always `main` | the **contents of `_dream_context/`** at the repo root (core/, knowledge/, state/…) | **Yes** |
20
+ | **`full-repo`** | the **project root** (whole project is the repo) | the project's own `origin` | the **current** branch (never assumes `main`) | the **entire project** — code + `_dream_context/` nested inside it | **Yes** |
21
+ | **`in-tree`** (default) | — | — | — | nothing pushed — **commit-only**, stages `_dream_context/` and commits locally | **No, never** |
22
+
23
+ - **`separate`** is the classic "team shares one brain repo, separate from the code repo." Created by `brain init` / joined by `brain attach`.
24
+ - **`full-repo`** makes the whole project folder the synced repo (brain nested under `_dream_context/`, plus root `CLAUDE.md` / `.claude/` if present). 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`.
25
+ - **`in-tree`** is the safe default: it commits the brain alongside your code but **never pushes** — you sync manually or promote to another mode.
26
+
27
+ **Switching modes:** there is **no `brain scope` / `brain mode` CLI command.** Switching to/from `full-repo` is done from the **dashboard** (Settings → Brain → Sync scope; server route `POST /api/brain/scope`). `full-repo` requires the project to already have a GitHub `origin` (it errors `no_origin` otherwise). To go the other way it becomes `separate` if a brain remote exists, else `in-tree`. `brain init` produces `separate`; a project with no brain config is `in-tree`.
28
+
29
+ ## Set it up (CLI)
30
+
31
+ ```bash
32
+ # 0. Token FIRST — init/attach and every push need it (see Auth for scope + resolution order).
33
+ dreamcontext config github-token "$(gh auth token)" # per-MACHINE token; gitignored, never travels with the repo
34
+
35
+ # Create a brand-new shared brain repo (PRIVATE by default), scrubbed first push → separate mode
36
+ dreamcontext brain init --owner <you-or-org> --name <repo> # --code-repo <url> pins the paired code repo
37
+
38
+ # OR join an existing brain repo (a TRUST decision — it loads into every session)
39
+ dreamcontext brain discover # list repos tagged `dreamcontext-brain` you can access
40
+ dreamcontext brain attach <brain-repo-url> # trust warning + read-only diff preview, then confirm
41
+
42
+ dreamcontext brain status # verify: mode, remote, resolved cloud-sync switch
43
+ ```
44
+
45
+ `brain init` creates the GitHub repo through the API with the **same resolved token**, so set the token (or be logged into dreamcontext for the global store) *before* `init`/`attach`. (PowerShell/cmd have no `$(…)` — use `dreamcontext config github-token <token>` or set `GITHUB_TOKEN`.)
46
+
47
+ Carry the Claude Code layer with the brain so a fresh clone is ready to use:
48
+
49
+ ```bash
50
+ dreamcontext brain platform # moves CLAUDE.md + .claude/ into _dream_context/platform/ and symlinks from root
51
+ dreamcontext brain platform --status
52
+ ```
53
+ (Separate mode only — its repo is rooted at `_dream_context/`, so root files wouldn't sync otherwise. In `full-repo` the root files sync natively and `brain platform` is unnecessary. Every `brain sync` re-creates missing root symlinks on a fresh clone; `doctor` flags broken links.)
54
+
55
+ ## Auth — how the brain repo authenticates (NOT gh, NOT the keychain)
56
+
57
+ The token is resolved by **`resolveBrainSyncToken`, secrets-first, env-last**:
58
+
59
+ 1. per-project `_dream_context/state/.secrets.json` → `github.token` (set via `dreamcontext config github-token`)
60
+ 2. global `~/.dreamcontext/.secrets.json` → `github.token` (the account you logged into dreamcontext as)
61
+ 3. env `GITHUB_TOKEN`, then `GH_TOKEN`
62
+
63
+ **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**.
64
+
65
+ > **Required scope (this bites people):** brain sync **pushes repo contents**, so the token needs classic **`repo`** scope, or a fine-grained PAT with **Contents: read & write** (add **Administration: read & write** on the owner if you'll `brain init` to *create* the 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 brain push**. When in doubt, use a classic `repo` token or a fine-grained PAT that includes Contents:write.
66
+
67
+ ## Shared vs machine-local config (important)
68
+
69
+ - **`state/.config.json` — SYNCS** across machines/teammates. It holds the whole `brainRepo` block: **`mode`, `enabled`, `remote`, `autoSync`**. Consequence: **an explicit `mode` or `enabled` propagates to everyone** on the next sync — they are a *shared* decision, not per-machine. (This is deliberate: one remote can only have one structure, so all machines must agree on the mode.)
70
+ - **`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.
71
+ - **`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`, OR `brainRepo.remote` is set), else OFF. So the *default* is per-machine; an *explicit* toggle is global.
72
+
73
+ ## Lifecycle — when sync happens
74
+
75
+ - **Session start:** a **detached, non-blocking** `brain sync --pull-only` fires in the background (only when `enabled` + mode `separate`/`full-repo` + `autoSync`; honors `DREAMCONTEXT_BRAIN_SYNC=0`). Its results land on the **NEXT** session (you see the previous pull's `pulledUpdates`).
76
+ - **`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.
77
+ - **Manual, any time:** `dreamcontext brain sync` (flags: `--pull-only`, `--push-only`, `--strict`, `--continue`, `--resume`).
78
+ - **Commit messages** (so you can recognize them): `chore(brain): sync` (separate/in-tree), `chore: sync project (dreamcontext)` (full-repo), `chore(brain): merge team updates` (auto-merge), `… (agent-resolved)` (after `/dream-sync`).
79
+
80
+ **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. In `full-repo`, 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).
81
+
82
+ ## Cross-machine / cross-OS setup
83
+
84
+ The brain 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.**
85
+
86
+ - **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.
87
+ - **The brain folder must be its OWN git root (the enclosing-repo trap).** In `separate` mode the repo root must be `_dream_context/`; in `full-repo` it must be the project folder. Verify: `git -C <that folder> rev-parse --show-toplevel` should print *that* folder — **not climb into an enclosing parent repo** (e.g. a home-directory `~/.git` or a wrapping code repo). dreamcontext guards this at `init`/`attach`/disconnect, but the per-sync path only checks "is a git repo," so a misplaced enclosing `.git` can hijack resolution. If sync targets the wrong tree, hunt for a parent `.git` above the folder and remove its stray `origin`.
88
+ - **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 brain 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.
89
+ - **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.
90
+ - **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.
91
+ - **Windows symlinks (separate mode).** `brain platform` shares CLAUDE.md/.claude by **symlinking** them from the project root, and every `brain sync` re-creates missing links. On Windows, creating symlinks normally needs **Developer Mode enabled or an elevated shell** — otherwise `brain platform` fails. On a Windows brain, prefer **`full-repo` mode**, where root files sync natively and no symlinks are involved.
92
+
93
+ **Per-OS quick matrix**
94
+
95
+ | | macOS | Linux | Windows / WSL |
96
+ |---|---|---|---|
97
+ | Token | `config github-token "$(gh auth token)"` | same | same (in WSL use the WSL `gh`; native Windows: `GITHUB_TOKEN` or dashboard login) |
98
+ | Line endings | fine | fine | **set `core.autocrlf false`** |
99
+ | Git root check | `rev-parse --show-toplevel` | same | same |
100
+ | Keychain/helper | bypassed | bypassed | bypassed |
101
+ | `brain platform` symlinks | native | native | **need Developer Mode / elevated shell** — or use `full-repo` (root files sync natively) |
102
+ | Token scope | `repo` / Contents:write | same | same (an Issues-only fine-grained token won't push) |
103
+
104
+ **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.
105
+
106
+ ## Onboarding a second machine (same user) — checklist
107
+
108
+ **On Windows, read the Cross-OS section first** — the token syntax (step 2), symlink privilege (step 3), and `core.autocrlf` (step 6) all differ.
109
+
110
+ 1. `git clone <brain-or-project-url>` (or `dreamcontext brain attach <url>` in an existing checkout).
111
+ 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).
112
+ 3. `dreamcontext brain platform` — re-create root `CLAUDE.md` / `.claude/` symlinks (separate mode; Windows needs Developer Mode/elevation, or use `full-repo` mode).
113
+ 4. `dreamcontext brain status` — confirm mode, remote, cloud-sync ON, right git root.
114
+ 5. `dreamcontext brain sync --pull-only` — take the latest, verify a clean pull.
115
+ 6. On Windows: `git config core.autocrlf false` first.
116
+
117
+ ## When sync is "silently failing" (troubleshooting)
118
+
119
+ 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:
120
+
121
+ 1. **`dreamcontext brain status`** — is cloud sync ON (and *why* — explicit vs derived)? Right `mode` and `remote`? Any `mergeInProgress` / `pendingAgentMerge`?
122
+ 2. **Token present?** Check `state/.secrets.json` (or global / `GITHUB_TOKEN`). No token = silent no-op — the most common cause. Set it and retry.
123
+ 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.
124
+ 4. **`dreamcontext brain sync --push-only`** (foreground) — forces the error to the surface instead of the background swallowing it.
125
+ 5. **`full-repo` on a detached HEAD** → `detached-head` refusal. Check out a branch.
126
+ 6. **Wrong git root** → the enclosing-repo trap above (`rev-parse --show-toplevel`).
127
+ 7. **`pendingAgentMerge` / `awaiting-agent`** → a prose conflict is waiting: run **`/dream-sync`**, then `brain sync --continue`.
128
+
129
+ ## `brain` command surface (10 subcommands)
130
+
131
+ `status`, `enable`, `disable`, `init`, `attach`, `discover`, `platform`, `scrub`, `sync`, `detach`. (`sync` flags: `--pull-only`, `--push-only`, `--strict`, `--continue`, `--resume` — the last two are attended-only; never drive them unattended.) 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`.
@@ -218,7 +218,9 @@ dreamcontext federation purge --dry-run # preview
218
218
 
219
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.
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," "put the brain in its own repo,"* 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 three modes (separate / 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.
@@ -231,11 +233,12 @@ dreamcontext federation purge --dry-run # preview
231
233
  # Person A — create a brand-new shared brain repo (PRIVATE by default) and push a scrubbed first commit
232
234
  dreamcontext brain init --code-repo https://github.com/acme/app # pointer back to the paired code repo
233
235
 
234
- # Person B (and every teammate) — attach the existing brain repo (a TRUST decision: it loads every session)
236
+ # Person B (and every teammate / each new machine) — attach the existing brain repo (a TRUST decision: it loads every session)
235
237
  dreamcontext brain discover # list dreamcontext-brain-topic repos you can access
236
238
  dreamcontext brain attach https://github.com/acme/app-brain # trust warning + diff preview, then confirm
237
239
 
238
- dreamcontext brain status # mode (separate/in-tree), remote, sync state, cloud-sync switch
240
+ dreamcontext config github-token "$(gh auth token)" # per-MACHINE token — the token is gitignored, never travels with the repo
241
+ dreamcontext brain status # mode (separate/full-repo/in-tree), remote, sync state, cloud-sync switch
239
242
  ```
240
243
 
241
244
  ### Day-to-day (mostly automatic)
@@ -258,7 +261,7 @@ missing root symlinks on a fresh clone, and `doctor` flags broken links. Machine
258
261
  ### Editing / reconfiguring
259
262
 
260
263
  - **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.
264
+ - **Modes:** `separate` (brain in its own remote, full auto-sync) · `full-repo` (whole project its own `origin`, on the current branchswitch from the dashboard: Settings → Brain → Sync scope) · `in-tree` (commit-only, **never** auto-pushes; the safe default). All run the scrub gate. Full detail + cross-OS setup → [brain-sync.md](brain-sync.md).
262
265
  - **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.
263
266
 
264
267
  ### From the desktop app? — M2, PENDING (not yet shipped)
@@ -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
  ---
@@ -150,8 +150,15 @@ order, BEFORE acquiring the lock:
150
150
 
151
151
  1. **Flag misuse** → `invalid-flag` + a guiding `note`: `--continue` without `MERGE_HEAD`;
152
152
  `--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.
153
+ 2. **`MERGE_HEAD` present** → only `--continue` proceeds; everything else disambiguates by the
154
+ **conflict report** (a merge dreamcontext started ALWAYS leaves one; the user's own
155
+ `git merge`/`rebase` — common in `full-repo`, where the git repo IS the project root —
156
+ leaves none):
157
+ - **no report** → `user-merge-in-progress` ("Finish your in-progress git merge first"). Never
158
+ claims a team merge awaits `/dream-sync` (there's nothing for the agent to resolve).
159
+ - **report with `codeConflicts`** → `code-conflict` (a full-repo code file for the human's
160
+ editor — see §16), never an agent job.
161
+ - **report without `codeConflicts`** → `already-awaiting-agent` (a real prose handoff for `/dream-sync`).
155
162
  3. **`pendingAgentMerge && !MERGE_HEAD`** (a LIVE pull-only-deferred handoff) → only `--resume`
156
163
  proceeds; everything else returns `already-awaiting-agent`.
157
164
  4. **Stale report** (`!MERGE_HEAD && !pendingAgentMerge`, and an existing report) → cleared, then
@@ -213,3 +220,62 @@ lists only `dreamcontext-brain`-topic repos; `Create` defaults private (public r
213
220
  confirmed toggle); `Attach` shows the trust warning + incoming diff preview and refuses without
214
221
  confirmation; the team-updates badge shows N after a teammate pushes, driven by a background fetch
215
222
  (the badge endpoint itself makes no network call in the request path).
223
+
224
+ ## 16. full-repo hardening (2026-07-08) — refuse/defer/recover, never mangle
225
+
226
+ `full-repo` mode makes the WHOLE project repo the synced unit, so the engine touches real code
227
+ and the user's own git state. Five extra guarantees on top of the separate/in-tree contract:
228
+
229
+ - **Detached HEAD → refuse.** `full-repo` syncs the CURRENT branch (`git.currentBranch`); on a
230
+ detached HEAD there is no branch to push. The engine returns **`detached-head`** ("check out a
231
+ branch") instead of falling back to `main` (which would push detached commits onto the team's
232
+ `main`). Brain-only modes keep their fixed `main` and never call `currentBranch`.
233
+ - **The user's own merge ≠ a team handoff.** The reentrancy guard (§10.2) distinguishes them by
234
+ the conflict report's presence. A `MERGE_HEAD` with no report is the user's own `git
235
+ merge`/`rebase` → **`user-merge-in-progress`**, never `already-awaiting-agent`.
236
+ - **Code conflicts defer to the HUMAN, never to the agent.** A conflicted path OUTSIDE
237
+ `_dream_context/` is classified **`code`** (`resolveConflicts({fullRepo:true})` →
238
+ `deferredToHuman`). It is NEVER semantically merged (`merge3Bodies` is for markdown/frontmatter
239
+ and would mangle source) and NEVER sent to `/dream-sync`. Foreground: git's native 3-way markers
240
+ are left in the tree for the editor; the human resolves, `git commit`s the merge, and the next
241
+ sync pushes it (a locally-ahead HEAD now pushes — see below). Headless background pull: aborts to
242
+ a clean tree (never breaks a working tree with no one watching); the next foreground sync
243
+ re-surfaces it. The conflict report **separates `codeConflicts` (human) from `deferred` (agent)** so
244
+ the two never blur → **`code-conflict`** outcome.
245
+ - **Locally-ahead HEAD pushes.** `autoSync` now proceeds (not `noop`) when HEAD is ahead of the
246
+ remote even with a clean tree and remote-not-ahead — e.g. after the human finishes a code-conflict
247
+ merge natively. Without this those commits would be silently stranded.
248
+ - **Auto-checkpoint transparency + opt-out.** The pull-only dirty-tree checkpoint reports
249
+ `checkpointed` + `checkpointSha` (identifiable message, undo via `git reset --soft <sha>^`). The
250
+ dashboard's on-open pull can pass **`noCheckpoint`** (the "auto-checkpoint on open" preference off) →
251
+ a dirty tree is left UNTOUCHED (the pull is skipped) instead of auto-committing WIP.
252
+
253
+ **Failure classification (`src/lib/git-sync/failure.ts`).** Every thrown `GitSyncError` (and a
254
+ token-shaped `no-remote`) maps to a SPECIFIC failure + recovery, never a generic "sync failed":
255
+ `auth` → Reconnect GitHub; `permission` → names the repo + Contents-write scope; `network` →
256
+ "you're offline, will retry" (passive); `push-rejected` (non-fast-forward twice) → Retry sync;
257
+ `unrelated histories` → manual. The `/api/brain/sync` route returns these as `action:'error'` +
258
+ `failure` (200, so the UI renders the recovery affordance). No local work is ever lost — the bar is
259
+ that every failure is surfaced clearly and offers a concrete next step.
260
+
261
+ **Scrub is MANDATORY over EVERYTHING pushed.** In addition to the staged-commit scrub, EVERY pushing
262
+ path runs a pre-push **`scrubCommitRange`** over the commits about to leave: `autoSync` scrubs
263
+ `origin/main..HEAD` when HEAD is locally ahead; `pushOnlySync` (the `--push-only` CLI path) scrubs
264
+ `(revParse(origin/main) ?? EMPTY_TREE)..HEAD`. So commits made OUTSIDE our staged-commit path (a
265
+ human-finished code-conflict merge, any locally-ahead work) can never reach the remote unscrubbed. A
266
+ block there aborts the push, loudly.
267
+
268
+ **Scrub-block guidance.** `blocked-scrub` surfaces each `scrub.blocks` entry (file/line/rule); for a
269
+ file whose name marks it a local secret/config (`.env`, `credentials*`, `*.pem`, …) the dashboard
270
+ offers one-click **add-to-`.gitignore`** (`POST /api/brain/scrub/ignore`, server-revalidated). A real
271
+ source file is refused — the secret must be removed, not the file un-tracked. The path is rejected if it
272
+ contains gitignore metacharacters (`! # * ? [ ]`) or control chars: a leading `!` is a NEGATION that
273
+ would UN-ignore an already-excluded secret, so it can never be written.
274
+
275
+ **Mixed conflicts keep both records.** When one merge conflicts on BOTH a code file (human) and a brain
276
+ prose file (agent), the report records `codeConflicts` AND the agent `deferred` snapshots — the prose
277
+ conflict is never silently dropped.
278
+
279
+ **Status `mergeKind`.** `GET /api/brain/status` returns `mergeKind: 'agent' | 'code' | 'user' | null`
280
+ (+ `codeConflicts[]`) so the dashboard shows the right banner: Resolve-with-AI (agent), resolve-in-editor
281
+ (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};