fix(build): reject unknown tokens beside allowed placeholders
This commit is contained in:
1 parent
a182b9c5c7
commit
55c80ab9de
3 files changed
+19
-2
No files matched your search
@@ -24,6 +24,9 @@ function Test-BuildFails([string]$Label, [scriptblock]$Mutate) {
|
||||
if (-not $failed) { throw "Expected build to fail for case '$Label' but it succeeded." }
|
||||
}
|
||||
|
||||
$baseline = New-RepoCopy
|
||||
& (Join-Path $baseline 'scripts/build.ps1') -Summary | Out-Null
|
||||
|
||||
Test-BuildFails 'invalid Claude settings.json' {
|
||||
param($copy)
|
||||
Add-Content (Join-Path $copy 'adapters/claude/config/settings.json') '} this is not json {'
|
||||
@@ -47,6 +50,12 @@ Test-BuildFails 'leftover template placeholder' {
|
||||
Add-Content (Join-Path $copy 'shared/global-instructions.md') "`n__NOT_A_REAL_PLACEHOLDER__"
|
||||
}
|
||||
|
||||
Test-BuildFails 'unknown placeholder beside an allowed installer placeholder' {
|
||||
param($copy)
|
||||
$path = Join-Path $copy 'adapters/claude/config/settings.json'
|
||||
(Get-Content $path -Raw).Replace('__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY__', '__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY____UNKNOWN_PLACEHOLDER__') | Set-Content $path
|
||||
}
|
||||
|
||||
Remove-Item $work -Recurse -Force -ErrorAction SilentlyContinue
|
||||
if ($Summary) { Write-Output 'Tests: PASS | build validation' } else { Write-Output 'PASS build validation: invalid JSON, duplicate agent, duplicate plugin, and leftover placeholders are all rejected' }
|
||||
exit 0
|
||||
Reference in new issue
Block a user