|
| 1 | +# FactorForge Agent Operating Rules |
| 2 | + |
| 3 | +> Implementation rules for any coding agent working in this repo. |
| 4 | +> Planning, job tracking, and workflow rules live in the PlantFormOrg private repo. |
| 5 | +
|
| 6 | +--- |
| 7 | + |
| 8 | +## 1. Repo Role |
| 9 | + |
| 10 | +FactorForge is the **public implementation repo**. |
| 11 | + |
| 12 | +- Source code: `src/factorforge/` |
| 13 | +- Scripts: `scripts/` |
| 14 | +- Tests: `tests/` |
| 15 | +- Docs: `docs/` (design, reports, model cards) |
| 16 | +- Configs: `configs/` |
| 17 | + |
| 18 | +Planning docs, job specs, and internal workflow tracking are in a separate private repo. Do not duplicate them here. |
| 19 | + |
| 20 | +## 2. Package Name |
| 21 | + |
| 22 | +The PyPI distribution name is **`factorforge-cds`** — install with `pip install factorforge-cds`. |
| 23 | +The Python import name is **`factorforge`** — not `codonforge`. |
| 24 | + |
| 25 | +```python |
| 26 | +from factorforge.ml.metrics import calculate_cai |
| 27 | +from factorforge.engines.v3.synonym_mask import build_synonym_mask |
| 28 | +``` |
| 29 | + |
| 30 | +Do not use `codonforge` in any import path, file path, or script. |
| 31 | + |
| 32 | +## 3. Branch & Commit Conventions |
| 33 | + |
| 34 | +Branch naming: |
| 35 | +``` |
| 36 | +feat/short-description |
| 37 | +fix/short-description |
| 38 | +docs/short-description |
| 39 | +chore/short-description |
| 40 | +``` |
| 41 | + |
| 42 | +Commit message format: |
| 43 | +``` |
| 44 | +feat: add Wolffia globosa codon table |
| 45 | +fix: correct GC% calculation for short sequences |
| 46 | +docs: update README installation section |
| 47 | +chore: bump version to 3.1.0 |
| 48 | +``` |
| 49 | + |
| 50 | +## 4. Source of Truth |
| 51 | + |
| 52 | +Before editing, read in this order: |
| 53 | + |
| 54 | +1. Current repo code |
| 55 | +2. `docs/reports/v3_audit_report.md` — v2/v3 audit findings |
| 56 | +3. `docs/design/v3_alpha_product_boundary.md` — claims policy |
| 57 | + |
| 58 | +## 5. Scope Guardrails |
| 59 | + |
| 60 | +Do not change without an explicit job: |
| 61 | +- v2 optimizer production behavior (`src/factorforge/engines/v2/`) |
| 62 | +- CodonTokenizer vocab or special token definitions |
| 63 | +- Codon table values |
| 64 | + |
| 65 | +Treat as read-mostly unless the active job targets them: |
| 66 | +- `experiments/` — results storage only |
| 67 | +- `models/` — checkpoints; do not commit `.pt`/`.ckpt`/`.bin` files (see `.gitignore`) |
| 68 | + |
| 69 | +## 6. Claims Policy |
| 70 | + |
| 71 | +Do not add any of the following to code comments, docstrings, or docs: |
| 72 | + |
| 73 | +- "increases yield" |
| 74 | +- "guarantees expression" |
| 75 | +- "validated expression optimizer" |
| 76 | +- "wet-lab proven" |
| 77 | +- "production replacement for v2" |
| 78 | + |
| 79 | +v3-alpha is an **in-silico CDS design assistant and evidence layer**. |
| 80 | +v2 remains the production fallback until v3 shows consistent advantage on defined benchmarks. |
| 81 | + |
| 82 | +## 7. Code Style & Testing |
| 83 | + |
| 84 | +Before submitting a PR: |
| 85 | + |
| 86 | +```bash |
| 87 | +ruff check . # linting |
| 88 | +ruff format . # formatting |
| 89 | +pytest tests/ -v # all tests must pass |
| 90 | +``` |
| 91 | + |
| 92 | +New features must include tests. Bug fixes should add a regression test. |
| 93 | + |
| 94 | +## 8. Security |
| 95 | + |
| 96 | +Do **not** open a public GitHub issue for security vulnerabilities. |
| 97 | +Report privately to: eijex.lab@gmail.com |
| 98 | + |
| 99 | +## 9. Do Not Commit |
| 100 | + |
| 101 | +- `models/*.pt`, `models/*.ckpt`, `models/*.bin` — use Google Drive or HuggingFace |
| 102 | +- `data/raw/`, `data/embeddings/` — large files, Drive only |
| 103 | +- `CLAUDE.md`, `.claude/` — internal workflow files, not for public repo |
| 104 | +- `.env`, secrets of any kind |
| 105 | + |
| 106 | +## 10. Completion Report |
| 107 | + |
| 108 | +After completing a job, print to terminal: |
| 109 | + |
| 110 | +``` |
| 111 | +=== JOB NNN COMPLETE === |
| 112 | +Files created/modified: [list] |
| 113 | +Test results: [results or N/A] |
| 114 | +Notes: [if any, otherwise none] |
| 115 | +======================== |
| 116 | +``` |
| 117 | + |
| 118 | +## 11. Public Document Checklist |
| 119 | + |
| 120 | +After any change, update the relevant public-facing files before pushing: |
| 121 | + |
| 122 | +| Change type | Files to update | |
| 123 | +|-------------|----------------| |
| 124 | +| New feature / API change | `README.md`, `CHANGELOG.md` | |
| 125 | +| Bug fix | `CHANGELOG.md` | |
| 126 | +| Version bump | `pyproject.toml`, `CHANGELOG.md`, `src/factorforge/__init__.py` | |
| 127 | +| New distribution method | `README.md` (Installation), `CHANGELOG.md` | |
| 128 | +| Web UI change | `web/index.html`, `web/README.md` | |
| 129 | +| New engine / model | `docs/model_cards/`, `CHANGELOG.md` | |
| 130 | +| Wet-lab result added | `VALIDATION.md` | |
0 commit comments