DEV Community

Avery Lin
Avery Lin

Posted on

The Doc Draft Ledger: Price Verification Before You Send a Section to the Model

The cheapest AI draft is the one a reviewer can verify in under two minutes. Most teams route an entire documentation set to a model and then discover that a single high-claim section consumes more review time than writing it by hand. The fix is a ledger that prices every doc section before the first generation job starts.

Why Verification, Not Drafting, Is the Bottleneck

Model output is a supply that outpaces human attention by orders of magnitude. With MonkeyCode's free model access and free server option, a first draft becomes a batch operation instead of a desk operation. Disclosure: This article was prepared as part of MonkeyCode's product outreach. The real constraint is the minutes a human spends deciding whether each sentence is true, current, and safe to publish.

That asymmetry has a practical consequence for documentation teams. A two-thousand-word section may take the model twenty seconds to produce and a reviewer ninety minutes to validate. Review time does not scale with word count; it scales with the density of statements that can be wrong.

A contract says who owns a section, and a ledger says what ownership costs. The workflow below combines both: three ownership classes, a pricing formula, and a CI gate that fails when the estimated review load exceeds a weekly budget.

The Ledger Schema

The ledger is a YAML file with one entry per top-level doc section. Keep it in the repository so the check becomes part of the merge pipeline.

budget:
  weekly_review_minutes: 240

sections:
  - id: quickstart
    path: docs/quickstart.md
    class: draftable
    words: 900
    claim_density: low
    code_blocks: 2
    external_links: []
  - id: authentication
    path: docs/auth.md
    class: hybrid
    words: 1400
    claim_density: high
    code_blocks: 4
    external_links: ['https://example.com/spec']
  - id: deployment-topology
    path: docs/deployment.md
    class: owned
    words: 1200
    claim_density: high
    code_blocks: 6
    external_links: []
Enter fullscreen mode Exit fullscreen mode

Three classes do the work in practice. draftable sections contain reproducible steps and low-stakes instructions, so the model may draft them and the human spot-checks. hybrid sections carry real technical weight, so the model produces an outline and example code while the human writes the final prose. owned sections cover architectural, security, or contractual claims and stay human-authored from the first keystroke.

The Verification Price

The ledger turns each section into an estimated review cost using weights, not magic. A claim about 'always' or 'never' costs more than a claim about 'can be' because one counterexample invalidates it. Every code block adds a read-and-run tax, and every external link adds a broken-reference risk.

#!/usr/bin/env python3
"""ledger_check.py - price doc verification before the model drafts anything."""
import argparse
import sys

try:
    import yaml
except ImportError:
    sys.exit('pip install pyyaml first')

WEIGHTS = {
    'claim_minutes': {'low': 1, 'medium': 3, 'high': 8},
    'code_minutes': 3,
    'link_minutes': 1,
    'read_wpm': 220,
}
CLASS_MULTIPLIERS = {'draftable': 0.3, 'hybrid': 0.7, 'owned': 0.0}


def section_cost(sec):
    claim = WEIGHTS['claim_minutes'][sec.get('claim_density', 'low')]
    code = WEIGHTS['code_minutes'] * sec.get('code_blocks', 0)
    links = WEIGHTS['link_minutes'] * len(sec.get('external_links', []))
    read = sec.get('words', 300) / WEIGHTS['read_wpm']
    base_minutes = claim + code + links + read
    return base_minutes * CLASS_MULTIPLIERS.get(sec['class'], 0.7)


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('ledger', type=str)
    parser.add_argument('--budget', type=int, required=True,
                        help='weekly AI-review budget in minutes')
    args = parser.parse_args()

    with open(args.ledger, 'r', encoding='utf-8') as fh:
        data = yaml.safe_load(fh)

    rows = []
    ai_total = 0.0
    docs_total = 0.0
    for sec in data['sections']:
        cost = section_cost(sec)
        ai_cost = cost if sec['class'] != 'owned' else 0.0
        rows.append((sec['id'], sec['class'], round(cost, 1), round(ai_cost, 1)))
        ai_total += ai_cost
        docs_total += cost

    print(f"{'section':<16} {'class':<12} {'all min':<8} {'ai min':<8}")
    print('-' * 48)
    for ident, klass, cost, ai_cost in rows:
        print(f'{ident:<16} {klass:<12} {cost:<8} {ai_cost:<8}')
    print('-' * 48)
    print(f'AI-drafted verification estimate: {ai_total:.1f} min')
    print(f'Budget: {args.budget} min')

    if ai_total > args.budget:
        sys.exit(f'OVER BUDGET by {ai_total - args.budget:.1f} min')
    print('Within budget.')


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

The script is a reference implementation, so treat the weights as starting points rather than measured facts. Its purpose is to make the trade visible before anyone reads generated prose.

Running it on the ledger above produces a short table:

section           class          all min  ai min
------------------------------------------------
quickstart        draftable      3.8      1.1
authentication    hybrid         12.6     8.8
deployment-topology owned        16.2     0.0
------------------------------------------------
AI-drafted verification estimate: 9.9 min
Budget: 240 min
Enter fullscreen mode Exit fullscreen mode

The authentication section alone consumes most of the AI-review allowance, and the owned deployment section costs nothing against that budget. If the sum exceeds the weekly budget, the command exits non-zero and the merge pipeline stops before anyone opens a draft.

The Six-Step Workflow

Use the ledger with a short loop that keeps human attention in the loop.

  1. Inventory. Find the top-level sections of your doc set and record their word counts, code blocks, links, and claim density. A quick start is find docs -name '*.md' -exec wc -w {} + plus a manual pass for claim density.
  2. Classify. Assign each section to draftable, hybrid, or owned based on how much harm a wrong statement could cause.
  3. Draft. For draftable and hybrid sections, run the generation job against MonkeyCode's free server option with its free model access, and write the output to a feature branch. Keep owned sections on the keyboard; a model never sees them.
  4. Price. Run python3 ledger_check.py docs_ledger.yaml --budget 240 and read the resulting table.
  5. Cut, don't stretch. If the estimate is over budget, move the costliest section to owned or delete it from the sprint. Never lower the budget to match the output, because that defeats the exercise.
  6. Verify and merge. For every section the model touched, add verified_by and verified_on fields to the ledger; the ownership gate can refuse to merge until those fields exist.

Calibration Notes

The default weights are heuristics, so calibrate them with your own review history. Pick five merged doc PRs, record the actual review minutes, and divide by the estimate the script produced before merge. If the ratio is consistently around 1.4, raise every weight by that factor; if it is below 0.8, lower them. Two weeks of data is enough to stop guessing about verification cost.

Limitations and Non-Fit

The ledger cannot measure comprehension, so a cheap section can still mislead a reader. The free tier is a development resource and not an SLA, so availability and quotas can change during a sprint; keep a fallback path ready. Skip this workflow when your docs are mostly narrative, because classifying prose-heavy pages costs more than the drafting saves. Skip it when no one is actually reviewing, because the ledger exposes a time deficit but cannot create capacity.

Close

Price the review, not the generation. Run the reference script against a repo you maintain with a two-hour budget and read the first overrun report; it will teach you more about your AI documentation workflow than the next model evaluation.

Top comments (0)