docs: add architecture and full audit; fill project templates (.gitignore, scripts/test.sh) per audit findings
Some checks failed
ci / test (push) Has been cancelled

This commit is contained in:
2025-09-17 11:11:07 -05:00
parent e1b3cd5634
commit bae62d94dc
6 changed files with 145 additions and 0 deletions

34
docs/architecture.md Normal file
View File

@@ -0,0 +1,34 @@
# CodexHelper — Architecture (Phase 1)
Overview
- Goal: Bash wrapper around `codex`/`codex-cli` with modes, project scaffolding, prompt composition, config precedence, and safety.
- Constraints: TDD, zero technical debt, plan-first, clean root, CI via Gitea with local Docker parity.
Modules
- CLI Entrypoint (`CodexHelper`)
- Subcommands: `new-mode` (repo-only), `new-project` (outside repo), `run` (outside repo)
- Guardrails: detect helper repo by structure; block disallowed subcommands
- Binary Detection: `CODEX_BIN` > `codex` > `codex-cli`
- Flag Pass-through: `--mode`, `--prompt-file`, `--config`, `--sandbox`, `--full-auto`, `--`
- Scaffolding
- Modes: `modes/<Name>/{mode.md, defaults.yaml, system.md?}` with intake hints
- Projects: `AGENTS.md`, `prompts/{project.md,style.md?}`, `prompts/_mode/` (copies of global/mode prompts), `codex.yaml`, `codex.sh`, `.gitignore`, CI/containers templates
- Run Engine
- Validate project layout
- Compose prompts (global system → mode system? → mode rules → project narrative)
- Invoke `$CODEX_BIN` with pass-through flags; write artifacts under `runs/<ts>/`
- Config
- YAML via `yq`: global defaults < mode defaults < project config < ENV < CLI
Cross-cutting
- Tests: `tests/` via bats or fallback; Docker Compose runner for local parity; Gitea Actions for CI
- Docs: `README.md`, `docs/wrapper.md`, `docs/architecture.md`, DevLogs
- Governance: propagation updates applied to prompts/global and AGENTS templates
Assumptions
- `yq` available in containers; host only orchestrates Docker and git/tea.
- codex auth may require host mounts; handled via project `codex.sh` composition.