diff --git a/.changeset/bind-sdk-transport.md b/.changeset/bind-sdk-transport.md new file mode 100644 index 00000000..0242c791 --- /dev/null +++ b/.changeset/bind-sdk-transport.md @@ -0,0 +1,9 @@ +--- +'@inkcre/core': patch +--- + +独立 SDK 的二进制存储和外部观测请求会沿用构造连接时的 Fetch,调用方稍后更换全局 Fetch 时,已有客户端仍通过原传输访问该连接。 + +持续运行的 Web Peer 在已有 JWT 到期后会在下一次数据库或 Peer 请求时重新签名。 + +切换连接时,发往新数据库的请求使用新连接的密钥,即使旧令牌仍在有效期内。 diff --git a/.changeset/clear-web-heading-hierarchy.md b/.changeset/clear-web-heading-hierarchy.md new file mode 100644 index 00000000..082bd821 --- /dev/null +++ b/.changeset/clear-web-heading-hierarchy.md @@ -0,0 +1,7 @@ +--- +'@inkcre/web': patch +--- + +补齐来源页面的一级标题,并修正 Peer 与扩展卡片的标题层级。将扩展卡片内的 Peer 控制行标记为具名分组,避免多张卡片产生同名地标,使辅助技术能够按页面和卡片导航,同时保留现有视觉样式。 + +图谱预览不再将有限场景的可见边当作节点的完整关系集合缓存,修复重新打开邮件后无法读取已下载内嵌图片等场景之外的持久化内容。 diff --git a/.changeset/direct-native-build-config.md b/.changeset/direct-native-build-config.md new file mode 100644 index 00000000..80cb548e --- /dev/null +++ b/.changeset/direct-native-build-config.md @@ -0,0 +1,6 @@ +--- +'@inkcre/ext-github': patch +'@inkcre/ext-twitter': patch +--- + +简化 MF 构建配置,保留既有可重定位制品及 Host 公开入口。 diff --git a/.changeset/quiet-mail-inline-images.md b/.changeset/quiet-mail-inline-images.md new file mode 100644 index 00000000..45eb16bf --- /dev/null +++ b/.changeset/quiet-mail-inline-images.md @@ -0,0 +1,7 @@ +--- +'@inkcre/ext-mail': patch +--- + +修复普通邮件隔离正文无法显示已下载 CID 图片的问题:将已材化的图片字节转换为正文专用 data URL,清除源邮件自带的 SVG 图像引用,保留禁止脚本与同源访问的 sandbox,以及远程图片阻断;MIME 条目的独立打开继续使用 Blob URL。 + +允许图谱预览与邮件详情共享同一 MIME 部件的只读加载,避免重新打开已下载图片时误报正在加载。刷新、显式材化和不同投影保持独立;进入自定义或递归内容前停止接纳共享读取,保留循环终止保护和自定义内容兼容。 diff --git a/.changeset/tidy-bilibili-anchor-recovery.md b/.changeset/tidy-bilibili-anchor-recovery.md new file mode 100644 index 00000000..9710ec44 --- /dev/null +++ b/.changeset/tidy-bilibili-anchor-recovery.md @@ -0,0 +1,5 @@ +--- +'@inkcre/ext-bilibili': patch +--- + +恢复收藏采集时分页查找已有来源锚点,避免来源更新失败后因数据库单页上限重复创建锚点。 diff --git a/.changeset/validate-empty-capture-graph.md b/.changeset/validate-empty-capture-graph.md new file mode 100644 index 00000000..da33cbf1 --- /dev/null +++ b/.changeset/validate-empty-capture-graph.md @@ -0,0 +1,5 @@ +--- +'@inkcre/ext-capture': patch +--- + +已存储的采集同时缺少材料和附注时显示读取错误。只有附注的采集仍可正常阅读。 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4e14f8d..f2ab83a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,9 +64,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Verify canonical candidate admission boundaries - run: node --test scripts/test-core-release.mjs - - name: Resolve admitted Core once to an immutable release id: release run: node scripts/resolve-core-release.mjs @@ -129,22 +126,8 @@ jobs: - name: 构建并校验相互兼容的 Host 与 MF 产物 run: pnpm build - - name: Verify independent SDK and Job observations - run: pnpm check:sdk && pnpm check:web - - - name: 验证 B 站收藏采集规则 - run: pnpm --filter @inkcre/ext-bilibili test - - - name: Verify independent MF publication - run: >- - node --test scripts/test-extension-publication.mjs scripts/test-core-sdk-publication.mjs - scripts/tests/independent-extension-release.test.mjs - scripts/tests/release-checkout.test.mjs - scripts/tests/core-sdk-compatibility.test.mjs - scripts/tests/pages-preview.test.mjs - scripts/tests/browser-automation-transport.test.mjs - scripts/tests/job-cancellation.test.mjs - scripts/tests/source-anchor.test.mjs + - name: 验证 SDK、运行时、采集与发布的独立契约 + run: pnpm test:contracts peer-database: # Existing branch protection binds this exact check name. @@ -180,8 +163,8 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Run the selected real core service and isolated browser/database chain - run: pnpm test:e2e:web + - name: 验证邮件阅读及独占浏览器与数据库链路 + run: pnpm test:e2e:web:with-mail env: INKCRE_CORE_IMAGE: ${{ needs.core-release.outputs.image }} @@ -193,12 +176,14 @@ jobs: path: | test-results/playwright test-results/database + test-results/mail-newsletter if-no-files-found: ignore retention-days: 7 browser-extension: # Existing branch protection binds this exact check name. name: client-webext E2E + needs: core-release runs-on: ubuntu-latest steps: - name: Checkout @@ -218,23 +203,28 @@ jobs: - name: Install the frozen workspace run: pnpm install --frozen-lockfile - - name: Install the exact browser engine - run: pnpm exec playwright install --with-deps chromium - - - name: Load the exact Chromium extension build - run: pnpm test:e2e:webext + - name: 安装锁定的 Chromium 和 Firefox + run: pnpm exec playwright install --with-deps chromium firefox - - name: Build the Firefox extension - run: pnpm --filter @inkcre/webext build:firefox + - name: Authenticate to GHCR + uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Verify WebExt delivery rules - run: node --test scripts/tests/webext-release.test.mjs + - name: 验证浏览器扩展产物与独占数据库采集、重启恢复 + run: pnpm test:e2e:webext + env: + INKCRE_CORE_IMAGE: ${{ needs.core-release.outputs.image }} - name: Upload browser evidence on failure if: failure() uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: browser-extension-failure-evidence - path: test-results/playwright + path: | + test-results/playwright + test-results/database if-no-files-found: ignore retention-days: 7 diff --git a/AGENTS.md b/AGENTS.md index 14dde33d..eaabec51 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,6 +49,8 @@ For UI work, read the installed `@inkcre/ui-web` package's `DESIGN.md` and `skil - `.env` files are dotenv data, not shell scripts. Load them through the application because values may contain shell metacharacters. - Generated contracts under `contracts/` are checked-in projections. Change their source and regenerate; do not edit them directly. - The `apps/webext/` WXT extension and the `apps/web/` Vue SPA share `@inkcre/core` but run in different security contexts. Changes that cross the seam must be validated against both runtimes. +- For test changes, check the actual entry point in `package.json`, `playwright.config.ts`, and CI. Put independent producer fixtures (including legacy persisted bytes) in the tests. Exercise browser recovery through the shipped wake-up events. +- Development, release, and artifact checks under `scripts/` are acceptance entry points too. Exercise CLI behavior at process boundaries and check the resolved configuration or published artifact when that owns the contract. - Follow `.agents/prompts/code-for-human.md` for source changes. ## Governance And Workflow diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ddcfcb0..938e8ce6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,10 +58,9 @@ and the distinction between applications, SDK packages, and native Extension rel ## Verification and pull requests -Run `pnpm check` before opening or updating a pull request. Also run the behavior-level command that -matches the change, normally `pnpm test:e2e:web`, `pnpm test:e2e:webext`, or a narrower documented -acceptance command. Record what actually ran and any unmet environment condition in the pull-request -body; a package build is not evidence of browser behavior. +打开或更新 PR 前运行 `pnpm check`,并执行与变更行为对应的验收入口。`pnpm test:e2e` 包含 Web、WebExt 的独占数据库/浏览器路径和 Mail 阅读验收;局部复验使用 `pnpm test:e2e:web`、`pnpm test:e2e:webext`、`pnpm test:mail` 或文档中说明的专项入口。 + +Core 构建完成后,`pnpm test:contracts` 可集中验证 SDK、运行时、采集和发布合同;本地默认检查与 CI 使用同一入口。在 PR 正文记录实际执行结果、跳过项和未满足的环境条件。产物构建通过不能代替浏览器行为证明。 External fork workflows require maintainer approval and receive no preview or production credentials. A maintainer may perform a trusted Pages preview after the ordinary checks pass. Frozen dependency diff --git a/apps/web/package.json b/apps/web/package.json index 56ed36ed..9949e433 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -9,8 +9,8 @@ "preview": "vite preview", "build-only": "vite build", "type-check": "vue-tsc --build", - "test:a11y": "playwright test accessibility.spec.ts", - "test:a11y:report": "playwright test accessibility.spec.ts --reporter=html" + "test:a11y": "pnpm -w test:e2e:web --project accessibility", + "test:a11y:report": "pnpm -w test:e2e:web --project accessibility --reporter=html" }, "dependencies": { "@dagrejs/dagre": "^3.1.2", @@ -34,7 +34,6 @@ "zod-config": "^1.4.0" }, "devDependencies": { - "@axe-core/playwright": "^4.14.0", "@iconify-json/mdi": "^1.2.3", "@module-federation/vite": "^1.1.0", "@playwright/test": "1.61.1", diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts deleted file mode 100644 index f9419da7..00000000 --- a/apps/web/playwright.config.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { defineConfig, devices } from '@playwright/test' - -export default defineConfig({ - testDir: './tests', - fullyParallel: true, - forbidOnly: !!process.env.CI, - retries: process.env.CI ? 2 : 0, - workers: process.env.CI ? 1 : undefined, - reporter: 'html', - use: { - baseURL: 'http://localhost:5199', - trace: 'on-first-retry', - }, - - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - ], - - webServer: { - command: 'pnpm dev', - url: 'http://localhost:5199', - reuseExistingServer: !process.env.CI, - }, -}) diff --git a/apps/web/src/components/extension/extensionCard/extensionCard.scss b/apps/web/src/components/extension/extensionCard/extensionCard.scss index 4702eae9..9246376c 100644 --- a/apps/web/src/components/extension/extensionCard/extensionCard.scss +++ b/apps/web/src/components/extension/extensionCard/extensionCard.scss @@ -20,6 +20,8 @@ &__id { @include apply-font(label-lg); + display: inline; + margin: 0; } &__version { diff --git a/apps/web/src/components/extension/extensionCard/extensionCard.vue b/apps/web/src/components/extension/extensionCard/extensionCard.vue index 44a158dd..28fd07c7 100644 --- a/apps/web/src/components/extension/extensionCard/extensionCard.vue +++ b/apps/web/src/components/extension/extensionCard/extensionCard.vue @@ -81,7 +81,7 @@ const {
- {{ extension.nickname ?? extension.name }} +

