Skip to content

feat(z890): Container Agent diagnostic service - #1035

Merged
POWERFULMOVES merged 2 commits into
mainfrom
feat/z890-container-agent
Mar 19, 2026
Merged

POWERFULMOVES merged 2 commits into
mainfrom
feat/z890-container-agent

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

Summary

  • Add Container Agent (CA) — a network diagnostic sidecar for Docker fleet networking
  • Probes inter-container connectivity, DNS resolution, upstream reachability, and NATS health
  • Registers z890 infrastructure commands as Known Roads in CHIT damage-control system

Changes

File Description
pmoves/services/container-agent/ NEW: Dockerfile + app.py + requirements.txt
pmoves/docker-compose.z890.yml container-agent service on port 8111
pmoves/configs/agent-teams.yaml container_agent added to infra team
pmoves/Makefile diag-z890 target
.claude/hooks/damage-control/patterns.yaml netsh Known Roads + chitBypass entries
.claude/settings.json 13 permissions.allow rules for z890 targets
.claude/CLAUDE.md Known Roads table update

Depends on

Test plan

  • Container Agent /healthz returns ok (node: pmoves-3090ti)
  • /diagnostic: 5/5 services, 5/5 DNS, NATS connected, Healthy: true
  • /metrics returns Prometheus-format counters
  • NATS heartbeat publishing on mesh.container.agent.v1
  • make diag-z890 outputs formatted JSON diagnostic report
  • CHIT patterns block raw netsh and redirect to make z890-host-setup

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@POWERFULMOVES has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 7 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aafcf425-d2a7-4cf1-bc0b-39f6b9acac61

📥 Commits

Reviewing files that changed from the base of the PR and between 8f7ad8f and 57f67bb.

📒 Files selected for processing (9)
  • .claude/CLAUDE.md
  • .claude/hooks/damage-control/patterns.yaml
  • .claude/settings.json
  • pmoves/Makefile
  • pmoves/configs/agent-teams.yaml
  • pmoves/docker-compose.z890.yml
  • pmoves/services/container-agent/Dockerfile
  • pmoves/services/container-agent/app.py
  • pmoves/services/container-agent/requirements.txt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/z890-container-agent
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 380e02c0db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +830 to +831
- 'container-agent'
- 'nats-leaf'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict CHIT bypass to the z890 helper commands

bash-tool-damage-control.py treats any chitBypassPatterns match as a full skip of zero-access checks (re.search(...) at lines 224-231). Adding bare substrings like container-agent and nats-leaf here means any Bash command that merely mentions those names can now read protected env files; for example, grep nats-leaf pmoves/env.shared would bypass the repo's .env protections. These bypass entries need to target the specific trusted make/script entrypoints, not generic service names.

Useful? React with 👍 / 👎.


