Skip to content

chore(docs): mark the generated documents as generated #4888

Description

@dan-petty

Problem or Motivation

This is hooks item P19, child 18 of #4771. It was a tracker line with no issue. This issue files it with a wider scope. It is also child 2 of the content freshness tracker #4880.

Proposed Solution & Architectural Design

  1. In .gitattributes, set linguist-generated=true for the 11 generated globs of CONST_DOCS_INVENTORY (52 files). README.md stays unmarked, because only one block of it is generated.
  2. The review skip (src/devops_cli/review/targets.py) reads the generated class from the inventory. Remove docs/commands/*.md and docs/CLI_REFERENCE.md from CONST_REVIEW_ROUTED_PATH_PATTERNS.
  3. One test compares the inventory, git check-attr and the review skip.
  4. Add the conflict step to CONTRIBUTING.md next to the docs step: when a rebase stops on a generated file, run git checkout --ours -- <file> (in a rebase, "ours" is main) and continue the rebase. Then run uv run devops docs generate --sync-readme once and commit. The devops-pr-ci skill line of refactor(pr): devops pr update acts only on a failed check #4674 links to this step and does not copy it.
  5. Post a comment on feat(ci): track the agent hooks plan #4771 that corrects the P19 statement about generated-only conflicts.

No merge driver: GitHub ignores merge drivers.

Target Subsystem

SDLC, Git & PR Governance (.gitattributes, the model-review skip, CONTRIBUTING.md).

Existing Tool Considered

GitHub Linguist attributes (linguist-generated) and git check-attr. Nothing is built apart from one test and the inventory read.

Acceptance Criteria

  • git check-attr linguist-generated gives true for each of the 52 files and unspecified for every other tracked Markdown file.
  • The test fails when the inventory gets a generated glob with no attribute line.
  • A review target test skips all 52 files.
  • The docs row still fails a hand edit of a generated page.
  • CONTRIBUTING.md has the conflict step.

Dependencies

None.

Source: #4771

Alternatives check of 2026-11-14: not-applicable.
Class: chore, no search.
Tool: none found.

Proposed design

Problem statement

Generated documents fill the pull request diff and the model review. In the week to 2026-11-11, 121 commits on main touched them. .gitattributes sets no linguist-generated line, so GitHub shows each generated diff in full. The model-review skip names 2 of the 11 generated globs, so 9 documents still reach model review. No contributor document holds the rebase conflict step for a generated file, and the devops-pr-ci skill holds the only copy.

Acceptance criteria

Requirement: Generated documents carry the linguist-generated attribute

.gitattributes SHALL set linguist-generated=true for each glob of the generated class of CONST_DOCS_INVENTORY.

Scenario: each generated document is marked

  • WHEN a test runs git check-attr linguist-generated for each tracked file that matches a generated glob
  • THEN each file prints true

Requirement: No other Markdown file carries the attribute

A tracked Markdown file that matches no generated glob MUST print unspecified for linguist-generated.

Scenario: a hand-written document stays unmarked

  • WHEN a test runs git check-attr linguist-generated for README.md and each other tracked Markdown file that matches no generated glob
  • THEN each file prints unspecified

Requirement: A generated glob with no attribute line fails the check

The attribute check MUST fail when a glob of the generated class has no matching line in .gitattributes.

Scenario: a new generated glob has no line

  • WHEN a test adds a glob to the generated class and runs the attribute check
  • THEN the check fails and names the glob and the missing attribute

Requirement: The review skip reads the generated class

is_secret_scan_only SHALL treat each path that matches a glob of the generated class of CONST_DOCS_INVENTORY as secret-scan only.

Scenario: a glob added to the inventory changes the skip

  • WHEN a test adds a glob to the generated class and calls is_secret_scan_only with a path that matches it
  • THEN the call returns True

Requirement: The routed patterns hold no generated glob

CONST_REVIEW_ROUTED_PATH_PATTERNS MUST hold no glob of the generated class.

Scenario: the two generated globs are gone

  • WHEN a test compares each entry of CONST_REVIEW_ROUTED_PATH_PATTERNS with the generated class
  • THEN no entry equals docs/commands/*.md or docs/CLI_REFERENCE.md, and no entry matches a generated glob

Requirement: Every generated document is skipped by the review

A review target test SHALL skip each tracked file that matches a generated glob.

Scenario: each generated document is secret-scan only

  • WHEN a test calls is_secret_scan_only for each tracked file that matches a generated glob
  • THEN each call returns True

Requirement: The docs row refuses a hand edit of a generated page

The docs row of devops ci MUST still fail when a generated document is not the output of its generator.

Scenario: a generated page holds a hand edit

  • WHEN the docs check runs on a tree whose generated page holds a hand edit
  • THEN the check exits 1 and names that page

Requirement: CONTRIBUTING.md holds the conflict step

CONTRIBUTING.md SHALL state the rebase conflict step for a generated file in its Documentation Synchronization section.

Scenario: a reader finds the step beside the docs command

  • WHEN a test reads the Documentation Synchronization section of CONTRIBUTING.md
  • THEN it holds git checkout --ours -- <file>, git rebase --continue and uv run devops docs generate

Existing Tool Considered

GitHub Linguist's linguist-generated attribute, read with git check-attr, covers the diff view: it collapses a generated file in the GitHub pull request view. It lacks the model-review skip, because it marks a file for GitHub and not for this project's review. The change therefore reads the generated class of CONST_DOCS_INVENTORY in is_secret_scan_only: about 10 lines and two tests, an estimated 2,000 tokens to write and 1,000 to keep and fix, and under one hour of elapsed time. No merge driver is added: a merge attribute names a driver that git starts as a program (CONST_GIT_ATTRIBUTE_DRIVERS), and git defines only text, binary and union itself (CONST_GIT_BUILTIN_DRIVERS).

Key questions

  • Which documents does the generated class of the docs inventory cover?: The generated class holds 11 globs and 52 files: 7 reference pages (docs/CLI_REFERENCE.md, docs/CONFIGURATION.md, docs/ENV_VARS.md, docs/ERRORS.md, docs/KNOWLEDGE_BASE.md, docs/MCP_TOOLS.md, docs/TELEMETRY.md), 42 pages of docs/commands/, and 3 instruction stubs (CLAUDE.md, GEMINI.md, .github/copilot-instructions.md). [sources: src/devops_cli/config/constants.py:494, docs/adr/0025-generated-documents-stay-in-git-and-the-project-brain-cites-them.md:18]
  • Which generated globs does the model-review skip name today?: Two: docs/commands/*.md and docs/CLI_REFERENCE.md. The other 9 generated globs reach model review. [sources: src/devops_cli/config/constants.py:4667, src/devops_cli/review/targets.py:37]
  • Does a document already hold the rebase conflict step for a generated file?: Yes. The devops-pr-ci skill holds it: "On a rebase conflict in a generated document, run git checkout --ours <file> (in a rebase, "ours" is main). Then run uv run devops docs generate, git add <file> and git rebase --continue." CONTRIBUTING.md holds no such step, so the body's line "No document holds the conflict step" is wrong. The step moves to CONTRIBUTING.md as the canonical text. [sources: .agents/skills/devops-pr-ci/SKILL.md:21, CONTRIBUTING.md]
  • How does the review skip learn which files are generated?: is_secret_scan_only reads the generated class of CONST_DOCS_INVENTORY and treats each match as secret-scan only. CONST_REVIEW_ROUTED_PATH_PATTERNS keeps the record, tool-owned and prompt paths, and loses the two generated globs. (best practice) [sources: src/devops_cli/config/constants.py:494, src/devops_cli/review/targets.py:37]
    • Chosen: Read the generated class of CONST_DOCS_INVENTORY. One source of truth: the inventory already classifies every Markdown file, and a second copy is what let the two globs drift.
    • Rejected: Add the 9 missing globs to CONST_REVIEW_ROUTED_PATH_PATTERNS. It keeps two lists of the same globs, and a new generated document needs an edit in two places.
    • Rejected: Add a third constant of the generated globs for the review. It is a third list of the same globs, with the same drift.
  • How does a rebase conflict on a generated file get resolved?: The contributor takes the base copy with git checkout --ours -- <file>, continues the rebase, runs uv run devops docs generate once on the final tree, and commits the result. The skill's current order regenerates inside the rebase; the step moves the one regeneration to the end, so one commit holds the final output. (best practice) [sources: src/devops_cli/config/constants.py, .agents/skills/devops-pr-ci/SKILL.md:21]
    • Rejected: A merge=ours attribute line. Git defines only text, binary and union as merge drivers. ours needs a driver in each clone's config, and a clone does not get one.
    • Chosen: A documented step in CONTRIBUTING.md. It needs no per-clone setup, and the generator rewrites the file, so the base copy plus one regeneration is deterministic.
  • Which command regenerates the generated documents?: uv run devops docs generate, the form that CONTRIBUTING.md and the devops-pr-ci skill give. The proposal's --sync-readme has no source in the repository, so the step leaves it out. [sources: CONTRIBUTING.md, .agents/skills/devops-pr-ci/SKILL.md:21]
  • Does README.md hold a generated block?: No. Its Command Reference section is prose that links docs/CLI_REFERENCE.md, and the docs-cli-reference requirement "README.md holds no generated block" states the same. README.md stays unmarked because nothing in it is generated, not because only one block of it is. [sources: README.md]
  • Where does the conflict step go in CONTRIBUTING.md?: In the Documentation Synchronization bullet of section 4, after the uv run devops docs generate line. (best practice) [sources: CONTRIBUTING.md]
    • Chosen: The Documentation Synchronization bullet of section 4. It already tells the reader to run uv run devops docs generate, and the conflict step is the recovery for that command.
    • Rejected: A new section of its own. It splits one procedure over two places and grows the document.
  • How do the attribute lines stay true when the inventory changes?: The lines are hand-written, and one test compares the generated class, git check-attr and .gitattributes. A glob with no line fails in the pull request that adds the glob. (best practice) [sources: src/devops_cli/config/constants.py:494, CONTRIBUTING.md]
    • Chosen: Hand-written lines, kept true by one test. The file holds unrelated eol and binary lines, and the test fails in the pull request that adds a generated glob.
    • Rejected: Generate the lines from the inventory. It needs a command, a hook and a generated block in a file that git reads before any tool runs, and no generator writes .gitattributes.
  • Which tests read the two symbols that this change edits?: CONST_DOCS_INVENTORY is read by tests/commands/test_openspec_scaffold.py, tests/config/test_tuicr_config.py and tests/docs/test_docs_inventory.py. CONST_REVIEW_ROUTED_PATH_PATTERNS is read by tests/commands/test_openspec_scaffold.py:26, so that test changes if it asserts the two removed globs. [sources: tests/commands/test_openspec_scaffold.py:26, tests/docs/test_docs_inventory.py, tests/config/test_tuicr_config.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/chore
    scope/docs
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/chore. The chore prefix of the title gives the type.
    • Scope: scope/docs. The (docs) scope of the title gives the scope.
    • Priority: P2-Medium. It reduces noise and unnecessary model review on every pull request but does not block delivery.
    • Value: Medium. It removes generated-file noise from PR views and stops 6 pages from going to model review on each PR.
    • Effort: Medium. It touches .gitattributes, review/targets.py, a new test, and CONTRIBUTING.md, but each change is small.
    • Related: refactor(docs): no documentation-only pull requests: release artifacts are made as the release merges, and every kept doc changes with its code or is deleted #1103, which asks for a different change. Both work on the generated docs inventory, but #1103 removes committed reference pages while this marks them as generated in .gitattributes.
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: chore. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  6. added
    status/ready
    and removed
    status/new
    on Nov 15, 2026
  7. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at ca62d6a (see proposed design in issue body).

    Moved to new items: #5900.

  8. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor

    The Ready body of this item has stale premises, and two acceptance points conflict with main. Correct the body before a builder takes it.

    Evidence (origin/main 0d90de5, 2026-11-19)

    1. 2 of the 11 generated globs are already marked. feat(roadmap): collect the git facts of a project review window #4794 (merged 2026-11-11T21:23Z, before this item was filed at 2026-11-12T01:57Z) added docs/CLI_REFERENCE.md linguist-generated and docs/commands/*.md linguist-generated (.gitattributes:22-23). The body line ".gitattributes has only eol and binary lines" and the refine line ".gitattributes sets no linguist-generated line" are wrong. The work is 9 globs (9 files), not 11 globs. The tracker feat(docs): track current content and brain-fed reference docs #4880 (body line 188) already states this.
    2. The marked lines print set, not true. The feat(roadmap): collect the git facts of a project review window #4794 lines use the bare form, so git check-attr linguist-generated docs/CLI_REFERENCE.md prints set. Body acceptance point 1 and the refine scenario "each file prints true" fail for these 44 files. Either the PR changes the two lines to =true, or the test accepts set and true, as _GENERATED_VALUES in src/devops_cli/roadmap/project_review/git_read.py:29 does.
    3. "unspecified for every other tracked Markdown file" conflicts with CHANGELOG.md. feat(roadmap): collect the git facts of a project review window #4794 also added CHANGELOG.md linguist-generated (.gitattributes:19). CHANGELOG.md is in the tool-owned class (src/devops_cli/config/constants.py:522-523), not in the generated class. The project review reads this mark to count generated lines apart (src/devops_cli/roadmap/project_review/facts.py:5). The requirement "No other Markdown file carries the attribute" must exclude CHANGELOG.md, or the PR removes a mark that the project review uses.
    4. Step 4 names a deleted flag. It says "run uv run devops docs generate --sync-readme". docs(cli): turn CLI_REFERENCE into an index of the command group pages #5198 (merged 2026-11-12T20:29Z) deleted --sync-readme. git grep sync.readme finds 0 hits in src/, CONTRIBUTING.md and docs/commands/. The refine design already drops the flag, but the body step still holds it.
    5. The counts changed. docs/commands/ holds 43 pages, not 42. The generated class holds 53 files (7 reference pages, 3 stubs and 43 command pages), not 52.
    6. Step 5 moved. The refine comment of 2026-11-15T23:22Z moved the comment on feat(ci): track the agent hooks plan #4771 to docs(roadmap): correct the P19 statement about generated-only conflicts #5900.

    Still true

    • CONST_REVIEW_ROUTED_PATH_PATTERNS (src/devops_cli/config/constants.py:4826) names the 2 generated globs, so 9 generated documents still go to model review.
    • CONTRIBUTING.md holds no conflict step. CONTRIBUTING.md:184 gives only uv run devops docs generate.

    Proposed body changes

  9. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  10. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  11. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  12. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 06:00 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/docssource/agenttype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions