Skip to content

Documentation Generation Loop

Deterministic source → draft → review → finalize flow used by the Documentation Agent.

Steps

  1. Source ingestion.
  2. Pull declared source_references[] from the project (repo, wiki, AnyType, files, transcripts).
  3. Pin each source by commit / version / timestamp.
  4. Reject if any source is private_sensitive and the requested content type is intended for public publishing.

  5. Context assembly.

  6. Build a canonical brief: problem, audience, intent, key facts, citations.
  7. Compute the maximum data classification across all sources — drives runtime choice (SPB-10).

  8. First-draft generation.

  9. Choose the matching template under templates/.
  10. Fill required fields and sections; mark unfilled sections with explicit TODO[author] markers — never silently omit.

  11. Quality / lint checks.

  12. Schema validation against content-type.schema.json.
  13. Editorial policy check (voice, citation, safety, prohibited claims).
  14. Citation resolution: every claim's source resolves.
  15. SPB-09 secret-scan against the draft.

  16. Reviewer signoff.

  17. Per-content-type review matrix in editorial policy.
  18. Reviewers fill the quality_checklist flags.

  19. Finalize.

  20. When all quality_checklist flags are true, mark the draft finalized.
  21. Cross-link from the originating project record (AnyType Project or wiki entry).
  22. Persist a finalized artifact and a content-lineage record.

Failure handling

  • Lint or editorial failure → block finalization; iterate.
  • Reviewer rejection → return to step 3 with reviewer comments.
  • Schema validation error → fix template usage; do not bypass schema.

Audit events

  • draft_created, draft_revised, quality_check_passed, quality_check_failed, signoff_recorded, finalized.