Skip to content
Myr

rows.ts

This file

Path

packages/project/src/project-store/rows.ts

187 lines · 4.8 KiB · TypeScript

Last changed by

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

History of this file

Take 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–5why, one step back
1import { Ask } from "@repo/protocol/domain/ask";
2import { AgentTrailer } from "@repo/protocol/domain/credit";3import { Decision } from "@repo/protocol/domain/decision";4import { ProjectEvent } from "@repo/protocol/domain/event";5import { LandingView } from "@repo/protocol/domain/landing";

Merge build/imported-from into mainoscabrielbefore adoptionf224a14

line 6why, one step back
6import { ImportSource } from "@repo/protocol/domain/policy";

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 7–24why, one step back
7import { Proposal } from "@repo/protocol/domain/proposal";
8import { LedgerEntry } from "@repo/protocol/domain/visibility";9import {10 AreaName,11 AskId,12 CommitSha,13 EnvKey,14 Handle,15 LandedSha,16 LayerName,17 ProjectName,18 RatchetName,19 RepoName,20 RequestId,21 SuiteRoot,22} from "@repo/protocol/ids";23import { Schema } from "effect";24

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 25why, one step back
25// Lifecycle states travel as encoded JSON: the store never decodes them.

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 26–28why, one step back
26
27export const ProjectRow = Schema.Struct({28 createdAt: Schema.DateTimeUtcFromString,

Merge build/imported-from into mainoscabrielbefore adoptionf224a14

line 29why, one step back
29 importedFrom: Schema.optionalKey(ImportSource),

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 30–43why, one step back
30 initializer: Handle,
31 landed: Schema.optionalKey(LandedSha),32 policy: Schema.optionalKey(Schema.Json),33 policyAt: Schema.optionalKey(LandedSha),34 project: ProjectName,35 state: Schema.Literals(["awaitingFirstPush", "live"]),36});3738export type ProjectRow = typeof ProjectRow.Type;3940export const AskRow = Ask;4142export type AskRow = typeof AskRow.Type;43

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 44why, one step back
44/** An answer on the claim is judged by this suite, whatever the layer holds later. */

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 45–51why, one step back
45export const PinnedSuite = Schema.Struct({
46 at: CommitSha,47 suite: SuiteRoot,48});4950export type PinnedSuite = typeof PinnedSuite.Type;51

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 52why, one step back
52/** `agents` is audit metadata (`Assisted-by:`), never credit. */

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 53–63why, one step back
53export const ClaimRow = Schema.Struct({
54 ask: AskId,55 assisted: Schema.optionalKey(Schema.Array(AgentTrailer)),56 claimant: Handle,57 pinned: Schema.optionalKey(PinnedSuite),58 state: Schema.Json,59 updatedAt: Schema.DateTimeUtcFromString,60});6162export type ClaimRow = typeof ClaimRow.Type;63

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 64why, one step back
64/** Keyed by `requestId`, so a request sent twice is one row. */

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 65–105why, one step back
65export const AnswerRow = Schema.Struct({
66 answerer: Handle,67 ask: Schema.optionalKey(AskId),68 head: CommitSha,69 requestId: RequestId,70 state: Schema.Json,71 updatedAt: Schema.DateTimeUtcFromString,72});7374export type AnswerRow = typeof AnswerRow.Type;7576export const LandingRow = LandingView;7778export type LandingRow = typeof LandingRow.Type;7980export const ProposalRow = Proposal;8182export type ProposalRow = typeof ProposalRow.Type;8384export const DecisionRow = Decision;8586export type DecisionRow = typeof DecisionRow.Type;8788export const BudgetDayRow = Schema.Struct({89 day: Schema.String,90 decider: Handle,91 finishes: Schema.Int,92 used: Schema.Int,93});9495export type BudgetDayRow = typeof BudgetDayRow.Type;9697export const RatchetRow = Schema.Struct({98 at: LandedSha,99 count: Schema.Int,100 ratchet: RatchetName,101 territory: Schema.NonEmptyString,102});103104export type RatchetRow = typeof RatchetRow.Type;105

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 106why, one step back
106/** Keyed by event id: events arrive per ref and may repeat. */

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 107–127why, one step back
107export const PushEventRow = Schema.Struct({
108 after: Schema.optionalKey(CommitSha),109 at: Schema.DateTimeUtcFromString,110 before: Schema.optionalKey(CommitSha),111 eventId: Schema.NonEmptyString,112 ref: Schema.NonEmptyString,113 repo: RepoName,114});115116export type PushEventRow = typeof PushEventRow.Type;117118export const OutboxRow = Schema.Struct({119 attempts: Schema.Int,120 body: Schema.Json,121 id: Schema.NonEmptyString,122 kind: Schema.NonEmptyString,123 notBefore: Schema.DateTimeUtcFromString,124});125126export type OutboxRow = typeof OutboxRow.Type;127

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 128why, one step back
128/** The salt never leaves the project's store: no ledger entry, trailer, note or event carries 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 129–140why, one step back
129export const LayerRow = Schema.Struct({
130 admittedAt: Schema.optionalKey(Schema.DateTimeUtcFromString),131 landedSha: Schema.optionalKey(CommitSha),132 name: LayerName,133 proposed: Schema.optionalKey(CommitSha),134 repo: RepoName,135 saltRef: Schema.optionalKey(Schema.NonEmptyString),136 suiteRoot: Schema.optionalKey(SuiteRoot),137});138139export type LayerRow = typeof LayerRow.Type;140

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 141why, one step back
141/** Never a record of the person. */

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 142–155why, one step back
142export const AttemptRow = Schema.Struct({
143 area: AreaName,144 ask: AskId,145 claimant: Handle,146 count: Schema.Int,147 week: Schema.NonEmptyString,148});149150export type AttemptRow = typeof AttemptRow.Type;151152export const LedgerRow = LedgerEntry;153154export type LedgerRow = typeof LedgerRow.Type;155

Merge build/comments-project into mainoscabrielbefore adoption49efd2a

line 156why, one step back
156/** Sealed by the vault; nothing returns the value. */

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 157–187why, one step back
157export const EnvValueRow = Schema.Struct({
158 key: EnvKey,159 sealed: Schema.Json,160 setAt: Schema.DateTimeUtcFromString,161 setBy: Handle,162});163164export type EnvValueRow = typeof EnvValueRow.Type;165166export const LayerRead = Schema.Struct({167 at: Schema.DateTimeUtcFromString,168 handle: Handle,169 layer: LayerName,170 sha: Schema.optionalKey(CommitSha),171});172173export type LayerRead = typeof LayerRead.Type;174175export const LayerReadRow = Schema.Struct({176 ...LayerRead.fields,177 seq: Schema.Int,178});179180export type LayerReadRow = typeof LayerReadRow.Type;181182export const EventRow = Schema.Struct({183 event: ProjectEvent,184 seq: Schema.Int,185});186187export type EventRow = typeof EventRow.Type;