flamerjs 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +141 -0
- package/dist/cli.js +8 -1
- package/docs/ARCHITECTURE.md +175 -0
- package/package.json +8 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to flamer are recorded here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
|
|
5
|
+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [1.0.0] - 2026-10-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Rust and C++ native workers under `native/core` for coordinated native
|
|
12
|
+
processing.
|
|
13
|
+
- Versioned JSONL worker protocol with TypeScript integration through
|
|
14
|
+
`--engine all|typescript|rust|cpp`.
|
|
15
|
+
- Dedicated native Rust and C++ build/test workflows.
|
|
16
|
+
- Architecture documentation covering runtime layers, protocol, and fallback
|
|
17
|
+
behavior.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Native execution failures are explicit for targeted workers and safely fall
|
|
22
|
+
back to TypeScript in the default `all` mode.
|
|
23
|
+
|
|
24
|
+
## [1.1.1] - 2026-10-24
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Align the main npm package and native worker package versions.
|
|
29
|
+
- Publish all supported Linux, macOS, and Windows x64/arm64 native packages.
|
|
30
|
+
- Include the changelog and architecture documentation in the npm tarball.
|
|
31
|
+
|
|
32
|
+
## [1.1.0] - 2026-10-24
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Optional platform-specific npm packages containing both native workers.
|
|
37
|
+
- Release automation for Linux x64, macOS x64/arm64, and Windows x64 native
|
|
38
|
+
packages.
|
|
39
|
+
- A native package builder and explicit Rust/C++ build-phase output.
|
|
40
|
+
- `scripts/install.sh` with npm installation and guarded native release-asset
|
|
41
|
+
installation paths.
|
|
42
|
+
- The default `flamer .` execution coordinates TypeScript, Rust, and C++
|
|
43
|
+
together, with pure TypeScript fallback when native workers are unavailable.
|
|
44
|
+
- Rust owns shared file metrics and Rust-specific checks; C++ owns C/C++-specific
|
|
45
|
+
checks, so the workers no longer perform the same analysis.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- CI now builds before tests that execute the bundled CLI.
|
|
50
|
+
- Node 18 builds use a compatible pinned tsup release.
|
|
51
|
+
- Conventional Commit validation accepts the `ci` type.
|
|
52
|
+
|
|
53
|
+
- Dedicated Codecov coverage reporting and CodeQL analysis workflows.
|
|
54
|
+
|
|
55
|
+
## [0.1.6] - 2026-10-24
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- Updated the README Quick Start to use the published `flamerjs` package with
|
|
60
|
+
`npx`, local installation, and global installation examples.
|
|
61
|
+
- Updated CLI examples to use the published `flamerjs` command while retaining
|
|
62
|
+
the source checkout workflow for contributors.
|
|
63
|
+
|
|
64
|
+
## [0.1.5] - 2026-10-24
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
68
|
+
- Human-readable terminal output is now the default CLI mode, with severity
|
|
69
|
+
grouping, clean scan summaries, and TTY-aware ANSI colors.
|
|
70
|
+
- `--color` and `--no-color` flags for controlling terminal colors.
|
|
71
|
+
- High-confidence detection for explicit not-implemented errors and empty
|
|
72
|
+
error handlers.
|
|
73
|
+
- npm packaging metadata, a `flamerjs` command alias, and automated publishing
|
|
74
|
+
to npm and GitHub Packages on version tags.
|
|
75
|
+
|
|
76
|
+
### Fixed
|
|
77
|
+
|
|
78
|
+
- README and CI test-count checks now follow the current TypeScript test suite.
|
|
79
|
+
- CLI, contributor, and agent documentation now matches the `src/` and `dist/`
|
|
80
|
+
project layout.
|
|
81
|
+
|
|
82
|
+
### Removed
|
|
83
|
+
|
|
84
|
+
- Bun as a project development dependency and lockfile.
|
|
85
|
+
- JSON as the default interactive output mode; JSON remains available with
|
|
86
|
+
`--format json`.
|
|
87
|
+
|
|
88
|
+
## [0.1.0] - 2026-10-02
|
|
89
|
+
|
|
90
|
+
First public release.
|
|
91
|
+
|
|
92
|
+
### Added
|
|
93
|
+
|
|
94
|
+
- Single-pass tree scanner covering 25 languages across 70 file extensions:
|
|
95
|
+
JavaScript, TypeScript, Python, Rust, Go, C, C++, C#, Java, Kotlin, Scala,
|
|
96
|
+
Terraform, HCL, Docker, SQL, Ruby, PHP, Shell, PowerShell, Haskell, Elixir,
|
|
97
|
+
Lua, R, Solidity, Swift, Dart, Zig, and Jupyter notebooks.
|
|
98
|
+
- Eight analyzers, each isolated so one throwing does not stop the rest:
|
|
99
|
+
`universal`, `notebooks`, `scaffolding`, `testing`, `git`, `node`, `python`,
|
|
100
|
+
`systems`.
|
|
101
|
+
- Redacted credential detection for 14 credential shapes, with test and fixture
|
|
102
|
+
paths exempt so a repository's own fake secrets are not reported.
|
|
103
|
+
- Adaptive bloat detection with per-language baselines, so a large generated
|
|
104
|
+
file is not scored as though a human wrote every line.
|
|
105
|
+
- Per-language test coverage ratios, so a mostly-Terraform repository is not
|
|
106
|
+
graded as though it were all application code.
|
|
107
|
+
- The roast persona in `SKILL.md`, including a confirmation gate, an audit mode
|
|
108
|
+
that drops the character, and an instruction to defer deep security analysis
|
|
109
|
+
to the `poison` skill when it is installed.
|
|
110
|
+
- JSON output by default with a human-readable `--format summary`.
|
|
111
|
+
|
|
112
|
+
### Performance
|
|
113
|
+
|
|
114
|
+
Measured on a 3.0 GB monorepo of 98,161 files, 71,150 of them source:
|
|
115
|
+
**3.60s before, 2.10s after**, with byte-identical findings.
|
|
116
|
+
|
|
117
|
+
- Newline discovery uses `indexOf` rather than a per-character `charCodeAt`
|
|
118
|
+
loop. Measured 3.7x faster on a 525 MB corpus; `split` measured slower than
|
|
119
|
+
both while also allocating an array of every line.
|
|
120
|
+
- The credential scanner gates 13 of its 14 patterns behind a literal substring
|
|
121
|
+
test, so the regex engine never runs against a file that cannot contain that
|
|
122
|
+
shape of credential. The assignment pattern is intentionally left ungated
|
|
123
|
+
because its names match case insensitively and an incomplete gate would be a
|
|
124
|
+
silently dropped rule.
|
|
125
|
+
- Line numbers for a credential finding are resolved by binary search over a
|
|
126
|
+
lazily built offset table. The previous approach sliced and split the text
|
|
127
|
+
once per match, which is up to 280 times on a single file.
|
|
128
|
+
|
|
129
|
+
### Notes
|
|
130
|
+
|
|
131
|
+
- Zero runtime dependencies. Node 18 or newer, no install step.
|
|
132
|
+
- `poison` is a separate project. Flamer does not import it, and the handoff is
|
|
133
|
+
a runtime capability check in `SKILL.md` rather than a code dependency.
|
|
134
|
+
|
|
135
|
+
[Unreleased]: https://github.com/dummy3ye/flamer/compare/v1.1.1...HEAD
|
|
136
|
+
[1.1.1]: https://github.com/dummy3ye/flamer/releases/tag/v1.1.1
|
|
137
|
+
[1.1.0]: https://github.com/dummy3ye/flamer/releases/tag/v1.1.0
|
|
138
|
+
[1.0.0]: https://github.com/dummy3ye/flamer/releases/tag/v1.0.0
|
|
139
|
+
[0.1.6]: https://github.com/dummy3ye/flamer/releases/tag/v0.1.6
|
|
140
|
+
[0.1.5]: https://github.com/dummy3ye/flamer/releases/tag/v0.1.5
|
|
141
|
+
[0.1.0]: https://github.com/OWNER/flamer/releases/tag/v0.1.0
|
package/dist/cli.js
CHANGED
|
@@ -2910,7 +2910,14 @@ import { createRequire } from "module";
|
|
|
2910
2910
|
var require2 = createRequire(import.meta.url);
|
|
2911
2911
|
function nativePackageName() {
|
|
2912
2912
|
const platform = `${process.platform}-${process.arch}`;
|
|
2913
|
-
const supported = /* @__PURE__ */ new Set([
|
|
2913
|
+
const supported = /* @__PURE__ */ new Set([
|
|
2914
|
+
"linux-x64",
|
|
2915
|
+
"linux-arm64",
|
|
2916
|
+
"darwin-x64",
|
|
2917
|
+
"darwin-arm64",
|
|
2918
|
+
"win32-x64",
|
|
2919
|
+
"win32-arm64"
|
|
2920
|
+
]);
|
|
2914
2921
|
return supported.has(platform) ? `@dummy3ye/flamer-native-${platform}` : null;
|
|
2915
2922
|
}
|
|
2916
2923
|
function packagedWorkerPath(worker) {
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Flamer architecture
|
|
2
|
+
|
|
3
|
+
Flamer is a Node.js CLI with a coordinated native execution layer. TypeScript
|
|
4
|
+
owns the public interface, repository traversal, generic analyzers, findings,
|
|
5
|
+
fallback behavior, and report format. Rust and C++ run together as specialized
|
|
6
|
+
workers with non-overlapping responsibilities. Native findings are validated
|
|
7
|
+
and merged into the TypeScript report; they are not alternative scanners.
|
|
8
|
+
|
|
9
|
+
## Runtime layers
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
CLI (src/cli.ts)
|
|
13
|
+
├─ argument parsing and terminal/JSON output
|
|
14
|
+
├─ repository detection and scope selection
|
|
15
|
+
├─ TypeScript scanner and analyzers
|
|
16
|
+
└─ native worker adapter (src/native.ts)
|
|
17
|
+
├─ Rust worker: native/core/rust
|
|
18
|
+
│ ├─ shared file metrics
|
|
19
|
+
│ └─ Rust-specific analysis
|
|
20
|
+
└─ C++ worker: native/core/cpp
|
|
21
|
+
└─ C/C++-specific analysis
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### TypeScript layer
|
|
25
|
+
|
|
26
|
+
The TypeScript CLI is the default and source of truth. `src/scan.ts` walks and
|
|
27
|
+
reads files once, `src/detect.ts` builds project profiles, and registered
|
|
28
|
+
analyzers turn the collected context into findings. This path works with the
|
|
29
|
+
published npm package and does not require Rust, C++, Cargo, or CMake.
|
|
30
|
+
|
|
31
|
+
### Native layer
|
|
32
|
+
|
|
33
|
+
The native layer is intentionally separate from generic analyzer logic. Rust
|
|
34
|
+
receives all selected files for shared byte/newline metrics and receives Rust
|
|
35
|
+
files for Rust-specific checks. C++ receives only C and C++ files for
|
|
36
|
+
C/C++-specific checks. These jobs run concurrently in `all` mode, so no worker
|
|
37
|
+
repeats another worker's language analysis.
|
|
38
|
+
|
|
39
|
+
Rust is built from `native/core/rust/Cargo.toml` and exposes a reusable library
|
|
40
|
+
plus a thin JSONL binary. C++ is built with CMake from
|
|
41
|
+
`native/core/cpp/CMakeLists.txt` and exposes a public header, analyzer
|
|
42
|
+
implementation, and protocol executable.
|
|
43
|
+
|
|
44
|
+
The current native checks are deliberately small but real: Rust reports
|
|
45
|
+
`.unwrap()` usage and C++ reports the non-portable
|
|
46
|
+
`#include <bits/stdc++.h>` include. Additional expensive, language-specific
|
|
47
|
+
work can be added without moving report ownership out of TypeScript.
|
|
48
|
+
|
|
49
|
+
## Engine selection
|
|
50
|
+
|
|
51
|
+
The CLI accepts:
|
|
52
|
+
|
|
53
|
+
| Engine | Behavior |
|
|
54
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `all` | Default; runs TypeScript, Rust, and C++ together. Falls back to the TypeScript-only report if any native job is unavailable or fails. |
|
|
56
|
+
| `typescript` | Runs only the TypeScript implementation. |
|
|
57
|
+
| `rust` | Runs TypeScript plus Rust metrics and Rust analysis; fails if Rust is unavailable. |
|
|
58
|
+
| `cpp` | Runs TypeScript plus C++ analysis; fails if C++ is unavailable. |
|
|
59
|
+
|
|
60
|
+
The workers can be overridden with `FLAMER_RUST_CORE` and `FLAMER_CPP_CORE`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
FLAMER_RUST_CORE="$PWD/native/core/rust/target/release/flamer-core" \
|
|
64
|
+
FLAMER_CPP_CORE="$PWD/native/core/cpp/build/flamer-core-cpp" \
|
|
65
|
+
node dist/cli.js .
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Worker protocol
|
|
69
|
+
|
|
70
|
+
Workers communicate over newline-delimited JSON (JSONL):
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{ "protocol": 1, "operation": "file_metrics", "root": ".", "files": ["README.md"] }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Each request produces exactly one response on stdout. The operation determines
|
|
77
|
+
the worker contract:
|
|
78
|
+
|
|
79
|
+
| Worker | Operation | Input files | Responsibility |
|
|
80
|
+
| ------ | --------------- | ------------------ | ---------------------------------------- |
|
|
81
|
+
| Rust | `file_metrics` | all selected files | byte, newline, and readable-file metrics |
|
|
82
|
+
| Rust | `rust_analysis` | Rust files | Rust-specific findings |
|
|
83
|
+
| C++ | `cpp_analysis` | C/C++ files | C/C++-specific findings |
|
|
84
|
+
|
|
85
|
+
Example response:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"protocol": 1,
|
|
90
|
+
"ok": true,
|
|
91
|
+
"operation": "file_metrics",
|
|
92
|
+
"metrics": { "files": 1, "bytes": 1234, "lines": 42 },
|
|
93
|
+
"errors": [],
|
|
94
|
+
"duration_ms": 1
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Stdout is reserved for protocol messages. Diagnostics belong on stderr.
|
|
99
|
+
Unknown protocol versions, operations, malformed responses, non-zero exits, and
|
|
100
|
+
timeouts are errors. The TypeScript adapter validates the response before using
|
|
101
|
+
it.
|
|
102
|
+
|
|
103
|
+
## Build and test
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm test
|
|
107
|
+
npm run native:build
|
|
108
|
+
npm run native:test
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The individual projects can also be built directly:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
cargo build --release --manifest-path native/core/rust/Cargo.toml
|
|
115
|
+
cmake -S native/core/cpp -B native/core/cpp/build -DCMAKE_BUILD_TYPE=Release
|
|
116
|
+
cmake --build native/core/cpp/build --config Release
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The npm native scripts validate that Cargo and CMake are installed and return
|
|
120
|
+
an actionable error when either toolchain is missing. The C++ CMake project
|
|
121
|
+
also exports `compile_commands.json` and contains a protocol smoke test.
|
|
122
|
+
|
|
123
|
+
Native builds are checked independently in the Native Rust and Native C++
|
|
124
|
+
GitHub Actions workflows. Compiled output is ignored and is not committed.
|
|
125
|
+
|
|
126
|
+
## Release and installation roadmap
|
|
127
|
+
|
|
128
|
+
The npm package remains the required installation:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npm install --global flamerjs
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`flamerjs` declares platform-specific native packages under the publisher scope
|
|
135
|
+
as optional
|
|
136
|
+
dependencies. npm installs only the package matching the host OS and CPU:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
flamerjs
|
|
140
|
+
└── @dummy3ye/flamer-native-linux-x64
|
|
141
|
+
├── bin/flamer-core
|
|
142
|
+
└── bin/flamer-core-cpp
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
At runtime `src/native.ts` resolves both workers from that package. If npm
|
|
146
|
+
skips the optional package, the package is unavailable for the platform, or a
|
|
147
|
+
worker cannot start, default `all` mode falls back to TypeScript. The source
|
|
148
|
+
build command creates the same package shape:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npm run native:build:all
|
|
152
|
+
npm run native:package -- linux-x64
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The release workflow must build and publish both workers for each supported
|
|
156
|
+
OS/architecture package before that platform is advertised as native-enabled.
|
|
157
|
+
The standalone installer and release archives can use the same worker
|
|
158
|
+
artifacts.
|
|
159
|
+
|
|
160
|
+
The eventual bundled release keeps the TypeScript CLI as the orchestration
|
|
161
|
+
layer and packages both Rust and C++ workers. They are not alternatives:
|
|
162
|
+
standard execution starts both, while the explicit engine flags are for
|
|
163
|
+
debugging, benchmarking, and degraded environments.
|
|
164
|
+
|
|
165
|
+
## Design constraints
|
|
166
|
+
|
|
167
|
+
- Keep npm installation functional with Node.js alone; native packages remain
|
|
168
|
+
optional.
|
|
169
|
+
- Keep findings and report semantics in TypeScript.
|
|
170
|
+
- Keep workers deterministic and communicate only through the versioned
|
|
171
|
+
protocol; stdout is protocol-only and diagnostics use stderr.
|
|
172
|
+
- Keep native execution fallback-safe until platform packaging and release
|
|
173
|
+
binaries are mature.
|
|
174
|
+
- Do not duplicate generic analyzer work in native workers.
|
|
175
|
+
- Add a benchmark before moving more work out of the TypeScript scanner.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flamerjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Language-agnostic code health auditor that walks a repository once and reports what is wrong with it",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,12 +20,18 @@
|
|
|
20
20
|
"flamerjs": "./dist/cli.js"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
-
"dist"
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"CHANGELOG.md",
|
|
27
|
+
"docs/ARCHITECTURE.md"
|
|
24
28
|
],
|
|
25
29
|
"optionalDependencies": {
|
|
26
30
|
"@dummy3ye/flamer-native-darwin-arm64": "1.1.1",
|
|
27
31
|
"@dummy3ye/flamer-native-darwin-x64": "1.1.1",
|
|
32
|
+
"@dummy3ye/flamer-native-linux-arm64": "1.1.1",
|
|
28
33
|
"@dummy3ye/flamer-native-linux-x64": "1.1.1",
|
|
34
|
+
"@dummy3ye/flamer-native-win32-arm64": "1.1.1",
|
|
29
35
|
"@dummy3ye/flamer-native-win32-x64": "1.1.1"
|
|
30
36
|
},
|
|
31
37
|
"scripts": {
|