🐛 fix(playbook): enforce rulesets to agents flow

This commit is contained in:
csh
2026-01-10 22:18:26 +08:00
parent f2df89d483
commit 37546fe4f7
13 changed files with 13 additions and 223 deletions
-5
View File
@@ -20,11 +20,6 @@ for %%I in ("%ROOT%") do set "ROOT=%%~fI"
for %%I in ("%SCRIPT_DIR%..") do set "SRC=%%~fI"
set "AGENTS_SRC_ROOT=%SRC%\rulesets"
if not exist "%AGENTS_SRC_ROOT%" (
if exist "%SRC%\.agents" (
set "AGENTS_SRC_ROOT=%SRC%\.agents"
)
)
set "GITATTR_SRC=%SRC%\.gitattributes"
if not exist "%AGENTS_SRC_ROOT%" (
-6
View File
@@ -23,12 +23,6 @@ if (-not $Root) {
$Root = (Resolve-Path $Root).Path
$AgentsSrcRoot = Join-Path $Src "rulesets"
if (-not (Test-Path $AgentsSrcRoot)) {
$legacyAgents = Join-Path $Src ".agents"
if (Test-Path $legacyAgents) {
$AgentsSrcRoot = $legacyAgents
}
}
$GitAttrSrc = Join-Path $Src ".gitattributes"
if (-not (Test-Path $AgentsSrcRoot)) {
-3
View File
@@ -22,9 +22,6 @@ fi
ROOT="$(CDPATH= cd -- "$ROOT" && pwd -P)"
AGENTS_SRC_ROOT="$SRC/rulesets"
if [ ! -d "$AGENTS_SRC_ROOT" ] && [ -d "$SRC/.agents" ]; then
AGENTS_SRC_ROOT="$SRC/.agents"
fi
GITATTR_SRC="$SRC/.gitattributes"
if [ ! -d "$AGENTS_SRC_ROOT" ]; then
-7
View File
@@ -77,13 +77,6 @@ if errorlevel 1 (
if not exist "%DEST_PREFIX%\\rulesets" mkdir "%DEST_PREFIX%\\rulesets"
copy /y "%SRC%\\rulesets\\index.md" "%DEST_PREFIX%\\rulesets\\index.md" >nul
if exist "%SRC%\\.agents" (
xcopy "%SRC%\\.agents\\*" "%DEST_PREFIX%\\.agents\\" /e /i /y >nul
if errorlevel 1 (
echo ERROR: failed to copy .agents
exit /b 1
)
)
if not exist "%DEST_PREFIX%\\templates" mkdir "%DEST_PREFIX%\\templates"
-5
View File
@@ -77,11 +77,6 @@ Copy-Item (Join-Path $Src "docs/common") $DocsDir -Recurse -Force
$AgentsDir = Join-Path $DestPrefix "rulesets"
New-Item -ItemType Directory -Path $AgentsDir -Force | Out-Null
Copy-Item (Join-Path $Src "rulesets/index.md") (Join-Path $AgentsDir "index.md") -Force
# Compatibility: keep a mirrored .agents/ snapshot when present.
$LegacyAgents = Join-Path $Src ".agents"
if (Test-Path $LegacyAgents) {
Copy-Item $LegacyAgents (Join-Path $DestPrefix ".agents") -Recurse -Force
}
$TemplatesDir = Join-Path $DestPrefix "templates"
New-Item -ItemType Directory -Path $TemplatesDir -Force | Out-Null
-4
View File
@@ -84,10 +84,6 @@ cp -R "$SRC/docs/common" "$DEST_PREFIX/docs/"
# Copy rulesets
mkdir -p "$DEST_PREFIX/rulesets"
cp "$SRC/rulesets/index.md" "$DEST_PREFIX/rulesets/index.md"
# Compatibility: keep a mirrored .agents/ snapshot when present.
if [ -d "$SRC/.agents" ]; then
cp -R "$SRC/.agents" "$DEST_PREFIX/"
fi
mkdir -p "$DEST_PREFIX/templates"
if [ -d "$SRC/templates/ci" ]; then