Skip to content

Commit 66a455d

Browse files
Define fire-and-forget flag semantics and implementation (#8)
Define comprehensive semantics for fire-and-forget feature flags: - Eventual consistency with bounded propagation delay - Version vectors for conflict resolution - TTL-based caching with stale-while-revalidate - Immutable audit logging with checksums - Targeting rules and percentage rollouts Reference implementation in ReScript: - Core types (Types.res) - Version vector conflict resolution (VersionVector.res) - Flag evaluation engine (Evaluator.res) - In-memory storage adapter (MemoryStore.res) - Cache with adaptive TTL (Cache.res) - Audit logging system (AuditLog.res) - Main client API (Fireflag.res) Co-authored-by: Claude <noreply@anthropic.com>
1 parent af05051 commit 66a455d

10 files changed

Lines changed: 2364 additions & 11 deletions

File tree

docs/SEMANTICS.adoc

Lines changed: 509 additions & 0 deletions
Large diffs are not rendered by default.

justfile

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
# fireflag - Development Tasks
23
set shell := ["bash", "-uc"]
34
set dotenv-load := true
@@ -8,22 +9,36 @@ project := "fireflag"
89
default:
910
@just --list --unsorted
1011

11-
# Build
12+
# Build ReScript sources
1213
build:
13-
@echo "TODO: Add build command"
14+
deno run -A npm:rescript build
1415

15-
# Test
16-
test:
17-
@echo "TODO: Add test command"
16+
# Build in watch mode
17+
watch:
18+
deno run -A npm:rescript build -w
1819

19-
# Clean
20+
# Clean build artifacts
2021
clean:
21-
@echo "TODO: Add clean command"
22+
deno run -A npm:rescript clean
23+
rm -rf src/**/*.res.js src/**/*.bs.js
2224

23-
# Format
25+
# Format ReScript code
2426
fmt:
25-
@echo "TODO: Add format command"
27+
deno run -A npm:rescript format src/**/*.res
28+
29+
# Type check
30+
check:
31+
deno run -A npm:rescript build
32+
33+
# Run tests
34+
test:
35+
deno test --allow-read
36+
37+
# Run example
38+
example:
39+
deno run --allow-read src/example.js
2640

27-
# Lint
41+
# Lint (placeholder for future rescript-eslint)
2842
lint:
29-
@echo "TODO: Add lint command"
43+
@echo "Lint: Type checking via rescript build"
44+
deno run -A npm:rescript build

rescript.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json",
3+
"name": "fireflag",
4+
"version": "0.1.0",
5+
"sources": [
6+
{
7+
"dir": "src",
8+
"subdirs": true
9+
}
10+
],
11+
"package-specs": [
12+
{
13+
"module": "esmodule",
14+
"in-source": true
15+
}
16+
],
17+
"suffix": ".res.js",
18+
"bs-dependencies": [],
19+
"warnings": {
20+
"error": "+101"
21+
}
22+
}

0 commit comments

Comments
 (0)