openvibers/openvibe.bot Commits
Migrations: restore the text applied in production (#342)
Changes
@@@ -1,17 +1,17 @@-- phase: expand---- Jobs on the device link (plan T14 step L1; platform.job@1 inside platform.job-frame@1): Bot is the dispatcher++-- that hands a job to a paired Node and meters it per wall-clock second for Billing. Additive only: two new-- tables, nothing existing changes, nothing to backfill.---- run_jobs one row per job id: what was sent, to which device, its state and how far it is metered-- run_usage_outbox platform.usage-sample@1 readings waiting for Billing (the openvibe-sdk outboxSchema shape).-- event_id is the reading's idempotency_key run:<job id>:<second>, so a second is queued once++-- however often the Node reports it.CREATE TABLE IF NOT EXISTS run_jobs (id text PRIMARY KEY CHECK (id ~ '^job_[0-9A-HJKMNP-TV-Z]{26}$'), -- platform.job@1 id-- node_id text NOT NULL REFERENCES devices (id), -- dev_…: the device whose Link runs it++ node_id text NOT NULL REFERENCES devices (id), -- dev_…: the device whose Node runs itproject_id text, -- prj_… of the payer; no FK, Bot holds no projectssubject text, -- who the readings are for (user:usr_…)provider text,@@@ -19,9 +19,9 @@ CREATE TABLE IF NOT EXISTS run_jobs (job jsonb NOT NULL, -- the platform.job@1 body, resent verbatim until ackedstate text NOT NULL CHECK (state IN ('queued', 'placed', 'running', 'succeeded', 'failed', 'cancelled', 'expired')),cancel_requested boolean NOT NULL DEFAULT false,-- fault_code text, -- the Link's nack, or why Bot stopped sending it++ fault_code text, -- the Node's nack, or why Bot stopped sending itsent_at bigint, -- first time the job frame went out (ms)-- started_ms bigint, -- the Link's started_ms: anchors every usage second++ started_ms bigint, -- the Node's started_ms: anchors every usage secondwall_ms bigint, -- job_exit.usage.wall_ms as billed (capped at limits.wall_ms)usage_read integer NOT NULL DEFAULT 0 CHECK (usage_read >= 0), -- seconds queued for Billing; never moves backexit_reason text, -- job_exit.reason; set once, by the first job_exit@@@ -1,5 +1,5 @@-- phase: expand-- A screen share link shows the owner's own screen (main) or the machine's private desk (contracts 0.214.0 bot.command@1++-- `desk: private`, OpenVibe.Node v0.15.0): the agent works on the desk, and a room watches it there, never the owner's-- screen. Links made before this show the owner's screen, as they did.ALTER TABLE machine_screen_shares ADD COLUMN IF NOT EXISTS desk text NOT NULL DEFAULT 'main' CHECK (desk IN ('main', 'private'));@@@ -1,6 +1,6 @@-- phase: expand-- Vibe by voice (consumer plan §8, contracts 0.214.0 bot.device-message@1 voice_ask / voice_answer): the owner lets-- Vibe answer their voice on this machine, and chooses its call word. Off until they turn it on on openvibe.bot/machines;++-- the machine (OpenVibe Node's voice plugin) listens for the word only while it is on (config `voice`).ALTER TABLE devices ADD COLUMN IF NOT EXISTS voice_on boolean NOT NULL DEFAULT false;ALTER TABLE devices ADD COLUMN IF NOT EXISTS call_word text;@@@ -1,5 +1,5 @@-- phase: expand-- AI on your own machines (contracts 0.219.0, bot.command@1 kind ai; capability bot.machine.ai): the owner lets their++-- AI (OpenVibe.AI, acting for them) run a model on this machine's own model server through OpenVibe Node's ai plugin.-- Off until they turn it on on openvibe.bot/machines.ALTER TABLE devices ADD COLUMN IF NOT EXISTS ai_models boolean NOT NULL DEFAULT false;@@@ -1,7 +1,7 @@-- phase: expand-- Run sessions (contracts 0.223.0, the Desks plan's D6). A machine's owner may offer its desks to other people++-- (shared_desks, off until they turn it on on openvibe.bot/machines; only where its OpenVibe Node runs every desk in its++-- own sandbox, desk_isolation sandbox, Node v0.32.0). OpenVibe.Run leases one named desk per session there, or on the-- person's own machine (bot.desk-lease@1): only that session's commands reach the desk, and the lease ends with it.ALTER TABLE devices ADD COLUMN IF NOT EXISTS shared_desks boolean NOT NULL DEFAULT false;@@@ -1,7 +1,7 @@-- phase: expand-- What a machine's coding agents have left (Codes C9c, bot.device-message@1's heartbeat `fleet`): each agent's id,-- whether it is installed and signed in, and each limit window's label, what it has used of its limit, and when it++-- frees. Its OpenVibe.Node reads it with OpenVibe.Codes' own logins probe as the machine's user and reports labels,-- numbers and times only: no key, token or account name. Bot keeps the latest reading per machine and when it stored-- it; a machine that stops beating keeps its last reading, and fleet_at says how old it is.ALTER TABLE devices ADD COLUMN IF NOT EXISTS fleet jsonb;@@@ -1,6 +1,6 @@-- phase: expand-- Plan L34 (the machines hub): the roles a machine has for the network (the catalogue is Contracts 0.257.0's-- machineRoles: codes.worker, desks.host, ai.host, bot.robot). The owner sets them on openvibe.network/machines and++-- the Node reads them on its next check-in (the config frame carries them). A machine that never had a role has the-- empty list, which is what the column starts with.ALTER TABLE devices ADD COLUMN roles jsonb NOT NULL DEFAULT '[]'::jsonb;@@@ -1,6 +1,6 @@-- phase: expand++-- The guided first run (OpenVibe.Node's `openvibe-node`, docs/install.md#first-run-guided-and-measured): one row per++-- device and step, from the `node.first_run` telemetry events the Node sends over its existing device link. It powers-- the machines page's figures for a machine's first job and the admin funnel (how many installs reach each step, and-- how long each took). The fields are an allowlist: no path, username or address is stored.CREATE TABLE IF NOT EXISTS device_first_run (
@@ -1,17 +1,17 @@
@@ -1,17 +1,17 @@
-- phase: expand
-- phase: expand
--
--
-- Jobs on the device link (plan T14 step L1; platform.job@1 inside platform.job-frame@1): Bot is the dispatcher
-- Jobs on the device link (plan T14 step L1; platform.job@1 inside platform.job-frame@1): Bot is the dispatcher
+-- that hands a job to a paired Node and meters it per wall-clock second for Billing. Additive only: two new
-- tables, nothing existing changes, nothing to backfill.
-- tables, nothing existing changes, nothing to backfill.
--
--
-- run_jobs one row per job id: what was sent, to which device, its state and how far it is metered
-- run_jobs one row per job id: what was sent, to which device, its state and how far it is metered
-- run_usage_outbox platform.usage-sample@1 readings waiting for Billing (the openvibe-sdk outboxSchema shape).
-- run_usage_outbox platform.usage-sample@1 readings waiting for Billing (the openvibe-sdk outboxSchema shape).
-- event_id is the reading's idempotency_key run:<job id>:<second>, so a second is queued once
-- event_id is the reading's idempotency_key run:<job id>:<second>, so a second is queued once
+-- however often the Node reports it.
CREATE TABLE IF NOT EXISTS run_jobs (
CREATE TABLE IF NOT EXISTS run_jobs (
id text PRIMARY KEY CHECK (id ~ '^job_[0-9A-HJKMNP-TV-Z]{26}$'), -- platform.job@1 id
id text PRIMARY KEY CHECK (id ~ '^job_[0-9A-HJKMNP-TV-Z]{26}$'), -- platform.job@1 id
- node_id text NOT NULL REFERENCES devices (id), -- dev_…: the device whose Link runs it
+ node_id text NOT NULL REFERENCES devices (id), -- dev_…: the device whose Node runs it
project_id text, -- prj_… of the payer; no FK, Bot holds no projects
project_id text, -- prj_… of the payer; no FK, Bot holds no projects
subject text, -- who the readings are for (user:usr_…)
subject text, -- who the readings are for (user:usr_…)
provider text,
provider text,
@@ -19,9 +19,9 @@ CREATE TABLE IF NOT EXISTS run_jobs (
@@ -19,9 +19,9 @@ CREATE TABLE IF NOT EXISTS run_jobs (
job jsonb NOT NULL, -- the platform.job@1 body, resent verbatim until acked
job jsonb NOT NULL, -- the platform.job@1 body, resent verbatim until acked
state text NOT NULL CHECK (state IN ('queued', 'placed', 'running', 'succeeded', 'failed', 'cancelled', 'expired')),
state text NOT NULL CHECK (state IN ('queued', 'placed', 'running', 'succeeded', 'failed', 'cancelled', 'expired')),
cancel_requested boolean NOT NULL DEFAULT false,
cancel_requested boolean NOT NULL DEFAULT false,
- fault_code text, -- the Link's nack, or why Bot stopped sending it
+ fault_code text, -- the Node's nack, or why Bot stopped sending it
sent_at bigint, -- first time the job frame went out (ms)
sent_at bigint, -- first time the job frame went out (ms)
- started_ms bigint, -- the Link's started_ms: anchors every usage second
+ started_ms bigint, -- the Node's started_ms: anchors every usage second
wall_ms bigint, -- job_exit.usage.wall_ms as billed (capped at limits.wall_ms)
wall_ms bigint, -- job_exit.usage.wall_ms as billed (capped at limits.wall_ms)
usage_read integer NOT NULL DEFAULT 0 CHECK (usage_read >= 0), -- seconds queued for Billing; never moves back
usage_read integer NOT NULL DEFAULT 0 CHECK (usage_read >= 0), -- seconds queued for Billing; never moves back
exit_reason text, -- job_exit.reason; set once, by the first job_exit
exit_reason text, -- job_exit.reason; set once, by the first job_exit
@@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
-- phase: expand
-- phase: expand
-- A screen share link shows the owner's own screen (main) or the machine's private desk (contracts 0.214.0 bot.command@1
-- A screen share link shows the owner's own screen (main) or the machine's private desk (contracts 0.214.0 bot.command@1
+-- `desk: private`, OpenVibe.Node v0.15.0): the agent works on the desk, and a room watches it there, never the owner's
-- screen. Links made before this show the owner's screen, as they did.
-- screen. Links made before this show the owner's screen, as they did.
ALTER TABLE machine_screen_shares ADD COLUMN IF NOT EXISTS desk text NOT NULL DEFAULT 'main' CHECK (desk IN ('main', 'private'));
ALTER TABLE machine_screen_shares ADD COLUMN IF NOT EXISTS desk text NOT NULL DEFAULT 'main' CHECK (desk IN ('main', 'private'));
@@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
-- phase: expand
-- phase: expand
-- Vibe by voice (consumer plan §8, contracts 0.214.0 bot.device-message@1 voice_ask / voice_answer): the owner lets
-- Vibe by voice (consumer plan §8, contracts 0.214.0 bot.device-message@1 voice_ask / voice_answer): the owner lets
-- Vibe answer their voice on this machine, and chooses its call word. Off until they turn it on on openvibe.bot/machines;
-- Vibe answer their voice on this machine, and chooses its call word. Off until they turn it on on openvibe.bot/machines;
+-- the machine (OpenVibe Node's voice plugin) listens for the word only while it is on (config `voice`).
ALTER TABLE devices ADD COLUMN IF NOT EXISTS voice_on boolean NOT NULL DEFAULT false;
ALTER TABLE devices ADD COLUMN IF NOT EXISTS voice_on boolean NOT NULL DEFAULT false;
ALTER TABLE devices ADD COLUMN IF NOT EXISTS call_word text;
ALTER TABLE devices ADD COLUMN IF NOT EXISTS call_word text;
@@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
-- phase: expand
-- phase: expand
-- AI on your own machines (contracts 0.219.0, bot.command@1 kind ai; capability bot.machine.ai): the owner lets their
-- AI on your own machines (contracts 0.219.0, bot.command@1 kind ai; capability bot.machine.ai): the owner lets their
+-- AI (OpenVibe.AI, acting for them) run a model on this machine's own model server through OpenVibe Node's ai plugin.
-- Off until they turn it on on openvibe.bot/machines.
-- Off until they turn it on on openvibe.bot/machines.
ALTER TABLE devices ADD COLUMN IF NOT EXISTS ai_models boolean NOT NULL DEFAULT false;
ALTER TABLE devices ADD COLUMN IF NOT EXISTS ai_models boolean NOT NULL DEFAULT false;
@@ -1,7 +1,7 @@
@@ -1,7 +1,7 @@
-- phase: expand
-- phase: expand
-- Run sessions (contracts 0.223.0, the Desks plan's D6). A machine's owner may offer its desks to other people
-- Run sessions (contracts 0.223.0, the Desks plan's D6). A machine's owner may offer its desks to other people
+-- (shared_desks, off until they turn it on on openvibe.bot/machines; only where its OpenVibe Node runs every desk in its
+-- own sandbox, desk_isolation sandbox, Node v0.32.0). OpenVibe.Run leases one named desk per session there, or on the
-- person's own machine (bot.desk-lease@1): only that session's commands reach the desk, and the lease ends with it.
-- person's own machine (bot.desk-lease@1): only that session's commands reach the desk, and the lease ends with it.
ALTER TABLE devices ADD COLUMN IF NOT EXISTS shared_desks boolean NOT NULL DEFAULT false;
ALTER TABLE devices ADD COLUMN IF NOT EXISTS shared_desks boolean NOT NULL DEFAULT false;
@@ -1,7 +1,7 @@
@@ -1,7 +1,7 @@
-- phase: expand
-- phase: expand
-- What a machine's coding agents have left (Codes C9c, bot.device-message@1's heartbeat `fleet`): each agent's id,
-- What a machine's coding agents have left (Codes C9c, bot.device-message@1's heartbeat `fleet`): each agent's id,
-- whether it is installed and signed in, and each limit window's label, what it has used of its limit, and when it
-- whether it is installed and signed in, and each limit window's label, what it has used of its limit, and when it
+-- frees. Its OpenVibe.Node reads it with OpenVibe.Codes' own logins probe as the machine's user and reports labels,
-- numbers and times only: no key, token or account name. Bot keeps the latest reading per machine and when it stored
-- numbers and times only: no key, token or account name. Bot keeps the latest reading per machine and when it stored
-- it; a machine that stops beating keeps its last reading, and fleet_at says how old it is.
-- it; a machine that stops beating keeps its last reading, and fleet_at says how old it is.
ALTER TABLE devices ADD COLUMN IF NOT EXISTS fleet jsonb;
ALTER TABLE devices ADD COLUMN IF NOT EXISTS fleet jsonb;
@@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
-- phase: expand
-- phase: expand
-- Plan L34 (the machines hub): the roles a machine has for the network (the catalogue is Contracts 0.257.0's
-- Plan L34 (the machines hub): the roles a machine has for the network (the catalogue is Contracts 0.257.0's
-- machineRoles: codes.worker, desks.host, ai.host, bot.robot). The owner sets them on openvibe.network/machines and
-- machineRoles: codes.worker, desks.host, ai.host, bot.robot). The owner sets them on openvibe.network/machines and
+-- the Node reads them on its next check-in (the config frame carries them). A machine that never had a role has the
-- empty list, which is what the column starts with.
-- empty list, which is what the column starts with.
ALTER TABLE devices ADD COLUMN roles jsonb NOT NULL DEFAULT '[]'::jsonb;
ALTER TABLE devices ADD COLUMN roles jsonb NOT NULL DEFAULT '[]'::jsonb;
@@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
-- phase: expand
-- phase: expand
+-- The guided first run (OpenVibe.Node's `openvibe-node`, docs/install.md#first-run-guided-and-measured): one row per
+-- device and step, from the `node.first_run` telemetry events the Node sends over its existing device link. It powers
-- the machines page's figures for a machine's first job and the admin funnel (how many installs reach each step, and
-- the machines page's figures for a machine's first job and the admin funnel (how many installs reach each step, and
-- how long each took). The fields are an allowlist: no path, username or address is stored.
-- how long each took). The fields are an allowlist: no path, username or address is stored.
CREATE TABLE IF NOT EXISTS device_first_run (
CREATE TABLE IF NOT EXISTS device_first_run (