Skip to content

Commit 67f3233

Browse files
authored
ci: enforce shared repository hygiene and data provenance (#600)
Enforce shared PR-range repository hygiene in [SIMPLE](https://github.com/itpplasma/SIMPLE), replacing the staged-only aggregate checker with the public revision-pinned [shared workflow](lazy-fortran/.github#2). The gate checks secrets, 1 MiB/file, data/archive types and 5 MiB aggregate additions, including intermediate commits. Exceptions require tracked path globs and reasons; the 24-file rule and environment override are removed. CONTRIBUTING documents synthetic/published fixture provenance, external result archives, offline global hooks, SQUASH integration and private-repo cluster validation. [V] Six real-Git/Gitleaks tests and hosted shared-workflow CI passed. Local global-hook checks exercise scratch repos and linked worktrees. Numerical code and test inputs are unchanged; existing native CI remains required. Chris&AI
1 parent 9eca50e commit 67f3233

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎.github/workflows/repo-hygiene.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Repository hygiene
2+
on:
3+
pull_request:
4+
merge_group:
5+
permissions:
6+
contents: read
7+
jobs:
8+
repo-hygiene:
9+
uses: lazy-fortran/.github/.github/workflows/repo-hygiene.yml@4a515a95feac1fa1e79d2f721a4b20eb124b20f4
10+
with:
11+
hygiene-revision: 4a515a95feac1fa1e79d2f721a4b20eb124b20f4

‎CONTRIBUTING.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ invariants a change must keep.
6060
that are ready for review.
6161
5. Answer review with new commits. A maintainer merges.
6262

63+
Before marking a PR ready, compare the final diff with the issue and PR
64+
contract. Remove unrelated work, redundant tests/docs, transient generated data
65+
and accidental large result sets. Squash fixups or reorganize commits into a few
66+
meaningful steps; preserve rejected scientific approaches only when their
67+
history is useful evidence. Do not rewrite shared, stacked or queued branches
68+
without coordinating with their users.
69+
6370
Each pull request carries one risk tier, set by its highest-risk part. The
6471
tier sets the depth of review and the evidence required:
6572

@@ -99,6 +106,28 @@ reference output without that explanation.
99106
- A branch need not be up to date with `main`. Merge `main` into a PR only
100107
when it conflicts.
101108

109+
The merge queue uses `SQUASH`. Standalone PRs land as one commit; stacks
110+
land one squashed commit per layer. Record the lower layer's old head before
111+
merging; rebase the upper layer with
112+
`git rebase --onto origin/main <old-lower-head>` and retarget it to main.
113+
Recheck its final diff and affected tests after rebasing.
114+
115+
The required repository-hygiene workflow scans the PR commit range for secrets,
116+
files over 1 MiB, data/archive types and aggregate additions over 5 MiB. The
117+
[pinned shared checker](https://github.com/lazy-fortran/.github/blob/main/REPO_HYGIENE.md)
118+
also runs offline on staged changes through the prompts global hook, before
119+
this repository's pre-commit hooks. Install `pre-commit` and its existing quick
120+
mechanical checks before committing. Reuse valid test evidence; builds,
121+
numerical tests and optional AI review do not belong in ordinary commit hooks.
122+
123+
Artifact exceptions require a tracked `.repo-hygiene-allow`: repository-relative
124+
path glob, TAB, one-line provenance/reason. There is no environment override.
125+
Never commit non-public machine, experiment or collaborator data as fixtures
126+
(ITER/TC24/IMAS, AUG shots, JT-60SA inputs included). Use synthetic or published
127+
data with provenance. Keep campaign results externally with checksums.
128+
Heavy CI runs only in public repositories. Private repositories validate via
129+
cluster jobs, with job IDs, revision, commands and results recorded in the PR.
130+
102131
## Commit messages
103132

104133
Use a lower-case type prefix and an imperative summary of at most about 72

0 commit comments

Comments
 (0)