Skip to content

feat(dashboard): add deterministic service topology model - #600

Merged
Hydralerne merged 1 commit into
oblien:mainfrom
ValenFelizia:feat/service-topology
Aug 18, 2026
Merged

feat(dashboard): add deterministic service topology model#600
Hydralerne merged 1 commit into
oblien:mainfrom
ValenFelizia:feat/service-topology

Conversation

@ValenFelizia

Copy link
Copy Markdown
Contributor

Summary

Adds a pure, deterministic service topology mapper for the first part of the Canvas feature discussed in #92.

The mapper converts existing project services and live container state into service nodes, semantic dependency relationships, and unresolved dependency diagnostics, without introducing any UI or graph-library dependency.

Motivation

Issue #92 agreed on a two-PR approach for introducing a read-only Canvas view.

This first PR establishes the service-domain topology contract independently from the visual layer, so the follow-up PR can build the reusable canvas on top of it without coupling service dependency semantics to React Flow or layout concerns.

The maintainer also asked that the future canvas remain generic enough to support later features such as load balancing and scaling. Keeping this mapper framework-independent leaves that separation intact.

Related issue

Related to #92.

This does not close the issue because the visible Canvas UI will be implemented separately in PR 2.

Changes

apps/dashboard

  • Added buildServiceTopology() as a pure service topology mapper.
  • Uses existing service IDs as stable node identity.
  • Resolves relationships exclusively from exact service.dependsOn name matches.
  • Represents dependency semantics explicitly as dependentId and dependencyId, independently from any future canvas source / target orientation.
  • Preserves cycles and self-dependencies.
  • Deduplicates repeated dependency declarations.
  • Reports missing and ambiguous dependencies without creating synthetic nodes.
  • Includes sorted candidate service IDs for ambiguous dependency names.
  • Preserves live runtime status when available and keeps missing runtime information as null.
  • Produces deterministic output regardless of service, dependency, or container input ordering.
  • Does not mutate input data.
  • Added Vitest coverage for dependency shapes, diagnostics, status behavior, determinism, and input immutability.

No React Flow, UI, layout, API, database, routing, persistence, package, or dependency changes are included in this PR.

Verification

bun run --cwd apps/dashboard test
# PASS — 67 test files passed, 866 tests passed

bun run --cwd apps/dashboard lint
# PASS — tsc --noEmit

bunx prettier --check \
  apps/dashboard/src/lib/service-topology.ts \
  apps/dashboard/src/lib/service-topology.test.ts
# PASS — both files use Prettier code style

git diff upstream/main...HEAD --check
# PASS — no output

git status --short
# clean — no output

bun run test was also executed. The dashboard suite passed, but the aggregate command stopped in the unchanged apps/cli workspace on Windows with 20 failures across 7 files. The failures were confined to the unchanged apps/cli workspace and appear to involve POSIX path and generated Compose expectations when running on Windows. This PR does not modify apps/cli.

Checklist

  • One change per PR — one bug, or one agreed feature, with nothing unrelated bundled in
  • The diff is scoped — no reformatting or lint fixes on lines I wasn't otherwise changing
  • A test fails without this change and passes with it (or I explained above why there isn't one)
  • bun run test, bun run --cwd <workspace> lint, and bun format all pass locally
  • I understand every line of this diff and can explain it in review

@Hydralerne
Hydralerne merged commit cc405ae into oblien:main Aug 18, 2026
3 checks passed
@Hydralerne

Copy link
Copy Markdown
Member

looking forward to the rest of the feature

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.

2 participants