Skip to content

Commit 426ada6

Browse files
committed
refactor(imports): #1438 burn-down wave — hoist 20 deferred dazzle.core.* imports
Hoisted function-level dazzle.core.* imports to module top across 8 non-core files (worker, agent_commands/renderer, fuzzer/oracle, template_compiler, integration_manager, subsystems/channels, investigator/tools_read, cli/ux_interactions). dazzle.core is the bottom layer (import-linter-enforced core ↛ http/page), so these can't cycle, and none of the hoisted names are source-patched in tests (the #1438 test-coupling trap) — verified by the full non-e2e suite (18773 passed; the 4 failures are pre-existing test-order pollution: alembic_env_url + fuzzer_oracle, both pass isolated). Dead try/except ImportError guards around always-present core modules dropped. Ratchet baseline lowered 1699 → 1679. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6470363 commit 426ada6

16 files changed

Lines changed: 35 additions & 53 deletions

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,4 @@ Example: `examples/ops_dashboard` has working `bar_chart` (FK `group_by: system`
374374
- **KG re-seeding**: `ensure_seeded()` checks a version key; bump it in `seed.py` when TOML data changes.
375375

376376
---
377-
**Version**: 0.86.1 | **Python**: 3.12+ | **Status**: Production Ready
377+
**Version**: 0.86.2 | **Python**: 3.12+ | **Status**: Production Ready

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12-
## [0.86.1] - 2026-06-24
12+
## [0.86.2] - 2026-06-24
13+
14+
### Changed
15+
- **#1438 deferred-import burn-down (wave): hoisted 20 function-level `dazzle.core.*` imports to module top across 8 non-core files** (`process/worker`, `services/agent_commands/renderer`, `testing/fuzzer/oracle`, `page/converters/template_compiler`, `http/runtime/integration_manager`, `http/runtime/subsystems/channels`, `fitness/investigator/tools_read`, `cli/ux_interactions`). `dazzle.core` is the bottom layer (import-linter-enforced `core ↛ http/page`), so these can't cause an import cycle, and none of the hoisted names are source-patched in tests (the #1438 test-coupling trap) — verified by the full suite. Dead `try/except ImportError` guards around always-present core modules were dropped. Ratchet baseline lowered 1699 → 1679 (`deferred_imports_baseline.json`).
1316

1417
### Fixed
1518
- **#1464 (follow-up) engine baseline emitted composite FKs BEFORE the UNIQUE constraints they reference → `db upgrade` failed.** The v0.86.0 composite-constraint fix emitted ops in sorted-table order, so a composite FK `(tenant_id, fk) → Parent(tenant_id, id)` on a child that sorts *before* its parent was created before the parent's `UNIQUE(tenant_id, id)` existed — `psycopg.errors.InvalidForeignKey: there is no unique constraint matching given keys`. `schema_diff.diff` now orders all additions so **every `AddUnique`/`AddIndex` precedes every `AddForeignKey`** (and drops mirror it: FKs before the uniques they depend on), via a stable type-priority sort — independent of table name order. Guarded by a fast unit test (`diff` op ordering) and a real-PG fixture whose child (`Booking`) deliberately sorts before its parent (`Room`), which reproduced the exact `InvalidForeignKey` before the fix. The v0.86.0 fixture passed only because its parent happened to sort first. (Adopters who hand-reordered the generated baseline no longer need to.)

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DAZZLE Development Roadmap
22

33
**Last Updated**: 2026-06-16
4-
**Current Version**: v0.86.1
4+
**Current Version**: v0.86.2
55

66
For past releases, see [CHANGELOG.md](CHANGELOG.md).
77

homebrew/dazzle.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class Dazzle < Formula
1010

1111
desc "DSL-first application framework with LLM-assisted development"
1212
homepage "https://github.com/manwithacat/dazzle"
13-
version "0.86.1"
13+
version "0.86.2"
1414
license "MIT"
1515

16-
url "https://github.com/manwithacat/dazzle/archive/refs/tags/v0.86.1.tar.gz"
16+
url "https://github.com/manwithacat/dazzle/archive/refs/tags/v0.86.2.tar.gz"
1717
sha256 "PLACEHOLDER_SOURCE_SHA256"
1818

1919
# pydantic-core requires Rust to build from source, so use pre-built wheels

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "dazzle-dsl"
7-
version = "0.86.1"
7+
version = "0.86.2"
88
description = "DAZZLE — declarative SaaS framework with built-in compliance (SOC 2, ISO 27001), provable RBAC, and graph features"
99
readme = "README.md"
1010
requires-python = ">=3.12"

src/dazzle/cli/ux_interactions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from pathlib import Path
2828
from typing import TYPE_CHECKING, Any
2929

30+
from dazzle.core.appspec_loader import load_project_appspec
3031
from dazzle.testing.ux.interactions import (
3132
CardAddInteraction,
3233
CardDragInteraction,
@@ -177,8 +178,6 @@ def _build_context_selector_walk(project_root: Path) -> list[Interaction]:
177178
be a real, surprising failure worth surfacing — not silently swallowing
178179
into "no gestures".
179180
"""
180-
from dazzle.core.appspec_loader import load_project_appspec
181-
182181
appspec = load_project_appspec(project_root)
183182
return [
184183
ContextSelectInteraction(workspace=ws.name)
@@ -290,7 +289,6 @@ def run_guide_walk(project_root: Path, *, json_output: bool = False, persona: st
290289
Returns an exit code (0/1/2).
291290
"""
292291
from dazzle.cli.runtime_impl.ports import read_runtime_test_secret
293-
from dazzle.core.appspec_loader import load_project_appspec
294292

295293
appspec = load_project_appspec(project_root)
296294
if not (getattr(appspec, "guides", None) or []):

src/dazzle/fitness/investigator/tools_read.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from typing import Any
1414

1515
from dazzle.agent.core import AgentTool
16+
from dazzle.core.appspec_loader import load_project_appspec
1617
from dazzle.core.ir.identity import spec_display_id
1718
from dazzle.fitness.investigator.case_file import CaseFile
1819
from dazzle.fitness.investigator.tools import (
@@ -128,14 +129,6 @@ def handler(name: str) -> dict[str, Any]:
128129
state.tool_calls_summary.append(f"query_dsl({name})")
129130
scope_root = case_file.example_root or dazzle_root
130131

131-
try:
132-
from dazzle.core.appspec_loader import load_project_appspec
133-
except ImportError:
134-
return {
135-
"error": "DSL parser unavailable",
136-
"hint": "install dazzle[dev]",
137-
}
138-
139132
try:
140133
appspec = load_project_appspec(scope_root)
141134
except Exception as e:

src/dazzle/http/runtime/integration_manager.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import logging
88
from typing import TYPE_CHECKING, Any
99

10-
from dazzle.core.ir import AppSpec
10+
from dazzle.core.ir import AppSpec, ChannelKind
11+
from dazzle.core.ir import ChannelSpec as IRChannelSpec
1112

1213
if TYPE_CHECKING:
1314
from fastapi import FastAPI
@@ -105,8 +106,6 @@ def __init__(
105106
def init_channel_manager(self) -> None:
106107
"""Initialize the channel manager for messaging."""
107108
try:
108-
from dazzle.core.ir import ChannelKind
109-
from dazzle.core.ir import ChannelSpec as IRChannelSpec
110109
from dazzle.http.channels import create_channel_manager
111110

112111
ir_channels = []

src/dazzle/http/runtime/subsystems/channels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import logging
99
from typing import Any
1010

11+
from dazzle.core.ir import ChannelKind
12+
from dazzle.core.ir import ChannelSpec as IRChannelSpec
1113
from dazzle.http.runtime.subsystems import SubsystemContext
1214

1315
logger = logging.getLogger(__name__)
@@ -33,8 +35,6 @@ def startup(self, ctx: SubsystemContext) -> None:
3335

3436
def _init_channel_manager(self, ctx: SubsystemContext) -> None:
3537
try:
36-
from dazzle.core.ir import ChannelKind
37-
from dazzle.core.ir import ChannelSpec as IRChannelSpec
3838
from dazzle.http.channels import create_channel_manager
3939

4040
kind_map = {

src/dazzle/mcp/semantics_kb/core.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[meta]
55
category = "Core Constructs"
6-
version = "0.86.1"
6+
version = "0.86.2"
77

88
[concepts.entity]
99
category = "Core Construct"

0 commit comments

Comments
 (0)