architecture-policy.yaml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. version: 1
  2. # 存量模块先标记为 legacy;新模块或完成迁移的模块设置 managed: true。
  3. modules:
  4. - id: rpc
  5. roots: [packages/rpc/src]
  6. managed: false
  7. - id: shared
  8. roots: [packages/shared/src]
  9. managed: false
  10. - id: provider
  11. roots: [packages/provider/src]
  12. managed: false
  13. - id: provider-node
  14. roots: [packages/provider-node/src]
  15. managed: false
  16. - id: services
  17. roots: [packages/services/src]
  18. managed: false
  19. - id: session
  20. roots: [packages/services/src/session]
  21. managed: false
  22. requires: [shared]
  23. publicEntrypoints:
  24. - packages/services/src/session/contract.ts
  25. - packages/services/src/session/taskIndexRepo.ts
  26. - packages/services/src/session/automationRepo.ts
  27. - packages/services/src/session/offPeakTaskRepo.ts
  28. - packages/services/src/session/tasksDatabase/migrations.ts
  29. - packages/services/src/session/tasksDatabase/prepared.ts
  30. owner: conversation
  31. - id: storage
  32. roots: [packages/services/src/storage]
  33. managed: true
  34. requires: [shared, rpc, services]
  35. publicEntrypoints: [packages/services/src/storage/contract.ts]
  36. layers: {domain: domain, app: app, adapters: adapters}
  37. layerOrder: [domain, app, adapters]
  38. owner: desktop-settings
  39. - id: client
  40. roots: [packages/client/src]
  41. managed: false
  42. - id: server
  43. roots: [packages/server/src]
  44. managed: false
  45. - id: zcode-server-cli
  46. roots: [packages/zcode-server-cli/src]
  47. managed: false
  48. - id: ui
  49. roots: [packages/ui/src]
  50. managed: false
  51. - id: web
  52. roots: [packages/web/src]
  53. managed: false
  54. - id: desktop
  55. roots: [packages/desktop/src]
  56. managed: false
  57. - id: formal-proof
  58. roots: [packages/formal-proof/src]
  59. managed: false
  60. - id: stream-animate
  61. roots: [packages/stream-animate/src]
  62. managed: false
  63. - id: e2e-report
  64. roots: [packages/e2e-report/src]
  65. managed: false
  66. - id: zcode-cli
  67. roots: [apps/zcode-cli]
  68. managed: false
  69. # sqlite-migrations:由 architecture:adopt 登记
  70. - id: sqlite-migrations
  71. roots:
  72. - packages/shared/src/sqlite-migrations
  73. managed: true
  74. requires: []
  75. publicEntrypoints:
  76. - packages/shared/src/sqlite-migrations/index.ts
  77. - packages/shared/src/sqlite-migrations/contract.ts
  78. layers:
  79. adapters: .
  80. owner: persistence
  81. # project-storage:由 architecture:adopt 登记
  82. - id: project-storage
  83. roots:
  84. - packages/services/src/project-storage
  85. managed: true
  86. requires:
  87. - shared
  88. - sqlite-migrations
  89. - services
  90. - session
  91. publicEntrypoints:
  92. - packages/services/src/project-storage/index.ts
  93. - packages/services/src/project-storage/contract.ts
  94. - packages/services/src/project-storage/startup.ts
  95. - packages/services/src/project-storage/startup-entry.ts
  96. layers:
  97. adapters: .
  98. owner: conversation
  99. # project:由 architecture:adopt 登记
  100. - id: project
  101. roots:
  102. - packages/services/src/project
  103. managed: true
  104. requires: [project-storage, services, shared]
  105. publicEntrypoints:
  106. - packages/services/src/project/index.ts
  107. - packages/services/src/project/contract.ts
  108. layers:
  109. adapters: .
  110. owner: conversation
  111. # task-facts:由 architecture:adopt 登记
  112. - id: task-facts
  113. roots:
  114. - packages/services/src/task-facts
  115. managed: true
  116. requires: [shared]
  117. publicEntrypoints:
  118. - packages/services/src/task-facts/index.ts
  119. - packages/services/src/task-facts/contract.ts
  120. - packages/services/src/task-facts/repairSubagentTaskIndex.ts
  121. layers:
  122. app: .
  123. owner: conversation
  124. # project-sidebar:由 architecture:adopt 登记
  125. - id: project-sidebar
  126. roots:
  127. - packages/ui/src/project-sidebar
  128. managed: true
  129. requires:
  130. - services
  131. - shared
  132. - ui
  133. - conversation-workspace-target
  134. - web-remote-control-ui
  135. - remote-connection-flow
  136. publicEntrypoints:
  137. - packages/ui/src/project-sidebar/index.tsx
  138. - packages/ui/src/project-sidebar/contract.ts
  139. - packages/ui/src/project-sidebar/remote-project-connection.ts
  140. - packages/ui/src/project-sidebar/useSavedWorkflowProjectOptions.ts
  141. - packages/ui/src/project-sidebar/RemoteProjectMenu.tsx
  142. - packages/ui/src/project-sidebar/WorkspaceDragOverlay.tsx
  143. - packages/ui/src/project-sidebar/useRemoteProjectConnectionPresentation.ts
  144. - packages/ui/src/project-sidebar/OfflineRemoteProjectRows.tsx
  145. - packages/ui/src/project-sidebar/RemoteConversationDisconnected.tsx
  146. layers:
  147. contract: contract.ts
  148. ui: .
  149. owner: conversation
  150. # remote-projects:由 architecture:adopt 登记
  151. - id: remote-projects
  152. roots:
  153. - packages/services/src/remote-projects
  154. managed: true
  155. requires: [services, shared, project-storage]
  156. publicEntrypoints:
  157. - packages/services/src/remote-projects/index.ts
  158. - packages/services/src/remote-projects/contract.ts
  159. layers:
  160. adapters: .
  161. owner: conversation
  162. # startup-storage:由 architecture:adopt 登记
  163. - id: startup-storage
  164. roots:
  165. - packages/services/src/startup-storage
  166. managed: true
  167. requires:
  168. - sqlite-migrations
  169. publicEntrypoints:
  170. - packages/services/src/startup-storage/index.ts
  171. - packages/services/src/startup-storage/contract.ts
  172. layers:
  173. adapters: .
  174. owner: persistence
  175. # workspace-config-catalog:由 architecture:adopt 登记
  176. - id: workspace-config-catalog
  177. roots:
  178. - packages/ui/src/workspace-config-catalog
  179. managed: true
  180. requires: [services, shared, ui]
  181. publicEntrypoints:
  182. - packages/ui/src/workspace-config-catalog/index.ts
  183. - packages/ui/src/workspace-config-catalog/contract.ts
  184. layers:
  185. contract: contract.ts
  186. app: catalog.ts
  187. ui: .
  188. owner: configuration
  189. # project-catalog:由 architecture:adopt 登记
  190. - id: project-catalog
  191. roots:
  192. - packages/services/src/project-catalog
  193. managed: true
  194. requires: [project, remote-projects]
  195. publicEntrypoints:
  196. - packages/services/src/project-catalog/index.ts
  197. - packages/services/src/project-catalog/contract.ts
  198. layers:
  199. contract: contract.ts
  200. domain: selection-id.ts
  201. app: .
  202. owner: conversation
  203. # bot-project-runtime:由 architecture:adopt 登记
  204. - id: bot-project-runtime
  205. roots:
  206. - packages/services/src/bot-project-runtime
  207. managed: true
  208. requires: [services, shared, remote-projects]
  209. publicEntrypoints:
  210. - packages/services/src/bot-project-runtime/index.ts
  211. - packages/services/src/bot-project-runtime/contract.ts
  212. layers:
  213. contract: contract.ts
  214. app: .
  215. owner: conversation
  216. # project-workspace-navigation:由 architecture:adopt 登记
  217. - id: project-workspace-navigation
  218. roots:
  219. - packages/services/src/project-workspace-navigation
  220. managed: true
  221. requires: [project, project-catalog, remote-projects, shared]
  222. publicEntrypoints:
  223. - packages/services/src/project-workspace-navigation/index.ts
  224. - packages/services/src/project-workspace-navigation/contract.ts
  225. layers:
  226. contract: contract.ts
  227. app: .
  228. owner: conversation
  229. # conversation-workspace-target:由 architecture:adopt 登记
  230. - id: conversation-workspace-target
  231. roots:
  232. - packages/ui/src/conversation-workspace-target
  233. managed: true
  234. requires: [shared, ui]
  235. publicEntrypoints:
  236. - packages/ui/src/conversation-workspace-target/index.ts
  237. - packages/ui/src/conversation-workspace-target/contract.ts
  238. - packages/ui/src/conversation-workspace-target/purpose.ts
  239. - packages/ui/src/conversation-workspace-target/sourceIdentity.ts
  240. - packages/ui/src/conversation-workspace-target/workbenchTarget.ts
  241. - packages/ui/src/conversation-workspace-target/usePluginCreator.ts
  242. - packages/ui/src/conversation-workspace-target/PluginAddMenu.tsx
  243. layers:
  244. contract: contract.ts
  245. app: .
  246. owner: conversation
  247. - id: gen-ui-protocol
  248. roots: [packages/shared/src/gen-ui]
  249. managed: true
  250. requires: []
  251. publicEntrypoints: [packages/shared/src/gen-ui/index.ts, packages/shared/src/gen-ui/contract.ts]
  252. layers: {domain: "."}
  253. owner: conversation
  254. - id: gen-ui-service
  255. roots: [packages/services/src/gen-ui]
  256. managed: true
  257. requires: [services, shared, rpc, gen-ui-protocol, mcp-apps-protocol]
  258. publicEntrypoints: [packages/services/src/gen-ui/index.ts, packages/services/src/gen-ui/contract.ts, packages/services/src/gen-ui/node.ts]
  259. layers: {domain: domain, app: app, adapters: adapters}
  260. layerOrder: [domain, app, adapters]
  261. owner: conversation
  262. - id: gen-ui
  263. roots: [packages/ui/src/gen-ui]
  264. managed: true
  265. requires: [ui, services, gen-ui-service, gen-ui-protocol, mcp-apps-protocol, plugin-ui]
  266. publicEntrypoints: [packages/ui/src/gen-ui/index.ts, packages/ui/src/gen-ui/contract.ts, packages/ui/src/gen-ui/host.ts]
  267. layers: {domain: domain, app: app, adapters: adapters, ui: components}
  268. layerOrder: [domain, app, adapters, ui]
  269. owner: conversation
  270. # 插件 UI(MCP Apps 沙箱):模块边界见各模块 CONTRACT.md。
  271. - id: mcp-apps-protocol
  272. roots: [packages/shared/src/mcp-apps]
  273. managed: true
  274. requires: []
  275. publicEntrypoints: [packages/shared/src/mcp-apps/index.ts, packages/shared/src/mcp-apps/contract.ts, packages/shared/src/mcp-apps/hostContract.ts]
  276. layers:
  277. domain: "."
  278. owner: plugin
  279. - id: mcp-ui
  280. roots: [apps/zcode-cli/packages/bootstrap/src/zcode-protocol/mcp-ui]
  281. managed: true
  282. requires: [zcode-cli, shared, mcp-apps-protocol]
  283. publicEntrypoints: [apps/zcode-cli/packages/bootstrap/src/zcode-protocol/mcp-ui/index.ts, apps/zcode-cli/packages/bootstrap/src/zcode-protocol/mcp-ui/contract.ts]
  284. layers:
  285. app: "."
  286. owner: plugin
  287. - id: plugin-ui-bridge
  288. roots: [packages/services/src/plugin-ui-bridge]
  289. managed: true
  290. requires: [services, shared, mcp-apps-protocol]
  291. publicEntrypoints: [packages/services/src/plugin-ui-bridge/index.ts, packages/services/src/plugin-ui-bridge/contract.ts, packages/services/src/plugin-ui-bridge/appToolsContract.ts, packages/services/src/plugin-ui-bridge/samplingContract.ts]
  292. layers:
  293. app: "."
  294. owner: plugin
  295. - id: plugin-sandbox
  296. roots:
  297. - packages/desktop/src/main/pluginSandbox
  298. - packages/desktop/src/host/pluginSandbox
  299. - packages/desktop/src/preload/pluginSandbox
  300. - packages/desktop/src/renderer/src/plugin-sandbox
  301. managed: true
  302. requires: [desktop, shared, mcp-apps-protocol, gen-ui-protocol]
  303. publicEntrypoints:
  304. [
  305. packages/desktop/src/host/pluginSandbox/index.ts,
  306. packages/desktop/src/host/pluginSandbox/contract.ts,
  307. packages/desktop/src/preload/pluginSandbox/hostBridge.ts,
  308. packages/desktop/src/main/pluginSandbox/index.ts,
  309. packages/desktop/src/main/pluginSandbox/contract.ts,
  310. # 页面兼容接口由宿主及其契约测试维护。
  311. packages/desktop/src/renderer/src/plugin-sandbox/aliasRuntime.ts,
  312. packages/desktop/src/renderer/src/plugin-sandbox/aliasApi.ts
  313. ]
  314. layers:
  315. adapters: "."
  316. owner: plugin
  317. - id: plugin-ui
  318. roots: [packages/ui/src/plugin-ui]
  319. managed: true
  320. requires: [ui, shared, services, mcp-apps-protocol, plugin-ui-bridge, plugin-sandbox]
  321. publicEntrypoints: [packages/ui/src/plugin-ui/index.ts, packages/ui/src/plugin-ui/contract.ts, packages/ui/src/plugin-ui/hostPrimitives.ts]
  322. layers:
  323. domain: domain
  324. app: app
  325. adapters: adapters
  326. ui: components
  327. layerOrder: [domain, app, adapters, ui]
  328. owner: plugin
  329. # remote-connection-flow:由 architecture:adopt 登记
  330. - id: remote-connection-flow
  331. roots:
  332. - packages/ui/src/remote-connection-flow
  333. managed: true
  334. requires:
  335. - shared
  336. - ui
  337. publicEntrypoints:
  338. - packages/ui/src/remote-connection-flow/index.ts
  339. - packages/ui/src/remote-connection-flow/contract.ts
  340. - packages/ui/src/remote-connection-flow/ui/RemoteConnectionProgress.tsx
  341. layers:
  342. app: .
  343. ui: ui
  344. layerOrder: [app, ui]
  345. owner: remote
  346. # project-workflow:由 architecture:adopt 登记
  347. - id: project-workflow
  348. roots:
  349. - packages/ui/src/project-workflow
  350. managed: true
  351. requires:
  352. - shared
  353. - ui
  354. - project-sidebar
  355. publicEntrypoints:
  356. - packages/ui/src/project-workflow/contract.ts
  357. - packages/ui/src/project-workflow/useWorkflowRunSave.ts
  358. - packages/ui/src/project-workflow/WorkflowRunSaveControls.tsx
  359. - packages/ui/src/project-workflow/WorkflowRunPaneSaveSlots.tsx
  360. layers:
  361. app: .
  362. owner: conversation
  363. # host-database-startup:由 architecture:adopt 登记
  364. - id: host-database-startup
  365. roots:
  366. - packages/desktop/src/host/database-startup
  367. managed: true
  368. requires:
  369. - project-storage
  370. - shared
  371. - desktop
  372. publicEntrypoints:
  373. - packages/desktop/src/host/database-startup/contract.ts
  374. - packages/desktop/src/host/database-startup/tasksStorageWorker.ts
  375. - packages/desktop/src/host/database-startup/hostDatabaseStartup.ts
  376. - packages/desktop/src/host/database-startup/storagePreparationProcesses.ts
  377. layers:
  378. adapters: .
  379. owner: persistence
  380. # cli-subagent-config:由 architecture:adopt 登记
  381. - id: cli-subagent-config
  382. roots:
  383. - apps/zcode-cli/packages/bootstrap/src/runtime-subagents
  384. - apps/zcode-cli/packages/bootstrap/tests/runtime-subagents
  385. managed: true
  386. requires:
  387. - shared
  388. publicEntrypoints:
  389. - apps/zcode-cli/packages/bootstrap/src/runtime-subagents/index.ts
  390. - apps/zcode-cli/packages/bootstrap/src/runtime-subagents/contract.ts
  391. layers:
  392. domain: .
  393. owner: agent
  394. # cli-session-execution:由 architecture:adopt 登记
  395. - id: cli-session-execution
  396. roots:
  397. - apps/zcode-cli/packages/bootstrap/src/session-execution
  398. - apps/zcode-cli/packages/bootstrap/tests/session-execution
  399. managed: true
  400. requires:
  401. - shared
  402. - zcode-cli
  403. publicEntrypoints:
  404. - apps/zcode-cli/packages/bootstrap/src/session-execution/index.ts
  405. - apps/zcode-cli/packages/bootstrap/src/session-execution/contract.ts
  406. layers:
  407. app: .
  408. owner: conversation
  409. # web-remote-relay:由 architecture:adopt 登记
  410. - id: web-remote-relay
  411. roots:
  412. - packages/shared/src/web-remote-relay
  413. managed: true
  414. requires: []
  415. publicEntrypoints:
  416. - packages/shared/src/web-remote-relay/index.ts
  417. - packages/shared/src/web-remote-relay/contract.ts
  418. layers:
  419. contract: contract.ts
  420. domain: domain
  421. adapters: .
  422. owner: remote
  423. layerOrder:
  424. - contract
  425. - domain
  426. - app
  427. - adapters
  428. - ui
  429. # desktop-web-remote-relay:由 architecture:adopt 登记
  430. - id: desktop-web-remote-relay
  431. roots:
  432. - packages/desktop/src/main/web-remote-relay
  433. managed: true
  434. requires:
  435. - client
  436. - desktop
  437. - shared
  438. - web-remote-relay
  439. publicEntrypoints:
  440. - packages/desktop/src/main/web-remote-relay/index.ts
  441. - packages/desktop/src/main/web-remote-relay/contract.ts
  442. layers:
  443. contract: contract.ts
  444. adapters: .
  445. owner: remote
  446. layerOrder:
  447. - contract
  448. - domain
  449. - app
  450. - adapters
  451. - ui
  452. # mobile-ui:由 architecture:adopt 登记
  453. - id: mobile-ui
  454. roots:
  455. - packages/ui/src/components/mobile-ui
  456. managed: true
  457. requires:
  458. - ui
  459. publicEntrypoints:
  460. - packages/ui/src/components/mobile-ui/index.ts
  461. - packages/ui/src/components/mobile-ui/contract.ts
  462. - packages/ui/src/components/mobile-ui/DevicePlatformIcon.tsx
  463. - packages/ui/src/components/mobile-ui/ZCodeAppLogo.tsx
  464. - packages/ui/src/components/mobile-ui/bottom-sheet.tsx
  465. layers:
  466. contract: contract.ts
  467. ui: .
  468. owner: remote
  469. layerOrder:
  470. - contract
  471. - domain
  472. - app
  473. - adapters
  474. - ui
  475. # web-remote-control-ui:由 architecture:adopt 登记
  476. - id: web-remote-control-ui
  477. roots:
  478. - packages/ui/src/web-remote-control
  479. managed: true
  480. requires:
  481. - mobile-ui
  482. - services
  483. - shared
  484. - ui
  485. publicEntrypoints:
  486. - packages/ui/src/web-remote-control/index.ts
  487. - packages/ui/src/web-remote-control/contract.ts
  488. - packages/ui/src/web-remote-control/WebRemoteControlDeviceHeader.tsx
  489. - packages/ui/src/web-remote-control/app/useWebRemoteControlAuthSync.ts
  490. layers:
  491. contract: contract.ts
  492. domain: domain
  493. app: app
  494. ui: .
  495. owner: remote
  496. layerOrder:
  497. - contract
  498. - domain
  499. - app
  500. - adapters
  501. - ui
  502. # web-remote-control:由 architecture:adopt 登记
  503. - id: web-remote-control
  504. roots:
  505. - packages/web/src/web-remote-control
  506. managed: true
  507. requires:
  508. - client
  509. - mobile-ui
  510. - shared
  511. - ui
  512. - web
  513. - web-remote-relay
  514. publicEntrypoints:
  515. - packages/web/src/web-remote-control/index.ts
  516. - packages/web/src/web-remote-control/contract.ts
  517. - packages/web/src/web-remote-control/views.ts
  518. - packages/web/src/web-remote-control/adapters/webRemoteControlThemeSeed.ts
  519. layers:
  520. contract: contracts
  521. domain: domain
  522. app: app
  523. adapters: adapters
  524. ui: ui
  525. owner: remote
  526. layerOrder:
  527. - contract
  528. - domain
  529. - app
  530. - adapters
  531. - ui
  532. # 保留既有源码位置;精确登记源文件,不扩大到整个 CLI 或 handlers 目录。
  533. - id: cli-arguments
  534. roots:
  535. - apps/zcode-cli/packages/cli/src/argument-parsing
  536. - apps/zcode-cli/packages/cli/src/arguments.ts
  537. - apps/zcode-cli/packages/cli/tests/argument-parsing
  538. managed: true
  539. requires: []
  540. publicEntrypoints:
  541. - apps/zcode-cli/packages/cli/src/arguments.ts
  542. - apps/zcode-cli/packages/cli/src/argument-parsing/contract.ts
  543. layers: {adapters: .}
  544. owner: agent
  545. - id: workflow-tool-entrypoints
  546. roots:
  547. - apps/zcode-cli/packages/core/src/tool/workflow-entrypoints
  548. - apps/zcode-cli/packages/core/src/tool/handlers/amend-workflow.ts
  549. - apps/zcode-cli/packages/core/src/tool/handlers/list-models.ts
  550. - apps/zcode-cli/packages/core/src/tool/handlers/fill-workflow-hole.ts
  551. - apps/zcode-cli/packages/core/tests/workflow-entrypoints
  552. managed: true
  553. requires: [zcode-cli]
  554. publicEntrypoints:
  555. - apps/zcode-cli/packages/core/src/tool/handlers/amend-workflow.ts
  556. - apps/zcode-cli/packages/core/src/tool/handlers/list-models.ts
  557. - apps/zcode-cli/packages/core/src/tool/handlers/fill-workflow-hole.ts
  558. - apps/zcode-cli/packages/core/src/tool/workflow-entrypoints/contract.ts
  559. layers: {app: .}
  560. owner: agent
  561. - id: tool-result-settlement
  562. roots:
  563. - apps/zcode-cli/packages/core/src/runtime/tool-result-settlement
  564. - apps/zcode-cli/packages/core/src/runtime/methods/tool-result-settlement.ts
  565. - apps/zcode-cli/packages/core/tests/tool-result-settlement
  566. managed: true
  567. requires: [zcode-cli]
  568. publicEntrypoints:
  569. - apps/zcode-cli/packages/core/src/runtime/methods/tool-result-settlement.ts
  570. - apps/zcode-cli/packages/core/src/runtime/tool-result-settlement/contract.ts
  571. layers: {app: .}
  572. owner: agent
  573. - id: channel-reply-tool
  574. roots:
  575. - apps/zcode-cli/packages/core/src/tool/channel-reply
  576. - apps/zcode-cli/packages/core/src/tool/handlers/reply-to-channel.ts
  577. - apps/zcode-cli/packages/core/tests/channel-reply
  578. managed: true
  579. requires: [shared, zcode-cli]
  580. publicEntrypoints:
  581. - apps/zcode-cli/packages/core/src/tool/handlers/reply-to-channel.ts
  582. - apps/zcode-cli/packages/core/src/tool/channel-reply/contract.ts
  583. layers: {app: .}
  584. owner: agent
  585. # composer-toolbar-layout:登记既有 DOM 布局入口,不改调用路径。
  586. - id: composer-toolbar-layout
  587. roots:
  588. - packages/ui/src/composer-toolbar-layout
  589. - packages/ui/src/prompt-editor/useComposerToolbarFit.ts
  590. - packages/ui/test/composer-toolbar-layout
  591. managed: true
  592. requires: []
  593. publicEntrypoints:
  594. - packages/ui/src/prompt-editor/useComposerToolbarFit.ts
  595. - packages/ui/src/composer-toolbar-layout/contract.ts
  596. layers: {ui: .}
  597. owner: conversation
  598. # task-groups:由 architecture:adopt 登记
  599. - id: task-groups
  600. roots:
  601. - packages/services/src/task-groups
  602. managed: true
  603. requires:
  604. - services
  605. - session
  606. - shared
  607. publicEntrypoints:
  608. - packages/services/src/task-groups/index.ts
  609. - packages/services/src/task-groups/contract.ts
  610. - packages/services/src/task-groups/migration-v6.ts
  611. layers:
  612. adapters: .
  613. owner: conversation
  614. # window-project-directory:由 architecture:adopt 登记
  615. - id: window-project-directory
  616. roots:
  617. - packages/services/src/window-project-directory
  618. managed: true
  619. requires:
  620. - project
  621. - remote-projects
  622. - rpc
  623. - services
  624. - shared
  625. publicEntrypoints:
  626. - packages/services/src/window-project-directory/index.ts
  627. - packages/services/src/window-project-directory/contract.ts
  628. layers:
  629. adapters: .
  630. owner: conversation
  631. # conversation-share-interaction:由 architecture:adopt 登记
  632. - id: conversation-share-interaction
  633. roots:
  634. - packages/ui/src/conversation-share-interaction
  635. managed: true
  636. requires:
  637. - services
  638. - shared
  639. - ui
  640. publicEntrypoints:
  641. - packages/ui/src/conversation-share-interaction/index.ts
  642. - packages/ui/src/conversation-share-interaction/contract.ts
  643. - packages/ui/src/conversation-share-interaction/ConversationSharePopover.tsx
  644. - packages/ui/src/conversation-share-interaction/ConversationSharePreflightStatus.tsx
  645. - packages/ui/src/conversation-share-interaction/conversationSharePopoverActions.ts
  646. - packages/ui/src/conversation-share-interaction/conversationSharePreflightRequest.ts
  647. - packages/ui/src/conversation-share-interaction/conversationSharePreflightResponse.ts
  648. layers:
  649. contract: contract.ts
  650. ui: .
  651. owner: conversation
  652. # workspace-plugin-preview:由 architecture:adopt 登记
  653. - id: workspace-plugin-preview
  654. roots:
  655. - packages/ui/src/workspace-plugin-preview
  656. managed: true
  657. requires:
  658. - shared
  659. - ui
  660. publicEntrypoints:
  661. - packages/ui/src/workspace-plugin-preview/index.ts
  662. - packages/ui/src/workspace-plugin-preview/contract.ts
  663. layers:
  664. ui: .
  665. owner: plugin
  666. # office-runtime:内置文档插件查看面板的共享运行时,由 architecture:adopt 登记
  667. - id: office-runtime
  668. roots:
  669. - apps/zcode-cli/packages/office-runtime
  670. managed: true
  671. requires: []
  672. publicEntrypoints:
  673. - apps/zcode-cli/packages/office-runtime/index.ts
  674. - apps/zcode-cli/packages/office-runtime/contract.ts
  675. layers:
  676. app: .
  677. owner: plugin
  678. # embedded-browser-permission:由 architecture:adopt 登记
  679. - id: embedded-browser-permission
  680. roots:
  681. - packages/desktop/src/main/embedded-browser-permission-contract
  682. - packages/desktop/src/main/embeddedBrowserPermissionPolicy.ts
  683. managed: true
  684. requires:
  685. - desktop
  686. - shared
  687. publicEntrypoints:
  688. - packages/desktop/src/main/embeddedBrowserPermissionPolicy.ts
  689. - packages/desktop/src/main/embedded-browser-permission-contract/contract.ts
  690. layers:
  691. adapters: .
  692. owner: desktop
  693. # marketing-touch-controller:由 architecture:adopt 登记
  694. - id: marketing-touch-controller
  695. roots:
  696. - packages/ui/src/marketing-touch-contract
  697. - packages/ui/src/components/marketing-touch/marketingTouchController.ts
  698. managed: true
  699. requires:
  700. - services
  701. - shared
  702. - ui
  703. publicEntrypoints:
  704. - packages/ui/src/components/marketing-touch/marketingTouchController.ts
  705. - packages/ui/src/marketing-touch-contract/contract.ts
  706. layers:
  707. app: .
  708. owner: desktop
  709. # side-pane-full-view:由 architecture:adopt 登记
  710. - id: side-pane-full-view
  711. roots:
  712. - packages/ui/src/side-pane-full-view
  713. managed: true
  714. requires:
  715. - shared
  716. - ui
  717. publicEntrypoints:
  718. - packages/ui/src/side-pane-full-view/index.ts
  719. - packages/ui/src/side-pane-full-view/contract.ts
  720. layers:
  721. ui: .
  722. owner: conversation
  723. global:
  724. # 临时时间戳(2026-09-10):unmanaged-new-file 只约束此日期之后首次入库的文件。
  725. # 基于领先 staging 很多的分支开工时,merge-base 之前的"新增"文件不应被追溯。
  726. newFilesEnforcedSince: "2026-09-10"
  727. acceptedUpstreamCommits: []
  728. maxFileLines: 800
  729. maxContractLines: 300
  730. maxPublicMethods: 12
  731. forbidCycles: true
  732. forbidDeepImports: true
  733. managedOnly: true
  734. acceptedUpstreamSnapshot: scripts/architecture/upstream-snapshot.json
  735. exceptions:
  736. - id: side-pane-full-view-shortcut-command-edit
  737. rule: unmanaged-new-file
  738. paths: [packages/shared/src/shortcutCommands.ts]
  739. reason: 已准入的快捷键命令表只追加一条 toggleSidePaneFullView 命令(Side Pane 完整视图,docs/ui/side-pane-full-view.md);命令表仍是唯一数据源,签名与模块边界不变,接管整个 shared 包不在本次范围内。
  740. - id: opensource-cua-test-project-config
  741. rule: unmanaged-new-file
  742. paths: [packages/zcode-cua/vitest.config.ts]
  743. reason: 该文件只装配测试项目,开源占位版本用于保持根单测入口可运行;不包含 producer 运行逻辑,不为同目录实现文件开放例外。
  744. - id: opensource-tool-search-comment-cleanup
  745. rule: unmanaged-new-file
  746. paths:
  747. - apps/zcode-cli/packages/contracts/src/tools/tool-search.ts
  748. - apps/zcode-cli/packages/core/src/tool/handlers/tool-search.ts
  749. reason: 已有上游文件仅去掉两行产品对标注释;去除注释后的 TypeScript 输出与 staging 完全一致。契约、实现和模块边界不变,整目录接管不在本次开源整理范围内;后续逻辑修改须重新核对模块治理。
  750. - id: project-location-cache-recovery-existing-edit
  751. rule: unmanaged-new-file
  752. paths:
  753. - packages/shared/src/project-access-token-client.ts
  754. - packages/services/src/model-provider/accountProjectTokenClient.ts
  755. - packages/services/src/credential/credentialService.ts
  756. reason: 已有项目 Token 与凭据存储增加派生缓存的局部恢复端口;保持原有 owner 和共享文件锁,不接管全目录。
  757. - id: test-ids-subpath-import-unmanaged-edit
  758. rule: unmanaged-new-file
  759. paths:
  760. - packages/ui/src/browser-use/EmbeddedBrowserPermissionPrompts.tsx
  761. - packages/ui/src/hooks/useStartPlanRecommendation.ts
  762. - packages/ui/src/settings/DynamicWorkflowModeSetting.tsx
  763. reason: 已准入的存量文件只把 TID 导入从 @zcode/shared 根入口改为 @zcode/shared/test-ids 子路径(根入口不再导出 test-ids,以收窄受影响单测范围);行为与模块边界不变,接管 ui 目录不在本次范围内。
  764. - id: connection-log-secret-token-unmanaged-edit
  765. rule: unmanaged-new-file
  766. paths: [packages/shared/src/source-server/connectionLog.ts]
  767. reason: 已存在的连接日志过滤函数只把已知秘密从子串替换改为完整 token 匹配,修复短密码反推泄露;签名与模块边界不变,接管整个 shared 包不在本次修复范围内。
  768. - id: connection-errors-econnreset-unmanaged-edit
  769. rule: unmanaged-new-file
  770. paths: [packages/shared/src/source-server/connectionErrors.ts]
  771. reason: 已存在的连接错误归一化码表补一项 ECONNRESET → remote-host-unreachable,修复在线断连恢复失败被误报为预检失败;签名与模块边界不变,接管整个 shared 包不在本次修复范围内。
  772. - id: client-config-public-field-unmanaged-edit
  773. rule: unmanaged-new-file
  774. paths: [packages/shared/src/clientConfig.ts]
  775. reason: Existing upstream public config parser gains one validated recommendation field; ownership and module boundaries remain unchanged, and adopting the shared package is outside this change.
  776. - id: highspeed-fallback-snapshot-unmanaged-edit
  777. rule: unmanaged-new-file
  778. paths: [apps/zcode-cli/packages/core/src/runtime/methods/turn-execution-fallback.ts]
  779. reason: 合并已存在于 staging 的加速卡回退模块,仅将可变 Session 读取替换为本轮固定候选;保持现有 Core 模块边界,不在同步分支时机械拆分整个 runtime。
  780. - id: shortcut-settings-existing-ui-edit
  781. rule: unmanaged-new-file
  782. paths:
  783. - packages/ui/src/components/ui/kbd.tsx
  784. - packages/ui/src/settings/ShortcutSearchBar.tsx
  785. - packages/ui/src/settings/ShortcutSettingsSection.tsx
  786. reason: Existing upstream shortcut components and keycap primitive edited for shared controls, responsive layout and save admission; adopting the entire settings directory requires a separate boundary refactor.
  787. - id: sidebar-workflow-tooltip-existing-ui-edit
  788. rule: unmanaged-new-file
  789. paths: [packages/ui/src/components/workflow-run-line/WorkflowRunRail.tsx]
  790. reason: Existing upstream workflow rail edited only to adapt native titles within the sidebar tooltip scope; workflow ownership and imports remain unchanged except for the shared UI tooltip adapter.
  791. - id: onboarding-existing-module-edit
  792. rule: unmanaged-new-file
  793. paths:
  794. - packages/services/src/onboarding/
  795. - packages/ui/src/onboarding/
  796. reason: onboarding 目录(记录持久化服务与触发 hook)是已合入 staging 的存量功能模块,本轮修复在其既有边界内收紧老用户判定与兜底;模块 adopt 登记需单独的边界梳理,不在本缺陷修复内展开。
  797. - id: remote-connection-flow-existing-size
  798. rule: max-file-lines
  799. paths: [packages/ui/src/remote-connection-flow/index.ts]
  800. reason: Preserve the existing single hook owner and closure; module adoption must not mechanically split state to satisfy line counts.
  801. - id: gen-ui-tweak-runtime-size
  802. rule: max-file-lines
  803. paths: [packages/desktop/src/renderer/src/plugin-sandbox/genUiTweakRuntime.js]
  804. reason: Keep parameter binding and registration lifecycle together; runtime-manifest.json and tests verify file integrity.
  805. - id: gen-ui-tweak-runtime-lint
  806. rule: disable-count
  807. paths: [packages/desktop/src/renderer/src/plugin-sandbox/genUiTweakRuntime.js]
  808. reason: Allow the control-character validation regex and the single-file parameter-control runtime.
  809. - id: settings-machine-unmanaged-edit
  810. rule: unmanaged-new-file
  811. paths: [packages/ui/src/settings/SettingsMachine.tsx]
  812. reason: Admitted upstream file edited only to remove settings notices; adopting packages/ui/src/settings needs a separate module boundary refactor.
  813. - id: workflow-amend-provider-boundary-unmanaged-edit
  814. rule: unmanaged-new-file
  815. paths:
  816. - apps/zcode-cli/packages/contracts/src/tools/amend-workflow.ts
  817. - apps/zcode-cli/packages/core/src/tool/handlers/amend-workflow-resolve.ts
  818. reason: Admitted upstream files edited only to make an own-run AmendWorkflow that brings in a new provider ask the user; adopting the zcode-cli contracts and core handlers needs a separate module boundary refactor.
  819. - id: workflow-share-unmanaged-new-files
  820. rule: unmanaged-new-file
  821. paths:
  822. - packages/services/src/conversation-share/conversationShareInlineImages.ts
  823. - packages/services/src/conversation-share/conversationShareWorkflowSnapshot.ts
  824. - packages/shared/src/conversation-share-content.ts
  825. - packages/shared/src/conversation-share-tool-presentation.ts
  826. - packages/ui/src/v4/ConversationShareContent.tsx
  827. - packages/ui/src/v4/ConversationShareWorkflow.tsx
  828. - packages/ui/src/v4/conversationShareItems.ts
  829. - packages/ui/src/ToolCallBlocks/ToolPresentation.tsx
  830. - packages/ui/src/ToolCallBlocks/presentationCapabilities.tsx
  831. - packages/ui/src/ToolCallBlocks/renderers/list-models.tsx
  832. - packages/ui/src/ToolCallBlocks/renderers/list-saved-workflows-presentation.tsx
  833. - packages/ui/src/ToolCallBlocks/renderers/web-fetch.tsx
  834. - packages/ui/src/hooks/useToolPresentationHostCapabilities.ts
  835. - packages/ui/src/chat-input-toolbar/thoughtLevelLabels.ts
  836. - packages/ui/src/components/workflow-timeline/subagent-model-label.ts
  837. - packages/desktop/src/main/fileApplications.ts
  838. reason: Feature-branch files admitted path-exact; adopting conversation-share, tool presentation or renderer directories needs a separate module boundary refactor (same pattern as settings-machine-unmanaged-edit).
  839. - id: workflow-notifications-unmanaged-files
  840. rule: unmanaged-new-file
  841. paths:
  842. - apps/zcode-cli/packages/core/src/runtime-task/workflow-blocked-reminder.ts
  843. - apps/zcode-cli/packages/core/src/runtime/methods/dynamic-workflow-blocked-reminder.ts
  844. - apps/zcode-cli/packages/core/src/runtime-task/workflow-notification-copy.ts
  845. - apps/zcode-cli/packages/core/src/runtime/methods/dynamic-workflow-run-hole-notification.ts
  846. - apps/zcode-cli/packages/core/src/tool/handlers/model-reference.ts
  847. - packages/shared/src/test-ids-workflow.ts
  848. reason: Workflow reminder, notification and model reference files reached staging without the MR architecture gate running; adopting the zcode-cli core and shared test ids needs a separate module boundary refactor.
  849. - id: composer-toolbar-unmanaged-files
  850. rule: unmanaged-new-file
  851. paths:
  852. - packages/ui/src/ControlShortcutBadge.tsx
  853. - packages/ui/src/chat-input-toolbar/ComposerEffortHeading.tsx
  854. - packages/ui/src/chat-input-toolbar/ComposerModelMenu.tsx
  855. - packages/ui/src/chat-input-toolbar/ComposerProviderMenu.tsx
  856. - packages/ui/src/chat-input-toolbar/ComposerTriggerTransition.tsx
  857. - packages/ui/src/hooks/useComposerConnectionSwitch.ts
  858. - packages/ui/src/lib/composerPlanGroups.ts
  859. - packages/ui/src/lib/providerFamilyConnectionTransition.ts
  860. - packages/ui/src/prompt-editor/useComposerToolbarFit.ts
  861. reason: Composer model, provider and toolbar files reached staging without the MR architecture gate running; adopting the packages/ui composer toolbar needs a separate module boundary refactor.
  862. - id: provider-endpoint-routing-unmanaged-edit
  863. rule: unmanaged-new-file
  864. paths:
  865. - apps/zcode-cli/packages/adapters/src/model/endpoint-routing-edition/index.ts
  866. - apps/zcode-cli/packages/adapters/src/model/provider-endpoint-routing-options.ts
  867. reason: Existing upstream routing assembly files gain the endpoint origin and injected JWT reader; adopting the full CLI model adapter directory needs a separate module boundary refactor.
  868. - id: workflow-mode-user-choice-unmanaged-edit
  869. rule: unmanaged-new-file
  870. paths:
  871. - packages/shared/src/dynamic-workflow-feature.ts
  872. - packages/ui/src/settings/DynamicWorkflowModeSetting.tsx
  873. - packages/ui/src/store/dynamicWorkflowAvailabilityStore.ts
  874. reason: Admitted upstream files edited only to let the user's dynamic workflow mode choice always win and keep the settings row visible; adopting packages/shared/src and packages/ui/src needs a separate module boundary refactor.