mishkan-harness 0.2.6 → 0.2.7

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 (133) hide show
  1. package/README.md +49 -11
  2. package/bin/mishkan.js +562 -79
  3. package/docs/design/MISHKAN_decisions.md +398 -8
  4. package/docs/design/MISHKAN_observability.md +8 -8
  5. package/docs/engineer/profile-readable.md +201 -0
  6. package/docs/engineer/profile.md +754 -0
  7. package/docs/usage/01-installation.md +22 -8
  8. package/docs/usage/02-project-init.md +30 -13
  9. package/docs/usage/03-orchestration.md +46 -7
  10. package/docs/usage/04-memory-layer.md +135 -69
  11. package/docs/usage/06-llm-providers.md +2 -1
  12. package/docs/usage/07-troubleshooting.md +23 -0
  13. package/docs/usage/08-glossary.md +12 -3
  14. package/docs/usage/09-workflows.md +15 -3
  15. package/docs/usage/10-observability.md +3 -3
  16. package/docs/usage/11-graphify.md +38 -18
  17. package/docs/usage/12-cli.md +87 -0
  18. package/docs/usage/12-skill-discovery.md +11 -0
  19. package/docs/usage/README.md +35 -19
  20. package/package.json +1 -1
  21. package/payload/mishkan/AGENT_SPEC.md +3 -1
  22. package/payload/mishkan/agents/ahikam.md +3 -1
  23. package/payload/mishkan/agents/aholiab.md +3 -1
  24. package/payload/mishkan/agents/asaph.md +3 -1
  25. package/payload/mishkan/agents/baruch.md +8 -1
  26. package/payload/mishkan/agents/benaiah.md +3 -1
  27. package/payload/mishkan/agents/bezalel.md +3 -1
  28. package/payload/mishkan/agents/caleb.md +3 -1
  29. package/payload/mishkan/agents/deborah.md +3 -1
  30. package/payload/mishkan/agents/elasah.md +3 -1
  31. package/payload/mishkan/agents/eliashib.md +3 -1
  32. package/payload/mishkan/agents/ezra.md +3 -1
  33. package/payload/mishkan/agents/hanun.md +3 -1
  34. package/payload/mishkan/agents/hiram.md +3 -1
  35. package/payload/mishkan/agents/hizkiah.md +3 -1
  36. package/payload/mishkan/agents/huldah.md +3 -1
  37. package/payload/mishkan/agents/huram.md +3 -1
  38. package/payload/mishkan/agents/hushai.md +3 -1
  39. package/payload/mishkan/agents/igal.md +3 -1
  40. package/payload/mishkan/agents/ira.md +3 -1
  41. package/payload/mishkan/agents/jahaziel.md +3 -1
  42. package/payload/mishkan/agents/jakin.md +3 -1
  43. package/payload/mishkan/agents/jehonathan.md +3 -1
  44. package/payload/mishkan/agents/jehoshaphat.md +3 -1
  45. package/payload/mishkan/agents/joab.md +3 -1
  46. package/payload/mishkan/agents/joah.md +3 -1
  47. package/payload/mishkan/agents/maaseiah.md +3 -1
  48. package/payload/mishkan/agents/meremoth.md +3 -1
  49. package/payload/mishkan/agents/meshullam.md +3 -1
  50. package/payload/mishkan/agents/nathan.md +3 -1
  51. package/payload/mishkan/agents/nehemiah.md +3 -1
  52. package/payload/mishkan/agents/obed.md +3 -1
  53. package/payload/mishkan/agents/oholiab.md +3 -1
  54. package/payload/mishkan/agents/palal.md +3 -1
  55. package/payload/mishkan/agents/phinehas.md +3 -1
  56. package/payload/mishkan/agents/rehum.md +3 -1
  57. package/payload/mishkan/agents/salma.md +3 -1
  58. package/payload/mishkan/agents/seraiah.md +3 -1
  59. package/payload/mishkan/agents/shallum.md +3 -1
  60. package/payload/mishkan/agents/shaphan.md +3 -1
  61. package/payload/mishkan/agents/shemaiah.md +6 -1
  62. package/payload/mishkan/agents/shevna.md +3 -1
  63. package/payload/mishkan/agents/uriah.md +3 -1
  64. package/payload/mishkan/agents/zaccur.md +3 -1
  65. package/payload/mishkan/agents/zadok.md +3 -1
  66. package/payload/mishkan/agents/zerubbabel.md +3 -1
  67. package/payload/mishkan/cognee/.env.example +11 -0
  68. package/payload/mishkan/cognee/Dockerfile +20 -0
  69. package/payload/mishkan/cognee/README.md +34 -14
  70. package/payload/mishkan/cognee/docker-compose.curated.yml +33 -6
  71. package/payload/mishkan/cognee/docker-compose.selfhosted.yml +35 -5
  72. package/payload/mishkan/cognee/docker-compose.work.yml +191 -0
  73. package/payload/mishkan/cognee/docker-compose.yml +18 -3
  74. package/payload/mishkan/cognee/patches/cognee-mcp-core-align.py +72 -0
  75. package/payload/mishkan/cognee/patches/cognee-mcp-recall-user.py +82 -0
  76. package/payload/mishkan/cognee/promote-curated.py +77 -0
  77. package/payload/mishkan/cognee/prune-store.py +23 -0
  78. package/payload/mishkan/commands/mishkan-init.md +4 -1
  79. package/payload/mishkan/commands/mishkan-org-reference.md +2 -2
  80. package/payload/mishkan/config/curated-library.yaml +1 -0
  81. package/payload/mishkan/config/model-routing.yaml +23 -14
  82. package/payload/mishkan/evals/baruch/fixtures/invalid/bad-curated-candidate.json +22 -0
  83. package/payload/mishkan/evals/baruch/fixtures/valid/resolved-curated-candidate.json +23 -0
  84. package/payload/mishkan/hooks/model-route.py +14 -1
  85. package/payload/mishkan/observability/usage_parser.py +1 -0
  86. package/payload/mishkan/observability/watch/pyproject.toml +1 -1
  87. package/payload/mishkan/observability/watch/src/mishkan_watch/__main__.py +78 -21
  88. package/payload/mishkan/observability/watch/src/mishkan_watch/app.py +56 -3
  89. package/payload/mishkan/observability/watch/src/mishkan_watch/tabs/knowledge.py +76 -5
  90. package/payload/mishkan/observability/watch/src/mishkan_watch/tabs/workflows.py +22 -1
  91. package/payload/mishkan/observability/watchd/pyproject.toml +1 -1
  92. package/payload/mishkan/observability/watchd/src/mishkan_watchd/__main__.py +35 -7
  93. package/payload/mishkan/observability/watchd/src/mishkan_watchd/server.py +102 -8
  94. package/payload/mishkan/observability/watchd/src/mishkan_watchd/sources/cognee_poll.py +136 -49
  95. package/payload/mishkan/ontology.md +8 -1
  96. package/payload/mishkan/ontology.ttl +188 -0
  97. package/payload/mishkan/scripts/ensure-work-store.sh +230 -0
  98. package/payload/mishkan/scripts/mishkan-ingest.sh +49 -3
  99. package/payload/mishkan/scripts/promote-curated.sh +77 -0
  100. package/payload/mishkan/scripts/reset-knowledge-data.sh +70 -0
  101. package/payload/mishkan/scripts/validate-research-log.sh +27 -0
  102. package/payload/mishkan/skills/baruch-research-reporting-craft/SKILL.md +42 -8
  103. package/payload/mishkan/skills/cognee-promote/SKILL.md +13 -0
  104. package/payload/mishkan/skills/cognee-quickstart/SKILL.md +7 -1
  105. package/payload/mishkan/skills/ezra-research-formulation-craft/SKILL.md +9 -0
  106. package/payload/mishkan/skills/mishkan-ingest/SKILL.md +22 -0
  107. package/payload/mishkan/skills/mishkan-init/SKILL.md +31 -19
  108. package/payload/mishkan/skills/shemaiah-evaluation-craft/SKILL.md +33 -5
  109. package/payload/mishkan/skills/team-lead-craft/SKILL.md +66 -0
  110. package/payload/mishkan/templates/mcp.json +7 -2
  111. package/payload/mishkan/templates/observability-log.schema.json +1 -1
  112. package/payload/mishkan/templates/research-log.schema.json +15 -1
  113. package/payload/mishkan/workflows/README.md +19 -13
  114. package/payload/mishkan/workflows/chosheb-feature-ship.js +63 -18
  115. package/payload/mishkan/workflows/migdal-dr-drill.js +4 -0
  116. package/payload/mishkan/workflows/migdal-infra-change.js +48 -7
  117. package/payload/mishkan/workflows/mishkan-architecture-panel.js +4 -0
  118. package/payload/mishkan/workflows/mishkan-blast-radius.js +4 -0
  119. package/payload/mishkan/workflows/mishkan-codebase-audit.js +4 -0
  120. package/payload/mishkan/workflows/mishkan-deep-research.js +4 -0
  121. package/payload/mishkan/workflows/mishkan-init.js +4 -0
  122. package/payload/mishkan/workflows/mishkan-knowledge-gap-discovery.js +4 -0
  123. package/payload/mishkan/workflows/mishkan-migration-wave.js +4 -0
  124. package/payload/mishkan/workflows/mishkan-release-readiness.js +4 -0
  125. package/payload/mishkan/workflows/mishkan-sprint-close.js +4 -0
  126. package/payload/mishkan/workflows/mishkan-standards-rollout.js +4 -0
  127. package/payload/mishkan/workflows/mishmar-security-gate.js +45 -6
  128. package/payload/mishkan/workflows/panim-ds-rollout.js +4 -0
  129. package/payload/mishkan/workflows/panim-feature-ship.js +132 -0
  130. package/payload/mishkan/workflows/sefer-release-notes.js +4 -0
  131. package/payload/mishkan/workflows/yasad-data-migration-wave.js +4 -0
  132. package/payload/mishkan/workflows/yasad-feature-ship.js +130 -0
  133. package/payload/mishkan/workflows/yasad-schema-evolution.js +4 -0
