finalize_handoff
Produce a canonical Markdown handoff for completed documentation audits, validating evidence references against session retrievals and persisting an immutable, session-scoped receipt.
Instructions
Finalize one canonical Markdown handoff for a completed documentation audit/analysis (jdocmunch.handoff/v1; suite parity with jCodeMunch). The server assembles YOUR sections deterministically, validates every evidence_refs entry against what this session actually retrieved (section ids or doc paths served by search_sections / search_titles / get_section / get_sections — unknown refs fail closed), persists the result session-scoped, and returns a compact receipt {handoff_id, resource_uri, sha256, length, canonical:true}. Read the immutable body via the munch://handoff/ resource; repeated reads are byte-identical. Appendices are included exactly once; no character limit; never writes to the documentation corpus.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Doc repo identifier the handoff is about. | |
| task | Yes | The task/question this handoff answers (becomes the title). | |
| profile | No | Handoff profile label (e.g. doc_audit). | general |
| sections | Yes | Ordered report sections, each {heading, content} (markdown). The caller authors these; the server only assembles. Optional per-section claims[] bind evidence to an individual claim instead of one global list (handoff/v2). | |
| appendices | No | Optional named appendices, each {name, content, content_type?}; names must be unique. | |
| evidence_refs | Yes | Section ids or doc paths retrieved this session; validated against the session retrieval record. |