Skip to content

Add local dev harness for agentic testing#34

Closed
riccjohn wants to merge 9 commits into
mainfrom
add-local-dev-harness
Closed

Add local dev harness for agentic testing#34
riccjohn wants to merge 9 commits into
mainfrom
add-local-dev-harness

Conversation

@riccjohn
Copy link
Copy Markdown
Owner

@riccjohn riccjohn commented Mar 19, 2026

Summary

  • scripts/collect-logs.sh — captures container status, recent errors, and the last 75 lines per service in a format ready to paste into Claude for diagnosis
  • README.md — new "Diagnosing issues" section documenting collect-logs.sh
  • CLAUDE.md — lean session init and task tracking instructions only; human-facing docs moved to README
  • Existing hooks and lint-config.sh CI validation unchanged

What changed from the original plan

The PR started as a full local dev harness (local docker stack, health checks, compose override). During testing we found that 3 of 9 services can't run on macOS (Pi-hole host networking, Jellyfin GPU device, Syncthing port conflicts), making the harness too brittle to be useful for autonomous agentic testing. Replaced with a simpler diagnostic script that works against the real server where all services actually run.

Test plan

  • bash scripts/lint-config.sh exits clean
  • ./scripts/collect-logs.sh runs on the server without error
  • ./scripts/collect-logs.sh <service> filters to one service

🤖 Generated with Claude Code

riccjohn and others added 9 commits March 19, 2026 10:47
Introduces a full local development environment so Claude can spin up
services, run health checks, and verify changes autonomously without
the Linux server or Cloudflare DNS.

- docker-compose.dev.yml: compose override disabling pihole/jellyfin
  (Linux-only), Traefik HTTP-only on :8080, all services with native
  ports exposed, data volumes redirected to .dev/data/
- traefik/traefik.dev.yml: Traefik static config with no ACME, ping
  endpoint enabled, insecure dashboard for local use
- traefik/dynamic.dev/: empty dynamic config dir to avoid cert resolver
  warnings from production tls.yml/services.yml
- scripts/dev.sh: up/down/restart/status/logs subcommands; creates
  .env.dev and data dirs on first run; down/status work without .env.dev
- scripts/health-check.sh: hits each service health endpoint on
  localhost; exits 1 if any fail; supports single-service filter arg
- .env.dev.example: dev-safe template with dummy tokens (readable by
  Claude; blocked by pre-tool-use hook like .env)
- CLAUDE.md: local dev workflow section with agentic test loop pattern
- .gitignore: add .env.dev, .dev/, acme.dev.json
- pre-tool-use.sh: allow reads of .env.dev.example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Catches drift between docker-compose.yml and docker-compose.dev.yml
on every PR — any change that breaks the merged dev config will fail CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Docker Compose concatenates port lists rather than merging by target,
so the production sync ports (22000, 21027) were always bound regardless
of what the dev override specified. Since syncthing conflicts with a
native install on the dev machine anyway, disable it via profiles like
pihole and jellyfin.

Also removes the dead .dev/data/syncthing directory from ensure_dirs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
api.insecure serves on an internal :8080 entry point, but the dev port
mapping is 8080:80 (host→web entry point). Bind ping to the web entry
point so localhost:8080/ping works as expected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds SKIP lines for syncthing, jellyfin, and pihole so the full service
list is always visible — makes it obvious they're intentionally absent
rather than accidentally missing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The local stack was too brittle: 3 of 9 services couldn't run on macOS
(host networking, GPU devices, port conflicts), and the real failure modes
for this repo happen on the Linux server after deployment.

Replace with scripts/collect-logs.sh — captures container status, recent
errors, and per-service log tails in a format ready to paste into Claude
for diagnosis.

Removes:
- docker-compose.dev.yml
- traefik/traefik.dev.yml
- traefik/dynamic.dev/
- .env.dev.example
- scripts/dev.sh
- scripts/health-check.sh
- CI step: Validate docker-compose.dev.yml merge
- .gitignore entries for .dev/, .env.dev, acme.dev.json
- pre-tool-use.sh exception for .env.dev.example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
.dev/ and .env.dev were created by the local docker stack during testing
and not gitignored after removing them from the harness cleanup. Untrack
and re-add to .gitignore.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
collect-logs.sh documentation belongs in README for human consumption.
CLAUDE.md is for agent instructions only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@riccjohn
Copy link
Copy Markdown
Owner Author

Not sure if this is actually helpful

@riccjohn riccjohn closed this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant