优化
This commit is contained in:
@@ -36,6 +36,27 @@ function Assert-Path([string]$relativePath) {
|
||||
}
|
||||
}
|
||||
|
||||
function Assert-MarkdownTableUnique([string]$path, [string]$heading, [int]$keyColumn, [string]$scope) {
|
||||
$script:checked++
|
||||
$lines = Get-Content -LiteralPath $path
|
||||
$inside = $false
|
||||
$keys = [System.Collections.Generic.List[string]]::new()
|
||||
foreach ($line in $lines) {
|
||||
if ($line -eq $heading) {
|
||||
$inside = $true
|
||||
continue
|
||||
}
|
||||
if ($inside -and $line.StartsWith('## ')) { break }
|
||||
if (-not $inside -or -not $line.StartsWith('|')) { continue }
|
||||
$cells = @($line.Trim('|').Split('|') | ForEach-Object { $_.Trim() })
|
||||
if ($keyColumn -ge $cells.Count -or $cells[$keyColumn] -match '^:?-{3,}:?$') { continue }
|
||||
$keys.Add($cells[$keyColumn])
|
||||
}
|
||||
$keys | Group-Object | Where-Object Count -gt 1 | ForEach-Object {
|
||||
Add-Failure "$scope 存在重复索引键: $($_.Name)($($_.Count) 次)"
|
||||
}
|
||||
}
|
||||
|
||||
$rootAgentsPath = Join-Path $workspaceRoot 'AGENTS.md'
|
||||
$adminAgentsPath = Join-Path $workspaceRoot 'apps/admin-web/AGENTS.md'
|
||||
$clientAgentsPath = Join-Path $workspaceRoot 'apps/client-web/AGENTS.md'
|
||||
@@ -55,6 +76,10 @@ Get-ChildItem -LiteralPath (Join-Path $workspaceRoot 'apps') -Directory |
|
||||
Sort-Object Name |
|
||||
ForEach-Object { Assert-Contains $rootAgents "apps/$($_.Name)/" '根 AGENTS.md' }
|
||||
Assert-Contains $rootAgents 'baiyue-firstleg/' '根 AGENTS.md'
|
||||
Assert-MarkdownTableUnique $rootAgentsPath '## 项目快速入口' 0 '根项目表'
|
||||
Assert-MarkdownTableUnique $rootAgentsPath '## 项目快速入口' 1 '根项目目录'
|
||||
Assert-MarkdownTableUnique $rootAgentsPath '## 业务快速路由表' 0 '根业务路由表'
|
||||
Assert-MarkdownTableUnique $rootAgentsPath '## 原型入口索引' 0 '根原型表'
|
||||
|
||||
# 前端当前全部业务模块必须能从应用级索引命中。
|
||||
$applications = @(
|
||||
@@ -95,6 +120,9 @@ $criticalPaths = @(
|
||||
'apps/admin-web/src/modules/overseas-warehouse/api/inboundPlans.ts',
|
||||
'apps/admin-web/src/modules/overseas-warehouse/api/inventory.ts',
|
||||
'apps/admin-web/src/modules/overseas-warehouse/api/pallets.ts',
|
||||
'apps/admin-web/src/modules/overseas-warehouse/api/dispatches.ts',
|
||||
'apps/admin-web/src/modules/overseas-warehouse/pages/DispatchesView.vue',
|
||||
'apps/admin-web/src/modules/overseas-warehouse/components/SmartDispatchDialog.vue',
|
||||
'apps/admin-web/src/modules/overseas-business/api/platformOverseasBusiness.ts',
|
||||
'apps/admin-web/src/modules/overseas-master-data/api/overseasMasterData.ts',
|
||||
'apps/pda-uniapp/pages/tasks/tasks.vue',
|
||||
@@ -111,8 +139,19 @@ $criticalPaths = @(
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/mapper/InboundPlanQueryMapper.java',
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/service/InboundFbaAppointmentService.java',
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/pda/gateway/UnloadPhotoFileGateway.java',
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/dispatch/controller/DispatchQueryController.java',
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/dispatch/controller/SmartDispatchController.java',
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/controller/MerchantLastlegOrderController.java',
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/model/LastlegOrderType.java',
|
||||
'baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/model/LastlegOrderStatus.java',
|
||||
'baiyue-firstleg/firstleg/src/main/java/com/baiyue/firstleg/portschedule/service/CarrierScheduleQuerySlots.java',
|
||||
'baiyue-firstleg/firstleg/src/main/java/com/baiyue/firstleg/portschedule/entity/CarrierScheduleExceptionFactEntity.java',
|
||||
'baiyue-firstleg/integration-service/src/main/java/com/baiyue/integration/domain/CarrierScheduleStandardNode.java',
|
||||
'baiyue-firstleg/integration-service/src/main/java/com/baiyue/integration/domain/CarrierScheduleExceptionCode.java',
|
||||
'baiyue-firstleg/gateway-overseas/src/test/java/com/baiyue/gateway/config/OverseasLastlegRouteContractTest.java',
|
||||
'baiyue-firstleg/event-bridge-service/src/main/java/com/baiyue/eventbridge/service/FirstlegEventClient.java',
|
||||
'baiyue-firstleg/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV2.java'
|
||||
'baiyue-firstleg/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV2.java',
|
||||
'docs/四期/船节点标准化契约.md'
|
||||
)
|
||||
$criticalPaths | ForEach-Object { Assert-Path $_ }
|
||||
|
||||
@@ -164,5 +203,5 @@ if ($failures.Count -gt 0) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "AGENTS 索引合同通过:$checked 项检查,覆盖部署单元、前端模块、PDA 注册页面、Maven 模块、关键入口和排除目录。" -ForegroundColor Green
|
||||
Write-Host "AGENTS 索引合同通过:$checked 项检查,覆盖快速表唯一性、部署单元、前端模块、PDA 注册页面、Maven 模块、关键入口和排除目录。" -ForegroundColor Green
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user