SPB Git

Repository Public

POLICY.md 3.9 KB 51 lines markdown

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

Theme