From 0281d101307c8884f64d8d31f48e6ca982e3c42a Mon Sep 17 00:00:00 2001
From: morluto <76467478+morluto@users.noreply.github.com>
Date: Fri, 23 Oct 2026 06:40:25 +0800
Subject: [PATCH] fix(mobile): share authenticated inventory projection sources
Authenticate inventory requests once before family projection, remove obsolete schema aliases and raw facades, and preserve unresolved occurrence references from partial pages without fabricating content identities.
---
.../InventoryProjectionEvidence.ts | 128 +++++---------
.../android/AndroidApplicationService.ts | 8 +-
.../apple/AppleApplicationService.ts | 8 +-
.../harmony/HarmonyApplicationService.ts | 8 +-
.../ArtifactOccurrenceIdentity.test.ts | 13 +-
src/cli/applicationCommands.ts | 23 +--
src/contracts/applicationToolContracts.ts | 22 +--
src/domain/android/androidApplication.ts | 83 ++++-----
src/domain/apple/appleApplication.test.ts | 36 ++--
src/domain/apple/appleApplication.ts | 90 +++++-----
src/domain/harmony/harmonyApplication.ts | 93 +++++-----
.../mobileApplicationGraphProjection.ts | 73 ++++++--
.../tools/mobileGraphExamples.test.ts | 34 +++-
.../mcp/mobileApplicationGraphMcp.test.ts | 163 +++++++++++++++++-
14 files changed, 466 insertions(+), 316 deletions(-)
diff --git a/src/application/InventoryProjectionEvidence.ts b/src/application/InventoryProjectionEvidence.ts
index b89059c15e..9d25988723 100644
--- a/src/application/InventoryProjectionEvidence.ts
+++ b/src/application/InventoryProjectionEvidence.ts
@@ -1,23 +1,15 @@
-import { z } from "zod";
-
-import { AnalysisInputError } from "../domain/analysisErrorCore.js";
-import { AnalysisError } from "../domain/analysisErrorBase.js";
+import type { AnalysisInputError } from "../domain/analysisErrorCore.js";
+import type { AnalysisError } from "../domain/analysisErrorBase.js";
import {
createEvidence,
type Evidence,
type EvidenceProvider,
type EvidenceSubjectTarget,
} from "../domain/evidence.js";
-import { jsonValueSchema } from "../domain/jsonValue.js";
-import type { MobileApplicationProjectionWithSources } from "../domain/mobileApplicationGraphProjection.js";
-import { err, ok, type Result } from "../domain/result.js";
-import { requestInputError } from "./workflowInputError.js";
-import { ArtifactInventoryCarrierError } from "../domain/artifactInventoryEvidence.js";
-
-interface InventoryProjectionInput {
- readonly inventory_evidence: readonly Evidence[];
- readonly limits?: unknown;
-}
+import type { JsonValue } from "../domain/jsonValue.js";
+import type { ParsedInventorySet } from "../domain/artifactInventoryEvidence.js";
+import { readApplicationInventoryProjection } from "../domain/mobileApplicationGraphProjection.js";
+import { ok, type Result } from "../domain/result.js";
interface InventoryProjectionResult {
readonly root_sha256: string;
@@ -31,86 +23,56 @@ export interface InventoryProjectionEvidenceResult {
}
interface InventoryProjectionOptions<
- Input extends InventoryProjectionInput,
- Output extends InventoryProjectionResult,
+ Output extends InventoryProjectionResult & JsonValue,
> {
readonly rawInput: unknown;
- readonly schema: z.ZodType;
readonly project: (
- input: Input,
- ) => MobileApplicationProjectionWithSources