Establish system identity before the multi-instance account bootstrap
ci / svc-realcombo (pull_request) Successful in 2m18s
ci / test (pull_request) Successful in 5m51s
ci / test-pg (pull_request) Successful in 8m48s

Why: bootstrap-admin now refuses a database that has no agent_system_identity row, and serve does not insert one.
Evidence: Dev CI run 3266 job 5008 failed with system identity missing on 7eef723.
Impact: test setup only.
Refs: Agent-System-Dev pulls/558
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-15 02:33:08 +00:00
co-authored by Cursor
parent 7eef72323b
commit b97d6cd60b
@@ -438,6 +438,8 @@ func (e *env) killNine(t *testing.T, inst *instance) {
// alice 发放激活凭据。凭据兑换后设置 alicePass,然后才能发 API Key。 // alice 发放激活凭据。凭据兑换后设置 alicePass,然后才能发 API Key。
func (e *env) loginAlice(t *testing.T) *userClient { func (e *env) loginAlice(t *testing.T) *userClient {
t.Helper() t.Helper()
// 账户事务会锁库内服务身份;serve 不补写这行,须先显式建立。
e.cli(t, "identity", "ensure", "--dsn", e.dbDSN, "--instance-id", "mi-acceptance", "--dbref", "pg")
e.cli(t, "user", "bootstrap-admin", "--dsn", e.dbDSN, "--owner", "mi_setup", "--name", "Setup", e.cli(t, "user", "bootstrap-admin", "--dsn", e.dbDSN, "--owner", "mi_setup", "--name", "Setup",
"--out-file", filepath.Join(t.TempDir(), "setup-grant")) "--out-file", filepath.Join(t.TempDir(), "setup-grant"))
grantFile := filepath.Join(t.TempDir(), "alice-grant") grantFile := filepath.Join(t.TempDir(), "alice-grant")