Skip to content

Commit 3424d66

Browse files
committed
chore: update progress for US-182
1 parent fb76520 commit 3424d66

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

progress.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Started: 2026-03-17
33
PRD: ralph/kernel-hardening (46 stories)
44

55
## Codebase Patterns
6+
- Timing mitigation Date.now/performance.now use getter/setter (not writable:false) — setter is no-op for Node.js compat; configurable:false blocks re-definition
67
- Claude binary at ~/.claude/local/claude — not on PATH by default; skip helpers must check this fallback location
78
- Claude Code --output-format stream-json requires --verbose flag; uses ANTHROPIC_BASE_URL natively (no fetch interceptor)
89
- Python WORKER_SOURCE is String.raw — use array.join("\n") for multiline Python code; f-strings with escaped quotes break
@@ -2284,3 +2285,19 @@ PRD: ralph/kernel-hardening (46 stories)
22842285
- SandboxHmac must handle SandboxKeyObject as key (check key._pem) — jwa passes KeyObject directly to crypto.createHmac()
22852286
- createSecretKey creates a KeyObject with type='secret' — needed for HS256/HS384/HS512 algorithm validation in jsonwebtoken
22862287
---
2288+
2289+
## 2026-03-18 - US-182
2290+
- What was implemented: Added bcryptjs project-matrix fixture; fixed Date.now timing mitigation to use getter/setter instead of writable:false
2291+
- Files changed:
2292+
- packages/secure-exec/tests/projects/bcryptjs-pass/ — new fixture (fixture.json, package.json, src/index.js, pnpm-lock.yaml)
2293+
- packages/secure-exec-core/isolate-runtime/src/inject/apply-timing-mitigation-freeze.ts — changed Date.now freeze from writable:false to getter/setter (no-op setter) for Node.js compat
2294+
- packages/secure-exec-core/src/generated/isolate-runtime.ts — regenerated from build
2295+
- packages/secure-exec/tests/runtime-driver/node/index.test.ts — updated "Date.now cannot be overridden" test to expect assignThrew:false (setter is silently ignored)
2296+
- docs/nodejs-compatibility.mdx — added bcryptjs to Tested Packages table
2297+
- **Learnings for future iterations:**
2298+
- bcryptjs does `Date.now = Date.now || function()...` which assigns to Date.now even when it already exists; writable:false causes TypeError in strict mode
2299+
- Fix: use getter/setter pattern (get returns frozen fn, set is no-op) instead of writable:false — silently ignores writes while keeping Date.now frozen
2300+
- Object.defineProperty with configurable:false still blocks re-definition, so security is maintained
2301+
- Must rebuild core (`pnpm turbo run build --filter=@secure-exec/core`) after changing isolate-runtime source files
2302+
- Generated isolate-runtime.ts must be committed alongside source changes
2303+
---

scripts/ralph/prd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3140,7 +3140,7 @@
31403140
"Tests pass (project-matrix)"
31413141
],
31423142
"priority": 182,
3143-
"passes": false,
3143+
"passes": true,
31443144
"notes": "bcryptjs is pure JS bcrypt. Tests computation-heavy pure JS workload."
31453145
},
31463146
{

0 commit comments

Comments
 (0)