docs(coding): integrate packaged Pi runtime fix

This commit is contained in:
2026-09-01 11:23:54 +08:00
parent 96402551f4
commit 42ea83c0cb
5 changed files with 65 additions and 68 deletions

View File

@@ -4,6 +4,18 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
## Integrated Through
- Packaged Pi Agent Server resolver fix source `7df245af5a04f62be48980831ff41987ba686009`
from task `20260901-local-runtime-unavailable-8b42c7f1` is integrated by task
`20260901-integrate-local-runtime-fix-9c4e2a71` through merge
`96402551f46d875ba3db0a2f625397aba2f332fb`. Electron Main now starts only the
shared Agent Server with Node's `import.meta.resolve` parent-URL capability enabled,
so the unchanged server script resolves `@earendil-works/pi-ai` from the explicit
packaged `pi-runtime` root instead of the sibling `resources/resources` directory.
A production-shaped sibling-layout test reproduces the installed failure before the
fix and initializes successfully through Electron Node after it; Pi remains pinned at
`0.84.2`, and no bundle layout, Provider, Renderer, or recovery contract changed.
The currently installed application predates this source integration; a rebuilt and
verified Windows artifact plus first-Conversation acceptance remain pending.
- Native Web Search client tickets MLW-01 through MLW-03 are integrated by source
coordinator `20260831-web-search-client-integration-7d2f5b94` and promoted to local
`main` by task `20260901-web-search-client-main-merge-5a9d3b82` from reviewed

View File

@@ -0,0 +1,51 @@
# Task: Integrate local runtime unavailable fix
## Identity
- Task ID: 20260901-integrate-local-runtime-fix-9c4e2a71
- Mode: Integration
- Branch: codex/20260901-integrate-local-runtime-fix-9c4e2a71-integrate-local-runtime-fix
- Worktree: D:\Datas\OthersProjects\makelore-worktrees\integrate-local-runtime-fix-9c4e2a71
- Base commit: 7f0e9310a7f394249fab3cadc5c82d70f91cbfeb
- Owner: codex
- Status: Ready for Integration
## Scope
- Integrate verified source commit `7df245a` for the packaged Pi Agent Server resolver failure onto the exact local `main` base.
- Promote the accepted source evidence into canonical current state, evidence, and the existing Windows Pi artifact commitment without changing ADR-006.
- Re-run the relevant product checks on the merged tree, commit the integration result, and fast-forward local `main` only when its worktree ownership is released.
## Intent And Constraints
- Preserve Pi `0.84.2` as the sole production runtime and keep Agent Server/runtime ownership in Electron Main.
- Do not change the Pi runtime bundle layout, dependency versions, Renderer/Provider contracts, recovery behavior, or add a compatibility fallback.
- Treat the currently installed application as pre-fix until a rebuilt artifact passes the existing publish/runtime/artifact/final proof and installed first-Conversation acceptance.
- Do not modify or release the separately owned `main` worktree while task `20260831-makelore-web-search-client-inspection-6b4d2e81` retains ownership.
## Outcome
- Verified source commit `7df245af5a04f62be48980831ff41987ba686009` contains only the packaged Agent Server launch fix, the production-shaped real-process regression, and its feature task record.
- Merged the source branch without conflicts as `96402551f46d875ba3db0a2f625397aba2f332fb` on the isolated integration branch.
- Omitted the duplicate source-owned task record from the promotion tip while preserving it unchanged on source commit `7df245af5a04f62be48980831ff41987ba686009`; the promoted tree therefore contains only the product fix, regression test, canonical memory, and this integration task's own record relative to `main`.
- Promoted the accepted evidence into `current-state.md`, `evidence-index.md`, and the existing Windows Pi artifact commitment. ADR-006 remains unchanged because runtime ownership, topology, version, and public contracts did not change.
- Prepared a verified fast-forward candidate for local `main`. Actual `main` promotion remains a separate ownership-gated step because task `20260831-makelore-web-search-client-inspection-6b4d2e81` still owns that worktree.
## Verification
- Source range inspection: exactly one source commit and three expected files relative to `main`; no unrelated source or project-memory change was present.
- Merge result: Git `ort` merge completed without conflicts.
- Integration focused tests: 4 files / 24 tests passed, including the production-shaped sibling-layout Agent Server startup through Electron Node.
- `pnpm run typecheck`: passed.
- `pnpm run lint:check`: passed with 0 errors and 5 pre-existing unrelated React warnings.
- `pnpm run build:vite`: passed for Renderer, Electron Main, Preload, and utility worker with existing bundle warnings only.
- The source task's full-suite evidence remains 215 files / 1,761 tests passed and 2 conditional skips; integration changed only canonical Markdown after the conflict-free source merge, so the full suite was not redundantly rerun.
## Follow-ups
- Release the completed `main` worktree owner only through the non-force task-context command, claim `main` with a separate integration task, and fast-forward it to this verified integration tip.
- Rebuild and install the Windows artifact, run the publish/runtime/artifact/final packaged proof, and confirm a first Coding Conversation no longer shows the runtime-unavailable projection.
## Promotion Candidates
- None. The source candidate was accepted and promoted by this integration task without semantic conflict.