@@ -62,7 +62,9 @@ finding:
62
62
 
63
63
  Stateful operations hard stop. Sequence before implementation. Diagnose
64
64
  before fix. Durable solutions only. No scope expansion. No fabricated
65
- facts. English for all output.
65
+ facts. Surface an unknown you cannot resolve up to the main session rather
66
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
67
+ English for all output.
66
68
 
67
69
  ---
68
70
 
@@ -51,7 +51,9 @@ You document the specific project: its decisions, its operations, its history.
51
51
 
52
52
  Stateful operations hard stop. Sequence before implementation. Diagnose
53
53
  before fix. Durable solutions only. No scope expansion. No fabricated
54
- facts. English for all output.
54
+ facts. Surface an unknown you cannot resolve up to the main session rather
55
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
56
+ English for all output.
55
57
 
56
58
  MADR for ADRs. Keep a Changelog. Diátaxis quadrant.
57
59
 
@@ -49,7 +49,9 @@ You collect and assemble. You do not decide and you do not produce work.
49
49
 
50
50
  Stateful operations hard stop. Sequence before implementation. Diagnose
51
51
  before fix. Durable solutions only. No scope expansion. No fabricated
52
- facts. English for all output.
52
+ facts. Surface an unknown you cannot resolve up to the main session rather
53
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
54
+ English for all output.
53
55
 
54
56
  No `/plan` (collect-only role).
55
57
 
@@ -54,7 +54,9 @@ You work the delivery layer: CI/CD, build, release automation.
54
54
 
55
55
  Stateful operations hard stop. Sequence before implementation. Diagnose
56
56
  before fix. Durable solutions only. No scope expansion. No fabricated
57
- facts. English for all output.
57
+ facts. Surface an unknown you cannot resolve up to the main session rather
58
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
59
+ English for all output.
58
60
 
59
61
  No `:latest`. SOPS for secrets.
60
62
 
@@ -56,7 +56,9 @@ change, the alternatives, what is affected, the rollback path.
56
56
 
57
57
  Stateful operations hard stop. Sequence before implementation. Diagnose
58
58
  before fix. Durable solutions only. No scope expansion. No fabricated
59
- facts. English for all output.
59
+ facts. Surface an unknown you cannot resolve up to the main session rather
60
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
61
+ English for all output.
60
62
 
61
63
  No `:latest`. All resources tagged. SOPS for secrets.
62
64
 
@@ -59,7 +59,9 @@ approval needed. Capture the outcome as an ADR (MADR) for Sefer to publish.
59
59
 
60
60
  Stateful operations hard stop. Sequence before implementation. Diagnose
61
61
  before fix. Durable solutions only. No scope expansion. No fabricated
62
- facts. English for all output.
62
+ facts. Surface an unknown you cannot resolve up to the main session rather
63
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
64
+ English for all output.
63
65
 
64
66
  Approval gate via `/plan`.
65
67
 
@@ -81,7 +81,9 @@ stop, surface it, and wait.
81
81
 
82
82
  Stateful operations hard stop. Sequence before implementation. Diagnose
83
83
  before fix. Durable solutions only. No scope expansion. No fabricated
84
- facts. English for all output.
84
+ facts. Surface an unknown you cannot resolve up to the main session rather
85
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
86
+ English for all output.
85
87
 
86
88
  Approval gate on consequential decisions via `/plan`.
87
89
 
@@ -48,7 +48,9 @@ prepared, optimised, delivered.
48
48
 
49
49
  Stateful operations hard stop. Sequence before implementation. Diagnose
50
50
  before fix. Durable solutions only. No scope expansion. No fabricated
51
- facts. English for all output.
51
+ facts. Surface an unknown you cannot resolve up to the main session rather
52
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
53
+ English for all output.
52
54
 
53
55
  Core Web Vitals budgets (LCP < 2.5s, INP < 200ms, CLS < 0.1).
