DEV Community

Avery Lin
Avery Lin

Posted on

The Documentation Ownership Matrix: Decide What AI Drafts Before It Drafts Anything

Most documentation review budgets collapse because they spread the same scrutiny across tutorials, reference pages, and API contracts. A model can generate thousands of words of plausible prose before a human notices that one compatibility promise is wrong. The fix is a decision matrix that assigns ownership before any draft reaches the page.

Why Section-Level Ownership Matters

Every sentence in a doc is either a claim or an illustration. Claims that affect user decisions, like "this function is thread-safe" or "we support Python 3.12", carry blast radius. Illustrations, like a motivating example or a conceptual analogy, are lower risk because failures are usually obvious. Treating both with the same review process wastes your time or, worse, lets a high-risk claim slip through without scrutiny.

The key metric is the cost of a wrong statement. A wrong tutorial snippet often fails immediately, but a wrong contract promise can compromise a production system. Therefore, the human must own sections where an incorrect claim would create more than annoyance: external promises, security notes, and anything that runs as code.

The 3x3 Matrix

Combine risk level with volatility to decide who drafts and who owns. Use a simple 3x3 table:

Risk level Stable behavior Changing behavior
Low (concept, context) AI drafts, human skims AI drafts, human reviews
Medium (usage, examples) AI drafts, human verifies examples Human drafts, AI assists
High (contracts, security) Human drafts, human verifies Human drafts, human verifies

Low-risk stable sections are the only place where a generated draft can go straight into a PR. Medium-risk sections require that every code block be executed before approval. High-risk sections should never be written from a model's output without a human-authored skeleton first.

Implementing the Contract in a Workflow

Below is a practical workflow using a free tier, which I've used for internal library docs.

  1. Classify each section using the matrix and write the result as a YAML contract.
  2. Let the model draft only the sections marked drafter: model via MonkeyCode's free model access.
  3. Run an ownership checker on each push using MonkeyCode's free server option to keep CI costs at zero.
  4. Have the human approve and sign each model-drafted section by adding a reviewer marker.
  5. Merge only when every section has the expected markers.

Disclosure: This article was prepared as part of MonkeyCode's product outreach.

A Minimal Ownership Checker

Save this YAML as ownership.yaml:

sections:
  - id: overview
    drafter: model
    risk: low
    require_reviewer: true
  - id: installation
    drafter: model
    risk: high
    require_reviewer: true
  - id: api-reference
    drafter: human
    risk: critical
Enter fullscreen mode Exit fullscreen mode

Then a GitHub Action or pre-commit hook can verify each section. The script below parses the markdown by ## headings and enforces the contract:

import re, sys, yaml
from pathlib import Path

def main():
    contract = yaml.safe_load(Path("ownership.yaml").read_text())
    doc = Path("README.md").read_text()
    sections = re.split(r"\n## ", doc)
    for entry in contract["sections"]:
        section = next((s for s in sections if s.startswith(entry["id"])), None)
        if not section:
            print(f"Missing section: {entry['id']}")
            sys.exit(1)
        has_model_marker = "<!-- draft-by: model -->" in section
        if entry["drafter"] == "model" and not has_model_marker:
            print(f"Section {entry['id']} must be marked as model-drafted")
            sys.exit(1)
        if entry["drafter"] == "human" and has_model_marker:
            print(f"Section {entry['id']} must not be model-drafted")
            sys.exit(1)
        if entry.get("require_reviewer") and "<!-- reviewer: @" not in section:
            print(f"Section {entry['id']} needs a reviewer marker")
            sys.exit(1)
    print("All ownership checks passed")

if __name__ == "__main__":
    main()
Enter fullscreen mode Exit fullscreen mode

This checker is intentionally dumb; it relies on explicit markers rather than detecting authorship. That is a feature, because implicit authorship detection is unreliable. If your model-drafted section lacks a reviewer, the build fails, and you must decide whether you actually own what you are about to publish.

Limitations and Who Should Skip This

This workflow assumes you have enough human reviewers to sign every section that touches promises. For a solo open-source maintainer with a huge API surface, the reviewer requirement may be the bottleneck. It also assumes your doc structure maps cleanly to discrete headings; if sections are deeply nested, you will need a more sophisticated parser. Finally, regulated documentation, such as safety or medical material, should not use AI drafts at all, regardless of the ownership matrix.

If you try this, put the YAML contract at the root of your docs and make the checker part of your merge pipeline. The model drafts; the humans pay the price. Encoding the boundary is the only way to keep the price visible.

Top comments (0)