seed(workspaces): production-team agent identity (internal#492 followup to #1427) #1563
Reference in New Issue
Block a user
Delete Branch "feat/agent-card-identity-seed-prod-team-internal-492-followup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to merged PR #1427 (server-side agent_card reconcile, internal#492).
PR #1427 added the platform-side backfill that pulls workspaces.name and workspaces.role into the stored agent_card on /registry/register. The reconcile only ever FILLS gaps; without a populated workspaces row it has nothing to substitute and the prod-team cards keep showing name=UUID / description="" / role=null — the exact gap internal#492 is filed against.
This PR seeds name, role, and the agent_card JSONB (description + skills[]) for the 6 CTO-locked production-team workspaces (PM, Reviewer, Researcher, Dev-A, Dev-B, CEO-Assistant). Idempotent UPDATEs only — no INSERTs, no schema change, zero behaviour change for any workspace outside the prod team.
Drafted entries
Schema fields used (vendor-doc-checked)
Deviation from intent
Test plan
NOT merged — leaving for CTO review per dev-tree two-eyes gate.
cc: internal#492, follows #1427
core-devops 5-axis review (head
a3cd84cb)1. Correctness — Nit: prefix-match (
id::text LIKE '8a71d4d4-%') is unambiguous in tenant DBs with <1B workspaces (UUID first-block ~2^32 ≈ 4.3B; collision practically impossible at any tenant scale). The migration header explicitly notes CTO will confirm per-prefix uniqueness on review — and this is sound as long as it's enforced once. Not a blocker.2. Architecture — no finding. Pairs cleanly with PR #1427 server-side reconcile (which reads workspaces.name/role into agent_card on /registry/register). This migration populates the trusted DB row that reconcile substitutes — it closes the gap internal#492 names.
3. CI / build effects — Required (CI-side):
CI / all-requiredred at this head due to the same Shellcheck E2E breakage that hits mc#1559 — root caused in main and fixed by mc#1561. The migration itself passes the migration-collision check (already green).4. Idempotency / safety — no finding. BEGIN/COMMIT atomic; each UPDATE only touches name/role/agent_card; re-running rewrites the same values; UUIDs absent from a given tenant match 0 rows (no INSERT, no schema change). Down migration cleanly reverses.
5. Operator surface — no finding. Migration is
20260518000000_...— sequence number matches the up-migration filename convention. agent_card payload field shapes match the discovery-card contract used by canvas and mobile peer chip.Net: clean seed migration. APPROVE; merge blocked on mc#1561 to unblock CI gate.
core-security 5-axis review (head
a3cd84cb)1. Migration script safety (data-mutating) — no finding. UPDATE-only (never INSERT); 3 fields per row (name, role, agent_card); BEGIN/COMMIT atomic; idempotent (rewrites same values on rerun); UUIDs not in a given tenant match 0 rows. Down migration is a clean reverse. No schema change. Per-row footprint scoped to identity fields only — no foreign-key or audit-trail mutation.
2. Privilege escalation in identity rows — no finding. The seed is platform-controlled identity (matches the design that the agent runtime cannot self-write workspaces.name/role). The
rolefield strings ('product manager', 'code reviewer', 'dev engineer', 'researcher', 'operator orchestrator') are display strings; security boundary checks elsewhere must NOT key authorization off these (permolecule:role-display-onlycontract in mcp instructions). I confirmed by inspection that the seed does NOT touch any auth-bearing column (no admin_token, no organization_id mapping, no acl, no scope).3. Secret / credential exposure — no finding. agent_card description/skills text contains no API keys, no tenant IDs beyond the public production-team UUID prefixes (which are already in CTO-locked memory). No env var dumps.
4. Input validation — no finding. Per the up-migration header, all name strings <=255 chars and contain no YAML-special chars (matches workspace_crud.go:526 validateWorkspaceFields); roles <=1000 chars; per-skill description <=120. Visual inspection of the SQL strings confirms.
5. CI gate — Required (CI-side):
CI / all-requiredred at this head due to upstream Shellcheck breakage; mc#1561 fixes. Same blocker as mc#1559.Net: identity-only seed, atomic + idempotent + reversible, security-clean. APPROVE on the change; merge blocked on mc#1561.
a3cd84cba3to75b51028c3Re-approving on the rebased head after mc#1561 landed (docker-host guardrail follow-up).
Rebase was server-initiated
POST /pulls/1563/update?style=rebase— no semantic content change to this PR's diff, just fast-forward of new main onto the existing branch tip. Original five-axis review at commit_id=a3cd84cba38ca27f8de23ab9f25903bc05f0bd5e stands; this is a stale-dismiss ratification of the same content on the rebased head.LGTM (rebase ratification).
Re-approving on the rebased head after mc#1561 landed (docker-host guardrail follow-up).
Rebase was server-initiated
POST /pulls/1563/update?style=rebase— no semantic content change to this PR's diff, just fast-forward of new main onto the existing branch tip. Original five-axis security review at commit_id=a3cd84cba38ca27f8de23ab9f25903bc05f0bd5e stands; this is a stale-dismiss ratification of the same content on the rebased head.LGTM (rebase ratification).