# Harness Audit Last audited: 2026-06-26 This audit records the repository state used to add the agent harness. It is a compatibility note, not a replacement for existing rules or architecture docs. ## Existing Commands | Area | Existing Command | Notes | | --- | --- | --- | | Bootstrap | `./planet.sh init` | Syncs uv/Bun dependencies, creates missing env files, starts data services, seeds defaults. | | Start | `./planet.sh start` | Starts backend, frontend, AI Provider, PostgreSQL/Redis, and Motion Agent when available. | | LAN start | `./planet.sh start --allow-lan` | Opens frontend/backend/AI Provider ports and requests Windows firewall/port cleanup when needed. | | Restart | `./planet.sh restart` | Supports scoped restart flags for backend, frontend, AI Provider, database, and Motion Agent. | | Health | `./planet.sh health` | Checks containers, backend `/health`, AI Provider `/health`, frontend, and Motion Agent state. | | Logs | `./planet.sh log` | Supports backend, frontend, AI Provider, and Motion Agent log views. | | User fallback | `./planet.sh createuser` | Interactive emergency/local account creation. | | Destructive reset | `./planet.sh destroy` | Requires confirmation and removes Planet-owned Docker/build/runtime state. Not a validation command. | | Backend CI smoke | `cd backend && uv run --frozen --group dev --project .. python -m pytest -s tests/test_api.py tests/test_realtime_sources.py -q` | Mirrors `.gitea/workflows/ci.yaml`. | | Frontend build | `cd frontend && bun install --frozen-lockfile && bun run build` | Bun-only workflow. | | Root helper | `bun run mock:ais-ws` | Runs `scripts/mock-ais-ws-server.ts` from the root package. | ## Existing Agent Instructions | File | Status | Notes | | --- | --- | --- | | `AGENTS.md` | Present | Single authoritative agent behavior guide. It references `rules.md`, `project_context.md`, harness validation, and high-risk areas. | | `rules.md` | Present | Mandatory modular rules. Always load `core`, `security`, and `workflow`; load topic modules as needed. | | `project_context.md` | Present | Static context. Some roadmap-era stack details are older than the current README/docs. | | `.claude/commands/*.md` | Present | Existing command docs for cleanup, docs, goal-driven, and release workflows. | | `.codex/skills/*.md` | Present | Existing local skills for cleanup, docs, goal-driven, and release. | ## Existing CI Gates The repository uses `.gitea/workflows/`, not `.github/workflows/`. | Workflow | Gate | | --- | --- | | `.gitea/workflows/ci.yaml` | Backend smoke tests, frontend Bun build, Docker build smoke, Helm lint/template. | | `.gitea/workflows/release.yaml` | Builds and pushes frontend, backend, and AI Provider images on main/tag/manual release events. | | `.gitea/workflows/deploy-staging.yaml` | Deploys Helm release to staging and runs curl smoke tests inside the cluster. | ## Existing Docs And Architecture Maps | Area | Docs | | --- | --- | | Current architecture and startup | `README.md` | | Technical docs index | `docs/technical/zh/README.md`, `docs/technical/en/README.md` | | Documentation rules | `docs/documentation-coverage-rules.md` | | Operations | `docs/technical/zh/ops-runbook.md`, `docs/technical/en/ops-runbook.md` | | Startup internals | `docs/technical/zh/ops-planet-sh-startup.md`, `docs/technical/en/ops-planet-sh-startup.md` | | AI Provider | `docs/technical/zh/agents-aiprovider.md`, `docs/technical/en/agents-aiprovider.md` | | Frontend admin | `docs/technical/zh/frontend-admin-frontend-context.md`, `docs/technical/en/frontend-admin-frontend-context.md` | | Earth rendering | `docs/technical/zh/earth-frontend-context.md`, `docs/technical/zh/earth-render-layer-order.md`, `docs/technical/zh/earth-layer-style-reference.md` | | Plans and history | `docs/plans/README.md`, `docs/deprecated/README.md` | ## Release And Deploy Process - Release workflow is documented in `.codex/skills/release/SKILL.md` and `.claude/commands/release.md`. - Version-bearing files include `VERSION`, `frontend/package.json`, `pyproject.toml`, `uv.lock`, `docs/CHANGELOG.md`, and `docs/version-history.md`. - Delivery automation lives in `.gitea/workflows/release.yaml` and `.gitea/workflows/deploy-staging.yaml`. - Helm chart entry point is `deploy/helm/planet/Chart.yaml`. ## Missing Or Unclear Areas - The older lowercase `agents.md` entry has been merged into uppercase `AGENTS.md` so coding agents and harness tools use one source of truth. - `project_context.md` originally included older roadmap assumptions such as Celery, Kafka, TimescaleDB, MinIO, and UE5 as active stack elements. The harness pass updated it to separate active stack facts from future directions; current code and technical docs still remain authoritative when details drift. - No safe automatic hook system was already configured. This phase documents manual reminders instead of adding hooks. - `.github/workflows/` is absent by design; CI is under `.gitea/workflows/`. ## Conflicts And Preserved Rules | Conflict Or Tension | Resolution | | --- | --- | | Prompt suggested `AGENTS.md`; repository already had `agents.md`. | Merged the lowercase guide into uppercase `AGENTS.md`; harness doctor now requires `AGENTS.md` and keeps `agents.md` absent to prevent split authority. | | Harness validation could duplicate CI. | Added wrapper scripts that call existing commands and mirror current CI gates where practical. | | Full Docker smoke builds are expensive locally. | Kept them opt-in with `PLANET_HARNESS_DOCKER_SMOKE=1`. | | Internal harness docs could clutter public Docs UI. | Kept `docs/HARNESS.md` and `docs/harness-audit.md` as repository docs, not product Docs entries. | | Existing frontend toolchain is Bun-only. | Harness scripts and docs use Bun only and flag npm/pnpm/yarn lockfiles as failures. | | Agents often miss user-installed Bun or uv in non-interactive shells. | Added `scripts/harness/lib.sh` to resolve tools from current `PATH` first and then the user's login interactive shell without hardcoding a dotfile. | | Always-loaded security rules had no standalone harness gate. | Added `scripts/harness/security-check.sh` to block tracked `.env` / key files and scan for high-confidence committed private keys or provider tokens; quick-check now runs it. | | Build success does not prove frontend page usability. | Added static frontend rules/doc checks and a Playwright route smoke for public pages, protected admin fallback, Docs loading and detail interactions, Earth iframe entry, login/register/verification/password-reset interactions, authenticated admin route/section rendering with mocked API data across desktop, mobile, and 125% / 150% zoom, plus manifest-derived desktop/mobile menu navigation and safe search/tab/dialog/Earth News interactions. | | Route fallback behavior can regress even when every named page renders. | Extended the frontend smoke to verify `/` redirects to Earth, unauthenticated unknown routes show the login page, and authenticated unknown routes navigate back to `/admin`. | | Frontend smoke route lists can drift from `AdminRoutes` and resource-page sections. | Updated the smoke to derive protected route checks and authenticated section deep-link checks from `AdminRoutes.tsx` and `PlainResourcePages.tsx`, including redirect-only `/alerts`. | | Docs smoke mocks can drift from the product Docs catalog. | Updated the frontend smoke to derive mocked Docs catalog/content from `frontend/src/pages/Docs/docs-content.ts` plus backend Gatekeeper access metadata, then open every Chinese Docs catalog slug. | | User manuals can miss a real console menu entry after route changes. | Added a docs consistency check that compares the manual console overview tables with `frontend/src/admin/routes/manifest.tsx`; fixed the missing `/docs` row in both user manuals. | | Rendered pages can still contain broken internal shortcuts. | Added literal internal route-link checks and an interaction smoke for the AI settings shortcut; this caught and fixed a stale `/admin/settings` link that should point to `/settings`. | | Global search entries can drift because their route targets live in data objects rather than JSX links. | Added a frontend rules check that validates every admin search `routePath` against the actual frontend route set. | | Responsive styling fixes can satisfy one viewport by breaking the no-viewport-font rule. | Added a frontend rules failure for `font-size` values that use viewport or container query width units, and replaced public auth shell `vw` font sizing with fixed desktop/mobile sizes. | | Typography polish can accidentally reintroduce squeezed non-zero letter spacing. | Normalized active frontend `letter-spacing` values to `0` and made the frontend rules check fail non-zero `letter-spacing` / `letterSpacing` declarations, with only inherit/default-zero forms allowed. | | Native buttons can accidentally submit forms or keep controls clickable while loading after a props-spread reorder. | Added a frontend rules failure for TSX `