Repository navigation
adopt-project.py and scripts/repo_shape.py: a float that overflows is said as "the number inf", and a plain integer of more than 4300 digits ends check and execute in a ValueError traceback instead of yaml-unparsable (RV1198's NIT-1 and NIT-2 on #1198, both older than it; follows #1114) #1212
Description
(lane openRepoShape-4, 2026-10-23T18:00:03Z)
Found by: RV1198 and RV1198-cont, the independent review of PR #1198 (for #1114) at d38e4e36 (#1198 issuecomment-6365427244, #1198 (comment)). It graded #1198 READY, with no MUST and no SHOULD, and three NITs. NIT-1 and NIT-2 predate #1198, are equally true on main, and need follow-up issues: they are this issue. The third NIT is about #1198's body alone and is not part of it. This follows #1114 and #1198.
The measurements below are RV1198-cont's, taken through check and execute on a scratch merge of #1198's head with main 961640c68 (Python 3.12.3, where sys.get_int_max_str_digits() is 4300; the review says CI's 3.14 has the same default), with the real gh kept unreachable. The probe is RV1198's probe_bigint.py (<clone> <fresh base dir>), and its output is in the lane's scratch, rv1198/probe/bigint-120609.txt. #1198 is open and not on main. Line numbers are approximate, read on main ac5f28d2a (2026-10-23): _read_as is at adopt-project.py about :8371, and _scalar and load_yaml at scripts/repo_shape.py about :580 and :1321. The reader is scripts/repo_shape.py, and #1198 changes none of it (0 diff lines).
I also ran the reader alone on main ac5f28d2a's scripts/repo_shape.py (Python 3.12.3, parse_yaml("k: <value>\n")), to see that both still hold there:
4300 digits -> int 1111111111...
4301 digits -> raised ValueError Exceeds the limit (4300 digits) for integer string conversion: value has 4301 digits; use sys.set_int_max_str_digits() ...
400 ones .5 -> float inf
300 nines .5 -> float 1e+300
What is wrong
NIT-1: a float that overflows is said as "the number inf", a number this reader would never read
_scalar reads -?\d+\.\d+ with float(text), so a decimal that overflows is inf, and one of 300 digits is 1e+300. _read_as says a number with {value!r}, so:
- a
commit:of four hundred1s followed by.5, incheckand inexecute, on the merge:records `commit:` as the number inf, which is not text. The probe'sfloat-overflow-commitrow:checkexit 1,executeexit 2,FINDING plan-pin-malformed, no traceback, noghcall. - a
commit:of three hundred9s followed by.5reads "the number 1e+300" (RV1198's probe). - This reader reads
infand1e+300as text, never as numbers, so "the number inf" names a value no plan holds: it stands for every float that overflows, and typinginfinto the plan gives the textinf. Onmain, before adopt-project.py:_pin_row_problemsays a pin field whose value is not text as_read_assays what the plan's reader read, "recordscommit:as the number 7", where it spelled it as Python does,commit: 7andTrue, socheckandexecutename it in the words the plan's other refusals use under the sameplan-pin-malformed(#1114) #1198, the same values read ascommit: inf(Python'sreprin_pin_row_problem). - Fix, the review's: have
_scalarrefuse a decimal whose float is not finite, asyaml-unparsable. Then have_read_assay a float in a form this reader reads back as that number, with no exponent and noinf, in place ofrepr.
NIT-2: a plain integer of more than 4300 digits ends check and execute in a ValueError traceback
_scalar's int(text) raises ValueError: Exceeds the limit (4300 digits) for integer string conversion, and load_yaml catches only YamlError, so nothing turns it into a refusal. From the probe, on the merge:
| Row | check |
execute |
|---|---|---|
commit: of 4301 digits (int-4301-digits-commit) |
exit 1, Traceback, ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 4301 digits; use sys.set_int_max_str_digits() to increase the limit |
exit 1, the same traceback |
a top-level key probe_extra: of 4301 digits, outside pins: (int-4301-digits-outside-pins) |
exit 1, the same traceback | exit 1, the same traceback |
commit: of 4300 digits (int-4300-digits-commit) |
exit 1, FINDING plan-pin-malformed: `pins:` entry 1 ('openGlass') records `commit:` as the number 1111... , no traceback |
exit 2, REFUSED plan-pin-malformed, no traceback |
- Every row:
gh-calls=0andremotes-made=False. So the fault is in the reader, not the pin rows, and it ends the run before anything is asked or made. - 4300 digits is an ordinary finding, as it should be. The line is at 4301.
- Fix, the review's: catch the
ValueErrorin_scalarand raise aYamlErrorthat names the line, so that it isyaml-unparsable. (A fix that counts digits beforeint()would do as well. What matters is that a plan in which the reader cannot make a number is a refusal and not a traceback, at anyint_max_str_digitssetting.)
The probe, in the part that matters (the rows are built from a plan planned(...) wrote, with pins: [] replaced):
def pin(commit):
return ("pins:\n - product: openGlass\n repository: opensoft/openGlass\n"
f" commit: {commit}\n tree_sha256: \"{DIGEST}\"\n"
" digest_source: gh-api-tree-recursive\n")
rows = {
"int-4301-digits-commit": text.replace("\npins: []\n", "\n" + pin("1" * 4301), 1),
"int-4300-digits-commit": text.replace("\npins: []\n", "\n" + pin("1" * 4300), 1),
"float-overflow-commit": text.replace("\npins: []\n", "\n" + pin("1" * 400 + ".5"), 1),
"int-4301-digits-outside-pins": text + "probe_extra: " + "1" * 4301 + "\n",
}
# each row: check --plan P --local-remote-dir D ; execute --plan P --local-remote-dir D --yes --work-dir WDone when
- A
commit:of 4301 digits, and a top-level key of 4301 digits, endcheckandexecutein ayaml-unparsablerefusal that names the line, with no traceback; 4300 digits is still theplan-pin-malformedfinding. - A
commit:of1* 400 +.5is refused by_scalar, or_read_assays it withoutinfand without an exponent, and9* 300 +.5without1e+300. - The pin rows' wording adopt-project.py:
_pin_row_problemsays a pin field whose value is not text as_read_assays what the plan's reader read, "recordscommit:as the number 7", where it spelled it as Python does,commit: 7andTrue, socheckandexecutename it in the words the plan's other refusals use under the sameplan-pin-malformed(#1114) #1198 puts in (records `commit:` as the number 7, which is not text) is unchanged for a number the reader reads as itself.
Lane: openreposhape-4 (openRepoShape-4)
Activity
brettheap commentedon Oct 24, 2026
CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-10-24T14:10:55Z, for #1212
Logged in
lanes/log/openRepoShape-4.mdatcb56d2fc1146380c21ed57980952a9bc45d55321.The three reads (lane-collision-protocol Rule 1):