test(core): Swift oracle — the filius-ipad core built on Linux as the reference

tools/swift-oracle builds the unchanged Swift runtime (pinned 3b5ded0)
in Docker and replays JSON scenarios; the TypeScript engine must produce
the same trace events, results and end state. Five scenarios, 884
events, identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 19:33:14 +00:00
co-authored by Claude Opus 5.5
parent 696334aa5a
commit 5c16cf18b4
27 changed files with 27394 additions and 4 deletions
@@ -0,0 +1,69 @@
diff --git a/TopologyPacketCaptureTextExport.swift b/TopologyPacketCaptureTextExport.swift
index fcdb43a..c9ed472 100644
--- a/TopologyPacketCaptureTextExport.swift
+++ b/TopologyPacketCaptureTextExport.swift
@@ -245,26 +245,26 @@ enum TopologyPacketCaptureTextExportFormatter {
}
private static func renderRecord(_ record: TopologyPacketCaptureExportRecord) -> String {
- [
- String(record.number),
- String(record.timeMilliseconds),
- String(record.traceID),
- record.frameID.map(String.init) ?? "",
- record.packetID.map(String.init) ?? "",
- normalizedUUID(record.nodeID),
- record.nodeName,
- record.interfaceID.map(normalizedUUID) ?? "",
- record.interfaceName ?? "",
- record.direction,
- record.layer,
- record.operation,
- record.source,
- record.destination,
- record.protocolName,
- record.beforeHeaders,
- record.afterHeaders,
- record.detail,
- ].map(escapeTSVField).joined(separator: "\t")
+ var fields: [String] = []
+ fields.append(String(record.number))
+ fields.append(String(record.timeMilliseconds))
+ fields.append(String(record.traceID))
+ fields.append(record.frameID.map { String($0) } ?? "")
+ fields.append(record.packetID.map { String($0) } ?? "")
+ fields.append(normalizedUUID(record.nodeID))
+ fields.append(record.nodeName)
+ fields.append(record.interfaceID.map { normalizedUUID($0) } ?? "")
+ fields.append(record.interfaceName ?? "")
+ fields.append(record.direction)
+ fields.append(record.layer)
+ fields.append(record.operation)
+ fields.append(record.source)
+ fields.append(record.destination)
+ fields.append(record.protocolName)
+ fields.append(record.beforeHeaders)
+ fields.append(record.afterHeaders)
+ fields.append(record.detail)
+ return fields.map(escapeTSVField).joined(separator: "\t")
}
private static func traceIsOrderedBefore(
diff --git a/TopologyRuntimeSimpleClientEcho.swift b/TopologyRuntimeSimpleClientEcho.swift
index e72694f..5b9baf3 100644
--- a/TopologyRuntimeSimpleClientEcho.swift
+++ b/TopologyRuntimeSimpleClientEcho.swift
@@ -252,8 +252,11 @@ struct TopologyRuntimeWebBrowserHistoryEntry: Equatable {
}
fileprivate var retainedByteCount: Int {
- address.utf8.count + resolvedIPAddress.utf8.count + (contentType?.utf8.count ?? 0)
- + body.utf8.count + bodyData.count + (errorMessage?.utf8.count ?? 0)
+ let head: Int = address.utf8.count + resolvedIPAddress.utf8.count
+ let type: Int = contentType?.utf8.count ?? 0
+ let error: Int = errorMessage?.utf8.count ?? 0
+ let tail: Int = body.utf8.count + bodyData.count
+ return head + type + tail + error
}
}