deepline 0.3.535 → 0.3.536
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client-core.ts +232 -147
- package/dist/bundling-sources/sdk/src/index.ts +4 -0
- package/dist/bundling-sources/sdk/src/plays/local-file-discovery.ts +27 -1
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +16 -5
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +2 -23
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +26 -14
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-input-contract.ts +33 -8
- package/dist/bundling-sources/shared_libs/monitors/fleets/count-drift-alert.ts +121 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +14 -82
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +4 -4
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +0 -26
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +21 -31
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +88 -96
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +12 -10
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +71 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +127 -9
- package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +15 -2
- package/dist/bundling-sources/shared_libs/play-runtime/prebuilt-result-quality.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/fixture-capacity-simulator.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/gradient2-concurrency-controller.ts +41 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-capacity-policy.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-concurrency-policy.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +5 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +8 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +11 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +73 -18
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +169 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +26 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +84 -49
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -32
- package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +13 -1
- package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +68 -1
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +57 -1
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +22 -9
- package/dist/cli/auth-6XQKFOLG.js +43 -0
- package/dist/cli/{auth-ZCTMB5RA.mjs → auth-KCTCUO7P.mjs} +7 -7
- package/dist/cli/{billing-GVFKZQH3.js → billing-4VBGZ3CT.js} +273 -112
- package/dist/cli/{billing-OU2ZHL72.mjs → billing-OOJHKLNS.mjs} +185 -24
- package/dist/cli/{chunk-FGN75ZN6.js → chunk-2B4IOGFD.js} +390 -382
- package/dist/cli/{chunk-KOZBZPRM.js → chunk-2FCSUOYN.js} +55 -55
- package/dist/cli/{chunk-T2N3B7IQ.js → chunk-2GJZLIKW.js} +8 -8
- package/dist/cli/{chunk-AUEUAPVS.mjs → chunk-2YWJS76L.mjs} +1 -1
- package/dist/cli/{chunk-W5YJYU4G.mjs → chunk-3PCYV6ZJ.mjs} +2 -2
- package/dist/cli/{chunk-UUQ2OXMH.js → chunk-4E5JXZ3W.js} +18 -20
- package/dist/cli/{chunk-R4RG4FV5.mjs → chunk-4KWD3MX2.mjs} +13 -10
- package/dist/cli/{chunk-XSOTEVOB.js → chunk-6BBGUQJJ.js} +50 -141
- package/dist/cli/{chunk-PHLNYBAA.js → chunk-6VUGBQZQ.js} +5 -5
- package/dist/cli/{chunk-G2DLG32W.mjs → chunk-AB2GBOD4.mjs} +40 -27
- package/dist/cli/{chunk-JWWYLGUT.mjs → chunk-ANUKBZ6W.mjs} +475 -11
- package/dist/cli/{chunk-FZKPPB5P.mjs → chunk-BASLYGXK.mjs} +85 -77
- package/dist/cli/{chunk-SQWET4SL.js → chunk-BBTKAASQ.js} +2 -1
- package/dist/cli/{chunk-NRO3NTVO.js → chunk-CBV7AKWM.js} +5 -5
- package/dist/cli/{chunk-PI5R65OQ.js → chunk-CIDN5K23.js} +1 -1
- package/dist/cli/{chunk-QNHHZ63P.mjs → chunk-CQBIO6HW.mjs} +1 -1
- package/dist/cli/{chunk-2KHUFWTK.js → chunk-CQDQNZGH.js} +42 -37
- package/dist/cli/{chunk-D4MHCCIR.js → chunk-CWSLUNA6.js} +33 -33
- package/dist/cli/{chunk-E3CLOVG5.mjs → chunk-CXTW7SRW.mjs} +50 -141
- package/dist/cli/{chunk-H6SWS5CG.mjs → chunk-DA2I2M7D.mjs} +2 -2
- package/dist/cli/{chunk-WAIBM6KX.mjs → chunk-DQHUJMCL.mjs} +5 -5
- package/dist/cli/{chunk-DWPY6ZID.mjs → chunk-DUYAMLOC.mjs} +1 -1
- package/dist/cli/{chunk-K53NKWZO.mjs → chunk-E24UGPGG.mjs} +13 -15
- package/dist/cli/{chunk-STR5LXK4.mjs → chunk-FSIVF2SI.mjs} +1 -1
- package/dist/cli/{chunk-7R5DAANG.mjs → chunk-GF32SBST.mjs} +1 -1
- package/dist/cli/{chunk-7CWSAEYS.mjs → chunk-GHLDCLSC.mjs} +1 -1
- package/dist/cli/{chunk-ZUVE63Y7.js → chunk-GTVZKY3F.js} +2 -2
- package/dist/cli/{chunk-J75DANZY.mjs → chunk-HAJQGP5V.mjs} +2 -2
- package/dist/cli/{chunk-RFQWSH6I.js → chunk-HWDKRN7L.js} +3 -3
- package/dist/cli/{chunk-5YAJGRWB.js → chunk-IPVRMYWT.js} +7 -7
- package/dist/cli/{chunk-ZPGGW27Q.mjs → chunk-JL2OTMSG.mjs} +1 -0
- package/dist/cli/{chunk-K76AEBFY.mjs → chunk-JUHDJNSI.mjs} +4 -4
- package/dist/cli/{chunk-R2KKEHJN.mjs → chunk-KPQHUVYW.mjs} +5 -5
- package/dist/cli/{chunk-6LHX33VN.js → chunk-KWYGWO4Y.js} +9 -6
- package/dist/cli/{chunk-7PXP2FQK.js → chunk-LDGZFDUB.js} +2 -2
- package/dist/cli/{chunk-KWGXHPHL.js → chunk-LN6RXDTB.js} +523 -59
- package/dist/cli/{chunk-TCVCFZP6.mjs → chunk-LZXZQPA2.mjs} +4 -1
- package/dist/cli/{chunk-2D6SWQTK.js → chunk-MSP4DTSD.js} +13 -13
- package/dist/cli/{chunk-BNH4Y35W.mjs → chunk-OLH2PHMC.mjs} +2 -2
- package/dist/cli/{chunk-QYBAHYP4.mjs → chunk-OUDTOMZC.mjs} +7 -9
- package/dist/cli/{chunk-GESIFFQX.mjs → chunk-OVX3Q5Q3.mjs} +1 -1
- package/dist/cli/{chunk-6TYRRNXY.mjs → chunk-PNY3BWHP.mjs} +2 -2
- package/dist/cli/{chunk-DYIWDUY4.js → chunk-Q4MNUOS4.js} +316 -303
- package/dist/cli/{chunk-5EKNDNFQ.js → chunk-Q5CXV3E3.js} +2 -2
- package/dist/cli/{chunk-W6T23EUC.mjs → chunk-RVSSQPQO.mjs} +1 -1
- package/dist/cli/{chunk-WNNA4L6Z.js → chunk-SLPJ3LXI.js} +22 -22
- package/dist/cli/{chunk-K3IPGMGP.js → chunk-TX5TUHJN.js} +17 -19
- package/dist/cli/{chunk-IF75RD6U.js → chunk-U2LVWCTD.js} +18 -6
- package/dist/cli/{chunk-ZS2WHWWL.js → chunk-UNDLNT3V.js} +1 -1
- package/dist/cli/{chunk-4NLRWKZB.js → chunk-VBDZIMWD.js} +26 -26
- package/dist/cli/{chunk-DAPKLYST.js → chunk-W7AEIGZR.js} +41 -41
- package/dist/cli/{chunk-LVISZFYO.mjs → chunk-WC5M3JXE.mjs} +2 -2
- package/dist/cli/{chunk-C374C22Y.js → chunk-WOQO3GV4.js} +14 -11
- package/dist/cli/{chunk-243O3FH5.js → chunk-XBAH3TKU.js} +5 -5
- package/dist/cli/{chunk-DFJODFMC.mjs → chunk-XJD2GYUP.mjs} +5 -5
- package/dist/cli/{chunk-BF65LB7X.mjs → chunk-XVZRJJDS.mjs} +4 -4
- package/dist/cli/{chunk-OM732MGV.js → chunk-Y2NTPYGS.js} +17 -17
- package/dist/cli/{chunk-YFZLZNTH.mjs → chunk-YBMHOH6H.mjs} +4 -4
- package/dist/cli/{chunk-RKY4LBX3.mjs → chunk-YRLAUGQY.mjs} +3 -3
- package/dist/cli/{chunk-FKD3KL5Q.mjs → chunk-Z2XA6YU4.mjs} +10 -5
- package/dist/cli/{chunk-JQQG4QL4.mjs → chunk-Z7UIOGW4.mjs} +3 -3
- package/dist/cli/{chunk-HYBZWSSH.js → chunk-ZEV2Y56V.js} +44 -44
- package/dist/cli/{chunk-MI6ZP7XI.mjs → chunk-ZG7BOECV.mjs} +18 -6
- package/dist/cli/{chunk-HWPOXCCK.js → chunk-ZILSRDIN.js} +8 -8
- package/dist/cli/{chunk-CIDATNTY.js → chunk-ZISEH7OL.js} +16 -16
- package/dist/cli/{chunk-KA6ZERJL.js → chunk-ZZ4MF2GI.js} +6 -6
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-CD55KEIO.js → csv-2V2DIFNG.js} +15 -15
- package/dist/cli/{csv-CLPVMIRF.mjs → csv-P3HLK4GO.mjs} +6 -6
- package/dist/cli/{db-MQKLDAEO.js → db-MREAQVW6.js} +36 -36
- package/dist/cli/{db-AU4SMWUN.mjs → db-ZYOY3QRQ.mjs} +9 -9
- package/dist/cli/describe-IKZFOADR.mjs +49 -0
- package/dist/cli/describe-WW3OQRLP.js +49 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +5 -5
- package/dist/cli/describe-core.mjs +4 -4
- package/dist/cli/{executions-77GOLWRM.js → executions-H5IJ7QSQ.js} +11 -11
- package/dist/cli/{executions-TFIJPUX7.mjs → executions-KTSY5M34.mjs} +9 -9
- package/dist/cli/{feedback-OV5YAL3A.js → feedback-724QK3Z5.js} +16 -16
- package/dist/cli/{feedback-2WRSZ5WL.mjs → feedback-WWJRIXEU.mjs} +8 -8
- package/dist/cli/git-PHYRD56H.js +25 -0
- package/dist/cli/{git-VNS4ATLZ.mjs → git-R5VRG7X6.mjs} +7 -7
- package/dist/cli/index.js +151 -157
- package/dist/cli/index.mjs +51 -57
- package/dist/cli/{legacy-noops-HDOB5C6F.js → legacy-noops-C6GDEGPU.js} +11 -11
- package/dist/cli/{legacy-noops-C732QDCY.mjs → legacy-noops-PWZ5XLAO.mjs} +8 -8
- package/dist/cli/{monitors-5IUMHH3E.js → monitors-VAVQ4WCE.js} +125 -122
- package/dist/cli/{monitors-2LYEFXOU.mjs → monitors-WQSKMHAP.mjs} +19 -16
- package/dist/cli/{org-ADW2EVAC.js → org-CWWRWXZQ.js} +89 -89
- package/dist/cli/{org-G4YGZPHS.mjs → org-MAL4QPVF.mjs} +9 -9
- package/dist/cli/{play-7GQ56C2D.mjs → play-ILW6MSNG.mjs} +123 -76
- package/dist/cli/{play-EHSOSSHT.js → play-WJOWK5PQ.js} +641 -594
- package/dist/cli/{providers-WL3YTCSV.mjs → providers-4V2NMLZZ.mjs} +9 -9
- package/dist/cli/{providers-PWCF6OOO.js → providers-W662ANCH.js} +12 -12
- package/dist/cli/{quickstart-ZKI5MURA.js → quickstart-BW6EBUYX.js} +8 -8
- package/dist/cli/{quickstart-323XOPGI.mjs → quickstart-C22BR743.mjs} +6 -6
- package/dist/cli/{run-XZPWA6JS.js → run-KW7KW4FX.js} +50 -53
- package/dist/cli/{run-ZCNZU3K2.mjs → run-SPAU5IMW.mjs} +31 -34
- package/dist/cli/search-HLE54W5G.js +32 -0
- package/dist/cli/{search-CVLVSFMJ.mjs → search-XPC75HLM.mjs} +10 -11
- package/dist/cli/{search-output-6PY6RN2R.mjs → search-output-JKYJSEPM.mjs} +6 -6
- package/dist/cli/{search-output-7HRSSRBS.js → search-output-VJYE7USJ.js} +8 -8
- package/dist/cli/{secrets-6S2ZWDIM.mjs → secrets-OJG73GXQ.mjs} +9 -9
- package/dist/cli/{secrets-IYD5VKY4.js → secrets-YB57KGSB.js} +18 -18
- package/dist/cli/{sessions-GVEX5TUJ.mjs → sessions-7ZL37BW4.mjs} +8 -8
- package/dist/cli/sessions-VEBYZIEU.js +22 -0
- package/dist/cli/{settings-CANK4HJQ.js → settings-A7DD2ZYE.js} +88 -89
- package/dist/cli/{settings-BN5MJZ3C.mjs → settings-RKSQB7FA.mjs} +15 -16
- package/dist/cli/{setup-JNMSCCU4.mjs → setup-NXDUTITY.mjs} +11 -12
- package/dist/cli/{setup-YSGKGLSJ.js → setup-S3K5YU62.js} +51 -52
- package/dist/cli/skills-NVQ744CN.js +36 -0
- package/dist/cli/{skills-QCQN2UM2.mjs → skills-VMFAIDO6.mjs} +9 -10
- package/dist/cli/{tools-CDPOID7V.mjs → tools-52NTHBSJ.mjs} +20 -21
- package/dist/cli/tools-SBDUL3WB.js +56 -0
- package/dist/cli/update-HHVFZPCV.js +34 -0
- package/dist/cli/{update-D3ZERUQ3.mjs → update-SAKBEKMV.mjs} +11 -12
- package/dist/cli/{views-RDZRWQBQ.mjs → views-ACRV7MD6.mjs} +54 -10
- package/dist/cli/{views-4NV2KQKA.js → views-C3GJOBDG.js} +66 -22
- package/dist/cli/{workflow-2CG3TVCG.mjs → workflow-CS22E7TC.mjs} +10 -10
- package/dist/cli/{workflow-RABJCAZC.js → workflow-ZNWCZEGN.js} +20 -20
- package/dist/{client-DhSvMO3A.d.mts → client-BlLYQDNo.d.mts} +1 -1
- package/dist/{client-oGNJMQFd.d.ts → client-DSQlkIDO.d.ts} +1 -1
- package/dist/{client-core-CdWH6Sii.d.ts → client-core-CDwapXy5.d.ts} +159 -108
- package/dist/{client-core-CVG1Et-4.d.mts → client-core-rX7n2H8U.d.mts} +159 -108
- package/dist/{compiler-manifest-D2ZlBGxj.d.ts → compiler-manifest-BHNC4RL-.d.mts} +15 -22
- package/dist/{compiler-manifest-D2ZlBGxj.d.mts → compiler-manifest-BHNC4RL-.d.ts} +15 -22
- package/dist/{errors-B-gOQdj-.d.mts → errors-D7sPXrvB.d.mts} +1 -1
- package/dist/{errors-CB0KAmmV.d.ts → errors-lhtIWG5Z.d.ts} +1 -1
- package/dist/{index-c3nvUGCS.d.ts → index-CQTBHXHr.d.ts} +1 -1
- package/dist/{index-BbJADro4.d.mts → index-NaDZq2xf.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -15
- package/dist/index.mjs +11 -11
- package/dist/install-integrity.json +129 -132
- package/dist/monitor-fleet-contract.d.mts +17 -11
- package/dist/monitor-fleet-contract.d.ts +17 -11
- package/dist/monitor-fleet-contract.js +3 -3
- package/dist/monitor-fleet-contract.mjs +2 -2
- package/dist/monitor-input-contract.js +2 -2
- package/dist/monitor-input-contract.mjs +1 -1
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +17 -5
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +3 -3
- package/dist/plays/run-request.mjs +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +12 -12
- package/dist/server.mjs +6 -6
- package/package.json +1 -1
- package/dist/cli/auth-VDCU3T6A.js +0 -43
- package/dist/cli/chunk-4QELPWUW.mjs +0 -405
- package/dist/cli/chunk-T7RBM2WX.js +0 -405
- package/dist/cli/describe-5BFNHT5V.js +0 -50
- package/dist/cli/describe-AWJUXE2U.mjs +0 -50
- package/dist/cli/git-HGMX52XU.js +0 -25
- package/dist/cli/pages-KXKWSCEV.mjs +0 -266
- package/dist/cli/pages-VTJGAI2D.js +0 -266
- package/dist/cli/search-J6EY7DQN.js +0 -33
- package/dist/cli/sessions-7HPIVSQ4.js +0 -22
- package/dist/cli/skills-WDGSSKJZ.js +0 -37
- package/dist/cli/tools-URNVXSTZ.js +0 -57
- package/dist/cli/update-Q6JW32IA.js +0 -35
|
@@ -8,9 +8,21 @@ import {
|
|
|
8
8
|
* Monitor transaction admission reuses this ceiling; it must never drift
|
|
9
9
|
* from the limit admitted when a customer authors a Fleet.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
// 20,000 is the first step up from 1,000. The whole Fleet lifecycle is proven
|
|
12
|
+
// on the fake TamRadar at 5,000 and 10,000, and deploy, re-plan, the global
|
|
13
|
+
// audit and teardown at 100,000 (docs/plans/2026-10-22-monitor-load-testing.md,
|
|
14
|
+
// Stage 10); the full 100,000 run gates the next raise.
|
|
15
|
+
export const MONITOR_FLEET_MAX_MEMBERS = 20_000;
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Source rows one plan may evaluate. Every row the planner reads is an
|
|
19
|
+
* eligible candidate (the source's `where` is applied in SQL), so a plan reads
|
|
20
|
+
* at most `selection.limit` rows; the frontier only has to admit the ceiling.
|
|
21
|
+
*/
|
|
22
|
+
export const MONITOR_FLEET_FRONTIER_MAX_ROWS = Math.max(
|
|
23
|
+
10_000,
|
|
24
|
+
MONITOR_FLEET_MAX_MEMBERS,
|
|
25
|
+
);
|
|
14
26
|
/**
|
|
15
27
|
* Fleet definitions are admitted once and executed many times. Keep the
|
|
16
28
|
* edition beside the definition just as Plays keep their authoring-contract
|
|
@@ -29,7 +41,7 @@ export const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG = [
|
|
|
29
41
|
{
|
|
30
42
|
edition: 1,
|
|
31
43
|
changed:
|
|
32
|
-
'Initial Fleet JSON contract: bounded sticky table membership, source refresh, and a seven-day removal grace.',
|
|
44
|
+
'Initial Fleet JSON contract: bounded sticky table membership, source refresh, and a seven-day removal grace. The grace was retired for every edition on 2026-11-13: a member whose row is gone is removed by the next plan (see the fixed policy).',
|
|
33
45
|
compatibilityOwner: 'Monitors Runtime',
|
|
34
46
|
newWritesEnd: null,
|
|
35
47
|
readerRemoval: null,
|
|
@@ -44,12 +56,13 @@ export const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG = [
|
|
|
44
56
|
},
|
|
45
57
|
] as const;
|
|
46
58
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
59
|
+
* A member whose row the source no longer returns is deactivated by the next
|
|
60
|
+
* plan; there is no removal grace. Fleets used to keep such a member for seven
|
|
61
|
+
* days. The export stays, at zero, so code that imports it keeps compiling.
|
|
62
|
+
*
|
|
63
|
+
* @deprecated There is no removal grace; this is always 0.
|
|
51
64
|
*/
|
|
52
|
-
export const MONITOR_FLEET_REMOVAL_GRACE_MS =
|
|
65
|
+
export const MONITOR_FLEET_REMOVAL_GRACE_MS = 0;
|
|
53
66
|
|
|
54
67
|
/**
|
|
55
68
|
* Public, machine-readable guidance for every Monitor Fleet authoring
|
|
@@ -65,13 +78,12 @@ export const MONITOR_FLEET_DOCUMENTATION = {
|
|
|
65
78
|
'Customer DB table, unique row key, and optional equality filters that select candidate rows.',
|
|
66
79
|
monitor:
|
|
67
80
|
'One Batch-compatible MonitorSpec. Direct Handlebars source-row fields such as {{domain}} are rendered for each selected row.',
|
|
68
|
-
selection:
|
|
69
|
-
'Deterministic ranking and an active-member limit between 1 and 1,000.',
|
|
81
|
+
selection: `Deterministic ranking and an active-member limit between 1 and ${MONITOR_FLEET_MAX_MEMBERS.toLocaleString('en-US')}.`,
|
|
70
82
|
},
|
|
71
83
|
fixedPolicy: {
|
|
72
|
-
cadence: '
|
|
84
|
+
cadence: '15m fair bounded source refresh',
|
|
73
85
|
membership: 'sticky',
|
|
74
|
-
removalGrace: '
|
|
86
|
+
removalGrace: 'none',
|
|
75
87
|
onRemoved: 'deactivate',
|
|
76
88
|
ownership:
|
|
77
89
|
'A Fleet may adopt a same-tool ordinary monitor with its deterministic member key. The first Fleet claim wins; another Fleet or a different tool receives a conflict.',
|
|
@@ -445,7 +457,7 @@ function validateMonitorFleetDefinitionV1(value: unknown): {
|
|
|
445
457
|
issues.push({
|
|
446
458
|
path: 'selection.limit',
|
|
447
459
|
code: 'MONITOR_FLEET_LIMIT_EXCEEDED',
|
|
448
|
-
message:
|
|
460
|
+
message: `selection.limit must be between 1 and ${MONITOR_FLEET_MAX_MEMBERS.toLocaleString('en-US')}.`,
|
|
449
461
|
});
|
|
450
462
|
}
|
|
451
463
|
if (selection?.membership !== 'sticky') {
|
|
@@ -507,7 +519,7 @@ function validateMonitorFleetDefinitionV1(value: unknown): {
|
|
|
507
519
|
code: 'unsupported_fleet_option',
|
|
508
520
|
message:
|
|
509
521
|
`${removedOption} is fixed by Monitor Fleets and must be omitted. ` +
|
|
510
|
-
`Fleets sync ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.cadence} and ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.onRemoved}
|
|
522
|
+
`Fleets sync on a ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.cadence} and ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.onRemoved} a member as soon as the source no longer returns its row.`,
|
|
511
523
|
});
|
|
512
524
|
}
|
|
513
525
|
}
|
|
@@ -101,8 +101,7 @@ function monitorSpec(
|
|
|
101
101
|
code: 'PLAY_BINDING_NOT_IN_MONITOR_SPEC',
|
|
102
102
|
path: authoredMonitorFieldPath(path, 'play'),
|
|
103
103
|
message: 'A monitor does not own Play bindings.',
|
|
104
|
-
suggestion:
|
|
105
|
-
'Declare sqlListeners in the Play.',
|
|
104
|
+
suggestion: 'Declare sqlListeners in the Play.',
|
|
106
105
|
});
|
|
107
106
|
continue;
|
|
108
107
|
}
|
|
@@ -401,15 +400,38 @@ export function lintMonitorSpecTemplate(
|
|
|
401
400
|
: { normalized: normalized!, issues: ordered };
|
|
402
401
|
}
|
|
403
402
|
|
|
403
|
+
/**
|
|
404
|
+
* Compiled templates by source. A Fleet renders the same few templates once
|
|
405
|
+
* per row, and compiling each one again for every row was most of a
|
|
406
|
+
* 100,000-member sync's 34 s `desired` phase. Cleared, not evicted, past the
|
|
407
|
+
* bound: one process renders many Fleets' templates over its life.
|
|
408
|
+
*/
|
|
409
|
+
const COMPILED_TEMPLATES = new Map<
|
|
410
|
+
string,
|
|
411
|
+
ReturnType<typeof Handlebars.compile>
|
|
412
|
+
>();
|
|
413
|
+
const COMPILED_TEMPLATES_MAX = 1_000;
|
|
414
|
+
|
|
415
|
+
function compiledTemplate(source: string) {
|
|
416
|
+
const cached = COMPILED_TEMPLATES.get(source);
|
|
417
|
+
if (cached) return cached;
|
|
418
|
+
if (COMPILED_TEMPLATES.size >= COMPILED_TEMPLATES_MAX) {
|
|
419
|
+
COMPILED_TEMPLATES.clear();
|
|
420
|
+
}
|
|
421
|
+
const compiled = Handlebars.compile(source, {
|
|
422
|
+
noEscape: true,
|
|
423
|
+
strict: true,
|
|
424
|
+
knownHelpersOnly: true,
|
|
425
|
+
preventIndent: true,
|
|
426
|
+
});
|
|
427
|
+
COMPILED_TEMPLATES.set(source, compiled);
|
|
428
|
+
return compiled;
|
|
429
|
+
}
|
|
430
|
+
|
|
404
431
|
function renderValue(value: unknown, row: Record<string, unknown>): unknown {
|
|
405
432
|
if (typeof value === 'string' && value.includes('{{')) {
|
|
406
433
|
const context = Object.assign(Object.create(null), row);
|
|
407
|
-
return
|
|
408
|
-
noEscape: true,
|
|
409
|
-
strict: true,
|
|
410
|
-
knownHelpersOnly: true,
|
|
411
|
-
preventIndent: true,
|
|
412
|
-
})(context, {
|
|
434
|
+
return compiledTemplate(value)(context, {
|
|
413
435
|
allowProtoMethodsByDefault: false,
|
|
414
436
|
allowProtoPropertiesByDefault: false,
|
|
415
437
|
helpers: Object.create(null),
|
|
@@ -428,6 +450,9 @@ export function renderMonitorSpecTemplate(
|
|
|
428
450
|
template: MonitorSpec,
|
|
429
451
|
row: Record<string, unknown>,
|
|
430
452
|
): { spec?: MonitorSpec; issues: MonitorInputIssue[] } {
|
|
453
|
+
// Linted on every call: the template is a caller's object, and a caller
|
|
454
|
+
// may change it between renders. Compiling is what cost, and that is kept
|
|
455
|
+
// by source text above.
|
|
431
456
|
const lint = lintMonitorSpecTemplate(template);
|
|
432
457
|
if (!lint.normalized) return { issues: lint.issues };
|
|
433
458
|
try {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Slack alert for a Monitor Fleet whose member counts drifted.
|
|
3
|
+
*
|
|
4
|
+
* A drift is a bug, never an expected state: every member movement is
|
|
5
|
+
* journalled by the one transition writer, so a counter that disagrees with
|
|
6
|
+
* the members means a movement was lost or applied twice. The alert says so
|
|
7
|
+
* loudly and carries everything an agent needs to start on it without asking.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type FleetCountsByBucket = Record<string, number>;
|
|
11
|
+
|
|
12
|
+
export type FleetCountDriftAlertInput = {
|
|
13
|
+
stage: 'detected' | 'repaired';
|
|
14
|
+
environment: string;
|
|
15
|
+
convexDeployment: string | null;
|
|
16
|
+
orgId: string;
|
|
17
|
+
fleetId: string;
|
|
18
|
+
trigger: string;
|
|
19
|
+
startedAt: number;
|
|
20
|
+
fleetStatus: string;
|
|
21
|
+
generation: number;
|
|
22
|
+
observed: FleetCountsByBucket;
|
|
23
|
+
repaired?: FleetCountsByBucket;
|
|
24
|
+
detail?: Record<string, unknown>;
|
|
25
|
+
pages?: number;
|
|
26
|
+
durationMs?: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const FIRE = '🔥🔥🔥';
|
|
30
|
+
|
|
31
|
+
const TRIGGER_MEANING: Record<string, string> = {
|
|
32
|
+
underflow:
|
|
33
|
+
'applying a page of journalled movements would have taken a bucket below zero (a movement was lost, or one was applied twice)',
|
|
34
|
+
bucket_mismatch:
|
|
35
|
+
'with no journal rows left to fold, the counter said a bucket was occupied while no member sat in it, or the reverse (an over-count that never goes negative, or an under-count)',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function json(value: unknown): string {
|
|
39
|
+
return JSON.stringify(value ?? null);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function bucketDiff(
|
|
43
|
+
observed: FleetCountsByBucket,
|
|
44
|
+
repaired: FleetCountsByBucket,
|
|
45
|
+
): string {
|
|
46
|
+
const buckets = [
|
|
47
|
+
...new Set([...Object.keys(observed), ...Object.keys(repaired)]),
|
|
48
|
+
];
|
|
49
|
+
const changed = buckets.filter(
|
|
50
|
+
(bucket) => (observed[bucket] ?? 0) !== (repaired[bucket] ?? 0),
|
|
51
|
+
);
|
|
52
|
+
if (changed.length === 0) return 'no bucket changed';
|
|
53
|
+
return changed
|
|
54
|
+
.map(
|
|
55
|
+
(bucket) =>
|
|
56
|
+
`${bucket} ${observed[bucket] ?? 0} -> ${repaired[bucket] ?? 0}`,
|
|
57
|
+
)
|
|
58
|
+
.join(', ');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The paragraph to paste into an agent: what happened, where the code is,
|
|
63
|
+
* and where the evidence is.
|
|
64
|
+
*/
|
|
65
|
+
export function fleetCountDriftAgentBrief(
|
|
66
|
+
input: FleetCountDriftAlertInput,
|
|
67
|
+
): string {
|
|
68
|
+
const at = new Date(input.startedAt).toISOString();
|
|
69
|
+
const windowStart = new Date(input.startedAt - 60 * 60_000).toISOString();
|
|
70
|
+
const lines = [
|
|
71
|
+
`Monitor Fleet count drift in ${input.environment}${input.convexDeployment ? ` (Convex ${input.convexDeployment})` : ''}: org ${input.orgId}, fleet ${input.fleetId}, generation ${input.generation}, status ${input.fleetStatus}, detected ${at}.`,
|
|
72
|
+
`Trigger "${input.trigger}": ${TRIGGER_MEANING[input.trigger] ?? 'see the trigger name'}.`,
|
|
73
|
+
`Counter when detected: ${json(input.observed)}.${input.detail ? ` Context: ${json(input.detail)}.` : ''}`,
|
|
74
|
+
...(input.repaired
|
|
75
|
+
? [
|
|
76
|
+
`Exact recount from the member rows: ${json(input.repaired)} (${bucketDiff(input.observed, input.repaired)}), ${input.pages ?? '?'} pages in ${Math.round((input.durationMs ?? 0) / 1000)} s. The counter is correct again; the bug that drifted it is not fixed.`,
|
|
77
|
+
]
|
|
78
|
+
: [
|
|
79
|
+
'The fleet is paused (monitorFleets.countsAudit): no claim, commit or repair moves its members until runFleetCountsAudit has recounted them and published the exact numbers. A second alert reports the repair.',
|
|
80
|
+
]),
|
|
81
|
+
'How the counter works: applyMonitorTransition in packages/convex/providerMonitorFleets.ts is the only writer of a member\'s convergence field and journals each bucket movement to providerMonitorCounterDeltas (family "fleet_counts", counterKey = fleet id); drainFleetCounts folds those rows into monitorFleetCounts. Find the transition or fold that lost or doubled a movement.',
|
|
82
|
+
`Evidence to pull: Convex logs for org ${input.orgId} from ${windowStart} to ${at} (Axiom dataset "convex", function paths providerMonitorFleets:*, console lines "[monitor-fleets]" and "[provider-monitor-counters]"), and the fleet row: npx convex run providerMonitorFleets:getFleetV2 '${json({ orgId: input.orgId, fleetId: input.fleetId })}'. Suspects: a fold racing the drain (the deployed-ABI foldFleetCounts from an older revision), a transition patched outside applyMonitorTransition, or rows crossing a rolling deploy.`,
|
|
83
|
+
];
|
|
84
|
+
return lines.join('\n');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Fields for `buildSlackActivityPayload`; the brief rides as one field. */
|
|
88
|
+
export function fleetCountDriftAlert(input: FleetCountDriftAlertInput): {
|
|
89
|
+
activityTitle: string;
|
|
90
|
+
activityPrimary: string;
|
|
91
|
+
fallbackText: string;
|
|
92
|
+
fields: Array<{ label: string; value: string | number | null }>;
|
|
93
|
+
} {
|
|
94
|
+
const headline =
|
|
95
|
+
input.stage === 'detected'
|
|
96
|
+
? `${FIRE} BUG CAUGHT: Monitor Fleet counts drifted ${FIRE}`
|
|
97
|
+
: `${FIRE} Fleet count drift repaired - the bug behind it still needs a fix ${FIRE}`;
|
|
98
|
+
const primary = `${input.fleetId} | ${input.trigger} | ${input.environment}`;
|
|
99
|
+
return {
|
|
100
|
+
activityTitle: headline,
|
|
101
|
+
activityPrimary: primary,
|
|
102
|
+
fallbackText: `${headline} ${primary} | org ${input.orgId}`,
|
|
103
|
+
fields: [
|
|
104
|
+
{ label: 'Stage', value: input.stage },
|
|
105
|
+
{ label: 'Environment', value: input.environment },
|
|
106
|
+
{ label: 'Convex deployment', value: input.convexDeployment },
|
|
107
|
+
{ label: 'Org ID', value: input.orgId },
|
|
108
|
+
{ label: 'Fleet', value: input.fleetId },
|
|
109
|
+
{ label: 'Trigger', value: input.trigger },
|
|
110
|
+
{ label: 'Fleet status', value: input.fleetStatus },
|
|
111
|
+
{ label: 'Generation', value: input.generation },
|
|
112
|
+
{ label: 'Detected at', value: new Date(input.startedAt).toISOString() },
|
|
113
|
+
{ label: 'Counter seen', value: json(input.observed) },
|
|
114
|
+
{
|
|
115
|
+
label: 'Exact recount',
|
|
116
|
+
value: input.repaired ? json(input.repaired) : 'pending (fleet paused)',
|
|
117
|
+
},
|
|
118
|
+
{ label: 'Agent brief', value: fleetCountDriftAgentBrief(input) },
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
@@ -24,6 +24,14 @@ export const FLEET_REFUSAL = {
|
|
|
24
24
|
resourceBindingConflict: 'provider.resource_binding_conflict',
|
|
25
25
|
} as const;
|
|
26
26
|
export const MAX_MEMBER_DEFINITION_BYTES = 2_048;
|
|
27
|
+
/**
|
|
28
|
+
* The largest plan published in ONE Convex transaction (`commitPlan`). It is
|
|
29
|
+
* the size that transaction was built and ceiling-tested for; a larger plan is
|
|
30
|
+
* staged in chunks of STAGED_COMMIT_CHUNK_MEMBERS.
|
|
31
|
+
*/
|
|
32
|
+
export const SINGLE_COMMIT_MAX_MEMBERS = 1_000;
|
|
33
|
+
/** Members one staged-commit chunk carries; see `commitStagedChunk`. */
|
|
34
|
+
export const STAGED_COMMIT_CHUNK_MEMBERS = 250;
|
|
27
35
|
export const MAX_FLEET_SETTLE_ITEMS = 100;
|
|
28
36
|
/**
|
|
29
37
|
* How long a convergence claim leases its members. The create path posts
|
|
@@ -11,19 +11,13 @@
|
|
|
11
11
|
* verbatim. Planning decides; the commit publishes.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { MONITOR_FLEET_REMOVAL_GRACE_MS } from '../../integration-contracts/monitor-fleet-contract';
|
|
15
14
|
import { FLEET_BLOCKED_BY } from './limits';
|
|
16
15
|
export { FLEET_BLOCKED_BY } from './limits';
|
|
17
16
|
|
|
18
17
|
// Rollout access is checked by convergence immediately before provider work,
|
|
19
18
|
// not by this pure planner: an admitted plan can outlive rollout access.
|
|
20
19
|
|
|
21
|
-
export type FleetMemberAction =
|
|
22
|
-
| 'create'
|
|
23
|
-
| 'update'
|
|
24
|
-
| 'remove'
|
|
25
|
-
| 'blocked'
|
|
26
|
-
| 'grace';
|
|
20
|
+
export type FleetMemberAction = 'create' | 'update' | 'remove' | 'blocked';
|
|
27
21
|
|
|
28
22
|
/** One monitor the fleet wants, fully resolved from its source row. */
|
|
29
23
|
export type DesiredFleetMember = {
|
|
@@ -90,52 +84,21 @@ export type FleetPlan = {
|
|
|
90
84
|
|
|
91
85
|
export type FleetMembershipMember = {
|
|
92
86
|
sourceKey: string;
|
|
93
|
-
firstMissingAt: number | null;
|
|
94
87
|
};
|
|
95
88
|
|
|
96
89
|
export type FleetMembershipDecision = {
|
|
97
90
|
/** Source keys the fleet holds after this plan, in selection order. */
|
|
98
91
|
selected: string[];
|
|
99
|
-
/**
|
|
100
|
-
reservedGraceSlots: number;
|
|
101
|
-
/** Members whose row vanished on this plan. Grace starts now. */
|
|
102
|
-
markMissing: string[];
|
|
103
|
-
/** Members whose grace has expired and are now removed. */
|
|
92
|
+
/** Members whose row the source no longer returns; removed by this plan. */
|
|
104
93
|
remove: string[];
|
|
105
94
|
};
|
|
106
95
|
|
|
107
|
-
/**
|
|
108
|
-
* Slots held by members whose source row has vanished but whose removal grace
|
|
109
|
-
* has not expired.
|
|
110
|
-
*
|
|
111
|
-
* Such a member is still a member: it keeps its monitor, and grace exists so a
|
|
112
|
-
* row that comes back is restored rather than recreated. Handing its vacancy
|
|
113
|
-
* to the next ranked candidate immediately would push the fleet past its own
|
|
114
|
-
* limit, and then the reappearance grace is designed to absorb would force an
|
|
115
|
-
* eviction to get back under it - exactly the churn stickiness promises not to
|
|
116
|
-
* cause. Reserve the slot until grace actually expires.
|
|
117
|
-
*/
|
|
118
|
-
export function countReservedRemovalGraceSlots(input: {
|
|
119
|
-
members: readonly FleetMembershipMember[];
|
|
120
|
-
selectedSourceKeys: ReadonlySet<string>;
|
|
121
|
-
now: number;
|
|
122
|
-
}): number {
|
|
123
|
-
return input.members.filter((member) => {
|
|
124
|
-
if (input.selectedSourceKeys.has(member.sourceKey)) return false;
|
|
125
|
-
// Not yet marked missing means this plan is the one that starts grace.
|
|
126
|
-
return (
|
|
127
|
-
member.firstMissingAt === null ||
|
|
128
|
-
input.now - member.firstMissingAt < MONITOR_FLEET_REMOVAL_GRACE_MS
|
|
129
|
-
);
|
|
130
|
-
}).length;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
96
|
/**
|
|
134
97
|
* Who the fleet holds after a plan, given what the source still returns.
|
|
135
98
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
99
|
+
* An active member keeps its slot while its row exists, ranking only ever
|
|
100
|
+
* fills what is free, and a member whose row the source no longer returns is
|
|
101
|
+
* removed by this plan.
|
|
139
102
|
*/
|
|
140
103
|
export function decideFleetMembership(input: {
|
|
141
104
|
limit: number;
|
|
@@ -144,7 +107,6 @@ export function decideFleetMembership(input: {
|
|
|
144
107
|
presentSourceKeys: ReadonlySet<string>;
|
|
145
108
|
/** Ranked non-member candidates, best first. */
|
|
146
109
|
candidates: readonly string[];
|
|
147
|
-
now: number;
|
|
148
110
|
}): FleetMembershipDecision {
|
|
149
111
|
const selected: string[] = [];
|
|
150
112
|
const selectedKeys = new Set<string>();
|
|
@@ -156,31 +118,16 @@ export function decideFleetMembership(input: {
|
|
|
156
118
|
selected.push(member.sourceKey);
|
|
157
119
|
selectedKeys.add(member.sourceKey);
|
|
158
120
|
}
|
|
159
|
-
const reservedGraceSlots = countReservedRemovalGraceSlots({
|
|
160
|
-
members: input.members,
|
|
161
|
-
selectedSourceKeys: selectedKeys,
|
|
162
|
-
now: input.now,
|
|
163
|
-
});
|
|
164
121
|
for (const candidate of input.candidates) {
|
|
165
|
-
if (selected.length
|
|
122
|
+
if (selected.length >= input.limit) break;
|
|
166
123
|
if (selectedKeys.has(candidate)) continue;
|
|
167
124
|
selected.push(candidate);
|
|
168
125
|
selectedKeys.add(candidate);
|
|
169
126
|
}
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (member.firstMissingAt === null) {
|
|
175
|
-
markMissing.push(member.sourceKey);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (input.now - member.firstMissingAt < MONITOR_FLEET_REMOVAL_GRACE_MS) {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
remove.push(member.sourceKey);
|
|
182
|
-
}
|
|
183
|
-
return { selected, reservedGraceSlots, markMissing, remove };
|
|
127
|
+
const remove = input.members
|
|
128
|
+
.filter((member) => !selectedKeys.has(member.sourceKey))
|
|
129
|
+
.map((member) => member.sourceKey);
|
|
130
|
+
return { selected, remove };
|
|
184
131
|
}
|
|
185
132
|
|
|
186
133
|
/** The account a monitor is counted against. Never null, so nothing is uncounted. */
|
|
@@ -210,10 +157,8 @@ export type FleetEntitlements = {
|
|
|
210
157
|
export function planFleetMembers(input: {
|
|
211
158
|
desired: readonly DesiredFleetMember[];
|
|
212
159
|
owned: readonly OwnedFleetMonitor[];
|
|
213
|
-
/** Source keys
|
|
160
|
+
/** Source keys no longer selected, from `decideFleetMembership`. */
|
|
214
161
|
remove: readonly string[];
|
|
215
|
-
/** Source keys whose row vanished on this plan. */
|
|
216
|
-
markMissing: readonly string[];
|
|
217
162
|
entitlements: FleetEntitlements;
|
|
218
163
|
/**
|
|
219
164
|
* Monitors already counted against an account, org-wide. An account absent
|
|
@@ -276,10 +221,9 @@ export function planFleetMembers(input: {
|
|
|
276
221
|
owned?.convergence === 'settled' &&
|
|
277
222
|
owned.firstMissingAt === null;
|
|
278
223
|
if (settledOnDesired) continue;
|
|
279
|
-
// A member
|
|
280
|
-
// re-
|
|
281
|
-
//
|
|
282
|
-
// rather than needing a second write path that could disagree with it.
|
|
224
|
+
// A member an older revision marked missing (the removal grace, since
|
|
225
|
+
// removed) is still re-published, which clears that mark through the
|
|
226
|
+
// same guarded transition every other change uses.
|
|
283
227
|
members.push({ ...base, action: 'update', needsSeed: false });
|
|
284
228
|
updates += 1;
|
|
285
229
|
// A failed update keeps its applied hash, so it is retried as an update.
|
|
@@ -313,18 +257,6 @@ export function planFleetMembers(input: {
|
|
|
313
257
|
}
|
|
314
258
|
|
|
315
259
|
const plannedKeys = new Set(members.map((member) => member.monitorKey));
|
|
316
|
-
for (const sourceKey of input.markMissing) {
|
|
317
|
-
const owned = ownedBySource.get(sourceKey);
|
|
318
|
-
if (!owned || plannedKeys.has(owned.monitorKey)) continue;
|
|
319
|
-
members.push({
|
|
320
|
-
monitorKey: owned.monitorKey,
|
|
321
|
-
sourceKey,
|
|
322
|
-
...(owned.entityKey ? { entityKey: owned.entityKey } : {}),
|
|
323
|
-
action: 'grace',
|
|
324
|
-
needsSeed: false,
|
|
325
|
-
});
|
|
326
|
-
plannedKeys.add(owned.monitorKey);
|
|
327
|
-
}
|
|
328
260
|
for (const sourceKey of input.remove) {
|
|
329
261
|
const owned = ownedBySource.get(sourceKey);
|
|
330
262
|
if (!owned || plannedKeys.has(owned.monitorKey)) continue;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./fleets/limits": "./fleets/limits.ts",
|
|
8
|
+
"./fleets/count-drift-alert": "./fleets/count-drift-alert.ts",
|
|
8
9
|
"./analytics-install-guides": "./analytics-install-guides.ts",
|
|
9
10
|
"./analytics-install-guides.js": "./analytics-install-guides.ts",
|
|
10
11
|
"./analytics-public": "./analytics-public.ts",
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
"id": "github.eval-agent-cli-matrix",
|
|
260
260
|
"name": "Eval Agent CLI Matrix",
|
|
261
261
|
"scheduler": "github_actions",
|
|
262
|
-
"cadence": "0 7 * * *; 0
|
|
262
|
+
"cadence": "0 7 * * *; 0 3 * * 1,3,5",
|
|
263
263
|
"timezone": "America/New_York",
|
|
264
264
|
"source": ".github/workflows/eval-agent-cli-matrix.yml",
|
|
265
265
|
"locator": "schedule:",
|
|
@@ -1442,9 +1442,9 @@
|
|
|
1442
1442
|
"locator": "publish shadow tool rates",
|
|
1443
1443
|
"owner": "integrations",
|
|
1444
1444
|
"criticality": "operational",
|
|
1445
|
-
"purpose": "
|
|
1446
|
-
"successDefinition": "The leased
|
|
1447
|
-
"failureDefinition": "A publication
|
|
1445
|
+
"purpose": "Publish completed workspace/tool/day buckets into weighted 28-day shadow tool rates.",
|
|
1446
|
+
"successDefinition": "The leased run publishes completed buckets within its budget and saves its scan position. Incomplete workspaces are counted and revisited on the next scan.",
|
|
1447
|
+
"failureDefinition": "A publication read or write fails. A successful bounded run can leave work for the next invocation.",
|
|
1448
1448
|
"startGraceMs": 120000,
|
|
1449
1449
|
"runTimeoutMs": 180000,
|
|
1450
1450
|
"failureAlert": "convex_action_wrapper",
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
GetObjectCommand,
|
|
5
5
|
HeadObjectCommand,
|
|
6
6
|
DeleteObjectCommand,
|
|
7
|
-
ListObjectsV2Command,
|
|
8
7
|
} from '@aws-sdk/client-s3';
|
|
9
8
|
import { createHash } from 'node:crypto';
|
|
10
9
|
import { NodeHttpHandler } from '@smithy/node-http-handler';
|
|
@@ -281,31 +280,6 @@ export async function getBufferFromR2(
|
|
|
281
280
|
return Buffer.from(bytes);
|
|
282
281
|
}
|
|
283
282
|
|
|
284
|
-
/** Every key under a prefix, across as many listing pages as it takes. */
|
|
285
|
-
export async function listR2Keys(
|
|
286
|
-
prefix: string,
|
|
287
|
-
kind: R2BucketKind = 'default',
|
|
288
|
-
): Promise<string[]> {
|
|
289
|
-
const config = getR2Config(kind);
|
|
290
|
-
const client = getR2Client(config);
|
|
291
|
-
const keys: string[] = [];
|
|
292
|
-
let continuationToken: string | undefined;
|
|
293
|
-
do {
|
|
294
|
-
const response = await client.send(
|
|
295
|
-
new ListObjectsV2Command({
|
|
296
|
-
Bucket: config.bucket,
|
|
297
|
-
Prefix: prefix,
|
|
298
|
-
ContinuationToken: continuationToken,
|
|
299
|
-
}),
|
|
300
|
-
);
|
|
301
|
-
for (const object of response.Contents ?? []) {
|
|
302
|
-
if (object.Key) keys.push(object.Key);
|
|
303
|
-
}
|
|
304
|
-
continuationToken = response.NextContinuationToken;
|
|
305
|
-
} while (continuationToken);
|
|
306
|
-
return keys;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
283
|
/**
|
|
310
284
|
* Delete one immutable runtime object. Callers must retain their own durable
|
|
311
285
|
* deletion intent and confirm absence with HEAD before they acknowledge this
|
|
@@ -3,6 +3,11 @@ import { RUN_EVENT_KIND } from './run-event-catalog';
|
|
|
3
3
|
/** One current activity across bounded platform-recovery attempts. */
|
|
4
4
|
export const PLATFORM_RECOVERY_ACTIVITY_ID = 'run:platform-recovery';
|
|
5
5
|
export const CANCELLATION_CLEANUP_ACTIVITY_ID = 'run:cancellation-cleanup';
|
|
6
|
+
/**
|
|
7
|
+
* One current activity while a run waits because its workspace already runs
|
|
8
|
+
* as many Plays at once as its plan allows (the live-sandbox cap).
|
|
9
|
+
*/
|
|
10
|
+
export const SANDBOX_CAPACITY_ACTIVITY_ID = 'run:sandbox-capacity';
|
|
6
11
|
/**
|
|
7
12
|
* Canonical, producer-facing description of what a play is doing.
|
|
8
13
|
*
|
|
@@ -42,6 +47,11 @@ export type PlayActivityTarget =
|
|
|
42
47
|
kind: 'capacity';
|
|
43
48
|
pool: 'worker' | 'provider' | 'dataset' | 'runner';
|
|
44
49
|
label?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The concurrent-run limit the workspace reached. Optional: absent on
|
|
52
|
+
* observations written before it existed and on other capacity pools.
|
|
53
|
+
*/
|
|
54
|
+
limit?: number;
|
|
45
55
|
};
|
|
46
56
|
|
|
47
57
|
export type PlayActivityProgress = {
|
|
@@ -308,6 +318,27 @@ function publicProviderCapacityObservation(
|
|
|
308
318
|
};
|
|
309
319
|
}
|
|
310
320
|
|
|
321
|
+
/** The concurrent-run limit an observation carries, when it has one. */
|
|
322
|
+
export function sandboxCapacityLimit(
|
|
323
|
+
target: PlayActivityTarget,
|
|
324
|
+
): number | null {
|
|
325
|
+
return target.kind === 'capacity' &&
|
|
326
|
+
typeof target.limit === 'number' &&
|
|
327
|
+
Number.isSafeInteger(target.limit) &&
|
|
328
|
+
target.limit > 0
|
|
329
|
+
? target.limit
|
|
330
|
+
: null;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function sandboxCapacitySummary(target: PlayActivityTarget): string {
|
|
334
|
+
const limit = sandboxCapacityLimit(target);
|
|
335
|
+
const running =
|
|
336
|
+
limit === null
|
|
337
|
+
? 'as many Play runs at once as its plan allows'
|
|
338
|
+
: `${limit.toLocaleString('en-US')} Play ${limit === 1 ? 'run' : 'runs'} at once, the most its plan allows`;
|
|
339
|
+
return `Queued: this workspace is running ${running}. This run starts when one finishes; upgrade the plan to run more at once.`;
|
|
340
|
+
}
|
|
341
|
+
|
|
311
342
|
export function summarizePlayActivity(
|
|
312
343
|
observation: PlayActivityObservation,
|
|
313
344
|
): string {
|
|
@@ -318,6 +349,11 @@ export function summarizePlayActivity(
|
|
|
318
349
|
state.kind === 'active'
|
|
319
350
|
)
|
|
320
351
|
return 'Cancelling Play: waiting for cleanup to finish.';
|
|
352
|
+
if (
|
|
353
|
+
observation.activityId === SANDBOX_CAPACITY_ACTIVITY_ID &&
|
|
354
|
+
state.kind === 'queued'
|
|
355
|
+
)
|
|
356
|
+
return sandboxCapacitySummary(observation.target);
|
|
321
357
|
switch (state.kind) {
|
|
322
358
|
case 'active': {
|
|
323
359
|
const progress = state.progress;
|