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
122 lines
3.8 KiB
Python
122 lines
3.8 KiB
Python
# #region SettingsSchemas [C:3] [TYPE Module] [SEMANTICS pydantic, schema, validate, notification-channel]
|
|
# @defgroup Schemas Module group.
|
|
# @BRIEF Pydantic schemas for application settings and automation policies.
|
|
# @LAYER Domain
|
|
# @RELATION DEPENDS_ON -> [EXT:Library:pydantic]
|
|
|
|
from datetime import datetime, time
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
# #region NotificationChannel [TYPE Class]
|
|
# @defgroup Schemas Module group.
|
|
# @BRIEF Structured notification channel definition for policy-level custom routing.
|
|
class NotificationChannel(BaseModel):
|
|
type: str = Field(
|
|
..., description="Notification channel type (e.g., SLACK, SMTP, TELEGRAM)"
|
|
)
|
|
target: str = Field(
|
|
..., description="Notification destination (e.g., #alerts, chat id, email)"
|
|
)
|
|
|
|
|
|
# #endregion NotificationChannel
|
|
|
|
|
|
# #region ValidationPolicyBase [TYPE Class]
|
|
# @defgroup Schemas Module group.
|
|
# @BRIEF Base schema for validation policy data.
|
|
class ValidationPolicyBase(BaseModel):
|
|
name: str = Field(..., description="Name of the policy")
|
|
environment_id: str = Field(..., description="Target Superset environment ID")
|
|
is_active: bool = Field(True, description="Whether the policy is currently active")
|
|
dashboard_ids: list[str] = Field(
|
|
..., description="List of dashboard IDs to validate"
|
|
)
|
|
schedule_days: list[int] = Field(
|
|
..., description="Days of the week (0-6, 0=Sunday) to run"
|
|
)
|
|
window_start: time = Field(..., description="Start of the execution window")
|
|
window_end: time = Field(..., description="End of the execution window")
|
|
notify_owners: bool = Field(
|
|
True, description="Whether to notify dashboard owners on failure"
|
|
)
|
|
custom_channels: list[NotificationChannel] | None = Field(
|
|
None,
|
|
description="List of additional structured notification channels",
|
|
)
|
|
alert_condition: str = Field(
|
|
"FAIL_ONLY",
|
|
description="Condition to trigger alerts: FAIL_ONLY, WARN_AND_FAIL, ALWAYS",
|
|
)
|
|
|
|
|
|
# #endregion ValidationPolicyBase
|
|
|
|
|
|
# #region ValidationPolicyCreate [TYPE Class]
|
|
# @defgroup Schemas Module group.
|
|
# @BRIEF Schema for creating a new validation policy.
|
|
class ValidationPolicyCreate(ValidationPolicyBase):
|
|
pass
|
|
|
|
|
|
# #endregion ValidationPolicyCreate
|
|
|
|
|
|
# #region ValidationPolicyUpdate [TYPE Class]
|
|
# @defgroup Schemas Module group.
|
|
# @BRIEF Schema for updating an existing validation policy.
|
|
class ValidationPolicyUpdate(BaseModel):
|
|
name: str | None = None
|
|
environment_id: str | None = None
|
|
is_active: bool | None = None
|
|
dashboard_ids: list[str] | None = None
|
|
schedule_days: list[int] | None = None
|
|
window_start: time | None = None
|
|
window_end: time | None = None
|
|
notify_owners: bool | None = None
|
|
custom_channels: list[NotificationChannel] | None = None
|
|
alert_condition: str | None = None
|
|
|
|
|
|
# #endregion ValidationPolicyUpdate
|
|
|
|
|
|
# #region ValidationPolicyResponse [TYPE Class]
|
|
# @defgroup Schemas Module group.
|
|
# @BRIEF Schema for validation policy response data.
|
|
class ValidationPolicyResponse(ValidationPolicyBase):
|
|
id: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
# #endregion ValidationPolicyResponse
|
|
|
|
|
|
# #region TranslationScheduleItem [C:1] [TYPE Class]
|
|
# @BRIEF Response schema for a translation schedule item with joined job name.
|
|
class TranslationScheduleItem(BaseModel):
|
|
schedule_id: str
|
|
job_id: str
|
|
job_name: str | None = None
|
|
cron_expression: str
|
|
timezone: str
|
|
is_active: bool
|
|
execution_mode: str = "full"
|
|
last_run_at: datetime | None = None
|
|
next_run_at: datetime | None = None
|
|
created_by: str | None = None
|
|
created_at: datetime | None = None
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
# #endregion TranslationScheduleItem
|
|
|
|
# #endregion SettingsSchemas
|