diff --git a/tests/__mocks__/results/github-comment-results.json b/tests/__mocks__/results/github-comment-results.json index ba6bd93c..baca1a0c 100644 --- a/tests/__mocks__/results/github-comment-results.json +++ b/tests/__mocks__/results/github-comment-results.json @@ -1,8 +1,11 @@ { "gentlementlegen": { "userId": 9807008, - "total": 1872.688, - "task": { "reward": 400, "multiplier": 1 }, + "total": 1873.688, + "task": { + "reward": 400, + "multiplier": 1 + }, "comments": [ { "id": 2033404518, @@ -12,11 +15,24 @@ "score": { "reward": 16.704, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "a": { "score": 1, "elementCount": 2 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "a": { + "score": 1, + "elementCount": 2 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 17, "wordValue": 0.2, "result": 2.22 }, + "words": { + "wordCount": 17, + "wordValue": 0.2, + "result": 2.22 + }, "multiplier": 1, "relevance": 0.8 } @@ -30,15 +46,31 @@ "reward": 65.152, "formatting": { "content": { - "p": { "score": 1, "elementCount": 5 }, - "ul": { "score": 1, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 3 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 5 + }, + "ul": { + "score": 1, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 3 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 10 }, "priority": 4, - "words": { "wordCount": 104, "wordValue": 0.2, "result": 10.36 }, + "words": { + "wordCount": 104, + "wordValue": 0.2, + "result": 10.36 + }, "multiplier": 1, "relevance": 0.8 } @@ -52,14 +84,27 @@ "reward": 56.096, "formatting": { "content": { - "p": { "score": 1, "elementCount": 3 }, - "code": { "score": 1, "elementCount": 3 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 3 + }, + "code": { + "score": 1, + "elementCount": 3 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 7 }, "priority": 4, - "words": { "wordCount": 106, "wordValue": 0.2, "result": 10.53 }, + "words": { + "wordCount": 106, + "wordValue": 0.2, + "result": 10.53 + }, "multiplier": 1, "relevance": 0.8 } @@ -72,11 +117,24 @@ "score": { "reward": 57.12, "formatting": { - "content": { "p": { "score": 1, "elementCount": 4 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 4 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 5 }, "priority": 4, - "words": { "wordCount": 134, "wordValue": 0.2, "result": 12.85 }, + "words": { + "wordCount": 134, + "wordValue": 0.2, + "result": 12.85 + }, "multiplier": 1, "relevance": 0.8 } @@ -88,9 +146,21 @@ "type": "ISSUE_AUTHOR", "score": { "reward": 63.584, - "formatting": { "content": { "p": { "score": 1, "elementCount": 5 } }, "result": 5 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 5 + } + }, + "result": 5 + }, "priority": 4, - "words": { "wordCount": 159, "wordValue": 0.2, "result": 14.87 }, + "words": { + "wordCount": 159, + "wordValue": 0.2, + "result": 14.87 + }, "multiplier": 1, "relevance": 0.8 } @@ -102,9 +172,21 @@ "type": "ISSUE_AUTHOR", "score": { "reward": 22.496, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 55, "wordValue": 0.2, "result": 6.03 }, + "words": { + "wordCount": 55, + "wordValue": 0.2, + "result": 6.03 + }, "multiplier": 1, "relevance": 0.8 } @@ -117,11 +199,24 @@ "score": { "reward": 34.336, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 85, "wordValue": 0.2, "result": 8.73 }, + "words": { + "wordCount": 85, + "wordValue": 0.2, + "result": 8.73 + }, "multiplier": 1, "relevance": 0.8 } @@ -134,11 +229,24 @@ "score": { "reward": 29.792, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 2 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 2 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 58, "wordValue": 0.2, "result": 6.31 }, + "words": { + "wordCount": 58, + "wordValue": 0.2, + "result": 6.31 + }, "multiplier": 1, "relevance": 0.8 } @@ -152,15 +260,31 @@ "reward": 70.208, "formatting": { "content": { - "p": { "score": 1, "elementCount": 5 }, - "ul": { "score": 1, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 3 }, - "code": { "score": 1, "elementCount": 7 } + "p": { + "score": 1, + "elementCount": 5 + }, + "ul": { + "score": 1, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 3 + }, + "code": { + "score": 1, + "elementCount": 7 + } }, "result": 16 }, "priority": 4, - "words": { "wordCount": 54, "wordValue": 0.2, "result": 5.94 }, + "words": { + "wordCount": 54, + "wordValue": 0.2, + "result": 5.94 + }, "multiplier": 1, "relevance": 0.8 } @@ -174,15 +298,31 @@ "reward": 61.8, "formatting": { "content": { - "p": { "score": 1, "elementCount": 6 }, - "ul": { "score": 1, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 3 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 6 + }, + "ul": { + "score": 1, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 3 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 11 }, "priority": 4, - "words": { "wordCount": 87, "wordValue": 0.1, "result": 4.45 }, + "words": { + "wordCount": 87, + "wordValue": 0.1, + "result": 4.45 + }, "multiplier": 1, "relevance": 1 } @@ -194,9 +334,21 @@ "type": "PULL_SPECIFICATION", "score": { "reward": 0, - "formatting": { "content": { "p": { "score": 1, "elementCount": 3 } }, "result": 3 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 3 + } + }, + "result": 3 + }, "priority": 4, - "words": { "wordCount": 19, "wordValue": 0, "result": 0 }, + "words": { + "wordCount": 19, + "wordValue": 0, + "result": 0 + }, "multiplier": 0, "relevance": 0.7 } @@ -210,11 +362,24 @@ "score": { "reward": 69.944, "formatting": { - "content": { "p": { "score": 1, "elementCount": 2 }, "code": { "score": 1, "elementCount": 4 } }, + "content": { + "p": { + "score": 1, + "elementCount": 2 + }, + "code": { + "score": 1, + "elementCount": 4 + } + }, "result": 6 }, "priority": 4, - "words": { "wordCount": 60, "wordValue": 0.2, "result": 6.49 }, + "words": { + "wordCount": 60, + "wordValue": 0.2, + "result": 6.49 + }, "multiplier": 2, "relevance": 0.7 } @@ -228,11 +393,24 @@ "score": { "reward": 23.016, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 16, "wordValue": 0.2, "result": 2.11 }, + "words": { + "wordCount": 16, + "wordValue": 0.2, + "result": 2.11 + }, "multiplier": 2, "relevance": 0.7 } @@ -246,11 +424,24 @@ "score": { "reward": 22.4, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 15, "wordValue": 0.2, "result": 2 }, + "words": { + "wordCount": 15, + "wordValue": 0.2, + "result": 2 + }, "multiplier": 2, "relevance": 0.7 } @@ -264,11 +455,24 @@ "score": { "reward": 42.56, "formatting": { - "content": { "p": { "score": 1, "elementCount": 2 }, "code": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 2 + }, + "code": { + "score": 1, + "elementCount": 1 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 40, "wordValue": 0.2, "result": 4.6 }, + "words": { + "wordCount": 40, + "wordValue": 0.2, + "result": 4.6 + }, "multiplier": 2, "relevance": 0.7 } @@ -283,14 +487,27 @@ "reward": 35.952, "formatting": { "content": { - "p": { "score": 1, "elementCount": 2 }, - "code": { "score": 1, "elementCount": 2 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 2 + }, + "code": { + "score": 1, + "elementCount": 2 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 5 }, "priority": 4, - "words": { "wordCount": 10, "wordValue": 0.2, "result": 1.42 }, + "words": { + "wordCount": 10, + "wordValue": 0.2, + "result": 1.42 + }, "multiplier": 2, "relevance": 0.7 } @@ -304,11 +521,24 @@ "score": { "reward": 44.856, "formatting": { - "content": { "p": { "score": 1, "elementCount": 3 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 3 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 4 }, "priority": 4, - "words": { "wordCount": 34, "wordValue": 0.2, "result": 4.01 }, + "words": { + "wordCount": 34, + "wordValue": 0.2, + "result": 4.01 + }, "multiplier": 2, "relevance": 0.7 } @@ -321,9 +551,21 @@ "diffHunk": "@@ -0,0 +1,212 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ let body = \"\";", "score": { "reward": 22.904, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 25, "wordValue": 0.2, "result": 3.09 }, + "words": { + "wordCount": 25, + "wordValue": 0.2, + "result": 3.09 + }, "multiplier": 2, "relevance": 0.7 } @@ -338,14 +580,27 @@ "reward": 43.12, "formatting": { "content": { - "p": { "score": 1, "elementCount": 1 }, - "code": { "score": 1, "elementCount": 1 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 3 }, "priority": 4, - "words": { "wordCount": 41, "wordValue": 0.2, "result": 4.7 }, + "words": { + "wordCount": 41, + "wordValue": 0.2, + "result": 4.7 + }, "multiplier": 2, "relevance": 0.7 } @@ -359,11 +614,24 @@ "score": { "reward": 35.84, "formatting": { - "content": { "p": { "score": 1, "elementCount": 2 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 2 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 28, "wordValue": 0.2, "result": 3.4 }, + "words": { + "wordCount": 28, + "wordValue": 0.2, + "result": 3.4 + }, "multiplier": 2, "relevance": 0.7 } @@ -377,11 +645,24 @@ "score": { "reward": 17.752, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 8, "wordValue": 0.2, "result": 1.17 }, + "words": { + "wordCount": 8, + "wordValue": 0.2, + "result": 1.17 + }, "multiplier": 2, "relevance": 0.7 } @@ -396,14 +677,27 @@ "reward": 47.6, "formatting": { "content": { - "p": { "score": 1, "elementCount": 2 }, - "code": { "score": 1, "elementCount": 1 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 2 + }, + "code": { + "score": 1, + "elementCount": 1 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 4 }, "priority": 4, - "words": { "wordCount": 39, "wordValue": 0.2, "result": 4.5 }, + "words": { + "wordCount": 39, + "wordValue": 0.2, + "result": 4.5 + }, "multiplier": 2, "relevance": 0.7 } @@ -416,9 +710,21 @@ "diffHunk": "@@ -0,0 +1,212 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ let body = \"\";", "score": { "reward": 14.84, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 12, "wordValue": 0.2, "result": 1.65 }, + "words": { + "wordCount": 12, + "wordValue": 0.2, + "result": 1.65 + }, "multiplier": 2, "relevance": 0.7 } @@ -431,9 +737,21 @@ "diffHunk": "@@ -0,0 +1,216 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ let body = \"\";\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ body += result[key].evaluationCommentHtml;\n+ }\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ function createIncentiveRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function buildIncentiveRow(commentScore: GithubCommentScore) {\n+ // Properly escape carriage returns for HTML rendering\n+ const formatting = stringify(commentScore.score?.formatting?.content).replace(/[\\n\\r]/g, \" \");\n+ return `\n+ \n+ \n+
\n+ ${commentScore.content.replace(/(.{64})..+/, \"$1…\")}\n+
\n+ \n+ \n+
\n+ \n+ ${Object.values(commentScore.score?.formatting?.content || {}).reduce((acc, curr) => {\n+ return acc.add(curr.score * curr.count);\n+ }, new Decimal(0))}\n+ \n+
${formatting}
\n+
\n+ \n+ ${commentScore.score?.relevance || \"-\"}\n+ ${commentScore.score?.reward || \"-\"}\n+ `;\n+ }\n+\n+ for (const issueComment of sorted.issues.comments) {\n+ content.push(buildIncentiveRow(issueComment));\n+ }\n+ for (const reviewComment of sorted.reviews) {\n+ content.push(buildIncentiveRow(reviewComment));\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ return `\n+
\n+ \n+ \n+

\n+ \n+ [ ${result.total} ${getPayoutConfigByNetworkId(program.opts().evmNetworkId).symbol} ]\n+ \n+

\n+
\n+ @${username}\n+
\n+
\n+
\n+
Contributions Overview
\n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ ${createContributionRows()}\n+ \n+
ViewContributionCountReward
\n+
Conversation Incentives
\n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ ${createIncentiveRows()}\n+ \n+
CommentFormattingRelevanceReward
\n+
\n+ `\n+ .replace(/\\s+/g, \" \")", "score": { "reward": 27.496, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 33, "wordValue": 0.2, "result": 3.91 }, + "words": { + "wordCount": 33, + "wordValue": 0.2, + "result": 3.91 + }, "multiplier": 2, "relevance": 0.7 } @@ -447,11 +765,24 @@ "score": { "reward": 51.632, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 68, "wordValue": 0.2, "result": 7.22 }, + "words": { + "wordCount": 68, + "wordValue": 0.2, + "result": 7.22 + }, "multiplier": 2, "relevance": 0.7 } @@ -465,11 +796,24 @@ "score": { "reward": 28.504, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 25, "wordValue": 0.2, "result": 3.09 }, + "words": { + "wordCount": 25, + "wordValue": 0.2, + "result": 3.09 + }, "multiplier": 2, "relevance": 0.7 } @@ -482,9 +826,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))", "score": { "reward": 22.288, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 24, "wordValue": 0.2, "result": 2.98 }, + "words": { + "wordCount": 24, + "wordValue": 0.2, + "result": 2.98 + }, "multiplier": 2, "relevance": 0.7 } @@ -498,11 +854,24 @@ "score": { "reward": 24.752, "formatting": { - "content": { "p": { "score": 1, "elementCount": 2 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 2 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 10, "wordValue": 0.2, "result": 1.42 }, + "words": { + "wordCount": 10, + "wordValue": 0.2, + "result": 1.42 + }, "multiplier": 2, "relevance": 0.7 } @@ -517,15 +886,31 @@ "reward": 71.12, "formatting": { "content": { - "p": { "score": 1, "elementCount": 5 }, - "ul": { "score": 1, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 2 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 5 + }, + "ul": { + "score": 1, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 2 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 9 }, "priority": 4, - "words": { "wordCount": 31, "wordValue": 0.2, "result": 3.7 }, + "words": { + "wordCount": 31, + "wordValue": 0.2, + "result": 3.7 + }, "multiplier": 2, "relevance": 0.7 } @@ -539,11 +924,24 @@ "score": { "reward": 31.36, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 30, "wordValue": 0.2, "result": 3.6 }, + "words": { + "wordCount": 30, + "wordValue": 0.2, + "result": 3.6 + }, "multiplier": 2, "relevance": 0.7 } @@ -557,11 +955,24 @@ "score": { "reward": 122.92, "formatting": { - "content": { "p": { "score": 1, "elementCount": 8 }, "code": { "score": 1, "elementCount": 7 } }, + "content": { + "p": { + "score": 1, + "elementCount": 8 + }, + "code": { + "score": 1, + "elementCount": 7 + } + }, "result": 15 }, "priority": 4, - "words": { "wordCount": 65, "wordValue": 0.2, "result": 6.95 }, + "words": { + "wordCount": 65, + "wordValue": 0.2, + "result": 6.95 + }, "multiplier": 2, "relevance": 0.7 } @@ -574,9 +985,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))", "score": { "reward": 35.672, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 48, "wordValue": 0.2, "result": 5.37 }, + "words": { + "wordCount": 48, + "wordValue": 0.2, + "result": 5.37 + }, "multiplier": 2, "relevance": 0.7 } @@ -591,14 +1014,27 @@ "reward": 91.168, "formatting": { "content": { - "p": { "score": 1, "elementCount": 5 }, - "code": { "score": 1, "elementCount": 5 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 5 + }, + "code": { + "score": 1, + "elementCount": 5 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 11 }, "priority": 4, - "words": { "wordCount": 47, "wordValue": 0.2, "result": 5.28 }, + "words": { + "wordCount": 47, + "wordValue": 0.2, + "result": 5.28 + }, "multiplier": 2, "relevance": 0.7 } @@ -611,11 +1047,24 @@ "score": { "reward": 22.68, "formatting": { - "content": { "p": { "score": 1, "elementCount": 2 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 2 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 7, "wordValue": 0.2, "result": 1.05 }, + "words": { + "wordCount": 7, + "wordValue": 0.2, + "result": 1.05 + }, "multiplier": 2, "relevance": 0.7 } @@ -627,45 +1076,236 @@ "type": "PULL_AUTHOR", "score": { "reward": 24.024, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 27, "wordValue": 0.2, "result": 3.29 }, + "words": { + "wordCount": 27, + "wordValue": 0.2, + "result": 3.29 + }, "multiplier": 2, "relevance": 0.7 } } ], "reviewReward": { - "reviewBaseReward": { "reward": 0 }, + "reviewBaseReward": { + "reward": 0 + }, "reviews": [ - { "reviewId": 2007888517, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2007889613, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2007892341, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2008110387, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2008112006, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013179924, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013180169, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013180522, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013386612, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013386753, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013387960, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013389883, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013743347, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2014542130, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2014668126, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2014705833, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2014778123, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2016265929, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2016291507, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2017767160, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2019198962, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 } + { + "reviewId": 2007888517, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2007889613, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2007892341, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2008110387, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2008112006, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013179924, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013180169, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013180522, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013386612, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013386753, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013387960, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013389883, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013743347, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2014542130, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2014668126, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2014705833, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2014778123, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2016265929, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2016291507, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2017767160, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2019198962, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2020326790, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + } ] }, - "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIxODcyNjg4MDAwMDAwMDAwMDAwMDAwIn0sIm5vbmNlIjoiODMwNzY0Mzc0NDY0OTk1ODkzMDQ2MTExMjg5NjM5MTY3MTAxMDY4ODYxMDI0MzYwMjM4ODE1MjAwNTgzNDY4MDA1Nzg3NTQ0MDE3NTUiLCJkZWFkbGluZSI6IjExNTc5MjA4OTIzNzMxNjE5NTQyMzU3MDk4NTAwODY4NzkwNzg1MzI2OTk4NDY2NTY0MDU2NDAzOTQ1NzU4NDAwNzkxMzEyOTYzOTkzNSJ9LCJ0cmFuc2ZlckRldGFpbHMiOnsidG8iOiIweDREMDcwNGY0MDBENTdCYTkzZUVhODg3NjVDM0ZjREJEODI2ZENGYzQiLCJyZXF1ZXN0ZWRBbW91bnQiOiIxODcyNjg4MDAwMDAwMDAwMDAwMDAwIn0sIm93bmVyIjoiMHhkOTUzMEYzZmJCRWExMWJlRDAxREMwOUU3OTMxOGYyZjIwMjIzNzE2Iiwic2lnbmF0dXJlIjoiMHgzNTYxOTEzMmJhNGQwYzc2ZDkzZWJjZjE5M2JmNjkyYmU5ODdhNTVlZmI2YWM5ODA0ZDE4NDhiODJiZmMzM2FkNmM1YjkyMzU0YjRlODI5ZjgzODk5MTgwNjk2MzVhYTZhYWRmYTJiZGUwN2NkYzNhMTU3ZWUwYTRmY2RmNTcwNTFjIiwibmV0d29ya0lkIjoxMDB9XQ==", - "evaluationCommentHtml": "

 [ 1872.688 WXDAI ] 

@gentlementlegen
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
IssueTask1400
ReviewCode Review2121
IssueSpecification161.8
IssueComment9415.488
ReviewComment25974.4
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
In the v1 of the Ubiquibot, when a result gets evaluated, a reca…
15.45
content:
  content:
    p:
      score: 1
      elementCount: 6
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 87
  wordValue: 0.1
  result: 4.45
1461.8
This needs https://github.com/ubiquity-os/conversation-rewards/p…
5.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 17
  wordValue: 0.2
  result: 2.22
0.8416.704
To me 1 is the most straightforward to do for few reasons:- th…
20.36
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 10
regex:
  wordCount: 104
  wordValue: 0.2
  result: 10.36
0.8465.152
I think each plugin should output JSON not html as it is not rel…
17.53
content:
  content:
    p:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 7
regex:
  wordCount: 106
  wordValue: 0.2
  result: 10.53
0.8456.096
If you want to manipulate and convey data, HTML really is not ma…
17.85
content:
  content:
    p:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 134
  wordValue: 0.2
  result: 12.85
0.8457.12
But then how do we consider the formatting of that output?Prac…
19.87
content:
  content:
    p:
      score: 1
      elementCount: 5
  result: 5
regex:
  wordCount: 159
  wordValue: 0.2
  result: 14.87
0.8463.584
This can work, but we skyrocket coupling and to me defeat purpos…
7.03
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 55
  wordValue: 0.2
  result: 6.03
0.8422.496
@pavlovcik To mitigate that that's why inside the comment reward…
10.73
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 85
  wordValue: 0.2
  result: 8.73
0.8434.336
I realized that to carry this task properly we need to handle fl…
9.31
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 58
  wordValue: 0.2
  result: 6.31
0.8429.792
Agreed, I think currently there are 3 possible things to annotat…
21.94
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 7
  result: 16
regex:
  wordCount: 54
  wordValue: 0.2
  result: 5.94
0.8470.208
Resolves #5 Depends on #8 Reviews looks gigantic but it's on…
3
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 19
  wordValue: 0
  result: 0
0.740
I think in this case it makes sense because this function will r…
12.49
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 4
  result: 6
regex:
  wordCount: 60
  wordValue: 0.2
  result: 6.49
0.7469.944
It is supposed to represent a comment. Would you prefer a descri…
4.11
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 16
  wordValue: 0.2
  result: 2.11
0.7423.016
True, just picked this up from the previous codebase. https://rp…
4
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 15
  wordValue: 0.2
  result: 2
0.7422.4
Seems convoluted to me and I don't know what problem that solved…
7.6
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 40
  wordValue: 0.2
  result: 4.6
0.7442.56
Changed `COMMENT` to `COMMENTED`, added jsdoc de…
6.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7435.952
Simply makes the docs linking the code within the comment, for c…
8.01
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 34
  wordValue: 0.2
  result: 4.01
0.7444.856
In the case of a string it would coerce the value and you would …
4.09
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7422.904
`observe` would help to chose what we want to include an…
7.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 41
  wordValue: 0.2
  result: 4.7
0.7443.12
Not very useful indeed. I am working on the tests on a separate …
6.4
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 28
  wordValue: 0.2
  result: 3.4
0.7435.84
See https://github.com/ubiquity-os/conversation-rewards/pull/14 …
3.17
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 8
  wordValue: 0.2
  result: 1.17
0.7417.752
Good point, also symbol should not be DAI but ETH isn't it? …
8.5
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 39
  wordValue: 0.2
  result: 4.5
0.7447.6
Had changed it everywhere else but here, now it should be fine
2.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 12
  wordValue: 0.2
  result: 1.65
0.7414.84
This matches any whitespace character (spaces, tabs, line breaks…
4.91
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 33
  wordValue: 0.2
  result: 3.91
0.7427.496
By definition `dump` was just outputting results to stdo…
9.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 68
  wordValue: 0.2
  result: 7.22
0.7451.632
Un-nested them one level. I think that the `buildXrow` s…
5.09
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7428.504
I assumed BigInt only handles integers, and we manipulate a lot …
3.98
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.2
  result: 2.98
0.7422.288
There is one permit generated per participating user, last run:…
4.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7424.752
I made it according to the previous version:- Issue Specificat…
12.7
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 31
  wordValue: 0.2
  result: 3.7
0.7471.12
Wouldn't that lead to precision loss in JS and after the divisio…
5.6
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 30
  wordValue: 0.2
  result: 3.6
0.7431.36
That is correct. I understand now why you're confused:The valu…
21.95
content:
  content:
    p:
      score: 1
      elementCount: 8
    code:
      score: 1
      elementCount: 7
  result: 15
regex:
  wordCount: 65
  wordValue: 0.2
  result: 6.95
0.74122.92
I don't think is it relevant in this scenario because we are not…
6.37
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 48
  wordValue: 0.2
  result: 5.37
0.7435.672
@whilefoo you are correct, these were wrongly used. I corrected …
16.28
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 5
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 47
  wordValue: 0.2
  result: 5.28
0.7491.168
Example of successful comment posting with results:https://git…
4.05
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 7
  wordValue: 0.2
  result: 1.05
0.7422.68
@0x4007 I believe that if I had all the tests in this PR it will…
4.29
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 27
  wordValue: 0.2
  result: 3.29
0.7424.024
" + "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIxODczNjg4MDAwMDAwMDAwMDAwMDAwIn0sIm5vbmNlIjoiODMwNzY0Mzc0NDY0OTk1ODkzMDQ2MTExMjg5NjM5MTY3MTAxMDY4ODYxMDI0MzYwMjM4ODE1MjAwNTgzNDY4MDA1Nzg3NTQ0MDE3NTUiLCJkZWFkbGluZSI6IjExNTc5MjA4OTIzNzMxNjE5NTQyMzU3MDk4NTAwODY4NzkwNzg1MzI2OTk4NDY2NTY0MDU2NDAzOTQ1NzU4NDAwNzkxMzEyOTYzOTkzNSJ9LCJ0cmFuc2ZlckRldGFpbHMiOnsidG8iOiIweDREMDcwNGY0MDBENTdCYTkzZUVhODg3NjVDM0ZjREJEODI2ZENGYzQiLCJyZXF1ZXN0ZWRBbW91bnQiOiIxODczNjg4MDAwMDAwMDAwMDAwMDAwIn0sIm93bmVyIjoiMHhkOTUzMEYzZmJCRWExMWJlRDAxREMwOUU3OTMxOGYyZjIwMjIzNzE2Iiwic2lnbmF0dXJlIjoiMHg3YjcwY2Q0ZTMwNmNkOGZjMjdmM2Q2ODUxZDliZmYyNjg4MjUxMWE1YTdmNDQ2NDc1OTZkMzA5ODBmMTUxYmZhNmRhYjVkYjc3YTJkZjcyNzI0ZjZjNTg5ZTY3MzQ5NjE4OTRjODYzMDdjMGU0ODk4ZWI3MjY3MWIwYzAwNWM2NDFiIiwibmV0d29ya0lkIjoxMDB9XQ==", + "evaluationCommentHtml": "

 [ 1873.688 WXDAI ] 

@gentlementlegen
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
IssueTask1400
ReviewCode Review2222
IssueSpecification161.8
IssueComment9415.488
ReviewComment25974.4
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
In the v1 of the Ubiquibot, when a result gets evaluated, a reca…
15.45
content:
  content:
    p:
      score: 1
      elementCount: 6
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 87
  wordValue: 0.1
  result: 4.45
1461.8
This needs https://github.com/ubiquity-os/conversation-rewards/p…
5.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 17
  wordValue: 0.2
  result: 2.22
0.8416.704
To me 1 is the most straightforward to do for few reasons:- th…
20.36
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 10
regex:
  wordCount: 104
  wordValue: 0.2
  result: 10.36
0.8465.152
I think each plugin should output JSON not html as it is not rel…
17.53
content:
  content:
    p:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 7
regex:
  wordCount: 106
  wordValue: 0.2
  result: 10.53
0.8456.096
If you want to manipulate and convey data, HTML really is not ma…
17.85
content:
  content:
    p:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 134
  wordValue: 0.2
  result: 12.85
0.8457.12
But then how do we consider the formatting of that output?Prac…
19.87
content:
  content:
    p:
      score: 1
      elementCount: 5
  result: 5
regex:
  wordCount: 159
  wordValue: 0.2
  result: 14.87
0.8463.584
This can work, but we skyrocket coupling and to me defeat purpos…
7.03
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 55
  wordValue: 0.2
  result: 6.03
0.8422.496
@pavlovcik To mitigate that that's why inside the comment reward…
10.73
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 85
  wordValue: 0.2
  result: 8.73
0.8434.336
I realized that to carry this task properly we need to handle fl…
9.31
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 58
  wordValue: 0.2
  result: 6.31
0.8429.792
Agreed, I think currently there are 3 possible things to annotat…
21.94
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 7
  result: 16
regex:
  wordCount: 54
  wordValue: 0.2
  result: 5.94
0.8470.208
Resolves #5 Depends on #8 Reviews looks gigantic but it's on…
3
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 19
  wordValue: 0
  result: 0
0.740
I think in this case it makes sense because this function will r…
12.49
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 4
  result: 6
regex:
  wordCount: 60
  wordValue: 0.2
  result: 6.49
0.7469.944
It is supposed to represent a comment. Would you prefer a descri…
4.11
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 16
  wordValue: 0.2
  result: 2.11
0.7423.016
True, just picked this up from the previous codebase. https://rp…
4
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 15
  wordValue: 0.2
  result: 2
0.7422.4
Seems convoluted to me and I don't know what problem that solved…
7.6
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 40
  wordValue: 0.2
  result: 4.6
0.7442.56
Changed `COMMENT` to `COMMENTED`, added jsdoc de…
6.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7435.952
Simply makes the docs linking the code within the comment, for c…
8.01
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 34
  wordValue: 0.2
  result: 4.01
0.7444.856
In the case of a string it would coerce the value and you would …
4.09
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7422.904
`observe` would help to chose what we want to include an…
7.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 41
  wordValue: 0.2
  result: 4.7
0.7443.12
Not very useful indeed. I am working on the tests on a separate …
6.4
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 28
  wordValue: 0.2
  result: 3.4
0.7435.84
See https://github.com/ubiquity-os/conversation-rewards/pull/14 …
3.17
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 8
  wordValue: 0.2
  result: 1.17
0.7417.752
Good point, also symbol should not be DAI but ETH isn't it? …
8.5
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 39
  wordValue: 0.2
  result: 4.5
0.7447.6
Had changed it everywhere else but here, now it should be fine
2.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 12
  wordValue: 0.2
  result: 1.65
0.7414.84
This matches any whitespace character (spaces, tabs, line breaks…
4.91
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 33
  wordValue: 0.2
  result: 3.91
0.7427.496
By definition `dump` was just outputting results to stdo…
9.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 68
  wordValue: 0.2
  result: 7.22
0.7451.632
Un-nested them one level. I think that the `buildXrow` s…
5.09
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7428.504
I assumed BigInt only handles integers, and we manipulate a lot …
3.98
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.2
  result: 2.98
0.7422.288
There is one permit generated per participating user, last run:…
4.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7424.752
I made it according to the previous version:- Issue Specificat…
12.7
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 31
  wordValue: 0.2
  result: 3.7
0.7471.12
Wouldn't that lead to precision loss in JS and after the divisio…
5.6
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 30
  wordValue: 0.2
  result: 3.6
0.7431.36
That is correct. I understand now why you're confused:The valu…
21.95
content:
  content:
    p:
      score: 1
      elementCount: 8
    code:
      score: 1
      elementCount: 7
  result: 15
regex:
  wordCount: 65
  wordValue: 0.2
  result: 6.95
0.74122.92
I don't think is it relevant in this scenario because we are not…
6.37
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 48
  wordValue: 0.2
  result: 5.37
0.7435.672
@whilefoo you are correct, these were wrongly used. I corrected …
16.28
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 5
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 47
  wordValue: 0.2
  result: 5.28
0.7491.168
Example of successful comment posting with results:https://git…
4.05
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 7
  wordValue: 0.2
  result: 1.05
0.7422.68
@0x4007 I believe that if I had all the tests in this PR it will…
4.29
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 27
  wordValue: 0.2
  result: 3.29
0.7424.024
" }, "0x4007": { - "total": 543.356, + "total": 544.356, "userId": 4975670, "comments": [ { @@ -677,14 +1317,27 @@ "reward": 14.848, "formatting": { "content": { - "p": { "score": 1, "elementCount": 1 }, - "pre": { "score": 0, "elementCount": 1 }, - "code": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 1 + }, + "pre": { + "score": 0, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } }, "result": 2 }, "priority": 4, - "words": { "wordCount": 47, "wordValue": 0.1, "result": 2.64 }, + "words": { + "wordCount": 47, + "wordValue": 0.1, + "result": 2.64 + }, "multiplier": 1, "relevance": 0.8 } @@ -696,9 +1349,21 @@ "type": "ISSUE_COLLABORATOR", "score": { "reward": 6.752, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 17, "wordValue": 0.1, "result": 1.11 }, + "words": { + "wordCount": 17, + "wordValue": 0.1, + "result": 1.11 + }, "multiplier": 1, "relevance": 0.8 } @@ -712,15 +1377,31 @@ "reward": 77.472, "formatting": { "content": { - "p": { "score": 1, "elementCount": 7 }, - "ul": { "score": 1, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 2 }, - "code": { "score": 1, "elementCount": 2 } + "p": { + "score": 1, + "elementCount": 7 + }, + "ul": { + "score": 1, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 2 + }, + "code": { + "score": 1, + "elementCount": 2 + } }, "result": 12 }, "priority": 4, - "words": { "wordCount": 285, "wordValue": 0.1, "result": 12.21 }, + "words": { + "wordCount": 285, + "wordValue": 0.1, + "result": 12.21 + }, "multiplier": 1, "relevance": 0.8 } @@ -734,14 +1415,27 @@ "reward": 52.576, "formatting": { "content": { - "p": { "score": 1, "elementCount": 4 }, - "code": { "score": 1, "elementCount": 4 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 4 + }, + "code": { + "score": 1, + "elementCount": 4 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 9 }, "priority": 4, - "words": { "wordCount": 159, "wordValue": 0.1, "result": 7.43 }, + "words": { + "wordCount": 159, + "wordValue": 0.1, + "result": 7.43 + }, "multiplier": 1, "relevance": 0.8 } @@ -755,14 +1449,27 @@ "reward": 42.304, "formatting": { "content": { - "p": { "score": 1, "elementCount": 2 }, - "code": { "score": 1, "elementCount": 5 }, - "pre": { "score": 0, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 2 + }, + "code": { + "score": 1, + "elementCount": 5 + }, + "pre": { + "score": 0, + "elementCount": 1 + } }, "result": 7 }, "priority": 4, - "words": { "wordCount": 129, "wordValue": 0.1, "result": 6.22 }, + "words": { + "wordCount": 129, + "wordValue": 0.1, + "result": 6.22 + }, "multiplier": 1, "relevance": 0.8 } @@ -776,16 +1483,35 @@ "reward": 65.824, "formatting": { "content": { - "p": { "score": 1, "elementCount": 6 }, - "code": { "score": 1, "elementCount": 3 }, - "h3": { "score": 1, "elementCount": 1 }, - "pre": { "score": 0, "elementCount": 1 }, - "a": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 6 + }, + "code": { + "score": 1, + "elementCount": 3 + }, + "h3": { + "score": 1, + "elementCount": 1 + }, + "pre": { + "score": 0, + "elementCount": 1 + }, + "a": { + "score": 1, + "elementCount": 1 + } }, "result": 11 }, "priority": 4, - "words": { "wordCount": 214, "wordValue": 0.1, "result": 9.57 }, + "words": { + "wordCount": 214, + "wordValue": 0.1, + "result": 9.57 + }, "multiplier": 1, "relevance": 0.8 } @@ -799,15 +1525,31 @@ "reward": 41.376, "formatting": { "content": { - "p": { "score": 1, "elementCount": 5 }, - "code": { "score": 1, "elementCount": 1 }, - "ol": { "score": 0, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 2 } + "p": { + "score": 1, + "elementCount": 5 + }, + "code": { + "score": 1, + "elementCount": 1 + }, + "ol": { + "score": 0, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 2 + } }, "result": 8 }, "priority": 4, - "words": { "wordCount": 98, "wordValue": 0.1, "result": 4.93 }, + "words": { + "wordCount": 98, + "wordValue": 0.1, + "result": 4.93 + }, "multiplier": 1, "relevance": 0.8 } @@ -821,14 +1563,27 @@ "reward": 31.616, "formatting": { "content": { - "p": { "score": 1, "elementCount": 1 }, - "ol": { "score": 0, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 4 } + "p": { + "score": 1, + "elementCount": 1 + }, + "ol": { + "score": 0, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 4 + } }, "result": 5 }, "priority": 4, - "words": { "wordCount": 97, "wordValue": 0.1, "result": 4.88 }, + "words": { + "wordCount": 97, + "wordValue": 0.1, + "result": 4.88 + }, "multiplier": 1, "relevance": 0.8 } @@ -840,9 +1595,21 @@ "type": "ISSUE_COLLABORATOR", "score": { "reward": 8.8, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 29, "wordValue": 0.1, "result": 1.75 }, + "words": { + "wordCount": 29, + "wordValue": 0.1, + "result": 1.75 + }, "multiplier": 1, "relevance": 0.8 } @@ -854,9 +1621,21 @@ "type": "PULL_COLLABORATOR", "score": { "reward": 3.892, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 5, "wordValue": 0.1, "result": 0.39 }, + "words": { + "wordCount": 5, + "wordValue": 0.1, + "result": 0.39 + }, "multiplier": 1, "relevance": 0.7 } @@ -869,9 +1648,21 @@ "diffHunk": "@@ -27,29 +27,39 @@ formattingEvaluator:\n td: 1\n hr: 0\n multipliers:\n- - type: [ISSUE, ISSUER]:\n+ - type: [ISSUE, ISSUER, TASK]:\n+ formattingMultiplier: 1\n+ wordValue: 0.1\n+ - type: [ISSUE, ISSUER, COMMENT]:\n formattingMultiplier: 1\n wordValue: 0.2\n- - type: [ISSUE, ASSIGNEE]:\n+ - type: [ISSUE, ASSIGNEE, COMMENT]:", "score": { "reward": 4.256, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 7, "wordValue": 0.1, "result": 0.52 }, + "words": { + "wordCount": 7, + "wordValue": 0.1, + "result": 0.52 + }, "multiplier": 1, "relevance": 0.7 } @@ -884,9 +1675,21 @@ "diffHunk": "@@ -0,0 +1,212 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ let body = \"\";", "score": { "reward": 10.444, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 49, "wordValue": 0.1, "result": 2.73 }, + "words": { + "wordCount": 49, + "wordValue": 0.1, + "result": 2.73 + }, "multiplier": 1, "relevance": 0.7 } @@ -899,9 +1702,21 @@ "diffHunk": "@@ -0,0 +1,22 @@\n+// available tokens for payouts\n+export const PAYMENT_TOKEN_PER_NETWORK: Record = {\n+ \"1\": {\n+ rpc: \"https://rpc-bot.ubq.fi/v1/mainnet\",", "score": { "reward": 4.088, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 6, "wordValue": 0.1, "result": 0.46 }, + "words": { + "wordCount": 6, + "wordValue": 0.1, + "result": 0.46 + }, "multiplier": 1, "relevance": 0.7 } @@ -915,11 +1730,24 @@ "score": { "reward": 13.16, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 2 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 2 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 28, "wordValue": 0.1, "result": 1.7 }, + "words": { + "wordCount": 28, + "wordValue": 0.1, + "result": 1.7 + }, "multiplier": 1, "relevance": 0.7 } @@ -933,11 +1761,24 @@ "score": { "reward": 8.232, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } + }, "result": 2 }, "priority": 4, - "words": { "wordCount": 14, "wordValue": 0.1, "result": 0.94 }, + "words": { + "wordCount": 14, + "wordValue": 0.1, + "result": 0.94 + }, "multiplier": 1, "relevance": 0.7 } @@ -952,14 +1793,27 @@ "reward": 9.772, "formatting": { "content": { - "p": { "score": 1, "elementCount": 1 }, - "pre": { "score": 0, "elementCount": 1 }, - "code": { "score": 1, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 1 + }, + "pre": { + "score": 0, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + } }, "result": 2 }, "priority": 4, - "words": { "wordCount": 24, "wordValue": 0.1, "result": 1.49 }, + "words": { + "wordCount": 24, + "wordValue": 0.1, + "result": 1.49 + }, "multiplier": 1, "relevance": 0.7 } @@ -972,9 +1826,21 @@ "diffHunk": "@@ -19,12 +19,42 @@ import {\n } from \"./start\";\n \n export enum CommentType {\n+ /**\n+ * Review related item\n+ */\n REVIEW = 0b1,\n+ /**\n+ * Issue related item\n+ */\n ISSUE = 0b10,\n+ /**\n+ * User assigned to the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ASSIGNEE = 0b100,\n+ /**\n+ * The author of the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ISSUER = 0b1000,\n+ /**\n+ * A user that is part of the organization or owner of the repo\n+ */\n COLLABORATOR = 0b10000,\n+ /**\n+ * A user that is NOT part of the organization nor owner of the repo\n+ */\n CONTRIBUTOR = 0b100000,\n+ /**\n+ * A user comment action on a {@link CommentType.ISSUE} or {@link CommentType.REVIEW}", "score": { "reward": 3.892, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 5, "wordValue": 0.1, "result": 0.39 }, + "words": { + "wordCount": 5, + "wordValue": 0.1, + "result": 0.39 + }, "multiplier": 1, "relevance": 0.7 } @@ -987,9 +1853,21 @@ "diffHunk": "@@ -73,12 +103,17 @@ export class IssueActivity {\n self: GitHubPullRequest | GitHubIssue | null\n ) {\n let ret = 0;\n- ret |= \"pull_request_review_id\" in comment ? CommentType.REVIEW : CommentType.ISSUE;\n+ ret |= \"pull_request_review_id\" in comment || \"draft\" in comment ? CommentType.REVIEW : CommentType.ISSUE;", "score": { "reward": 4.452, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 8, "wordValue": 0.1, "result": 0.59 }, + "words": { + "wordCount": 8, + "wordValue": 0.1, + "result": 0.59 + }, "multiplier": 1, "relevance": 0.7 } @@ -1004,14 +1882,27 @@ "reward": 20.944, "formatting": { "content": { - "p": { "score": 1, "elementCount": 1 }, - "code": { "score": 1, "elementCount": 3 }, - "pre": { "score": 0, "elementCount": 1 } + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 3 + }, + "pre": { + "score": 0, + "elementCount": 1 + } }, "result": 4 }, "priority": 4, - "words": { "wordCount": 65, "wordValue": 0.1, "result": 3.48 }, + "words": { + "wordCount": 65, + "wordValue": 0.1, + "result": 3.48 + }, "multiplier": 1, "relevance": 0.7 } @@ -1024,9 +1915,21 @@ "diffHunk": "@@ -27,29 +27,39 @@ formattingEvaluator:\n td: 1\n hr: 0\n multipliers:\n- - type: [ISSUE, ISSUER]:\n+ - type: [ISSUE, ISSUER, TASK]:\n+ formattingMultiplier: 1\n+ wordValue: 0.1\n+ - type: [ISSUE, ISSUER, COMMENTED]:\n formattingMultiplier: 1\n wordValue: 0.2\n- - type: [ISSUE, ASSIGNEE]:\n+ - type: [ISSUE, ASSIGNEE, COMMENTED]:\n formattingMultiplier: 0\n wordValue: 0\n- - type: [ISSUE, COLLABORATOR]:\n+ - type: [ISSUE, COLLABORATOR, COMMENTED]:", "score": { "reward": 6.832, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 23, "wordValue": 0.1, "result": 1.44 }, + "words": { + "wordCount": 23, + "wordValue": 0.1, + "result": 1.44 + }, "multiplier": 1, "relevance": 0.7 } @@ -1039,9 +1942,21 @@ "diffHunk": "@@ -0,0 +1,212 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ let body = \"\";", "score": { "reward": 3.892, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 5, "wordValue": 0.1, "result": 0.39 }, + "words": { + "wordCount": 5, + "wordValue": 0.1, + "result": 0.39 + }, "multiplier": 1, "relevance": 0.7 } @@ -1055,11 +1970,24 @@ "score": { "reward": 11.816, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 2 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 2 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 19, "wordValue": 0.1, "result": 1.22 }, + "words": { + "wordCount": 19, + "wordValue": 0.1, + "result": 1.22 + }, "multiplier": 1, "relevance": 0.7 } @@ -1072,9 +2000,21 @@ "diffHunk": "@@ -0,0 +1,22 @@\n+// available tokens for payouts\n+export const PAYMENT_TOKEN_PER_NETWORK: Record = {\n+ \"1\": {\n+ rpc: \"https://rpc.gnosischain.com\",\n+ token: \"0x6B175474E89094C44Da98b954EedeAC495271d0F\",\n+ symbol: \"DAI\",\n+ },", "score": { "reward": 7.112, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 25, "wordValue": 0.1, "result": 1.54 }, + "words": { + "wordCount": 25, + "wordValue": 0.1, + "result": 1.54 + }, "multiplier": 1, "relevance": 0.7 } @@ -1087,9 +2027,21 @@ "diffHunk": "", "score": { "reward": 4.256, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 7, "wordValue": 0.1, "result": 0.52 }, + "words": { + "wordCount": 7, + "wordValue": 0.1, + "result": 0.52 + }, "multiplier": 1, "relevance": 0.7 } @@ -1102,9 +2054,21 @@ "diffHunk": "", "score": { "reward": 3.304, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 2, "wordValue": 0.1, "result": 0.18 }, + "words": { + "wordCount": 2, + "wordValue": 0.1, + "result": 0.18 + }, "multiplier": 1, "relevance": 0.7 } @@ -1117,9 +2081,21 @@ "diffHunk": "@@ -0,0 +1,22 @@\n+// available tokens for payouts\n+export const PAYMENT_TOKEN_PER_NETWORK: Record = {\n+ \"1\": {\n+ rpc: \"https://rpc.gnosischain.com\",\n+ token: \"0x6B175474E89094C44Da98b954EedeAC495271d0F\",\n+ symbol: \"DAI\",\n+ },", "score": { "reward": 4.452, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 8, "wordValue": 0.1, "result": 0.59 }, + "words": { + "wordCount": 8, + "wordValue": 0.1, + "result": 0.59 + }, "multiplier": 1, "relevance": 0.7 } @@ -1132,9 +2108,21 @@ "diffHunk": "@@ -0,0 +1,216 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ let body = \"\";\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ body += result[key].evaluationCommentHtml;\n+ }\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ function createIncentiveRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function buildIncentiveRow(commentScore: GithubCommentScore) {\n+ // Properly escape carriage returns for HTML rendering\n+ const formatting = stringify(commentScore.score?.formatting?.content).replace(/[\\n\\r]/g, \" \");\n+ return `\n+ \n+ \n+
\n+ ${commentScore.content.replace(/(.{64})..+/, \"$1…\")}\n+
\n+ \n+ \n+
\n+ \n+ ${Object.values(commentScore.score?.formatting?.content || {}).reduce((acc, curr) => {\n+ return acc.add(curr.score * curr.count);\n+ }, new Decimal(0))}\n+ \n+
${formatting}
\n+
\n+ \n+ ${commentScore.score?.relevance || \"-\"}\n+ ${commentScore.score?.reward || \"-\"}\n+ `;\n+ }\n+\n+ for (const issueComment of sorted.issues.comments) {\n+ content.push(buildIncentiveRow(issueComment));\n+ }\n+ for (const reviewComment of sorted.reviews) {\n+ content.push(buildIncentiveRow(reviewComment));\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ return `\n+
\n+ \n+ \n+

\n+ \n+ [ ${result.total} ${getPayoutConfigByNetworkId(program.opts().evmNetworkId).symbol} ]\n+ \n+

\n+
\n+ @${username}\n+
\n+
\n+
\n+
Contributions Overview
\n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ ${createContributionRows()}\n+ \n+
ViewContributionCountReward
\n+
Conversation Incentives
\n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ ${createIncentiveRows()}\n+ \n+
CommentFormattingRelevanceReward
\n+
\n+ `\n+ .replace(/\\s+/g, \" \")", "score": { "reward": 3.304, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 2, "wordValue": 0.1, "result": 0.18 }, + "words": { + "wordCount": 2, + "wordValue": 0.1, + "result": 0.18 + }, "multiplier": 1, "relevance": 0.7 } @@ -1148,11 +2136,24 @@ "score": { "reward": 13.44, "formatting": { - "content": { "p": { "score": 1, "elementCount": 1 }, "code": { "score": 1, "elementCount": 2 } }, + "content": { + "p": { + "score": 1, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 2 + } + }, "result": 3 }, "priority": 4, - "words": { "wordCount": 30, "wordValue": 0.1, "result": 1.8 }, + "words": { + "wordCount": 30, + "wordValue": 0.1, + "result": 1.8 + }, "multiplier": 1, "relevance": 0.7 } @@ -1165,9 +2166,21 @@ "diffHunk": "@@ -19,12 +19,42 @@ import {\n } from \"./start\";\n \n export enum CommentType {\n+ /**\n+ * Review related item\n+ */\n REVIEW = 0b1,\n+ /**\n+ * Issue related item\n+ */\n ISSUE = 0b10,\n+ /**\n+ * User assigned to the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ASSIGNEE = 0b100,\n+ /**\n+ * The author of the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ISSUER = 0b1000,\n+ /**\n+ * A user that is part of the organization or owner of the repo\n+ */\n COLLABORATOR = 0b10000,\n+ /**\n+ * A user that is NOT part of the organization nor owner of the repo\n+ */\n CONTRIBUTOR = 0b100000,\n+ /**\n+ * A user comment action on a {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n+ COMMENTED = 0b1000000,\n+ /**\n+ * Pull request opening item\n+ */\n+ TASK = 0b10000000,", "score": { "reward": 9.38, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 41, "wordValue": 0.1, "result": 2.35 }, + "words": { + "wordCount": 41, + "wordValue": 0.1, + "result": 2.35 + }, "multiplier": 1, "relevance": 0.7 } @@ -1180,9 +2193,21 @@ "diffHunk": "@@ -19,12 +19,42 @@ import {\n } from \"./start\";\n \n export enum CommentType {\n+ /**\n+ * Review related item\n+ */\n REVIEW = 0b1,\n+ /**\n+ * Issue related item\n+ */\n ISSUE = 0b10,\n+ /**\n+ * User assigned to the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ASSIGNEE = 0b100,\n+ /**\n+ * The author of the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ISSUER = 0b1000,\n+ /**\n+ * A user that is part of the organization or owner of the repo\n+ */\n COLLABORATOR = 0b10000,\n+ /**\n+ * A user that is NOT part of the organization nor owner of the repo\n+ */\n CONTRIBUTOR = 0b100000,\n+ /**\n+ * A user comment action on a {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n+ COMMENTED = 0b1000000,\n+ /**\n+ * Pull request opening item\n+ */\n+ TASK = 0b10000000,", "score": { "reward": 22.54, - "formatting": { "content": { "p": { "score": 1, "elementCount": 3 } }, "result": 3 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 3 + } + }, + "result": 3 + }, "priority": 4, - "words": { "wordCount": 101, "wordValue": 0.1, "result": 5.05 }, + "words": { + "wordCount": 101, + "wordValue": 0.1, + "result": 5.05 + }, "multiplier": 1, "relevance": 0.7 } @@ -1195,9 +2220,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))", "score": { "reward": 7.56, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 28, "wordValue": 0.1, "result": 1.7 }, + "words": { + "wordCount": 28, + "wordValue": 0.1, + "result": 1.7 + }, "multiplier": 1, "relevance": 0.7 } @@ -1209,39 +2246,182 @@ "type": "PULL_COLLABORATOR", "score": { "reward": 5.768, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 16, "wordValue": 0.1, "result": 1.06 }, + "words": { + "wordCount": 16, + "wordValue": 0.1, + "result": 1.06 + }, "multiplier": 1, "relevance": 0.7 } } ], "reviewReward": { - "reviewBaseReward": { "reward": 0 }, + "reviewBaseReward": { + "reward": 0 + }, "reviews": [ - { "reviewId": 2007841578, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2008041757, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2008075969, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2008690769, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013380519, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013381647, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013381967, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013382304, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013382757, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013382941, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013708154, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2013708476, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2016111656, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2016113083, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2017922720, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 } + { + "reviewId": 2007841578, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2008041757, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2008075969, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2008690769, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013380519, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013381647, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013381967, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013382304, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013382757, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013382941, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013708154, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2013708476, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2016111656, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2016113083, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2017922720, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2018784615, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + } ] }, - "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiI1NDMzNTYwMDAwMDAwMDAwMDAwMDAifSwibm9uY2UiOiIzMzkyOTQxNzYyNzkzOTc1NTkzMTc4MTExNTY1OTgzNzk3NDc1ODk0MDM3NDk1NDA0MTMxMjg2MzgyNzgwNDExNjg3NzA4MzUyODg4IiwiZGVhZGxpbmUiOiIxMTU3OTIwODkyMzczMTYxOTU0MjM1NzA5ODUwMDg2ODc5MDc4NTMyNjk5ODQ2NjU2NDA1NjQwMzk0NTc1ODQwMDc5MTMxMjk2Mzk5MzUifSwidHJhbnNmZXJEZXRhaWxzIjp7InRvIjoiMHg0RDA3MDRmNDAwRDU3QmE5M2VFYTg4NzY1QzNGY0RCRDgyNmRDRmM0IiwicmVxdWVzdGVkQW1vdW50IjoiNTQzMzU2MDAwMDAwMDAwMDAwMDAwIn0sIm93bmVyIjoiMHhkOTUzMEYzZmJCRWExMWJlRDAxREMwOUU3OTMxOGYyZjIwMjIzNzE2Iiwic2lnbmF0dXJlIjoiMHhjYTE4NmI2ZDc0ZTI5ODkxMzUxNDVhZmI4NTFhZmI4MjEwZTU1NDlmODljMzgxNDY1NGVjMDEzMDJlODA0NmQxNzkyMDk1YzM2OTY0MGM1Y2JjYjBhMzViOTBmOTk3NzU2MWY5ODczMzJkYmM0ZTI0YTFiMzY4ZGRhYTQ5MWEzYjFiIiwibmV0d29ya0lkIjoxMDB9XQ==", - "evaluationCommentHtml": "

 [ 543.356 WXDAI ] 

@0x4007
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
ReviewCode Review1515
IssueComment9341.568
ReviewComment23186.788
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
@whilefoo rfc on how we can deal with comment outputs. Perhaps w…
4.64
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 47
  wordValue: 0.1
  result: 2.64
0.8414.848
I think you should fork from and overtake that second pull due t…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.846.752
I think the most pure architecture would be that plugins can NOT…
24.21
content:
  content:
    p:
      score: 1
      elementCount: 7
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 12
regex:
  wordCount: 285
  wordValue: 0.1
  result: 12.21
0.8477.472
I know JSON makes things more complicated than it needs to be wi…
16.43
content:
  content:
    p:
      score: 1
      elementCount: 4
    code:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 159
  wordValue: 0.1
  result: 7.43
0.8452.576
Going back to my \"plugin-side-rendering\" mention, the data manip…
13.22
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 5
    pre:
      score: 0
      elementCount: 1
  result: 7
regex:
  wordCount: 129
  wordValue: 0.1
  result: 6.22
0.8442.304
The proposed `comment` output is intended for ease of co…
20.57
content:
  content:
    p:
      score: 1
      elementCount: 6
    code:
      score: 1
      elementCount: 3
    h3:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 214
  wordValue: 0.1
  result: 9.57
0.8465.824
I understand your concern and I would need to put more thought i…
12.93
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 2
  result: 8
regex:
  wordCount: 98
  wordValue: 0.1
  result: 4.93
0.8441.376
I see, so you're suggesting that we must annotate each comment a…
9.88
content:
  content:
    p:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 4
  result: 5
regex:
  wordCount: 97
  wordValue: 0.1
  result: 4.88
0.8431.616
Consider calling it \"contributor\" and \"collaborator\" as that is …
2.75
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 29
  wordValue: 0.1
  result: 1.75
0.848.8
Nice code quality per usual
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
\"Comment\" implication isn't clear to me
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
I've always been anti empty string for variable declarations. It…
3.73
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 49
  wordValue: 0.1
  result: 2.73
0.7410.444
Our RPCs don't work anymore
1.46
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.744.088
Yes consider changing them to verbs `ISSUER``COMME…
4.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.7413.16
`[].join(\"\");` yields an empty string as well if there's…
2.94
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.748.232
Perhaps it will make the config more expressive if you add other…
3.49
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.749.772
What is this @link syntax
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
Just noticed the bit wise operators 1337 code
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
It might seem convoluted but I think that it condenses the logic…
7.48
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 3
    pre:
      score: 0
      elementCount: 1
  result: 4
regex:
  wordCount: 65
  wordValue: 0.1
  result: 3.48
0.7420.944
I am aware of its purpose. I am proposing to make the config mor…
2.44
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 23
  wordValue: 0.1
  result: 1.44
0.746.832
Will you use array syntax?
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
This regex appears to convert repeating spaces i.e. `\" \"&#…
4.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 19
  wordValue: 0.1
  result: 1.22
0.7411.816
This doesn't seem right. Network ID 1 is mainnet. The RPC clearl…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.747.112
Seems like not a very useful mock.
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
Same here
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
The token address indeed represents DAI on mainnet.
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
@gentlementlegen rfc
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
Why not do it in the industry standard way? All values are denom…
4.8
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 30
  wordValue: 0.1
  result: 1.8
0.7413.44
I'm not sure if I understand but task reward is if you completed…
3.35
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 41
  wordValue: 0.1
  result: 2.35
0.749.38
Spoke a bit on this in dms. @whilefoo my intent with referring t…
8.05
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 101
  wordValue: 0.1
  result: 5.05
0.7422.54
Possibly. I personally haven't had that issue but either way my …
2.7
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.747.56
I think it's fine. I generally scrutinize test code less than no…
2.06
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 16
  wordValue: 0.1
  result: 1.06
0.745.768
" + "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiI1NDQzNTYwMDAwMDAwMDAwMDAwMDAifSwibm9uY2UiOiIzMzkyOTQxNzYyNzkzOTc1NTkzMTc4MTExNTY1OTgzNzk3NDc1ODk0MDM3NDk1NDA0MTMxMjg2MzgyNzgwNDExNjg3NzA4MzUyODg4IiwiZGVhZGxpbmUiOiIxMTU3OTIwODkyMzczMTYxOTU0MjM1NzA5ODUwMDg2ODc5MDc4NTMyNjk5ODQ2NjU2NDA1NjQwMzk0NTc1ODQwMDc5MTMxMjk2Mzk5MzUifSwidHJhbnNmZXJEZXRhaWxzIjp7InRvIjoiMHg0RDA3MDRmNDAwRDU3QmE5M2VFYTg4NzY1QzNGY0RCRDgyNmRDRmM0IiwicmVxdWVzdGVkQW1vdW50IjoiNTQ0MzU2MDAwMDAwMDAwMDAwMDAwIn0sIm93bmVyIjoiMHhkOTUzMEYzZmJCRWExMWJlRDAxREMwOUU3OTMxOGYyZjIwMjIzNzE2Iiwic2lnbmF0dXJlIjoiMHg5YmE3MDdmZjk5MjY3OTJiNTAwNWNmOGYyOGJkNzE5NjJjZTI0NmE1ZTU5YjEyNjQ0ZmJjYWNiZGIzYTJhYjg1NDA0ZWQ0NGMyMTFkMGQyYWY3NWRlMzJmMTcxYWQ3YTZhOTcxOTBmMGJiMzkyNWRlNTFiYTE3NzU1ZmY5ZDVmYTFjIiwibmV0d29ya0lkIjoxMDB9XQ==", + "evaluationCommentHtml": "

 [ 544.356 WXDAI ] 

@0x4007
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
ReviewCode Review1616
IssueComment9341.568
ReviewComment23186.788
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
@whilefoo rfc on how we can deal with comment outputs. Perhaps w…
4.64
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 47
  wordValue: 0.1
  result: 2.64
0.8414.848
I think you should fork from and overtake that second pull due t…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.846.752
I think the most pure architecture would be that plugins can NOT…
24.21
content:
  content:
    p:
      score: 1
      elementCount: 7
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 12
regex:
  wordCount: 285
  wordValue: 0.1
  result: 12.21
0.8477.472
I know JSON makes things more complicated than it needs to be wi…
16.43
content:
  content:
    p:
      score: 1
      elementCount: 4
    code:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 159
  wordValue: 0.1
  result: 7.43
0.8452.576
Going back to my \"plugin-side-rendering\" mention, the data manip…
13.22
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 5
    pre:
      score: 0
      elementCount: 1
  result: 7
regex:
  wordCount: 129
  wordValue: 0.1
  result: 6.22
0.8442.304
The proposed `comment` output is intended for ease of co…
20.57
content:
  content:
    p:
      score: 1
      elementCount: 6
    code:
      score: 1
      elementCount: 3
    h3:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 214
  wordValue: 0.1
  result: 9.57
0.8465.824
I understand your concern and I would need to put more thought i…
12.93
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 2
  result: 8
regex:
  wordCount: 98
  wordValue: 0.1
  result: 4.93
0.8441.376
I see, so you're suggesting that we must annotate each comment a…
9.88
content:
  content:
    p:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 4
  result: 5
regex:
  wordCount: 97
  wordValue: 0.1
  result: 4.88
0.8431.616
Consider calling it \"contributor\" and \"collaborator\" as that is …
2.75
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 29
  wordValue: 0.1
  result: 1.75
0.848.8
Nice code quality per usual
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
\"Comment\" implication isn't clear to me
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
I've always been anti empty string for variable declarations. It…
3.73
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 49
  wordValue: 0.1
  result: 2.73
0.7410.444
Our RPCs don't work anymore
1.46
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.744.088
Yes consider changing them to verbs `ISSUER``COMME…
4.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.7413.16
`[].join(\"\");` yields an empty string as well if there's…
2.94
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.748.232
Perhaps it will make the config more expressive if you add other…
3.49
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.749.772
What is this @link syntax
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
Just noticed the bit wise operators 1337 code
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
It might seem convoluted but I think that it condenses the logic…
7.48
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 3
    pre:
      score: 0
      elementCount: 1
  result: 4
regex:
  wordCount: 65
  wordValue: 0.1
  result: 3.48
0.7420.944
I am aware of its purpose. I am proposing to make the config mor…
2.44
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 23
  wordValue: 0.1
  result: 1.44
0.746.832
Will you use array syntax?
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
This regex appears to convert repeating spaces i.e. `\" \"&#…
4.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 19
  wordValue: 0.1
  result: 1.22
0.7411.816
This doesn't seem right. Network ID 1 is mainnet. The RPC clearl…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.747.112
Seems like not a very useful mock.
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
Same here
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
The token address indeed represents DAI on mainnet.
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
@gentlementlegen rfc
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
Why not do it in the industry standard way? All values are denom…
4.8
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 30
  wordValue: 0.1
  result: 1.8
0.7413.44
I'm not sure if I understand but task reward is if you completed…
3.35
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 41
  wordValue: 0.1
  result: 2.35
0.749.38
Spoke a bit on this in dms. @whilefoo my intent with referring t…
8.05
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 101
  wordValue: 0.1
  result: 5.05
0.7422.54
Possibly. I personally haven't had that issue but either way my …
2.7
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.747.56
I think it's fine. I generally scrutinize test code less than no…
2.06
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 16
  wordValue: 0.1
  result: 1.06
0.745.768
" }, "whilefoo": { - "total": 67.336, + "total": 68.336, "userId": 139262667, "comments": [ { @@ -1253,14 +2433,27 @@ "reward": 13.6, "formatting": { "content": { - "p": { "score": 1, "elementCount": 6 }, - "ol": { "score": 0, "elementCount": 1 }, - "li": { "score": 1, "elementCount": 3 } + "p": { + "score": 1, + "elementCount": 6 + }, + "ol": { + "score": 0, + "elementCount": 1 + }, + "li": { + "score": 1, + "elementCount": 3 + } }, "result": 9 }, "priority": 4, - "words": { "wordCount": 173, "wordValue": 0.1, "result": 7.99 }, + "words": { + "wordCount": 173, + "wordValue": 0.1, + "result": 7.99 + }, "multiplier": 0.25, "relevance": 0.8 } @@ -1275,14 +2468,27 @@ "reward": 2.072, "formatting": { "content": { - "pre": { "score": 0, "elementCount": 1 }, - "code": { "score": 1, "elementCount": 1 }, - "p": { "score": 1, "elementCount": 1 } + "pre": { + "score": 0, + "elementCount": 1 + }, + "code": { + "score": 1, + "elementCount": 1 + }, + "p": { + "score": 1, + "elementCount": 1 + } }, "result": 2 }, "priority": 4, - "words": { "wordCount": 14, "wordValue": 0.1, "result": 0.94 }, + "words": { + "wordCount": 14, + "wordValue": 0.1, + "result": 0.94 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1295,9 +2501,21 @@ "diffHunk": "@@ -0,0 +1,41 @@\n+import { parseGitHubUrl } from \"../src/start\";\n+import { IssueActivity } from \"../src/issue-activity\";\n+import { Processor } from \"../src/parser/processor\";\n+import { UserExtractorModule } from \"../src/parser/user-extractor-module\";\n+import { server } from \"./__mocks__/node\";\n+import { DataPurgeModule } from \"../src/parser/data-purge-module\";\n+import userCommentResults from \"./__mocks__/results/user-comment-results.json\";\n+import dataPurgeResults from \"./__mocks__/results/data-purge-result.json\";\n+\n+const issueUrl = process.env.TEST_ISSUE_URL || \"https://github.com/ubiquity-os/comment-incentives/issues/22\";\n+\n+beforeAll(() => server.listen());\n+afterEach(() => server.resetHandlers());\n+afterAll(() => server.close());\n+\n+describe(\"Modules tests\", () => {\n+ const issue = parseGitHubUrl(issueUrl);\n+ const activity = new IssueActivity(issue);\n+\n+ beforeAll(async () => {\n+ await activity.init();\n+ });\n+\n+ it(\"Should extract users from comments\", async () => {\n+ const logSpy = jest.spyOn(console, \"log\");\n+ const processor = new Processor();\n+ processor[\"_transformers\"] = [new UserExtractorModule()];\n+ await processor.run(activity);\n+ processor.dump();\n+ expect(logSpy).toHaveBeenCalledWith(JSON.stringify(userCommentResults, undefined, 2));", "score": { "reward": 1.792, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 25, "wordValue": 0.1, "result": 1.54 }, + "words": { + "wordCount": 25, + "wordValue": 0.1, + "result": 1.54 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1310,9 +2528,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(", "score": { "reward": 1.204, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 10, "wordValue": 0.1, "result": 0.71 }, + "words": { + "wordCount": 10, + "wordValue": 0.1, + "result": 0.71 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1325,9 +2555,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))", "score": { "reward": 1.316, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 13, "wordValue": 0.1, "result": 0.88 }, + "words": { + "wordCount": 13, + "wordValue": 0.1, + "result": 0.88 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1340,9 +2582,21 @@ "diffHunk": "@@ -19,12 +19,42 @@ import {\n } from \"./start\";\n \n export enum CommentType {\n+ /**\n+ * Review related item\n+ */\n REVIEW = 0b1,\n+ /**\n+ * Issue related item\n+ */\n ISSUE = 0b10,\n+ /**\n+ * User assigned to the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ASSIGNEE = 0b100,\n+ /**\n+ * The author of the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ISSUER = 0b1000,\n+ /**\n+ * A user that is part of the organization or owner of the repo\n+ */\n COLLABORATOR = 0b10000,\n+ /**\n+ * A user that is NOT part of the organization nor owner of the repo\n+ */\n CONTRIBUTOR = 0b100000,\n+ /**\n+ * A user comment action on a {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n+ COMMENTED = 0b1000000,\n+ /**\n+ * Pull request opening item\n+ */\n+ TASK = 0b10000000,", "score": { "reward": 1.736, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 24, "wordValue": 0.1, "result": 1.49 }, + "words": { + "wordCount": 24, + "wordValue": 0.1, + "result": 1.49 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1355,9 +2609,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ function createIncentiveRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function buildIncentiveRow(commentScore: GithubCommentScore) {\n+ // Properly escape carriage returns for HTML rendering\n+ const formatting = stringify(commentScore.score?.formatting?.content).replace(/[\\n\\r]/g, \" \");\n+ return `\n+ \n+ \n+
\n+ ${commentScore.content.replace(/(.{64})..+/, \"$1…\")}\n+
\n+ \n+ \n+
\n+ \n+ ${Object.values(commentScore.score?.formatting?.content || {}).reduce((acc, curr) => {\n+ return acc.add(curr.score * curr.count);\n+ }, new Decimal(0))}\n+ \n+
${formatting}
\n+
\n+ \n+ ${commentScore.score?.relevance || \"-\"}\n+ ${commentScore.score?.reward || \"-\"}\n+ `;\n+ }\n+\n+ for (const issueComment of sorted.issues.comments) {\n+ content.push(buildIncentiveRow(issueComment));\n+ }\n+ for (const reviewComment of sorted.reviews) {\n+ content.push(buildIncentiveRow(reviewComment));\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ return `\n+
\n+ \n+ \n+

\n+ ", "score": { "reward": 1.596, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 20, "wordValue": 0.1, "result": 1.28 }, + "words": { + "wordCount": 20, + "wordValue": 0.1, + "result": 1.28 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1370,9 +2636,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ function createIncentiveRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function buildIncentiveRow(commentScore: GithubCommentScore) {\n+ // Properly escape carriage returns for HTML rendering\n+ const formatting = stringify(commentScore.score?.formatting?.content).replace(/[\\n\\r]/g, \" \");\n+ return `\n+ \n+ \n+
\n+ ${commentScore.content.replace(/(.{64})..+/, \"$1…\")}\n+
\n+ \n+ \n+
\n+ \n+ ${Object.values(commentScore.score?.formatting?.content || {}).reduce((acc, curr) => {\n+ return acc.add(curr.score * curr.count);\n+ }, new Decimal(0))}\n+ \n+
${formatting}
\n+
\n+ \n+ ${commentScore.score?.relevance || \"-\"}\n+ ${commentScore.score?.reward || \"-\"}\n+ `;\n+ }\n+\n+ for (const issueComment of sorted.issues.comments) {\n+ content.push(buildIncentiveRow(issueComment));\n+ }\n+ for (const reviewComment of sorted.reviews) {\n+ content.push(buildIncentiveRow(reviewComment));\n+ }\n+ return content.join(\"\");\n+ }\n+\n+ return `\n+
\n+ \n+ \n+

\n+ ", "score": { "reward": 1.148, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 9, "wordValue": 0.1, "result": 0.65 }, + "words": { + "wordCount": 9, + "wordValue": 0.1, + "result": 0.65 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1386,11 +2664,24 @@ "score": { "reward": 5.18, "formatting": { - "content": { "p": { "score": 1, "elementCount": 3 }, "a": { "score": 1, "elementCount": 1 } }, + "content": { + "p": { + "score": 1, + "elementCount": 3 + }, + "a": { + "score": 1, + "elementCount": 1 + } + }, "result": 4 }, "priority": 4, - "words": { "wordCount": 63, "wordValue": 0.1, "result": 3.38 }, + "words": { + "wordCount": 63, + "wordValue": 0.1, + "result": 3.38 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1403,9 +2694,21 @@ "diffHunk": "@@ -0,0 +1,217 @@\n+import { Value } from \"@sinclair/typebox/value\";\n+import Decimal from \"decimal.js\";\n+import * as fs from \"fs\";\n+import { stringify } from \"yaml\";\n+import configuration from \"../configuration/config-reader\";\n+import githubCommentConfig, { GithubCommentConfiguration } from \"../configuration/github-comment-config\";\n+import { getOctokitInstance } from \"../get-authentication-token\";\n+import { CommentType, IssueActivity } from \"../issue-activity\";\n+import { parseGitHubUrl } from \"../start\";\n+import { getPayoutConfigByNetworkId } from \"../types/payout\";\n+import program from \"./command-line\";\n+import { GithubCommentScore, Module, Result } from \"./processor\";\n+\n+/**\n+ * Posts a GitHub comment according to the given results.\n+ */\n+export class GithubCommentModule implements Module {\n+ private readonly _configuration: GithubCommentConfiguration = configuration.githubComment;\n+ private readonly _debugFilePath = \"./output.html\";\n+\n+ async transform(data: Readonly, result: Result): Promise {\n+ const bodyArray: (string | undefined)[] = [];\n+\n+ for (const [key, value] of Object.entries(result)) {\n+ result[key].evaluationCommentHtml = this._generateHtml(key, value);\n+ bodyArray.push(result[key].evaluationCommentHtml);\n+ }\n+ const body = bodyArray.join(\"\");\n+ if (this._configuration.debug) {\n+ fs.writeFileSync(this._debugFilePath, body);\n+ }\n+ if (this._configuration.post) {\n+ try {\n+ const octokit = getOctokitInstance();\n+ const { owner, repo, issue_number } = parseGitHubUrl(program.opts().issue);\n+\n+ await octokit.issues.createComment({\n+ body,\n+ repo,\n+ owner,\n+ issue_number,\n+ });\n+ } catch (e) {\n+ console.error(`Could not post GitHub comment: ${e}`);\n+ }\n+ }\n+ return Promise.resolve(result);\n+ }\n+\n+ get enabled(): boolean {\n+ if (!Value.Check(githubCommentConfig, this._configuration)) {\n+ console.warn(\"Invalid configuration detected for GithubContentModule, disabling.\");\n+ return false;\n+ }\n+ return true;\n+ }\n+\n+ _generateHtml(username: string, result: Result[0]) {\n+ const sorted = result.comments?.reduce<{\n+ issues: { task: GithubCommentScore | null; comments: GithubCommentScore[] };\n+ reviews: GithubCommentScore[];\n+ }>(\n+ (acc, curr) => {\n+ if (curr.type & CommentType.ISSUE) {\n+ if (curr.type & CommentType.TASK) {\n+ acc.issues.task = curr;\n+ } else {\n+ acc.issues.comments.push(curr);\n+ }\n+ } else if (curr.type & CommentType.REVIEW) {\n+ acc.reviews.push(curr);\n+ }\n+ return acc;\n+ },\n+ { issues: { task: null, comments: [] }, reviews: [] }\n+ );\n+\n+ function createContributionRows() {\n+ const content: string[] = [];\n+\n+ if (!sorted) {\n+ return content.join(\"\");\n+ }\n+\n+ function generateContributionRow(\n+ view: string,\n+ contribution: string,\n+ count: number,\n+ reward: number | Decimal | undefined\n+ ) {\n+ return `\n+ \n+ ${view}\n+ ${contribution}\n+ ${count}\n+ ${reward || \"-\"}\n+ `;\n+ }\n+\n+ if (result.task?.reward) {\n+ content.push(generateContributionRow(\"Issue\", \"Task\", 1, result.task.reward));\n+ }\n+ if (sorted.issues.task) {\n+ content.push(generateContributionRow(\"Issue\", \"Specification\", 1, sorted.issues.task.score?.reward));\n+ }\n+ if (sorted.issues.comments.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Issue\",\n+ \"Comment\",\n+ sorted.issues.comments.length,\n+ sorted.issues.comments.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))\n+ )\n+ );\n+ }\n+ if (sorted.reviews.length) {\n+ content.push(\n+ generateContributionRow(\n+ \"Review\",\n+ \"Comment\",\n+ sorted.reviews.length,\n+ sorted.reviews.reduce((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0))", "score": { "reward": 1.484, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 17, "wordValue": 0.1, "result": 1.11 }, + "words": { + "wordCount": 17, + "wordValue": 0.1, + "result": 1.11 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1419,11 +2722,24 @@ "score": { "reward": 4.284, "formatting": { - "content": { "p": { "score": 1, "elementCount": 2 }, "code": { "score": 1, "elementCount": 2 } }, + "content": { + "p": { + "score": 1, + "elementCount": 2 + }, + "code": { + "score": 1, + "elementCount": 2 + } + }, "result": 4 }, "priority": 4, - "words": { "wordCount": 36, "wordValue": 0.1, "result": 2.1 }, + "words": { + "wordCount": 36, + "wordValue": 0.1, + "result": 2.1 + }, "multiplier": 0.25, "relevance": 0.7 } @@ -1436,25 +2752,96 @@ "diffHunk": "@@ -19,12 +19,42 @@ import {\n } from \"./start\";\n \n export enum CommentType {\n+ /**\n+ * Review related item\n+ */\n REVIEW = 0b1,\n+ /**\n+ * Issue related item\n+ */\n ISSUE = 0b10,\n+ /**\n+ * User assigned to the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ASSIGNEE = 0b100,\n+ /**\n+ * The author of the {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n ISSUER = 0b1000,\n+ /**\n+ * A user that is part of the organization or owner of the repo\n+ */\n COLLABORATOR = 0b10000,\n+ /**\n+ * A user that is NOT part of the organization nor owner of the repo\n+ */\n CONTRIBUTOR = 0b100000,\n+ /**\n+ * A user comment action on a {@link CommentType.ISSUE} or {@link CommentType.REVIEW}\n+ */\n+ COMMENTED = 0b1000000,\n+ /**\n+ * Pull request opening item\n+ */\n+ TASK = 0b10000000,", "score": { "reward": 0.924, - "formatting": { "content": { "p": { "score": 1, "elementCount": 1 } }, "result": 1 }, + "formatting": { + "content": { + "p": { + "score": 1, + "elementCount": 1 + } + }, + "result": 1 + }, "priority": 4, - "words": { "wordCount": 4, "wordValue": 0.1, "result": 0.32 }, + "words": { + "wordCount": 4, + "wordValue": 0.1, + "result": 0.32 + }, "multiplier": 0.25, "relevance": 0.7 } } ], "reviewReward": { - "reviewBaseReward": { "reward": 25 }, + "reviewBaseReward": { + "reward": 25 + }, "reviews": [ - { "reviewId": 2014236289, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2016582024, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2017635547, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2020125850, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2020144465, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 }, - { "reviewId": 2022648888, "effect": { "addition": 50, "deletion": 50 }, "reward": 1, "priority": 1 } + { + "reviewId": 2014236289, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2016582024, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2017635547, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2020125850, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2020144465, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2022648888, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + }, + { + "reviewId": 2022656285, + "effect": { + "addition": 50, + "deletion": 50 + }, + "reward": 1, + "priority": 1 + } ] }, - "evaluationCommentHtml": "

 [ 67.336 WXDAI ] 

@whilefoo
Contributions Overview
ViewContributionCountReward
ReviewBase Review125
ReviewCode Review66
IssueComment113.6
ReviewComment1122.736
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
there are a couple of options:1. we let the conversation-rewar…
16.99
content:
  content:
    p:
      score: 1
      elementCount: 6
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 3
  result: 9
regex:
  wordCount: 173
  wordValue: 0.1
  result: 7.99
0.8413.6
```suggestionreturn result;```…
2.94
content:
  content:
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    p:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.742.072
I'm not sure if it's a good idea to rely on logs for testing, is…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.741.792
why so many nested functions? it becomes hard to read
1.71
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 10
  wordValue: 0.1
  result: 0.71
0.741.204
is there a reason we are using Decimal.js instead of native BigI…
1.88
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 13
  wordValue: 0.1
  result: 0.88
0.741.316
Shouldn't task be issue opening item and specification is pull r…
2.49
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.741.736
I assume this is a permit for task assignee, but where are other…
2.28
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 20
  wordValue: 0.1
  result: 1.28
0.741.596
gotcha, I thought this html is for all users
1.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 9
  wordValue: 0.1
  result: 0.65
0.741.148
I can see from the example that it works correctly but when read…
7.38
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 63
  wordValue: 0.1
  result: 3.38
0.745.18
Ok so we need it for precise floating point calculations, in tha…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.741.484
why is it `ISSUER` which is meant for author of issue/re…
6.1
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 4
regex:
  wordCount: 36
  wordValue: 0.1
  result: 2.1
0.744.284
this makes more sense!
1.32
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 4
  wordValue: 0.1
  result: 0.32
0.740.924
" + "evaluationCommentHtml": "

 [ 68.336 WXDAI ] 

@whilefoo
Contributions Overview
ViewContributionCountReward
ReviewBase Review125
ReviewCode Review77
IssueComment113.6
ReviewComment1122.736
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
there are a couple of options:1. we let the conversation-rewar…
16.99
content:
  content:
    p:
      score: 1
      elementCount: 6
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 3
  result: 9
regex:
  wordCount: 173
  wordValue: 0.1
  result: 7.99
0.8413.6
```suggestionreturn result;```…
2.94
content:
  content:
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    p:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.742.072
I'm not sure if it's a good idea to rely on logs for testing, is…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.741.792
why so many nested functions? it becomes hard to read
1.71
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 10
  wordValue: 0.1
  result: 0.71
0.741.204
is there a reason we are using Decimal.js instead of native BigI…
1.88
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 13
  wordValue: 0.1
  result: 0.88
0.741.316
Shouldn't task be issue opening item and specification is pull r…
2.49
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.741.736
I assume this is a permit for task assignee, but where are other…
2.28
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 20
  wordValue: 0.1
  result: 1.28
0.741.596
gotcha, I thought this html is for all users
1.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 9
  wordValue: 0.1
  result: 0.65
0.741.148
I can see from the example that it works correctly but when read…
7.38
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 63
  wordValue: 0.1
  result: 3.38
0.745.18
Ok so we need it for precise floating point calculations, in tha…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.741.484
why is it `ISSUER` which is meant for author of issue/re…
6.1
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 4
regex:
  wordCount: 36
  wordValue: 0.1
  result: 2.1
0.744.284
this makes more sense!
1.32
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 4
  wordValue: 0.1
  result: 0.32
0.740.924
" } -} +} \ No newline at end of file diff --git a/tests/__mocks__/results/output.html b/tests/__mocks__/results/output.html index 0fec66ed..ea937cdf 100644 --- a/tests/__mocks__/results/output.html +++ b/tests/__mocks__/results/output.html @@ -1,4 +1,4 @@ -

 [ 1872.688 WXDAI ] 

@gentlementlegen
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
IssueTask1400
ReviewCode Review2121
IssueSpecification161.8
IssueComment9415.488
ReviewComment25974.4
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
In the v1 of the Ubiquibot, when a result gets evaluated, a reca…
15.45
content:
  content:
    p:
      score: 1
      elementCount: 6
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 87
  wordValue: 0.1
  result: 4.45
1461.8
This needs https://github.com/ubiquity-os/conversation-rewards/p…
5.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 17
  wordValue: 0.2
  result: 2.22
0.8416.704
To me 1 is the most straightforward to do for few reasons:- th…
20.36
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 10
regex:
  wordCount: 104
  wordValue: 0.2
  result: 10.36
0.8465.152
I think each plugin should output JSON not html as it is not rel…
17.53
content:
  content:
    p:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 7
regex:
  wordCount: 106
  wordValue: 0.2
  result: 10.53
0.8456.096
If you want to manipulate and convey data, HTML really is not ma…
17.85
content:
  content:
    p:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 134
  wordValue: 0.2
  result: 12.85
0.8457.12
But then how do we consider the formatting of that output?Prac…
19.87
content:
  content:
    p:
      score: 1
      elementCount: 5
  result: 5
regex:
  wordCount: 159
  wordValue: 0.2
  result: 14.87
0.8463.584
This can work, but we skyrocket coupling and to me defeat purpos…
7.03
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 55
  wordValue: 0.2
  result: 6.03
0.8422.496
@pavlovcik To mitigate that that's why inside the comment reward…
10.73
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 85
  wordValue: 0.2
  result: 8.73
0.8434.336
I realized that to carry this task properly we need to handle fl…
9.31
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 58
  wordValue: 0.2
  result: 6.31
0.8429.792
Agreed, I think currently there are 3 possible things to annotat…
21.94
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 7
  result: 16
regex:
  wordCount: 54
  wordValue: 0.2
  result: 5.94
0.8470.208
Resolves #5 Depends on #8 Reviews looks gigantic but it's on…
3
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 19
  wordValue: 0
  result: 0
0.740
I think in this case it makes sense because this function will r…
12.49
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 4
  result: 6
regex:
  wordCount: 60
  wordValue: 0.2
  result: 6.49
0.7469.944
It is supposed to represent a comment. Would you prefer a descri…
4.11
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 16
  wordValue: 0.2
  result: 2.11
0.7423.016
True, just picked this up from the previous codebase. https://rp…
4
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 15
  wordValue: 0.2
  result: 2
0.7422.4
Seems convoluted to me and I don't know what problem that solved…
7.6
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 40
  wordValue: 0.2
  result: 4.6
0.7442.56
Changed `COMMENT` to `COMMENTED`, added jsdoc de…
6.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7435.952
Simply makes the docs linking the code within the comment, for c…
8.01
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 34
  wordValue: 0.2
  result: 4.01
0.7444.856
In the case of a string it would coerce the value and you would …
4.09
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7422.904
`observe` would help to chose what we want to include an…
7.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 41
  wordValue: 0.2
  result: 4.7
0.7443.12
Not very useful indeed. I am working on the tests on a separate …
6.4
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 28
  wordValue: 0.2
  result: 3.4
0.7435.84
See https://github.com/ubiquity-os/conversation-rewards/pull/14 …
3.17
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 8
  wordValue: 0.2
  result: 1.17
0.7417.752
Good point, also symbol should not be DAI but ETH isn't it? …
8.5
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 39
  wordValue: 0.2
  result: 4.5
0.7447.6
Had changed it everywhere else but here, now it should be fine
2.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 12
  wordValue: 0.2
  result: 1.65
0.7414.84
This matches any whitespace character (spaces, tabs, line breaks…
4.91
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 33
  wordValue: 0.2
  result: 3.91
0.7427.496
By definition `dump` was just outputting results to stdo…
9.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 68
  wordValue: 0.2
  result: 7.22
0.7451.632
Un-nested them one level. I think that the `buildXrow` s…
5.09
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7428.504
I assumed BigInt only handles integers, and we manipulate a lot …
3.98
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.2
  result: 2.98
0.7422.288
There is one permit generated per participating user, last run:…
4.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7424.752
I made it according to the previous version:- Issue Specificat…
12.7
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 31
  wordValue: 0.2
  result: 3.7
0.7471.12
Wouldn't that lead to precision loss in JS and after the divisio…
5.6
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 30
  wordValue: 0.2
  result: 3.6
0.7431.36
That is correct. I understand now why you're confused:The valu…
21.95
content:
  content:
    p:
      score: 1
      elementCount: 8
    code:
      score: 1
      elementCount: 7
  result: 15
regex:
  wordCount: 65
  wordValue: 0.2
  result: 6.95
0.74122.92
I don't think is it relevant in this scenario because we are not…
6.37
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 48
  wordValue: 0.2
  result: 5.37
0.7435.672
@whilefoo you are correct, these were wrongly used. I corrected …
16.28
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 5
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 47
  wordValue: 0.2
  result: 5.28
0.7491.168
Example of successful comment posting with results:https://git…
4.05
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 7
  wordValue: 0.2
  result: 1.05
0.7422.68
@0x4007 I believe that if I had all the tests in this PR it will…
4.29
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 27
  wordValue: 0.2
  result: 3.29
0.7424.024

 [ 543.356 WXDAI ] 

@0x4007
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
ReviewCode Review1515
IssueComment9341.568
ReviewComment23186.788
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
@whilefoo rfc on how we can deal with comment outputs. Perhaps w…
4.64
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 47
  wordValue: 0.1
  result: 2.64
0.8414.848
I think you should fork from and overtake that second pull due t…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.846.752
I think the most pure architecture would be that plugins can NOT…
24.21
content:
  content:
    p:
      score: 1
      elementCount: 7
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 12
regex:
  wordCount: 285
  wordValue: 0.1
  result: 12.21
0.8477.472
I know JSON makes things more complicated than it needs to be wi…
16.43
content:
  content:
    p:
      score: 1
      elementCount: 4
    code:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 159
  wordValue: 0.1
  result: 7.43
0.8452.576
Going back to my "plugin-side-rendering" mention, the data manip…
13.22
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 5
    pre:
      score: 0
      elementCount: 1
  result: 7
regex:
  wordCount: 129
  wordValue: 0.1
  result: 6.22
0.8442.304
The proposed `comment` output is intended for ease of co…
20.57
content:
  content:
    p:
      score: 1
      elementCount: 6
    code:
      score: 1
      elementCount: 3
    h3:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 214
  wordValue: 0.1
  result: 9.57
0.8465.824
I understand your concern and I would need to put more thought i…
12.93
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 2
  result: 8
regex:
  wordCount: 98
  wordValue: 0.1
  result: 4.93
0.8441.376
I see, so you're suggesting that we must annotate each comment a…
9.88
content:
  content:
    p:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 4
  result: 5
regex:
  wordCount: 97
  wordValue: 0.1
  result: 4.88
0.8431.616
Consider calling it "contributor" and "collaborator" as that is …
2.75
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 29
  wordValue: 0.1
  result: 1.75
0.848.8
Nice code quality per usual
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
"Comment" implication isn't clear to me
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
I've always been anti empty string for variable declarations. It…
3.73
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 49
  wordValue: 0.1
  result: 2.73
0.7410.444
Our RPCs don't work anymore
1.46
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.744.088
Yes consider changing them to verbs `ISSUER``COMME…
4.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.7413.16
`[].join("");` yields an empty string as well if there's…
2.94
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.748.232
Perhaps it will make the config more expressive if you add other…
3.49
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.749.772
What is this @link syntax
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
Just noticed the bit wise operators 1337 code
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
It might seem convoluted but I think that it condenses the logic…
7.48
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 3
    pre:
      score: 0
      elementCount: 1
  result: 4
regex:
  wordCount: 65
  wordValue: 0.1
  result: 3.48
0.7420.944
I am aware of its purpose. I am proposing to make the config mor…
2.44
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 23
  wordValue: 0.1
  result: 1.44
0.746.832
Will you use array syntax?
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
This regex appears to convert repeating spaces i.e. `" "&#…
4.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 19
  wordValue: 0.1
  result: 1.22
0.7411.816
This doesn't seem right. Network ID 1 is mainnet. The RPC clearl…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.747.112
Seems like not a very useful mock.
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
Same here
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
The token address indeed represents DAI on mainnet.
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
@gentlementlegen rfc
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
Why not do it in the industry standard way? All values are denom…
4.8
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 30
  wordValue: 0.1
  result: 1.8
0.7413.44
I'm not sure if I understand but task reward is if you completed…
3.35
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 41
  wordValue: 0.1
  result: 2.35
0.749.38
Spoke a bit on this in dms. @whilefoo my intent with referring t…
8.05
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 101
  wordValue: 0.1
  result: 5.05
0.7422.54
Possibly. I personally haven't had that issue but either way my …
2.7
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.747.56
I think it's fine. I generally scrutinize test code less than no…
2.06
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 16
  wordValue: 0.1
  result: 1.06
0.745.768

 [ 67.336 WXDAI ] 

@whilefoo
Contributions Overview
ViewContributionCountReward
ReviewBase Review125
ReviewCode Review66
IssueComment113.6
ReviewComment1122.736
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
there are a couple of options:1. we let the conversation-rewar…
16.99
content:
  content:
    p:
      score: 1
      elementCount: 6
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 3
  result: 9
regex:
  wordCount: 173
  wordValue: 0.1
  result: 7.99
0.8413.6
```suggestionreturn result;```…
2.94
content:
  content:
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    p:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.742.072
I'm not sure if it's a good idea to rely on logs for testing, is…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.741.792
why so many nested functions? it becomes hard to read
1.71
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 10
  wordValue: 0.1
  result: 0.71
0.741.204
is there a reason we are using Decimal.js instead of native BigI…
1.88
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 13
  wordValue: 0.1
  result: 0.88
0.741.316
Shouldn't task be issue opening item and specification is pull r…
2.49
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.741.736
I assume this is a permit for task assignee, but where are other…
2.28
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 20
  wordValue: 0.1
  result: 1.28
0.741.596
gotcha, I thought this html is for all users
1.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 9
  wordValue: 0.1
  result: 0.65
0.741.148
I can see from the example that it works correctly but when read…
7.38
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 63
  wordValue: 0.1
  result: 3.38
0.745.18
Ok so we need it for precise floating point calculations, in tha…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.741.484
why is it `ISSUER` which is meant for author of issue/re…
6.1
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 4
regex:
  wordCount: 36
  wordValue: 0.1
  result: 2.1
0.744.284
this makes more sense!
1.32
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 4
  wordValue: 0.1
  result: 0.32
0.740.924
+

 [ 1873.688 WXDAI ] 

@gentlementlegen
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
IssueTask1400
ReviewCode Review2222
IssueSpecification161.8
IssueComment9415.488
ReviewComment25974.4
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
In the v1 of the Ubiquibot, when a result gets evaluated, a reca…
15.45
content:
  content:
    p:
      score: 1
      elementCount: 6
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 87
  wordValue: 0.1
  result: 4.45
1461.8
This needs https://github.com/ubiquity-os/conversation-rewards/p…
5.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 17
  wordValue: 0.2
  result: 2.22
0.8416.704
To me 1 is the most straightforward to do for few reasons:- th…
20.36
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 10
regex:
  wordCount: 104
  wordValue: 0.2
  result: 10.36
0.8465.152
I think each plugin should output JSON not html as it is not rel…
17.53
content:
  content:
    p:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 7
regex:
  wordCount: 106
  wordValue: 0.2
  result: 10.53
0.8456.096
If you want to manipulate and convey data, HTML really is not ma…
17.85
content:
  content:
    p:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 134
  wordValue: 0.2
  result: 12.85
0.8457.12
But then how do we consider the formatting of that output?Prac…
19.87
content:
  content:
    p:
      score: 1
      elementCount: 5
  result: 5
regex:
  wordCount: 159
  wordValue: 0.2
  result: 14.87
0.8463.584
This can work, but we skyrocket coupling and to me defeat purpos…
7.03
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 55
  wordValue: 0.2
  result: 6.03
0.8422.496
@pavlovcik To mitigate that that's why inside the comment reward…
10.73
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 85
  wordValue: 0.2
  result: 8.73
0.8434.336
I realized that to carry this task properly we need to handle fl…
9.31
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 58
  wordValue: 0.2
  result: 6.31
0.8429.792
Agreed, I think currently there are 3 possible things to annotat…
21.94
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 3
    code:
      score: 1
      elementCount: 7
  result: 16
regex:
  wordCount: 54
  wordValue: 0.2
  result: 5.94
0.8470.208
Resolves #5 Depends on #8 Reviews looks gigantic but it's on…
3
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 19
  wordValue: 0
  result: 0
0.740
I think in this case it makes sense because this function will r…
12.49
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 4
  result: 6
regex:
  wordCount: 60
  wordValue: 0.2
  result: 6.49
0.7469.944
It is supposed to represent a comment. Would you prefer a descri…
4.11
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 16
  wordValue: 0.2
  result: 2.11
0.7423.016
True, just picked this up from the previous codebase. https://rp…
4
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 15
  wordValue: 0.2
  result: 2
0.7422.4
Seems convoluted to me and I don't know what problem that solved…
7.6
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 40
  wordValue: 0.2
  result: 4.6
0.7442.56
Changed `COMMENT` to `COMMENTED`, added jsdoc de…
6.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 5
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7435.952
Simply makes the docs linking the code within the comment, for c…
8.01
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 34
  wordValue: 0.2
  result: 4.01
0.7444.856
In the case of a string it would coerce the value and you would …
4.09
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7422.904
`observe` would help to chose what we want to include an…
7.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 41
  wordValue: 0.2
  result: 4.7
0.7443.12
Not very useful indeed. I am working on the tests on a separate …
6.4
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 28
  wordValue: 0.2
  result: 3.4
0.7435.84
See https://github.com/ubiquity-os/conversation-rewards/pull/14 …
3.17
content:
  content:
    p:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 8
  wordValue: 0.2
  result: 1.17
0.7417.752
Good point, also symbol should not be DAI but ETH isn't it? …
8.5
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 39
  wordValue: 0.2
  result: 4.5
0.7447.6
Had changed it everywhere else but here, now it should be fine
2.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 12
  wordValue: 0.2
  result: 1.65
0.7414.84
This matches any whitespace character (spaces, tabs, line breaks…
4.91
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 33
  wordValue: 0.2
  result: 3.91
0.7427.496
By definition `dump` was just outputting results to stdo…
9.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 68
  wordValue: 0.2
  result: 7.22
0.7451.632
Un-nested them one level. I think that the `buildXrow` s…
5.09
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 25
  wordValue: 0.2
  result: 3.09
0.7428.504
I assumed BigInt only handles integers, and we manipulate a lot …
3.98
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.2
  result: 2.98
0.7422.288
There is one permit generated per participating user, last run:…
4.42
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 10
  wordValue: 0.2
  result: 1.42
0.7424.752
I made it according to the previous version:- Issue Specificat…
12.7
content:
  content:
    p:
      score: 1
      elementCount: 5
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 31
  wordValue: 0.2
  result: 3.7
0.7471.12
Wouldn't that lead to precision loss in JS and after the divisio…
5.6
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 30
  wordValue: 0.2
  result: 3.6
0.7431.36
That is correct. I understand now why you're confused:The valu…
21.95
content:
  content:
    p:
      score: 1
      elementCount: 8
    code:
      score: 1
      elementCount: 7
  result: 15
regex:
  wordCount: 65
  wordValue: 0.2
  result: 6.95
0.74122.92
I don't think is it relevant in this scenario because we are not…
6.37
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 48
  wordValue: 0.2
  result: 5.37
0.7435.672
@whilefoo you are correct, these were wrongly used. I corrected …
16.28
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 5
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 47
  wordValue: 0.2
  result: 5.28
0.7491.168
Example of successful comment posting with results:https://git…
4.05
content:
  content:
    p:
      score: 1
      elementCount: 2
    a:
      score: 1
      elementCount: 1
  result: 3
regex:
  wordCount: 7
  wordValue: 0.2
  result: 1.05
0.7422.68
@0x4007 I believe that if I had all the tests in this PR it will…
4.29
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 27
  wordValue: 0.2
  result: 3.29
0.7424.024

 [ 544.356 WXDAI ] 

@0x4007
⚠️ Your rewards have been limited to the task price of 400 WXDAI.
Contributions Overview
ViewContributionCountReward
ReviewCode Review1616
IssueComment9341.568
ReviewComment23186.788
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
@whilefoo rfc on how we can deal with comment outputs. Perhaps w…
4.64
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 47
  wordValue: 0.1
  result: 2.64
0.8414.848
I think you should fork from and overtake that second pull due t…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.846.752
I think the most pure architecture would be that plugins can NOT…
24.21
content:
  content:
    p:
      score: 1
      elementCount: 7
    ul:
      score: 1
      elementCount: 1
    li:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 12
regex:
  wordCount: 285
  wordValue: 0.1
  result: 12.21
0.8477.472
I know JSON makes things more complicated than it needs to be wi…
16.43
content:
  content:
    p:
      score: 1
      elementCount: 4
    code:
      score: 1
      elementCount: 4
    a:
      score: 1
      elementCount: 1
  result: 9
regex:
  wordCount: 159
  wordValue: 0.1
  result: 7.43
0.8452.576
Going back to my "plugin-side-rendering" mention, the data manip…
13.22
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 5
    pre:
      score: 0
      elementCount: 1
  result: 7
regex:
  wordCount: 129
  wordValue: 0.1
  result: 6.22
0.8442.304
The proposed `comment` output is intended for ease of co…
20.57
content:
  content:
    p:
      score: 1
      elementCount: 6
    code:
      score: 1
      elementCount: 3
    h3:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    a:
      score: 1
      elementCount: 1
  result: 11
regex:
  wordCount: 214
  wordValue: 0.1
  result: 9.57
0.8465.824
I understand your concern and I would need to put more thought i…
12.93
content:
  content:
    p:
      score: 1
      elementCount: 5
    code:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 2
  result: 8
regex:
  wordCount: 98
  wordValue: 0.1
  result: 4.93
0.8441.376
I see, so you're suggesting that we must annotate each comment a…
9.88
content:
  content:
    p:
      score: 1
      elementCount: 1
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 4
  result: 5
regex:
  wordCount: 97
  wordValue: 0.1
  result: 4.88
0.8431.616
Consider calling it "contributor" and "collaborator" as that is …
2.75
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 29
  wordValue: 0.1
  result: 1.75
0.848.8
Nice code quality per usual
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
"Comment" implication isn't clear to me
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
I've always been anti empty string for variable declarations. It…
3.73
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 49
  wordValue: 0.1
  result: 2.73
0.7410.444
Our RPCs don't work anymore
1.46
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.744.088
Yes consider changing them to verbs `ISSUER``COMME…
4.7
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.7413.16
`[].join("");` yields an empty string as well if there's…
2.94
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.748.232
Perhaps it will make the config more expressive if you add other…
3.49
content:
  content:
    p:
      score: 1
      elementCount: 1
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.749.772
What is this @link syntax
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
Just noticed the bit wise operators 1337 code
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
It might seem convoluted but I think that it condenses the logic…
7.48
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 3
    pre:
      score: 0
      elementCount: 1
  result: 4
regex:
  wordCount: 65
  wordValue: 0.1
  result: 3.48
0.7420.944
I am aware of its purpose. I am proposing to make the config mor…
2.44
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 23
  wordValue: 0.1
  result: 1.44
0.746.832
Will you use array syntax?
1.39
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.743.892
This regex appears to convert repeating spaces i.e. `" "&#…
4.22
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 19
  wordValue: 0.1
  result: 1.22
0.7411.816
This doesn't seem right. Network ID 1 is mainnet. The RPC clearl…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.747.112
Seems like not a very useful mock.
1.52
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 7
  wordValue: 0.1
  result: 0.52
0.744.256
Same here
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
The token address indeed represents DAI on mainnet.
1.59
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.744.452
@gentlementlegen rfc
1.18
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 2
  wordValue: 0.1
  result: 0.18
0.743.304
Why not do it in the industry standard way? All values are denom…
4.8
content:
  content:
    p:
      score: 1
      elementCount: 1
    code:
      score: 1
      elementCount: 2
  result: 3
regex:
  wordCount: 30
  wordValue: 0.1
  result: 1.8
0.7413.44
I'm not sure if I understand but task reward is if you completed…
3.35
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 41
  wordValue: 0.1
  result: 2.35
0.749.38
Spoke a bit on this in dms. @whilefoo my intent with referring t…
8.05
content:
  content:
    p:
      score: 1
      elementCount: 3
  result: 3
regex:
  wordCount: 101
  wordValue: 0.1
  result: 5.05
0.7422.54
Possibly. I personally haven't had that issue but either way my …
2.7
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.747.56
I think it's fine. I generally scrutinize test code less than no…
2.06
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 16
  wordValue: 0.1
  result: 1.06
0.745.768

 [ 68.336 WXDAI ] 

@whilefoo
Contributions Overview
ViewContributionCountReward
ReviewBase Review125
ReviewCode Review77
IssueComment113.6
ReviewComment1122.736
Review Details
ChangesPriorityReward
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
+50 -5011
Conversation Incentives
CommentFormattingRelevancePriorityReward
there are a couple of options:1. we let the conversation-rewar…
16.99
content:
  content:
    p:
      score: 1
      elementCount: 6
    ol:
      score: 0
      elementCount: 1
    li:
      score: 1
      elementCount: 3
  result: 9
regex:
  wordCount: 173
  wordValue: 0.1
  result: 7.99
0.8413.6
```suggestionreturn result;```…
2.94
content:
  content:
    pre:
      score: 0
      elementCount: 1
    code:
      score: 1
      elementCount: 1
    p:
      score: 1
      elementCount: 1
  result: 2
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.742.072
I'm not sure if it's a good idea to rely on logs for testing, is…
2.54
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.741.792
why so many nested functions? it becomes hard to read
1.71
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 10
  wordValue: 0.1
  result: 0.71
0.741.204
is there a reason we are using Decimal.js instead of native BigI…
1.88
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 13
  wordValue: 0.1
  result: 0.88
0.741.316
Shouldn't task be issue opening item and specification is pull r…
2.49
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.741.736
I assume this is a permit for task assignee, but where are other…
2.28
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 20
  wordValue: 0.1
  result: 1.28
0.741.596
gotcha, I thought this html is for all users
1.65
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 9
  wordValue: 0.1
  result: 0.65
0.741.148
I can see from the example that it works correctly but when read…
7.38
content:
  content:
    p:
      score: 1
      elementCount: 3
    a:
      score: 1
      elementCount: 1
  result: 4
regex:
  wordCount: 63
  wordValue: 0.1
  result: 3.38
0.745.18
Ok so we need it for precise floating point calculations, in tha…
2.11
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.741.484
why is it `ISSUER` which is meant for author of issue/re…
6.1
content:
  content:
    p:
      score: 1
      elementCount: 2
    code:
      score: 1
      elementCount: 2
  result: 4
regex:
  wordCount: 36
  wordValue: 0.1
  result: 2.1
0.744.284
this makes more sense!
1.32
content:
  content:
    p:
      score: 1
      elementCount: 1
  result: 1
regex:
  wordCount: 4
  wordValue: 0.1
  result: 0.32
0.740.924