SPB Git

Repository Public

POLICY.md 3.9 KB

# Source header policy (SP Boucher development standard v1.0.0)

  1. Scope. Every eligible, SP Boucher-owned source file starts with the official header (TEMPLATE.md), written by sp-header only. Never hand-write, shorten or replace it by a one-line copyright.
  2. 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 not in-scope, when .sp-standard.json says "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.
  3. 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 specified until a remote exists), Project Website (policy or manifest homepage, else Not specified), Created (kept if present; else first git addition following renames; else file birth time; else Unknown), Last Modified (set on a substantive edit, never by a check), Copyright year or range, License (nearest LICENSE/COPYING, SPDX, manifest; else None specified (no license file in this repository)). A license is never added or changed. A public repository is not thereby open source.
  4. Existing files. On modification: check, add if absent, correct stale metadata, refresh Last Modified, keep Created, keep every legal notice, never duplicate. Earlier SP Boucher header variants (v1 engine spb-header: full, research, infrastructure, minimal…) are recognised and left as they are; sp-header apply --upgrade converts one deliberately. No mass migration outside sp-header fix <dir>.
  5. 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", …]}.
  6. 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.

Files main
Menu

Theme