[PR #39] Checking the Kakao and Apple Login Unattended Work Order Against the Code First
- What changed: No code was touched. A work order for an overnight run of the Kakao and Apple login work was written first.
- Decision: Before writing the order, the plan’s test lines were checked one by one against the current code, so the places where the overnight run would stop were found in advance.
- Still unknown: How Kakao and Apple actually respond was not checked. Only the code comparison was done.
PR #39 did not touch any code. It is the record of writing the unattended work order, the instructions for AI to work on Kakao and Apple login while no one is present, before any of that work began.
What was done and why
- Before writing the unattended work order (a work description for AI to follow while no one is present), the test lines in the plan were checked one by one against the current code. A test line is a check that must pass once the feature works.
- After writing the order, the plan was reviewed once more from the view of failures, attacks, and operations. Checking against the code shows whether the plan works as written. Reviewing from other angles shows failures the plan never mentioned.
- Both services answer from outside, so the tests need fake clients (stand-in objects used in place of the real services).
What the code check found
| Finding | Fix |
|---|---|
| No work item was assigned to the fake clients | The order allowed the test setup file to be changed |
| A rule against importing modules that do not exist yet conflicted with the plan | The work was split into three steps (skeleton, tests, implementation), and the skeleton’s shape was written into the order in advance |
| One error code was missing from the list (it only happens inside the server) | The app receives a general server error instead |
| A test passed although it should not have, because it inserted the link record directly | The test was changed to go through the login entrance |
| The “link ticket expires after 10 minutes” test needed a different order | The order is: move the clock first, then check the code |
| An invited user could not use a link ticket | Fixed: the request accepts one of a password or a link ticket, not both |
What the review from other angles added
- A failure path was missing from the plan: an Apple code exchange can fail on the first link. If the account is linked without a refresh token (a key that lets the server act later without a new login), the link cannot be removed on withdrawal. The direction the user chose is to refuse the link and return
apple_unavailable(a response meaning the service is temporarily unavailable). - The Kakao app ID check was placed in the service layer. If it sat inside the real client, end-to-end tests with the fake client would skip it.
- A link ticket is used once: the check and the use are one statement, so a second use fails. Kakao and Apple requests stop and return an error if no answer comes within 5 seconds. One test was added to confirm that login history stores no tokens.
Options considered
- The work was split into three steps. Two other options were rejected. If the test writer also owned the implementation’s interfaces, the roles would mix. If names were overridden with strings, one mistyped letter would silently use the real client.
- Apple failures return
apple_unavailable. A general server error would not let the app tell “try again later” from “the server is broken.” Linking without a token was rejected because it leaves the withdrawal gap open. - The encryption function takes its key as an argument. The plan had it use a key from elsewhere, but the unit tests need to swap the key, so the signature was changed.
How it was checked
- Claude opened the current test setup, error-code list, entities, and controllers and compared them with the plan’s test lines.
- Claude confirmed that the JWT library fetches remote keys only on first use, so the server makes no outside request at startup, and that the request log does not record bodies, so tokens cannot leak into logs.
- This PR did not run the code. The real Kakao response shapes and the 5-second limit cannot be checked with fakes, so they were left for a check on a real device.
Added after the merge
After PR #39 was merged, a fourth step was added to the same night-order file. That change is not part of PR #39; it lives on a separate work branch. The fourth step is a read-only review of what the earlier steps produced. It checks for missing test lines, weak tests, token leaks into logs, and whether the decisions in the order were followed in the code. The reviewer changes no code, tests, or documents; anything wrong goes into a report, and the fix is decided after the code has been checked.
Lessons
- A unattended work order needs no blanks. Checking it against the code before handing it over is the cheapest way to find them.
- A plan’s tests cover only the paths the plan names. Failure paths the plan never mentions show up only when someone reviews from another angle.
- Fake tests do not confirm a real service’s response shape or time limits. Those checks have to be written down as a separate real-device step.