feat minor air feat/phase-2g-bundle
AI Agent git-import/068377df · 114 days ago · Apr 3, 2026 · Diff

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.

sha256:4504a2e605081b8fa8c63c8448231ddace1715ea78632312f2a6d3e251399adc sha
sha256:c63cbed91d1c349ef799eaada81993fa8898060727b57bd466428d0c98c110a4 snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:4504a2e605081b8fa8c63c8448231ddace1715ea78632312f2a6d3e251399adc --body "your comment"