Initial v1 code layout
The destination of the wayfinder map: directory and module structure, the domain model as real schema files, permission boundaries expressed as code, and typed seams where the undecided parts land. Satisfies the four structural requirements earlier resolutions handed to a layout that did not exist: - a single database entry point (#11) — the pool is not exported - a scheduler entry point with actor context and no request (#13) - an entitlement assertion helper (#20, #34) — its call sites are the paid-feature list - an enumerated list of privileged RLS bypasses (#33) — three of them Seams carry real types and throw with the ticket that owns them, so the skeleton wires up and fails only where a decision is genuinely missing. Verified: tsc --noEmit clean; drizzle-kit generate produces RLS on 18 tables and 6 policies calling the release-level functions. Resolves #35 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
31
src/audit/index.ts
Normal file
31
src/audit/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Seam } from '../seam.js'
|
||||
|
||||
/**
|
||||
* Audit trail and evidentiary record. SEAM — owned by #21.
|
||||
*
|
||||
* Four consecutive resolutions have handed protest surface here, and the
|
||||
* inputs are already fixed even though the retention and query design is not:
|
||||
*
|
||||
* #14 the release matrix must be VERSIONED, and release_level's inputs
|
||||
* reconstructable, or a past release cannot be explained. export_event.
|
||||
* #15 score commits, rubric amendments with their voided-score set,
|
||||
* gate results, and model_version per suggestion.
|
||||
* #16 confirmation events with a confirmer per requirement,
|
||||
* "not an obligation" dismissals with their author, amendment
|
||||
* classification, and vendor omission reports WITH whether they were
|
||||
* acted on — the strongest protest artifact on the map.
|
||||
* #12 the invited set at issue, and the stage timeline.
|
||||
*/
|
||||
export interface AuditWriter {
|
||||
recordScoreCommit(e: { responseId: string; criterionId: string; by: string }): Promise<void>
|
||||
recordRubricAmendment(e: { solicitationId: string; voided: string[]; by: string }): Promise<void>
|
||||
recordSweepDismissal(e: { findingId: string; by: string }): Promise<void>
|
||||
recordExport(e: { orgId: string; classes: string[]; rowCount: number }): Promise<void>
|
||||
}
|
||||
|
||||
export const auditWriter: AuditWriter = {
|
||||
async recordScoreCommit() { throw new Seam('#21', 'the audit trail') },
|
||||
async recordRubricAmendment() { throw new Seam('#21', 'the audit trail') },
|
||||
async recordSweepDismissal() { throw new Seam('#21', 'the audit trail') },
|
||||
async recordExport() { throw new Seam('#21', 'the audit trail') },
|
||||
}
|
||||
Reference in New Issue
Block a user