Hi, I'm Hasan. I build ML systems, security tools and production web apps.
I'm a Senior Software Engineer at the Farmacia pharmacy group, where I build the telehealth and e-commerce sites. I also founded DarkForge AI and Dusklayer. Lately I've been building a camera analytics engine, a small language model from scratch, a Raft implementation and a security gateway for MCP.
Frames from the Sentinel Vision demo. The video is AI generated, so there are no real people in it. The boxes and labels are what the software drew. More on this project
01
Selected work
Six projects I'd point you to first. The rest are on the work page.
Most camera footage only gets watched after something goes wrong. I wanted the camera to report what's happening as short status changes with timestamps.
What I built
Everything: the model export, the rules, the browser demo, the Windows apps, the release pipeline and the site.
The same ONNX models run on a Windows GPU, on a plain CPU and in the browser.
The rules are regular code, kept separate from the model, with 41 tests.
The small model takes about 68 ms a frame on a 2 core CPU with no GPU.
I'd used model libraries without really knowing what goes on inside them. So I wrote each piece myself, then wrote the inference a second time in Rust to check I had it right.
What I built
Everything: the BPE tokenizer, the transformer and trainer in PyTorch, the model file format and the Rust engine.
Trained from random weights on about 1 MB of Shakespeare. 857K parameters, around 11 minutes on 2 CPU cores.
The Rust engine matches PyTorch's logits to 5 decimal places.
Training and validation loss from the repo's training log. Validation stops improving around step 1,000, so the model is overfitting after that.
$ cargo test --release --test parity logits_match -- --nocapture
largest difference from PyTorch over 4608 logits: 1.1570752e-5
test result: ok. 1 passed; 0 failed
Consensus bugs hide in rare orderings, like a message that lands after a crash or a leader that doesn't know it's been replaced. They're hard to hit in tests and even harder to reproduce.
What I built
Everything: the Raft node, the key value store on top of it, the simulator and the linearizability checker.
The node has no goroutines, timers or sockets, so a whole cluster runs deterministically from a seed.
500 seeds with crashes, partitions and dropped messages: about 330K client operations and no violations.
When I break reads on purpose, the checker catches it.
$ go run ./cmd/quorum-sim -seeds 500
500 seeds in 6.37s: 2006617 ticks, 330221 operations (330221 completed), 3244 leader terms, 337948 entries committed,
30313 snapshots, 2055 crashes, 4957 partitions, 12871111 messages (2192855 lost)
no property violated$ go run ./cmd/quorum-sim -seeds 40 -unsafe-reads
seed 17: VIOLATION at tick 4013: linearizability: no sequential order explains the history of key "k1"
seed 21: VIOLATION at tick 4005: linearizability: no sequential order explains the history of key "k1"
seed 26: VIOLATION at tick 4009: linearizability: no sequential order explains the history of key "k2"
40 seeds in 398ms: 160535 ticks, 29059 operations (29059 completed), 257 leader terms, 19371 entries committed,
1738 snapshots, 164 crashes, 395 partitions, 730476 messages (141629 lost)
3 seed(s) violated a property
Simulator output. The second run has a bug I added on purpose, to make sure the checker fails when it should.
Request
Result
Reason
tools/list
1 of 6 tools shown
Tools the policy never allows are hidden. One tool with an injection in its description is quarantined.
read_file README.md
Allowed, redacted
aws_access_key_id = [REDACTED:aws-access-key-id]
read_file /home/me/.ssh/id_rsa
Denied
argument 'path' matches a denied pattern
shell_exec ls
Denied
no rule matches 'shell_exec'; default is deny
export_all
Denied
its description reads like a prompt injection (concealment, tool-coercion)
fetch_page https://example.com
Denied
no rule matches 'fetch_page'; default is deny
What anvil did when I ran it in front of the hostile server from its test suite. That server offers six tools, hides an instruction in one description, leaks a key and exposes a shell.
An MCP server controls the tool descriptions and results that a model reads. If the server is malicious, or just passes along a bad web page, it can talk the model into running things.
What I built
Everything: the proxy, the policy engine, redaction, the injection scanner, tool pinning, the audit log and the CLI.
Deny by default. A blocked call never reaches the server.
Against the hostile server in its test suite, it hid 5 of 6 tools and redacted a leaked AWS key.
206 tests. The audit log is hash chained, so edits show up.
You can't sell prescription treatments like regular e-commerce. Nothing can be bought without a prescriber, and the first form shouldn't collect health information.
What I built
Design, build, the English and Spanish content, and the compliance copy, which I wrote with the pharmacist.
There's no cart. Every page leads to a consultation request.
The request form only takes contact details. Medical intake happens later on a secure link.
Every product is labeled FDA approved or compounded, and there's a full Spanish version.
Two school projects also have full write-ups: CyberForge, my senior project with a team of five, and Distributed Smart Parking, a class project with a group of seven.
A few details from the projects, with real output.
ML and vision
Same models on three runtimes
Sentinel Vision exports its models to ONNX once. The same files run on a Windows GPU through DirectML, on a CPU, and in the browser with WebAssembly. These are the timings so far. I haven't timed the GPU path yet.
In the parking project, a client that gets no reply retries with the same message id. The server keeps the reply it already sent and returns it again, flagged as a duplicate. This is the server log from a test that drops the first reply.
From lot_server_A.log, trimmed to the relevant fields.
Security
A CI gate for secrets and risky code
pipeline-armor scans a repo for hardcoded secrets and dangerous calls, and fails the build above a severity you pick. It ships with a vulnerable demo app, and its own CI checks that the demo still gets blocked.
I work for a group of pharmacies in California. I build and maintain their sites: the main group site, the telehealth site, the supplement store and the individual store sites. A lot of it is regulated, so I work closely with the pharmacists on what a page can say and what it can collect.
I also run DarkForge AI, a small studio for client work, and Dusklayer, which is my own product. I'm finishing a CS degree at Cal State Long Beach.
darkforge-edr Linux endpoint detection agent in Go. It reads process info from /proc, runs it through YAML rules and writes alerts as JSON lines.Go47 tests
pipeline-armor CI security gate for GitHub Actions. Scans for secrets and risky code patterns, with a YAML policy.Python19 tests
tiny-compiler A small Pascal style language that compiles to MIPS assembly. Lexer, parser, code generator and an interpreter in about 700 lines.Python41 tests
cecs327-smart-parking The distributed parking system from my distributed systems class. Group project.Python35 unit tests, 10 scenarios