Skip to content

docs: one page for a coding assistant, and a copy-page control on every page - #20

Merged
AlexeyShalaev merged 2 commits into
masterfrom
docs/copy-page-and-agents
Sep 6, 2026
Merged

docs: one page for a coding assistant, and a copy-page control on every page#20
AlexeyShalaev merged 2 commits into
masterfrom
docs/copy-page-and-agents

Conversation

@AlexeyShalaev

Copy link
Copy Markdown
Member

Three things, one docs change.

A "Copy page" control above every page. A split button that copies the page's
Markdown, or opens it in ChatGPT, Claude or Perplexity. It works because
scripts/emit_markdown.py runs after the build and writes every docs/<path>.md next
to the HTML it built, so each page has a plain-text twin one URL away — /agents/ and
/agents.md. The Docs workflow gained that one step.

docs/agents.md — the whole library on one page, for a coding assistant: the facts
table, the arithmetic timeout_for actually does, both classes and both contrib modules,
fifteen rules, the mistakes a model makes with this API, and a map of which page to fetch
for the rest. Two sections exist because they are what a model gets wrong here and the
library gives no error when it does:

  • Crossing a process boundarytime.monotonic() is process-local, so the budget
    object never travels; the number from timeout_for does, and the callee builds its own
    budget from it. There is no header, no context variable and nothing ambient: in-process
    propagation is a function argument.
  • When the budget runs out — nothing fires. No timer, no cancellation. remaining()
    goes negative, the next timeout_for raises, an in-flight call keeps running on the
    timeout it was already given, and a downstream timeout still raises the client's own
    error rather than ours.

The rule that keeps it true. CONTRIBUTING.md and the pull request template now say
the page is part of the public API and changes in the same pull request the API does. A
stale one is worse than none — it teaches a model an API that no longer exists.

docs/reference/index.md takes copy_page: false: its Markdown is two lines of
instruction to mkdocstrings, not the API, so it carries neither the control nor a twin.

How to see it. The Docs workflow deploys on merge; after that,
bedrock-python.github.io/deadline-budget/agents/ and the button at the top of every
page. Locally: make docs-build && uv run --no-dev --group docs python scripts/emit_markdown.py,
then serve site/zensical serve rebuilds into the same directory without the twins
and answers 404 to the control.

docs/assets/stylesheets/copy-page.css, docs/assets/javascripts/copy-page.js,
overrides/main.html and scripts/emit_markdown.py are byte-identical across the
organisation, so they can be updated in one sweep.

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AlexeyShalaev
AlexeyShalaev merged commit a67acd9 into master Sep 6, 2026
6 checks passed
@AlexeyShalaev
AlexeyShalaev deleted the docs/copy-page-and-agents branch September 6, 2026 17:28
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.

1 participant