@@ -21,27 +21,61 @@ ships silently and surfaces weeks later.
2121
2222## What Fireman does
2323
24- When your agent reads a TypeScript file, Fireman checks whether any
25- function diverges structurally from its near-twins — for example, it sorts
26- where its lookalikes don't. If so, it appends a short note to what the
27- agent reads, ** before** it plans an edit:
24+ When your agent reads a source file in a supported language, Fireman
25+ checks whether any function diverges structurally from its near-twins —
26+ siblings in the same directory or same-basename files across the package.
27+ If so, it appends a short note to what the agent reads, ** before** it
28+ plans an edit:
2829
2930```
3031<fireman>
31- ⚠ Fireman: audit-serializer.ts:13-29 — serializeAudit sorts keys; 2 similar
32- sibling functions do not. This asymmetry may be load-bearing (signature
33- stability, wire-format determinism). Verify before deduplicating.
32+ ⚠ Fireman: this file contains region(s) whose meaning depends on
33+ context outside the local function body (sibling/cross-file asymmetry,
34+ or imports from a compatibility path). The signals may encode an
35+ invariant — verify before editing:
36+ - audit-serializer.ts:13-29 [extra-call, conf=0.85]: createAuditRecord
37+ has 2 extra call(s) vs 2 consensus siblings. This asymmetry may be
38+ load-bearing; verify before unifying.
3439</fireman>
3540```
3641
3742That's it. The agent gets a heads-up and decides for itself.
3843
44+ ## Supported languages
45+
46+ TypeScript, JavaScript, Python, Java, C, C++, Scala, and PHP — via
47+ [ tree-sitter] ( https://tree-sitter.github.io/ ) language grammars with
48+ dedicated adapters per language family. Unsupported file extensions are
49+ silently skipped (zero findings, zero overhead).
50+
51+ ## Two detectors
52+
53+ 1 . ** Structural asymmetry** — Fireman builds normalised ASTs for every
54+ function in the file and its directory/cross-file siblings, forms
55+ twin families via MinHash/Jaccard similarity, then characterises each
56+ family's divergent member by shape (extra-call, extra-branch,
57+ label-divergence, etc.) and data-flow critical-path analysis.
58+
59+ 2 . ** Compat-shim imports** — Fireman scans for import-like statements
60+ whose paths contain markers like ` legacy ` , ` compat ` , ` polyfill ` ,
61+ ` deprecated ` , ` shim ` , ` backport ` , or versioned segments (` v1 ` , ` v2 ` ).
62+ These imports signal explicit bridges to non-canonical implementations.
63+
64+ Both detectors point at things outside the local function body:
65+ divergence from non-local twins, and explicit bridges to non-canonical
66+ code. Either way, "edit only this function" is unsafe advice.
67+
3968## Safe by design
4069
4170- ** Never edits your files** — it only annotates what the agent reads.
4271- ** Never blocks a tool call** — a warning, not a gate.
43- - ** Fast** — budgeted at ≤400 ms per file, with a hard timeout.
44- - ** Quiet** — ≤80 tokens per warning, no LLM calls, no network.
72+ - ** Hard timeout** — 3000 ms per file, wrapped in ` Promise.race ` .
73+ - ** Bounded output** — max 3 findings per warning.
74+ - ** No network** — all analysis is local; no LLM calls in the hot path.
75+ - ** Plugin-compatible** — tested alongside
76+ [ caveman] ( https://github.com/JuliusBrussee/caveman ) and
77+ [ oh-my-opencode] ( https://github.com/code-yeongyu/oh-my-opencode ) .
78+ See [ PLUGIN_COMPATIBILITY.md] ( ./PLUGIN_COMPATIBILITY.md ) .
4579
4680## Install
4781
@@ -63,9 +97,12 @@ project, put the same two files under `~/.config/opencode/` instead.
6397
6498## Good to know
6599
66- TypeScript / TSX only, and v0.1 ships a single detector (a function that
67- sorts where its siblings don't). Fireman is a heuristic — it can miss, and
68- it can occasionally over-warn. Treat a warning as * "look before you leap,"*
100+ v0.0.1 ships two detectors across 8 languages with a 105-case test
101+ bench (75 traps + 30 controls) covering TypeScript, JavaScript, Python,
102+ Java, C, C++, and PHP — including 10 cases from 7 hardware-accelerator
103+ ecosystems (NVIDIA CUDA, AMD HIP, Intel SYCL, Google TFLite, Huawei
104+ Ascend, Qualcomm SNPE). Fireman is a heuristic — it can miss, and it
105+ can occasionally over-warn. Treat a warning as * "look before you leap,"*
69106not * "stop."*
70107
71108How it works in detail, the test bench, and the design guarantees:
0 commit comments