Phase 005: vendor ArkScope, land the Arco style baseline, and fix bridge interpreter resolution

- Vendor ArkScope decorative layers (ScrambleTitle / IsometricWave) with provenance notes; decorative-only per AGENTS.md red lines
- Migrate theme tokens to Arco, register the Arco theme, and add hook adapter composables (useMessage / useDialog / useNotification) with matching signatures
- Sample pages: LoginView and AppSidebar on the new baseline; docs/arco-mapping.md and docs/ui-baseline.md land
- agent-bridge: prefer the PM-selected venv from facts.json over legacy in-tree venvs (legacy lacks the mcp extra, so every MCP server showed 0 tools / not connected)
- agent-bridge python (vendored, deliberate deviation): MCP discovery import fallback and pyyaml -> hermes_yaml so plugins and MCP work under the PM env; install the mcp extra via `hermes pm install --extra mcp`
- Chat-chain fragment: docs/chat-chain-changes/2026-10-17-phase005-arkscope-baseline.md

Verified: harness:check, test (2020 passed), test:e2e (30 passed), build all green; manual: plugins 100/0 warnings, MCP 6/6 servers connected with 104 tools.
This commit is contained in:
2026-10-17 09:45:30 +08:00
parent 4701bf0ad0
commit 4baccd5d88
106 changed files with 1493 additions and 221 deletions
+43
View File
@@ -0,0 +1,43 @@
import { existsSync, readdirSync, readFileSync, statSync } from 'fs'
import { join } from 'path'
import { describe, expect, it } from 'vitest'
const VENDOR_ROOT = 'packages/client/src/vendor/arkscore'
const listFiles = (dir: string): string[] =>
readdirSync(dir).flatMap((name) => {
const full = join(dir, name)
return statSync(full).isDirectory() ? listFiles(full) : [full]
})
describe('ArkScope vendored components', () => {
const vendorFiles = listFiles(VENDOR_ROOT)
it('contains no art assets (images, audio, video)', () => {
const assetPattern = /\.(png|jpe?g|webp|mp3|mp4)$/i
expect(vendorFiles.filter((file) => assetPattern.test(file))).toEqual([])
})
it('contains no references to upstream asset directories', () => {
for (const file of vendorFiles) {
const content = readFileSync(file, 'utf8')
expect(content, `${file} must not reference upstream assets`).not.toMatch(
/src\/assets|public\/assets/,
)
}
})
it('keeps PROVENANCE.md with the pinned upstream commit hash', () => {
const provenancePath = join(VENDOR_ROOT, 'PROVENANCE.md')
expect(existsSync(provenancePath)).toBe(true)
const provenance = readFileSync(provenancePath, 'utf8')
expect(provenance).toContain('78f3763b0a48608eae00c27ac837449a32bd93df')
expect(provenance).toContain('https://github.com/triplepiers/ArkScope')
})
it('vendors no more than 3 components (guards against bulk re-import)', () => {
const componentCount = vendorFiles.filter((file) => file.endsWith('index.vue')).length
expect(componentCount).toBeLessThanOrEqual(3)
})
})
+2
View File
@@ -24,6 +24,8 @@ vi.mock('naive-ui', () => ({
NSpin: { template: '<span class="spin" />' },
useMessage: () => mockMessage,
}))
// Component reads messages via the Arco adapter layer, not naive-ui.
vi.mock('@/composables/useMessage', () => ({ useMessage: () => mockMessage }))
import CopilotLoginModal from '@/components/hermes/models/CopilotLoginModal.vue'
+3
View File
@@ -76,6 +76,9 @@ vi.mock('naive-ui', () => ({
useMessage: () => mockMessage,
}))
// KanbanCreateForm reads messages via the Arco adapter layer, not naive-ui.
vi.mock('@/composables/useMessage', () => ({ useMessage: () => mockMessage }))
import KanbanCreateForm from '@/components/hermes/kanban/KanbanCreateForm.vue'
describe('KanbanCreateForm', () => {
+19
View File
@@ -33,6 +33,25 @@ vi.mock('@/api/auth', () => ({
}))
import LoginView from '@/views/LoginView.vue'
import { config } from '@vue/test-utils'
// Arco components are registered globally in main.ts; stub a-input as a
// real <input> so v-model setValue still works in tests.
config.global.stubs = {
'a-input': {
props: ['modelValue'],
emits: ['update:modelValue'],
methods: {
// Real a-input exposes focus(); LoginView calls it on mount.
focus() {},
},
template:
'<input :value="modelValue" @input="$emit(\'update:modelValue\', $event.target.value)" />',
},
'a-button': {
template: '<button type="button" v-bind="$attrs"><slot /></button>',
},
}
describe('LoginView password login', () => {
beforeEach(() => {
+3
View File
@@ -56,6 +56,9 @@ vi.mock('naive-ui', () => ({
useMessage: () => messageMock,
}))
// PluginsView reads messages via the Arco adapter layer, not naive-ui.
vi.mock('@/composables/useMessage', () => ({ useMessage: () => messageMock }))
import PluginsView from '@/views/hermes/PluginsView.vue'
describe('PluginsView management actions', () => {
@@ -145,6 +145,11 @@ vi.mock('naive-ui', () => ({
useDialog: () => dialogMock,
}))
// ProviderCard reads message/dialog through the Arco adapter layer, not
// naive-ui's composables, so the mock must target the adapter modules.
vi.mock('@/composables/useMessage', () => ({ useMessage: () => messageMock }))
vi.mock('@/composables/useDialog', () => ({ useDialog: () => dialogMock }))
vi.mock('@/stores/hermes/models', () => ({ useModelsStore: () => modelsStoreMock }))
vi.mock('@/stores/hermes/app', () => ({ useAppStore: () => appStoreMock }))
vi.mock('@/stores/hermes/chat', () => ({ useChatStore: () => chatStoreMock }))
+25 -23
View File
@@ -80,28 +80,33 @@ vi.mock('@/components/common/RouteLinkItem.vue', () => ({
},
}))
vi.mock('naive-ui', async () => {
const actual = await vi.importActual<any>('naive-ui')
return {
...actual,
useMessage: () => ({
success: vi.fn(),
error: vi.fn(),
}),
NButton: {
template: '<button v-bind="$attrs"><slot /></button>',
},
NModal: {
props: ['show'],
template: '<div v-if="show" class="n-modal-stub"><slot /></div>',
},
NSelect: {
template: '<div />',
},
}
})
vi.mock('naive-ui', () => ({
// AppSidebar no longer imports naive-ui; keep the module inert for any
// transitive import during the Arco migration.
useMessage: () => ({
success: vi.fn(),
error: vi.fn(),
}),
}))
import AppSidebar from '@/components/layout/AppSidebar.vue'
import { config } from '@vue/test-utils'
// Arco components are globally registered in main.ts; register test stubs
// here with the same contract the sidebar relies on.
config.global.stubs = {
'a-button': {
template: '<button class="a-button-stub" v-bind="$attrs"><slot /></button>',
},
'a-modal': {
props: ['visible'],
emits: ['update:visible'],
template: '<div v-if="visible" class="a-modal-stub"><slot /></div>',
},
'a-tag': {
template: '<span class="a-tag-stub"><slot /></span>',
},
}
function fakeJwt(payload: Record<string, unknown>) {
return `header.${btoa(JSON.stringify(payload)).replace(/=/g, '')}.signature`
@@ -131,7 +136,6 @@ describe('AppSidebar navigation', () => {
ModelSelector: true,
LanguageSwitch: true,
ThemeSwitch: true,
NButton: true,
},
},
})
@@ -150,7 +154,6 @@ describe('AppSidebar navigation', () => {
ModelSelector: true,
LanguageSwitch: true,
ThemeSwitch: true,
NButton: true,
},
},
})
@@ -179,7 +182,6 @@ describe('AppSidebar navigation', () => {
ModelSelector: true,
LanguageSwitch: true,
ThemeSwitch: true,
NButton: true,
},
},
})