@jetthai/cuora 1.1.488-dev.1 → 1.1.488

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/.claude/commands/sync-ai-prompts.md +1 -88
  2. package/.claude/settings.local.json +1 -3
  3. package/.github/copilot-instructions.md +6 -17
  4. package/.husky/post-checkout +3 -3
  5. package/.husky/pre-push +1 -1
  6. package/.prettierignore +1 -2
  7. package/AGENTS.md +6 -17
  8. package/AI_PROMPT_SOURCE.md +6 -17
  9. package/CHANGELOG.md +23 -420
  10. package/CLAUDE.md +6 -17
  11. package/GEMINI.md +6 -17
  12. package/package.json +1 -1
  13. package/scripts/auto-version.js +0 -1
  14. package/scripts/branch-auto-npm-publish.js +2 -9
  15. package/src/api/payment.js +0 -1
  16. package/src/machine/auth.js +33 -36
  17. package/src/machine/game_v2_1.js +0 -15
  18. package/src/machine/user_sign_up.js +0 -3
  19. package/src/machine/withdraw/withdraw_manual_cash.js +7 -17
  20. package/src/request/request.js +4 -103
  21. package/src/util/constant.js +0 -6
  22. package/e2e/feature-map.md +0 -19
  23. package/prepare-for-pr/JT-1776243420.md +0 -85
  24. package/prepare-for-pr/TI-16026/STATE.md +0 -18
  25. package/prepare-for-pr/TI-16026/after-prepare-authorization.md +0 -3
  26. package/prepare-for-pr/TI-16026/analysis.md +0 -38
  27. package/prepare-for-pr/TI-16026/answer-analyze-01.md +0 -1
  28. package/prepare-for-pr/TI-16026/answer-commit-01.md +0 -2
  29. package/prepare-for-pr/TI-16026/answer-commit-02.md +0 -1
  30. package/prepare-for-pr/TI-16026/bundle.json +0 -18
  31. package/prepare-for-pr/TI-16026/checklist.md +0 -196
  32. package/prepare-for-pr/TI-16026/checklist.unit-test-original.md +0 -39
  33. package/prepare-for-pr/TI-16026/claude-after-model +0 -1
  34. package/prepare-for-pr/TI-16026/claude-commit-session +0 -1
  35. package/prepare-for-pr/TI-16026/claude-harvest-session +0 -1
  36. package/prepare-for-pr/TI-16026/claude-hops/01-analyze.err +0 -1
  37. package/prepare-for-pr/TI-16026/claude-hops/01-analyze.out +0 -2
  38. package/prepare-for-pr/TI-16026/claude-hops/02-analyze.err +0 -1
  39. package/prepare-for-pr/TI-16026/claude-hops/02-analyze.out +0 -4
  40. package/prepare-for-pr/TI-16026/claude-hops/03-dev.err +0 -1
  41. package/prepare-for-pr/TI-16026/claude-hops/03-dev.out +0 -4
  42. package/prepare-for-pr/TI-16026/claude-hops/04-dev.err +0 -1
  43. package/prepare-for-pr/TI-16026/claude-hops/04-dev.out +0 -4
  44. package/prepare-for-pr/TI-16026/claude-hops/05-dev.err +0 -1
  45. package/prepare-for-pr/TI-16026/claude-hops/05-dev.out +0 -3
  46. package/prepare-for-pr/TI-16026/claude-hops/06-after.err +0 -1
  47. package/prepare-for-pr/TI-16026/claude-hops/06-after.out +0 -2
  48. package/prepare-for-pr/TI-16026/claude-hops/07-commit.err +0 -1
  49. package/prepare-for-pr/TI-16026/claude-hops/07-commit.out +0 -2
  50. package/prepare-for-pr/TI-16026/claude-hops/08-commit.err +0 -1
  51. package/prepare-for-pr/TI-16026/claude-hops/08-commit.out +0 -2
  52. package/prepare-for-pr/TI-16026/claude-hops/09-commit.err +0 -1
  53. package/prepare-for-pr/TI-16026/claude-hops/09-commit.out +0 -8
  54. package/prepare-for-pr/TI-16026/claude-hops/10-harvest.err +0 -1
  55. package/prepare-for-pr/TI-16026/claude-hops/10-harvest.out +0 -3
  56. package/prepare-for-pr/TI-16026/claude-hops/11-harvest.err +0 -1
  57. package/prepare-for-pr/TI-16026/claude-hops/11-harvest.out +0 -3
  58. package/prepare-for-pr/TI-16026/commit-note.md +0 -5
  59. package/prepare-for-pr/TI-16026/evidence-index.json +0 -215
  60. package/prepare-for-pr/TI-16026/feature-map.before.md +0 -61
  61. package/prepare-for-pr/TI-16026/harvest-redaction.json +0 -34
  62. package/prepare-for-pr/TI-16026/harvest-redaction.out +0 -37
  63. package/prepare-for-pr/TI-16026/harvest.md +0 -46
  64. package/prepare-for-pr/TI-16026/lessons.md +0 -5
  65. package/prepare-for-pr/TI-16026/note-harvest-redaction.md +0 -1
  66. package/prepare-for-pr/TI-16026/open-questions.md +0 -6
  67. package/prepare-for-pr/TI-16026/publish.md +0 -32
  68. package/prepare-for-pr/TI-16026/review-convergence-response.md +0 -3
  69. package/prepare-for-pr/TI-16026/review-input/scope.md +0 -18
  70. package/prepare-for-pr/TI-16026/review-log.md +0 -57
  71. package/prepare-for-pr/TI-16026/review-notes.md +0 -97
  72. package/prepare-for-pr/TI-16026/review-response-r1.md +0 -7
  73. package/prepare-for-pr/TI-16026/self-test-report.md +0 -67
  74. package/prepare-for-pr/TI-16026/spec-proposal.md +0 -34
  75. package/prepare-for-pr/TI-16026/spec-snapshot.md +0 -291
  76. package/prepare-for-pr/TI-16026/state-log.md +0 -57
  77. package/prepare-for-pr/TI-16026/user-messages/01.md +0 -12
  78. package/prepare-for-pr/TI-16026/user-messages/02.md +0 -20
  79. package/prepare-for-pr/TI-16026/user-messages/03.md +0 -1
  80. package/prepare-for-pr/TI-16026/user-messages/04.md +0 -1
  81. package/prepare-for-pr/TI-16026/user-messages/05.md +0 -1
  82. package/prepare-for-pr/TI-16026/user-messages/06.md +0 -1
  83. package/prepare-for-pr/TI-16026/user-messages/07.md +0 -1
  84. package/prepare-for-pr/TI-16026/user-messages/08.md +0 -1
  85. package/prepare-for-pr/TI-16026/user-messages/09.md +0 -1
  86. package/prepare-for-pr/TI-16026/user-messages/10.md +0 -1
  87. package/prepare-for-pr/TI-16026/user-messages/11.md +0 -1
  88. package/prepare-for-pr/TI-16026/user-messages/12.md +0 -1
  89. package/prepare-for-pr/TI-16026/user-messages/13.md +0 -1
  90. package/prepare-for-pr/TI-16026/user-messages/14.md +0 -1
  91. package/prepare-for-pr/TI-16026/user-messages/15.md +0 -1
  92. package/prepare-for-pr/TI-16026/user-messages/16.md +0 -1
  93. package/prepare-for-pr/TI-16026/user-messages/17.md +0 -1
  94. package/prepare-for-pr/TI-16026/user-messages/18.md +0 -10
  95. package/prepare-for-pr/TI-16026/user-messages/19.md +0 -1
  96. package/prepare-for-pr/TI-16026/user-messages/20.md +0 -1
  97. package/prepare-for-pr/TI-16026/user-messages/21.md +0 -1
  98. package/prepare-for-pr/TI-16026/user-messages/22.md +0 -1
  99. package/prepare-for-pr/TI-16026/user-messages/23.md +0 -8
  100. package/prepare-for-pr/TI-16026/user-messages/24.md +0 -24
  101. package/prepare-for-pr/TI-16026/user-question.md +0 -24
  102. package/prepare-for-pr/TI-16026/verify/metrics-check.json +0 -13
  103. package/prepare-for-pr/TI-16026/verify/redaction.json +0 -38
  104. package/prepare-for-pr/TI-16026/verify/row-closure.json +0 -45
  105. package/prepare-for-pr/TI-16026/verify/s04-ws-capture.md +0 -23
  106. package/prepare-for-pr/TI-16026/verify-after.md +0 -23
  107. package/prepare-for-pr/TI-16026/verify.json +0 -80
  108. package/prepare-for-pr/TI-16026.md +0 -408
  109. package/src/util/tokenStore.js +0 -44
  110. package/test/auth_self_timeout.test.js +0 -171
  111. package/test/request_self.test.js +0 -288
  112. package/test/withdraw_manual_cash.test.js +0 -149
  113. package/tests/session.test.mjs +0 -177
@@ -1,215 +0,0 @@
1
- {
2
- "taskId": "TI-16026",
3
- "formatVersion": 2,
4
- "generatedAt": "2026-11-18T09:19:41.360Z",
5
- "generator": "runner/evidence-index.mjs",
6
- "afterCommit": null,
7
- "result": "ok",
8
- "problems": [],
9
- "rows": [
10
- {
11
- "id": "U1",
12
- "title": "submitted 收到 REFRESH 後重新載入提款狀態",
13
- "kind": "CHANGE",
14
- "status": "PASS",
15
- "origin": "spec",
16
- "sources": [
17
- {
18
- "ref": "B01",
19
- "location": "正文 › 現行問題說明",
20
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
21
- },
22
- {
23
- "ref": "B03",
24
- "location": "正文 › 優化內容 › 流程 3",
25
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
26
- },
27
- {
28
- "ref": "B04",
29
- "location": "正文 › 前端需調整 › @jetthai/cuora bullet 1",
30
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
31
- }
32
- ],
33
- "via": null,
34
- "qualifiedBy": [],
35
- "found": null,
36
- "fix": null,
37
- "qa": null,
38
- "observation": "test asserts the state and request-count transition.",
39
- "states": {
40
- "submitted-refresh": {
41
- "proof": "measure"
42
- }
43
- },
44
- "showcase": [],
45
- "variantSummary": {
46
- "required": 0,
47
- "captured": 0
48
- },
49
- "problems": []
50
- },
51
- {
52
- "id": "U2",
53
- "title": "刷新回應沒有 pending order 時回到提款表單狀態",
54
- "kind": "CHANGE",
55
- "status": "PASS",
56
- "origin": "spec",
57
- "sources": [
58
- {
59
- "ref": "B03",
60
- "location": "正文 › 優化內容 › 流程 3",
61
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
62
- },
63
- {
64
- "ref": "B04",
65
- "location": "正文 › 前端需調整 › @jetthai/cuora bullet 1",
66
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
67
- }
68
- ],
69
- "via": null,
70
- "qualifiedBy": [],
71
- "found": null,
72
- "fix": null,
73
- "qa": null,
74
- "observation": "empty-order response clears the pending order and returns to loaded.",
75
- "states": {
76
- "empty-pending-order": {
77
- "proof": "measure"
78
- }
79
- },
80
- "showcase": [],
81
- "variantSummary": {
82
- "required": 0,
83
- "captured": 0
84
- },
85
- "problems": []
86
- },
87
- {
88
- "id": "U3",
89
- "title": "刷新回應仍有 pending order 時更新目前訂單",
90
- "kind": "CHANGE",
91
- "status": "PASS",
92
- "origin": "spec",
93
- "sources": [
94
- {
95
- "ref": "B03",
96
- "location": "正文 › 優化內容 › 流程 3",
97
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
98
- },
99
- {
100
- "ref": "B04",
101
- "location": "正文 › 前端需調整 › @jetthai/cuora bullet 1",
102
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
103
- }
104
- ],
105
- "via": null,
106
- "qualifiedBy": [],
107
- "found": null,
108
- "fix": null,
109
- "qa": null,
110
- "observation": "the new pending order replaces the original processing object.",
111
- "states": {
112
- "replacement-pending-order": {
113
- "proof": "measure"
114
- }
115
- },
116
- "showcase": [],
117
- "variantSummary": {
118
- "required": 0,
119
- "captured": 0
120
- },
121
- "problems": []
122
- },
123
- {
124
- "id": "U4",
125
- "title": "submitted 以外的 REFRESH 保留既有 bank 條件",
126
- "kind": "SAME",
127
- "status": "PASS",
128
- "origin": "ripple",
129
- "sources": [
130
- {
131
- "ref": "B04",
132
- "location": "正文 › 前端需調整 › @jetthai/cuora bullet 1",
133
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
134
- }
135
- ],
136
- "via": "`src/machine/withdraw/withdraw_manual_cash.js:159-160` — root REFRESH handler remains guarded by hasNoBank; the submitted-local handler does not replace it elsewhere.",
137
- "qualifiedBy": [],
138
- "found": null,
139
- "fix": null,
140
- "qa": null,
141
- "observation": "loaded with a bound bank remains loaded and does not issue another request.",
142
- "states": {
143
- "loaded-with-bound-bank": {
144
- "proof": "measure"
145
- }
146
- },
147
- "showcase": [],
148
- "variantSummary": {
149
- "required": 0,
150
- "captured": 0
151
- },
152
- "problems": []
153
- },
154
- {
155
- "id": "U5",
156
- "title": "payment-info 不因 windowType 而被丟棄",
157
- "kind": "CHANGE",
158
- "status": "N/A",
159
- "origin": "spec",
160
- "sources": [
161
- {
162
- "ref": "B05",
163
- "location": "正文 › 前端需調整 › @jetthai/cuora bullet 2",
164
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
165
- }
166
- ],
167
- "via": null,
168
- "qualifiedBy": [],
169
- "found": null,
170
- "fix": null,
171
- "qa": null,
172
- "observation": "current base code already forwards payment-info without a windowType filter.",
173
- "states": {},
174
- "showcase": [],
175
- "variantSummary": {
176
- "required": 0,
177
- "captured": 0
178
- },
179
- "problems": []
180
- },
181
- {
182
- "id": "U6",
183
- "title": "socket-to-order matching stays in client-pwa-cash",
184
- "kind": "CHANGE",
185
- "status": "N/A",
186
- "origin": "spec",
187
- "sources": [
188
- {
189
- "ref": "B02",
190
- "location": "正文 › 優化內容 › 流程 1–2",
191
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
192
- },
193
- {
194
- "ref": "B06",
195
- "location": "正文 › 前端需調整 › client-pwa-cash",
196
- "url": "https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907"
197
- }
198
- ],
199
- "via": null,
200
- "qualifiedBy": [],
201
- "found": null,
202
- "fix": null,
203
- "qa": null,
204
- "observation": "the spec assigns socket-to-order matching to client-pwa-cash; this package provides the REFRESH transition.",
205
- "states": {},
206
- "showcase": [],
207
- "variantSummary": {
208
- "required": 0,
209
- "captured": 0
210
- },
211
- "problems": []
212
- }
213
- ],
214
- "keep": []
215
- }
@@ -1,61 +0,0 @@
1
- # Feature map — per-repo scenario knowledge that outlives a bundle
2
-
3
- A task bundle is removed after delivery and commit (bundle-contract.md "Retention"), and with it everything the task learned about reaching its screens: routes, preconditions, selectors that held, states a site can or cannot show, and the methods that wasted runs. The feature map keeps that knowledge, per repo, for the next task. Model: pstack create-verification-skill "feature map" / control adapter.
4
-
5
- ## Where
6
-
7
- `<repoRoot>/e2e/feature-map.md`, beside `e2e/review-playbook.md`. Local only, never tracked: the repo's `.gitignore` or the global excludes file must ignore it. `call-claude.sh --stage harvest` refuses to run when `git check-ignore` does not report it ignored.
8
-
9
- The map holds per-feature knowledge. Repo-wide rules the review relies on stay in `e2e/review-playbook.md`, which the harvest never edits; a harvest finding that contradicts the playbook is reported, not written there.
10
-
11
- ## Format
12
-
13
- ```markdown
14
- # Feature map — <repo>
15
-
16
- Hints, not facts: verify any line you rely on with this task's own BEFORE capture.
17
- Each line ends with (observed YYYY-MM-DD <TASK-id>) = the last task that confirmed it.
18
-
19
- ## Repo-wide
20
-
21
- - <runtime gotcha that affects every feature: cause → workaround> (observed …)
22
-
23
- ## <screen or route> e.g. `/main` lobby — game cards
24
-
25
- - Entry: <route or menu path>; site <CONFIG_NAME>; viewport <w×h> (observed …)
26
- - Preconditions: <guest | logged-in, account kind only>; backend <dev|qa>; data <API path or fixture boundary> (observed …)
27
- - Selectors: <stable anchor> — `<file:line>` (observed …)
28
- - States: <state> — <how it is reached (fixture, fault, menu)> | unreachable on <site>: <evidence> (observed …)
29
- - Gotchas: <what failed, its proven cause> → <what works>; see measurement-recipes.md "<row>" when it applies (observed …)
30
- ```
31
-
32
- - One `##` section per screen or route; `## Repo-wide` first. Section keys use the screen names `repos.md` uses, so the analyze hop can find them.
33
- - Size cap: about 300 lines for the file, 25 lines per section.
34
- - Only what a capture, a measurement or the code showed. A guess, a plan not run, or "not found" without saying how far the search went (e.g. sub-menus not expanded) is either written with that limit or left out.
35
-
36
- ## Credentials (README hard rule 5a, text rule)
37
-
38
- The map is text evidence: no account value, password, token, test display name, or any value from `e2e/test-accounts.local.json`. Name an account by its kind ("logged-in member with a wallet", "the site's test account via `--auth accounts`"). The harvest stage runs `runner/redaction-check.mjs` on the map after Claude writes it and restores the previous map on any hit.
39
-
40
- ## Who reads it
41
-
42
- | Reader | When | How |
43
- | ------------------------------------------------ | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
44
- | Claude analyze hop (`/ui-baseline-codex` Step 1) | before writing `scenarios.mjs`, fixtures and selectors | read `## Repo-wide` and the sections for the screens in this repo's `repos.md` row; list the lines used under `## Feature map lines used` in `analysis.md` (section + line text) |
45
- | Claude verify-before hop (Step 2) | a capture failed | check the matching Gotchas before writing a Retake basis; a known cause with a known workaround is the Retake basis |
46
- | `/qa-fix` | writing "How to verify" | entry, site and preconditions for the screen; read only, never written (no runtime observation happens there) |
47
-
48
- ## Who writes it — the harvest hop
49
-
50
- Driver: after `NEXT: committed` (and after a supplement's delivery), **before** the bundle removal, Codex runs `call-claude.sh --stage harvest`. Always a new Claude session. Claude reads the bundle's text files and updates the map; the script backs the map up into the bundle, allows only the map to change, and runs the redaction check. Claude command "Harvest" holds the procedure. The same hop routes the run's other lessons (Codex's `lessons.md`) to a script check, `measurement-recipes.md` or a flow-file line — as proposals in `harvest.md` `## Lesson routing` for the user to approve; it writes nothing but the map. The bundle stays until the user has answered each proposal (bundle-contract.md Retention "When the removal runs").
51
-
52
- ## Pruning
53
-
54
- In this order, on every harvest, within the sections this task touched (and `## Repo-wide`):
55
-
56
- 1. **Invalidated by evidence** — a line this task's capture or code contradicts is replaced by the new observation (never kept beside it); a `file:line` that no longer exists is fixed or the line removed; a screen the code no longer has loses its section.
57
- 2. **Confirmed** — a line listed under `## Feature map lines used` in `analysis.md` that this task's BEFORE capture bore out gets this task's date and ID.
58
- 3. **Merged** — duplicates and lines that say the same thing are merged into one.
59
- 4. **Over the cap** — only then, remove the lines unconfirmed for longest (oldest `observed`). Age alone is a weak signal, so this is the last step, not the first.
60
-
61
- Claude writes `prepare-for-pr/{TASK-id}/harvest.md`: lines added, lines confirmed, every line removed with its reason (1, 3 or 4), and any contradiction with `e2e/review-playbook.md`. Codex copies it into the final report before the bundle is removed, so a removal stays visible.
@@ -1,34 +0,0 @@
1
- {
2
- "checkedAt": "2026-11-18T06:05:09.510Z",
3
- "roots": ["../../../../../../var/folders/s8/rjb4nddx2f1c_nl7p_wwz8kh0000gn/T/harvest-redaction.ow2KgXXZAY", "e2e/feature-map.md"],
4
- "valuesChecked": 6,
5
- "valueLengths": {
6
- "account#0": 21,
7
- "password#1": 8,
8
- "password#2": 8,
9
- "account#3": 9,
10
- "account#4": 9,
11
- "account#5": 5
12
- },
13
- "textFilesScanned": 1,
14
- "unscannedMedia": 0,
15
- "secretHits": [],
16
- "allowedValues": [],
17
- "contextNamesUsed": {
18
- "account#0": 0,
19
- "password#1": 0,
20
- "password#2": 0,
21
- "account#3": 0,
22
- "account#4": 0,
23
- "account#5": 9
24
- },
25
- "contextMasked": {},
26
- "contextExactNames": {
27
- "account#5": 1
28
- },
29
- "patternHits": [],
30
- "infoWordCounts": {
31
- "token": 1
32
- },
33
- "result": "ok"
34
- }
@@ -1,37 +0,0 @@
1
- {
2
- "checkedAt": "2026-11-18T06:05:09.510Z",
3
- "roots": [
4
- "../../../../../../var/folders/s8/rjb4nddx2f1c_nl7p_wwz8kh0000gn/T/harvest-redaction.ow2KgXXZAY",
5
- "e2e/feature-map.md"
6
- ],
7
- "valuesChecked": 6,
8
- "valueLengths": {
9
- "account#0": 21,
10
- "password#1": 8,
11
- "password#2": 8,
12
- "account#3": 9,
13
- "account#4": 9,
14
- "account#5": 5
15
- },
16
- "textFilesScanned": 1,
17
- "unscannedMedia": 0,
18
- "secretHits": [],
19
- "allowedValues": [],
20
- "contextNamesUsed": {
21
- "account#0": 0,
22
- "password#1": 0,
23
- "password#2": 0,
24
- "account#3": 0,
25
- "account#4": 0,
26
- "account#5": 9
27
- },
28
- "contextMasked": {},
29
- "contextExactNames": {
30
- "account#5": 1
31
- },
32
- "patternHits": [],
33
- "infoWordCounts": {
34
- "token": 1
35
- },
36
- "result": "ok"
37
- }
@@ -1,46 +0,0 @@
1
- # Harvest — TI-16026
2
-
3
- ## Map lines added
4
-
5
- - Repo-wide: no UI / no e2e playbook, evidence is unit tests + review.
6
- - Repo-wide: pre-commit hook runs prettier over ignored `prepare-for-pr/` even with `HUSKY=0`.
7
- - Repo-wide: env-prefixed `HUSKY=0 git commit` not matched by the allow pattern.
8
- - Repo-wide: `npm whoami` E401 although `NPM_TOKEN_WRITE` is set.
9
- - New section `withdraw_manual_cash machine`: entry, preconditions, selectors (`:40`, `:100`, `:159`), states, gotchas.
10
-
11
- ## Lines confirmed
12
-
13
- None (`analysis.md` listed no feature-map lines used).
14
-
15
- ## Lines removed
16
-
17
- - Whole previous content of `e2e/feature-map.md`: a verbatim copy of the shared `feature-map.md` contract, not repo knowledge (pruning rule 1). Backup: `feature-map.before.md`.
18
-
19
- ## Playbook contradictions
20
-
21
- None (`e2e/review-playbook.md` does not exist in this repo).
22
-
23
- ## Open runner work hit
24
-
25
- none
26
-
27
- ## Lesson routing
28
-
29
- 1. `HUSKY=0` does not stop the pre-commit `prettier --write .` over ignored `prepare-for-pr/` files — home: map (Repo-wide, written). A commit-hop hash check of `prepare-for-pr/` overlaps the existing guard; discarded as repo-specific.
30
- 2. `Bash(HUSKY=0 git commit:*)` was not matched by the `git commit` allow pattern — proposal below.
31
- 3. `NPM_TOKEN_WRITE` set but `npm whoami` E401 — home: map (Repo-wide, written); project-specific, no shared-file change.
32
-
33
- ### Proposal for 2
34
-
35
- 白話:這次提交時,Claude 被允許執行 `git commit`,但實際指令前面多了 `HUSKY=0`,權限比對不到,使用者批准後還要手動補一條允許規則才能提交。建議在呼叫 Claude 提交階段的腳本裡,直接把允許規則寫成同時涵蓋有環境變數前綴與沒有前綴的 `git commit`,這樣提交階段不會因為格式不同被擋住。不改的話,每個會用 `HUSKY=0` 的 repo 提交時都可能再卡一次。
36
-
37
- - Lesson: env-prefixed `HUSKY=0 git commit` is not matched by the `git commit` allow pattern.
38
- - Evidence: `user-question.md`, `answer-commit-02.md`, `claude-hops/09-commit.out`.
39
- - Target: `call-claude.sh` commit-stage `--allowedTools`.
40
- - Text: add `Bash(HUSKY=0 git commit:*)` next to `Bash(git commit:*)`.
41
- - Why no cheaper home: it is a permission flag, not a judgement; a script change is the cheapest.
42
- - Overlap: none known.
43
-
44
- ## User decisions
45
-
46
- - Proposal 2: 「不核准,維持現有設定」(2026-11-18). The shared Claude call script remains unchanged; no proposal was applied.
@@ -1,5 +0,0 @@
1
- # Lessons — TI-16026 (cuora-module)
2
-
3
- - The commit hop's `HUSKY=0` did not prevent the repository's pre-commit hook from running `npm run format` over the whole tree. It formatted globally ignored `prepare-for-pr/` files, including this task's review report and a report from another task. Evidence: `claude-hops/09-commit.out` and `STATE.md`. Do not rely on `HUSKY=0` to suppress repository hooks in a Claude tool subprocess; a future task needs a hook-safe, non-mutating format check or an explicit safe hook configuration before commit.
4
- - Claude's commit tool permission pattern did not match the environment-prefixed `HUSKY=0 git commit` command. After the user approved the commit, the `Bash(HUSKY=0 git commit:*)` allowance had to be added explicitly. Evidence: `user-question.md`, `answer-commit-02.md`, and `claude-hops/09-commit.out`.
5
- - A set `NPM_TOKEN_WRITE` variable did not establish usable npm authorization: `npm whoami` returned E401. Verify registry authentication before beginning the shared-dev release flow; evidence: `publish.md` and `STATE.md`.
@@ -1 +0,0 @@
1
- For the wrapper's local redaction check only, `e2e/test-accounts.local.json` is a temporary ignored symlink to the existing cash test-account file. Do not read, grep, or otherwise open this path; do not include its values in any response or write them anywhere. Continue the harvest normally. The symlink will be removed after the wrapper completes.
@@ -1,6 +0,0 @@
1
- # Open questions — TI-16026 (cuora-module)
2
-
3
- None open.
4
-
5
- - Q1 (answered 2026-11-17): how to verify this UI-less SDK repo. User: "A,不過修改後需要 publish cash 才有辦法驗證,而且 publish token 有改,有需要 publish 再叫我,或是先給我指令,我更新之後你就可以直接走到底". Meaning: no screenshot flow here; unit test + Codex review; a published version is needed before client-pwa-cash can verify; the publish command goes to the user now (`publish.md`).
6
- - Spec L3 second bullet (relax `windowType === 'toast'` in `websocket.js`): already satisfied, no change. `src/machine/websocket.js:296-302` forwards every `payment-info` as `ACTIVITY_INFO` + `PUSH_ANALYTICS` with no `windowType` check (`rg windowType src` = 0 hits). The CLAUDE.md §2.6 table row saying "Conditional: when `windowType === 'toast'`" is stale; fixing that doc row is out of scope unless asked.
@@ -1,32 +0,0 @@
1
- # Publish plan — TI-16026 (cuora-module)
2
-
3
- The user has authorized using the new cuora dev build for cash verification and asked to be told when publishing is needed or given the command. Publishing is performed by the user because the npm credential is not currently verified in Codex.
4
-
5
- ## Release steps
6
-
7
- 1. Update the local environment variable `NPM_TOKEN_WRITE` used by `.npmrc`; do not send the token in chat. In a new shell, run `npm whoami` from this repo. It must succeed before proceeding.
8
- 2. The reviewed fix is commit `219a415070e8c9ee23615b60a9942d6c4dc1b02c` on `feat/stone/JT-1791856380-ws-refresh`. This feature branch was cut from `master` and has diverged from `dev`; cherry-pick only this commit onto `dev`, rather than merging the whole feature branch.
9
- 3. In `cuora-module`, run:
10
-
11
- ```sh
12
- git switch dev
13
- git cherry-pick 219a415070e8c9ee23615b60a9942d6c4dc1b02c
14
- git push origin dev
15
- ```
16
-
17
- The `post-checkout` hook pulls the latest `origin/dev`. The `pre-push` hook calculates the next `{master_version}-dev.N`, runs `standard-version`, pushes the release commit and tag, then runs `npm publish --tag dev`. It exits 1 after its internal push; `Released 1.1.485-dev.N on dev` indicates release success.
18
-
19
- 4. If the hook reports that `npm publish` failed after pushing the release commit, run `npm publish --tag dev` from the release commit on `dev`; do not repeat the push. Confirm the successful published version and send Codex the exact `1.1.485-dev.N`.
20
- 5. Codex then pins the exact version in `client-pwa-cash/package.json` and lockfile, reviews the package delta, runs `npm install`, and continues AFTER verification.
21
-
22
- The direct command `npm publish --tag dev` from the feature branch is not the normal release path: it does not run the `dev` branch prerelease-version hook. The README and `scripts/auto-version.sh` / `.husky/pre-push` define the release path above.
23
-
24
- ## Completed release status
25
-
26
- The user later confirmed that cuora was published and installed in cash as `1.1.485-dev.0`. The current checkout is at tag `v1.1.485-dev.0`, and the reviewed task commit `219a415070e8c9ee23615b60a9942d6c4dc1b02c` is in its history. Codex did not push or publish. No additional cuora release is needed for this task.
27
-
28
- ## Authorization and gate
29
-
30
- The user said: 「A,不過修改後需要 publish cash 才有辦法驗證,而且 publish token 有改,有需要 publish 再叫我,或是先給我指令,我更新之後你就可以直接走到底」. The earlier `npm whoami` E401 is historical: the user later confirmed that `1.1.485-dev.0` was published and installed in cash. The completed release status is recorded above; no additional cuora push or publish is needed.
31
-
32
- The user also confirmed: 「A:依既有規則修改」 — cash handles only `withdraw_success` and `withdraw_rejected`, requires `subType === 'payment'` and strict `applyId` / `transactionId` match, and excludes `withdraw_returned`. The subtype is inferred from the existing cash deposit filter; TI-7046 does not document it.
@@ -1,3 +0,0 @@
1
- The driver ran `~/.agents/shared/ui-evidence/check-review.sh prepare-for-pr/TI-16026/review-log.md` after round r2 and it returned `converged`. A fresh whole-change convergence reviewer independently checked the base-to-working-tree change, verified F-r1-01 remains `ACCEPT` + `verified in r2: yes`, found 0 new findings, rewrote the r2 Impact block, reran the 6-case suite and read back the report/log/notes. The driver has updated STATE.md to `phase: review-response`.
2
-
3
- Please finish the developer response/loop closure per the review protocol and next-phase guidance. This SDK follows user choice A: no BEFORE/AFTER capture or Notion self-test page. Do not commit, merge, push, publish, or run npm commands in this hop. The user reported the local publish-token setup complete; the shared-dev merge/push authorization remains open in STATE.md/publish.md and must be resolved at the publish gate. After review closure, return the next action via the required first-line protocol.
@@ -1,18 +0,0 @@
1
- # Review scope — TI-16026 (cuora-module)
2
-
3
- ## Spec
4
-
5
- https://app.notion.com/p/3f8b399ad8b5801d81e9fb0675e50907
6
-
7
- ## Base
8
-
9
- c9186b6b3f424d74a9fe1363e64b17eb63809b58 (diff: base..working tree; the new test file is untracked)
10
-
11
- ## Consuming files
12
-
13
- Command: `rg -n withdraw_manual_cash src`
14
-
15
- - src/machine/withdraw/index.js:1
16
- - src/machine/withdraw/index.js:4
17
-
18
- Downstream consumer outside this repo: client-pwa-cash (sends `REFRESH`; its own TI-16026 bundle).
@@ -1,57 +0,0 @@
1
- # TI-16026 review log
2
-
3
- ## Round r1 — Codex — 2026-11-17 — reviewed c9186b6 working tree (base c9186b6)
4
-
5
- Comparison: `c9186b6b3f424d74a9fe1363e64b17eb63809b58` to the working tree on `feat/stone/JT-1791856380-ws-refresh`, including untracked `test/withdraw_manual_cash.test.js`. HEAD equals the base; the product change is uncommitted.
6
-
7
- No new product-code findings in the reviewed scope. Targeted tests: 4 passed, 0 failed, exit 0. The root REFRESH bank/no-bank pure-transition probe passed. A memory-only negative control forcing `hasNoBank=true` made the existing bound-bank regression test fail as expected (3 passed, 1 failed, exit 1). Commands, raw output, traced paths and exclusions are recorded in `prepare-for-pr/TI-16026.md` and `review-notes.md`.
8
-
9
- The initial `check-review.sh` returned exit 2 because this log did not yet exist; this is a new r1 log, with no earlier findings or decisions to reconcile. The driver explicitly prohibited reading STATE/checklist/author analysis and limited writes to this log, review notes and the report; those boundaries take precedence over the generic loop defaults.
10
-
11
- ### F-r1-01 [medium] A failed submitted refresh exits Pending and prevents a bound-bank retry
12
-
13
- - class: product-code
14
- - where: src/machine/withdraw/withdraw_manual_cash.js:101 (new path to loading.onError at :39–40)
15
- - trigger: submitted with an existing processing order and a bound bank; REFRESH is accepted, then getPendingOrder rejects ERR_998.
16
- - expected / actual: a failed status read must preserve Pending or expose a recoverable error until an empty pending-order response is confirmed / loading.onError enters loaded with the old processing object; a subsequent REFRESH is ignored because hasNoBank is false.
17
- - evidence: independent convergence reproduction E5 in prepare-for-pr/TI-16026.md uses the real initializer and a local request stub: first pendingOrder returns W-1, the second rejects ERR_998; observed loaded plus processing W-1, with pendingOrder calls remaining at 2 after retry. Path: :101 → :34/:277 → :39–40; no setInitData at :173 on failure; retry reaches :160/:227. Request ERR_998 rethrows without errorHandler at src/request/request.js:337–338.
18
- - proof: L4 ran
19
- - risk: a transient read failure exposes the form state even when an order may still be pending, and the cash consumer's submitted-only refresh path can no longer recover it. No duplicate transaction or downstream rendering was executed or claimed.
20
- - suggested action: preserve the previous pending state on refresh failure, or use an explicit retryable error state; distinguish a failed status read from a confirmed empty response and add a rejection-path regression test.
21
-
22
- #### Claude response
23
-
24
- - decision: ACCEPT
25
- - reason: reproduced the path as described; a rejected refresh must not be read as "no pending order".
26
- - fix: uncommitted — src/machine/withdraw/withdraw_manual_cash.js:39-40 `loading.onError` is now `[{ target: 'submitted', cond: 'isProcessing' }, { target: 'loaded' }]`. A refresh from `submitted` that rejects returns to `submitted` with the previous `processing` (setInitData does not run on error), where `submitted.on.REFRESH` accepts the retry regardless of `hasNoBank`. The first load has `processing: null`, so its failure still goes to `loaded` (unchanged). State names and the spec's `REFRESH → loading` are kept, so downstream `state.matches(...)` checks are unaffected. Regression tests in test/withdraw_manual_cash.test.js: "a failed refresh in submitted keeps the pending order and a later REFRESH retries" (2nd pendingOrder rejects ERR_998 → submitted + processing W-1; 3rd REFRESH → pendingOrder call 3 → loaded) and "a failed first load without a pending order still shows the form". `node --test test/*.test.js`: 22 pass, 0 fail.
27
-
28
- #### Codex follow-up (round r2)
29
-
30
- - verified in r2: yes (node --test test/withdraw_manual_cash.test.js: 6 passed, 0 failed, exit 0; bound-bank pending W-1 -> second pendingOrder rejects ERR_998 -> submitted retains W-1 -> next REFRESH makes call 3 and reaches loaded. loading.onError at src/machine/withdraw/withdraw_manual_cash.js:40 uses isProcessing (:229-230); failure skips setInitData (:172-184). First-load failure retains null processing and reaches loaded. A memory-only old-onError negative control fails exactly the new retry test: 5 passed, 1 failed, exit 1, Timed out waiting for submitted. Full r2 evidence is in prepare-for-pr/TI-16026.md.)
31
- - verified in r2: yes (fresh whole-change convergence reviewer independently traced the base-to-working-tree change before reading prior records, then reran all six targeted tests, the memory-only old-onError negative control and the root bank/no-bank probe. Results remain 6/6 pass, expected 5/6 negative-control pass with only retry failing, and both root boundaries pass. See C2-E1–C2-E4 in prepare-for-pr/TI-16026.md.)
32
-
33
- ### Impact
34
-
35
- - src/machine/withdraw/index.js:4 — unaffected: this direct consumer only exports the unchanged factory; no signature, event name or export mapping changes are required here.
36
- - src/machine/index.js:18 — unaffected: the import and spread at :54 forward the same withdrawal factory; this aggregation layer makes no state or error-handling decision.
37
- - src/index.js:2 — unaffected: the public machine export at :7 retains its object contract; the runtime risk to callers is recorded as F-r1-01 rather than an export-wiring defect.
38
-
39
- Round r1 result: 1 new findings (0 high, 1 medium, 0 low, 0 nit); re-raised: 0; out-of-scope dropped: 0
40
-
41
- ## Round r2 — Codex — 2026-11-17 — reviewed c9186b6 working tree (incremental after r1)
42
-
43
- Scope: verify the ACCEPT fix for F-r1-01 and affected successful paths only. HEAD remains c9186b6b3f424d74a9fe1363e64b17eb63809b58; r1 reviewed an uncommitted working tree. The r1 log/notes identify the previous loading.onError as unconditional loaded; r2 delta is the guarded onError and two error tests, not the original submitted REFRESH addition. Read review-log.md, review-notes.md and STATE.md in full before reviewing. Driver supplied the starting check-review result: not-converged: F-r1-01:accept-not-verified r1:1-new-findings.
44
-
45
- F-r1-01 verified yes above. No new product-code findings. Targeted suite: 6 passed, 0 failed, exit 0. Memory-only old-onError negative control: expected 5 passed, 1 failed (new retry case), exit 1. Read-only root REFRESH probe: no bank -> loading; bound bank -> loaded, exit 0. Normal loading, empty-order and replacement-order cases passed in the targeted suite. Commands and output are in the report; trace details and limits are in review-notes.md. No product files changed.
46
-
47
- Fresh convergence check: the reviewer first formed independent observations from the raw spec, scope input, full base-to-working-tree diff, complete untracked test and source, then read the full STATE/log/notes. Whole-change review found no additional product-code defect. Both submitted REFRESH success paths, guarded failure/retry, initial failure and root hasNoBank behavior were rechecked. The following Impact block replaces the incremental inventory with the complete internal consumer inventory for the full change; the external cash runtime remains outside this review. The driver owns the next check-review.sh call and STATE update.
48
-
49
- ### Impact
50
-
51
- - src/machine/withdraw/index.js:1/:4 — unaffected: directly forwards the same factory under withdraw_manual_cash; the full change adds submitted REFRESH and guards loading failure inside that factory without changing its parameters, export name or required wrapper behavior.
52
- - src/machine/index.js:18/:54 — unaffected: imports the withdrawal object and spreads its unchanged factory key; neither the new submitted transition nor retained processing on failure requires aggregation or event adaptation.
53
- - src/index.js:2/:7 — unaffected: exports the same machine object and therefore exposes the refreshed factory behavior without changing the public object shape; this layer has no state selection, order cache or error handling to update.
54
-
55
- Round r2 result: 0 new findings (0 high, 0 medium, 0 low, 0 nit); re-raised: 0; out-of-scope dropped: 0
56
-
57
- REVIEW CONVERGED — 2026-11-17, after r2 (driver check-review.sh: `converged`; checked by hand in this hop: r2 has 0 new findings, 0 re-raises, an Impact block, and F-r1-01 is ACCEPT with last verified = yes).