This document explains how to build FireFlag from source code.
- Deno 2.1.4 or later (JavaScript/TypeScript runtime)
- ReScript compiler (for .res → .js compilation)
- Idris2 0.7.0 or later (optional - for rebuilding formally verified libraries)
The extension is already built - all .res.js files are included in the source.
To verify the build:
# 1. Navigate to extension directory
cd extension/
# 2. Package the extension
zip -r ../fireflag-0.1.0.zip * -x "*.DS_Store" -x "__MACOSX/*" -x "web-ext-artifacts/*"
# 3. Verify the package
ls -lh ../fireflag-0.1.0.zipExpected output: fireflag-0.1.0.zip (approximately 122KB)
If you want to rebuild the ReScript files:
# Install Deno (if not already installed)
curl -fsSL https://deno.land/install.sh | sh
# Install ReScript globally
deno install -g @rescript/core# Navigate to lib/rescript directory
cd extension/lib/rescript/
# Compile .res files to .res.js
rescript build
# OR use Deno to compile
deno task buildFiles compiled:
Types.res→Types.res.jsBrowserAPI.res→ (inline, no separate output)DevTools.res→ (inline, no separate output)DatabaseUpdater.res→ (inline, no separate output)
# Check that .res.js files exist
ls -l extension/lib/rescript/*.res.js
# Should show: Types.res.jscd extension/
zip -r ../fireflag-0.1.0.zip * -x "*.DS_Store" -x "__MACOSX/*" -x "web-ext-artifacts/*"The Idris2 files in extension/lib/idris/*.idr are not compiled as part of the extension build.
These files are:
- Formally verified safety proofs
- Type definitions with dependent types
- Included for transparency and auditing
- NOT executed at runtime (JavaScript implementation is separate)
Purpose: Demonstrate formal verification of core safety logic.
To rebuild Idris2 proofs (optional, not required for extension):
cd extension/lib/idris/
idris2 --build fireflag.ipkgThis generates proof artifacts but does NOT affect the extension package.
fireflag/
├── extension/ # Extension source
│ ├── manifest.json # Extension manifest
│ ├── background/ # Background scripts
│ ├── popup/ # Popup UI
│ ├── sidebar/ # Sidebar UI
│ ├── options/ # Options page
│ ├── devtools/ # DevTools panel
│ ├── lib/ # Libraries
│ │ ├── rescript/ # ReScript source (.res)
│ │ │ └── *.res.js # Compiled JavaScript
│ │ ├── idris/ # Idris2 proofs (.idr)
│ │ └── dom-utils.js # Safe DOM utilities
│ ├── data/ # Flag database
│ └── icons/ # Extension icons
├── README.md # Project documentation
├── LICENSE # PMPL-1.0-or-later
└── BUILD_INSTRUCTIONS.md # This file
To verify the build matches the submitted package:
# 1. Build extension
cd extension/
zip -r ../fireflag-built.zip * -x "*.DS_Store" -x "__MACOSX/*" -x "web-ext-artifacts/*"
# 2. Compare with submitted package
cd ..
unzip -l fireflag-0.1.0.zip > submitted.txt
unzip -l fireflag-built.zip > built.txt
diff submitted.txt built.txtExpected result: No differences (or only timestamp differences)
None. All code is original, except:
- Browser APIs (provided by Firefox)
- Standard JavaScript built-ins
-
ReScript Compiler
- Version: Latest stable
- Input:
.resfiles (ReScript source) - Output:
.res.jsfiles (JavaScript) - Purpose: Type-safe JavaScript generation
- Repository: https://github.com/rescript-lang/rescript-compiler
-
Idris2 (Optional, for proofs only)
- Version: 0.7.0+
- Input:
.idrfiles (Idris2 source) - Output: Proof artifacts (not included in extension)
- Purpose: Formal verification of safety properties
- Repository: https://github.com/idris-lang/Idris2
- Extension Code: PMPL-1.0-or-later (Palimpsest Meta-Project License)
- License File:
LICENSEin repository root - License URL: https://github.com/hyperpolymath/palimpsest-license
- Author: Jonathan D.A. Jewell j.d.a.jewell@open.ac.uk
- Repository: https://github.com/hyperpolymath/fireflag
- Issues: https://github.com/hyperpolymath/fireflag/issues
ReScript provides:
- Type safety: Compile-time guarantees against common JavaScript errors
- Memory safety: No null/undefined errors at runtime
- Performance: Generates optimized JavaScript
- Readability:
.res.jsoutput is human-readable, not minified
The Idris2 .idr files demonstrate:
- Formal verification: Mathematical proofs of safety properties
- Transparency: Auditable safety claims
- Documentation: Self-documenting type guarantees
These files are NOT executed - they're included for transparency and verification.
All source code is available at:
- GitHub: https://github.com/hyperpolymath/fireflag
- License: Open source (PMPL-1.0-or-later)
Build Time: < 5 seconds (ReScript compilation only) Build Reproducibility: Deterministic (same source → same output) Build Dependencies: Deno + ReScript (optional: Idris2 for proofs)