[工程][Provider] 统一 Provider Catalog 并防止元数据漂移 #4

Closed
opened 2026-09-15 00:39:39 +08:00 by CoderLambert · 1 comment
CoderLambert commented 2026-09-15 00:39:39 +08:00 (Migrated from github.com)

Execution State

DONE

Observed base: main@536e657
Execution base: main@4510833

Problem

Provider id、name、URL、host、origin、mode 和默认选择状态分别维护在 popup、workspace、service worker 和 adapter 中,容易发生语义漂移。

Target

由共享 Provider Catalog 提供运行时元数据,并由契约测试验证 Catalog、Manifest、adapter 和入口脚本加载顺序的一致性。

Invariants

  • 保持 Manifest V3 兼容。
  • 不扩大 host permissions 或 DNR 范围。
  • 不改变 Provider UI、消息协议和 Grok 顶层标签页架构。
  • Provider selector 仍归属各自 adapter。

Acceptance Criteria

  • popup、workspace、service worker 使用共享 Catalog。
  • Catalog 覆盖现有八个 Provider 及其 host/origin/mode/default 元数据。
  • 测试验证 Manifest host coverage、adapter host coverage 和脚本加载顺序。
  • Catalog 元数据数组不可被运行时修改。

Validation

Focused:

  • npm test:10/10 passed

Repository / Regression:

  • npm run check:passed
  • npm --prefix apps/browser-extension run check:passed

Package:

  • npm run package:extension:passed
  • v2.1.4 ZIP contains shared/provider-catalog.js

Changes

  • Add apps/browser-extension/shared/provider-catalog.js.
  • Consume Catalog from popup, workspace and service worker.
  • Add provider catalog contract tests.
  • Document the shared metadata boundary.

Commit

  • 4510833 refactor(extension): centralize provider catalog

Known Limitations

  • Authenticated browser-page selector validation still requires a browser session.
## Execution State DONE Observed base: main@536e657 Execution base: main@4510833 ## Problem Provider id、name、URL、host、origin、mode 和默认选择状态分别维护在 popup、workspace、service worker 和 adapter 中,容易发生语义漂移。 ## Target 由共享 Provider Catalog 提供运行时元数据,并由契约测试验证 Catalog、Manifest、adapter 和入口脚本加载顺序的一致性。 ## Invariants - 保持 Manifest V3 兼容。 - 不扩大 host permissions 或 DNR 范围。 - 不改变 Provider UI、消息协议和 Grok 顶层标签页架构。 - Provider selector 仍归属各自 adapter。 ## Acceptance Criteria - [x] popup、workspace、service worker 使用共享 Catalog。 - [x] Catalog 覆盖现有八个 Provider 及其 host/origin/mode/default 元数据。 - [x] 测试验证 Manifest host coverage、adapter host coverage 和脚本加载顺序。 - [x] Catalog 元数据数组不可被运行时修改。 ## Validation Focused: - npm test:10/10 passed Repository / Regression: - npm run check:passed - npm --prefix apps/browser-extension run check:passed Package: - npm run package:extension:passed - v2.1.4 ZIP contains shared/provider-catalog.js ## Changes - Add apps/browser-extension/shared/provider-catalog.js. - Consume Catalog from popup, workspace and service worker. - Add provider catalog contract tests. - Document the shared metadata boundary. ## Commit - 4510833 refactor(extension): centralize provider catalog ## Known Limitations - Authenticated browser-page selector validation still requires a browser session.
CoderLambert commented 2026-09-15 00:39:51 +08:00 (Migrated from github.com)

[HANDOFF]

STATUS: DONE
ISSUE: #4
LANE: provider-runtime
EXECUTION_BASE: main@536e657
BRANCH: main
HEAD: 4510833
PR: none
OWNED_SCOPE: shared Provider Catalog and catalog contract tests
SENSITIVE_SURFACES_TOUCHED: none
CHANGED: shared/provider-catalog.js; popup/workspace/service-worker entry points; provider catalog tests
AC_STATUS: complete; all acceptance criteria checked in the issue body
VALIDATION: npm test (10/10); npm run check; extension check; package:extension
SECURITY_PERMISSION_DELTA: none
KNOWN_RISKS: authenticated provider selector validation remains browser-dependent
BLOCKERS: none
NEXT: browser-backed selector validation

[HANDOFF] STATUS: DONE ISSUE: #4 LANE: provider-runtime EXECUTION_BASE: main@536e657 BRANCH: main HEAD: 4510833 PR: none OWNED_SCOPE: shared Provider Catalog and catalog contract tests SENSITIVE_SURFACES_TOUCHED: none CHANGED: shared/provider-catalog.js; popup/workspace/service-worker entry points; provider catalog tests AC_STATUS: complete; all acceptance criteria checked in the issue body VALIDATION: npm test (10/10); npm run check; extension check; package:extension SECURITY_PERMISSION_DELTA: none KNOWN_RISKS: authenticated provider selector validation remains browser-dependent BLOCKERS: none NEXT: browser-backed selector validation
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lambert/ai-parallel#4