54
56
 
@@ -56,7 +56,9 @@ Plan before a **design-system or state-management architectural change**.
56
56
 
57
57
  Stateful operations hard stop. Sequence before implementation. Diagnose
58
58
  before fix. Durable solutions only. No scope expansion. No fabricated
59
- facts. English for all output.
59
+ facts. Surface an unknown you cannot resolve up to the main session rather
60
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
61
+ English for all output.
60
62
 
61
63
  pnpm only. WCAG 2.2 AA. Core Web Vitals budgets. TanStack Query/Router.
62
64
 
@@ -52,7 +52,9 @@ You work at the structural intersection: OS, virtualisation, networking.
52
52
 
53
53
  Stateful operations hard stop. Sequence before implementation. Diagnose
54
54
  before fix. Durable solutions only. No scope expansion. No fabricated
55
- facts. English for all output.
55
+ facts. Surface an unknown you cannot resolve up to the main session rather
56
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
57
+ English for all output.
56
58
 
57
59
  Two root causes on non-trivial failures (e.g. an incident is often applicative + network).
58
60
 
@@ -61,7 +61,9 @@ constraint, the threat it addresses, which teams it binds, and the cost.
61
61
 
62
62
  Stateful operations hard stop. Sequence before implementation. Diagnose
63
63
  before fix. Durable solutions only. No scope expansion. No fabricated
64
- facts. English for all output.
64
+ facts. Surface an unknown you cannot resolve up to the main session rather
65
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
66
+ English for all output.
65
67
 
66
68
  Two root causes on non-trivial failures. Approval gate via `/plan`.
67
69
 
@@ -50,7 +50,9 @@ You watch for risk and advise. Reliability, SLOs, capacity, infra security postu
50
50
 
51
51
  Stateful operations hard stop. Sequence before implementation. Diagnose
52
52
  before fix. Durable solutions only. No scope expansion. No fabricated
53
- facts. English for all output.
53
+ facts. Surface an unknown you cannot resolve up to the main session rather
54
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
55
+ English for all output.
54
56
 
55
57
  ---
56
58
 
@@ -58,7 +58,9 @@ Plan before any **state-management architectural change**.
58
58
 
59
59
  Stateful operations hard stop. Sequence before implementation. Diagnose
60
60
  before fix. Durable solutions only. No scope expansion. No fabricated
61
- facts. English for all output.
61
+ facts. Surface an unknown you cannot resolve up to the main session rather
62
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
63
+ English for all output.
62
64
 
63
65
  pnpm only. WCAG 2.2 AA. Core Web Vitals budgets.
64
66
 
@@ -61,7 +61,9 @@ engineering identity, conventions that span every project.
61
61
 
62
62
  Stateful operations hard stop. Sequence before implementation. Diagnose
63
63
  before fix. Durable solutions only. No scope expansion. No fabricated
64
- facts. English for all output.
64
+ facts. Surface an unknown you cannot resolve up to the main session rather
65
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
66
+ English for all output.
65
67
 
66
68
  Diátaxis quadrant declared.
67
69
 
@@ -57,7 +57,9 @@ data-safety implications, the rollback path, and what depends on the schema.
57
57
 
58
58
  Stateful operations hard stop. Sequence before implementation. Diagnose
59
59
  before fix. Durable solutions only. No scope expansion. No fabricated
60
- facts. English for all output.
60
+ facts. Surface an unknown you cannot resolve up to the main session rather
61
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
62
+ English for all output.
61
63
 
62
64
  ---
63
65
 
@@ -54,7 +54,9 @@ sources: [...]
54
54
 
55
55
  Stateful operations hard stop. Sequence before implementation. Diagnose
56
56
  before fix. Durable solutions only. No scope expansion. No fabricated
57
- facts. English for all output.
57
+ facts. Surface an unknown you cannot resolve up to the main session rather
58
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
59
+ English for all output.
58
60
 
59
61
  ---
60
62
 
@@ -46,6 +46,9 @@ verdict: resolved|partial|blocked
46
46
  confidence: high|medium|low
47
47
  gaps: [...] # unanswered sub-questions
48
48
  curated_library_agreement: agrees|conflicts|not_covered
