kind.ts
This file
Path
packages/protocol/src/domain/kind.ts
51 lines · 1.2 KiB · TypeScript
Last changed by
Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–44why, one step back1import { Schema } from "effect";23import { Handle, KindName } from "../ids.ts";4import { Strength } from "./check.ts";5import { AtLeastOne, NoneOrMore } from "./common.ts";67export const BriefField = Schema.Literals([8 "want",9 "current",10 "check",11 "territory",12 "outOfScope",13 "terms",14 "context",15]);1617export type BriefField = typeof BriefField.Type;1819export const CheckKind = Schema.Literals([20 "redThenGreen",21 "lintToZero",22 "ratchet",23 "migrate",24 "symbolAbsent",25]);2627export type CheckKind = typeof CheckKind.Type;2829export const ClaimRule = Schema.Union([30 Schema.Literals(["vouched", "anyone"]),31 Schema.Struct({32 record: Schema.Struct({ area: Schema.NonEmptyString, atLeast: NoneOrMore }),33 }),34 Schema.Struct({ newcomer: Schema.Struct({ mentor: Handle }) }),35]);3637export type ClaimRule = typeof ClaimRule.Type;3839export const AskKind = Schema.Struct({40 checkKind: CheckKind,41 claimers: ClaimRule,42 finish: Schema.Literals(["never", "optional", "required"]),43 name: KindName,44 oneWay: Schema.Boolean,Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
line 45why, one step back45 /** How many claims an ask takes at once; 1 is exclusive. */Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 46–51why, one step back46 race: AtLeastOne,47 requires: Schema.Array(BriefField),48 strength: Strength,49});5051export type AskKind = typeof AskKind.Type;