Skip to content

feat(roles): collaborator is a role people can be onboarded with - #525

Open
nadernik wants to merge 1 commit into
devfrom
fix/collaborator-role
Open

nadernik wants to merge 1 commit into
devfrom
fix/collaborator-role

Conversation

@nadernik

Copy link
Copy Markdown
Collaborator

Decision (nadernik, 2026-11-19): collaborator is a role for people onboarded without another role: someone who isn't on the award, or isn't in the awardee lab.

What was wrong. normalize_grant_role has stored the token since 20261118140000, which was applied from #520. But onboard_member normalises roles with its own CASE and sends anything it doesn't list to research_staff. So onboarding a collaborator through MCP or the admin console stored research_staff, with no error.

What changes:

  • 20261118140000_role_vocabulary_collaborator.sql is feat(kg): read-only MCP server over the exported graph #520's file, committed unchanged because it's live in production. The parity guard reads the latest normalize_grant_role, so it needs the file here.
  • 20261119170000_onboard_collaborator.sql adds one line to each of two functions:
    • onboard_member keeps collaborator.
    • role_label_from_token('collaborator') returns Collaborator, so a new collaborator's investigators.role label isn't left empty.
    • Both bodies are 20260811120000's plus that one line. The live bodies match it (compared, ignoring comments and spacing).
    • The script stops if either live body has changed since. It can be run twice.
  • Graph: project_role_enum (with a description) and shape Test issue from Lovable #4 gain the token. bbqs.owl.ttl and bbqs.shapes.gen.ttl are edited by hand to match, because the local LinkML environment is broken. CI's --check-generated regenerates both and compares them.
  • Onboarding: the admin dialog offers Collaborator, and bbqs-mcp's onboard_member role help lists it. That help text only goes live with a deploy of bbqs-mcp.
  • tests/guards/onboard-role-parity checks two things. onboard_member's role CASE must equal normalize_grant_role's tokens, and every role in the onboarding dialog and the roster editor must be one the roster accepts. It fails without 20261119170000. Locally, all 104 guards and tsc pass.

Groups: sync-member-groups gives a collaborator consortium@ and their working groups. They don't get pi@, young-investigators@ or dcaic-all@.

To apply: SQL editor, project vpexxhfpvghlejljwpvt. The last statement should show label = Collaborator and onboard_keeps_token = true.

Refs #496, #520

A collaborator is someone onboarded without another role: not on the award, or not in the
awardee lab (nadernik, 2026-11-19). normalize_grant_role stores the token since 20261118140000,
applied from #520 and committed here as applied. onboard_member still sent any role it didn't
list to research_staff, so onboarding a collaborator stored research_staff.

- 20261119170000: onboard_member keeps 'collaborator'; role_label_from_token gives 'Collaborator'.
- KG: project_role_enum and shape #4 gain the token; OWL/SHACL updated to match.
- The admin onboarding dialog and bbqs-mcp's onboard_member help offer it.
- tests/guards/onboard-role-parity: onboard_member's role CASE equals normalize_grant_role's
  tokens, and every role menu sends a role the roster accepts. Fails without 20261119170000.

Refs #496, #520
@github-actions github-actions Bot added the spec:C Danger layer — Spec Kit + sign-off required label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Triage: Class C → spec:C

Touches a danger layer. Requires Spec Kit artifacts (spec/plan/tasks/qa-itinerary), a Constitution Check, and human sign-off. Never auto-merges.

Blast radius: HIGH

  • migration: Schema/RLS/view migration — applied MANUALLY to production and hard to reverse. RLS policy and CREATE OR REPLACE VIEW changes live here too.
  • triage-gate: The gate itself (classifier or guard suite). A change that could weaken the gate must never pass through the gate automatically.

Complexity: HIGH

  • 9 files changed (> 4).
  • 426 lines changed (> 80).
  • 4 new files (> 2).

Files that set the class:

  • supabase/functions/bbqs-mcp/index.ts → edge-function (soft)
  • supabase/migrations/20261118140000_role_vocabulary_collaborator.sql → migration (hard)
  • supabase/migrations/20261119170000_onboard_collaborator.sql → migration (hard)
  • tests/guards/onboard-role-parity.test.mjs → triage-gate (hard)

Deterministic classifier — computed from the diff, not from the issue text. Change the rules in scripts/triage/classify.mjs (itself a Class-C path).

@github-actions

Copy link
Copy Markdown
Contributor

🛑 Class C — this touches a danger layer

Per the constitution (Development Workflow) danger-layer changes are spec-driven. Before this can merge, a maintainer must:

  1. Create the Spec Kit artifacts in bbqs-agent/specs/<NNN-feature>/ — spec.md, plan.md (with a Constitution Check), tasks.md, qa-itinerary.md.
  2. Point bbqs-agent/.specify/feature.json at that directory.
  3. Run the Find → Fix → Test → Verify-Live loop, incl. the sandbox QA workflow.
  4. Add the spec-signoff label to this PR to release the triage/spec-gate check.

This gate is here because a small-looking diff to supabase/functions/bbqs-mcp/index.ts reaches far beyond the file it edits.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec:C Danger layer — Spec Kit + sign-off required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant