2026-04-12 03:51:48 +00:00
# Contributing to The Nexus
2026-03-25 17:46:48 +00:00
2026-04-12 03:51:48 +00:00
## Issue Assignment — The Lock Protocol
2026-03-25 17:46:48 +00:00
2026-04-12 03:51:48 +00:00
**Rule: Assign before you code.**
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
Before starting work on any issue, you **must ** assign it to yourself. If an issue is already assigned to someone else, **do not submit a competing PR ** .
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
### For Humans
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
1. Check the issue is unassigned
2. Assign yourself via the Gitea UI (right sidebar → Assignees)
3. Start coding
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
### For Agents (Claude, Perplexity, Mimo, etc.)
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
1. Before generating code, call the Gitea API to check assignment:
```
GET /api/v1/repos/{owner}/{repo}/issues/{number}
→ Check assignees array
```
2. If unassigned, self-assign:
```
POST /api/v1/repos/{owner}/{repo}/issues/{number}/assignees
{"assignees": ["your-username"]}
```
3. If already assigned, **stop ** . Post a comment offering to help instead.
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
### Why This Matters
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
On April 11, 2026, we found 12 stale PRs caused by Rockachopa and the `[claude]` auto-bot racing on the same issues. The auto-bot merged first, orphaning the manual PRs. Assignment-as-lock prevents this race condition.
2026-04-07 10:12:58 +00:00
2026-04-12 03:51:48 +00:00
---
2026-04-07 06:43:13 +00:00
2026-04-07 07:47:01 +00:00
## Branch Protection & Review Policy
2026-04-12 03:51:48 +00:00
All repositories enforce these rules on `main` :
2026-04-07 07:47:01 +00:00
2026-04-12 03:51:48 +00:00
| Rule | Status |
|------|--------|
| Require Pull Request for merge | ✅ Enabled |
| Require 1 approval before merge | ✅ Enabled |
| Dismiss stale approvals on new commits | ✅ Enabled |
| Require CI to pass (where CI exists) | ⚠️ Conditional |
| Block force pushes to `main` | ✅ Enabled |
| Block deletion of `main` branch | ✅ Enabled |
2026-04-07 07:47:01 +00:00
### Default Reviewer Assignments
| Repository | Required Reviewers |
2026-04-12 03:51:48 +00:00
|------------|-------------------|
2026-04-07 07:47:01 +00:00
| `hermes-agent` | `@perplexity` , `@Timmy` |
| `the-nexus` | `@perplexity` |
| `timmy-home` | `@perplexity` |
| `timmy-config` | `@perplexity` |
### CI Enforcement Status
| Repository | CI Status |
|------------|-----------|
| `hermes-agent` | ✅ Active |
| `the-nexus` | ⚠️ CI runner pending (#915 ) |
| `timmy-home` | ❌ No CI |
| `timmy-config` | ❌ Limited CI |
2026-04-12 03:51:48 +00:00
---
2026-04-07 07:47:01 +00:00
2026-04-12 03:51:48 +00:00
## Branch Naming
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
Use descriptive prefixes:
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
| Prefix | Use |
|--------|-----|
| `feat/` | New features |
| `fix/` | Bug fixes |
| `epic/` | Multi-issue epic branches |
| `docs/` | Documentation only |
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
Example: `feat/mnemosyne-memory-decay`
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
---
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
## PR Requirements
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
1. **Rebase before merge ** — PRs must be up-to-date with `main` . If you have merge conflicts, rebase locally and force-push.
2. **Reference the issue ** — Use `Closes #NNN` in the PR body so Gitea auto-closes the issue on merge.
3. **No bytecode ** — Never commit `__pycache__/` or `.pyc` files. The `.gitignore` handles this, but double-check.
4. **One feature per PR ** — Avoid omnibus PRs that bundle multiple unrelated features. They're harder to review and more likely to conflict.
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
---
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
## Path Conventions
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
| Module | Canon Path |
|--------|-----------|
| Mnemosyne (backend) | `nexus/mnemosyne/` |
| Mnemosyne (frontend) | `nexus/components/` |
| MemPalace | `nexus/mempalace/` |
| Scripts/tools | `bin/` |
| Git hooks/automation | `.githooks/` |
| Tests | `nexus/mnemosyne/tests/` |
2026-04-07 06:43:13 +00:00
2026-04-12 03:51:48 +00:00
**Never** create a duplicate module at the repo root (e.g., `mnemosyne/` when `nexus/mnemosyne/` already exists). Check `FEATURES.yaml` manifests for the canonical path.
2026-04-07 07:48:57 +00:00
2026-04-12 03:51:48 +00:00
---
2026-04-07 07:48:57 +00:00
2026-04-12 03:51:48 +00:00
## Feature Manifests
2026-04-07 07:48:57 +00:00
2026-04-12 03:51:48 +00:00
Each major module maintains a `FEATURES.yaml` manifest that declares:
- What exists (status: `shipped` )
- What's in progress (status: `in-progress` , with assignee)
- What's planned (status: `planned` )
2026-04-07 08:20:25 +00:00
2026-04-12 03:51:48 +00:00
**Check the manifest before creating new PRs.** If your feature is already shipped, you're duplicating work. If it's in-progress by someone else, coordinate.
2026-04-07 09:28:55 +00:00
2026-04-12 03:51:48 +00:00
Current manifests:
- [`nexus/mnemosyne/FEATURES.yaml` ](nexus/mnemosyne/FEATURES.yaml )
2026-04-07 09:45:30 +00:00
2026-04-12 03:51:48 +00:00
---
2026-04-07 09:45:30 +00:00
2026-04-12 03:51:48 +00:00
## Workflow
2026-04-07 09:28:55 +00:00
2026-04-12 03:51:48 +00:00
1. Check the issue is unassigned → self-assign
2. Check `FEATURES.yaml` for the relevant module
3. Create feature branch from `main`
4. Submit PR with clear description and `Closes #NNN`
5. Wait for reviewer approval
6. Rebase if needed, then merge
2026-04-07 09:28:55 +00:00
2026-04-12 03:51:48 +00:00
### Emergency Exceptions
2026-04-07 09:28:55 +00:00
2026-04-12 03:51:48 +00:00
Hotfixes require:
- ✅ @Timmy approval
- ✅ Post-merge documentation
- ✅ Follow-up PR for full review
2026-04-07 09:28:55 +00:00
2026-04-12 03:51:48 +00:00
---
2026-04-07 09:28:55 +00:00
2026-04-12 03:51:48 +00:00
## Stale PR Policy
2026-04-07 09:28:55 +00:00
2026-04-12 03:51:48 +00:00
A cron job runs every 6 hours and auto-closes PRs that are:
1. **Conflicted ** (not mergeable)
2. **Superseded ** by a merged PR that closes the same issue or implements the same feature
2026-04-07 08:57:50 +00:00
2026-04-12 03:51:48 +00:00
Closed PRs receive a comment explaining which PR superseded them. If your PR was auto-closed but contains unique work, reopen it, rebase against `main` , and update the feature manifest.
2026-04-07 08:57:50 +00:00
2026-04-12 03:51:48 +00:00
---
2026-04-07 08:57:50 +00:00
## CI/CD Requirements
2026-04-07 09:04:20 +00:00
2026-04-12 03:51:48 +00:00
All main branch merges require (where applicable):
- ✅ Linting
- ✅ Unit tests
- ⚠️ Integration tests (pending for the-nexus, see #915 )
- ✅ Security scans