feat(commands): multi-select ordered command pipeline with step reordering and single-pass composition (AI-05, AI-07)

This commit is contained in:
Yun Chan 2026-10-31 02:54:54 +09:00
parent f49acf0105
commit 10af20a0ad
157 changed files with 29455 additions and 913 deletions

View file

@ -34,6 +34,7 @@ function loadSurfaces(readSurface = read) {
forgejoPublisher: readSurface('scripts/ci/publish-forgejo-release.mjs'),
gitlab: readSurface('.gitlab-ci.yml'),
forgejoRelease: readSurface('.forgejo/workflows/release.yml'),
forgejoPortable: readSurface('.forgejo/workflows/portable.yml'),
changelog: readSurface('CHANGELOG.md'),
}
}
@ -224,6 +225,24 @@ function validate(surfaces) {
surfaces.forgejoPublisher.includes('generic'),
'forgejo_publisher_registry_path_missing',
)
// GAP-REL-14: Forgejo Release 가 옛 main 커밋에 가짜 lightweight 태그를 만들지 않도록
// 정확한 커밋 SHA(resolveTargetCommitish)를 쓰고 게시 전에 태그를 먼저 푸시한다.
fail(
!surfaces.forgejoPublisher.includes('target_commitish: "main"') &&
surfaces.forgejoPublisher.includes('resolveTargetCommitish('),
'forgejo_publisher_mutable_main_target_commitish',
)
fail(
surfaces.releaseCommand.includes('FORGEJO_TARGET_COMMITISH: tagCommit') &&
surfaces.releaseCommand.indexOf('pushToRemotes(tag, tagCommit)') <
surfaces.releaseCommand.indexOf("'scripts/ci/publish-forgejo-release.mjs'"),
'release_command_push_after_publish',
)
// GAP-REL-11: Forgejo 러너가 지원하지 않는 actions/upload-artifact@v4 금지
fail(
!/^\s*uses:\s*actions\/upload-artifact@v4/m.test(surfaces.forgejoPortable),
'forgejo_portable_unsupported_upload_artifact',
)
for (const [name, workflow] of [
['gitlab', surfaces.gitlab],
@ -392,6 +411,23 @@ if (process.argv.includes('--self-test')) {
},
'update_service_policy_enforcement_missing',
)
expectRejected(
surfaces,
(candidate) => {
candidate.forgejoPublisher = candidate.forgejoPublisher.replaceAll(
'target_commitish: targetCommitish',
'target_commitish: "main"',
)
},
'forgejo_publisher_mutable_main_target_commitish',
)
expectRejected(
surfaces,
(candidate) => {
candidate.forgejoPortable = `${candidate.forgejoPortable}\nuses: actions/upload-artifact@v4\n`
},
'forgejo_portable_unsupported_upload_artifact',
)
let missingDesktopKeyRejected = false
try {
loadSurfaces((path) => {
@ -407,7 +443,7 @@ if (process.argv.includes('--self-test')) {
if (!missingDesktopKeyRejected) {
throw new Error('release_metadata_self_test_failed:desktop_license_public_key_missing')
}
result.negativeCases = 16
result.negativeCases = 18
}
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`)