Documentation Generation Loop¶
Deterministic source → draft → review → finalize flow used by the Documentation Agent.
Steps¶
- Source ingestion.
- Pull declared
source_references[]from the project (repo, wiki, AnyType, files, transcripts). - Pin each source by commit / version / timestamp.
-
Reject if any source is
private_sensitiveand the requested content type is intended for public publishing. -
Context assembly.
- Build a canonical brief: problem, audience, intent, key facts, citations.
-
Compute the maximum data classification across all sources — drives runtime choice (SPB-10).
-
First-draft generation.
- Choose the matching template under
templates/. -
Fill required fields and sections; mark unfilled sections with explicit
TODO[author]markers — never silently omit. -
Quality / lint checks.
- Schema validation against
content-type.schema.json. - Editorial policy check (voice, citation, safety, prohibited claims).
- Citation resolution: every claim's source resolves.
-
SPB-09 secret-scan against the draft.
-
Reviewer signoff.
- Per-content-type review matrix in editorial policy.
-
Reviewers fill the
quality_checklistflags. -
Finalize.
- When all
quality_checklistflags aretrue, mark the draftfinalized. - Cross-link from the originating project record (AnyType
Projector wiki entry). - 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.