Source header policy (SP Boucher development standard v1.0.0)
- Scope. Every eligible, SP Boucher-owned source file starts with the official header (
TEMPLATE.md), written bysp-headeronly. Never hand-write, shorten or replace it by a one-line copyright. - Ownership comes first. A header asserts authorship. It is stamped automatically only on positive evidence:
the repository's origin is SPB Git (or another owned remote), or a policy file says so. It is never stamped when
the origin is a third-party remote, when
.spb-source-governance.toml(v1) does not name Simon-Pierre Boucher as rights holder or is notin-scope, when.sp-standard.jsonsays"headers": false, or when the repository is in the machine-local list of repositories under review. Co-authored papers, students' work, clients' code and anonymous submissions never receive the header by automation. - Metadata are detected, never invented. Project (policy file → README title → manifest → repository slug →
directory), File (path relative to the project root, updated on rename), Module (functional directory), Repository
(normalised
origin, credentials stripped;Not specifieduntil a remote exists), Project Website (policy or manifest homepage, elseNot specified), Created (kept if present; else first git addition following renames; else file birth time; elseUnknown), Last Modified (set on a substantive edit, never by a check), Copyright year or range, License (nearestLICENSE/COPYING, SPDX, manifest; elseNone specified (no license file in this repository)). A license is never added or changed. A public repository is not thereby open source. - Existing files. On modification: check, add if absent, correct stale metadata, refresh
Last Modified, keepCreated, keep every legal notice, never duplicate. Earlier SP Boucher header variants (v1 enginespb-header: full, research, infrastructure, minimal…) are recognised and left as they are;sp-header apply --upgradeconverts one deliberately. No mass migration outsidesp-header fix <dir>. - Never touched. JSON, binaries, media, models and weights, CSV/Parquet, databases, lock files, minified files,
dependencies, generated files, build output, certificates, keys,
.env, schema migrations and snapshot/fixture directories (checksummed by their tools), anonymous-submission directories, files carrying a third-party notice, Markdown/plain text, XML/plist/SVG. LaTeX and BibTeX are manual-only (sp-header apply), never automatic. Lists:exclusions.json; per repository:.sp-standard.json→{"exclude": ["glob", …]}. - Safety. Comment-only change, proven where cheap (Python AST equality,
bash -n); encoding, BOM, line endings, permissions and inode preserved; non-UTF-8 files are left alone; every operation is idempotent.
Commands
bash
sp-header inspect <file> # language, eligibility, ownership, detected and expected metadata (JSON)
sp-header generate <file> # print the header that would be written
sp-header apply <file>… [--touch] [--new] [--upgrade] [--force-owner] [--dry-run]
sp-header check <dir> # exit 1 when an eligible file is missing or stale
sp-header fix <dir> [--dry-run] [--upgrade]
sp-header audit <dir> # every file with its status and reason
sp-header report <dir> [--out f] # Markdown compliance report (or --json)
sp-header doctor | version Per-repository policy .sp-standard.json (optional)
json
{"owner": "sp-boucher", "project": "Official Name", "website": "https://example.org", "headers": true,
"exclude": ["data/**"], "publish": true, "visibility": "public"}"modules": {"path/prefix": "Name"} names modules explicitly; "headers": false disables stamping; "owner": "third-party" marks foreign code; "publish": false keeps the
repository local; "visibility": "private" makes sp-git init create an SSH-only repository.