Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions reviewer-expertise-credential-guard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Reviewer Expertise Credential Guard

This module adds a focused community reputation guard for trusted reviewer expertise credentials.

It evaluates whether a reviewer should receive weighted assignment credit or trusted-reviewer badge eligibility by checking declared expertise, evidence-backed domains, method credentials, evidence freshness, review history, conflicts of interest, and anonymous-review redaction.

## Run

```sh
node reviewer-expertise-credential-guard/test.js
node reviewer-expertise-credential-guard/demo.js
```

The demo writes JSON and Markdown reviewer artifacts to `reviewer-expertise-credential-guard/reports/`.

## Review Surface

The implementation is dependency-free, uses synthetic data only, and does not call external APIs or read credentials.
19 changes: 19 additions & 0 deletions reviewer-expertise-credential-guard/acceptance-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Acceptance Notes

## Validation

- `node reviewer-expertise-credential-guard/test.js`
- `node reviewer-expertise-credential-guard/demo.js`
- `node --check reviewer-expertise-credential-guard/index.js`
- `node --check reviewer-expertise-credential-guard/test.js`
- `node --check reviewer-expertise-credential-guard/demo.js`
- `ffprobe -v error -show_entries format=duration,size -show_entries stream=codec_name,width,height -of default=noprint_wrappers=1 reviewer-expertise-credential-guard/demo.mp4`

## Acceptance Coverage

- Current domain and method evidence can make a reviewer trusted-reviewer eligible.
- Missing domain evidence lowers review weight and requires steward review.
- Conflicts block weighted assignment credit.
- Stale credentials require refresh before trusted badge elevation.
- Anonymous review mode redacts display name and ORCID from public profiles.
- The output audit digest is deterministic for reviewer replay.
100 changes: 100 additions & 0 deletions reviewer-expertise-credential-guard/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
const fs = require("fs");
const path = require("path");
const { evaluateReviewerExpertiseCredentials } = require("./index");

const outputDir = path.join(__dirname, "reports");
fs.mkdirSync(outputDir, { recursive: true });

const packet = {
now: "2026-06-01T12:00:00Z",
maxEvidenceAgeDays: 730,
minimumAcceptedReviews: 3,
reviewers: [
{
id: "reviewer-ada",
displayName: "Ada Reviewer",
orcid: "0000-0002-1825-0097",
institution: "open-science-lab",
declaredDomains: ["proteomics", "machine-learning"],
declaredMethods: ["bayesian-modeling", "mass-spectrometry"],
acceptedReviews: 16,
evidence: [
{ type: "domain", domains: ["proteomics"], issuedAt: "2026-01-15T00:00:00Z", sourceId: "orcid-work-proteomics" },
{ type: "domain", domains: ["machine-learning"], issuedAt: "2026-02-10T00:00:00Z", sourceId: "grant-ml" },
{ type: "method", methods: ["bayesian-modeling"], issuedAt: "2026-03-01T00:00:00Z", sourceId: "review-method" },
],
conflicts: [],
},
{
id: "reviewer-byron",
displayName: "Byron Reviewer",
institution: "northbridge-university",
declaredDomains: ["materials-science"],
declaredMethods: ["density-functional-theory"],
acceptedReviews: 2,
evidence: [{ type: "domain", domains: ["materials-science"], issuedAt: "2023-01-10T00:00:00Z", sourceId: "publication-old" }],
conflicts: [{ authorId: "author-lin", type: "recent-coauthor" }],
},
],
assignments: [
{
id: "assign-protein",
manuscriptId: "ms-protein-forecast",
projectId: "project-protein",
reviewerId: "reviewer-ada",
requiredDomains: ["proteomics", "machine-learning"],
requiredMethods: ["bayesian-modeling"],
anonymousMode: true,
authorIds: ["author-lin"],
institutions: ["northbridge-university"],
},
{
id: "assign-materials",
manuscriptId: "ms-materials-benchmark",
projectId: "project-materials",
reviewerId: "reviewer-byron",
requiredDomains: ["materials-science"],
requiredMethods: ["electron-microscopy"],
anonymousMode: false,
authorIds: ["author-lin"],
institutions: ["northbridge-university"],
},
],
};

const report = evaluateReviewerExpertiseCredentials(packet);
const jsonPath = path.join(outputDir, "reviewer-expertise-credential-report.json");
const markdownPath = path.join(outputDir, "reviewer-expertise-credential-report.md");

fs.writeFileSync(jsonPath, JSON.stringify(report, null, 2));
fs.writeFileSync(
markdownPath,
[
"# Reviewer Expertise Credential Guard Demo",
"",
`Decision: ${report.decision}`,
`Audit digest: ${report.auditDigest}`,
"",
"## Assignment Decisions",
"",
...report.assignments.map(
(assignment) =>
`- ${assignment.assignmentId}: ${assignment.decision}; badge ${assignment.badge}; weight ${assignment.reviewWeight}`,
),
"",
"## Findings",
"",
...report.assignments.flatMap((assignment) =>
assignment.findings.map((finding) => `- ${assignment.assignmentId}: ${finding.severity} ${finding.code} - ${finding.message}`),
),
"",
"## Public Profiles",
"",
...report.assignments.map((assignment) => `- ${assignment.assignmentId}: ${JSON.stringify(assignment.publicProfile)}`),
"",
].join("\n"),
);

console.log(`Wrote ${jsonPath}`);
console.log(`Wrote ${markdownPath}`);
console.log(`${report.decision}: ${report.counts.findings} finding(s), ${report.auditDigest}`);
Binary file added reviewer-expertise-credential-guard/demo.mp4
Binary file not shown.
27 changes: 27 additions & 0 deletions reviewer-expertise-credential-guard/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading