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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# deepevents.ai
deepevents.ai main codebase

- `credit-attestation-ledger/` adds contributor credit attestation and dispute routing for community reputation workflows.
43 changes: 43 additions & 0 deletions credit-attestation-ledger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Credit Attestation Ledger

This module adds a contributor-credit gate for the community and reputation layer. It validates CRediT-style contribution records, attached evidence, independent attestations, duplicate claims, and active disputes before profile credit or reputation points are released.

It is self-contained and uses only Node built-ins.

## What It Covers

- CRediT role validation for contribution records
- Evidence checks for commits, uploads, reviews, and artifacts
- Attestation strength from project leads, reviewers, collaborators, and self claims
- Duplicate credit claim detection
- Open dispute routing for moderation
- Conflict checks for attestors
- Profile summaries and reputation deltas
- Signed ledger events and deterministic manifest digests

## Run

```sh
npm run check
npm test
npm run demo
```

The demo reads `data/sample-credit-input.json` and prints the credit queue.

## Demo Artifact

- `docs/demo.svg`
- `docs/demo.gif`
- `docs/demo.webm`

## Main API

```js
import {
evaluateCreditLedger,
renderCreditReport
} from "./src/credit-attestation-ledger.js";
```

`evaluateCreditLedger(input)` returns dashboard metrics, ordered credit records, contributor profile summaries, signed events, and a manifest digest.
94 changes: 94 additions & 0 deletions credit-attestation-ledger/data/sample-credit-input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"generatedAt": "2026-05-16T11:10:00.000Z",
"signingKey": "credit-demo-signing-key",
"knownConflicts": [
{
"contributorId": "u-carol",
"attestorId": "u-pi-2",
"reason": "same lab funding line"
}
],
"contributions": [
{
"id": "CR-001",
"contributorId": "u-alex",
"contributorName": "Alex Rivera",
"projectId": "P-CELL-42",
"artifactId": "notebook-rerun-01",
"role": "software",
"timestamp": "2026-05-10T14:00:00.000Z",
"evidence": [
{"type": "commit", "id": "a94df12", "summary": "rerun notebook pipeline"},
{"type": "artifact", "id": "notebook-rerun-01", "summary": "clean execution output"}
],
"attestations": [
{"attestorId": "u-pi-1", "attestorRole": "lead", "statement": "Implemented the rerun script."},
{"attestorId": "u-reviewer-1", "attestorRole": "reviewer", "statement": "Verified the submitted evidence."}
],
"disputes": []
},
{
"id": "CR-002",
"contributorId": "u-bela",
"contributorName": "Bela Chen",
"projectId": "P-CELL-42",
"artifactId": "dataset-clean-02",
"role": "data-curation",
"timestamp": "2026-05-11T09:30:00.000Z",
"evidence": [],
"attestations": [
{"attestorId": "u-bela", "attestorRole": "self", "statement": "Cleaned the dataset."}
],
"disputes": []
},
{
"id": "CR-003",
"contributorId": "u-carol",
"contributorName": "Carol Singh",
"projectId": "P-META-7",
"artifactId": "review-report-3",
"role": "validation",
"timestamp": "2026-05-12T18:20:00.000Z",
"evidence": [
{"type": "review", "id": "RV-88", "summary": "statistical validation notes"}
],
"attestations": [
{"attestorId": "u-pi-2", "attestorRole": "lead", "statement": "Reviewed the validation notes."}
],
"attestorId": "u-pi-2",
"disputes": [
{"id": "DSP-4", "status": "open", "reason": "role claimed by another reviewer"}
]
},
{
"id": "CR-004",
"contributorId": "u-bela",
"contributorName": "Bela Chen",
"projectId": "P-CELL-42",
"artifactId": "dataset-clean-02",
"role": "data-curation",
"timestamp": "2026-05-11T09:35:00.000Z",
"evidence": [
{"type": "artifact", "id": "dataset-clean-02", "summary": "deduplicated data table"}
],
"attestations": [
{"attestorId": "u-reviewer-2", "attestorRole": "reviewer", "statement": "Confirmed curation work."}
],
"disputes": []
},
{
"id": "CR-005",
"contributorId": "u-dev",
"contributorName": "Dev Novak",
"projectId": "P-META-7",
"artifactId": "figure-pack-9",
"role": "figure-polish",
"timestamp": "",
"evidence": [
{"type": "artifact", "id": "figure-pack-9", "summary": "updated figures"}
],
"attestations": [],
"disputes": []
}
]
}
Binary file added credit-attestation-ledger/docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions credit-attestation-ledger/docs/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added credit-attestation-ledger/docs/demo.webm
Binary file not shown.
36 changes: 36 additions & 0 deletions credit-attestation-ledger/docs/requirement-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Requirement Map

Maps this slice to issue #15, Community & User Reputation System.

## Contributor Credits

- Validates timestamped contribution records.
- Supports CRediT-style roles such as software, validation, data curation, and writing.
- Requires evidence records before visible profile credit is released.
- Produces contributor profile summaries with role counts and reputation deltas.

## Peer Validation

- Scores attestations from project leads, reviewers, collaborators, and self claims.
- Routes weak attestations to review instead of awarding automatic reputation.
- Detects conflicted attestations that need an independent reviewer.

## Reputation Scoring

- Releases reputation only for verified credit.
- Holds weak, duplicate, or unsupported claims for moderation.
- Blocks reputation changes while a dispute is active.

## Community Timeline And Moderation

- Detects duplicate credit claims for the same contributor, artifact, project, and role.
- Produces a moderation queue for unresolved disputes and review-needed credits.
- Signs ledger events for audit trails.

## Local Verification

```sh
npm run check
npm test
npm run demo
```
12 changes: 12 additions & 0 deletions credit-attestation-ledger/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "credit-attestation-ledger",
"version": "1.0.0",
"description": "Contributor credit attestation ledger for community reputation workflows.",
"type": "module",
"scripts": {
"check": "node --check src/credit-attestation-ledger.js && node --check scripts/demo.js && node --check test/credit-attestation-ledger.test.js",
"test": "node --test",
"demo": "node scripts/demo.js"
},
"license": "MIT"
}
13 changes: 13 additions & 0 deletions credit-attestation-ledger/scripts/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import path from "node:path";
import {fileURLToPath} from "node:url";
import {
evaluateCreditLedger,
readCreditInput,
renderCreditReport
} from "../src/credit-attestation-ledger.js";

const directory = path.dirname(fileURLToPath(import.meta.url));
const inputPath = path.join(directory, "..", "data", "sample-credit-input.json");
const result = evaluateCreditLedger(readCreditInput(inputPath));

console.log(renderCreditReport(result));
Loading
Loading