@cobol-ts/cobolts 0.0.18 → 0.0.20
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.benchmark.md +21 -21
- package/README.cel.md +19 -11
- package/README.crypto.md +105 -0
- package/README.md +103 -30
- package/README.oracle.md +110 -0
- package/README.periodic-verification.md +84 -83
- package/build/gui/assets/index-AxtZbbsk.js +71 -0
- package/build/gui/assets/index-DUqGF627.css +1 -0
- package/build/gui/index.html +13 -0
- package/dist/src/benchmark.aggregate.fixture.spec.js +2 -2
- package/dist/src/benchmark.aggregate.fixture.spec.js.map +1 -1
- package/dist/src/benchmark.cli.functional.spec.js +15 -5
- package/dist/src/benchmark.cli.functional.spec.js.map +1 -1
- package/dist/src/benchmark.cli.golden.spec.js +6 -4
- package/dist/src/benchmark.cli.golden.spec.js.map +1 -1
- package/dist/src/benchmark.composed.execution.spec.js +1 -1
- package/dist/src/benchmark.composed.execution.spec.js.map +1 -1
- package/dist/src/benchmark.composed.fixture.js +2 -2
- package/dist/src/benchmark.composed.fixture.js.map +1 -1
- package/dist/src/benchmark.composed.fixture.spec.js +3 -1
- package/dist/src/benchmark.composed.fixture.spec.js.map +1 -1
- package/dist/src/benchmark.composed.runner.js +14 -4
- package/dist/src/benchmark.composed.runner.js.map +1 -1
- package/dist/src/benchmark.composed.two.fixture.js +9 -5
- package/dist/src/benchmark.composed.two.fixture.js.map +1 -1
- package/dist/src/benchmark.composed.two.spec.js +3 -1
- package/dist/src/benchmark.composed.two.spec.js.map +1 -1
- package/dist/src/benchmark.format.composition.spec.js +16 -11
- package/dist/src/benchmark.format.composition.spec.js.map +1 -1
- package/dist/src/benchmark.format.fixture.js +2 -2
- package/dist/src/benchmark.format.fixture.js.map +1 -1
- package/dist/src/benchmark.format.runner.js +2 -2
- package/dist/src/benchmark.format.runner.js.map +1 -1
- package/dist/src/benchmark.format.spec.js +1 -1
- package/dist/src/benchmark.format.spec.js.map +1 -1
- package/dist/src/benchmark.periodic.execution.spec.js +6 -6
- package/dist/src/benchmark.periodic.execution.spec.js.map +1 -1
- package/dist/src/benchmark.runner.d.ts +2 -1
- package/dist/src/benchmark.runner.js +10 -2
- package/dist/src/benchmark.runner.js.map +1 -1
- package/dist/src/benchmark.runner.spec.js +10 -4
- package/dist/src/benchmark.runner.spec.js.map +1 -1
- package/dist/src/benchmark.strategy.spec.js +3 -1
- package/dist/src/benchmark.strategy.spec.js.map +1 -1
- package/dist/src/cel.composition.integration.spec.js +15 -12
- package/dist/src/cel.composition.integration.spec.js.map +1 -1
- package/dist/src/cel.evaluate.integration.spec.js +18 -15
- package/dist/src/cel.evaluate.integration.spec.js.map +1 -1
- package/dist/src/cel.shared.execution.d.ts +3 -3
- package/dist/src/cel.shared.execution.js +4 -4
- package/dist/src/cel.shared.execution.js.map +1 -1
- package/dist/src/cli.integration.spec.js +5 -5
- package/dist/src/cli.integration.spec.js.map +1 -1
- package/dist/src/cli.js +7 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/cli.spec.js +18 -0
- package/dist/src/cli.spec.js.map +1 -1
- package/dist/src/commands/ai.demo.spec.js +30 -6
- package/dist/src/commands/ai.demo.spec.js.map +1 -1
- package/dist/src/commands/ai.spec.js +16 -5
- package/dist/src/commands/ai.spec.js.map +1 -1
- package/dist/src/commands/benchmark.js +3 -4
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/cel.js +10 -4
- package/dist/src/commands/cel.js.map +1 -1
- package/dist/src/commands/characteristics.d.ts +1 -0
- package/dist/src/commands/characteristics.js +77 -25
- package/dist/src/commands/characteristics.js.map +1 -1
- package/dist/src/commands/characteristics.spec.js +129 -56
- package/dist/src/commands/characteristics.spec.js.map +1 -1
- package/dist/src/commands/config.compositions.d.ts +4 -0
- package/dist/src/commands/config.compositions.js +15 -0
- package/dist/src/commands/config.compositions.js.map +1 -0
- package/dist/src/commands/config.validate.js +1 -0
- package/dist/src/commands/config.validate.js.map +1 -1
- package/dist/src/commands/crypto.d.ts +41 -0
- package/dist/src/commands/crypto.js +196 -0
- package/dist/src/commands/crypto.js.map +1 -0
- package/dist/src/commands/crypto.spec.d.ts +1 -0
- package/dist/src/commands/crypto.spec.js +32 -0
- package/dist/src/commands/crypto.spec.js.map +1 -0
- package/dist/src/commands/extract.d.ts +4 -1
- package/dist/src/commands/extract.js +23 -6
- package/dist/src/commands/extract.js.map +1 -1
- package/dist/src/commands/extract.spec.js +88 -1
- package/dist/src/commands/extract.spec.js.map +1 -1
- package/dist/src/commands/graph.spec.js +10 -2
- package/dist/src/commands/graph.spec.js.map +1 -1
- package/dist/src/commands/oracle.d.ts +3 -0
- package/dist/src/commands/oracle.js +96 -0
- package/dist/src/commands/oracle.js.map +1 -0
- package/dist/src/commands/validate.all.js +12 -3
- package/dist/src/commands/validate.all.js.map +1 -1
- package/dist/src/commands/validate.all.spec.js +22 -0
- package/dist/src/commands/validate.all.spec.js.map +1 -1
- package/dist/src/composition.data.d.ts +10 -0
- package/dist/src/composition.data.js +133 -0
- package/dist/src/composition.data.js.map +1 -0
- package/dist/src/composition.data.spec.d.ts +1 -0
- package/dist/src/composition.data.spec.js +80 -0
- package/dist/src/composition.data.spec.js.map +1 -0
- package/dist/src/composition.run.d.ts +5 -0
- package/dist/src/composition.run.integration.spec.d.ts +1 -0
- package/dist/src/composition.run.integration.spec.js +32 -0
- package/dist/src/composition.run.integration.spec.js.map +1 -0
- package/dist/src/composition.run.js +32 -0
- package/dist/src/composition.run.js.map +1 -0
- package/dist/src/composition.run.spec.d.ts +1 -0
- package/dist/src/composition.run.spec.js +71 -0
- package/dist/src/composition.run.spec.js.map +1 -0
- package/dist/src/context.d.ts +18 -2
- package/dist/src/context.js +96 -12
- package/dist/src/context.js.map +1 -1
- package/dist/src/gui.assets.d.ts +11 -0
- package/dist/src/gui.assets.js +68 -0
- package/dist/src/gui.assets.js.map +1 -0
- package/dist/src/gui.assets.spec.d.ts +1 -0
- package/dist/src/gui.assets.spec.js +94 -0
- package/dist/src/gui.assets.spec.js.map +1 -0
- package/dist/src/oracle.repository.d.ts +28 -0
- package/dist/src/oracle.repository.js +205 -0
- package/dist/src/oracle.repository.js.map +1 -0
- package/dist/src/oracle.repository.spec.d.ts +1 -0
- package/dist/src/oracle.repository.spec.js +118 -0
- package/dist/src/oracle.repository.spec.js.map +1 -0
- package/index.ts +2 -0
- package/package.json +35 -28
package/README.oracle.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Production oracle repository CLI
|
|
2
|
+
|
|
3
|
+
`oracle` is a repository-aware adapter over `@cobol-ts/crypto-packager`. It imports one observed production execution, identified by **explicit named relational composition** and **actual execution date**, into its canonical `{composition}/{date}` directory. The single `validationDataSet` composition is not an import target. It does not compact the original files or calculate characteristics.
|
|
4
|
+
|
|
5
|
+
## Configuration
|
|
6
|
+
|
|
7
|
+
`.cobolts/oracle.yaml`:
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
version: 1
|
|
11
|
+
cryptoConfig: crypto.yaml
|
|
12
|
+
repository:
|
|
13
|
+
type: filesystem
|
|
14
|
+
root: ../oracle
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The root and `cryptoConfig` paths resolve against the discovered `.cobolts` directory. `oracle.yaml` controls only the repository destination; `crypto.yaml` supplies the local sealed-box recipient, Ed25519 signing keys and shared authenticated streaming format. It does not duplicate `files.yaml` readers or relations. A Google storage/key provider can replace local adapters in a later phase without changing import logic.
|
|
18
|
+
|
|
19
|
+
The `productionDaily` and `productionMonthly` definitions in `files.yaml` identify required input files, their copybooks/projections and key ordering. The loader demands those original files with names made from the logical name plus physical extension (`customers.fb`, `customerPreferences.fb`, etc.). Extra CSV/JSONL reference-result files such as `oracleDaily.jsonl` are accepted as raw original files and do not need redundant catalogue entries; their precise required naming/completeness policy is not yet configurable. All source files are archived byte-exact and individually encrypted. Nested paths in production deliveries are rejected.
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
|
|
23
|
+
From the monorepo root:
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
# Create local dev keys if not already created for crypto.yaml
|
|
27
|
+
# yarn cobolts -d modules/examples/example/definitions crypto keys generate
|
|
28
|
+
|
|
29
|
+
# Import a directory or ZIP containing the required files for that composition
|
|
30
|
+
# (the ZIP basename is not used to infer composition or execution date)
|
|
31
|
+
yarn cobolts -d modules/examples/example/definitions oracle import --composition productionDaily --date 2026-05-31 --source ../incoming/daily.zip
|
|
32
|
+
|
|
33
|
+
# Replace an already published run (the old signature is invalidated first)
|
|
34
|
+
yarn cobolts -d modules/examples/example/definitions oracle import --composition productionDaily --date 2026-05-31 --source ../incoming/corrected.zip --force
|
|
35
|
+
|
|
36
|
+
# Discover complete, signed production runs
|
|
37
|
+
yarn cobolts -d modules/examples/example/definitions oracle list
|
|
38
|
+
|
|
39
|
+
# Check every encrypted source and detached signature
|
|
40
|
+
yarn cobolts -d modules/examples/example/definitions oracle verify --composition productionDaily --date 2026-05-31
|
|
41
|
+
|
|
42
|
+
# Inspect public metadata and the signed inventory
|
|
43
|
+
yarn cobolts -d modules/examples/example/definitions oracle inspect --composition productionDaily --date 2026-05-31
|
|
44
|
+
|
|
45
|
+
# Explicitly show one 256-bit content key (NEVER a parent/private key)
|
|
46
|
+
yarn cobolts -d modules/examples/example/definitions oracle key --composition productionDaily --date 2026-05-31 --file customers.fb
|
|
47
|
+
|
|
48
|
+
# Restore one file, optionally selecting the content key from --key-file or --key-hex
|
|
49
|
+
yarn cobolts -d modules/examples/example/definitions oracle view --composition productionDaily --date 2026-05-31 --file customers.fb --output recovered.fb
|
|
50
|
+
|
|
51
|
+
# Omit --output to emit the exact original bytes to stdout, without log messages
|
|
52
|
+
yarn cobolts -d modules/examples/example/definitions oracle view --composition productionDaily --date 2026-05-31 --file oracleDaily.jsonl
|
|
53
|
+
|
|
54
|
+
# Recover the entire run into a previously nonexistent directory
|
|
55
|
+
yarn cobolts -d modules/examples/example/definitions oracle unpack --composition productionDaily --date 2026-05-31 --output recovered-daily
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Executable smoke tests with the checked-in files (Windows PowerShell)
|
|
59
|
+
|
|
60
|
+
The `../incoming/daily.zip` examples above are **illustrative**; that ZIP is not checked in. The demo *does* contain `customers.fb` and `customer-preferences.fb` in `modules/examples/example/definitions/data`. The importer derives the required filename from the logical name in `files.yaml`, so it requires **`customerPreferences.fb`**, not the existing `customer-preferences.fb` name used by `data.yaml`. Stage a separate delivery and rename that file in the copy; do not rename the original example data, because `data.yaml` still references it.
|
|
61
|
+
|
|
62
|
+
First check the **single-file monthly** path, requiring only `customers.fb`. Generate the crypto keys once using `crypto keys generate` if they do not already exist (see [README.crypto.md](README.crypto.md)). Run all commands from the repository root:
|
|
63
|
+
|
|
64
|
+
```powershell
|
|
65
|
+
$demo = 'modules/examples/example/definitions'
|
|
66
|
+
yarn cobolts -d $demo oracle import --composition productionMonthly --date 2026-05-31 --source "$demo/data/customers.fb"
|
|
67
|
+
yarn cobolts -d $demo oracle list
|
|
68
|
+
yarn cobolts -d $demo oracle verify --composition productionMonthly --date 2026-05-31
|
|
69
|
+
yarn cobolts -d $demo oracle inspect --composition productionMonthly --date 2026-05-31 --file customers.fb --show-key
|
|
70
|
+
yarn cobolts -d $demo oracle view --composition productionMonthly --date 2026-05-31 --file customers.fb --output recovered-monthly.fb
|
|
71
|
+
fc.exe /b "$demo/data/customers.fb" recovered-monthly.fb
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The list should contain `productionMonthly/2026-05-31`, and `fc.exe` should report **no differences**. The repository package is stored at `modules/examples/example/definitions/oracle/productionMonthly/2026-05-31`.
|
|
75
|
+
|
|
76
|
+
Then check the **directory-based daily** path, including an optional published CSV/JSONL result stream:
|
|
77
|
+
|
|
78
|
+
```powershell
|
|
79
|
+
New-Item -ItemType Directory -Force -Path smoke-daily | Out-Null
|
|
80
|
+
Copy-Item "$demo/data/customers.fb" smoke-daily/customers.fb
|
|
81
|
+
Copy-Item "$demo/data/customer-preferences.fb" smoke-daily/customerPreferences.fb
|
|
82
|
+
@('{"customerId":"00001001","result":42}') | Set-Content -Encoding ascii smoke-daily/oracleDaily.jsonl
|
|
83
|
+
|
|
84
|
+
yarn cobolts -d $demo oracle import --composition productionDaily --date 2026-06-01 --source smoke-daily
|
|
85
|
+
yarn cobolts -d $demo oracle list
|
|
86
|
+
yarn cobolts -d $demo oracle verify --composition productionDaily --date 2026-06-01
|
|
87
|
+
yarn cobolts -d $demo oracle view --composition productionDaily --date 2026-06-01 --file oracleDaily.jsonl --output recovered-oracle.jsonl
|
|
88
|
+
Get-Content recovered-oracle.jsonl
|
|
89
|
+
fc.exe /b smoke-daily/oracleDaily.jsonl recovered-oracle.jsonl
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The resulting package is under `modules/examples/example/definitions/oracle/productionDaily/2026-06-01`. This demonstrates **original bytes preserved**, including the optional result stream. To check the **ZIP import** path, compress the *contents* of `smoke-daily` (not its parent folder), and import under another execution date:
|
|
93
|
+
|
|
94
|
+
```powershell
|
|
95
|
+
Compress-Archive -Path smoke-daily/* -DestinationPath smoke-daily.zip
|
|
96
|
+
yarn cobolts -d $demo oracle import --composition productionDaily --date 2026-06-02 --source smoke-daily.zip
|
|
97
|
+
yarn cobolts -d $demo oracle verify --composition productionDaily --date 2026-06-02
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Importing the same composition/date again must fail unless `--force` is specified. **`--force` deletes and replaces that complete run**, so use it only on disposable test runs. `oracle list` displays published signed packages; it is not a substitute for `oracle verify`, which decrypts and validates all files. Each `view --output` requires a previously nonexistent output filename.
|
|
101
|
+
|
|
102
|
+
## Publication and verification
|
|
103
|
+
|
|
104
|
+
1. Resolve the named relational composition, validate the execution date, read its required physical sources and validate their framing and nondecreasing original customer key using the existing typed COBOL/CSV/JSONL readers.
|
|
105
|
+
2. Reject missing required inputs and unknown binary files. Accept additional CSV/JSONL reference-result files without a secondary catalogue. For ordinary directories and individual files, validation reads the original paths and packaging streams them again without copying them to scratch. ZIP deliveries are extracted into a private temporary directory to permit validation and re-reading without buffering the entire archive in memory.
|
|
106
|
+
3. Invoke `CryptoPackager.publish(id, files, 'production')`. Each file receives a separate 256-bit content key, compressed single-entry ZIP and authenticated secretstream. The signed package includes the correct production identity, stream header, key-recovery metadata, SHA-256 and detached Ed25519 signature.
|
|
107
|
+
4. Readers require independently trusted signing keys. An interrupted write cleans up the incomplete package; the final signature is the usability marker. `--force` validates the incoming delivery first, invalidates the existing signature and fully replaces the package.
|
|
108
|
+
5. `view`/`unpack` stage results and publish only after authenticated decryption, final marker, ciphertext hash, ZIP member/framing and CRC checks. `verify` checks every file. An explicit content key bypasses key recovery, not decryption authentication or signature validation.
|
|
109
|
+
|
|
110
|
+
**Current deployment boundary:** Local filesystem and libsodium are supported. As in the crypto layer, ZIP decryption and input validation use private local scratch space. Do not assume local scratch and replacement concurrency controls satisfy a production bank policy. The exact required inventory of undeclared reference-result files and Google KMS/GCS adapters remain future work. No CLI here asserts that the validation dataset loader/compactor exists.
|
|
@@ -1,83 +1,84 @@
|
|
|
1
|
-
# Rolling windows: end-to-end verification
|
|
2
|
-
|
|
3
|
-
The `graph-1000-periodic` project is included in `benchmark init all` and
|
|
4
|
-
`benchmark list`. Regenerating it with
|
|
5
|
-
`benchmark init graph-1000-periodic -n 10000 --force` (or `init all --force`)
|
|
6
|
-
writes `.cobolts/accumulator.yaml` with `customerId.field: recordId` and
|
|
7
|
-
`customerId.type: number`. Applying a source patch alone does not rewrite an
|
|
8
|
-
existing generated project.
|
|
9
|
-
|
|
10
|
-
The `graph-1000-periodic` project contains exactly 1,000 nodes: 100 daily scalar
|
|
11
|
-
counters, 100 monthly six-observation rings, 100 CEL `sum()` consumers, 70
|
|
12
|
-
ordinary consumers of those sums, and 630 input-derived scalars. The fixture
|
|
13
|
-
starts each customer with six active monthly values (2–7), an expired value
|
|
14
|
-
(1), and a nonzero daily count (30 + customer ID modulo 5).
|
|
15
|
-
|
|
16
|
-
## Run the regression tests
|
|
17
|
-
|
|
18
|
-
From the repository root:
|
|
19
|
-
|
|
20
|
-
```powershell
|
|
21
|
-
yarn jest modules/cel/graph-runtime/src/cel.graph.periodic.integration.spec.ts --runInBand
|
|
22
|
-
yarn jest modules/cel/graph-runtime/src/cel.graph.periodicity.spec.ts --runInBand
|
|
23
|
-
yarn jest modules/cel/graph-runtime/src/cel.graph.scalar.periodicity.spec.ts --runInBand
|
|
24
|
-
yarn jest modules/cobolts/cobolts/src/benchmark.periodic.fixture.spec.ts --runInBand
|
|
25
|
-
yarn jest modules/cobolts/cobolts/src/benchmark.periodic.execution.spec.ts --runInBand
|
|
26
|
-
yarn jest modules/cursor-loader/cursor-loader-protobuf/src/protobuf.rolling.spec.ts --runInBand
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
The integration checks compare every window, sum, reset and dependent addition;
|
|
30
|
-
compare indexed and object results; verify the expired observation and physical
|
|
31
|
-
ring layout; recover from a persisted indexed checkpoint; and ensure that a
|
|
32
|
-
failed indexed transition cannot be retried against partially mutated state.
|
|
33
|
-
The existing Protobuf tests cover native and number-backed round trips (not a
|
|
34
|
-
separate Protobuf graph interpreter).
|
|
35
|
-
|
|
36
|
-
## Run the production benchmark
|
|
37
|
-
|
|
38
|
-
The generated historical fixture is read afresh for each pass; neither the
|
|
39
|
-
benchmark nor `cel execute` writes an updated checkpoint into that fixture.
|
|
40
|
-
If the project already exists, do **not** reinitialise it unless you mean to
|
|
41
|
-
replace the generated data.
|
|
42
|
-
|
|
43
|
-
```powershell
|
|
44
|
-
yarn cobolts benchmark run graph-1000-periodic -n 10000 --runs 5 --
|
|
45
|
-
yarn cobolts benchmark run graph-1000-periodic -n 10000 --runs 5 --
|
|
46
|
-
yarn cobolts benchmark run graph-1000-no-map -n 10000 --runs 5 --accumulator-strategy indexed --gc
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
For the per-generation diagnostic, run each period **separately**, with
|
|
50
|
-
`--graph-timing --timing-sample-every 100`. These timings include instrumentation
|
|
51
|
-
overhead and should not be compared to uninstrumented throughput. Use
|
|
52
|
-
`--allocation-profile` on a separate pass to write a heap sampling profile;
|
|
53
|
-
profiled timings are not baseline timings.
|
|
54
|
-
|
|
55
|
-
Expected state for the first customer's initial six-month history:
|
|
56
|
-
|
|
57
|
-
| Run | Daily counter | Logical monthly history | Expired | Window sum |
|
|
58
|
-
| --- | ---: | --- | ---: | ---: |
|
|
59
|
-
| Before execution | 31 | 2, 3, 4, 5, 6, 7 | 1 | 27 |
|
|
60
|
-
| Daily | 32 | 2, 3, 4, 5, 6, 7 | 1 | 27 |
|
|
61
|
-
| Monthly (from original fixture) | 0 | 3, 4, 5, 6, 7, 31 | 2 | 56 |
|
|
62
|
-
| Next daily (after that monthly transition) | 1 | 3, 4, 5, 6, 7, 31 | 2 | 56 |
|
|
63
|
-
|
|
64
|
-
The monthly benchmark runs **from the original fixture**, not from the result
|
|
65
|
-
of the preceding daily benchmark; therefore the first monthly insertion is 31,
|
|
66
|
-
not 32. The chronological daily-then-monthly transition is tested separately
|
|
67
|
-
by the integration tests.
|
|
68
|
-
|
|
69
|
-
## Failure and lifecycle boundary
|
|
70
|
-
|
|
71
|
-
Indexed evaluation deliberately mutates the working record in place. If it
|
|
72
|
-
throws after advancing a ring, that record is not rolled back. The session is
|
|
73
|
-
invalidated and the caller must abort the job and reload from the **last
|
|
74
|
-
committed checkpoint**. The source historical indexed file remains unchanged;
|
|
75
|
-
there is no automatic checkpoint writer in these commands. Object execution
|
|
76
|
-
uses an independent result and copy-on-write for matching windows.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
value type. There is still no
|
|
81
|
-
so callers must not run the
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
# Rolling windows: end-to-end verification
|
|
2
|
+
|
|
3
|
+
The `graph-1000-periodic` project is included in `benchmark init all` and
|
|
4
|
+
`benchmark list`. Regenerating it with
|
|
5
|
+
`benchmark init graph-1000-periodic -n 10000 --force` (or `init all --force`)
|
|
6
|
+
writes `.cobolts/accumulator.yaml` with `customerId.field: recordId` and
|
|
7
|
+
`customerId.type: number`. Applying a source patch alone does not rewrite an
|
|
8
|
+
existing generated project.
|
|
9
|
+
|
|
10
|
+
The `graph-1000-periodic` project contains exactly 1,000 nodes: 100 daily scalar
|
|
11
|
+
counters, 100 monthly six-observation rings, 100 CEL `sum()` consumers, 70
|
|
12
|
+
ordinary consumers of those sums, and 630 input-derived scalars. The fixture
|
|
13
|
+
starts each customer with six active monthly values (2–7), an expired value
|
|
14
|
+
(1), and a nonzero daily count (30 + customer ID modulo 5).
|
|
15
|
+
|
|
16
|
+
## Run the regression tests
|
|
17
|
+
|
|
18
|
+
From the repository root:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
yarn jest modules/cel/graph-runtime/src/cel.graph.periodic.integration.spec.ts --runInBand
|
|
22
|
+
yarn jest modules/cel/graph-runtime/src/cel.graph.periodicity.spec.ts --runInBand
|
|
23
|
+
yarn jest modules/cel/graph-runtime/src/cel.graph.scalar.periodicity.spec.ts --runInBand
|
|
24
|
+
yarn jest modules/cobolts/cobolts/src/benchmark.periodic.fixture.spec.ts --runInBand
|
|
25
|
+
yarn jest modules/cobolts/cobolts/src/benchmark.periodic.execution.spec.ts --runInBand
|
|
26
|
+
yarn jest modules/cursor-loader/cursor-loader-protobuf/src/protobuf.rolling.spec.ts --runInBand
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The integration checks compare every window, sum, reset and dependent addition;
|
|
30
|
+
compare indexed and object results; verify the expired observation and physical
|
|
31
|
+
ring layout; recover from a persisted indexed checkpoint; and ensure that a
|
|
32
|
+
failed indexed transition cannot be retried against partially mutated state.
|
|
33
|
+
The existing Protobuf tests cover native and number-backed round trips (not a
|
|
34
|
+
separate Protobuf graph interpreter).
|
|
35
|
+
|
|
36
|
+
## Run the production benchmark
|
|
37
|
+
|
|
38
|
+
The generated historical fixture is read afresh for each pass; neither the
|
|
39
|
+
benchmark nor `cel execute` writes an updated checkpoint into that fixture.
|
|
40
|
+
If the project already exists, do **not** reinitialise it unless you mean to
|
|
41
|
+
replace the generated data.
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
yarn cobolts benchmark run graph-1000-periodic -n 10000 --runs 5 --composition benchmark --accumulator-strategy indexed --gc
|
|
45
|
+
yarn cobolts benchmark run graph-1000-periodic -n 10000 --runs 5 --composition monthly --accumulator-strategy indexed --gc
|
|
46
|
+
yarn cobolts benchmark run graph-1000-no-map -n 10000 --runs 5 --composition benchmark --accumulator-strategy indexed --gc
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
For the per-generation diagnostic, run each period **separately**, with
|
|
50
|
+
`--graph-timing --timing-sample-every 100`. These timings include instrumentation
|
|
51
|
+
overhead and should not be compared to uninstrumented throughput. Use
|
|
52
|
+
`--allocation-profile` on a separate pass to write a heap sampling profile;
|
|
53
|
+
profiled timings are not baseline timings.
|
|
54
|
+
|
|
55
|
+
Expected state for the first customer's initial six-month history:
|
|
56
|
+
|
|
57
|
+
| Run | Daily counter | Logical monthly history | Expired | Window sum |
|
|
58
|
+
| --- | ---: | --- | ---: | ---: |
|
|
59
|
+
| Before execution | 31 | 2, 3, 4, 5, 6, 7 | 1 | 27 |
|
|
60
|
+
| Daily | 32 | 2, 3, 4, 5, 6, 7 | 1 | 27 |
|
|
61
|
+
| Monthly (from original fixture) | 0 | 3, 4, 5, 6, 7, 31 | 2 | 56 |
|
|
62
|
+
| Next daily (after that monthly transition) | 1 | 3, 4, 5, 6, 7, 31 | 2 | 56 |
|
|
63
|
+
|
|
64
|
+
The monthly benchmark runs **from the original fixture**, not from the result
|
|
65
|
+
of the preceding daily benchmark; therefore the first monthly insertion is 31,
|
|
66
|
+
not 32. The chronological daily-then-monthly transition is tested separately
|
|
67
|
+
by the integration tests.
|
|
68
|
+
|
|
69
|
+
## Failure and lifecycle boundary
|
|
70
|
+
|
|
71
|
+
Indexed evaluation deliberately mutates the working record in place. If it
|
|
72
|
+
throws after advancing a ring, that record is not rolled back. The session is
|
|
73
|
+
invalidated and the caller must abort the job and reload from the **last
|
|
74
|
+
committed checkpoint**. The source historical indexed file remains unchanged;
|
|
75
|
+
there is no automatic checkpoint writer in these commands. Object execution
|
|
76
|
+
uses an independent result and copy-on-write for matching windows.
|
|
77
|
+
|
|
78
|
+
The selected named relational composition supplies `variables.periodicity`:
|
|
79
|
+
`benchmark` is daily and `monthly` is monthly for this fixture. Other graph-level
|
|
80
|
+
periodicity strings are not prohibited by the value type. There is still no
|
|
81
|
+
period identity or exactly-once calendar policy, so callers must not run the
|
|
82
|
+
same logical monthly transition twice. Specialised
|
|
83
|
+
incremental aggregators are also outside this work: window sums use the
|
|
84
|
+
existing CEL collection visitor.
|