Skip to content

phpMan v5.0: remove LLM code, simplify to pure doc server (0 LLM calls) #224

Description

@chedong

Goal

Strip all LLM-related code, config, and cache from phpMan. After this:

  • phpMan is a pure documentation server: man/perldoc/info/pydoc/ri → raw HTML/Markdown/JSON/MCP
  • 0 LLM calls in any request path
  • Cache is for storage only, not enhancement

Why now

The 2026-07-14 myblog MT→markdown migration made it clear that LLM work is dominated by task management, prompt versioning, and flow orchestration — concerns that don't belong in a doc server. Same prompts serve phpMan, myblog, and future projects via the new standalone llm_enhance repo (#222).

Code to delete from phpMan.php

  • enhanceManPage()
  • callLLM()
  • cleanEmojiHtml()
  • formatMarkdownToHTML(), formatInlineMarkdown()
  • renderTocSidebar() (the LLM-enhanced HTML TOC version)
  • The --enhance CLI flag (formerly phpMan.php --enhance=...)

Config to delete from phpman.config.php.example

  • LLM_API_KEY
  • LLM_API_URL
  • LLM_MODEL
  • LLM_MAX_TOKENS
  • PHPMAN_ENHANCE_MAX_CHARS

Schema migration

Drop from cache SQLite table:

  • emoji_html column
  • emoji_md column

(One-time migration; backup .phpman/cache/db.sqlite first.)

Files to delete

  • cli/batch-enhance.php (moved to llm_enhance as Python CLI)
  • test/unit/test_enhance.php (LLM-related tests)

Docs to update

  • docs/01-PRODUCT.md §2.12 — already updated to "Moved to External Project"
  • docs/02-UI-DESIGN.md — drop emoji-related theme tokens if any
  • docs/05-PLAN.md — already documents this as Phase F
  • README.md — point users to llm_enhance for enhanced output

Validation

  • php test/run_all.php passes (target: ~323/323, was 349 minus 26 LLM tests)
  • phpMan.php request path: grep -E 'callLLM|enhanceMan|emoji_' phpMan.php returns 0 matches
  • phpMan.php line count reduced by ~300-500 lines
  • Manual smoke: /man/ls, /perldoc/File::Path, /search/foo all return raw output, no LLM involvement

Version

Tag v5.0.0 (major bump — removed features). No backport path; users wanting emoji enhancement install llm_enhance separately.

Rollback

All original code is in git history (v4.0..v4.9). git revert v5.0.0..HEAD restores it. llm_enhance repo is independent and unaffected.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions