From b118f044926ae6b4880c4214621ae6c5b2a71f17 Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Fri, 9 Oct 2026 23:21:24 -0700 Subject: [PATCH] perf(apple): stop repeating the archive path in Interface Builder evidence (#1460) Every Interface Builder node and edge evidence record prefixed its description with the archive's relative path, which artifact_path in the same record already states. Bundles carry thousands of objects across localized nibs, so the repeated path made up 6-10% of decode_interface_builder output (XLD: 7.38 MB to 6.62 MB). Descriptions now name only the decoded item, such as "object 81" or "outlet o_quality". Co-authored-by: Claude Opus 5.5 --- .../apple/interfaceBuilderGraph.test.ts | 43 +++++++++++++++++++ src/domain/apple/interfaceBuilderGraph.ts | 4 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/domain/apple/interfaceBuilderGraph.test.ts b/src/domain/apple/interfaceBuilderGraph.test.ts index 13d6f79fb..fb1c0b9ad 100644 --- a/src/domain/apple/interfaceBuilderGraph.test.ts +++ b/src/domain/apple/interfaceBuilderGraph.test.ts @@ -509,3 +509,46 @@ describe("AppKit keyed archive connectors", () => { expect(to).toEqual(expect.arrayContaining(["objc_selector", "unknown"])); }); }); + +it("names the archive once per evidence record", () => { + const relativePath = "Views/Main.storyboardc/scene.nib/objects.nib"; + const result = buildInterfaceBuilderAnalysis({ + targetSha256: hash, + toolVersion: "test", + documents: [ + { + relativePath, + archiveSha256: hash, + documentKind: "storyboard_scene", + raw: { + "com.apple.ibtool.document.objects": { + controller: { customClass: "StoreViewController" }, + next: { customClass: "BuildViewController" }, + }, + "com.apple.ibtool.document.connections": { + controller: [ + { type: "segue", identifier: "showBuild", destinationId: "next" }, + ], + }, + }, + }, + ], + limits: interfaceBuilderLimitsSchema.parse({}), + }); + const evidence = [...result.graph.nodes, ...result.graph.edges].flatMap( + (item) => item.evidence, + ); + expect(new Set(evidence.map(({ artifact_path }) => artifact_path))).toEqual( + new Set([relativePath]), + ); + expect(evidence.map(({ description }) => description)).toEqual( + expect.arrayContaining([ + "compiled document", + "object controller", + "segue showBuild", + ]), + ); + expect( + evidence.filter(({ description }) => description.includes(relativePath)), + ).toEqual([]); +}); diff --git a/src/domain/apple/interfaceBuilderGraph.ts b/src/domain/apple/interfaceBuilderGraph.ts index 17e94d584..bd35130a8 100644 --- a/src/domain/apple/interfaceBuilderGraph.ts +++ b/src/domain/apple/interfaceBuilderGraph.ts @@ -72,7 +72,9 @@ export const buildInterfaceBuilderAnalysis = (input: { const evidenceFor = (description: string) => [ { kind: "interface_builder_resource" as const, - description: `${document.relativePath}: ${description}`, + // artifact_path names the archive; repeating it here cost a path per + // node and edge. + description, location: { address: null, file_offset: null }, artifact_path: document.relativePath, artifact_sha256: document.archiveSha256,