Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This repo builds the Grill CLI and project setup tooling. The generated map-proj
- Local helpers in `config/ProjectConfigModels.kt` should stay thin: typealiases plus immutable copy helpers for shared records.
- `YamlHelper.dumpProjectConfig` intentionally serializes a pruned YAML map instead of the shared records directly. This preserves the old user-facing `wurst.build` behavior by omitting null/default nested fields.
- `wbschema.json` should stay lenient and aligned with the shared config parser, especially for `scriptMode`, `wc3Patch`, and nullable legacy fields.
- Compiler-owned agent references belong in `~/.wurst/wurst-compiler/agent-docs/`. Generated project notes should prefer those version-matched local files when present and retain an online fallback until compiler releases ship them.

## WC3 Patch And Core JASS

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/file/SetupApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object SetupApp {

private data class WurstProcessResult(val exitCode: Int, val output: List<String>)

internal const val AGENTS_TEMPLATE_VERSION = "2026-08-05"
internal const val AGENTS_TEMPLATE_VERSION = "2026-08-08"
Comment thread
Frotty marked this conversation as resolved.
private const val AGENTS_TEMPLATE_MARKER_PREFIX = "<!-- WURST_AGENTS_TEMPLATE_VERSION:"
private const val AGENTS_TEMPLATE_MARKER = "<!-- WURST_AGENTS_TEMPLATE_VERSION: $AGENTS_TEMPLATE_VERSION -->"
private const val AGENTS_TEMPLATE_SOURCE_HINT = "WurstScript Warcraft III map project notes"
Expand Down
29 changes: 29 additions & 0 deletions src/test/kotlin/AgentsTemplateTests.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import org.testng.Assert
import org.testng.annotations.Test
import java.nio.file.Files
import java.nio.file.Paths

class AgentsTemplateTests {
private val templatePath = Paths.get("templates", "AGENTS.md")

@Test
fun testTemplateStaysTokenLean() {
val content = Files.readString(templatePath)
val wordCount = Regex("""\S+""").findAll(content).count()

Assert.assertTrue(wordCount <= 900, "AGENTS template grew to $wordCount words (limit: 900)")
Assert.assertTrue(content.length <= 7000, "AGENTS template grew to ${content.length} characters (limit: 7000)")
}

@Test
fun testLanguageDocsPreferCompilerMatchedLocalReference() {
val content = Files.readString(templatePath)
val localReference = "~/.wurst/wurst-compiler/agent-docs/WURST_LANGUAGE.md"
val onlineFallback = "https://wurstlang.org/manual.html"
val localIndex = content.indexOf(localReference)
val onlineIndex = content.indexOf(onlineFallback)

Assert.assertTrue(localIndex >= 0, "Missing compiler-matched local language reference")
Assert.assertTrue(onlineIndex > localIndex, "Online manual must remain a fallback after the local reference")
}
}
Loading
Loading