@reworkdigital.io/rework-proof-mcp 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,6 +29,7 @@ No API key. No account. Every tool here reads public endpoints.
29
29
  | `verify_rework_credential` | Checks a VC-JWT's signature and returns the issuer, the subject, and the ceiling on what the credential proves. |
30
30
  | `get_rework_issuer_keys` | Fetches REWORK's public JWKS so you can verify offline yourself instead of trusting this server. |
31
31
  | `explain_rework_assurance` | Explains what an assurance level proves and what it explicitly does not. |
32
+ | `lookup_rework_attestation` | Checks whether REWORK actually *issued* a credential — a forged-but-well-formed token fails this — and returns the current OpenTimestamps receipt, which may have been upgraded to a Bitcoin confirmation since issue. The credential is hashed locally; it never leaves your machine. |
32
33
 
33
34
  ### Why the verdict ships with a caveat
34
35
 
@@ -40,6 +41,35 @@ vouched for who wrote the commits — it says nothing about whether the code
40
41
  works or is any good. Returning the verdict without its ceiling would invite
41
42
  exactly that misreading, so the ceiling travels with it.
42
43
 
44
+ The ceilings are read at runtime from [`src/assurance.json`](src/assurance.json),
45
+ the one file every REWORK surface renders them from:
46
+
47
+ <!-- rework-assurance:begin -->
48
+ **Workflow identity** (`workflow-identity`), moderate: strong on identity, silent on quality
49
+
50
+ Proves: GitHub cryptographically vouched that a specific workflow run belongs to a specific repository and commit, and REWORK recorded the authorship signals that run observed: commit signature state, whether each commit resolves to the pull request author, and how many commit messages declared AI assistance.
51
+
52
+ Does not prove: Nobody reviewed the code, ran it, or judged its quality. It does not say the work is good, only who the git history says wrote it. The AI count is what authors declared in commit messages: a zero means nothing was declared, not that no tool was used.
53
+
54
+ **Reviewed reference** (`reviewed-reference`), moderate: human-checked, but of a demonstration rather than the artefact
55
+
56
+ Proves: A REWORK reviewer watched a demonstration video and confirmed it corresponds to the claimed work, and the video is fingerprinted so reuse is detectable.
57
+
58
+ Does not prove: The reviewer did not audit the source, reproduce the result, or verify claims made verbally in the video.
59
+
60
+ **Cross-platform join** (`cross-platform-join`), moderate: strong on which bytes landed where and who controls both ends, silent on how they were made
61
+
62
+ Proves: The exact bytes named by a manifest digest were present in the named Hugging Face repository, at the named commit, immediately after the named GitHub Actions run, confirmed by REWORK's own independent read of the Hub; and one REWORK account holds both the App installation on the GitHub repository's owner and a verified write-control claim on the Hugging Face repository.
63
+
64
+ Does not prove: It does not prove that the workflow produced, trained, or evaluated the content. A run that downloads someone else's files and uploads them also carries bytes. Read the workflow reference to judge what the run actually did.
65
+ <!-- rework-assurance:end -->
66
+
67
+ `explain_rework_assurance` also returns `ai_declaration`: which commit-message
68
+ trailers count as declared AI assistance (read from
69
+ [`src/ai-trailers.json`](src/ai-trailers.json), the same list the Action and
70
+ the App check use). A declared count of zero means no message declared a
71
+ tool; it never means no tool was used.
72
+
43
73
  ## Zero dependencies, on purpose
44
74
 
45
75
  The whole server is one file: [`src/index.js`](src/index.js). MCP's stdio
@@ -66,7 +96,7 @@ is a convenience, not an authority.
66
96
 
67
97
  ## Related
68
98
 
69
- - [REWORK Proof Check](https://github.com/Reworkdigital-io/REWORK-Proof) — the
99
+ - [REWORK Proof Check](https://github.com/reworkio/REWORK-Proof) — the
70
100
  GitHub Action that produces these attestations from a CI run.
71
101
  - [REWORK Proof App](https://github.com/apps/rework-proof) — the same
72
102
  verification posted automatically as a check run on every pull request.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reworkdigital.io/rework-proof-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "MCP server for verifying REWORK credentials — check whether delivered work is genuinely the author's.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/Reworkdigital-io/REWORK-Proof.git",
21
+ "url": "git+https://github.com/reworkio/REWORK-Proof.git",
22
22
  "directory": "mcp"
23
23
  },
24
24
  "homepage": "https://reworkdigital.io/proofs",
@@ -0,0 +1,120 @@
1
+ {
2
+ "$comment": "The one definition of what counts as a DECLARED AI assistant in a commit message. Every runtime that reads commit messages for REWORK Proof loads this file and nothing else, so a commit reads the same from the Action, the App and the MCP server. Each `tools[].pattern` is a regular expression fragment written in the subset that JavaScript and Python evaluate identically: no lookbehind, no named groups, no flags inline. Matching is always case-insensitive. `patterns` are tried in order and the first hit is the verdict; `{{tools}}` expands to the alternation of every tool pattern. A match means the author DECLARED the tool in the message. No match means nothing was declared; it never means nothing was used.",
3
+ "version": 1,
4
+ "tools": [
5
+ {
6
+ "name": "Claude",
7
+ "pattern": "\\bClaude\\b|noreply@anthropic\\.com",
8
+ "example": "Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>",
9
+ "evidence": "observed"
10
+ },
11
+ {
12
+ "name": "GitHub Copilot",
13
+ "pattern": "\\bCopilot\\b|copilot@github\\.com",
14
+ "example": "Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>",
15
+ "evidence": "observed"
16
+ },
17
+ {
18
+ "name": "OpenAI Codex / ChatGPT / GPT",
19
+ "pattern": "\\bCodex\\b|\\b(?:Chat)?GPT\\b|\\bGPT-[0-9]|@openai\\.com",
20
+ "example": "Co-authored-by: Codex <codex@openai.com>",
21
+ "evidence": "observed"
22
+ },
23
+ {
24
+ "name": "Gemini",
25
+ "pattern": "\\bGemini\\b|gemini-cli",
26
+ "example": "Co-Authored-By: Gemini <noreply@google.com>",
27
+ "evidence": "observed"
28
+ },
29
+ {
30
+ "name": "Cursor",
31
+ "pattern": "\\bCursor\\b|@cursor\\.com",
32
+ "example": "Co-authored-by: Cursor Agent <cursoragent@cursor.com>",
33
+ "evidence": "observed"
34
+ },
35
+ {
36
+ "name": "Devin",
37
+ "pattern": "devin-ai-integration|devin@cognition|\\bDevin AI\\b",
38
+ "example": "Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>",
39
+ "evidence": "observed",
40
+ "note": "Devin is also a common first name, so a bare `Devin` is not enough: the vendor login or address has to be there."
41
+ },
42
+ {
43
+ "name": "Aider",
44
+ "pattern": "\\baider\\b|@aider\\.chat",
45
+ "example": "Co-authored-by: aider (gpt-5.4) <aider@aider.chat>",
46
+ "evidence": "observed"
47
+ },
48
+ {
49
+ "name": "Windsurf",
50
+ "pattern": "\\bWindsurf\\b|windsurf-bot|@codeium\\.com",
51
+ "example": "Co-authored-by: windsurf-bot[bot] <189301087+windsurf-bot[bot]@users.noreply.github.com>",
52
+ "evidence": "observed"
53
+ },
54
+ {
55
+ "name": "Cline",
56
+ "pattern": "cline-cloud|@cline\\.bot|\\bCline\\s+(?:Bot|AI)\\b",
57
+ "example": "Co-authored-by: Cline <noreply@cline.bot>",
58
+ "evidence": "observed",
59
+ "note": "Cline is also a surname (a `Patsy Cline <patsy@example.com>` co-author is a person), so the word alone never counts: only the vendor address or login does."
60
+ },
61
+ {
62
+ "name": "Jules",
63
+ "pattern": "google-labs-jules|jules@google",
64
+ "example": "Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>",
65
+ "evidence": "observed",
66
+ "note": "Jules is also a first name; only the vendor login or address counts."
67
+ },
68
+ {
69
+ "name": "Amp",
70
+ "pattern": "\\bAmp\\b(?=\\s*(?:<|\\())|@ampcode\\.com",
71
+ "example": "Co-authored-by: Amp <amp@ampcode.com>",
72
+ "evidence": "observed"
73
+ },
74
+ {
75
+ "name": "Augment",
76
+ "pattern": "\\bAugment(?:\\s*Code|\\s*Agent)?\\b|@augmentcode\\.com",
77
+ "example": "Co-authored-by: Augment <noreply@augmentcode.com>",
78
+ "evidence": "observed"
79
+ },
80
+ {
81
+ "name": "Kiro",
82
+ "pattern": "\\bKiro\\b(?=\\s*(?:<|\\())|@kiro\\.dev",
83
+ "example": "Co-Authored-By: Kiro <noreply@kiro.dev>",
84
+ "evidence": "observed"
85
+ },
86
+ {
87
+ "name": "SWE-agent",
88
+ "pattern": "\\bSWE-agent\\b",
89
+ "example": "Co-authored-by: SWE-agent <swe-agent@example.invalid>",
90
+ "evidence": "assumed"
91
+ }
92
+ ],
93
+ "patterns": [
94
+ {
95
+ "id": "co-authored-by",
96
+ "what": "A Co-authored-by trailer naming one of the tools above, in any casing (`Co-Authored-By`, `Co-authored-by`, `co-authored-by`).",
97
+ "regex": "Co-?authored-?by:[^\\n]*?(?:{{tools}})"
98
+ },
99
+ {
100
+ "id": "claude-session",
101
+ "what": "The `Claude-Session:` trailer Claude Code writes beside its co-author line.",
102
+ "regex": "(?:^|\\n)[ \\t]*Claude-Session:[ \\t]*\\S+"
103
+ },
104
+ {
105
+ "id": "amp-thread-id",
106
+ "what": "The `Amp-Thread-ID:` trailer Amp writes beside its co-author line.",
107
+ "regex": "(?:^|\\n)[ \\t]*Amp-Thread-ID:[ \\t]*\\S+"
108
+ },
109
+ {
110
+ "id": "generated-with",
111
+ "what": "A `Generated with <tool>` or `Generated by <tool>` line, with or without a markdown link around the tool name. `Regenerated with build.js` is a human sentence about a script and does not count.",
112
+ "regex": "\\bGenerated\\s+(?:with|by)\\s+\\[?(?:{{tools}})"
113
+ },
114
+ {
115
+ "id": "robot-generated",
116
+ "what": "The robot-emoji form, `🤖 Generated ...`, which some tools write without naming themselves on the same line.",
117
+ "regex": "🤖\\s*Generated"
118
+ }
119
+ ]
120
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$comment": "The one statement of what a REWORK assurance level proves and what it does not. The MCP server reads this file at runtime for explain_rework_assurance and for the assurance_note on every verified credential; the Action README and the reworkdigital.io/github page render the same text, and a published check fails the build when any rendered copy drifts from this file. Edit here, nowhere else.",
3
+ "levels": {
4
+ "workflow-identity": {
5
+ "title": "Workflow identity",
6
+ "means": "GitHub cryptographically vouched that a specific workflow run belongs to a specific repository and commit, and REWORK recorded the authorship signals that run observed: commit signature state, whether each commit resolves to the pull request author, and how many commit messages declared AI assistance.",
7
+ "does_not_mean": "Nobody reviewed the code, ran it, or judged its quality. It does not say the work is good, only who the git history says wrote it. The AI count is what authors declared in commit messages: a zero means nothing was declared, not that no tool was used.",
8
+ "strength": "moderate: strong on identity, silent on quality"
9
+ },
10
+ "reviewed-reference": {
11
+ "title": "Reviewed reference",
12
+ "means": "A REWORK reviewer watched a demonstration video and confirmed it corresponds to the claimed work, and the video is fingerprinted so reuse is detectable.",
13
+ "does_not_mean": "The reviewer did not audit the source, reproduce the result, or verify claims made verbally in the video.",
14
+ "strength": "moderate: human-checked, but of a demonstration rather than the artefact"
15
+ },
16
+ "cross-platform-join": {
17
+ "title": "Cross-platform join",
18
+ "means": "The exact bytes named by a manifest digest were present in the named Hugging Face repository, at the named commit, immediately after the named GitHub Actions run, confirmed by REWORK's own independent read of the Hub; and one REWORK account holds both the App installation on the GitHub repository's owner and a verified write-control claim on the Hugging Face repository.",
19
+ "does_not_mean": "It does not prove that the workflow produced, trained, or evaluated the content. A run that downloads someone else's files and uploads them also carries bytes. Read the workflow reference to judge what the run actually did.",
20
+ "strength": "moderate: strong on which bytes landed where and who controls both ends, silent on how they were made"
21
+ }
22
+ },
23
+ "reads": [
24
+ {
25
+ "title": "Signatures, from GitHub rather than from the commit.",
26
+ "body": "A commit's author line is free text that anyone can set. The check reads GitHub's own verification result and the account-resolved author login instead, which is what closes the gap between \"it says your name\" and \"it is yours\"."
27
+ },
28
+ {
29
+ "title": "Declared AI assistance, counted and not penalised.",
30
+ "body": "A commit message that names a coding assistant (a Co-authored-by trailer, a Generated-with line) is recorded as something the author chose to declare. That is a good sign, not a flag, and it never lowers the result. The check reads messages, not keystrokes: \"none declared\" means none was declared, not that none was used."
31
+ },
32
+ {
33
+ "title": "It re-checks after the day it passed.",
34
+ "body": "A repository can be renamed, made private, or deleted long after a proof was verified. A nightly sweep re-reads what each GitHub proof points at and marks the ones whose evidence moved, so a proof ages into \"stale\" rather than into a quiet lie."
35
+ },
36
+ {
37
+ "title": "It never fails an honest repository.",
38
+ "body": "There is no red state. The check reports what it saw; it does not grade a pull request, and nothing here can leave a mark on someone else's work."
39
+ }
40
+ ]
41
+ }
package/src/index.js CHANGED
@@ -19,11 +19,23 @@
19
19
 
20
20
  'use strict';
21
21
 
22
+ const crypto = require('node:crypto');
23
+ const fs = require('node:fs');
24
+ const path = require('node:path');
25
+
22
26
  const API = (process.env.REWORK_API_URL || 'https://api.reworkdigital.io/api/v1').replace(/\/$/, '');
23
- const SERVER_VERSION = '1.0.0';
24
27
 
25
- // Protocol revisions this server understands. We echo the client's if we know
26
- // it, otherwise answer with our newest and let the client decide.
28
+ const readJson = (name) => JSON.parse(fs.readFileSync(path.join(__dirname, name), 'utf8'));
29
+
30
+ // The version a client sees in serverInfo is package.json's, read at start,
31
+ // so it cannot drift from what npm published. It was a typed '1.0.0' while
32
+ // the package was 1.1.0 (found 2026-10-18); check_rework_proof_mcp.py pins
33
+ // this now. package.json sits one level up from src/, inside the tarball.
34
+ const SERVER_VERSION = readJson('../package.json').version;
35
+
36
+ // Protocol revisions this server understands. The client's own revision is
37
+ // echoed back when it appears here; otherwise the newest is offered and the
38
+ // client decides whether it can proceed.
27
39
  const SUPPORTED_PROTOCOLS = ['2025-06-18', '2025-03-26', '2024-11-05'];
28
40
  const HTTP_TIMEOUT_MS = 15000;
29
41
 
@@ -31,35 +43,36 @@ const log = (...a) => process.stderr.write(a.join(' ') + '\n');
31
43
 
32
44
  /**
33
45
  * What REWORK's assurance levels mean, and — more importantly — what they do
34
- * not. Held locally rather than fetched: an agent asking "how much does this
35
- * prove?" should get the same answer when the API is unreachable, and the
36
- * honest ceiling on a claim is not something to look up over the network.
46
+ * not. Read from `assurance.json` beside this file rather than fetched: an
47
+ * agent asking "how much does this prove?" should get the same answer when
48
+ * the API is unreachable, and the honest ceiling on a claim is not something
49
+ * to look up over the network. The same file is what the Action README and
50
+ * the reworkdigital.io/github page render, so every surface states one
51
+ * ceiling.
37
52
  */
38
- const ASSURANCE = {
39
- 'workflow-identity': {
40
- means:
41
- 'GitHub cryptographically vouched that a specific workflow run belongs to a '
42
- + 'specific repository and commit, and REWORK recorded the authorship signals '
43
- + 'that run observed (commit signature state, whether commits resolve to the '
44
- + 'PR author, disclosed AI assistance).',
45
- does_not_mean:
46
- 'Nobody reviewed the code, ran it, or judged its quality. It does not say the '
47
- + 'work is good, only who the git history says wrote it.',
48
- strength: 'moderate — strong on identity, silent on quality',
49
- },
50
- 'reviewed-reference': {
51
- means:
52
- 'A REWORK reviewer watched a demonstration video and confirmed it corresponds '
53
- + 'to the claimed work, and the video is fingerprinted so reuse is detectable.',
54
- does_not_mean:
55
- 'The reviewer did not audit the source, reproduce the result, or verify claims '
56
- + 'made verbally in the video.',
57
- strength: 'moderate — human-checked, but of a demonstration rather than the artefact',
58
- },
53
+ const ASSURANCE_SPEC = readJson('assurance.json');
54
+ const ASSURANCE = ASSURANCE_SPEC.levels;
55
+
56
+ /**
57
+ * Which commit-message declarations the checks count as AI assistance, from
58
+ * `ai-trailers.json`: the same definition the Action and the App check read.
59
+ * Listed in the explanation so an agent knows what "declared" means here. A
60
+ * declaration is something the author wrote; a count of zero means nothing
61
+ * was declared, never that no tool was used.
62
+ */
63
+ const AI_TRAILERS = readJson('ai-trailers.json');
64
+ const AI_DECLARATION = {
65
+ reads: 'Commit messages only: a Co-authored-by trailer naming one of the tools below, a '
66
+ + 'Claude-Session or Amp-Thread-ID trailer, or a "Generated with" line.',
67
+ tools: AI_TRAILERS.tools.map((t) => t.name),
68
+ zero_means: 'No commit message declared a tool. It does not mean no tool was used; a '
69
+ + 'message with no trailer looks the same either way.',
70
+ declared_means: 'The author chose to say so. It is reported as a fact and never lowers a result.',
59
71
  };
60
72
 
61
73
  const CREDENTIAL_TYPES = {
62
74
  REWORKWorkflowAttestation: 'A CI run whose repository identity GitHub attested via OIDC.',
75
+ REWORKHfJoinedPublication: 'A Hugging Face publication joined to the CI run that preceded it, confirmed by REWORK\'s own read of the Hub.',
63
76
  REWORKProofOfWorkCredential: 'A submitted piece of work that passed REWORK verification.',
64
77
  REWORKVideoProvenanceReceipt: 'A reviewed demonstration video, fingerprinted against reuse.',
65
78
  REWORKReputationPassport: "A holder's full verified history in one signed credential.",
@@ -113,6 +126,29 @@ const TOOLS = [
113
126
  additionalProperties: false,
114
127
  },
115
128
  },
129
+ {
130
+ name: 'lookup_rework_attestation',
131
+ description:
132
+ 'Check whether REWORK actually ISSUED a credential - not just whether its '
133
+ + 'signature verifies. A forged-but-well-formed token fails this; a real one '
134
+ + 'returns its issuance record and the CURRENT OpenTimestamps receipt, which '
135
+ + 'may have been upgraded to a Bitcoin confirmation since issue. Pass the '
136
+ + 'credential (its sha256 is the lookup key) or the digest directly.',
137
+ inputSchema: {
138
+ type: 'object',
139
+ properties: {
140
+ credential: {
141
+ type: 'string',
142
+ description: 'The VC-JWT. Hashed locally; never sent anywhere.',
143
+ },
144
+ digest: {
145
+ type: 'string',
146
+ description: 'sha256 hex of the credential, if you already have it.',
147
+ },
148
+ },
149
+ additionalProperties: false,
150
+ },
151
+ },
116
152
  ];
117
153
 
118
154
  async function http(path, { method = 'GET', body } = {}) {
@@ -169,9 +205,49 @@ async function callTool(name, args) {
169
205
  if (!entry) {
170
206
  return { error: `unknown assurance level: ${level}`, known: Object.keys(ASSURANCE) };
171
207
  }
172
- return { assurance: level, ...entry };
208
+ return { assurance: level, ...entry, ai_declaration: AI_DECLARATION };
209
+ }
210
+ return {
211
+ assurance_levels: ASSURANCE,
212
+ what_the_check_reads: ASSURANCE_SPEC.reads,
213
+ ai_declaration: AI_DECLARATION,
214
+ credential_types: CREDENTIAL_TYPES,
215
+ };
216
+ }
217
+
218
+ if (name === 'lookup_rework_attestation') {
219
+ let digest = args && args.digest;
220
+ if (!digest && args && args.credential) {
221
+ // Hashed locally: the credential itself never leaves this process.
222
+ digest = crypto.createHash('sha256').update(args.credential, 'utf8').digest('hex');
223
+ }
224
+ if (!digest || !/^[0-9a-f]{64}$/.test(String(digest).toLowerCase())) {
225
+ throw new Error('pass either `credential` (the VC-JWT) or `digest` (64 hex chars)');
226
+ }
227
+ digest = String(digest).toLowerCase();
228
+ try {
229
+ const record = await http(`/github-app/attestations/${digest}`);
230
+ return {
231
+ ...record,
232
+ assurance_note:
233
+ 'Issuance confirms REWORK signed a credential with this digest. It is '
234
+ + 'still not a review of the code or a claim the work is any good - '
235
+ + 'and a "submitted" timestamp is a calendar promise, only "confirmed" '
236
+ + 'means anchored in Bitcoin.',
237
+ };
238
+ } catch (err) {
239
+ if (String(err.message).includes('REWORK API 404')) {
240
+ return {
241
+ issued: false,
242
+ digest_sha256: digest,
243
+ assurance_note:
244
+ 'REWORK has no record of issuing a credential with this digest. A '
245
+ + 'valid signature with no issuance record deserves suspicion: it '
246
+ + 'could predate the registry, or it could be a key compromise.',
247
+ };
248
+ }
249
+ throw err;
173
250
  }
174
- return { assurance_levels: ASSURANCE, credential_types: CREDENTIAL_TYPES };
175
251
  }
176
252
 
177
253
  throw new Error(`unknown tool: ${name}`);