Name: [Campaign] Brain v17 Complete: v1.4 + v2.0 Foundation — WI-1..WI-11

State: Killed

PR State: merged

PR Author: David Tran

PR Author Email:

PR: #22

Committer: David Tran

Committer Email: davidtran.hp@gmail.com

Commit: ab8ad4749ca54b61598ab4bcf623391f4107d61c

Description:

                                            [ADD] viin_brain: activate bus.bus OT collab step relay for real-time editing (WI-9)

Implements ADR-002 Option 1: real-time collaborative editing via OdooEditor's
bus.bus peer-to-peer OT mechanism, as documented in
docs/brain/architecture/adr_002_crdt_collab.md.

Changes:
- viin.brain.collab.step: new transient model acting as a 100-step rolling
  buffer per page for reconnect replay (GET /viin_brain/collab/history/<id>).
- BrainCollabController: POST /viin_brain/collab/step fans out edit steps
  via bus.bus channel editor_collaboration:viin.brain.page:content_html:<id>
  and stores steps in the rolling buffer.
- collab_step_service.js: new OWL service that subscribes to the bus.bus
  collab channel, delivers peer steps to registered listeners, and exposes
  broadcastStep() / loadHistory() for the page editor.
- page_editor.js: wires collab_step_service when realtime_collab=True —
  generates a stable tab clientId, subscribes on page open, loads missed
  history on reconnect, broadcasts edit steps fire-and-forget, applies peer
  HTML snapshots when no local save is pending, tears down on page switch /
  unmount.
- ConflictDialog: retained as fallback for non-collaborative saves (force
  path and offline edge cases); disabled in the collab hot path
  (expectedToken=false, force=True per existing WI-13 flag).
- ACL: editor + admin rows added for viin.brain.collab.step.
- Tests: TransactionCase unit tests for the rolling buffer model + HttpCase
  controller smoke tests + tour verifying service registry wiring.

Note: full 2-writer concurrent edit scenario (M>0 evidence) is PENDING —
requires a live Odoo server with two authenticated browser sessions. Server
is not running in this sprint environment. Test infrastructure is complete;
manual verification procedure documented in brain_collab_activation_tour.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
                                            

Branch: 17.0

Instance ID: 0

Age:

Up-time: Not finished