Skip to content

fix(p7): first-bring-up fixes — container path crash, FILE secrets, profiles, broker auth - #2223

Merged
POWERFULMOVES merged 1 commit into
mainfrom
fix/p7-bringup
Jul 25, 2026
Merged

POWERFULMOVES merged 1 commit into
mainfrom
fix/p7-bringup

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

Landed #2173 then stood P7 up for real on 5090 — five defects surfaced at first boot, all fixed and live-verified (/healthzrooms_loaded: 9, nats_connected: true, make up-p7 + make smoke-p7 green, 46/46):

  1. Container crash-loop: Path(__file__).parents[3] IndexErrors at /app/main.py before the ImportError fallback can engage. Now walks upward — and appends to sys.path (services/common ships its own config.py, which insert(0) would shadow over the service's config module). Bonus finding: the old fixed index never resolved in-repo either, so the shared secret helper was silently unused everywhere; tests now exercise the real env.get_secret.
  2. _FILE secrets dead in-container: compose delivers P7_SIGNING_KEY_FILE but the fallback only read plain env — signing key would silently never load.
  3. up-p7 unbootable: --profile agents activates the legacy orchestrator whose supabase-kong dep is profile-gated → compose fails the whole project. New p7 needs --profile p7 only.
  4. required: false on the legacy kong dep so any --profile agents invocation resolves without supabase-local.
  5. Broker auth: P7_NATS_URL lacked credentials → log-only fallback, no signed lifecycle events. Plus: p7-health retries (up-p7 chains into it pre-boot), smoke-p7 runs from the service dir.

🤖 Generated with Claude Code

…rofiles, broker auth

Landed #2173 and stood P7 up on 5090; five defects surfaced at first
real boot, each verified fixed live (healthz ok, rooms_loaded=9,
nats_connected=true, smoke 46/46):

1. main.py crashed in-container: Path(__file__).parents[3] raises
   IndexError at /app/main.py before the ImportError fallback can
   engage (restart loop). Now walks upward for services/common — and
   APPENDS to sys.path: services/common ships its own config.py which
   would otherwise shadow the service's config module. (The old fixed
   index accidentally never resolved in-repo either, so the shared
   env helper was silently unused everywhere; tests now import the
   real one.)
2. Fallback get_secret ignored the <KEY>_FILE convention — compose
   delivers P7_SIGNING_KEY_FILE, which would silently never load
   in-container.
3. up-p7 used --profile agents, activating the legacy
   p7-room-orchestrator whose supabase-kong dependency is
   profile-gated — compose fails the whole project as 'depends on
   undefined service'. New p7 needs only --profile p7.
4. Legacy service's kong dependency marked required:false so ANY
   --profile agents invocation resolves again without supabase-local.
5. P7_NATS_URL lacked broker credentials — P7 booted log-only
   (nats_connected:false, no signed lifecycle events). Also: p7-health
   now retries (up-p7 chains into it before the container finishes
   booting) and smoke-p7 runs pytest from the service dir (flat-module
   imports).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@POWERFULMOVES, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a367bd91-98d6-47b7-b60b-0e25659c6b77

📥 Commits

Reviewing files that changed from the base of the PR and between be1059a and 2ce0e90.

📒 Files selected for processing (3)
  • pmoves/Makefile
  • pmoves/docker-compose.yml
  • pmoves/services/p7-room-orchestrator/main.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/p7-bringup

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.

@github-actions

Copy link
Copy Markdown
Contributor

Docker Hardening Validation

Hardening Validation Report

Validated: Sat Jul 25 12:40:57 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: 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: p7-room-orchestrator
[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

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

======================================
Summary: 112 passed, 43 warnings, 0 errors

@github-actions github-actions Bot added compose Compose files / service Dockerfiles services Service source under pmoves/services/ labels Jul 25, 2026
@POWERFULMOVES
POWERFULMOVES merged commit 4b33935 into main Jul 25, 2026
34 of 36 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the fix/p7-bringup branch July 25, 2026 12:41

@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: 2ce0e90ae5

ℹ️ 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 thread pmoves/docker-compose.yml
# Broker requires auth (documented default creds convention) — without
# them P7 boots in log-only fallback (nats_connected:false, no signed
# lifecycle events on the control plane).
- P7_NATS_URL=${P7_NATS_URL:-nats://nats:pmoves@nats:4222}

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 Inherit the configured NATS broker URL

When production operators replace the weak default credentials in env.shared.example (lines 30–32) and update the canonical NATS_URL, this fallback still authenticates with the hard-coded nats:pmoves credentials unless they also discover and define the otherwise undocumented P7_NATS_URL. P7 then silently starts in log-only mode and emits no lifecycle events; fall back through ${NATS_URL} before using the development URL.

AGENTS.md reference: AGENTS.md:L87-L89

Useful? React with 👍 / 👎.

Comment on lines +69 to +70
file_path = os.environ.get(f"{key}_FILE")
if file_path:

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 Preserve direct environment-secret precedence

Inside the image this fallback is always used because services/common is not copied, and it now reads <KEY>_FILE before checking <KEY>. When both forms are present—for example, during a signing-key rotation where P7_SIGNING_KEY overrides a still-mounted file—the stale file value wins, causing invalid signatures or rejected control credentials. Match services/common/env.py::get_secret by checking the direct environment value first.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compose Compose files / service Dockerfiles services Service source under pmoves/services/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants