Repository navigation
Closed
Description
Context
The docs tools from the previous issue read Markdown from disk. In a source checkout docs/ is present; in production the API runs from the propr/app image built by docker/app/Dockerfile (via scripts/build-images.sh), which does not copy docs/. Without this issue the tools answer DOCS_UNAVAILABLE on real installs.
The request also asks: "Consider how the docs are kept current with the shipped version." The answer should be structural: the docs served by an instance must come from the same commit as the code it runs, and the tools must say which version that is.
Requirements
- New script
scripts/build-docs-manifest.mjsthat readsdocs/sidebars.tsordering (without executing TypeScript: parse the doc ids with a conservative regex over string literals, falling back to alphabetical), and writesdocs/docs-manifest.json:{ "schemaVersion": 1, "version": "<root package.json version>", "sourceRevision": "<GIT_SHA env or git rev-parse HEAD or null>", "generatedAt": "<ISO>", "order": ["tutorials/setup", "features/overview", ...], "pageCount": 87 }docs-manifest.jsonis git-ignored (generated). docker/app/Dockerfile: in the final stage, run the manifest script in the build stage andCOPYonlydocs/docs/,docs/mcp.md,docs/mcp-coverage.md,docs/mcp-operator-surface.mdanddocs/docs-manifest.jsoninto/app/docs/(nonode_modules, no build output, no images — keeps the image small). PassGIT_SHAas a build arg (already provided byscripts/build-images.sh).docsIndex.tsalready prefers the manifest when present (version,sourceRevision,order). Additionally, if the manifestversiondiffers from the running@propr/apipackage version,list_docsreturnsversionMismatch: { docs, api }and a warning so an operator mounting stale docs throughPROPR_DOCS_DIRsees it.get_connectionoutput gainsdocs: { available: boolean, version, sourceRevision, pages }so an agent can check docs availability in its first call.scripts/smoke-test-images.shgains an assertion that/app/docs/docs-manifest.jsonexists in the app image and itsversionequals the image's package version..dockerignoreat repo root (if it excludesdocs/) must allow the copied paths.docs/README.mddocuments that docs are shipped inside the app image and exposed to MCP clients, and that editing docs in a PR is enough to update what agents see after the next release.
Implementation Specification
- New
scripts/build-docs-manifest.mjs+test/buildDocsManifest.test.mjs(root test dir, node:test). - Edit
docker/app/Dockerfile,scripts/smoke-test-images.sh,.dockerignore,.gitignore(adddocs/docs-manifest.json). - Edit
packages/api/mcp/toolsDocs.ts(versionMismatch) andpackages/api/mcp/tools.ts(get_connection.docs). - Edit
docs/README.md.
Acceptance Criteria
-
node scripts/build-docs-manifest.mjsproduces a manifest whoseorderstarts with the first ids indocs/sidebars.tsand whosepageCountequals the number of.md/.mdxfiles underdocs/docs. - A built
propr/appimage contains/app/docs/docs/features/pr-commands.mdand the manifest;list_docsinside the container returns pages withdocsVersionequal to the release version andsourceRevisionequal to the image's git SHA. -
get_connectionreportsdocs.available: truein the image andfalsewhen no docs root exists. - Image size increase is under 3 MB (docs are Markdown only).
- Smoke test fails if the manifest is missing.
Created by ProPR AI Planner
Activity
propr-dev commentedon Sep 28, 2026
Suggested Implementation:
Implementation Approach
We ship the Markdown inside the app image built from the same commit. Alternatives considered: fetching docs from the public docs site at runtime (rejected: network dependency, and the public site tracks
main, not the operator's installed version) and reading the optionalpropr/docscontainer (rejected: it is optional and serves rendered HTML). Baking in a small manifest withversionandsourceRevisionmakes "which docs am I reading?" answerable and lets us detect a mismatchedPROPR_DOCS_DIRoverride.File:
scripts/build-docs-manifest.mjs(new file)Why this file: Produces the version/ordering metadata at build time, so the runtime never has to execute
sidebars.ts.File:
docker/app/DockerfileWhy this file: Only the app image serves the API; docs must be copied into it from the same build context and commit.
Adjust the stage name (
build) and source path (/app) to the names used in the existing Dockerfile.File:
scripts/smoke-test-images.shWhy this file: Release gate: an image without docs would silently make the MCP docs tools unavailable.
File:
packages/api/mcp/toolsDocs.tsWhy this file: Surfaces a version mismatch when an operator overrides
PROPR_DOCS_DIRwith docs from another release.File:
packages/api/mcp/tools.tsWhy this file:
get_connectionis the first call agents make; advertising docs availability there saves a failing round trip.File:
test/buildDocsManifest.test.mjs(new file)Why this file: Guards the sidebar parsing so a sidebar refactor cannot silently scramble page order.
File:
.gitignoreanddocs/README.mdpropr-dev commentedon Sep 29, 2026
🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-5.6-sol2602/gpt-5.6-sol-bundle-the-docs-into-the--20260929-2059-nsm2593-epic-mcp-observability-cf6issue-2602-20260929-2059-gpt-5.6-sol-nsm🔍 Track Task Execution
fix(ai): Resolve issue #2602 - Bundle the docs into the app image wit…
fix(ai): Resolve issue #2602 - Bundle the docs into the app image wit…