Sync VCC Plus 3.7.1 build 67 source

Refresh reviewed MCP output export, four-drive owned playtests, bounded BASIC readiness, and pinned CMOC 0.1.101 source/patches. Preserve independent source-edition identity, empty libraries, notices and privacy boundaries.

Validated 74 export/privacy checks, pinned dependency sources, and an independent unsigned universal Release build. A subsequent documentation-only correction removes an excluded qualification link; all build inputs remain identical.
This commit is contained in:
Brian Holman committed 2026-11-17 08:42:27 -07:00
1 parent 4abc194001
commit 5534005799
54 files changed
+2950 -435

No files matched your search

+58 -7
View File
@@ -507,6 +507,8 @@ struct CMOCProjectConfiguration: Codable, Equatable, Sendable {
/// Additional build-produced floppy images reviewed for owned disk exchange.
/// These are outputs, not source inputs or arbitrary files to mount.
var playtestDisks: [String] = []
/// Concrete additional delivery files; outputDirectories are never export permissions.
var exportOutputs: [String] = []
var launchMode: CMOCLaunchMode = .quickload
var launchCommands: [String] = []
var configurations = [CMOCBuildConfiguration(name: "Debug"), CMOCBuildConfiguration(name: "Release", makeArguments: ["VCC_CONFIGURATION=Release"])]
@@ -521,7 +523,7 @@ struct CMOCProjectConfiguration: Codable, Equatable, Sendable {
var outputDirectories: [String] = []
var makefileSettings: CMOCMakefileSettings? = nil
init() {}
enum CodingKeys: CodingKey { case entrySource, makefile, buildTarget, cleanTarget, diskTarget, binary, diskImage, debugManifest, playtestDisks, launchMode, launchCommands, configurations, jobs, makefileSettings, bundledLibraries, buildSupportDirectories, resourceInputs, generatedInputs, outputDirectories }
enum CodingKeys: CodingKey { case entrySource, makefile, buildTarget, cleanTarget, diskTarget, binary, diskImage, debugManifest, playtestDisks, exportOutputs, launchMode, launchCommands, configurations, jobs, makefileSettings, bundledLibraries, buildSupportDirectories, resourceInputs, generatedInputs, outputDirectories }
init(from decoder: Decoder) throws {
self.init()
let c = try decoder.container(keyedBy: CodingKeys.self)
@@ -534,6 +536,7 @@ struct CMOCProjectConfiguration: Codable, Equatable, Sendable {
diskImage = try c.decodeIfPresent(String.self, forKey: .diskImage)
debugManifest = try c.decodeIfPresent(String.self, forKey: .debugManifest)
playtestDisks = try c.decodeIfPresent([String].self, forKey: .playtestDisks) ?? []
exportOutputs = try c.decodeIfPresent([String].self, forKey: .exportOutputs) ?? []
launchMode = try c.decodeIfPresent(CMOCLaunchMode.self, forKey: .launchMode) ?? launchMode
launchCommands = try c.decodeIfPresent([String].self, forKey: .launchCommands) ?? []
configurations = try c.decodeIfPresent([CMOCBuildConfiguration].self, forKey: .configurations) ?? configurations
@@ -554,6 +557,7 @@ struct CMOCProjectConfiguration: Codable, Equatable, Sendable {
try c.encodeIfPresent(diskImage, forKey: .diskImage); try c.encode(launchMode, forKey: .launchMode)
try c.encodeIfPresent(debugManifest, forKey: .debugManifest)
if !playtestDisks.isEmpty { try c.encode(playtestDisks, forKey: .playtestDisks) }
if !exportOutputs.isEmpty { try c.encode(exportOutputs, forKey: .exportOutputs) }
try c.encode(launchCommands, forKey: .launchCommands); try c.encode(configurations, forKey: .configurations)
try c.encode(jobs, forKey: .jobs); try c.encodeIfPresent(makefileSettings, forKey: .makefileSettings)
if !bundledLibraries.isEmpty { try c.encode(bundledLibraries, forKey: .bundledLibraries) }
@@ -592,7 +596,23 @@ struct CMOCProjectConfiguration: Codable, Equatable, Sendable {
throw CMOCBuildError.message("Additional playtest disks need distinct project-relative .dsk or .os9 output paths, separate from inputs and primary outputs.")
}
}
let concreteOutputs = ([binary, diskImage, debugManifest].compactMap { $0 } + playtestDisks +
let exportPaths = [binary, diskImage, debugManifest].compactMap { $0 } + playtestDisks + exportOutputs
guard exportPaths.count <= 64,
Set(exportPaths.map { $0.lowercased() }).count == exportPaths.count else {
throw CMOCBuildError.message("Declare at most 64 distinct concrete delivery outputs.")
}
for path in exportOutputs {
try CMOCProject.validateRelativePath(path)
guard !occupiedRoles.contains(path.lowercased()), path.split(separator: "/").count <= 32,
!path.split(separator: "/").contains(where: { [".git", ".hg", ".svn"].contains($0.lowercased()) }) else {
throw CMOCBuildError.message("Delivery outputs must be concrete generated files, separate from project inputs.")
}
}
let lowerExportPaths = exportPaths.map { $0.lowercased() }
guard !lowerExportPaths.contains(where: { path in lowerExportPaths.contains(where: { $0.hasPrefix(path + "/") }) }) else {
throw CMOCBuildError.message("Delivery output paths cannot overlap directories and files.")
}
let concreteOutputs = ([binary, diskImage, debugManifest].compactMap { $0 } + playtestDisks + exportOutputs +
(makefileSettings?.generatedResources.flatMap(\.outputs) ?? [])).map { $0.lowercased() }
let ordinaryInputs = [entrySource, makefile, CMOCProject.configurationFilename] + resourceInputs
let explicitInputs = ordinaryInputs + generatedInputs
@@ -820,7 +840,7 @@ struct CMOCProject: Equatable, Sendable {
for ext in ["map", "link"] { excluded.insert((stem + "." + ext).lowercased()) }
}
if let disk = configuration.diskImage { excluded.insert(disk.lowercased()) }
excluded.formUnion(configuration.playtestDisks.map { $0.lowercased() })
excluded.formUnion((configuration.playtestDisks + configuration.exportOutputs).map { $0.lowercased() })
if let manifest = configuration.debugManifest { excluded.insert(manifest.lowercased()) }
if let recipe = configuration.makefileSettings {
for path in recipe.generatedResources.flatMap(\.outputs) { excluded.insert(path.lowercased()) }
@@ -976,6 +996,20 @@ struct CMOCPlaytestDiskProduct: Codable, Equatable, Sendable {
let byteCount: Int
}
/// A concrete delivery product frozen at successful build completion.
struct CMOCBuildOutputProduct: Codable, Equatable, Sendable {
let relativePath: String
let byteCount: Int
let sha256: String
func identifier(artifactID: UUID) -> String {
CMOCProject.sha256(Data((artifactID.uuidString + "\n" + relativePath).utf8))
}
func fields(artifactID: UUID) -> [String: Any] {
["output_id": identifier(artifactID: artifactID), "path": relativePath,
"bytes": byteCount, "sha256": sha256]
}
}
struct CMOCBuildArtifact: Sendable {
let id: UUID
let directory: URL
@@ -998,6 +1032,7 @@ struct CMOCBuildArtifact: Sendable {
let playtestDiskProducts: [CMOCPlaytestDiskProduct]
let debugManifestRelativePath: String?
let outputPaths: [String]
let exportProducts: [CMOCBuildOutputProduct]
let configurationName: String
let action: CMOCBuildAction
var hasBinary: Bool { binaryRelativePath != nil && !binaryData.isEmpty }
@@ -1016,7 +1051,7 @@ struct CMOCBuildArtifact: Sendable {
entrySourcePath: String = "main.c", binaryRelativePath: String? = "main.bin", diskRelativePath: String? = nil,
outputPaths: [String] = [], configurationName: String = "Debug", action: CMOCBuildAction = .build,
debugManifestRelativePath: String? = nil, diskSHA256: String? = nil, buildOutput: CMOCBuildOutput? = nil,
playtestDiskProducts: [CMOCPlaytestDiskProduct] = []) {
playtestDiskProducts: [CMOCPlaytestDiskProduct] = [], exportProducts: [CMOCBuildOutputProduct] = []) {
self.id = id; self.directory = directory; self.source = source; self.sourceData = sourceData; self.sourceSHA256 = sourceSHA256
self.binaryData = binaryData; self.buildLog = buildLog; self.buildOutput = buildOutput; self.sources = sources ?? [entrySourcePath: sourceData]
self.sourceHashes = self.sources.mapValues(CMOCProject.sha256)
@@ -1026,6 +1061,7 @@ struct CMOCBuildArtifact: Sendable {
self.debugManifestRelativePath = debugManifestRelativePath
self.diskSHA256 = diskSHA256
self.playtestDiskProducts = playtestDiskProducts
self.exportProducts = exportProducts
self.configurationName = configurationName; self.action = action
}
func matches(source: String) -> Bool { sourceSHA256 == CMOCProject.sha256(Data(source.utf8)) }
@@ -1588,10 +1624,11 @@ final class CMOCBuildService: @unchecked Sendable {
let supportKey = CMOCProject.sha256(try libraryEncoder.encode(supportIdentity))
// A newly reviewed media declaration cannot inherit an incidental old
// image from an earlier cache. Empty declarations retain legacy keys.
let exportKey = settings.exportOutputs.isEmpty ? "" : "\nexport-outputs:" + CMOCProject.sha256(try libraryEncoder.encode(settings.exportOutputs))
let playtestMediaKey = settings.playtestDisks.isEmpty ? "" :
"\nplaytest-disks:" + CMOCProject.sha256(try libraryEncoder.encode(settings.playtestDisks))
let cacheKey = CMOCProject.sha256(Data((project.directory.resolvingSymlinksInPath().path + "\n" + name + "\n" +
configuration.makeArguments.joined(separator: "\n") + "\n" + libraryKey + "\n" + supportKey + "\n" + toolchain.path + "\n" + CMOCProject.sha256(manifest) + playtestMediaKey).utf8))
configuration.makeArguments.joined(separator: "\n") + "\n" + libraryKey + "\n" + supportKey + "\n" + toolchain.path + "\n" + CMOCProject.sha256(manifest) + playtestMediaKey + exportKey).utf8))
let cache = try incrementalWorkspaceRoot().appendingPathComponent(cacheKey)
let workspace = cache.appendingPathComponent("project")
let indexURL = cache.appendingPathComponent("inputs.json")
@@ -1750,6 +1787,19 @@ final class CMOCBuildService: @unchecked Sendable {
sha256: CMOCProject.sha256(data), byteCount: data.count))
}
}
var exportProducts: [CMOCBuildOutputProduct] = []
if requiresProducts {
let declared = [binaryPath, diskPath, settings.debugManifest.flatMap { products[$0] == nil ? nil : $0 }].compactMap { $0 } + settings.playtestDisks + settings.exportOutputs
var total = 0
for path in declared {
guard let data = products[path], data.count <= CMOCProject.maximumFileBytes,
total <= 128 * 1024 * 1024 - data.count else {
throw CMOCBuildError.validation(message: "Make did not produce a bounded declared delivery file: " + path, log: log, capture: combinedOutput)
}
total += data.count
exportProducts.append(CMOCBuildOutputProduct(relativePath: path, byteCount: data.count, sha256: CMOCProject.sha256(data)))
}
}
try control.checkCancellation(log: log)
let id = UUID()
let result = buildRoot.appendingPathComponent(id.uuidString)
@@ -1773,7 +1823,7 @@ final class CMOCBuildService: @unchecked Sendable {
binaryRelativePath: binaryPath, diskRelativePath: diskPath, outputPaths: products.keys.sorted(), configurationName: name, action: action,
debugManifestRelativePath: settings.debugManifest,
diskSHA256: diskPath.flatMap { products[$0] }.map(CMOCProject.sha256), buildOutput: combinedOutput,
playtestDiskProducts: playtestDiskProducts)
playtestDiskProducts: playtestDiskProducts, exportProducts: exportProducts)
try buildHistory.record(artifact, project: project.directory)
frozen = true; succeeded = true
return artifact
@@ -1831,7 +1881,8 @@ final class CMOCBuildService: @unchecked Sendable {
let physicalDirectory = URL(fileURLWithPath: String(cString: physicalPath), isDirectory: true)
free(physicalPath)
let artifact = CMOCBuildArtifact(id: id, directory: physicalDirectory, source: source,
sourceData: sourceData, sourceSHA256: CMOCProject.sha256(sourceData), binaryData: binary, buildLog: output.text, buildOutput: control.capturedOutput)
sourceData: sourceData, sourceSHA256: CMOCProject.sha256(sourceData), binaryData: binary, buildLog: output.text, buildOutput: control.capturedOutput,
exportProducts: [CMOCBuildOutputProduct(relativePath: "main.bin", byteCount: binary.count, sha256: CMOCProject.sha256(binary))])
try control.checkCancellation()
try buildHistory.record(artifact, project: project.directory)
succeeded = true