Skip to content

fix(secrets): route remaining CHIT_PASSPHRASE reads through services.common.env - #2125

Merged
POWERFULMOVES merged 2 commits into
mainfrom
fix/chit-secrets-audit-cleanup
Jul 15, 2026
Merged

fix(secrets): route remaining CHIT_PASSPHRASE reads through services.common.env#2125
POWERFULMOVES merged 2 commits into
mainfrom
fix/chit-secrets-audit-cleanup

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

Summary

Replaces raw os.environ.get / os.getenv reads of CHIT_PASSPHRASE with services.common.env.get_secret() so Docker *_FILE secrets are supported consistently across the fleet.

Services updated

  • graph-linker/chit_signer
  • a2ui-nats-bridge/bridge
  • tokenism-simulator/services/chit_encoder
  • consciousness-service/chr_algorithm
  • hi-rag-gateway/gateway
  • hi-rag-gateway-v2/config

Tests updated

  • graph-linker/tests/test_neo4j_chit_signer.py: CHIT_PASSPHRASE_FILE signing roundtrip
  • a2ui-nats-bridge/tests/test_signature_gate.py: signature gate with CHIT_PASSPHRASE_FILE

Verification

# Consciousness / tokenism tests pass in this environment
python3 -m pytest pmoves/services/consciousness-service/tests/test_chit_signing.py -v
# 18 passed
python3 -m pytest pmoves/services/tokenism-simulator/tests/test_chit_encoder.py -v
# 12 passed

# graph-linker and a2ui tests require service-specific deps (structlog, prometheus_client, nats) not present in the host venv;
# the same logic was verified with isolated import scripts and py_compile.

Related

Follow-up to #2124 (evo-controller fix). This should close the remaining CHIT secrets-audit warnings.

…common.env

Replaces raw os.environ.get/os.getenv calls with get_secret so Docker
*_FILE secrets are supported across the fleet.

Services updated:
- graph-linker/chit_signer
- a2ui-nats-bridge/bridge
- tokenism-simulator/services/chit_encoder
- consciousness-service/chr_algorithm
- hi-rag-gateway/gateway
- hi-rag-gateway-v2/config

Tests updated:
- graph-linker: CHIT_PASSPHRASE_FILE signing roundtrip
- a2ui-nats-bridge: signature gate with CHIT_PASSPHRASE_FILE
@coderabbitai

coderabbitai Bot commented Jul 14, 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: 57 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

Run ID: b0ef7559-d837-494a-b6ff-1861299ceb09

📥 Commits

Reviewing files that changed from the base of the PR and between d9a077c and 6e88017.

📒 Files selected for processing (10)
  • pmoves/services/a2ui-nats-bridge/bridge.py
  • pmoves/services/a2ui-nats-bridge/tests/test_signature_gate.py
  • pmoves/services/consciousness-service/Dockerfile
  • pmoves/services/consciousness-service/chr_algorithm.py
  • pmoves/services/graph-linker/chit_signer.py
  • pmoves/services/graph-linker/tests/test_neo4j_chit_signer.py
  • pmoves/services/hi-rag-gateway-v2/config.py
  • pmoves/services/hi-rag-gateway/gateway.py
  • pmoves/services/tokenism-simulator/Dockerfile
  • pmoves/services/tokenism-simulator/services/chit_encoder.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/chit-secrets-audit-cleanup

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.

@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: 9c7883c279

ℹ️ 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 +23 to +25
from services.common.env import get_secret
except ImportError: # pragma: no cover - narrow test/sys.path contexts
from pmoves.services.common.env import get_secret

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 Package env helper for consciousness image