49
+ curated_promotion_candidate: null | {name,url,problem_class,team,source_tier,why}
50
+ # D-016: non-null ONLY when resolved + confidence≥medium +
51
+ # not_covered + cross-project reuse. Nominates, never writes.
49
52
  ```
50
53
 
51
54
  ## Skills (invoke on demand)
@@ -57,7 +60,9 @@ curated_library_agreement: agrees|conflicts|not_covered
57
60
 
58
61
  Stateful operations hard stop. Sequence before implementation. Diagnose
59
62
  before fix. Durable solutions only. No scope expansion. No fabricated
60
- facts. English for all output.
63
+ facts. Surface an unknown you cannot resolve up to the main session rather
64
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
65
+ English for all output.
61
66
 
62
67
  ---
63
68
 
@@ -47,7 +47,9 @@ You embed with the teams and document what they produce.
47
47
 
48
48
  Stateful operations hard stop. Sequence before implementation. Diagnose
49
49
  before fix. Durable solutions only. No scope expansion. No fabricated
50
- facts. English for all output.
50
+ facts. Surface an unknown you cannot resolve up to the main session rather
51
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
52
+ English for all output.
51
53
 
52
54
  Diátaxis quadrant declared.
53
55
 
@@ -59,7 +59,9 @@ finding:
59
59
 
60
60
  Stateful operations hard stop. Sequence before implementation. Diagnose
61
61
  before fix. Durable solutions only. No scope expansion. No fabricated
62
- facts. English for all output.
62
+ facts. Surface an unknown you cannot resolve up to the main session rather
63
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
64
+ English for all output.
63
65
 
64
66
  No `/plan` (evaluate against known rules).
65
67
 
@@ -46,7 +46,9 @@ You keep the record and assemble Migdal's milestone report.
46
46
 
47
47
  Stateful operations hard stop. Sequence before implementation. Diagnose
48
48
  before fix. Durable solutions only. No scope expansion. No fabricated
49
- facts. English for all output.
49
+ facts. Surface an unknown you cannot resolve up to the main session rather
50
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
51
+ English for all output.
50
52
 
51
53
  No `/plan` (collect-only role).
52
54
 
@@ -58,7 +58,9 @@ guarantees to be fixed, and what they bind.
58
58
 
59
59
  Stateful operations hard stop. Sequence before implementation. Diagnose
60
60
  before fix. Durable solutions only. No scope expansion. No fabricated
61
- facts. English for all output.
61
+ facts. Surface an unknown you cannot resolve up to the main session rather
62
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
63
+ English for all output.
62
64
 
63
65
  ---
64
66
 
@@ -57,7 +57,9 @@ why this shape, what consumes it, what is out of scope.
57
57
 
58
58
  Stateful operations hard stop. Sequence before implementation. Diagnose
59
59
  before fix. Durable solutions only. No scope expansion. No fabricated
60
- facts. English for all output.
60
+ facts. Surface an unknown you cannot resolve up to the main session rather
61
+ than guessing — a subagent cannot delegate onward (its Task tool is inert).
62
+ English for all output.
61
63
 
62
64
  OpenAPI 3.1 contract before any endpoint. Approval gate via `/plan`.
63
65
 
@@ -136,6 +136,17 @@ COGNEE_PORT=7777
136
136
  # Cognee 1.x defaults multi-user access control ON, whose handler is incompatible
137
137
  # with neo4j. Single-user self-host → disable it:
138
138
  ENABLE_BACKEND_ACCESS_CONTROL=false
139
+ # ⚠️ ISOLATION (verified, cognee v1.1.0 + issue #2855/#1023): with access control
140
+ # OFF on a Neo4j backend, cognee's `datasets=` filter is ADVISORY ONLY — silently
141
+ # ignored; search runs the WHOLE graph. So projects sharing one Neo4j work store
142
+ # are MUTUALLY VISIBLE (a query scoped to one project can return another's data).
143
+ # RESOLUTION — ADR D-012: each project gets its OWN per-project work store
144
+ # (embedded Ladybug container + volume, mishkan-work-<slug>), provisioned by
145
+ # ensure-work-store.sh; isolation is by topology, not datasets=. This .env config
146
+ # (GRAPH_DATABASE_PROVIDER=neo4j below) is the LEGACY shared work box; the
147
+ # per-project stores override the graph provider to ladybug via
148
+ # docker-compose.work.yml. While any project still uses the shared box, treat it
149
+ # as a SINGLE TRUST DOMAIN: no secrets, no PII, opt-in + scrubbed ingest only.
139
150
 
140
151
  # Secured default user — OVERRIDE Cognee's built-in default_user@example.com + default
141
152
  # password. Even with access control off, set these so the well-known defaults don't work.
@@ -31,6 +31,26 @@ WORKDIR /app
31
31
  RUN git clone https://github.com/topoteretes/cognee.git . \
32
32
  && git checkout "$COGNEE_MCP_REF"
33
33
  WORKDIR /app/cognee-mcp
34
+
35
+ # MISHKAN overlay patch 1/2 — align cognee CORE to the pinned wrapper ref.
36
+ # cognee-mcp pins the core LOOSELY against PyPI (>=1.0.0,<2.0.0), so uv sync
37
+ # would install a different core version than the checked-out wrapper. That skew
38
+ # is what makes the recall patch below collide with the core's own user= pass
39
+ # ("authorized_search() got multiple values for keyword argument 'user'"). This
40
+ # rewrites the core dep to a `@ file:///app` direct reference so uv builds the
41
+ # core from the same checkout. Idempotent + fail-loud. Must run before uv sync.
42
+ COPY --chown=cognee:cognee patches/cognee-mcp-core-align.py /app/_mishkan_core_align.py
43
+ RUN python /app/_mishkan_core_align.py
44
+
45
+ # MISHKAN overlay patch 2/2 — cognee-mcp recall()/search() omit `user=` (upstream
46
+ # cognee issue #2855, unfixed through v1.1.2), which breaks the read/search path
47
+ # with "'NoneType' object has no attribute 'id'". Apply to the checked-out
48
+ # source before uv sync. Idempotent + fail-loud: the build fails if the anchor
49
+ # call-sites move on a COGNEE_MCP_REF bump, so we never ship a silently-unpatched
50
+ # (still-broken) image. Drop this COPY/RUN once a fixed cognee-mcp ref is pinned.
51
+ COPY --chown=cognee:cognee patches/cognee-mcp-recall-user.py /app/_mishkan_patch.py
52
+ RUN python /app/_mishkan_patch.py
53
+
34
54
  RUN uv sync --all-extras
