Skip to content

Commit 4e2ee8a

Browse files
committed
[bug] Fixing docs and a few inconsistencies
1 parent 0ed866e commit 4e2ee8a

9 files changed

Lines changed: 377 additions & 257 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2026 opencode-agent-cooper contributors
3+
Copyright (c) 2026 opencode-fireman contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3742
That'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,"*
69106
not *"stop."*
70107

71108
How it works in detail, the test bench, and the design guarantees:

bench/README.md

Lines changed: 145 additions & 123 deletions
Large diffs are not rendered by default.

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)