Repository source: docs/specs/agent_response_metadata_v1.md
Agent response metadata — named headers v1
New scripture-analysis and expansion replies use these canonical post headers:
Agent-Response-Type: scripture_oriented_analysis
Agent-Response-Source-Post-ID: source-post
Agent-Response-Source-SHA256: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
For scripture_expansion, all three fields above are required, plus:
Agent-Response-Expansion-Of: initial-reply
Agent-Response-Initial-SHA256: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
The initial reply's source must equal its parent; an expansion's Expansion-Of
must equal its parent. Source IDs retain the existing ASCII token grammar;
hashes are exactly 64 lowercase hexadecimal characters. Existing shared metadata
validation remains authoritative. Extra Agent-Response- names, duplicate headers,
missing/empty required values, and simultaneous Agent-Response plus named headers
are errors. Plain replies have none of these fields. Canonical LF/UTF-8 rules apply.
The complete post is signed, including headers; metadata alone grants no authority.
Historical Agent-Response: {…} records remain readable through
LegacyAgentResponseMetadata. Preserve all historical bytes and detached
signatures, including optional fields and existing empty-header interpretation.
Never rewrite a signed post to convert this representation. New writers emit only
named fields and reject unsupported extra input rather than silently dropping it.
Both representations become the same PostRecord::agentResponse data. Machine
agent_response_json and offline snapshot fields remain JSON. Their decoder and
shared validation do not depend on the legacy canonical adapter. postHash remains
SHA-256 of the existing JSON-encoded post ID, subject and body tuple; changing
metadata representation does not change source/initial version hashes. Expansion
identity and author/source/thread checks are unchanged.
The read-only readiness command and removal guide define the eventual decoder-removal boundary and archive limitations.