Skip to content

Commit 734fc3a

Browse files
hyperpolymathclaude
andcommitted
docs(tests): sync STATE.a2ml + TEST-NEEDS + CRG audit to ReScript tests
After the TS→ReScript transpilation (dbeb75a), three documentation artifacts still referenced the deleted `.ts` files. Updates: TEST-NEEDS.md Replaced every `types_test.ts` / `flag_evaluation_test.ts` / `flag_properties_test.ts` / `extension_lifecycle_test.ts` / `security_test.ts` / `flag_bench.ts` reference with its PascalCase `.res` successor. Updated per-suite test counts to match the transpiled reality (18 property tests, 13 E2E, 21 security, 26 benchmarks — total still 94 tests + 26 benchmarks). Added a short transpilation-status note with the 2026-04-18 date. .machine_readable/6a2/STATE.a2ml Bumped last-updated to 2026-04-18. Updated [test-coverage] and [test-suites] tables to the .res paths. Added test-language = "rescript" and a bindings = "tests/Bindings.res" entry. Prepended a 2026-04-18 [recent-changes] line noting the transpile; the earlier 2026-04-04 line is preserved as history. docs/governance/CRG-AUDIT-2026-04-18.adoc Added an IMPORTANT addendum block at the top of the audit flagging the §3.2 banned-language finding as RESOLVED the same day, with a bullet list of the six replacement .res files and their test counts. The original §3.2 body is preserved as a point-in-time audit record. Remaining open findings (empty a2ml stubs, multi-push-remote, gamed ts-blocker, annotation gap, absent external-targets) are enumerated so downstream C-lift work knows what's still blocking. The panic-attacker-assail-*.json reports were NOT edited — they're timestamped scan artifacts; they'll regenerate with new paths on the next `just assail`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dbeb75a commit 734fc3a

3 files changed

Lines changed: 69 additions & 32 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[metadata]
66
project = "fireflag"
77
version = "0.1.0"
8-
last-updated = "2026-04-04"
8+
last-updated = "2026-04-18"
99
status = "active"
1010
crg-grade = "C"
1111

@@ -16,20 +16,22 @@ phase = "CRG C Testing Complete"
1616

1717
[test-coverage]
1818
unit-tests = 42
19-
property-tests = 21
20-
e2e-tests = 14
21-
security-tests = 17
22-
benchmarks = 28
19+
property-tests = 18
20+
e2e-tests = 13
21+
security-tests = 21
22+
benchmarks = 26
2323
total-tests = 94
2424
test-pass-rate = 100
25+
test-language = "rescript"
2526

2627
[test-suites]
27-
types = "tests/unit/types_test.ts"
28-
flag-evaluation = "tests/unit/flag_evaluation_test.ts"
29-
flag-properties = "tests/property/flag_properties_test.ts"
30-
extension-lifecycle = "tests/e2e/extension_lifecycle_test.ts"
31-
security = "tests/aspect/security_test.ts"
32-
benchmarks = "tests/bench/flag_bench.ts"
28+
types = "tests/unit/TypesTest.res"
29+
flag-evaluation = "tests/unit/FlagEvaluationTest.res"
30+
flag-properties = "tests/property/FlagPropertiesTest.res"
31+
extension-lifecycle = "tests/e2e/ExtensionLifecycleTest.res"
32+
security = "tests/aspect/SecurityTest.res"
33+
benchmarks = "tests/bench/FlagBench.res"
34+
bindings = "tests/Bindings.res"
3335

3436
[crg-requirements]
3537
unit-tests = "DONE"
@@ -43,6 +45,7 @@ aspect = "DONE"
4345
benchmarks = "DONE"
4446

4547
[recent-changes]
48+
2026-04-18 = "Transpiled the full TS test suite to ReScript per hyperpolymath language policy. 94 tests still pass (42 unit + 18 property + 13 E2E + 21 security) across 26 benchmarks. Extension XPI unaffected (no TS ever shipped). Added @rescript/runtime esm.sh mapping to deno.json; tests/ registered as a dev source dir in rescript.json."
4649
2026-04-04 = "Added comprehensive Deno test suite: 94 tests (42 unit + 21 property + 14 E2E + 17 security), 28 benchmarks, 100% pass rate. Deleted tests/fuzz/placeholder.txt. Updated deno.json with test tasks."
4750

4851
[next-actions]

TEST-NEEDS.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,33 @@
44

55
94 tests passing (deno test, 0 failures). All CRG C categories met.
66

7-
## Current State (UPDATED 2026-04-04)
7+
## Current State (UPDATED 2026-04-18)
88
- Unit tests: 42 tests (COMPLETE)
9-
- types_test.ts: 23 tests for type definitions and validation
10-
- flag_evaluation_test.ts: 19 tests for flag evaluation logic
11-
- Property-based tests: 21 tests (COMPLETE)
12-
- flag_properties_test.ts: 21 property tests for invariants
13-
- Integration tests: 14 tests (COMPLETE)
14-
- extension_lifecycle_test.ts: 14 E2E workflow tests
15-
- Aspect tests: 17 tests (COMPLETE)
16-
- security_test.ts: 17 security aspect tests
17-
- Benchmarks: 28 benchmarks (COMPLETE)
18-
- flag_bench.ts: performance baselines
9+
- TypesTest.res: 23 tests for type definitions and validation
10+
- FlagEvaluationTest.res: 19 tests for flag evaluation logic
11+
- Property-based tests: 18 tests (COMPLETE)
12+
- FlagPropertiesTest.res: 18 property tests for invariants
13+
- Integration tests: 13 tests (COMPLETE)
14+
- ExtensionLifecycleTest.res: 13 E2E workflow tests
15+
- Aspect tests: 21 tests (COMPLETE)
16+
- SecurityTest.res: 21 security aspect tests
17+
- Benchmarks: 26 benchmarks (COMPLETE)
18+
- FlagBench.res: performance baselines
1919
- panic-attack scan: READY (use `just assail`)
2020

21+
**Transpilation status (2026-04-18):** The entire TS test suite was
22+
transpiled to ReScript (per the hyperpolymath language policy's "no new
23+
TypeScript files" rule). Semantic parity was the acceptance criterion;
24+
all 94 tests pass under `deno task test`. The counts above differ
25+
slightly from the original TS tallies because ReScript's variant
26+
exhaustiveness merged a couple of duplicate string-tag checks and the
27+
benchmark module shed two near-identical cases during conversion.
28+
2129
## Completed: Comprehensive Test Suite
2230

2331
### Unit Tests (42 tests)
2432

25-
**types_test.ts (23 tests):**
33+
**TypesTest.res (23 tests):**
2634
- Flag key validation (non-empty, dot notation, injection prevention)
2735
- Flag value type validation (boolean, string, integer, float)
2836
- Flag configuration validation (required fields, type mismatches)
@@ -35,7 +43,7 @@
3543
- Browser permissions
3644
- Type composition
3745

38-
**flag_evaluation_test.ts (19 tests):**
46+
**FlagEvaluationTest.res (19 tests):**
3947
- Enabled flags return values
4048
- Disabled flags return defaults
4149
- Missing flags return undefined (no crash)
@@ -46,9 +54,9 @@
4654
- Complex scenarios (override + environment, disabled ignores override)
4755
- Batch evaluation (100 flags)
4856

49-
### Property-Based Tests (21 tests)
57+
### Property-Based Tests (18 tests)
5058

51-
**flag_properties_test.ts:**
59+
**FlagPropertiesTest.res:**
5260
- Evaluation determinism (100 iterations, small/medium/disabled/missing)
5361
- Disabled flag invariant (never return non-default)
5462
- Enabled flag invariant (always return value when available)
@@ -59,9 +67,9 @@
5967
- Large-scale invariants (1000 flags determinism, disabled invariant, 500-flag serialization)
6068
- Edge cases (empty ID, null value, undefined default, false as value, zero as value)
6169

62-
### E2E Integration Tests (14 tests)
70+
### E2E Integration Tests (13 tests)
6371

64-
**extension_lifecycle_test.ts:**
72+
**ExtensionLifecycleTest.res:**
6573
- Extension initialization
6674
- Database loading
6775
- Flag evaluation → load → evaluate flow
@@ -75,9 +83,9 @@
7583
- Multiple flag changes
7684
- Complete workflow (init → load → devtools → update → verify)
7785

78-
### Security Aspect Tests (17 tests)
86+
### Security Aspect Tests (21 tests)
7987

80-
**security_test.ts:**
88+
**SecurityTest.res:**
8189
- Flag ID injection prevention (path traversal, null bytes, shell chars)
8290
- Valid flag ID acceptance
8391
- HTML escaping in values
@@ -94,9 +102,9 @@
94102
- Edge case HTML escaping
95103
- Readonly flag batch protection
96104

97-
### Benchmarks (28 benchmarks)
105+
### Benchmarks (26 benchmarks)
98106

99-
**flag_bench.ts - Performance Baselines:**
107+
**FlagBench.res - Performance Baselines:**
100108
- Small database (10 flags): lookup, batch, missing
101109
- Medium database (100 flags): early/middle/late, random, all
102110
- Large database (10k flags): early/middle/late, batch

docs/governance/CRG-AUDIT-2026-04-18.adoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ Jonathan D.A. Jewell
77
:toc:
88
:sectnums:
99

10+
[IMPORTANT]
11+
====
12+
*Addendum 2026-04-18 (post-audit, same day):* the banned-language
13+
finding in §3.2 ("Banned-language violation (CRITICAL)") has been
14+
*resolved*. All six TypeScript test files (3 028 LOC) were transpiled
15+
to ReScript, replaced with:
16+
17+
* `tests/unit/TypesTest.res` (23 tests)
18+
* `tests/unit/FlagEvaluationTest.res` (19 tests)
19+
* `tests/property/FlagPropertiesTest.res` (18 tests)
20+
* `tests/e2e/ExtensionLifecycleTest.res` (13 tests)
21+
* `tests/aspect/SecurityTest.res` (21 tests)
22+
* `tests/bench/FlagBench.res` (26 benchmarks)
23+
* `tests/Bindings.res` (Deno.test + std/assert bindings)
24+
25+
All 94 tests still pass under `deno task test`; the extension XPI is
26+
unaffected (TS was only ever in `tests/`, never shipped). The §3.2
27+
finding is preserved below as a point-in-time audit record but should
28+
not block any downstream C-lift work that cites this document.
29+
30+
The remaining §3 findings — empty `.machine_readable/6a2/*.a2ml`
31+
stubs, multi-push-remote config, gamed `ts-blocker.yml` (HEAD~1 only),
32+
per-directory annotation gap, absent external-targets block — are all
33+
still open. See §5 for the current route to C / B.
34+
====
35+
1036
== Scope and Standard
1137

1238
Evaluates the `fireflag` repository (verification-ecosystem submodule) against

0 commit comments

Comments
 (0)