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

+115 -11
View File
@@ -519,10 +519,29 @@ final class InteractionTests: XCTestCase {
let access = app.dialogs["C Project Assistant Access"]
XCTAssertTrue(access.waitForExistence(timeout: 5))
XCTAssertTrue(access.checkBoxes["Allow Disposable Playtests"].exists)
let outputExport = access.checkBoxes["Allow Build Output Export"]
XCTAssertTrue(outputExport.exists)
XCTAssertEqual(outputExport.value as? Int, 0, "Opening Assistant must not grant delivery-folder access")
XCTAssertTrue(access.checkBoxes["Use Project Makefile"].exists)
XCTAssertTrue(access.buttons["Save Private Connection…"].exists)
let corner = access.coordinate(withNormalizedOffset: CGVector(dx: 1, dy: 1)).withOffset(CGVector(dx: -3, dy: -3))
corner.click(forDuration: 0.2, thenDragTo: corner.withOffset(CGVector(dx: 0, dy: max(0, 620 - access.frame.height))))
let accessShot = XCTAttachment(screenshot: access.screenshot())
accessShot.name = "C Development — native Assistant permission choices"; accessShot.lifetime = .keepAlways; add(accessShot)
outputExport.click()
let chooseDelivery = access.buttons["Choose Delivery Folder…"]
XCTAssertTrue(chooseDelivery.waitForExistence(timeout: 5))
XCTAssertFalse(access.buttons["Save Private Connection…"].isEnabled, "Export needs a separately approved folder")
let exportShot = XCTAttachment(screenshot: access.screenshot())
exportShot.name = "C Development — explicit build delivery folder approval"; exportShot.lifetime = .keepAlways; add(exportShot)
chooseDelivery.click()
XCTAssertTrue(app.buttons["Approve Folder"].firstMatch.waitForExistence(timeout: 5))
app.buttons["Cancel"].firstMatch.click()
XCTAssertTrue(access.waitForExistence(timeout: 5))
XCTAssertTrue(access.staticTexts["No delivery folder selected"].exists)
XCTAssertFalse(access.buttons["Save Private Connection…"].isEnabled)
outputExport.click()
XCTAssertTrue(access.buttons["Save Private Connection…"].isEnabled, "Cancelling export consent leaves ordinary connection creation available")
access.buttons[XCUIIdentifierCloseWindow].click()
XCTAssertEqual(session()[0], before[0], "Reading workspace and consent controls must not restart the CoCo")
XCTAssertEqual(try String(contentsOf: folder.appendingPathComponent("main.c"), encoding: .utf8), source)
@@ -2430,14 +2449,86 @@ final class InteractionTests: XCTestCase {
// Examine the composited live Metal surface, not just the viewport formula.
// The authored diagnostic fills its 640 × 384 active raster with color bars.
private func assertPictureAspect(scaling: String = "Sharp — Fit Window") throws {
let bitmap = try XCTUnwrap(NSBitmapImageRep(data: display.screenshot().pngRepresentation))
func bright(_ x: Int, _ y: Int) -> Bool {
var pixel = [Int](repeating: 0, count: 5)
bitmap.getPixel(&pixel, atX: x, y: y)
return pixel.prefix(3).max()! > 150
struct Observation {
let bitmap: NSBitmapImageRep
let frame: CGRect
let xs: [Int], ys: [Int]
}
let xs = (0..<bitmap.pixelsWide).filter { bright($0, bitmap.pixelsHigh / 2) }
let ys = (0..<bitmap.pixelsHigh).filter { bright(bitmap.pixelsWide / 2, $0) }
func finitePositiveFrame(_ frame: CGRect) -> Bool {
[frame.minX, frame.minY, frame.width, frame.height].allSatisfy { $0.isFinite }
&& frame.width > 0 && frame.height > 0
}
func reportFrame(_ frame: CGRect) -> [Any] {
[frame.minX, frame.minY, frame.width, frame.height].map { value -> Any in
value.isFinite ? Double(value) : String(describing: value)
}
}
let began = ContinuousClock.now
let deadline = began.advanced(by: .seconds(5))
var latest: Observation?, firstMismatch: [String: Any]?, lastDetails: [String: Any] = [:]
var stableObservations = 0, attempts = 0
while ContinuousClock.now < deadline {
attempts += 1
let element = display
let before = element.frame
let bitmap = NSBitmapImageRep(data: element.screenshot().pngRepresentation)
let frame = element.frame
let duration = began.duration(to: ContinuousClock.now).components
let elapsed = Double(duration.seconds) + Double(duration.attoseconds) / 1e18
var details: [String: Any] = ["elapsed_seconds": elapsed,
"frame_before": reportFrame(before), "frame_after": reportFrame(frame),
"finite_positive_frame": finitePositiveFrame(before) && finitePositiveFrame(frame)]
if let bitmap, bitmap.pixelsWide > 0, bitmap.pixelsHigh > 0,
finitePositiveFrame(before), finitePositiveFrame(frame) {
func bright(_ x: Int, _ y: Int) -> Bool {
var pixel = [Int](repeating: 0, count: 5)
bitmap.getPixel(&pixel, atX: x, y: y)
return pixel.prefix(3).max()! > 150
}
let xs = (0..<bitmap.pixelsWide).filter { bright($0, bitmap.pixelsHigh / 2) }
let ys = (0..<bitmap.pixelsHigh).filter { bright(bitmap.pixelsWide / 2, $0) }
if let x0 = xs.first, let x1 = xs.last, let y0 = ys.first, let y1 = ys.last {
let width = Double(x1 - x0 + 1), height = Double(y1 - y0 + 1)
let backing = Double(bitmap.pixelsWide) / frame.width
let inset = 4 * backing
let fit = min((Double(bitmap.pixelsWide) - 2 * inset) / 640,
(Double(bitmap.pixelsHigh) - 2 * inset) / 384)
let integer = scaling == "Integer Pixels" && fit >= 1
let scale = integer ? floor(fit) : fit
// Use the unchanged final assertions' exact tolerances for
// readiness; an indefinitely stretched drawable still fails.
let matches = abs(width - height * 640 / 384) <= 3
&& abs(width - 640 * scale) <= 3 && abs(height - 384 * scale) <= 3
&& abs(Double(x0) + width / 2 - Double(bitmap.pixelsWide) / 2) <= 2
&& abs(Double(y0) + height / 2 - Double(bitmap.pixelsHigh) / 2) <= 2
let stableFrame = before == frame && latest?.frame == frame
stableObservations = matches && before == frame ? (stableFrame ? stableObservations + 1 : 1) : 0
details.merge(["picture": [x0, y0, x1 - x0 + 1, y1 - y0 + 1],
"bitmap_size": [bitmap.pixelsWide, bitmap.pixelsHigh], "expected_scale": scale.isFinite ? scale as Any : String(describing: scale),
"unchanged_tolerances_satisfied": matches, "stable_observations": stableObservations]) { _, new in new }
latest = Observation(bitmap: bitmap, frame: frame, xs: xs, ys: ys)
} else {
stableObservations = 0; details["failure"] = "No bright diagnostic row or column"
}
} else {
stableObservations = 0; details["failure"] = "Display screenshot or finite positive frame unavailable"
}
lastDetails = details
if stableObservations >= 2 { break }
if firstMismatch == nil { firstMismatch = details }
if ContinuousClock.now.advanced(by: .milliseconds(100)) >= deadline { break }
Thread.sleep(forTimeInterval: 0.1) // Test runner only; the app and guest keep running.
}
let duration = began.duration(to: ContinuousClock.now).components
let report: [String: Any] = ["scaling": scaling, "attempts": attempts,
"elapsed_seconds": Double(duration.seconds) + Double(duration.attoseconds) / 1e18,
"required_stable_observations": 2, "ready": stableObservations >= 2,
"first_mismatch_or_unsettled_observation": firstMismatch.map { $0 as Any } ?? NSNull(), "final_observation": lastDetails]
let readiness = XCTAttachment(data: try JSONSerialization.data(withJSONObject: report, options: [.prettyPrinted, .sortedKeys]), uniformTypeIdentifier: "public.json")
readiness.name = "Metal picture readiness"; readiness.lifetime = .keepAlways; add(readiness)
XCTAssertGreaterThanOrEqual(stableObservations, 2, "The actual composited picture and display frame must settle within five seconds without relaxing geometry checks")
let observation = try XCTUnwrap(latest, "The actual Metal diagnostic picture was unavailable")
let bitmap = observation.bitmap, xs = observation.xs, ys = observation.ys
let width = try XCTUnwrap(xs.last) - XCTUnwrap(xs.first) + 1
let height = try XCTUnwrap(ys.last) - XCTUnwrap(ys.first) + 1
XCTAssertEqual(Double(width), Double(height) * 640 / 384, accuracy: 3,
@@ -2445,7 +2536,7 @@ final class InteractionTests: XCTestCase {
// Aspect alone also passes for a tiny picture centered in a huge
// viewport. Measure actual composited coverage and placement as well.
// Calculate expectations independently of the app's VideoGeometry.
let backing = Double(bitmap.pixelsWide) / display.frame.width
let backing = Double(bitmap.pixelsWide) / observation.frame.width
let inset = 4 * backing
let fit = min((Double(bitmap.pixelsWide) - 2 * inset) / 640,
(Double(bitmap.pixelsHigh) - 2 * inset) / 384)
@@ -4209,10 +4300,24 @@ extension InteractionTests {
let source = library.buttons["library-open-source"]
let detail = library.scrollViews.containing(.button, identifier: "library-open-source").firstMatch
for _ in 0..<8 where !source.isHittable { detail.scroll(byDeltaX: 0, deltaY: -300) }
XCTAssertTrue(source.isHittable)
XCTAssertTrue(library.descendants(matching: .any)["library-online-manual"].firstMatch.exists, "The online edition remains a distinct link")
func downloadSource(to location: URL) {
app.activate()
// XCTest can report a clipped button as hittable even when its
// center is below the scroll viewport. Qualify the actual geometry
// before clicking, including after returning from the workspace.
func sourceIsVisible() -> Bool {
let button = source.frame, viewport = detail.frame.insetBy(dx: 4, dy: 8)
return [button.minX, button.minY, button.width, button.height,
viewport.minX, viewport.minY, viewport.width, viewport.height].allSatisfy { $0.isFinite }
&& button.width > 0 && button.height > 0
&& viewport.width > 0 && viewport.height > 0
&& source.isHittable && viewport.contains(button)
}
for _ in 0..<8 where !sourceIsVisible() {
detail.scroll(byDeltaX: 0, deltaY: source.frame.minY < detail.frame.minY ? 200 : -200)
}
diskEditorWait("Open Source must be wholly inside the visible detail viewport") { sourceIsVisible() }
source.click()
let download = app.buttons["Download Source"].firstMatch
XCTAssertTrue(download.waitForExistence(timeout: 5))
@@ -4245,7 +4350,6 @@ extension InteractionTests {
let dirty = editor.value as? String
menu("Media", "Software Library…")
XCTAssertTrue(library.waitForExistence(timeout: 5))
for _ in 0..<8 where !source.isHittable { detail.scroll(byDeltaX: 0, deltaY: -300) }
downloadSource(to: secondDestination)
let cancelReview = app.buttons["Cancel"].firstMatch
XCTAssertTrue(app.staticTexts["Save changes to this project?"].firstMatch.waitForExistence(timeout: 15))