Bonsai Demo
This report summarizes scanner evidence for PrismML-Eng/Bonsai-demo, a Shell project with 3,328 GitHub stars. SynthScan examined 22,359 lines of code across 156 source files, recording 155 pattern matches distributed across 10 syntactic categories. The legacy adjusted pattern signal is 12.2 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 86 finding(s).
Are imports declared and package/API names verified? 0 finding(s).
Are wrappers, guards, and repeated structures necessary? 120 finding(s).
Which changes need focused human review? 155 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 155 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | setup.sh | 151 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 153 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 157 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 159 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 243 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 245 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 254 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 256 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 261 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 263 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 270 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | setup.sh | 272 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 21 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 23 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 214 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 216 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 287 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 289 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 420 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | setup.sh | 422 | # ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/openwebui/make_demo_db.py | 62 | # ── customers ──────────────────────────────────────────────────────────────── | STRING |
| MEDIUM | scripts/openwebui/make_demo_db.py | 83 | # ── orders ─────────────────────────────────────────────────────────────────── | STRING |
| MEDIUM | scripts/openwebui/make_demo_db.py | 116 | # ── support tickets (spike for anchors in May-June 2025: v3 firmware) ──────── | STRING |
| MEDIUM | .github/workflows/manual-platform-smoke.yml | 83 | # ────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/manual-platform-smoke.yml | 85 | # ────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/manual-platform-smoke.yml | 376 | # ────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/manual-platform-smoke.yml | 378 | # ────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/build-from-source-smoke.yml | 47 | # ────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/build-from-source-smoke.yml | 49 | # ────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_seed_openwebui.py | 30 | def test_model_disables_openwebui_citation_rewrite(self): | CODE |
| LOW | tests/test_seed_openwebui.py | 49 | def test_prompt_is_generic_bounded_and_date_aware(self): | CODE |
| LOW | tests/test_seed_openwebui.py | 72 | def test_repo_owned_code_tool_is_attached_when_jupyter_is_on(self): | CODE |
| LOW | tests/test_tool_web_fetch.py | 60 | def test_prefers_article_and_returns_source_metadata(self): | CODE |
| LOW | tests/test_tool_web_fetch.py | 94 | def test_navigation_only_page_is_rejected_and_does_not_consume_quota(self): | STRING |
| LOW⚡ | tests/test_tool_web_fetch.py | 106 | def test_unreadable_page_releases_slot_for_a_retry(self): | STRING |
| LOW⚡ | tests/test_tool_web_fetch.py | 116 | def test_quota_reservations_include_parallel_inflight_calls(self): | STRING |
| LOW⚡ | tests/test_tool_web_fetch.py | 125 | def test_binary_content_is_rejected_without_consuming_quota(self): | STRING |
| LOW | tests/test_mlx_existing_server.py | 24 | def test_older_families_keep_reuse(self): | CODE |
| LOW⚡ | tests/test_mlx_setup_paths.py | 83 | def test_current_environment_skips_install(self): | STRING |
| LOW⚡ | tests/test_mlx_setup_paths.py | 88 | def test_legacy_families_still_require_metal(self): | STRING |
| LOW⚡ | tests/test_mlx_setup_paths.py | 96 | def test_all_installs_both_runtimes_with_metal(self): | STRING |
| LOW | tests/test_smoke_local_api.py | 37 | def test_http_error_body_status_and_timing_are_reported(self): | CODE |
| LOW | tests/test_smoke_local_api.py | 53 | def test_non_json_http_error_and_tokenize_request_are_recorded(self): | CODE |
| LOW | tests/test_smoke_local_api.py | 64 | def test_successful_http_request_retains_usage_and_timing(self): | CODE |
| LOW | tests/test_smoke_local_api.py | 81 | def test_transport_failure_records_timing_without_http_status(self): | CODE |
| LOW | tests/test_smoke_local_api.py | 91 | def test_failed_context_check_preserves_actual_answer(self): | CODE |
| LOW | tests/test_smoke_local_api.py | 102 | def test_retry_and_final_result(self): | CODE |
| LOW | tests/test_smoke_local_api.py | 106 | def test_no_tool_is_not_success(self): | CODE |
| LOW⚡ | tests/test_smoke_local_api.py | 118 | def test_unbounded_loop_is_stopped(self): | CODE |
| LOW⚡ | tests/test_smoke_local_api.py | 122 | def test_reasoning_only_is_failure(self): | CODE |
| LOW⚡ | tests/test_smoke_local_api.py | 131 | def test_truncated_response_is_failure(self): | CODE |
| LOW⚡ | tests/test_smoke_local_api.py | 137 | def test_cli_exit_and_no_overwrite(self): | CODE |
| LOW | tests/test_tool_code_interpreter.py | 15 | def test_progress_only_stderr_is_clean_success(self): | CODE |
| LOW | tests/test_tool_code_interpreter.py | 24 | def test_traceback_without_result_is_compact_error(self): | CODE |
| LOW | tests/test_tool_code_interpreter.py | 42 | def test_traceback_with_image_is_partial_success(self): | CODE |
| LOW | tests/test_tool_code_interpreter.py | 53 | def test_tool_description_is_generic_and_allows_api_discovery(self): | CODE |
| LOW | tests/test_tool_code_interpreter.py | 63 | def test_generated_image_is_attached_with_native_compatible_file_event(self): | CODE |
| LOW | tests/test_tool_code_interpreter.py | 85 | def test_generated_image_has_model_fallback_without_event_emitter(self): | CODE |
| LOW⚡ | tests/test_tool_code_interpreter.py | 99 | def test_non_image_result_is_preserved(self): | CODE |
| LOW⚡ | tests/test_tool_code_interpreter.py | 105 | def test_unrelated_error_does_not_receive_yfinance_advice(self): | CODE |
| LOW⚡ | tests/test_tool_code_interpreter.py | 115 | def test_nonfatal_warning_is_preserved_without_marking_failure(self): | CODE |
| LOW | tests/test_tool_sql.py | 17 | def test_description_names_dialect_and_common_date_trap(self): | CODE |
| LOW⚡ | tests/test_tool_sql.py | 43 | def test_leading_line_and_block_comments_are_allowed(self): | CODE |
| LOW⚡ | tests/test_tool_sql.py | 52 | def test_large_detailed_results_are_withheld(self): | CODE |
| LOW⚡ | tests/test_tool_sql.py | 61 | def test_small_results_include_completeness_marker(self): | CODE |
| LOW⚡ | tests/test_native_mlx_versions.py | 12 | def test_tested_versions_pass(self): | CODE |
| LOW⚡ | tests/test_native_mlx_versions.py | 16 | def test_old_importable_environment_is_rejected(self): | CODE |
| LOW⚡ | tests/test_native_mlx_versions.py | 22 | def test_missing_dependency_is_rejected(self): | CODE |
| LOW | scripts/openwebui/tool_code_interpreter.py | 80 | def _extract_artifact_markdown(result: str) -> str: | CODE |
| LOW | scripts/openwebui/tool_sql.py | 15 | def _without_leading_comments(sql: str) -> str: | CODE |
| LOW⚡ | scripts/agent/test_runner_safety.py | 57 | def test_existing_workspace_is_preserved(self): | STRING |
| LOW⚡ | scripts/agent/test_runner_safety.py | 66 | def test_dangling_workspace_symlink_is_preserved(self): | STRING |
| LOW⚡ | scripts/agent/test_runner_safety.py | 74 | def test_missing_task_leaves_no_run_state(self): | STRING |
| LOW⚡ | scripts/agent/test_runner_safety.py | 81 | def test_missing_feedback_workspace_leaves_no_run_state(self): | STRING |
| LOW⚡ | scripts/agent/test_runner_safety.py | 88 | def test_relative_workspace_root_is_rejected_before_creation(self): | STRING |
| LOW⚡ | scripts/agent/test_runner_safety.py | 95 | def test_workspace_created_after_precheck_is_preserved(self): | STRING |
| LOW⚡ | scripts/agent/test_runner_safety.py | 102 | def test_existing_custom_home_is_preserved(self): | STRING |
| LOW | scripts/agent/test_runner_safety.py | 113 | def test_fresh_workspace_with_spaces_reaches_mock_launch(self): | STRING |
| LOW | scripts/agent/test_runner_safety.py | 127 | def test_failed_launch_removes_everything_it_created(self): | STRING |
| LOW | scripts/agent/test_runner_safety.py | 143 | def test_trace_injection_uses_runner_values(self): | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/common.sh | 345 | except Exception: | CODE |
| LOW | scripts/smoke_local_api.py | 48 | except Exception as error: | CODE |
| LOW | scripts/smoke_local_api.py | 150 | except Exception as error: | CODE |
| LOW | scripts/openwebui/tool_code_interpreter.py | 113 | except Exception: | CODE |
| LOW | scripts/openwebui/tool_code_interpreter.py | 212 | except Exception as exc: | CODE |
| LOW | scripts/openwebui/tool_sql.py | 81 | except Exception as e: | CODE |
| LOW | scripts/openwebui/tool_weather.py | 51 | except Exception as e: | CODE |
| LOW | scripts/openwebui/tool_web_fetch.py | 333 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 129 | except Exception: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 138 | except Exception: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 154 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 185 | except Exception as e2: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 187 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 261 | except Exception as e2: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 263 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 288 | except Exception: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 302 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 310 | except Exception: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 323 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 333 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 345 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 371 | except Exception as e: | CODE |
| LOW | scripts/openwebui/seed_openwebui.py | 412 | except Exception as e: # never fail the launcher | CODE |
| LOW | scripts/agent/logproxy.py | 24 | except Exception: | CODE |
| LOW | scripts/agent/logproxy.py | 32 | except Exception: continue | CODE |
| LOW | scripts/agent/logproxy.py | 63 | except Exception as e: sys.stderr.write("logproxy: bad INJECT_BODY (%r)\n" % (e,)) | CODE |
| LOW | scripts/agent/logproxy.py | 77 | except Exception as e: | CODE |
| LOW⚡ | scripts/agent/logproxy.py | 96 | except Exception as _e: | CODE |
| LOW⚡ | scripts/agent/logproxy.py | 103 | except Exception: pass | CODE |
| LOW⚡ | scripts/agent/logproxy.py | 108 | except Exception as _e: sys.stderr.write("inject body failed: %r\n"%(_e,)) | CODE |
| LOW⚡ | scripts/agent/logproxy.py | 150 | except Exception: pass | CODE |
| LOW⚡ | scripts/agent/logproxy.py | 157 | except Exception as _e: | CODE |
| LOW⚡ | scripts/agent/logproxy.py | 167 | except Exception: pass | CODE |
| LOW | scripts/agent/logproxy.py | 181 | except Exception: pass | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | scripts/openwebui/tool_code_interpreter.py | 113 | except Exception: | CODE |
| HIGH | scripts/agent/logproxy.py | 24 | except Exception: | CODE |
| HIGH | scripts/agent/logproxy.py | 103 | except Exception: pass | CODE |
| HIGH | scripts/agent/logproxy.py | 181 | except Exception: pass | CODE |
| HIGH | scripts/agent/logproxy.py | 167 | except Exception: pass | CODE |
| HIGH | scripts/agent/logproxy.py | 150 | except Exception: pass | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | OPENWEBUI.md | 1 | # Open WebUI: the full agentic demo | COMMENT |
| MEDIUM | README.md | 328 | ## Open WebUI (Optional): the full agentic demo | COMMENT |
| MEDIUM | README.md | 456 | ├── OPENWEBUI.md # Open WebUI agentic demo guide | CODE |
| MEDIUM | TOOLS.md | 60 | The built-in UI (http://localhost:8080) has an MCP client with an agentic loop. | CODE |
| MEDIUM | scripts/start_openwebui.sh | 333 | # generous-but-finite 30: enough for the agentic DB-analyst scenario | COMMENT |
| MEDIUM | scripts/start_agent_server.sh | 2 | # Start llama-server with the "agent profile": the settings the Bonsai 2 agentic demo (AGENT-DEMO.md) | COMMENT |
| MEDIUM | scripts/start_llama_server.sh | 132 | # by default and lives on this standalone server, not the agentic Open WebUI | COMMENT |
| MEDIUM | scripts/openwebui/seed_openwebui.py | 225 | # RAG citation template after fetch_url calls. That conflicts with | COMMENT |
| MEDIUM | scripts/openwebui/seed_openwebui.py | 398 | # Hide backend helper models (e.g. mlx-vlm's embedding model) from the picker. | COMMENT |
| MEDIUM | scripts/agent/run_agent_demo.sh | 2 | # Run one round of the Bonsai 2 agentic demo (AGENT-DEMO.md) against a running llama-server. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/common.sh | 1 | #!/bin/sh | COMMENT |
| LOW | scripts/common.sh | 121 | COMMENT | |
| LOW | scripts/common.sh | 181 | bonsai_mlx_present | COMMENT |
| LOW | scripts/common.sh | 241 | # We deliberately do NOT use llama.cpp's -c 0: that means "use the model's full | COMMENT |
| LOW | scripts/fetch_gguf.sh | 1 | #!/bin/sh | COMMENT |
| LOW | scripts/start_openwebui.sh | 321 | export ENABLE_RAG_WEB_SEARCH=false | COMMENT |
| LOW | scripts/start_agent_server.sh | 1 | #!/bin/sh | COMMENT |
| LOW | scripts/make_kv_bias.sh | 1 | #!/bin/sh | COMMENT |
| LOW | scripts/download_models.sh | 1 | #!/bin/sh | COMMENT |
| LOW | scripts/build_cuda_linux.sh | 1 | #!/bin/bash | COMMENT |
| LOW | scripts/openwebui/seed_openwebui.py | 221 | "vision": vision, | COMMENT |
| LOW | scripts/agent/run_agent_demo.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | scripts/agent/run_agent_demo.sh | 21 | # AGENT_WORKSPACE_ROOT absolute workspace root (default: bonsai-agent under the system temp directory) | COMMENT |
| LOW | demos/skateboard/skate-rush/pages/round1.html | 21 | #combo.show{opacity:1} | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.sh | 5 | # Usage: | COMMENT |
| LOW | scripts/fetch_gguf.sh | 5 | # Usage: | COMMENT |
| LOW | scripts/make_kv_bias.sh | 7 | # Usage: | COMMENT |
| LOW | scripts/download_models.sh | 4 | # Usage: | COMMENT |
| LOW | scripts/build_cuda_linux.sh | 6 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/common.sh | 6 | # Set BONSAI_MODEL to choose size: 27B (default), 8B, 4B, 1.7B, or all | COMMENT |
| LOW | scripts/common.sh | 7 | # Set BONSAI_FAMILY to choose family: bonsai2 (default), ternary, bonsai (1-bit), or all | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/openwebui/tool_web_fetch.py | 257 | CODE | |
| LOW | scripts/openwebui/tool_web_fetch.py | 279 | CODE | |
| LOW | scripts/agent/logproxy.py | 83 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | scripts/agent/test_runner_safety.py | 51 | def run_task(self, task=None, mode_args=None): | STRING |