@boxxy/model 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/dist/closeouts/build-close-out-schema.d.ts +31 -0
- package/dist/closeouts/close-out-answer-schema.d.ts +3 -0
- package/dist/closeouts/close-out-schema.d.ts +3 -0
- package/dist/closeouts/design-close-out-schema.d.ts +30 -0
- package/dist/closeouts/friction-schema.d.ts +14 -0
- package/dist/closeouts/open-item-schema.d.ts +3 -0
- package/dist/closeouts/review-close-out-schema.d.ts +40 -0
- package/dist/closeouts/triage-close-out-schema.d.ts +40 -0
- package/dist/closeouts/types.d.ts +221 -0
- package/dist/dispatch/build-applied-change.d.ts +6 -0
- package/dist/dispatch/collect-seat-sync.d.ts +14 -0
- package/dist/dispatch/pick-seat-take.d.ts +10 -0
- package/dist/dispatch/types.d.ts +11 -0
- package/dist/facts/outbox-fact-schema.d.ts +3 -0
- package/dist/facts/parse-new-fact.d.ts +2 -0
- package/dist/facts/types.d.ts +191 -0
- package/dist/facts/work-fact-schemas.d.ts +293 -0
- package/dist/index.d.ts +64 -16
- package/dist/items/build-item-views.d.ts +4 -0
- package/dist/items/collect-retries.d.ts +3 -0
- package/dist/items/collect-settled.d.ts +3 -0
- package/dist/items/derive-item-state.d.ts +17 -0
- package/dist/{live-levers.d.ts → items/live-levers.d.ts} +1 -1
- package/dist/items/types.d.ts +12 -0
- package/dist/pipeline/advance.d.ts +10 -0
- package/dist/pipeline/constants.d.ts +2 -0
- package/dist/pipeline/count-trailing.d.ts +1 -0
- package/dist/pipeline/find-position.d.ts +9 -0
- package/dist/pipeline/find-step.d.ts +3 -0
- package/dist/pipeline/merge-by-time.d.ts +9 -0
- package/dist/pipeline/position-schema.d.ts +3 -0
- package/dist/pipeline/types.d.ts +28 -0
- package/dist/planning/define-admission.d.ts +3 -0
- package/dist/planning/define-gate.d.ts +3 -0
- package/dist/planning/define-signal.d.ts +3 -0
- package/dist/planning/is-filter-match.d.ts +3 -0
- package/dist/planning/limit-fill-schema.d.ts +3 -0
- package/dist/{signal-key.d.ts → planning/signal-key.d.ts} +1 -1
- package/dist/planning/types.d.ts +155 -0
- package/dist/ports/types.d.ts +289 -0
- package/dist/reports/constants.d.ts +3 -0
- package/dist/reports/cost-to-land-schema.d.ts +29 -0
- package/dist/reports/outbox-status.d.ts +16 -0
- package/dist/reports/stage-time-schema.d.ts +25 -0
- package/dist/reports/types.d.ts +5 -0
- package/dist/rows/actor-ref-schema.d.ts +2 -0
- package/dist/rows/attempt-row-schema.d.ts +3 -0
- package/dist/rows/attempt-session-row-schema.d.ts +3 -0
- package/dist/{brand-schemas.d.ts → rows/brand-schemas.d.ts} +5 -2
- package/dist/rows/caller-identity-schema.d.ts +3 -0
- package/dist/rows/criterion-schema.d.ts +3 -0
- package/dist/rows/decision-row-schema.d.ts +34 -0
- package/dist/rows/evidence-row-schema.d.ts +3 -0
- package/dist/rows/item-row-schema.d.ts +28 -0
- package/dist/rows/item-view-schema.d.ts +3 -0
- package/dist/rows/lease-row-schema.d.ts +3 -0
- package/dist/rows/lever-row-schema.d.ts +12 -0
- package/dist/rows/limit-schema.d.ts +3 -0
- package/dist/rows/limit-seat-row-schema.d.ts +3 -0
- package/dist/rows/note-row-schema.d.ts +3 -0
- package/dist/rows/notice-row-schema.d.ts +3 -0
- package/dist/rows/pull-request-row-schema.d.ts +3 -0
- package/dist/rows/relation-row-schema.d.ts +3 -0
- package/dist/rows/row-schemas.d.ts +5 -0
- package/dist/rows/runner-row-schema.d.ts +3 -0
- package/dist/rows/spawn-request-schema.d.ts +3 -0
- package/dist/rules/define-phase.d.ts +3 -0
- package/dist/rules/load-rejection-schema.d.ts +3 -0
- package/dist/rules/types.d.ts +244 -0
- package/dist/test-utils/build-mock-cost-to-land.d.ts +2 -0
- package/dist/test-utils/build-mock-evidence-row.d.ts +2 -0
- package/dist/test-utils/build-mock-fact-id.d.ts +2 -0
- package/dist/test-utils/build-mock-frame-item.d.ts +2 -0
- package/dist/test-utils/build-mock-frame.d.ts +2 -0
- package/dist/test-utils/build-mock-item-rules.d.ts +2 -0
- package/dist/test-utils/build-mock-lease-row.d.ts +1 -1
- package/dist/test-utils/build-mock-outbox-fact.d.ts +2 -0
- package/dist/test-utils/build-mock-phase-kind.d.ts +7 -0
- package/dist/test-utils/build-mock-pipeline.d.ts +7 -0
- package/dist/test-utils/build-mock-relation-row.d.ts +2 -0
- package/dist/test-utils/build-mock-settled.d.ts +9 -0
- package/dist/test-utils/build-mock-snapshot.d.ts +2 -0
- package/dist/test-utils/build-mock-v1-attempt-row.d.ts +2 -0
- package/dist/test-utils/build-mock-v1-item-row.d.ts +2 -0
- package/dist/test-utils/build-mock-v1-item-view.d.ts +2 -0
- package/dist/test-utils/build-mock-v1-lever-row.d.ts +2 -0
- package/dist/test-utils/build-mock-v1-pull-request-row.d.ts +2 -0
- package/dist/test-utils/build-mock-work-fact.d.ts +12 -0
- package/dist/test-utils/create-fake-notifier.d.ts +9 -0
- package/dist/test-utils/create-fake-pepys-reader.d.ts +13 -0
- package/dist/test-utils/fact-sink-contract.d.ts +14 -0
- package/dist/test-utils/pepys-reader-contract.d.ts +17 -0
- package/dist/{types/core.d.ts → types.d.ts} +94 -36
- package/dist/utils/format-key-path.d.ts +1 -0
- package/dist/utils/to-json-value.d.ts +2 -0
- package/package.json +14 -3
- package/src/{build-close-out-schema.ts → closeouts/build-close-out-schema.ts} +5 -10
- package/src/closeouts/close-out-answer-schema.ts +42 -0
- package/src/closeouts/close-out-schema.ts +13 -0
- package/src/closeouts/design-close-out-schema.ts +20 -0
- package/src/closeouts/friction-schema.ts +11 -0
- package/src/closeouts/open-item-schema.ts +8 -0
- package/src/closeouts/review-close-out-schema.ts +38 -0
- package/src/closeouts/triage-close-out-schema.ts +29 -0
- package/src/closeouts/types.ts +230 -0
- package/src/dispatch/build-applied-change.ts +57 -0
- package/src/dispatch/collect-seat-sync.ts +86 -0
- package/src/dispatch/pick-seat-take.ts +39 -0
- package/src/dispatch/types.ts +14 -0
- package/src/facts/outbox-fact-schema.ts +22 -0
- package/src/facts/parse-new-fact.ts +16 -0
- package/src/facts/types.ts +235 -0
- package/src/facts/work-fact-schemas.ts +201 -0
- package/src/index.ts +147 -41
- package/src/items/build-item-views.ts +146 -0
- package/src/items/collect-retries.ts +12 -0
- package/src/items/collect-settled.ts +20 -0
- package/src/items/derive-item-state.ts +95 -0
- package/src/{live-levers.ts → items/live-levers.ts} +1 -1
- package/src/items/types.ts +26 -0
- package/src/pipeline/advance.ts +78 -0
- package/src/pipeline/constants.ts +12 -0
- package/src/pipeline/count-trailing.ts +16 -0
- package/src/pipeline/find-position.ts +74 -0
- package/src/pipeline/find-step.ts +6 -0
- package/src/pipeline/merge-by-time.ts +33 -0
- package/src/pipeline/position-schema.ts +27 -0
- package/src/pipeline/types.ts +47 -0
- package/src/{define-admission.ts → planning/define-admission.ts} +2 -2
- package/src/{define-gate.ts → planning/define-gate.ts} +2 -2
- package/src/{define-signal.ts → planning/define-signal.ts} +2 -2
- package/src/planning/is-filter-match.ts +10 -0
- package/src/planning/limit-fill-schema.ts +12 -0
- package/src/{signal-key.ts → planning/signal-key.ts} +1 -1
- package/src/planning/types.ts +216 -0
- package/src/ports/types.ts +412 -0
- package/src/reports/constants.ts +6 -0
- package/src/reports/cost-to-land-schema.ts +47 -0
- package/src/reports/outbox-status.ts +22 -0
- package/src/reports/stage-time-schema.ts +21 -0
- package/src/reports/types.ts +7 -0
- package/src/rows/actor-ref-schema.ts +17 -0
- package/src/rows/attempt-row-schema.ts +69 -0
- package/src/rows/attempt-session-row-schema.ts +12 -0
- package/src/{brand-schemas.ts → rows/brand-schemas.ts} +5 -2
- package/src/rows/caller-identity-schema.ts +7 -0
- package/src/rows/criterion-schema.ts +9 -0
- package/src/rows/decision-row-schema.ts +34 -0
- package/src/rows/evidence-row-schema.ts +13 -0
- package/src/rows/item-row-schema.ts +32 -0
- package/src/rows/item-view-schema.ts +31 -0
- package/src/rows/lease-row-schema.ts +12 -0
- package/src/rows/lever-row-schema.ts +17 -0
- package/src/rows/limit-schema.ts +12 -0
- package/src/rows/limit-seat-row-schema.ts +12 -0
- package/src/rows/note-row-schema.ts +12 -0
- package/src/rows/notice-row-schema.ts +17 -0
- package/src/rows/pull-request-row-schema.ts +15 -0
- package/src/rows/relation-row-schema.ts +13 -0
- package/src/rows/row-schemas.ts +30 -0
- package/src/rows/runner-row-schema.ts +9 -0
- package/src/rows/spawn-request-schema.ts +15 -0
- package/src/rules/define-phase.ts +12 -0
- package/src/rules/load-rejection-schema.ts +51 -0
- package/src/rules/types.ts +291 -0
- package/src/test-utils/build-mock-cost-to-land.ts +31 -0
- package/src/test-utils/build-mock-evidence-row.ts +17 -0
- package/src/test-utils/build-mock-fact-id.ts +7 -0
- package/src/test-utils/build-mock-frame-item.ts +14 -0
- package/src/test-utils/build-mock-frame.ts +13 -0
- package/src/test-utils/build-mock-item-rules.ts +17 -0
- package/src/test-utils/build-mock-lease-row.ts +2 -2
- package/src/test-utils/build-mock-outbox-fact.ts +22 -0
- package/src/test-utils/build-mock-phase-kind.ts +29 -0
- package/src/test-utils/build-mock-pipeline.ts +52 -0
- package/src/test-utils/{build-mock-link-row.ts → build-mock-relation-row.ts} +4 -4
- package/src/test-utils/build-mock-settled.ts +18 -0
- package/src/test-utils/build-mock-snapshot.ts +13 -0
- package/src/test-utils/{build-mock-attempt-row.ts → build-mock-v1-attempt-row.ts} +28 -9
- package/src/test-utils/{build-mock-item-row.ts → build-mock-v1-item-row.ts} +7 -3
- package/src/test-utils/build-mock-v1-item-view.ts +29 -0
- package/src/test-utils/{build-mock-lever-row.ts → build-mock-v1-lever-row.ts} +5 -3
- package/src/test-utils/build-mock-v1-pull-request-row.ts +26 -0
- package/src/test-utils/build-mock-work-fact.ts +179 -0
- package/src/test-utils/create-fake-notifier.ts +54 -0
- package/src/test-utils/create-fake-pepys-reader.ts +73 -0
- package/src/test-utils/fact-sink-contract.ts +103 -0
- package/src/test-utils/pepys-reader-contract.ts +117 -0
- package/src/{types/core.ts → types.ts} +184 -48
- package/src/utils/format-key-path.ts +19 -0
- package/src/utils/to-json-value.ts +25 -0
- package/dist/build-close-out-schema.d.ts +0 -3
- package/dist/define-admission.d.ts +0 -3
- package/dist/define-gate.d.ts +0 -3
- package/dist/define-signal.d.ts +0 -3
- package/dist/derive-item-state.d.ts +0 -2
- package/dist/fact-schemas.d.ts +0 -5
- package/dist/friction-schema.d.ts +0 -3
- package/dist/test-utils/build-mock-attempt-row.d.ts +0 -2
- package/dist/test-utils/build-mock-item-row.d.ts +0 -2
- package/dist/test-utils/build-mock-item-rows.d.ts +0 -2
- package/dist/test-utils/build-mock-lever-row.d.ts +0 -2
- package/dist/test-utils/build-mock-link-row.d.ts +0 -2
- package/dist/test-utils/build-mock-pull-request-row.d.ts +0 -2
- package/dist/types/dispatch.d.ts +0 -82
- package/dist/types/facts.d.ts +0 -154
- package/dist/types/planning.d.ts +0 -94
- package/dist/types/ports.d.ts +0 -218
- package/dist/types/registries.d.ts +0 -150
- package/src/derive-item-state.ts +0 -76
- package/src/fact-schemas.ts +0 -138
- package/src/friction-schema.ts +0 -10
- package/src/test-utils/build-mock-item-rows.ts +0 -14
- package/src/test-utils/build-mock-pull-request-row.ts +0 -16
- package/src/types/dispatch.ts +0 -95
- package/src/types/facts.ts +0 -166
- package/src/types/planning.ts +0 -136
- package/src/types/ports.ts +0 -262
- package/src/types/registries.ts +0 -185
- /package/dist/test-utils/{seed-faker.d.ts → pin-faker-seed.d.ts} +0 -0
- /package/src/test-utils/{seed-faker.ts → pin-faker-seed.ts} +0 -0
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from '@boxxy/content-hash';
|
|
2
|
-
import type { z } from 'zod';
|
|
3
|
-
import type { ConceptPin, ItemKindName, LeverKind, LoadedRecipe, MaxAttemptsByKind, PhaseName, PipelineName, RecipeName, RulesVersion } from './core.ts';
|
|
4
|
-
import type { Admission, FrameItem, Gate, Pool, PropagationLine, Signal, SignalKey, SignalName, View, Waiver } from './planning.ts';
|
|
5
|
-
export type Schema<T> = z.ZodType<T>;
|
|
6
|
-
export interface ParamKinds<P> {
|
|
7
|
-
signal: Signal<P>;
|
|
8
|
-
gate: Gate<P>;
|
|
9
|
-
admission: Admission<P>;
|
|
10
|
-
}
|
|
11
|
-
export type ParamKindName = keyof ParamKinds<unknown>;
|
|
12
|
-
export interface Registered<K extends ParamKindName> {
|
|
13
|
-
readonly kind: K;
|
|
14
|
-
readonly name: string;
|
|
15
|
-
open: <R>(use: <P>(plugin: ParamKinds<P>[K]) => R) => R;
|
|
16
|
-
}
|
|
17
|
-
export interface Resolved<K extends ParamKindName> {
|
|
18
|
-
readonly kind: K;
|
|
19
|
-
readonly name: string;
|
|
20
|
-
readonly key: string;
|
|
21
|
-
open: <R>(use: <P>(plugin: ParamKinds<P>[K], params: P) => R) => R;
|
|
22
|
-
}
|
|
23
|
-
export type ConceptName = string;
|
|
24
|
-
export interface Concept {
|
|
25
|
-
name: ConceptName;
|
|
26
|
-
version: number;
|
|
27
|
-
signals?: Registered<'signal'>[];
|
|
28
|
-
gates?: Registered<'gate'>[];
|
|
29
|
-
waivers?: Waiver[];
|
|
30
|
-
levers?: LeverKind[];
|
|
31
|
-
filterFields?: FilterField[];
|
|
32
|
-
}
|
|
33
|
-
export interface FilterField {
|
|
34
|
-
name: string;
|
|
35
|
-
value: (item: FrameItem) => string | readonly string[] | null;
|
|
36
|
-
}
|
|
37
|
-
export interface PlainKinds {
|
|
38
|
-
waiver: Waiver;
|
|
39
|
-
'filter-field': FilterField;
|
|
40
|
-
lever: {
|
|
41
|
-
readonly kind: LeverKind;
|
|
42
|
-
};
|
|
43
|
-
view: View;
|
|
44
|
-
}
|
|
45
|
-
export type PluginKindName = ParamKindName | keyof PlainKinds;
|
|
46
|
-
export type Registry = {
|
|
47
|
-
readonly [K in ParamKindName]: ReadonlyMap<string, Registered<K>>;
|
|
48
|
-
} & {
|
|
49
|
-
readonly [K in keyof PlainKinds]: ReadonlyMap<string, PlainKinds[K]>;
|
|
50
|
-
} & {
|
|
51
|
-
readonly pins: readonly ConceptPin[];
|
|
52
|
-
};
|
|
53
|
-
export interface KindRules {
|
|
54
|
-
readonly pipeline: Pipeline;
|
|
55
|
-
readonly recipes: Readonly<Record<PhaseName, RecipeName>>;
|
|
56
|
-
}
|
|
57
|
-
export interface Pipeline {
|
|
58
|
-
readonly name: PipelineName;
|
|
59
|
-
readonly steps: readonly PipelineStep[];
|
|
60
|
-
}
|
|
61
|
-
export interface PipelineStep {
|
|
62
|
-
readonly phase: PhaseName;
|
|
63
|
-
readonly maxAttempts: number;
|
|
64
|
-
}
|
|
65
|
-
export type ConceptEntry = `${string}@${number}`;
|
|
66
|
-
export type PluginRef = string | Readonly<Record<string, JsonValue>>;
|
|
67
|
-
export type SignalRef = SignalName | Readonly<Record<string, JsonValue>>;
|
|
68
|
-
export interface RulesFile {
|
|
69
|
-
readonly version: 1;
|
|
70
|
-
readonly concepts: readonly ConceptEntry[];
|
|
71
|
-
readonly kinds: Readonly<Record<string, {
|
|
72
|
-
readonly pipeline: readonly string[] | PipelineName;
|
|
73
|
-
readonly maxAttempts: Readonly<Record<string, number>>;
|
|
74
|
-
readonly recipes: Readonly<Record<string, string>>;
|
|
75
|
-
}>>;
|
|
76
|
-
readonly pools: readonly {
|
|
77
|
-
readonly name: string;
|
|
78
|
-
readonly slots: number;
|
|
79
|
-
readonly takes: Readonly<Record<string, JsonValue>>;
|
|
80
|
-
readonly order: readonly SignalRef[];
|
|
81
|
-
}[];
|
|
82
|
-
readonly lead: readonly SignalRef[];
|
|
83
|
-
readonly propagation: readonly {
|
|
84
|
-
readonly value: string;
|
|
85
|
-
readonly over: string;
|
|
86
|
-
readonly toward: 'source' | 'target';
|
|
87
|
-
}[];
|
|
88
|
-
readonly recipes: Readonly<Record<string, {
|
|
89
|
-
readonly agent: string;
|
|
90
|
-
readonly model: string;
|
|
91
|
-
readonly effort: string;
|
|
92
|
-
readonly prompt: string;
|
|
93
|
-
readonly source: string;
|
|
94
|
-
}>>;
|
|
95
|
-
}
|
|
96
|
-
export interface LoadedRules {
|
|
97
|
-
readonly version: RulesVersion;
|
|
98
|
-
readonly commit: string;
|
|
99
|
-
readonly registry: Registry;
|
|
100
|
-
readonly signals: ReadonlyMap<SignalKey, Resolved<'signal'>>;
|
|
101
|
-
readonly gates: readonly Resolved<'gate'>[];
|
|
102
|
-
readonly kinds: ReadonlyMap<ItemKindName, KindRules>;
|
|
103
|
-
readonly maxAttemptsByKind: MaxAttemptsByKind;
|
|
104
|
-
readonly pools: readonly Pool[];
|
|
105
|
-
readonly propagation: readonly PropagationLine[];
|
|
106
|
-
readonly recipes: ReadonlyMap<RecipeName, LoadedRecipe>;
|
|
107
|
-
}
|
|
108
|
-
export interface LoadRejection {
|
|
109
|
-
readonly file: string;
|
|
110
|
-
readonly path: string;
|
|
111
|
-
readonly reason: LoadRejectionReason;
|
|
112
|
-
}
|
|
113
|
-
export type LoadRejectionReason = {
|
|
114
|
-
readonly kind: 'invalid';
|
|
115
|
-
readonly message: string;
|
|
116
|
-
} | {
|
|
117
|
-
readonly kind: 'unknown-concept';
|
|
118
|
-
readonly ref: string;
|
|
119
|
-
} | {
|
|
120
|
-
readonly kind: 'unknown-signal';
|
|
121
|
-
readonly signal: string;
|
|
122
|
-
} | {
|
|
123
|
-
readonly kind: 'bad-plugin-params';
|
|
124
|
-
readonly pluginKind: ParamKindName;
|
|
125
|
-
readonly name: string;
|
|
126
|
-
readonly message: string;
|
|
127
|
-
} | {
|
|
128
|
-
readonly kind: 'unknown-link-type';
|
|
129
|
-
readonly link: string;
|
|
130
|
-
} | {
|
|
131
|
-
readonly kind: 'signal-without-combine';
|
|
132
|
-
readonly signal: string;
|
|
133
|
-
} | {
|
|
134
|
-
readonly kind: 'missing-recipe';
|
|
135
|
-
readonly itemKind: string;
|
|
136
|
-
readonly phase: string;
|
|
137
|
-
} | {
|
|
138
|
-
readonly kind: 'missing-prompt';
|
|
139
|
-
readonly path: string;
|
|
140
|
-
} | {
|
|
141
|
-
readonly kind: 'uncommitted-changes';
|
|
142
|
-
};
|
|
143
|
-
export type LoadResult = {
|
|
144
|
-
readonly kind: 'loaded';
|
|
145
|
-
readonly rules: LoadedRules;
|
|
146
|
-
readonly warnings: readonly string[];
|
|
147
|
-
} | {
|
|
148
|
-
readonly kind: 'rejected';
|
|
149
|
-
readonly rejections: readonly LoadRejection[];
|
|
150
|
-
};
|
package/src/derive-item-state.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { AttemptRow, DerivedState, ItemRow, ItemRows } from './types/core.ts';
|
|
2
|
-
|
|
3
|
-
interface StateInput {
|
|
4
|
-
readonly item: ItemRow;
|
|
5
|
-
readonly rows: ItemRows;
|
|
6
|
-
|
|
7
|
-
// the succeeded and failed attempts that ended after the item's latest `item.retry` lever
|
|
8
|
-
readonly counted: readonly AttemptRow[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface StateRule {
|
|
12
|
-
readonly derived: DerivedState;
|
|
13
|
-
readonly holds: (input: StateInput) => boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const stateRules: readonly StateRule[] = [
|
|
17
|
-
{ derived: { state: 'archived' }, holds: (input) => input.item.closedAt !== null },
|
|
18
|
-
{ derived: { state: 'done' }, holds: (input) => hasMergedPullRequest(input.rows) },
|
|
19
|
-
{ derived: { state: 'running' }, holds: (input) => input.rows.liveLease !== null },
|
|
20
|
-
{ derived: { state: 'waiting', reason: 'PR open' }, holds: hasOpenPullRequest },
|
|
21
|
-
{ derived: { state: 'waiting', reason: 'no PR linked' }, holds: hasSucceededWithoutPullRequest },
|
|
22
|
-
{ derived: { state: 'waiting', reason: 'attempts used up' }, holds: hasUsedUpAttempts },
|
|
23
|
-
{ derived: { state: 'idea' }, holds: (input) => input.item.acceptance.length === 0 },
|
|
24
|
-
{ derived: { state: 'blocked' }, holds: (input) => hasOpenBlocker(input.rows) },
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
export function deriveItemState(item: ItemRow, rows: ItemRows): DerivedState {
|
|
28
|
-
const input = { item, rows, counted: collectCountedAttempts(rows) };
|
|
29
|
-
|
|
30
|
-
return stateRules.find((rule) => rule.holds(input))?.derived ?? { state: 'ready' };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function collectCountedAttempts(rows: ItemRows): AttemptRow[] {
|
|
34
|
-
const retryAt = Math.max(
|
|
35
|
-
Number.NEGATIVE_INFINITY,
|
|
36
|
-
...rows.levers.filter((lever) => lever.kind === 'item.retry').map((lever) => lever.at),
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return rows.attempts.filter((attempt) => attempt.endedAt !== null && attempt.endedAt > retryAt);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function hasMergedPullRequest(rows: ItemRows): boolean {
|
|
43
|
-
const succeeded = new Set(collectSucceeded(rows.attempts).map((attempt) => attempt.id));
|
|
44
|
-
|
|
45
|
-
return rows.pullRequests.some((pr) => pr.state === 'merged' && succeeded.has(pr.attempt));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function collectSucceeded(attempts: readonly AttemptRow[]): AttemptRow[] {
|
|
49
|
-
return attempts.filter((attempt) => attempt.state === 'succeeded');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function hasOpenPullRequest(input: StateInput): boolean {
|
|
53
|
-
const succeeded = new Set(collectSucceeded(input.counted).map((attempt) => attempt.id));
|
|
54
|
-
|
|
55
|
-
return input.rows.pullRequests.some((pr) => pr.state === 'open' && succeeded.has(pr.attempt));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function hasSucceededWithoutPullRequest(input: StateInput): boolean {
|
|
59
|
-
const linked = new Set(input.rows.pullRequests.map((pr) => pr.attempt));
|
|
60
|
-
|
|
61
|
-
return collectSucceeded(input.counted).some((attempt) => !linked.has(attempt.id));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function hasUsedUpAttempts(input: StateInput): boolean {
|
|
65
|
-
const failed = input.counted.filter((attempt) => attempt.state === 'failed');
|
|
66
|
-
|
|
67
|
-
return failed.length >= input.rows.maxAttempts;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function hasOpenBlocker(rows: ItemRows): boolean {
|
|
71
|
-
return rows.links.some((link) => {
|
|
72
|
-
const blockerState = rows.blockerStates.get(link.source);
|
|
73
|
-
|
|
74
|
-
return link.type === 'blocks' && blockerState !== 'done' && blockerState !== 'archived';
|
|
75
|
-
});
|
|
76
|
-
}
|
package/src/fact-schemas.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { brandSchemas } from './brand-schemas.ts';
|
|
3
|
-
import { buildCloseOutSchema } from './build-close-out-schema.ts';
|
|
4
|
-
import { frictionSchema } from './friction-schema.ts';
|
|
5
|
-
import type { FactType, SliceOneFacts } from './types/facts.ts';
|
|
6
|
-
|
|
7
|
-
const actorRefSchema = z.union([
|
|
8
|
-
z.literal('boxxy:owner:local'),
|
|
9
|
-
z.templateLiteral(['boxxy:runner:', brandSchemas.runnerId]),
|
|
10
|
-
z.templateLiteral(['boxxy:attempt:', brandSchemas.attemptId]),
|
|
11
|
-
z.templateLiteral(['boxxy:hook:', brandSchemas.attemptId]),
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
|
-
const criterionSchema = z.object({
|
|
15
|
-
id: brandSchemas.criterionId,
|
|
16
|
-
text: z.string().min(1),
|
|
17
|
-
evidence: z.array(brandSchemas.factId),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const linkPayloadSchema = z.object({
|
|
21
|
-
source: brandSchemas.itemId,
|
|
22
|
-
target: brandSchemas.itemId,
|
|
23
|
-
type: brandSchemas.linkTypeName,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const faultSchema = z.object({
|
|
27
|
-
plugin: z.string().min(1),
|
|
28
|
-
kind: z.enum(['signal', 'gate', 'waiver', 'admission', 'propagation']),
|
|
29
|
-
item: brandSchemas.itemId.nullable(),
|
|
30
|
-
error: z.string(),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const copiedEvidenceSchema = z.object({
|
|
34
|
-
criterion: brandSchemas.criterionId,
|
|
35
|
-
evidence: z.array(brandSchemas.factId),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const pullRequestNumberSchema = z.number().int().positive();
|
|
39
|
-
|
|
40
|
-
export const factSchemas: { readonly [T in FactType]: z.ZodType<SliceOneFacts[T]> } = {
|
|
41
|
-
'boxxy.item.filed': z.object({
|
|
42
|
-
id: brandSchemas.itemId,
|
|
43
|
-
kind: brandSchemas.itemKindName,
|
|
44
|
-
repo: brandSchemas.repoName,
|
|
45
|
-
title: z.string().min(1),
|
|
46
|
-
outcome: z.string().min(1),
|
|
47
|
-
acceptance: z.array(criterionSchema),
|
|
48
|
-
foundInAttempt: brandSchemas.attemptId.nullable(),
|
|
49
|
-
filedBy: actorRefSchema,
|
|
50
|
-
filedAt: brandSchemas.instant,
|
|
51
|
-
closedAt: brandSchemas.instant.nullable(),
|
|
52
|
-
closeReason: z.string().nullable(),
|
|
53
|
-
}),
|
|
54
|
-
'boxxy.item.edited': z
|
|
55
|
-
.object({
|
|
56
|
-
title: z.string().min(1).exactOptional(),
|
|
57
|
-
outcome: z.string().min(1).exactOptional(),
|
|
58
|
-
acceptance: z.array(criterionSchema).exactOptional(),
|
|
59
|
-
})
|
|
60
|
-
.refine((fields) => Object.keys(fields).length > 0, 'an edit changes at least one field'),
|
|
61
|
-
'boxxy.item.closed': z.object({ reason: z.string().min(1) }),
|
|
62
|
-
'boxxy.link.added': linkPayloadSchema,
|
|
63
|
-
'boxxy.link.removed': linkPayloadSchema,
|
|
64
|
-
'boxxy.lever.recorded': z.object({
|
|
65
|
-
seq: z.number().int().nonnegative(),
|
|
66
|
-
kind: z.templateLiteral([z.string().min(1), '.', z.string().min(1)]),
|
|
67
|
-
item: brandSchemas.itemId,
|
|
68
|
-
until: brandSchemas.instant.nullable(),
|
|
69
|
-
expiresAt: brandSchemas.instant.nullable(),
|
|
70
|
-
reason: z.string().nullable(),
|
|
71
|
-
actor: actorRefSchema,
|
|
72
|
-
at: brandSchemas.instant,
|
|
73
|
-
}),
|
|
74
|
-
'boxxy.attempt.claimed': z.object({
|
|
75
|
-
item: brandSchemas.itemId,
|
|
76
|
-
phase: brandSchemas.phaseName,
|
|
77
|
-
number: z.number().int().positive(),
|
|
78
|
-
pool: brandSchemas.poolName,
|
|
79
|
-
slot: z.number().int().nonnegative(),
|
|
80
|
-
gen: z.number().int().nonnegative(),
|
|
81
|
-
recipeHash: brandSchemas.recipeHash,
|
|
82
|
-
rulesVersion: brandSchemas.rulesVersion,
|
|
83
|
-
}),
|
|
84
|
-
'boxxy.decision.recorded': z.object({
|
|
85
|
-
id: brandSchemas.decisionId,
|
|
86
|
-
attempt: brandSchemas.attemptId,
|
|
87
|
-
item: brandSchemas.itemId,
|
|
88
|
-
pool: brandSchemas.poolName,
|
|
89
|
-
rulesVersion: brandSchemas.rulesVersion,
|
|
90
|
-
snapshotHash: brandSchemas.snapshotHash,
|
|
91
|
-
storeVersion: z.number().int().nonnegative(),
|
|
92
|
-
pepysOffsets: z.record(brandSchemas.streamName, z.number().int().nonnegative()),
|
|
93
|
-
faults: z.array(faultSchema),
|
|
94
|
-
at: brandSchemas.instant,
|
|
95
|
-
}),
|
|
96
|
-
'boxxy.attempt.started': z.object({ atcSession: brandSchemas.atcSessionId }),
|
|
97
|
-
'boxxy.attempt.reconciling': z.object({ reason: z.string().min(1) }),
|
|
98
|
-
'boxxy.attempt.reconciled': z.object({ atcSession: brandSchemas.atcSessionId }),
|
|
99
|
-
'boxxy.attempt.session_bound': z.object({
|
|
100
|
-
atcSession: brandSchemas.atcSessionId,
|
|
101
|
-
agentSession: brandSchemas.agentSessionId,
|
|
102
|
-
seenAt: brandSchemas.instant,
|
|
103
|
-
}),
|
|
104
|
-
'boxxy.attempt.closed_out': z.object({ closeOut: buildCloseOutSchema }),
|
|
105
|
-
'boxxy.attempt.settled': z.object({
|
|
106
|
-
state: z.enum(['succeeded', 'failed']),
|
|
107
|
-
failure: z.string().min(1).nullable(),
|
|
108
|
-
endedAt: brandSchemas.instant,
|
|
109
|
-
criteria: z.array(copiedEvidenceSchema),
|
|
110
|
-
matched: z.array(brandSchemas.itemId),
|
|
111
|
-
frictionDropped: z.number().int().nonnegative(),
|
|
112
|
-
}),
|
|
113
|
-
'boxxy.evidence.recorded': z.object({
|
|
114
|
-
kind: z.enum(['pr', 'commit', 'test', 'ci-run', 'live-check']),
|
|
115
|
-
ref: z.string().min(1),
|
|
116
|
-
observed: z.string().nullable(),
|
|
117
|
-
}),
|
|
118
|
-
'boxxy.evidence.pr_linked': z.object({
|
|
119
|
-
repo: brandSchemas.repoName,
|
|
120
|
-
number: pullRequestNumberSchema,
|
|
121
|
-
url: z.url(),
|
|
122
|
-
}),
|
|
123
|
-
'boxxy.evidence.commit_linked': z.object({
|
|
124
|
-
repo: brandSchemas.repoName,
|
|
125
|
-
sha: brandSchemas.commitSha,
|
|
126
|
-
pr: pullRequestNumberSchema,
|
|
127
|
-
}),
|
|
128
|
-
'boxxy.pr.merged': z.object({
|
|
129
|
-
repo: brandSchemas.repoName,
|
|
130
|
-
number: pullRequestNumberSchema,
|
|
131
|
-
mergedAt: brandSchemas.instant,
|
|
132
|
-
mergeCommit: brandSchemas.commitSha,
|
|
133
|
-
}),
|
|
134
|
-
'boxxy.pr.closed': z.object({ repo: brandSchemas.repoName, number: pullRequestNumberSchema }),
|
|
135
|
-
'boxxy.proposal.recorded': frictionSchema,
|
|
136
|
-
'boxxy.runner.paused': z.object({ runner: brandSchemas.runnerId }),
|
|
137
|
-
'boxxy.runner.resumed': z.object({ runner: brandSchemas.runnerId }),
|
|
138
|
-
};
|
package/src/friction-schema.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { Friction } from './types/facts.ts';
|
|
3
|
-
|
|
4
|
-
export const frictionSchema: z.ZodType<Friction> = z.object({
|
|
5
|
-
target: z.object({
|
|
6
|
-
kind: z.enum(['skill', 'rule', 'lint', 'agents-md', 'tool']),
|
|
7
|
-
name: z.string().min(1),
|
|
8
|
-
}),
|
|
9
|
-
change: z.string().min(1),
|
|
10
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ItemRows } from '../types/core.ts';
|
|
2
|
-
|
|
3
|
-
export function buildMockItemRows(overrides: Partial<ItemRows> = {}): ItemRows {
|
|
4
|
-
return {
|
|
5
|
-
links: [],
|
|
6
|
-
blockerStates: new Map(),
|
|
7
|
-
levers: [],
|
|
8
|
-
attempts: [],
|
|
9
|
-
liveLease: null,
|
|
10
|
-
pullRequests: [],
|
|
11
|
-
maxAttempts: 2,
|
|
12
|
-
...overrides,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { faker } from '@faker-js/faker';
|
|
2
|
-
import { brandSchemas } from '../brand-schemas.ts';
|
|
3
|
-
import type { PullRequestRow } from '../types/core.ts';
|
|
4
|
-
|
|
5
|
-
export function buildMockPullRequestRow(overrides: Partial<PullRequestRow> = {}): PullRequestRow {
|
|
6
|
-
return {
|
|
7
|
-
repo: brandSchemas.repoName.parse(`${faker.string.alpha(8)}/${faker.string.alpha(8)}`),
|
|
8
|
-
number: faker.number.int({ min: 1, max: 10_000 }),
|
|
9
|
-
attempt: brandSchemas.attemptId.parse(faker.string.uuid({ version: 7 })),
|
|
10
|
-
state: 'open',
|
|
11
|
-
mergedAt: null,
|
|
12
|
-
mergeCommit: null,
|
|
13
|
-
checkedAt: brandSchemas.instant.parse(faker.number.int({ max: 1_800_000_000_000 })),
|
|
14
|
-
...overrides,
|
|
15
|
-
};
|
|
16
|
-
}
|
package/src/types/dispatch.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { ContentHash } from '@boxxy/content-hash';
|
|
2
|
-
import type {
|
|
3
|
-
AttemptId,
|
|
4
|
-
AttemptRow,
|
|
5
|
-
CriterionId,
|
|
6
|
-
EvidenceRow,
|
|
7
|
-
FactId,
|
|
8
|
-
ForcedFailure,
|
|
9
|
-
Instant,
|
|
10
|
-
ItemView,
|
|
11
|
-
KnownFailure,
|
|
12
|
-
LiveAttemptState,
|
|
13
|
-
Minutes,
|
|
14
|
-
RecipeName,
|
|
15
|
-
RepoName,
|
|
16
|
-
} from './core.ts';
|
|
17
|
-
import type { Friction, OpenItem } from './facts.ts';
|
|
18
|
-
import type { SessionReading, SpawnRequest } from './ports.ts';
|
|
19
|
-
|
|
20
|
-
export interface SpawnContext {
|
|
21
|
-
readonly repoPaths: ReadonlyMap<RepoName, string>;
|
|
22
|
-
readonly pluginFolder: { readonly path: string; readonly hash: ContentHash };
|
|
23
|
-
readonly promptTemplates: ReadonlyMap<RecipeName, string>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface Claim {
|
|
27
|
-
readonly attempt: AttemptRow;
|
|
28
|
-
readonly spawn: SpawnRequest;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type ReconcileAction =
|
|
32
|
-
| {
|
|
33
|
-
readonly kind: 'move-to-running';
|
|
34
|
-
readonly fact: 'boxxy.attempt.started' | 'boxxy.attempt.reconciled';
|
|
35
|
-
}
|
|
36
|
-
| { readonly kind: 'bind-session' }
|
|
37
|
-
| { readonly kind: 'settle' }
|
|
38
|
-
| { readonly kind: 'fail'; readonly failure: Extract<KnownFailure, 'session-lost'> }
|
|
39
|
-
| {
|
|
40
|
-
readonly kind: 'respawn';
|
|
41
|
-
readonly giveUpAfter: Minutes;
|
|
42
|
-
readonly then: Extract<KnownFailure, 'spawn-lost'>;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type ReconcileTable = Readonly<
|
|
46
|
-
Record<SessionReading['kind'], Readonly<Record<LiveAttemptState, ReconcileAction>>>
|
|
47
|
-
>;
|
|
48
|
-
|
|
49
|
-
export interface Settlement {
|
|
50
|
-
readonly state: 'succeeded' | 'failed';
|
|
51
|
-
readonly failure: string | null;
|
|
52
|
-
readonly openItems: readonly OpenItem[];
|
|
53
|
-
readonly criteria: readonly {
|
|
54
|
-
readonly criterion: CriterionId;
|
|
55
|
-
readonly evidence: readonly FactId[];
|
|
56
|
-
}[];
|
|
57
|
-
readonly friction: readonly Friction[];
|
|
58
|
-
readonly frictionDropped: number;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface SettleRule<Out = unknown> {
|
|
62
|
-
settle: (input: SettleInput<Out>) => Settlement;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface SettleInput<Out> {
|
|
66
|
-
readonly attempt: AttemptRow;
|
|
67
|
-
readonly item: ItemView;
|
|
68
|
-
readonly closeOut: CloseOutParse<Out> | null;
|
|
69
|
-
|
|
70
|
-
// a `forced` reason wins over the close-out's state
|
|
71
|
-
readonly forced: ForcedFailure | null;
|
|
72
|
-
readonly now: Instant;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface CloseOutContext {
|
|
76
|
-
readonly item: ItemView;
|
|
77
|
-
readonly attempt: AttemptId;
|
|
78
|
-
|
|
79
|
-
// the attempt's own evidence rows
|
|
80
|
-
readonly evidence: readonly EvidenceRow[];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export type CloseOutProblem =
|
|
84
|
-
| { readonly kind: 'schema'; readonly path: string; readonly message: string }
|
|
85
|
-
| { readonly kind: 'unknown-criterion'; readonly criterion: CriterionId }
|
|
86
|
-
| { readonly kind: 'foreign-evidence'; readonly evidence: FactId }
|
|
87
|
-
| { readonly kind: 'built-without-evidence'; readonly criteria: readonly CriterionId[] };
|
|
88
|
-
|
|
89
|
-
export type CloseOutParse<Out> =
|
|
90
|
-
| { readonly kind: 'valid'; readonly closeOut: Out }
|
|
91
|
-
| { readonly kind: 'invalid'; readonly problems: readonly CloseOutProblem[] };
|
|
92
|
-
|
|
93
|
-
export interface CloseOutParser<Out> {
|
|
94
|
-
parse: (raw: unknown, ctx: CloseOutContext) => CloseOutParse<Out>;
|
|
95
|
-
}
|
package/src/types/facts.ts
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from '@boxxy/content-hash';
|
|
2
|
-
import type {
|
|
3
|
-
ActorRef,
|
|
4
|
-
AgentSessionId,
|
|
5
|
-
AtcSessionId,
|
|
6
|
-
CommitSha,
|
|
7
|
-
Criterion,
|
|
8
|
-
CriterionId,
|
|
9
|
-
DecisionRow,
|
|
10
|
-
EvidenceKind,
|
|
11
|
-
FactId,
|
|
12
|
-
Instant,
|
|
13
|
-
ItemId,
|
|
14
|
-
ItemRow,
|
|
15
|
-
LeverRow,
|
|
16
|
-
LinkTypeName,
|
|
17
|
-
PhaseName,
|
|
18
|
-
PoolName,
|
|
19
|
-
RecipeHash,
|
|
20
|
-
RepoName,
|
|
21
|
-
RulesVersion,
|
|
22
|
-
RunnerId,
|
|
23
|
-
} from './core.ts';
|
|
24
|
-
|
|
25
|
-
export interface BuildCloseOut {
|
|
26
|
-
readonly result:
|
|
27
|
-
| { readonly kind: 'built' }
|
|
28
|
-
| { readonly kind: 'blocked'; readonly reason: string }
|
|
29
|
-
| { readonly kind: 'abandoned'; readonly reason: string };
|
|
30
|
-
readonly criteria: readonly { readonly criterion: CriterionId; readonly evidence: FactId }[];
|
|
31
|
-
readonly openItems: readonly OpenItem[];
|
|
32
|
-
readonly friction: readonly Friction[];
|
|
33
|
-
readonly frictionDropped: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface OpenItem {
|
|
37
|
-
readonly kind: 'core.issue';
|
|
38
|
-
readonly title: string;
|
|
39
|
-
readonly body: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type FrictionTargetKind = 'skill' | 'rule' | 'lint' | 'agents-md' | 'tool';
|
|
43
|
-
|
|
44
|
-
export interface Friction {
|
|
45
|
-
readonly target: { readonly kind: FrictionTargetKind; readonly name: string };
|
|
46
|
-
readonly change: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export type EntityRef =
|
|
50
|
-
| `boxxy:item:${string}`
|
|
51
|
-
| `boxxy:link:${string}:${string}:${string}`
|
|
52
|
-
| `boxxy:attempt:${string}`
|
|
53
|
-
| `boxxy:decision:${string}`
|
|
54
|
-
| `boxxy:runner:${string}`;
|
|
55
|
-
|
|
56
|
-
export interface FactEnvelope<
|
|
57
|
-
M extends object = SliceOneFacts,
|
|
58
|
-
T extends keyof M & string = keyof M & string,
|
|
59
|
-
> {
|
|
60
|
-
readonly id: FactId;
|
|
61
|
-
readonly type: T;
|
|
62
|
-
|
|
63
|
-
// oxlint-disable-next-line id-length -- pepys's fact envelope names this field
|
|
64
|
-
readonly v: 1;
|
|
65
|
-
readonly api: 'boxxy/1';
|
|
66
|
-
readonly entity: EntityRef;
|
|
67
|
-
readonly actor: ActorRef;
|
|
68
|
-
readonly at: Instant;
|
|
69
|
-
readonly payload: M[T] & { readonly storeVersion: number };
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface NewFact<T extends keyof M & string, M extends object = SliceOneFacts> {
|
|
73
|
-
readonly id: FactId;
|
|
74
|
-
readonly type: T;
|
|
75
|
-
readonly entity: EntityRef;
|
|
76
|
-
readonly actor: ActorRef;
|
|
77
|
-
readonly payload: M[T];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface OutboxFact {
|
|
81
|
-
readonly seq: number;
|
|
82
|
-
readonly factId: FactId;
|
|
83
|
-
readonly type: string;
|
|
84
|
-
readonly entity: EntityRef;
|
|
85
|
-
readonly actor: ActorRef;
|
|
86
|
-
readonly at: Instant;
|
|
87
|
-
readonly payload: JsonValue;
|
|
88
|
-
readonly sentAt: Instant | null;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export type FactType = keyof SliceOneFacts;
|
|
92
|
-
|
|
93
|
-
export interface LinkPayload {
|
|
94
|
-
readonly source: ItemId;
|
|
95
|
-
readonly target: ItemId;
|
|
96
|
-
readonly type: LinkTypeName;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface SliceOneFacts {
|
|
100
|
-
'boxxy.item.filed': ItemRow;
|
|
101
|
-
'boxxy.item.edited': {
|
|
102
|
-
readonly title?: string;
|
|
103
|
-
readonly outcome?: string;
|
|
104
|
-
readonly acceptance?: readonly Criterion[];
|
|
105
|
-
};
|
|
106
|
-
'boxxy.item.closed': { readonly reason: string };
|
|
107
|
-
'boxxy.link.added': LinkPayload;
|
|
108
|
-
'boxxy.link.removed': LinkPayload;
|
|
109
|
-
'boxxy.lever.recorded': LeverRow;
|
|
110
|
-
'boxxy.attempt.claimed': {
|
|
111
|
-
readonly item: ItemId;
|
|
112
|
-
readonly phase: PhaseName;
|
|
113
|
-
readonly number: number;
|
|
114
|
-
readonly pool: PoolName;
|
|
115
|
-
readonly slot: number;
|
|
116
|
-
readonly gen: number;
|
|
117
|
-
readonly recipeHash: RecipeHash;
|
|
118
|
-
readonly rulesVersion: RulesVersion;
|
|
119
|
-
};
|
|
120
|
-
'boxxy.decision.recorded': DecisionRow;
|
|
121
|
-
'boxxy.attempt.started': { readonly atcSession: AtcSessionId };
|
|
122
|
-
'boxxy.attempt.reconciling': { readonly reason: string };
|
|
123
|
-
'boxxy.attempt.reconciled': { readonly atcSession: AtcSessionId };
|
|
124
|
-
'boxxy.attempt.session_bound': {
|
|
125
|
-
readonly atcSession: AtcSessionId;
|
|
126
|
-
readonly agentSession: AgentSessionId;
|
|
127
|
-
readonly seenAt: Instant;
|
|
128
|
-
};
|
|
129
|
-
'boxxy.attempt.closed_out': { readonly closeOut: BuildCloseOut };
|
|
130
|
-
'boxxy.attempt.settled': {
|
|
131
|
-
readonly state: 'succeeded' | 'failed';
|
|
132
|
-
readonly failure: string | null;
|
|
133
|
-
readonly endedAt: Instant;
|
|
134
|
-
readonly criteria: readonly {
|
|
135
|
-
readonly criterion: CriterionId;
|
|
136
|
-
readonly evidence: readonly FactId[];
|
|
137
|
-
}[];
|
|
138
|
-
readonly matched: readonly ItemId[];
|
|
139
|
-
readonly frictionDropped: number;
|
|
140
|
-
};
|
|
141
|
-
'boxxy.evidence.recorded': {
|
|
142
|
-
readonly kind: EvidenceKind;
|
|
143
|
-
readonly ref: string;
|
|
144
|
-
readonly observed: string | null;
|
|
145
|
-
};
|
|
146
|
-
'boxxy.evidence.pr_linked': {
|
|
147
|
-
readonly repo: RepoName;
|
|
148
|
-
readonly number: number;
|
|
149
|
-
readonly url: string;
|
|
150
|
-
};
|
|
151
|
-
'boxxy.evidence.commit_linked': {
|
|
152
|
-
readonly repo: RepoName;
|
|
153
|
-
readonly sha: CommitSha;
|
|
154
|
-
readonly pr: number;
|
|
155
|
-
};
|
|
156
|
-
'boxxy.pr.merged': {
|
|
157
|
-
readonly repo: RepoName;
|
|
158
|
-
readonly number: number;
|
|
159
|
-
readonly mergedAt: Instant;
|
|
160
|
-
readonly mergeCommit: CommitSha;
|
|
161
|
-
};
|
|
162
|
-
'boxxy.pr.closed': { readonly repo: RepoName; readonly number: number };
|
|
163
|
-
'boxxy.proposal.recorded': Friction;
|
|
164
|
-
'boxxy.runner.paused': { readonly runner: RunnerId };
|
|
165
|
-
'boxxy.runner.resumed': { readonly runner: RunnerId };
|
|
166
|
-
}
|