feat: parliament daemon, login gate, peer context sync (0.9.13)

Login claims the chair, writes a session ticket, and starts a background
service for discovery plus revision-based context sync. Password Realm
opens require --login (or CST_REALM_PASSWORD); --service/--service-stop
manage the resident agent.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
WHC
2026-10-28 23:11:23 +08:00
co-authored by Cursor
parent de9ee28773
commit e853abac5e
13 changed files with 769 additions and 12 deletions
+4 -1
View File
@@ -24,8 +24,10 @@ static void *server_main(void *p) {
char err[128];
s->ok = cst_peer_accept((intptr_t)s->listen, &s->cert, s->sk, s->realm_pk,
5000, &sess, err, sizeof(err)) == 0;
if (s->ok)
if (s->ok) {
snprintf(s->remote_id, sizeof(s->remote_id), "%s", sess.remote.instance_id);
cst_peer_close(&sess);
}
return NULL;
}
@@ -55,6 +57,7 @@ int main(void) {
assert(cst_peer_dial("127.0.0.1", port, &ca, ska, realm.pk, 5000, &sess, err,
sizeof(err)) == 0);
assert(!strcmp(sess.remote.instance_id, "peer-b"));
cst_peer_close(&sess);
pthread_join(th, NULL);
assert(srv.ok);
assert(!strcmp(srv.remote_id, "peer-a"));