← Back to Pull requests

feat: llms.txt shell guide and {{webmux}} (2/5) #339

Closed
unknown closed this pull request without merging on Nov 06, 2026 01:59 UTC
View on GitHub
unknown unknown commented on Nov 05, 2026 18:28 UTC
Author

Summary

Second implementation PR of add-agent-shell-control (stacked on #338). Scope: tasks.md §6, plus webmux dir (§2.7) and the llms command reference (§7.3).

Shell guide (US-S05)


  • New shared package internal/agentguide: /llms.txt (H1, blockquote summary, command-prefix note, topic links, ## Optional), /llms/<topic>.md, /llms-full.txt. Embedded and rendered in memory — nothing is written to the temp folder or anywhere else.

  • Topics: connect (how to find the executable and socket, troubleshooting), sessions, launch, artifacts (all of the old “临时文件夹” preset text), commands, exit codes, rules, recipes.

  • /llms/commands.md is generated from the command table; TestGuideCommandReference fails when stale (WEBMUX_UPDATE_GUIDE=1 regenerates). Defaults under $HOME are written with ~.

  • TCP: no token (outside /api/, like the static app) but Host-checked, and no version, host, path or session data — a test checks it. The local socket adds version, executable and socket.

  • CLI: webmux guide [TOPIC] [--full] [--path] (falls back to the built-in copy when the server is down) and webmux dir [SESSION].
  • {{webmux}} (US-S06)


  • POST /api/sessions/{id}/agent-guide → AgentGuidePrompt{prompt, guideUrl, dir, bin, socket}; the brief names the session ID, the absolute executable and socket, the llms.txt address and guide, and the artifacts folder with the deliverables rule.

  • Init instructions: {{webmux}} is no longer rejected; it is inserted after {{dir}} so nothing in it is rescanned; an unavailable brief fails the precheck with 503 before any worktree exists.

  • Web: quick commands expand {{webmux}} (failure → “WebMux 工具说明不可用”, nothing inserted); preset “临时文件夹” is replaced by “WebMux 工具” ({{webmux}}) — saved lists are untouched; the init instruction field gains a built-in “WebMux 说明” button and loses the reserved-variable warning; Quick Start’s preview explains {{webmux}}.
  • Screenshots (isolated demo instance, demo repo bookshelf-api)

    Repository settings — desktop 1280×720, light

    | Before | After |
    | --- | --- |
    | ![](https://github.com/mzdluo123/webmux/blob/ccr-462bcb9e-6uyk04-pr2/docs/images/webmux-guide/repo-settings-desktop-light-before.png?raw=true) | ![](https://github.com/mzdluo123/webmux/blob/ccr-462bcb9e-6uyk04-pr2/docs/images/webmux-guide/repo-settings-desktop-light-after.png?raw=true) |

    Repository settings — desktop dark / mobile 390×844 light (after)

    | Desktop dark | Mobile light |
    | --- | --- |
    | ![](https://github.com/mzdluo123/webmux/blob/ccr-462bcb9e-6uyk04-pr2/docs/images/webmux-guide/repo-settings-desktop-dark-after.png?raw=true) | ![](https://github.com/mzdluo123/webmux/blob/ccr-462bcb9e-6uyk04-pr2/docs/images/webmux-guide/repo-settings-mobile-light-after.png?raw=true) |

    Settings → quick commands (presets) — desktop light

    | Before | After |
    | --- | --- |
    | ![](https://github.com/mzdluo123/webmux/blob/ccr-462bcb9e-6uyk04-pr2/docs/images/webmux-guide/quick-commands-desktop-light-before.png?raw=true) | ![](https://github.com/mzdluo123/webmux/blob/ccr-462bcb9e-6uyk04-pr2/docs/images/webmux-guide/quick-commands-desktop-light-after.png?raw=true) |

    More (dark, mobile, before/after) are in docs/images/webmux-guide/.

    Verification


  • go test -race: internal/agentguide, internal/api (guide routes incl. Host check and unclean paths, brief endpoint, new wire snapshot), internal/workspace (brief order, precheck), internal/sessioncmd, cmd/webmux, internal/archtest, internal/localclient.

  • make check items run individually: format, docs guard, pnpm check, lint, check:arch, golangci-lint v2.15.0.

  • Vitest unit (654) and browser (547) suites pass; E2E artifacts.spec.ts and quick-commands.spec.ts pass on desktop and mobile.

  • Locally TestWireSnapshots/workspace differs only in repository-commits.json (git 2.43 date format), same as on a clean main.

  • Visual check: desktop light/dark and mobile light in Chromium; no real devices.
  • User stories


    US-S05, US-S06 added; US-G06 and the J-group init instruction text updated; coverage index and verification log updated.

    ---
    _Generated by Claude Code_

    Diff: 527 lines (+395 / -132) across 6 files Reviewer: mzdluo123 Review duration: 450m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.53) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.53 · 527 lines diff across 6 files
    0.53
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.375
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #339"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52.8% (MEDIUM) · Higher = larger blast radius
    52.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.9% · Safe to merge
    20.9%