{{ extension.nickname ?? extension.name }}

{{ extension.name }}

@@ -102,9 +102,10 @@ const {

{{ t('extension.usedOnPeers') }}

-
@@ -177,7 +178,7 @@ const { @click="removePeer(peer)" /> -
+ {
-

+

-

+ {{ statusConfig.text }} diff --git a/apps/web/src/styles/entity-card.scss b/apps/web/src/styles/entity-card.scss index c189beb2..eb474c75 100644 --- a/apps/web/src/styles/entity-card.scss +++ b/apps/web/src/styles/entity-card.scss @@ -4,7 +4,7 @@ //
//
//
-//

…

+//

…

// … //
//
diff --git a/apps/web/src/views/info-base/graph/useGraphScene.ts b/apps/web/src/views/info-base/graph/useGraphScene.ts index cfaa4964..904176b3 100644 --- a/apps/web/src/views/info-base/graph/useGraphScene.ts +++ b/apps/web/src/views/info-base/graph/useGraphScene.ts @@ -56,7 +56,6 @@ export interface GraphSceneHooks { interface PendingPreview { block: Block - relations: Relation[] owns: () => boolean } @@ -192,11 +191,6 @@ export function useGraphScene(hooks: GraphSceneHooks) { } function setGraph(graph: GraphModel): void { - const incident = new Map() - for (const relation of graph.relations) { - incident.set(relation.from_, [...(incident.get(relation.from_) ?? []), relation]) - incident.set(relation.to_, [...(incident.get(relation.to_) ?? []), relation]) - } nodes.value = graph.blocks.map((block) => blockNode(block, { focal: block.id === focalBlock.value, @@ -211,7 +205,7 @@ export function useGraphScene(hooks: GraphSceneHooks) { }) ) applyPresentation() - void loadPreviews(graph.blocks, incident, generation) + void loadPreviews(graph.blocks, generation) // Layout after a short delay to allow Vue Flow to measure nodes. setTimeout(() => { hooks.layoutAndRoute() @@ -233,7 +227,8 @@ export function useGraphScene(hooks: GraphSceneHooks) { const lookupBeforeRestore = allowRestoreRetry && ['idle', 'restoring'].includes(extensionHostRestoreState.value) try { - const resolver = await ResolverCache.getResolver(entry.block, entry.relations) + // A bounded scene is not the complete relation set owned by a Resolver. + const resolver = await ResolverCache.getResolver(entry.block) const solvedContent = await resolver.getSolvedContent({ materializeMissing: false }) if (!entry.owns()) return nodes.value = nodes.value.map((node) => @@ -270,11 +265,7 @@ export function useGraphScene(hooks: GraphSceneHooks) { pendingPreviews.value = [] }) - async function loadPreviews( - blocks: Block[], - incident: Map, - current: number - ): Promise { + async function loadPreviews(blocks: Block[], current: number): Promise { previewReady.value = false const meta = { ...configStore.metaConfig } const host = getExtensionHost() @@ -288,7 +279,7 @@ export function useGraphScene(hooks: GraphSceneHooks) { async function worker(): Promise { while (index < blocks.length) { const block = blocks[index++]! - await resolvePreview({ block, relations: incident.get(block.id) ?? [], owns }, true) + await resolvePreview({ block, owns }, true) } } await Promise.all(Array.from({ length: Math.min(4, blocks.length) }, () => worker())) @@ -466,12 +457,6 @@ export function useGraphScene(hooks: GraphSceneHooks) { return } - const incident = new Map() - for (const relation of graph.relations) { - incident.set(relation.from_, [...(incident.get(relation.from_) ?? []), relation]) - incident.set(relation.to_, [...(incident.get(relation.to_) ?? []), relation]) - } - // Add new nodes with temporary positions (positioned by the layout hook) const newNodes = newBlocks.map((block) => blockNode(block, { @@ -510,7 +495,7 @@ export function useGraphScene(hooks: GraphSceneHooks) { })) // Load previews for new blocks only - void loadPreviews(newBlocks, incident, generation) + void loadPreviews(newBlocks, generation) // Layout only new nodes around existing graph, then focus camera. // Set skipLayout to prevent the view from re-layouting all nodes. diff --git a/apps/web/src/views/sources/sources.vue b/apps/web/src/views/sources/sources.vue index d6690e26..67c3a7f4 100644 --- a/apps/web/src/views/sources/sources.vue +++ b/apps/web/src/views/sources/sources.vue @@ -41,6 +41,7 @@ async function onCreateSource(source: Source) {