Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ec7a800
feat(desktop): scaffold runnable ctx Desktop shell (Sub-project B)
hamzaerbay May 31, 2026
3cb4ca4
feat(desktop): add nav shell + Tasks screen
hamzaerbay May 31, 2026
00092a9
feat(desktop): add Decisions screen (browse + ADR authoring)
hamzaerbay May 31, 2026
8670c13
feat(desktop): add Learnings screen (browse + authoring)
hamzaerbay May 31, 2026
0c41612
feat(desktop): add Context Packet screen (budget slider + preview)
hamzaerbay May 31, 2026
c65c36e
feat(desktop): add Journal timeline + doctor health pill
hamzaerbay May 31, 2026
838d90b
feat(desktop): add project switcher (folder dialog + recents)
hamzaerbay May 31, 2026
23618f0
feat(desktop): fs-watch auto-refresh on external .context writes
hamzaerbay May 31, 2026
e79639d
docs(context): capture ctx Desktop architecture decisions + gotchas
hamzaerbay May 31, 2026
9016013
feat(desktop): workspace scan + project switcher dropdown
hamzaerbay May 31, 2026
5eac8bd
refactor(desktop): drop manual path field; tidy workspace top bar
hamzaerbay May 31, 2026
65a86db
fix(desktop): collect target section when adding a task
hamzaerbay May 31, 2026
aa8d214
fix(desktop): complete tasks by number; show doctor warnings on hover
hamzaerbay May 31, 2026
95d2b72
feat(desktop): add Health screen with guided doctor fixes
hamzaerbay May 31, 2026
9a0c16d
docs(desktop): add build/run guide for engineers
hamzaerbay May 31, 2026
bc9f66c
feat(desktop): add Constitution + Conventions screens
parlakisik Jun 4, 2026
35260de
feat(desktop): add Drift screen
parlakisik Jun 4, 2026
816c510
feat(desktop): add global Search screen
parlakisik Jun 4, 2026
240fa05
feat(desktop): add Knowledge Base browser
parlakisik Jun 4, 2026
2152ee7
feat(desktop): add Reminders, Scratchpad, and Hub screens
parlakisik Jun 4, 2026
1da8c72
Adding some information
parlakisik Jun 7, 2026
9a89f26
fix(desktop): race-safe screen loads and stable task keys
parlakisik Jun 8, 2026
942cbfb
feat(desktop): multi-project dashboard and multiple workspaces
parlakisik Jun 8, 2026
c34ff28
chore(desktop): use the ctx fish logo for the app icon
parlakisik Jun 8, 2026
5fae90d
fix(desktop): set a Content-Security-Policy for the webview
parlakisik Jun 8, 2026
6e5775c
fix(desktop): harden the multi-project client
parlakisik Jun 8, 2026
d1b374c
fix(desktop): scope dashboard watch to its own event channel
parlakisik Jun 8, 2026
4e04b1e
feat(desktop): render tables, links, and code fences in markdown
parlakisik Jun 8, 2026
77160fb
fix(desktop): keep wide markdown tables inside the doc panel
parlakisik Jun 8, 2026
61e8eff
fix(desktop): refresh the top-bar doctor pill live
parlakisik Jun 8, 2026
da80fd5
fix(desktop): harden the IPC command layer against blocking, races, a…
parlakisik Jun 11, 2026
0b32d30
docs(context): refresh graph-verified architecture data for the regro…
parlakisik Jun 11, 2026
33cb4b1
fix(desktop): strip HTML comments to a fixpoint
parlakisik Jun 11, 2026
dcbc824
chore: refresh GitNexus index stats in AGENTS.md and CLAUDE.md
parlakisik Jun 11, 2026
4938c8c
Merge origin/main into feat/ctx-desktop
parlakisik Jun 11, 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
77 changes: 48 additions & 29 deletions .context/ARCHITECTURE-PRINCIPAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,47 +451,66 @@ but shape the architecture significantly:
are skills and others are prompts, and when to use which, is
tribal knowledge.

## Domain Clustering Comparison (enriched 2026-04-03 via GitNexus)
## Domain Clustering Comparison (enriched 2026-06-09 via GitNexus)

GitNexus auto-detected 94 functional clusters from the call graph.
GitNexus auto-detected 100 functional clusters from the call graph
(index @ 60d8e823; was 94 at the 2026-04-03 enrichment).
Comparing against the 5 manual DETAILED_DESIGN domain splits:

| Manual Domain | GitNexus Clusters | Match | Notes |
|---------------|-------------------|-------|-------|
| Foundation | Format (97%), Sysinfo (82%), Rc (57%), Io (53%) | Partial | Format is extremely cohesive; Rc and Io are looser than expected |
| Domain | Drift (263 sym, 84%), Session (110, 88%), Memory (91, 61%), Parser (89, 70%), Journal (74, 47%), Trace (59, 68%) | Partial | Drift is the largest cluster — pulls in cli/drift + write/drift. Journal is low cohesion (47%) |
| MCP | Server (49, 90%) | Yes | Tight, well-bounded cluster |
| CLI | Root (85, 83%), Initialize (72, 50%), Bootstrap (41, 67%) | Partial | Initialize is low cohesion — it touches too many domains during deployment |
| Output | Lock (42, 76%), Notify (46, 65%), Watch (39, 57%) | No | GitNexus doesn't group write/* as a cluster; it groups by behavioral coupling instead |
| Manual Domain | GitNexus Clusters (top) | Match | Notes |
|---------------|-------------------------|-------|-------|
| Foundation | Flagbind (170, 93%), Git (111, 93%), Rc (146, 53%), Format (106, 26%), Store (65, 47%) | Partial | Flagbind and Git are extremely cohesive. Format collapsed from 97% to 26% cohesion — its symbols are now dispersed across consumers |
| Domain | Memory (91, 60%), Trace (80, 68%), Journal (97, 52%), Parser (64, 75%), Add (67, 62%) | Partial | Journal still low cohesion (52%) — site and import pipelines remain two subsystems sharing a name |
| MCP | Server (103, 78%), Extract (61, 67%) | Yes | Server cluster doubled in size (49 -> 103 symbols) but stays well-bounded |
| CLI | Pad (243, 74%), Skill (237, 77%), Initialize (89, 47%), Nudge (72, 79%), Audit (149, 68%) | Partial | Pad and Skill are now the two largest clusters in the codebase. Initialize remains the structural low-cohesion deployment orchestrator |
| Output | (no matching clusters) | No | Unchanged: write/* and err/* are leaves, not communities |

### Coverage Gaps (clusters with no manual domain)

These clusters exist in the call graph but have no section in any
DETAILED_DESIGN domain file — the codebase outgrew the 2026-04
architecture map:

- **Hub (118 symbols, 73%)** — `internal/hub` + `cli/hub` server,
persistence, admin setup. Entirely new subsystem.
- **Steering (95, 61%)** — steering files + drift checks + CLI.
- **Trigger (72, 63%)** — trigger add/list lifecycle.
- Also absent: kb (editorial pipeline), connection, handover,
message, loop, fmt, permission — visible in the bootstrap
registration inventory (42 commands vs 34 documented).

⚠ Recommend a `/ctx-architecture` refresh pass before the next
enrichment: ~8 command families have no manual baseline to enrich.

### Hidden Coupling (GitNexus groups, manual splits)

- **Drift cluster (263 symbols)** includes symbols from drift/,
cli/drift/, write/drift/, and context/load — all tightly coupled
through the Detect() -> load.Do() -> report chain. Manual split
puts these in 3 different domains.
- **Pad cluster (200 symbols)** is self-contained — pad, crypto,
and store form a tight unit. Manual split disperses these across
Foundation (crypto) and Domain (pad).
- **Pad cluster (243 symbols, 74%)** — still self-contained (pad,
crypto, store history) and still dispersed across Foundation
(crypto) and Domain in the manual split.
- **Rc cluster (146 symbols, 53%)** — now pulls in config profile
detection and token/window logic; the manual split keeps rc as
a small Foundation leaf, but the graph sees it as a mid-size
shared service (rc.RC d=1: 34 across 8 modules).

### Artificial Grouping (GitNexus splits, manual groups)

- **Journal (47% cohesion)** — lowest cohesion cluster. The site
pipeline (zensical, CSS, nav links) and the import pipeline
(parser, state, execute) have minimal internal coupling. These
are effectively two separate subsystems sharing a command name.
- **Initialize (50% cohesion)** — touches every domain during
deployment (templates, hooks, skills, settings, vscode, makefile,
gitignore). Low cohesion is structural, not a bug — it's a
deployment orchestrator, not a domain.
- **Journal (52% cohesion)** — unchanged finding: site pipeline
and import pipeline have minimal internal coupling.
- **Initialize (47% cohesion)** — unchanged: deployment
orchestrator, low cohesion is structural, not a bug.
- **Format (26% cohesion)** — new: the format helpers no longer
form a community at all; each helper is coupled to its caller,
not to sibling helpers. The manual Foundation grouping is an
organizational convenience here.

### Key Insight

The write/* and err/* layers don't form clusters because they have
no internal coupling — each write package is called by exactly one
CLI command. GitNexus correctly identifies them as leaves, not
communities. The manual "Output" domain is an organizational
convenience, not an architectural boundary.
Unchanged from 2026-04: write/* and err/* don't form clusters
because each package is called by exactly one CLI command — they
are leaves. The new top-level fact is growth-driven: the two
largest clusters (Pad 243, Skill 237) and the new Hub/Steering/
Trigger/KB subsystems all post-date the manual architecture pass,
so the map's blind spots are now bigger than its mismatches.

## Questions That Would Sharpen This Analysis

Expand Down
70 changes: 43 additions & 27 deletions .context/CHEAT-SHEETS.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,36 +208,52 @@ Common failure modes:

---

## Execution Flow Index (enriched 2026-04-03 via GitNexus)

_Auto-detected from the call graph. Complements the manually
written cheat sheets above._

Top cross-community flows (spanning multiple domains):

| Flow | Steps | Entry Point | Key Symbols |
|------|-------|-------------|-------------|
| Deploy -> ContextDir | 10 | initialize | DeployTemplates, Do, ContextDir |
| Deploy -> Symlinks | 10 | initialize | DeployTemplates, Do, Symlinks |
| Write -> Init | 10 | MCP server | Serve, Init, SafeWriteFile |
| Write -> Server | 10 | MCP server | Serve, New, Do |
| Write -> TokenBudget | 10 | MCP server | Serve, TokenBudget, Do |
| Run -> Init | 10 | CLI commands | Run, Do, Init |
| Sync -> ContextDir | 10 | sync cmd | Run, Do, ContextDir |
| Run -> Text | 9 | CLI commands | Run, Do, desc.Text |
| Run -> URI | 9 | CLI commands | Run, catalog, URI |
| Run -> NotFoundError | 8 | CLI commands | Run, Do, NotFound |
## Execution Flow Index (enriched 2026-06-09 via GitNexus)

_Auto-detected from the call graph (203 flows in index @ 60d8e823).
Complements the manually written cheat sheets above._

Top cross-community flows (spanning multiple domains). Nearly all
deep flows terminate at desc.Text — text lookup is the universal
last step of every command:

| Flow | Steps | Entry Point |
|------|-------|-------------|
| RunShow -> Text | 10 | internal/cli/journal/core/source/show.go |
| Run -> Text (journal import) | 9 | internal/cli/journal/cmd/importer/run.go |
| Run -> Text (checkversion hook) | 9 | internal/cli/system/cmd/checkversion/run.go |
| Run -> Text (journal site) | 8 | internal/cli/journal/cmd/site/run.go |
| Run -> Text (checkcontextsize hook) | 8 | internal/cli/system/cmd/checkcontextsize/run.go |
| Run -> Text (pad merge) | 8 | internal/cli/pad/cmd/merge/run.go |
| BuildVault -> Text (obsidian export) | 8 | internal/cli/journal/core/obsidian/vault.go |
| Run -> Text (pad tag) | 8 | internal/cli/pad/cmd/tag/run.go |
| Run -> Text (context load gate hook) | 7 | internal/cli/system/cmd/contextloadgate/run.go |
| Run -> Text (setup) | 7 | internal/cli/setup/cmd/root/run.go |
| Run -> Text (add) | 7 | internal/cli/add/core/run/run.go |

### Multi-Flow Hotspots

Symbols participating in 3+ flows (high-impact modification points):
Symbols participating in 3+ flows (high-impact modification
points), counted via STEP_IN_PROCESS edges:

| Symbol | Flows | Location |
|--------|-------|----------|
| desc.Text | 53 | internal/assets/read/desc/desc.go:75 |
| load.Do | 100+ | internal/context/load/loader.go:34 |
| SafeWriteFile | 69 callers | internal/io/security.go |
| rc.ContextDir | 20+ | internal/rc/rc.go |
| validate.Symlinks | 10+ | internal/validate/path.go |
| err/context.NotFound | 30+ | internal/err/context/context.go |
| rc.RC | 15+ | internal/rc/rc.go |
| desc.Text | 58 | internal/assets/read/desc/desc.go |
| check.FullPreamble | 40 | internal/cli/system/core/check/full_preamble.go |
| check.Preamble | 39 | internal/cli/system/core/check/input.go |
| load.Do | 28 | internal/context/load/loader.go:34 |
| session.ReadInput | 26 | internal/cli/system/core/session/session.go |
| err/context.StatFailed | 25 | internal/err/context/context.go |
| rc.ContextDir | 25 | internal/rc/rc.go |
| nudge.Paused | 21 | internal/cli/system/core/nudge/pause.go |
| hub.Unmarshal | 20 | internal/hub/types.go |
| rc.RC | 20 | internal/rc/rc.go |
| io.cleanAndValidate | 15 | internal/io/validate.go |
| io.SafeReadUserFile | 14 | internal/io/security.go |
| nudge.PauseMarkerPath | 14 | internal/cli/system/core/nudge/pause.go |

New since 2026-04-03: the system-hook preamble pair
(FullPreamble/Preamble at 40/39 flows) and nudge pause gating
(21/14 flows) are now top-tier integration points — every hook
subcommand routes through them. hub.Unmarshal/Name (20/18) mark
the hub subsystem as a new flow participant.
23 changes: 14 additions & 9 deletions .context/CONVERGENCE-REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _Generated 2026-04-03 by /ctx-architecture principal_
| internal/format | 0.80 | 🟡 Solid | All functions cataloged |
| internal/parse | 0.80 | 🟡 Solid | Small package, fully understood |
| internal/sanitize | 0.80 | 🟡 Solid | Small package, fully understood |
| internal/validate | 0.70 | 🟡 Solid | API inferred; source not directly read this run |
| internal/validate | 0.75 | 🟡 Solid | Enriched 2026-06-09: Symlinks() is a single-caller chokepoint on the context-load path (9 flows) |
| internal/inspect | 0.75 | 🟡 Solid | API cataloged from survey |
| internal/flagbind | 0.85 | 🟡 Solid | Pattern and all variants documented |
| internal/exec/* | 0.80 | 🟡 Solid | All 5 wrappers surveyed |
Expand All @@ -39,7 +39,7 @@ _Generated 2026-04-03 by /ctx-architecture principal_
| internal/write/* | 0.80 | 🟡 Solid | Pattern understood; not all 46 packages individually read |
| internal/err/* | 0.80 | 🟡 Solid | Pattern understood; not all 35 packages individually read |
| internal/audit | 0.75 | 🟡 Solid | Purpose understood; individual test files not read |
| internal/compliance | 0.70 | 🟡 Solid | Purpose understood; tests not read |
| internal/compliance | 0.75 | 🟡 Solid | Enriched 2026-06-09: 29 checks cataloged across 4 test files; section added to DETAILED_DESIGN-cli.md |

## By Domain

Expand All @@ -50,7 +50,7 @@ _Generated 2026-04-03 by /ctx-architecture principal_
| MCP | 1 (15 sub-pkgs) | 1/1 | 0.90 |
| CLI | 2 (34 commands) | 0/2 | 0.78 |
| Output (write, err) | 2 | 0/2 | 0.80 |
| Quality (audit, compliance) | 2 | 0/2 | 0.73 |
| Quality (audit, compliance) | 2 | 0/2 | 0.75 |

## Overall

Expand Down Expand Up @@ -142,12 +142,17 @@ which sources to trust.

## Enrichment Summary

_Last enrichment: 2026-04-03 via GitNexus (index: bf42b1f6)_
_Last enrichment: 2026-06-09 via GitNexus (index @ 60d8e823,
27,927 symbols, 203 flows; prior enrichment 2026-04-03 @ bf42b1f6)_

| Phase | Items Processed | Key Findings |
|-------|----------------|--------------|
| Danger zones | 25 entries | 4 upgraded to CRITICAL (desc.Text, SafeWriteFile, DescKey-YAML, DiscoverPath); 1 new (load.Do) |
| Extension points | 14 patterns | Session parser (4 registrations), CLI commands (34), MCP tools (11), MCP prompts (5), agent setup (5) |
| Execution flows | 257 total, 10 indexed | 7 multi-flow hotspots identified (desc.Text at 53 flows is #1) |
| Clustering | 94 clusters vs 5 manual domains | Journal (47%) and Initialize (50%) are low-cohesion; write/err are leaves, not communities |
| Shallow modules | 0 enriched | All modules already >= 0.70; no confidence bumps warranted |
| Danger zones | 26 entries, 9 symbols re-verified | desc.Text d=1 now 940 (was "30+"); SafeWriteFile 95 (was 69); rc.RC new CRITICAL (d=1: 34, 8 modules); DiscoverPath downgraded CRITICAL->HIGH (d=1: 4, single domain); 3 undercount flags (load.Do, Serve, ValidateAndWrite) |
| Extension points | 14 patterns | CLI commands 34->42, MCP tools 11->15, drift checks 7->12, setup deployers 5->8 (cline, cursor, kiro, opencode); parsers/prompts unchanged (4/5) |
| Execution flows | 203 total, 11 indexed | 13 multi-flow hotspots; new top-tier: check.FullPreamble (40) and check.Preamble (39) — every hook routes through them |
| Clustering | 100 clusters vs 5 manual domains | Coverage gaps now dominate mismatches: Hub, Steering, Trigger, kb + ~8 command families have no manual baseline; Format cohesion collapsed 97%->26% |
| Shallow modules | 2 enriched | validate 0.70->0.75 (single-caller chokepoint), compliance 0.70->0.75 (29 checks cataloged) |

⚠ The codebase has outgrown the 2026-04 architecture baseline
(19.3k -> 27.9k symbols). Recommend `/ctx-architecture` refresh
before the next enrichment pass.
Loading
Loading