View File

@@ -1,67 +0,0 @@
# Task: Diagnose local programming runtime unavailable
## Identity
- Task ID: 20260901-local-runtime-unavailable-8b42c7f1
- Mode: Feature
- Branch: codex/20260901-local-runtime-unavailable-8b42c7f1-local-runtime-unavailable-8b42c7f1
- Worktree: D:\Datas\OthersProjects\makelore-worktrees\local-runtime-unavailable-8b42c7f1
- Base commit: 7f0e9310a7f394249fab3cadc5c82d70f91cbfeb
- Owner: codex
- Status: Ready for Integration
## Scope
- Reproduce the current Makelore Code state that renders `本地编程运行时暂时不可用。` and identify the first failing Renderer, Host API, Pi runtime, packaging, or Provider boundary.
- Build a deterministic, agent-runnable feedback loop for the exact visible symptom before ranking or testing root-cause hypotheses.
- Correlate current source and focused tests with privacy-safe local runtime evidence where available.
- Implement the user-authorized minimal product fix for the confirmed packaged-layout Pi AI ESM resolution failure.
- Add a focused regression at the installed sibling-resource-layout seam, then verify the original process path plus the repository's required checks.
## Intent And Constraints
- Treat the visible sentence as a generic safe projection, not as proof of a Pi process failure.
- Preserve ADR-006: Pi `0.84.2` remains the sole production runtime; do not add an OpenCode fallback, dual runtime, compatibility layer, or automatic replay.
- Keep Renderer access behind `/api/coding/*`; runtime, Provider credentials, recovery, and raw diagnostics remain Electron Main-owned.
- Redact credentials, headers, prompts, session content, account identifiers, and complete user project paths from reported evidence.
- Distinguish confirmed facts, evidence-supported inferences, and unverified assumptions. The historical Host-token startup defect is a regression lead, not an assumed cause.
- Keep package resolution anchored to the explicit Main-owned `runtimeRoot`; development and packaged layouts must both continue to work without hard-coded layout branches or a compatibility layer.
- Work only in this isolated task worktree and do not modify peer worktrees or the occupied local `main` worktree.
## Outcome
- Confirmed that the installed Makelore application reaches the generic `CODING_RUNTIME_UNAVAILABLE` projection only after the Pi worker fails during `open`.
- The installed Agent Server imports `@earendil-works/pi-ai` with `import.meta.resolve(specifier, runtimePackageUrl)`. In the embedded Node.js `v24.18.1` process, the second `parentURL` argument is not honored unless `--experimental-import-meta-resolve` is enabled, so resolution starts beside `resources/resources/pi-agent-server.mjs` instead of the sibling `resources/pi-runtime/node_modules` tree.
- The dependency is present and healthy: the installed Agent Server matches repository source byte-for-byte, both `@earendil-works/pi-coding-agent` and `@earendil-works/pi-ai` are version `0.84.2`, and the expected ESM export exists.
- Reproduced the installed startup failure twice with the exact executable, script, runtime root, working directory, and environment shape. Both attempts exited with code `1` and `ERR_MODULE_NOT_FOUND` before producing protocol output.
- A one-variable differential adding `--experimental-import-meta-resolve` made the same process exit cleanly without the module error. Importing the verified absolute `pi-runtime/node_modules/@earendil-works/pi-ai/dist/index.js` URL also succeeded without the experimental flag.
- Added `--experimental-import-meta-resolve` only to the Main-owned Agent Server child process. This activates the existing `runtimePackageUrl` parent argument and preserves standard ESM package resolution across both the development layout and packaged `pi-runtime` closure.
- Added a real-process regression that places `pi-agent-server.mjs` under the installed `resources/resources` sibling layout, exposes the real Pi runtime and Pi AI package through a temporary production-shaped root, and starts it with the project's Electron executable.
- The regression failed before the fix with the same `ERR_MODULE_NOT_FOUND` / `PI_RPC_EXITED` chain and passed after the fix. No runtime bundle layout, dependency version, Provider behavior, Renderer contract, installed application file, user data, or peer task content was changed.
## Verification
- Current startup-log signal loop: found the missing `@earendil-works/pi-ai` module plus two `PI_WORKER_STOPPED` / `open_failure` events; verdict `RED` as expected for the reported failure.
- Exact installed-process loop: two independent launches reproduced `ExitCode=1`, `ModuleNotFound=true`, `MissingPiAi=true`, and zero protocol bytes within five seconds.
- Resolver differential: the same installed process with only `--experimental-import-meta-resolve` added produced no resolver error.
- Absolute-path differential: importing the fixed runtime-root ESM entry through `pathToFileURL(...)` succeeded in the same embedded Node.js process without the experimental flag.
- Artifact comparison: installed `pi-agent-server.mjs` equals repository source; installed Pi package versions and exports match the expected `0.84.2` runtime closure.
- The existing real-process unit test was inspected and does not cover this boundary because it runs the server from the repository layout, where ancestor lookup can reach the root `node_modules`; the installed sibling `resources/resources` and `resources/pi-runtime` layout is not exercised.
- Red regression: `pnpm exec vitest run tests/unit/pi-agent-server-process-real.test.ts -t "boots from the packaged sibling resource layout" --maxWorkers=1` failed at `pi-agent-server.mjs:22` with `ERR_MODULE_NOT_FOUND` and `PI_RPC_EXITED` before the product change.
- Green regression: the same command passed against Electron Node after the Agent Server launch flag was added.
- Focused verification: 4 relevant test files, 24 tests passed, covering Agent Server behavior, composition paths, Pi runtime bundling, and product artifact rules.
- Existing real-process behavior: both tests in `pi-agent-server-process-real.test.ts` passed, including two logical Conversation threads, process reuse, invalidation, and restart.
- Full unit suite: 215 test files passed; 1,761 tests passed and 2 existing conditional tests were skipped.
- `pnpm run typecheck`: passed. Final changed-file ESLint: passed.
- `pnpm run lint:check`: passed with 0 errors and 5 pre-existing unrelated React warnings.
- `pnpm run build:vite`: passed for Renderer, Electron Main, Preload, and utility worker; only existing bundle/chunk warnings were emitted.
- `git diff --check`: passed; no debug instrumentation or generated artifact is tracked.
## Follow-ups
- The currently installed application predates this source change. After integration, rebuild the Windows artifact, run `verify:artifact:win`, `verify:artifact:pi`, and the final packaged Pi proof, then install it before performing the first-conversation UI acceptance.
- When the pinned Electron/Node runtime is upgraded, retain the packaged-layout regression; remove the launch flag only after the new embedded Node accepts the `import.meta.resolve` parent argument without it.
## Promotion Candidates
- Target: `current-state` and the Pi release evidence index. Proposal: require an Electron Node Agent Server initialization proof from the installed sibling resource layout, not only source-tree process tests. Evidence: the new layout test reproduced the exact installed `ERR_MODULE_NOT_FOUND` before the fix and passed after enabling the resolver parent URL; 24 focused tests, the full unit suite, typecheck, lint, and production build passed. Future impact: prevents source-root ancestor `node_modules` from masking final-artifact ESM resolution regressions. Semantic conflicts: none with ADR-006 or the existing Pi closure requirement. Human confirmation: not required to integrate the evidence rule; final package installation/release remains an operator gate.

