Skip to content

Decouple pipeline-editing surface into core pipeline_editor mode#2426

Merged
chubes4 merged 3 commits into
mainfrom
fix-2425-pipeline-editor-mode
May 31, 2026
Merged

Decouple pipeline-editing surface into core pipeline_editor mode#2426
chubes4 merged 3 commits into
mainfrom
fix-2425-pipeline-editor-mode

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 31, 2026

Summary

Closes #2425.

Generic core mode chat carried the entire DM admin pipeline-editor surface — a hardcoded "you are in the Data Machine admin UI" prompt, the pipelines inventory, and ~25 pipeline-editing tools. Any portable chat surface (the frontend-agent-chat widget, data-machine-chat-bridge) that sends no mode defaults to chat and therefore inherited the false location claim and the admin tool surface (proven live on the extrachill.com homepage).

This PR decouples the pipeline-editing surface from generic chat into a new core mode pipeline_editor, using the existing additive mode composition (guidance concatenates, tools union). chat becomes truly portable; the admin/pipeline context only appears when a surface that actually is the admin editor asks for it.

New pipeline_editor mode

  • Registered in core (inc/bootstrap.php) at priority 25 (between pipeline=20 and system=30; editor=40 unchanged), mirroring how data-machine-editor registers editor.
  • Owns the pipeline/handler/flow guidance (moved out of CHAT_MODE into a new PIPELINE_EDITOR_MODE constant), the pipelines inventory directive, and the 25 pipeline-editing tools.
  • The DM admin pipeline chat opts into [chat, pipeline_editor] server-side: in Chat::handle_chat, a request carrying selected_pipeline_id (the admin pipeline editor surface) sends modes => ['chat','pipeline_editor']. Any explicitly-requested mode is preserved/appended. No JS rebuild required.
  • AgentsChatHandler::resolveModes() is unchanged — still defaults to ['chat'] for callers that send nothing, which is correct for portable surfaces.

Files changed

Core mode / directive plumbing

  • inc/Engine/AI/Directives/AgentModeDirective.php — slimmed CHAT_MODE to a location-agnostic generic chat default; added PIPELINE_EDITOR_MODE with the moved pipeline/handler/flow/scheduling/execution guidance; added pipeline_editor case to get_default_for_mode().
  • inc/bootstrap.php — registered the pipeline_editor mode (priority 25).
  • inc/Api/Chat/ChatPipelinesDirective.php — re-gated the pipelines inventory directive modes from ['chat'] to ['pipeline_editor'].
  • inc/Api/Chat/Chat.php — admin pipeline chat (selected_pipeline_id present) now sends modes => ['chat','pipeline_editor'].

Tools re-gated chatpipeline_editor (25)
create_pipeline, delete_pipeline, add_pipeline_step, configure_pipeline_step, delete_pipeline_step, reorder_pipeline_steps, create_flow, copy_flow, delete_flow, update_flow, configure_flow_steps, list_flows, get_problem_flows, run_flow, execute_workflow, api_query, authenticate_handler, get_handler_defaults, set_handler_defaults, manage_jobs, manage_queue, manage_logs, read_logs, system_health_check, delete_file.

Kept on generic chat (portable, unchanged)
consult_agent, send_ping, and the taxonomy tools assign_taxonomy_term / create_taxonomy_term / merge_taxonomy_terms / search_taxonomy_terms / update_taxonomy_term. insert_content was left untouched (it is multi-mode ['chat','pipeline','system','editor'], not a pipeline-admin tool).

Verification

  • php -l clean on all 29 changed files.
  • phpcs (repo lint) clean — exit 0 on all changed files.
  • Smoke tests pass: agents-chat-handler-smoke (13), directive-policy-resolver-smoke (10), ai-step-agent-mode-plumbing-smoke (6), global-tool-pipeline-modes-smoke (16), pipeline-tool-policy-surfaces-smoke (10), mode-model-resolution-smoke (8).
  • Leak check (grep): no pipeline-admin tool remains gated on bare chat; CHAT_MODE no longer contains the admin-UI location claim or pipeline manual.
  • Session-mode storage: the admin pipeline chat persists mode = "chat,pipeline_editor" (exactly 20 chars, fits the mode VARCHAR(20) column; processContinue already parses comma-joined modes back into an array). The session-list endpoint applies no mode filter in practice (the JS client sends context, which the route arg mode does not bind), so admin sessions still list correctly.

