Repository navigation
feat(moduleauthority): expose module audit emission - #28
antoinetoussaint-byte merged 4 commits into
Conversation
|
@gael-obin — heads-up: I'm taking this PR to merge. obin-ai/module-record-store#115 needs moduleauthority's audit emission (#28) and declarations (#32) in an upstream commit Go can fetch; today it pins 278a7a6, which exists only on your fork. A worker will review this PR, merge main into its branch (no rebase or force-push), fix what the review finds, and post the review here. I'll merge once CI is green. If you'd rather land it yourself, or something here shouldn't go upstream, say so on this PR. |
Review of saas-sdk-go #28Reviewed head: Phase 1 was completed before implementation changes, from a full, non-shallow, non-promisor clone at the exact PR head. The original checkout and the review clone are clean after restoring the deliberate mutations below. The useful change is a thin module-authority facade: forward an original capability for live boundary attestation, emit a registered audit event with a caller-retained stable key, and recover its receipt under current authority. The new methods correctly reuse Most of the 5,118 additions are complete generated bindings, including intervening platform catalogue, organization, invitation, datasource and audit-visibility contracts. Those are not hand-written feature sprawl: buf 1.73.0 with this repository's pinned template reproduced the entire head
Audit semantics were traced into the recorded host implementation: Fail-closed review: the boundary facade accepts no caller-chosen tenant/boundary, carries the forwarded viewer token only in the request, authenticates separately as the module, rejects missing response fields, and propagates denial. The recorded host verifies the forwarded signature/current authority and live registration; consumers still must compare the returned identity with their independently verified context and enforce scopes. This contract is unavailable on current host main, per finding 1. Mutation evidence (all mutations restored): removing the emitted idempotency key makes Formatting recheck: Not verified in phase 1: a real host/database restart, concurrent database receipt reservations, or the deployed gateway; no such end-to-end result is claimed. GitHub returned no workflow runs for the reviewed SHA, and the PR is conflicting, so there was no pending run to approve yet. Next: fix findings 2–3 and resolve main's changes without rebasing. Finding 1 needs the coordinator's contract/scope decision before selecting the final generated tree; no issues, tags, releases, or merges will be created by this worker. |
Review result for saas-sdk-go #28Final reviewed head: The fork branch now contains a self-contained The boundary and receipt experiment was not carried forward: its source lacked seven messages required by current consumers, and current host main does not serve those two RPCs. They remain dependent on an integrated owner-side contract from host #1046. This PR makes the supported emission API available for a durable producer relay without inventing an SDK-side verifier or receipt store.
Reuse review: production emission uses the existing A relay must persist its complete event and stable key before sending and reuse both after a restart. The current host deduplicates by Local verification at the final head passed: Final mutation checks all failed as intended and were restored: dropping the idempotency key broke request/restart/refresh assertions; retrying Hosted CI passed at the final head: run 38092844274, with both Not verified: a live host/database restart, a deployed gateway, or end-to-end webhook delivery. SDK fakes prove transport behavior, not host database durability. This worker created no tag, release, issue, or PR merge. The fork was updated by an ordinary push; main was merged, never rebased or force-pushed. During the final handoff, after this worker marked the green PR ready and posted this result, GitHub reported #28 merged by PR #32 is still open at |
|
Merged at 7fe05b8 (reviewed head 1b0fbc3, CI green). The scope was narrowed to the |
|
lazybox has finished working on this. claim detail |
Expose
moduleauthority.Client.EmitAuditEvent(ctx, AuditEvent)through the existing authenticated module-authority transport. A producer can persist its complete event and stable idempotency key, emit it, and settle its outbox only after the host acknowledges it. The SDK preserves fields, credentials and host error codes; it refreshes rejected authentication once and never automatically retries an uncertain effect.The current host deduplicates by
(tenant, event_type, idempotency_key)without comparing payloads. Callers must never reuse a key for another intent. A successful call acknowledges the audit write or an existing key, not webhook delivery. Receipt lookup and runtime-boundary verification are deferred to an integrated host contract from codefly-dev/module-saas-starter#1046; this PR preserves all artifact, installation and delegation APIs already on main.gen/andSOURCE.txtmatch main exactly and reproduce from its recorded source; no generated file was hand-edited.Classification: fixes at the SDK owner. The audit facade reuses
callAsModuleand generated bindings,golang.org/x/toolsis updated so the API boundary gate can read Go 1.27.2 export data, and generic release ownership replaces downstream product references. Consumer behavior and recovery limits are documented inREADME.mdandCHANGELOG.md; gate and regeneration guidance is updated inAGENTS.mdand.claude/skills/refresh-generated-api/SKILL.md.Maintainer-side review and fixes were done by Antoine's coordinator worker.
Validation: local build, vet, test, race, formatting, public API boundary and agent-context checks; byte-for-byte generation with buf 1.73.0; boundary gate also checked with Go 1.27.0. Deliberately dropping the idempotency key, stripping module authentication, or retrying unavailable effects makes audit regression tests fail; every mutation was restored. Tests cover exact request transport, preservation across client recreation, one authentication refresh, permission refusal, missing authority and uncertain effect errors.
The SDK tests do not establish host database restart safety or deployed gateway wiring. Those guarantees belong to the host transaction and the producer's durable outbox. No live hosted deployment, release, or tag was exercised.
Review: #28 (comment)
Main was merged without rebasing or force-pushing. PR #32 owns audit declarations and gateway transport and remains open at handoff. Both hosted checks (
testandgen-drift) passed at1b0fbc32fb763a9a383cd703c7323084f5e35d9f: https://github.com/codefly-dev/saas-sdk-go/actions/runs/38092844274. GitHub subsequently reported #28 merged byantoinetoussaint-byteas7fe05b85970956d74fa3b7122ac1874d30a37f7d; this worker did not issue a merge command. PR #32 must now integrate the new main.Review result: #28 (comment)