Extension:WikiLambda

From mediawiki.org
MediaWiki extensions manual
OOjs UI icon advanced-invert.svg
WikiLambda
Release status: experimental
Implementation Parser function , ContentHandler
Description Providing Wikimedia wikis with a wikitext parser function to call evaluation of functions written, managed, and evaluated on a central wiki.
Author(s) Wikimedia Foundation
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki >= 1.39.0
Database changes Yes
License MIT License
Download
  • $wgWikiLambdaOrchestratorLocation
  • $wgWikiLambdaEnable
  • $wgWikiLambdaEnableParserFunction
Translate the WikiLambda extension if it is available at translatewiki.net

Check usage and version matrix.

Issues Open tasks · Report a bug

The WikiLambda extension provides for a wiki to host functions written, managed, and evaluated by users, which will be used to power wikifunctions.org. It forms the core of the "Wikifunctions" software stack, as part of the work towards m:Abstract Wikipedia. The system is currently in active development ahead of launch, with the front-end written in Vue.js and using the new Codex interface library. Wikifunctions via WikiLambda will later provide Wikimedia wikis with a wikitext parser function to make evaluations from Wikifunctions on their local wiki.

Introduction[edit]

The current working top-level architectural model for how Wikifunctions will work

Wikifunctions will be a MediaWiki installation on which function content, but not output, is stored. This content takes the form of programmatic descriptions of each available function ("Functions"), actual user-written code for these functions ("Implementations"), test suites for these functions ("Testers"), and human-facing documentation about these functions, alongside the usual wiki community management content like village pumps, discussion areas, and policy pages.

Requests for function calls can come in directly via a Web request, or via MediaWiki (probably through a parser function like {{#wikifunction:…}}, but this is not yet decided). The function orchestrator determines the specifics of the request, checks the cache to see if the output value has been recently provided, and either returns that or proceeds to trigger an evaluation. To do that, it fetches all relevant content from the cluster, be that published function content (or mid-edit as-yet-unpublished function content being "previewed") from Wikifunctions, or structured content on which functions can operate from Wikidata and Wikimedia Commons. The complete bundle of code to execute and inputs on which to execute are then passed to the appropriate function executor, which then securely tries to execute the input and returns the output (or a failure error). The orchestrator then writes the successful result to the cache and transmits it to the consumer.

The WikiLambda extension is responsible for content management of the content on the Wikifunctions wiki (like the WikibaseRepo extension), providing editing interfaces, restricting users from or warning about certain actions, and providing a reading and test execution interface, and the integration of content requests on all Wikimedia wikis (like the WikibaseClient extension). User-written code is never executed in the context of the production environment, and thus never has access to sensitive content, but is only run in isolated, disposable instances

Getting started[edit]

Install[edit]

  • Download and place the file(s) in a directory called WikiLambda in your extensions/ folder.
  • Only when installing from Git, run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See task T173141 for potential complications.)
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'WikiLambda' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Installing the back-end services[edit]

If you wish you install the back-end services to use the WikiLambda software, you must do so and configure them. Instructions are subject to change, and so only provided within the repo.

Testing locally[edit]

(TODO)

Code stewardship[edit]

See also[edit]

Subpages