Could not verify

  • No runtime browser test of the live admin pipeline chat (PR-only, no deploy). Logic verified via code trace + smoke tests.

Out of scope (separate follow-up)

  • Activating roadie mode for the EC frontend widget (making the widget request [chat, roadie] + populate page client_context) lives in extrachill-roadie / frontend-agent-chat, not this PR. This core PR only removes the wrong location from generic chat and decouples the surface.

… mode

Generic `chat` mode carried the entire DM admin pipeline-editor surface —
a hardcoded "you are in the Data Machine admin UI" prompt, the pipelines
inventory, and ~25 pipeline-editing tools — so any portable chat surface
(frontend widget, bridge) inherited the wrong location claim and admin tools.

Decouple the surface into a new core `pipeline_editor` mode via additive
mode composition:

- Slim CHAT_MODE to a location-agnostic generic chat default.
- Add PIPELINE_EDITOR_MODE (the moved pipeline/handler/flow guidance) and
  wire it into get_default_for_mode().
- Register `pipeline_editor` in core at priority 25.
- Re-gate the pipelines inventory directive and the 25 pipeline-editing
  tools from `chat` to `pipeline_editor`.
- The admin pipeline chat (requests carrying selected_pipeline_id) opts into
  [chat, pipeline_editor] server-side; portable surfaces stay on chat.

AgentsChatHandler::resolveModes() still defaults to [chat] for callers that
send nothing, keeping portable surfaces clean.

Closes #2425
@homeboy-ci
Copy link
Copy Markdown
Contributor

homeboy-ci Bot commented May 31, 2026

Homeboy Results — data-machine

Lint

lint — passed

ℹ️ Full options: homeboy docs commands/lint
Deep dive: homeboy lint data-machine --changed-since 424a39a

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-lint-quality-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-lint-quality-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/26717452245

Test

test — passed

  • 798 passed
  • 3 skipped

ℹ️ Auto-fix lint issues: homeboy refactor data-machine --from lint --write
ℹ️ Collect coverage: homeboy test data-machine --coverage
ℹ️ Save test baseline: homeboy test data-machine --baseline
ℹ️ Pass args to test runner: homeboy test -- [args]
ℹ️ Full options: homeboy docs commands/test
Deep dive: homeboy test data-machine --changed-since 424a39a

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-test-quality-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-test-quality-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/26717452245

Audit

audit — passed

  • audit — 70 finding(s)
  • Total: 70 finding(s)

Deep dive: homeboy audit data-machine --changed-since 424a39a

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-audit-quality-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-audit-quality-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/26717452245
Tooling versions
  • Homeboy CLI: homeboy 0.213.5+e0d7ba53
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: fd7beb81
  • Action: unknown@unknown

homeboy-ci Bot added 2 commits May 31, 2026 15:57
The PR moved the pipeline-editing tools (update_flow and ~24 others) from
generic chat mode to the new pipeline_editor mode. These tests still encoded
the pre-decouple coupling (asserting update_flow resolves under chat).

- ChatToolsAvailabilityTest: assert chat EXCLUDES pipeline-editing tools and
  add a pipeline_editor test that asserts update_flow resolves there.
- ToolPolicyResolverTest: replace the chat-includes-update_flow assertion with
  a chat-excludes-pipeline-tools assertion; add pipeline_editor-mode and
  composed [chat, pipeline_editor] union coverage; re-point the agent
  deny-policy chat test at send_ping (a real chat tool) since update_flow no
  longer resolves under chat.

Full suite: 1308 passed, 3 skipped, 0 failed.
@chubes4 chubes4 merged commit e72370a into main May 31, 2026
5 checks passed
@chubes4 chubes4 deleted the fix-2425-pipeline-editor-mode branch May 31, 2026 17:11
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.

Chat mode hardcodes 'Data Machine admin UI' location — leaks into every portable chat surface (layer-purity bug)

1 participant