ci: docs retrieval index trigger, and keep code indentation in static Markdown (TE-28101) - #3558
Merged
Ishavyas9 merged 4 commits intoSep 17, 2026
Conversation
toPlainMarkdown removed every leading space and tab from every line of every fenced code block, not only the fence's own indentation. Nested YAML keys and Python bodies came out flush left, so the Markdown copies linked from llms.txt carried code that no longer means what the page shows. For example hyperexecute-yaml-version0.2.md served 'framework:' followed by an unindented 'name:'. Remove at most the fence's own indentation from each line, as CommonMark does for an indented fence. On stage at 08fce1f, generated files with an indented code line go from 0 to 536, and 537 of the 1,408 generated files change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
scripts/check-static-md-fences.js runs after generate-static-md.js and compares every fenced code block in docs/ with its copy in static/docs/: the same non-blank lines, in order, with the same relative indentation (only the fence's own indentation may be removed). It fails on any changed line and on a source fence that is never closed or that another opening fence interrupts, and warns when a code block is missing from the generated copy. Node built-ins only. Wired as npm run check-static-md-fences and as a pull request workflow on docs and generator changes. On stage at 08fce1f with the previous commit's fix: 5,143 blocks checked, 0 changed lines, 7 unclosed or interrupted fences in 3 source docs that need fixing before this check can pass, and 13 code blocks missing from 6 generated files (a separate content-dropping defect in the generator). Without the fix the same check reports 20,024 changed lines in 535 docs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
On stage the fence-fidelity check finds 7 code fences that are never closed or that another opening fence interrupts. On the site, every later fence in those pages pairs the wrong way round, so prose renders as code and code as prose. Each fix follows what the page was written to show: - kane-cli-testmd-composition.md: the two test.md examples that contain a nested yaml step block now use four-backtick outer fences, so the inner three-backtick fences stay inside the example. Four VerifiedTag lines that the badge script had inserted inside those examples and inside the path tree are removed; the tags before each example stay. - playwright-sdk.md: close the last bash block, which is the end of the page. - smartui-build-merging.md: close the bash blocks of strategies 1 and 2 before the next strategy heading. smartui-appium-hooks.md and smartui-cli-env-variables.md, which need the same kind of fix on testmuCom, are already closed on stage. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds docs-retrieval-index-notify.yml, triggered by workflow_run on 'Deployment (Prod - testmucom New Bucket)' when it succeeds, or by hand with a deployed sha. It sends an HMAC-SHA256 signed POST /v1/index with the deployed commit sha (TE-28101, RFC section 4.3), retries on 409, 429, 5xx and connection failures with backoff, and fails on 400, 401, 403, 404 and 413. While the DOCS_RETRIEVAL_URL variable is unset it logs a notice and succeeds; once it is set, a missing DOCS_RETRIEVAL_DISPATCH_TOKEN secret is an error. It is a separate file, so the existing documentation-notify.yml (product-context notifier) is not changed. workflow_run only fires from the default branch, so on stage this workflow is dormant until it reaches testmuCom. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ishavyas9
approved these changes
Sep 17, 2026
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.
Raised on
stagefirst, as requested on #3557. #3557 carries the same change fortestmuCom.What this changes
New workflow
.github/workflows/docs-retrieval-index-notify.yml. It runs onworkflow_runwhenDeployment (Prod - testmucom New Bucket)finishes withconclusion == 'success', and has one job,docs-retrieval-index. It sends an HMAC-SHA256 signedPOST /v1/indexto docs-retrieval-service with the deployed commit sha. The body is{"sha":"<40 hex>","ts":<epoch seconds>,"trigger":"deploy"}and the header isX-Signature-256: sha256=<hex>. A freshtsis signed on each attempt. It retries HTTP 409, 429, 5xx and connection failures up to 6 times (15, 30, 60, 120 and 240 seconds apart), and fails at once on 400, 401, 403, 404 and 413. It can also be run by hand (Actions, "Notify docs retrieval index after prod deploy", Run workflow) with a deployedsha.documentation-notify.yml(product-context notifier) is not touched. The docs retrieval trigger is a separate file so the two workflows stay independent.Fix in
scripts/generate-static-md.js. When it shielded fenced code blocks, it removed all leading whitespace from every code line. It now removes at most the fence's own indentation, as CommonMark does.New check
scripts/check-static-md-fences.js, thenpm run check-static-md-fencesscript, and a pull request workflowstatic-md-fence-fidelity.yml(for PRs intostageandtestmuCom). The check runs after the generator and compares every fenced code block indocs/with its copy instatic/docs/: the same non-blank lines, in order, with the same relative indentation. It fails on a changed line, and on a source fence that is never closed or that another opening fence interrupts. It warns (fails only with--strict) when a code block is missing from the generated copy. Node built-ins only, nonpm installneeded.Doc fixes for the 7 broken fences in 3 pages that the check finds on
stage. On the live site every later fence on these pages pairs the wrong way round, so prose renders as code and code as prose:kane-cli-testmd-composition.md: the two test.md examples that contain a nestedyamlstep block now use four-backtick outer fences. Four<VerifiedTag>lines that the badge script had inserted inside those examples and inside the path tree are removed (the tag before each example stays).playwright-sdk.md: closes the last bash block, which ends the page.smartui-build-merging.md: closes the bash blocks of strategies 1 and 2 before the next heading.smartui-appium-hooks.mdandsmartui-cli-env-variables.mdneed the same fix ontestmuCom(ci: notify the docs retrieval index after prod deploy, and keep code indentation in static Markdown (TE-28101) #3557) but are already closed onstage.Why
Search index trigger. The MCP
search_testmu_docstool is backed by docs-retrieval-service, which needs to know when new docs are live. A push trigger fires before the site is built and uploaded, so this usesworkflow_runon the prod deploy and skips failed or cancelled deploys.Broken code in the Markdown copies. The
.mdcopies understatic/docs/are served as<slug>.md, linked fromllms.txt, and read by AI agents and the retrieval index. The generator flattened indentation in code blocks, so YAML and Python lost their meaning. For examplehyperexecute-yaml-version0.2.mdserved:Numbers
Measured on
stageat08fce1fcwith this branch's docs, generator run locally (1,408 generated files):Without the doc fixes the check also reports 7 unclosed or interrupted fences in 3 docs (5,143 code blocks compared). With them it passes:
Checked 5174 code block(s) in 1408 doc(s): 0 error(s), 13 warning(s). The three fixed pages also compile with@mdx-js/mdx.The committed copies under
static/docs/are not regenerated in this PR, becauseprebuildregenerates them on every build.Settings needed (names only)
DOCS_RETRIEVAL_URLDOCS_RETRIEVAL_DISPATCH_TOKENThe docs retrieval workflow is dormant on
stage.workflow_runonly fires for workflow files on the default branch (testmuCom), so it starts running once this file reachestestmuCom(#3557). Even then it does nothing untilDOCS_RETRIEVAL_URLis set: while the variable is unset, the job logs a notice and succeeds, so it never turns a prod deploy red. The service is not deployed yet. Once the URL is set, a missingDOCS_RETRIEVAL_DISPATCH_TOKENis an error.The workflows have not run on GitHub yet. Their YAML was parsed and passes
actionlint, and the notify step's shell was run locally for the unset and missing-secret cases.Known issue, not fixed here
The generator drops whole regions of 6 pages, so 13 code blocks are missing from their
.mdcopies. This happens with and without this PR (probably in the tag-stripping steps), and the check reports it as warnings:deep-dive-into-hyperexecute-yaml(6 blocks)hyperexecute-background-services(2 blocks)hyperexecute-projects(2 blocks)legacy-test-platform-to-lambdatest(generated asmigrate-from-legacy-platform-to-testmu.md, 1 block)playwright-test-execution-setup(1 block)travis-ci-with-hyperexecute(1 block)🤖 Generated with Claude Code