Repository navigation
Description
Problem or Motivation
- Only 2 of the 49 DocGenerator pages say that they are generated, so agents edit them by hand.
- No map tells the brain which source module writes each page, so a stale generated citation cannot heal itself.
- A removed command group leaves its
docs/commandspage behind. docs/index.mdlinks 3 of 7 reference pages and 0 command pages.devops docs generate --format jsonwritesdocs/cli_schema.jsoninto a tracked folder, and.gitignoredoes not ignore it.
Proposed Solution & Architectural Design
- Under each title, DocGenerator writes one line: "Generated by
uv run devops docs generatefrom<source module>. Do not edit this file." Whendocs/DESIGN.mdof feat(design): track the project design spec #4735 lands, it owns the form of this line. - The generator exports a page-to-source map (
generated_from) for the brain and for repair. write_all_docsdeletes adocs/commandspage that no command group writes.- Generalize
render_synced_readme(src/devops_cli/docs/generator.py) into one named marker-block function. It writes the README matrix and a new reference-pages block indocs/index.md. The quality-limits item (child 10 of feat(docs): track current content and brain-fed reference docs #4880) uses it again. --format jsonprints to stdout, or writes to--output-dirwhen given. It never writes intodocs/.
This PR changes all 49 pages, so it lands as one PR. Before ready, the agent rebases on origin/main and runs uv run devops docs generate. Update the docs step of CONTRIBUTING.md and the docs row text of docs/SDLC.md.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/docs/generator.py, docs/index.md).
Existing Tool Considered
The existing generator and its marker-block function. Cost: about 80 lines plus tests, about 60k tokens and 1.5 h to build.
Acceptance Criteria
- Each of the 49 pages has the source line, and a test fails for a new output with no line.
- A test removes a fake group and sees its page deleted.
docs/index.mdlinks all 7 reference pages anddocs/commands/, and a test fails when a generated page has no link.uv run devops docs generate --format jsonwrites no file underdocs/.- The map names a source module for each of the 49 pages.
Dependencies
Source: #4880
Alternatives check of 2026-11-27: rejected.
Rejected by ADR 0025. A newer fact can change an ADR.
Tool: cogapp (https://pypi.org/project/cogapp), MIT, last activity 2026-11-15, maintained.
Reason: Searches found only cogapp, a maintained cog code generator that syncs generated marker blocks and so covers the README matrix and index block part, but it exports no page-to-source map, deletes no orphan page and handles no JSON output; ADR 0025 rejects it.
Covers:
- Syncs text between generated markers in existing files
- One block per file, rerun is idempotent
- Inline Python in the document supplies the body
Lacks:
- No page-to-source map such as generated_from
- No deletion of orphaned docs/commands pages
- No JSON stdout or --output-dir output path
- Runs Python from the documents, which ADR 0025 refuses
Proposed design
Problem statement
DocGenerator writes 49 pages, and only 2 say that they are generated. No map names the source module of each page, so a stale generated citation cannot heal itself. A removed command group leaves its docs/commands page behind, and docs/index.md does not link every reference page and command page. devops docs generate --format json writes docs/cli_schema.json into a tracked folder. The README matrix and the contributor docs edits are out of scope: main moved the matrix to docs/CLI_REFERENCE.md and already names the regenerate command.
Acceptance criteria
Requirement: Generated page source line
DocGenerator SHALL write a visible generated-by line under the H1 title of each page that generate_all_docs writes.
Scenario: Every generated page names its source module
- WHEN A test runs
generate_all_docsinto a temporary docs tree. - THEN Each written page holds "Generated by
uv run devops docs generatefrom<module>. Do not edit this file." under its H1, and its<module>equals thegenerated_fromentry.
Requirement: Orphaned command page deletion
write_all_docs SHALL delete each file under docs/commands/ that holds the generated-by line and that no command group writes.
Scenario: A removed command group loses its generated page
- WHEN A temporary docs tree holds a
docs/commands/page of a command group that the command tree no longer names, and that page holds the generated-by line. - THEN
write_all_docsdeletes that page and keeps each file underdocs/commands/that holds no generated-by line.
Requirement: Index block completeness
The generator SHALL write a named marker block in docs/index.md that links each reference page, the docs/commands/ directory and the page of each command group.
Scenario: A new page appears in the index block
- WHEN A test writes a page set with a new reference page and a new command group into a temporary docs tree.
- THEN The index block holds a link to each page and to
docs/commands/, and the test fails when the block lacks a link that the page set needs.
Requirement: Page-to-source map
The generator SHALL export generated_from, a map from each page path to its source module path.
Scenario: Each page has one map entry
- WHEN A test builds the map for the page set.
- THEN The map holds one entry for each page that
generate_all_docswrites, and each entry names a path undersrc/that the checkout holds.
Requirement: JSON output outside docs
devops docs generate --format json SHALL write its JSON document to stdout and MUST write no file under docs/.
Scenario: The JSON run changes no file under docs
- WHEN A test runs
uv run devops docs generate --format jsonin a temporary copy of the repository that holds a docs directory. - THEN stdout parses as JSON and no file under
docs/changes.
Requirement: JSON output directory
devops docs generate --format json --output-dir <dir> SHALL write one JSON file under <dir> and MUST write no file under docs/.
Scenario: The given directory holds the JSON document
- WHEN A test runs
uv run devops docs generate --format json --output-dir <tmp>. - THEN One JSON file is under
<tmp>and no file is underdocs/.
Requirement: One marker-block function
The generator SHALL write the docs/index.md index block through one function sync_marker_block(text, marker, body).
Scenario: The index block goes through one function
- WHEN A test replaces
sync_marker_blockwith a spy and runswrite_all_docstwice. - THEN The spy receives one call for the index block, and the second run changes no byte of
docs/index.md.
Existing Tool Considered
cogapp (https://pypi.org/project/cogapp), verdict rejected: ADR 0025 rejects it. The alternatives check in the issue body gives what cogapp covers and lacks. The proposal adds one sync_marker_block function for the docs/index.md block. It adds the source line, generated_from map, orphan deletion and JSON output in src/devops_cli/docs/generator.py and src/devops_cli/commands/docs.py. The written cost of this code is about 80 lines plus tests, about 60k tokens and 1.5 h to build, keep and fix.
Key questions
- What text and position does the generated-page source line take?: Write one visible line directly under the H1 title: "Generated by
uv run devops docs generatefrom<source module>. Do not edit this file." The line stays outside the marker block. The issue text sets this form until feat(design): track the project design spec #4735 changes it. (best practice) [sources: src/devops_cli/docs/generator.py:1466, src/devops_cli/docs/generator.py:1508, docs/DESIGN.md]- Chosen: Visible line under the H1. A reader and an agent see it. One literal prefix lets the page-set test and the delete guard find it.
- Rejected: HTML comment above the H1. The rendered page does not show it. The issue asks for a line that says the page is generated.
- Rejected: Front-matter key. GitHub and the docs site do not show front matter. The brain reads page text.
- Which source module does each page name, and where does the generator hold the map?: A module-level table in
src/devops_cli/docs/generator.pymaps each page path to the module whose data it renders. A command page names the module of its command group. A synced page names the module of its sync. The generator exports the table asgenerated_from, andgenerate_all_docswrites the source line from it. (best practice) [sources: src/devops_cli/docs/generator.py:1466, src/devops_cli/docs/generator.py:1508, CONTEXT.md]- Chosen: One module-level table. The map has one place, and a test reads it for each page.
- Rejected: A field of each render function. A new page can omit its entry, and no one place names the source of each page.
- Does
write_all_docsdelete a hand-written file underdocs/commands/?: No.write_all_docsdeletes only a file that holds the generated-by line and that no command group writes. A hand-written file underdocs/commands/stays. (best practice) [sources: src/devops_cli/docs/generator.py:1508, CONTEXT.md]- Chosen: Delete only a file that holds the generated-by line. The delete acts on generated output alone, and a hand-written page stays.
- Rejected: Delete each file that the generator does not write. It removes a hand-written page and a file that another tool put there.
- How does
docs/index.mdstay complete when the generator adds a page?: The generator writes a named marker block indocs/index.md. The block links each reference page thatgenerate_all_docswrites, thedocs/commands/directory and the page of each command group. A test fails when the block lacks a link that the page set needs. (best practice) [sources: docs/index.md, src/devops_cli/docs/generator.py:1466]- Chosen: A marker block that the generator syncs. A new page needs no edit of the index, and the block is the same on each run.
- Rejected: A hand-written list that a test checks. A new page fails the test until a person edits the index, which is the defect that the issue names.
- Where does
devops docs generate --format jsonwrite its document?: To stdout by default. With--output-dir <dir>it writes one JSON file under<dir>. It writes no file underdocs/. (best practice) [sources: src/devops_cli/commands/docs.py, src/devops_cli/docs/generator.py:1508]- Chosen: stdout by default, a file only with --output-dir. No generated file enters the tracked docs folder, and a caller redirects the output where it wants it.
- Rejected: Keep docs/cli_schema.json and add it to .gitignore. A file that git ignores is in no tree that the brain cites, and no check reads it.
- Which function holds the marker-block logic after
render_synced_readmeis gone?: One functionsync_marker_block(text, marker, body)insrc/devops_cli/docs/generator.py.write_all_docscalls it for thedocs/index.mdindex block. The quality-limits item can call it for its block. (best practice) [sources: src/devops_cli/docs/generator.py, docs/index.md]- Chosen: One function, called for the index block. One place holds the marker logic, and the index block needs no second write path.
- Rejected: One function plus a block registry. A registry adds indirection for one block, and a third caller can pass its own marker and body.
- Rejected: A second sync path for the index page. Two paths write the same kind of block, and a fix must change both.
- What replaces the deleted
render_synced_readmeand the README matrix in the proposal?: No README matrix. Commit 0a14161 removed the matrix fromREADME.mdand moved it todocs/CLI_REFERENCE.md.tests/docs/test_docs_inventory.py:153asserts thatDocGeneratorwrites no block ofREADME.md.CONTRIBUTING.md:193anddocs/SDLC.md:215already nameuv run devops docs generate. The proposal adds onesync_marker_blockfunction for thedocs/index.mdblock only. (best practice) [sources: tests/docs/test_docs_inventory.py:153, docs/CLI_REFERENCE.md, CONTRIBUTING.md:193, docs/SDLC.md:215]- Rejected: Keep the README matrix sync. Commit 0a14161 deleted
render_synced_readmeand the README matrix, and a test refuses a DocGenerator block inREADME.md. - Chosen: Sync only the
docs/index.mdblock. It keeps the marker-block helper for the remaining generated block and does not restore a block thatmainremoved. - Rejected: Add a second sync path for
docs/index.md. Two paths would duplicate the marker logic and a fix would need both.
- Rejected: Keep the README matrix sync. Commit 0a14161 deleted
- Do
CONTRIBUTING.mdanddocs/SDLC.mdstill need the regeneration command?: No.CONTRIBUTING.md:193anddocs/SDLC.md:215already nameuv run devops docs generate. The proposal removes those edits. [sources: CONTRIBUTING.md:193, docs/SDLC.md:215] - Does the existing
generated_frominsrc/devops_cli/citation.pyconflict with the new generator map?: No. The new map is a module-level value insrc/devops_cli/docs/generator.py. The citation module keeps its owngenerated_from. [sources: src/devops_cli/citation.py:63, src/devops_cli/docs/generator.py:1466]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(docs)scope of the title gives the scope.It prevents agent errors on 49 pages but is not a blocking defect.It stops hand-edits of generated pages and keeps the doc set complete and linked.The body estimates about 80 lines plus tests and 1.5 hours to build.Both mark generated docs, but the candidate also adds a source map, orphan deletion, index links, and JSON output fix that #4888 does not cover.devops-cli-service commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The change stops hand edits and stale pages, but it does not block users.Correct generated pages help users and agents trust the documentation.The work adds about 80 lines and tests for five acceptance criteria.Both items keep the generated reference pages correct and usable as brain sources, but #4884 records the decision and citation form while the candidate adds markers, a source map and link checks.devops-cli-service commentedon Nov 14, 2026
Alternatives check: rejected
Reason: The searches found no general tool for the whole need: the item is about this repository's own DocGenerator (source line per page, page-to-source map, orphan deletion, index link checks, JSON output). The one open, maintained tool that covers a part of it is cogapp, whose marker-block generation writes generated blocks into documents, but ADR 0025 explicitly rejects cogapp for the generated blocks because it runs Python from the documents and the generator already writes marker blocks.
Rejected by ADR 0025. A newer fact can change an ADR.
Tool: cogapp (https://pypi.org/project/cogapp)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Owner question: When does the pull request merge? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 20, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
8 remaining items
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.241.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.241.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 00:41 UTC