Build a research code artifact policy: repository structure, licensing, citation, preservation, and review gates.
Assistant
The user wants a "Research Code Artifact Policy." This is a formal document or set of guidelines for a research group, institution, or journal to manage software written for research purposes.
The policy needs to cover five specific areas:
Repository Structure: How the code is organized.
Licensing: How rights are reserved or shared.
Citation: How the code is credited.
Preservation: Long-term archiving and DOI minting.
Review Gates: Quality checks before release or publication.
Target Audience: Likely a Research Software Engineer (RSE) group, a university research office, or a research team leader looking to professionalize their code management.
Tone: Professional, actionable, structured, and comprehensive.
Drafting - Section by Section:
Header/Intro: Needs a title, scope, and objective. Why do we need this? (Reproducibility, impact, compliance).
Repository Structure (The "Where" and "How it looks"):
Concept: Standardization makes onboarding easier and review faster.
Key elements: Version control (Git), standard folders (src, data, docs, tests), README.md (crucial), environment specification (requirements.txt, environment.yml, Dockerfile). Data handling (don't commit big data, use DVC or pointers).
Licensing (The "Legal"):
Concept: If there's no license, no one can legally use it.
Key elements: OSI-approved licenses. Distinguish between permissive (MIT/BSD) and copyleft (GPL). Context matters (is it a library or a one-off script?). Need to clarify ownership (institution vs. individual).
Citation (The "Credit"):
Concept: Software is a research output.
Key elements:CITATION.cff file (standard now). DOI (Zenodo). Linking code to paper. Metadata (authors, ORCID).
Preservation (The "Long-term"):
Concept: Links rot. Repositories get deleted.
Key elements: Archival (Zenodo, Figshare, Software Heritage). Versioning (semantic versioning). Long-term accessibility (ensuring the environment is captured, e.g., containers).
Review Gates (The "Quality Control"):
Concept: Don't push bad code. Don't publish non-reproducible code.
Refining the Structure:
I should organize this as a formal policy document with clear bullet points and specific "Requirements" vs "Recommendations." I'll use a "Maturity Model" approach or just distinct levels to make it scalable (e.g., Level 1: Basic, Level 2: Reusable). Self-correction: The user asked for a "Policy," not a "Maturity Model," but a policy implies rules. I will structure it with strict Requirements and Best Practices.
Specific details to include:
Repo: Use README.md, LICENSE, CITATION.cff.
Licensing: MIT for broad use, GPL for staying open.
Preservation: Zenodo integration with GitHub.
Review: CI/CD checks.
Reviewing the prompt again: "Build a research code artifact policy." Okay, I will create a template document that can be copy-pasted and adapted.
Outline of the Output:
Policy Overview: Purpose & Scope.
Section 1: Repository Infrastructure & Structure. (Git, standard layout, documentation).
Section 2: Licensing & Intellectual Property. (Choosing a license, compliance).
Section 5: Review Gates (QA). (The lifecycle stages).
Enforcement/Roles: Who is responsible?
Polishing the content:
Make sure to mention Software Heritage for preservation.
Emphasize Semantic Versioning.
Include Containerization (Docker/Singularity) as a high-standard preservation method.
Let's write the content.
Section 1 (Structure): Needs src, tests, docs. README must explain "what, why, how".
Section 2 (Licensing): Must define default. MIT/BSD/Apache usually preferred for academic libraries. GPL for end-user tools. Crucial: No closed-source dependencies without permission.
Section 3 (Citation): The CITATION.cff is the modern standard. DOIs via Zenodo.
Section 4 (Preservation): Archive upon publication. Not just "whenever".
Section 5 (Review):
* Gate 0: Init (License/Readme).
* Gate 1: Dev (CI/CD/Tests).
* Gate 2: Release (DOI/Docs).
Let's assemble the final response. I will provide a clean, structured policy template.
This is a comprehensive template for a Research Code Artifact Policy. It is designed to be adaptable for research groups, university departments, or funding agency requirements.
This policy treats code not as a disposable byproduct, but as a legitimate, citable research output.
Research Code Artifact Policy
Version: 1.0
Scope: All software, scripts, and computational notebooks generated during the research lifecycle.
1. guiding Principles
Reproducibility: Code must be available to validate results.
Transparency: Clear documentation of logic and dependencies.
Accessibility: Code should be open by default, unless restricted by security, privacy, or IP constraints.
Credit: Code creation is a scholarly contribution deserving of citation.
2. Repository Structure & Infrastructure
All research code must be version-controlled using Git.
2.1 Hosting Platforms
Active Development: Host on institutional instances (e.g., GitLab Self-Managed) or major public platforms (GitHub, GitLab.com).
Synchronization: Mirror private repositories to public ones upon publication.
2.2 Mandatory Directory Layout
To ensure consistency and ease of navigation, repositories must adhere to the following minimal structure:
text
/project-root
├── README.md # Project description, installation, usage
├── LICENSE # The license file
├── CITATION.cff # Machine-readable citation metadata
├── environment.yml # OR requirements.txt / Dockerfile (Dependencies)
├── /src # Source code, distinct from analysis
├── /data # Placeholder or small static data (Do not commit large datasets)
├── /notebooks # Exploratory analysis and figures
├── /tests # Unit tests (mandatory for "Production" grade)
└── /docs # Extended documentation (optional but recommended)
2.3 Versioning
Projects must utilize Semantic Versioning (e.g., v1.0.0) once published or shared externally.
Do not commit sensitive data (API keys, patient data). Use .gitignore strictly.
3. Licensing
Code cannot be reused without a license. "All Rights Reserved" is the default legal state, which prohibits reuse.
3.1 Default Licenses
Open Science (Permissive): Use MIT or Apache 2.0 for maximum reuse and commercial compatibility.
Open Science (Copyleft): Use GPL v3 if you require derivative works to remain open source.
Proprietary/Restrictive: Use a custom license only if commercialization is pending or IP restrictions apply.
3.2 Policy
A license file must be present at the root of the repository upon initialization (Day 1).
No code repository shall be made public without an explicit OSI-approved license attached.
4. Citation & Attribution
We adhere to the FAIR principles (Findable, Accessible, Interoperable, Reusable).
4.1 CITATION.cff
All repositories must include a CITATION.cff file.
This file provides machine-readable metadata (authors, title, version, DOI).
Platforms like GitHub and Zenodo use this to generate BibTeX/APA citations automatically.
4.2 Persistent Identifiers (DOIs)
Archival: Upon submission of a related manuscript, a snapshot of the repository must be archived on Zenodo (or similar).
Linking: The Zenodo DOI must be linked to the specific Git tag (e.g., v2.1.0).
Paper Citation: The research paper must cite the software DOI in the References or "Data Availability" section.
5. Preservation & Archiving
Code is a fragile artifact. Preservation ensures long-term viability.
5.1 Archival Strategy
Active Phase: Hosted on standard Git platforms.
Publication Phase: Archived on Zenodo (hosted by CERN) or Figshare.
Long-Term Preservation: Institutional repositories or Software Heritage (the "Library of Alexandria" for code).
5.2 Environment Capture
To combat "bit rot" (code failing due to system updates), the computational environment must be captured:
Minimum:requirements.txt (Python), renv.lock (R), or Project.toml (Julia).
Preferred:Docker Container or Singularity definition file, ensuring the OS and libraries are preserved exactly.
6. Review Gates (Quality Assurance)
We implement a tiered review system based on the visibility and impact of the project.
Reproducibility Check: A third party (e.g., a "Code Buddy" or Reviewer 2) must be able to run the code and regenerate the figures from the paper using the provided data/instructions.
CITATION.cff present and valid.
Zenodo DOI minted.
Reviewer: Internal Code Review Committee or Journal Referee.
Gate 3: High-Impact Tool (Reusable Library)
Requirement:
API documentation generated (e.g., Sphinx, Doxygen).
Automated Unit Tests (CI/CD pipeline passing).
User Guide / Tutorial provided.
7. Compliance & Non-Compliance
Funding: Grant deliverables involving code will not be marked "Complete" without a valid DOI and Public Repository link.
Publishing: Authors must provide a "Software Availability Statement" in all manuscripts.
Appendix A: Minimal Checklist for Authors
Repo Created: Is the code on Git?
Ignored: Are data files and secrets excluded via .gitignore?
License: Is there an MIT or GPL license?
Readme: Can a stranger install this by reading the README?
Archive: Is there a Zenodo DOI for the submitted version?