Skip to content

Land Runtime v2 architecture and AgentRun wiring - #8

Merged
likun666661 merged 7 commits into
mainfrom
runtime-v2-architecture-doc
Jun 14, 2026
Merged

Land Runtime v2 architecture and AgentRun wiring#8
likun666661 merged 7 commits into
mainfrom
runtime-v2-architecture-doc

Conversation

@likun666661

Copy link
Copy Markdown
Member

Summary

  • land the Runtime v2 architecture evolution branch on main
  • include the RuntimeEvent/adapter/RuntimeRunner skeleton and contract fixes
  • include the hot-path SessionManager -> RuntimeRunner -> AgentRun wiring from PR Wire RuntimeRunner through SessionManager #7

Branch cleanup

  • removed obsolete upstream branches: runtime-kernel-upstream, runtime-v2-implementation-pr, runtime-v2-agentrun-wiring-followup, runtime-v2-contract-fixes
  • removed obsolete fork branches: runtime-kernel-upstream, runtime-v2-implementation-pr, runtime-v2-agentrun-wiring-followup
  • fast-forwarded fork runtime-v2-architecture-doc to the same e2bce5e head as upstream

Verification

Latest hot-path follow-up verification before this PR:

  • npm run typecheck
  • npm run build
  • npm run test --workspaces --if-present
  • git diff --check upstream/runtime-v2-architecture-doc..HEAD

Expected test counts from that run: core 614, storage 76, runtime 397, desktop 1399, all 0 failed / 0 skipped.

@likun666661
likun666661 merged commit 0cdcdcb into main Jun 14, 2026
@jackwener
jackwener deleted the runtime-v2-architecture-doc branch June 15, 2026 13:23
jackwener pushed a commit that referenced this pull request Jun 21, 2026
Land Runtime v2 architecture and AgentRun wiring
jackwener pushed a commit that referenced this pull request Jun 21, 2026
Land Runtime v2 architecture and AgentRun wiring
jackwener added a commit that referenced this pull request Jun 21, 2026
…inese-first labels, stub views for non-implemented modules

Implements the IA refactor WAWQAQ locked in msg `b86b47d1`: the
sidebar's second part is now a top-level 5-module nav (会话 / 搜索 /
计划 / 技能 / 每日回顾) rather than session filter tabs. Pinned /
Archived / Chats become internal Sessions filters. Settings stays at
the bottom; a placeholder 版本更新 button sits above it.

Per xuan `47e204f2` priorities applied directly:
  - #2 IA: top-level modules; filters moved into Sessions.
  - #4 visual hierarchy: nav rows reuse `.maka-nav-row` (transparent
    bg, accent-tinted selected state, no card stacking).
  - #5 Chinese-first naming throughout the surface; English stays
    as accessible keywords in the command palette.
  - #7 Search nav item placeholder for Phase 4 modal; clicking now
    switches the section to `'search'` and renders an empty-state
    stub. Phase 4 will swap the section switch for an
    `onOpenSearchModal()` callback (already plumbed through props).
  - #8 disabled / hover / focus states pinned for the Update
    placeholder (aria-disabled + data-disabled + CSS dim).

== Type-level changes ==

`packages/ui/src/components.tsx`:

  export type NavSelection =
    | { section: 'sessions'; filter: SessionFilter }
    | { section: 'search' }
    | { section: 'automations' }
    | { section: 'skills' }
    | { section: 'daily-review' };

  // New module label map (Chinese-first):
  const MODULE_NAV_LABEL: Record<NavSelection['section'], string> = {
    sessions: '会话', search: '搜索', automations: '计划',
    skills: '技能', 'daily-review': '每日回顾',
  };

== SessionListPanel JSX shape ==

  <aside>
    <header>新建对话 button</header>
    <nav.maka-sidebar-modules>          5 module nav rows  (NEW)
    <div.maka-session-filter hidden={!sessions}>      Pinned/Chats/Archived
    <div.maka-session-search hidden={!sessions}>      session-name search
    <section.maka-session-list>
      ├ skills view (existing, reused for `selection.section==='skills'`)
      ├ sessions view (existing, when 'sessions')
      └ STUB_VIEWS[section] (search / automations / daily-review)
    <footer.maka-session-panel-footer>
      ├ 版本更新 button (NEW; UI placeholder, aria-disabled by default)
      └ 设置 button (existing; renamed from "Settings")
  </aside>

Skills no longer appears in the footer — it lives in the top-level
module nav alongside the other 4. The chat surface (`ChatPanel`)
shows a neutral "从 会话 选择对话" message when the active section
is `search` / `automations` / `daily-review`.

== Persistence ==

