Skip to content

Clear the fork's architecture findings that have a mechanical fix - #74

Merged
dhx merged 1 commit into
mainfrom
fix/arch-findings
Nov 26, 2026
Merged

dhx merged 1 commit into
mainfrom
fix/arch-findings

Conversation

@dhx

@dhx dhx commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

💡 Change Scope

  • Small Change: Fast feedback, localized UI/logic, low-risk.
  • Large Change: New feature, cross-boundary logic, runtime-risk (persistence, IPC, lifecycle, recovery).

Small: imports, adapters and table lookups only, with no change in behavior. The structural part is split off into the draft spec #73.

📝 What Does This PR Do?

pnpm arch:check failed on main with 49 findings, almost all from fork features. Our ci.yml doesn't run it, so they piled up. This PR fixes the ones with a mechanical answer and records the rest in the ratchet as debt for #73. After it, arch:check is green.

  • Deep imports → context entries. Imports now go through src/contexts/<ctx>/<layer>/index.ts. Missing entries are added, with named re-exports only (contextEntryShape).
  • voiceSettings.ts moves to settings/domain, beside pluginSettings.ts. It's part of AgentSettings. Left in voice/domain, the two domain entries would import each other, and agentSettings.defaults reads DEFAULT_VOICE_SETTINGS at load time, which would risk a TDZ error.
  • window.opencoveApi behind adapters. utils/fileDropApi.ts covers canvas and terminal drop/paste. pluginNodeHeaderApi.ts covers the node-header poller.
  • Variant decisions read a field.
    • OpenCode's embedded TUI config is a per-provider launchEnv hook (opencode/OpenCodeLaunchEnv.ts), looked up by id in the catalog.
    • Foreground recognition is a descriptor capability (foregroundProcessRecognition, with isForegroundRecognizedProvider derived from it). The derived type must stay assignable to RecognizedForegroundAgent, so marking a provider the recognizer doesn't know is a compile error.
    • The plugin host reads PLUGIN_SESSION_NODE_KINDS.
    • The doc lists .includes on a named array as a detector gap. I didn't use it.
  • Ratchet. It takes the 7 lowered counts and records the composition seams as debt (below).

🏗️ Large Change Spec (Required if "Large Change" is checked)

Not applicable: Small change. The structural part is spec'd in #73.

📈 Ratchet rises

  • harness/architecture/ratchet.json architecture.contextForbiddenLayer 141 -> 146: debt: Spec draft: composition seams for the voice and plugin UI #73 voice and plugin UI composed across context presentation layers (settings → voice section, voice → settings group and workspace renderer types, terminal node → plugin header actions); needs slots, which the spec decides
  • harness/architecture/ratchet.json architecture.layerDependency 583 -> 593: debt: Spec draft: composition seams for the voice and plugin UI #73 voice and plugin renderer UI use app-renderer i18n, UI primitives and store, plus one more canvas-image infrastructure edge in workspace main-ipc register.ts (same pattern as upstream's two there)

🔗 Co-change partners left untouched

  • docs/ui/README.md (with src/app/renderer/shell/components/AppShellOverlays.tsx, 5/8): only import specifiers changed in AppShellOverlays; no UI change to document
  • src/app/renderer/shell/AppShell.tsx (with src/app/renderer/shell/components/AppShellOverlays.tsx, 5/8): import specifiers only; the overlays' props are unchanged
  • src/app/renderer/shell/components/ControlCenter.tsx (with src/app/renderer/shell/components/AppShellOverlays.tsx, 7/8): import specifiers only; nothing ControlCenter consumes changed
  • src/contexts/settings/presentation/renderer/settingsPanel/SettingsPanelContent.tsx (with src/contexts/settings/domain/agentSettings.types.ts, 8/11): the VoiceSettings import path changed, but the settings shape did not
  • src/contexts/settings/presentation/renderer/settingsPanel/settingsSearchIndex.definitions.ts (with src/contexts/settings/domain/agentSettings.types.ts, 6/11): no new setting; the search index is unaffected
  • src/contexts/settings/presentation/renderer/useSettingsPanelUpdaters.ts (with src/contexts/settings/domain/agentSettings.types.ts, 9/11): no new setting; the updaters are unaffected

✅ Delivery & Compliance Checklist

  • The local quick gate passes: pnpm verify:quick / pnpm pre-commit is green; any additional focused tests are reported above.
    • I ran the parts this environment supports: arch:check green, pnpm check (tsc) green, oxlint on the changed files green.
    • vitest related for all changed files: 995 files pass. 2 fail only because the sandbox install skipped native builds (Electron binary, node-pty). E2E didn't run here.
  • Full CI passes on the final revision before merge; local quick checks are not reported as full regression.
  • I have locked down the behavior with the strongest asset that fits, in this order: type or structure, mechanical check, runtime assertion, scenario test (or explicitly stated why none applies). Structure: entries, adapters and satisfies/derived types. Mechanical: arch:check with the ratchet.
  • I have strictly adhered to the DEVELOPMENT.md architectural boundaries.
  • I have attached a screenshot or screen recording (if this touches the UI). No visible change.
  • I have updated the documentation accordingly (if adding a feature or changing a contract). No contract changes.

Follow-up outside this PR: run arch:check in ci.yml, so the fork can't drift again. That needs workflow permissions, so it's done by hand.

https://claude.ai/code/session_01TUJxdvNkaMbgXq7YR53F8Y


Generated by Claude Code

arch:check was failing on main with 49 findings, almost all from fork
features, because our CI does not run it. This fixes the ones with a
mechanical answer and records the rest, which are composition seams, as
debt in the ratchet.

- Deep imports go through the target context's layer entry (index.ts);
  the missing entries are added with named re-exports only.
- voiceSettings moves from voice/domain to settings/domain, beside
  pluginSettings: it is part of AgentSettings, and keeping it in voice
  would make the two domain entries import each other.
- window.opencoveApi in the file-drop handlers and the plugin
  node-header poller goes through transport adapters (fileDropApi.ts,
  pluginNodeHeaderApi.ts), as the boundary rule asks.
- Provider and node-kind decisions read a table field instead of
  comparing ids: OpenCode's launch env is a per-provider hook looked up
  in the catalog, foreground recognition is a descriptor capability, and
  the plugin host reads PLUGIN_SESSION_NODE_KINDS.
- ratchet.json takes the lowered counts, and records the voice/plugin
  UI seams (contextForbiddenLayer 141 -> 146, layerDependency
  583 -> 593) as debt for a follow-up spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TUJxdvNkaMbgXq7YR53F8Y
@dhx
dhx merged commit 20b2a75 into main Nov 26, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants