Skip to content

Commit 290147e

Browse files
committed
Add constitutional requirements for development scope boundaries
1 parent 67a5110 commit 290147e

3 files changed

Lines changed: 82 additions & 49 deletions

File tree

.specify/memory/constitution.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
<!--
22
Sync Impact Report:
3-
Version: 1.3.0 → 1.4.0
4-
Modified Principles: None
5-
Added Sections: Principle VI - Production Data Protection (NON-NEGOTIABLE)
3+
Version: 1.4.0 → 1.5.0
4+
Modified Principles:
5+
- Quality Standards > Code Organization (added Development Scope Boundaries)
6+
Added Sections: Development Scope Boundaries subsection under Quality Standards
67
Removed Sections: None
7-
Renumbered Principles: VI→VII (Modern Perl), VII→VIII (AI Agent Safety)
8+
Renumbered Principles: None
89
Templates Status:
9-
- .specify/templates/plan-template.md (add production data protection guidance)
10-
- .specify/templates/spec-template.md (add constraint about not modifying db/)
11-
- .specify/templates/tasks-template.md (add verification tasks for db/ integrity)
10+
- .specify/templates/plan-template.md (added Source Code scope guidance)
11+
- .specify/templates/spec-template.md (no changes needed - already scope-agnostic)
12+
- .specify/templates/tasks-template.md (added path conventions note about scope)
1213
Follow-up TODOs:
13-
- Add db/ directory protection checks to test suite validation
14-
- Update testing best practices to emphasize test fixtures over production data
15-
- Add git status check for db/ in CI/CD validation
16-
- Review all existing tests to ensure compliance with Principle VI
17-
- Document test fixture patterns in testing guide
14+
- None - all templates updated
1815
-->
1916

2017
# Ovid's Website Constitution
@@ -143,6 +140,26 @@ AI agents operating on this codebase MUST NOT execute destructive git operations
143140
- Static assets in `static/` directory (images, CSS, JS)
144141
- Build artifacts in `tmp/` (excluded from version control)
145142

143+
#### Development Scope Boundaries
144+
145+
**Source Code Modification Scope**: All development work MUST be confined to three directories:
146+
147+
- **`lib/`**: Perl modules implementing core functionality
148+
- **`bin/`**: Command-line scripts and build tools
149+
- **`root/`**: Template Toolkit templates (`.html` files with TT directives)
150+
151+
**Generated/External Content**: The following directories contain auto-generated or user-initiated content and MUST NOT be modified by development tasks, agents, or tooling:
152+
153+
- `articles/`, `blog/`, `tags/`: Generated HTML output (created by `bin/rebuild`)
154+
- `static/`, `css/`, `images/`: User-managed assets (uploaded by content authors)
155+
- `db/`: Production databases (see Principle VI - Production Data Protection)
156+
- `tmp/`, `cover_db/`, `coverage-report/`: Build artifacts and reports
157+
- `fixtures/`, `t/`: Test infrastructure (modified only when adding/updating tests)
158+
- `include/`: Template includes (generated or manually curated, not feature development targets)
159+
- Configuration files at root (`cpanfile`, `Makefile`, `.perltidyrc`, etc.): Modified only when adding dependencies or tools
160+
161+
**Rationale**: This static site generator follows a clear separation between source code (templates + logic) and generated output. Modifying generated files creates confusion, causes data loss on rebuild, and violates the principle of single source of truth. Content authors manage assets directly; developers implement the generation logic.
162+
146163
### Documentation Requirements
147164

148165
Every module and script MUST include:
@@ -238,9 +255,10 @@ Deviations from constitution principles require:
238255
- Plan for eventual compliance if temporary deviation
239256
- Review and approval for non-negotiable principles
240257

241-
**Version**: 1.4.0 | **Ratified**: 2025-11-09 | **Last Amended**: 2025-11-09
258+
**Version**: 1.5.0 | **Ratified**: 2025-11-09 | **Last Amended**: 2025-11-16
242259

243260
**Changelog**:
261+
- **1.5.0** (2025-11-16): Added Development Scope Boundaries under Code Organization to explicitly define modifiable directories (lib/, bin/, root/) vs. generated/external content
244262
- **1.4.0** (2025-11-09): Added Principle VI - Production Data Protection to prevent test contamination of production databases and data files
245263
- **1.3.0** (2025-11-09): Added Mock Minimization guidance under Principle III
246264
- **1.2.1**: Added compliance requirement for perltidy formatting