`apps/desktop/src/renderer/main.tsx readNavSelection`: recognizes
`search` / `automations` / `daily-review` as valid section variants
when restoring from localStorage. Corrupted entries fall back to
`{ section: 'sessions', filter: 'chats' }`.

== CSS ==

`apps/desktop/src/renderer/styles.css`:

  .maka-session-panel grid-template-rows:
    auto auto auto auto minmax(0, 1fr) auto;

  /* Row 2 is the new module nav. Phase 1's `.maka-session-list` grid
   * fix (auto + minmax(0, 1fr)) and `.maka-list-stack` overflow:auto
   * are preserved verbatim. */

  .maka-sidebar-modules { display: grid; gap: 2px; padding: 4px 8px; }

  /* Disabled nav-row dimming (used by 版本更新 placeholder). */
  .maka-nav-row[aria-disabled="true"],
  .maka-nav-row[data-disabled="true"] { cursor: not-allowed; opacity: 0.55; }
  .maka-nav-row[aria-disabled="true"]:hover,
  .maka-nav-row[data-disabled="true"]:hover { background: transparent; }

== Tests ==

  core 392 / storage 50 / runtime 103 / desktop 645 = 1190 pass.
  Typecheck + build green across all workspaces.
  Phase 1's CSS contract test still passes (grid + min-height + overflow
  pins survive the IA refactor).

== Out of scope (Phase 3 / 4) ==

  - Session row slimming (~85px → ~32px). Phase 3.
  - Search modal implementation. Phase 4 (resurrects `useThreadSearch`
    from `yuejing/pr-search-2.6`; swaps current Search stub for modal
    trigger).
  - Real auto-update wiring (Electron updater). Future PR-AUTOUPDATE-0.
  - Automations / Daily Review feature implementation. Future
    PR-TIME-* / PR-DAILY-*.

Anchors:
  WAWQAQ msg `b86b47d1` + `f5f6f834` (IA + Skills inclusion + Update button).
  xuan msg `47e204f2` (8-point priority list); `dc790a54` (Phase 1 scope refinement);
  `adcf0c95` (per-phase gate workflow).
  kenji msg `fcd9c54f` (consolidated packet design); `0f7bb872` (scroll P0 architecture).

Branch base: `655a09f` (Phase 1 + fixup, on top of main `809875a`).
jackwener pushed a commit that referenced this pull request Jun 21, 2026
Land Runtime v2 architecture and AgentRun wiring
jackwener pushed a commit that referenced this pull request Jun 21, 2026
Land Runtime v2 architecture and AgentRun wiring
jackwener added a commit that referenced this pull request Jun 24, 2026
Follow-up to PR #224. After scanning a wider set of `components.tsx`
exports, 4 more had zero external consumers:

  - `SkillEntry` (line 341 — skill catalog row shape)
  - `EmptyStateProps` (line 799 — empty-state component props)
  - `EmptyState` (line 811 — the component itself, used 10x internally)
  - `SearchModalCloseOptions` (line 2804 — internal close-event payload)

`SkillEntry`: appears 5x in components.tsx (parent panel props,
descriptor function, render helper) — internal-only.

`EmptyState` + `EmptyStateProps`: PR-EMPTY-STATE-COMPONENT-0
(2026-05-19 task #8) extracted the shared component anticipating
multi-file reuse. Three months later still only used inside
components.tsx itself (10 call sites), all the surfaces that wanted
empty states ended up using it via that route. Demote until a real
external consumer materializes; re-add `export` is one-line then.

`SearchModalCloseOptions`: 1 internal usage in the modal's `onClose`
type — no consumer.

Verified zero external imports of each name via:
  grep -rE "^import.*\\b<name>\\b" --include="*.tsx" --include="*.ts" apps/desktop/src packages/ui/src

Zero runtime impact (TS type elision). Zero visual change. 4 fewer
names in the `@maka/ui` barrel's IDE auto-import surface.

Same approach as PR #224 (5 demotions); this round catches what
the first sweep missed.
anaconda110 added a commit to anaconda110/maka-agent that referenced this pull request Aug 3, 2026
…egroundServiceType (P1 apache#8)

Android 14 (targetSdk 34) requires a foreground service to declare a
foregroundServiceType on the <service> element AND hold the matching
FOREGROUND_SERVICE_<type> sub-permission; the base FOREGROUND_SERVICE permission
alone is insufficient and StartForegroundService crashes at runtime. The
intended use is long-running runtime-host sessions (data-sync work), so the
dataSync sub-permission is declared now. The <service> element with
android:foregroundServiceType="dataSync" will be added when the service is
implemented; declaring the sub-permission now keeps the manifest Android-14-
compliant the moment the service is wired up.

Aligns with .hive/android-code-review.md P1 apache#8.
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.

1 participant