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
26 changes: 26 additions & 0 deletions artifact-package-integrity-gate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Artifact Package Integrity Gate

This module adds a Scientific Data & Code Hosting slice for reviewer-ready research artifact packages. It is self-contained, dependency-free, and synthetic-data-only so reviewers can validate it without credentials, cloud storage, or a running platform.

It covers the issue #14 requirements by validating:

- datasets, notebooks, code, figures, media, and model artifacts with deterministic type classification
- metadata-aware preview plans for tabular data, notebooks, figures, JSON, model files, and deferred large payloads
- DataCite, JSON-LD, and schema.org package metadata completeness
- FAIR access requirements, reusable licenses, reviewer access evidence, version hashes, and persistent links
- pinned executable environments and rerun commands that only reference hosted artifacts
- stable export packets with package and source digests for DOI/API/archive workflows

## Local Validation

```sh
node artifact-package-integrity-gate/test.js
node artifact-package-integrity-gate/demo.js
```

## Demo Evidence

- [demo.mp4](demo.mp4) shows the problem, implementation scope, acceptance behavior, and validation commands.
- [demo.svg](demo.svg) provides a static reviewer dashboard preview.
- [requirements-map.md](requirements-map.md) maps the implementation to issue #14.
- [acceptance-notes.md](acceptance-notes.md) lists the reviewer checks.
24 changes: 24 additions & 0 deletions artifact-package-integrity-gate/acceptance-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Acceptance Notes

## What This Adds

The `artifact-package-integrity-gate` module gives SCIBASE a deterministic validation layer for hosted scientific data and code packages before they are exposed through persistent links, DOI metadata, reviewer packets, or rerun buttons.

## Why It Is Distinct

This is not a broad storage sketch or another simple FAIR manifest. It focuses on the package boundary where reviewers need to know whether every artifact is hashed, previewable, licensed, metadata-complete, access-controlled, and connected to a pinned executable environment.

## Reviewer Checks

1. Run `node artifact-package-integrity-gate/test.js`.
2. Run `node artifact-package-integrity-gate/demo.js`.
3. Confirm the passing package reports `packageReady: true`.
4. Confirm the broken package test catches missing sha256 hashes, incomplete DataCite fields, unpinned runtimes, and commands that reference missing hosted inputs.
5. Inspect `demo.svg` or `demo.mp4` for the reviewer-facing workflow summary.

## Payout Conditions Covered

- Issue #14 has a live Algora bounty route.
- The PR body includes `/claim #14`.
- The module includes a short demo video artifact.
- The implementation is dependency-free and locally verifiable.
89 changes: 89 additions & 0 deletions artifact-package-integrity-gate/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
"use strict";

const { evaluateArtifactPackage } = require("./index");

const packageInput = {
generatedAt: "2026-05-17T12:00:00.000Z",
project: { id: "proj-ocean-sensor-2026", title: "Ocean sensor reproducibility package" },
metadata: {
datacite: {
identifier: "10.5555/scibase.ocean-sensor.2026",
creators: ["C. Oceanographer", "D. Data Steward"],
titles: ["Ocean sensor reproducibility package"],
publisher: "SCIBASE.AI",
publicationYear: "2026",
resourceType: "Dataset and software",
},
jsonLd: {
"@context": "https://schema.org",
"@type": "Dataset",
name: "Ocean sensor reproducibility package",
},
schemaOrg: {
"@type": "Dataset",
name: "Ocean sensor reproducibility package",
},
},
artifacts: [
{
id: "sensor-readings",
path: "data/sensor-readings.parquet",
bytes: 18_000_000,
hash: "1".repeat(64),
license: "CC-BY-4.0",
access: "public",
version: 2,
previousVersionHash: "2".repeat(64),
metadata: { title: "Sensor readings", creators: ["C. Oceanographer"], keywords: ["ocean", "sensor"] },
},
{
id: "calibration-notebook",
path: "notebooks/calibration.ipynb",
bytes: 900_000,
hash: "3".repeat(64),
license: "MIT",
access: "public",
metadata: { title: "Calibration notebook", creators: ["D. Data Steward"], keywords: ["calibration"] },
},
{
id: "temperature-map",
path: "figures/temperature-map.png",
bytes: 850_000,
hash: "4".repeat(64),
license: "CC-BY-4.0",
access: "restricted",
accessJustification: "review-only embargo before journal supplement release",
reviewerAccessWindow: "2026-05-17/2026-06-17",
metadata: { title: "Temperature anomaly map", creators: ["D. Data Steward"], keywords: ["figure"] },
},
],
environments: [
{
id: "python-reproducer",
name: "Pinned Python notebook runner",
image: "ghcr.io/scibase/ocean-runner@sha256:" + "5".repeat(64),
runtimes: ["python", "jupyter"],
trigger: "run-analysis-button",
commands: [
{
id: "reproduce-calibration",
label: "Reproduce calibration",
command: "python scripts/run_notebook.py notebooks/calibration.ipynb",
inputs: ["data/sensor-readings.parquet", "notebooks/calibration.ipynb"],
outputs: ["figures/temperature-map.png"],
},
],
},
],
};

const result = evaluateArtifactPackage(packageInput);

console.log("Artifact package integrity demo");
console.log(JSON.stringify(result.dashboard, null, 2));
console.log("Preview plan:");
for (const artifact of result.artifacts) {
console.log(`- ${artifact.path}: ${artifact.preview.previewKind} (${artifact.classification.category})`);
}
console.log("Export packet:");
console.log(JSON.stringify(result.exportPacket, null, 2));
Binary file added artifact-package-integrity-gate/demo.mp4
Binary file not shown.
39 changes: 39 additions & 0 deletions artifact-package-integrity-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