Skip to content

feat: Comet-style TUI + rigorous CI#6

Merged
CryptoJones merged 5 commits into
mainfrom
feat/comet-tui-and-ci
Jun 5, 2026
Merged

feat: Comet-style TUI + rigorous CI#6
CryptoJones merged 5 commits into
mainfrom
feat/comet-tui-and-ci

Conversation

@CryptoJones

Copy link
Copy Markdown
Owner

Summary

Adds an interactive Comet-style terminal UI on top of the existing security-hardened Perplexity MCP server, and builds out a rigorous multi-job CI pipeline. The MCP tool surface is unchanged — the TUI and its page fetcher are additive and never reachable from an MCP tool.

TUI (perplexity-agent tui, optional tui extra)

Maps Perplexity Comet's browser features onto the terminal, backed by the existing Search / Sonar / deep-research client:

Comet feature Command
Assistant sidebar bare chat (tab-aware)
Answer-first search /search
Open / summarize / ask / translate a page /open /summary /ask /translate
Chat with tabs / synthesis / AI grouping /summary (all tabs), /group
Deep research /research
Memory & Spaces /space (SQLite store)
Background / scheduled tasks /task /untask
  • fetch.pySSRF-hardened page fetcher: scheme allowlist, private/loopback/link-local IP rejection re-checked on every redirect hop, size/time caps, indirect-prompt-injection flagging. Documented in SECURITY.md.
  • Out of scope by physics: voice, and real web actions (clicking/booking/buying).

CI

  • Fixes a real gap: old CI synced only --extra dev, so the new TUI tests (import textual) would fail. Now syncs --extra tui.
  • Split into lint / typecheck / test (3.11–3.13 matrix) / security jobs with uv caching, least-privilege permissions, and concurrency cancellation.
  • Coverage gate at 85% (currently 87%).
  • Added CodeQL SAST, gitleaks secret scan (+ .gitleaks.toml allowlisting placeholder keys), and Dependabot (uv + actions).

Tests

80 passing — added fetch / assistant / memory / tasks / tui / main suites plus in-memory MCP server integration tests (server.py 19% → 100%). ruff + mypy --strict clean.

Verified locally

ruff check ✓ · mypy src ✓ · 80 tests ✓ · coverage 87.34% ✓ · workflow YAML validates ✓. gitleaks runs in CI (no Docker locally; manual scan found no real keys).

🤖 Generated with Claude Code

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread tests/test_fetch.py Fixed
Comment thread tests/test_server.py Fixed
Comment thread tests/test_tasks.py Fixed
Comment thread tests/test_tasks.py Fixed
Comment thread tests/test_fetch.py Fixed
Comment thread tests/test_fetch.py Fixed
Comment thread tests/test_fetch.py Fixed
Comment thread tests/test_fetch.py Fixed
Comment thread tests/test_fetch.py Fixed
Comment thread tests/test_fetch.py Fixed
CryptoJones and others added 4 commits June 5, 2026 07:14
Add an interactive terminal UI that maps Perplexity Comet's browser features
onto the existing security-hardened MCP server, plus a multi-job CI pipeline.

TUI (optional `tui` extra, `perplexity-agent tui`):
- Textual app: assistant chat sidebar, content pane, tab bar, command palette.
- Commands: /search (answer-first), /open + /summary + /ask + /translate
  (page interaction), /tabs + /group + cross-tab synthesis, /research,
  /space (Spaces), /task + /untask (background monitors).
- assistant.py orchestrates Search/Sonar/deep-research; memory.py is a local
  SQLite store; tasks.py runs asyncio change-detection monitors.
- fetch.py is an SSRF-hardened page fetcher (scheme allowlist, private-IP
  rejection re-checked on every redirect hop, size/time caps, injection
  flagging). Reachable only from the TUI — the MCP tool surface is unchanged.
- Out of scope by physics: voice and real web actions (clicking/booking/buying).

CI:
- Split into lint / typecheck / test (3.11-3.13 matrix) / security jobs with
  uv caching, least-privilege permissions, and concurrency cancellation.
- Coverage gate at 85% (currently 87%); CI now syncs --extra tui so TUI tests
  run. Added CodeQL SAST, gitleaks secret scan (+ allowlist for placeholder
  keys), and Dependabot for uv + actions.

Tests: 80 passing (added fetch/assistant/memory/tasks/tui/main and in-memory
MCP server integration tests; server.py now 100% covered). ruff + mypy strict
clean. Docs: README feature map + TUI usage, SECURITY.md fetcher egress section,
CHANGELOG entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The gitleaks generic-api-key rule flagged the fake `pplx-abcdef123456` key in
tests/test_security.py (a fixture for the redaction unit test — not a real
secret). Broaden the allowlist to cover hex placeholder keys and match against
the whole line so allowlisting is robust to how each rule captures its secret.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds this feature branch to CodeQL's push trigger (and a workflow_dispatch) so
the SAST setup runs once before merge. Reverts to main-only after results are
confirmed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CodeQL validated clean (0 alerts) on the feature branch. Restore the intended
trigger set: push/PR to main, weekly schedule, plus workflow_dispatch for manual
runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CryptoJones CryptoJones force-pushed the feat/comet-tui-and-ci branch from 16f66c8 to 23f044d Compare June 5, 2026 12:16
CodeQL's first full run surfaced 10 alerts — all in test files, none in shipped
code:
- 2 "high" py/incomplete-url-substring-sanitization on `"https://…" in <json>`
  test assertions (benign in tests)
- 2 py/side-effect-in-assert on `assert mgr.remove(...)` / `assert await
  run_once(...)` (these silently skip under `python -O`)
- 6 py/import-and-import-from notes on test_fetch.py's mixed import style

Scope SAST to the shipped package via a CodeQL config (paths: src) so findings
stay actionable, and fix the genuine assert-with-side-effect anti-pattern by
assigning before asserting. src/ remains clean (0 alerts).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit db98529 into main Jun 5, 2026
14 checks passed
@CryptoJones CryptoJones deleted the feat/comet-tui-and-ci branch June 5, 2026 12:24
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