Skip to content

feat(wordpress-chat): opt-in --wordpress-chat-agent activation for the WordPress runtime-chat pipeline (#779) - #784

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-779-wp-coding-agents
Oct 17, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-779-wp-coding-agents

Conversation

@chubes4

@chubes4 chubes4 commented Oct 17, 2026

Copy link
Copy Markdown
Member

Summary

Adds one opt-in setup/upgrade flag, --wordpress-chat-agent <slug>, that activates the merged #772/#773 WordPress-native chat pipeline as a unit: runtime-chat adapter config (slug -> runtime ID), a shared signing secret minted once into a 0600 env file loaded by both the Roadie unit and a new managed inbound-event-connector service (systemd + launchd), ROADIE_PLATFORM=discord,wordpress on the rendered Roadie service, and a wordpress:<context> entry in channels.yaml so ensureRuntime() admits the bound context. Without the flag every hook is inert and rendered output is byte-identical (existing bridge-render snapshots unchanged).

What changed

  • lib/wordpress-chat.sh (new): activation module — env-file secret mint/reuse, runtime-chat adapter config mu-plugin, text-preserving channels.yaml insert keyed by the wordpress-context.json binding, connector + generated wp-control wrapper install, systemd/launchd service render and install, wordpress_chat_apply orchestrator
  • bridges/roadie.sh: declare -F-guarded hooks add ROADIE_PLATFORM=discord,wordpress, the shared-secret EnvironmentFile line, and inlined launchd delivery env only when the activation is enabled
  • [operator-only reference omitted]
  • tests/wordpress-chat-activation.sh (new, hermetic temp config root per bridge-render.sh snapshot depends on the host's /opt/roadie-config/channels.yaml #776): 15 checks — disabled no-op, enabled render equals disabled plus exactly the two added lines, secret 0600 + reused across upgrades with and without the flag, adapter config resolves through a real PHP filter run, channels.yaml create/insert/idempotence/context binding, connector unit present only when enabled and sharing the Roadie env file, instance suffixing, launchd plist validity
  • .github/workflows/shell.yml: wordpress-chat-activation job so tests/ci-coverage.sh stays green
  • tests/agents-md-failure-does-not-abort-upgrade.sh: stubs for the two new upgrade phase calls in its execute-block harness

How to test

  1. Run bash tests/ci-coverage.sh; expect passes as recorded by Cook's deterministic gate.
  2. Run bash tests/roadie-managed-env.sh; expect passes as recorded by Cook's deterministic gate.
  3. Run bash tests/ai-gateway.sh; expect passes as recorded by Cook's deterministic gate.
  4. Run node tests/roadie-wordpress-platform.mjs; expect passes as recorded by Cook's deterministic gate.
  5. Run python3 tests/inbound-event-connector.py; expect passes as recorded by Cook's deterministic gate.
  6. Run bash -c 'ls tests/wordpress-chat-activation.* >/dev/null && for t in tests/wordpress-chat-activation.*; do bash $t || exit 1; done'; expect passes as recorded by Cook's deterministic gate.

Compatibility

Fully backward compatible. Without --wordpress-chat-agent (and without a previously written env file) no behavior changes and rendered systemd/launchd output is byte-identical — bridge-render golden snapshots pass unmodified. Once opted in, the 0600 env file is the durable record: upgrades converge without repeating the flag and never regenerate the secret. channels.yaml edits are text-preserving with a pending-item fallback instead of rewriting the operator file. VERSION and CHANGELOG untouched as instructed.

Evidence

  • Verified command bash tests/ci-coverage.sh: status=succeeded; candidate commit d55b2a9654c62e849b38dc472a28dce4c31d785b, tree d3ec4f90b396923c58557e8deb1a7e7db16f3ceb, fingerprint c4f4f59e2c2ebcd6d4e4fe9428f39f33b0203934f4de630c74841301d54bfa0f; durable gate gate-1
  • Verified command bash tests/roadie-managed-env.sh: status=succeeded; candidate commit d55b2a9654c62e849b38dc472a28dce4c31d785b, tree d3ec4f90b396923c58557e8deb1a7e7db16f3ceb, fingerprint c4f4f59e2c2ebcd6d4e4fe9428f39f33b0203934f4de630c74841301d54bfa0f; durable gate gate-2
  • Verified command bash tests/ai-gateway.sh: status=succeeded; candidate commit d55b2a9654c62e849b38dc472a28dce4c31d785b, tree d3ec4f90b396923c58557e8deb1a7e7db16f3ceb, fingerprint c4f4f59e2c2ebcd6d4e4fe9428f39f33b0203934f4de630c74841301d54bfa0f; durable gate gate-3
  • Verified command node tests/roadie-wordpress-platform.mjs: status=succeeded; candidate commit d55b2a9654c62e849b38dc472a28dce4c31d785b, tree d3ec4f90b396923c58557e8deb1a7e7db16f3ceb, fingerprint c4f4f59e2c2ebcd6d4e4fe9428f39f33b0203934f4de630c74841301d54bfa0f; durable gate gate-4
  • Verified command python3 tests/inbound-event-connector.py: status=succeeded; candidate commit d55b2a9654c62e849b38dc472a28dce4c31d785b, tree d3ec4f90b396923c58557e8deb1a7e7db16f3ceb, fingerprint c4f4f59e2c2ebcd6d4e4fe9428f39f33b0203934f4de630c74841301d54bfa0f; durable gate gate-5
  • Verified command bash -c 'ls tests/wordpress-chat-activation.* >/dev/null && for t in tests/wordpress-chat-activation.*; do bash $t || exit 1; done': status=succeeded; candidate commit d55b2a9654c62e849b38dc472a28dce4c31d785b, tree d3ec4f90b396923c58557e8deb1a7e7db16f3ceb, fingerprint c4f4f59e2c2ebcd6d4e4fe9428f39f33b0203934f4de630c74841301d54bfa0f; durable gate gate-6
  • Base advanced after verification: verified main at 93070b5; publication observed d0f8b13. Candidate ancestry was validated against the verified snapshot.
  • CI expected: Homeboy CI after push
  • Candidate adoption provenance: the candidate was promoted from the recorded Cook task execution.
  • Cook deterministic verification: 6 gate(s) completed green.
  • Durable run execution: Succeeded
  • Reviewer-resolvable evidence from source_refs[0]: Setup/upgrade flag to activate runtime-backed WordPress chat (config, connector service, platform, secret) #779
  • Task objective: You are implementing Setup/upgrade flag to activate runtime-backed WordPress chat (config, connector service, platform, secret) #779. Ship a committed change with tests to a PR. Context: the runtime-chat handler is in templates/wp-coding-agents-inbound-events.php (WpCodingAgents_Runtime_Chat, adapter_config('runtime-chat')); the Roadie plugin is bridges/roadie/roadie-plugins/wordpress-platform.mjs (ingressConfig() reads WP_CODING_AGENTS_INBOUND_WORDPRESS_*); the connector is scripts/inbound-event-connector.py (deliver_wordpress) installed by lib/inbound-event-bridge.sh; the Roadie unit is rendered in bridges/roadie.sh. Roadie accepts several platforms via --platform/ROADIE_PLATFORM (comma list). Host snapshot tests must be hermetic: tests/bridge-render.sh currently reads the host's the host-managed roadie-config channels.yaml (the system config root, not a fixture) (bridge-render.sh snapshot depends on the host's /opt/roadie-config/channels.yaml #776), so put your new render assertions in a NEW test file (e.g. tests/wordpress-chat-activation.sh) that uses a temp config root, and reference it from tests/ci-coverage.sh. Ship working code, not a plan; a tested partial (config + platform list + shared secret, connector unit next) beats a write-up.
  • Verified candidate scope: 7 changed file(s): .github/workflows/shell.yml, bridges/roadie.sh, lib/wordpress-chat.sh, setup.sh, tests/agents-md-failure-does-not-abort-upgrade.sh, tests/wordpress-chat-activation.sh, upgrade.sh.
  • Verified finalization base: main at 93070b5
  • deterministic gate passed: sh -c bash -c 'ls tests/wordpress-chat-activation.* >/dev/null && for t in tests/wordpress-chat-activation.*; do bash $t || exit 1; done' (Passed)
  • deterministic gate passed: sh -c bash tests/ai-gateway.sh (Passed)
  • deterministic gate passed: sh -c bash tests/ci-coverage.sh (Passed)
  • deterministic gate passed: sh -c bash tests/roadie-managed-env.sh (Passed)
  • deterministic gate passed: sh -c node tests/roadie-wordpress-platform.mjs (Passed)
  • deterministic gate passed: sh -c python3 tests/inbound-event-connector.py (Passed)

AI assistance

  • AI assistance: Yes
  • Tool(s): Homeboy (pi)
  • Model: anthropic-claude-fable-5
  • Used for: Operators enabling WordPress-native chat for one agent on a managed Roadie install: one flag writes the WordPress-side runtime binding, wires the shared HMAC secret, supervises the inbound-event connector next to Roadie, and opens the wordpress platform/channel in the rendered Roadie service.

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