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
25 changes: 25 additions & 0 deletions repository-citation-impact-gate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Repository Citation Impact Gate

This submission targets [SCIBASE issue #10](https://github.com/SCIBASE-AI/SCIBASE.AI/issues/10) with a focused module for project repositories and version control.

It models a research repository merge gate that keeps fork attribution, DOI metadata, licenses, component hashes, and reproducibility status connected when a derivative repository is merged back into a project.

## What It Adds

- Deterministic repository manifests for manuscripts, datasets, code, results, and environment descriptors.
- Fork attribution checks so derivative repositories keep parent project citation links.
- License compatibility checks before accepting a merge into a publishable project version.
- Component-level hash diffs with semantic version recommendations.
- Exportable citation impact attestations for downstream DOI, API, or archive systems.

## Demo

```powershell
node repository-citation-impact-gate/demo.js
node repository-citation-impact-gate/test.js
```

`demo.mp4` is the reviewer-facing video artifact for the bounty submission. It walks through the problem, implementation, acceptance path, and command validation in 8.4 seconds. `demo.svg` is a short visual storyboard of the merge gate from incoming fork to export attestation.

See `acceptance-notes.md` for the payout-gate evidence checklist.

31 changes: 31 additions & 0 deletions repository-citation-impact-gate/acceptance-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Acceptance Notes

This is a focused implementation for SCIBASE issue #10, not a generic AI-generated content drop. The module targets one reviewable repository-versioning problem: preserving citation, license, hash, and reproducibility evidence when a fork is merged back into a research project.

## What Changed

- Added deterministic repository manifests for manuscripts, datasets, code, result tables, and environment descriptors.
- Added fork attribution checks so derivative repositories retain parent project citation links.
- Added license compatibility and reproducibility checks before accepting a publishable merge.
- Added component hash diffs with semantic version recommendations.
- Added exportable citation impact attestations for downstream DOI, API, or archive systems.

## Video Demo

- `demo.mp4` shows the problem, implementation, acceptance behavior, and validation command.
- `demo.svg` provides a static storyboard of the merge gate.

## Validation

Run from the repository root:

```powershell
node repository-citation-impact-gate/test.js
node repository-citation-impact-gate/demo.js
```

Expected result: the test prints `repository-citation-impact-gate tests passed`, and the demo prints release decisions, version recommendations, component diffs, and an export attestation.

## Integration Notes

The module is dependency-free and uses plain manifest objects so maintainers can adapt it to a SCIBASE repository model or API. The next integration step is replacing the sample manifests with repository metadata loaded from project storage.
76 changes: 76 additions & 0 deletions repository-citation-impact-gate/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"use strict";

const {
buildRepositoryManifest,
createExportAttestation,
planMergeCitationImpact
} = require("./index");

const base = buildRepositoryManifest({
repositoryId: "scibase/demo-project",
version: "0.8.3",
license: "MIT",
doi: "10.5555/scibase.demo",
authors: ["Researcher One", "Researcher Two"],
components: [
{
id: "paper",
type: "manuscript",
path: "paper.md",
content: "Original repository manuscript.",
environmentHash: "pandoc-3.1"
},
{
id: "analysis",
type: "code",
path: "analysis/notebook.ipynb",
content: "mean(control) - mean(treatment)",
environmentHash: "python-3.12-numpy-2"
}
]
});

const incoming = buildRepositoryManifest({
repositoryId: "researcher/forked-demo-project",
version: "0.9.0",
license: "MIT",
doi: "10.5555/scibase.demo.fork",
authors: ["Researcher One", "Researcher Two", "Reviewer Three"],
parentForks: [{ repositoryId: "scibase/demo-project", version: "0.8.3", doi: "10.5555/scibase.demo" }],
components: [
{
id: "paper",
type: "manuscript",
path: "paper.md",
content: "Updated manuscript with validated sensitivity analysis.",
environmentHash: "pandoc-3.1"
},
{
id: "analysis",
type: "code",
path: "analysis/notebook.ipynb",
content: "bootstrap_ci(treatment, control)",
environmentHash: "python-3.12-numpy-2"
},
{
id: "result-table",
type: "results",
path: "results/bootstrap.csv",
content: "estimate,lower,upper\n0.42,0.31,0.54",
environmentHash: "python-3.12-numpy-2"
}
]
});

const plan = planMergeCitationImpact({ base, incoming });
const attestation = createExportAttestation(plan);

console.log(JSON.stringify({
releaseDecision: plan.releaseDecision,
nextVersion: plan.nextVersion,
addedComponents: plan.diff.added.map((component) => component.id),
changedComponents: plan.diff.changed.map((item) => item.after.id),
citationChanges: plan.citationChanges,
attestation
}, null, 2));

Binary file added repository-citation-impact-gate/demo.mp4
Binary file not shown.
36 changes: 36 additions & 0 deletions repository-citation-impact-gate/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