LESSON 10

Documentation Maintenance

Keep documentation true over time: ownership and metadata, change-triggered updates, automated drift detection, review cadence, feedback loops, and metrics that help rather than mislead.

Introduction

On the day of the release, the documentation is as accurate as it will ever be. From then on, every change to the code makes some page a little wrong. Nobody decides to let documentation rot; it happens one unreviewed change at a time.

Maintenance is therefore not a cleanup you do later. It is a set of habits and mechanisms that make staying accurate the easy path, and make drift visible when it happens anyway.

Learning Objectives

  • Explain why documentation drifts and which kinds drift fastest.
  • Assign ownership and record page metadata.
  • Make documentation part of the definition of done.
  • Detect drift automatically with checks, scans, and diffs.
  • Set a risk-based review cadence and handle documentation debt.
  • Retire, archive, and redirect pages responsibly.
  • Collect feedback and track metrics that drive improvement.
  • Use AI to detect drift and draft updates without publishing unreviewed text.

1. Why Documentation Drifts

Cause Example
Changes without docs A limit changes from 5 MB to 10 MB; three pages still say 5
No owner Everyone assumes someone else will fix it
Duplication The same fact appears in five places; four get updated
Hidden coupling Nobody knows which pages describe a given module
No signal Nothing fails when a page becomes wrong
Pressure Releases ship; documentation is “next sprint”
Screenshots and procedures Interface changes silently invalidate them

Drift is fastest in content that mirrors fast-moving details: commands, configuration, screens, versions, and limits. It is slowest in explanation of concepts and decisions. Spend automation effort where drift is fastest.

2. Ownership and Metadata

Every page needs a person or team responsible for it. Record that in the page itself so that tooling can use it.

1
2
3
4
5
6
7
8
9
10
---
title: Import feedback from a CSV file
kind: how-to
audience: administrator
owner: product-team
last_verified: 2026-12-04
verified_against: v0.1.0-rc1
review_interval_days: 90
source_of_truth: [docs/api/openapi.yaml, src/signaldesk/imports/validation.py]
---
Field Purpose
owner Who fixes or approves changes; used for review routing and reports
last_verified and verified_against When and against what someone confirmed it is true (not merely edited)
review_interval_days How often it must be reviewed, set by risk
source_of_truth Which code or specification it depends on; powers change-triggered updates
kind, audience Supports the plan from lesson 1 and reporting

A check should fail the build when a page lacks an owner or a verification date. “Verified” means someone followed the page or compared it with the source, not that someone edited a typo.

3. Documentation in the Definition of Done

A change is not done until documentation is consistent with it. Make this concrete:

  • The pull request template asks for documentation impact (lesson 3).
  • Reviewers may block a change that alters behavior without updating docs.
  • The team’s definition of done lists documentation, release notes, and ADR impact.
  • Features have documentation tasks in the sprint, estimated like any other work, from the project management course.
  • Release readiness includes a documentation check (the capstone).

Where the team has a dedicated writer, they are an enabler and reviewer, not the only person who writes. If documentation is “someone else’s job,” it will lag.

4. Change-Triggered Updates

Use the source_of_truth metadata to ask automatically: which pages might this change affect?

1
2
3
4
5
6
7
8
# scripts/docs_impact.py (illustrative)
# Given the files changed in a pull request, list documentation pages
# whose source_of_truth includes any of them.
changed = set(git_changed_files(base="main"))
for page in load_pages("docs/"):
    overlap = changed & set(page.source_of_truth)
    if overlap:
        print(f"{page.path}: depends on {sorted(overlap)}")

Post the result as a pull request comment: “This change touches validation.py. These pages depend on it: …” The author then updates them or confirms they remain correct. The mapping needs upkeep, but even a rough version prevents most silent drift.

A second approach is to search for the changed identifiers: when a function, flag, error code, or setting is renamed or removed, search the documentation for the old name.

5. Automated Drift Detection

Layer several detectors, from cheap to thorough:

Detector Detects Frequency
Build with warnings as errors, internal link check Broken structure and links Every pull request
Example and quickstart tests Instructions that no longer run Every pull request or nightly
Spec lint and contract tests API documentation that disagrees with the API Every pull request
Error and configuration completeness checks Error codes or settings with no documentation Every pull request
Command existence check Documented commands or make targets that no longer exist Every pull request
Contract diff between releases Undocumented breaking changes Each release
External link check Rotted links Weekly
Stale page report Pages past review_interval_days Weekly
Screenshot inventory Pages with images that need review after interface changes Each release
Terminology check Glossary violations, deprecated names Every pull request

The stale page report is the safety net:

1
2
3
Pages overdue for review (owner, days overdue)
- docs/guides/deployment.md (platform-team, 41)
- docs/user/import-csv.md (product-team, 12)

Send it to owners and to the team channel; a visible list is hard to ignore.

6. Review Cadence and Documentation Debt

Not every page deserves the same attention. Set the review interval by risk and volatility:

Page type Risk if wrong Suggested review (illustrative)
Quickstarts, setup, runbooks High: blocks work or causes harm Every release, or automatically
API reference and error catalog High, but generated and tested On every change (automated)
User how-to guides Medium Each release or quarterly
Architecture views Medium Quarterly, and after major changes
ADRs Low for text (append-only), medium for status Quarterly index review
Concept explanations Low Twice a year

