Skip to content

LOD-5: prove portable AI system graphs through import/export and MCP authoring #217

Open

Description

@mvalancy

Focused implementation help requested under #193 / LOD-5 in docs/architecture/dynamic-graph-lod.md. #216 implements nested display cuts; it does not yet prove portable AI-authored system graphs through the actual authoring/import/export paths.

Claim an owned branch/worktree and exact scope before editing. Start from live reviewed dev (058aaa7 at this checkpoint). #216 is already merged and accepted; coordinate with #223/#224 if their pending UI is required. Keep CodeGraph and GraphDone implementations independent: ideas only, no shared libraries. This slice can proceed mainly in transfer/MCP/server contracts without editing another agent's renderer.

Acceptance:

  • Document the existing optional metadata.lod.groupPath semantic-key contract with a concrete system → service → component example, long/multilingual titles, direct parent members, disconnected items and cross-service typed cycles. Any versioning must preserve existing version-1 portable documents and unknown metadata.
  • Exercise the actual JSON import/export path (packages/web/src/lib/project-transfer/, offline model/store and existing project-transfer browser coverage), not a replacement serializer. Fresh imported node IDs must preserve portable semantic paths, exact directed/typed/parallel edges and unrelated metadata. Embedded source node references must be explicitly remapped or rejected with a recoverable explanation; do not silently treat arbitrary IDs as portable semantic keys.
  • Exercise actual MCP/API creation and readback with an owned disposable graph, supported Node and the installed server/stdio client. Verify the rendered hierarchy represents the authored nodes and relations and can inspect the original source item.
  • Add failing-before negatives for any uncovered boundary, malformed/over-limit payloads and partial failure cleanup. Respect real admission limits; no client-only success badge for rejected persistence. Use existing auth/fixture helpers and edge-first owned cleanup.
  • Preserve account isolation, credentials/sync-internal export exclusions, layout recovery and existing importer compatibility. No source-position writes merely from viewing/imported overview navigation.
  • Ship focused tests/docs and a reviewable PR; retain exact revisions and all failures. Required browser/real DB/MCP gates cannot be replaced by static JSON examples.

This issue does not claim topology inference, 1k/10k capacity, hosted parity, publication or deployment. Those remain separate acceptance requirements in #193. Coordinate before editing semanticLOD or SemanticGraphOverview while #223/#224 are under final acceptance. Their shared renderer stays owned; transfer/MCP contracts can proceed independently.

