Reintegrate projax with mBrian as backend (data on mBrian, both frontends in parallel) #5
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Premise (m's framing, 2026-05-29)
Use mBrian as projax's backend store so projax data lives in mBrian's graph and is automatically visible to both surfaces. mBrian's node+edge model + jsonb metadata accommodates the types projax needs. The graph stays canonical, no redundant data, both frontends keep working in parallel.
Current state
projax.itemstable (47 rows) +projax.item_links+projax.views(Phase 5j incoming) + bidirectional sync withmai.projects(Phase 1.5). Trigger-maintainedpaths text[]+ slug-per-sibling uniqueness. Rich structured columns (status, pinned, tags, management, public_*, timeline_exclude). Aggregator (Phase 5a) over the projax store. Tiles dashboard (Phase 5h), calendar grid (Phase 5e), timeline (Phase 4a). MCP at/mcp/rpc.mcp__mbrian__*.Mapping projax → mBrian
projax.itemsrow → mBrian node, type either a new[item]or[project](or piggy-back on[topic]since hierarchy is the same shape).projax.item_linksrow → mBrian edge withref_typeas the edge relation + jsonb for ref_id / event_date / note.metadatajsonb.child_ofedges. The paths array becomes a derived render-time concept, not a stored field.Implementation shapes (4 options)
A. Full backend migration
projax loses its store. All reads/writes go through mBrian's MCP or direct DB. projax becomes a specialized view over the mBrian subset. End-state cleanest, cost highest. Touches: store/, aggregator/, every handler, every MCP tool, the mai.projects sync, every test. Multi-phase (likely a 5-7 sub-phase project on its own).
B. Bidirectional sync (mai.projects pattern from Phase 1.5)
Keep
projax.itemsas projax's store. Add triggers: projax → mBrian on projax-side write; mBrian → projax on mBrian-side write. Both sides read their own. Mirrors the existing Phase 1.5 pattern. Lower cost than A. Risk: sync drift (already accepted for mai.projects, would be accepted again here). Both frontends "see" the data because each stores it.C. One-way mirror (projax → mBrian)
projax remains source of truth. On every projax write, mirror to mBrian. mBrian gets the data for graph view + search but doesn't write back. Simpler than B, less symmetric — m can't edit a projax item from mBrian's UI.
D. MCP federation
No data duplication. mBrian's frontend queries projax via MCP for projax-shaped data. projax stays canonical. mBrian renders projax data inline where relevant (e.g. on a topic page that's associated with a projax item, mBrian fetches that item via
mcp__projax__get_item). No schema changes anywhere. Lowest cost. End-state: federation, not integration.Recommendation (head's read)
B or D, depending on whether m wants editing from both surfaces:
A is the architecturally ideal end-state but the implementation cost is large and would freeze projax development for the duration. Phase 5j (Views redesign) just started; landing A mid-5j is impractical.
C is a stepping stone toward A but rarely a stable end-state.
Open questions
projax_itemdirectly, or do we need a new type? ([project]exists?[item]exists?)child_ofcarry slug semantics, or just parent-child relationship? Slug uniqueness per sibling — enforced where?mai.projects↔projax.itemsbidirectional sync: keep, drop, or chain through mBrian?Constraints (don't relitigate)
Refs
docs/design.md— current PRDconcept-mbrian-conventionsnode — node/edge naming patternsDecision needed from m
Which shape (A/B/C/D), and if A or B, what's the sequencing relative to Phase 5j (Views redesign in flight)?
m's decision (2026-05-29 12:09)
Pick: A — Full backend migration
m sees projax-as-project-management completing mBrian. Data loss-tolerance is high (47 items, hours-old structure). End-state: mBrian is canonical store; projax UI surfaces mBrian-sourced project data.
Sequencing (head proposal — needs m confirmation)
Let Phase 5j finish (kahn currently 5/7 slices through — A/B/C/E/G shipped; D editor + F 5i cleanup remain). The just-built /views routes, sidebar, system-view migration, icon registry are UI scaffolding that PRESERVES into Phase 6 — they just point at a different data source once the backend swaps. Estimated: D + F land in next 30-60 min at kahn's current cadence.
Start Phase 6 (mBrian backend migration) design as a separate inventor task. Phase 6 brief needs:
Outstanding open questions (still need m's input — from original issue body)
[project]type or new[item]/[work-item]type?Status: Phase 5j continues, Phase 6 design queued for after 5j ships