Parser 2011/Real-time collaboration/Project

Purpose
We have found that concurrently editing documents in a shared online space, such as Etherpad or Google Docs, to be very productive and engenders better social relations among people working together. It creates a space that can be shared in the same room, or across the world.

As an experiment we would like to bring a similar kind of editing to MediaWiki. Our goals include:

Bring WMF employees back to the wiki.
 * The WMF employees have found Etherpad to be very useful, and use it almost exclusively for first drafts of internal documents or meeting notes. Unfortunately this cuts them off from the community, or imposes the extra chore of copying data from Etherpad to the wiki. By bringing collaboration and chat to a wiki page, at the very least, we can bring our own employees back to the wiki community.

More engaging interface for groups that want to work together.
 * Similarly, we hope to allow WikiProjects and other such gatherings to be able to chat live together, in a space that was previously only asynchronous.

A new means for mentoring new users and transfering knowledge.
 * If there were a way for people having trouble with wikitext to have a sort of co-pilot, it might increase the flow of knowledge to new users.

A unified social experience on the wiki.
 * Currently, there are only weak connections between live chat (IRC) and mailing lists and the wikis themselves. Perhaps this will allow us to integrate them. (IRC <-> etherpad chat bridge?)

Project scope (phase 1)
Preliminary description:

We don't want to see as much of the Etherpad or HackPad site, we basically just want an unadorned iframe, with chat and indications of who has edited what.

Must have

 * shows who is editing with you
 * shows edits from all
 * chat window
 * allows save to the wiki

Nice to have

 * maybe accept some generic editing commands from WikiEditor so templates etc can be inserted, i.e. has an API like "insert this text at the insertion point".

Won't have

 * Security
 * It is hard to know what users are going to want in terms of security -- who is allowed to be in an editing session with you, what precautions need to be taken against vandalism, etc.. We will need to experiment. This is deferred to a later phase.

Longer term ideas

 * import history of the entire page from MediaWiki into Etherpad so changes can be viewed by slider. These would be more coarse-grained than Etherpad's edit history, of course.

User Stories
These are some initial user stories (and technical requirements) for the project. Longer term ideas, like scrolling through history, are not outlined here.

While we expect to do a prototype of this project by forking Etherpad (or adding authentication features), the project is not necessarily bound to that server. It may ultimately be better to use other concurrency servers such as OpenCoWeb

Base case - no regression from current experience

 * User can create or edit page & save it, as plain wikitext, as normal
 * Fixed-width font (for wikitext)
 * Styling is not available or hidden
 * Edit window appears similarly to the WikiEditor
 * WikiEditor commands work normally
 * Extensions to WikiEditor work normally
 * Conflict resolution works normally

Concurrent editing

 * Users who choose to edit the same page while other users are editing may an existing concurrent editing session, or start their own
 * In a concurrent session, users work in a shared space where they can see theirs and each others' changes with high responsiveness.
 * This implies an Operational Transformations-style algorithm for communicating changes.
 * Undo is shared (the same actions are undone for all connected users)
 * Interface that is specific to the concurrent editor (for instance, toggling user annotations, hiding and showing chat) are minimized or eliminated
 * Ideally, such interface should migrate to the enclosing WikiEditor, and should not be trapped inside an iframe.

Saving

 * Any user at any time may choose to save the session to MediaWiki as a standard revision.
 * The page revision will be logged as the work of that user.
 * The summary log message for a saved page defaults to showing the usernames of other collaborators from that session.
 * This is marked in some way that will be easy for a bot to understand, in the future.
 * It may be desirable to insert the collaborators into the summary message with a script.

Persistence of content

 * Each article on the wiki may have any number of sessions hosted by the concurrent server.
 * When a user begins editing,
 * If no one else is editing, they begin with the content of the page as MediaWiki at the latest revision, as they would today.
 * If they are joining an editing session, they begin with the most recent version of the text as stored in the session.

Garbage collection

 * At this time, we do not anticipate maintaining a presence on the server for each article on the wiki.
 * So, editing sessions which appear to be abandoned will be removed from the server.
 * A session which has no users in it is abandoned.
 * It may be necessary to mark some sessions as abandoned if the users have excessive (>24 hours) idle time.

Presence

 * For all users in the session, the displayed username matches what MediaWiki would log if that user had edited the page.
 * This may be an IP.
 * Users are marked in a distinctive way (color, icon)
 * Users' edits are marked in the text in a distinctive way (color, icon, name?)
 * User can see the presence of other users watching
 * Edits by each user are distinctive in some way to that user

Chat

 * User can see other users' messages in a chat window
 * User can enter messages to other users in a chat window

Hostable by Wikimedia

 * Concurrent editing master server can be hosted in Wikimedia cluster
 * OS: Ubuntu Linux
 * These servers can obtain and verify Wikimedia cookies
 * This allows them to show accurate metadata about the user, like Username
 * App deployment will conform to Wikimedia standards.
 * With reasonable adaptations
 * Ancillary services such as databases will conform to Wikimedia standards or practices, including documentation.

Licensing requirements

 * It will be possible to add the concurrent server (likely a fork of Etherpad) to a MediaWiki distribution under its existing license.
 * Any Open Source Institute approved license is likely to suffice.
 * The Wikimedia Foundation and any other party will be able to use the code in source and compiled form, encumbered by no other obligations other than those specified in the license for MediaWiki.