Repository Analysis

microsoft/TypeChat

TypeChat is a library that makes it easy to build natural language interfaces using types.

6.9 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of microsoft/TypeChat, a TypeScript project with 8,676 GitHub stars. SynthScan v2.0 examined 21,365 lines of code across 244 source files, recording 113 pattern matches distributed across 13 syntactic categories. The overall adjusted score of 6.9 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

6.9
Adjusted Score
6.9
Raw Score
100%
Time Factor
2026-08-02
Last Push
8.7K
Stars
TypeScript
Language
21.4K
Lines of Code
244
Files
113
Pattern Hits
2026-08-02
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 3MEDIUM 8LOW 102

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 113 distinct pattern matches across 13 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers36 hits · 38 pts
SeverityFileLineSnippetContext
LOWpython/tests/test_translator.py41def test_translator_with_immediate_pass(snapshot: Any):CODE
LOWpython/tests/test_translator.py50def test_translator_with_single_failure(snapshot: Any):CODE
LOWpython/tests/test_translator.py60def test_translator_with_invalid_json(snapshot: Any):CODE
LOWpython/tests/test_translator.py70def test_translator_with_single_failure_and_str_preamble(snapshot: Any):CODE
LOWpython/tests/test_model.py35def test_reads_response_within_size_limit():CODE
LOWpython/tests/test_model.py45def test_rejects_oversized_response_via_content_length():CODE
LOWpython/tests/test_model.py57def test_rejects_oversized_streamed_response_without_content_length():CODE
LOWpython/tests/test_model.py73def test_size_limit_disabled_allows_large_response():CODE
LOWpython/tests/test_abstract_collections.py26def test_abstract_collections(snapshot: Any):CODE
LOWpython/tests/test_validator.py13def test_dict_valid_as_dataclass():CODE
LOWpython/examples/music/client.py96def get_tracks_from_result_list(resultItems: list[Any]) -> list[SimplifiedTrackInfo]:CODE
LOWpython/examples/music/client.py149def update_track_list_and_print(tracks: list[SimplifiedTrackInfo], context: ClientContext):CODE
LOWpython/examples/music/client.py154async def get_current_users_playlists(context: ClientContext) -> list[SimplifiedPlaylistInfo]:CODE
LOWpython/examples/music/spotipyWrapper.py110 async def current_user_unfollow_playlist(self, playlist_id: str) -> None:CODE
LOWpython/examples/multiSchema/agents.py55 async def _handle_json_program_call(self, func: str, args: Sequence[object]) -> int | float:CODE
LOWpython/src/typechat/_internal/model.py193def create_openai_language_model(api_key: str, model: str, endpoint: str = "https://api.openai.com/v1/chat/completions",CODE
LOWpython/src/typechat/_internal/model.py212def create_azure_openai_language_model(api_key: str, endpoint: str) -> HttpxLanguageModel:CODE
LOWpython/src/typechat/_internal/ts_conversion/__init__.py23def python_type_to_typescript_schema(py_type: type | TypeAliasType) -> TypeScriptSchemaConversionResult:CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py156def python_type_to_typescript_nodes(root_py_type: object) -> TypeScriptNodeTranslationResult:CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py175 def convert_to_type_reference_node(py_type: TypeReferenceTarget) -> TypeNode:CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py193 def generic_alias_to_type_reference(py_type: GenericAliasish) -> TypeReferenceNode:CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py200 def convert_literal_type_arg_to_type_node(py_type: object) -> TypeNode:CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py420 def attribute_identical_in_all_bases(attr_name: str, type_hint: object, base_attributes: dict[str, set[object]]) -> CODE
LOWtypescript/examples/crossword/src/translator.ts56 function getScreenshotPromptSection(screenshot: string | undefined) {CODE
LOWtypescript/src/model.ts192export function createOpenAILanguageModel(apiKey: string, model: string, endPoint = "https://api.openai.com/v1/chat/compCODE
LOWtypescript/src/model.ts213export function createAzureOpenAILanguageModel(apiKey: string, endPoint: string, options?: LanguageModelOptions): TypeChCODE
LOWtypescript/src/model.ts333function createResponsesFetchLanguageModel(url: string, headers: object, defaultParams: object, proxy?: ProxySettings) {CODE
LOWtypescript/src/model.ts601function missingEnvironmentVariable(name: string): never {CODE
LOWtypescript/src/zod/validate.ts219 function appendUnionOrIntersectionTypes(types: readonly z.ZodType[], minPrecedence: TypePrecedence) {CODE
LOWtypescript/src/ts/program.ts99export function createModuleTextFromProgram(jsonObject: object): Result<string> {CODE
LOWtypescript/src/ts/validate.ts82 function expandMissingPropertiesMessage(checker: ts.TypeChecker, file: ts.SourceFile, position: number): string | unCODE
LOWtypescript/src/ts/validate.ts112 function createProgramFromModuleText(moduleText: string, oldProgram?: ts.Program) {CODE
LOWsite/src/docs/python/basic-usage.md72def create_openai_language_model(CODE
LOWsite/src/docs/python/basic-usage.md80def create_azure_openai_language_model(api_key: str, endpoint: str): ...CODE
LOWsite/src/docs/typescript/basic-usage.md71export function createOpenAILanguageModel(apiKey: string, model: string, endPoint? string): TypeChatLanguageModel;CODE
LOWsite/src/docs/typescript/basic-usage.md73export function createAzureOpenAILanguageModel(apiKey: string, endPoint: string): TypeChatLanguageModel;CODE
Decorative Section Separators6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMpython/examples/healthData/input.txt8# ================COMMENT
MEDIUMpython/examples/healthData/input.txt10# ================COMMENT
MEDIUMtypescript/examples/healthData/src/input.txt8# ================COMMENT
MEDIUMtypescript/examples/healthData/src/input.txt10# ================COMMENT
MEDIUM.github/workflows/fix-dependabot-alerts.yml125 # ── Final clean build verification ──────────────────────────────COMMENT
MEDIUM.github/workflows/fix-dependabot-alerts.yml150 # ── Create PR ───────────────────────────────────────────────────COMMENT
Deep Nesting17 hits · 17 pts
SeverityFileLineSnippetContext
LOWpython/examples/music/client.py186CODE
LOWpython/examples/music/demo.py10CODE
LOWpython/examples/music/demo.py17CODE
LOWpython/examples/restaurant/demo.py8CODE
LOWpython/examples/restaurant/demo.py14CODE
LOWpython/examples/drawing/demo.py20CODE
LOWpython/examples/drawing/demo.py35CODE
LOWpython/examples/coffeeShop/demo.py10CODE
LOWpython/examples/coffeeShop/demo.py17CODE
LOWpython/examples/calendar/demo.py9CODE
LOWpython/examples/calendar/demo.py15CODE
LOWpython/src/typechat/_internal/interactive.py3CODE
LOWpython/src/typechat/_internal/translator.py52CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py156CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py211CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py296CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py345CODE
Structural Annotation Overuse11 hits · 16 pts
SeverityFileLineSnippetContext
LOWpython/examples/README.md22## Step 1: Configure your development environmentCOMMENT
LOWpython/examples/README.md76## Step 2: Configure environment variablesCOMMENT
LOWpython/examples/README.md107## Step 3: Run the examplesCOMMENT
LOWtypescript/examples/README.md21## Step 1: Configure your development environmentCOMMENT
LOWtypescript/examples/README.md56## Step 2: Build TypeChat SamplesCOMMENT
LOWtypescript/examples/README.md64## Step 3: Configure environment variablesCOMMENT
LOWtypescript/examples/README.md114## Step 4: Run the examplesCOMMENT
LOWsite/src/docs/examples.md23## Step 1: Configure development environmentCOMMENT
LOWsite/src/docs/examples.md58## Step 2: Build TypeChat ExamplesCOMMENT
LOWsite/src/docs/examples.md66## Step 3: Configure environment variablesCOMMENT
LOWsite/src/docs/examples.md95## Step 4: Run the examplesCOMMENT
Unused Imports16 hits · 16 pts
SeverityFileLineSnippetContext
LOWpython/examples/math/program.py1CODE
LOWpython/src/typechat/__init__.py5CODE
LOWpython/src/typechat/__init__.py5CODE
LOWpython/src/typechat/__init__.py5CODE
LOWpython/src/typechat/__init__.py5CODE
LOWpython/src/typechat/__init__.py5CODE
LOWpython/src/typechat/__init__.py6CODE
LOWpython/src/typechat/__init__.py6CODE
LOWpython/src/typechat/__init__.py6CODE
LOWpython/src/typechat/__init__.py7CODE
LOWpython/src/typechat/__init__.py8CODE
LOWpython/src/typechat/__init__.py9CODE
LOWpython/src/typechat/__init__.py10CODE
LOWpython/src/typechat/_internal/interactive.py25CODE
LOW…/src/typechat/_internal/ts_conversion/ts_type_nodes.py1CODE
LOW…hat/_internal/ts_conversion/python_type_to_ts_nodes.py1CODE
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHpython/examples/math/program.py0the following is the user request translated into a json object with 2 spaces of indentation and no properties with the STRING
HIGHpython/examples/healthData/translator.py0the following is the user request translated into a json object with 2 spaces of indentation and no properties with the STRING
HIGHpython/src/typechat/_internal/translator.py0the following is the user request translated into a json object with 2 spaces of indentation and no properties with the STRING
Over-Commented Block10 hits · 10 pts
SeverityFileLineSnippetContext
LOWpython/tests/__init__.py1# SPDX-FileCopyrightText: Microsoft CorporationCOMMENT
LOW…pshots__/test_tuple_errors_1/test_tuples_2.schema.d.ts1// Entry point is: 'TupleContainer'COMMENT
LOWpython/examples/healthData/input.txt1#COMMENT
LOWpython/src/typechat/__about__.py1# SPDX-FileCopyrightText: Microsoft CorporationCOMMENT
LOWtypescript/examples/music/src/chatifyActionsSchema.ts21 // show now playingCOMMENT
LOWtypescript/examples/music/src/chatifyActionsSchema.ts41 setVolume(newVolumeLevel: number): void;COMMENT
LOWtypescript/examples/healthData/src/input.txt1#COMMENT
LOW.github/dependabot.yml1# Dependabot configuration for microsoft/TypeChat.COMMENT
LOW.github/workflows/fix-dependabot-alerts.yml1# Copyright (c) Microsoft Corporation.COMMENT
LOW.github/workflows/fix-dependabot-alerts.yml121 # cache key. The restore step uses a shared prefix so anyCOMMENT
Excessive Try-Catch Wrapping5 hits · 6 pts
SeverityFileLineSnippetContext
LOWpython/examples/music/demo.py27 except Exception as error:CODE
LOWpython/examples/multiSchema/agents.py123 except Exception as error:CODE
LOWpython/src/typechat/_internal/model.py107 except Exception as e:CODE
LOWpython/src/typechat/_internal/model.py152 except Exception:CODE
MEDIUMpython/src/typechat/_internal/model.py149def __del__(self):CODE
Overly Generic Function Names4 hits · 4 pts
SeverityFileLineSnippetContext
LOWpython/tests/test_dataclasses.py25 def do_something(self):CODE
LOWpython/examples/multiSchema/agents.py37 async def handle_request(self, line: str):CODE
LOWpython/examples/multiSchema/agents.py80 async def handle_request(self, line: str):CODE
LOWpython/examples/multiSchema/agents.py108 async def handle_request(self, line: str):CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/fix-dependabot-alerts.yml244 # Create the new PR FIRST, capture its number, THEN closeCOMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpython/src/typechat/__init__.py12__all__ = [CODE
LOWpython/src/typechat/_internal/ts_conversion/__init__.py7__all__ = [CODE
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWpython/examples/math/program.py108 # For now, we just pass in `Any` in place of `JsonProgram`.COMMENT
AI Structural Patterns1 hit · 1 pts
SeverityFileLineSnippetContext
LOWpython/examples/music/client.py68CODE