Skip to content

build(docs): isolate docs build from the workspace lock#286

Merged
max-parke-scale merged 4 commits into
mainfrom
maxparke/agx1-292-docs-build-isolation
Jun 9, 2026
Merged

build(docs): isolate docs build from the workspace lock#286
max-parke-scale merged 4 commits into
mainfrom
maxparke/agx1-292-docs-build-isolation

Conversation

@max-parke-scale

@max-parke-scale max-parke-scale commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Decouples the documentation build from the backend's workspace uv.lock so documenting a newly released SDK API surface no longer forces backend dependency bumps.

Problem

The mkdocs site documents the published agentex SDK via mkdocstrings, which introspects the installed agentex package. The build installed it from the frozen workspace lock (uv sync --group docs), pinning the docs to whatever agentex-sdk the backend's lock resolved. Documenting a new path like agentex.protocol.* (released in agentex-sdk 0.11.5) therefore required bumping agentex-sdk in the lock — and because every protocol-supporting SDK floors openai-agents>=0.14.3 (→ websockets>=15) and temporalio>=1.26, that cascaded backend-runtime bumps the docs don't need.

Change

Docs deps now live in agentex/docs/requirements.txt and install into an ephemeral environment, independent of the workspace lock:

  • CI (ci.yml, build-agentex.yml) and Makefile (serve-docs, build-docs): uv run --isolated --no-project --with-requirements requirements.txt mkdocs build
  • Dockerfile docs-builder stage: uv pip install --system -r docs/requirements.txt (honors UV_INDEX_URL for private-index prod builds)

The workspace lock and backend dependency resolution are untouched — zero pyproject.toml / uv.lock changes. Docs always render against the latest published SDK.

Verified

  • Isolated mkdocs build green locally — griffe introspects an ephemeral uv env, not .venv.
  • make build-docs green.

Notes

  • The docs dependency-group in agentex/pyproject.toml is now unused by the build (left in place; install-docs still references it). Removing it + relocking is a trivial follow-up.
  • #254 (canonical agentex.protocol.acp doc paths) stacks on this branch and goes green because the isolated build pulls agentex-sdk>=0.12.0.

🧑‍💻🤖 — posted via Claude Code

Greptile Summary

This PR decouples the MkDocs documentation build from the workspace uv.lock by introducing agentex/docs/requirements.txt and switching CI, the Makefile, and the Dockerfile docs-builder stage to install docs deps in an isolated ephemeral environment. Zero changes to pyproject.toml runtime deps or the workspace lock.

  • New docs/requirements.txt: mkdocs toolchain packages are pinned to known-good versions for reproducibility; agentex-sdk>=0.12.0 stays floating so the rendered docs automatically track new SDK releases without forcing backend dependency bumps.
  • CI & Makefile: Both workflows and both Makefile targets (build-docs, serve-docs) now use uv run --isolated --no-project --with-requirements requirements.txt mkdocs build/serve.
  • Dockerfile docs-builder stage: Drops the uv export --frozen --group docs path in favour of uv pip install -r docs/requirements.txt; the docs dependency group is removed from both pyproject.toml and the workspace lock.

Confidence Score: 5/5

Safe to merge — the change is scoped entirely to the docs build pipeline and leaves the backend runtime deps untouched.

All CI, Makefile, and Dockerfile changes are straightforward substitutions of one install method for another. The workspace lock and backend pyproject.toml runtime dependencies are completely unchanged, so there is no risk to the running service. The only finding is a Docker layer-ordering nit in the docs-builder stage that affects build cache efficiency but not correctness.

The COPY order in the docs-builder stage of agentex/Dockerfile is worth a quick look for the caching optimization, but it does not affect build correctness.

Important Files Changed

Filename Overview
.github/workflows/build-agentex.yml Switched docs build from uv sync --group docs to uv run --isolated --no-project --with-requirements requirements.txt mkdocs build; one-line replacement, straightforward.
.github/workflows/ci.yml Same isolated-env docs build switch as build-agentex.yml; no other changes.
agentex/Dockerfile docs-builder stage now copies the full docs/ dir before running pip install, which breaks Docker layer caching whenever any doc file changes — every .md edit triggers a full dep reinstall.
agentex/Makefile Removed install-docs target and updated serve-docs/build-docs to use isolated uv run; clean change.
agentex/docs/requirements.txt New file with pinned mkdocs toolchain and floating agentex-sdk>=0.12.0; addresses prior review comment about reproducibility.
agentex/pyproject.toml Removed the now-unused docs dependency group; clean-up.
pyproject.toml Removed root-level docs group that forwarded to agentex[docs]; consistent with backend cleanup.
uv.lock Removed all docs-only packages (mkdocs, mkdocs-material, mkdocstrings-python, griffe-pydantic, etc.) from the workspace lock; confirms zero backend-runtime deps were touched.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before
        A[uv sync --group docs] --> B[installs from workspace uv.lock]
        B --> C[mkdocs build]
        B --> D[forces agentex-sdk pin in lock]
    end

    subgraph After
        E[docs/requirements.txt] --> F{build context}
        F -->|CI / Makefile| G["uv run --isolated --no-project\n--with-requirements requirements.txt\nmkdocs build"]
        F -->|Dockerfile docs-builder| H["uv pip install --system\n-r docs/requirements.txt"]
        G --> I[mkdocs build]
        H --> I
        E --> J["agentex-sdk>=0.12.0 floats\ntoolchain pinned for reproducibility"]
    end

    D -. eliminated .-> E
