Repository navigation
Description
Context & Rationale
DocGenerator.write_all_docs (docs/generator.py:1020) and check_docs (:1038) each regenerate the whole doc set, and generation imports 37 command modules and the live MCP server (:349, :367): 9.5s the first time and about 1.7s after. tests/test_docs.py::test_write_and_check_docs (~26s) and test_doc_generator_write_all_and_check (~20s) only test writing and stale or missing files, yet run four and three full generations. The gate already checks the real docs as its own stage (commands/ci.py:440). The gate's test stage took 5m 26s on the 9p workspace mount (2026-09-30) and 1m 42s after the workspace moved to ext4 (2026-10-01), so it is within its 5-minute budget; the per-test timings below were measured on 9p.
Scope & Deliverables
- Deliverable: the
{path: content}doc set thatgenerate_all_docsalready returns becomes the seam. Writing, checking and README sync consume a doc set, from real introspection or from a fixture, and each check generates once.- The two mechanics tests run on a two-entry fixture.
- Introspection is tested by the gate's docs stage and one integration test.
- Constraint:
devops docsoutput is unchanged.
Strategic Alignment
- Milestone: Backlog (no release)
- Design: none
- Depends on: none
Update 2026-10-08: refinement
check_docs (docs/generator.py:1155-1189) now also resolves every devops argv (:1168-1170).
- The mechanics tests (
tests/test_docs.py:164,:305) run on a two-entry set, without introspection or argv checks. - One
check_docscall introspects once.
Proposed design
Problem statement
The current documentation generation and validation process regenerates the entire doc set multiple times per test, which is slow and redundant. Tests like test_write_and_check_docs and test_doc_generator_write_all_and_check run full generations four and three times respectively, consuming 26s and 20s of test time each. The check_docs function also resolves every devops argv and regenerates the docs set.
Acceptance criteria
- Criterion 1: The
write_all_docsandcheck_docsfunctions consume a pre-generated doc set instead of regenerating it.
Verification: Run tests that usewrite_all_docsandcheck_docsand verify they no longer regenerate the full doc set. - Criterion 2: Mechanics tests run on a two-entry fixture without introspection or argv checks.
Verification: Executetests/test_docs.py::test_write_and_check_docsandtests/test_docs.py::test_doc_generator_write_all_and_checkwith fixtures and confirm they do not perform full introspection. - Criterion 3: The
devops docsCLI output remains unchanged.
Verification: Rundevops docs generateand compare the output against a known good baseline to ensure no functional changes.
Key questions
- What is the current behavior of
DocGenerator.write_all_docsandcheck_docs?:DocGenerator.write_all_docsandcheck_docseach regenerate the whole doc set, which includes importing 37 command modules and the live MCP server. [sources: src/devops_cli/docs/generator.py:1020, src/devops_cli/docs/generator.py:1038] - How much time does a full regeneration take?: The first time, generation takes 9.5s; after that, it takes about 1.7s. [sources: src/devops_cli/docs/generator.py:349, src/devops_cli/docs/generator.py:367]
- What is the intended delivery for this refactor?: The
{path: content}doc set thatgenerate_all_docsalready returns becomes the seam. Writing, checking and README sync consume a doc set from real introspection or from a fixture. [sources: src/devops_cli/docs/generator.py:1155] - Should the
devops docsCLI output be changed?: No, the constraint states thatdevops docsoutput is unchanged. (proposed) [sources: src/devops_cli/docs/generator.py:1168]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 18, 2026
Status set to Ready at 25e2cda (see proposed design in issue body).
dan-petty commentedon Oct 18, 2026
Amendment (2026-10-18): folded here by intake as a duplicate
devops roadmap intakejudged the candidate below a duplicate of this item and filed nothing, so its findings are recorded here for whoever plans or delivers this item. Candidate title: "perf(ci): the gate starts its checks while the docs pre-fix runs, and only docs check waits for it".Friction
devops ciruns three pre-fixes one after another before any check starts:ruff format .,ruff check --fix ., thendevops docs generate --sync-readme. The docs pre-fix is the largest serial step on every cache-miss push.devopsimport less does not shorten this step:docs generateimports the MCP server (src/devops_cli/docs/generator.py:430) and needs pydantic_ai for real.Evidence
Checked at release/v0.2.37 30b8fdd.
src/devops_cli/commands/ci.py:688-731), at:848, before the 14 checks start together in oneasyncio.gather(:867-875).*.pyfiles, every check reads them, and docs generate imports them. Each takes 0.1-0.8 s.tests/test_docs.py:499and:691readdocs/commands/*.md, andtests/test_review_exporter.py:259-268reads README.md and everydocs/**/*.md. pytest cannot start before docs generate until they stop depending on those files.src/devops_cli/output/file_writer.py:174-185), and a run whose pre-fix changed the tree saves no verdict (src/devops_cli/commands/ci.py:998-1004).--dry-runprints the requests as one list "in order" (:787-818) and does not show which run serially.Remedy
tests/test_docs.py:499,:691andtests/test_review_exporter.py:259-268read the generator's in-memory output (DocGenerator.generate_all_docs) instead of the committed files.docs checkalready verifies the committed files match.devops ci, keep the ruff pre-fixes first and serial, then start the docs pre-fix and the checks as tasks together. Onlydocs checkawaits the docs pre-fix.--dry-runlabels the pre-fix block serial and the check block concurrent.Acceptance criteria
docs checkstarts after it.tmp_pathcopy.--dry-runoutput shows the serial and concurrent blocks.refactor(docs): writing and checking docs consume a generated doc set (…
dan-petty commentedon Oct 20, 2026
What changed
#1762, merged into
release/v0.2.38as 1d87095.4 file(s) changed.
How it was verified
Check runs at 31bb9f1:
Acceptance Criteria of
docs/agent/tasks/task-774-docs-consume-generated-doc-set.md:No Acceptance Criteria section.
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)