feat: parliament seat collaboration loop (0.9.19)
Seats publish via parliament_note, sync pushes on write, member join without stealing the chair, and worker tools are hard-gated when parliament is active. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+14
-2
@@ -255,6 +255,7 @@ int cst_parliament_cli_peer_listen(int port, const char *instance_id) {
|
||||
cst_parliament_meta_t m;
|
||||
memset(&m, 0, sizeof(m));
|
||||
(void)cst_parliament_load(&m);
|
||||
unsigned long before = m.revision;
|
||||
local.revision = m.revision;
|
||||
snprintf(local.parliament_id, sizeof(local.parliament_id), "%s",
|
||||
m.parliament_id);
|
||||
@@ -264,8 +265,13 @@ int cst_parliament_cli_peer_listen(int port, const char *instance_id) {
|
||||
local.context = cst_parliament_context_get();
|
||||
if (cst_peer_sync(&sess, &local, 15000, err, sizeof(err)) != 0)
|
||||
fprintf(stderr, "peer_sync failed: %s\n", err);
|
||||
else
|
||||
else {
|
||||
if (local.revision > before)
|
||||
(void)cst_parliament_apply_sync(local.revision, local.parliament_id,
|
||||
local.project_id, local.chair_instance,
|
||||
local.context);
|
||||
printf("peer_sync rev=%lu sealed=1\n", local.revision);
|
||||
}
|
||||
free(local.context);
|
||||
}
|
||||
cst_peer_close(&sess);
|
||||
@@ -301,6 +307,7 @@ int cst_parliament_cli_peer_dial(const char *host, int port,
|
||||
cst_parliament_meta_t m;
|
||||
memset(&m, 0, sizeof(m));
|
||||
(void)cst_parliament_load(&m);
|
||||
unsigned long before = m.revision;
|
||||
local.revision = m.revision;
|
||||
snprintf(local.parliament_id, sizeof(local.parliament_id), "%s",
|
||||
m.parliament_id);
|
||||
@@ -310,8 +317,13 @@ int cst_parliament_cli_peer_dial(const char *host, int port,
|
||||
local.context = cst_parliament_context_get();
|
||||
if (cst_peer_sync(&sess, &local, 15000, err, sizeof(err)) != 0)
|
||||
fprintf(stderr, "peer_sync failed: %s\n", err);
|
||||
else
|
||||
else {
|
||||
if (local.revision > before)
|
||||
(void)cst_parliament_apply_sync(local.revision, local.parliament_id,
|
||||
local.project_id, local.chair_instance,
|
||||
local.context);
|
||||
printf("peer_sync rev=%lu sealed=1\n", local.revision);
|
||||
}
|
||||
free(local.context);
|
||||
}
|
||||
cst_peer_close(&sess);
|
||||
|
||||
Reference in New Issue
Block a user