Keep a documentation backlog alongside the code backlog: known gaps, outdated pages, confusing sections, and feedback. Give items a priority by impact and frequency, and set aside regular time to work them. Documentation debt, like technical debt, should be visible and chosen, not accidental.

7. Retiring Content

Removing content is maintenance too.

  • Delete or archive pages for removed features and superseded procedures. Obsolete documentation is a trap.
  • Add redirects when moving or deleting pages, so external links and search results keep working.
  • Keep old versions available for old releases, clearly labeled, rather than mixing them into current pages.
  • Merge duplicates and keep one source, linking from the others.
  • Mark deprecated features prominently with the replacement and the timeline (lesson 4).
  • Never delete ADRs; mark them deprecated or superseded.

8. Feedback Loops

Readers know where the documentation fails. Make it easy to tell you, and listen.

  • Page-level feedback: “Was this helpful?” and a link to report a problem, routed to the page owner.
  • Support and issue tickets: tag each question that documentation should have answered; the count per page is a priority signal.
  • Search analytics: queries with no results show missing pages or wrong vocabulary.
  • Onboarding retrospectives: each newcomer’s stumbles (lesson 8).
  • Incident reviews: after an incident, ask whether the runbook or architecture documentation helped or misled, and fix it as an action item (this connects to the operations course).
  • Pull request comments: repeated review comments about conventions mean documentation or automation is missing.

Close the loop: when someone reports a problem, fix it promptly and, where possible, tell them. Responsiveness encourages more feedback.

9. Measures That Help, and Measures That Mislead

Helpful Why
Share of pages past their review date Direct measure of drift risk
Time to first success on the quickstart Measures the most important page
Time for a new engineer to first merged change Measures the whole developer documentation set
Broken links and failing example tests Automated, objective drift signals
Support questions that documentation should answer Measures cost of gaps
Feedback ratings and comments, by page Points to the pages needing care
Share of pull requests with documentation updates where impact exists Measures the habit

Misleading measures: page counts and word counts (reward volume, not value), documentation coverage as a target (people document trivial things to raise the number, as with code coverage in the quality course), and ranking individuals by documentation output. Use the helpful measures to decide where to act, not to grade people.

10. Using AI for Maintenance

AI helps most at comparison: noticing that a change and a page disagree.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Act as a documentation drift auditor.

Inputs:
- The code diff or release changes since the last verification:
  [paste]
- The documentation pages listed as depending on those files: [paste]
- The current OpenAPI diff and configuration changes: [paste]

Tasks:
1. List behavior changes visible in the diff.
2. For each page, list statements that the diff makes untrue or
   incomplete. Quote the statement and cite the diff line.
3. Propose minimal replacement text for each, as a suggestion.
4. List pages that depend on the changes but where you found no
   conflict, and what a human should re-check.
5. List changes that probably need new documentation.

Do not rewrite whole pages. Do not report a conflict you cannot
support from the inputs.

Other uses:

  • Release notes drafts: from merged pull requests and the contract diff, grouped by type, in user language, for human editing. Verify each entry against the release.
  • Stale content triage: ask the model to classify overdue pages as “likely still accurate,” “likely outdated,” or “unknown,” with reasons, to order the review queue.
  • Duplicate detection: find passages that state the same fact in several places.
  • Feedback clustering: group page comments and support tickets by theme to prioritize the backlog.

Guardrails: AI proposes, owners approve; automatic edits are limited to non-factual fixes such as typos and link updates; and every AI-suggested factual change is verified against the code or the running system before merging.

11. Practical Exercise

For SignalDesk (or your project):

  1. Add the metadata fields to every page, with an owner, a verification date set by actually verifying, and a review interval by risk.
  2. Add a build check that fails when metadata is missing.
  3. Write the change-triggered impact script and attach its output to pull requests.
  4. Add the drift detectors you do not yet have: example tests, error and configuration completeness, command existence, and the stale page report.
  5. Set review intervals by page type and schedule the first review session.
  6. Create the documentation backlog from the gap analysis, feedback, and anything found while building the course.
  7. Remove or redirect at least three obsolete or duplicate pages.
  8. Add page feedback and a way to tag support questions that documentation should have answered.
  9. Choose four measures from section 9, and record their baseline.
  10. Run the drift audit prompt on a recent real change, verify its findings, and apply the valid ones.

Verification

You are ready to continue when:

  • Every page has an owner, a verification date, a review interval, and its sources.
  • A change to a source file produces a list of pages that may be affected.
  • At least five categories of drift are detected automatically, and you have seen each fail correctly.
  • A stale page report exists and reaches owners.
  • A documentation backlog exists, prioritized, with time allocated.
  • Obsolete content has been removed or redirected.
  • You have baselines for your chosen measures and know what decision each informs.

Key Takeaways

  • Documentation drifts through unreviewed change; prevention beats periodic cleanup.
  • Every page needs an owner, a verification date, and declared sources.
  • Include documentation in the definition of done, and automate detection of drift.
  • Review by risk, keep a visible backlog, and retire what is obsolete.
  • Measure what helps decisions, never volume; AI compares and proposes while people verify and approve.

What’s Next?

You now have every part of the documentation set and the means to keep it true. In the capstone, you assemble the pieces into Complete Technical Documentation, check them for consistency, test them with real readers, and assess whether the documentation is ready for the release candidate.