Skip to content

Commit 55ec91e

Browse files
committed
backup fix
1 parent ec77e00 commit 55ec91e

17 files changed

Lines changed: 2939 additions & 112 deletions

TODO.md

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

docs/en/TODO.md

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

docs/en/fixrisk_TODO.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,174 @@
1+
# 2026-03-11 v1.0.28
2+
3+
# RISK-CORRECTION EXECUTION UPDATE (MOBILE EVIDENCE MANIFEST + FRESHNESS/POLICY VERIFIER)
4+
5+
## ENGLISH DOCUMENT
6+
7+
### Remediation Status (This Slice)
8+
- [x] Upgraded mobile evidence capture from markdown-only to structured manifests:
9+
- [x] `scripts/capture-capacitor-device-evidence.js` now writes `acceptance_evidence.json`.
10+
- [x] Manifest includes structured device snapshot, artifact pointers, integrity metadata, and checklist states.
11+
- [x] Added rolling pointer `docs/mobile-evidence/latest.json` for deterministic verification.
12+
- [x] Added explicit evidence verifier `scripts/verify-capacitor-evidence-freshness.js`:
13+
- [x] Verifies latest manifest existence and artifact-file integrity.
14+
- [x] Enforces bounded freshness policy (`NOTE_CONNECTION_EVIDENCE_MAX_AGE_DAYS`, `1..365`, default `30`).
15+
- [x] Supports strict manual checklist policy (`NOTE_CONNECTION_REQUIRE_MANUAL_MOBILE_CHECKLIST`).
16+
- [x] Supports evidence-root override (`NOTE_CONNECTION_EVIDENCE_ROOT`) for controlled CI/fixture runs.
17+
- [x] Strengthened contract coverage and script wiring:
18+
- [x] Added `src/capacitor.evidence.contract.test.ts` (fresh/stale/manual-policy contract scenarios).
19+
- [x] Updated `src/mobile.pipeline.test.ts` for script wiring and key verifier/capture assertions.
20+
- [x] Added evidence contract suite to migration gate list in `package.json`.
21+
22+
### Best-Practice Compliance Delta
23+
- [x] Mobile evidence is now machine-readable and policy-verifiable instead of document-only.
24+
- [x] Freshness and manual-approval policy can be enforced deterministically.
25+
- [x] Regression contracts now cover evidence-policy behavior, not just script presence.
26+
- [ ] Remaining broader checklist items are unchanged in this slice (broader transport/storage refactors and production-scale parity tuning).
27+
28+
### Verification Snapshot (2026-03-11)
29+
- [x] `node node_modules/jest/bin/jest.js src/capacitor.evidence.contract.test.ts src/mobile.pipeline.test.ts src/server.migration.test.ts --runInBand` (**3 suites, 33 tests passed**)
30+
- [x] Migration matrix equivalent to `npm run test:migration`: **30 suites, 161 tests passed**
31+
- [x] Full Jest equivalent to `npm test`: **34 suites, 182 tests passed**
32+
- [x] Build pipeline equivalent to `npm run build` passed.
33+
- [x] Sidecar pipeline equivalent to `npm run build:sidecar` passed.
34+
- [x] WASM strict gates equivalent to `npm run test:wasm:parity:gates` passed.
35+
36+
---
37+
38+
# 2026-03-11 v1.0.27
39+
40+
# RISK-CORRECTION EXECUTION UPDATE (CONFIGURABLE CLIPBOARD INGRESS LIMIT + DIAGNOSTIC TELEMETRY)
41+
42+
## ENGLISH DOCUMENT
43+
44+
### Remediation Status (This Slice)
45+
- [x] Closed fixed-threshold clipboard ingress rigidity in `src/server.ts`:
46+
- [x] Added bounded env config `NOTE_CONNECTION_CLIPBOARD_BODY_LIMIT_MB`.
47+
- [x] Replaced fixed `8 MiB` limit with bounded effective limit (`default=64 MiB`, `min=1 MiB`, `max=512 MiB`).
48+
- [x] Added clamp/warning behavior for invalid or out-of-range configuration.
49+
- [x] Added runtime observability in `/api/runtime-diagnostics`:
50+
- [x] Exposes JSON request body limit.
51+
- [x] Exposes effective clipboard body limit (`bytes` + `MiB`) and configured bounds.
52+
- [x] Strengthened regression coverage in `src/server.migration.test.ts`:
53+
- [x] Added deterministic env override (`4 MiB`) for hermetic clipboard-limit contracts.
54+
- [x] Added diagnostics assertions for ingress limit telemetry.
55+
- [x] Updated oversized binary payload case to validate against configured limit.
56+
57+
### Best-Practice Compliance Delta
58+
- [x] Clipboard ingress is now configurable for high-scale payloads while remaining bounded for safety.
59+
- [x] Effective ingress constraints are now observable through runtime diagnostics (operability improvement).
60+
- [x] Contract tests now lock both behavior and telemetry for the new limit path.
61+
- [ ] Remaining broader checklist items are unchanged in this slice (mobile physical-device evidence and larger transport/storage refactors).
62+
63+
### Verification Snapshot (2026-03-11)
64+
- [x] `node node_modules/jest/bin/jest.js src/server.migration.test.ts --runInBand` (**1 suite, 22 tests passed**)
65+
- [x] Migration matrix equivalent to `npm run test:migration`: **29 suites, 158 tests passed**
66+
- [x] Full Jest equivalent to `npm test`: **33 suites, 179 tests passed**
67+
- [x] Build pipeline equivalent to `npm run build` passed.
68+
- [x] Sidecar pipeline equivalent to `npm run build:sidecar` passed.
69+
- [x] WASM strict gates equivalent to `npm run test:wasm:parity:gates` passed.
70+
71+
---
72+
73+
# 2026-03-11 v1.0.26
74+
75+
# RISK-CORRECTION EXECUTION UPDATE (GODOT CLIPBOARD BINARY-FIRST MIGRATION + FALLBACK CONTRACT LOCK)
76+
77+
## ENGLISH DOCUMENT
78+
79+
### Remediation Status (This Slice)
80+
- [x] Completed Godot client clipboard transport migration in `path_mode/scripts/reader_render_client.gd`:
81+
- [x] Clipboard upload now prefers `POST /api/clipboard/image-binary` (binary PNG).
82+
- [x] Preserved backward compatibility by retaining fallback to `POST /api/clipboard/image` (`pngBase64`).
83+
- [x] Added explicit dual-route failure reporting to avoid silent transport ambiguity.
84+
- [x] Added transport contract enforcement in `src/pathbridge.handshake.contract.test.ts`:
85+
- [x] Asserts binary endpoint usage in Godot client code.
86+
- [x] Asserts `HTTPRequest.request_raw(...)` binary path is present.
87+
- [x] Asserts base64 fallback path is still retained.
88+
- [x] Preserved rendering/runtime safety boundary:
89+
- [x] Godot runtime remains PNG-first.
90+
- [x] SVG remains diagnostics-only due to known direct-SVG instability in Godot runtime.
91+
92+
### Best-Practice Compliance Delta
93+
- [x] Clipboard path now avoids mandatory base64 expansion on the Godot client.
94+
- [x] Backward compatibility with older sidecars is retained through deterministic fallback behavior.
95+
- [x] Regression contracts now cover both server-side endpoint behavior and client-side transport intent.
96+
- [ ] Remaining broader checklist items are unchanged in this slice (mobile physical-device evidence and larger transport/storage refactors).
97+
98+
### Verification Snapshot (2026-03-11)
99+
- [x] `node node_modules/jest/bin/jest.js src/pathbridge.handshake.contract.test.ts src/server.migration.test.ts --runInBand` (**2 suites, 34 tests passed**)
100+
- [x] Migration matrix equivalent to `npm run test:migration`: **29 suites, 158 tests passed**
101+
- [x] Full Jest equivalent to `npm test`: **33 suites, 179 tests passed**
102+
- [x] Build pipeline equivalent to `npm run build` passed.
103+
- [x] Sidecar pipeline equivalent to `npm run build:sidecar` passed.
104+
- [x] WASM strict gates equivalent to `npm run test:wasm:parity:gates` passed.
105+
106+
---
107+
108+
# 2026-03-11 v1.0.25
109+
110+
# RISK-CORRECTION EXECUTION UPDATE (CLIPBOARD BINARY TRANSPORT PATH + PNG VALIDATION HARDENING)
111+
112+
## ENGLISH DOCUMENT
113+
114+
### Remediation Status (This Slice)
115+
- [x] Added binary clipboard upload path in `src/server.ts`:
116+
- [x] New endpoint `POST /api/clipboard/image-binary`.
117+
- [x] Accepts `image/png` and `application/octet-stream`.
118+
- [x] Uses bounded request-body ingestion with threshold spool-to-disk handling.
119+
- [x] Hardened payload validation for clipboard ingestion:
120+
- [x] Added PNG signature validation before invoking native clipboard bridge.
121+
- [x] Applied the same PNG validation guard to existing JSON/base64 endpoint (`/api/clipboard/image`).
122+
- [x] Added regression evidence:
123+
- [x] `src/server.migration.test.ts` now covers binary success, unsupported content-type (`415`), and oversized payload (`413`) contracts.
124+
125+
### Best-Practice Compliance Delta
126+
- [x] Clipboard transport no longer depends solely on base64 JSON payloads.
127+
- [x] Request ingress protection (limits + spool + explicit errors) remains enforced for both binary and JSON clipboard routes.
128+
- [ ] Remaining broader checklist items are unchanged in this slice (mobile physical-device evidence and larger transport/storage refactors).
129+
130+
### Verification Snapshot (2026-03-11)
131+
- [x] `npx jest src/server.migration.test.ts --runInBand` (**1 suite, 22 tests passed**)
132+
- [x] `npm run test:migration` (**29 suites, 157 tests passed**)
133+
- [x] `npm test` (**33 suites, 178 tests passed**)
134+
- [x] `npm run build`
135+
- [x] `npm run build:sidecar`
136+
- [x] `npm run test:wasm:parity:gates`
137+
138+
---
139+
140+
# 2026-03-11 v1.0.24
141+
142+
# RISK-CORRECTION EXECUTION UPDATE (SIDECAR SERVER SYNC-FS REMOVAL + CONTRACT GUARD)
143+
144+
## ENGLISH DOCUMENT
145+
146+
### Remediation Status (This Slice)
147+
- [x] Removed synchronous filesystem operations from `src/server.ts` runtime/request path:
148+
- [x] Runtime-data and spool directory provisioning now use `fs.promises.mkdir(...)`.
149+
- [x] Sidecar runtime-manifest writes now use `fs.promises.writeFile(...)`.
150+
- [x] CLI cache discovery and path fallback resolution now use async helpers.
151+
- [x] Preserved behavior while hardening robustness:
152+
- [x] Runtime manifest and cache-restore flows remain deterministic.
153+
- [x] Restore-cache path now ensures writable runtime-data directory before copy.
154+
- [x] Godot runtime contract remains PNG-first; no SVG runtime dependency introduced.
155+
- [x] Added regression contract to prevent reintroduction:
156+
- [x] `src/server.migration.test.ts` now verifies `src/server.ts` contains no `fs.*Sync` usage on runtime/request paths.
157+
158+
### Best-Practice Compliance Delta
159+
- [x] `No synchronous fs.* in server runtime/request path` is now remediated in `src/server.ts`.
160+
- [ ] Remaining broader checklist items are unchanged in this slice (mobile physical-device evidence and larger transport/storage refactors).
161+
162+
### Verification Snapshot (2026-03-11)
163+
- [x] `npx jest src/server.migration.test.ts --runInBand` (**1 suite, 19 tests passed**)
164+
- [x] `npm run test:migration` (**29 suites, 154 tests passed**)
165+
- [x] `npm test` (**33 suites, 175 tests passed**)
166+
- [x] `npm run build`
167+
- [x] `npm run build:sidecar`
168+
- [x] `npm run test:wasm:parity:gates`
169+
170+
---
171+
1172
# 2026-03-10 v1.0.23
2173

3174
# RISK-CORRECTION EXECUTION UPDATE (WASM TOPOLOGICAL RANK PARITY SLICE + STRICT EXPORT GATE ALIGNMENT)

0 commit comments

Comments
 (0)