architecture-policy.yaml 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513
  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: conversation-telemetry-engine
  71. roots: [packages/shared/src/conversation-telemetry]
  72. managed: true
  73. requires: [shared]
  74. publicEntrypoints:
  75. - packages/shared/src/conversation-telemetry/index.ts
  76. - packages/shared/src/conversation-telemetry/contract.ts
  77. - packages/shared/src/conversation-telemetry/messageTelemetry.ts
  78. - packages/shared/src/conversation-telemetry/providerTelemetryIdentity.ts
  79. - packages/shared/src/conversation-telemetry/remoteTelemetryEvent.ts
  80. layers: {app: "."}
  81. owner: conversation
  82. - id: conversation-telemetry-service
  83. roots: [packages/services/src/conversation-telemetry]
  84. managed: true
  85. requires: [shared, services, rpc, conversation-telemetry-engine]
  86. publicEntrypoints:
  87. - packages/services/src/conversation-telemetry/remoteConversationTelemetry.ts
  88. - packages/services/src/conversation-telemetry/contract.ts
  89. layers: {app: "."}
  90. owner: conversation
  91. - id: sqlite-migrations
  92. roots:
  93. - packages/shared/src/sqlite-migrations
  94. managed: true
  95. requires: []
  96. publicEntrypoints:
  97. - packages/shared/src/sqlite-migrations/index.ts
  98. - packages/shared/src/sqlite-migrations/contract.ts
  99. layers:
  100. adapters: .
  101. owner: persistence
  102. # project-storage:由 architecture:adopt 登记
  103. - id: project-storage
  104. roots:
  105. - packages/services/src/project-storage
  106. managed: true
  107. requires:
  108. - shared
  109. - sqlite-migrations
  110. - services
  111. - session
  112. publicEntrypoints:
  113. - packages/services/src/project-storage/index.ts
  114. - packages/services/src/project-storage/contract.ts
  115. - packages/services/src/project-storage/startup.ts
  116. - packages/services/src/project-storage/startup-entry.ts
  117. layers:
  118. adapters: .
  119. owner: conversation
  120. # project:由 architecture:adopt 登记
  121. - id: project
  122. roots:
  123. - packages/services/src/project
  124. managed: true
  125. requires: [project-storage, services, shared]
  126. publicEntrypoints:
  127. - packages/services/src/project/index.ts
  128. - packages/services/src/project/contract.ts
  129. layers:
  130. adapters: .
  131. owner: conversation
  132. # task-facts:由 architecture:adopt 登记
  133. - id: task-facts
  134. roots:
  135. - packages/services/src/task-facts
  136. managed: true
  137. requires: [shared]
  138. publicEntrypoints:
  139. - packages/services/src/task-facts/index.ts
  140. - packages/services/src/task-facts/contract.ts
  141. - packages/services/src/task-facts/repairSubagentTaskIndex.ts
  142. layers:
  143. app: .
  144. owner: conversation
  145. # project-sidebar:由 architecture:adopt 登记
  146. - id: project-sidebar
  147. roots:
  148. - packages/ui/src/project-sidebar
  149. managed: true
  150. requires:
  151. - services
  152. - shared
  153. - ui
  154. - conversation-workspace-target
  155. - web-remote-control-ui
  156. - remote-connection-flow
  157. - data-sync
  158. publicEntrypoints:
  159. - packages/ui/src/project-sidebar/index.tsx
  160. - packages/ui/src/project-sidebar/contract.ts
  161. - packages/ui/src/project-sidebar/remote-project-connection.ts
  162. - packages/ui/src/project-sidebar/useSavedWorkflowProjectOptions.ts
  163. - packages/ui/src/project-sidebar/RemoteProjectMenu.tsx
  164. - packages/ui/src/project-sidebar/WorkspaceDragOverlay.tsx
  165. - packages/ui/src/project-sidebar/useRemoteProjectConnectionPresentation.ts
  166. - packages/ui/src/project-sidebar/OfflineRemoteProjectRows.tsx
  167. - packages/ui/src/project-sidebar/RemoteConversationDisconnected.tsx
  168. layers:
  169. contract: contract.ts
  170. ui: .
  171. owner: conversation
  172. # remote-projects:由 architecture:adopt 登记
  173. - id: remote-projects
  174. roots:
  175. - packages/services/src/remote-projects
  176. managed: true
  177. requires: [services, shared, project-storage]
  178. publicEntrypoints:
  179. - packages/services/src/remote-projects/index.ts
  180. - packages/services/src/remote-projects/contract.ts
  181. layers:
  182. adapters: .
  183. owner: conversation
  184. # startup-storage:由 architecture:adopt 登记
  185. - id: startup-storage
  186. roots:
  187. - packages/services/src/startup-storage
  188. managed: true
  189. requires:
  190. - sqlite-migrations
  191. publicEntrypoints:
  192. - packages/services/src/startup-storage/index.ts
  193. - packages/services/src/startup-storage/contract.ts
  194. layers:
  195. adapters: .
  196. owner: persistence
  197. # workspace-config-catalog:由 architecture:adopt 登记
  198. - id: workspace-config-catalog
  199. roots:
  200. - packages/ui/src/workspace-config-catalog
  201. managed: true
  202. requires: [services, shared, ui]
  203. publicEntrypoints:
  204. - packages/ui/src/workspace-config-catalog/index.ts
  205. - packages/ui/src/workspace-config-catalog/contract.ts
  206. layers:
  207. contract: contract.ts
  208. app: catalog.ts
  209. ui: .
  210. owner: configuration
  211. # project-catalog:由 architecture:adopt 登记
  212. - id: project-catalog
  213. roots:
  214. - packages/services/src/project-catalog
  215. managed: true
  216. requires: [project, remote-projects]
  217. publicEntrypoints:
  218. - packages/services/src/project-catalog/index.ts
  219. - packages/services/src/project-catalog/contract.ts
  220. layers:
  221. contract: contract.ts
  222. domain: selection-id.ts
  223. app: .
  224. owner: conversation
  225. # bot-project-runtime:由 architecture:adopt 登记
  226. - id: bot-project-runtime
  227. roots:
  228. - packages/services/src/bot-project-runtime
  229. managed: true
  230. requires: [services, shared, remote-projects]
  231. publicEntrypoints:
  232. - packages/services/src/bot-project-runtime/index.ts
  233. - packages/services/src/bot-project-runtime/contract.ts
  234. layers:
  235. contract: contract.ts
  236. app: .
  237. owner: conversation
  238. # project-workspace-navigation:由 architecture:adopt 登记
  239. - id: project-workspace-navigation
  240. roots:
  241. - packages/services/src/project-workspace-navigation
  242. managed: true
  243. requires: [project, project-catalog, remote-projects, shared]
  244. publicEntrypoints:
  245. - packages/services/src/project-workspace-navigation/index.ts
  246. - packages/services/src/project-workspace-navigation/contract.ts
  247. layers:
  248. contract: contract.ts
  249. app: .
  250. owner: conversation
  251. # conversation-workspace-target:由 architecture:adopt 登记
  252. - id: conversation-workspace-target
  253. roots:
  254. - packages/ui/src/conversation-workspace-target
  255. managed: true
  256. requires: [shared, ui]
  257. publicEntrypoints:
  258. - packages/ui/src/conversation-workspace-target/index.ts
  259. - packages/ui/src/conversation-workspace-target/contract.ts
  260. - packages/ui/src/conversation-workspace-target/purpose.ts
  261. - packages/ui/src/conversation-workspace-target/sourceIdentity.ts
  262. - packages/ui/src/conversation-workspace-target/workbenchTarget.ts
  263. - packages/ui/src/conversation-workspace-target/usePluginCreator.ts
  264. - packages/ui/src/conversation-workspace-target/PluginAddMenu.tsx
  265. layers:
  266. contract: contract.ts
  267. app: .
  268. owner: conversation
  269. - id: gen-ui-protocol
  270. roots: [packages/shared/src/gen-ui]
  271. managed: true
  272. requires: []
  273. publicEntrypoints: [packages/shared/src/gen-ui/index.ts, packages/shared/src/gen-ui/contract.ts]
  274. layers: {domain: "."}
  275. owner: conversation
  276. - id: gen-ui-service
  277. roots: [packages/services/src/gen-ui]
  278. managed: true
  279. requires: [services, shared, rpc, gen-ui-protocol, mcp-apps-protocol]
  280. publicEntrypoints: [packages/services/src/gen-ui/index.ts, packages/services/src/gen-ui/contract.ts, packages/services/src/gen-ui/node.ts]
  281. layers: {domain: domain, app: app, adapters: adapters}
  282. layerOrder: [domain, app, adapters]
  283. owner: conversation
  284. - id: gen-ui
  285. roots: [packages/ui/src/gen-ui]
  286. managed: true
  287. requires: [ui, services, gen-ui-service, gen-ui-protocol, mcp-apps-protocol, plugin-ui]
  288. publicEntrypoints: [packages/ui/src/gen-ui/index.ts, packages/ui/src/gen-ui/contract.ts, packages/ui/src/gen-ui/host.ts]
  289. layers: {domain: domain, app: app, adapters: adapters, ui: components}
  290. layerOrder: [domain, app, adapters, ui]
  291. owner: conversation
  292. # 插件 UI(MCP Apps 沙箱):模块边界见各模块 CONTRACT.md。
  293. - id: mcp-apps-protocol
  294. roots: [packages/shared/src/mcp-apps]
  295. managed: true
  296. requires: []
  297. publicEntrypoints: [packages/shared/src/mcp-apps/index.ts, packages/shared/src/mcp-apps/contract.ts, packages/shared/src/mcp-apps/hostContract.ts]
  298. layers:
  299. domain: "."
  300. owner: plugin
  301. - id: mcp-ui
  302. roots: [apps/zcode-cli/packages/bootstrap/src/zcode-protocol/mcp-ui]
  303. managed: true
  304. requires: [zcode-cli, shared, mcp-apps-protocol]
  305. 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]
  306. layers:
  307. app: "."
  308. owner: plugin
  309. - id: plugin-ui-bridge
  310. roots: [packages/services/src/plugin-ui-bridge]
  311. managed: true
  312. requires: [services, shared, mcp-apps-protocol]
  313. 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]
  314. layers:
  315. app: "."
  316. owner: plugin
  317. - id: plugin-sandbox
  318. roots:
  319. - packages/desktop/src/main/pluginSandbox
  320. - packages/desktop/src/host/pluginSandbox
  321. - packages/desktop/src/preload/pluginSandbox
  322. - packages/desktop/src/renderer/src/plugin-sandbox
  323. managed: true
  324. requires: [desktop, shared, mcp-apps-protocol, gen-ui-protocol]
  325. publicEntrypoints:
  326. [
  327. packages/desktop/src/host/pluginSandbox/index.ts,
  328. packages/desktop/src/host/pluginSandbox/contract.ts,
  329. packages/desktop/src/preload/pluginSandbox/hostBridge.ts,
  330. packages/desktop/src/main/pluginSandbox/index.ts,
  331. packages/desktop/src/main/pluginSandbox/contract.ts,
  332. # 页面兼容接口由宿主及其契约测试维护。
  333. packages/desktop/src/renderer/src/plugin-sandbox/aliasRuntime.ts,
  334. packages/desktop/src/renderer/src/plugin-sandbox/aliasApi.ts
  335. ]
  336. layers:
  337. adapters: "."
  338. owner: plugin
  339. - id: plugin-ui
  340. roots: [packages/ui/src/plugin-ui]
  341. managed: true
  342. requires: [ui, shared, services, mcp-apps-protocol, plugin-ui-bridge, plugin-sandbox]
  343. publicEntrypoints: [packages/ui/src/plugin-ui/index.ts, packages/ui/src/plugin-ui/contract.ts, packages/ui/src/plugin-ui/hostPrimitives.ts]
  344. layers:
  345. domain: domain
  346. app: app
  347. adapters: adapters
  348. ui: components
  349. layerOrder: [domain, app, adapters, ui]
  350. owner: plugin
  351. # remote-connection-flow:由 architecture:adopt 登记
  352. - id: remote-connection-flow
  353. roots:
  354. - packages/ui/src/remote-connection-flow
  355. managed: true
  356. requires:
  357. - shared
  358. - ui
  359. publicEntrypoints:
  360. - packages/ui/src/remote-connection-flow/index.ts
  361. - packages/ui/src/remote-connection-flow/contract.ts
  362. - packages/ui/src/remote-connection-flow/ui/RemoteConnectionProgress.tsx
  363. layers:
  364. app: .
  365. ui: ui
  366. layerOrder: [app, ui]
  367. owner: remote
  368. # project-workflow:由 architecture:adopt 登记
  369. - id: project-workflow
  370. roots:
  371. - packages/ui/src/project-workflow
  372. managed: true
  373. requires:
  374. - shared
  375. - ui
  376. - project-sidebar
  377. publicEntrypoints:
  378. - packages/ui/src/project-workflow/contract.ts
  379. - packages/ui/src/project-workflow/useWorkflowRunSave.ts
  380. - packages/ui/src/project-workflow/WorkflowRunSaveControls.tsx
  381. - packages/ui/src/project-workflow/WorkflowRunPaneSaveSlots.tsx
  382. layers:
  383. app: .
  384. owner: conversation
  385. # host-database-startup:由 architecture:adopt 登记
  386. - id: host-database-startup
  387. roots:
  388. - packages/desktop/src/host/database-startup
  389. managed: true
  390. requires:
  391. - project-storage
  392. - shared
  393. - desktop
  394. publicEntrypoints:
  395. - packages/desktop/src/host/database-startup/contract.ts
  396. - packages/desktop/src/host/database-startup/tasksStorageWorker.ts
  397. - packages/desktop/src/host/database-startup/hostDatabaseStartup.ts
  398. - packages/desktop/src/host/database-startup/storagePreparationProcesses.ts
  399. layers:
  400. adapters: .
  401. owner: persistence
  402. # cli-subagent-config:由 architecture:adopt 登记
  403. - id: cli-subagent-config
  404. roots:
  405. - apps/zcode-cli/packages/bootstrap/src/runtime-subagents
  406. - apps/zcode-cli/packages/bootstrap/tests/runtime-subagents
  407. managed: true
  408. requires:
  409. - shared
  410. publicEntrypoints:
  411. - apps/zcode-cli/packages/bootstrap/src/runtime-subagents/index.ts
  412. - apps/zcode-cli/packages/bootstrap/src/runtime-subagents/contract.ts
  413. layers:
  414. domain: .
  415. owner: agent
  416. # cli-session-execution:由 architecture:adopt 登记
  417. - id: cli-session-execution
  418. roots:
  419. - apps/zcode-cli/packages/bootstrap/src/session-execution
  420. - apps/zcode-cli/packages/bootstrap/tests/session-execution
  421. - apps/zcode-cli/packages/core/src/runtime/permission-full-access.ts
  422. - apps/zcode-cli/packages/core/tests/permission-full-access.test.ts
  423. - apps/zcode-cli/packages/bootstrap/tests/draft-permission-full-access.test.ts
  424. managed: true
  425. requires:
  426. - shared
  427. - zcode-cli
  428. publicEntrypoints:
  429. - apps/zcode-cli/packages/bootstrap/src/session-execution/index.ts
  430. - apps/zcode-cli/packages/bootstrap/src/session-execution/contract.ts
  431. - apps/zcode-cli/packages/core/src/runtime/permission-full-access.ts
  432. layers:
  433. app: .
  434. owner: conversation
  435. # web-remote-relay:由 architecture:adopt 登记
  436. - id: web-remote-relay
  437. roots:
  438. - packages/shared/src/web-remote-relay
  439. managed: true
  440. requires: []
  441. publicEntrypoints:
  442. - packages/shared/src/web-remote-relay/index.ts
  443. - packages/shared/src/web-remote-relay/contract.ts
  444. layers:
  445. contract: contract.ts
  446. domain: domain
  447. adapters: .
  448. owner: remote
  449. layerOrder:
  450. - contract
  451. - domain
  452. - app
  453. - adapters
  454. - ui
  455. # desktop-web-remote-relay:由 architecture:adopt 登记
  456. - id: desktop-web-remote-relay
  457. roots:
  458. - packages/desktop/src/main/web-remote-relay
  459. managed: true
  460. requires:
  461. - client
  462. - desktop
  463. - shared
  464. - web-remote-relay
  465. publicEntrypoints:
  466. - packages/desktop/src/main/web-remote-relay/index.ts
  467. - packages/desktop/src/main/web-remote-relay/contract.ts
  468. layers:
  469. contract: contract.ts
  470. adapters: .
  471. owner: remote
  472. layerOrder:
  473. - contract
  474. - domain
  475. - app
  476. - adapters
  477. - ui
  478. # mobile-ui:由 architecture:adopt 登记
  479. - id: mobile-ui
  480. roots:
  481. - packages/ui/src/components/mobile-ui
  482. managed: true
  483. requires:
  484. - ui
  485. publicEntrypoints:
  486. - packages/ui/src/components/mobile-ui/index.ts
  487. - packages/ui/src/components/mobile-ui/contract.ts
  488. - packages/ui/src/components/mobile-ui/DevicePlatformIcon.tsx
  489. - packages/ui/src/components/mobile-ui/ZCodeAppLogo.tsx
  490. - packages/ui/src/components/mobile-ui/bottom-sheet.tsx
  491. layers:
  492. contract: contract.ts
  493. ui: .
  494. owner: remote
  495. layerOrder:
  496. - contract
  497. - domain
  498. - app
  499. - adapters
  500. - ui
  501. # web-remote-control-ui:由 architecture:adopt 登记
  502. - id: web-remote-control-ui
  503. roots:
  504. - packages/ui/src/web-remote-control
  505. managed: true
  506. requires:
  507. - mobile-ui
  508. - services
  509. - shared
  510. - ui
  511. publicEntrypoints:
  512. - packages/ui/src/web-remote-control/index.ts
  513. - packages/ui/src/web-remote-control/contract.ts
  514. - packages/ui/src/web-remote-control/WebRemoteControlDeviceHeader.tsx
  515. - packages/ui/src/web-remote-control/app/useWebRemoteControlAuthSync.ts
  516. layers:
  517. contract: contract.ts
  518. domain: domain
  519. app: app
  520. ui: .
  521. owner: remote
  522. layerOrder:
  523. - contract
  524. - domain
  525. - app
  526. - adapters
  527. - ui
  528. # web-remote-control:由 architecture:adopt 登记
  529. - id: web-remote-control
  530. roots:
  531. - packages/web/src/web-remote-control
  532. managed: true
  533. requires:
  534. - client
  535. - mobile-ui
  536. - shared
  537. - ui
  538. - web
  539. - web-remote-relay
  540. publicEntrypoints:
  541. - packages/web/src/web-remote-control/index.ts
  542. - packages/web/src/web-remote-control/contract.ts
  543. - packages/web/src/web-remote-control/views.ts
  544. - packages/web/src/web-remote-control/adapters/webRemoteControlThemeSeed.ts
  545. layers:
  546. contract: contracts
  547. domain: domain
  548. app: app
  549. adapters: adapters
  550. ui: ui
  551. owner: remote
  552. layerOrder:
  553. - contract
  554. - domain
  555. - app
  556. - adapters
  557. - ui
  558. # 保留既有源码位置;精确登记源文件,不扩大到整个 CLI 或 handlers 目录。
  559. - id: cli-arguments
  560. roots:
  561. - apps/zcode-cli/packages/cli/src/argument-parsing
  562. - apps/zcode-cli/packages/cli/src/arguments.ts
  563. - apps/zcode-cli/packages/cli/tests/argument-parsing
  564. managed: true
  565. requires: []
  566. publicEntrypoints:
  567. - apps/zcode-cli/packages/cli/src/arguments.ts
  568. - apps/zcode-cli/packages/cli/src/argument-parsing/contract.ts
  569. layers: {adapters: .}
  570. owner: agent
  571. - id: workflow-tool-entrypoints
  572. roots:
  573. - apps/zcode-cli/packages/core/src/tool/workflow-entrypoints
  574. - apps/zcode-cli/packages/core/src/tool/handlers/amend-workflow.ts
  575. - apps/zcode-cli/packages/core/src/tool/handlers/list-models.ts
  576. - apps/zcode-cli/packages/core/src/tool/handlers/fill-workflow-hole.ts
  577. - apps/zcode-cli/packages/core/tests/workflow-entrypoints
  578. managed: true
  579. requires: [zcode-cli]
  580. publicEntrypoints:
  581. - apps/zcode-cli/packages/core/src/tool/handlers/amend-workflow.ts
  582. - apps/zcode-cli/packages/core/src/tool/handlers/list-models.ts
  583. - apps/zcode-cli/packages/core/src/tool/handlers/fill-workflow-hole.ts
  584. - apps/zcode-cli/packages/core/src/tool/workflow-entrypoints/contract.ts
  585. layers: {app: .}
  586. owner: agent
  587. - id: tool-result-settlement
  588. roots:
  589. - apps/zcode-cli/packages/core/src/runtime/tool-result-settlement
  590. - apps/zcode-cli/packages/core/src/runtime/methods/tool-result-settlement.ts
  591. - apps/zcode-cli/packages/core/tests/tool-result-settlement
  592. managed: true
  593. requires: [zcode-cli, session-features]
  594. publicEntrypoints:
  595. - apps/zcode-cli/packages/core/src/runtime/methods/tool-result-settlement.ts
  596. - apps/zcode-cli/packages/core/src/runtime/tool-result-settlement/contract.ts
  597. layers: {app: .}
  598. owner: agent
  599. # remote-input-prediction:手机远控输入预测(v4 线格式、Host 侧开关、CLI 只读查询)。
  600. # 规格:docs/web-remote-control/mobile-input-prediction.md。
  601. - id: remote-input-prediction
  602. roots:
  603. - packages/shared/src/zcode-protocol-v4/input-prediction
  604. - packages/services/src/zcode-agent/inputPredictionSwitch.ts
  605. - apps/zcode-cli/packages/bootstrap/src/zcode-protocol/input-prediction-handler.ts
  606. - apps/zcode-cli/packages/core/src/runtime/methods/input-prediction-sidecar.ts
  607. managed: true
  608. requires: [shared, zcode-cli]
  609. publicEntrypoints:
  610. - packages/shared/src/zcode-protocol-v4/input-prediction/contract.ts
  611. - packages/services/src/zcode-agent/inputPredictionSwitch.ts
  612. - apps/zcode-cli/packages/bootstrap/src/zcode-protocol/input-prediction-handler.ts
  613. - apps/zcode-cli/packages/core/src/runtime/methods/input-prediction-sidecar.ts
  614. layers: {app: .}
  615. owner: remote
  616. # remote-resident-rows-range:rowsRange 只读热会话(residency="resident-only")的 Host 侧执行端能力确认,
  617. # 供手机任务列表预加载;旧 CLI 不认识该参数时 Host 直接拒绝,不触发冷恢复。
  618. - id: remote-resident-rows-range
  619. roots:
  620. - packages/services/src/zcode-agent/resident-rows-range
  621. managed: true
  622. requires: [shared, services]
  623. publicEntrypoints:
  624. - packages/services/src/zcode-agent/resident-rows-range/contract.ts
  625. layers: {app: .}
  626. owner: remote
  627. - id: tool-discovery
  628. roots:
  629. - apps/zcode-cli/packages/core/src/tool/search
  630. - apps/zcode-cli/packages/core/src/tool/handlers/tool-search.ts
  631. - apps/zcode-cli/packages/core/src/tool/handlers/deferred-tool-call.ts
  632. - apps/zcode-cli/packages/contracts/src/tools/tool-search.ts
  633. - apps/zcode-cli/packages/core/tests/tool-discovery
  634. managed: true
  635. requires: [zcode-cli]
  636. publicEntrypoints:
  637. - apps/zcode-cli/packages/core/src/tool/search/contract.ts
  638. - apps/zcode-cli/packages/core/src/tool/search/exposure.ts
  639. - apps/zcode-cli/packages/core/src/tool/search/history.ts
  640. - apps/zcode-cli/packages/core/src/tool/search/search.ts
  641. - apps/zcode-cli/packages/core/src/tool/search/description.ts
  642. - apps/zcode-cli/packages/core/src/tool/search/local-projection.ts
  643. - apps/zcode-cli/packages/core/src/tool/handlers/tool-search.ts
  644. - apps/zcode-cli/packages/core/src/tool/handlers/deferred-tool-call.ts
  645. - apps/zcode-cli/packages/contracts/src/tools/tool-search.ts
  646. layers: {app: .}
  647. owner: agent
  648. # node-repl-call-ledger:node_repl 结果里可信事实的唯一来源(apps/zcode-cli/docs/design/v2/tool/20-node-repl-call-ledger.md)
  649. - id: node-repl-call-ledger
  650. roots:
  651. - apps/zcode-cli/packages/node-repl-host/src/call-ledger
  652. - apps/zcode-cli/packages/node-repl-host/test/call-ledger
  653. managed: true
  654. requires: [zcode-cli]
  655. publicEntrypoints:
  656. - apps/zcode-cli/packages/node-repl-host/src/call-ledger/contract.ts
  657. layers: {adapters: .}
  658. owner: agent
  659. - id: session-features
  660. roots:
  661. - apps/zcode-cli/packages/core/src/runtime/session-features
  662. - apps/zcode-cli/packages/core/tests/session-features
  663. managed: true
  664. requires: [zcode-cli]
  665. publicEntrypoints:
  666. - apps/zcode-cli/packages/core/src/runtime/session-features/contract.ts
  667. layers: {app: .}
  668. owner: agent
  669. - id: provider-tool-rounds
  670. roots:
  671. - apps/zcode-cli/packages/core/src/runtime/provider-tool-rounds
  672. - apps/zcode-cli/packages/core/tests/provider-tool-rounds
  673. managed: true
  674. requires: [zcode-cli]
  675. publicEntrypoints:
  676. - apps/zcode-cli/packages/core/src/runtime/provider-tool-rounds/contract.ts
  677. layers: {app: .}
  678. owner: agent
  679. - id: provider-builtin-tool-compat
  680. roots:
  681. - apps/zcode-cli/packages/adapters/src/model/provider-builtin-tool-compat
  682. - apps/zcode-cli/packages/adapters/tests/provider-builtin-tool-compat
  683. managed: true
  684. requires: []
  685. publicEntrypoints:
  686. - apps/zcode-cli/packages/adapters/src/model/provider-builtin-tool-compat/contract.ts
  687. layers: {adapters: .}
  688. owner: agent
  689. - id: conversation-quote-context
  690. roots:
  691. - apps/zcode-cli/packages/core/src/runtime/conversation-quote-context
  692. - apps/zcode-cli/packages/core/src/runtime/helpers/conversation-quotes.ts
  693. - apps/zcode-cli/packages/core/tests/conversation-quote-context
  694. managed: true
  695. requires: [zcode-cli]
  696. publicEntrypoints:
  697. - apps/zcode-cli/packages/core/src/runtime/conversation-quote-context/contract.ts
  698. - apps/zcode-cli/packages/core/src/runtime/helpers/conversation-quotes.ts
  699. layers: {domain: .}
  700. owner: agent
  701. - id: tool-search-comparison
  702. roots:
  703. - apps/zcode-cli/tools/prompt-trajectory/src/tool-search-comparison-contract
  704. - apps/zcode-cli/tools/prompt-trajectory/src/tool-search-comparison.ts
  705. - apps/zcode-cli/tools/prompt-trajectory/tests/tool-search-comparison
  706. managed: true
  707. requires: [zcode-cli]
  708. publicEntrypoints:
  709. - apps/zcode-cli/tools/prompt-trajectory/src/tool-search-comparison-contract/contract.ts
  710. - apps/zcode-cli/tools/prompt-trajectory/src/tool-search-comparison.ts
  711. layers: {domain: .}
  712. owner: agent
  713. - id: window-topic-resource-relay
  714. roots:
  715. - packages/desktop/src/host/topic-resource-relay
  716. - packages/desktop/src/host/windowTopicResourceRelay.ts
  717. - packages/desktop/test/topic-resource-relay
  718. managed: true
  719. requires: [services, shared]
  720. publicEntrypoints:
  721. - packages/desktop/src/host/topic-resource-relay/contract.ts
  722. - packages/desktop/src/host/windowTopicResourceRelay.ts
  723. layers: {adapters: .}
  724. owner: desktop
  725. - id: channel-reply-tool
  726. roots:
  727. - apps/zcode-cli/packages/core/src/tool/channel-reply
  728. - apps/zcode-cli/packages/core/src/tool/handlers/reply-to-channel.ts
  729. - apps/zcode-cli/packages/core/tests/channel-reply
  730. managed: true
  731. requires: [shared, zcode-cli]
  732. publicEntrypoints:
  733. - apps/zcode-cli/packages/core/src/tool/handlers/reply-to-channel.ts
  734. - apps/zcode-cli/packages/core/src/tool/channel-reply/contract.ts
  735. layers: {app: .}
  736. owner: agent
  737. # composer-toolbar-layout:登记既有 DOM 布局入口,不改调用路径。
  738. - id: composer-toolbar-layout
  739. roots:
  740. - packages/ui/src/composer-toolbar-layout
  741. - packages/ui/src/prompt-editor/useComposerToolbarFit.ts
  742. - packages/ui/test/composer-toolbar-layout
  743. managed: true
  744. requires: []
  745. publicEntrypoints:
  746. - packages/ui/src/prompt-editor/useComposerToolbarFit.ts
  747. - packages/ui/src/composer-toolbar-layout/contract.ts
  748. layers: {ui: .}
  749. owner: conversation
  750. # task-groups:由 architecture:adopt 登记
  751. - id: task-groups
  752. roots:
  753. - packages/services/src/task-groups
  754. managed: true
  755. requires:
  756. - services
  757. - session
  758. - shared
  759. publicEntrypoints:
  760. - packages/services/src/task-groups/index.ts
  761. - packages/services/src/task-groups/contract.ts
  762. - packages/services/src/task-groups/migration-v6.ts
  763. layers:
  764. adapters: .
  765. owner: conversation
  766. # window-project-directory:由 architecture:adopt 登记
  767. - id: window-project-directory
  768. roots:
  769. - packages/services/src/window-project-directory
  770. managed: true
  771. requires:
  772. - project
  773. - remote-projects
  774. - rpc
  775. - services
  776. - shared
  777. publicEntrypoints:
  778. - packages/services/src/window-project-directory/index.ts
  779. - packages/services/src/window-project-directory/contract.ts
  780. layers:
  781. adapters: .
  782. owner: conversation
  783. # conversation-share-interaction:由 architecture:adopt 登记
  784. - id: conversation-share-interaction
  785. roots:
  786. - packages/ui/src/conversation-share-interaction
  787. managed: true
  788. requires:
  789. - services
  790. - shared
  791. - ui
  792. publicEntrypoints:
  793. - packages/ui/src/conversation-share-interaction/index.ts
  794. - packages/ui/src/conversation-share-interaction/contract.ts
  795. - packages/ui/src/conversation-share-interaction/ConversationSharePopover.tsx
  796. - packages/ui/src/conversation-share-interaction/ConversationSharePreflightStatus.tsx
  797. - packages/ui/src/conversation-share-interaction/conversationSharePopoverActions.ts
  798. - packages/ui/src/conversation-share-interaction/conversationSharePreflightRequest.ts
  799. - packages/ui/src/conversation-share-interaction/conversationSharePreflightResponse.ts
  800. layers:
  801. contract: contract.ts
  802. ui: .
  803. owner: conversation
  804. # workspace-plugin-preview:由 architecture:adopt 登记
  805. - id: workspace-plugin-preview
  806. roots:
  807. - packages/ui/src/workspace-plugin-preview
  808. managed: true
  809. requires:
  810. - shared
  811. - ui
  812. publicEntrypoints:
  813. - packages/ui/src/workspace-plugin-preview/index.ts
  814. - packages/ui/src/workspace-plugin-preview/contract.ts
  815. layers:
  816. ui: .
  817. owner: plugin
  818. # office-runtime:内置文档插件查看面板的共享运行时,由 architecture:adopt 登记
  819. - id: office-runtime
  820. roots:
  821. - apps/zcode-cli/packages/office-runtime
  822. managed: true
  823. requires: []
  824. publicEntrypoints:
  825. - apps/zcode-cli/packages/office-runtime/index.ts
  826. - apps/zcode-cli/packages/office-runtime/contract.ts
  827. layers:
  828. app: .
  829. owner: plugin
  830. # embedded-browser-permission:由 architecture:adopt 登记
  831. - id: embedded-browser-permission
  832. roots:
  833. - packages/desktop/src/main/embedded-browser-permission-contract
  834. - packages/desktop/src/main/embeddedBrowserPermissionPolicy.ts
  835. managed: true
  836. requires:
  837. - desktop
  838. - shared
  839. publicEntrypoints:
  840. - packages/desktop/src/main/embeddedBrowserPermissionPolicy.ts
  841. - packages/desktop/src/main/embedded-browser-permission-contract/contract.ts
  842. layers:
  843. adapters: .
  844. owner: desktop
  845. # marketing-touch-controller:由 architecture:adopt 登记
  846. - id: marketing-touch-controller
  847. roots:
  848. - packages/ui/src/marketing-touch-contract
  849. - packages/ui/src/components/marketing-touch/marketingTouchController.ts
  850. managed: true
  851. requires:
  852. - services
  853. - shared
  854. - ui
  855. publicEntrypoints:
  856. - packages/ui/src/components/marketing-touch/marketingTouchController.ts
  857. - packages/ui/src/marketing-touch-contract/contract.ts
  858. layers:
  859. app: .
  860. owner: desktop
  861. # data-sync-service:数据同步分类服务形状与本机设备同步状态(docs/remote/data-sync.md)
  862. - id: data-sync-service
  863. roots:
  864. - packages/services/src/data-sync
  865. managed: true
  866. requires:
  867. - services
  868. - shared
  869. publicEntrypoints:
  870. - packages/services/src/data-sync/index.ts
  871. - packages/services/src/data-sync/contract.ts
  872. - packages/services/src/data-sync/node.ts
  873. layers:
  874. app: .
  875. owner: remote
  876. # provider-provisioning-status:数据同步页模型提供商读取 / 重试 Main 协调器的 Provisioning lane(R3 §8.3.6)
  877. - id: provider-provisioning-status
  878. roots:
  879. - packages/services/src/provider-provisioning-status
  880. managed: true
  881. requires:
  882. - services
  883. - shared
  884. publicEntrypoints:
  885. - packages/services/src/provider-provisioning-status/index.ts
  886. - packages/services/src/provider-provisioning-status/contract.ts
  887. - packages/services/src/provider-provisioning-status/node.ts
  888. layers:
  889. app: .
  890. owner: remote
  891. # data-sync:设置页「数据同步」与同步弹窗(docs/remote/data-sync.md)
  892. - id: data-sync
  893. roots:
  894. - packages/ui/src/data-sync
  895. managed: true
  896. requires:
  897. - services
  898. - shared
  899. - ui
  900. - conversation-workspace-target
  901. publicEntrypoints:
  902. - packages/ui/src/data-sync/index.ts
  903. - packages/ui/src/data-sync/contract.ts
  904. layers:
  905. contract: contract.ts
  906. domain: domain
  907. app: app
  908. ui: .
  909. layerOrder: [contract, domain, app, ui]
  910. owner: remote
  911. # settings-scope:设置页 Scope 菜单按设备分组(docs/remote/data-sync.md「Scope 菜单按设备分组」)
  912. - id: settings-scope
  913. roots:
  914. - packages/ui/src/settings-scope
  915. managed: true
  916. requires:
  917. - services
  918. - shared
  919. - ui
  920. - conversation-workspace-target
  921. - workspace-config-catalog
  922. publicEntrypoints:
  923. - packages/ui/src/settings-scope/index.ts
  924. - packages/ui/src/settings-scope/contract.ts
  925. layers:
  926. contract: contract.ts
  927. domain: domain
  928. app: app
  929. ui: .
  930. layerOrder: [contract, domain, app, ui]
  931. owner: remote
  932. # side-pane-full-view:由 architecture:adopt 登记
  933. - id: side-pane-full-view
  934. roots:
  935. - packages/ui/src/side-pane-full-view
  936. managed: true
  937. requires:
  938. - shared
  939. - ui
  940. publicEntrypoints:
  941. - packages/ui/src/side-pane-full-view/index.ts
  942. - packages/ui/src/side-pane-full-view/contract.ts
  943. layers:
  944. ui: .
  945. owner: conversation
  946. # 发行策略使用独立目录;修改后的文件由本模块承担边界检查。
  947. - id: request-security-edition
  948. roots: [packages/shared/src/request-security-edition]
  949. managed: true
  950. requires: [shared]
  951. publicEntrypoints:
  952. - packages/shared/src/request-security-edition/index.ts
  953. - packages/shared/src/request-security-edition/policy.ts
  954. - packages/shared/src/request-security-edition/verification-policy.ts
  955. - packages/shared/src/request-security-edition/contract.ts
  956. layers: {adapters: .}
  957. owner: request-security
  958. # local-ttft-contract:由 architecture:adopt 登记
  959. - id: local-ttft-contract
  960. roots:
  961. - packages/shared/src/local-ttft
  962. managed: true
  963. requires: []
  964. publicEntrypoints:
  965. - packages/shared/src/local-ttft/contract.ts
  966. layers:
  967. contract: .
  968. # local-ttft-renderer:由 architecture:adopt 登记
  969. - id: local-ttft-renderer
  970. roots:
  971. - packages/ui/src/v4/telemetry/local-ttft
  972. managed: true
  973. requires:
  974. - shared
  975. - ui
  976. publicEntrypoints:
  977. - packages/ui/src/v4/telemetry/local-ttft/contract.ts
  978. layers:
  979. ui: .
  980. # local-ttft-desktop:由 architecture:adopt 登记
  981. - id: local-ttft-desktop
  982. roots:
  983. - packages/desktop/src/renderer/src/local-ttft
  984. managed: true
  985. requires:
  986. - shared
  987. - ui
  988. publicEntrypoints:
  989. - packages/desktop/src/renderer/src/local-ttft/contract.ts
  990. layers:
  991. ui: .
  992. # local-ttft-cli:由 architecture:adopt 登记
  993. - id: local-ttft-cli
  994. roots:
  995. - apps/zcode-cli/packages/bootstrap/src/zcode-protocol-v4/local-ttft
  996. managed: true
  997. requires:
  998. - shared
  999. - zcode-cli
  1000. publicEntrypoints:
  1001. - apps/zcode-cli/packages/bootstrap/src/zcode-protocol-v4/local-ttft/contract.ts
  1002. layers:
  1003. adapters: .
  1004. # cli-official-command-endpoint:由 architecture:adopt 登记
  1005. - id: cli-official-command-endpoint
  1006. roots:
  1007. - apps/zcode-cli/packages/bootstrap/src/official-command-endpoint
  1008. - apps/zcode-cli/packages/bootstrap/tests/official-command-endpoint
  1009. managed: true
  1010. requires:
  1011. - shared
  1012. - zcode-cli
  1013. publicEntrypoints:
  1014. - apps/zcode-cli/packages/bootstrap/src/official-command-endpoint/index.ts
  1015. - apps/zcode-cli/packages/bootstrap/src/official-command-endpoint/contract.ts
  1016. layers:
  1017. adapters: .
  1018. owner: identity
  1019. # zcode-site-panel:zcode-site 插件自带的 Sites 面板(MCP server + 页面),由 architecture:adopt 登记
  1020. - id: zcode-site-panel
  1021. roots:
  1022. - apps/zcode-cli/packages/zcode-site-plugin/src
  1023. managed: true
  1024. requires:
  1025. - shared
  1026. publicEntrypoints:
  1027. - apps/zcode-cli/packages/zcode-site-plugin/src/index.ts
  1028. - apps/zcode-cli/packages/zcode-site-plugin/src/contract.ts
  1029. layers:
  1030. app: .
  1031. owner: plugin
  1032. # file-open-apps:由 architecture:adopt 登记
  1033. - id: file-open-apps
  1034. roots:
  1035. - packages/desktop/src/main/file-open-apps
  1036. managed: true
  1037. requires: [shared]
  1038. publicEntrypoints:
  1039. - packages/desktop/src/main/file-open-apps/index.ts
  1040. - packages/desktop/src/main/file-open-apps/contract.ts
  1041. layers:
  1042. adapters: .
  1043. owner: desktop
  1044. # ui-file-menu:由 architecture:adopt 登记
  1045. - id: ui-file-menu
  1046. roots:
  1047. - packages/ui/src/file-menu
  1048. managed: true
  1049. requires:
  1050. - shared
  1051. - ui
  1052. publicEntrypoints:
  1053. - packages/ui/src/file-menu/index.ts
  1054. - packages/ui/src/file-menu/contract.ts
  1055. layers:
  1056. ui: .
  1057. owner: file-preview
  1058. # web-platform:由 architecture:adopt 登记
  1059. - id: web-platform
  1060. roots:
  1061. - packages/web/src/platform
  1062. managed: true
  1063. requires:
  1064. - shared
  1065. - ui
  1066. - web
  1067. publicEntrypoints:
  1068. - packages/web/src/platform/index.ts
  1069. - packages/web/src/platform/contract.ts
  1070. layers:
  1071. adapters: .
  1072. owner: web
  1073. # image-preview-editor:由 architecture:adopt 登记
  1074. - id: image-preview-editor
  1075. roots:
  1076. - packages/ui/src/image-preview-editor
  1077. managed: true
  1078. requires: [ui]
  1079. publicEntrypoints:
  1080. - packages/ui/src/image-preview-editor/index.ts
  1081. - packages/ui/src/image-preview-editor/contract.ts
  1082. layers:
  1083. ui: .
  1084. owner: conversation
  1085. # protocol-session-data:由 architecture:adopt 登记
  1086. - id: protocol-session-data
  1087. roots:
  1088. - packages/shared/src/zcode-protocol-v4/session-data
  1089. managed: true
  1090. requires: []
  1091. publicEntrypoints:
  1092. - packages/shared/src/zcode-protocol-v4/session-data/index.ts
  1093. - packages/shared/src/zcode-protocol-v4/session-data/contract.ts
  1094. layers:
  1095. domain: .
  1096. # cli-session-data-files:由 architecture:adopt 登记
  1097. - id: cli-session-data-files
  1098. roots:
  1099. - apps/zcode-cli/packages/adapters/src/storage/session-data-files
  1100. managed: true
  1101. requires: []
  1102. publicEntrypoints:
  1103. - apps/zcode-cli/packages/adapters/src/storage/session-data-files/index.ts
  1104. - apps/zcode-cli/packages/adapters/src/storage/session-data-files/contract.ts
  1105. layers:
  1106. adapters: .
  1107. # cli-session-data:由 architecture:adopt 登记
  1108. - id: cli-session-data
  1109. roots:
  1110. - apps/zcode-cli/packages/bootstrap/src/zcode-protocol/session-data
  1111. managed: true
  1112. requires:
  1113. - shared
  1114. - zcode-cli
  1115. publicEntrypoints:
  1116. - apps/zcode-cli/packages/bootstrap/src/zcode-protocol/session-data/index.ts
  1117. - apps/zcode-cli/packages/bootstrap/src/zcode-protocol/session-data/contract.ts
  1118. layers:
  1119. app: .
  1120. - id: provider-regression
  1121. roots: [apps/zcode-cli/tools/provider-regression]
  1122. managed: true
  1123. requires: [zcode-cli, provider, provider-node, shared]
  1124. publicEntrypoints:
  1125. - apps/zcode-cli/tools/provider-regression/index.ts
  1126. - apps/zcode-cli/tools/provider-regression/contract.ts
  1127. layers: {adapters: .}
  1128. owner: agent
  1129. # session-lifecycle:由 architecture:adopt 登记
  1130. - id: session-lifecycle
  1131. roots:
  1132. - apps/zcode-cli/packages/bootstrap/src/session-lifecycle
  1133. - apps/zcode-cli/packages/bootstrap/tests/session-lifecycle
  1134. managed: true
  1135. requires: [shared]
  1136. publicEntrypoints:
  1137. - apps/zcode-cli/packages/bootstrap/src/session-lifecycle/index.ts
  1138. - apps/zcode-cli/packages/bootstrap/src/session-lifecycle/contract.ts
  1139. layers:
  1140. app: .
  1141. owner: agent-runtime
  1142. # workspace-mcp-trust:由 architecture:adopt 登记
  1143. - id: workspace-mcp-trust
  1144. roots:
  1145. - apps/zcode-cli/packages/bootstrap/src/workspace-mcp-trust
  1146. managed: true
  1147. requires: [zcode-cli, shared]
  1148. publicEntrypoints:
  1149. - apps/zcode-cli/packages/bootstrap/src/workspace-mcp-trust/index.ts
  1150. - apps/zcode-cli/packages/bootstrap/src/workspace-mcp-trust/contract.ts
  1151. layers:
  1152. adapters: .
  1153. owner: cli
  1154. # 内置浏览器本地 HTML 的受控文件读取边界。
  1155. - id: browser-local-preview
  1156. roots:
  1157. - packages/desktop/src/main/browser-local-preview
  1158. managed: true
  1159. requires: [shared]
  1160. publicEntrypoints:
  1161. - packages/desktop/src/main/browser-local-preview/index.ts
  1162. - packages/desktop/src/main/browser-local-preview/contract.ts
  1163. layers:
  1164. adapters: .
  1165. owner: desktop
  1166. global:
  1167. # 临时时间戳(2026-09-10):unmanaged-new-file 只约束此日期之后首次入库的文件。
  1168. # 基于领先 staging 很多的分支开工时,merge-base 之前的"新增"文件不应被追溯。
  1169. newFilesEnforcedSince: "2026-09-10"
  1170. acceptedUpstreamCommits: []
  1171. maxFileLines: 800
  1172. maxContractLines: 300
  1173. maxPublicMethods: 12
  1174. forbidCycles: true
  1175. forbidDeepImports: true
  1176. managedOnly: true
  1177. acceptedUpstreamSnapshot: scripts/architecture/upstream-snapshot.json
  1178. exceptions:
  1179. - id: session-features-attribution-header-edit
  1180. rule: unmanaged-new-file
  1181. paths: [apps/zcode-cli/packages/adapters/src/model/runner-attribution.ts]
  1182. reason: 已准入的归因头构造器只追加 x-zcode-session-features(docs/design/v2/model/session-features-header.md);它仍是全部归因头的唯一写入点,签名与模块边界不变,接管整个 adapters 包不在本次范围内。
  1183. - id: session-features-workflow-command-pattern-edit
  1184. rule: unmanaged-new-file
  1185. paths: [apps/zcode-cli/packages/core/src/runtime/methods/dynamic-workflow-activation.ts]
  1186. reason: 已准入的动态工作流激活只导出既有 `/workflow` 历史判据常量,供 session-features 的历史推导复用同一判据;激活行为、owner 与模块边界不变。
  1187. - id: node-repl-call-ledger-cua-bridge-edit
  1188. rule: unmanaged-new-file
  1189. paths: [apps/zcode-cli/packages/node-repl-host/src/cua-bridge.ts]
  1190. reason: 已准入的 node_repl CUA bridge 只删去 Worker 侧的会话信息构造与目标应用身份记录,二者移到主线程 CUA broker(apps/zcode-cli/docs/design/v2/tool/20-node-repl-call-ledger.md);subagent 拒绝与对模型的行为不变,接管整个 node-repl-host 包不在本次范围内。
  1191. - id: node-repl-call-ledger-cua-broker-edit
  1192. rule: unmanaged-new-file
  1193. paths: [apps/zcode-cli/packages/node-repl-host/src/cua-broker.ts]
  1194. reason: 已准入的 node_repl CUA broker 改为只认 node-repl-call-ledger 签发的本次调用 token,按账本条目构造会话信息并把目标应用身份记进账本(20-node-repl-call-ledger.md「CUA broker」);MR !3207 再在 token 校验之后把会话能力标签用的 computerUse 记进账本(docs/design/v2/model/session-features-header.md);runtime 调用与响应格式不变。
  1195. - id: node-repl-call-ledger-result-edit
  1196. rule: unmanaged-new-file
  1197. paths: [apps/zcode-cli/packages/node-repl-host/src/result.ts]
  1198. reason: 已准入的 node_repl 结果组装改为只从账本 facts 取可信 key,忽略 Worker 结果消息里的同名字段(20-node-repl-call-ledger.md「结果组装」);MR !3207 按同样处置追加 zcode/nodeReplBrowserUse、zcode/nodeReplComputerUse 两个 key(docs/design/v2/model/session-features-header.md);结果内容与其他 meta 处置不变。
  1199. - id: offpeak-expiration-codes-existing-edit
  1200. rule: unmanaged-new-file
  1201. paths: [apps/zcode-cli/packages/core/src/runtime/off-peak/model-binding.ts]
  1202. reason: 已准入的闲时请求包装器仅复用共享错误码判断,补齐 3106 运行超时的既有生命周期通知;不改变 owner、控制协议或模块边界,不扩展为整个 CLI runtime 目录接管。
  1203. - id: multi-cursor-badge-title-passthrough-edit
  1204. rule: unmanaged-new-file
  1205. paths:
  1206. - apps/zcode-cli/packages/node-repl-host/src/cua-broker.ts
  1207. reason: 已准入的 node_repl CUA broker 仅增透传可选 actionTitle 字段(node_repl cell title → badge 文字,docs/cua/producer/multi-session-cursor-overlay-spec.md §4.8)——cua-broker 按 ledger meta 构建的 requestContext 注入、parseContext 白名单补字段;签名、broker 形态与模块边界不变,不接管 zcode-cli 目录。
  1208. - id: side-pane-full-view-shortcut-command-edit
  1209. rule: unmanaged-new-file
  1210. paths: [packages/shared/src/shortcutCommands.ts]
  1211. reason: 已准入的快捷键命令表只追加一条 toggleSidePaneFullView 命令(Side Pane 完整视图,docs/ui/side-pane-full-view.md);命令表仍是唯一数据源,签名与模块边界不变,接管整个 shared 包不在本次范围内。
  1212. - id: zcode-site-deploy-runtime-template
  1213. rule: unmanaged-new-file
  1214. paths: [apps/zcode-cli/packages/zcode-site-plugin/skills/site-deploy/templates/static-server.mjs]
  1215. reason: site-deploy 技能复制进用户部署包的静态站服务器模板,只在 Sites runner 的容器里由 start.sh 执行;仓库代码不 import 它,也不属于任何运行时模块。同目录的 start.sh 模板是 shell,不受本规则约束。
  1216. - id: opensource-cua-test-project-config
  1217. rule: unmanaged-new-file
  1218. paths: [packages/zcode-cua/vitest.config.ts]
  1219. reason: 该文件只装配测试项目,开源占位版本用于保持根单测入口可运行;不包含 producer 运行逻辑,不为同目录实现文件开放例外。
  1220. - id: project-location-cache-recovery-existing-edit
  1221. rule: unmanaged-new-file
  1222. paths:
  1223. - packages/shared/src/project-access-token.ts
  1224. - packages/shared/src/project-access-token-client.ts
  1225. - packages/services/src/model-provider/accountProjectTokenClient.ts
  1226. - packages/services/src/credential/credentialService.ts
  1227. reason: 已有项目 Token 与凭据存储增加派生缓存的局部恢复端口,并把换证请求失败按固定类别分码(ZCT-2111046389485834240);保持原有 owner 和共享文件锁,不接管全目录。
  1228. - id: plugin-agent-permission-mode-restrict-only-existing-edit
  1229. rule: unmanaged-new-file
  1230. paths:
  1231. - packages/shared/src/subagent-profile.ts
  1232. - packages/shared/src/subagent-profile-parser.ts
  1233. reason: 已准入的存量文件为插件 agent 的 permissionMode 只能收紧(ZP-20261028-13)增加进程内 profile 标记字段并更新注释;跨进程 schema 与解析行为不变,接管 shared 目录不在本次范围内。
  1234. - id: test-ids-subpath-import-unmanaged-edit
  1235. rule: unmanaged-new-file
  1236. paths:
  1237. - packages/ui/src/browser-use/EmbeddedBrowserPermissionPrompts.tsx
  1238. - packages/ui/src/hooks/useStartPlanRecommendation.ts
  1239. - packages/ui/src/settings/DynamicWorkflowModeSetting.tsx
  1240. reason: 已准入的存量文件只把 TID 导入从 @zcode/shared 根入口改为 @zcode/shared/test-ids 子路径(根入口不再导出 test-ids,以收窄受影响单测范围);行为与模块边界不变,接管 ui 目录不在本次范围内。
  1241. - id: settings-personalization-section-new-file
  1242. rule: unmanaged-new-file
  1243. paths: [packages/ui/src/settings/PersonalizationSection.tsx]
  1244. reason: 个性化设置分区组件只编排 ISettingService 的 getUserInstructions/saveUserInstructions 与既有设置页 UI 原语(spec:docs/ui/settings-personalization.md);读写唯一事实源在服务层,不新增平行状态,接管整个 ui 目录不在本次范围内。
  1245. - id: settings-personalization-size-constant-new-file
  1246. rule: unmanaged-new-file
  1247. paths: [packages/shared/src/userInstructions.ts]
  1248. reason: 用户自定义指令字节上限共享常量(与 CLI 读取截断对齐,spec:docs/ui/settings-personalization.md),服务层校验与 UI 计数共用同一数值;仅两个常量导出,接管整个 shared 目录不在本次范围内。
  1249. - id: remote-workspace-admission-deadline-existing-edit
  1250. rule: unmanaged-new-file
  1251. paths: [packages/desktop/src/host/remoteWorkspacePreparation.ts]
  1252. reason: 已准入的远程项目目录 admission 只增加 30 秒截止时间和可重试的无响应错误码(3.16.2 远端回归 R8,docs/remote/project-first-remote-navigation-spec.md §2.4);owner、调用方与模块边界不变,接管 desktop host 目录不在本次修复范围内。
  1253. - id: gen-ui-existing-capability-check
  1254. rule: unmanaged-new-file
  1255. paths: [packages/services/src/zcode-agent/independentPlanSupport.ts]
  1256. reason: 在已存在的 CLI 能力查询入口补充 GenUI 上下文能力检查,防止旧 CLI 静默丢弃状态;保持既有 services/agent 边界,不扩展本次修复为整个 zcode-agent 模块接管。
  1257. - id: connection-log-secret-token-unmanaged-edit
  1258. rule: unmanaged-new-file
  1259. paths: [packages/shared/src/source-server/connectionLog.ts]
  1260. reason: 已存在的连接日志过滤函数只把已知秘密从子串替换改为完整 token 匹配,修复短密码反推泄露;签名与模块边界不变,接管整个 shared 包不在本次修复范围内。
  1261. - id: connection-errors-econnreset-unmanaged-edit
  1262. rule: unmanaged-new-file
  1263. paths: [packages/shared/src/source-server/connectionErrors.ts]
  1264. reason: 已存在的连接错误归一化码表补一项 ECONNRESET → remote-host-unreachable,修复在线断连恢复失败被误报为预检失败;签名与模块边界不变,接管整个 shared 包不在本次修复范围内。
  1265. - id: remote-authentication-unsupported-presentation-unmanaged-edit
  1266. rule: unmanaged-new-file
  1267. paths: [packages/ui/src/lib/remoteConnectionPresentationErrors.ts]
  1268. reason: 已存在的远程连接错误展示映射为新增公开码 remote-authentication-unsupported 补一项标题与“查看详情”操作,修复 SSH 二次验证失败被提示为检查密码;签名与模块边界不变,接管 ui 目录不在本次修复范围内。
  1269. - id: source-server-operation-log-level-unmanaged-edit
  1270. rule: unmanaged-new-file
  1271. paths: [packages/desktop/src/host/sourceServerOperationLogs.ts]
  1272. reason: 已有连接日志封装透传 TransportContext 已定义的 level,使低版本 glibc 提示保留 warn;Host 仍是唯一日志 owner,签名与模块边界不变,接管整个 desktop 包不在本次范围内。
  1273. - id: client-config-public-field-unmanaged-edit
  1274. rule: unmanaged-new-file
  1275. paths: [packages/shared/src/clientConfig.ts]
  1276. 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.
  1277. - id: highspeed-fallback-snapshot-unmanaged-edit
  1278. rule: unmanaged-new-file
  1279. paths: [apps/zcode-cli/packages/core/src/runtime/methods/turn-execution-fallback.ts]
  1280. reason: 合并已存在于 staging 的加速卡回退模块,仅将可变 Session 读取替换为本轮固定候选;保持现有 Core 模块边界,不在同步分支时机械拆分整个 runtime。
  1281. - id: session-owned-workflow-shutdown-existing-files
  1282. rule: unmanaged-new-file
  1283. paths:
  1284. - apps/zcode-cli/packages/bootstrap/src/app/dynamic-workflow-run-submit.ts
  1285. - apps/zcode-cli/packages/bootstrap/src/app/workflow-driver-quiescence.ts
  1286. reason: 两个文件已存在于集成基线;本次在既有 bootstrap owner 内补启动关闭互斥和 actor 清理等待,不新增模块或跨层依赖。整个 bootstrap/app 的接管另行治理,生命周期公开模块边界保持不变。
  1287. - id: workflow-quota-auto-resume-unmanaged-file
  1288. rule: unmanaged-new-file
  1289. paths: [apps/zcode-cli/packages/bootstrap/src/app/dynamic-workflow-quota-resume.ts]
  1290. reason: 额度停止的 run 到点自动续跑,是 run service 旁的一个宿主模块(只读 journal 行、订阅结算、经注入的 resume 续跑);与同目录的 run service 文件同属未受管的 zcode-cli bootstrap,接管该目录需要单独的模块边界整理。
  1291. - id: mcp-node-fallback-unmanaged-file
  1292. rule: unmanaged-new-file
  1293. paths:
  1294. - apps/zcode-cli/packages/adapters/src/mcp/node-fallback.ts
  1295. - apps/zcode-cli/packages/bootstrap/src/app/mcp-node-fallback.ts
  1296. reason: 桌面 Electron Node 下 stdio MCP 的 node/npm/npx 回退(apps/zcode-cli/docs/design/v2/mcp-node-fallback.md)。adapters 文件只负责 shim 目录与子进程 env 合并,经 CreateMcpAdapterOptions.nodeFallback 注入;bootstrap 文件只判定 Electron 并给出随包 npm 候选目录。两者同属未受管的 zcode-cli,接管 adapters/mcp 或 bootstrap/app 需要单独的模块边界整理。
  1297. - id: workflow-unrecognized-code-cap-unmanaged-edit
  1298. rule: unmanaged-new-file
  1299. paths: [apps/zcode-cli/packages/adapters/src/model/workflow-model-failure-policy.ts]
  1300. reason: 已准入的 workflow 模型错误策略表只增加一行(分类器不认识的业务码在同一次请求里连续出现 10 次时停 run)、一个连续计数入参与两个计数纯函数;runner 与 driver 读同一函数的约束与模块边界不变,接管 adapters/model 目录不在本次范围内。
  1301. - id: automation-self-pause-turn-visibility-existing-edit
  1302. rule: unmanaged-new-file
  1303. paths: [apps/zcode-cli/packages/core/src/runtime/methods/turn-tool-visibility.ts]
  1304. reason: 已有 turn 工具可见性 owner 仅增加当前 automation 自暂停的反向可见性规则;不新增跨模块依赖或 owner,接管整个 zcode-cli runtime 超出本次缺陷修复范围。
  1305. - id: compact-bundle-reminder-builder-unmanaged-edit
  1306. rule: unmanaged-new-file
  1307. paths: [apps/zcode-cli/packages/core/src/runtime/methods/runtime-reminder-persistence.ts]
  1308. reason: 已入库的隐藏提醒落盘函数拆出只构建记录的函数,供 compaction 把公告、summary 与附件交给同一个 store 事务;记录不再写 tools 字段,中断标记按普通 user 文本取正文;Core 模块边界不变,接管整个 runtime 目录不在本次范围内。
  1309. - id: tool-search-schema-key-order-unmanaged-edit
  1310. rule: unmanaged-new-file
  1311. paths: [apps/zcode-cli/packages/contracts/src/tools/tool-search.ts]
  1312. reason: 已入库的 ToolSearch 输入 schema 改走统一的 toToolJsonSchema,使 key 顺序与其他工具一致,$schema 随之从 draft-07 改为 2020-12;contracts 模块边界不变,接管整个 tools 目录不在本次范围内。
  1313. - id: tool-search-removal-reason-unmanaged-edit
  1314. rule: unmanaged-new-file
  1315. paths:
  1316. - apps/zcode-cli/packages/adapters/src/model/tool-search.ts
  1317. - apps/zcode-cli/packages/core/src/tool/search/exposure.ts
  1318. - apps/zcode-cli/tools/prompt-trajectory/src/tool-search-comparison.ts
  1319. reason: 已入库的 ToolSearch 能力解析、公告渲染与离线轨迹识别按删除原因分段,并由 adapter 声明 Anthropic 协议的提醒折叠能力;增量事实、持久化与模块边界不变,接管整个 zcode-cli 目录不在本次范围内。
  1320. - id: interrupt-marker-unmanaged-new-file
  1321. rule: unmanaged-new-file
  1322. paths: [apps/zcode-cli/packages/core/src/runtime/methods/interrupt-marker.ts]
  1323. reason: 停止轮次后给模型的中断标记放在 runtime/methods 的独立小文件,避免继续增大已超行数的 turn.ts;复用隐藏提醒的落盘函数(persistRuntimeReminderMessage)与历史提交,Core 模块边界不变,接管整个 zcode-cli 目录不在本次范围内。
  1324. - id: off-peak-takeover-context-prefix-unmanaged-edit
  1325. rule: unmanaged-new-file
  1326. paths: [apps/zcode-cli/packages/core/src/runtime/off-peak/turn.ts]
  1327. reason: 已入库的闲时接管函数换成用户模型后,按新模型重建 Context Prefix,与 guide 换模型共用 rebuildContextPrefix;接管时机、归属与 Core 模块边界不变,接管整个 zcode-cli 目录不在本次范围内。
  1328. - id: turn-work-segment-comment-unmanaged-edit
  1329. rule: unmanaged-new-file
  1330. paths: [packages/ui/src/v4/conversationTurnRenderUnitTypes.ts]
  1331. reason: 已入库的渲染单元类型只更新 workSegments 字段注释,使其与同一 drain 边界的 guide 共用一段的行为一致;类型与 ui 模块边界不变,接管整个 v4 目录不在本次范围内。
  1332. - id: shortcut-settings-existing-ui-edit
  1333. rule: unmanaged-new-file
  1334. paths:
  1335. - packages/ui/src/components/ui/kbd.tsx
  1336. - packages/ui/src/settings/ShortcutSearchBar.tsx
  1337. - packages/ui/src/settings/ShortcutSettingsSection.tsx
  1338. 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.
  1339. - id: sidebar-workflow-tooltip-existing-ui-edit
  1340. rule: unmanaged-new-file
  1341. paths: [packages/ui/src/components/workflow-run-line/WorkflowRunRail.tsx]
  1342. 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.
  1343. - id: onboarding-existing-module-edit
  1344. rule: unmanaged-new-file
  1345. paths:
  1346. - packages/services/src/onboarding/
  1347. - packages/ui/src/onboarding/
  1348. reason: onboarding 目录(记录持久化服务与触发 hook)是已合入 staging 的存量功能模块,本轮修复在其既有边界内收紧老用户判定与兜底;模块 adopt 登记需单独的边界梳理,不在本缺陷修复内展开。
  1349. - id: remote-connection-flow-existing-size
  1350. rule: max-file-lines
  1351. paths: [packages/ui/src/remote-connection-flow/index.ts]
  1352. reason: Preserve the existing single hook owner and closure; module adoption must not mechanically split state to satisfy line counts.
  1353. - id: gen-ui-tweak-runtime-size
  1354. rule: max-file-lines
  1355. paths: [packages/desktop/src/renderer/src/plugin-sandbox/genUiTweakRuntime.js]
  1356. reason: Keep parameter binding and registration lifecycle together; runtime-manifest.json and tests verify file integrity.
  1357. - id: gen-ui-tweak-runtime-lint
  1358. rule: disable-count
  1359. paths: [packages/desktop/src/renderer/src/plugin-sandbox/genUiTweakRuntime.js]
  1360. reason: Allow the control-character validation regex and the single-file parameter-control runtime.
  1361. - id: workflow-amend-provider-boundary-unmanaged-edit
  1362. rule: unmanaged-new-file
  1363. paths:
  1364. - apps/zcode-cli/packages/contracts/src/tools/amend-workflow.ts
  1365. - apps/zcode-cli/packages/core/src/tool/handlers/amend-workflow-resolve.ts
  1366. 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.
  1367. - id: remote-device-list-unmanaged-new-files
  1368. rule: unmanaged-new-file
  1369. paths:
  1370. - packages/ui/src/settings/SourceServerDeviceRow.tsx
  1371. - packages/ui/src/settings/sourceServerDeviceList.ts
  1372. - packages/ui/src/lib/remoteConnectionPresentation.ts
  1373. reason: Settings remote device list (RDUX-13) splits the presentational row and pure ordering/search helpers out of the existing SourceServerManagementPanel, and removes the now-unused settings navigation status aggregate from the admitted presentation model; adopting packages/ui/src/settings or packages/ui/src/lib needs a separate module boundary refactor (same pattern as settings-machine-unmanaged-edit).
  1374. - id: workflow-share-unmanaged-new-files
  1375. rule: unmanaged-new-file
  1376. paths:
  1377. - packages/services/src/conversation-share/conversationShareInlineImages.ts
  1378. - packages/services/src/conversation-share/conversationShareWorkflowSnapshot.ts
  1379. - packages/shared/src/conversation-share-content.ts
  1380. - packages/shared/src/conversation-share-tool-presentation.ts
  1381. - packages/ui/src/v4/ConversationShareContent.tsx
  1382. - packages/ui/src/v4/ConversationShareWorkflow.tsx
  1383. - packages/ui/src/v4/conversationShareItems.ts
  1384. - packages/ui/src/ToolCallBlocks/ToolPresentation.tsx
  1385. - packages/ui/src/ToolCallBlocks/presentationCapabilities.tsx
  1386. - packages/ui/src/ToolCallBlocks/renderers/list-models.tsx
  1387. - packages/ui/src/ToolCallBlocks/renderers/list-saved-workflows-presentation.tsx
  1388. - packages/ui/src/ToolCallBlocks/renderers/web-fetch.tsx
  1389. - packages/ui/src/hooks/useToolPresentationHostCapabilities.ts
  1390. - packages/ui/src/chat-input-toolbar/thoughtLevelLabels.ts
  1391. - packages/ui/src/components/workflow-timeline/subagent-model-label.ts
  1392. - packages/desktop/src/main/fileApplications.ts
  1393. 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).
  1394. - id: workflow-notifications-unmanaged-files
  1395. rule: unmanaged-new-file
  1396. paths:
  1397. - apps/zcode-cli/packages/core/src/runtime-task/workflow-blocked-reminder.ts
  1398. - apps/zcode-cli/packages/core/src/runtime/methods/dynamic-workflow-blocked-reminder.ts
  1399. - apps/zcode-cli/packages/core/src/runtime-task/workflow-notification-copy.ts
  1400. - apps/zcode-cli/packages/core/src/runtime/methods/dynamic-workflow-run-hole-notification.ts
  1401. - apps/zcode-cli/packages/core/src/tool/handlers/model-reference.ts
  1402. - packages/shared/src/test-ids-workflow.ts
  1403. 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.
  1404. - id: composer-toolbar-unmanaged-files
  1405. rule: unmanaged-new-file
  1406. paths:
  1407. - packages/ui/src/ControlShortcutBadge.tsx
  1408. - packages/ui/src/chat-input-toolbar/ComposerEffortHeading.tsx
  1409. - packages/ui/src/chat-input-toolbar/ComposerModelMenu.tsx
  1410. - packages/ui/src/chat-input-toolbar/ComposerProviderMenu.tsx
  1411. - packages/ui/src/chat-input-toolbar/ComposerTriggerTransition.tsx
  1412. - packages/ui/src/hooks/useComposerConnectionSwitch.ts
  1413. - packages/ui/src/lib/composerPlanGroups.ts
  1414. - packages/ui/src/lib/providerFamilyConnectionTransition.ts
  1415. - packages/ui/src/prompt-editor/useComposerToolbarFit.ts
  1416. 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.
  1417. - id: provider-endpoint-routing-unmanaged-edit
  1418. rule: unmanaged-new-file
  1419. paths:
  1420. - apps/zcode-cli/packages/adapters/src/model/endpoint-routing-edition/index.ts
  1421. - apps/zcode-cli/packages/adapters/src/model/provider-endpoint-routing-options.ts
  1422. 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.
  1423. - id: workflow-mode-user-choice-unmanaged-edit
  1424. rule: unmanaged-new-file
  1425. paths:
  1426. - packages/shared/src/dynamic-workflow-feature.ts
  1427. - packages/ui/src/settings/DynamicWorkflowModeSetting.tsx
  1428. - packages/ui/src/store/dynamicWorkflowAvailabilityStore.ts
  1429. 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.
  1430. - id: workflow-source-error-hint-unmanaged-edit
  1431. rule: unmanaged-new-file
  1432. paths:
  1433. - apps/zcode-cli/packages/contracts/src/tools/fill-workflow-hole.ts
  1434. reason: Admitted upstream file edited only to rename the constant its comment refers to (CREATE_WORKFLOW_SOURCE_ERROR split into conflict and missing messages); adopting apps/zcode-cli needs a separate module boundary refactor.
  1435. - id: workflow-analyzer-complexity-unmanaged-edit
  1436. rule: unmanaged-new-file
  1437. paths:
  1438. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-bindings.ts
  1439. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-calls.ts
  1440. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-functions.ts
  1441. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-loops.ts
  1442. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-settle.ts
  1443. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-state.ts
  1444. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-strands.ts
  1445. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/causality-order-types.ts
  1446. - apps/zcode-cli/packages/dynamic-workflow/src/analysis/flow-strands.ts
  1447. reason: Admitted upstream analyzer files edited only to stop the workflow analysis from growing much faster than the script (callback bindings, loop regions, join control, flow strands); adopting apps/zcode-cli/packages/dynamic-workflow needs a separate module boundary refactor that first breaks its 24 internal import cycles.
  1448. - id: off-peak-model-descriptor-unmanaged-edit
  1449. rule: unmanaged-new-file
  1450. paths: [apps/zcode-cli/packages/core/src/runtime/off-peak/model-binding.ts]
  1451. reason: 已入库的闲时 Model 包装改用 contracts 的 modelDescriptorOf 复制全部数据字段,修复逐字段手抄漏掉 requestCapabilities;包装行为与 Core 模块边界不变,接管整个 runtime 目录不在本次范围内。
  1452. - id: workflow-draft-read-state-per-path-unmanaged-edit
  1453. rule: unmanaged-new-file
  1454. paths: [apps/zcode-cli/packages/core/src/tool/handlers/workflow-draft-read-state.ts]
  1455. reason: 已入库的工作流草稿读状态登记改走 setReadFileStateEntry,跟随读状态改为每个路径一条;草稿流程与 Core 模块边界不变,接管整个 tool 目录不在本次范围内。
  1456. - id: workflow-skill-gate-compact-read-state-comment-unmanaged-edit
  1457. rule: unmanaged-new-file
  1458. paths: [apps/zcode-cli/packages/core/src/tool/handlers/workflow-skill-gate.ts]
  1459. reason: 已入库的工作流技能门只更新一句注释,跟随 compaction 后读取状态改为只留补回的文件;门的判据、代码与 Core 模块边界不变,接管整个 tool 目录不在本次范围内。
  1460. - id: conversation-telemetry-existing-state-machine-size
  1461. rule: max-file-lines
  1462. paths:
  1463. - packages/shared/src/conversation-telemetry/conversationTelemetryEngine.ts
  1464. - packages/shared/src/conversation-telemetry/messageTelemetry.ts
  1465. reason: Relocate the existing renderer state machine and builders unchanged so desktop and execution share token/step semantics; retain one lifecycle owner instead of splitting state to meet line counts.
  1466. - id: conversation-telemetry-existing-state-machine-lint
  1467. rule: disable-count
  1468. paths:
  1469. - packages/shared/src/conversation-telemetry/conversationTelemetryEngine.ts
  1470. - packages/shared/src/conversation-telemetry/messageTelemetry.ts
  1471. reason: Preserve the two original file-length annotations while relocating the existing implementation.
  1472. - id: host-service-telemetry-existing-file
  1473. rule: unmanaged-new-file
  1474. paths: [packages/desktop/src/host/hostServiceResourceTelemetry.ts]
  1475. reason: Existing main-branch registration point gains a Host-only event and capability gate; adopting the whole Host runtime is outside this telemetry change.
  1476. - id: request-verification-config-recovery-presentation
  1477. rule: unmanaged-new-file
  1478. paths:
  1479. - packages/ui/src/request-security-edition/errors.ts
  1480. reason: 在现有官方版本安全校验展示入口补充配置读取失败的分类与本地化,不改变状态 owner 或模块边界;公共 errors.ts 入口及其开源占位实现承接同一契约,沿用本条精确路径准入;接管整个 UI 安全校验目录不属于本次网络恢复修复。
  1481. - id: node-repl-no-progress-hint-unmanaged-edit
  1482. rule: unmanaged-new-file
  1483. paths:
  1484. - apps/zcode-cli/packages/node-repl-host/src/no-progress-guard.ts
  1485. - apps/zcode-cli/packages/node-repl-host/src/tool-contract.ts
  1486. reason: Admitted upstream node_repl host gains a self-contained no-progress hint file and a serverInfo version bump; adopting the whole node-repl-host package needs a separate module boundary refactor.
  1487. - id: zcode-cua-unmanaged-new-files
  1488. rule: unmanaged-new-file
  1489. paths:
  1490. - packages/zcode-cua/src/**
  1491. reason: The whole zcode-cua producer package (broker, native adapters, tools) entered the repo after the gate timestamp as pre-existing code moved from a separate repository; adopting its internal layers needs a dedicated CONTRACT pass (it has known internal cycles by design), not a mechanical split in this branch.