TypeScript v2 Functions CI: local SDK generation resolves Global Branch and object import, then OntologiesV2.get returns OntologyNotFound

Hello,

We are seeing a reproducible failure while building TypeScript v2 Functions repositories that use a local Ontology SDK and Global Branching. We’re hoping someone else has run into the same issue and have successfully debugged it.

Configuration

  • TypeScript v2 Functions repository.
  • Local SDK enabled with useSdkSidebar: false.
  • File-based imports through typescript-functions/resources.json.
  • One imported object type.
  • Active Global Branch.
  • Nonproduction Ontology with an inherited organization marking.
  • No external sources, models, Actions, publications, or production data.

Reproduction

We reproduced the behavior in two independent repositories: an existing repository containing application logic and two object imports, and a newly created minimal repository using the standard TypeScript v2 template, one object import, and this read-only function:

import { Osdk } from "@osdk/client";
import { SyntheticObject } from "@ontology/sdk";

export default function sdkBranchSmokeTest(
  object: Osdk.Instance<SyntheticObject>,
): string {
  return object.primaryKey;
}

In both repositories:

  • Resource validation succeeds.
  • Interactive SDK refresh succeeds.
  • CI selects file-based imports and loads resources.json.
  • CI discovers the Ontology and imported object.
  • The Global Branch and Ontology branch resolve.
  • The expected root Ontology identifier is loaded.
  • The imported object API name resolves.
  • SDK generation starts.

CI then fails before compilation or tests:

OntologyMetadataResolver.getWireOntologyDefinition
  -> OntologiesV2.get(CI context, root Ontology RID)
  -> HTTP 404 OntologyNotFound

The same operation fails in both repositories. Interactive SDK refresh against the same branch succeeds.

Questions

  1. Is the unbranched root-Ontology lookup during local SDK generation expected after the Ontology branch has already resolved?
  2. Are organization-marked Ontologies expected to require an additional entitlement or marking assignment for the Functions/Jemma CI principal?
  3. Should file-based object imports automatically propagate the root-Ontology scope to the build token?
  4. Is there a known issue where branch/object resolution succeeds but OntologiesV2.get under the CI context returns a security-filtered 404?
  5. Which platform audit event or administrator-visible access decision should be inspected to distinguish a missing marking from an SDK-generator defect?

We intentionally have not changed markings or permissions and cannot inject production data for comparison. If anyone has any ideas/fixes, we sure could use the help!