feat(pbs): add Beacon Workshop composition example
Add an original-asset minigame with modern controls, independent movement and tool animations, randomized safe beacon layouts and 2D drone patrols. Distribute the canonical project through installed knowledge and exercise compiled cartridges and animation boundaries. Fix lowering of admitted sibling constants and add a regression test. Focused compiler, installed knowledge and direct native checks passed; user tested and approved. Full make verify remains blocked by sandbox sysctl restrictions in ACP tests. WRK-0022 remains open.
This commit is contained in:
@@ -14,10 +14,17 @@ dependencies {
|
||||
// Build-time projection of owner-maintained sources; no second normative copy is edited by Studio.
|
||||
val pbsSpecs = rootProject.layout.projectDirectory.dir("docs/specs/compiler-languages/pbs")
|
||||
val pbsResources = layout.projectDirectory.dir("src/main/resources")
|
||||
val beaconWorkshop = rootProject.layout.projectDirectory.dir("test-projects/beacon-workshop")
|
||||
val beaconFiles = fileTree(beaconWorkshop) {
|
||||
include("src/**", "assets/**", "tools/*.py", "*.md", "prometeu.json", ".gitignore")
|
||||
exclude("**/__pycache__/**")
|
||||
}
|
||||
val generatePbsKnowledge by tasks.registering(Sync::class) {
|
||||
from(pbsSpecs) { include("*.md"); into("pbs-knowledge/specs") }
|
||||
from(beaconFiles) { into("pbs-knowledge/examples/game/1/beacon-workshop") }
|
||||
into(layout.buildDirectory.dir("generated/pbsKnowledge"))
|
||||
inputs.files(fileTree(pbsResources) { include("game/stdlib/**/*.pbs", "game/stdlib/**/*.barrel", "pbs-knowledge/examples/**") })
|
||||
inputs.files(beaconFiles)
|
||||
doLast {
|
||||
val entries = mutableListOf<Map<String, Any?>>()
|
||||
fun entry(id: String, title: String, kind: String, resource: String, source: File, sdk: Int? = null, target: String? = null) {
|
||||
@@ -72,6 +79,23 @@ val generatePbsKnowledge by tasks.registering(Sync::class) {
|
||||
entry("pbs:example:game:1:$relative", "PBS Game / SDK 1 example: $relative", "EXAMPLE",
|
||||
"pbs-knowledge/examples/game/1/$relative", source, 1, "Game")
|
||||
}
|
||||
// Binary glyphs travel as resources, never as UTF-8 reference payloads.
|
||||
val distributed = beaconFiles.files.sorted().map { source ->
|
||||
val relative = source.relativeTo(beaconWorkshop.asFile).invariantSeparatorsPath
|
||||
val resource = "pbs-knowledge/examples/game/1/beacon-workshop/$relative"
|
||||
if (source.extension != "png") {
|
||||
entry("pbs:example:game:1:beacon-workshop/$relative", "Beacon Workshop / $relative",
|
||||
"EXAMPLE", resource, source, 1, "Game")
|
||||
}
|
||||
mapOf("path" to relative, "resource" to resource,
|
||||
"sha256" to MessageDigest.getInstance("SHA-256").digest(source.readBytes())
|
||||
.joinToString("") { "%02x".format(it) })
|
||||
}
|
||||
val inventory = destinationDir.resolve("pbs-knowledge/examples/game/1/beacon-workshop/distribution.json")
|
||||
inventory.writeText(groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(
|
||||
mapOf("schemaVersion" to 1, "files" to distributed))))
|
||||
entry("pbs:example:game:1:beacon-workshop/distribution.json", "Beacon Workshop / packaged files",
|
||||
"EXAMPLE", "pbs-knowledge/examples/game/1/beacon-workshop/distribution.json", inventory, 1, "Game")
|
||||
check(entries.map { it["id"] }.distinct().size == entries.size) { "Duplicate PBS reference IDs" }
|
||||
destinationDir.resolve("pbs-knowledge/index.json").writeText(groovy.json.JsonOutput.prettyPrint(
|
||||
groovy.json.JsonOutput.toJson(mapOf("schemaVersion" to 1, "owner" to "pbs", "references" to entries))))
|
||||
|
||||
Reference in New Issue
Block a user