View on GitHub

Winery API Document Automation Lab

A hands-on developer learning lab for deterministic document generation, validation, estimation, and provenance.

Developer Learning Lab: One Script, Four Documents

This lab teaches deterministic document automation using a working system. You’ll take one structured video-course script and follow it through a parser, a validation gate, a duration estimator, and a generator that writes four role-specific Google Docs with a provenance manifest.

Everything in the five core exercises runs locally, against files in this repository, with no Google account. An optional sixth exercise runs the real Google Docs workflow.

The script is for a fictional course, Understanding APIs: A Winery’s Digital Cellar. The winery API in api/ is what that course teaches. You don’t need to run it for this lab.

Who it’s for

Developers, developer advocates, technical educators, technical writers, and documentation engineers who are comfortable with a terminal and basic JSON. You don’t need to know Google Apps Script.

Time

  Exercise Time
0 Set up 5 min
1 Inspect the source 10 min
2 Parse and validate 10 min
3 Break the contract 10 min
4 Estimate production 12 min
5 Provenance and regeneration 10 min
  Core lab about 57 min
6 Optional: generate the Google Docs 45 to 60 min

Learning objectives

By the end of the lab you should be able to:

# Objective Exercise
1 Explain why maintaining several production documents by hand creates synchronization risks 1
2 Tell a structured source document from a generated artifact 1, 5
3 Identify stages, videos, sections, and annotations in the master script 1
4 Parse the source into a deterministic intermediate representation 2
5 Validate structural contracts and interpret diagnostics 2, 3
6 Show that invalid source material blocks generation 3
7 Explain how role-specific document filtering works 1, 6
8 Calculate and interpret narration-duration estimates 4
9 Distinguish observed script facts from estimation assumptions 4
10 Inspect a provenance manifest and explain what its hashes establish 5
11 Explain why regenerating outputs is better than editing generated documents 5
12 Identify the system’s limitations, including the code-example convention and estimated (not measured) runtime 4, 6

Prerequisites

How the lab works

The system in one picture

master script ──► parser ──► IR + diagnostics ──► any errors? ──► yes: stop. Nothing is generated.
                                                             └──► no:  estimator ──► renderer ──► ONSET, MOTION, SCREENCAST,
                                                                                                  Production Summary, manifest.json

The lab home page has the same flow as a diagram, and docs/architecture.md describes each part.

Reference