Repository navigation
feat(chat): store an Admin's go-live switch and each agent's go-live permission (00443) - #1967
Merged
Merged
Conversation
…permission AUTONOMOUS-GO-LIVE PR 1 (migration 00443), with nothing reading it yet: chat_settings gains the workspace switch (auto_go_live_groups, who turned it on, when, under which terms); chat_agent_go_live keeps an agent's permission for the version it was given on, with its daily limit (1-20, 5 unless set); chat_agent_go_live_events keeps each step an agent takes live on its own, read by brand access. reserve_agent_go_live and finish_agent_go_live (service role) hold the daily limit under a lock per agent, once per (draft, target); a failed step frees its slot. Types, schema.sql, and the brand-access and demo coverage lists follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 1, 2026
Merged
# Conflicts: # server/src/lib/brand-access-policies.test.js # supabase/schema.sql
8 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AUTONOMOUS-GO-LIVE PR 1: stores an Admin's go-live switch and each agent's go-live permission, with the ledger that holds an agent's daily limit. Migration 00443. Nothing reads it yet, so nothing changes: the precedence's exception comes in PR 5, behind
CHAT_AUTO_GO_LIVE.What changes (00443)
chat_settingsgains the workspace switch:auto_go_live_groups(the four go-live groups, distinct, asmanager_execute_off);auto_go_live_by,auto_go_live_at,auto_go_live_terms(the version of the responsibility text);auto_go_live_at.chat_agent_go_live: one row per allowed agent.agent_id in chat_agents). The server writes it.chat_agent_go_live_events: each step an agent takes live on its own (CMS draft, publish, webhook).reserved→done/failed, latertaken_down.user_brand_ids().reserve_agent_go_livetakes a slot underpg_advisory_xact_lockper agent. It counts the last 24 hours' reserved, done and taken-down steps once per (draft, target). A (draft, target) already counted returns its row. It answers null when the agent is full.finish_agent_go_livemarks a stepdoneorfailed; a failed step frees its slot.schema.sql.brand-access-policies:chat_agent_go_liveis DEFERRED to BRAND-ACCESS PR 9 with the other agent tables.parseChatSettingsreads the new columns in PR 5, with the precedence step. Reading them here would break Chat before the migration runs.Related issue
None. AUTONOMOUS-GO-LIVE spec, PR 1.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
bash supabase/build-schema.sh:schema.sqlmatches.brand-access-policies,brand-access-schema,demo/coverageandwrite-guardpass.select reserve_agent_go_live(...)five times for one agent with five drafts gives five ids. A sixth gives null. The same draft and target again returns its row.finish_agent_go_live(id, 'failed')frees a slot.No visible change, no Help article.
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (983b86a), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41355931759): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code