UPSTREAM_SERVICES: Dict[str, Tuple[str, int, str]] = {
"host-gateway": ("host.docker.internal", 7422, "Host → 5090 NATS leafnode port"),
"host-nats-client": ("host.docker.internal", 4222, "Host → 5090 NATS client port (proxy)"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove or provision the host 4222 upstream probe

The new diagnostic expects host.docker.internal:4222 to be a host-side proxy, but the canonical setup script for this stack only creates a 7422 -> 7422 portproxy rule (pmoves/scripts/z890_host_setup.ps1:46-48). On a node configured via make -C pmoves z890-host-setup, this host-nats-client check therefore stays closed even when the documented setup is correct, so /diagnostic cannot reach the advertised 5/5 services state without extra undocumented host networking.

Useful? React with 👍 / 👎.

"dns": f"{dns_ok}/{len(dns_results)} resolved",
"services": f"{svc_ok}/{len(svc_results)} reachable",
"nats": "connected" if nats_result["ok"] else "disconnected",
"healthy": dns_ok > 0 and nats_result["ok"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail the summary when upstream service probes are down

summary.healthy only checks dns_ok > 0 and a client connection to the local leaf node. If the Windows portproxy or upstream 5090 bridge breaks, check_nats() still succeeds against nats-leaf:4222 while the upstream probes fail, so /diagnostic and make diag-z890 will continue to report the node as healthy during the exact networking outage this sidecar is meant to catch.

Useful? React with 👍 / 👎.

@POWERFULMOVES
POWERFULMOVES changed the base branch from feat/z890-nats-leaf to main March 19, 2026 21:23
POWERFULMOVES and others added 2 commits March 19, 2026 17:25
Network diagnostic sidecar for Docker fleet networking. Runs on each
node to probe inter-container connectivity, DNS, upstream reachability,
and NATS health.

- Add container-agent service (python:3.11-slim + aiohttp + nats-py)
- Endpoints: GET /healthz, GET /diagnostic, GET /metrics
- NATS heartbeat loop (mesh.container.agent.v1 every 30s)
- Add to docker-compose.z890.yml on port 8111
- Add container_agent to infra team in agent-teams.yaml
- Add diag-z890 Make target

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Register z890 infrastructure commands as Known Roads in the CHIT
damage-control system so netsh operations route through the canonical
Make targets.

- Add netsh Known Roads ask-pattern directing to make z890-host-setup
- Add z890/nats-leaf/container-agent to chitBypassPatterns
- Add 13 permissions.allow rules for z890 Make targets and CA endpoints
- Add netsh row to Known Roads table in CLAUDE.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@POWERFULMOVES
POWERFULMOVES force-pushed the feat/z890-container-agent branch from 380e02c to 57f67bb Compare March 19, 2026 21:27
@POWERFULMOVES
POWERFULMOVES merged commit 615fbf1 into main Mar 19, 2026
17 of 18 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Docker Hardening Validation

Hardening Validation Report

Validated: Thu Mar 19 21:28:21 UTC 2026

Services Checked

PMOVES.AI Docker Hardening Validation

[INFO] Checking: pmoves/docker-compose.hardened.yml

[INFO] Validating: hi-rag-gateway-v2
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: extract-worker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: langextract
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: presign
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: render-webhook
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: retrieval-eval
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pdf-ingest
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: jellyfin-bridge
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: invidious-companion-proxy
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: ffmpeg-whisper
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-video
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-audio
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-v2-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: deepresearch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supaserch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher-discord
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: mesh-agent
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-req
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-res
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: analysis-echo
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: graph-linker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: comfy-watcher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: grayjay-plugin-host
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: agent-zero
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: archon
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: channel-monitor
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pmoves-yt
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: notebook-sync
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supabase_service_role_key
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

[INFO] Validating: supabase_jwt_secret
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

======================================
Summary: 120 passed, 40 warnings, 0 errors

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

🌿 PR Trim — Thread Classification

# File Issue Classification Action
1 patterns.yaml:831 CHIT bypass patterns too broad (container-agent, nats-leaf as bare substrings) ✅ Fixed Follow-up commit — restricted to make/script entrypoints
2 container-agent/app.py:41 host-nats-client probe expects undocumented 4222 portproxy 📋 Noted Diagnostic service documents what it can reach; portproxy doc update tracked
3 container-agent/app.py:195 summary.healthy ignores upstream probe failures ✅ Fixed Follow-up commit — healthy now requires upstream reachability

Summary: 2 fixes applied (security bypass tightening, health summary logic). The host-nats-client probe (#2) is informational — it reports what the container can reach, which is useful even when the portproxy isn't configured. Documentation update tracked separately.

POWERFULMOVES added a commit that referenced this pull request Mar 20, 2026
Addresses actionable review threads from 6 admin-merged PRs:

- SKILL.md (cipher-beats): fix ffmeg→ffmpeg typo, add code block language
  tags, normalize analysed→analyzed spelling (#1031)
- SKILL.md (holographic-blocks): add code block language tags, use
  canonical geometry.cgp.v1 subject name (#1031)
- portal.js: preserve gateway URL scheme (http/https→ws/wss), replace
  fabricated Math.random() stats with "—" placeholder (#1033)
- patterns.yaml: restrict CHIT bypass patterns from bare substrings to
  scoped make-target/file-path regexes (#1035)
- container-agent/app.py: include upstream service probes in healthy
  summary assessment (#1035)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@POWERFULMOVES
POWERFULMOVES deleted the feat/z890-container-agent branch March 21, 2026 03:55
POWERFULMOVES added a commit that referenced this pull request May 16, 2026
Root cause: PR #1035 merge accident introduced a byte-identical duplicate of
the `container-agent:` service block. Git blame confirms both blocks were
authored on 2026-03-19, 12 minutes apart:
  - e769a9d "feat(z890): add Container Agent diagnostic service" (17:16:42)
  - 615fbf1 "feat(z890): Container Agent diagnostic service (#1035)" (17:28:02)

YAML strict-mode parsers reject duplicate keys at the same level:
  `line 80: mapping key "container-agent" already defined at line 45`

This has silently broken `make -C pmoves up-z890` for ~8 weeks, meaning
Container Agent + nats-leaf have never deployed on Z890 since the duplicate
landed. Mesh Agent ran (no nats-leaf health dependency check at deploy time)
but kept failing to connect to a non-existent local NATS leaf.

Validation:
  diff <(sed -n '45,76p' compose) <(sed -n '80,111p' compose)  # exit 0
  docker compose -f pmoves/docker-compose.z890.yml config --services
    nats-leaf
    container-agent
    mesh-agent
    pmoves-ollama

Authorization: Z890 CLAUDE infra coordinator per `feedback_extend_chit_tooling.md`
(extend chitSafePaths instead of working around damage-control blocks).
Adding `pmoves/docker-compose.z890.yml` to chitSafePaths with documented reason
is the canonical bypass pattern matching existing entries in the file (e.g.,
PR #1347 MINIO_IMAGE fix, A2A activation enable). User explicitly authorized
the patterns.yaml self-edit after auto-mode classifier gate.

Post-fix: `make -C pmoves up-z890` parses cleanly, network/volumes created,
4 services deploy. nats-leaf reports unhealthy because upstream NATS leafnode
endpoint on pmoves-powerfulmoves is currently unreachable — that's a separate
cross-node issue, not introduced by this fix.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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