@@ -1013,6 +1013,8 @@ function makeFlowReceiptId() {
10131013}
10141014
10151015function makeReceipt ( { execution, result, status = "success" , error = null , traceId, receiptId } ) {
1016+ // CommandLayer receipt generation
1017+ // Wraps an agent verb execution into a signed, verifiable receipt.
10161018 let receipt = {
10171019 status,
10181020 entry : execution . entry ,
@@ -1797,6 +1799,8 @@ app.post("/verify", async (req, res) => {
17971799 let ensExpect = null ;
17981800
17991801 if ( wantEns ) {
1802+ // ENS signer resolution (VerifyAgent.eth integration)
1803+ // Resolves cl.sig.pub / cl.sig.kid from the signer ENS name so receipts can be verified without hardcoded keys.
18001804 const signerForEns = String ( proof ?. signer_id || runtimeConfig . signerId || "" ) . trim ( ) ;
18011805 const ensOut = await fetchEnsSignerBundle ( { signerName : signerForEns , refresh } ) ;
18021806
@@ -1866,7 +1870,8 @@ app.post("/verify", async (req, res) => {
18661870 } ) ;
18671871 }
18681872
1869- // 2) verify signature/hash via runtime-core
1873+ // CommandLayer receipt verification
1874+ // Rebuilds the canonical receipt hash and verifies the Ed25519 signature.
18701875 let v ;
18711876 try {
18721877 v = verifyReceiptEd25519Sha256 ( runtimeCoreReceipt , {
@@ -1899,6 +1904,8 @@ app.post("/verify", async (req, res) => {
18991904
19001905 const sigErr = signatureValid ? null : v ?. reason || "verify failed" ;
19011906
1907+ // Schema validation for verifiable agent receipts
1908+ // Confirms receipt structure matches the declared CommandLayer schema.
19021909 // 3) schema validation (optional + edge-safe)
19031910 let schemaOk = null ;
19041911 let schemaErrors = null ;
0 commit comments