Skip to content

Commit beafe31

Browse files
Add repository protection guide to prevent accidental overrides
Co-authored-by: chaishillomnitech1 <211137784+chaishillomnitech1@users.noreply.github.com>
1 parent 4d1e93f commit beafe31

File tree

1 file changed

+391
-0
lines changed

1 file changed

+391
-0
lines changed

.github/PROTECTING_REPOSITORY.md

Lines changed: 391 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,391 @@
1+
# 🛡️ Repository Protection Guide
2+
3+
## Purpose
4+
5+
This guide provides instructions for protecting the restored README.md and repository structure to prevent accidental overrides while still supporting future enhancements.
6+
7+
---
8+
9+
## 🔒 Critical Files to Protect
10+
11+
### Primary Files (Never Delete)
12+
- `README.md` - Main repository overview
13+
- `CENTRAL_MANIFESTO.md` - Single source of truth
14+
- `MASTER_INDEX.md` - Universal searchability
15+
- `ARCHITECTURE.md` - Technical architecture
16+
- `SCROLLVERSE_SOVEREIGN_LICENSE.md` - Legal framework
17+
18+
### Sacred Documentation (Review Required Before Changes)
19+
- All `OMEGA_*.md` files
20+
- All `AKASHIC_*.md` files
21+
- All deployment guides
22+
- All protocol documentation
23+
24+
---
25+
26+
## 🔐 Branch Protection Setup
27+
28+
### Protect Main Branch
29+
30+
1. **Go to Repository Settings**
31+
- Navigate to: `Settings``Branches`
32+
- Click `Add rule` or edit existing `main` rule
33+
34+
2. **Configure Protection Rules**
35+
```
36+
Branch name pattern: main
37+
38+
✅ Require a pull request before merging
39+
- Required approvals: 1
40+
- Dismiss stale pull request approvals when new commits are pushed
41+
- Require review from Code Owners
42+
43+
✅ Require status checks to pass before merging
44+
- Require branches to be up to date before merging
45+
- Status checks that are required:
46+
☑ security-scan
47+
☑ secrets-scan
48+
☑ build-and-test
49+
☑ codeql
50+
☑ contract-integrity-verification
51+
52+
✅ Require conversation resolution before merging
53+
54+
✅ Require signed commits (Recommended)
55+
56+
✅ Require linear history (Recommended)
57+
58+
✅ Include administrators
59+
60+
✅ Restrict who can push to matching branches
61+
- Only allow specific actors to push
62+
63+
❌ Allow force pushes (Disabled)
64+
65+
❌ Allow deletions (Disabled)
66+
```
67+
68+
3. **Save Changes**
69+
- Click `Create` or `Save changes`
70+
71+
### Protect Critical Documentation
72+
73+
1. **Create CODEOWNERS File**
74+
- File: `.github/CODEOWNERS`
75+
- Content:
76+
```
77+
# Global owner
78+
* @chaishillomnitech1
79+
80+
# Critical documentation requires review
81+
README.md @chaishillomnitech1
82+
CENTRAL_MANIFESTO.md @chaishillomnitech1
83+
MASTER_INDEX.md @chaishillomnitech1
84+
ARCHITECTURE.md @chaishillomnitech1
85+
86+
# Smart contracts
87+
/contracts/ @chaishillomnitech1
88+
*.sol @chaishillomnitech1
89+
90+
# Security-sensitive files
91+
/legal/ @chaishillomnitech1
92+
SECURITY.md @chaishillomnitech1
93+
.github/workflows/ @chaishillomnitech1
94+
95+
# Deployment configurations
96+
/deployment/ @chaishillomnitech1
97+
/scripts/ @chaishillomnitech1
98+
hardhat.config.js @chaishillomnitech1
99+
```
100+
101+
---
102+
103+
## 🚨 Pull Request Requirements
104+
105+
### For README.md Changes
106+
107+
Any PR that modifies `README.md` must:
108+
109+
1. **Explain the Change**
110+
- Clearly describe what is being added/removed/modified
111+
- Justify why the change is necessary
112+
- Reference any related issues
113+
114+
2. **Preserve Core Sections**
115+
- The Four Pillars (Justice, Unity, Truth, Eternal)
116+
- The Five Sovereign Sigils
117+
- The Vision statement
118+
- Quick Start guide
119+
- How to Contribute section
120+
121+
3. **Maintain Visual Quality**
122+
- Keep badges and formatting
123+
- Preserve emojis for visual appeal
124+
- Ensure links are valid
125+
- Keep the Akashic Codex vision intact
126+
127+
4. **Get Required Approvals**
128+
- Minimum 1 approval from @chaishillomnitech1
129+
- Pass all CI/CD checks
130+
- Resolve all conversations
131+
132+
### For Other Critical Files
133+
134+
Follow the same process as README.md changes, with additional requirements:
135+
- Smart contract changes require security audit review
136+
- Legal documents require legal team review
137+
- Deployment configs require DevOps review
138+
139+
---
140+
141+
## 🔄 Safe Update Process
142+
143+
### How to Make Enhancements
144+
145+
1. **Create Feature Branch**
146+
```bash
147+
git checkout develop
148+
git pull origin develop
149+
git checkout -b feature/enhance-readme-[description]
150+
```
151+
152+
2. **Make Changes**
153+
- Edit files locally
154+
- Test changes (preview markdown if applicable)
155+
- Ensure all links work
156+
157+
3. **Commit with Clear Message**
158+
```bash
159+
git add README.md
160+
git commit -m "docs(readme): [clear description of enhancement]"
161+
```
162+
163+
4. **Push and Create PR**
164+
```bash
165+
git push origin feature/enhance-readme-[description]
166+
```
167+
- Create PR to `develop` (not directly to `main`)
168+
- Fill out PR template completely
169+
- Add screenshots if visual changes
170+
171+
5. **Review Process**
172+
- Wait for CI/CD to pass
173+
- Address review comments
174+
- Get required approvals
175+
- Merge only when all checks pass
176+
177+
6. **Deploy to Main**
178+
- After testing in `develop`, create PR to `main`
179+
- Get final approval
180+
- Merge to main
181+
182+
---
183+
184+
## 📋 Pre-Commit Checklist
185+
186+
Before committing changes to critical files, verify:
187+
188+
- [ ] Change is necessary and beneficial
189+
- [ ] No accidental deletions of important content
190+
- [ ] All links are valid and working
191+
- [ ] Formatting is preserved
192+
- [ ] Visual elements (badges, emojis) are intact
193+
- [ ] The Akashic Codex vision is maintained
194+
- [ ] Documentation is clear and accurate
195+
- [ ] Changes align with project principles
196+
197+
---
198+
199+
## 🚫 What NOT to Do
200+
201+
### Never:
202+
- ❌ Delete entire sections without discussion
203+
- ❌ Remove the Four Pillars or Five Sigils
204+
- ❌ Change the core vision statement
205+
- ❌ Remove attribution to CHAIS THE GREAT
206+
- ❌ Bypass branch protection without emergency reason
207+
- ❌ Force push to protected branches
208+
- ❌ Merge without required approvals
209+
- ❌ Ignore failing CI/CD checks
210+
211+
### Always:
212+
- ✅ Create PRs for all changes
213+
- ✅ Get proper reviews
214+
- ✅ Document your changes
215+
- ✅ Test before merging
216+
- ✅ Preserve the repository's sacred structure
217+
- ✅ Maintain visual quality and appeal
218+
219+
---
220+
221+
## 🔧 Automated Protection
222+
223+
### GitHub Actions Workflows
224+
225+
The following workflows help protect the repository:
226+
227+
1. **README Validation** (`.github/workflows/readme-validation.yml`)
228+
- Validates markdown syntax
229+
- Checks for broken links
230+
- Ensures required sections exist
231+
- Verifies badge URLs
232+
233+
2. **CODEOWNERS Check** (`.github/workflows/codeowners-check.yml`)
234+
- Ensures CODEOWNERS file is valid
235+
- Verifies reviewers are assigned
236+
- Validates GitHub usernames
237+
238+
3. **Documentation Quality** (`.github/workflows/docs-quality.yml`)
239+
- Spell checking
240+
- Markdown linting
241+
- Link validation
242+
- Format consistency
243+
244+
### Enable These Workflows
245+
246+
1. Ensure workflows exist in `.github/workflows/`
247+
2. Set as required status checks in branch protection
248+
3. Monitor workflow runs for failures
249+
4. Fix issues promptly
250+
251+
---
252+
253+
## 📊 Monitoring & Maintenance
254+
255+
### Weekly Tasks
256+
257+
- [ ] Review open PRs affecting critical files
258+
- [ ] Check for failed workflow runs
259+
- [ ] Verify branch protection is active
260+
- [ ] Review recent changes to README.md
261+
262+
### Monthly Tasks
263+
264+
- [ ] Audit CODEOWNERS file accuracy
265+
- [ ] Update branch protection rules if needed
266+
- [ ] Review and update this protection guide
267+
- [ ] Test PR workflow with minor change
268+
269+
### Quarterly Tasks
270+
271+
- [ ] Full repository security audit
272+
- [ ] Review all documentation for accuracy
273+
- [ ] Update protection strategies as needed
274+
- [ ] Train new maintainers on protection procedures
275+
276+
---
277+
278+
## 🆘 Emergency Procedures
279+
280+
### If README.md is Accidentally Damaged
281+
282+
1. **Don't Panic**
283+
- Repository has version history
284+
- Changes can be reverted
285+
286+
2. **Check Git History**
287+
```bash
288+
git log README.md
289+
git diff <commit-hash> README.md
290+
```
291+
292+
3. **Restore Previous Version**
293+
```bash
294+
git checkout <good-commit-hash> -- README.md
295+
git commit -m "docs(readme): restore to working version"
296+
git push origin <branch-name>
297+
```
298+
299+
4. **Create Restoration PR**
300+
- Explain what happened
301+
- Show before/after comparison
302+
- Get quick review and merge
303+
304+
5. **Document Incident**
305+
- Create post-mortem issue
306+
- Identify how it happened
307+
- Update protection to prevent recurrence
308+
309+
### If Branch Protection is Disabled
310+
311+
1. **Immediately Re-enable**
312+
- Go to Settings → Branches
313+
- Re-apply protection rules
314+
- Verify all settings are correct
315+
316+
2. **Audit Recent Changes**
317+
- Check commits during unprotected period
318+
- Verify no harmful changes were made
319+
- Revert any problematic commits
320+
321+
3. **Create Incident Report**
322+
- Document what happened
323+
- Identify who disabled protection
324+
- Verify it was intentional or accidental
325+
- Update procedures to prevent
326+
327+
---
328+
329+
## 🎓 Training Resources
330+
331+
### For New Maintainers
332+
333+
Required reading:
334+
1. This document (PROTECTING_REPOSITORY.md)
335+
2. [BRANCH_PROTECTION.md](BRANCH_PROTECTION.md)
336+
3. [CONTRIBUTING.md](../CONTRIBUTING.md)
337+
4. [REPOSITORY_SETTINGS.md](REPOSITORY_SETTINGS.md)
338+
339+
Hands-on practice:
340+
1. Create test PR with minor documentation change
341+
2. Review existing PR following guidelines
342+
3. Practice reverting a commit safely
343+
4. Test emergency restoration procedure
344+
345+
### For Contributors
346+
347+
Required reading:
348+
1. [CONTRIBUTING.md](../CONTRIBUTING.md)
349+
2. [CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT.md)
350+
3. This document (overview only)
351+
352+
Guidelines:
353+
- Always create PRs for changes
354+
- Respect review process
355+
- Don't bypass protections
356+
- Ask questions if unsure
357+
358+
---
359+
360+
## 🔥 Conclusion
361+
362+
The README.md restoration represents the **perfect embodiment** of the Akashic Codex vision. Protecting this structure ensures:
363+
364+
- **Visual Excellence**: Eye-pleasing, comprehensive, impactful
365+
- **Content Integrity**: All pillars, sigils, and guides preserved
366+
- **Future Flexibility**: Enhancements supported through proper process
367+
- **Sacred Protection**: Divine architecture locked in place
368+
369+
**Key Principles:**
370+
- **PROTECT THE VISION**: Preserve the Akashic Codex embodiment
371+
- **ENABLE GROWTH**: Support enhancements through proper channels
372+
- **MAINTAIN QUALITY**: Every change improves, never degrades
373+
- **ETERNAL VIGILANCE**: Continuous monitoring and protection
374+
375+
---
376+
377+
**ALLĀHU AKBAR! 🕋🔥💎🌌**
378+
379+
**The Repository is Protected.**
380+
**The Structure is Locked.**
381+
**The Vision is Eternal.**
382+
**The Legacy is Secured.**
383+
384+
---
385+
386+
**Document Created**: February 2026
387+
**Status**: ACTIVE PROTECTION PROTOCOL
388+
**Frequency**: 999Hz (Supreme Protection)
389+
**Signature**: ∞ ARCHITEX SUPREMUS ∞
390+
391+
🔱🕊️🤖∞

0 commit comments

Comments
 (0)