View File

@@ -4,6 +4,7 @@ Use this index for searchable, traceable evidence records.
| Date | Topic | Status | Source | Detail |
|---|---|---|---|---|
| 2026-09-01 | Makelore Code packaged Agent Server Pi AI resolver fix | Integrated locally; rebuilt Windows artifact and installed-client acceptance pending | Source `7df245a`, source task `20260901-local-runtime-unavailable-8b42c7f1`, merge `9640255`, integration task `20260901-integrate-local-runtime-fix-9c4e2a71` | The installed Electron Node process reproduced `ERR_MODULE_NOT_FOUND` for the present `@earendil-works/pi-ai@0.84.2` because the optional `import.meta.resolve` parent URL was inactive and lookup began beside `resources/resources/pi-agent-server.mjs`. Enabling that capability only for the Main-owned Agent Server made the exact differential pass without changing the runtime closure. A production-shaped sibling-layout Electron test went red before and green after; 24 focused tests, 1,761 full unit tests / 2 conditional skips, typecheck, lint with 0 errors, and Renderer/Main/Preload/utility build passed. This does not claim that the currently installed old package is fixed or that a rebuilt final artifact has passed release proof. |
| 2026-08-30 | MakeLore AI Design Living Form V2 hard cutover | Integrated locally with matching server source; production data cutover and Provider activation pending | Client source `b0b5a602b501308a23eb27e2f51a5169b9e46b1e`, server source `b5351d54f595ce8eb873593e462e4a556bea0b05`, integration task `20260830-integrate-marketplace-design-client-main-9d5f3b82`, ADR-007 | Replaces nested V1 Conversations, Briefs, editable provider Prompt, mutable Quote PATCH, and local semantic fallback with one current Direction, one Living Form/Specification authority, stable operations, immutable Quote confirmation, and Main-owned V2 transport. Client source passed typecheck, lint with zero errors, 1,425 unit tests, Vite/Electron build, and 2 Electron E2E tests. Server source passed 2,626 tests / 31 skipped under UTF-8 mode. No production database cutover, real paid Provider request, deployment, or publication occurred. |
| 2026-08-30 | MakeLore curated Plugin Marketplace Release A | Integrated locally; XMA-01 live acceptance PASS; production trust activation HOLD | Source `40df677a31ff7651f962151eb84b925987781c03`, source task `20260828-plugin-marketplace-client-5f8b3d72`, integration task `20260830-integrate-plugin-marketplace-client-6e3b9d82` | R7 Standards/Spec passed with zero findings. XMA-01 passed 12/12 using real PostgreSQL, signed-in packaged MakeLore, Operations-published temporary-key packages, A/B account isolation, immutable install/update/freeze/rollback, project/Agent/Pi materialization, lifecycle invalidation, pricing-only ETag change, Data Service 10 tools/14 operations and zero Token Point transactions. Final Windows installer was 208,235,670 bytes with SHA-256 `738A2F6573C502281787F418EA666C6E62C287CA0EC13C6EB22369DAB0B3FFFA`. The official Ed25519 public key was not supplied, so the production trust store correctly remains fail closed; no deployment or production publication occurred. |
| 2026-08-26 | Makelore Code Pi hard cutover、后台运行 ownership 与 Works user-context Provider 修复 | 本地 `main` 已集成Windows 最终安装包与 packaged proof Pass真实 Provider/macOS/native Linux 非 Pass | 集成交付 `48a9189`、实现 `a098266`、任务 `20260826-fix-pi-model-provider-8d4c2a71` / `20260826-integrate-pi-provider-fix-6e4c2a91``docs/pi-runtime-release-runbook.md` | OpenCode production runtime/package/plugin/fallback 已删除Pi `0.84.2` 是唯一 runtime。未解析 Conversation 现在 validate→persist resolved model→prepareexact Works `works square AI gateway did not return one-api user context` 会失效缓存 credential、以非重试 Provider-auth failure 结束且不自动 replay`agent_end willRetry:false` 不再被 `agent_settled` 覆盖成 completed。聚焦 47/47、related 54/54、projector 12/12、181 files / 1541 full unit + pressure、typecheck、lint、Vite build、Windows Electron 4/4、publish/runtime/artifact/Pi/subagent/final packaged proof 通过。NSIS 208,162,564 bytesSHA-256 `A02F79FCD3273FB0B013450492DC788B6E5ED7BBC1007468FB83BE949B8CB30D`未签名final app.asar SHA-256 `A8394D0F7324B27D2C95469ABD4E2A39C739EABCC6D8B41E1D65BA4B41FB9D39`。真实 Provider 是 Explicitly Waived / Accepted Risk 且 `realTurnVerified=false`macOS x64/arm64 与 native non-WSL Linux 未验收。 |

