Skip to content

Commit e9054c7

Browse files
authored
refactor(workspace): raise structural guards and land architecture cleanup (#89)
* docs(style): add architectural principles and workspace rules * chore(architecture): add workspace boundary guards * refactor(sequence-editor): move sequence editing to shared schema * refactor(editor-api): route editor through public engine facade * refactor(view-editor): move view editing to shared schema * refactor(battle-schema): wrap player config around shared schema * chore(architecture): normalize core boundary baseline * refactor(state-schema): wrap state config around shared schema * refactor(input-schema): wrap input config around shared schema * refactor(character-schema): wrap character assets around shared schema * refactor(enemy-schema): wrap enemy assets around shared schema * refactor(item-schema): wrap item assets around shared schema * refactor(core-mode): move generic runtime state out of app_state * refactor(battle-box): move shared battle box types into core * refactor(battle-runtime): move shared battle runtime tags into core * refactor(core-boundary): eliminate core app_state dependencies * refactor(bootstrap): split souprune entry modules * refactor(editor-bootstrap): split editor entry modules * refactor(fre-bridge): split runtime dispatch modules * refactor(dialogue): split dialogue runtime systems * refactor(sequencer): split chapter schema module * refactor(sequencer): split fact chapter runtime * test(architecture): add editor boundary and asset smoke guards * refactor(sequencer): split tween execution module * refactor(view): split lifecycle systems * refactor(view-sequencer): split root assembly and flow modules * refactor(danmaku): move runtime onto shared schema * refactor(view): split ron view spawn pipeline * chore(style): add bevy plugin rules and sync submodule refs * chore(submodules): sync bevy_ecs_typewriter ref * chore(workspace): sync bevy_alight_motion ref and lockfile * refactor(cleanup): delete retired view compatibility paths * refactor(view-text): replace legacy data templates * chore(lint): codify dual tokei thresholds * refactor(workspace): split oversized modules and remove mod_rs * chore(submodules): sync lint and refactor checkpoints * chore(review): align style rules and schema naming * chore(submodules): sync semantic cleanup checkpoints * test(bevy_alight_motion): update test results after refactor * refactor(animation): reorganize transform system imports and functions * fix(ci): resolve workspace clippy failures * docs(style): clarify module-level documentation requirements * fix(bevy_alight_motion): update dependency hash * docs(workspace): add bilingual module docs * docs(workspace): finish non-alight module docs * fix(clippy): clean all-targets all-features warnings * refactor(battle/collision): reorder imports and add TODO comment * refactor(docs, core): update documentation and code comments * refactor(video_comparison): extract headless capture functions and reorganize logic * chore(bevy_alight_motion): update submodule ref * style: remove unused imports from plugins.rs * chore: update bevy_alight_motion submodule to 432b427d * docs: tighten file header comments * fix(ci): bump bevy_alight_motion fixture path fix * chore: update bitmap text and typewriter submodules * chore: update dependencies and submodules * chore(bevy_bitmap_text): bump submodule to v0.1.1 * chore(submodules): sync squashed dependency histories * fix(ci): align workspace dependency versions * chore(submodule): bump bevy_alight_motion * test: warn when example project smoke assets are absent * fix: import info macro for unsafe_gpu build * fix: gate unsafe_gpu logging import
1 parent 6b27bc7 commit e9054c7

File tree

218 files changed

+18734
-19771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+18734
-19771
lines changed

Cargo.lock

Lines changed: 33 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

check_core_boundaries.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
# check_core_boundaries.sh — Architecture guardrail for core -> app_state dependencies.
3+
#
4+
# This check is baseline-based on purpose:
5+
# - existing violations are frozen in a baseline file
6+
# - newly introduced violations fail the check
7+
# - removed violations are reported as cleanup progress
8+
9+
set -euo pipefail
10+
11+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12+
ROOT_DIR="$SCRIPT_DIR"
13+
BASELINE_FILE="$ROOT_DIR/core_to_app_state_baseline.txt"
14+
TMP_CURRENT="$(mktemp)"
15+
trap 'rm -f "$TMP_CURRENT"' EXIT
16+
17+
if [ ! -f "$BASELINE_FILE" ]; then
18+
echo "Missing baseline file: $BASELINE_FILE" >&2
19+
exit 1
20+
fi
21+
22+
(
23+
cd "$ROOT_DIR"
24+
python - <<'PY' > "$TMP_CURRENT"
25+
import re
26+
import subprocess
27+
28+
result = subprocess.run(
29+
["rg", "-n", r"crate::app_state(::|\b)", "crates/souprune/src/core"],
30+
check=False,
31+
capture_output=True,
32+
text=True,
33+
)
34+
35+
hits = set()
36+
for line in result.stdout.splitlines():
37+
file_path, _, text = line.split(":", 2)
38+
match = re.search(r"crate::app_state(?:::[A-Za-z0-9_]+)*", text)
39+
if not match:
40+
continue
41+
42+
path = match.group(0)
43+
44+
# Normalize imports to the module path, so changing imported symbols
45+
# does not look like a brand-new dependency.
46+
if text.lstrip().startswith("use "):
47+
parts = path.split("::")
48+
if len(parts) > 2:
49+
path = "::".join(parts[:-1])
50+
51+
hits.add(f"{file_path}:{path}")
52+
53+
for hit in sorted(hits):
54+
print(hit)
55+
PY
56+
)
57+
58+
new_hits="$(comm -13 "$BASELINE_FILE" "$TMP_CURRENT" || true)"
59+
removed_hits="$(comm -23 "$BASELINE_FILE" "$TMP_CURRENT" || true)"
60+
61+
if [ -n "$new_hits" ]; then
62+
echo "Error: new core -> app_state dependencies were introduced."
63+
echo "Move the behavior out of core/, or update the architecture intentionally before changing the baseline."
64+
echo "$new_hits"
65+
exit 1
66+
fi
67+
68+
if [ -n "$removed_hits" ]; then
69+
echo "Progress: some historical core -> app_state dependencies disappeared."
70+
echo "Shrink core_to_app_state_baseline.txt after the refactor is reviewed:"
71+
echo "$removed_hits"
72+
fi
73+
74+
echo "Core boundary OK: no new core -> app_state dependencies."

check_editor_boundaries.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# check_editor_boundaries.sh — Architecture guardrail for editor -> engine internals.
3+
4+
set -euo pipefail
5+
6+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7+
ROOT_DIR="$SCRIPT_DIR"
8+
9+
cd "$ROOT_DIR"
10+
11+
hits="$(rg -n 'souprune::(core|app_state|extra)::' crates/souprune_editor/src -g '*.rs' || true)"
12+
13+
if [ -n "$hits" ]; then
14+
echo "Error: souprune_editor is reaching into engine internals."
15+
echo "Route the dependency through souprune::editor_api or a top-level public API instead."
16+
echo "$hits"
17+
exit 1
18+
fi
19+
20+
echo "Editor boundary OK: no deep engine internal paths are used."

core_to_app_state_baseline.txt

Whitespace-only changes.

crates/bevy_alight_motion

Submodule bevy_alight_motion updated 189 files

0 commit comments

Comments
 (0)