Repository navigation
docs: build out /docs/ tree (22 topical pages, README untouched) - #245
Conversation
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.
There was a problem hiding this comment.
💡 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".
| The gateway can be locked down for exposed MCP: | ||
|
|
||
| ```sh | ||
| pasclaw gateway --mcp-allow fs_read,fs_list,memory_search # only these tools advertised |
There was a problem hiding this comment.
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 👍 / 👎.
| pasclaw auth status | ||
| pasclaw auth login anthropic | ||
| pasclaw auth logout anthropic | ||
| pasclaw auth fallback openai gemini # set Cfg.Fallbacks |
There was a problem hiding this comment.
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 👍 / 👎.
| pasclaw gateway --discord --token <BOT_TOKEN> | ||
| pasclaw gateway --slack |
There was a problem hiding this comment.
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 👍 / 👎.
| - `$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`. |
There was a problem hiding this comment.
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 👍 / 👎.
| - `$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`. |
There was a problem hiding this comment.
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 👍 / 👎.
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).
Summary
Adds
/docs/as a topical documentation tree.README.mdis byte-identical tomain— deliberately untouched so existing GitHub deep-links toREADME.md#mcp-serversetc. keep working. The docs tree is purely additive.22 pages, ~3800 LOC, organised by topic.
Layout
Index
docs/README.md— link tree by topicGetting started
docs/getting-started.md— install + onboard + first chatdocs/configuration.md—config.json+ env vars +$PASCLAW_HOMEdocs/commands.md— all 27 top-level commands with flagsCapabilities
docs/providers.md— 19-entry catalog + fallback chain + prompt cachingdocs/tools.md— built-in tools the model seesdocs/web-search.md—web_search/web_fetchprovidersdocs/memory.md—workspace/memory/+ FTS5 + hybrid vectordocs/knowledgebase.md—pasclaw kb(RAG over docs)docs/skills.md—$PASCLAW_HOME/workspace/skills/docs/sessions.md— persistence + resume + mid-loop steeringdocs/mcp.md— MCP servers (stdio + http) + catalogdocs/cron.md— scheduled tasksInterfaces
docs/gateway.md—/v1/chat/completions,/v1/responses, web UI, route tabledocs/channels.md— Telegram / Slack / Matrix / IRC / Discord / WhatsApp / LINE / Emaildocs/embedding.md—TPasClawAgent/TPasClawServerOperations
docs/security.md— sandbox + denylist + SSRF guarddocs/observability.md— OpenTelemetry +/v1/statsdocs/troubleshooting.md— grep-friendly "user sees X, fix Y"Inside PasClaw
docs/architecture.md— system overview + agent loop walkthroughdocs/contributing.md— repo layout + build / test / commit conventionsdocs/changelog.md— feature-by-feature history (mirrors the README's changelog)Specialised (already existed)
docs/c2w.md— container2wasm browser buildConventions
./<topic>.md#<anchor>).README.mdchangelog anddocs/changelog.mdintentionally 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
architecture.md— system overview pulled from the inline block comments inPasClaw.Tools.ToolLoop,PasClaw.Cmd.Root,PasClaw.Otel,PasClaw.Providers.Factory,PasClaw.Shell.Backend, etc. Walks the agent loop iteration, fallback walk, hook ordering, MCP bridges, sandbox guards, shell backends.contributing.md— repo layout (oneCmd.<Name>.pasper top-level command, packaged undersrc/pkg/<topic>/), FPC + Delphi build, test conventions (one test program per feature, regression naming), the dpr/Makefile dual-tree pitfall (F2613 Unit not found), comment style with Codex/PR-review attribution, commit message + PR description shape, review-fix commits.troubleshooting.md— grep-friendly entries mined from PR descriptions where real-world issues got diagnosed: Windows OEM mojibake (Windows shell output: decode via OEM codepage (closes mojibake on non-ASCII paths) #237/Revert PR #237's GetConsoleOutputCP fix; cmd pipes use OEM, not console CP #239),¶infs_readoutput (Hashline: fix fs_read header mojibake on Windows (¶ → ¶) #238), config rewrite dropsdiagnostics.otel.*(otel: OpenTelemetry traces (OTLP/HTTP+JSON) for agent loop + gateway #242),[info]leak in--quiet(agent --quiet: clamp logger to llError so [info] noise stays off the stdout pipe #244),pasclaw agent --quietexit-0-on-error (dcc64: add otel/ to Delphi search path; addpasclaw agent --quiet#243),dcc64 F2613 Unit 'PasClaw.Otel' not found(dcc64: add otel/ to Delphi search path; addpasclaw agent --quiet#243), OpenSSL DLL not loadable, OOM-killed mid-turn, MCP cache empty, channel auth, sandbox refusals, OTel exports not arriving.Verification
README.mdbyte-identical tomain(git diff --stat README.mdis empty).grep'd and validated each./*.mdreference).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