@graphrefly/graphrefly 0.44.0 → 0.45.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/README.md +21 -17
- package/dist/compat/index.cjs +20 -10
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +1 -22
- package/dist/compat/index.d.ts +1 -22
- package/dist/compat/index.js +3 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +21 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +1 -2
- package/dist/compat/jotai/index.d.ts +1 -2
- package/dist/compat/jotai/index.js +3 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +21 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +1 -2
- package/dist/compat/nanostores/index.d.ts +1 -2
- package/dist/compat/nanostores/index.js +3 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +20 -10
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +1 -13
- package/dist/compat/nestjs/index.d.ts +1 -13
- package/dist/compat/nestjs/index.js +3 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +21 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +1 -2
- package/dist/compat/react/index.d.ts +1 -2
- package/dist/compat/react/index.js +3 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +21 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +1 -2
- package/dist/compat/solid/index.d.ts +1 -2
- package/dist/compat/solid/index.js +3 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +21 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +1 -2
- package/dist/compat/svelte/index.d.ts +1 -2
- package/dist/compat/svelte/index.js +3 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +21 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +1 -3
- package/dist/compat/vue/index.d.ts +1 -3
- package/dist/compat/vue/index.js +3 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +21 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +1 -6
- package/dist/compat/zustand/index.d.ts +1 -6
- package/dist/compat/zustand/index.js +3 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +21 -1
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1 -3
- package/dist/core/index.d.ts +1 -3
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -0
- package/dist/extra/browser.cjs +21 -1
- package/dist/extra/browser.cjs.map +1 -0
- package/dist/extra/browser.d.cts +1 -4
- package/dist/extra/browser.d.ts +1 -4
- package/dist/extra/browser.js +3 -1
- package/dist/extra/browser.js.map +1 -0
- package/dist/extra/index.cjs +20 -19
- package/dist/extra/index.cjs.map +1 -0
- package/dist/extra/index.d.cts +1 -17
- package/dist/extra/index.d.ts +1 -17
- package/dist/extra/index.js +3 -1
- package/dist/extra/index.js.map +1 -0
- package/dist/extra/node.cjs +21 -2
- package/dist/extra/node.cjs.map +1 -0
- package/dist/extra/node.d.cts +1 -187
- package/dist/extra/node.d.ts +1 -187
- package/dist/extra/node.js +3 -2
- package/dist/extra/node.js.map +1 -0
- package/dist/extra/operators.cjs +21 -1
- package/dist/extra/operators.cjs.map +1 -0
- package/dist/extra/operators.d.cts +1 -958
- package/dist/extra/operators.d.ts +1 -958
- package/dist/extra/operators.js +3 -1
- package/dist/extra/operators.js.map +1 -0
- package/dist/extra/reactive.cjs +21 -1
- package/dist/extra/reactive.cjs.map +1 -0
- package/dist/extra/reactive.d.cts +1 -353
- package/dist/extra/reactive.d.ts +1 -353
- package/dist/extra/reactive.js +3 -1
- package/dist/extra/reactive.js.map +1 -0
- package/dist/extra/render/index.cjs +21 -5
- package/dist/extra/render/index.cjs.map +1 -0
- package/dist/extra/render/index.d.cts +1 -183
- package/dist/extra/render/index.d.ts +1 -183
- package/dist/extra/render/index.js +3 -1
- package/dist/extra/render/index.js.map +1 -0
- package/dist/extra/sources.cjs +21 -3
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +1 -584
- package/dist/extra/sources.d.ts +1 -584
- package/dist/extra/sources.js +3 -1
- package/dist/extra/sources.js.map +1 -0
- package/dist/extra/storage-browser.cjs +21 -1
- package/dist/extra/storage-browser.cjs.map +1 -0
- package/dist/extra/storage-browser.d.cts +1 -37
- package/dist/extra/storage-browser.d.ts +1 -37
- package/dist/extra/storage-browser.js +3 -1
- package/dist/extra/storage-browser.js.map +1 -0
- package/dist/extra/storage-core.cjs +21 -1
- package/dist/extra/storage-core.cjs.map +1 -0
- package/dist/extra/storage-core.d.cts +1 -28
- package/dist/extra/storage-core.d.ts +1 -28
- package/dist/extra/storage-core.js +3 -1
- package/dist/extra/storage-core.js.map +1 -0
- package/dist/extra/storage-node.cjs +20 -0
- package/dist/extra/storage-node.cjs.map +1 -0
- package/dist/extra/storage-node.d.cts +1 -2
- package/dist/extra/storage-node.d.ts +1 -2
- package/dist/extra/storage-node.js +3 -0
- package/dist/extra/storage-node.js.map +1 -0
- package/dist/extra/storage-tiers-browser.cjs +21 -1
- package/dist/extra/storage-tiers-browser.cjs.map +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +1 -120
- package/dist/extra/storage-tiers-browser.d.ts +1 -120
- package/dist/extra/storage-tiers-browser.js +3 -1
- package/dist/extra/storage-tiers-browser.js.map +1 -0
- package/dist/extra/storage-tiers-node.cjs +21 -1
- package/dist/extra/storage-tiers-node.cjs.map +1 -0
- package/dist/extra/storage-tiers-node.d.cts +1 -210
- package/dist/extra/storage-tiers-node.d.ts +1 -210
- package/dist/extra/storage-tiers-node.js +3 -1
- package/dist/extra/storage-tiers-node.js.map +1 -0
- package/dist/extra/storage-tiers.cjs +21 -1
- package/dist/extra/storage-tiers.cjs.map +1 -0
- package/dist/extra/storage-tiers.d.cts +1 -412
- package/dist/extra/storage-tiers.d.ts +1 -412
- package/dist/extra/storage-tiers.js +3 -1
- package/dist/extra/storage-tiers.js.map +1 -0
- package/dist/extra/storage-wal.cjs +21 -0
- package/dist/extra/storage-wal.cjs.map +1 -0
- package/dist/extra/storage-wal.d.cts +1 -0
- package/dist/extra/storage-wal.d.ts +1 -0
- package/dist/extra/storage-wal.js +3 -0
- package/dist/extra/storage-wal.js.map +1 -0
- package/dist/graph/index.cjs +21 -7
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +1 -7
- package/dist/graph/index.d.ts +1 -7
- package/dist/graph/index.js +3 -1
- package/dist/graph/index.js.map +1 -0
- package/dist/index.cjs +20 -227
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -95
- package/dist/index.d.ts +45 -95
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -0
- package/dist/patterns/ai/browser.cjs +20 -7
- package/dist/patterns/ai/browser.cjs.map +1 -0
- package/dist/patterns/ai/browser.d.cts +1 -127
- package/dist/patterns/ai/browser.d.ts +1 -127
- package/dist/patterns/ai/browser.js +3 -3
- package/dist/patterns/ai/browser.js.map +1 -0
- package/dist/patterns/ai/index.cjs +20 -73
- package/dist/patterns/ai/index.cjs.map +1 -0
- package/dist/patterns/ai/index.d.cts +1 -20
- package/dist/patterns/ai/index.d.ts +1 -20
- package/dist/patterns/ai/index.js +3 -1
- package/dist/patterns/ai/index.js.map +1 -0
- package/dist/patterns/ai/node.cjs +21 -1
- package/dist/patterns/ai/node.cjs.map +1 -0
- package/dist/patterns/ai/node.d.cts +1 -59
- package/dist/patterns/ai/node.d.ts +1 -59
- package/dist/patterns/ai/node.js +3 -1
- package/dist/patterns/ai/node.js.map +1 -0
- package/dist/patterns/cqrs/index.cjs +21 -3
- package/dist/patterns/cqrs/index.cjs.map +1 -0
- package/dist/patterns/cqrs/index.d.cts +1 -8
- package/dist/patterns/cqrs/index.d.ts +1 -8
- package/dist/patterns/cqrs/index.js +3 -1
- package/dist/patterns/cqrs/index.js.map +1 -0
- package/dist/patterns/demo-shell/index.cjs +21 -5
- package/dist/patterns/demo-shell/index.cjs.map +1 -0
- package/dist/patterns/demo-shell/index.d.cts +1 -7
- package/dist/patterns/demo-shell/index.d.ts +1 -7
- package/dist/patterns/demo-shell/index.js +3 -1
- package/dist/patterns/demo-shell/index.js.map +1 -0
- package/dist/patterns/domain-templates/index.cjs +21 -3
- package/dist/patterns/domain-templates/index.cjs.map +1 -0
- package/dist/patterns/domain-templates/index.d.cts +1 -6
- package/dist/patterns/domain-templates/index.d.ts +1 -6
- package/dist/patterns/domain-templates/index.js +3 -1
- package/dist/patterns/domain-templates/index.js.map +1 -0
- package/dist/patterns/graphspec/index.cjs +21 -86
- package/dist/patterns/graphspec/index.cjs.map +1 -0
- package/dist/patterns/graphspec/index.d.cts +1 -8
- package/dist/patterns/graphspec/index.d.ts +1 -8
- package/dist/patterns/graphspec/index.js +3 -1
- package/dist/patterns/graphspec/index.js.map +1 -0
- package/dist/patterns/harness/index.cjs +21 -48
- package/dist/patterns/harness/index.cjs.map +1 -0
- package/dist/patterns/harness/index.d.cts +1 -13
- package/dist/patterns/harness/index.d.ts +1 -13
- package/dist/patterns/harness/index.js +3 -1
- package/dist/patterns/harness/index.js.map +1 -0
- package/dist/patterns/inspect/index.cjs +21 -3
- package/dist/patterns/inspect/index.cjs.map +1 -0
- package/dist/patterns/inspect/index.d.cts +1 -9
- package/dist/patterns/inspect/index.d.ts +1 -9
- package/dist/patterns/inspect/index.js +3 -1
- package/dist/patterns/inspect/index.js.map +1 -0
- package/dist/patterns/job-queue/index.cjs +21 -3
- package/dist/patterns/job-queue/index.cjs.map +1 -0
- package/dist/patterns/job-queue/index.d.cts +1 -9
- package/dist/patterns/job-queue/index.d.ts +1 -9
- package/dist/patterns/job-queue/index.js +3 -1
- package/dist/patterns/job-queue/index.js.map +1 -0
- package/dist/patterns/memory/index.cjs +21 -3
- package/dist/patterns/memory/index.cjs.map +1 -0
- package/dist/patterns/memory/index.d.cts +1 -8
- package/dist/patterns/memory/index.d.ts +1 -8
- package/dist/patterns/memory/index.js +3 -1
- package/dist/patterns/memory/index.js.map +1 -0
- package/dist/patterns/messaging/index.cjs +21 -3
- package/dist/patterns/messaging/index.cjs.map +1 -0
- package/dist/patterns/messaging/index.d.cts +1 -7
- package/dist/patterns/messaging/index.d.ts +1 -7
- package/dist/patterns/messaging/index.js +3 -1
- package/dist/patterns/messaging/index.js.map +1 -0
- package/dist/patterns/orchestration/index.cjs +21 -3
- package/dist/patterns/orchestration/index.cjs.map +1 -0
- package/dist/patterns/orchestration/index.d.cts +1 -8
- package/dist/patterns/orchestration/index.d.ts +1 -8
- package/dist/patterns/orchestration/index.js +3 -1
- package/dist/patterns/orchestration/index.js.map +1 -0
- package/dist/patterns/process/index.cjs +21 -3
- package/dist/patterns/process/index.cjs.map +1 -0
- package/dist/patterns/process/index.d.cts +1 -10
- package/dist/patterns/process/index.d.ts +1 -10
- package/dist/patterns/process/index.js +3 -1
- package/dist/patterns/process/index.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +21 -4
- package/dist/patterns/reactive-layout/index.cjs.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +1 -7
- package/dist/patterns/reactive-layout/index.d.ts +1 -7
- package/dist/patterns/reactive-layout/index.js +3 -1
- package/dist/patterns/reactive-layout/index.js.map +1 -0
- package/dist/patterns/reduction/index.cjs +21 -3
- package/dist/patterns/reduction/index.cjs.map +1 -0
- package/dist/patterns/reduction/index.d.cts +1 -6
- package/dist/patterns/reduction/index.d.ts +1 -6
- package/dist/patterns/reduction/index.js +3 -1
- package/dist/patterns/reduction/index.js.map +1 -0
- package/dist/patterns/surface/index.cjs +21 -13
- package/dist/patterns/surface/index.cjs.map +1 -0
- package/dist/patterns/surface/index.d.cts +1 -9
- package/dist/patterns/surface/index.d.ts +1 -9
- package/dist/patterns/surface/index.js +3 -1
- package/dist/patterns/surface/index.js.map +1 -0
- package/dist/patterns/topology-view/index.cjs +21 -0
- package/dist/patterns/topology-view/index.cjs.map +1 -0
- package/dist/patterns/topology-view/index.d.cts +1 -0
- package/dist/patterns/topology-view/index.d.ts +1 -0
- package/dist/patterns/topology-view/index.js +3 -0
- package/dist/patterns/topology-view/index.js.map +1 -0
- package/dist/testing/index.cjs +21 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +608 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/cascading-BglDkMdX.d.cts +0 -199
- package/dist/cascading-MFgxu7Yo.d.ts +0 -199
- package/dist/chunk-2T7U5EU6.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-5M4CCMMD.js +0 -45
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-5XJ6B66J.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-6X7AFUJV.js +0 -9
- package/dist/chunk-7K6PWTDQ.js +0 -1
- package/dist/chunk-7LIAPXJB.js +0 -1
- package/dist/chunk-7WPU3UHQ.js +0 -1
- package/dist/chunk-A5WCQ5NO.js +0 -1
- package/dist/chunk-APPIWSGD.js +0 -84
- package/dist/chunk-BEZWM2SY.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CB676TKJ.js +0 -1
- package/dist/chunk-CE6TI2TL.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLVB32RD.js +0 -1
- package/dist/chunk-CRVT7D2P.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-D7GPHKFH.js +0 -1
- package/dist/chunk-DHRX7JX4.js +0 -2
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FZMYDOWV.js +0 -1
- package/dist/chunk-GHBWHMRZ.js +0 -1
- package/dist/chunk-GLERH466.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-HIDYF36O.js +0 -1
- package/dist/chunk-HITNVN6B.js +0 -3
- package/dist/chunk-HY4DJBA7.js +0 -5
- package/dist/chunk-KZIEYVXN.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-N4MQX6JU.js +0 -18
- package/dist/chunk-N7FHEL4D.js +0 -1
- package/dist/chunk-NTEURFZH.js +0 -1
- package/dist/chunk-OIVP6KFV.js +0 -1
- package/dist/chunk-OPHBU3LG.js +0 -1
- package/dist/chunk-OYQOZP2F.js +0 -5
- package/dist/chunk-PTZK576G.js +0 -1
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-ST7UXLWR.js +0 -1
- package/dist/chunk-SVY7VUYU.js +0 -1
- package/dist/chunk-TK3NWWD4.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-UNGSTR4X.js +0 -61
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VV4N5P64.js +0 -1
- package/dist/chunk-W3I423PS.js +0 -1
- package/dist/chunk-WJR24TAG.js +0 -1
- package/dist/chunk-XTGKMHSW.js +0 -1
- package/dist/chunk-YBB7ZGTY.js +0 -1
- package/dist/chunk-Z4NPUARF.js +0 -1
- package/dist/chunk-ZGNQRPDT.js +0 -1
- package/dist/chunk-ZKPSFFKU.js +0 -1
- package/dist/chunk-ZLV5SQSX.js +0 -1
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/fallback-74oxi34l.d.cts +0 -250
- package/dist/fallback-DUyyBTBK.d.ts +0 -250
- package/dist/graph-CWvEUQAq.d.cts +0 -1861
- package/dist/graph-D9LFnda9.d.ts +0 -1861
- package/dist/index-5k1T6jl0.d.cts +0 -121
- package/dist/index-9770hRuQ.d.cts +0 -779
- package/dist/index-B-_tFaqV.d.cts +0 -468
- package/dist/index-B17QddL1.d.cts +0 -374
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-B5S8ULbU.d.ts +0 -515
- package/dist/index-B8YnZpIR.d.ts +0 -102
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BQSKmbuG.d.cts +0 -127
- package/dist/index-BaQaY_IQ.d.cts +0 -231
- package/dist/index-BmZXHqkE.d.ts +0 -36
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BrPrLl4e.d.cts +0 -86
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-Byu-OpX_.d.ts +0 -113
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C5stwKcw.d.cts +0 -44
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CBBLl_rc.d.ts +0 -127
- package/dist/index-CBGUK09R.d.ts +0 -754
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CK29LV56.d.cts +0 -34
- package/dist/index-CMh5Rz1y.d.ts +0 -385
- package/dist/index-CPQlGA29.d.ts +0 -34
- package/dist/index-CR8QpwX8.d.ts +0 -2680
- package/dist/index-CS0LTlB8.d.cts +0 -385
- package/dist/index-CSOmP7xT.d.cts +0 -291
- package/dist/index-CYq8vAyV.d.ts +0 -291
- package/dist/index-CZ3r5Rxp.d.ts +0 -374
- package/dist/index-CasX6Pfq.d.cts +0 -358
- package/dist/index-CdAlHFEt.d.ts +0 -44
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-CeFiHtAg.d.ts +0 -468
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Climxqsu.d.cts +0 -754
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-CviRnE4K.d.ts +0 -45
- package/dist/index-Cwv0KWcU.d.cts +0 -102
- package/dist/index-CzLVrjxn.d.ts +0 -231
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-DV_1YuVk.d.cts +0 -221
- package/dist/index-Dc4AYqrJ.d.cts +0 -515
- package/dist/index-Dgl1HpPn.d.ts +0 -86
- package/dist/index-DisjX8a-.d.ts +0 -221
- package/dist/index-UPSiS-X7.d.cts +0 -2680
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-ZVQhLa2i.d.cts +0 -37
- package/dist/index-_6ODbuOu.d.cts +0 -45
- package/dist/index-hcDJ8PSI.d.cts +0 -36
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/index-p09KSrTN.d.ts +0 -358
- package/dist/index-sqkqlb1p.d.ts +0 -37
- package/dist/index-tRCxuAXF.d.cts +0 -113
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/observable-DWjNfLvC.d.ts +0 -36
- package/dist/observable-e3eiPPFy.d.cts +0 -36
- package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
- package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
- package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
- package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
- package/dist/reactive-log-BKALbfal.d.ts +0 -223
- package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
- package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
- package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
- package/dist/resilience-6LYQJAC5.js +0 -1
- package/dist/sugar-DQjFmVqb.d.cts +0 -399
- package/dist/sugar-fhLIE7TT.d.ts +0 -399
- package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
- package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
- package/dist/types-C0_yquda.d.cts +0 -442
- package/dist/types-CWFysE9E.d.ts +0 -442
|
@@ -1,1858 +0,0 @@
|
|
|
1
|
-
import { NodeInput } from './extra/sources.cjs';
|
|
2
|
-
import { N as Node } from './node-kK3CvTrR.cjs';
|
|
3
|
-
import { L as LLMAdapter } from './types-C0_yquda.cjs';
|
|
4
|
-
import { J as JobEnvelope, a as JobFlowGraph, b as JobQueueGraph } from './index-DV_1YuVk.cjs';
|
|
5
|
-
import { T as TopicGraph, M as MessagingHubGraph } from './index-C5ri2Axc.cjs';
|
|
6
|
-
import { a as GraphOptions, G as Graph, t as GraphProfileResult, s as GraphProfileOptions } from './graph-CWvEUQAq.cjs';
|
|
7
|
-
import { G as GateController } from './pipeline-graph-CIKhynsF.cjs';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Strategy model and priority scoring (roadmap §9.0).
|
|
11
|
-
*
|
|
12
|
-
* Pure-computation derived nodes — no LLM, no async.
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/** Snapshot shape for the strategy model node. */
|
|
18
|
-
type StrategySnapshot = ReadonlyMap<StrategyKey, StrategyEntry>;
|
|
19
|
-
/** Bundle returned by {@link strategyModel}. */
|
|
20
|
-
interface StrategyModelBundle {
|
|
21
|
-
/** Reactive node — current strategy map. */
|
|
22
|
-
readonly node: Node<StrategySnapshot>;
|
|
23
|
-
/** Record a completed issue (success or failure). */
|
|
24
|
-
record(rootCause: RootCause, intervention: Intervention, success: boolean): void;
|
|
25
|
-
/** Look up effectiveness for a specific pair. */
|
|
26
|
-
lookup(rootCause: RootCause, intervention: Intervention): StrategyEntry | undefined;
|
|
27
|
-
/** Tear down internal keepalive subscriptions. */
|
|
28
|
-
dispose(): void;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Create a strategy model that tracks `rootCause × intervention → successRate`
|
|
32
|
-
* over completed issues. Pure derived computation — no LLM.
|
|
33
|
-
*
|
|
34
|
-
* The model feeds back into TRIAGE for routing hints.
|
|
35
|
-
*/
|
|
36
|
-
declare function strategyModel(): StrategyModelBundle;
|
|
37
|
-
/**
|
|
38
|
-
* Create a priority scoring derived node for a single triaged item.
|
|
39
|
-
*
|
|
40
|
-
* Combines severity weight, attention decay, strategy model effectiveness,
|
|
41
|
-
* and an optional external urgency signal.
|
|
42
|
-
*
|
|
43
|
-
* **Age sampling caveat.** The `ageSeconds` term is computed as
|
|
44
|
-
* `monotonicNs() - lastInteractionNs.cache` at *each reactive update*. If
|
|
45
|
-
* nothing upstream settles, the score node does not recompute — so a
|
|
46
|
-
* long-idle queue may show a stale score. Pass a `fromTimer(...)`-driven
|
|
47
|
-
* node as a dep (or re-emit on `lastInteractionNs`) when live age decay
|
|
48
|
-
* matters.
|
|
49
|
-
*
|
|
50
|
-
* **Not the same as `TriagedItem.priority`.** The LLM-emitted
|
|
51
|
-
* `priority: 0..100` field on each triaged item is decorative today — the
|
|
52
|
-
* queue consumption order ignores it (tracked in `docs/optimizations.md`
|
|
53
|
-
* as a priority-ordered queue enhancement). This function computes an
|
|
54
|
-
* orthogonal reactive score; it does NOT override the LLM's per-item
|
|
55
|
-
* priority, nor does it drive queue ordering. Wire it to
|
|
56
|
-
* `HarnessGraph.priorityScores` to surface per-route pressure.
|
|
57
|
-
*
|
|
58
|
-
* @param item - Node holding the triaged item.
|
|
59
|
-
* @param strategy - Strategy model node.
|
|
60
|
-
* @param lastInteractionNs - Node holding the monotonic timestamp (ns) of last human interaction.
|
|
61
|
-
* @param urgency - Optional external urgency signal node (0–1 scale).
|
|
62
|
-
* @param signals - Configurable scoring parameters.
|
|
63
|
-
*/
|
|
64
|
-
declare function priorityScore(item: Node<TriagedItem>, strategy: Node<StrategySnapshot>, lastInteractionNs: Node<number>, urgency?: Node<number>, signals?: PrioritySignals): Node<number>;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Harness runtime defaults (roadmap §9.0).
|
|
68
|
-
*
|
|
69
|
-
* Split out from `types.ts` in Wave B Unit 15 G so the type file holds
|
|
70
|
-
* only type declarations and plug-in contracts. Runtime constants and
|
|
71
|
-
* helpers live here; the harness barrel (`index.ts`) re-exports both so
|
|
72
|
-
* external consumers see a single surface.
|
|
73
|
-
*
|
|
74
|
-
* @module
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
/** Ordered queue route names for iteration. */
|
|
78
|
-
declare const QUEUE_NAMES: readonly QueueRoute[];
|
|
79
|
-
/** Default queue configurations. */
|
|
80
|
-
declare const DEFAULT_QUEUE_CONFIGS: Record<QueueRoute, QueueConfig>;
|
|
81
|
-
/** Default severity weights. */
|
|
82
|
-
declare const DEFAULT_SEVERITY_WEIGHTS: Record<Severity, number>;
|
|
83
|
-
/** Default decay rate: ~7-day half-life. */
|
|
84
|
-
declare const DEFAULT_DECAY_RATE: number;
|
|
85
|
-
/** Canonical `${RootCause}→${Intervention}` join char; used by the `StrategyKey` template literal. */
|
|
86
|
-
declare function strategyKey(rootCause: RootCause, intervention: Intervention): StrategyKey;
|
|
87
|
-
/** Default error classifier: parse/config errors are self-correctable. */
|
|
88
|
-
declare const defaultErrorClassifier: ErrorClassifier;
|
|
89
|
-
/** Default TRIAGE prompt — LLM classifies intake items into root-cause + intervention + route + priority. */
|
|
90
|
-
declare const DEFAULT_TRIAGE_PROMPT = "You are a triage classifier for a reactive collaboration harness.\n\nGiven an intake item, classify it and output JSON:\n{\n \"rootCause\": \"composition\" | \"missing-fn\" | \"bad-docs\" | \"schema-gap\" | \"regression\" | \"unknown\",\n \"intervention\": \"template\" | \"catalog-fn\" | \"docs\" | \"wrapper\" | \"schema-change\" | \"investigate\",\n \"route\": \"auto-fix\" | \"needs-decision\" | \"investigation\" | \"backlog\",\n \"priority\": <number 0-100>,\n \"triageReasoning\": \"<one sentence>\"\n}\n\nStrategy model (past effectiveness):\n{{strategy}}\n\nIntake item:\n{{item}}";
|
|
91
|
-
/** Default EXECUTE prompt — LLM produces a fix given a triaged issue. */
|
|
92
|
-
declare const DEFAULT_EXECUTE_PROMPT = "You are an implementation agent.\n\nGiven a triaged issue with root cause and intervention type, produce a fix.\n\nIssue:\n{{item}}\n\nOutput JSON:\n{\n \"outcome\": \"success\" | \"failure\" | \"partial\",\n \"detail\": \"<description of what was done or what failed>\"\n}";
|
|
93
|
-
/** Default VERIFY prompt — LLM reviews an execution result against the original issue. */
|
|
94
|
-
declare const DEFAULT_VERIFY_PROMPT = "You are a QA reviewer.\n\nGiven an execution result, verify whether the fix is correct.\n\nExecution:\n{{execution}}\n\nOriginal issue:\n{{item}}\n\nOutput JSON:\n{\n \"verified\": true/false,\n \"findings\": [\"<finding1>\", ...],\n \"errorClass\": \"self-correctable\" | \"structural\" // only if verified=false\n}";
|
|
95
|
-
/**
|
|
96
|
-
* Collapse the `string | ((input: In) => string) | undefined` prompt-template
|
|
97
|
-
* pattern into a single `(input: In) => string`. A function `raw` is used as-is
|
|
98
|
-
* (the caller opted into full control). Otherwise `raw ?? fallbackTemplate`
|
|
99
|
-
* is fed through `substitute`, which does the placeholder replacement.
|
|
100
|
-
*
|
|
101
|
-
* Used by the three harness stages (TRIAGE / EXECUTE / VERIFY), which each
|
|
102
|
-
* accept a `string | function` config but use different placeholder schemes
|
|
103
|
-
* (`{{item}}`, `{{execution}}`, `{{strategy}}`). The helper absorbs only the
|
|
104
|
-
* branch logic; the per-stage placeholder substitution lives at the call site.
|
|
105
|
-
*/
|
|
106
|
-
declare function resolvePromptFn<In>(raw: string | ((input: In) => string) | undefined, fallbackTemplate: string, substitute: (template: string, input: In) => string): (input: In) => string;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Harness wiring types (roadmap §9.0).
|
|
110
|
-
*
|
|
111
|
-
* Shared types for the reactive collaboration loop: intake, triage, queue,
|
|
112
|
-
* gate, execute, verify, reflect. These types are intentionally domain-agnostic
|
|
113
|
-
* — the harness loop is not specific to eval workflows.
|
|
114
|
-
*
|
|
115
|
-
* Runtime constants and helpers live in `./defaults.ts`. The harness barrel
|
|
116
|
-
* (`./index.ts`) re-exports both so external consumers see a single surface.
|
|
117
|
-
*
|
|
118
|
-
* @module
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
/** Known intake source tags. */
|
|
122
|
-
type KnownIntakeSource = "eval" | "test" | "human" | "code-change" | "hypothesis" | "parity";
|
|
123
|
-
/**
|
|
124
|
-
* Sources that can produce intake items. Open union — the known tags
|
|
125
|
-
* retain IDE autocomplete while user-supplied strings (e.g. `"schema"`,
|
|
126
|
-
* `"slack"`) pass through without a type change.
|
|
127
|
-
*/
|
|
128
|
-
type IntakeSource = KnownIntakeSource | (string & {});
|
|
129
|
-
/** Severity levels for intake items. */
|
|
130
|
-
type Severity = "critical" | "high" | "medium" | "low";
|
|
131
|
-
/** Root cause categories for triage classification. */
|
|
132
|
-
type RootCause = "composition" | "missing-fn" | "bad-docs" | "schema-gap" | "regression" | "unknown";
|
|
133
|
-
/** Intervention types that address root causes. */
|
|
134
|
-
type Intervention = "template" | "catalog-fn" | "docs" | "wrapper" | "schema-change" | "investigate";
|
|
135
|
-
/** Routing destinations after triage. Closed union — iterated via `QUEUE_NAMES`. */
|
|
136
|
-
type QueueRoute = "auto-fix" | "needs-decision" | "investigation" | "backlog";
|
|
137
|
-
/**
|
|
138
|
-
* An item entering the harness loop via the INTAKE stage.
|
|
139
|
-
*
|
|
140
|
-
* All intake sources produce this uniform shape — the intake topic
|
|
141
|
-
* doesn't care where items came from.
|
|
142
|
-
*
|
|
143
|
-
* `$`-prefix keys (`$reingestions`, `$retries` on {@link TriagedItem}) are
|
|
144
|
-
* framework-only — an LLM round-tripping the serialized item is far less
|
|
145
|
-
* likely to echo back a `$`-prefixed key than an `_`-prefixed one, which
|
|
146
|
-
* neutralizes the field-collision class that surfaced earlier in the
|
|
147
|
-
* router's spread order.
|
|
148
|
-
*/
|
|
149
|
-
interface IntakeItem {
|
|
150
|
-
source: IntakeSource;
|
|
151
|
-
summary: string;
|
|
152
|
-
evidence: string;
|
|
153
|
-
affectsAreas: string[];
|
|
154
|
-
affectsEvalTasks?: string[];
|
|
155
|
-
severity?: Severity;
|
|
156
|
-
/**
|
|
157
|
-
* Stable identity carrier for retry / reingestion paths. Per qa D1
|
|
158
|
-
* (2026-04-29), `relatedTo[0]` MUST be the original tracking key for
|
|
159
|
-
* items derived from a prior publish so the harness's `routeJobIds`
|
|
160
|
-
* map preserves identity across decorated retry summaries. First-time
|
|
161
|
-
* publishes leave this `undefined`; the tracking key falls back to
|
|
162
|
-
* `summary`. Two first-time publishes with identical `summary` collide
|
|
163
|
-
* on key — see `trackingKey` JSDoc in `patterns/_internal/index.ts`
|
|
164
|
-
* for the uniqueness caller contract.
|
|
165
|
-
*/
|
|
166
|
-
relatedTo?: string[];
|
|
167
|
-
/** Item-carried reingestion count. Incremented on each full-loop reingestion. */
|
|
168
|
-
$reingestions?: number;
|
|
169
|
-
}
|
|
170
|
-
/** Output of the TRIAGE stage — enriched intake item with classification. */
|
|
171
|
-
interface TriagedItem extends IntakeItem {
|
|
172
|
-
rootCause: RootCause;
|
|
173
|
-
intervention: Intervention;
|
|
174
|
-
route: QueueRoute;
|
|
175
|
-
priority: number;
|
|
176
|
-
triageReasoning?: string;
|
|
177
|
-
/** Item-carried retry count. Incremented on each fast-retry pass. */
|
|
178
|
-
$retries?: number;
|
|
179
|
-
}
|
|
180
|
-
/** Effectiveness record for a rootCause→intervention pair. */
|
|
181
|
-
interface StrategyEntry {
|
|
182
|
-
rootCause: RootCause;
|
|
183
|
-
intervention: Intervention;
|
|
184
|
-
attempts: number;
|
|
185
|
-
successes: number;
|
|
186
|
-
successRate: number;
|
|
187
|
-
}
|
|
188
|
-
/** Key format: `${rootCause}→${intervention}`. */
|
|
189
|
-
type StrategyKey = `${RootCause}→${Intervention}`;
|
|
190
|
-
/**
|
|
191
|
-
* LLM output shape from the EXECUTE stage (partial — lacks `item`).
|
|
192
|
-
*
|
|
193
|
-
* Generic over the artifact type `A` so typed executors like
|
|
194
|
-
* `refineExecutor<T>` can flow `T` through to an `evalVerifier<T>` without
|
|
195
|
-
* the caller casting `artifact` at the boundary. Defaults to `unknown`
|
|
196
|
-
* for escape-hatch executors that carry opaque state.
|
|
197
|
-
*/
|
|
198
|
-
type ExecuteOutput<A = unknown> = {
|
|
199
|
-
/**
|
|
200
|
-
* Execution outcome classification:
|
|
201
|
-
*
|
|
202
|
-
* - `"success"`: execution completed cleanly and the artifact (if any) is
|
|
203
|
-
* ready for verification. The verifier should proceed with a full
|
|
204
|
-
* evaluation pass.
|
|
205
|
-
* - `"failure"`: execution did not produce a usable artifact — the actuator
|
|
206
|
-
* threw, a prompt parse failed, or `shouldApply` skipped the item. The
|
|
207
|
-
* verifier should treat this as a non-result and route accordingly.
|
|
208
|
-
* - `"partial"`: execution produced a candidate that converged but did not
|
|
209
|
-
* fully meet verification criteria. Used by `refineExecutor` when the
|
|
210
|
-
* iteration cap is reached without full convergence; the artifact holds
|
|
211
|
-
* the best candidate achieved.
|
|
212
|
-
*/
|
|
213
|
-
outcome: "success" | "failure" | "partial";
|
|
214
|
-
detail: string;
|
|
215
|
-
/**
|
|
216
|
-
* Optional opaque artifact that a custom executor (e.g. `refineExecutor`)
|
|
217
|
-
* may attach so downstream verifiers can re-run evaluation against the
|
|
218
|
-
* thing that was produced. LLM-backed default executors never populate
|
|
219
|
-
* this — it's an escape hatch for reactive executors carrying structured
|
|
220
|
-
* output (a refined prompt, a patched spec, a generated template, ...).
|
|
221
|
-
*/
|
|
222
|
-
artifact?: A;
|
|
223
|
-
};
|
|
224
|
-
/** Full execution result assembled downstream (LLM output + context). */
|
|
225
|
-
interface ExecutionResult<A = unknown> {
|
|
226
|
-
item: TriagedItem;
|
|
227
|
-
/**
|
|
228
|
-
* Execution outcome classification. Same semantics as
|
|
229
|
-
* {@link ExecuteOutput.outcome}:
|
|
230
|
-
*
|
|
231
|
-
* - `"success"`: execution completed cleanly; artifact is ready for
|
|
232
|
-
* verification.
|
|
233
|
-
* - `"failure"`: no usable artifact was produced.
|
|
234
|
-
* - `"partial"`: best candidate produced but convergence criteria not met
|
|
235
|
-
* (iteration cap reached in `refineExecutor`).
|
|
236
|
-
*/
|
|
237
|
-
outcome: "success" | "failure" | "partial";
|
|
238
|
-
detail: string;
|
|
239
|
-
/**
|
|
240
|
-
* Passthrough of {@link ExecuteOutput.artifact} when the executor emitted
|
|
241
|
-
* one. Reactive executors like `refineExecutor` populate this; LLM-backed
|
|
242
|
-
* default executors leave it undefined.
|
|
243
|
-
*/
|
|
244
|
-
artifact?: A;
|
|
245
|
-
}
|
|
246
|
-
/** Whether an error is self-correctable (fast-retry) or structural (full loop). */
|
|
247
|
-
type ErrorClass = "self-correctable" | "structural";
|
|
248
|
-
/** Classifier for fast-retry path. */
|
|
249
|
-
type ErrorClassifier = (result: ExecutionResult) => ErrorClass;
|
|
250
|
-
/** Result of the VERIFY stage. */
|
|
251
|
-
interface VerifyResult<A = unknown> {
|
|
252
|
-
item: TriagedItem;
|
|
253
|
-
execution: ExecutionResult<A>;
|
|
254
|
-
verified: boolean;
|
|
255
|
-
findings: string[];
|
|
256
|
-
errorClass?: ErrorClass;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Verifier output shape — what a custom verifier emits. The harness
|
|
260
|
-
* assembles this into the full {@link VerifyResult} using the triaged
|
|
261
|
-
* item + execute output sampled from `executeContextNode`.
|
|
262
|
-
*/
|
|
263
|
-
interface VerifyOutput {
|
|
264
|
-
verified: boolean;
|
|
265
|
-
findings: string[];
|
|
266
|
-
errorClass?: ErrorClass;
|
|
267
|
-
}
|
|
268
|
-
/** Configurable signals for priority scoring. */
|
|
269
|
-
interface PrioritySignals {
|
|
270
|
-
/** Per-severity base weight (default: critical=100, high=70, medium=40, low=10). */
|
|
271
|
-
severityWeights?: Partial<Record<Severity, number>>;
|
|
272
|
-
/** Decay rate per second for attention decay (default ~1.15e-6 ≈ 7-day half-life). */
|
|
273
|
-
decayRate?: number;
|
|
274
|
-
/** Strategy model effectiveness boost threshold (default 0.7). */
|
|
275
|
-
effectivenessThreshold?: number;
|
|
276
|
-
/** Strategy model effectiveness boost amount (default 15). */
|
|
277
|
-
effectivenessBoost?: number;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/** Per-queue configuration in the harness loop. */
|
|
281
|
-
interface QueueConfig {
|
|
282
|
-
/** Whether this queue is gated (requires human approval). */
|
|
283
|
-
gated: boolean;
|
|
284
|
-
/** Maximum pending items in the gate (default Infinity). */
|
|
285
|
-
maxPending?: number;
|
|
286
|
-
/** Start the gate in open (auto-approve) mode? Only meaningful when `gated: true`. */
|
|
287
|
-
startOpen?: boolean;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Accumulating per-job payload threaded through the harness's
|
|
291
|
-
* `executeFlow` ({@link harnessLoop} Tier 6.5 C2 lock). Each stage's work fn
|
|
292
|
-
* receives the prior payload and returns a new one with its own field
|
|
293
|
-
* filled in:
|
|
294
|
-
*
|
|
295
|
-
* - The `enqueueEffect` seeds with `{ item }` only.
|
|
296
|
-
* - The execute work fn fills `execution`.
|
|
297
|
-
* - The verify work fn fills `verify`.
|
|
298
|
-
*
|
|
299
|
-
* The post-completed dispatch effect reads `verify.verified` /
|
|
300
|
-
* `verify.errorClass` to route the item to `verifyResults` /
|
|
301
|
-
* `retryTopic.publish(...)` / `intake.publish(...)` (3-way verdict).
|
|
302
|
-
*
|
|
303
|
-
* Carrying `item` through stage payloads (rather than re-pairing via a
|
|
304
|
-
* separate `withLatestFrom` node) is the C2 deviation from today's
|
|
305
|
-
* `executeContextNode` design: each `JobEnvelope` is self-contained, so the
|
|
306
|
-
* verify pump can run multiple in-flight jobs in parallel without an
|
|
307
|
-
* external pairing node.
|
|
308
|
-
*/
|
|
309
|
-
interface HarnessJobPayload<A = unknown> {
|
|
310
|
-
/** The triaged item flowing through execute → verify → dispatch. */
|
|
311
|
-
item: TriagedItem;
|
|
312
|
-
/** Filled by the execute work fn. Verify reads this; dispatch routes. */
|
|
313
|
-
execution?: ExecutionResult<A>;
|
|
314
|
-
/** Filled by the verify work fn. Dispatch reads `verified` / `errorClass`. */
|
|
315
|
-
verify?: VerifyOutput;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Pluggable EXECUTE work fn — receives a {@link JobEnvelope} carrying a
|
|
319
|
-
* {@link HarnessJobPayload} (with `item` set, `execution` / `verify`
|
|
320
|
-
* unset), returns a {@link NodeInput} that emits the same payload with
|
|
321
|
-
* `execution` filled.
|
|
322
|
-
*
|
|
323
|
-
* **C2 contract (Tier 6.5 lock, 2026-04-28):**
|
|
324
|
-
* 1. Emit DATA exactly once per claimed job. The JobFlow pump subscribes
|
|
325
|
-
* once, takes the first DATA, then unsubscribes. Subsequent emissions
|
|
326
|
-
* are ignored.
|
|
327
|
-
* 2. Errors must be caught and surfaced as a `failure` outcome inside the
|
|
328
|
-
* payload — never throw / return ERROR. A pump nack would drop the
|
|
329
|
-
* item from JobFlow before the dispatch effect could route it.
|
|
330
|
-
* 3. The work fn runs once per claim — no internal `switchMap` needed.
|
|
331
|
-
* Per-item subgraphs (e.g. a fresh `refineLoop` per claim) are
|
|
332
|
-
* instantiated inside the work fn body.
|
|
333
|
-
*
|
|
334
|
-
* `defaultLlmExecutor` (in `defaults.ts`) is a thin `adapter.invoke()`
|
|
335
|
-
* wrapper. `refineExecutor` builds a per-claim `refineLoop`.
|
|
336
|
-
* `actuatorExecutor` runs a side-effecting `apply(item, signal)`.
|
|
337
|
-
*/
|
|
338
|
-
type HarnessExecutor<A = unknown> = (job: JobEnvelope<HarnessJobPayload<A>>, opts?: {
|
|
339
|
-
signal: AbortSignal;
|
|
340
|
-
}) => NodeInput<HarnessJobPayload<A>>;
|
|
341
|
-
/**
|
|
342
|
-
* Pluggable VERIFY work fn — receives a {@link JobEnvelope} whose payload
|
|
343
|
-
* has `item` + `execution` populated, returns a {@link NodeInput} that
|
|
344
|
-
* emits the same payload with `verify` filled.
|
|
345
|
-
*
|
|
346
|
-
* Same C2 contract rules 1–3 as {@link HarnessExecutor}. The dispatch
|
|
347
|
-
* effect downstream reads `verify.verified` (success → ack +
|
|
348
|
-
* verifyResults publish), `verify.errorClass === "self-correctable"`
|
|
349
|
-
* (retry → republish to retry topic with `$retries` bumped), or anything
|
|
350
|
-
* else (structural → reingest to intake if budget remains).
|
|
351
|
-
*
|
|
352
|
-
* Verify-LLM-call failures (parse error, adapter throw, timeout) MUST be
|
|
353
|
-
* caught and surfaced as a structural-failure `verify` payload (`{
|
|
354
|
-
* verified: false, findings: [...], errorClass: "structural" }`) so the
|
|
355
|
-
* dispatch effect can route the item rather than silently drop it.
|
|
356
|
-
*/
|
|
357
|
-
type HarnessVerifier<A = unknown> = (job: JobEnvelope<HarnessJobPayload<A>>, opts?: {
|
|
358
|
-
signal: AbortSignal;
|
|
359
|
-
}) => NodeInput<HarnessJobPayload<A>>;
|
|
360
|
-
/** Triage prompt callable shape — pair of `[intake item, strategy snapshot]`. */
|
|
361
|
-
type TriagePromptFn = (pair: readonly [IntakeItem, StrategySnapshot]) => string;
|
|
362
|
-
/** Execute prompt callable shape. */
|
|
363
|
-
type ExecutePromptFn = (item: TriagedItem) => string;
|
|
364
|
-
/** Verify prompt callable shape — pair of `[execute output, triaged item]`. */
|
|
365
|
-
type VerifyPromptFn<A = unknown> = (pair: readonly [ExecuteOutput<A> | null, TriagedItem | null]) => string;
|
|
366
|
-
/** Options for {@link harnessLoop}. */
|
|
367
|
-
interface HarnessLoopOptions<A = unknown> {
|
|
368
|
-
/** LLM adapter for promptNode-based stages (triage + any default executor/verifier). */
|
|
369
|
-
adapter: LLMAdapter;
|
|
370
|
-
/** Custom triage prompt (receives IntakeItem + strategy snapshot as a tuple). */
|
|
371
|
-
triagePrompt?: string | TriagePromptFn;
|
|
372
|
-
/**
|
|
373
|
-
* Execute prompt — sugar over the default LLM executor. Ignored when
|
|
374
|
-
* `executor` is set.
|
|
375
|
-
*/
|
|
376
|
-
executePrompt?: string | ExecutePromptFn;
|
|
377
|
-
/**
|
|
378
|
-
* Verify prompt — sugar over the default LLM verifier. Ignored when
|
|
379
|
-
* `verifier` is set.
|
|
380
|
-
*/
|
|
381
|
-
verifyPrompt?: string | VerifyPromptFn<A>;
|
|
382
|
-
/**
|
|
383
|
-
* Pluggable EXECUTE slot. When omitted, the harness uses a `promptNode`
|
|
384
|
-
* driven by `adapter` + `executePrompt`. Replace to plug in a
|
|
385
|
-
* `refineExecutor`, tool-using agent, or any reactive execution pipeline.
|
|
386
|
-
*/
|
|
387
|
-
executor?: HarnessExecutor<A>;
|
|
388
|
-
/**
|
|
389
|
-
* Pluggable VERIFY slot. When omitted, the harness uses a `promptNode`
|
|
390
|
-
* driven by `adapter` + `verifyPrompt`. Replace to plug in an
|
|
391
|
-
* `evalVerifier` that re-runs affected eval tasks.
|
|
392
|
-
*/
|
|
393
|
-
verifier?: HarnessVerifier<A>;
|
|
394
|
-
/** Per-queue configuration overrides. */
|
|
395
|
-
queues?: Partial<Record<QueueRoute, QueueConfig>>;
|
|
396
|
-
/** Priority scoring signals. */
|
|
397
|
-
priority?: PrioritySignals;
|
|
398
|
-
/**
|
|
399
|
-
* Reactive last-human-interaction timestamp (monotonic ns). Drives the
|
|
400
|
-
* priority score age-decay term for `HarnessGraph.priorityScores`.
|
|
401
|
-
*
|
|
402
|
-
* **Required when `opts.priority` is set.** Priority score nodes only
|
|
403
|
-
* re-derive when `topic.latest`, `strategy.node`, or this tick settles —
|
|
404
|
-
* an idle queue would freeze its age at construction time if we
|
|
405
|
-
* auto-defaulted. Typical sources:
|
|
406
|
-
* - `fromTimer(60_000)` — steady tick, uniform decay.
|
|
407
|
-
* - `state(monotonicNs())` — bumped from a human-interaction handler.
|
|
408
|
-
* - A reactive view over a DB column / external metrics source.
|
|
409
|
-
*/
|
|
410
|
-
lastInteractionNs?: Node<number>;
|
|
411
|
-
/** Error classifier for fast-retry path. */
|
|
412
|
-
errorClassifier?: ErrorClassifier;
|
|
413
|
-
/** Max fast-retries per item before routing to full intake (default 2). */
|
|
414
|
-
maxRetries?: number;
|
|
415
|
-
/** Global retry cap across all items — circuit breaker (default maxRetries × 10). */
|
|
416
|
-
maxTotalRetries?: number;
|
|
417
|
-
/** Max re-ingestions from verify→intake before giving up (default 1). */
|
|
418
|
-
maxReingestions?: number;
|
|
419
|
-
/** Global reingestion cap across all items — circuit breaker (default maxReingestions × 10). */
|
|
420
|
-
maxTotalReingestions?: number;
|
|
421
|
-
/** Retained limit for topic logs (default 1000). */
|
|
422
|
-
retainedLimit?: number;
|
|
423
|
-
/**
|
|
424
|
-
* Per-pump-tick claim cap on the internal `executeFlow` JobFlow's `execute`
|
|
425
|
-
* stage (Tier 6.5 C2). Default `Number.MAX_SAFE_INTEGER` — every pending
|
|
426
|
-
* claim is processed in one tick (matches today's unbounded `merge()`
|
|
427
|
-
* parallelism). Lower this to bound LLM cost spikes on bursty intake.
|
|
428
|
-
*
|
|
429
|
-
* **Caveat.** This caps **claims per pump tick**, not total concurrent
|
|
430
|
-
* inflight. Bounded-inflight is a separate primitive concern — see
|
|
431
|
-
* `docs/optimizations.md` "Tier 6.5 follow-up — bounded concurrent inflight
|
|
432
|
-
* on JobFlow stages".
|
|
433
|
-
*/
|
|
434
|
-
executeMaxPerPump?: number;
|
|
435
|
-
/**
|
|
436
|
-
* Per-pump-tick claim cap on the internal `executeFlow` JobFlow's
|
|
437
|
-
* `verify` stage. Default `Number.MAX_SAFE_INTEGER`. Same caveat as
|
|
438
|
-
* {@link HarnessLoopOptions.executeMaxPerPump}. Honored independently
|
|
439
|
-
* of the execute cap via `StageDef.maxPerPump` (Tier 6.5 D1).
|
|
440
|
-
*/
|
|
441
|
-
verifyMaxPerPump?: number;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* actuatorExecutor — bridge a side-effecting actuator into the harness
|
|
446
|
-
* EXECUTE work fn.
|
|
447
|
-
*
|
|
448
|
-
* `refineExecutor` covers the artifact-typed case (refine a candidate
|
|
449
|
-
* `T` against an evaluator); `actuatorExecutor` covers the side-effecting
|
|
450
|
-
* case (write a catalog entry, mutate a template registry, edit a doc on
|
|
451
|
-
* disk). The user's `apply` callback owns the side effect; the executor
|
|
452
|
-
* wraps it in the per-claim lifecycle:
|
|
453
|
-
*
|
|
454
|
-
* 1. **One DATA per claim.** The producer captures the first DATA from
|
|
455
|
-
* the bridged `apply` result, emits a {@link HarnessJobPayload} with
|
|
456
|
-
* `execution` filled in, and completes. Subsequent inner DATAs are
|
|
457
|
-
* ignored.
|
|
458
|
-
* 2. **Cancel-on-teardown.** When the JobFlow pump unsubscribes (after
|
|
459
|
-
* capturing first DATA, or on graph teardown), the producer's cleanup
|
|
460
|
-
* fires `ac.abort()` which propagates into `apply`'s `signal`.
|
|
461
|
-
* 3. **Errors surfaced as failure payload.** A thrown / ERROR result is
|
|
462
|
-
* mapped via `onError` into a `failure`-outcome `ExecuteOutput` so the
|
|
463
|
-
* dispatch effect can route the item rather than silently dropping it.
|
|
464
|
-
*
|
|
465
|
-
* **What `apply` may return.** Anything `fromAny` accepts: `Promise<R>`,
|
|
466
|
-
* `Node<R>`, `AsyncIterable<R>`, `Iterable<R>`, or a synchronous `R`.
|
|
467
|
-
* `Promise<R>` is the typical shape (`writeFile`, `fetch`, `db.execute`).
|
|
468
|
-
*
|
|
469
|
-
* **Pairing with `evalVerifier`.** `ExecuteOutput.artifact` is set to
|
|
470
|
-
* the actuation record; an `evalVerifier<R>` whose `extractArtifact`
|
|
471
|
-
* returns the record (or the post-apply world state) closes EXECUTE →
|
|
472
|
-
* VERIFY with consistent typing end-to-end.
|
|
473
|
-
*
|
|
474
|
-
* @module
|
|
475
|
-
*/
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* What an actuator's `apply` may return. Mirrors `NodeInput<R>` plus a
|
|
479
|
-
* raw `R` for synchronous side effects.
|
|
480
|
-
*/
|
|
481
|
-
type ActuatorResult<R> = NodeInput<R>;
|
|
482
|
-
/** Configuration for {@link actuatorExecutor}. */
|
|
483
|
-
interface ActuatorExecutorConfig<R> {
|
|
484
|
-
/**
|
|
485
|
-
* Apply the side effect for this triaged item. Receives the abort
|
|
486
|
-
* signal — actuators that own real I/O should thread `signal` into
|
|
487
|
-
* `fetch`, `fs.writeFile`, child-process kills, etc. so that the
|
|
488
|
-
* pump's teardown actually cancels in-flight work.
|
|
489
|
-
*
|
|
490
|
-
* The first DATA emitted by the bridged result wins; later DATAs are
|
|
491
|
-
* discarded. ERROR (or a synchronous throw) is mapped via `onError`.
|
|
492
|
-
*/
|
|
493
|
-
apply: (item: TriagedItem, opts: {
|
|
494
|
-
signal: AbortSignal;
|
|
495
|
-
}) => ActuatorResult<R>;
|
|
496
|
-
/**
|
|
497
|
-
* Optional gate — when provided and returning `false`, the actuator
|
|
498
|
-
* is skipped and the executor emits an `ExecuteOutput` with
|
|
499
|
-
* `outcome: "failure"`. Use to route interventions the actuator can't
|
|
500
|
-
* handle into the failure path.
|
|
501
|
-
*/
|
|
502
|
-
shouldApply?: (item: TriagedItem) => boolean;
|
|
503
|
-
/** Detail string for the skip path. Default: includes intervention name. */
|
|
504
|
-
skipDetail?: (item: TriagedItem) => string;
|
|
505
|
-
/**
|
|
506
|
-
* Map a successfully-applied actuation record into an `ExecuteOutput<R>`.
|
|
507
|
-
*/
|
|
508
|
-
toOutput?: (record: R, item: TriagedItem) => ExecuteOutput<R>;
|
|
509
|
-
/**
|
|
510
|
-
* Map a thrown / ERROR result into an `ExecuteOutput<R>`.
|
|
511
|
-
*/
|
|
512
|
-
onError?: (err: unknown, item: TriagedItem) => ExecuteOutput<R>;
|
|
513
|
-
/** Node name prefix for `describe()` introspection. */
|
|
514
|
-
name?: string;
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* Build a {@link HarnessExecutor} backed by a side-effecting actuator.
|
|
518
|
-
*
|
|
519
|
-
* @example File-system actuator that writes a catalog entry and emits the diff.
|
|
520
|
-
* ```ts
|
|
521
|
-
* const harness = harnessLoop("repair", {
|
|
522
|
-
* adapter,
|
|
523
|
-
* executor: actuatorExecutor<CatalogPatch>({
|
|
524
|
-
* async apply(item, { signal }) {
|
|
525
|
-
* const patch = patchFromItem(item);
|
|
526
|
-
* await fs.writeFile(patch.path, patch.contents, { signal });
|
|
527
|
-
* return patch;
|
|
528
|
-
* },
|
|
529
|
-
* shouldApply: (item) => item.intervention === "catalog-fn",
|
|
530
|
-
* }),
|
|
531
|
-
* verifier: evalVerifier<CatalogPatch>({ ... }),
|
|
532
|
-
* });
|
|
533
|
-
* ```
|
|
534
|
-
*/
|
|
535
|
-
declare function actuatorExecutor<R>(config: ActuatorExecutorConfig<R>): HarnessExecutor<R>;
|
|
536
|
-
/**
|
|
537
|
-
* Apply callback shape consumed by {@link dispatchActuator}. Same shape as
|
|
538
|
-
* {@link ActuatorExecutorConfig.apply}.
|
|
539
|
-
*/
|
|
540
|
-
type ActuatorApplyFn<R> = (item: TriagedItem, opts: {
|
|
541
|
-
signal: AbortSignal;
|
|
542
|
-
}) => ActuatorResult<R>;
|
|
543
|
-
/** Configuration for {@link dispatchActuator}. */
|
|
544
|
-
interface DispatchActuatorConfig<R> {
|
|
545
|
-
/**
|
|
546
|
-
* Per-intervention apply callbacks. Keyed by `TriagedItem.intervention`.
|
|
547
|
-
* Items whose intervention is not in `routes` fall through to `default`
|
|
548
|
-
* (when set) or emit a skip-failure `ExecuteOutput`.
|
|
549
|
-
*/
|
|
550
|
-
routes: Readonly<Partial<Record<TriagedItem["intervention"], ActuatorApplyFn<R>>>>;
|
|
551
|
-
/** Fallback apply callback for items whose intervention is not in `routes`. */
|
|
552
|
-
default?: ActuatorApplyFn<R>;
|
|
553
|
-
/** Node name prefix for `describe()` introspection. */
|
|
554
|
-
name?: string;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* Multi-intervention actuator — dispatches each `TriagedItem` to one of
|
|
558
|
-
* several `apply` callbacks based on `item.intervention`.
|
|
559
|
-
*
|
|
560
|
-
* Internally builds a single `actuatorExecutor` whose `apply` resolves the
|
|
561
|
-
* intervention → callback at call-time. Items with no matching route and no
|
|
562
|
-
* `default` emit a skip-failure with detail
|
|
563
|
-
* `"no route for intervention 'X'"`.
|
|
564
|
-
*/
|
|
565
|
-
declare function dispatchActuator<R>(config: DispatchActuatorConfig<R>): HarnessExecutor<R>;
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* autoSolidify — promote successful VERIFY runs into a durable artifact
|
|
569
|
-
* (catalog entry, skill, template, doc edit, …).
|
|
570
|
-
*
|
|
571
|
-
* Closes the dogfood retrospective loop: when the harness's VERIFY
|
|
572
|
-
* stage reports `verified: true`, the validated intervention should
|
|
573
|
-
* become an authoring artifact the next loop run can rely on. This
|
|
574
|
-
* primitive is the generic substrate — pass a `write` callback that
|
|
575
|
-
* does the actual promotion (e.g. `overlay.upsertTemplate` for the
|
|
576
|
-
* dogfood catalog overlay; `fs.writeFile` for a doc edit; `ctx.skill`
|
|
577
|
-
* for a Hermes-style skill registry).
|
|
578
|
-
*
|
|
579
|
-
* @example Wire the catalog overlay as the solidify target.
|
|
580
|
-
* ```ts
|
|
581
|
-
* const solidified = autoSolidify({
|
|
582
|
-
* verifyResults: harness.verifyResults.latest,
|
|
583
|
-
* extract: (vr) => vr.execution.artifact ?? null,
|
|
584
|
-
* write: (entry, vr) => overlay.upsertFn(`learned-${vr.item.summary}`, entry),
|
|
585
|
-
* });
|
|
586
|
-
* solidified.subscribe(() => {}); // keep alive for log
|
|
587
|
-
* ```
|
|
588
|
-
*
|
|
589
|
-
* **Why a node and not just an effect.** The returned `Node<R>` emits
|
|
590
|
-
* each promoted artifact, so callers can pipe solidifications through
|
|
591
|
-
* the standard reactive surface (`describe()`, `observe()`, replay
|
|
592
|
-
* buffers) instead of side-channel logging. An audit / dashboard that
|
|
593
|
-
* wants "what was learned this run?" subscribes to the returned node;
|
|
594
|
-
* the `write` callback owns the durable side effect.
|
|
595
|
-
*
|
|
596
|
-
* **Idempotency is the caller's responsibility.** The primitive
|
|
597
|
-
* promotes every `verified: true` wave that passes the predicate. If
|
|
598
|
-
* the harness re-verifies the same item (e.g. via reingestion), the
|
|
599
|
-
* `write` callback is invoked again. Wrap your write fn with a
|
|
600
|
-
* dedup-by-key guard if your target store would otherwise bloat. The
|
|
601
|
-
* inner `seen` set inside this factory is intentionally absent — the
|
|
602
|
-
* harness already retains via topic logs and the user may want
|
|
603
|
-
* re-promotion semantics that are domain-specific.
|
|
604
|
-
*
|
|
605
|
-
* @module
|
|
606
|
-
*/
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* Configuration for {@link autoSolidify}.
|
|
610
|
-
*
|
|
611
|
-
* `R` is the artifact type the upstream EXECUTE stage produced (and
|
|
612
|
-
* `evalVerifier` carries through `execution.artifact`). `T` is the
|
|
613
|
-
* promotion shape — what `write` consumes and what the returned node
|
|
614
|
-
* emits. Often `T = R`, but they diverge when the actuator's raw
|
|
615
|
-
* artifact needs a transform before storing (e.g. wrap a `CatalogPatch`
|
|
616
|
-
* into a `CatalogEntry` with effectiveness metadata).
|
|
617
|
-
*/
|
|
618
|
-
interface AutoSolidifyConfig<R, T = R> {
|
|
619
|
-
/** Reactive verify-result stream. Typically `harness.verifyResults.latest`. */
|
|
620
|
-
verifyResults: Node<VerifyResult<R> | null>;
|
|
621
|
-
/**
|
|
622
|
-
* Pull the value-to-promote out of a verified VerifyResult.
|
|
623
|
-
* Default: `(vr) => vr.execution.artifact as T | null`. Return `null`
|
|
624
|
-
* to skip a particular VerifyResult even when `verified: true` (e.g.
|
|
625
|
-
* an LLM-default executor produces no artifact and there's nothing to
|
|
626
|
-
* solidify).
|
|
627
|
-
*/
|
|
628
|
-
extract?: (vr: VerifyResult<R>) => T | null;
|
|
629
|
-
/**
|
|
630
|
-
* Optional gate beyond `verified === true`. When provided, the
|
|
631
|
-
* primitive only promotes when this returns `true`. Default: pass
|
|
632
|
-
* everything verified.
|
|
633
|
-
*
|
|
634
|
-
* Useful predicates:
|
|
635
|
-
* - `(vr) => vr.item.intervention === "catalog-fn"` — only catalog work.
|
|
636
|
-
* - `(vr) => (vr.findings ?? []).every(f => !/regression/i.test(f))` —
|
|
637
|
-
* skip even-passes that mention regressions.
|
|
638
|
-
*/
|
|
639
|
-
predicate?: (vr: VerifyResult<R>) => boolean;
|
|
640
|
-
/**
|
|
641
|
-
* Promote — usually a side effect (write to overlay, fs, KG, etc.).
|
|
642
|
-
* Receives the extracted artifact AND the originating VerifyResult so
|
|
643
|
-
* the writer can use any context it needs (item summary, eval task
|
|
644
|
-
* IDs, finding text, …) when shaping the durable record.
|
|
645
|
-
*/
|
|
646
|
-
write: (artifact: T, vr: VerifyResult<R>) => void;
|
|
647
|
-
/** Node name for `describe()` introspection. Default `"auto-solidify"`. */
|
|
648
|
-
name?: string;
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Build a `Node<T>` that subscribes to `verifyResults`, filters to
|
|
652
|
-
* verified passes that produced an extractable artifact, runs `write`,
|
|
653
|
-
* and emits the artifact. Use the returned node as a subscription
|
|
654
|
-
* point for audit / dashboard / log pipelines.
|
|
655
|
-
*
|
|
656
|
-
* **Terminal-on-error semantics.** A throw from `predicate`, `extract`,
|
|
657
|
-
* or `write` surfaces as `[[ERROR]]` on the returned node and
|
|
658
|
-
* **terminates** it — the upstream subscription tears down and no
|
|
659
|
-
* further DATA is emitted. This matches the spec's terminal-frame
|
|
660
|
-
* contract for ERROR. If you want the solidify node to stay live
|
|
661
|
-
* across user-callback throws, wrap your callbacks with try/catch
|
|
662
|
-
* internally and emit a sentinel value or no-op on failure. A future
|
|
663
|
-
* non-terminal `errors: Node<unknown>` companion may surface failures
|
|
664
|
-
* without terminating the success stream — flagged as a follow-up.
|
|
665
|
-
*
|
|
666
|
-
* @returns A `Node<T>` that emits one DATA per promoted artifact.
|
|
667
|
-
* Stays live as long as `verifyResults` is live AND no user callback
|
|
668
|
-
* has thrown.
|
|
669
|
-
*/
|
|
670
|
-
declare function autoSolidify<R, T = R>(config: AutoSolidifyConfig<R, T>): Node<T>;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Harness bridge factories (roadmap §9.0).
|
|
674
|
-
*
|
|
675
|
-
* Intake bridges, eval source wrapper, before/after comparison,
|
|
676
|
-
* affected-task filter, code-change bridge, and notification effect.
|
|
677
|
-
* All are compositions of existing primitives — no new abstractions.
|
|
678
|
-
*
|
|
679
|
-
* @module
|
|
680
|
-
*/
|
|
681
|
-
|
|
682
|
-
/** Options for {@link createIntakeBridge}. */
|
|
683
|
-
interface IntakeBridgeOptions {
|
|
684
|
-
/** Name for the effect node (default "intake-bridge"). */
|
|
685
|
-
name?: string;
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Generic source→intake bridge factory.
|
|
689
|
-
*
|
|
690
|
-
* Watches a source node for new values, passes each through a user-supplied
|
|
691
|
-
* `parser` that produces zero or more `IntakeItem`s, and publishes them to
|
|
692
|
-
* the given intake topic.
|
|
693
|
-
*
|
|
694
|
-
* This is the generalized pattern behind {@link evalIntakeBridge}. Use it for
|
|
695
|
-
* CI results, test failures, Slack messages, monitoring alerts, or any domain
|
|
696
|
-
* where structured results should flow into a harness loop.
|
|
697
|
-
*
|
|
698
|
-
* @param source - Reactive node emitting domain-specific data.
|
|
699
|
-
* @param intakeTopic - TopicGraph to publish IntakeItem entries to.
|
|
700
|
-
* @param parser - Converts source data into IntakeItem[]. Return empty array to skip.
|
|
701
|
-
* @param opts - Optional configuration.
|
|
702
|
-
* @returns The effect node (for lifecycle management).
|
|
703
|
-
*/
|
|
704
|
-
declare function createIntakeBridge<T>(source: Node<T>, intakeTopic: TopicGraph<IntakeItem>, parser: (value: T) => IntakeItem[], opts?: IntakeBridgeOptions): Node<unknown>;
|
|
705
|
-
/**
|
|
706
|
-
* Minimal eval result shape accepted by the bridge.
|
|
707
|
-
*
|
|
708
|
-
* TS eval runner uses `EvalRun` from `evals/lib/types.ts` which is a superset
|
|
709
|
-
* of this shape. The bridge only reads what it needs.
|
|
710
|
-
*/
|
|
711
|
-
interface EvalRunResult {
|
|
712
|
-
run_id: string;
|
|
713
|
-
model: string;
|
|
714
|
-
tasks: EvalTaskResult[];
|
|
715
|
-
}
|
|
716
|
-
interface EvalTaskResult {
|
|
717
|
-
task_id: string;
|
|
718
|
-
valid: boolean;
|
|
719
|
-
judge_scores?: EvalJudgeScore[];
|
|
720
|
-
}
|
|
721
|
-
interface EvalJudgeScore {
|
|
722
|
-
claim: string;
|
|
723
|
-
pass: boolean;
|
|
724
|
-
reasoning: string;
|
|
725
|
-
}
|
|
726
|
-
interface EvalIntakeBridgeOptions {
|
|
727
|
-
/** Name for the effect node (default "eval-intake-bridge"). */
|
|
728
|
-
name?: string;
|
|
729
|
-
/** Minimum severity for eval-sourced items (default "medium"). */
|
|
730
|
-
defaultSeverity?: Severity;
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* Create an effect node that watches an eval results source and publishes
|
|
734
|
-
* per-criterion findings to an intake topic.
|
|
735
|
-
*
|
|
736
|
-
* Each failing judge criterion produces a separate IntakeItem — not one
|
|
737
|
-
* item per task. This gives the triage stage granular findings to classify.
|
|
738
|
-
*
|
|
739
|
-
* @param evalSource - Node emitting EvalRunResult (or EvalRunResult[]).
|
|
740
|
-
* @param intakeTopic - TopicGraph to publish IntakeItem entries to.
|
|
741
|
-
* @param opts - Optional configuration.
|
|
742
|
-
* @returns The effect node (for lifecycle management).
|
|
743
|
-
*/
|
|
744
|
-
declare function evalIntakeBridge(evalSource: Node<EvalRunResult | EvalRunResult[]>, intakeTopic: TopicGraph<IntakeItem>, opts?: EvalIntakeBridgeOptions): Node<unknown>;
|
|
745
|
-
/**
|
|
746
|
-
* Wrap any eval runner as a reactive producer node.
|
|
747
|
-
*
|
|
748
|
-
* When `trigger` emits, calls `runner()` and emits the result downstream.
|
|
749
|
-
* Uses `switchMap` + `fromAny` — the async boundary stays in the source
|
|
750
|
-
* layer (spec §5.10). A new trigger cancels any in-flight run.
|
|
751
|
-
*
|
|
752
|
-
* ```ts
|
|
753
|
-
* const trigger = state(0); // bump to trigger a new run
|
|
754
|
-
* const results = evalSource(trigger, () => runEvals(config));
|
|
755
|
-
* results.subscribe(msgs => { ... });
|
|
756
|
-
* trigger.emit(1); // fires the runner
|
|
757
|
-
* ```
|
|
758
|
-
*
|
|
759
|
-
* @param trigger - Any node; each new DATA emission fires the runner.
|
|
760
|
-
* @param runner - Returns an EvalRunResult (or promise of one).
|
|
761
|
-
*/
|
|
762
|
-
declare function evalSource<T extends EvalRunResult>(trigger: Node<unknown>, runner: () => T | Promise<T>): Node<T>;
|
|
763
|
-
/** Per-task delta produced by {@link beforeAfterCompare}. */
|
|
764
|
-
interface EvalTaskDelta {
|
|
765
|
-
taskId: string;
|
|
766
|
-
before: boolean;
|
|
767
|
-
after: boolean;
|
|
768
|
-
/** Score-level diff (after − before), undefined if no scores present. */
|
|
769
|
-
scoreDiff?: number;
|
|
770
|
-
}
|
|
771
|
-
/** Output of {@link beforeAfterCompare}. */
|
|
772
|
-
interface EvalDelta {
|
|
773
|
-
/** Task IDs that newly fail in `after` (were passing in `before`). */
|
|
774
|
-
newFailures: string[];
|
|
775
|
-
/** Task IDs that now pass in `after` (were failing in `before`). */
|
|
776
|
-
resolved: string[];
|
|
777
|
-
/** Full per-task breakdown. */
|
|
778
|
-
taskDeltas: EvalTaskDelta[];
|
|
779
|
-
/** True when net resolutions > net failures. */
|
|
780
|
-
overallImproved: boolean;
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Derived node that computes before/after eval deltas.
|
|
784
|
-
*
|
|
785
|
-
* Pure computation: no LLM, no async. Compares per-task validity and
|
|
786
|
-
* pass counts between two `EvalRunResult` snapshots.
|
|
787
|
-
*
|
|
788
|
-
* @param before - Node holding the baseline eval result.
|
|
789
|
-
* @param after - Node holding the new eval result.
|
|
790
|
-
*/
|
|
791
|
-
declare function beforeAfterCompare(before: Node<EvalRunResult>, after: Node<EvalRunResult>): Node<EvalDelta>;
|
|
792
|
-
/**
|
|
793
|
-
* Derived node that selects which eval task IDs to re-run.
|
|
794
|
-
*
|
|
795
|
-
* Collects `affectsEvalTasks` from all triaged items, deduplicates, then
|
|
796
|
-
* optionally intersects with `fullTaskSet`. Returns a sorted array of IDs.
|
|
797
|
-
*
|
|
798
|
-
* Use this to avoid re-running the full eval suite after each fix: only the
|
|
799
|
-
* tasks that the triaged items claim to affect are returned.
|
|
800
|
-
*
|
|
801
|
-
* @param issues - Node holding the current list of triaged items.
|
|
802
|
-
* @param fullTaskSet - Optional node (or plain array) of all known task IDs.
|
|
803
|
-
* When provided, output is the intersection.
|
|
804
|
-
*/
|
|
805
|
-
declare function affectedTaskFilter(issues: Node<readonly TriagedItem[]>, fullTaskSet?: Node<readonly string[]> | readonly string[]): Node<string[]>;
|
|
806
|
-
/** A single lint error emitted by a CI tool. */
|
|
807
|
-
interface LintError {
|
|
808
|
-
file: string;
|
|
809
|
-
line: number;
|
|
810
|
-
col: number;
|
|
811
|
-
rule: string;
|
|
812
|
-
message: string;
|
|
813
|
-
}
|
|
814
|
-
/** A single test failure emitted by a test runner. */
|
|
815
|
-
interface TestFailure {
|
|
816
|
-
testId: string;
|
|
817
|
-
file: string;
|
|
818
|
-
message: string;
|
|
819
|
-
}
|
|
820
|
-
/** Structured code-change / CI event. */
|
|
821
|
-
interface CodeChange {
|
|
822
|
-
/** Files touched by the change. */
|
|
823
|
-
files: string[];
|
|
824
|
-
lintErrors?: LintError[];
|
|
825
|
-
testFailures?: TestFailure[];
|
|
826
|
-
}
|
|
827
|
-
/** Options for {@link codeChangeBridge}. */
|
|
828
|
-
interface CodeChangeBridgeOptions {
|
|
829
|
-
/** Name for the effect node (default "code-change-bridge"). */
|
|
830
|
-
name?: string;
|
|
831
|
-
/** Default severity for generated IntakeItems (default "high"). */
|
|
832
|
-
defaultSeverity?: Severity;
|
|
833
|
-
}
|
|
834
|
-
/**
|
|
835
|
-
* Intake bridge for code-change / CI events.
|
|
836
|
-
*
|
|
837
|
-
* Watches a source node for `CodeChange` events and publishes one
|
|
838
|
-
* `IntakeItem` per lint error and per test failure to the intake topic.
|
|
839
|
-
* Pass a custom `parser` to override the default mapping.
|
|
840
|
-
*
|
|
841
|
-
* @param source - Node emitting CodeChange events.
|
|
842
|
-
* @param intakeTopic - TopicGraph to publish IntakeItem entries to.
|
|
843
|
-
* @param parser - Optional custom parser (overrides default).
|
|
844
|
-
* @param opts - Optional configuration.
|
|
845
|
-
*/
|
|
846
|
-
declare function codeChangeBridge(source: Node<CodeChange>, intakeTopic: TopicGraph<IntakeItem>, parser?: (change: CodeChange) => IntakeItem[], opts?: CodeChangeBridgeOptions): Node<unknown>;
|
|
847
|
-
/** Transport function for {@link notifyEffect}. Sync or async. */
|
|
848
|
-
type NotifyTransport<T> = (item: T) => void | Promise<void>;
|
|
849
|
-
/** Options for {@link notifyEffect}. */
|
|
850
|
-
interface NotifyEffectOptions {
|
|
851
|
-
/** Name for the effect node (default "notify-effect"). */
|
|
852
|
-
name?: string;
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* Effect node that sends each new topic entry to an external channel.
|
|
856
|
-
*
|
|
857
|
-
* The `transport` function is called for every item published to `topic`.
|
|
858
|
-
* Async transports are bridged via `fromAny` (spec §5.10 compliant).
|
|
859
|
-
*
|
|
860
|
-
* Typical use: Slack webhook, GitHub PR comment, email notification, etc.
|
|
861
|
-
* The factory provides reactive wiring; the transport supplies domain logic.
|
|
862
|
-
*
|
|
863
|
-
* ```ts
|
|
864
|
-
* notifyEffect(alertQueue, async (item) => {
|
|
865
|
-
* await fetch(SLACK_WEBHOOK, { method: 'POST', body: JSON.stringify({ text: item.summary }) });
|
|
866
|
-
* });
|
|
867
|
-
* ```
|
|
868
|
-
*
|
|
869
|
-
* @param topic - TopicGraph whose latest entry triggers the notification.
|
|
870
|
-
* @param transport - Called with each new item. May return a Promise.
|
|
871
|
-
* @param opts - Optional configuration.
|
|
872
|
-
*/
|
|
873
|
-
declare function notifyEffect<T>(topic: TopicGraph<T>, transport: NotifyTransport<T>, opts?: NotifyEffectOptions): Node<unknown>;
|
|
874
|
-
|
|
875
|
-
/**
|
|
876
|
-
* `effectivenessTracker` — action×context → success rate tracker.
|
|
877
|
-
*
|
|
878
|
-
* Demoted from `patterns/reduction` to `patterns/harness/` per Tier 2.3
|
|
879
|
-
* (consolidation plan §1 Rule 6). The only in-tree consumer is the harness
|
|
880
|
-
* strategy model, so the primitive moves alongside it. Building-block status
|
|
881
|
-
* is dropped: this is a harness-shaped preset (a small composition over
|
|
882
|
-
* `reactiveMap` with attempt-counting semantics) rather than an orthogonal
|
|
883
|
-
* primitive.
|
|
884
|
-
*
|
|
885
|
-
* @module
|
|
886
|
-
*/
|
|
887
|
-
|
|
888
|
-
/** A single effectiveness record for an action×context pair. */
|
|
889
|
-
type EffectivenessEntry = {
|
|
890
|
-
readonly key: string;
|
|
891
|
-
readonly attempts: number;
|
|
892
|
-
readonly successes: number;
|
|
893
|
-
readonly successRate: number;
|
|
894
|
-
};
|
|
895
|
-
/** Snapshot shape for the effectiveness tracker node. */
|
|
896
|
-
type EffectivenessSnapshot = ReadonlyMap<string, EffectivenessEntry>;
|
|
897
|
-
/** Bundle returned by {@link effectivenessTracker}. */
|
|
898
|
-
interface EffectivenessTrackerBundle {
|
|
899
|
-
/** Reactive node — current effectiveness map snapshot. */
|
|
900
|
-
readonly node: Node<EffectivenessSnapshot>;
|
|
901
|
-
/** Record a completed action (success or failure). */
|
|
902
|
-
record(key: string, success: boolean): void;
|
|
903
|
-
/** Look up effectiveness for a specific key. */
|
|
904
|
-
lookup(key: string): EffectivenessEntry | undefined;
|
|
905
|
-
/** Tear down internal keepalive subscriptions. */
|
|
906
|
-
dispose(): void;
|
|
907
|
-
}
|
|
908
|
-
/** Options for {@link effectivenessTracker}. */
|
|
909
|
-
type EffectivenessTrackerOptions = {
|
|
910
|
-
/** Name for the reactive map (default "effectiveness-entries"). */
|
|
911
|
-
name?: string;
|
|
912
|
-
};
|
|
913
|
-
/**
|
|
914
|
-
* Generic action×context → success rate tracker.
|
|
915
|
-
*
|
|
916
|
-
* Generalized from the harness `strategyModel` pattern. Tracks attempts and
|
|
917
|
-
* successes per string key, exposes a reactive snapshot node, and provides
|
|
918
|
-
* `record()` / `lookup()` methods.
|
|
919
|
-
*
|
|
920
|
-
* Use cases: A/B testing, routing optimization, cache policy tuning, retry
|
|
921
|
-
* strategy selection — any domain that tracks effectiveness per action.
|
|
922
|
-
*
|
|
923
|
-
* @param opts - Optional configuration.
|
|
924
|
-
* @returns Bundle with reactive node, record(), lookup(), dispose().
|
|
925
|
-
*/
|
|
926
|
-
declare function effectivenessTracker(opts?: EffectivenessTrackerOptions): EffectivenessTrackerBundle;
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* refineLoop — universal prompt/artifact optimization loop as a reactive Graph.
|
|
930
|
-
*
|
|
931
|
-
* Roadmap §9.8 (Wave 2.5). The loop is a 4-topic reactive pipeline:
|
|
932
|
-
*
|
|
933
|
-
* iterationTrigger ──▶ GENERATE ──▶ EVALUATE ──▶ ANALYZE ──▶ DECIDE
|
|
934
|
-
* │ │
|
|
935
|
-
* └─────── feedback + trigger ◀─────┘
|
|
936
|
-
*
|
|
937
|
-
* Each stage is a `TopicGraph` so dispatches stay O(1) per subscriber (cursor-
|
|
938
|
-
* based) and every iteration is observable, replayable, and checkpointable.
|
|
939
|
-
*
|
|
940
|
-
* Composition invariants (from COMPOSITION-GUIDE):
|
|
941
|
-
* - §7 feedback cycle: only `iterationTrigger` drives re-generation. Strategy
|
|
942
|
-
* + feedback + dataset are read via closure updaters (§28 factory-time seed)
|
|
943
|
-
* so mid-run swaps apply to the NEXT iteration, never retrigger the current.
|
|
944
|
-
* - §28 factory-time seed: strategy, lastFeedback, prevCandidates, dataset
|
|
945
|
-
* closures captured at wiring time + updated via subscribe handlers so the
|
|
946
|
-
* first activation doesn't drop the initial pair.
|
|
947
|
-
* - §32 nested-drain state-mirror: the decide-effect writes `lastFeedback`
|
|
948
|
-
* BEFORE bumping `iterationTrigger` inside its `batch()`, guaranteeing the
|
|
949
|
-
* mirror is current when the next-iteration wave reaches the generate fn.
|
|
950
|
-
* - §19 terminal-emission: history / best emit once per iteration (settled),
|
|
951
|
-
* not on every intermediate wave.
|
|
952
|
-
* - §27 attachSnapshotStorage: the whole graph is checkpointable — pause overnight,
|
|
953
|
-
* resume tomorrow from the exact iteration count, candidate set, strategy.
|
|
954
|
-
*
|
|
955
|
-
* Scope clamp (v1): core factory + `RefineStrategy<T>` + `blindVariation` and
|
|
956
|
-
* `errorCritique` built-ins + budget gating + checkpoint/resume.
|
|
957
|
-
* `mutateAndRefine` / registry / `autoSelectStrategy` / `optimizeCatalog` /
|
|
958
|
-
* `refineExecutor` are deferred.
|
|
959
|
-
*
|
|
960
|
-
* @module
|
|
961
|
-
*/
|
|
962
|
-
|
|
963
|
-
/** A single task row — the unit the evaluator scores one candidate against. */
|
|
964
|
-
interface DatasetItem {
|
|
965
|
-
readonly id: string;
|
|
966
|
-
readonly [k: string]: unknown;
|
|
967
|
-
}
|
|
968
|
-
/**
|
|
969
|
-
* One candidate's score on one task. Higher is better by convention.
|
|
970
|
-
*
|
|
971
|
-
* Set `candidateIndex` when the evaluator fans out scores across multiple
|
|
972
|
-
* candidates (e.g. `candidates × tasks`). `pickBest` aggregates mean scores
|
|
973
|
-
* per `candidateIndex` when present; when absent, falls back to positional
|
|
974
|
-
* alignment (`scores[i]` ↔ `candidates[i]`).
|
|
975
|
-
*/
|
|
976
|
-
interface EvalResult {
|
|
977
|
-
readonly taskId: string;
|
|
978
|
-
readonly score: number;
|
|
979
|
-
readonly error?: string;
|
|
980
|
-
readonly detail?: unknown;
|
|
981
|
-
/** 0-based index into the `candidates` batch this score belongs to. */
|
|
982
|
-
readonly candidateIndex?: number;
|
|
983
|
-
}
|
|
984
|
-
/** Aggregated feedback the strategy produces from a scores batch. */
|
|
985
|
-
interface Feedback {
|
|
986
|
-
readonly summary: string;
|
|
987
|
-
readonly critique?: unknown;
|
|
988
|
-
readonly weakTasks?: readonly string[];
|
|
989
|
-
readonly score: number;
|
|
990
|
-
}
|
|
991
|
-
/**
|
|
992
|
-
* Strategy interface — plain object, no base class. Strategies implement three
|
|
993
|
-
* pure hooks; the loop infrastructure wraps them in reactive nodes so every
|
|
994
|
-
* decision is visible in `describe()`.
|
|
995
|
-
*
|
|
996
|
-
* `generate` may be sync or async. Async generates yield a microtask per
|
|
997
|
-
* iteration — that's what gives `pause()` / `setStrategy()` a window to
|
|
998
|
-
* interleave. **A fully synchronous `generate` will drain the entire loop
|
|
999
|
-
* during factory activation** (all iterations run before `refineLoop()`
|
|
1000
|
-
* returns), which is usually not what you want for observable, steerable
|
|
1001
|
-
* loops. Real strategies that call LLMs / evals are async and Just Work;
|
|
1002
|
-
* custom sync strategies for tests are fine but should be marked `async`
|
|
1003
|
-
* to match real cadence.
|
|
1004
|
-
*/
|
|
1005
|
-
interface RefineStrategy<T> {
|
|
1006
|
-
readonly name: string;
|
|
1007
|
-
/** Produce initial candidates from the seed. Called at iteration 0. */
|
|
1008
|
-
seed(seed: T): readonly T[];
|
|
1009
|
-
/** Reduce scores to feedback. Pure function. */
|
|
1010
|
-
analyze(scores: readonly EvalResult[], candidates: readonly T[]): Feedback;
|
|
1011
|
-
/**
|
|
1012
|
-
* Generate next-iteration candidates from feedback + prior candidates.
|
|
1013
|
-
* Async allowed — the loop awaits via `fromAny`.
|
|
1014
|
-
*/
|
|
1015
|
-
generate(feedback: Feedback, candidates: readonly T[]): Promise<readonly T[]> | readonly T[];
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* Evaluator shape — Shape 4 (2026-04-22): both `candidates` and `dataset` are
|
|
1019
|
-
* reactive nodes; the evaluator's returned node IS the EVALUATE topic's source
|
|
1020
|
-
* (no glue). Implementers can batch-eval (e.g. `funnel` with concurrency) or
|
|
1021
|
-
* map per-candidate — user's code.
|
|
1022
|
-
*
|
|
1023
|
-
* **`EvalResult.candidateIndex` semantics.** Optional per-result field.
|
|
1024
|
-
* When present, multi-candidate aggregators ({@link errorCritique}'s
|
|
1025
|
-
* `pickBest`) score per index, picking the candidate with the highest
|
|
1026
|
-
* mean score. When absent across all results, those aggregators fall back
|
|
1027
|
-
* to positional matching against `candidates[0]` — meaning a strategy that
|
|
1028
|
-
* generates >1 candidate but emits unindexed scores effectively only ever
|
|
1029
|
-
* critiques the first candidate. Set `candidateIndex` whenever the
|
|
1030
|
-
* evaluator's score corresponds to a specific candidate in the batch.
|
|
1031
|
-
*/
|
|
1032
|
-
type Evaluator<T> = (candidates: Node<readonly T[]>, dataset: Node<readonly DatasetItem[]>) => Node<readonly EvalResult[]>;
|
|
1033
|
-
/**
|
|
1034
|
-
* Early-stop controls. Each field fans into its own derived node; the four
|
|
1035
|
-
* combine via `||` into `converged: Node<boolean>`. Callers see exactly
|
|
1036
|
-
* which rule tripped via `status` / the DECIDE topic's `reason`.
|
|
1037
|
-
*/
|
|
1038
|
-
interface ConvergenceOptions {
|
|
1039
|
-
/** Stop when aggregate score has not improved for N iterations. */
|
|
1040
|
-
patience?: number;
|
|
1041
|
-
/** Stop when aggregate score reaches or exceeds this. */
|
|
1042
|
-
minScore?: number;
|
|
1043
|
-
/** Stop when absolute delta between consecutive scores falls below this. */
|
|
1044
|
-
minDelta?: number;
|
|
1045
|
-
/** Stop after N total evaluations (iteration count × per-iter candidates). */
|
|
1046
|
-
maxEvaluations?: number;
|
|
1047
|
-
/** Stop after N iterations. Always set a finite bound in production. */
|
|
1048
|
-
maxIterations?: number;
|
|
1049
|
-
}
|
|
1050
|
-
/** Emitted to the GENERATE topic each time the strategy produces a batch. */
|
|
1051
|
-
interface GenerateEvent<T> {
|
|
1052
|
-
readonly iteration: number;
|
|
1053
|
-
readonly candidates: readonly T[];
|
|
1054
|
-
readonly timestamp_ns: number;
|
|
1055
|
-
}
|
|
1056
|
-
/** Emitted to the EVALUATE topic when scores settle for an iteration. */
|
|
1057
|
-
interface EvaluateEvent<T> {
|
|
1058
|
-
readonly iteration: number;
|
|
1059
|
-
readonly candidates: readonly T[];
|
|
1060
|
-
readonly scores: readonly EvalResult[];
|
|
1061
|
-
readonly timestamp_ns: number;
|
|
1062
|
-
}
|
|
1063
|
-
/** Emitted to the ANALYZE topic — strategy's reduction over scores. */
|
|
1064
|
-
interface AnalyzeEvent<T> {
|
|
1065
|
-
readonly iteration: number;
|
|
1066
|
-
readonly candidates: readonly T[];
|
|
1067
|
-
readonly feedback: Feedback;
|
|
1068
|
-
readonly timestamp_ns: number;
|
|
1069
|
-
}
|
|
1070
|
-
/** Emitted to the DECIDE topic — branch taken this iteration. */
|
|
1071
|
-
interface DecideEvent {
|
|
1072
|
-
readonly iteration: number;
|
|
1073
|
-
readonly decision: "continue" | "converged" | "budget" | "paused";
|
|
1074
|
-
readonly reason?: string;
|
|
1075
|
-
readonly timestamp_ns: number;
|
|
1076
|
-
}
|
|
1077
|
-
type RefineStatus = "running" | "converged" | "budget" | "paused" | "errored";
|
|
1078
|
-
interface Iteration<T> {
|
|
1079
|
-
readonly n: number;
|
|
1080
|
-
readonly candidates: readonly T[];
|
|
1081
|
-
readonly scores: readonly EvalResult[];
|
|
1082
|
-
readonly feedback: Feedback;
|
|
1083
|
-
/** `null` iff the candidate batch for this iteration was empty. */
|
|
1084
|
-
readonly best: T | null;
|
|
1085
|
-
readonly bestScore: number;
|
|
1086
|
-
readonly timestamp_ns: number;
|
|
1087
|
-
}
|
|
1088
|
-
interface RefineLoopOptions extends ConvergenceOptions {
|
|
1089
|
-
/** Reactive dataset OR a plain array (auto-wrapped into `state`). */
|
|
1090
|
-
dataset: NodeInput<readonly DatasetItem[]> | readonly DatasetItem[];
|
|
1091
|
-
/** Total teacher calls cap across iterations. Default: unlimited. */
|
|
1092
|
-
budget?: number;
|
|
1093
|
-
/** Graph name. Default: `"refine-loop"`. */
|
|
1094
|
-
name?: string;
|
|
1095
|
-
/** Extra graph options forwarded to the underlying `Graph`. */
|
|
1096
|
-
graph?: GraphOptions;
|
|
1097
|
-
}
|
|
1098
|
-
/**
|
|
1099
|
-
* Return type — extends Graph so all observability tools (`describe`,
|
|
1100
|
-
* `explain`, `observe`, `attachSnapshotStorage`, `snapshot`) Just Work.
|
|
1101
|
-
*/
|
|
1102
|
-
interface RefineLoopGraph<T> extends Graph {
|
|
1103
|
-
readonly best: Node<T | null>;
|
|
1104
|
-
readonly score: Node<number>;
|
|
1105
|
-
readonly status: Node<RefineStatus>;
|
|
1106
|
-
readonly history: Node<readonly Iteration<T>[]>;
|
|
1107
|
-
readonly strategy: Node<RefineStrategy<T>>;
|
|
1108
|
-
readonly iteration: Node<number>;
|
|
1109
|
-
/** Stage topics — subscribe for per-stage streaming / cursor consumers. */
|
|
1110
|
-
readonly generate: TopicGraph<GenerateEvent<T>>;
|
|
1111
|
-
readonly evaluate: TopicGraph<EvaluateEvent<T>>;
|
|
1112
|
-
readonly analyze: TopicGraph<AnalyzeEvent<T>>;
|
|
1113
|
-
readonly decide: TopicGraph<DecideEvent>;
|
|
1114
|
-
/** Swap the active strategy mid-run (human-in-the-loop handoff). */
|
|
1115
|
-
setStrategy(next: RefineStrategy<T>): void;
|
|
1116
|
-
/** Pause after the current iteration completes. */
|
|
1117
|
-
pause(): void;
|
|
1118
|
-
/** Resume a paused loop. */
|
|
1119
|
-
resume(): void;
|
|
1120
|
-
}
|
|
1121
|
-
declare function refineLoop<T>(seed: T, evaluator: Evaluator<T>, initialStrategy: RefineStrategy<T>, opts: RefineLoopOptions): RefineLoopGraph<T>;
|
|
1122
|
-
/**
|
|
1123
|
-
* Context passed to a `blindVariation` teacher per call. `reportCost` is a
|
|
1124
|
-
* per-call hook — see `BlindVariationOptions.tokens`.
|
|
1125
|
-
*/
|
|
1126
|
-
interface BlindVariationContext<T> {
|
|
1127
|
-
readonly prior: T;
|
|
1128
|
-
/**
|
|
1129
|
-
* Report tokens consumed by this teacher call. Aggregated per iteration
|
|
1130
|
-
* and flushed to `opts.tokens` in the strategy's `finally` block so
|
|
1131
|
-
* partial spend is preserved when the teacher throws mid-batch.
|
|
1132
|
-
*/
|
|
1133
|
-
readonly reportCost: (tokens: number) => void;
|
|
1134
|
-
}
|
|
1135
|
-
interface BlindVariationOptions<T> {
|
|
1136
|
-
/** Name — default: `"blindVariation"`. */
|
|
1137
|
-
name?: string;
|
|
1138
|
-
/** Number of candidates generated per iteration. Default: 4. */
|
|
1139
|
-
width?: number;
|
|
1140
|
-
/**
|
|
1141
|
-
* Run teacher calls in parallel via `Promise.all`. Default `true` — the
|
|
1142
|
-
* common case (independent LLM calls). Set `false` to run sequentially
|
|
1143
|
-
* via `for/await` when teachers share stateful resources (rate limiters,
|
|
1144
|
-
* rolling context, serial API ordering) that don't tolerate concurrency.
|
|
1145
|
-
*/
|
|
1146
|
-
parallel?: boolean;
|
|
1147
|
-
/**
|
|
1148
|
-
* Optional cost counter node. Running total tokens reported via
|
|
1149
|
-
* `ctx.reportCost` during each iteration is added to this node in the
|
|
1150
|
-
* strategy's `finally` block — fires on success AND on teacher throw so
|
|
1151
|
-
* partial spend is never lost. User owns the node; wire to `budgetGate`,
|
|
1152
|
-
* `attachSnapshotStorage`, telemetry, etc.
|
|
1153
|
-
*/
|
|
1154
|
-
tokens?: Node<number>;
|
|
1155
|
-
/**
|
|
1156
|
-
* Teacher — given `{prior, reportCost}`, produce one variant. Async
|
|
1157
|
-
* allowed. Called `width` times per iteration. Call `ctx.reportCost(n)`
|
|
1158
|
-
* to track tokens consumed per call (optional, no-op if `opts.tokens`
|
|
1159
|
-
* is not set).
|
|
1160
|
-
*/
|
|
1161
|
-
teacher: (ctx: BlindVariationContext<T>) => Promise<T> | T;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* Simplest built-in strategy: generate N variants per iteration via the
|
|
1165
|
-
* supplied `teacher`; no feedback-informed steering (equivalent to Random
|
|
1166
|
-
* Search). Validates the loop infrastructure end-to-end and is the baseline
|
|
1167
|
-
* every other strategy should outperform.
|
|
1168
|
-
*
|
|
1169
|
-
* `analyze` records the mean score and flags the worst task — strategies that
|
|
1170
|
-
* care about per-task critique layer on top.
|
|
1171
|
-
*/
|
|
1172
|
-
declare function blindVariation<T>(opts: BlindVariationOptions<T>): RefineStrategy<T>;
|
|
1173
|
-
/**
|
|
1174
|
-
* Context passed to an `errorCritique` teacher. `critique` is the pre-formatted
|
|
1175
|
-
* summary a prompt template can drop in verbatim; `failures` carries the
|
|
1176
|
-
* structured evidence (per-task error / score / detail) for richer prompts.
|
|
1177
|
-
*/
|
|
1178
|
-
interface ErrorCritiqueContext<T> {
|
|
1179
|
-
readonly prior: T;
|
|
1180
|
-
readonly critique: string;
|
|
1181
|
-
readonly failures: readonly EvalResult[];
|
|
1182
|
-
/**
|
|
1183
|
-
* Report tokens consumed by this teacher call. Aggregated per iteration
|
|
1184
|
-
* and flushed to `opts.tokens` in the strategy's `finally` block so
|
|
1185
|
-
* partial spend is preserved when the teacher throws mid-batch.
|
|
1186
|
-
*/
|
|
1187
|
-
readonly reportCost: (tokens: number) => void;
|
|
1188
|
-
}
|
|
1189
|
-
interface ErrorCritiqueOptions<T> {
|
|
1190
|
-
/** Name — default: `"errorCritique"`. */
|
|
1191
|
-
name?: string;
|
|
1192
|
-
/** Number of candidates generated per iteration. Default: 4. */
|
|
1193
|
-
width?: number;
|
|
1194
|
-
/**
|
|
1195
|
-
* Cut-off below which a task is classified as a failure and fed into the
|
|
1196
|
-
* critique. Default: the batch mean — any task scoring below the batch
|
|
1197
|
-
* mean is a failure. Pass a number for an absolute cut-off, or a function
|
|
1198
|
-
* for per-batch computation (e.g. a percentile). When the default mean
|
|
1199
|
-
* is non-finite (NaN / ±Infinity from a degenerate evaluator), ALL scores
|
|
1200
|
-
* are treated as failures so the critique loop continues to steer.
|
|
1201
|
-
*/
|
|
1202
|
-
failureThreshold?: number | ((scores: readonly EvalResult[]) => number);
|
|
1203
|
-
/** Cap on failure samples packed into the critique. Default: 5. */
|
|
1204
|
-
maxFailureSamples?: number;
|
|
1205
|
-
/**
|
|
1206
|
-
* Format failures into the `critique` string passed to the teacher. Default
|
|
1207
|
-
* joins `- taskId (score=N) | error: …` lines. Override to shape LLM prompts.
|
|
1208
|
-
*
|
|
1209
|
-
* **Note:** the `feedback` argument is a shell with `{score, weakTasks}`
|
|
1210
|
-
* populated; `summary` is empty because `analyze` computes the final summary
|
|
1211
|
-
* AFTER `formatCritique` runs (the summary embeds the formatted count).
|
|
1212
|
-
* Rely on `failures` and `feedback.score` — do not read `feedback.summary`
|
|
1213
|
-
* here.
|
|
1214
|
-
*/
|
|
1215
|
-
formatCritique?: (failures: readonly EvalResult[], feedback: Feedback) => string;
|
|
1216
|
-
/**
|
|
1217
|
-
* Run teacher calls in parallel via `Promise.all`. Default `true` — the
|
|
1218
|
-
* common case (independent LLM calls). Set `false` to run sequentially
|
|
1219
|
-
* via `for/await` when teachers share stateful resources (rate limiters,
|
|
1220
|
-
* rolling context, serial API ordering) that don't tolerate concurrency.
|
|
1221
|
-
*/
|
|
1222
|
-
parallel?: boolean;
|
|
1223
|
-
/**
|
|
1224
|
-
* Optional cost counter node. Running total tokens reported via
|
|
1225
|
-
* `ctx.reportCost` during each iteration is added to this node in the
|
|
1226
|
-
* strategy's `finally` block — fires on success AND on teacher throw so
|
|
1227
|
-
* partial spend is never lost. User owns the node; wire to `budgetGate`,
|
|
1228
|
-
* `attachSnapshotStorage`, telemetry, etc.
|
|
1229
|
-
*/
|
|
1230
|
-
tokens?: Node<number>;
|
|
1231
|
-
/**
|
|
1232
|
-
* Teacher — given `{prior, critique, failures, reportCost}`, produce one
|
|
1233
|
-
* refined variant. Called `width` times per iteration. Async allowed.
|
|
1234
|
-
* Call `ctx.reportCost(n)` to track tokens consumed per call (optional,
|
|
1235
|
-
* no-op if `opts.tokens` is not set).
|
|
1236
|
-
*/
|
|
1237
|
-
teacher: (ctx: ErrorCritiqueContext<T>) => Promise<T> | T;
|
|
1238
|
-
}
|
|
1239
|
-
/**
|
|
1240
|
-
* Critique-driven strategy (ProTeGi-style "textual gradient"). Each iteration:
|
|
1241
|
-
* 1. `analyze` classifies tasks scoring below a threshold as failures, picks
|
|
1242
|
-
* the best candidate from the batch, and packs both plus a formatted
|
|
1243
|
-
* critique string into `feedback.critique` as a private payload.
|
|
1244
|
-
* 2. `generate` unpacks that payload and calls the teacher with
|
|
1245
|
-
* `{prior, critique, failures, reportCost}` `width` times, returning the
|
|
1246
|
-
* refined batch.
|
|
1247
|
-
*
|
|
1248
|
-
* The teacher receives a pre-formatted string (drop into an LLM prompt) AND
|
|
1249
|
-
* the structured failure list (for richer prompts that want per-task detail).
|
|
1250
|
-
* Throws on empty candidate batches — matches `blindVariation`'s contract
|
|
1251
|
-
* (no silent zero-candidate cycles).
|
|
1252
|
-
*
|
|
1253
|
-
* When `setStrategy()` swaps this strategy in mid-run, the first `generate`
|
|
1254
|
-
* may receive a `Feedback` produced by the prior strategy (no private payload);
|
|
1255
|
-
* the fallback path uses `candidates[last]` as the prior and the feedback
|
|
1256
|
-
* summary as the critique, so the loop keeps running without a stall. When a
|
|
1257
|
-
* private payload IS present, `priv.critiqueText` takes precedence over any
|
|
1258
|
-
* edits a caller made to `feedback.summary` — treat `critique` as the
|
|
1259
|
-
* strategy-owned channel.
|
|
1260
|
-
*/
|
|
1261
|
-
declare function errorCritique<T>(opts: ErrorCritiqueOptions<T>): RefineStrategy<T>;
|
|
1262
|
-
|
|
1263
|
-
/**
|
|
1264
|
-
* evalVerifier — re-run the affected eval tasks against the execute-stage
|
|
1265
|
-
* artifact instead of asking an LLM to opine on the fix.
|
|
1266
|
-
*
|
|
1267
|
-
* Pairs naturally with {@link refineExecutor}: refineExecutor emits an
|
|
1268
|
-
* `ExecuteOutput<T>.artifact` holding the converged candidate; evalVerifier
|
|
1269
|
-
* pulls it out via `extractArtifact` and feeds a single-candidate batch
|
|
1270
|
-
* into the same `Evaluator<T>` shape that `refineLoop` used. Consistent
|
|
1271
|
-
* scoring between EXECUTE and VERIFY — no "LLM said it looks fine" gap.
|
|
1272
|
-
*
|
|
1273
|
-
* **C2 lifecycle (Tier 6.5).** The work fn is invoked once per claimed
|
|
1274
|
-
* verify-stage job. A fresh single-candidate eval subgraph is mounted
|
|
1275
|
-
* inside the work fn and tears down when the JobFlow pump ack/unsubs.
|
|
1276
|
-
*
|
|
1277
|
-
* @module
|
|
1278
|
-
*/
|
|
1279
|
-
|
|
1280
|
-
/** Summary of the re-eval wave passed to a custom `toOutput` mapper. */
|
|
1281
|
-
interface EvalVerifierSummary {
|
|
1282
|
-
readonly scores: readonly EvalResult[];
|
|
1283
|
-
readonly meanScore: number;
|
|
1284
|
-
readonly passCount: number;
|
|
1285
|
-
readonly total: number;
|
|
1286
|
-
readonly threshold: number;
|
|
1287
|
-
/**
|
|
1288
|
-
* True when the EXECUTE stage did not produce an artifact (i.e.
|
|
1289
|
-
* `extractArtifact` returned `null` / `undefined`). Downstream mappers
|
|
1290
|
-
* can distinguish this from "evaluator ran but everything scored zero".
|
|
1291
|
-
*/
|
|
1292
|
-
readonly missingArtifact?: boolean;
|
|
1293
|
-
}
|
|
1294
|
-
/** Configuration for {@link evalVerifier}. */
|
|
1295
|
-
interface EvalVerifierConfig<T> {
|
|
1296
|
-
/**
|
|
1297
|
-
* Pull the artifact that should be re-evaluated out of the execute-stage
|
|
1298
|
-
* output. Default: `(exec) => exec.artifact as T` — works out-of-the-box
|
|
1299
|
-
* with `refineExecutor` (which populates `artifact` by default).
|
|
1300
|
-
*/
|
|
1301
|
-
extractArtifact?: (exec: ExecuteOutput<T>, item: TriagedItem) => T | null | undefined;
|
|
1302
|
-
/**
|
|
1303
|
-
* Reactive evaluator — same contract as `refineLoop`'s `Evaluator<T>`.
|
|
1304
|
-
*/
|
|
1305
|
-
evaluator: Evaluator<T>;
|
|
1306
|
-
/**
|
|
1307
|
-
* Resolve which dataset rows to score this verification against.
|
|
1308
|
-
*/
|
|
1309
|
-
datasetFor: (item: TriagedItem) => readonly DatasetItem[];
|
|
1310
|
-
/** Mean score required to pass verification. Default `0.5`. */
|
|
1311
|
-
threshold?: number;
|
|
1312
|
-
/** Optional output mapper — override the default findings / errorClass shape. */
|
|
1313
|
-
toOutput?: (summary: EvalVerifierSummary) => VerifyOutput;
|
|
1314
|
-
/** Node name prefix for introspection. */
|
|
1315
|
-
name?: string;
|
|
1316
|
-
}
|
|
1317
|
-
/**
|
|
1318
|
-
* Build a {@link HarnessVerifier} that re-runs the eval suite against the
|
|
1319
|
-
* artifact produced by EXECUTE.
|
|
1320
|
-
*
|
|
1321
|
-
* Reads `job.payload.execution` (filled by the upstream execute work fn)
|
|
1322
|
-
* and runs the evaluator against `extractArtifact(execution, item)`.
|
|
1323
|
-
* Returns the same payload with `verify` filled in.
|
|
1324
|
-
*
|
|
1325
|
-
* @example Pair with refineExecutor for end-to-end eval consistency.
|
|
1326
|
-
* ```ts
|
|
1327
|
-
* const evaluator: Evaluator<CatalogEntry> = (cands, ds) => runEval(cands, ds);
|
|
1328
|
-
* const harness = harnessLoop("repair", {
|
|
1329
|
-
* adapter,
|
|
1330
|
-
* executor: refineExecutor({ ..., evaluator, ...strategyConfig }),
|
|
1331
|
-
* verifier: evalVerifier({ evaluator, datasetFor, threshold: 0.8 }),
|
|
1332
|
-
* });
|
|
1333
|
-
* ```
|
|
1334
|
-
*/
|
|
1335
|
-
declare function evalVerifier<T>(config: EvalVerifierConfig<T>): HarnessVerifier<T>;
|
|
1336
|
-
/**
|
|
1337
|
-
* Config for {@link harnessEvalPair} — the typed bundle that produces a
|
|
1338
|
-
* matched `refineExecutor<T>` + `evalVerifier<T>` pair sharing one
|
|
1339
|
-
* {@link Evaluator} and one `datasetFor` resolver.
|
|
1340
|
-
*/
|
|
1341
|
-
interface HarnessEvalPairConfig<T> {
|
|
1342
|
-
/** Map a triaged item to the seed candidate. */
|
|
1343
|
-
seedFrom: (item: TriagedItem) => T;
|
|
1344
|
-
/** The reactive evaluator used by BOTH executor and verifier. */
|
|
1345
|
-
evaluator: Evaluator<T>;
|
|
1346
|
-
/** The refinement strategy (e.g. `errorCritique(teacher)`). */
|
|
1347
|
-
strategy: RefineStrategy<T>;
|
|
1348
|
-
/** Resolve dataset rows per triaged item. */
|
|
1349
|
-
datasetFor: (item: TriagedItem) => readonly DatasetItem[];
|
|
1350
|
-
/** Pass-threshold for the verifier. Default `0.5`. */
|
|
1351
|
-
threshold?: number;
|
|
1352
|
-
/** Convergence / budget options forwarded to each inner `refineLoop`. */
|
|
1353
|
-
refine?: Omit<RefineLoopOptions, "dataset" | "name">;
|
|
1354
|
-
/**
|
|
1355
|
-
* Shared node-name prefix — the executor becomes `${name}-exec` and the
|
|
1356
|
-
* verifier `${name}-verify` for distinct but related describe() paths.
|
|
1357
|
-
* Default `"harness-pair"`.
|
|
1358
|
-
*/
|
|
1359
|
-
name?: string;
|
|
1360
|
-
}
|
|
1361
|
-
/**
|
|
1362
|
-
* Typed factory that returns a matched `{ executor, verifier }` pair.
|
|
1363
|
-
*
|
|
1364
|
-
* Prevents the "executor wrote `A`, verifier expected `B`" class of runtime
|
|
1365
|
-
* cast errors — `T` is threaded through both sides, so mixing up the
|
|
1366
|
-
* configuration is a compile error instead of a silent `as T` in
|
|
1367
|
-
* `extractArtifact`. Shares the evaluator so EXECUTE and VERIFY score with
|
|
1368
|
-
* identical semantics (the whole point of `evalVerifier`).
|
|
1369
|
-
*/
|
|
1370
|
-
declare function harnessEvalPair<T>(config: HarnessEvalPairConfig<T>): {
|
|
1371
|
-
executor: HarnessExecutor<T>;
|
|
1372
|
-
verifier: HarnessVerifier<T>;
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
/**
|
|
1376
|
-
* harnessLoop() factory (roadmap §9.0).
|
|
1377
|
-
*
|
|
1378
|
-
* Wires the static 7-stage topology: INTAKE → TRIAGE → QUEUE → GATE →
|
|
1379
|
-
* EXECUTE → VERIFY → REFLECT. Static topology, flowing data — the Kafka
|
|
1380
|
-
* insight applied to human+LLM collaboration.
|
|
1381
|
-
*
|
|
1382
|
-
* **Hub model (Wave B Unit 20 C + Q1).** All reactive-wire-crossing topics
|
|
1383
|
-
* live in one `MessagingHubGraph` exposed as `HarnessGraph.queues`: the
|
|
1384
|
-
* four per-route queues, an `__unrouted` dead-letter, plus `intake`,
|
|
1385
|
-
* `retry`, `verify-results`, and the `triage-output` fan-in topic. The
|
|
1386
|
-
* router is a single derived/effect pair that publishes to `triage-output`;
|
|
1387
|
-
* per-route `topicBridge`s fan out by `map:` predicate. Routing is data
|
|
1388
|
-
* (topic name), not code — every routing decision is a visible edge in
|
|
1389
|
-
* `describe()` / `explain()`.
|
|
1390
|
-
*
|
|
1391
|
-
* **EXECUTE/VERIFY via JobFlow (Tier 6.5 C2 lock, 2026-04-28).** The
|
|
1392
|
-
* stages 5–6 EXECUTE → VERIFY pair runs through an internal `executeFlow`
|
|
1393
|
-
* JobFlow with two stages (`execute`, `verify`). Each stage's pump owns
|
|
1394
|
-
* `claim → work → ack` for one claim; the verify stage's payload contains
|
|
1395
|
-
* `{ item, execution, verify }` so the post-completed dispatch effect can
|
|
1396
|
-
* route the 3-way verdict (verified / self-correctable retry / structural
|
|
1397
|
-
* + reingest) without any cross-wave `withLatestFrom` pairing. Items
|
|
1398
|
-
* arriving from per-route topics + retry feedback enter via a single
|
|
1399
|
-
* `enqueueEffect` that pushes to `executeFlow.queue("execute")`.
|
|
1400
|
-
*
|
|
1401
|
-
* @module
|
|
1402
|
-
*/
|
|
1403
|
-
|
|
1404
|
-
/**
|
|
1405
|
-
* Build the default EXECUTE work fn — calls `adapter.invoke()` once per
|
|
1406
|
-
* claimed job, parses the JSON response into an `ExecuteOutput<A>`, and
|
|
1407
|
-
* returns a {@link HarnessJobPayload} with `execution` filled in.
|
|
1408
|
-
*
|
|
1409
|
-
* Errors (parse failure, adapter throw, malformed JSON) are caught and
|
|
1410
|
-
* surfaced as a `failure`-outcome payload — the dispatch effect routes
|
|
1411
|
-
* the item rather than dropping it via pump nack (see C2 contract on
|
|
1412
|
-
* {@link HarnessExecutor}).
|
|
1413
|
-
*
|
|
1414
|
-
* Subsumes the pre-Tier-6.5 `promptNode`-based default: per-claim LLM
|
|
1415
|
-
* calls don't benefit from `promptNode`'s cross-wave switchMap, and a
|
|
1416
|
-
* fresh per-claim subgraph would be wasteful. Direct `adapter.invoke`
|
|
1417
|
-
* is the right shape inside JobFlow pumps.
|
|
1418
|
-
*
|
|
1419
|
-
* @param adapter - LLMAdapter for the execute call.
|
|
1420
|
-
* @param prompt - Prompt template (string or `(item) => string`). Defaults
|
|
1421
|
-
* to the harness's built-in execute prompt.
|
|
1422
|
-
*/
|
|
1423
|
-
declare function defaultLlmExecutor<A = unknown>(adapter: LLMAdapter, prompt?: string | ExecutePromptFn): HarnessExecutor<A>;
|
|
1424
|
-
/**
|
|
1425
|
-
* Build the default VERIFY work fn — calls `adapter.invoke()` once per
|
|
1426
|
-
* claimed job to review the prior-stage execution, parses the JSON
|
|
1427
|
-
* response into a `VerifyOutput`, and returns a {@link HarnessJobPayload}
|
|
1428
|
-
* with `verify` filled in.
|
|
1429
|
-
*
|
|
1430
|
-
* Same C2 error semantics as {@link defaultLlmExecutor}: parse / adapter
|
|
1431
|
-
* failures are surfaced as a structural-failure verify payload so the
|
|
1432
|
-
* dispatch effect routes the item.
|
|
1433
|
-
*/
|
|
1434
|
-
declare function defaultLlmVerifier<A = unknown>(adapter: LLMAdapter, prompt?: string | VerifyPromptFn<A>): HarnessVerifier<A>;
|
|
1435
|
-
/**
|
|
1436
|
-
* The graph returned by {@link harnessLoop}. Wraps a single
|
|
1437
|
-
* {@link MessagingHubGraph} that owns all reactive-wire-crossing topics
|
|
1438
|
-
* (intake, per-route queues, `__unrouted`, retry, verify-results,
|
|
1439
|
-
* triage-output), plus an `executeFlow` JobFlow that owns the
|
|
1440
|
-
* EXECUTE → VERIFY pipeline (Tier 6.5 C2). Sugar getters expose the
|
|
1441
|
-
* canonical topics so the surface stays ergonomic.
|
|
1442
|
-
*/
|
|
1443
|
-
declare class HarnessGraph<A = unknown> extends Graph {
|
|
1444
|
-
/** Messaging hub — the routing-data plane. Queue topics live here. */
|
|
1445
|
-
readonly queues: MessagingHubGraph;
|
|
1446
|
-
/**
|
|
1447
|
-
* EXECUTE → VERIFY JobFlow (Tier 6.5 C2). Pumps own claim/ack/nack
|
|
1448
|
-
* lifecycle for each stage. Inspect via:
|
|
1449
|
-
* - `harness.executeFlow.queue("execute").pending` — pending depth.
|
|
1450
|
-
* - `harness.executeFlow.queue("verify").pending` — items mid-execute.
|
|
1451
|
-
* - `harness.executeFlow.completed` — verified items waiting for the
|
|
1452
|
-
* dispatch effect's 3-way routing.
|
|
1453
|
-
* - `harness.executeFlow.completedCount` — total terminal completions.
|
|
1454
|
-
*/
|
|
1455
|
-
readonly executeFlow: JobFlowGraph<HarnessJobPayload<A>>;
|
|
1456
|
-
/**
|
|
1457
|
-
* Per-route JobQueueGraph audit mirrors. Each triaged item that reaches
|
|
1458
|
-
* a queue is also enqueued here, giving reactive `depth` + `pending` +
|
|
1459
|
-
* `jobs` observables per route. The dispatch effect ack/removeBy-id's
|
|
1460
|
-
* the matching job on terminal verdict. The executeFlow JobFlow handles
|
|
1461
|
-
* the EXECUTE → VERIFY data flow; this is a parallel audit-side ledger
|
|
1462
|
-
* for per-route depth metrics. Inspect via
|
|
1463
|
-
* `harness.jobs.get(route).depth.cache` for backpressure metrics.
|
|
1464
|
-
*/
|
|
1465
|
-
readonly jobs: ReadonlyMap<QueueRoute, JobQueueGraph<TriagedItem>>;
|
|
1466
|
-
/** Per-route gate controllers (only for gated queues). */
|
|
1467
|
-
readonly gates: ReadonlyMap<QueueRoute, GateController<TriagedItem>>;
|
|
1468
|
-
/**
|
|
1469
|
-
* Per-route queue topics — typed accessor for the four
|
|
1470
|
-
* {@link QUEUE_NAMES} entries (`auto-fix`, `needs-decision`,
|
|
1471
|
-
* `investigation`, `backlog`). Mirrors the `gates` / `jobs` map
|
|
1472
|
-
* shape so callers can iterate `[route, topic]` pairs without
|
|
1473
|
-
* hand-rolling `harness.queues.topicNames()` + meta-topic exclusion.
|
|
1474
|
-
*
|
|
1475
|
-
* Excludes the meta topics that share the hub:
|
|
1476
|
-
* `intake` (use {@link intake}), `verify-results` (use
|
|
1477
|
-
* {@link verifyResults}), `retry` (use {@link retry}), `__unrouted`
|
|
1478
|
-
* (use {@link unrouted}), and the internal `triage-output` fan-in.
|
|
1479
|
-
*/
|
|
1480
|
-
readonly queueTopics: ReadonlyMap<QueueRoute, TopicGraph<TriagedItem>>;
|
|
1481
|
-
/** Strategy model bundle — record outcomes, lookup effectiveness. */
|
|
1482
|
-
readonly strategy: StrategyModelBundle;
|
|
1483
|
-
/** Global retry count across all items (circuit breaker). Reactive — subscribable. */
|
|
1484
|
-
readonly totalRetries: Node<number>;
|
|
1485
|
-
/** Global reingestion count across all items (circuit breaker). Reactive — subscribable. */
|
|
1486
|
-
readonly totalReingestions: Node<number>;
|
|
1487
|
-
/**
|
|
1488
|
-
* Per-route priority score nodes, populated only when `opts.priority` is
|
|
1489
|
-
* set on {@link harnessLoop}. Each node emits a score combining severity,
|
|
1490
|
-
* attention decay, and strategy-model effectiveness for the route's
|
|
1491
|
-
* current head-of-queue item. `undefined` means the caller did not opt
|
|
1492
|
-
* in to priority scoring.
|
|
1493
|
-
*/
|
|
1494
|
-
readonly priorityScores?: ReadonlyMap<QueueRoute, Node<number>>;
|
|
1495
|
-
/**
|
|
1496
|
-
* REFLECT-stage tick marker — emits one DATA per terminal verdict observed
|
|
1497
|
-
* on `executeFlow.completed`. `equals: () => false` so each completion
|
|
1498
|
-
* produces an observable tick (no Object.is collapse on identical
|
|
1499
|
-
* `null` payloads). Inspection tools (`harnessTrace`, dashboards) can
|
|
1500
|
-
* subscribe directly here instead of resolving by string path
|
|
1501
|
-
* (`harness.node("reflect")`) — the field is the lock against rename
|
|
1502
|
-
* drift.
|
|
1503
|
-
*/
|
|
1504
|
-
readonly reflect: Node<null>;
|
|
1505
|
-
constructor(name: string, queues: MessagingHubGraph, executeFlow: JobFlowGraph<HarnessJobPayload<A>>, queueTopics: Map<QueueRoute, TopicGraph<TriagedItem>>, jobs: Map<QueueRoute, JobQueueGraph<TriagedItem>>, gates: Map<QueueRoute, GateController<TriagedItem>>, strategy: StrategyModelBundle, totalRetries: Node<number>, totalReingestions: Node<number>, reflect: Node<null>, priorityScores?: Map<QueueRoute, Node<number>>);
|
|
1506
|
-
/** Intake topic — publish items here to enter the loop. */
|
|
1507
|
-
get intake(): TopicGraph<IntakeItem>;
|
|
1508
|
-
/** Verify results topic — subscribe to see verification outcomes. */
|
|
1509
|
-
get verifyResults(): TopicGraph<VerifyResult<A>>;
|
|
1510
|
-
/** Retry feedback topic — fast-retry re-entry point. */
|
|
1511
|
-
get retry(): TopicGraph<TriagedItem>;
|
|
1512
|
-
/** Dead-letter topic for items whose LLM-chosen route is unknown. */
|
|
1513
|
-
get unrouted(): TopicGraph<TriagedItem>;
|
|
1514
|
-
/**
|
|
1515
|
-
* Stage-label → observe-path map for the 7 pipeline stages.
|
|
1516
|
-
*
|
|
1517
|
-
* Decouples inspection tools (`harnessTrace`, `harnessProfile`, custom
|
|
1518
|
-
* dashboards) from mount-structure churn: hub migration, future stage
|
|
1519
|
-
* splits, gate remounting, or the Tier 6.5 C2 JobFlow rewire shouldn't
|
|
1520
|
-
* require edits to `trace.ts` as long as this method stays accurate.
|
|
1521
|
-
*
|
|
1522
|
-
* Each stage yields `{ label, paths }`; consumers iterate paths per
|
|
1523
|
-
* stage and attach observers. Tier 6.5: EXECUTE / VERIFY paths now
|
|
1524
|
-
* resolve to the `executeFlow` stage queues + the `verify-dispatch`
|
|
1525
|
-
* effect node.
|
|
1526
|
-
*/
|
|
1527
|
-
stageNodes(): ReadonlyArray<{
|
|
1528
|
-
label: string;
|
|
1529
|
-
paths: readonly string[];
|
|
1530
|
-
}>;
|
|
1531
|
-
}
|
|
1532
|
-
/**
|
|
1533
|
-
* Wire the reactive collaboration loop as a static-topology graph.
|
|
1534
|
-
*
|
|
1535
|
-
* The loop has 7 stages:
|
|
1536
|
-
* 1. **INTAKE** — items arrive from multiple sources via `intake.publish()`
|
|
1537
|
-
* 2. **TRIAGE** — promptNode classifies, routes, and prioritizes
|
|
1538
|
-
* 3. **QUEUE** — 4 priority-ordered TopicGraphs (auto-fix, needs-decision, investigation, backlog)
|
|
1539
|
-
* 4. **GATE** — human approval on configurable queues
|
|
1540
|
-
* 5. **EXECUTE** — JobFlow `execute` stage; user-supplied or default work fn
|
|
1541
|
-
* 6. **VERIFY** — JobFlow `verify` stage; verifies the executed artifact
|
|
1542
|
-
* 7. **REFLECT** — strategy model records outcomes; dispatch effect routes 3-way
|
|
1543
|
-
*
|
|
1544
|
-
* @param name - Graph name.
|
|
1545
|
-
* @param opts - Configuration.
|
|
1546
|
-
* @returns HarnessGraph with controller accessors.
|
|
1547
|
-
*/
|
|
1548
|
-
declare function harnessLoop<A = unknown>(name: string, opts: HarnessLoopOptions<A>): HarnessGraph<A>;
|
|
1549
|
-
|
|
1550
|
-
/**
|
|
1551
|
-
* Harness-specific graph profiling (roadmap §9.0).
|
|
1552
|
-
*
|
|
1553
|
-
* Extends {@link graphProfile} with harness domain counters:
|
|
1554
|
-
* queue depths, strategy entries, retry/reingestion tracker sizes.
|
|
1555
|
-
*
|
|
1556
|
-
* @module
|
|
1557
|
-
*/
|
|
1558
|
-
|
|
1559
|
-
/** Harness-specific profile extending the base graph profile. */
|
|
1560
|
-
interface HarnessProfileResult extends GraphProfileResult {
|
|
1561
|
-
/** Per-queue retained item counts. */
|
|
1562
|
-
queueDepths: Record<QueueRoute, number>;
|
|
1563
|
-
/** Number of rootCause→intervention entries in the strategy model. */
|
|
1564
|
-
strategyEntries: number;
|
|
1565
|
-
/** Global retry count across all items. */
|
|
1566
|
-
totalRetries: number;
|
|
1567
|
-
/** Global reingestion count across all items. */
|
|
1568
|
-
totalReingestions: number;
|
|
1569
|
-
}
|
|
1570
|
-
/**
|
|
1571
|
-
* Profile a harness graph with domain-specific counters.
|
|
1572
|
-
*
|
|
1573
|
-
* **Snapshot caveat (Unit 22 B).** Reads `.cache` values from the
|
|
1574
|
-
* strategy / retry / reingestion nodes + each queue topic's `.retained()`
|
|
1575
|
-
* view. These are point-in-time reads and are not transactional — if you
|
|
1576
|
-
* invoke this during an in-flight reactive wave the values may reflect
|
|
1577
|
-
* a partially-settled frame. For end-of-wave accuracy, call from outside
|
|
1578
|
-
* any batch boundary.
|
|
1579
|
-
*
|
|
1580
|
-
* @param harness - The HarnessGraph to profile.
|
|
1581
|
-
* @param opts - Optional base profile options.
|
|
1582
|
-
* @returns Harness profile with queue depths, strategy stats, and tracker sizes.
|
|
1583
|
-
*/
|
|
1584
|
-
declare function harnessProfile(harness: HarnessGraph, opts?: GraphProfileOptions): HarnessProfileResult;
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
* refineExecutor — bridge a `refineLoop` into the harness EXECUTE work fn.
|
|
1588
|
-
*
|
|
1589
|
-
* Each claimed job mounts a fresh `refineLoop`; when the loop reaches a
|
|
1590
|
-
* terminal status (`converged` / `budget` / `errored`), the work fn emits a
|
|
1591
|
-
* single {@link HarnessJobPayload} with `execution` filled in. The JobFlow
|
|
1592
|
-
* pump subscribes once, takes the first DATA, then unsubscribes — so the
|
|
1593
|
-
* inner loop tears down cleanly when the harness acks the job.
|
|
1594
|
-
*
|
|
1595
|
-
* **C2 lifecycle (Tier 6.5).** The work fn is invoked once per claim, so
|
|
1596
|
-
* no internal `switchMap` is needed (the prior pre-C2 shape used switchMap
|
|
1597
|
-
* to handle a stream of items). The pump owns the per-claim lifecycle:
|
|
1598
|
-
* activation when the work fn returns, teardown when the result Node is
|
|
1599
|
-
* unsubscribed.
|
|
1600
|
-
*
|
|
1601
|
-
* **Cross-item learning:** a fresh refineLoop per item means
|
|
1602
|
-
* `errorCritique`-style failure sampling does NOT accumulate across items
|
|
1603
|
-
* sharing a `rootCause`. A persistent-loop + re-seed surface is filed in
|
|
1604
|
-
* `docs/optimizations.md` as a long-term follow-up.
|
|
1605
|
-
*
|
|
1606
|
-
* @module
|
|
1607
|
-
*/
|
|
1608
|
-
|
|
1609
|
-
/** Terminal-run snapshot passed to a custom `toOutput` mapper. */
|
|
1610
|
-
interface RefineExecutorResult<T> {
|
|
1611
|
-
/** Best candidate the inner loop converged on. `null` if no candidates were scored. */
|
|
1612
|
-
readonly best: T | null;
|
|
1613
|
-
/** Aggregate score at termination. `-Infinity` if the batch was empty. */
|
|
1614
|
-
readonly score: number;
|
|
1615
|
-
/** Reason the loop terminated. */
|
|
1616
|
-
readonly status: RefineStatus;
|
|
1617
|
-
}
|
|
1618
|
-
/** Configuration for {@link refineExecutor}. */
|
|
1619
|
-
interface RefineExecutorConfig<T> {
|
|
1620
|
-
/** Map a triaged item to the seed candidate (e.g. a catalog entry, prompt, patch). */
|
|
1621
|
-
seedFrom: (item: TriagedItem) => T;
|
|
1622
|
-
/** Reactive evaluator — same shape as passed to `refineLoop`. */
|
|
1623
|
-
evaluator: Evaluator<T>;
|
|
1624
|
-
/** Strategy (e.g. `errorCritique(teacher)`). Applied to every item's inner loop. */
|
|
1625
|
-
strategy: RefineStrategy<T>;
|
|
1626
|
-
/** Map a triaged item to the dataset rows the evaluator should score against. */
|
|
1627
|
-
datasetFor: (item: TriagedItem) => readonly DatasetItem[];
|
|
1628
|
-
/**
|
|
1629
|
-
* Optional mapper from the inner loop's terminal snapshot to an
|
|
1630
|
-
* `ExecuteOutput<T>`. Default: converged→success, budget→partial,
|
|
1631
|
-
* errored→failure.
|
|
1632
|
-
*/
|
|
1633
|
-
toOutput?: (result: RefineExecutorResult<T>) => ExecuteOutput<T>;
|
|
1634
|
-
/** Convergence / budget options forwarded to each inner `refineLoop`. */
|
|
1635
|
-
refine?: Omit<RefineLoopOptions, "dataset" | "name">;
|
|
1636
|
-
/** Node name prefix for introspection. Default `"refine-executor"`. */
|
|
1637
|
-
name?: string;
|
|
1638
|
-
}
|
|
1639
|
-
/**
|
|
1640
|
-
* Build a {@link HarnessExecutor} backed by a `refineLoop` per claimed
|
|
1641
|
-
* job.
|
|
1642
|
-
*
|
|
1643
|
-
* @example Eval-driven repair loop in the harness EXECUTE slot.
|
|
1644
|
-
* ```ts
|
|
1645
|
-
* const harness = harnessLoop("repair", {
|
|
1646
|
-
* adapter,
|
|
1647
|
-
* executor: refineExecutor({
|
|
1648
|
-
* seedFrom: (item) => initialCatalogEntry(item),
|
|
1649
|
-
* datasetFor: (item) => pickAffectedTasks(item, allTasks),
|
|
1650
|
-
* evaluator: (cands, tasks) => runEvalBatch(cands, tasks),
|
|
1651
|
-
* strategy: errorCritique({ teacher, width: 3 }),
|
|
1652
|
-
* refine: { maxIterations: 5, minScore: 0.9 },
|
|
1653
|
-
* }),
|
|
1654
|
-
* });
|
|
1655
|
-
* ```
|
|
1656
|
-
*/
|
|
1657
|
-
declare function refineExecutor<T>(config: RefineExecutorConfig<T>): HarnessExecutor<T>;
|
|
1658
|
-
|
|
1659
|
-
/**
|
|
1660
|
-
* Harness pipeline trace — thin sugar over `graph.observe({ format: "stage-log" })`.
|
|
1661
|
-
*
|
|
1662
|
-
* Since 2026-04-22 (D2), stage-labeled tracing is a first-class observe format
|
|
1663
|
-
* on {@link Graph}. `harnessTrace` wires that format over the 7 pipeline stages
|
|
1664
|
-
* (INTAKE → TRIAGE → QUEUE → GATE → EXECUTE → VERIFY → STRATEGY) with sensible
|
|
1665
|
-
* defaults so harness consumers don't need to restate the stage map.
|
|
1666
|
-
*
|
|
1667
|
-
* For non-harness graphs, call `graph.observe({ format: "stage-log", stageLabels })`
|
|
1668
|
-
* directly — the format is domain-agnostic.
|
|
1669
|
-
*
|
|
1670
|
-
* @module
|
|
1671
|
-
*/
|
|
1672
|
-
|
|
1673
|
-
/** Event type captured by structured trace. */
|
|
1674
|
-
type TraceEventType = "data" | "error" | "complete";
|
|
1675
|
-
/** A single structured trace event. */
|
|
1676
|
-
interface TraceEvent {
|
|
1677
|
-
/** Elapsed seconds since trace was created. */
|
|
1678
|
-
elapsed: number;
|
|
1679
|
-
/** Pipeline stage label (INTAKE, TRIAGE, QUEUE, GATE, EXECUTE, VERIFY, STRATEGY). */
|
|
1680
|
-
stage: string;
|
|
1681
|
-
/** Event type. */
|
|
1682
|
-
type: TraceEventType;
|
|
1683
|
-
/** Data payload (present for "data" and "error" events). Omitted at "summary" detail. */
|
|
1684
|
-
data?: unknown;
|
|
1685
|
-
/** Human-readable summary of the data. Present at "standard" and "full" detail. */
|
|
1686
|
-
summary?: string;
|
|
1687
|
-
}
|
|
1688
|
-
/** Detail level for trace output. */
|
|
1689
|
-
type TraceDetail =
|
|
1690
|
-
/** Stage + elapsed only. No data preview. Lowest overhead. */
|
|
1691
|
-
"summary"
|
|
1692
|
-
/** Stage + elapsed + truncated data preview. Default. */
|
|
1693
|
-
| "standard"
|
|
1694
|
-
/** Stage + elapsed + full raw data. Use for debugging, not production. */
|
|
1695
|
-
| "full";
|
|
1696
|
-
/** Handle returned by {@link harnessTrace}. Call `dispose()` to stop tracing. */
|
|
1697
|
-
interface HarnessTraceHandle {
|
|
1698
|
-
/** Stop tracing and detach all observers. Safe to call multiple times. */
|
|
1699
|
-
dispose(): void;
|
|
1700
|
-
/**
|
|
1701
|
-
* Structured trace events collected since creation. Plain array — no
|
|
1702
|
-
* subscription needed (COMPOSITION-GUIDE §1: avoid lazy-activation
|
|
1703
|
-
* friction for inspection tools). Populated reactively via observe().
|
|
1704
|
-
*/
|
|
1705
|
-
readonly events: readonly TraceEvent[];
|
|
1706
|
-
}
|
|
1707
|
-
/** Options for {@link harnessTrace}. */
|
|
1708
|
-
interface HarnessTraceOptions {
|
|
1709
|
-
/** Sink for rendered trace lines. Default: `console.log`. Pass `null` for structured-only. */
|
|
1710
|
-
logger?: ((line: string) => void) | null;
|
|
1711
|
-
/** Detail level for both string and structured output. Default: `"summary"`. */
|
|
1712
|
-
detail?: TraceDetail;
|
|
1713
|
-
}
|
|
1714
|
-
/**
|
|
1715
|
-
* Attach a stage-log trace over the harness pipeline. Delegates to
|
|
1716
|
-
* `harness.observe({ format: "stage-log", ... })` for each stage path —
|
|
1717
|
-
* every event is captured in `handle.events` (structured) AND rendered via
|
|
1718
|
-
* the `logger` (string output).
|
|
1719
|
-
*
|
|
1720
|
-
* **Detail levels:**
|
|
1721
|
-
* - `"summary"` — stage + elapsed only. Minimal overhead.
|
|
1722
|
-
* - `"standard"` (default) — stage + elapsed + truncated data preview.
|
|
1723
|
-
* - `"full"` — stage + elapsed + full raw data object in events.
|
|
1724
|
-
*
|
|
1725
|
-
* Elapsed timestamps are relative to the `harnessTrace()` invocation time,
|
|
1726
|
-
* not the first event.
|
|
1727
|
-
*/
|
|
1728
|
-
declare function harnessTrace(harness: HarnessGraph, opts?: HarnessTraceOptions): HarnessTraceHandle;
|
|
1729
|
-
|
|
1730
|
-
/**
|
|
1731
|
-
* Harness wiring (roadmap §9.0).
|
|
1732
|
-
*
|
|
1733
|
-
* Reactive collaboration loop: static-topology, flowing data.
|
|
1734
|
-
* Composes orchestration (gate), AI (promptNode), reduction (scorer/stratify),
|
|
1735
|
-
* and messaging (TopicGraph/bridge) into a 7-stage loop.
|
|
1736
|
-
*
|
|
1737
|
-
* @module
|
|
1738
|
-
*/
|
|
1739
|
-
|
|
1740
|
-
type index_ActuatorApplyFn<R> = ActuatorApplyFn<R>;
|
|
1741
|
-
type index_ActuatorExecutorConfig<R> = ActuatorExecutorConfig<R>;
|
|
1742
|
-
type index_ActuatorResult<R> = ActuatorResult<R>;
|
|
1743
|
-
type index_AnalyzeEvent<T> = AnalyzeEvent<T>;
|
|
1744
|
-
type index_AutoSolidifyConfig<R, T = R> = AutoSolidifyConfig<R, T>;
|
|
1745
|
-
type index_BlindVariationContext<T> = BlindVariationContext<T>;
|
|
1746
|
-
type index_BlindVariationOptions<T> = BlindVariationOptions<T>;
|
|
1747
|
-
type index_CodeChange = CodeChange;
|
|
1748
|
-
type index_CodeChangeBridgeOptions = CodeChangeBridgeOptions;
|
|
1749
|
-
type index_ConvergenceOptions = ConvergenceOptions;
|
|
1750
|
-
declare const index_DEFAULT_DECAY_RATE: typeof DEFAULT_DECAY_RATE;
|
|
1751
|
-
declare const index_DEFAULT_EXECUTE_PROMPT: typeof DEFAULT_EXECUTE_PROMPT;
|
|
1752
|
-
declare const index_DEFAULT_QUEUE_CONFIGS: typeof DEFAULT_QUEUE_CONFIGS;
|
|
1753
|
-
declare const index_DEFAULT_SEVERITY_WEIGHTS: typeof DEFAULT_SEVERITY_WEIGHTS;
|
|
1754
|
-
declare const index_DEFAULT_TRIAGE_PROMPT: typeof DEFAULT_TRIAGE_PROMPT;
|
|
1755
|
-
declare const index_DEFAULT_VERIFY_PROMPT: typeof DEFAULT_VERIFY_PROMPT;
|
|
1756
|
-
type index_DatasetItem = DatasetItem;
|
|
1757
|
-
type index_DecideEvent = DecideEvent;
|
|
1758
|
-
type index_DispatchActuatorConfig<R> = DispatchActuatorConfig<R>;
|
|
1759
|
-
type index_EffectivenessEntry = EffectivenessEntry;
|
|
1760
|
-
type index_EffectivenessSnapshot = EffectivenessSnapshot;
|
|
1761
|
-
type index_EffectivenessTrackerBundle = EffectivenessTrackerBundle;
|
|
1762
|
-
type index_EffectivenessTrackerOptions = EffectivenessTrackerOptions;
|
|
1763
|
-
type index_ErrorClass = ErrorClass;
|
|
1764
|
-
type index_ErrorClassifier = ErrorClassifier;
|
|
1765
|
-
type index_ErrorCritiqueContext<T> = ErrorCritiqueContext<T>;
|
|
1766
|
-
type index_ErrorCritiqueOptions<T> = ErrorCritiqueOptions<T>;
|
|
1767
|
-
type index_EvalDelta = EvalDelta;
|
|
1768
|
-
type index_EvalIntakeBridgeOptions = EvalIntakeBridgeOptions;
|
|
1769
|
-
type index_EvalJudgeScore = EvalJudgeScore;
|
|
1770
|
-
type index_EvalResult = EvalResult;
|
|
1771
|
-
type index_EvalRunResult = EvalRunResult;
|
|
1772
|
-
type index_EvalTaskDelta = EvalTaskDelta;
|
|
1773
|
-
type index_EvalTaskResult = EvalTaskResult;
|
|
1774
|
-
type index_EvalVerifierConfig<T> = EvalVerifierConfig<T>;
|
|
1775
|
-
type index_EvalVerifierSummary = EvalVerifierSummary;
|
|
1776
|
-
type index_EvaluateEvent<T> = EvaluateEvent<T>;
|
|
1777
|
-
type index_Evaluator<T> = Evaluator<T>;
|
|
1778
|
-
type index_ExecuteOutput<A = unknown> = ExecuteOutput<A>;
|
|
1779
|
-
type index_ExecutePromptFn = ExecutePromptFn;
|
|
1780
|
-
type index_ExecutionResult<A = unknown> = ExecutionResult<A>;
|
|
1781
|
-
type index_Feedback = Feedback;
|
|
1782
|
-
type index_GenerateEvent<T> = GenerateEvent<T>;
|
|
1783
|
-
type index_HarnessEvalPairConfig<T> = HarnessEvalPairConfig<T>;
|
|
1784
|
-
type index_HarnessExecutor<A = unknown> = HarnessExecutor<A>;
|
|
1785
|
-
type index_HarnessGraph<A = unknown> = HarnessGraph<A>;
|
|
1786
|
-
declare const index_HarnessGraph: typeof HarnessGraph;
|
|
1787
|
-
type index_HarnessJobPayload<A = unknown> = HarnessJobPayload<A>;
|
|
1788
|
-
type index_HarnessLoopOptions<A = unknown> = HarnessLoopOptions<A>;
|
|
1789
|
-
type index_HarnessProfileResult = HarnessProfileResult;
|
|
1790
|
-
type index_HarnessTraceHandle = HarnessTraceHandle;
|
|
1791
|
-
type index_HarnessTraceOptions = HarnessTraceOptions;
|
|
1792
|
-
type index_HarnessVerifier<A = unknown> = HarnessVerifier<A>;
|
|
1793
|
-
type index_IntakeBridgeOptions = IntakeBridgeOptions;
|
|
1794
|
-
type index_IntakeItem = IntakeItem;
|
|
1795
|
-
type index_IntakeSource = IntakeSource;
|
|
1796
|
-
type index_Intervention = Intervention;
|
|
1797
|
-
type index_Iteration<T> = Iteration<T>;
|
|
1798
|
-
type index_KnownIntakeSource = KnownIntakeSource;
|
|
1799
|
-
type index_LintError = LintError;
|
|
1800
|
-
type index_NotifyEffectOptions = NotifyEffectOptions;
|
|
1801
|
-
type index_NotifyTransport<T> = NotifyTransport<T>;
|
|
1802
|
-
type index_PrioritySignals = PrioritySignals;
|
|
1803
|
-
declare const index_QUEUE_NAMES: typeof QUEUE_NAMES;
|
|
1804
|
-
type index_QueueConfig = QueueConfig;
|
|
1805
|
-
type index_QueueRoute = QueueRoute;
|
|
1806
|
-
type index_RefineExecutorConfig<T> = RefineExecutorConfig<T>;
|
|
1807
|
-
type index_RefineExecutorResult<T> = RefineExecutorResult<T>;
|
|
1808
|
-
type index_RefineLoopGraph<T> = RefineLoopGraph<T>;
|
|
1809
|
-
type index_RefineLoopOptions = RefineLoopOptions;
|
|
1810
|
-
type index_RefineStatus = RefineStatus;
|
|
1811
|
-
type index_RefineStrategy<T> = RefineStrategy<T>;
|
|
1812
|
-
type index_RootCause = RootCause;
|
|
1813
|
-
type index_Severity = Severity;
|
|
1814
|
-
type index_StrategyEntry = StrategyEntry;
|
|
1815
|
-
type index_StrategyKey = StrategyKey;
|
|
1816
|
-
type index_StrategyModelBundle = StrategyModelBundle;
|
|
1817
|
-
type index_StrategySnapshot = StrategySnapshot;
|
|
1818
|
-
type index_TestFailure = TestFailure;
|
|
1819
|
-
type index_TraceDetail = TraceDetail;
|
|
1820
|
-
type index_TraceEvent = TraceEvent;
|
|
1821
|
-
type index_TraceEventType = TraceEventType;
|
|
1822
|
-
type index_TriagePromptFn = TriagePromptFn;
|
|
1823
|
-
type index_TriagedItem = TriagedItem;
|
|
1824
|
-
type index_VerifyOutput = VerifyOutput;
|
|
1825
|
-
type index_VerifyPromptFn<A = unknown> = VerifyPromptFn<A>;
|
|
1826
|
-
type index_VerifyResult<A = unknown> = VerifyResult<A>;
|
|
1827
|
-
declare const index_actuatorExecutor: typeof actuatorExecutor;
|
|
1828
|
-
declare const index_affectedTaskFilter: typeof affectedTaskFilter;
|
|
1829
|
-
declare const index_autoSolidify: typeof autoSolidify;
|
|
1830
|
-
declare const index_beforeAfterCompare: typeof beforeAfterCompare;
|
|
1831
|
-
declare const index_blindVariation: typeof blindVariation;
|
|
1832
|
-
declare const index_codeChangeBridge: typeof codeChangeBridge;
|
|
1833
|
-
declare const index_createIntakeBridge: typeof createIntakeBridge;
|
|
1834
|
-
declare const index_defaultErrorClassifier: typeof defaultErrorClassifier;
|
|
1835
|
-
declare const index_defaultLlmExecutor: typeof defaultLlmExecutor;
|
|
1836
|
-
declare const index_defaultLlmVerifier: typeof defaultLlmVerifier;
|
|
1837
|
-
declare const index_dispatchActuator: typeof dispatchActuator;
|
|
1838
|
-
declare const index_effectivenessTracker: typeof effectivenessTracker;
|
|
1839
|
-
declare const index_errorCritique: typeof errorCritique;
|
|
1840
|
-
declare const index_evalIntakeBridge: typeof evalIntakeBridge;
|
|
1841
|
-
declare const index_evalSource: typeof evalSource;
|
|
1842
|
-
declare const index_evalVerifier: typeof evalVerifier;
|
|
1843
|
-
declare const index_harnessEvalPair: typeof harnessEvalPair;
|
|
1844
|
-
declare const index_harnessLoop: typeof harnessLoop;
|
|
1845
|
-
declare const index_harnessProfile: typeof harnessProfile;
|
|
1846
|
-
declare const index_harnessTrace: typeof harnessTrace;
|
|
1847
|
-
declare const index_notifyEffect: typeof notifyEffect;
|
|
1848
|
-
declare const index_priorityScore: typeof priorityScore;
|
|
1849
|
-
declare const index_refineExecutor: typeof refineExecutor;
|
|
1850
|
-
declare const index_refineLoop: typeof refineLoop;
|
|
1851
|
-
declare const index_resolvePromptFn: typeof resolvePromptFn;
|
|
1852
|
-
declare const index_strategyKey: typeof strategyKey;
|
|
1853
|
-
declare const index_strategyModel: typeof strategyModel;
|
|
1854
|
-
declare namespace index {
|
|
1855
|
-
export { type index_ActuatorApplyFn as ActuatorApplyFn, type index_ActuatorExecutorConfig as ActuatorExecutorConfig, type index_ActuatorResult as ActuatorResult, type index_AnalyzeEvent as AnalyzeEvent, type index_AutoSolidifyConfig as AutoSolidifyConfig, type index_BlindVariationContext as BlindVariationContext, type index_BlindVariationOptions as BlindVariationOptions, type index_CodeChange as CodeChange, type index_CodeChangeBridgeOptions as CodeChangeBridgeOptions, type index_ConvergenceOptions as ConvergenceOptions, index_DEFAULT_DECAY_RATE as DEFAULT_DECAY_RATE, index_DEFAULT_EXECUTE_PROMPT as DEFAULT_EXECUTE_PROMPT, index_DEFAULT_QUEUE_CONFIGS as DEFAULT_QUEUE_CONFIGS, index_DEFAULT_SEVERITY_WEIGHTS as DEFAULT_SEVERITY_WEIGHTS, index_DEFAULT_TRIAGE_PROMPT as DEFAULT_TRIAGE_PROMPT, index_DEFAULT_VERIFY_PROMPT as DEFAULT_VERIFY_PROMPT, type index_DatasetItem as DatasetItem, type index_DecideEvent as DecideEvent, type index_DispatchActuatorConfig as DispatchActuatorConfig, type index_EffectivenessEntry as EffectivenessEntry, type index_EffectivenessSnapshot as EffectivenessSnapshot, type index_EffectivenessTrackerBundle as EffectivenessTrackerBundle, type index_EffectivenessTrackerOptions as EffectivenessTrackerOptions, type index_ErrorClass as ErrorClass, type index_ErrorClassifier as ErrorClassifier, type index_ErrorCritiqueContext as ErrorCritiqueContext, type index_ErrorCritiqueOptions as ErrorCritiqueOptions, type index_EvalDelta as EvalDelta, type index_EvalIntakeBridgeOptions as EvalIntakeBridgeOptions, type index_EvalJudgeScore as EvalJudgeScore, type index_EvalResult as EvalResult, type index_EvalRunResult as EvalRunResult, type index_EvalTaskDelta as EvalTaskDelta, type index_EvalTaskResult as EvalTaskResult, type index_EvalVerifierConfig as EvalVerifierConfig, type index_EvalVerifierSummary as EvalVerifierSummary, type index_EvaluateEvent as EvaluateEvent, type index_Evaluator as Evaluator, type index_ExecuteOutput as ExecuteOutput, type index_ExecutePromptFn as ExecutePromptFn, type index_ExecutionResult as ExecutionResult, type index_Feedback as Feedback, type index_GenerateEvent as GenerateEvent, type index_HarnessEvalPairConfig as HarnessEvalPairConfig, type index_HarnessExecutor as HarnessExecutor, index_HarnessGraph as HarnessGraph, type index_HarnessJobPayload as HarnessJobPayload, type index_HarnessLoopOptions as HarnessLoopOptions, type index_HarnessProfileResult as HarnessProfileResult, type index_HarnessTraceHandle as HarnessTraceHandle, type index_HarnessTraceOptions as HarnessTraceOptions, type index_HarnessVerifier as HarnessVerifier, type index_IntakeBridgeOptions as IntakeBridgeOptions, type index_IntakeItem as IntakeItem, type index_IntakeSource as IntakeSource, type index_Intervention as Intervention, type index_Iteration as Iteration, type index_KnownIntakeSource as KnownIntakeSource, type index_LintError as LintError, type index_NotifyEffectOptions as NotifyEffectOptions, type index_NotifyTransport as NotifyTransport, type index_PrioritySignals as PrioritySignals, index_QUEUE_NAMES as QUEUE_NAMES, type index_QueueConfig as QueueConfig, type index_QueueRoute as QueueRoute, type index_RefineExecutorConfig as RefineExecutorConfig, type index_RefineExecutorResult as RefineExecutorResult, type index_RefineLoopGraph as RefineLoopGraph, type index_RefineLoopOptions as RefineLoopOptions, type index_RefineStatus as RefineStatus, type index_RefineStrategy as RefineStrategy, type index_RootCause as RootCause, type index_Severity as Severity, type index_StrategyEntry as StrategyEntry, type index_StrategyKey as StrategyKey, type index_StrategyModelBundle as StrategyModelBundle, type index_StrategySnapshot as StrategySnapshot, type index_TestFailure as TestFailure, type index_TraceDetail as TraceDetail, type index_TraceEvent as TraceEvent, type index_TraceEventType as TraceEventType, type index_TriagePromptFn as TriagePromptFn, type index_TriagedItem as TriagedItem, type index_VerifyOutput as VerifyOutput, type index_VerifyPromptFn as VerifyPromptFn, type index_VerifyResult as VerifyResult, index_actuatorExecutor as actuatorExecutor, index_affectedTaskFilter as affectedTaskFilter, index_autoSolidify as autoSolidify, index_beforeAfterCompare as beforeAfterCompare, index_blindVariation as blindVariation, index_codeChangeBridge as codeChangeBridge, index_createIntakeBridge as createIntakeBridge, index_defaultErrorClassifier as defaultErrorClassifier, index_defaultLlmExecutor as defaultLlmExecutor, index_defaultLlmVerifier as defaultLlmVerifier, index_dispatchActuator as dispatchActuator, index_effectivenessTracker as effectivenessTracker, index_errorCritique as errorCritique, index_evalIntakeBridge as evalIntakeBridge, index_evalSource as evalSource, index_evalVerifier as evalVerifier, index_harnessEvalPair as harnessEvalPair, index_harnessLoop as harnessLoop, index_harnessProfile as harnessProfile, index_harnessTrace as harnessTrace, index_notifyEffect as notifyEffect, index_priorityScore as priorityScore, index_refineExecutor as refineExecutor, index_refineLoop as refineLoop, index_resolvePromptFn as resolvePromptFn, index_strategyKey as strategyKey, index_strategyModel as strategyModel };
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
export { type IntakeBridgeOptions as $, type ActuatorApplyFn as A, type BlindVariationContext as B, type CodeChange as C, DEFAULT_DECAY_RATE as D, type EffectivenessEntry as E, type EvalResult as F, type EvalRunResult as G, type EvalTaskDelta as H, type EvalTaskResult as I, type EvalVerifierConfig as J, type EvalVerifierSummary as K, type EvaluateEvent as L, type Evaluator as M, type ExecuteOutput as N, type ExecutePromptFn as O, type ExecutionResult as P, type Feedback as Q, type GenerateEvent as R, type HarnessEvalPairConfig as S, type HarnessExecutor as T, HarnessGraph as U, type HarnessJobPayload as V, type HarnessLoopOptions as W, type HarnessProfileResult as X, type HarnessTraceHandle as Y, type HarnessTraceOptions as Z, type HarnessVerifier as _, type ActuatorExecutorConfig as a, type IntakeItem as a0, type IntakeSource as a1, type Intervention as a2, type Iteration as a3, type KnownIntakeSource as a4, type LintError as a5, type NotifyEffectOptions as a6, type NotifyTransport as a7, type PrioritySignals as a8, QUEUE_NAMES as a9, beforeAfterCompare as aA, blindVariation as aB, codeChangeBridge as aC, createIntakeBridge as aD, defaultErrorClassifier as aE, defaultLlmExecutor as aF, defaultLlmVerifier as aG, dispatchActuator as aH, effectivenessTracker as aI, errorCritique as aJ, evalIntakeBridge as aK, evalSource as aL, evalVerifier as aM, harnessEvalPair as aN, harnessLoop as aO, harnessProfile as aP, harnessTrace as aQ, notifyEffect as aR, priorityScore as aS, refineExecutor as aT, refineLoop as aU, resolvePromptFn as aV, strategyKey as aW, strategyModel as aX, type QueueConfig as aa, type QueueRoute as ab, type RefineExecutorConfig as ac, type RefineExecutorResult as ad, type RefineLoopGraph as ae, type RefineLoopOptions as af, type RefineStatus as ag, type RefineStrategy as ah, type RootCause as ai, type Severity as aj, type StrategyEntry as ak, type StrategyKey as al, type StrategyModelBundle as am, type StrategySnapshot as an, type TestFailure as ao, type TraceDetail as ap, type TraceEvent as aq, type TraceEventType as ar, type TriagePromptFn as as, type TriagedItem as at, type VerifyOutput as au, type VerifyPromptFn as av, type VerifyResult as aw, actuatorExecutor as ax, affectedTaskFilter as ay, autoSolidify as az, type ActuatorResult as b, type AnalyzeEvent as c, type AutoSolidifyConfig as d, type BlindVariationOptions as e, type CodeChangeBridgeOptions as f, type ConvergenceOptions as g, DEFAULT_EXECUTE_PROMPT as h, index as i, DEFAULT_QUEUE_CONFIGS as j, DEFAULT_SEVERITY_WEIGHTS as k, DEFAULT_TRIAGE_PROMPT as l, DEFAULT_VERIFY_PROMPT as m, type DatasetItem as n, type DecideEvent as o, type DispatchActuatorConfig as p, type EffectivenessSnapshot as q, type EffectivenessTrackerBundle as r, type EffectivenessTrackerOptions as s, type ErrorClass as t, type ErrorClassifier as u, type ErrorCritiqueContext as v, type ErrorCritiqueOptions as w, type EvalDelta as x, type EvalIntakeBridgeOptions as y, type EvalJudgeScore as z };
|