Activity

  1. mvalancy commented on Oct 28, 2026

    @mvalancy
    MemberAuthor

    Read-only source audit at 6a6792650e0d455b361e0c6d38bc0f08f4a00f42 while #216 runs its exact-source gates. No transfer/MCP ownership claimed and no changes made in this slice; help is still welcome after claiming scope here.

    Concrete boundaries for implementation:

    • project-transfer/format.ts preserves the metadata string through its allowlist. offline/engine.ts:importOffline creates fresh IDs and remaps edge/note references, but copies metadata verbatim. Establish an explicit contract for supported embedded node references; do not guess that arbitrary metadata strings are IDs or silently rewrite semantic path labels.
    • semanticLOD.ts:buildSemanticHierarchy interprets metadata.lod.groupPath (and the legacy top-level path) as semantic strings, not node IDs. Prefer array paths in the documented example so a slash in a segment remains meaningful. Direct parent members and disconnected nodes are supported by the hierarchy and need real transfer coverage.
    • Existing offline admission is 300 nodes / 600 edges and rejects self-loops in both validateBackupSnapshot and offline/link.ts. Keep this limitation visible and test atomic rejection until persistence support is deliberately extended; a renderer capable of showing a loop does not establish portable admission.
    • MCP createEdge currently uses a source/target/type MERGE: repeated identical triples are idempotent. Mixed types and reverse edges are distinct. Exercise the actual behavior, preserve existing compatibility, and do not claim arbitrary duplicate-edge authoring from the browser-only fixture.
    • Extend the existing project-transfer.spec.ts file-picker/download/reimport/account-isolation path and actual SDK StdioClientTransport contract in neo4j-contract.test.ts. A serializer-only test is insufficient. The existing stdio cleanup gives the right starting point for edge-first deletion and readback.

    These are source observations, not new runtime acceptance. #217 remains open, and #216 does not claim this portability slice.

  2. mvalancy commented on Oct 28, 2026

    @mvalancy
    MemberAuthor

    Concrete nested-authoring acceptance found while reviewing #225 / #226: creating a child graph/items/edges and connecting both subgraphId and the actual subgraph relation still leaves the parent sheet showing 0 nodes · 0 edges. The same inspector's actual query reports301/564 (desktop) or72/132 (phone), and Open reaches all actual items.

    Source evidence on dev a531823: packages/server/src/schema/neo4j-schema.ts declares Graph.nodeCount/edgeCount as stored Int defaults0; onboarding/hierarchyDemo explicitly seed these properties. InteractiveGraphVisualization.tsx renders the child's stored counts with zero fallback. Linking a graph alone does not maintain them. The inspector change derives its own capped counts from actual data and does not claim to repair the stored properties.

    Please include truthful nested counts after create/import/MCP additions, deletions and fresh-ID round trips in this existing authoring-contract issue. Prefer a consistent authoritative count contract, including incoming/outgoing boundary scope, over sprinkling repair mutations into view-only navigation. Validate through actual supported writers, not by manually filling fixture counts until screenshots look correct. This is a concrete remaining requirement; no production/original graph was mutated during diagnosis.

  3. mvalancy commented on Oct 28, 2026

    @mvalancy
    MemberAuthor

    Additional read-only continuation audit on accepted deva531823 while226 finishes final CI; no217 implementation ownership claimed.

    1. Preserve the existing version1 document and metadata string compatibility. validateBackupSnapshot bounds metadata length but does not require JSON; do not invalidate legacy opaque values to add semantic grouping. metadata.lod.groupPath remains an array of semantic labels, including slash-containing/multilingual labels, never an inferred node-ID list.
    2. Introduce any supported embedded node-reference shape explicitly in a reserved versioned metadata field. Validate every declared reference before writing any imported project, remap it through the same fresh-ID map as edges/notes, and reject unresolved references with a recoverable error. Keep unrelated opaque metadata unchanged; do not rewrite arbitrary strings that happen to match source IDs. The exact field should be documented and tested, not guessed from existing unknown metadata.
    3. Extend the actual tests/e2e/quality/project-transfer.spec.ts file-picker → download → fresh-ID reimport path with a bounded system/service/component fixture, direct parent members, disconnected items, directed cycles and parallel records. Include multi-project atomic rejection for malformed declared references and admission limits. This existing spec is not named in the current blocking new-user sequence; add an explicit executable production/offline-enabled browser gate. Its service-worker readiness and guest offline flow cannot be claimed from the normal Neo4j dev fixture alone. Preserve account isolation and export exclusions.
    4. Extend packages/mcp-server/tests/neo4j-contract.test.ts through its actual SDK StdioClientTransport and own disposable graph. MCP metadata sanitization bounds depth/strings/arrays; prove the supported semantic fixture survives actual admission, and state limits rather than inferring arbitrary metadata preservation. Same typed endpoint triple remains idempotent; other directed/typed connections remain distinct.
    5. Establish the nested-count contract across the supported writers before changing display consumers. Replacing stored Graph.nodeCount/edgeCount fields with computed-only schema fields can remove them from generated create/update inputs and break onboarding/scripts. Do not silently change that compatibility surface or add view-time repair writes. Test counts after actual create/delete/import/MCP operations and define boundary-edge scope.

    These are a concrete next implementation/test path, not runtime acceptance or a request to weaken217's original requirements. Final226 UI source stays frozen; renderer/shared routing ownership remains separate. Heavy browser/database matrices belong in hosted CI, with owned fixtures and exact-source review.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions