Skip to content

docs: build out /docs/ tree (22 topical pages, README untouched) - #245

Merged
FMXExpress merged 3 commits into
mainfrom
claude/docs-tree
Jun 13, 2026
Merged

FMXExpress merged 3 commits into
mainfrom
claude/docs-tree

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Summary

Adds /docs/ as a topical documentation tree. README.md is byte-identical to main — deliberately untouched so existing GitHub deep-links to README.md#mcp-servers etc. keep working. The docs tree is purely additive.

22 pages, ~3800 LOC, organised by topic.

Layout

Index

  • docs/README.md — link tree by topic

Getting started

  • docs/getting-started.md — install + onboard + first chat
  • docs/configuration.md — config.json + env vars + $PASCLAW_HOME
  • docs/commands.md — all 27 top-level commands with flags

Capabilities

  • docs/providers.md — 19-entry catalog + fallback chain + prompt caching
  • docs/tools.md — built-in tools the model sees
  • docs/web-search.md — web_search / web_fetch providers
  • docs/memory.md — workspace/memory/ + FTS5 + hybrid vector
  • docs/knowledgebase.md — pasclaw kb (RAG over docs)
  • docs/skills.md — $PASCLAW_HOME/workspace/skills/
  • docs/sessions.md — persistence + resume + mid-loop steering
  • docs/mcp.md — MCP servers (stdio + http) + catalog
  • docs/cron.md — scheduled tasks

Interfaces

  • docs/gateway.md — /v1/chat/completions, /v1/responses, web UI, route table
  • docs/channels.md — Telegram / Slack / Matrix / IRC / Discord / WhatsApp / LINE / Email
  • docs/embedding.md — TPasClawAgent / TPasClawServer

Operations

  • docs/security.md — sandbox + denylist + SSRF guard
  • docs/observability.md — OpenTelemetry + /v1/stats
  • docs/troubleshooting.md — grep-friendly "user sees X, fix Y"

