Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
dda9b64
feat(desktop): add standalone ABI Desktop local app
jravenel Jul 9, 2026
35f434c
feat(desktop): Finder drag-drop import and server lifecycle
jravenel Jul 9, 2026
819e2a2
docs(desktop): document Finder drag-drop and file import APIs
jravenel Jul 9, 2026
547cea3
fix(desktop): block non-tool models and seed workspace config
jravenel Jul 9, 2026
e7a55e0
feat(desktop): add org/model workspace layout with context scaffolding.
jravenel Jul 9, 2026
09acd5d
feat(desktop): BFO7 routing graph and bundled ontologies
jravenel Jul 9, 2026
3138cf6
feat(desktop): wire BFO7 bucket ontologies for org/model routing.
jravenel Jul 9, 2026
f99f47e
feat(desktop): add BFO7 model router with SPARQL suggestions.
jravenel Jul 9, 2026
2588e45
feat(desktop): complete router sync, graph UI, and TTL repair.
jravenel Jul 9, 2026
c508385
feat(desktop): logo, slides templates, external drag-drop, live HTML …
jravenel Jul 10, 2026
5384f3a
feat(desktop): add Nexus ABI logo to UI and app bundle.
jravenel Jul 10, 2026
2c522d9
feat(desktop): clone Nexus chat UI with tools, sources, and selectors.
jravenel Jul 10, 2026
de32101
fix(desktop): enforce square corners across chat UI.
jravenel Jul 10, 2026
75c1e95
feat(desktop): add browser-only dev mode for localhost iteration.
jravenel Jul 10, 2026
3d88c69
feat(desktop): add vis-network knowledge graph overview UI.
jravenel Jul 10, 2026
55b56c7
feat(desktop): add graph search and right detail panel.
jravenel Jul 10, 2026
7b03da4
fix(desktop): use stable default port 54242 for dev server
jravenel Jul 10, 2026
ae8f9ff
refactor(desktop): reorganize package into config, core, api, and gui
jravenel Jul 10, 2026
8d22fa1
refactor(desktop): reorganize harness into per-provider packages
jravenel Jul 10, 2026
a54de18
refactor(desktop): rename ontologies/ to ontology/
jravenel Jul 10, 2026
4ab5e1e
fix(desktop): use ephemeral ports in main_test port resolution tests
jravenel Jul 10, 2026
4a84d23
docs(desktop): add README and canonical test coverage KPI
jravenel Jul 10, 2026
247e128
feat(desktop): add IDE workspace switcher with recent folders
jravenel Jul 10, 2026
def2ad7
Move workspace switcher to status bar for IDE semantics.
jravenel Jul 10, 2026
2603a99
fix(desktop): span status bar full viewport width
jravenel Jul 10, 2026
fc8c16e
Restore workspace switcher to top bar; status bar read-only.
jravenel Jul 10, 2026
8497412
fix(desktop): move workspace switcher to icon rail top
jravenel Jul 10, 2026
9d19dbb
fix(desktop): logo-only rail switcher, workspace name in status bar
jravenel Jul 10, 2026
b42652c
feat(desktop): persist rail section in URL hash
jravenel Jul 10, 2026
7796a18
feat(desktop): BFO 7-bucket graph UI with subclass drill-down
jravenel Jul 10, 2026
5c81114
fix(desktop): replace graph layer chips with BFO bucket filters
jravenel Jul 10, 2026
a1b5a3d
fix(desktop): color graph nodes by BFO7 bucket with chat subgraph
jravenel Jul 10, 2026
5f6515c
fix(desktop): prevent duplicate instances and publish listen URL
jravenel Jul 10, 2026
3f6e6a6
fix(desktop): show all 7 BFO buckets per process in graph ABOX view
jravenel Jul 10, 2026
fc6761e
feat(desktop): add process event SQLite schema for 7-bucket graph
jravenel Jul 10, 2026
d36d329
feat(desktop): add process events table above graph overview
jravenel Jul 10, 2026
f734755
feat(desktop): move process events to dedicated rail section
jravenel Jul 10, 2026
35c192f
feat(desktop): add detached dev server with Python hot reload
jravenel Jul 10, 2026
1d86e70
fix(desktop): wait longer for dev port release on restart
jravenel Jul 10, 2026
2954e4e
fix(desktop): make dev server start idempotent and agent-safe
jravenel Jul 10, 2026
492b23e
fix(desktop): restore workspace logo to rail top
jravenel Jul 10, 2026
6c1287a
feat(desktop): reorganize rail with Table and Files sections
jravenel Jul 10, 2026
05e8afc
fix(desktop): align SQLite table API client with path routes
jravenel Jul 10, 2026
183419d
refactor(desktop): flat SQLite table list in Table rail
jravenel Jul 10, 2026
4b68fec
feat(desktop): Nexus-parity Files browser with breadcrumbs and grid/list
jravenel Jul 10, 2026
552096b
fix(desktop): reload all sections on workspace switch
jravenel Jul 10, 2026
1320b88
feat(desktop): auto-select qwen2.5-coder as default Ollama model
jravenel Jul 13, 2026
33f5ddf
fix(desktop): steer Code mode build agent to write files via tools
jravenel Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ storage/vectorstore/*
!libs/naas-abi/naas_abi/apps/nexus/demo/**
!libs/naas-abi/naas_abi/apps/nexus/apps/*/public/**

# ABI Desktop bundled UI assets (logo, favicon)
!libs/naas-abi/naas_abi/apps/desktop/gui/web/assets/**

# `abi dev` runtime artefacts (per-worktree instance/pid/log files)
.abi/
# Dagster local home dir created by `abi dev up`
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ help:
@echo " chat-support-agent Start customer support specialized agent"
@echo ""
@echo "DEVELOPMENT SERVERS & TOOLS:"
@echo " dev-desktop Start ABI Desktop dev server (reload + supervisor)"
@echo " api Start API server for local development (port 9879)"
@echo " api-prod Build and run production API server in Docker"
@echo " api-local Start local API server in Docker with volume mounting"
Expand All @@ -117,6 +118,8 @@ help:
@echo ""
@echo "TESTING & QUALITY ASSURANCE:"
@echo " test Run all Python tests using pytest"
@echo " test-desktop Run ABI Desktop tests with coverage KPI"
@echo " dev-desktop Start ABI Desktop dev server (reload + supervisor)"
@echo " test-coverage Run tests with coverage reporting and badge generation"
@echo " test-ci Run basic tests for CI (no external dependencies)"
@echo " test-abi Run tests specifically for the abi library"
Expand Down Expand Up @@ -546,6 +549,14 @@ path=tests/
test: deps
@ uv run python -m pytest .

# ABI Desktop unit tests + coverage KPI
test-desktop: deps
@ libs/naas-abi/naas_abi/apps/desktop/scripts/test.sh

# ABI Desktop browser dev server (detached, auto-reload, crash restart)
dev-desktop: deps
@ libs/naas-abi/naas_abi/apps/desktop/scripts/dev.sh

# Run API-specific tests
test-api: deps
@ uv run python -m pytest libs/naas-abi-core/naas_abi_core/apps/api/api_test.py -v -s
Expand Down
69 changes: 69 additions & 0 deletions docs/adr/20260710_desktop-abi-model-router.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Desktop ABI model router

## Status

Accepted

## Date

2026-07-10

## Context

ABI Desktop users bring their own models: local Ollama installs and cloud provider APIs. Today they pick a model manually from a dropdown. The product vision is **ABI as an intelligent model router**: the user types intent in chat, and the system suggests the best local vs cloud model based on TTL that describes each model's realizable BFO7 processes and hosting site.

Iteration 1 delivered BFO7 section routing (chat → plan, code → build) over Oxigraph. Iteration 3 adds task-aware **model** routing on the same graph stack, without importing `naas_abi` or `naas_abi_core`.

## Decision

1. **Router layer over Oxigraph + BFO7 realizabilities**

- Extend `ontology/desktop-routing.ttl` with `abi:LanguageModel`, `abi:hostedAt`, `abi:supportsTools`, `abi:canRealize`, `abi:modelRef`, and site individuals `abi:SiteLocal` / `abi:SiteCloud` (aligned with `BFO7Buckets.ttl` `abi:` namespace).
- Scaffolded `instances.ttl` seeds example `LanguageModel` individuals per org/model context.
- `DesktopGraph.suggest_models(intent_tags, prefer_local)` runs SPARQL over the active context graph, filters tool-capable models, ranks by process match count and hosting preference.

2. **Intent tagging (phased)**

- **MVP**: rule-based `tag_intent_from_text()` maps composer keywords to intent tags (`code`, `plan`, `summarize`, `general`), then to BFO7 process IRIs (`bfo:BFO_0000015` process, `bfo:BFO_0000023` role).
- **V2**: LLM intent tagger replaces keyword rules; same SPARQL router and TTL contract.

3. **API and UI**

- `POST /api/router/suggest` body `{ "text": "refactor this python file", "prefer_local": true }` returns `{ intent_tags, suggestions: [{ model_ref, label, hosted_at, score, reason, matched_processes }] }`.
- Chat/Code composer debounces input and shows suggestion chips above the composer; click applies the model chip and `@ollama:…` or cloud ref.

## Architecture

```mermaid
flowchart LR
User[User intent in composer]
Tagger[IntentTagger]
Router[SPARQL Router]
Suggest[ModelSuggestion]
Harness[Harness send]

User --> Tagger
Tagger -->|intent_tags| Router
Router -->|instances.ttl + BFO7| Suggest
Suggest -->|model_ref| Harness
```

## Phased rollout

| Phase | IntentTagger | Router | UI |
|-------|----------------|--------|-----|
| MVP (this iteration) | Keyword rules in `graph.py` | SPARQL over `instances.ttl` | Debounced chips in `app.js` |
| V2 | LLM classification | Same SPARQL + richer process TTL | Persist user overrides, graph panel |

## Consequences

- Model routing is data-driven: edit `instances.ttl` to add/remove models without code changes.
- Local vs cloud tradeoff is explicit via `abi:hostedAt` and `prefer_local`.
- Only models with `abi:supportsTools true` are suggested (opencode agents require tools).
- V2 can add per-process subclasses from Nexus process TTL without changing the API shape.
- Bundle stays self-contained: router vocab ships in `desktop/ontology/`.

## Related

- `docs/adr/20260710_desktop-bfo7-routing-graph.md`
- `docs/adr/20260710_desktop-org-model-workspace.md`
82 changes: 82 additions & 0 deletions docs/adr/20260710_desktop-bfo7-routing-graph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Desktop BFO7 routing knowledge graph

## Status

Accepted

## Date

2026-07-10

## Context

ABI Desktop already scaffolds per org/model `ontology.ttl` and `instances.ttl` files and loads them into an embedded Oxigraph store. Chat prompts prepend `AGENTS.md` and `MEMORY.md`, but agent selection still comes only from SQLite settings (`chat_agent`, `code_agent`). Nexus ships BFO7 bucket ontologies that classify processes, agents, and documents along seven BFO continuant/occurrent buckets. The desktop app must stay importable without `naas_abi` / `naas_abi_core`, yet still benefit from the same ontology base for routing hints.

## Decision

1. **System ontology config**

- `desktop_config.resolve_system_ontology_paths()` resolves TTL files in this order:
- `ABI_DESKTOP_SYSTEM_ONTOLOGY_PATHS` (explicit override)
- bundled `ontology/desktop-routing.ttl`
- repo or bundled `BFO7BucketsProcessOntology.ttl`
- Optional full `BFO7Buckets.ttl` is discovered when present in the repo; bundled copy is not required for v1.

2. **Graph loading**

- `DesktopGraph.load_system_ontology()` loads system TTL into named graph `http://ontology.naas.ai/abi/desktop#system`.
- `load_org_model_context()` always ensures the system graph is loaded, then loads org/model `ontology.ttl` and `instances.ttl` into `http://ontology.naas.ai/abi/desktop#context/{org}/{model}`.

3. **Routing vocabulary**

Shared classes in `ontology/desktop-routing.ttl`:

- `abid:SectionRoute` with `abid:forSection`, `abid:harnessAgent`, `abid:mapsToBfoProcess`
- `abid:Organization`, `abid:ModelContext`, `abid:ContextDocument`

Per org/model scaffold templates declare section route subclasses and seed instances:

- chat → `plan` agent, maps to `bfo:BFO_0000015` (process / WHAT)
- code → `build` agent, maps to `bfo:BFO_0000015`
- `AGENTS.md` and `MEMORY.md` as `ContextDocument` individuals

4. **SPARQL routing query**

```sparql
PREFIX abid: <http://ontology.naas.ai/abi/desktop#>

SELECT ?agent ?bucketLabel WHERE {
GRAPH <http://ontology.naas.ai/abi/desktop#context/{org}/{model}> {
?route abid:forSection ?section ;
abid:harnessAgent ?agent .
FILTER(?section = "chat")
OPTIONAL { ?route abid:mapsToBfoProcess ?bucket . }
}
OPTIONAL {
GRAPH <http://ontology.naas.ai/abi/desktop#system> {
?bucket rdfs:label ?bucketLabel .
}
}
}
LIMIT 1
```

5. **Chat send wiring (v1)**

On `POST /api/chats/{id}/messages`:

- `graph.resolve_route_agent(active_org, active_model, section)` overrides settings when instances define a route.
- `graph.build_routing_prompt_hint(...)` prepends a short routing block to the harness prompt (stored user message stays raw).

## Consequences

- Routing is data-driven: editing `instances.ttl` changes agent selection without code changes.
- BFO7 process bucket labels appear in prompts as lightweight context for the harness.
- Bundle stays lean: only routing vocab + process ontology are vendored under `desktop/ontology/`.
- `owl:imports` in scaffolded ontologies document intent; Oxigraph loads explicit file paths, not remote imports.
- Iteration 2 enriched instances (distinct BFO7 buckets, model URI, harness, model hints), added `resolve_route()`, wired model hints on send, and surfaced active routing in `/api/health` + Graph UI.
- Iteration 3 can add per-tool routes, settings↔TTL sync, and a seven-bucket visualization.

## Related

- `docs/adr/20260710_desktop-org-model-workspace.md`
66 changes: 66 additions & 0 deletions docs/adr/20260710_desktop-org-model-workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Desktop org/model workspace layout

## Status

Accepted

## Date

2026-07-10

## Context

ABI Desktop needs a canonical way to organize agent instructions, persistent memory, and RDF knowledge per organization and model context. The workspace root may contain multiple organizations (for example a monorepo like `/Users/jrvmac/abi`), and each organization may host multiple model-specific contexts.

## Decision

1. **Path schema**

```
{workspace_root}/{org}/{model}/AGENTS.md
{workspace_root}/{org}/{model}/MEMORY.md
{workspace_root}/{org}/{model}/ontology.ttl
{workspace_root}/{org}/{model}/instances.ttl
```

Organizations are directories directly under `workspace_root`. Model contexts are directories under each org. Infrastructure directories (`.git`, `node_modules`, virtualenvs, caches) are excluded from org discovery.

2. **Settings keys** (SQLite `settings` table via `DesktopStore`)

- `active_org` — selected organization folder name (default: `default`)
- `active_model` — selected model context folder name (default: `default`)

These are separate keys, not a combined `org/model` path string.

3. **Scaffolding**

- `workspace_layout.scaffold_org_model()` creates missing dirs and template files idempotently.
- `ensure_workspace()` scaffolds `default/default` on first workspace creation.
- Settings save and `POST /api/workspace/orgs/{org}/models/{model}/scaffold` also scaffold on demand.

4. **API**

- `GET /api/workspace/orgs` — list orgs + active org/model
- `GET /api/workspace/orgs/{org}/models` — list models for an org
- `POST /api/workspace/orgs/{org}/models/{model}/scaffold` — create templates + load graph
- `PUT /api/settings` accepts `active_org` and `active_model`

5. **Chat context**

On `POST /api/chats/{id}/messages`, the server reads `AGENTS.md` and `MEMORY.md` from the active org/model path and prepends them to the harness prompt. The user message stored in SQLite remains the raw user text.

6. **Graph loading**

`DesktopGraph.load_org_model_context()` loads `ontology.ttl` and `instances.ttl` into a named Oxigraph graph `http://ontology.naas.ai/abi/desktop#context/{org}/{model}`. Switching active context clears the previous context graph before loading the new one. Activity triples (chats/messages) remain in the default graph.

7. **UI**

Settings → General exposes org/model selectors and a scaffold button. The Code explorer auto-expands the active org/model folders.

## Consequences

- Multiple org/model contexts can coexist inside one git workspace without replacing the workspace root.
- Agent instructions are versionable alongside code when the workspace is a git repo.
- SPARQL queries can target context graphs with `GRAPH <...#context/{org}/{model}> { ... }`.
- Org/model names are restricted to safe path segments (`[A-Za-z0-9][A-Za-z0-9._-]*`).
- Legacy workspaces without org folders continue to work; `default/default` is created automatically.
Loading
Loading