tokens-for-good 0.3.7 → 0.3.9
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/package.json +1 -1
- package/pipeline/01-research/PROMPT.md +4 -3
- package/src/api-client.js +2 -1
- package/src/mcp-server.js +2 -1
package/package.json
CHANGED
|
@@ -66,6 +66,7 @@ Keep the table with all columns. For each of the 20 negative consequences, add a
|
|
|
66
66
|
- When Yes or Partial: include SPECIFIC data (percentages, sample sizes, time periods, study names)
|
|
67
67
|
- Only direct results from this organization, not from other orgs or modeling
|
|
68
68
|
- **CITATION RULES (critical):** Every data point MUST have its own inline citation `[Source Name](URL)`. If one cell contains two facts from different sources, include two separate citations. Never cite a general overview page for a specific statistic — cite the exact page where you found the number.
|
|
69
|
+
- **VERIFY INLINE:** After writing each cell, re-read the source you cited and confirm the exact numbers match. If the source says 75% and you wrote 59%, fix it before moving on. Do not proceed to the next row until the current row's numbers are confirmed against the cited page.
|
|
69
70
|
|
|
70
71
|
#### PROMPT 5 — Counterfactual Results
|
|
71
72
|
|
|
@@ -74,7 +75,7 @@ Keep the table with ALL previous columns. For each of the 20 negative consequenc
|
|
|
74
75
|
- Start each cell with "Yes.", "Partial.", or "No counterfactual results."
|
|
75
76
|
- Describe study design (RCT, quasi-experimental, matched comparison), sample sizes, what the control/comparison group showed
|
|
76
77
|
- Counterfactual = comparison to what would have happened without the intervention. Before/after alone does not count.
|
|
77
|
-
- **Same citation rules as Prompt 4:** every data point gets its own inline citation to the
|
|
78
|
+
- **Same citation and verify-inline rules as Prompt 4:** every data point gets its own inline citation, and confirm numbers match the source before moving to the next row.
|
|
78
79
|
|
|
79
80
|
#### SUMMARY REPORT
|
|
80
81
|
|
|
@@ -134,7 +135,7 @@ These rules are critical for report quality. Poorly attributed citations are the
|
|
|
134
135
|
|
|
135
136
|
3. **If you can't find a URL for a claim, don't include the claim.** No unsourced facts. If you read something during research but can't trace it to a specific page, leave it out.
|
|
136
137
|
|
|
137
|
-
4. **Verify
|
|
138
|
+
4. **Verify numbers match the source exactly.** After writing a claim with a number (percentage, dollar amount, count), re-read the cited page and confirm the exact figure appears there. Common errors: writing 59% when the source says 75%, writing 4,000 when the source says 1,651, or writing 20% when the source says 25%. If your number doesn't match, use the source's number or remove the claim.
|
|
138
139
|
|
|
139
140
|
5. **Attribution matters.** Say "X reports that" when citing an org's own claims. Say "independent evaluation found" when citing third-party evidence. The distinction is load-bearing.
|
|
140
141
|
|
|
@@ -152,7 +153,7 @@ Run these checks before submitting. They are not optional.
|
|
|
152
153
|
|
|
153
154
|
**Citations:**
|
|
154
155
|
- [ ] Every factual claim has its own inline citation
|
|
155
|
-
- [ ] Spot-check at least 5 citations: visit the URL and confirm the page
|
|
156
|
+
- [ ] Spot-check at least 5 citations: visit the URL and confirm the EXACT numbers on the page match what you wrote. If the source says 132% and you wrote 136%, fix it.
|
|
156
157
|
- [ ] For any citation where the page doesn't support your claim, find the correct source or remove the claim
|
|
157
158
|
- [ ] No claims are cited to general overview pages when a specific report or data page exists
|
|
158
159
|
|
package/src/api-client.js
CHANGED
|
@@ -43,13 +43,14 @@ export class ApiClient {
|
|
|
43
43
|
return this.request('POST', '/research/claim', { platform });
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
async submitReport(claimId, reportMarkdown, tokenUsage = null, metrics = null, modelUsed = null) {
|
|
46
|
+
async submitReport(claimId, reportMarkdown, tokenUsage = null, metrics = null, modelUsed = null, promptVersion = null) {
|
|
47
47
|
return this.request('POST', '/research/submit', {
|
|
48
48
|
claim_id: claimId,
|
|
49
49
|
report_markdown: reportMarkdown,
|
|
50
50
|
token_usage: tokenUsage,
|
|
51
51
|
metrics: metrics,
|
|
52
52
|
model_used: modelUsed,
|
|
53
|
+
prompt_version: promptVersion,
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
|
package/src/mcp-server.js
CHANGED
|
@@ -11,6 +11,7 @@ import { fileURLToPath } from 'url';
|
|
|
11
11
|
|
|
12
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
13
|
const PIPELINE_DIR = join(__dirname, '..', 'pipeline');
|
|
14
|
+
const PKG_VERSION = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')).version;
|
|
14
15
|
|
|
15
16
|
const apiKey = process.env.TFG_API_KEY;
|
|
16
17
|
let client;
|
|
@@ -168,7 +169,7 @@ server.tool('submit_report', 'Submit a completed research report for an org you
|
|
|
168
169
|
if (!client) return { content: [{ type: 'text', text: 'Error: TFG_API_KEY not set.' }] };
|
|
169
170
|
|
|
170
171
|
try {
|
|
171
|
-
const result = await client.submitReport(claim_id, report_markdown, null, null, model_used);
|
|
172
|
+
const result = await client.submitReport(claim_id, report_markdown, null, null, model_used, PKG_VERSION);
|
|
172
173
|
markContributed();
|
|
173
174
|
return {
|
|
174
175
|
content: [{ type: 'text', text: `Report submitted for ${result.org_name}!\n\nYour stats:\n- Total orgs: ${result.contributor_stats.total_orgs}\n- Tier: ${result.contributor_stats.tier}\n- Orgs remaining: ${result.orgs_remaining}\n\nYour report will now go through peer review. Thank you for contributing!` }],
|