Inside PasClaw

  • docs/architecture.md — system overview + agent loop walkthrough
  • docs/contributing.md — repo layout + build / test / commit conventions
  • docs/changelog.md — feature-by-feature history (mirrors the README's changelog)

Specialised (already existed)

  • docs/c2w.md — container2wasm browser build

Conventions

  • Each page focused on one topic. Cross-links are relative (./<topic>.md#<anchor>).
  • Source-truth inline unit comments are still the last word; pages link to relevant units when the inline comment is the better source.
  • README.md changelog and docs/changelog.md intentionally mirror each other — when a PR adds a notable feature, both files get an entry.

Three pages have no prior source material in the README and were written fresh

Verification

  • All 22 docs created.
  • README.md byte-identical to main (git diff --stat README.md is empty).
  • All cross-links target real files (grep'd and validated each ./*.md reference).
  • No build / test impact (docs only).

Scope

~3800 LOC across 22 files. Most of the volume is direct paste-and-organise from the README's existing sections, refactored into focused topic pages with consistent "see also" footers. The three NEW pages add ~750 LOC.


Generated by Claude Code

The root README.md is 1007 lines covering everything from install
to provider catalog to security to embedding. Useful as a reference,
painful as a landing page. This PR adds /docs/ as a topical tree
that a reader can navigate by topic — README.md is left untouched
so existing GitHub deep-links (README.md#mcp-servers etc.) keep
working.

Pages added:

  index:
    docs/README.md            ← link tree by topic

  getting started:
    docs/getting-started.md   ← install + onboard + first chat
    docs/configuration.md     ← config.json + env vars + $PASCLAW_HOME
    docs/commands.md          ← all 27 top-level commands

  capabilities:
    docs/providers.md         ← 19-entry catalog + fallback + caching
    docs/tools.md             ← built-in tools the model sees
    docs/web-search.md        ← web_search / web_fetch providers
    docs/memory.md            ← workspace/memory/ + FTS5 + vector
    docs/knowledgebase.md     ← pasclaw kb (RAG over docs)
    docs/skills.md            ← $PASCLAW_HOME/workspace/skills/
    docs/sessions.md          ← persistence + resume + steering
    docs/mcp.md               ← MCP servers (stdio + http) + catalog
    docs/cron.md              ← scheduled tasks

  interfaces:
    docs/gateway.md           ← /v1/chat/completions + /v1/responses
    docs/channels.md          ← Telegram/Slack/Matrix/IRC/Discord/...
    docs/embedding.md         ← TPasClawAgent / TPasClawServer

  operations:
    docs/security.md          ← sandbox + denylist + SSRF guard
    docs/observability.md     ← OpenTelemetry + /v1/stats
    docs/troubleshooting.md   ← grep-friendly "user sees X, fix Y"

  inside pasclaw:
    docs/architecture.md      ← system overview + agent loop walkthrough
    docs/contributing.md      ← repo layout + build + test + commit style
    docs/changelog.md         ← feature-by-feature history

  specialised (already there, kept):
    docs/c2w.md               ← container2wasm browser build

Conventions for these pages:
  - Each page is focused on one topic.
  - Cross-links are relative (./<topic>.md#<anchor>).
  - Source-truth comments at the top of each unit are still the
    last word; these pages link to the relevant unit when the
    inline comment is the better source.
  - The README.md changelog and the new docs/changelog.md
    intentionally mirror each other -- when a PR adds a feature
    worth surfacing, both files get an entry.

Three pages have no prior source material in the README and were
written fresh: architecture.md (system overview from the inline
unit comments), contributing.md (build conventions, test
conventions, commit style codified from PR history), and
troubleshooting.md (entries mined from PR descriptions where
real-world issues were diagnosed — Windows OEM mojibake from #237,
config rewrite drops diagnostics from #242, [info] leak in --quiet
from #244, etc.).

README.md is byte-identical to main -- intentional. Splitting it
would break deep-links people have to specific sections. The docs/
tree is purely additive.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85e2130e78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/mcp.md Outdated
The gateway can be locked down for exposed MCP:

```sh
pasclaw gateway --mcp-allow fs_read,fs_list,memory_search # only these tools advertised

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the unsupported MCP allowlist flag

For exposed MCP listeners this allowlist example does not take effect: the gateway/serve parsers only recognize --mcp-port and --mcp-allow-write (src/cmd/PasClaw.Cmd.Gateway.pas lines 155-156; src/cmd/PasClaw.Cmd.Serve.pas lines 118-119), and no CLI path calls SetMCPAllowList. Because unknown flags are skipped, users following this new lockdown guidance will still advertise all default read-only MCP tools instead of the named subset.

Useful? React with 👍 / 👎.

Comment thread docs/commands.md Outdated
pasclaw auth status
pasclaw auth login anthropic
pasclaw auth logout anthropic
pasclaw auth fallback openai gemini # set Cfg.Fallbacks

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the nonexistent auth fallback command

The documented pasclaw auth fallback ... command is not implemented: Cmd_Auth_Run dispatches only status, login, logout, and weixin (src/cmd/PasClaw.Cmd.Auth.pas lines 105-113), so this example prints help and exits non-zero instead of setting Cfg.Fallbacks. Users following the authoritative command reference cannot configure fallbacks this way.

Useful? React with 👍 / 👎.

Comment thread docs/channels.md Outdated
Comment on lines +33 to +34
pasclaw gateway --discord --token <BOT_TOKEN>
pasclaw gateway --slack

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop advertising unwired Slack/Discord gateway flags

The gateway parser has no --discord or --slack cases and only starts Telegram, LINE, WhatsApp, Matrix, IRC, and Email channels, so these two commands are silently ignored rather than enabling inbound bots. In the environments using these docs to deploy channel bots, this leaves Slack/Discord disconnected with no obvious startup error.

Useful? React with 👍 / 👎.

Comment thread docs/channels.md Outdated
- `$PASCLAW_LINE_TOKEN` — channel access token.
- `$PASCLAW_LINE_SECRET` — channel secret (used to verify `X-Line-Signature` on inbound events).

Point LINE's webhook URL at `https://<your-gateway>/v1/line/webhook`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fix the LINE webhook path

When --line is enabled, the gateway mounts the LINE handler at /webhooks/line (Server.MountWebhook('/webhooks/line', ...)), not under /v1. Configuring LINE with the documented /v1/line/webhook URL sends platform callbacks to an unmapped route, so inbound LINE messages will never reach the bot.

Useful? React with 👍 / 👎.

Comment thread docs/channels.md Outdated
- `$PASCLAW_WHATSAPP_VERIFY_TOKEN` — user-chosen string used to verify Meta's `GET /webhooks/whatsapp` subscription handshake.
- `$PASCLAW_WHATSAPP_APP_SECRET` — Meta App Secret used to validate `X-Hub-Signature-256` on inbound events.

Point Meta's webhook URL at `https://<your-gateway>/v1/whatsapp/webhook`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fix the WhatsApp webhook path

When --whatsapp is enabled, the gateway mounts the handler at /webhooks/whatsapp (Server.MountWebhook('/webhooks/whatsapp', ...)), while this setup instruction points Meta at /v1/whatsapp/webhook. Using the documented URL makes the verification handshake and inbound events miss the registered route.

Useful? React with 👍 / 👎.

claude added 2 commits June 13, 2026 14:01
Both changelog files were stuck at the 2026-06-10 TUI / background-
subagent / session_search / tool-RPC entries. ~7 weeks of merged
PRs (#214 through #244) had landed without a corresponding entry in
either file -- the git log was the only record of features like the
knowledgebase, inbound MCP server mode, checkpoints + /undo,
heartbeat daemon, shell backends (local | docker), send_message,
promptware defense, Windows shell-output encoding fixes, fs_grep
ripgrep optimisations, OpenTelemetry traces, and `pasclaw agent
--quiet`.

Added (newest first):

  2026-06-13
    #244  agent --quiet log-level clamp

  2026-06-12
    #243  dcc64 search path + agent --quiet / -q
    #242  OpenTelemetry traces (OTLP/HTTP+JSON)
    #241  fs_grep tier 5+6 (byte walker + Boyer-Moore-Horspool)
    #240  fs_grep tier 1-4 (deferred hash + skip-dirs + binary
          sniff + size cap)

  2026-06-11
    #239  Windows shell output: auto-detect UTF-8 vs OEM
    #238  Hashline fs_read header mojibake fix (¶ vs ¶)
    #237  Windows shell output: OEM codepage decode

  2026-06-10
    #233  Shell backends (local | docker via IShellBackend)
    #232  Heartbeat daemon + reversible condensation (CCR)
    #230  send_message tool + condenser families + promptware
          defense + task-aware MEMORY.md slicing

  2026-06-09
    #223  /goal Ralph loop + judge model + JSON-aware condenser
    #222  /undo wired into agent + sample dprojs
    #221  Checkpoints (auto-snapshot + TUI /undo)
    #220  mcp catalog: lenient hub projector
    #219  mcp: SSE / Streamable HTTP / stdio hub transports
    #218  Inbound MCP server mode
    #217  onboard: offer to index docs into the knowledgebase
    #214  Knowledgebase (RAG over operator-curated docs)

Skipped from this changelog (build-system / Delphi-fix / FPC-fix
PRs visible in the git log but not user-facing features):
#215, #216, #224, #225, #226, #227, #228, #229, #231, #234, #236.

Both files (README.md and docs/changelog.md) updated with the same
entries -- intentional mirror so a reader on either surface sees
the same history. Same prose in both; same footnote refs at the
bottom.

Validated: every [#N] reference in both files has a matching [#N]:
URL footnote (no broken links).
Codex review on PR #245 caught five inline issues -- all real, all
documentation referencing CLI flags / subcommands / URL routes that
don't exist in the code:

1. docs/mcp.md documented `--mcp-allow <list>`, `--mcp-read-only`,
   `--mcp-only` for the inbound MCP server. None of those exist.
   The actual flags from src/cmd/PasClaw.Cmd.Gateway.pas:
     - `--mcp-port <p>` spawns the second MCP-only listener (the
       inbound-MCP server is read-only by default; this flag is what
       wakes the isolation pattern).
     - `--mcp-allow-write` flips that listener from read-only to
       allowing mutating tools.
   No comma-separated per-tool allowlist; no standalone --mcp-only.

2. docs/commands.md, docs/configuration.md, docs/providers.md
   referenced `pasclaw auth fallback openai gemini`. src/cmd/
   PasClaw.Cmd.Auth.pas only dispatches `status` / `login` / `logout`
   / `weixin` -- no `fallback` subcommand exists. The fallback chain
   is configured by editing `fallbacks[]` in config.json directly.

3. docs/channels.md + docs/commands.md + docs/gateway.md documented
   `pasclaw gateway --discord --token <BOT_TOKEN>` and
   `pasclaw gateway --slack`. Those flags don't exist in the gateway
   ArgParser -- the channel units (PasClaw.Channels.Discord with
   TDiscordBot, PasClaw.Channels.Slack with the Events API receiver)
   exist but aren't wired to a CLI flag yet. Currently outbound-only
   via `pasclaw post discord/slack` and the `send_message` tool.

4. docs/channels.md said "Point LINE's webhook URL at
   https://<gateway>/v1/line/webhook". src/pkg/channels/
   PasClaw.Channels.LINE.pas line 13 says POST /webhooks/line.

5. docs/channels.md said "Point Meta's webhook URL at
   https://<gateway>/v1/whatsapp/webhook". src/pkg/channels/
   PasClaw.Channels.WhatsApp.pas lines 18+25 say GET/POST
   /webhooks/whatsapp.

All five are docs-only bugs -- the code is fine. Without the fix
operators following the docs would silently fail: --mcp-allow gets
ignored as an unknown flag, --discord/--slack same, the webhook URLs
404 at the gateway and Meta/LINE rejects the subscribe handshake.

Fixes:
- docs/mcp.md: replaced the wrong flag block with the real
  `--mcp-port` / `--mcp-allow-write` shape, plus a paragraph
  explaining the read-only-by-default contract.
- docs/commands.md + docs/configuration.md + docs/providers.md:
  removed `auth fallback`; replaced with "edit fallbacks[] in
  config.json directly".
- docs/channels.md: moved Discord and Slack from the bidirectional
  table into outbound-only, added inline notes about the
  not-yet-wired inbound paths. Fixed both webhook URLs.
- docs/commands.md + docs/gateway.md: dropped --discord/--slack
  from the gateway running examples, added --mcp-port to the same
  example block since it's a real isolation flag.
- docs/troubleshooting.md: --mcp-only -> "the listener spawned by
  --mcp-port <p>" so the troubleshooting entry maps to a real flag.
- docs/changelog.md + README.md: rewrote the PR #218 changelog
  entry to describe the real flags (--mcp-allow-write defaulting
  to read-only, --mcp-port for the second listener).
@FMXExpress
FMXExpress merged commit 6229923 into main Jun 13, 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.

2 participants