@medicine-wheel/community-review
Version:
Community-based ceremonial review protocol for Medicine Wheel — implements Wilson's validation through Elder review circles, consensus, and relational accountability
69 lines • 3.24 kB
JavaScript
"use strict";
/**
* @medicine-wheel/community-review — Zod Schemas
*
* Runtime validation schemas for community review types.
* Enforces data integrity at all boundaries.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReviewCircleSchema = exports.ReviewOutcomeSchema = exports.WilsonCheckSchema = exports.TalkingCircleEntrySchema = exports.ReviewerSchema = exports.DirectionNameSchema = exports.ReviewOutcomeTypeSchema = exports.ReviewCircleStatusSchema = exports.ArtifactTypeSchema = exports.PersonRoleSchema = void 0;
const zod_1 = require("zod");
// ── Enum Schemas ────────────────────────────────────────────────────────────
exports.PersonRoleSchema = zod_1.z.enum([
'steward', 'contributor', 'elder', 'firekeeper', 'community-member', 'youth',
]);
exports.ArtifactTypeSchema = zod_1.z.enum([
'research', 'ceremony', 'knowledge', 'code', 'narrative',
]);
exports.ReviewCircleStatusSchema = zod_1.z.enum([
'gathering', 'reviewing', 'deliberating', 'decided',
]);
exports.ReviewOutcomeTypeSchema = zod_1.z.enum([
'approved-with-blessings', 'deepen-required', 'return-to-circle',
'ceremonial-hold', 'withdrawn',
]);
exports.DirectionNameSchema = zod_1.z.enum(['east', 'south', 'west', 'north']);
// ── Composite Schemas ───────────────────────────────────────────────────────
exports.ReviewerSchema = zod_1.z.object({
id: zod_1.z.string(),
role: exports.PersonRoleSchema,
direction: exports.DirectionNameSchema.optional(),
voice: zod_1.z.string().optional(),
accountableTo: zod_1.z.array(zod_1.z.string()),
});
exports.TalkingCircleEntrySchema = zod_1.z.object({
speakerId: zod_1.z.string(),
role: exports.PersonRoleSchema,
direction: exports.DirectionNameSchema.optional(),
voice: zod_1.z.string(),
timestamp: zod_1.z.string(),
inResponseTo: zod_1.z.string().optional(),
});
exports.WilsonCheckSchema = zod_1.z.object({
respectHonored: zod_1.z.boolean(),
reciprocityPresent: zod_1.z.boolean(),
responsibilityTaken: zod_1.z.boolean(),
});
exports.ReviewOutcomeSchema = zod_1.z.object({
type: exports.ReviewOutcomeTypeSchema,
consensus: zod_1.z.boolean(),
voices: zod_1.z.array(exports.TalkingCircleEntrySchema),
wilsonCheck: exports.WilsonCheckSchema,
elderBlessing: zod_1.z.string().optional(),
conditions: zod_1.z.array(zod_1.z.string()),
nextAction: zod_1.z.string(),
});
exports.ReviewCircleSchema = zod_1.z.object({
id: zod_1.z.string(),
artifactId: zod_1.z.string(),
artifactType: exports.ArtifactTypeSchema,
reviewers: zod_1.z.array(exports.ReviewerSchema),
elderValidator: zod_1.z.string().optional(),
status: exports.ReviewCircleStatusSchema,
outcome: exports.ReviewOutcomeSchema.optional(),
talkingCircleLog: zod_1.z.array(exports.TalkingCircleEntrySchema),
wilsonAlignment: zod_1.z.number().min(0).max(1),
ocapCompliant: zod_1.z.boolean(),
createdAt: zod_1.z.string(),
});
//# sourceMappingURL=schemas.js.map