Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-api): r1-m1 establish retained baseline cursor
Josuée24d54c826bd
diff --git a/control-api/package-lock.json b/control-api/package-lock.jsonindex dac8a3f72..5ec8f7bf8 100644--- a/control-api/package-lock.json+++ b/control-api/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-api",- "version": "0.1.642",+ "version": "0.1.643","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-api",- "version": "0.1.642",+ "version": "0.1.643","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",diff --git a/control-api/package.json b/control-api/package.jsonindex 48ff97068..3aafb96fd 100644--- a/control-api/package.json+++ b/control-api/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-api",- "version": "0.1.642",+ "version": "0.1.643","description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets","main": "dist/main.js","engines": {diff --git a/control-api/test/entityChangeFeed.realPostgres.integration.test.ts b/control-api/test/entityChangeFeed.realPostgres.integration.test.tsindex 54e1094c9..12c683397 100644--- a/control-api/test/entityChangeFeed.realPostgres.integration.test.ts+++ b/control-api/test/entityChangeFeed.realPostgres.integration.test.ts@@ -410,6 +410,13 @@ describeRealPostgres('entity change feed real PostgreSQL contract', () => {})it('coalesces latest-state invalidations and keeps feed storage behind the runtime boundary', async () => {+ // Establish a retained cursor in this test instead of depending on the+ // preceding expiry test's intentionally pruned watermark cursor.+ await instancePool.query(+ `INSERT INTO gfs_resources (drive, name, kind) VALUES ($1, 'coalesce-baseline', 'file')`,+ [`entity-change-coalesce-baseline-${randomUUID()}`]+ )+ await instancePool.query('SELECT * FROM entity_change_dispatch_batch(1000, 86400)')const baseline = await instancePool.query<{ current_cursor: string }>('SELECT current_cursor::text FROM entity_change_watermark WHERE singleton = true')@@ -449,10 +456,14 @@ describeRealPostgres('entity change feed real PostgreSQL contract', () => {try {await restricted.query('SET ROLE control_api_runtime')await expect(restricted.query('SELECT * FROM entity_change_feed')).rejects.toThrow()- const checkpoint = await restricted.query<{ invalidated_scopes: string[] }>(- 'SELECT * FROM entity_change_read_checkpoint($1::uuid, $2)',- [baseline.rows[0]?.current_cursor, 10000]- )+ const checkpoint = await restricted.query<{+ needs_resync: boolean+ invalidated_scopes: string[]+ }>('SELECT * FROM entity_change_read_checkpoint($1::uuid, $2)', [+ baseline.rows[0]?.current_cursor,+ 10000,+ ])+ expect(checkpoint.rows[0]?.needs_resync).toBe(false)expect(checkpoint.rows[0]?.invalidated_scopes).toEqual(['gfs'])expect(Object.keys(checkpoint.rows[0] ?? {}).sort()).toEqual(['current_cursor',