Skip to content

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

Draft
PolyphonyRequiem wants to merge 3 commits intomicrosoft:mainfrom
PolyphonyRequiem:feat/human-gate-enrichment
Draft

feat: enrich human gates with Markdown rendering and file links#114
PolyphonyRequiem wants to merge 3 commits intomicrosoft:mainfrom
PolyphonyRequiem:feat/human-gate-enrichment

Conversation

@PolyphonyRequiem
Copy link
Copy Markdown
Member

Summary

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

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 (resolve + relative_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

  • 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
  • tests/test_web/test_server.py -- 13 new file API security tests
  • tests/test_gates/test_human.py -- 3 new/updated Markdown rendering tests

Testing

All 79 tests pass across both test suites. No regressions.

Daniel Green and others added 3 commits April 23, 2026 17:05
- 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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@873c72b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/conductor/web/server.py 85.71% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #114   +/-   ##
=======================================
  Coverage        ?   84.86%           
=======================================
  Files           ?       53           
  Lines           ?     7194           
  Branches        ?        0           
=======================================
  Hits            ?     6105           
  Misses          ?     1089           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PolyphonyRequiem PolyphonyRequiem marked this pull request as draft April 24, 2026 15:19
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.

2 participants