35
55
 
36
56
  # Pre-create the persisted-storage root owned by cognee (uid 10001). A named
@@ -9,6 +9,17 @@ graph persistence is deferred until it's up.
9
9
  New to Cognee setup? Run the **cognee-quickstart** skill first — it walks the
10
10
  Python env, provider keys, and backend choices.
11
11
 
12
+ > ⚠️ **Project isolation.** Per **ADR D-012**, each project gets its **own**
13
+ > physically-separate work store — a lightweight cognee-mcp container with an
14
+ > embedded **Ladybug** graph + its own volume (`mishkan-work-<slug>`, own port),
15
+ > provisioned by `ensure-work-store.sh` at `/mishkan-init`. Isolation is by
16
+ > topology, **not** cognee's `datasets=` filter: with
17
+ > `ENABLE_BACKEND_ACCESS_CONTROL=false` (required on Neo4j) that filter is
18
+ > advisory-only and does **not** isolate (cognee v1.1.0 / issue #1023).
19
+ > **Legacy / transition:** the old shared `:7777` Neo4j work box holds all
20
+ > projects in one graph — treat it as a single trust domain (no secrets/PII,
21
+ > scrubbed opt-in ingest) until each project is migrated to its own store.
22
+
12
23
  ## Bring it up
13
24
 
14
25
  ```bash
@@ -34,28 +45,37 @@ nc -z localhost 7730 && echo "cognee-mcp (curated) up on :7730"
34
45
  ~/.claude/mishkan/scripts/seed-curated-library.sh # targets mishkan-curated-mcp
35
46
  ```
36
47
 
37
- ## Two stores (decision D-007)
48
+ ## Three stores (decisions D-007 + D-012)
38
49
 
39
50
  | Store | Containers | Port | Holds | MCP alias |
40
51
  |---|---|---|---|---|
41
- | **work** | `mishkan-cognee-*` | 7777 | per-project knowledge + `<client>_memory` | `cognee` (read+write) |
52
+ | **per-project work** | `mishkan-work-<slug>` | own port | this project's knowledge embedded **Ladybug**, physically isolated per project (D-012) | `cognee` (read+write) |
53
+ | **session memory** | `mishkan-cognee-*` | 7777 | `claude_code_memory` only — shared per-client session memory (the kept Neo4j box) | `cognee-memory` (read+write) |
42
54
  | **curated** | `mishkan-curated-*` | 7730 | the cross-project reference library only | `cognee-curated` (read) |
43
55
 
44
- The curated library is **physically isolated** in its own Neo4j so project data
45
- (which can contain PII) never mixes with it. The curated box reuses the shared
46
- Ollama and the shared Postgres *server* (own database `curated_db`). The
47
- per-client memory dataset (e.g. `claude_code_memory`) is part of the **work**
48
- store and must not be pruned.
56
+ **Per-project work (D-012):** each project gets its own isolated work store
57
+ a cognee-mcp container with an embedded Ladybug graph + its own volume, on its
58
+ own port, provisioned by `ensure-work-store.sh` at `/mishkan-init`. Isolation is
59
+ by topology (container + volume), **not** the `datasets=` filter (which is
60
+ advisory-only on Neo4j with access control off — cognee v1.1.0 / issue #1023).
61
+
62
+ **Session memory:** `claude_code_memory` is per-client session memory — one
63
+ continuous thing across all your work, not re-derivable — so it stays in the one
64
+ shared box (`:7777`, the `cognee-memory` alias) and is never pruned. `CACHING=false`
65
+ + `COGNEE_MCP_AGENT_SCOPED=false` on the per-project stores keep both memory layers
66
+ out of them, so memory cannot fragment.
67
+
68
+ **Curated** is physically isolated in its own Neo4j so project data (which can
69
+ contain PII) never mixes with the cross-project reference. It reuses the shared
70
+ Ollama and Postgres *server* (own database `curated_db`).
49
71
 
50
72
  ## How agents reach it
51
73
 
52
- Claude Code connects via the project's `.mcp.json` (seeded by `/mishkan-init`
53
- from `~/.claude/mishkan/templates/mcp.json`), which declares **both** stores:
54
- `cognee` → work (`http://localhost:7777/mcp`) and `cognee-curated` → curated
55
- (`http://localhost:7730/mcp`). A **zero-container stdio alternative** is included
56
- in that template (`_stdio_alternative`): it launches `cognee-mcp` directly via
57
- `uv --directory <path-to-cognee-mcp> run cognee-mcp` with `LLM_API_KEY` — no
58
- container, no port. Use whichever fits.
74
+ Claude Code connects via the project's `.mcp.json` (rendered by `/mishkan-init`
75
+ from `~/.claude/mishkan/templates/mcp.json`), which declares **three** doorways:
76
+ `cognee` → this project's own work store (its own port), `cognee-memory` →
77
+ `http://localhost:7777/mcp` (shared session memory), `cognee-curated`
78
+ `http://localhost:7730/mcp` (shared reference).
59
79
 
