You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
M2-01: Decide Web runtime and freeze module boundaries #22
通过 Node 22 compatibility spike 选择 Web runtime,并冻结模块 ownership 和依赖方向。
比较方案
A. Next.js App Router + Node runtime + single process
B. React/Vite + Fastify
C. Vite/static + minimal Node server
建议 A,但只能由 build/deploy/Moss SDK/ESM spike 支持后接受。
固定模块边界
report-schema contracts only
decision-engine pure decision only
moss-adapter Moss/Monad I/O and raw mapping only
preflight-core alignment, decision input, report assembly
clear402-profile optional report consumer only
web/server orchestration and presentation only
Use Next.js App Router + Node runtime + one deployable Node process as the proposed Web runtime.
The production baseline is a normal Node server or container. Edge runtime is not the baseline. Core Preflight execution uses explicit Route Handlers; Server Actions do not own the core API.
Frozen boundary direction
report-schema contracts only
decision-engine pure decision only
moss-adapter Moss/Monad I/O and raw mapping only
preflight-core alignment, decision input, report assembly only
clear402-profile optional report consumer only
web/server orchestration and HTTP/presentation boundary only
The browser must not import moss-adapter, preflight-core, pinned Moss packages, RPC configuration, or server environment variables. The canonical report contract is owned by report-schema; preflight-core assembles and validates it; the Web route owns only request validation, HTTP status, and transport; UI code owns presentation only and cannot rewrite raw evidence.
CLEAR402_ENABLED=false must keep the core report path independent. clear402-profile may consume a completed report only when enabled and cannot alter Core evidence or Decision semantics.
Acceptance remains pending
This comment selects the direction but does not mark M2-01 Accepted. Option A must first pass the required Node 22, pnpm 11, ESM, production build/start, server-only bundle, Moss import, disabled-Clear402, clean-start, and deployment compatibility spike.
The spike may use the documented exact Moss upstream candidate as temporary compatibility evidence while M2-03 remains blocked. That candidate is not the final pinned integration dependency.
If Moss cannot be imported and executed in the Next.js Node production build, server-only code enters the browser bundle, or the selected Node deployment cannot run the required Moss/RPC path without unsupported workarounds, the recorded fallback is Option B: React/Vite + Fastify, preferably two development processes and one Fastify production process serving the built frontend.
M2-01 remains status:needs-decision until the spike evidence is linked and the Maintainer posts a separate Accepted or Rejected decision.
Result: the selected Option A is technically supported: Next.js App Router with Node runtime can import the pinned Moss candidate in server-only routes and run as one Node process.
Web dependency versions: Next 16.2.12, React/React DOM 19.2.3
Evidence
pnpm install and pnpm build completed for Moss plus the temporary Next workspace under Node 22.
next build produced a production App Router build.
A Node-runtime, server-only route imported @themoss/core, @themoss/simulator, @themoss/protocol-kuru, and @themoss/protocol-pancakeswap; production HTTP response reported all four imports as true.
next start served the production build in one Node process.
Static browser output contained no @themoss, moss, or clear402 references; Moss references appeared only in .next/server.
With CLEAR402_ENABLED unset/false, the dedicated route returned 404; no Clear402 module was imported.
Controlled deployment condition
Next resolved sharp@0.34.5. Moss pnpm supply-chain policy initially blocked Sharp's install script, so the temporary spike only added allowBuilds.sharp: true after explicit review. A real app must either carry the reviewed, pinned allowlist entry or demonstrate that the chosen Next configuration removes the dependency. Do not bypass the policy.
Boundary and residual risks
This is runtime/ESM/bundle evidence, not an implementation skeleton; the temporary workspace is not committed.
The final vendor/submodule and dependency-link strategy remains owned by the later integration work; this spike used Moss workspace links only.
Options B and C were not implemented as comparable spikes. The positive conclusion is that A meets its required compatibility proof, not that B/C are impossible.
Decision request: record Maintainer acceptance of Option A, then freeze the stated module ownership in the architecture ADR before app implementation begins.
Option A is accepted for the Mini-Demo architecture based on the Node 22 compatibility evidence above.
The following is now frozen:
Next.js App Router using the Node runtime.
One deployable Node process for web and server orchestration.
Moss imports remain server-only and must not enter browser bundles.
CLEAR402_ENABLED=false remains a complete, independently working path.
Module ownership and dependency direction remain exactly as listed in this Issue.
API/report ownership stays outside the UI; the UI must not rewrite raw evidence.
Local Fork remains a SHOULD and does not block Live + Fixture delivery.
The reviewed sharp build-script allowlist requirement must be handled explicitly in the implementation. Final Moss vendor/submodule linkage remains owned by the later integration work. Options B and C are not technically invalid, but are rejected for this Mini-Demo because Option A has now passed the required compatibility proof with less operational surface.
This comment constitutes Maintainer acceptance for #22.
Activity
pillowtalk-Qy commentedon Jul 30, 2026
Direction selected: Option A
Maintainer direction date: 2026-07-30
Selected runtime direction
Use Next.js App Router + Node runtime + one deployable Node process as the proposed Web runtime.
The production baseline is a normal Node server or container. Edge runtime is not the baseline. Core Preflight execution uses explicit Route Handlers; Server Actions do not own the core API.
Frozen boundary direction
Allowed internal dependency direction:
The browser must not import
moss-adapter,preflight-core, pinned Moss packages, RPC configuration, or server environment variables. The canonical report contract is owned byreport-schema;preflight-coreassembles and validates it; the Web route owns only request validation, HTTP status, and transport; UI code owns presentation only and cannot rewrite raw evidence.CLEAR402_ENABLED=falsemust keep the core report path independent.clear402-profilemay consume a completed report only when enabled and cannot alter Core evidence or Decision semantics.Acceptance remains pending
This comment selects the direction but does not mark M2-01 Accepted. Option A must first pass the required Node 22, pnpm 11, ESM, production build/start, server-only bundle, Moss import, disabled-Clear402, clean-start, and deployment compatibility spike.
The spike may use the documented exact Moss upstream candidate as temporary compatibility evidence while M2-03 remains blocked. That candidate is not the final pinned integration dependency.
If Moss cannot be imported and executed in the Next.js Node production build, server-only code enters the browser bundle, or the selected Node deployment cannot run the required Moss/RPC path without unsupported workarounds, the recorded fallback is Option B: React/Vite + Fastify, preferably two development processes and one Fastify production process serving the built frontend.
M2-01 remains
status:needs-decisionuntil the spike evidence is linked and the Maintainer posts a separateAcceptedorRejecteddecision.pillowtalk-Qy commentedon Jul 30, 2026
Node 22 compatibility spike: Option A evidence
Result: the selected Option A is technically supported: Next.js App Router with Node runtime can import the pinned Moss candidate in server-only routes and run as one Node process.
Reproducible environment
da9b566f9b607c28633b3790a44ae8d49522b26922.23.111.10.016.2.12, React/React DOM19.2.3Evidence
pnpm installandpnpm buildcompleted for Moss plus the temporary Next workspace under Node 22.next buildproduced a production App Router build.server-onlyroute imported@themoss/core,@themoss/simulator,@themoss/protocol-kuru, and@themoss/protocol-pancakeswap; production HTTP response reported all four imports astrue.next startserved the production build in one Node process.@themoss,moss, orclear402references; Moss references appeared only in.next/server.CLEAR402_ENABLEDunset/false, the dedicated route returned404; no Clear402 module was imported.Controlled deployment condition
Next resolved
sharp@0.34.5. Moss pnpm supply-chain policy initially blocked Sharp's install script, so the temporary spike only addedallowBuilds.sharp: trueafter explicit review. A real app must either carry the reviewed, pinned allowlist entry or demonstrate that the chosen Next configuration removes the dependency. Do not bypass the policy.Boundary and residual risks
Decision request: record Maintainer acceptance of Option A, then freeze the stated module ownership in the architecture ADR before app implementation begins.
pillowtalk-Qy commentedon Jul 31, 2026
Maintainer decision: Accepted
Option A is accepted for the Mini-Demo architecture based on the Node 22 compatibility evidence above.
The following is now frozen:
CLEAR402_ENABLED=falseremains a complete, independently working path.The reviewed
sharpbuild-script allowlist requirement must be handled explicitly in the implementation. Final Moss vendor/submodule linkage remains owned by the later integration work. Options B and C are not technically invalid, but are rejected for this Mini-Demo because Option A has now passed the required compatibility proof with less operational surface.This comment constitutes Maintainer acceptance for #22.