Skip to content

Inspect App#116

Draft
JonasScholl wants to merge 15 commits into
mainfrom
inspect-app-concept
Draft

Inspect App#116
JonasScholl wants to merge 15 commits into
mainfrom
inspect-app-concept

Conversation

@JonasScholl

@JonasScholl JonasScholl commented Jul 9, 2026

Copy link
Copy Markdown
Member

This PR adds app.inspect, a new read/write interface to VideoIPath's Inspect surface (verified against 2025.4+). It is purely additive, app.topology and app.inventory are unchanged.

Inspect lets you:

  • Read the live topology (devices, ports, edges, services) via a lazy, skeleton-first internal view
  • Write topology changes through a commit-style model (single-shot helpers or batched transactions)
  • Onboard devices into the topology (add_devices_to_topology, sync_devices, get_sync_info)
# Read (skeleton loads fast; ports hydrate on first access)
device = app.inspect.get_device("device-a")
for port in device.ports:
    print(port.label, port.edge)

# Write (auto-commit)
app.inspect.place_device("device-a", x=100, y=200)
app.inspect.connect("device-a.1.port-out-1", "device-b.0.port-in-1", bidirectional=True)

# Batched, atomic write
with app.inspect.transaction() as tx:
    tx.place_device("device-a", x=100, y=200)
    tx.connect(a_out, b_in, bidirectional=True)
    tx.commit()

Key design choices

Topic Approach
Loading Skeleton-first snapshot; per-device detail hydrates on demand (ADR-0007)
API surface Collector endpoints only: no legacy nGraphElements / edgesByDevice (ADR-0008)
Writes Staged change sets committed atomically (ADR-0006)
Concurrency Compare-and-commit conflict detection before POST; rebase() to retry (ADR-0009)
Post-commit state Targeted refresh of touched entities only (ADR-0010)

The snapshot is an internal implementation detail. Users interact only through app.inspect, not a snapshot object.

What's included

Application code

  • New package: src/videoipath_automation_tool/apps/inspect/
    • InspectApp (read / write / actions mixins)
    • InspectAPI + typed Pydantic models
    • InspectSnapshot with lazy hydration and in-memory indexes
    • InspectTransaction with conflict detection (deepdiff)
    • Domain views: InspectDevice, InspectPort, InspectEdge, InspectService
  • Wired into VideoIPathApp as a lazy app.inspect property (also exposed as _inspect_api in DEV mode)

Tests

  • Unit tests (tests/inspect/): Offline, fixture-driven coverage for snapshot loading, queries, transactions, conflict handling, and API parsing (anonymized 2025.4.9 fixtures)
  • E2E tests (tests/e2e/inspect/): Developer-run locally only against a real instance; each test builds and tears down its own mini-topology
  • New Poetry scripts: poetry run test-unit, poetry run test-e2e, poetry run test
  • CI now runs test-unit (e2e excluded by default via pytest marker)

Documentation

Tooling / housekeeping

  • .env.template replaces .env.example (e2e connection vars documented there)
  • AGENTS.md and path-scoped Python agent rules (.claude/rules/, .cursor/rules/ symlinks)
  • Minor REST connector tweak for Inspect collector calls

@JonasScholl JonasScholl marked this pull request as ready for review July 9, 2026 13:06
@JonasScholl JonasScholl marked this pull request as draft July 9, 2026 13:07
from videoipath_automation_tool.apps.inspect.domain import *
from videoipath_automation_tool.apps.inspect.errors import *
from videoipath_automation_tool.apps.inspect.inspect_app import InspectApp as InspectApp
from videoipath_automation_tool.apps.inspect.model import *
@@ -1,4 +1,5 @@
from videoipath_automation_tool.apps.inventory import *
from videoipath_automation_tool.apps.inspect import *
@JonasScholl JonasScholl changed the title Inspect app concept Inspect App Implementation Jul 9, 2026
@JonasScholl JonasScholl changed the title Inspect App Implementation Inspect App Jul 9, 2026
@JonasScholl JonasScholl self-assigned this Jul 9, 2026
@JonasScholl JonasScholl added the enhancement New feature or request label Jul 9, 2026
@JonasScholl JonasScholl added this to the Inspect App milestone Jul 9, 2026
@JonasScholl JonasScholl linked an issue Jul 9, 2026 that may be closed by this pull request
@property
def label(self) -> str | None:
return self._record().label

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description should be included here as well

return meta.isVirtual if meta is not None else None

@property
def icon_type(self) -> str | None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to expose the possible icon types via IntelliSense? That would improve the developer experience.

from videoipath_automation_tool.apps.inspect.domain.edge import InspectEdge


class InspectPort(InspectFrozenModel):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The app layer currently exposes too little information about ports. We need access to the full port/vertex data from Inspect, including the vertex kind and direction (Generic bidirectional, IP bidirectional, IP input, IP output, Codec/Video input, Codec/Video output), as well as the corresponding properties shown in the UI.

sWe also need a way to retrieve the original factory label, even if a manual label override has been set.

return self.snapshot.fetched_at(self.id)

@property
def ports(self) -> list[InspectPort]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding filter helpers for ports/vertices could improve the developer experience. Examples could be filtering vertices by slot/module, type, or properties such as Active, use_as_endpoint or control_level = Full.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Inspect App support

2 participants