60
80
  ## Transports (per cognee docs)
61
81
 
@@ -32,11 +32,26 @@ services:
32
32
  volumes:
33
33
  - curated_neo4j_data:/data
34
34
  healthcheck:
35
- test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:7474 >/dev/null 2>&1 || exit 1"]
35
+ # Conditional TCP probe WITH internal retries. Each invocation tries to open
36
+ # :7474 up to 3 times with a 2s gap and exits 0 on the first connect — so a
37
+ # momentary blip during the slow Neo4j+APOC cold-start does not register as a
38
+ # failure. bash /dev/tcp, NOT a wget HTTP GET (which takes 5-10s on a loaded
39
+ # Neo4j and blew the old timeout, false-flagging a healthy box and cascading to
40
+ # curated-mcp). The for-loop IS the retry; `&& exit 0` is the conditional
41
+ # success; `exit 1` fires only if all 3 attempts in the window fail.
42
+ test: ["CMD", "bash", "-c", "for i in 1 2 3; do (exec 3<>/dev/tcp/127.0.0.1/7474) 2>/dev/null && exit 0; [ \"$$i\" = 3 ] || sleep 2; done; exit 1"]
36
43
  interval: 15s
37
- timeout: 5s
44
+ timeout: 10s
38
45
  retries: 5
39
- start_period: 30s
46
+ # 240s: observed cold-start was 174s under full-stack I/O contention — right
47
+ # against the old 180s grace, so `compose up` declared the dependency failed
48
+ # ~4s before the health flip. 240s clears the observed worst case with margin;
49
+ # a too-long start_period only delays the first probe, never slows a healthy box.
50
+ start_period: 240s
51
+ # start_interval (Docker 25+): during start_period, probe every 5s instead of
52
+ # the 15s steady-state interval, so a healthy flip is detected within ~5s of
53
+ # the port binding — this removes the race, not just the larger grace.
54
+ start_interval: 5s
40
55
  networks:
41
56
  - shared
42
57
  security_opt:
@@ -59,11 +74,23 @@ services:
59
74
  ports:
60
75
  - "127.0.0.1:${CURATED_MCP_PORT:-7730}:7777"
61
76
  healthcheck:
62
- test: ["CMD-SHELL", "python3 -c \"import socket; socket.create_connection(('127.0.0.1',7777),2).close()\" || exit 1"]
77
+ # Conditional probe WITH internal retries: connect up to 3 times (1s apart, no
78
+ # trailing sleep), exit 0 on the first success — absorbs a transient blip
79
+ # without flagging a failure. `$$i` is escaped so compose passes a literal $i
80
+ # through to the shell.
81
+ test: ["CMD-SHELL", "for i in 1 2 3; do python3 -c \"import socket; socket.create_connection(('127.0.0.1',7777),2).close()\" 2>/dev/null && exit 0; [ \"$$i\" = 3 ] || sleep 1; done; exit 1"]
63
82
  interval: 15s
64
- timeout: 5s
83
+ timeout: 10s
65
84
  retries: 10
