Skip to content

Commit

Permalink
Initiatives: define internal datatype Initiative
Browse files Browse the repository at this point in the history
  • Loading branch information
Beanow committed Dec 22, 2019
1 parent 1b0eb48 commit 0038a58
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/plugins/initiatives/initiative.js
@@ -0,0 +1,30 @@
// @flow

import {type NodeAddressT} from "../../core/graph";

export type URL = string;

/**
* An intermediate representation of an Initiative.
*
* This makes the assumption a Champion cannot fail in championing.
* Instead of a success status, they should be removed if unsuccessful.
*
* There is also no timestamp for completion or each edge.
* It should be inferred from the node timestamps instead.
* We can support accurate edge timestamps by interpreting wiki histories.
* However the additional complexity and requirements put on the tracker
* don't seem worthwhile right now.
* Especially because cred can flow even before bounties are released.
* See https://discourse.sourcecred.io/t/write-the-initiatives-plugin/269/6
*/
export type Initiative = {|
+title: string,
+timestampMs: number,
+completed: boolean,
+tracker: NodeAddressT,
+dependencies: $ReadOnlyArray<URL>,
+references: $ReadOnlyArray<URL>,
+contributions: $ReadOnlyArray<URL>,
+champions: $ReadOnlyArray<URL>,
|};

0 comments on commit 0038a58

Please sign in to comment.