@eir-labs/coltrane 0.8.1 → 0.9.0

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/dist/src/cli.d.ts CHANGED
@@ -31,7 +31,7 @@ export interface CliIO {
31
31
  /** Injected for tests. Production reads stdin for `--input -`. */
32
32
  stdin?: () => string;
33
33
  }
34
- export declare const USAGE = "coltrane 0.8.1\n\n coltrane validate load the genome; exit non-zero on load errors\n coltrane dispatch <standard> run a standard\n coltrane monitor <gig-id> report a gig's progress\n coltrane logs <gig-id> per-chair logs for a gig\n coltrane abort <gig-id> stop a running gig\n coltrane trace <output-id> walk an output's provenance\n coltrane simulate <standard> cost/shape a standard without running it\n coltrane health engine + store health\n coltrane serve run the MCP server on stdio\n coltrane work claim one queued gig from the org store and run it\n (env: COLTRANE_STORE_URL, COLTRANE_STORE_ANON,\n COLTRANE_AGENT_TOKEN; results drain via\n COLTRANE_DRAIN_URL + COLTRANE_DRAIN_KEY;\n checkpoints under COLTRANE_WORKER_CHECKPOINTS,\n default ~/.coltrane/worker-checkpoints;\n exit 0 complete or parked, 1 failed, 3 queue empty)\n\nOptions\n --input <json|@file|-> dispatch payload; @file reads a file, - reads stdin\n --depth <skim|standard|deep> tighten the per-chair turn cap\n --budget <dollars> per-gig ceiling; the run stops when it is gone\n --reuse allow chair-level reuse of prior sealed outputs\n --resume <gig-id> continue a gig that died mid-pipeline\n --approve <role>=<json|@file> a human chair's verdict; repeat once per chair\n --as <name> who is approving; sealed as the verdict's author\n --wait block until the run finishes\n --follow poll until the gig reaches a terminal state\n --direction <upstream|downstream|both> for trace\n --json print the raw result to stdout\n --genome <path> genome root (default: $COLTRANE_GENOME or cwd)\n --help, --version\n\nA dispatch that reaches a chair a HUMAN holds parks: it names the waiting chair and exits 0,\nbecause a gig waiting on a person is not a failed gig. Approve it on the resume \u2014\n\n coltrane dispatch <standard> --resume <gig> --input @orig.json \\\n --approve approve=@verdict.json --as eugene\n";
34
+ export declare const USAGE = "coltrane 0.9.0\n\n coltrane validate load the genome; exit non-zero on load errors\n coltrane dispatch <standard> run a standard\n coltrane monitor <gig-id> report a gig's progress\n coltrane logs <gig-id> per-chair logs for a gig\n coltrane abort <gig-id> stop a running gig\n coltrane trace <output-id> walk an output's provenance\n coltrane simulate <standard> cost/shape a standard without running it\n coltrane health engine + store health\n coltrane serve run the MCP server on stdio\n coltrane work claim one queued gig from the org store and run it\n (env: COLTRANE_STORE_URL, COLTRANE_STORE_ANON,\n COLTRANE_AGENT_TOKEN; results drain via\n COLTRANE_DRAIN_URL + COLTRANE_DRAIN_KEY;\n checkpoints under COLTRANE_WORKER_CHECKPOINTS,\n default ~/.coltrane/worker-checkpoints;\n exit 0 complete or parked, 1 failed, 3 queue empty)\n\nOptions\n --input <json|@file|-> dispatch payload; @file reads a file, - reads stdin\n --depth <skim|standard|deep> tighten the per-chair turn cap\n --budget <dollars> per-gig ceiling; the run stops when it is gone\n --reuse allow chair-level reuse of prior sealed outputs\n --resume <gig-id> continue a gig that died mid-pipeline\n --approve <role>=<json|@file> a human chair's verdict; repeat once per chair\n --as <name> who is approving; sealed as the verdict's author\n --wait block until the run finishes\n --follow poll until the gig reaches a terminal state\n --direction <upstream|downstream|both> for trace\n --json print the raw result to stdout\n --genome <path> genome root (default: $COLTRANE_GENOME or cwd)\n --help, --version\n\nA dispatch that reaches a chair a HUMAN holds parks: it names the waiting chair and exits 0,\nbecause a gig waiting on a person is not a failed gig. Approve it on the resume \u2014\n\n coltrane dispatch <standard> --resume <gig> --input @orig.json \\\n --approve approve=@verdict.json --as eugene\n";
35
35
  interface Parsed {
36
36
  cmd: string | undefined;
37
37
  positional: string[];
@@ -0,0 +1,206 @@
1
+ import type { AdmissibilityResult, LawCheck } from "./institution_enforcement.js";
2
+ import type { GigLedgerEntry } from "./ledger.js";
3
+ import { DrawSchema, ResourceSchema, BookingSchema, TourSchema } from "./genome_schema.js";
4
+ /** One draw against declared capacity. A draw is UNIT-TAGGED — a booking draws a VECTOR of these,
5
+ * never a scalar, and over-commitment is checked per unit with NO exchange rate anywhere. */
6
+ export interface Draw {
7
+ resource_slug: string;
8
+ unit: string;
9
+ quantity: number;
10
+ }
11
+ /** Capacity as its OWN class, separate from commitment. A holding of some `unit` by a `holder`
12
+ * (an organization slug), for a `period`, that either may or may not be lent across organizations.
13
+ * `unit` is a free string treated as OPAQUE and NON-CONVERTIBLE — the precedent is BudgetState.unit
14
+ * ("append-units", "NOT dollars, and nothing converts between the two").
15
+ *
16
+ * `period` IS THE DISCRETIZATION, and that is the load-bearing reason it is REQUIRED rather than
17
+ * optional. A Resource is not a running balance; it is *this much, over this window*. Capacity is
18
+ * derived once at declaration and stored as a commitment for that window — so a capacity that is
19
+ * continuous underneath (a decaying rate, a regenerating credit) is sampled at declaration and the
20
+ * decay governs the NEXT period's declaration, never a live read inside this one. That is what
21
+ * makes this a budget, and it is consistent with a layer whose whole subject is committed work:
22
+ * a commitment is a stored fact even when computed from something continuous.
23
+ *
24
+ * Two things break the moment `period` becomes optional, so do not make it so for the convenience
25
+ * of a one-off holding (give that a window and be done):
26
+ * 1. a periodless Resource is a RUNNING BALANCE, and `quantity` stops meaning a declared
27
+ * commitment and starts meaning a live level;
28
+ * 2. a live level is an ORACLE. `can_cover(X)` asked repeatedly binary-searches the exact
29
+ * balance, which is precisely what a banded, quantized projection exists to prevent. Your own
30
+ * holdings you know exactly and no oracle exists; the leak appears only across an institution
31
+ * wall — and that is why the band belongs on the exchange contract that crosses the wall,
32
+ * never on this shape, which is quantity-typed to its holder by design. */
33
+ export interface Resource {
34
+ slug: string;
35
+ holder: string;
36
+ quantity: number;
37
+ unit: string;
38
+ /** REQUIRED. See the note above: this field is the discretization, not a label. */
39
+ period: string;
40
+ transferable: boolean;
41
+ }
42
+ /** One commitment within a Tour: the binding middle place, carrying the four load-bearing fields the
43
+ * lineage-record named plus its acceptance condition, its draws and its lifecycle. `amount` is
44
+ * OPTIONAL — Coltrane's own tour genuinely has commitments with no price ("ship the evaluator" is a
45
+ * real commitment with a real acceptance condition and no money numerator). */
46
+ export interface Booking {
47
+ slug: string;
48
+ aim: string;
49
+ amount?: number;
50
+ period: string;
51
+ /** The accountable OFFICE: an InstitutionalChair id (the office, not its incumbent). This is the
52
+ * DEBTOR of the commitment. */
53
+ accountable_office: string;
54
+ /** Reuses InstitutionalLawCheckSchema verbatim — decided by the same evaluate(). */
55
+ acceptance: LawCheck;
56
+ /** The vector of draws over declared resources. */
57
+ draws: Draw[];
58
+ /** The north stars this commitment serves (may be empty — that is a queryable fact, not an error). */
59
+ served_northstars: string[];
60
+ /** Whether the acceptance is a checkable rule or a stated norm. Reuses NormPairSchema's vocabulary
61
+ * — never a parallel tier enum. An UNMARKED, UNEVALUABLE commitment is refused. */
62
+ tier?: "declared" | "enforced";
63
+ /** The live lifecycle record — a party-constrained state machine, not a status field. */
64
+ lifecycle: CommitmentRecord;
65
+ /** In-repo join to the gigs that settled against this booking. NEVER an off-repo id. */
66
+ settled_gig_ids?: string[];
67
+ /** For a STAGED booking: the antecedent that must hold before it binds. Reuses LawCheck so there is
68
+ * ONE predicate form. Detach fires automatically when this holds (conditional → active). */
69
+ antecedent?: LawCheck;
70
+ }
71
+ /** The institution-visible aggregation. It REFERENCES an institution (the constraint whose laws
72
+ * govern it) and an organization (the accountable player) — it does NOT live inside InstitutionSchema,
73
+ * because institution, organization and committed work are three distinct things. All cross-refs are
74
+ * slugs, so the class depends on no other object at the type level. */
75
+ export interface Tour {
76
+ slug: string;
77
+ institution_slug: string;
78
+ org_slug: string;
79
+ /** The accountable office, an InstitutionalChair id — the VenueSchema.responsible_chair shape. */
80
+ responsible_chair: string;
81
+ period: string;
82
+ northstar_slugs: string[];
83
+ bookings: Booking[];
84
+ }
85
+ /** The two parties to a commitment. The debtor owes the consequent; the creditor holds the claim. */
86
+ export type CommitmentParty = "debtor" | "creditor";
87
+ /** The closed lifecycle state set. `cancelled` (debtor's act) and `released` (creditor's act) are
88
+ * DISTINCT members — the whole point of a state machine over a status field. */
89
+ export type CommitmentState = "conditional" | "active" | "pending" | "satisfied" | "violated" | "expired" | "cancelled" | "released";
90
+ /** The closed state set as data — for codomain-closure and distinctness assertions. */
91
+ export declare const COMMITMENT_STATES: readonly CommitmentState[];
92
+ /** The states in which a commitment is still LIVE — delegate and assign must keep the commitment in
93
+ * this set, and an undispatched booking is one whose state is still live with no settled gig. */
94
+ export declare const LIVE_STATES: ReadonlySet<CommitmentState>;
95
+ export type CommitmentOpKind = "create" | "detach" | "discharge" | "cancel" | "release" | "delegate" | "assign";
96
+ /** An operation on a commitment: what act, by which party, and (for delegate/assign) the substitute. */
97
+ export interface CommitmentOp {
98
+ kind: CommitmentOpKind;
99
+ /** Who is performing the act. `detach` is AUTOMATIC and carries no party actor. */
100
+ by?: CommitmentParty;
101
+ /** delegate substitutes the debtor; assign substitutes the creditor. */
102
+ substitute?: string;
103
+ }
104
+ /** One recorded operation — an append-only log entry, so Delegate's residual responsibility is
105
+ * RECORDED rather than overwritten by an in-place edit. */
106
+ export interface CommitmentOpEntry {
107
+ op: CommitmentOpKind;
108
+ by?: CommitmentParty;
109
+ /** For a delegate: the debtor that was substituted OUT and retains residual responsibility. */
110
+ residual_debtor?: string;
111
+ }
112
+ /** The live commitment record: its current state, its two parties, and its operation log. */
113
+ export interface CommitmentRecord {
114
+ state: CommitmentState;
115
+ /** The accountable office that owes the work. */
116
+ debtor: string;
117
+ /** The party the promise is made to (the institution/organization). */
118
+ creditor: string;
119
+ log: CommitmentOpEntry[];
120
+ }
121
+ /** A transition either succeeds with the next record, or is REFUSED with a stated reason (a party
122
+ * performing an act reserved to the other party; an operation illegal in the current state). A
123
+ * refusal is a decision, never a throw — a throw here is the unbuilt seam, distinguishable in test. */
124
+ export type CommitmentTransition = {
125
+ ok: true;
126
+ next: CommitmentRecord;
127
+ } | {
128
+ ok: false;
129
+ reason: string;
130
+ };
131
+ /**
132
+ * Apply one lifecycle operation under its party constraint. THE FIXED SEAM:
133
+ * - cancel → DEBTOR ONLY; a creditor's cancel is refused.
134
+ * - release → CREDITOR ONLY; a debtor's release is refused.
135
+ * - delegate→ substitutes the debtor, keeps the commitment LIVE, appends the residual debtor.
136
+ * - assign → substitutes the creditor, keeps the commitment LIVE.
137
+ * - detach → AUTOMATIC (no party); conditional → active once the antecedent holds.
138
+ * - discharge → the debtor delivers the consequent; active → satisfied.
139
+ * STUB: throws until implemented.
140
+ */
141
+ export declare function applyCommitmentOp(rec: CommitmentRecord, op: CommitmentOp): CommitmentTransition;
142
+ /** A per-unit tally of a set of draws — the vector the over-commitment check sums over. Units are
143
+ * OPAQUE and NON-CONVERTIBLE, so each distinct unit is its own bucket; nothing offsets across them. */
144
+ export declare function tallyDrawsPerUnit(draws: readonly Draw[]): Map<string, number>;
145
+ /**
146
+ * Check every booking's draws in a tour against the declared resources, PER UNIT, with no exchange
147
+ * rate anywhere. Returns the SAME AdmissibilityResult shape. Refusals:
148
+ * - a draw naming an undeclared resource → DEAD_NAME;
149
+ * - a draw in a unit the holder does not hold → dead unit (no conversion to a held unit);
150
+ * - the sum of draws in a unit exceeding the holder's declared quantity → over-committed;
151
+ * - a draw on a NON-TRANSFERABLE holding held by an org other than the tour's accountable org.
152
+ * STUB: throws until implemented.
153
+ */
154
+ export declare function checkTourCapacity(tour: Tour, resources: readonly Resource[]): AdmissibilityResult;
155
+ /** The document tour-admissibility consumes: the tour, the resources its draws name, and the genome
156
+ * slugs it resolves against (institution / chairs / northstars). */
157
+ export interface TourDocument {
158
+ tour: unknown;
159
+ resources?: readonly unknown[];
160
+ institution?: unknown;
161
+ chairs?: readonly unknown[];
162
+ northstars?: readonly unknown[];
163
+ }
164
+ /**
165
+ * Refuse a tour document that claims more than it holds — the same shape as
166
+ * checkInstitutionAdmissibility, pure and explicitly-invoked, NOT wired into loadGenome. Collect-all,
167
+ * refuse-once. Refusals:
168
+ * - a booking whose acceptance does not evaluate over its declared inputs AND is not marked
169
+ * declared-tier (an unmarked, unevaluable commitment — silence must not pass for a commitment);
170
+ * - a draw against a resource the genome does not declare (a dead name, failing closed);
171
+ * - a cross-org draw on a non-transferable holding;
172
+ * - a per-unit over-commitment;
173
+ * - any institution / chair / northstar / resource slug the genome cannot resolve.
174
+ * STUB: throws until implemented.
175
+ */
176
+ export declare function checkTourAdmissibility(doc: TourDocument): AdmissibilityResult;
177
+ /** Promised-versus-delivered for one booking. `committed` is the booking's amount (null when the
178
+ * booking carries none — that is "no numerator", NOT a second tier). `settled` is read FROM the
179
+ * ledger chain (sum of GigUsage.total_cost_usd over the booking's settled gigs). */
180
+ export interface Variance {
181
+ booking_slug: string;
182
+ committed: number | null;
183
+ settled: number;
184
+ /** committed - settled, or null when the booking carries no amount. */
185
+ variance: number | null;
186
+ has_numerator: boolean;
187
+ settled_gig_ids: readonly string[];
188
+ }
189
+ /**
190
+ * Compute a booking's variance by READING the booking → gig → spend chain (never assembling it
191
+ * by hand): for each gig id the booking settled against, read its ledger entry's usage.total_cost_usd
192
+ * and sum.
193
+ */
194
+ export declare function computeVariance(booking: Booking, ledger: readonly GigLedgerEntry[]): Variance;
195
+ /** Unpromised work: gig ids that no booking settled against. Allowed, but VISIBLE — a set difference
196
+ * of all gig ids minus every id any booking promised. */
197
+ export declare function unpromisedGigs(allGigIds: readonly string[], bookings: readonly Booking[]): string[];
198
+ /** Undispatched bookings: still-live commitments that settled against no gig — VISIBLE, not dropped.
199
+ * A booking already discharged/cancelled/released is not "undispatched", so the query keeps only the
200
+ * ones whose lifecycle is still live AND that carry no settled gig. */
201
+ export declare function undispatchedBookings(bookings: readonly Booking[]): Booking[];
202
+ /** Report A: north stars a tour names but no booking serves — directions nobody is funding. */
203
+ export declare function northstarsWithNoBooking(tour: Tour): string[];
204
+ /** Report B: bookings serving no north star — spend with no stated direction. */
205
+ export declare function bookingsServingNoNorthstar(tour: Tour): Booking[];
206
+ export { DrawSchema, ResourceSchema, BookingSchema, TourSchema };
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"file":"committed_work.js","sourceRoot":"","sources":["../../src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