MayFly LogoMayFly
Reference

Zero-Dependency Verification

Technical audit and verification of zero third-party runtime dependencies in MayFly.

Philosophy & Threat Model

Most modern developer utilities pull in hundreds of transitive dependencies. If any upstream package in the dependency graph is compromised, typo-squatted, or modified through account takeovers, developers inherit those vulnerabilities directly into their build environments.

Security tools, in particular, should not introduce supply-chain attack vectors. MayFly was designed and implemented from first principles to operate with zero third-party Go dependencies (go.mod contains 0 require directives).


Dependency Manifest (go.mod)

Inspection of MayFly's go.mod:

module mayfly

go 1.22

There are zero external module requirements, zero indirect dependencies, and zero vendored third-party source packages.


Standard Library Substitution Matrix (STDLIB.md)

MayFly implements 13 distinct subsystems using exclusively Go standard library primitives:

#Subsystem ReplacedExternal Packages ReplacedGo Stdlib Replacement PrimitivesArchitectural Details
1Terminal Raw Modegolang.org/x/term, termenvsyscall.SYS_IOCTL, TCGETS, TCSETS, syscall.TermiosDirect OS syscalls manipulate terminal line discipline into raw non-canonical mode, disabling ECHO and ICANON.
2Terminal UI Enginebubbletea, tview, termbox-gobytes.Buffer, io.Writer, Custom 2D Cell Grid, ANSI SGRDouble-buffered 2D character canvas, responsive Project Card Grid, scrollable lists, and masked inputs.
3Streaming Key Parserbubbletea/key, go-ttyunicode/utf8, Streaming FSMStreaming state machine parses multi-byte ANSI sequences (arrows, Esc, Tab, Enter, UTF-8 runes).
4Key Derivation (KDF)golang.org/x/crypto/pbkdf2crypto/hmac, crypto/sha256, encoding/binaryHand-rolled RFC 8018 PBKDF2-HMAC-SHA256 with 600,000 rounds deriving 256-bit AES master key.
5Encrypted Vault Storagemattn/go-sqlite3, bbolt, go-keyringcrypto/aes, crypto/cipher (AES-GCM), crypto/randAuthenticated binary container with 15-byte header, AES-256-GCM AEAD encryption, and atomic tmp -> fsync -> rename.
6In-Memory Injectionjoho/godotenv, gotenvos.Environ, os/exec.CommandContext, Buffer zeroingDecrypted secrets overlay directly into volatile child process RAM; buffers immediately zeroed upon process exit.
7Audit Traillogrus, zap, SIEM databasescrypto/sha256, encoding/hex, encoding/jsonSHA-256 hash-chained JSON log (~/.mayfly/audit.log) mathematically proving entries cannot be modified or deleted.
8Filesystem Project IDgoogle/uuid, go-gitsyscall.Stat_t (Dev, Ino), filepath.EvalSymlinksDeterministic SHA-256 project identity derived from storage (Device, Inode) preventing path collision leaks.
9Credential Scannertrufflehog, gitleakspath/filepath.WalkDir, regexp, bufio.ScannerRecursive bounded filesystem crawler detecting unencrypted .env files and API key patterns with .mayflyignore.
10ANSI Styling & Colorsfatih/color, mgutz/ansi, chalkHand-crafted ANSI SGR sequence builder, NO_COLOR16-color ANSI builder with attribute masking (bold, dim, underline, reverse) respecting the NO_COLOR spec.
11Unicode Rune Widthsmattn/go-runewidthunicode/utf8, East Asian width range checksComputes exact terminal cell column widths for East Asian, wide characters, and emojis for double-buffered alignment.
12Clipboard Controlleratotto/clipboard, x/clipboardencoding/base64, ANSI OSC 52 escape sequencesEmits pure ANSI OSC 52 clipboard sequences directly to terminal stdout with graceful fallback to OS utilities.
13Self-Updating Enginego-selfupdate, go-github-selfupdatenet/http, crypto/sha256, os.RenameChecks GitHub releases, verifies SHA-256 checksums, and performs atomic binary swap without curl or external scripts.

Replaced External Dependencies

MayFly eliminates reliance on popular external packages commonly pulled into Go toolchains:

  • godotenv / dotenv (10M+ weekly downloads): Replaced by in-memory volatile execution overlay in pkg/executor.
  • golang.org/x/crypto/pbkdf2 (5M+ weekly downloads): Replaced by hand-rolled RFC 8018 PBKDF2-HMAC-SHA256 in pkg/vault.
  • bubbletea / tview (1M+ weekly downloads): Replaced by double-buffered 2D TUI engine in pkg/tui.
  • fatih/color / chalk: Replaced by custom ANSI SGR generator in pkg/tui/terminal.
  • atotto/clipboard: Replaced by ANSI OSC 52 escape sequences in pkg/tui/terminal.
  • trufflehog / gitleaks: Replaced by bounded filesystem crawler in pkg/scanner.

Cryptographic Build Determinism

To ensure supply-chain integrity, MayFly compiles deterministically across independent builds. Compiling with -trimpath -ldflags="-s -w -buildid=" produces bit-for-bit identical binary hashes:

make reproducible

Verification Output:

Verifying bit-for-bit reproducible build...
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -buildid=" -o bin/repro1/mayfly ./cmd/mayfly
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -buildid=" -o bin/repro2/mayfly ./cmd/mayfly
a1c3e47019f2a41d9836dc369b6e5321a29f9d8d60ebe7d7e72151191dcfe6f0  bin/repro1/mayfly
a1c3e47019f2a41d9836dc369b6e5321a29f9d8d60ebe7d7e72151191dcfe6f0  bin/repro2/mayfly
[OK] REPRODUCIBLE BUILD VERIFIED: Byte-identical outputs!

Formal Manifest Verification

To audit the codebase and generate a formal zero-dependency proof manifest:

make deps-proof

To list modules directly:

go list -m all

Expected output:

mayfly

To inspect all package imports across the entire tree:

go list -f '{{.ImportPath}}: {{.Imports}}' ./...

Next Steps