Problem
Executable classification currently relies on an extensionless-file heuristic. That heuristic will misfire on ordinary extensionless files — README, LICENSE and similar — treating them as executables.
Proposed approach
Replace the heuristic with magic-byte sniffing:
- Mach-O (macOS)
- ELF (Linux)
- MZ (Windows)
Classify on file content rather than on the absence of an extension.
Acceptance criteria
- Extensionless non-executables (
README, LICENSE) are not classified as executables.
- Mach-O, ELF and MZ binaries are correctly identified on all platforms.
- Classification does not depend on file extension.
Notes
Worth landing before the current heuristic trips on real content in the wild.
Problem
Executable classification currently relies on an extensionless-file heuristic. That heuristic will misfire on ordinary extensionless files —
README,LICENSEand similar — treating them as executables.Proposed approach
Replace the heuristic with magic-byte sniffing:
Classify on file content rather than on the absence of an extension.
Acceptance criteria
README,LICENSE) are not classified as executables.Notes
Worth landing before the current heuristic trips on real content in the wild.