Skip to content

feat: enrich human gates with Markdown rendering and file links#1

Merged
PolyphonyRequiem merged 1 commit intoinstall-combinedfrom
feature/human-gate-enrichment
Apr 23, 2026
Merged

feat: enrich human gates with Markdown rendering and file links#1
PolyphonyRequiem merged 1 commit intoinstall-combinedfrom
feature/human-gate-enrichment

Conversation

@PolyphonyRequiem
Copy link
Copy Markdown
Owner

Summary

Enriches human gate prompts with proper Markdown rendering and interactive file links in both the terminal CLI and web dashboard.

Changes

Terminal (CLI):

  • Gate prompts now render as Rich Markdown — headings, bold, lists, code blocks, and links display properly instead of raw markup text

Web Dashboard:

  • New \GET /api/files/{path}\ endpoint serves local files relative to the workflow root
    • Security: path traversal protection (
      esolve()\ +
      elative_to()), extension allowlist, 1MB size limit, absolute/UNC/scheme path rejection
  • New \FileViewer\ modal component renders linked files (Markdown for .md, monospace for others)
  • Relative links in gate prompts (e.g. [plan](./plan.md)) open the FileViewer instead of navigating away
  • External URLs continue to open in new browser tabs

Files Changed

File Change
\src/conductor/gates/human.py\ Wrap prompt in \RichMarkdown()\
\src/conductor/web/server.py\ Add \workflow_root\ param + file API endpoint
\src/conductor/cli/run.py\ Pass \workflow_root\ to WebDashboard
\src/conductor/web/frontend/.../FileViewer.tsx\ NEW modal file viewer
\src/conductor/web/frontend/.../GateDetail.tsx\ Link interception + \isRelativeFileLink\ helper
\ ests/test_web/test_server.py\ 13 new file API security tests
\ ests/test_gates/test_human.py\ 3 new/updated Markdown rendering tests

Testing

All 79 tests pass across both test suites (test_server + test_human). No regressions.

- Terminal gates: wrap prompt text in Rich Markdown for proper heading,
  bold, list, and link rendering in the CLI
- Web dashboard: add GET /api/files/{path} endpoint to serve local files
  relative to the workflow root with security guards (path traversal
  protection, extension allowlist, 1MB size limit)
- Web dashboard: add FileViewer modal component for viewing linked files
  with Markdown rendering support
- Web dashboard: intercept relative links in gate prompts to open the
  FileViewer instead of navigating away; external URLs still open in
  new tabs
- Tests: 13 file API security tests + 3 gate Markdown rendering tests
  (79 total tests pass across both test suites)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PolyphonyRequiem PolyphonyRequiem merged commit ea16988 into install-combined Apr 23, 2026
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