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
65 lines
1.9 KiB
Python
Executable File
65 lines
1.9 KiB
Python
Executable File
# #region ApiRoutesModule [C:5] [TYPE Module] [SEMANTICS api, package, router, lazy, import]
|
|
# @defgroup Api Module group.
|
|
# @BRIEF Provide lazy route module loading to avoid heavyweight imports during tests.
|
|
# @LAYER API
|
|
# @RELATION CALLS -> [ApiRoutesGetAttr]
|
|
# @RELATION BINDS_TO -> [Route_Group_Contracts]
|
|
# @PRE FastAPI app initialized, route modules available in package
|
|
# @POST Route modules are lazily loadable via __getattr__
|
|
# @INVARIANT Only names listed in __all__ are importable via __getattr__.
|
|
|
|
# #region Route_Group_Contracts [C:3] [TYPE Block]
|
|
# @ingroup Api
|
|
# @BRIEF Declare the canonical route-module registry used by lazy imports and app router inclusion.
|
|
# @RELATION DEPENDS_ON -> [PluginsRouter]
|
|
# @RELATION DEPENDS_ON -> [TasksRouter]
|
|
# @RELATION DEPENDS_ON -> [SettingsRouter]
|
|
# @RELATION DEPENDS_ON -> [ReportsRouter]
|
|
# @RELATION DEPENDS_ON -> [LlmRoutes]
|
|
# @SIDE_EFFECT Registers route group imports via __getattr__
|
|
# @DATA_CONTRACT Package -> RouterModule mapping
|
|
__all__ = [
|
|
"admin",
|
|
"admin_api_keys",
|
|
"assistant",
|
|
"clean_release",
|
|
"clean_release_v2",
|
|
"dashboards",
|
|
"dataset_review",
|
|
"datasets",
|
|
"environments",
|
|
"git",
|
|
"health",
|
|
"llm",
|
|
"maintenance",
|
|
"mappings",
|
|
"migration",
|
|
"plugins",
|
|
"profile",
|
|
"reports",
|
|
"settings",
|
|
"storage",
|
|
"tasks",
|
|
"translate",
|
|
"validation_tasks",
|
|
]
|
|
# #endregion Route_Group_Contracts
|
|
|
|
|
|
# #region ApiRoutesGetAttr [C:3] [TYPE Function]
|
|
# @ingroup Api
|
|
# @BRIEF Lazily import route module by attribute name.
|
|
# @RELATION DEPENDS_ON -> [ApiRoutesModule]
|
|
# @PRE name is module candidate exposed in __all__.
|
|
# @POST Returns imported submodule or raises AttributeError.
|
|
def __getattr__(name):
|
|
if name in __all__:
|
|
import importlib
|
|
|
|
return importlib.import_module(f".{name}", __name__)
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
|
|
|
|
# #endregion ApiRoutesGetAttr
|
|
# #endregion ApiRoutesModule
|