a reputation protocol for open collaboration
Go to file
William Chargin 2aeeca9a13
Implement a command-line interface (#217)
Summary:
This commit implements the `sourcecred` command-line utility, which has
three subcommands:
  - `plugin-graph` creates one plugin’s graph;
  - `combine` combines multiple on-disk graphs; and
  - `graph` creates all plugins’ graphs and combines them.

As an implementation detail, the `into.sh` script is very convenient,
avoiding needing to do any pipe management in Node (which is Not Fun).
When we build for release, we may want to factor that differently.

Test Plan:
To see it all in action, run `yarn backend`, and then try:
```
$ export SOURCECRED_GITHUB_TOKEN="your_token_here"
$ node ./bin/sourcecred.js graph sourcecred sourcecred
Using output directory: /tmp/sourcecred/sourcecred

Starting tasks
  GO   create-git
  GO   create-github
 PASS  create-github
 PASS  create-git
  GO   combine
 PASS  combine

Full results
 PASS  create-git
 PASS  create-github
 PASS  combine

Overview
Final result:  SUCCESS

$ ls /tmp/sourcecred/sourcecred/
graph-github.json  graph-git.json  graph.json

$ jq '.nodes | length' /tmp/sourcecred/sourcecred/*.json
1000
7302
8302
```
The `node sourcecred.js graph` command takes 9.8s for me.

(The salient point of the last command is that the two small graphs have
node count adding up to the node count of the big graph. Incidentally,
we are [almost][1] at a nice round number of nodes in the GitHub graph.)

[1]: https://xkcd.com/1000/

wchargin-branch: cli
2018-05-07 12:23:09 -07:00
config Implement a command-line interface (#217) 2018-05-07 12:23:09 -07:00
experiments Tweak commit_graph_dump & store sample data. (#12) 2018-02-15 22:16:37 -08:00
flow-typed/npm Move package json to root (#37) 2018-02-26 22:32:23 -08:00
scripts Target latest Node for backend applications (#213) 2018-05-04 19:22:39 -07:00
src Implement a command-line interface (#217) 2018-05-07 12:23:09 -07:00
.eslintrc.js Fix all lint errors, adding a lint CI step (#175) 2018-04-30 14:52:28 -07:00
.flowconfig Move package json to root (#37) 2018-02-26 22:32:23 -08:00
.gitignore Configure Webpack for backend applications (#84) 2018-03-18 22:43:23 -07:00
.prettierignore Only exclude top-level directories from Prettier (#154) 2018-04-26 19:47:58 -07:00
.prettierrc.json Move package json to root (#37) 2018-02-26 22:32:23 -08:00
.travis.yml Setup travis CI testing (#58) 2018-03-02 14:39:54 -08:00
LICENSE Add LICENSE 2018-02-03 17:58:49 -08:00
README.md Update the README (#124) 2018-04-09 08:49:54 +03:00
package.json Change package.json name to sourcecred (#215) 2018-05-05 00:04:42 -07:00
yarn.lock Minimal toy oclif integration (#214) 2018-05-04 19:28:37 -07:00

README.md

SourceCred

Build Status

Vision

Open source software is amazing, and so are the creators and contributors who share it. How amazing? It's difficult to tell, since we don't have good tools for recognizing those people. Many amazing open-source contributors labor in the shadows, going unappreciated for the work they do.

As the open economy develops, we need to go beyond commit streaks and follower counts. We need transparent, accurate, and fair tools for recognizing and rewarding open collaboration. SourceCred aims to do that.

SourceCred will enable projects to create and track "cred", which is a quantitative measure of how much value different contributors added to a project. We'll do this by providing a basic data structure—a cred graph—into which projects can add all kinds of information about the contributions that compose it. For example, a software project might include information about GitHub pull requests, function declarations and implementations, design documents, community support, documentation, and so forth. We'll also provide an algorithm (PageRank) which will ingest all of this information and produce a "cred attribution", which assigns a cred value to each contribution, and thus to the people who authored the contributions.

Principles

SourceCred aims to be:

  1. Transparent

    If it's to be a legitimate and accepted way of tracking credit in projects, cred attribution can't be a black-box. SourceCred will provide tools that make it easy to dive into the cred attribution, and see exactly why contributions were valued the way they were.

  2. Community-controlled

    At the end of the day, the community of collaborators in a project will know best which contributions were important and deserve the most cred. No algorithm will do that perfectly on its own. To that end, we'll empower the community to modify the cred attribution, by adding human knowledge into the cred graph.

  3. Forkable

    Disputes about cred attribution are inevitable. Maybe a project you care about has a selfish maintainer who wants all the cred for themself :(. Not to worry—all of the cred data will be stored with the project, so you are empowered to solve cred disputes by forking the project.

Roadmap

SourceCred is currently in a very early stage. We are working full-time to develop a MVP, which will have the following basic features:

  • Create: The GitHub Plugin populates a project's GitHub data into a Contribution Graph. SourceCred uses this seed data to produce an initial, approximate cred attribution.

  • Read: The SourceCred Explorer enables users to examine the cred attribution, and all of the contributions in the graph. This reveals why the algorithm behaved the way that it did.

  • Update: The Artifact Plugin allows users to put their own knowledge into the system by adding new "Artifact Nodes" to the graph. An artifact node allows users to draw attention to contributions (or groups of contributions) that are particularly valuable. They can then merge this new information into the project repository, making it canonical.

Community

Please consider joining our community.