You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Runtime.execSeq 상태 변이 카운터(run/runAsync/setGlobal/install/loadPackages)로
경계 위반을 O(1) 감지. restoreLive가 위반 시 자동으로 재해시 경로 승격 = 조용히
틀린 복원 불가능. 실측: 위반 27.4ms 안전 복원, 준수 0.69ms 즉시 경로(rehashed 플래그).
- probe를 가드 검증형으로 갱신(자동 감지 + 즉시 경로 보존), 게이트 20검사 green.
- restore()의 힙 성장 비대칭 관찰(리뷰 부수 지적)을 계약 실태 표 열린 항목으로 등록.
- README/소비 계약/타입(RestoreInfo.rehashed) 동기화.
**실행 경계 계약**: `restoreLive`는 저장된 해시끼리만 비교한다(재해싱 0 = 즉시성의 근거). 그래서 파이썬을 실행했다면 복원 전에 반드시 `checkpoint()`로 경계를 닫아야 한다. 경계를 보장할 수 없으면 `restore()`(전체 복원, 안전 기준선)를 쓴다.
106
+
**실행 경계 계약(기계 강제)**: `restoreLive`는 경계(마지막 `checkpoint()`/복원 이후 실행 없음)를 지키면 저장 해시 비교만으로 즉시 복원한다(재해싱 0, 실측 ~1ms). 경계 위반(실행·예외·전역 변이)은 상태 변이 카운터로 O(1) 자동 감지되어 재해시 경로로 승격되므로 **조용히 틀린 복원은 일어나지 않는다**(실측 ~27ms). 어느 경로였는지는 반환값 `rehashed`로 확인한다.
**Execution boundary contract**: `restoreLive` compares stored hashes only (zero re-hashing is what makes it instant). So if you ran Python, you must close that boundary with `checkpoint()` before restoring. If you cannot guarantee the boundary, use `restore()` (full restore, the safe baseline).
106
+
**Execution boundary contract (machine-enforced)**: when the boundary holds (no execution since the last `checkpoint()`/restore), `restoreLive` compares stored hashes only and restores instantly (zero re-hashing, ~1ms measured). A boundary violation (execution, exception, global mutation) is auto-detected in O(1) via a state-mutation counter and the restore upgrades to the re-hash path, so **a silently wrong restore cannot happen** (~27ms measured). The returned `rehashed` flag tells you which path ran.
- 엔진 내부(`HEAPU8`, `Runtime.raw` 등)를 직접 만지지 않는다. `raw`는 탈출구이고 계약 밖이다.
36
-
-**restoreLive 실행 경계 계약**: 파이썬을 실행했다면 복원 전에 `checkpoint()`로 경계를 닫는다. 전제를 보장할 수 없으면 `restore()`(전체 복원)를 쓴다.
36
+
-**restoreLive 실행 경계 계약(기계 강제)**: 경계를 지키면 즉시 복원(재해싱 0), 위반은 자동 감지되어 재해시 경로로 승격된다(조용한 오염 없음). 반환값 `rehashed`로 경로 확인. 즉시성이 필요하면 복원 전 `checkpoint()`로 경계를 닫아라.
Copy file name to clipboardExpand all lines: mainPlan/web-python-runtime/01-architecture.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,11 +44,12 @@ pyproc의 코어는 새 이론이 아니라 codaro `tests/_attempts`에서 브
44
44
45
45
| 항목 | 계약 | 실제 | 상태 |
46
46
|---|---|---|---|
47
-
| restoreLive 실행 경계 |복원 전 마지막 실행을 `checkpoint()`로 닫아야 한다(재해싱 0이 즉시성의 근거) | 계약을 어기면 stale 해시 비교로 0페이지 복원(조용한 오동작). 코드 주석·README 사용례로 계약 명문화 + 브라우저 게이트가 계약 준수 경로를 기계 검증(2026-07-11, restoreLive 0.84ms 실측)|문서 + 게이트로 고정. 위반 감지 가드는 attempts 후보|
47
+
| restoreLive 실행 경계 |경계 준수 시 즉시(재해싱 0), 위반 시에도 조용한 오염 없음 |**기계 강제(2026-07-11)**: Runtime.execSeq(상태 변이 카운터)로 위반을 O(1) 감지해 자동 재해시 승격. 반환값 `rehashed`로 경로 확인, 게이트 상시 검증|해소 (외부 리뷰 지적 반영)|
48
48
| 페이지 해시 soundness | 실질적 sound(누락 확률 무시 가능) | 이중 32비트(실효 64비트, ~2^-64)로 승격. 비용 1.54배, 30MB 힙 14.3ms 실측 | 해소 (attempts/reactiveSoundness 졸업, 2026-07-11) |
| Pyodide 스냅샷 API | 스냅샷-fork |`_makeSnapshot`/`_loadSnapshot`은 Pyodide 밑줄(실험) API. 버전 핀(v314.0.2)으로만 안전 | 버전 올릴 때 최우선 재검증 항목 |
52
+
| restore()의 힙 성장 처리 | 두 복원 경로의 성장 처리 동등 | restore()(전체 복원)는 base 범위 밖 성장 페이지를 되돌리지 않고, restoreLive는 명시 처리한다(비대칭). 다음 checkpoint의 성장분 루프가 체인을 다시 정합시키므로 실해는 없을 가능성이 높으나 미실측 | 열림(외부 리뷰 관찰). runtimeParity probe 후보 |
Copy file name to clipboardExpand all lines: mainPlan/web-python-runtime/03-progress-ledger.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@
4
4
5
5
## 결정 원장 (최신이 위)
6
6
7
+
### 2026-07-11 외부 리뷰 대응: restoreLive 경계 계약을 기계 강제로
8
+
9
+
- 외부 코드 리뷰의 최우선 지적("sound를 파는 라이브러리에서 soundness 전제가 강제되지 않는다") 수용. `Runtime.execSeq`(상태 변이 카운터: run/runAsync/setGlobal/install/loadPackages)로 경계 위반을 **O(1) 감지**해 restoreLive가 자동으로 재해시 경로로 승격. 실측: 위반 시 27.4ms 안전 복원, 준수 시 0.69ms 즉시 경로 유지(`rehashed` 플래그로 확인).
10
+
- 리뷰의 다른 지적 중 SIGINT 부재·버전 관문·OPFS 경제성은 리뷰 시점 이후 이미 해소됐음을 확인. "리액티브 과설계" 우려는 dartlab의 독립 재발명이 수요 반증. restore()의 힙 성장 비대칭 관찰은 계약 실태 표에 열린 항목으로 등록(probe 후보).
11
+
- 릴리즈 0.0.4(버전만. 태그 폐지 정책 확정: 표식은 package.json 하나, npm 퍼블리시 개시 시 태그를 절차의 자동 산출물로 재도입).
0 commit comments