feat(air): implement AIR Improvements A, B, and C
A — Store air_id in note frontmatter (lib/write.mjs) writeNote is now async and accepts `options.config`. When air.enabled=true it calls attestBeforeWrite internally and merges the returned id into frontmatter before the file write. Removes the now-redundant standalone attestBeforeWrite calls from cli/index.mjs and mcp/create-server.mjs.
B — Wire hosted gateway writes to AIR (hub/gateway/server.mjs, apply-note-provenance.mjs) proxyToCanister calls attestBeforeWrite for POST /api/v1/notes and PUT /api/v1/notes/:path when KNOWTATION_AIR_ENDPOINT is set. The returned air_id is threaded into mergeHostedNoteBodyForCanister (new airId param) and stored in the note frontmatter forwarded to the canister. Failure is always non-blocking on the gateway (no air.required semantics at the hosted layer). Adds isNoteWriteRequest() to apply-note-provenance.mjs.
C — Configurable hard-fail mode (lib/air.mjs, lib/config.mjs) New AttestationRequiredError class exported from lib/air.mjs. When air.required=true in config, a failed endpoint call (unreachable, non-OK response, or no endpoint configured) throws instead of returning a placeholder, causing the write/export to be rejected. Default (false) is backward-compatible. lib/config.mjs adds `required` field to the air config shape and documents the full air config block in the loadConfig JSDoc.
0 comments
muse hub commit comment sha256:4504a2e605081b8fa8c63c8448231ddace1715ea78632312f2a6d3e251399adc --body "your comment"
No comments yet. Be the first to start the discussion.