Skip to content

Commit 81191ac

Browse files
authored
Fix docs (#93)
* fix docs * fix it * bump versin * ok nice
1 parent b4e77c6 commit 81191ac

3 files changed

Lines changed: 56 additions & 6 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CLI Branch Guard
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
check-cli-changes:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check for CLI changes
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Fail if cli/ changed
17+
run: |
18+
CHANGED_FILES=$(git diff --name-only origin/main...HEAD -- cli/)
19+
if [ -n "$CHANGED_FILES" ]; then
20+
echo "::error::Direct PRs to main cannot include cli/ changes."
21+
echo "::error::CLI changes must go through the 'next' branch first."
22+
echo ""
23+
echo "Changed files in cli/:"
24+
echo "$CHANGED_FILES"
25+
echo ""
26+
echo "To fix: target your PR to 'next' instead of 'main'"
27+
exit 1
28+
fi
29+
echo "No cli/ changes detected. PR can proceed."

.specify/memory/constitution.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<!--
22
Sync Impact Report
33
===================
4-
Version change: 1.3.0 -> 1.3.1
4+
Version change: 1.3.1 -> 1.4.0
55
6-
Modified principles:
7-
- VI. Minimal Code: Added explicit NO DEPRECATED FUNCTIONS, NO BACKWARDS-COMPAT SHIMS,
8-
DELETE TESTS FOR DELETED CODE rules. Updated rationale to emphasize single maintainer.
6+
Modified principles: N/A
97
108
Added sections:
119
- Core Principles V. Dogfooding (1.1.0)
1210
- Core Principles VI. Minimal Code (1.2.0)
1311
- Core Principles VII. Single Code Path (1.3.0)
12+
- Core Principles VIII. Fail Fast (1.4.0)
1413
1514
Removed sections: N/A
1615
1716
Templates requiring updates:
1817
- .specify/templates/plan-template.md: Add Dogfooding to Constitution Check table [DONE]
1918
- .specify/templates/plan-template.md: Add Minimal Code to Constitution Check table
2019
- .specify/templates/plan-template.md: Add Single Code Path to Constitution Check table
20+
- .specify/templates/plan-template.md: Add Fail Fast to Constitution Check table
2121
2222
Follow-up TODOs: None
2323
-->
@@ -160,6 +160,21 @@ parse → validate → execute
160160

161161
**Rationale**: We don't want command-specific bugs. We don't want to maintain multiple code paths. Keep it simple. Keep it DRY. No one wants wet code.
162162

163+
### VIII. Fail Fast
164+
165+
Code MUST fail immediately and loudly when something is wrong. Silent failures and deferred errors are bugs.
166+
167+
- Use assertions liberally. If a condition should never happen, assert it.
168+
- Validate inputs at the boundary. Reject garbage immediately, don't propagate it.
169+
- Panic on impossible states rather than returning meaningless defaults.
170+
- Error messages MUST be specific: what failed, why, and where.
171+
- NO defensive coding that papers over bugs. If caller passes nil, panic. Don't check and silently return.
172+
- NO "graceful degradation" that hides broken behavior. If it's broken, STOP.
173+
- Prefer hard crashes over corrupted state. A crash is debuggable. Corrupted data is a nightmare.
174+
- Tests MUST assert behavior, not just "run without error". A test that doesn't assert is not a test.
175+
176+
**Rationale**: The earlier you find a bug, the cheaper it is to fix. Assertions and hard failures surface bugs at development time, not in production. Whimsy code that "handles" errors by ignoring them creates debugging nightmares. Fail hard, fail fast, fix it now.
177+
163178
## Quality Standards
164179

165180
### Testing Requirements
@@ -230,4 +245,4 @@ All contributions MUST comply with these principles.
230245
- Complexity MUST be justified in PR descriptions
231246
- Principle violations require explicit exemption with documented rationale
232247

233-
**Version**: 1.3.1 | **Ratified**: 2025-10-14 | **Last Amended**: 2026-01-03
248+
**Version**: 1.4.0 | **Ratified**: 2025-10-14 | **Last Amended**: 2026-01-04

cli/scripts/gendocs.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ import (
1212
)
1313

1414
func main() {
15-
outputDir := "./web/app/_docs"
15+
outputDir := "../apps/web/app/_docs"
1616
if len(os.Args) > 1 {
1717
outputDir = os.Args[1]
1818
}
1919

20+
// Verify the parent path exists (apps/web/app) - fail fast if structure is wrong
21+
parentDir := strings.TrimSuffix(outputDir, "/_docs")
22+
if _, err := os.Stat(parentDir); os.IsNotExist(err) {
23+
log.Fatalf("web app not found at %s - did the directory structure change?", parentDir)
24+
}
25+
2026
if err := os.MkdirAll(outputDir, 0755); err != nil {
2127
log.Fatalf("failed to create output dir: %v", err)
2228
}

0 commit comments

Comments
 (0)