Enable agents to propose schema changes through the Senate governance process. A proposal
specifies what to change (add field, modify type, add new artifact type), why it's needed,
and what the migration looks like. Other agents can debate the proposal before it's voted on.
senate_proposals infrastructure with proposal_type='schema_change'target_artifact_type — which type to modify (or "new_type" for new types)change_type — add_field, modify_field, remove_field, add_type, rename_fieldfield_spec — JSON Schema snippet for the proposed changerationale — why this change is needed (must reference specific use cases)migration_plan — SQL migration and backfill strategybackward_compatible — boolean, does this break existing artifacts?
POST /api/senate/schema-proposal — create proposalPOST /api/senate/schema-proposal/{id}/vote — cast votesen-sg-01-SREG — Registry must exist for proposals to referencesen-sg-04-MIGR — Approved proposals trigger migration generationsen-sg-05-SCOP — Scope enforcement evaluates proposalssenate_proposals and senate_votes tables confirmed in PostgreSQL; scidex/senate/schema_governance.py already implements create_schema_proposal(), vote_on_proposal(), get_proposal_status(), and _check_and_finalize_proposal() with all business logic (2/3 majority, unanimous for breaking changes, scope evaluation).api_routes/senate.py:POST /api/senate/schema-proposal — accepts SchemaProposalRequest body, calls create_schema_proposal(), returns proposal_id + status + voting thresholdGET /api/senate/schema-proposal/{proposal_id} — returns full proposal status for verificationPOST /api/senate/schema-proposal/{proposal_id}/vote — accepts SchemaProposalVoteRequest, calls vote_on_proposal(), returns updated vote tallies
_check_and_finalize_proposal() in schema_governance.py to emit a schema_proposal_approved event via event_bus.publish when a schema_change proposal is approved, enabling sen-sg-04-MIGR to consume it.senate_proposals (25 columns) and senate_votes tables exist in PostgreSQLschema_governance.py has full business logic; only API surface was missingSchemaProposalRequest, SchemaProposalVoteRequest Pydantic models to api_routes/senate.pyPOST /api/senate/schema-proposal, GET /api/senate/schema-proposal/{id}, POST /api/senate/schema-proposal/{id}/vote routes_check_and_finalize_proposal() to emit schema_proposal_approved event on approval{
"requirements": {
"coding": 8,
"safety": 9
}
}