When this runs in the image built by pmoves/services/consciousness-service/Dockerfile, the image only copies services/consciousness-service/*.py plus a minimal pmoves/tools namespace, not services/common or pmoves/services/common. Since main.py imports chr_algorithm at startup, this new top-level import raises ModuleNotFoundError before the API can boot; copy services/common/env.py into that image or keep a local fallback.

Useful? React with 👍 / 👎.

Comment on lines +24 to +26
from services.common.env import get_secret
except ImportError: # pragma: no cover - narrow test/sys.path contexts
from pmoves.services.common.env import get_secret

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 Package env helper for tokenism image

The tokenism image built by pmoves/services/tokenism-simulator/Dockerfile copies the simulator tree and only a minimal pmoves/tools namespace, so neither services.common.env nor pmoves.services.common.env exists in the container. Because app.py imports services.simulation_engine, which imports this module during gunicorn startup, this new import aborts the service before /healthz is available; include the shared env helper in the image or add a standalone fallback.

Useful? React with 👍 / 👎.

…m images

Both services import 'from services.common.env import get_secret' for
CHIT passphrase access, but their Docker images don't include the
services/common/ directory. This causes ModuleNotFoundError at boot.

Add COPY for services/common/__init__.py + env.py to both Dockerfiles.
(Codex P1 × 2)
@POWERFULMOVES
POWERFULMOVES merged commit 3ce4b39 into main Jul 15, 2026
28 of 29 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the fix/chit-secrets-audit-cleanup branch July 15, 2026 00:38
@github-actions github-actions Bot added chit-aware Touches a CHIT-aware service — control-body signature gate applies compose Compose files / service Dockerfiles services Service source under pmoves/services/ labels Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Docker Hardening Validation

Hardening Validation Report

Validated: Wed Jul 15 00:38:30 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: 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: 108 passed, 37 warnings, 0 errors

@github-actions

Copy link
Copy Markdown
Contributor

🔏 CHIT-aware change — control-body routing

This PR touches a CHIT-aware service (ports 8086/8087/8103/8106/8113/9224 surface). Before a Control-Body ACK:

  • the diff (or PR body) should reference a CHIT signature trail — chit.signed.v1, a CHIT: trailer, or a make -C pmoves sign-trail entry;
  • the chit-pr-audit-agent (.claude/agents/chit-pr-audit-agent.md) is the gate that grants/refuses ACK eligibility;
  • signing quickstart: pmoves/docs/AGENTS/CHIT_SIGNING_TUTORIAL.md.

Advisory routing only — the blocking contract check is CHIT Contract.

POWERFULMOVES added a commit that referenced this pull request Jul 22, 2026
…ng the way (#2184)

* docs(design): combined PMOVES Pinokio customization architecture spec

Aggregation Model A (submodule) reconciling combined PMOVES-pinokio fork with
distributed per-service launchers (crush, claude-code) + forked plugin/code.
Captures the closed-CLI constraint (claude-code integration via extension
surface + Agent SDK, not a binary fork). Design approved verbally; pending
written-spec review before writing-plans.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(design): resolve auto-cli + submodule-recurse verification items

auto-cli = Pinokio's built-in CLI launcher generator (use installable variant
for claude-code/crush). Submodule recurse handled by explicit git submodule
update --init --recursive in each launcher install.js (no Pinokio-clone dependency).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(plan): combined PMOVES Pinokio customization implementation plan

5 atomic tasks (code fork+claude repoint, pmoves-claude-code launcher/scaffold,
PMOVES-pinokio assembly, meta-repo pbnj submodule, install repoint+validation).
Self-review fix: pmoves-claude-code launcher at repo root so its api submodule
places pinokio.js correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(plan): crush integration via thin api entry + sources/ submodule

Respects PMOVES-crush's nested launcher structure; keeps version-pinning.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(damage-control): exempt git-rm from filesystem-delete + no-delete guards

git-rm is a reversible git-index removal, categorically different from a
recursive filesystem delete. Adds (?<!git\s) to the four recursive/force
delete patterns (patterns.yaml) and the DELETE matcher (bash-tool-damage-control.py),
mirroring the existing docker/podman exclusion. Verified: git-index removals
pass; real recursive filesystem deletes and no-delete-path deletes still block.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(z890): carry node skills + launcher + profile example (reconciled onto main)

5 pmoves-* skills (legal-assist, folder-monitor, email-organizer, yt-monitor,
n8n-archon-bridge), pmoves/launcher/, launcher_profile_select.py, and the
profile .env.example (placeholders only). Node-local .env + .hermes stay untracked.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* reconcile(z890): known-roads topic domain + trail merge onto main

- Add topic domain predicate (_is_topic_target) for pmoves/contracts/topics.json
  and register it in DOMAIN_PATTERNS alongside main's existing compose/schema/dockerfile
  domains (schema was already merged upstream; dockerfile untouched).
- Append 7 local trail lines (schema + topic grants) to known-roads.jsonl, additive
  only, no overlap with main's existing entries.

z890-coordinator.yaml needed no change: main already has the Intel Core Ultra 7 265K
hardware fix (commit 0f578bb), superseding the stale AMD Ryzen values in the local
WIP snapshot.

z890-infra.room.fabric.json left uncommitted: the local WIP version fails validation
against main's current room schema ('stage' is a required property, missing from the
WIP file). Not forced — needs a human decision on the correct stage value.

* reconcile(z890): carry room manifest + add required stage field (schema conformance)

* fix(tokenism): repoint image to real CI-built tag + explicit PYTHONPATH (CHIT signing)

Build context/dockerfile path and pmoves.tools packaging were already
fixed on main via #2070/#2125. The remaining gap: docker-compose.yml's
TOKENISM_IMAGE default pointed at an orphan tag
(ghcr.io/powerfulmoves/pmoves-tokenism:pmoves-latest) that no CI
workflow ever builds. pmoves/images.yaml defines the real matrix entry
(name: pmoves-tokenism-simulator, context: pmoves, dockerfile:
services/tokenism-simulator/Dockerfile) which build-images.yml tags as
:edge. Repoint the default to that name/tag.

Also add explicit ENV PYTHONPATH=/app to the Dockerfile, mirroring the
hi-rag-gateway-v2 house pattern, so the pmoves.tools.* / services.common.*
imports resolve independent of invocation cwd.

* fix(evo-controller): use get_secret for CHIT signing key (unblocks secrets-audit)

Line 63 read the CHIT signing secret via os.getenv while the rest of the file
already uses the get_secret helper. get_secret is a strict superset (env var
first, then KEY_FILE indirection), so behavior is preserved and Docker secret
file-mounting now works. Unblocks the secrets-audit hard-gate in secrets-funnel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(2184): address review threads — planned-status apps, valid make targets, dry-run mkdir + verified CodeQL suppressions

- room manifest: mark legal/email/n8n panels status:planned until routes exist (Codex)
- launcher profile: up-archon->up-archon-native (valid target); drop skills that arent make targets (Codex)
- launcher_profile_select.py: dry-run no longer creates the Hermes profile dir; lgtm suppressions for env_content writes/logs (KEY NAMES only, values blank) (Codex + CodeQL)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chit-aware Touches a CHIT-aware service — control-body signature gate applies 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