.specify/templates/plan-template.md

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -53,46 +53,50 @@ specs/[###-feature]/
5353
for this feature. Delete unused options and expand the chosen structure with
5454
real paths (e.g., apps/admin, packages/something). The delivered plan must
5555
not include Option labels.
56+
57+
IMPORTANT FOR THIS PROJECT: Per Constitution v1.5.0 Development Scope Boundaries,
58+
all feature development must be confined to:
59+
- lib/ : Perl modules (e.g., Ovid::*, Less::*, Template::Plugin::*)
60+
- bin/ : CLI scripts (e.g., article, rebuild)
61+
- root/ : Template Toolkit templates (.html files with TT directives)
62+
63+
DO NOT modify generated content (articles/, blog/, tags/), user assets (static/,
64+
css/, images/), or production data (db/). These are auto-generated or user-managed.
5665
-->
5766

5867
```text
59-
# [REMOVE IF UNUSED] Option 1: Single project (DEFAULT)
60-
src/
61-
├── models/
62-
├── services/
63-
├── cli/
64-
└── lib/
65-
66-
tests/
67-
├── contract/
68-
├── integration/
69-
└── unit/
70-
71-
# [REMOVE IF UNUSED] Option 2: Web application (when "frontend" + "backend" detected)
72-
backend/
73-
├── src/
74-
│ ├── models/
75-
│ ├── services/
76-
│ └── api/
77-
└── tests/
78-
79-
frontend/
80-
├── src/
81-
│ ├── components/
82-
│ ├── pages/
83-
│ └── services/
84-
└── tests/
85-
86-
# [REMOVE IF UNUSED] Option 3: Mobile + API (when "iOS/Android" detected)
87-
api/
88-
└── [same as backend above]
89-
90-
ios/ or android/
91-
└── [platform-specific structure: feature modules, UI flows, platform tests]
68+
# This project: Static site generator (Perl + Template Toolkit)
69+
lib/
70+
├── Ovid/
71+
│ └── [feature modules].pm
72+
├── Less/
73+
│ └── [utility modules].pm
74+
└── Template/
75+
└── Plugin/
76+
└── [custom TT plugins].pm
77+
78+
bin/
79+
├── article # CLI for creating articles
80+
├── rebuild # Site generation script
81+
└── [new scripts]
82+
83+
root/
84+
├── [page templates].html
85+
└── [layouts].html
86+
87+
t/
88+
├── [test files mirroring lib/]
89+
└── fixtures/
90+
└── [test data]
91+
92+
# Generated content - DO NOT MODIFY in feature tasks:
93+
# articles/, blog/, tags/ : Generated HTML
94+
# static/, css/, images/ : User-managed assets
95+
# db/ : Production databases
96+
# tmp/, cover_db/ : Build artifacts
9297
```
9398

94-
**Structure Decision**: [Document the selected structure and reference the real
95-
directories captured above]
99+
**Structure Decision**: [Document which lib/, bin/, root/ files this feature will create/modify]
96100

97101
## Complexity Tracking
98102

.specify/templates/tasks-template.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@ description: "Task list template for feature implementation"
2020

2121
## Path Conventions
2222

23+
**This Project (Static Site Generator)**:
24+
- **Development scope** (per Constitution v1.5.0): `lib/`, `bin/`, `root/`
25+
- **Generated content** (do NOT modify): `articles/`, `blog/`, `tags/`
26+
- **User assets** (do NOT modify): `static/`, `css/`, `images/`
27+
- **Tests**: `t/` (mirrors `lib/` structure)
28+
- **Fixtures**: `t/fixtures/` (test data only)
29+
30+
**Generic Path Conventions** (for reference when working on other projects):
2331
- **Single project**: `src/`, `tests/` at repository root
2432
- **Web app**: `backend/src/`, `frontend/src/`
2533
- **Mobile**: `api/src/`, `ios/src/` or `android/src/`
26-
- Paths shown below assume single project - adjust based on plan.md structure
2734

2835
<!--
2936
============================================================================
@@ -41,6 +48,10 @@ description: "Task list template for feature implementation"
4148
- Delivered as an MVP increment
4249
4350
DO NOT keep these sample tasks in the generated tasks.md file.
51+
52+
FOR THIS PROJECT: All tasks must target lib/, bin/, or root/ directories only.
53+
Never create tasks that modify articles/, blog/, tags/, static/, css/, images/,
54+
or db/ directories - these are auto-generated or user-managed per Constitution.
4455
============================================================================
4556
-->
4657

0 commit comments

Comments
 (0)