Extension:WikiLambda/Discovery needs

This is a sketch document of the discovery needs and use cases for the experience for users of the WikiLambda code on Wikifunctions. It is not final, and some of the potential use cases may never be directly met by first party systems and services.

Use cases
All use cases should be taken implicitly as optionally searching for a match/fuzzy-match of the user's search input for label in their selected or imputed input language or its fallbacks, or just looking for a content listing without label input.

In all(?) use cases, results would be shown prioritised by fit to the search input criterion if provided, and then by popularity.

Finding things to use / reference

 * As a function user, show me a list of Functions.
 * As a function user, show me a list of Functions, where they are labelled in at least one of my languages.
 * As a function user, show me a list of Implementations in Python 3.8 of popular Functions, and whether or not they pass their tests.
 * As a function user, show me a list of Implementations in any version of Python 3 of popular Functions, and whether or not they pass their tests.


 * As a function user, show me a list of Functions which take exactly a string.
 * As a function user, show me a list of Functions which take exactly a string or a boolean.
 * As a function user, show me a list of Functions which take exactly two strings.
 * As a function user, show me a list of Functions which take exactly a string and a boolean (in that order).
 * As a function user, show me a list of Functions which take exactly a string and a boolean (in any order).
 * As a function user, show me a list of Functions which take a string and a boolean (in any order), alongside other inputs.
 * As a function user, show me a list of Functions which take a list.
 * As a function user, show me a list of Functions which take a list of strings.
 * As a function user, show me a list of Functions which take exactly a pair of string and boolean (in either order).
 * As a function user, show me a list of Functions which take exactly a pair of string and something else.


 * As a function user, show me a list of Functions which output a string.


 * As a function user, show me a list of Functions which take a string and output an integer.

Finding things to translate

 * As a contributor who can edit in French, German, and English, show me a list of Objects which have a label in at least one of those languages but not at least one of the others, so I can fix it, prioritised by popularity.


 * As a contributor who can edit Chinese fluently and read English, show me a list of Objects which have recent changes to their description in English so I can ensure they are aligned.
 * [As above, but restricted to Functions, or Implementations, or Functions including their input/output labels, or …]

Finding things to create / extend

 * As a code contributor, show me a list of Functions which have no Implementations.
 * As a code contributor, show me a list of Functions which have at least one Implementation.
 * As a code contributor, show me a list of Functions which have at least three Implementations.
 * As a code contributor who likes writing Python, show me a list of Functions which have no Implementations in Python3.
 * As a code contributor who likes writing Python and is learning Node by comparison, show me a list of Functions which have an Implementation in both Python and Node.
 * As a code contributor who likes writing Python and Node and making the code similar between them, show me a list of Functions which have an Implementation in Python or Node but not in the other.
 * As a code re-user on an environment that only lets me use Python or Node, show me a list of Functions which have at least one Implementation in Python or Node.


 * As a code contributor, show me a list of Functions which have no Testers.
 * As a code contributor, show me a list of Functions which have at least one Tester.
 * As a code contributor, show me a list of Functions which have at least ten Testers.

Finding things to fix

 * As a code fixer, show me a list of Functions which have some Testers and at least one Implementation in Node which does not pass all its Testers.
 * As a code fixer, show me a list of Functions which have Testers and at least one Implementation which passes all its tests but has an Implementation in Python which does not.


 * As a polyglot translator-cum-coder mathematician working on matrix operations who has overly extreme demands of what search tools we can provide, show me a list of all Functions which are labelled in English but not German, take a Nx6 Matrix of Integers and a 6-Vector of Integers (in either order) labelled in Russian or Ukrainian but not Bulgarian, output a Vector of at least three integers, have at least ten testers, have a passing implementation in Node, and do not have an implementation in Python.

Data model inputs (denormalised content) and dimensions of search
Permanent Objects are MediaWiki pages

Create a bespoke reporting system inside MW's code/DB set-up

 * What:
 * We'd provide reporting via a page like Special:ListObjects or similar, and in-editor tools using the APIs.
 * Special code in WikiLambda would inject content into secondary data tables any time they updated. (This is what we've already partially started for the search look-ahead API.)
 * We'd very visibly cross-link from Special:Search as it'd be useless for Object searching (but vital for normal wikitext content page searching).
 * Pros:
 * Lots of ability to add bespoke richness without slowing down the much larger users in production.
 * Avoid poor fit matches for our use cases.
 * Not held back by another team's priorities on feature/language support from upstream.
 * Cons:
 * Duplication of effort between us and Search Platform and Elastic – for example, we'd need to invent-our-own for a lot of specialist language-related content (e.g. stemming).
 * Significant extra application server and database load compared to our expectations (but less demands on ElasticSearch infrastructure).
 * User would have a split experience between searching for Object content and policy pages / etc.; this may be irritating especially if the community has "how to" documentation in both Wikifunctions: namespace and Object descriptions.

Inject content into Wikimedia cluster's ElasticSearch system and query that

 * What:
 * Special code in WikiLambda would define custom content fields for CirrusSearch and provide content updates.
 * Users would use Special:Search for everything, with a bunch of special keywords like  (possibly hid by a bespoke extra search interface).
 * Pros:
 * Standard model for content querying, familiar to community members.
 * Much less scary infrastructure / load balancing work for the team.
 * Might be able to take advantage of current facet tool (AdvancedSearch), extending that rather than writing our own interface from scratch.
 * Cons:
 * Content updates may be slow compared to on-wiki activity.
 * Not good for categorical reporting queries ("list every Function with no Testers", "exactly how many Objects have no labels in Assyrian?" etc.).
 * Less flexible to our needs.
 * Language support may lag from what we ideally want as a team.

Build our own reporting system based on a triple store/etc. for internal querying (and perhaps external querying?)

 * What:
 * We'd build out our own triple store for our special data (similar to the Wikidata Query Service and the Wikimedia Commons Query Service).
 * We would proxy the results from the back-end into one or more reporting pages on Special:ListObjects or similar.
 * Pros:
 * Amazingly flexible, built around our needs.
 * Support for longer-running complex queries; we could stash the results of these and re-trigger the run every few hours or whatever would be needed.
 * Cons:
 * Triple stores are best for combining with other datasets; ours wouldn't match up with anything external, unlike Wikidata.
 * Asking Search Platform / SRE to support Yet Another BlazeGraph Instance may not make us popular.
 * The effort to stand up and provide on-going support to a triple store is very high.
 * Not good for categorical reporting queries ("list every Function with no Testers", "exactly how many Objects have no labels in Assyrian?" etc.), though (?) better than Elastic.
 * Updates would be slower than ElasticSearch.
 * External querying adds a lot of extra concerns (security, updates, load, …)

Questions

 * In general we'd want to provide lists "by popularity".
 * What do we mean by this?
 * How would we inform the searching system of our needs?
 * Are there circumstances where we wouldn't want this ordering? What other orderings would we want, and why?
 * What have I forgotten?