semantics: complete DEF-to-region migration, fix regressions
- Convert legacy [DEF🆔Type] anchors to #region/#endregion across 329 files
- Reinstate _normalize_timestamp_value in sql_generator.py
- Fix MarkerLogger→logger migration in events.py (molecular CoT markers)
- Fix dataset_review orchestrator dependencies (_build_execution_snapshot)
- Fix config_manager stale-record deletion (moved to save path only)
- Add 77 missing [/DEF:] closers in 5 unbalanced test files
- Update assistant_chat.integration.test.js for #region format
- Apply molecular-cot-logging markers (REASON/REFLECT/EXPLORE) via logger.* methods
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
# #region SeedPermissionsScript [C:3] [TYPE Module] [SEMANTICS setup, database, auth, permissions, seeding]
|
||||
#
|
||||
# @BRIEF Populates the auth database with initial system permissions.
|
||||
# @LAYER Scripts
|
||||
# @INVARIANT Safe to run multiple times (idempotent).
|
||||
# @RELATION DEPENDS_ON -> [AuthSessionLocal]
|
||||
# @RELATION DEPENDS_ON -> [Permission]
|
||||
# @RELATION DEPENDS_ON -> [Role]
|
||||
# @RELATION DEPENDS_ON -> [AuthRepository]
|
||||
#
|
||||
# @LAYER: Scripts
|
||||
# @RELATION DEPENDS_ON -> AuthSessionLocal
|
||||
# @RELATION DEPENDS_ON -> Permission
|
||||
# @RELATION DEPENDS_ON -> Role
|
||||
# @RELATION DEPENDS_ON -> AuthRepository
|
||||
#
|
||||
# @INVARIANT: Safe to run multiple times (idempotent).
|
||||
|
||||
# [SECTION: IMPORTS]
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -20,11 +19,10 @@ from src.core.database import AuthSessionLocal
|
||||
from src.models.auth import Permission, Role
|
||||
from src.core.auth.repository import AuthRepository
|
||||
from src.core.logger import logger, belief_scope
|
||||
# [/SECTION]
|
||||
|
||||
# #region INITIAL_PERMISSIONS [C:3] [TYPE Constant]
|
||||
# @BRIEF Canonical bootstrap permission tuples seeded into auth storage.
|
||||
# @RELATION DEPENDS_ON -> [SeedPermissionsScript]
|
||||
# @RELATION DEPENDS_ON -> SeedPermissionsScript
|
||||
INITIAL_PERMISSIONS = [
|
||||
# Admin Permissions
|
||||
{"resource": "admin:users", "action": "READ"},
|
||||
@@ -61,12 +59,12 @@ INITIAL_PERMISSIONS = [
|
||||
|
||||
# #region seed_permissions [C:3] [TYPE Function]
|
||||
# @BRIEF Inserts missing permissions into the database.
|
||||
# @POST All INITIAL_PERMISSIONS exist in the DB.
|
||||
# @RELATION DEPENDS_ON -> [AuthSessionLocal]
|
||||
# @RELATION DEPENDS_ON -> [Permission]
|
||||
# @RELATION DEPENDS_ON -> [Role]
|
||||
# @RELATION DEPENDS_ON -> [AuthRepository]
|
||||
# @RELATION DEPENDS_ON -> [INITIAL_PERMISSIONS]
|
||||
# @POST: All INITIAL_PERMISSIONS exist in the DB.
|
||||
# @RELATION DEPENDS_ON -> AuthSessionLocal
|
||||
# @RELATION DEPENDS_ON -> Permission
|
||||
# @RELATION DEPENDS_ON -> Role
|
||||
# @RELATION DEPENDS_ON -> AuthRepository
|
||||
# @RELATION DEPENDS_ON -> INITIAL_PERMISSIONS
|
||||
def seed_permissions():
|
||||
with belief_scope("seed_permissions"):
|
||||
db = AuthSessionLocal()
|
||||
|
||||
Reference in New Issue
Block a user