[PR #13] The Assumption That Reference Values Live in the Old Code Was Wrong
- What changed: Before building the calculation feature, the old code, data, and tables were read to organize one document on where the reference values are and what is missing.
- Decision: The work order was set as 6 → 4 → 5, and ‘verified’ is attached only after a headquarters expert confirms a value.
- Still unknown: Answers to the questions for the experts are needed before reference values can be marked as verified.
This is the record of a PR that checked “where the reference values live and what is missing” before building the calculation features, and saved it as one document. No code changed; only the summary document and this PR’s work log went in.
What I did and why
- Claude organized items 4 to 6 of milestone M0 (verifying the reference data, growth and work rules, reading the old backend source) into one document.
- The purpose is to settle three things before building sub-milestone 3 (the daily calculation) and sub-milestone 4 (the quest, a feature for work rules): which reference values exist, what is missing, and what to ask the head-office experts.
- What Claude and I decided:
- The order is 6 → 4 → 5. The old source is the material for items 4 and 5.
- Dump files (files that save the whole content of a database) are read, but table names are looked at first and only the reference-value tables are opened.
- “Verified” is attached only after a head-office expert has confirmed it. Values that were merely matched across sources are “test values”.
The options I chose and the ones I dropped
- The dump was not relied on. The old system kept its reference values in the database, but the two dumps Claude read contained only one table, an equipment status log. No rows were opened. Instead, one sheet of the 2022 reference table was taken as the source of the reference values. That sheet holds elapsed days 1 to 123 in one-day steps.
- The old code was read for its history, not just the final version. Claude found that in the 2023-09-15 commit two correction tables (the survival-rate table and the temperature-based rate table) stopped being used. From the final version alone, Claude would have wrongly written that “the old system did not use temperature”.
- The rules were not decided; they were put forward as proposals. Rules such as head count, temperature correction and starting elapsed days are field-expert judgments, so Claude wrote only a recommendation with reasons and gathered them into questions for head office.
- The milestone document was not changed. Claude wrote three other facts (2,049 quest rows, the night job generating sensor values, a D+30 rule at the move point) into the new document and told me. I decide whether to change the milestone document.
How I checked
- There was no tool to read Excel files, so Claude unpacked the XML inside the Excel file with the standard library and extracted the text and formulas. At first the Korean text came out garbled. The cause was that Python was run in isolated mode (
-I), which ignores the output encoding setting, and it was fixed by specifying UTF-8 inside the script. - Claude checked that the example calculation (putting in head count, elapsed days, weight and temperature to get the daily amount and the amount per time) matches the calculated values in the 2022 sheet. It will be the first case in the automated tests for sub-milestone 3.
- Claude re-checked the starting elapsed days example and the comparison values of the three growth curves against the original tables.
- Personal names, old server addresses and secret values were not put in the document.
What I learned
- The lesson from this work is that the assumption “the reference values will be in the old code” was wrong. Values that are edited on an admin screen live in the data, not in the code. In the next system, the reference data should also be kept as files outside the database so the same thing does not repeat.