feat(eliminate-frontend-makefile): task 3.3 - update live documentation (11 files)
Removes every live current-fact reference to src/frontend/Makefile targets or Makefile-specific fixed paths across 11 docs (steering, frontend/CLAUDE.md, root CLAUDE.md, deployment docs, and two skill docs), replacing with the Meson-based equivalents established by tasks 1-3.2: /xce-build apiserver, meson test --suite apiserver, direct tests/regression/run.sh invocation. Round-1 review rejected the first pass: xce-deploy-ha/SKILL.md had over-corrected by deleting all mention of deploy-ha.sh's still-real /tmp/apiserver legacy fallback (that script's discovery logic is unchanged, unlike run-resource-verify.sh's, which genuinely lost its fallback in task 3.1 -- xce-test-resources/SKILL.md's identical- looking edit was correct for that reason). Fixed by restoring an accurate, Makefile-free description of the real fallback at all four touched sites. Re-reviewed and approved. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XYdtrEWWZfKRRGED7raEYg
This commit is contained in:
parent
483cac3dcb
commit
f5fbc6bcac
12 changed files with 56 additions and 48 deletions
|
|
@ -37,7 +37,7 @@
|
|||
- _Boundary: deploy-ha.sh, tests/regression/run.sh_
|
||||
- _Depends: 1.1, 2_
|
||||
|
||||
- [ ] 3.3 (P) Update live steering, skill, and status documentation
|
||||
- [x] 3.3 (P) Update live steering, skill, and status documentation
|
||||
- Update every current-fact reference to a `src/frontend/Makefile` target or a Makefile-specific fixed path in: `tech.md` (Build Systems table and code block, plus the "Testing Requirements" lines), `build-deployment.md` (Go Frontend Build section), `testing.md` (Build targets bullets, Philosophy line, and the "What Not to Mock" CGO-bridge line), `structure.md`, `frontend/CLAUDE.md`, root `CLAUDE.md`'s Key Files entry, `src/docs/deployment.md`'s Build gotcha section, `xce-deploy-ha/SKILL.md` (all four references, including the Step 4d intro), `xce-test-resources/SKILL.md`'s `$XCE_RESVERIFY_APISERVER_BIN` default description, `src/frontend/docs/status.md`, and `src/docs/apiserver-backend-tasks.md`
|
||||
- Replace each with the equivalent Meson-based guidance (`/xce-build apiserver`, `meson test --suite apiserver`, direct `tests/regression/run.sh` invocation) already established by tasks 1-3.2
|
||||
- Observable: none of the 11 files contains a live `make (build-server|build-cli|test|test-backend|test-integration|test-all)` or `/tmp/apiserver`/`/tmp/xce_static` reference presented as current fact
|
||||
|
|
@ -83,5 +83,6 @@
|
|||
|
||||
## Implementation Notes
|
||||
|
||||
- Task 3.3 (round 1 rejection, fixed in round 2): when removing a stale Makefile reference from a doc, check whether the underlying script it describes still has a genuine fallback behavior before deleting the mention entirely. `run-resource-verify.sh` (task 3.1) removed its `/tmp/apiserver` fallback outright, so `xce-test-resources/SKILL.md` correctly dropped all mention of it. `deploy-ha.sh` (task 3.2) deliberately KEPT its `/tmp/apiserver` fallback logic (only removed the `make build-server` association from its text) — so `xce-deploy-ha/SKILL.md` needed to keep describing that fallback accurately (just without the Make instruction), not delete it. Two visually-similar edits, two different correct outcomes, because the two underlying scripts' behaviors diverged.
|
||||
- Task 2: `/xce-build all` currently aborts (`set -euo pipefail`) at the pre-existing `meson test --print-errorlogs` step, BEFORE reaching the migrated Go-test line — two unrelated, already-logged C-side failures (bug-1723, LeakSanitizer on `xcelib_test`; bug-1758, `sched_core_events_test` deterministic failure), both predating this spec. Task 2's `all`-case line itself is verified (byte-identical to the fully-verified `apiserver`-case line), but this means task 4.1's "final go/no-go gate" and task 4.2's post-deletion re-validation will hit the SAME pre-existing abort when running `/xce-build all` — those tasks will need to either scope their validation to `/xce-build apiserver` + a separate `meson test` invocation that tolerates these 2 known-unrelated failures, or note them as pre-existing/out-of-scope rather than treating them as a regression from this spec.
|
||||
- Task 1.2: design.md's Testing Strategy suggests `librtti_dep` as the example dependency to remove when proving the new backend test() exercises the real CGO path. Empirically (implementer + independent reviewer both reproduced this live), removing `librtti_dep` does NOT reproduce a link failure for the `apiserver/backend/...` test package — none of `librtti`'s exported symbols are actually pulled into this specific link unit's undefined-symbol set. `c_capnproto_dep` (real `capn_*` undefined-reference errors from `request.c`/`controller.capnp.c`) is the dependency that genuinely reproduces the failure and was used instead. `apiserver_cgo_deps` itself was left byte-identical to task 1.1's state (verification-only task, no permanent code change).
|
||||
|
|
|
|||
|
|
@ -137,14 +137,13 @@ kill -9 $(pgrep xce_scheduler) 2>/dev/null || true
|
|||
|
||||
## Go Frontend Build
|
||||
|
||||
Go builds use `src/frontend/Makefile` for development, Meson for production:
|
||||
Go builds use Meson for both development and production — apiserver and xcecli have no separate build system:
|
||||
|
||||
```bash
|
||||
make build-server # → /tmp/apiserver
|
||||
make build-cli # → /tmp/xce_static (CGO_ENABLED=0)
|
||||
make test # unit tests (CGO_ENABLED=0)
|
||||
make test-backend # CGO-backed backend tests (needs nix dev shell)
|
||||
make test-integration # full regression suite (needs XCE_BIN + SRV_URL)
|
||||
/xce-build apiserver # → <build_dir>/frontend/apiserver/xce_apiserver, xcecli; runs unit tests (CGO_ENABLED=0)
|
||||
meson test -C <build_dir> --suite apiserver # CGO-backed backend tests (needs nix dev shell)
|
||||
XCE=<build_dir>/frontend/xcecli/xcecli URL=<url> \
|
||||
src/frontend/tests/regression/run.sh # full regression suite
|
||||
```
|
||||
|
||||
Go modules are independent — `apiserver` and `xcecli` have separate `go.mod` files, no `go.work`.
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ Plugin-based components add their own subdirectory:
|
|||
**Go tests** (co-located `_test.go`):
|
||||
- Table-driven unit tests, `t.TempDir()` for fixtures
|
||||
- Global state reset helpers (e.g., `resetRBACState()`) for test isolation
|
||||
- `make test` = unit only; `make test-all` = unit + integration
|
||||
- `/xce-build apiserver` = unit tests only; add `meson test -C <build_dir> --suite apiserver` (backend) and `tests/regression/run.sh` (integration) for full coverage
|
||||
|
||||
## Code Organization Principles
|
||||
|
||||
|
|
|
|||
|
|
@ -27,19 +27,18 @@ All controller state is in-memory. No persistent database in the API tier; job/q
|
|||
|
||||
| System | Scope |
|
||||
|--------|-------|
|
||||
| **Meson ≥ 1.5** | C daemons + Go modules via `tools/go_build` wrapper |
|
||||
| **Make** | Go development loop (build/test) from `src/frontend/` |
|
||||
| **Meson ≥ 1.5** | C daemons + Go modules via `tools/go_build` wrapper — sole build/test path for apiserver/xcecli |
|
||||
| **Nix flakes** | Hermetic dev environment, AppImage packaging |
|
||||
|
||||
```bash
|
||||
# Full build (C + Go, debug + ASAN)
|
||||
/xce-build
|
||||
|
||||
# Go development loop (from src/frontend/)
|
||||
make build-server # → /tmp/apiserver
|
||||
make build-cli # → /tmp/xce_static (CGO_ENABLED=0)
|
||||
make test # unit tests
|
||||
make test-integration # regression suite (needs XCE_BIN + SRV_URL)
|
||||
# Go development loop (apiserver + xcecli)
|
||||
/xce-build apiserver # builds both binaries + runs unit tests
|
||||
meson test -C <build_dir> --suite apiserver # CGO-backed backend tests
|
||||
XCE=<build_dir>/frontend/xcecli/xcecli URL=http://localhost:8080 \
|
||||
src/frontend/tests/regression/run.sh # regression suite
|
||||
|
||||
# Nix package builds (from src/)
|
||||
nix build .#xcecore # C daemons + apiserver
|
||||
|
|
@ -78,8 +77,8 @@ Early return on every error. Log with zap fields before returning.
|
|||
- **TDD mandatory**: Write failing test first, then implementation.
|
||||
- **Go unit tests**: Table-driven, no external dependencies, `t.TempDir()` for fixtures.
|
||||
- **C tests**: Add test case in `testsuite/` before modifying implementation.
|
||||
- `make test` must pass without a live server.
|
||||
- `make test-integration` requires `XCE_BIN` + `SRV_URL` env vars.
|
||||
- `/xce-build apiserver`'s unit-test step must pass without a live server.
|
||||
- `tests/regression/run.sh` requires `XCE` + `URL` env vars.
|
||||
|
||||
### Code Formatting
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
- **TDD mandatory**: Write a failing test first, then the minimal implementation. The cycle is Red → Green → Refactor.
|
||||
- Test behavior, not implementation details.
|
||||
- Tests must run without a live server or external services.
|
||||
- A change is not complete until `make test` (and `make test-integration` where applicable) passes.
|
||||
- A change is not complete until `/xce-build apiserver`'s unit-test step (and `tests/regression/run.sh` where applicable) passes.
|
||||
|
||||
## Go Tests (apiserver / xcecli)
|
||||
|
||||
|
|
@ -44,9 +44,9 @@ func TestPermissions(t *testing.T) {
|
|||
**Fixtures**: use `t.TempDir()` for file-system state; never rely on absolute paths or external services.
|
||||
|
||||
**Build targets**:
|
||||
- `make test` — unit tests only (`CGO_ENABLED=0`)
|
||||
- `make test-backend` — CGO-backed backend tests (requires nix dev shell + build dir)
|
||||
- `make test-integration` — full regression suite (requires `XCE_BIN` and `SRV_URL` env vars)
|
||||
- `/xce-build apiserver` — unit tests only (`CGO_ENABLED=0`), plus the build
|
||||
- `meson test -C <build_dir> --suite apiserver` — CGO-backed backend tests (requires nix dev shell + build dir)
|
||||
- `tests/regression/run.sh` — full regression suite (requires `XCE` and `URL` env vars, run directly)
|
||||
|
||||
## C Tests (controller / scheduler / lib)
|
||||
|
||||
|
|
@ -92,4 +92,4 @@ extern void reset_ha_state(ha_state_t *s);
|
|||
- Mock **external dependencies only** (network calls, file I/O that crosses component boundaries)
|
||||
- Do **not** mock the system under test
|
||||
- In-memory stores (`store/`) are real — use them directly in unit tests
|
||||
- CGO bridge (`backend/`) is covered by `make test-backend` — do not stub it in unit tests
|
||||
- CGO bridge (`backend/`) is covered by `meson test -C <build_dir> --suite apiserver` — do not stub it in unit tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue