Skip to content

Commit 77bec60

Browse files
committed
ci: add drift-check workflow + gitignore block
Defense-in-depth on top of the local pre-commit hook. Scans tracked files and filenames for internal terminology and private paths; gitignore patterns prevent accidental staging of internal-only document categories.
1 parent 77f0a6e commit 77bec60

2 files changed

Lines changed: 93 additions & 0 deletions

File tree

.github/workflows/check-drift.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Drift check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
scan:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Scan for forbidden patterns
17+
run: |
18+
set -e
19+
20+
PATTERNS=(
21+
'aeoess-private'
22+
'/Users/tima'
23+
'MODEL-CITIZEN-CANON'
24+
'MODEL_CITIZEN_CANON'
25+
'THE-SYNTHESIS'
26+
'THE_SYNTHESIS'
27+
'ERIK-NEWTON'
28+
'ERIK_NEWTON'
29+
'OPEN-COMMITMENTS'
30+
'OPEN_COMMITMENTS'
31+
'CC-PROMPT-TEMPLATES'
32+
'CC_PROMPT_TEMPLATES'
33+
'DAILY-UPDATE-RHYTHM'
34+
'DAILY_UPDATE_RHYTHM'
35+
'MUTUAL-MODE'
36+
'MUTUAL_MODE'
37+
'canary watch'
38+
'UPDATE-PROPAGATION-SPEC'
39+
'CONSILIUM-FORENSIC'
40+
'CONSILIUM-BRIEFING'
41+
'ROME-COMPLETE'
42+
)
43+
44+
# Files we deliberately allow these patterns in (the workflow itself,
45+
# any scripts that intentionally enumerate the patterns to check for).
46+
EXCLUDE_PATHS='(\.github/workflows/check-drift\.yml|scripts/check-drift\.sh)'
47+
48+
violations=0
49+
for pat in "${PATTERNS[@]}"; do
50+
# Search tracked files only, excluding self-references
51+
hits=$(git ls-files | grep -v -E "$EXCLUDE_PATHS" | xargs grep -l -F "$pat" 2>/dev/null || true)
52+
if [ -n "$hits" ]; then
53+
echo "::error::Forbidden pattern '$pat' found in:"
54+
echo "$hits" | sed 's/^/ /'
55+
violations=$((violations + 1))
56+
fi
57+
58+
# Also check filenames themselves
59+
file_hits=$(git ls-files | grep -F "$pat" || true)
60+
if [ -n "$file_hits" ]; then
61+
echo "::error::Forbidden pattern '$pat' in filename(s):"
62+
echo "$file_hits" | sed 's/^/ /'
63+
violations=$((violations + 1))
64+
fi
65+
done
66+
67+
if [ "$violations" -gt 0 ]; then
68+
echo ""
69+
echo "::error::Drift check failed: $violations pattern violation(s)."
70+
exit 1
71+
fi
72+
73+
echo "✓ Drift check passed."

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,23 @@ build/
99
*.egg
1010
.venv/
1111
venv/
12+
13+
# ─────────────────────────────────────────────────
14+
# AEOESS drift prevention — never commit these patterns.
15+
# These complement the pre-commit hook and CI scan.
16+
# ─────────────────────────────────────────────────
17+
specs/cc-prompts/
18+
specs/consilium/
19+
specs/briefings/
20+
specs/CONSILIUM-*
21+
specs/ROME-COMPLETE-*
22+
specs/DAILY-*
23+
specs/CC-PROMPT-*
24+
specs/OPEN-COMMITMENTS*
25+
specs/MODEL-CITIZEN*
26+
specs/MUTUAL-MODE*
27+
specs/THE-SYNTHESIS*
28+
specs/ERIK-NEWTON*
29+
/tmp-*.md
30+
/scratch-*.md
31+
*.private.md

0 commit comments

Comments
 (0)