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,14 +1,13 @@
|
||||
# #region CreateAdminScript [C:3] [TYPE Module] [SEMANTICS admin, setup, user, auth, cli]
|
||||
#
|
||||
# @BRIEF CLI tool for creating the initial admin user.
|
||||
# @LAYER Scripts
|
||||
# @INVARIANT Admin user must have the "Admin" role.
|
||||
# @LAYER: Scripts
|
||||
# @RELATION USES -> [AuthSecurityModule]
|
||||
# @RELATION USES -> [DatabaseModule]
|
||||
# @RELATION USES -> [AuthModels]
|
||||
#
|
||||
#
|
||||
# @INVARIANT: Admin user must have the "Admin" role.
|
||||
|
||||
# [SECTION: IMPORTS]
|
||||
import sys
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
@@ -20,17 +19,13 @@ from src.core.database import AuthSessionLocal, init_db
|
||||
from src.core.auth.security import get_password_hash
|
||||
from src.models.auth import User, Role
|
||||
from src.core.logger import logger, belief_scope
|
||||
# [/SECTION]
|
||||
|
||||
|
||||
# #region create_admin [TYPE Function]
|
||||
# @BRIEF Creates an admin user and necessary roles/permissions.
|
||||
# @PRE username and password provided via CLI.
|
||||
# @POST Admin user exists in auth.db.
|
||||
# @PRE: username and password provided via CLI.
|
||||
# @POST: Admin user exists in auth.db.
|
||||
#
|
||||
# @PARAM: username (str) - Admin username.
|
||||
# @PARAM: password (str) - Admin password.
|
||||
# @PARAM: email (str | None) - Optional admin email.
|
||||
def create_admin(username, password, email=None):
|
||||
with belief_scope("create_admin"):
|
||||
db = AuthSessionLocal()
|
||||
|
||||
Reference in New Issue
Block a user