@bjornpagen/bumbledb 0.7.0 → 0.8.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/COOKBOOK.md +105 -3
- package/README.md +3 -3
- package/dist/capacity.d.ts +310 -0
- package/dist/capacity.d.ts.map +1 -0
- package/dist/capacity.js +138 -0
- package/dist/capacity.js.map +1 -0
- package/dist/db.d.ts +5 -3
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +8 -8
- package/dist/db.js.map +1 -1
- package/dist/face.d.ts +1 -1
- package/dist/face.d.ts.map +1 -1
- package/dist/face.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/law.d.ts +3 -2
- package/dist/law.d.ts.map +1 -1
- package/dist/law.js +1 -1
- package/dist/law.js.map +1 -1
- package/dist/lower.d.ts.map +1 -1
- package/dist/lower.js +3 -2
- package/dist/lower.js.map +1 -1
- package/dist/native.d.ts +6 -3
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js.map +1 -1
- package/dist/schema.js +1 -1
- package/dist/schema.js.map +1 -1
- package/dist/spec.d.ts +76 -23
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js +39 -7
- package/dist/spec.js.map +1 -1
- package/dist/statements.d.ts +42 -25
- package/dist/statements.d.ts.map +1 -1
- package/dist/statements.js +81 -19
- package/dist/statements.js.map +1 -1
- package/package.json +2 -2
- package/src/capacity.ts +454 -0
- package/src/db.ts +13 -11
- package/src/face.ts +1 -0
- package/src/index.ts +19 -8
- package/src/law.ts +3 -2
- package/src/lower.ts +3 -2
- package/src/native.ts +6 -3
- package/src/schema.ts +1 -1
- package/src/spec.ts +91 -25
- package/src/statements.ts +160 -34
- package/dist/count.d.ts +0 -102
- package/dist/count.d.ts.map +0 -1
- package/dist/count.js +0 -115
- package/dist/count.js.map +0 -1
- package/src/count.ts +0 -211
package/COOKBOOK.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The cookbook — modeling intuition as schemas, in TypeScript
|
|
2
2
|
|
|
3
|
-
The bumbledb engine's
|
|
3
|
+
The bumbledb engine's 32 cookbook recipes (`bumbledb/docs/cookbook.md`),
|
|
4
4
|
translated to this SDK's structural API. **This document is illustrative,
|
|
5
5
|
never normative**: where a recipe and an engine architecture chapter disagree,
|
|
6
6
|
the chapter wins (`docs/architecture/README.md` rule 5) — the SDK is the same
|
|
@@ -39,9 +39,11 @@ import {
|
|
|
39
39
|
bool,
|
|
40
40
|
by,
|
|
41
41
|
bytes,
|
|
42
|
+
capacity,
|
|
42
43
|
closed,
|
|
43
44
|
contained,
|
|
44
45
|
desc,
|
|
46
|
+
duration,
|
|
45
47
|
eq,
|
|
46
48
|
i64,
|
|
47
49
|
interval,
|
|
@@ -53,11 +55,14 @@ import {
|
|
|
53
55
|
pointIn,
|
|
54
56
|
program,
|
|
55
57
|
query,
|
|
58
|
+
ref,
|
|
56
59
|
relation,
|
|
57
60
|
schema,
|
|
58
61
|
str,
|
|
59
62
|
u64,
|
|
60
|
-
v
|
|
63
|
+
v,
|
|
64
|
+
weigh,
|
|
65
|
+
within
|
|
61
66
|
} from "@bjornpagen/bumbledb"
|
|
62
67
|
```
|
|
63
68
|
|
|
@@ -66,7 +71,7 @@ import {
|
|
|
66
71
|
Relation declarations are pure structure — `kind`, `width`, `element`,
|
|
67
72
|
`fresh`, nothing else. Domains are never declared: `schema()` computes every
|
|
68
73
|
field's equivalence class FROM the statement list, by union-find across every
|
|
69
|
-
paired face (containment, `mirrors`,
|
|
74
|
+
paired face (containment, `mirrors`, capacity targets, ψ-selected faces
|
|
70
75
|
included). Three laws govern the classes:
|
|
71
76
|
|
|
72
77
|
1. **A fresh field is a generator** and names its class by its declaration
|
|
@@ -1606,3 +1611,100 @@ exists — `snap.scan(Program).find((row) => row.grp === grp)` — re-derives
|
|
|
1606
1611
|
in the host what the store already enforces. The uniqueness the fold
|
|
1607
1612
|
quietly assumes IS the declared key statement; spell the law and the point
|
|
1608
1613
|
read comes with it.
|
|
1614
|
+
|
|
1615
|
+
## Capacity laws
|
|
1616
|
+
|
|
1617
|
+
## 31. The power budget
|
|
1618
|
+
|
|
1619
|
+
Guarantee: Lean theorem + validator/runtime premises — the capacity law
|
|
1620
|
+
bounds each pool's summed draw by the pool's own row
|
|
1621
|
+
(`lean/Bumbledb/Capacity.lean: CapacityLaw`; per touched parent, one keyed
|
|
1622
|
+
probe plus one measure walk, `lean/Bumbledb/Oracle.lean:
|
|
1623
|
+
capacity_plan_decides`); the pinned-column containment proves a device's
|
|
1624
|
+
watts equals its model's at every commit.
|
|
1625
|
+
|
|
1626
|
+
Per-group capacity is one statement — the `capacity` builder mirrors the
|
|
1627
|
+
operator positionally (target, weight, window, source): `weigh` names the
|
|
1628
|
+
measure on the SOURCE row, and `ref` reads each group's ceiling from the
|
|
1629
|
+
TARGET row (hi slot only — ruled 2026-07-24, C6; bound names resolve
|
|
1630
|
+
against the target's full roster, ruled 2026-07-24, C1).
|
|
1631
|
+
|
|
1632
|
+
```ts
|
|
1633
|
+
const Pool = relation("Pool", { id: u64.fresh, supply: u64 })
|
|
1634
|
+
const Model = relation("Model", { id: u64.fresh, watts: u64 })
|
|
1635
|
+
const Device = relation("Device", {
|
|
1636
|
+
id: u64.fresh,
|
|
1637
|
+
pool: u64,
|
|
1638
|
+
model: u64,
|
|
1639
|
+
watts: u64
|
|
1640
|
+
})
|
|
1641
|
+
|
|
1642
|
+
const Racks = schema("Racks", { Pool, Model, Device }, [
|
|
1643
|
+
contained(on(Device, "pool"), on(Pool, "id")),
|
|
1644
|
+
// The pinned column: a device's watts provably equals its model's — the
|
|
1645
|
+
// two-column containment IS the join, stated as a law. The superkey it
|
|
1646
|
+
// targets is deliberate write-amplification rent.
|
|
1647
|
+
key(Model, ["id", "watts"]),
|
|
1648
|
+
contained(on(Device, ["model", "watts"]), on(Model, ["id", "watts"])),
|
|
1649
|
+
// Σ watts over a pool's devices stays within the pool's own supply:
|
|
1650
|
+
capacity(on(Pool, "id"), weigh("watts"), within(0n, ref("supply")), on(Device, "pool"))
|
|
1651
|
+
])
|
|
1652
|
+
|
|
1653
|
+
// utilization is a query, never a column (the ledger's law, recipe 19):
|
|
1654
|
+
const draw = query(Racks).rule((r) => {
|
|
1655
|
+
const { id, pool, watts } = v(Device)
|
|
1656
|
+
return r.match(Device, { id, pool, watts }).find({ pool, total: r.sum(watts) })
|
|
1657
|
+
})
|
|
1658
|
+
```
|
|
1659
|
+
|
|
1660
|
+
A path weight (`weigh("model.watts")`) is a typed refusal whose diagnostic
|
|
1661
|
+
names exactly this pair — the weight vocabulary is closed at the row (ruled
|
|
1662
|
+
2026-07-24, ruling 6): a weight read through a reference would be a
|
|
1663
|
+
maintained copy of another relation's field, and a catalog edit would
|
|
1664
|
+
silently re-weigh deployed fleets. Pinned, the inconsistent commit refuses
|
|
1665
|
+
at the device site and the migration is explicit.
|
|
1666
|
+
|
|
1667
|
+
## 32. Calendar capacity
|
|
1668
|
+
|
|
1669
|
+
Guarantee: Lean theorem + validator/runtime premises — the Duration weight
|
|
1670
|
+
sums each booking's interval measure against the room's own span measure
|
|
1671
|
+
(`lean/Bumbledb/Capacity.lean: CapacityLaw`; Duration weights pair with
|
|
1672
|
+
Duration-capable bounds, ruled 2026-07-24, C18; a ray-valued weight or
|
|
1673
|
+
bound refuses typed at the law site, ruled 2026-07-24, C10).
|
|
1674
|
+
|
|
1675
|
+
"Total booked time per room stays within the room's span" — one statement.
|
|
1676
|
+
The interval enters through the measure argument, never the group key.
|
|
1677
|
+
|
|
1678
|
+
```ts
|
|
1679
|
+
const Room = relation("Room", { id: u64.fresh, span: interval(i64) })
|
|
1680
|
+
const Booking = relation("Booking", {
|
|
1681
|
+
id: u64.fresh,
|
|
1682
|
+
room: u64,
|
|
1683
|
+
booked: interval(i64)
|
|
1684
|
+
})
|
|
1685
|
+
|
|
1686
|
+
const Rooms = schema("Rooms", { Room, Booking }, [
|
|
1687
|
+
contained(on(Booking, "room"), on(Room, "id")),
|
|
1688
|
+
// The pointwise key forbids double-booking (recipe 1); the capacity law
|
|
1689
|
+
// bounds the TOTAL. Different laws — a schema usually wants both.
|
|
1690
|
+
key(Booking, ["room", "booked"]),
|
|
1691
|
+
capacity(
|
|
1692
|
+
on(Room, "id"),
|
|
1693
|
+
weigh(duration("booked")),
|
|
1694
|
+
within(0n, duration("span")),
|
|
1695
|
+
on(Booking, "room")
|
|
1696
|
+
)
|
|
1697
|
+
])
|
|
1698
|
+
|
|
1699
|
+
// the booked time per room, read back:
|
|
1700
|
+
const booked = query(Rooms).rule((r) => {
|
|
1701
|
+
const { id, room, booked } = v(Booking)
|
|
1702
|
+
return r.match(Booking, { id, room, booked }).find({ room, total: r.sum(r.duration(booked)) })
|
|
1703
|
+
})
|
|
1704
|
+
```
|
|
1705
|
+
|
|
1706
|
+
Mind the weighted `{0}` and the weighted floor: on a weighted statement
|
|
1707
|
+
`within(0n)` says "the group's total is zero" (zero-measure rows may exist
|
|
1708
|
+
— the weaker law than the unit exclusion), and `within(1n, "*")` under a
|
|
1709
|
+
weight ("positive total") is not "at least one booking" — that intent is
|
|
1710
|
+
the bare `contained`. Choose by what you mean.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Type-theoretic TypeScript SDK for the [bumbledb](https://github.com/bjornpagen/bumbledb) embedded relational engine.
|
|
4
4
|
|
|
5
|
-
bumbledb models data as relations judged by statements (functionality, containment,
|
|
5
|
+
bumbledb models data as relations judged by statements (functionality, containment, capacity) and queried with Datalog expressed as plain values — no SQL, no query-string parser. The SDK is a thin, fully typed surface over an in-process native engine (LMDB storage, MVCC snapshots, a single-writer witnessed write loop).
|
|
6
6
|
|
|
7
7
|
The surface is structural to the bone. Relation declarations are pure structure — kind, width, element, fresh, nothing else — and domains are never declared anywhere: **the laws type the columns**. `schema()` computes every field's equivalence class from the statement list itself, so the containments and mirrors you already write ARE the typing, at compile time and again at construction. Values stay bare (`bigint`, `string`, …); identity lives in the class the laws compute, not in a wrapper.
|
|
8
8
|
|
|
@@ -131,14 +131,14 @@ real surface by `test/readme.test.ts` — the examples cannot drift.
|
|
|
131
131
|
The drizzle law governs this surface: the SDK's job at the host boundary is translation, not abstraction — every database idiom arrives as the modern TypeScript idiom for that concept, and the SDK never invents an operator where the language already has one.
|
|
132
132
|
|
|
133
133
|
- The structural type kernel — fields as pure structure (`bool`, `bytes`, `i64`, `u64`, `str`, `interval`, `span`), `relation()`, and `closed()` sealed rosters with typed axiom payloads. A closed reference's value type IS the handle union (`Infer` speaks it); dispatch is native `switch` narrowing with `satisfies never` exhaustiveness. Domains are never declared: `schema()` computes every field's class from the statement list.
|
|
134
|
-
- The statement algebra — `schema()`, `key`, `contained`, `mirrors`, `
|
|
134
|
+
- The statement algebra — `schema()`, `key`, `contained`, `mirrors`, `capacity`; faces via `on` (set membership is a plain array in `.where`); windows via `within` (`within(n)` exact, `within(lo, hi)` range, `within(lo, "*")` floor), measures via `weigh` (`weigh("f")` a u64 field, `weigh(duration("f"))` an interval's measure), dependent bounds via `ref`/`duration` read from the target row; ψ-selection via `.where` on relations and closed rosters.
|
|
135
135
|
- The `Db` runtime — `Db.create`/`Db.open`, path-cached stores, transactions, typed violations, scoped snapshot reads (`db.read(fn)`, or `using snap = db.read()` — lifetimes are disposables, never `close()`), the write verbs with `abandon` (returning `abandon(payload)` from `write` or `writeWitnessed` rolls the transaction back; the outcome arm is in the result type), and `db.explain` — the prepared plan as data.
|
|
136
136
|
- The query surface — Datalog as values, `query(S).rule(r => ...)`: `v(R)`-minted vars (identity is the object reference — reusing one across binding positions IS the join), `find({...})` named result heads (renames are real), params typed by use unchanged, negation, aggregates, and the free comparison/connective exports (`eq`, `ne`, `lt`, `le`, `gt`, `ge`, `and`, `or`, `not`, `allen`/`ALLEN`, `pointIn`); set membership at a closed field is a plain array in the match record (`r.match(Ticket, { priority: ["Normal", "Urgent"] })` — closed-only there: an ordinary field's membership is a bound `r.inSet` param); stratified recursion via `program()`; `db.prepare` as a plain value.
|
|
137
137
|
- The exhume surface — `Db.exhume`, the schema-independent read path: a store's self-described shapes and raw facts by name, with typed refusals (`ErrExhumeNoDescriptor`, `ErrExhumeFormatMismatch`, `ErrExhumeCorruption`). A disposable lifetime: `using exhumed = await Db.exhume(path)` releases the store's exclusive lock at scope exit.
|
|
138
138
|
|
|
139
139
|
## Cookbook
|
|
140
140
|
|
|
141
|
-
The engine cookbook's
|
|
141
|
+
The engine cookbook's 32 modeling recipes, translated to this SDK's structural API: [COOKBOOK.md](./COOKBOOK.md). Two referees hold it: `test/cookbook-doc.test.ts` extracts the document's own `ts` fences and type-checks them against the real surface (the doc itself cannot drift), and `test/cookbook.test.ts` runs compiled copies of the recipes — each schema admitted by the real engine, its fingerprint asserted against the cross-host goldens the Rust cookbook suite also pins, every query snippet lowered through `db.prepare`.
|
|
142
142
|
|
|
143
143
|
## Architecture
|
|
144
144
|
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacity-law mints — the window, weight, and dependent-bound vocabulary
|
|
3
|
+
* the one `capacity()` statement constructor consumes
|
|
4
|
+
* (`docs/architecture/70-api.md` § the canonical-utterance law, restated
|
|
5
|
+
* around the aggregate form). `within()` is the ONE window spelling —
|
|
6
|
+
* `within(n)` exact (`within(0n)` IS the exclusion's one spelling),
|
|
7
|
+
* `within(lo, hi)` range (`within(0n, hi)` the canonical ceiling),
|
|
8
|
+
* `within(lo, "*")` floor — `weigh()` names the measure on the SOURCE row
|
|
9
|
+
* (`weigh("watts")` a u64 field, `weigh(duration("booked"))` an interval's
|
|
10
|
+
* measure), and `ref()`/`duration()` read a dependent bound from the
|
|
11
|
+
* TARGET row (hi slot only — ruled 2026-07-24, C6). The ban table is
|
|
12
|
+
* enforced REPRESENTATIONALLY in two tiers, split per-aggregate where
|
|
13
|
+
* weight-sensitive (design § 6: a ban is canonical-utterance policing when
|
|
14
|
+
* it is weight-independent, semantic deduplication when it is not):
|
|
15
|
+
*
|
|
16
|
+
* - **The type tier**: a banned spelling written as a LITERAL does not
|
|
17
|
+
* compile — every negative bound, `within(n, n)`, `within(0n, 0n)`, and
|
|
18
|
+
* `within(0n, "*")` are type errors naming the canonical form. The
|
|
19
|
+
* weight-SENSITIVE row rides the `capacity()` overloads themselves:
|
|
20
|
+
* `within(1n, "*")` is banned on the unit overload only (`{1..*}` on the
|
|
21
|
+
* count instance is the bare containment respelled —
|
|
22
|
+
* `window_floor_containment`), and LEGAL on the weighted one ("positive
|
|
23
|
+
* total" is not an existence claim over rows).
|
|
24
|
+
* - **The construction tier**: a bound the type level cannot judge — a
|
|
25
|
+
* COMPUTED `bigint`, or an inverted `within(lo, hi)` order — is judged at
|
|
26
|
+
* construction with the same canonical-naming errors; and past both
|
|
27
|
+
* tiers the engine's own spec validation remains the law for a hostile
|
|
28
|
+
* FFI caller (the standing two-tier ban enforcement).
|
|
29
|
+
*
|
|
30
|
+
* The weight vocabulary is closed at the row (ruled 2026-07-24, ruling 6):
|
|
31
|
+
* a path weight (`weigh("model.watts")`) is a typed refusal at BOTH tiers
|
|
32
|
+
* whose diagnostic names the pinned-column idiom — the two-column
|
|
33
|
+
* containment IS the join, stated as a law. Bounds are `bigint` (u64
|
|
34
|
+
* crosses as bigint always, PRD-04's law); the witnessed measure comes
|
|
35
|
+
* back as `bigint` too (u128-wide engine accumulator, C3).
|
|
36
|
+
*/
|
|
37
|
+
import type { AnyFace, FaceFields, FaceSource, ProjectedShape } from "#face.ts";
|
|
38
|
+
import type { CapacityWindowSpec, WeightSpec } from "#spec.ts";
|
|
39
|
+
/**
|
|
40
|
+
* The admission brand — a module-private symbol, deliberately unexported
|
|
41
|
+
* (the standing statement-mint pattern): `CapacityWindowSpec` and
|
|
42
|
+
* `WeightSpec` are public wire types, so without this brand every banned
|
|
43
|
+
* spelling in the ban table would be writable as a plain object literal.
|
|
44
|
+
* The symbol makes `within()` and `weigh()` the ONLY producers of the
|
|
45
|
+
* values `capacity()` accepts, which is what "the ban table is unwritable"
|
|
46
|
+
* means.
|
|
47
|
+
*/
|
|
48
|
+
declare const admitted: unique symbol;
|
|
49
|
+
/**
|
|
50
|
+
* An admitted capacity window — opaque and inert: a fact about the theory,
|
|
51
|
+
* not a builder. Only `within()` produces one; the spec is carried at its
|
|
52
|
+
* EXACT type so the weight-sensitive `{1..*}` ban and the dependent-bound
|
|
53
|
+
* target wall are judged at the `capacity()` call.
|
|
54
|
+
*/
|
|
55
|
+
interface CapacityWindow<S extends CapacityWindowSpec = CapacityWindowSpec> {
|
|
56
|
+
readonly window: S;
|
|
57
|
+
readonly [admitted]: true;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An admitted measure — `weigh()`'s product, the `[w]` bracket of the
|
|
61
|
+
* operator. The spec is carried at its exact type so the u64/interval
|
|
62
|
+
* source wall ({@link WeightOnSource}) reads the weighed field's name off
|
|
63
|
+
* the value.
|
|
64
|
+
*/
|
|
65
|
+
interface CapacityWeight<S extends WeightSpec = WeightSpec> {
|
|
66
|
+
readonly weight: S;
|
|
67
|
+
readonly [admitted]: true;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A dependent bound naming a u64 field of the TARGET row — `ref()`'s
|
|
71
|
+
* product, legal in `within()`'s hi slot only (C6: a dependent floor has
|
|
72
|
+
* no use case; inversion with idents is unrepresentable). Carries no
|
|
73
|
+
* value: bounds resolve per target row at judge time.
|
|
74
|
+
*/
|
|
75
|
+
interface FieldRef<F extends string = string> {
|
|
76
|
+
readonly kind: "field";
|
|
77
|
+
readonly field: F;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A dependent interval-measure bound (`Duration(field)` of the TARGET
|
|
81
|
+
* row), or — handed to `weigh()` — the interval-measure weight of the
|
|
82
|
+
* SOURCE row. One mint, both slots: the interval enters through the
|
|
83
|
+
* measure argument, never the group key.
|
|
84
|
+
*/
|
|
85
|
+
interface DurationRef<F extends string = string> {
|
|
86
|
+
readonly kind: "durationField";
|
|
87
|
+
readonly field: F;
|
|
88
|
+
}
|
|
89
|
+
/** Narrows any value to an admitted capacity window through the module-private brand. */
|
|
90
|
+
declare function isCapacityWindow(value: unknown): value is CapacityWindow;
|
|
91
|
+
/** Narrows any value to an admitted capacity weight through the module-private brand. */
|
|
92
|
+
declare function isCapacityWeight(value: unknown): value is CapacityWeight;
|
|
93
|
+
/**
|
|
94
|
+
* The legible banned-spelling verdict: intersected into a mint's parameter
|
|
95
|
+
* when the LITERAL argument spells a banned window, naming the canonical
|
|
96
|
+
* form — the compile-time face of the ban table.
|
|
97
|
+
*/
|
|
98
|
+
interface BannedWindow<Canonical extends string> {
|
|
99
|
+
readonly "banned window spelling — the canonical-utterance law names the one legal form": Canonical;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The path-weight refusal (ruling 6 — a boundary, not a deferral): the
|
|
103
|
+
* verdict names the pinned-column idiom, the same diagnostic the macro
|
|
104
|
+
* expansion and the spec resolver carry.
|
|
105
|
+
*/
|
|
106
|
+
interface RefusedPath<Idiom extends string> {
|
|
107
|
+
readonly "path spelling refused — the vocabulary is closed at the row": Idiom;
|
|
108
|
+
}
|
|
109
|
+
/** `true` exactly when the literal bigint `N` is negative (out of the u64 bound domain). */
|
|
110
|
+
type IsNegative<N extends bigint> = `${N}` extends `-${string}` ? true : false;
|
|
111
|
+
/**
|
|
112
|
+
* The dotted-name ban, both mints: a `a.b` spelling is a typed refusal
|
|
113
|
+
* whose verdict names the composition idiom — pin the column with a
|
|
114
|
+
* two-column containment (`Device(model, watts) <= Model(id, watts)`) and
|
|
115
|
+
* name the local field.
|
|
116
|
+
*/
|
|
117
|
+
type PathBan<F extends string> = string extends F ? unknown : F extends `${string}.${string}` ? RefusedPath<"pin the column — a two-column containment (Source(ref, f) <= Catalog(id, f)) proves the local copy, then name the local field"> : unknown;
|
|
118
|
+
/** The ban verdict on a single bound: negatives are out of the u64 domain. */
|
|
119
|
+
type NegativeBan<N extends bigint> = bigint extends N ? unknown : IsNegative<N> extends true ? BannedWindow<"capacity bounds are u64 — a negative bound is out of domain"> : unknown;
|
|
120
|
+
/**
|
|
121
|
+
* The ban verdict on `within(lo, "*")`: `{0..*}` is vacuous —
|
|
122
|
+
* weight-independent (sums are ≥ 0). `{1..*}` is NOT judged here: the ban
|
|
123
|
+
* is weight-sensitive (Count-instance only) and rides the `capacity()`
|
|
124
|
+
* unit overload ({@link UnitWindowBan}).
|
|
125
|
+
*/
|
|
126
|
+
type FloorBan<N extends bigint> = bigint extends N ? unknown : IsNegative<N> extends true ? BannedWindow<"capacity bounds are u64 — a negative bound is out of domain"> : N extends 0n ? BannedWindow<"`{0..*}` is vacuous — it provably says nothing; delete the statement"> : unknown;
|
|
127
|
+
/**
|
|
128
|
+
* The ban verdict on `within(lo, hi)` with both literals known: `{n..n}`
|
|
129
|
+
* is the exact measure respelled (`within(n)`, or `within(0n)` at 0) —
|
|
130
|
+
* weight-independent canonical policing. Bound ORDER (`{hi..lo}` inverted)
|
|
131
|
+
* is not type-expressible — bigint literals have no type-level comparison
|
|
132
|
+
* — so inversion stays a construction error.
|
|
133
|
+
*/
|
|
134
|
+
type RangeBan<Lo extends bigint, Hi extends bigint> = bigint extends Lo ? unknown : bigint extends Hi ? unknown : IsNegative<Lo> extends true ? BannedWindow<"capacity bounds are u64 — a negative bound is out of domain"> : IsNegative<Hi> extends true ? BannedWindow<"capacity bounds are u64 — a negative bound is out of domain"> : Lo extends Hi ? Hi extends Lo ? Lo extends 0n ? BannedWindow<"`{0..0}` — the point window is written `{0}`: use within(0n)"> : BannedWindow<"`{n..n}` — an exact measure is written `{n}`: use within(n)"> : unknown : unknown;
|
|
135
|
+
/**
|
|
136
|
+
* The weight-SENSITIVE ban row, judged at the `capacity()` call where the
|
|
137
|
+
* aggregate instance is known (design § 6): on the UNIT overload a
|
|
138
|
+
* `{1..*}` floor says only what the bare containment says
|
|
139
|
+
* (`window_floor_containment`) and is banned naming `contained`; on the
|
|
140
|
+
* weighted overload the same window is LEGAL — "positive total" admits
|
|
141
|
+
* zero-weight rows and is a different, weaker law.
|
|
142
|
+
*/
|
|
143
|
+
type UnitWindowBan<W extends CapacityWindow> = W["window"] extends {
|
|
144
|
+
readonly kind: "floor";
|
|
145
|
+
readonly lo: {
|
|
146
|
+
readonly kind: "lit";
|
|
147
|
+
readonly value: 1n;
|
|
148
|
+
};
|
|
149
|
+
} ? BannedWindow<"`{1..*}` on the unit instance says only what the bare containment says — write contained(source, target)"> : unknown;
|
|
150
|
+
/** The projected kind of one field of a face's source, read off the schema type. */
|
|
151
|
+
type KindAt<S extends FaceSource, K extends string> = ProjectedShape<S, K> extends readonly [infer Kind, ...unknown[]] ? Kind : undefined;
|
|
152
|
+
/**
|
|
153
|
+
* The legible off-roster verdict for a dependent bound: bound names
|
|
154
|
+
* resolve against the TARGET's full field roster (C1 — the written
|
|
155
|
+
* projection tuple stays the pure grouping key), and the verdict names
|
|
156
|
+
* that roster.
|
|
157
|
+
*/
|
|
158
|
+
interface BoundOffTargetRoster<K, Roster> {
|
|
159
|
+
readonly "dependent bound must name a field of the TARGET's own row — bound names resolve against the target's full roster": readonly [
|
|
160
|
+
K,
|
|
161
|
+
Roster
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
/** The legible kind-mismatch verdict for a dependent bound: `ref()` needs u64, `duration()` an interval. */
|
|
165
|
+
interface BoundKindMismatch<K, Want> {
|
|
166
|
+
readonly "dependent bound kind mismatch — ref() reads a u64 field, duration() an interval field, of the TARGET row": readonly [
|
|
167
|
+
K,
|
|
168
|
+
Want
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* One dependent-bound slot judged against the target face's roster and
|
|
173
|
+
* kinds. A WIDE field name (the untyped-caller path — literal identity
|
|
174
|
+
* already lost) passes the type tier and is judged at construction.
|
|
175
|
+
*/
|
|
176
|
+
type BoundOnTarget<K extends string, Want extends "u64" | "interval", B extends AnyFace> = string extends K ? unknown : K extends FaceFields<B["source"]> ? KindAt<B["source"], K> extends Want ? unknown : BoundKindMismatch<K, Want> : BoundOffTargetRoster<K, FaceFields<B["source"]>>;
|
|
177
|
+
/**
|
|
178
|
+
* The dependent-bound target wall (type tier): for a `ref(K)` bound in the
|
|
179
|
+
* window's hi slot, `K` must name a u64 field of the TARGET face's own
|
|
180
|
+
* row; for a `duration(K)` bound, an interval field. Literal-bound windows
|
|
181
|
+
* pass untouched. The runtime twin for untyped callers lives at the
|
|
182
|
+
* `capacity()` construction (`statements.ts`).
|
|
183
|
+
*/
|
|
184
|
+
type BoundsOnTarget<W extends CapacityWindow, B extends AnyFace> = W["window"] extends {
|
|
185
|
+
readonly hi: FieldRef<infer K>;
|
|
186
|
+
} ? BoundOnTarget<K, "u64", B> : W["window"] extends {
|
|
187
|
+
readonly hi: DurationRef<infer K>;
|
|
188
|
+
} ? BoundOnTarget<K, "interval", B> : unknown;
|
|
189
|
+
/** The legible off-roster verdict for a weight: the vocabulary is closed at the SOURCE row. */
|
|
190
|
+
interface WeightOffSourceRoster<K, Roster> {
|
|
191
|
+
readonly "weight must name a field of the SOURCE's own row — the weight vocabulary is closed at the row": readonly [
|
|
192
|
+
K,
|
|
193
|
+
Roster
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The legible kind-mismatch verdict for a weight: a signed weight would
|
|
198
|
+
* break the polarity scheduler (an insert could lower a sum), so the
|
|
199
|
+
* illegal weight is unrepresentable, not checked.
|
|
200
|
+
*/
|
|
201
|
+
interface WeightKindMismatch<K, Want> {
|
|
202
|
+
readonly "weight kind mismatch — weigh(field) reads a u64 field, weigh(duration(field)) an interval field, of the SOURCE row": readonly [
|
|
203
|
+
K,
|
|
204
|
+
Want
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* The weight source wall (type tier): `weigh(K)`'s field must be a
|
|
209
|
+
* u64-encoded position of the SOURCE face's own row (signed encodings are
|
|
210
|
+
* the typed polarity refusal), `weigh(duration(K))`'s an interval
|
|
211
|
+
* position. Checked at the `capacity()` call where the source face is
|
|
212
|
+
* inferred — the proven constrain-after-inference pattern.
|
|
213
|
+
*/
|
|
214
|
+
type WeightOnSource<M extends CapacityWeight, A extends AnyFace> = M["weight"] extends {
|
|
215
|
+
readonly kind: "field";
|
|
216
|
+
readonly field: infer K extends string;
|
|
217
|
+
} ? string extends K ? unknown : K extends FaceFields<A["source"]> ? KindAt<A["source"], K> extends "u64" ? unknown : WeightKindMismatch<K, "u64"> : WeightOffSourceRoster<K, FaceFields<A["source"]>> : M["weight"] extends {
|
|
218
|
+
readonly kind: "durationField";
|
|
219
|
+
readonly field: infer K extends string;
|
|
220
|
+
} ? string extends K ? unknown : K extends FaceFields<A["source"]> ? KindAt<A["source"], K> extends "interval" ? unknown : WeightKindMismatch<K, "interval"> : WeightOffSourceRoster<K, FaceFields<A["source"]>> : unknown;
|
|
221
|
+
/** The unit weight — a case, not an absence (C4): the count instance's one wire spelling. */
|
|
222
|
+
declare const unitWeight: WeightSpec;
|
|
223
|
+
/**
|
|
224
|
+
* `{n}` — THE exact-measure spelling; `within(0n)` IS the exclusion's one
|
|
225
|
+
* spelling on the unit instance, and the weaker "total is zero" law on a
|
|
226
|
+
* weighted one (zero-weight rows may exist — design § 6, stated loudly).
|
|
227
|
+
*/
|
|
228
|
+
declare function within<const N extends bigint>(n: N & NegativeBan<N>): CapacityWindow<{
|
|
229
|
+
readonly kind: "exact";
|
|
230
|
+
readonly n: {
|
|
231
|
+
readonly kind: "lit";
|
|
232
|
+
readonly value: N;
|
|
233
|
+
};
|
|
234
|
+
}>;
|
|
235
|
+
/**
|
|
236
|
+
* `{lo..*}` — a floor with no ceiling. `within(0n, "*")` is vacuous
|
|
237
|
+
* (unwritable as a literal); `within(1n, "*")` constructs — the `{1..*}`
|
|
238
|
+
* ban is weight-sensitive and judged at the `capacity()` call (unit
|
|
239
|
+
* instance only).
|
|
240
|
+
*/
|
|
241
|
+
declare function within<const Lo extends bigint>(lo: Lo & FloorBan<Lo>, hi: "*"): CapacityWindow<{
|
|
242
|
+
readonly kind: "floor";
|
|
243
|
+
readonly lo: {
|
|
244
|
+
readonly kind: "lit";
|
|
245
|
+
readonly value: Lo;
|
|
246
|
+
};
|
|
247
|
+
}>;
|
|
248
|
+
/**
|
|
249
|
+
* `{lo..field}` / `{lo..Duration(field)}` — the dependent ceiling, read
|
|
250
|
+
* from the TARGET row per group (C6: hi slot only). The ref carries no
|
|
251
|
+
* value, so no inversion judgment exists at construction — a per-row
|
|
252
|
+
* inverted window is the judge's typed refusal.
|
|
253
|
+
*/
|
|
254
|
+
declare function within<const Lo extends bigint, const R extends FieldRef | DurationRef>(lo: Lo & NegativeBan<Lo>, hi: R): CapacityWindow<{
|
|
255
|
+
readonly kind: "range";
|
|
256
|
+
readonly lo: {
|
|
257
|
+
readonly kind: "lit";
|
|
258
|
+
readonly value: Lo;
|
|
259
|
+
};
|
|
260
|
+
readonly hi: R;
|
|
261
|
+
}>;
|
|
262
|
+
/**
|
|
263
|
+
* `{lo..hi}` — both bounds explicit, lo < hi; `within(0n, hi)` is the
|
|
264
|
+
* canonical ceiling. `lo === hi` is the exact measure respelled
|
|
265
|
+
* (unwritable as literals — {@link RangeBan} names `within(n)`), rejected
|
|
266
|
+
* at construction when computed; an inverted window is unsatisfiable and
|
|
267
|
+
* rejected at construction (bigint literals carry no type-level order).
|
|
268
|
+
*/
|
|
269
|
+
declare function within<const Lo extends bigint, const Hi extends bigint>(lo: Lo, hi: Hi & RangeBan<Lo, Hi>): CapacityWindow<{
|
|
270
|
+
readonly kind: "range";
|
|
271
|
+
readonly lo: {
|
|
272
|
+
readonly kind: "lit";
|
|
273
|
+
readonly value: Lo;
|
|
274
|
+
};
|
|
275
|
+
readonly hi: {
|
|
276
|
+
readonly kind: "lit";
|
|
277
|
+
readonly value: Hi;
|
|
278
|
+
};
|
|
279
|
+
}>;
|
|
280
|
+
/**
|
|
281
|
+
* `[field]` — the measure: a u64-encoded field of the SOURCE row summed
|
|
282
|
+
* per target group. A dotted path is the typed refusal naming the
|
|
283
|
+
* pinned-column idiom (ruling 6); `weigh(duration(field))` is the
|
|
284
|
+
* interval-measure weight — calendar capacity as one statement.
|
|
285
|
+
*/
|
|
286
|
+
declare function weigh<const F extends string>(field: F & PathBan<F>): CapacityWeight<{
|
|
287
|
+
readonly kind: "field";
|
|
288
|
+
readonly field: F;
|
|
289
|
+
}>;
|
|
290
|
+
declare function weigh<const F extends string>(measure: DurationRef<F>): CapacityWeight<{
|
|
291
|
+
readonly kind: "durationField";
|
|
292
|
+
readonly field: F;
|
|
293
|
+
}>;
|
|
294
|
+
/**
|
|
295
|
+
* A dependent bound by name — `within(0n, ref("supply"))` reads each
|
|
296
|
+
* group's ceiling from the TARGET row's u64 field (bound names resolve
|
|
297
|
+
* against the target's FULL roster, C1 — the projection tuple stays the
|
|
298
|
+
* pure grouping key). Carries no value.
|
|
299
|
+
*/
|
|
300
|
+
declare function ref<const F extends string>(field: F & PathBan<F>): FieldRef<F>;
|
|
301
|
+
/**
|
|
302
|
+
* `Duration(field)` — the interval-measure spelling, one mint for both
|
|
303
|
+
* slots: handed to `weigh()` it is the SOURCE row's interval measure;
|
|
304
|
+
* in `within()`'s hi slot it is the TARGET row's interval-measure bound
|
|
305
|
+
* (Duration weights pair with Duration-capable bounds — C18).
|
|
306
|
+
*/
|
|
307
|
+
declare function duration<const F extends string>(field: F & PathBan<F>): DurationRef<F>;
|
|
308
|
+
export type { BoundsOnTarget, CapacityWeight, CapacityWindow, DurationRef, FieldRef, UnitWindowBan, WeightOnSource };
|
|
309
|
+
export { duration, isCapacityWeight, isCapacityWindow, ref, unitWeight, weigh, within };
|
|
310
|
+
//# sourceMappingURL=capacity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacity.d.ts","sourceRoot":"","sources":["../src/capacity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,GACnB,cAAc,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC,CAAA;AAChE,iBAAS,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EACpC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GACrB,cAAc,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC,CAAA;AAQxE;;;;;GAKG;AACH,iBAAS,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAEvE;AAED;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAE/E;AAED,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,CAAA;AACpH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA"}
|
package/dist/capacity.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacity-law mints — the window, weight, and dependent-bound vocabulary
|
|
3
|
+
* the one `capacity()` statement constructor consumes
|
|
4
|
+
* (`docs/architecture/70-api.md` § the canonical-utterance law, restated
|
|
5
|
+
* around the aggregate form). `within()` is the ONE window spelling —
|
|
6
|
+
* `within(n)` exact (`within(0n)` IS the exclusion's one spelling),
|
|
7
|
+
* `within(lo, hi)` range (`within(0n, hi)` the canonical ceiling),
|
|
8
|
+
* `within(lo, "*")` floor — `weigh()` names the measure on the SOURCE row
|
|
9
|
+
* (`weigh("watts")` a u64 field, `weigh(duration("booked"))` an interval's
|
|
10
|
+
* measure), and `ref()`/`duration()` read a dependent bound from the
|
|
11
|
+
* TARGET row (hi slot only — ruled 2026-07-24, C6). The ban table is
|
|
12
|
+
* enforced REPRESENTATIONALLY in two tiers, split per-aggregate where
|
|
13
|
+
* weight-sensitive (design § 6: a ban is canonical-utterance policing when
|
|
14
|
+
* it is weight-independent, semantic deduplication when it is not):
|
|
15
|
+
*
|
|
16
|
+
* - **The type tier**: a banned spelling written as a LITERAL does not
|
|
17
|
+
* compile — every negative bound, `within(n, n)`, `within(0n, 0n)`, and
|
|
18
|
+
* `within(0n, "*")` are type errors naming the canonical form. The
|
|
19
|
+
* weight-SENSITIVE row rides the `capacity()` overloads themselves:
|
|
20
|
+
* `within(1n, "*")` is banned on the unit overload only (`{1..*}` on the
|
|
21
|
+
* count instance is the bare containment respelled —
|
|
22
|
+
* `window_floor_containment`), and LEGAL on the weighted one ("positive
|
|
23
|
+
* total" is not an existence claim over rows).
|
|
24
|
+
* - **The construction tier**: a bound the type level cannot judge — a
|
|
25
|
+
* COMPUTED `bigint`, or an inverted `within(lo, hi)` order — is judged at
|
|
26
|
+
* construction with the same canonical-naming errors; and past both
|
|
27
|
+
* tiers the engine's own spec validation remains the law for a hostile
|
|
28
|
+
* FFI caller (the standing two-tier ban enforcement).
|
|
29
|
+
*
|
|
30
|
+
* The weight vocabulary is closed at the row (ruled 2026-07-24, ruling 6):
|
|
31
|
+
* a path weight (`weigh("model.watts")`) is a typed refusal at BOTH tiers
|
|
32
|
+
* whose diagnostic names the pinned-column idiom — the two-column
|
|
33
|
+
* containment IS the join, stated as a law. Bounds are `bigint` (u64
|
|
34
|
+
* crosses as bigint always, PRD-04's law); the witnessed measure comes
|
|
35
|
+
* back as `bigint` too (u128-wide engine accumulator, C3).
|
|
36
|
+
*/
|
|
37
|
+
import * as errors from "@superbuilders/errors";
|
|
38
|
+
/**
|
|
39
|
+
* The admission brand — a module-private symbol, deliberately unexported
|
|
40
|
+
* (the standing statement-mint pattern): `CapacityWindowSpec` and
|
|
41
|
+
* `WeightSpec` are public wire types, so without this brand every banned
|
|
42
|
+
* spelling in the ban table would be writable as a plain object literal.
|
|
43
|
+
* The symbol makes `within()` and `weigh()` the ONLY producers of the
|
|
44
|
+
* values `capacity()` accepts, which is what "the ban table is unwritable"
|
|
45
|
+
* means.
|
|
46
|
+
*/
|
|
47
|
+
const admitted = Symbol("bumbledb.capacity.admitted");
|
|
48
|
+
/** Narrows any value to an admitted capacity window through the module-private brand. */
|
|
49
|
+
function isCapacityWindow(value) {
|
|
50
|
+
return typeof value === "object" && value !== null && admitted in value && "window" in value;
|
|
51
|
+
}
|
|
52
|
+
/** Narrows any value to an admitted capacity weight through the module-private brand. */
|
|
53
|
+
function isCapacityWeight(value) {
|
|
54
|
+
return typeof value === "object" && value !== null && admitted in value && "weight" in value;
|
|
55
|
+
}
|
|
56
|
+
/** The unit weight — a case, not an absence (C4): the count instance's one wire spelling. */
|
|
57
|
+
const unitWeight = Object.freeze({ kind: "unit" });
|
|
58
|
+
/** The construction-tier twin of {@link PathBan}: a dotted name refuses naming the idiom. */
|
|
59
|
+
function assertRowLocal(field, role) {
|
|
60
|
+
if (field.includes(".")) {
|
|
61
|
+
throw errors.new(`${role} \`${field}\` walks a reference — the vocabulary is closed at the row (ruling 6): pin the column with a two-column containment (Source(ref, f) <= Catalog(id, f)) and name the local field`);
|
|
62
|
+
}
|
|
63
|
+
return field;
|
|
64
|
+
}
|
|
65
|
+
/** Stamps one admitted window spec as a frozen branded value. */
|
|
66
|
+
function admitWindow(window) {
|
|
67
|
+
const value = { window, [admitted]: true };
|
|
68
|
+
return Object.freeze(value);
|
|
69
|
+
}
|
|
70
|
+
/** One literal bound. */
|
|
71
|
+
function lit(value) {
|
|
72
|
+
return Object.freeze({ kind: "lit", value });
|
|
73
|
+
}
|
|
74
|
+
function within(lo, hi) {
|
|
75
|
+
if (lo < 0n) {
|
|
76
|
+
throw errors.new(`capacity bounds are u64: within(${lo}${hi === undefined ? "" : ", …"}) is out of domain`);
|
|
77
|
+
}
|
|
78
|
+
if (hi === undefined) {
|
|
79
|
+
return admitWindow({ kind: "exact", n: lit(lo) });
|
|
80
|
+
}
|
|
81
|
+
if (hi === "*") {
|
|
82
|
+
if (lo === 0n) {
|
|
83
|
+
throw errors.new("the `{0..*}` window is vacuous — it provably says nothing; delete the statement");
|
|
84
|
+
}
|
|
85
|
+
return admitWindow({ kind: "floor", lo: lit(lo) });
|
|
86
|
+
}
|
|
87
|
+
if (typeof hi === "bigint") {
|
|
88
|
+
if (hi < 0n) {
|
|
89
|
+
throw errors.new(`capacity bounds are u64: within(${lo}, ${hi}) is out of domain`);
|
|
90
|
+
}
|
|
91
|
+
if (hi < lo) {
|
|
92
|
+
throw errors.new(`the window \`{${lo}..${hi}}\` is inverted — no measure satisfies it; bounds are \`{lo..hi}\` with lo < hi (an exact measure is \`{n}\`: within(n))`);
|
|
93
|
+
}
|
|
94
|
+
if (lo === hi) {
|
|
95
|
+
if (lo === 0n) {
|
|
96
|
+
throw errors.new("`{0..0}` — the point window is written `{0}`: use within(0n)");
|
|
97
|
+
}
|
|
98
|
+
throw errors.new(`\`{${lo}..${lo}}\` — an exact measure is written \`{${lo}}\`: use within(${lo}n)`);
|
|
99
|
+
}
|
|
100
|
+
return admitWindow({ kind: "range", lo: lit(lo), hi: lit(hi) });
|
|
101
|
+
}
|
|
102
|
+
const field = assertRowLocal(hi.field, "dependent bound");
|
|
103
|
+
if (hi.kind === "durationField") {
|
|
104
|
+
return admitWindow({ kind: "range", lo: lit(lo), hi: Object.freeze({ kind: "durationField", field }) });
|
|
105
|
+
}
|
|
106
|
+
return admitWindow({ kind: "range", lo: lit(lo), hi: Object.freeze({ kind: "field", field }) });
|
|
107
|
+
}
|
|
108
|
+
/** Stamps one admitted weight spec as a frozen branded value. */
|
|
109
|
+
function admitWeight(weight) {
|
|
110
|
+
const value = { weight, [admitted]: true };
|
|
111
|
+
return Object.freeze(value);
|
|
112
|
+
}
|
|
113
|
+
function weigh(measure) {
|
|
114
|
+
if (typeof measure === "string") {
|
|
115
|
+
return admitWeight({ kind: "field", field: assertRowLocal(measure, "weight") });
|
|
116
|
+
}
|
|
117
|
+
return admitWeight({ kind: "durationField", field: assertRowLocal(measure.field, "weight") });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A dependent bound by name — `within(0n, ref("supply"))` reads each
|
|
121
|
+
* group's ceiling from the TARGET row's u64 field (bound names resolve
|
|
122
|
+
* against the target's FULL roster, C1 — the projection tuple stays the
|
|
123
|
+
* pure grouping key). Carries no value.
|
|
124
|
+
*/
|
|
125
|
+
function ref(field) {
|
|
126
|
+
return Object.freeze({ kind: "field", field: assertRowLocal(field, "dependent bound") });
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* `Duration(field)` — the interval-measure spelling, one mint for both
|
|
130
|
+
* slots: handed to `weigh()` it is the SOURCE row's interval measure;
|
|
131
|
+
* in `within()`'s hi slot it is the TARGET row's interval-measure bound
|
|
132
|
+
* (Duration weights pair with Duration-capable bounds — C18).
|
|
133
|
+
*/
|
|
134
|
+
function duration(field) {
|
|
135
|
+
return Object.freeze({ kind: "durationField", field: assertRowLocal(field, "Duration measure") });
|
|
136
|
+
}
|
|
137
|
+
export { duration, isCapacityWeight, isCapacityWindow, ref, unitWeight, weigh, within };
|
|
138
|
+
//# sourceMappingURL=capacity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacity.js","sourceRoot":"","sources":["../src/capacity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAI/C;;;;;;;;GAQG;AACH,MAAM,QAAQ,GAAkB,MAAM,CAAC,4BAA4B,CAAC,CAAA;AA8Cp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