66
- start_period: 90s
85
+ # 300s: cognee-mcp cold-start is slow (~4-5min — cognee lib import + graph
86
+ # init + ollama embedding warmup + DB migrations before it binds :7777). The
87
+ # old 90s grace flagged a still-booting container unhealthy on every cold
88
+ # start. A generous start_period only delays the first probe; it never slows
89
+ # a healthy container. Matches the shared :7777 box (base compose) at 300s.
90
+ start_period: 300s
91
+ # start_interval (Docker 25+): probe every 5s during start_period so the health
92
+ # flip is caught within ~5s of :7777 binding, not up to 15s later.
93
+ start_interval: 5s
67
94
  networks:
68
95
  - shared
69
96
  security_opt:
@@ -52,17 +52,43 @@ services:
52
52
  NEO4J_PLUGINS: '["apoc"]'
53
53
  NEO4J_dbms_security_procedures_unrestricted: "apoc.*"
54
54
  NEO4J_dbms_security_procedures_allowlist: "apoc.*"
55
+ # Explicit heap + pagecache. Left unset, Neo4j auto-sizes conservatively
56
+ # against the cgroup limit and can GC-pause under a bulk cognify (APOC
57
+ # label/edge writes across many docs at once), making bolt briefly
58
+ # unresponsive -> the client sees "ServiceUnavailable ... Timed out" mid-
59
+ # ingest. Sized for the 4g limit below: heap initial==max (no resize pause)
60
+ # 1g + pagecache 1g leaves ~2g for off-heap + OS. Tune up for larger graphs.
61
+ NEO4J_server_memory_heap_initial__size: "1g"
62
+ NEO4J_server_memory_heap_max__size: "1g"
63
+ NEO4J_server_memory_pagecache_size: "1g"
55
64
  ports:
56
65
  - "127.0.0.1:${NEO4J_HTTP_PORT:-7716}:7474" # Neo4j Browser
57
66
  - "127.0.0.1:${NEO4J_BOLT_PORT:-7709}:7687" # bolt
58
67
  volumes:
59
68
  - neo4j_data:/data
60
69
  healthcheck:
61
- test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:7474 >/dev/null 2>&1 || exit 1"]
70
+ # Conditional TCP probe WITH internal retries. Each invocation tries to open
71
+ # :7474 up to 3 times with a 2s gap and exits 0 on the first connect — so a
72
+ # momentary blip during the slow Neo4j+APOC cold-start does not register as a
73
+ # failure. bash /dev/tcp, NOT a wget HTTP GET (the GET takes 5-10s on a loaded
74
+ # Neo4j and blew the old timeout, false-flagging a healthy box and cascading to
75
+ # cognee-mcp via depends_on). The for-loop IS the retry; `&& exit 0` is the
76
+ # conditional success; `exit 1` fires only if all 3 attempts in the window fail.
77
+ test: ["CMD", "bash", "-c", "for i in 1 2 3; do (exec 3<>/dev/tcp/127.0.0.1/7474) 2>/dev/null && exit 0; [ \"$$i\" = 3 ] || sleep 2; done; exit 1"]
62
78
  interval: 15s
63
- timeout: 5s
79
+ timeout: 10s
64
80
  retries: 5
65
- start_period: 30s
81
+ # 240s: observed cold-start was 174s under full-stack I/O contention (ollama +
82
+ # pg + both neo4j warming in parallel) — right against the old 180s grace, so
83
+ # `compose up` gave up ~4s before the health flip and declared the dependency
84
+ # failed. 240s clears the observed worst case with margin; a too-long
85
+ # start_period only delays the first probe, it never slows a healthy container.
86
+ start_period: 240s
87
+ # start_interval (Docker 25+): during start_period, probe every 5s instead of
88
+ # the 15s steady-state interval, so a healthy flip is detected within ~5s of
89
+ # the port binding. THIS removes the race (compose up giving up just before a
90
+ # 15s-cadence probe would fire) — the larger grace alone only narrowed it.
91
+ start_interval: 5s
66
92
  networks:
67
93
  - cognee_net
68
94
  security_opt:
@@ -70,8 +96,12 @@ services:
70
96
  deploy:
71
97
  resources:
72
98
  limits:
73
- cpus: "1.5"
74
- memory: 2g
99
+ # Raised 2g -> 4g (+cpus 1.5 -> 2.0): 2g was too tight for Neo4j+APOC
100
+ # under bulk cognify — heap+pagecache+off-heap collided with the cap and
101
+ # stalled the bolt server. 4g gives the configured 1g heap + 1g pagecache
102
+ # real headroom; the extra core shortens GC pauses.
103
+ cpus: "2.0"
104
+ memory: 4g
75
105
 
76
106
  postgres:
77
107
  image: pgvector/pgvector:pg16