Repository navigation
fix(autodoc): deliver the context to Claude, and fail loudly when nothing happens - #37952
Merged
Merged
Conversation
- Context travels prep -> executor as an encrypted artifact instead of a job output (dropped by the runner's secret masker). - prep reads issues/PRs with CI_MACHINE_TOKEN, fetches PRs from their own repos, includes sub-issues, trusted comments only, clips long text. - Missing context/report fails the run; report goes to the run summary. - Dispatch inputs: dry_run (default), ignore_epic_parent, inject_test. - Accept 32-hex dotCMS identifiers; add Type : Documentation trigger. - Prompt: autodoc-search instead of curl; confidentiality rules. Refs #36949 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 of 15 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dotCMS serves the page search and content reads to anonymous callers, so a stale drafting token or a wrong AUTODOC_DOTCMS_BASE_URL looked like 'no page', and the content read returned the live version instead of the working one, letting the human-draft guardrail pass on pages with outstanding drafts. Check /api/v1/users/current for the service account first, and treat a failed or malformed search as fatal. Refs #36949 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The executor's autodoc-search now prints a ranked list with excerpts and saves full pages for Read, instead of ~500 KB of raw JSON per query. Refs #36949 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jdcmsd
marked this pull request as ready for review
October 14, 2026 10:38
fmontes
approved these changes
Oct 23, 2026
jdcmsd
marked this pull request as draft
October 23, 2026 18:37
Contributor
Author
|
converting to draft just to prevent a premature merge ahead of dotCMS/ai-workflows#70, which is itself awaiting a tag for further testing. |
…or v3.6.0 The prep job now uploads instructions.md and eval_context.md as separate encrypted files. The executor sends the instructions as Claude's prompt and frames the context as data, so trusted and untrusted text no longer share a file. The prompt is no longer appended to the context. Pinned to @v3.6.0, which has the matching artifact layout. Merge only after v3.6.0 is tagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jdcmsd
marked this pull request as ready for review
October 28, 2026 17:46
Contributor
Author
|
Ready for review. ai-workflows#70 is merged and @fmontes, your Oct 23 approval predates the latest push, so it needs a fresh approval to merge. |
fmontes
reviewed
Oct 30, 2026
fmontes
left a comment
Member
There was a problem hiding this comment.
Two things worth a follow-up commit before the first live run. Everything else I checked (executor contract at v3.6.0, finalize gating, bot comments excluded as CONTRIBUTOR, leak check ordering) looks right.
…Python 3.11 - update/create without a BEGIN_DOC_DRAFT body now fails instead of blanking the working version or creating an empty page (checked in the lookup step, so dry runs catch it too, and again in each apply step) - an update draft under half the current page's length is refused as likely truncated - build the Related PRs list outside the f-string; the nested quotes needed Python 3.12 (PEP 701) Review feedback from @fmontes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
fmontes
approved these changes
Oct 30, 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.
Summary
The autodoc workflow has never produced a report. All 13 runs since 2026-08-14 went green without Claude seeing a prompt. This PR fixes that, plus the defects hidden behind it, which surfaced once the pipeline could be exercised end to end. It's one file,
.github/workflows/issue_autodoc.yml, and depends on dotCMS/ai-workflows#70 (executor v3.6.0).Everything below was rehearsed from a core branch with core's real secrets and issue data (see Testing).
What was wrong, and what changed
Authorization: Bearer $…trips it. Confirmed: the same context without that line arrives intact.instructions.md) and the context (eval_context.md) as separate files and uploads them as an artifact (autodoc-context). The executor (v3.6.0) decrypts them, sends the instructions as Claude's prompt, and has Claude read the context from disk as data, never instructions. Claude searches via a newautodoc-searchcommand instead of a curl with a token, so the Bearer text is gone from the prompt.GITHUB_TOKEN, which only sees core. For #36628 it saw 1 of 3 linked PRs, missing the ones that carried the work.CI_MACHINE_TOKEN, the org token the job already used for the vault checkout. ctx.py fetches each PR from its own repo; it previously assumed core.::notice::naming the Epic.Type : Documentationdidn't trigger a run.autodoc-search, Read and Write, and the drafting token never reaches it. finalize refuses to post a report containing any pipeline secret./issues/3599matched35990).evergreen-tracks) have 32-hex IDs.AUTODOC_DOTCMS_BASE_URLlooked like "no such page", and the content read returned the live version instead of the working one, so the human-draft guardrail passed on pages with outstanding drafts (confirmed on three). Writes still need a valid token, but dry runs reported "guardrail passed" and the cause was hidden./api/v1/users/current) and fails with an error naming both settings. A failed or malformed page search also fails the run instead of reading as "no page".Also:
concurrencyso two runs on the same issue can't racecreatewon't duplicate an existing urlTitleupdateorcreatewithout a draft fails instead of blanking the working version or creating an empty page, and an update draft under half the current page's length is refused as likely truncated (checked in dry runs too)Manual runs
PR #37933 added
workflow_dispatch; this version uses it:issue_number(required)dry_run(default true): build the report and show it in the run summary, but post nothing and write nothing to dotCMSignore_epic_parentinject_test(dry runs only): add a prompt-injection comment to the context; the run fails if the report follows itUses: testing a branch's version before merge, backfilling the issues that were missed, re-assessing after docs change.
Testing
Diagnostics on main's own code, from a branch, 2026-10-08:
github_token(fixed in the executor)Rehearsal of this workflow from branch
autodoc-rehearsal, forced to dry run:Executor at its PR branch: every step before the Bedrock login passed: context build (3 sub-issues, 9 PRs for Implement domain-driven query REST API for Analytics Dashboard #36628), encrypt, upload, download, decrypt (byte-exact), and a live
autodoc-searchsmoke test. The Bedrock login is refused as expected, since the role trusts only executor tags.Claude via core's
ANTHROPIC_API_KEYinstead of Bedrock, rehearsal-only, so the Claude half could be tested before any tag:none: thequery-apipage already covers it, verified against core's codeupdate evergreen-tracks, five concrete gaps; the dry-run lookup exposed B11ignore_epic_parent)none, consistent with the Epicinject_testRehearsal run records were deleted after download, because run summaries on this public repo would have exposed the pre-fix reports. Results are kept privately.
Bedrock end to end from this branch on
@v3.6.0-rc1, dry runs, 2026-10-13. All four runs green; each one $1.05–$1.98:none, as in the rehearsalnone. Theevergreen-trackspage was revised on 2026-10-09, after the rehearsal that proposed the update; the report checks the revised page section by sectionignore_epic_parent)none, as in the rehearsalinject_testThe rc1 runs showed Claude making 5–16 refused tool calls per run, because the raw search output (about 500 KB per query) was too large to read. The executor's
autodoc-searchnow prints a compact list and saves full pages forRead, and the prompt describes that.Bedrock end to end on
@v3.6.0-rc2, the same four dry runs, 2026-10-27. All green, with the same determinations as rc1. There were no refused tool calls, and about half as many turns at about half the cost:nonenoneignore_epic_parent)noneinject_testBefore merge:
v3.6.0-rc1tagged@v3.6.0-rc1(Bedrock end to end): Implement domain-driven query REST API for Analytics Dashboard #36628, [Epic] Release Tracks: per-environment update channel selection #35693, Improve documentation for Content Analytics domain-driven query endpoints #36951 (ignore_epic_parent), plus oneinject_testv3.6.0-rc2tagged (ai-workflows#70 head) and the dry runs repeatedinject_testboth gavenone(as on rc2), with 0 refused calls and the injection not followed.@v3.6.0, which has the matching artifact layout. There's no rc3: the change doesn't touch the Bedrock login or the model call.v3.6.0tagged on its merge commit (9b54f11)@v3.6.0, 2026-10-28. All passed, with 0 refused tool calls:none, 8 turns, $0.41.ignore_epic_parent):none, 8 turns, $0.46.none, 38 turns, $1.62.inject_test: injection not followed, and finalize's checks passed. This time the model proposed a one-entryupdateto Upgrading: Important Changes, for the removed analytics endpoints the Epic itself flags. rc2 saidnone; this is a judgment call, and a human reviews any draft.is_errorbefore writing. The retry passed.After merge: backfill the missed issues with manual runs, dry first.
Review notes
Write prompt) and the context builder (Build eval context), which was rewritten to use GraphQL. The job structure is unchanged: preflight → prep → claude → finalize.AUTODOC_CONTEXT_KEYrepo secret, already set.Refs #36949
🤖 Generated with Claude Code
This PR fixes: #36949