Loading

Fix All in Cursor Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
agentex/Dockerfile:68-76
Docker layer caching is busted for every docs content change. Because `COPY ${SOURCE_DIR}/docs/ docs/` copies all Markdown, images, and config files before the `uv pip install` step, any edit to a `.md` file or `mkdocs.yml` invalidates the install layer and forces a full dependency reinstall on every docs build. Copying only `requirements.txt` first lets the install layer stay cached as long as the pins don't change.

```suggestion
COPY ${SOURCE_DIR}/docs/requirements.txt docs/requirements.txt
# Docs build is decoupled from the workspace lock: install the toolchain + latest
# SDK from docs/requirements.txt so doc generation tracks SDK releases.
RUN if [ -n "${UV_INDEX_URL}" ]; then \
        uv pip install --system --index-url "${UV_INDEX_URL}" -r docs/requirements.txt; \
    else \
        uv pip install --system -r docs/requirements.txt; \
    fi
COPY ${SOURCE_DIR}/docs/ docs/
COPY ${SOURCE_DIR}/src/ src/
```

Reviews (4): Last reviewed commit: "Merge branch 'main' into maxparke/agx1-2..." | Re-trigger Greptile

The docs build introspects the installed agentex SDK but installed it from the frozen workspace uv.lock (`uv sync --group docs`). That coupled doc generation to the backend's pins: documenting a newly released SDK path (e.g. `agentex.protocol.*`) required bumping agentex-sdk in the lock, cascading backend-facing bumps (temporalio, websockets) the docs don't need.

Resolve docs deps independently via docs/requirements.txt, installed into an ephemeral env (`uv run --isolated --no-project --with-requirements` in CI/Makefile, `uv pip install -r` in the Dockerfile docs-builder stage). The workspace lock and backend resolution are now untouched by docs.

