mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Move protocol boundary filename exception to Biome includes
This commit is contained in:
parent
a2fd30850b
commit
22be754296
4 changed files with 24 additions and 7 deletions
|
|
@ -60,7 +60,11 @@
|
|||
},
|
||||
{
|
||||
"path": "./scripts/grit/import-boundaries/no-app-server-protocol-boundary-imports.grit",
|
||||
"includes": ["**/src/**/*.{ts,tsx}", "!**/src/app-server/**"]
|
||||
"includes": ["**/src/**/*.{ts,tsx}", "!**/src/app-server/**", "!**/src/features/chat/app-server/mappers/message-stream/turn-items.ts"]
|
||||
},
|
||||
{
|
||||
"path": "./scripts/grit/import-boundaries/no-chat-turn-item-non-turn-protocol-imports.grit",
|
||||
"includes": ["**/src/features/chat/app-server/mappers/message-stream/turn-items.ts"]
|
||||
},
|
||||
{
|
||||
"path": "./scripts/grit/import-boundaries/no-generated-app-server-boundary-imports.grit",
|
||||
|
|
|
|||
|
|
@ -9,12 +9,7 @@ private pattern js_module_reference() {
|
|||
|
||||
private pattern app_server_protocol_source() { r"^[\"'](?:(?:\.\./)+app-server/protocol|src/app-server/protocol)/[^/\"']+(?:/.*)?[\"']$" }
|
||||
|
||||
private pattern turn_protocol_source() { r"^[\"'](?:(?:\.\./)+app-server/protocol/turn|src/app-server/protocol/turn)(?:/.*)?[\"']$" }
|
||||
|
||||
js_module_reference() as $stmt where {
|
||||
$stmt <: contains `$source` where {
|
||||
$source <: app_server_protocol_source(),
|
||||
not { $filename <: r".*/src/features/chat/app-server/mappers/message-stream/turn-items\.ts$", $source <: turn_protocol_source() }
|
||||
},
|
||||
$stmt <: contains `$source` where { $source <: app_server_protocol_source() },
|
||||
register_diagnostic(span=$stmt, message="Source modules outside root src/app-server must use domain models and app-server services instead of app-server protocol modules. Chat turn-item conversion may consume turn protocol at its app-server boundary; feature state and UI must use Panel-owned models.", severity="error")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
language js
|
||||
|
||||
private pattern js_module_reference() {
|
||||
or {
|
||||
JsImport(),
|
||||
JsImportCallExpression()
|
||||
}
|
||||
}
|
||||
|
||||
private pattern app_server_protocol_source() { r"^[\"'](?:(?:\.\./)+app-server/protocol|src/app-server/protocol)/[^/\"']+(?:/.*)?[\"']$" }
|
||||
|
||||
private pattern turn_protocol_source() { r"^[\"'](?:(?:\.\./)+app-server/protocol/turn|src/app-server/protocol/turn)(?:/.*)?[\"']$" }
|
||||
|
||||
js_module_reference() as $stmt where {
|
||||
$stmt <: contains `$source` where { $source <: app_server_protocol_source(), not { $source <: turn_protocol_source() } },
|
||||
register_diagnostic(span=$stmt, message="Source modules outside root src/app-server must use domain models and app-server services instead of app-server protocol modules. Chat turn-item conversion may consume turn protocol at its app-server boundary; feature state and UI must use Panel-owned models.", severity="error")
|
||||
}
|
||||
|
|
@ -1156,6 +1156,7 @@ async function createAppServerBoundaryPolicyReport() {
|
|||
const cwd = await tempBiomeWorkspace([
|
||||
"no-generated-app-server-boundary-imports.grit",
|
||||
"no-app-server-protocol-boundary-imports.grit",
|
||||
"no-chat-turn-item-non-turn-protocol-imports.grit",
|
||||
"no-domain-outer-layer-imports.grit",
|
||||
"no-lower-level-feature-imports.grit",
|
||||
"no-app-server-connection-boundary-imports.grit",
|
||||
|
|
|
|||
Loading…
Reference in a new issue