docs: one page for a coding assistant, and a copy-page control on every page - #20
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyruns after the build and writes everydocs/<path>.mdnextto 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 factstable, the arithmetic
timeout_foractually 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:
time.monotonic()is process-local, so the budgetobject never travels; the number from
timeout_fordoes, and the callee builds its ownbudget from it. There is no header, no context variable and nothing ambient: in-process
propagation is a function argument.
remaining()goes negative, the next
timeout_forraises, an in-flight call keeps running on thetimeout 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.mdand the pull request template now saythe 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.mdtakescopy_page: false: its Markdown is two lines ofinstruction 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 everypage. Locally:
make docs-build && uv run --no-dev --group docs python scripts/emit_markdown.py,then serve
site/—zensical serverebuilds into the same directory without the twinsand answers 404 to the control.
docs/assets/stylesheets/copy-page.css,docs/assets/javascripts/copy-page.js,overrides/main.htmlandscripts/emit_markdown.pyare byte-identical across theorganisation, so they can be updated in one sweep.