SPB Git

Repository Public

SOURCE_HEADER_POLICY.md 4.6 KB 74 lines markdown

1# SP Boucher Source Header Policy23Version 1.0 — maintained by Simon-Pierre Boucher (dev@spboucher.ai). Enforced by `spb-header`.45## 1. Purpose67Every eligible first-party source file carries one standard header that states the project, the8maintainer, the verified rights holder, the license and the right contact. The header is metadata:9it never changes what a program computes, what a paper says, or who owns anything.1011## 2. Rules12131. **One header per file**, inserted by the tool, never typed by hand.142. **Verified facts only.** A field that cannot be verified is omitted, not guessed. No SPDX15   identifier unless the license text matches exactly. No license is added to a repository that has none.163. **Ownership is never invented.** The rights holder comes from the repository's license file, or17   from a sole-author history for non-research software. Research and teaching repositories without18   a license file carry a neutral notice until the author confirms the holder (see `COPYRIGHT_POLICY.md`).194. **Third-party material is preserved untouched**: vendored code, files with another holder's20   copyright or license notice, generated files, lockfiles, data, models, binaries.215. **Anonymous submissions stay anonymous.** Nothing is written under `soumission/`, `submission/`,22   `anonymous/`, `blind/` and similar directories, nor into files named `*anonym*` / `*blind*`.236. **A change is a pure splice.** The engine inserts one comment block after the mandatory first24   lines of the format (shebang, encoding line, `swift-tools-version`, `//go:build`, `% !TEX`,25   `# syntax=`, test-environment pragmas). Bytes outside the header are never re-encoded, re-wrapped26   or reformatted; line endings and BOM are kept. Files that are not valid UTF-8 are left alone.277. **Reversible and idempotent.** Removing the header gives back the baseline byte for byte;28   running the tool twice changes nothing.298. **No private information** in a header: no local path, private host, internal address or secret.3031## 3. Variants3233| Variant | Used for | Content |34|---|---|---|35| `SPB-FULL` | first-party source (Python, Go, C/C++, Kotlin…) outside research | canonical full header |36| `SPB-APPLE` | Swift, Objective-C | full header in `//` comments |37| `SPB-RESEARCH` | source and scripts of research / teaching repositories | maintainer, affiliation disclaimer, authorship and data notice |38| `SPB-LATEX` | `.tex`, `.sty`, `.cls`, `.bst` | 12-line LaTeX header |39| `SPB-BIB` | `.bib` | no e-mail address (BibTeX reads `@` as an entry) |40| `SPB-WEB` | JavaScript / TypeScript | medium header, no classification block |41| `SPB-INFRA` | shell, Dockerfile, Makefile, MacLustr and infrastructure code | medium header, security contact |42| `SPB-MINIMAL` | CSS, SQL, YAML, TOML, Vue/Svelte, files served to browsers as-is | compact attribution |43| `SPB-THIRD-PARTY` | third-party files | preservation only: nothing is written |44| `SPB-GENERATED` | generated files | nothing is written; change the generator |45| notebook metadata | `.ipynb` | `metadata.spboucher` only; cells, outputs, ids untouched |4647`Description` and `Created` are carried over from a previous identity block or module docstring;48`Created` / `Last Modified` otherwise come from version-control history and are kept stable once written.49`Version` is not stamped per file unless the repository policy pins it.5051## 4. Formats without an in-file header5253JSON, Markdown/MDX, HTML, SVG, XML, plist, entitlements, string catalogs, Xcode project files,54CSV and other data, lockfiles, source maps, images, fonts, archives, model weights, checkpoints.55They are covered by the repository policy file `.spb-source-governance.toml`. HTML is excluded on56purpose: a comment would change the bytes served to browsers.5758Also never edited: checksummed schema migrations (`migrations/`, `drizzle/`, `prisma/…`),59test fixtures and snapshots, computed LaTeX tables and figures (`tables/`, `results/`, `figures/`…),60LaTeX files typeset verbatim by another file, scripts that read their own source by line number,61files over 1.5 MB, minified files, empty files.6263## 5. Repository policy file6465`.spb-source-governance.toml` at the root of each onboarded repository states project name, category,66contact, classification, rights holder, license and extra exclusions. It is the only place to change67those values; `spb-header apply --repo .` then refreshes the headers.6869## 6. Workflow7071- New or modified file: `spb-header apply --repo . --files <path>`.72- Verification (hook, CI): `spb-header check --repo .` — reports missing, stale or duplicate headers.73- New repository: `docs/ONBOARDING.md`. Removal: `docs/ROLLBACK.md`.74
Files main
Menu

Theme