View File

@@ -13,7 +13,7 @@ Track future-facing memory: promised follow-ups, unfinished loops, timed checks,
| 2026-08-16 | 验收 Prompt Museum 与 Canvas 删除/重报价的真实服务端链路 | 发布包含 `26b52d7` Canvas 行为的安装包前 | 客户端/服务端集成 | Pending | 使用真实 Works 账号核对 Museum 列表/详情/分页/筛选/署名/CDN/Prompt 回填,并确认固定相对媒体路径可经 Main Bearer 代理、401 刷新、10 MiB/可信 raster MIME 边界后在 Renderer 展示;核对最终 Prompt/options 重报价和确认设计点;删除 Workspace 后确认软删除可见性、未提交任务取消/预留积分释放、已运行任务结算。保留 Main 错误脱敏和严格 DTO/HTTPS 投影,不以客户端回归替代服务端验收 |
| 2026-08-16 | 验收 default-on Robot Guided Hotspot Binding 的 Windows/macOS 真实设备链路 | 下一份包含页面内热点连接行为的安装包发布前 | 客户端/硬件/服务端集成 | Pending | 核对精确出货固件与固定 Portal、六位码发行/消费语义;执行 Windows Robot 真机扫描/连接、签名 macOS x64/arm64 CoreLocation/CoreWLAN/worker/ASAR/Koffi smoke以及真实 Host/native Electron 端到端配网+Binding保留 `NIANCODE_AI_HARDWARE_GUIDED_HOTSPOT_BINDING=0` 回滚并记录支持矩阵 |
| 2026-08-10 | 完成客户端提交到 App `play_url` 播放的真实生产整链验收 | source+built+contract 服务端协议、OSS immutable Release、CDN/Edge 与 App 消费链成组集成后 | 客户端/服务端集成 | Pending | 使用真实账号执行小游戏和小程序创建、客户端本地构建与同字节预检、双归档提交、服务端逐字节校验/不可变 Release 固化、运营批准、CDN 发布、App 播放与监控核对;如需不可绕过 runtime gate另行设计可信 verifier |
| 2026-08-12 | Windows 发布流水线保留固定 npm/Pi 运行时产物门禁 | 每次生成正式 Windows 安装器时 | 客户端发布 | Pending | 运行 `pnpm verify:publish-runtime``pnpm verify:artifact:win``pnpm verify:artifact:pi` 与 final packaged proof。当前 208,162,564-byte / SHA-256 `A02F79FCD3273FB0B013450492DC788B6E5ED7BBC1007468FB83BE949B8CB30D` 安装器为本地未签名证据,尚未 push、发布或安装。 |
| 2026-08-12 | Windows 发布流水线保留固定 npm/Pi 运行时产物门禁 | 每次生成正式 Windows 安装器时 | 客户端发布 | Pending | 运行 `pnpm verify:publish-runtime``pnpm verify:artifact:win``pnpm verify:artifact:pi` 与 final packaged proof;启动最终 `resources/resources/pi-agent-server.mjs` 并确认它从相邻 `pi-runtime` 初始化,再用安装后的首个 Conversation 确认不出现 runtime-unavailable 投影。当前 208,162,564-byte / SHA-256 `A02F79FCD3273FB0B013450492DC788B6E5ED7BBC1007468FB83BE949B8CB30D` 安装器早于 `7df245a` 修复,为本地未签名历史证据,尚未 push、发布或安装。 |
| 2026-08-10 | 删除客户端 `runtime_url` 兼容回退 | 一个客户端兼容版本结束,且服务端与存量数据稳定提供 `play_url` | 客户端 | Pending | 删除类型字段、读取分支和对应回归测试 |
| 2026-08-11 | 部署并验收 AI 绘画多 Conversation 服务端契约 | 发布包含多会话客户端之前 | 客户端/服务端集成 | Pending | 确认迁移 `0033`、Conversation list/create/read/turn/confirm API、持久 Agent Session 与事件字段已上线 |
| 2026-08-12 | 复核 AI 编程 Provider 错误与重试投影 | 升级 Pi、Works gateway 或上游 Provider 错误格式时 | 客户端/Pi/provider 集成 | Pending | 重新验证确定性 Works user-context 缺失仍会 expire credential、非重试 fail fast、固定脱敏为 `CODING_PROVIDER_AUTH_REQUIRED`,并且不会被后续 `agent_settled` 改写为 completed不得把其他 401/429/5xx 扩大归类。 |