Skip to content

Commit 568a606

Browse files
authored
Reconcile product direction and repair responsive foundation (#34)
Reconciles product and launch documentation with the deployed application, adds the repository development contract and canonical roadmap, and repairs hero and tablet responsive behavior.
1 parent 9bf1e54 commit 568a606

7 files changed

Lines changed: 274 additions & 49 deletions

File tree

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Hafa Code development contract
2+
3+
## Product boundary
4+
5+
Hafa Code is a beginner-first browser coding workspace for Code School of Guam, Father Dueñas students, instructors, mentors, and alumni. Keep the first loop—open, write, run, understand, revise—simple. Rails stores source and classroom records but never executes learner code.
6+
7+
Browser runtimes belong in dedicated workers. Web output belongs in the sandboxed preview. A remote terminal or general server-side execution environment is a separate product and security boundary.
8+
9+
## Repository shape
10+
11+
- `web/`: React, TypeScript, Vite, Monaco, browser runners, learning tools, and PWA assets.
12+
- `api/`: Rails API, Clerk authentication, PostgreSQL persistence, classroom permissions, feedback, sharing, and audit records.
13+
- `docs/`: current product, architecture, security, and launch decisions.
14+
15+
Add project kinds and file-language behavior through `web/src/lib/languageRegistry.ts`. A supported language also needs storage/import validation, runner behavior, a guide, Practice Lab coverage, error coaching, tests, and documentation. Do not add parallel language switches inside UI components.
16+
17+
## Local development
18+
19+
- Frontend: `npm --prefix web run dev -- --host 127.0.0.1 --port 5173 --strictPort`
20+
- Rails API: `(cd api && bin/rails server -b 127.0.0.1 -p 3000)`
21+
- Full gate: `./scripts/gate.sh`
22+
- Frontend-only gate: `npm --prefix web run lint && npm --prefix web test && npm --prefix web run build && npm --prefix web audit --audit-level=high`
23+
24+
Ports are configurable. Use distinct strict ports when another session already owns the defaults. Record and clean only resources started by the current session; never stop a borrowed listener, simulator, browser tab, database, or container.
25+
26+
The app can run without Clerk as a local-only playground. Do not copy real credentials into documentation, tests, commits, or PR descriptions.
27+
28+
## Change rules
29+
30+
- Preserve the focused Learn workspace and its mobile navigation.
31+
- Keep instructor access to student projects read-only unless a separately approved collaboration mode changes that contract.
32+
- Use project language from the registry, deterministic learning checks, and complete starter files.
33+
- Keep new runtime dependencies lazy and measure first-run and warm-run behavior.
34+
- Maintain keyboard access, visible focus, reduced-motion support, non-color status cues, and practical 44px touch targets.
35+
- Test responsive UI at 390x844, 768x1024, 1280x720, and a wide desktop size.
36+
- Never weaken CSP, worker isolation, iframe sandboxing, authorization, or project validation merely to make a runtime easier to add.
37+
38+
## Pull-request gate
39+
40+
Before opening a PR, run the full gate and the affected flow in a real browser. After pushing, require green GitHub checks and a CodeRabbit review of the current head. Verify every review finding against the code, fix valid findings with regression coverage, and request a new review after each pushed fix. Merge only when the current head is clean and the task has explicit merge authorization.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Hafa Code
22

3-
A simple open-source coding playground for Code School of Guam, Father Dueñas students, alumni, and anyone learning to code.
3+
A beginner-first, open-source coding workspace for Code School of Guam, Father Dueñas students, alumni, and anyone learning to code.
44

55
## Vision
66

7-
A lightweight alternative to Replit focused on the languages CSG actually teaches first:
7+
A focused alternative to Replit that removes installation and account friction from the first coding session:
88

99
- Ruby snippets powered by `ruby.wasm`
1010
- JavaScript snippets powered by QuickJS in a Web Worker
@@ -15,7 +15,9 @@ A lightweight alternative to Replit focused on the languages CSG actually teache
1515
- Save, fork, share, and remix beginner-friendly projects
1616
- Optional Clerk sign-in with Rails-backed cloud projects
1717

18-
This project intentionally starts smaller than Replit. The first version should be fast, safe, cheap to host, and approachable for students to contribute to.
18+
Hafa Code intentionally stays smaller than a general cloud IDE. It keeps the first learning loop—open, write, run, understand, revise—fast and approachable, while classroom organizations add teacher visibility and feedback without giving teachers edit access to student source.
19+
20+
Untrusted programs run in isolated browser workers or a sandboxed preview. Rails stores projects and classroom records; it does not execute student code. This keeps the hosted service comparatively inexpensive and avoids placing a general code-execution service beside student data.
1921

2022
## Monorepo
2123

@@ -28,6 +30,7 @@ hafa-code/
2830
## Planning Docs
2931

3032
- [Product spec](docs/PRODUCT_SPEC.md)
33+
- [Product roadmap](docs/PRODUCT_ROADMAP.md)
3134
- [Architecture](docs/ARCHITECTURE.md)
3235
- [Frontend structure](docs/FRONTEND_STRUCTURE.md)
3336
- [Security model](docs/SECURITY.md)
@@ -50,6 +53,8 @@ Java is intentionally a focused practice environment rather than a full desktop
5053

5154
## Development
5255

56+
The repository contract, ports, architecture boundaries, and complete validation gate are documented in [AGENTS.md](AGENTS.md).
57+
5358
```bash
5459
# frontend
5560
npm --prefix web install

docs/ARCHITECTURE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Benefits:
3737
- works well for snippets and web pages
3838
- easy for OSS contributors to run locally
3939

40+
This boundary is also a product decision. Hafa Code is optimized for the short beginner loop, not for packages, shell access, deployment, or arbitrary backend frameworks. A future remote advanced workspace would be a separate authenticated system with its own isolation, cost, and operations model; it must not weaken the Learn workspace.
41+
4042
## Runners
4143

4244
### Ruby
@@ -124,6 +126,8 @@ type ProjectFile = {
124126
}
125127
```
126128
129+
`ProjectKind` and file-language behavior are implemented through the frontend language registry. New language work must extend that registry, runner protocol, guide, Practice Lab, error coaching, storage validation, import/export behavior, and documentation together rather than adding component-specific switches.
130+
127131
## Backend Choice
128132
129133
Hafa Code uses the same broad shape as other Shimizu/CSG apps: Rails API + React frontend.

0 commit comments

Comments
 (0)