Updates all five doc-build sites: ci.yml, build-agentex.yml, the Dockerfile docs-builder stage, and the serve-docs/build-docs Makefile targets. The docs dependency-group in agentex/pyproject.toml is now unused by the build (left in place; removing it is a trivial follow-up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@max-parke-scale max-parke-scale requested a review from a team as a code owner June 8, 2026 20:34
Comment thread agentex/docs/requirements.txt Outdated
Pin mkdocs/mkdocs-material/mkdocs-macros-plugin/mkdocstrings-python/griffe-pydantic/pymdown-extensions/Pygments to current known-good versions for reproducible doc builds; agentex-sdk stays floating (>=0.12.0) so docs track the latest SDK release. Addresses the Greptile P2 on #286.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@smoreinis smoreinis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yikes! great catch

The docs build resolves its toolchain from docs/requirements.txt in an isolated env, so the `docs` dependency-groups (root + agentex-backend) and the `install-docs` make target are dead. Removing them drops the mkdocs toolchain from uv.lock; agentex-sdk stays via the dev group, so backend deps are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@max-parke-scale max-parke-scale enabled auto-merge (squash) June 9, 2026 02:19
@max-parke-scale max-parke-scale merged commit 7c0700a into main Jun 9, 2026
30 checks passed
@max-parke-scale max-parke-scale deleted the maxparke/agx1-292-docs-build-isolation branch June 9, 2026 02:25
max-parke-scale added a commit that referenced this pull request Jun 9, 2026
> **Stacked on
[#286](#286 (isolate
docs build from the workspace lock) — merge that first. This PR is only
the doc-path changes; #286 makes the doc build resolve
`agentex-sdk>=0.12.0` in an isolated env, so `agentex.protocol.*`
resolves without touching backend deps.

## Summary

Updates the agentex mkdocs site to use the new canonical
`agentex.protocol.acp` import paths for protocol-shape types
(`RPCMethod`, `CreateTaskParams`, `SendMessageParams`,
`SendEventParams`, `CancelTaskParams`).

Companion to
[scaleapi/scale-agentex-python#371](scaleapi/scale-agentex-python#371),
which moved these types out of `agentex.lib.types.*` into the new
slim-safe `agentex.protocol.*` package. The old path still works via a
back-compat shim — this PR isn't fixing a breakage, it's making sure
scaffolded user code following these docs starts on the canonical path.

Requested in [a review comment on
#371](scaleapi/scale-agentex-python#371 (review)).

## Changes

10 markdown files in `agentex/docs/`:

| Pattern | Count |
|---|---|
| `from agentex.lib.types.acp import ...` → `from agentex.protocol.acp
import ...` | 8 code samples |
| `::: agentex.lib.types.acp.X` → `::: agentex.protocol.acp.X` | 2
mkdocstrings cross-refs (in `agent_types/sync.md` and `api/types.md`) |

No content / behavior changes; same classes, new import path.

## What's not touched

Other `agentex.lib.types.*` modules (`tracing`, `agent_card`,
`credentials`, `fastacp`, `llm_messages`, `converters`) stay on the old
path because they have heavier transitive deps and weren't migrated by
#371. No doc references to those needed updates.

## Test plan

- [x] Isolated `mkdocs build` renders green against `agentex-sdk` 0.12.0
(verified locally via the #286 build path).
- [x] `::: agentex.protocol.acp.*` mkdocstrings directives resolve at
the new path.

🧑‍💻🤖 — posted via [Claude Code](https://claude.com/claude-code)
<!-- claude-code -->

<!-- greptile_comment -->

<h3>Greptile Summary</h3>

This PR updates 10 documentation markdown files to use the new canonical
`agentex.protocol.acp` import paths, replacing the old
`agentex.lib.types.acp` references in both Python code samples and
mkdocstrings directives.

- Replaces `from agentex.lib.types.acp import ...` with `from
agentex.protocol.acp import ...` in 10 code sample blocks across 8
files.
- Updates 13 mkdocstrings `::: agentex.lib.types.acp.X` directives to
`::: agentex.protocol.acp.X` across 5 files, covering
`CreateTaskParams`, `SendMessageParams`, `SendEventParams`, and
`CancelTaskParams`.
- A grep confirms no remaining `agentex.lib.types.acp` references exist
anywhere in the docs tree after this PR.

<details><summary><h3>Confidence Score: 5/5</h3></summary>

Safe to merge — purely mechanical doc path updates with no remaining
old-path references in the docs tree.

All 23 occurrences of agentex.lib.types.acp across 10 files have been
correctly replaced with agentex.protocol.acp. A grep of the entire docs
directory confirms zero leftover old-path references. No logic,
behavior, or non-doc files are touched.

No files require special attention.
</details>

<h3>Important Files Changed</h3>

| Filename | Overview |
|----------|----------|
| agentex/docs/docs/api/types.md | 4 mkdocstrings directives updated
from old to new canonical path; no issues. |
| agentex/docs/docs/agent_types/async/base.md | 1 import and 3
mkdocstrings directives updated; no issues. |
| agentex/docs/docs/agent_types/async/temporal.md | 1 import and 2
mkdocstrings directives updated; no issues. |
| agentex/docs/docs/acp/agentic/base.md | 3 mkdocstrings directives
updated; no issues. |
| agentex/docs/docs/getting_started/project_structure.md | 3 import
statements updated across different agent-type examples; no issues. |
| agentex/docs/docs/agent_types/sync.md | 1 import and 1 mkdocstrings
directive updated; no issues. |
| agentex/docs/docs/api/overview.md | 1 import statement updated; no
issues. |
| agentex/docs/docs/concepts/streaming.md | 1 import statement updated;
no issues. |
| agentex/docs/docs/acp/agentic/temporal.md | 1 import statement
updated; no issues. |
| agentex/docs/docs/temporal_development/openai_integration.md | 1
import statement updated; no issues. |

</details>

<details><summary><h3>Flowchart</h3></summary>

```mermaid
%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Doc code samples & mkdocstrings refs\n(10 markdown files)"] --> B{"Import path"}
    B -- "Before" --> C["agentex.lib.types.acp\n(back-compat shim)"]
    B -- "After" --> D["agentex.protocol.acp\n(canonical path)"]
    D --> E["CreateTaskParams"]
    D --> F["SendMessageParams"]
    D --> G["SendEventParams"]
    D --> H["CancelTaskParams"]
```
</details>

<sub>Reviews (5): Last reviewed commit: ["docs(agentex): use canonical
agentex.pro..."](5a42081)
| [Re-trigger
Greptile](https://app.greptile.com/api/retrigger?id=34170925)</sub>

<!-- /greptile_comment -->

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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