Skip to content

Fold navigation and services back into the runtime frontend - #52

Merged
ResurrectedTrader merged 3 commits into
mainfrom
fold-navigation-services
Sep 26, 2026
Merged

ResurrectedTrader merged 3 commits into
mainfrom
fold-navigation-services

Conversation

@ResurrectedTrader

@ResurrectedTrader ResurrectedTrader commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Folds the navigation and services libraries back into the runtime frontend.

Why

Both were split out so that a second frontend could link them instead of reimplementing them. That frontend isn't coming: main is plain V8 again (#49), and the unibind route keeps a single runtime frontend over either engine. Meanwhile:

  • neither backend uses them;
  • runtime is their only consumer;
  • the tests compile the sources they need (Pathfinder.cpp, ProfileService.cpp) directly.

Keeping them separate cost two projects, their include-path, solution and glue entries, and a special include spelling for navigation.

Where things went

Each piece becomes a component under src/frontends/runtime/components/, beside console/, drawing/, gameloop/ and the rest:

Was Now Namespace
src/navigation/ (pathfinder, exit finder) components/navigation/ d2bs::runtime::navigation
src/services/analytics/ components/analytics/ d2bs::runtime::analytics
src/services/characterstate/ components/characterstate/ d2bs::runtime::characterstate
src/services/dde/ components/dde/ d2bs::runtime::dde
src/services/profile/ components/profile/ d2bs::runtime::profile
src/services/update/ components/update/ d2bs::runtime::update

They aren't grouped under a services/ folder: Host starts and stops them like any other component, and a grouping folder would only add a namespace level.

Namespaces follow d2bs::<project>::<subdirectory>, as the other runtime components already do. Code inside d2bs::runtime names them bare (profile::Switch), and the bindings in d2bs::api write runtime::profile::Load. Bringing the rest of the tree into line with that scheme (d2bs::api, events and script types in bare d2bs, core, the backends) is the follow-up PR.

What else changes

  • Projects: navigation.vcxproj and services.vcxproj are deleted, along with their solution, runtime and glue entries. The tests compile the moved sources from their new paths.
  • Enum names: the moved enumerations' names are regenerated into RuntimeEnumNames. All 51 enumerations keep their names.
  • Dependency rules: the two libraries' rules become directory rules in CLAUDE.md. navigation/ uses contract + utils only, and the service components never touch api/, V8 or the script engine. The compiler no longer enforces these, but the test build still compiles Pathfinder.cpp without V8 on its include path, which catches the rule that matters most.
  • The namespace rule: a new "Namespaces" section in CLAUDE.md writes the scheme down: d2bs::<project>::<subdirectory>, with the contract (d2bs::game, d2bs::config) as the one exception. Grouping directories such as components/ don't appear, and a directory may split its code into purpose-named sub-namespaces.
  • Docs: CLAUDE.md (tree, build targets, linking diagram, include paths, dependency rules), the README and four design docs are updated for the new paths. CLAUDE.md's tree now names components/engine/; it still said v8/.

Testing

  • Builds: build.ps1 Release and Release -Platform x64 succeed.
  • Tests: build.ps1 test passes 157/157.
  • Lint: 125/125 files pass.
  • Format: build.ps1 check-format is clean.
  • Enum names: gen_enum_names.py --check is up to date.

🤖 Generated with Claude Code

ResurrectedTrader and others added 2 commits September 26, 2026 18:05
Both libraries were split out so that a second frontend could link them
instead of reimplementing them. That frontend no longer exists: main is
plain V8 again, and the unibind route keeps a single runtime frontend over
either engine. Neither backend uses them; runtime is their only consumer,
and the tests compile the sources they need directly. Keeping them apart
cost two projects, their include-path, solution and glue entries, and a
special include spelling for navigation.

They now live under src/frontends/runtime/components/, one directory per
component beside console/, drawing/, gameloop/ and the rest:

- navigation/: the A* pathfinder and the level-exit finder;
- analytics/, characterstate/, dde/, profile/, update/: the bot's
  background services, which Host starts and stops.

The namespaces follow the project/subdirectory layout,
d2bs::runtime::<component>, as the other components already do. Code
inside d2bs::runtime names them bare (profile::Switch); the bindings in
d2bs::api write runtime::profile::Load.

The two libraries' dependency rules become directory rules in CLAUDE.md:

- navigation/ uses contract + utils only;
- the service components never touch api/, V8 or the script engine.

The test build compiles Pathfinder.cpp without V8 on the include path,
which still catches the rule that matters most.

The enum names for the moved enumerations are regenerated into
RuntimeEnumNames. CLAUDE.md, the README and the design docs are updated
for the new paths, and CLAUDE.md's tree now names components/engine/
(it still said v8/).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A namespace says where its code lives: d2bs::<project>::<subdirectory>, with
the contract (d2bs::game, d2bs::config) as the one exception. Grouping
directories such as components/ do not appear, directories may split into
purpose-named sub-namespaces, and code never sits in a parent's namespace.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Two comments still named services/ and navigation as projects, the
Pathfinder.h alias comment named a namespace that no longer exists, and
ReloadPathsForProfile's local `profile` shadowed the profile:: namespace
it was initialised from.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ResurrectedTrader
ResurrectedTrader merged commit a08c752 into main Sep 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant