658348f208
Adds rulebooks.always_on (migration 0058) and a new list_always_on_rules MCP tool so a session-start eager pull can fetch standing rules without needing an active-project notion. Updates _INSTRUCTIONS so Claude calls the new tool at session start and codifies engineering rules in Scribe rather than CLAUDE.md / auto-memory. Seeds FabledSword family rulebook to always_on=true on migrate, matching its design role as the cross-project standards rulebook. Frontend: badge in RulebookListPane for always-on rulebooks; toggle in RulebookDetailPane header bound to a new toggleAlwaysOn store action. This is S1+S2 of the rules-consolidation plan (Scribe task #508). S3 (project-scoped rules) and S4 (enter_project handshake) follow. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
40 lines
962 B
Python
40 lines
962 B
Python
"""rulebook always_on flag
|
|
|
|
Revision ID: 0058
|
|
Revises: 0057
|
|
Create Date: 2026-06-01
|
|
|
|
Adds a boolean `always_on` to the `rulebooks` table. Rules from rulebooks
|
|
flagged always_on are loaded at session start by the new
|
|
`list_always_on_rules` MCP tool — they apply regardless of which project
|
|
(if any) is in scope. Seeds the FabledSword family rulebook to always_on
|
|
because that's the cross-project standards rulebook by design.
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "0058"
|
|
down_revision = "0057"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"rulebooks",
|
|
sa.Column(
|
|
"always_on",
|
|
sa.Boolean(),
|
|
nullable=False,
|
|
server_default=sa.text("false"),
|
|
),
|
|
)
|
|
op.execute(
|
|
"UPDATE rulebooks SET always_on = TRUE WHERE title = 'FabledSword family'"
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("rulebooks", "always_on")
|