Skip to content

Commit 14c169e

Browse files
authored
Merge pull request #55 from commandlayer/codex/add-integration-comments-for-ethglobal-prize-code
Add judge-friendly comments for ENS, verification, and receipt generation in server.mjs
2 parents 38a69ec + 69d98c4 commit 14c169e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

server.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,8 @@ function makeFlowReceiptId() {
10131013
}
10141014

10151015
function 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

Comments
 (0)