Core changes: - Add @defgroup/@ingroup to 1791 C2+ contracts (555 files) for HCA 128× pre-training DSA grouping - Add §0.1 Pre-Training Frequency matrix to semantics-core - Add §VIII Attention Architecture rules (ATTN_1-4) with MLA/CSA/HCA/DSA mechanics - Add @defgroup/@ingroup to canonical syntax (§II) and all contract examples Agent prompts (5 files): - Add ZERO-STATE RATIONALE with MLA/CSA/HCA/DSA compression mechanics - Add pre-training note: @RATIONALE/@REJECTED are in-context learned tags - svelte-coder: add missing #region contract, fix Svelte rule violations - python-coder/fullstack-coder: honor function contracts from speckit plan - qa-tester: add attention compliance audit (P3 ATTN_1-4 checks) Skills (6 files): - Translate all axiom_config descriptions to English - Fix doc_dirs to index .opencode/ and .specify/ - Deduplicate 5× complexity_rules → single global_tags catalog - Reduce semantics-svelte 591→485 lines (remove duplicate code blocks) - Fix semantics-testing: 'Short IDs' → 'Short hierarchical IDs' - Fix all examples: flat IDs → hierarchical Domain.Name format - Fix Svelte examples: replace raw Tailwind + <button> with semantic tokens + /ui Speckit workflow (commands + templates): - speckit.plan: add Function-Level Contracts for C3+ with @PRE/@POST/@TEST_EDGE - speckit.plan: add Attention Compliance Gate (ATTN_1-4 before contract generation) - speckit.tasks: add function contract inlining format (constraints in task description) - speckit.specify: load semantics-core for spec density rules - spec-template: add #region contract, @SEMANTICS grouping, hierarchical IDs - ux-reference-template: add #region wrapper - plan-template: add attention gate, @defgroup/@ingroup guidance - tasks-template: add attention audit + rebuild + orphan check tasks - constitution.md: translate to English, add Principle VIII (attention-optimized contracts) Reference modules rewritten (hierarchical IDs + full contracts): - Auth.Jwt: 6 child contracts with @RATIONALE/@REJECTED/@TEST_EDGE - Api.Auth: 5 endpoints with @TEST_EDGE + molecular CoT markers - Migration.Model: @defgroup Migration with 18 @ACTION + 6 @INVARIANT Scripts: - add_defgroup_ingroup.py: zero-risk additive @ingroup migration (1791 insertions) - migrate_hierarchical.py: flat→hierarchical ID dry-run analysis (792 contracts) - merge_prompts.py: merge all prompts/skills/commands into one review file Config: - axiom_config.yaml: 749→395 lines (-47%), English, doc_dirs include prompts - Fix test_datasets.py import collision (rename → test_datasets_routes.py) - Fix test_preview.py: SupersetClient→get_superset_client, AsyncMock, logger f-string
71 lines
2.5 KiB
Python
71 lines
2.5 KiB
Python
# #region GitModels [TYPE Module] [SEMANTICS sqlalchemy, git, model, config, sync]
|
|
# @defgroup Models Module group.
|
|
|
|
from datetime import UTC, datetime
|
|
import enum
|
|
import uuid
|
|
|
|
from sqlalchemy import Boolean, Column, DateTime, Enum, ForeignKey, Integer, String
|
|
|
|
from src.core.database import Base
|
|
|
|
|
|
class GitProvider(str, enum.Enum):
|
|
GITHUB = "GITHUB"
|
|
GITLAB = "GITLAB"
|
|
GITEA = "GITEA"
|
|
|
|
class GitStatus(str, enum.Enum):
|
|
CONNECTED = "CONNECTED"
|
|
FAILED = "FAILED"
|
|
UNKNOWN = "UNKNOWN"
|
|
|
|
class SyncStatus(str, enum.Enum):
|
|
CLEAN = "CLEAN"
|
|
DIRTY = "DIRTY"
|
|
CONFLICT = "CONFLICT"
|
|
|
|
# #region GitServerConfig [C:1] [TYPE Class]
|
|
# @BRIEF Configuration for a Git server connection.
|
|
class GitServerConfig(Base):
|
|
__tablename__ = "git_server_configs"
|
|
|
|
id = Column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
|
|
name = Column(String(255), nullable=False)
|
|
provider = Column(Enum(GitProvider), nullable=False)
|
|
url = Column(String(255), nullable=False)
|
|
pat = Column(String(255), nullable=False) # PERSONAL ACCESS TOKEN
|
|
default_repository = Column(String(255), nullable=True)
|
|
default_branch = Column(String(255), default="main")
|
|
status = Column(Enum(GitStatus), default=GitStatus.UNKNOWN)
|
|
last_validated = Column(DateTime, default=lambda: datetime.now(UTC))
|
|
# #endregion GitServerConfig
|
|
|
|
# #region GitRepository [C:1] [TYPE Class]
|
|
# @BRIEF Tracking for a local Git repository linked to a dashboard.
|
|
class GitRepository(Base):
|
|
__tablename__ = "git_repositories"
|
|
|
|
id = Column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
|
|
dashboard_id = Column(Integer, nullable=False, unique=True)
|
|
config_id = Column(String(36), ForeignKey("git_server_configs.id"), nullable=False)
|
|
remote_url = Column(String(255), nullable=False)
|
|
local_path = Column(String(255), nullable=False)
|
|
current_branch = Column(String(255), default="dev")
|
|
sync_status = Column(Enum(SyncStatus), default=SyncStatus.CLEAN)
|
|
# #endregion GitRepository
|
|
|
|
# #region DeploymentEnvironment [C:1] [TYPE Class]
|
|
# @BRIEF Target Superset environments for dashboard deployment.
|
|
class DeploymentEnvironment(Base):
|
|
__tablename__ = "deployment_environments"
|
|
|
|
id = Column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
|
|
name = Column(String(255), nullable=False)
|
|
superset_url = Column(String(255), nullable=False)
|
|
superset_token = Column(String(255), nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
# #endregion DeploymentEnvironment
|
|
|
|
# #endregion GitModels
|