feat(mma): Complete Visual DAG implementation, fix link creation/deletion, and sync docs

This commit is contained in:
2026-03-06 19:13:20 -05:00
parent 1c977d25d5
commit 661566573c
11 changed files with 260 additions and 36 deletions

View File

@@ -324,9 +324,10 @@ def run(config: dict[str, Any]) -> tuple[str, Path, list[dict[str, Any]]]:
return markdown, output_file, file_items
def main() -> None:
# Load global config to find active project
config_path = Path("config.toml")
# Load global config to find active project
config_path = Path(os.environ.get("SLOP_CONFIG", "config.toml"))
if not config_path.exists():
print("config.toml not found.")
return
with open(config_path, "rb") as f:

View File

@@ -1682,19 +1682,46 @@ class App:
tid = str(t.get('id', '??'))
for dep in t.get('depends_on', []):
ed.link(abs(hash(dep + "_" + tid)), abs(hash(dep + "_out")), abs(hash(tid + "_in")))
# Handle link creation
if ed.begin_create():
start_pin = ed.PinId()
end_pin = ed.PinId()
if ed.query_new_link(start_pin, end_pin):
if ed.accept_new_item():
s_id = start_pin.id()
e_id = end_pin.id()
source_tid = None
target_tid = None
for t in self.active_tickets:
tid = str(t.get('id', ''))
if abs(hash(tid + "_out")) == s_id: source_tid = tid
if abs(hash(tid + "_out")) == e_id: source_tid = tid
if abs(hash(tid + "_in")) == s_id: target_tid = tid
if abs(hash(tid + "_in")) == e_id: target_tid = tid
if source_tid and target_tid and source_tid != target_tid:
for t in self.active_tickets:
if str(t.get('id', '')) == target_tid:
if source_tid not in t.get('depends_on', []):
t.setdefault('depends_on', []).append(source_tid)
self._push_mma_state_update()
break
ed.end_create()
# Handle link deletion
if ed.begin_delete():
deleted = ed.get_deleted_link()
if deleted:
link_id = deleted[0]
for t in self.active_tickets:
tid = str(t.get('id', ''))
for d in t.get('depends_on', []):
if abs(hash(d + "_" + tid)) == link_id:
t['depends_on'] = [dep for dep in t['depends_on'] if dep != d]
link_id = ed.LinkId()
while ed.query_deleted_link(link_id):
if ed.accept_deleted_item():
lid_val = link_id.id()
for t in self.active_tickets:
tid = str(t.get('id', ''))
deps = t.get('depends_on', [])
if any(abs(hash(d + "_" + tid)) == lid_val for d in deps):
t['depends_on'] = [dep for dep in deps if abs(hash(dep + "_" + tid)) != lid_val]
self._push_mma_state_update()
break
ed.end_delete()
ed.end_delete()
# Validate DAG after any changes
try:
from src.dag_engine import TrackDAG

View File

@@ -1,10 +1,11 @@
from __future__ import annotations
import tomllib
import os
from dataclasses import dataclass, field
from typing import List, Optional, Dict, Any, Union
from pathlib import Path
CONFIG_PATH = Path("config.toml")
CONFIG_PATH = Path(os.environ.get("SLOP_CONFIG", "config.toml"))
def load_config() -> dict[str, Any]:
with open(CONFIG_PATH, "rb") as f: