Repository Analysis

cactus-compute/needle

14MB foundation model for tiny devices; phones, wearables, smart home, and robots.

11.1 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of cactus-compute/needle, a Python project with 4,725 GitHub stars. SynthScan v2.0 examined 5,644 lines of code across 31 source files, recording 59 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 11.1 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).

11.1
Adjusted Score
11.1
Raw Score
100%
Time Factor
2026-08-13
Last Push
4.7K
Stars
Python
Language
5.6K
Lines of Code
31
Files
59
Pattern Hits
2026-08-13
Scan Date
0.00
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 0MEDIUM 2LOW 57

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 59 distinct pattern matches across 6 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 Identifiers32 hits · 34 pts
SeverityFileLineSnippetContext
LOWneedle/model/quantize.py70def quantize_params_configured(params):CODE
LOWneedle/model/tokenizer.py82def _download_tokenizer_from_hf(prefix):CODE
LOWtests/test_inference.py21def test_structured_extraction():CODE
LOWtests/test_inference.py72def test_extract_keeps_agent_tools():CODE
LOWtests/test_generate.py7def test_parse_array_variants():CODE
LOWtests/test_generate.py19def test_collect_tools_dedups_by_name():CODE
LOWtests/test_generate.py27def test_generate_examples_attaches_tools(monkeypatch):CODE
LOWtests/test_generate.py39def test_generate_examples_requires_api_key(monkeypatch):CODE
LOWtests/test_generate.py47def test_openrouter_url_can_be_overridden_from_environment(monkeypatch):CODE
LOWtests/test_generate.py71def test_generate_dataset_hits_target_concurrently(monkeypatch):CODE
LOWtests/test_generate.py81def test_generate_dataset_dedups_and_terminates(monkeypatch):CODE
LOWtests/test_generate.py91def test_augment_jsonl_appends_generated(monkeypatch, tmp_path):CODE
LOWtests/test_build.py14def test_build_exports_loadable_cact(tiny_checkpoint, tmp_path):CODE
LOWtests/test_build.py39def test_export_round_trips_a_projection(tiny_checkpoint, tmp_path):CODE
LOWtests/test_finetune.py34def test_finetune_writes_adapter(tiny_checkpoint, tmp_path):CODE
LOWtests/test_finetune.py56def test_finetune_then_build_merges(tiny_checkpoint, tmp_path):CODE
LOWtests/test_render.py13def test_render_example_markers():CODE
LOWtests/test_render.py30def test_render_example_accepts_function_calls_alias():CODE
LOWtests/test_render.py38def test_encode_loss_mask_targets_only(tok):CODE
LOWtests/test_render.py55def test_load_jsonl_shapes_and_skips_invalid(tok, tmp_path):CODE
LOWtests/test_tools.py13def test_basic_schema_types_and_required():CODE
LOWtests/test_tools.py26def test_defaults_are_optional():CODE
LOWtests/test_tools.py35def test_literal_list_and_dict_types():CODE
LOWtests/test_tools.py53def test_optional_annotation_not_required():CODE
LOWtests/test_tools.py86def test_field_constraints_and_docstring_args():CODE
LOWtests/test_tools.py105def test_docstring_description_falls_back_to_args():CODE
LOWtests/test_tools.py117def test_pydantic_model_schema():CODE
LOWtests/test_tools.py133def test_tool_decorator_preserves_callable():CODE
LOWtests/test_lora.py4def test_lora_target_paths_selects_projection_kernels():CODE
LOWtests/test_lora.py20def test_init_lora_shapes_and_zero_b():CODE
LOWtests/test_lora.py34def test_merge_lora_is_identity_when_b_zero():CODE
LOWtests/test_lora.py48def test_merge_lora_adds_scaled_delta():CODE
Excessive Try-Catch Wrapping11 hits · 13 pts
SeverityFileLineSnippetContext
LOWneedle/__init__.py114 except Exception as exc:CODE
LOWneedle/cli.py43 except Exception:CODE
LOWneedle/cli.py84 except Exception:CODE
LOWneedle/playground/server.py94 except Exception as exc:CODE
LOWneedle/playground/server.py169 except Exception as exc:CODE
MEDIUMneedle/playground/server.py133def do_POST(self):CODE
LOWneedle/agent/tools.py114 except Exception:CODE
LOWneedle/model/tokenizer.py108 except Exception as e:CODE
LOWneedle/model/finetune.py124 except Exception as exc:CODE
LOWtests/conftest.py16 except Exception:CODE
MEDIUMtests/conftest.py7def _engine_available():CODE
Deep Nesting9 hits · 9 pts
SeverityFileLineSnippetContext
LOWneedle/__init__.py78CODE
LOWneedle/cli.py18CODE
LOWneedle/cli.py97CODE
LOWneedle/cli.py54CODE
LOWneedle/playground/server.py114CODE
LOWneedle/playground/server.py133CODE
LOWneedle/model/export.py317CODE
LOWneedle/model/export.py396CODE
LOWneedle/model/finetune.py92CODE
Unused Imports5 hits · 5 pts
SeverityFileLineSnippetContext
LOWneedle/__init__.py4CODE
LOWneedle/__init__.py6CODE
LOWneedle/__init__.py6CODE
LOWneedle/model/quantize.py2CODE
LOWneedle/model/export.py84CODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWneedle/__init__.py9__all__ = ["Needle", "tool", "Field", "extract", "__version__"]CODE
AI Structural Patterns1 hit · 1 pts
SeverityFileLineSnippetContext
LOWneedle/agent/tools.py18CODE