Record whether a problem has a forum thread - #384
Conversation
data/problems.yaml carried no signal that a problem has a discussion thread on
erdosproblems.com, so anyone working from the export -- which is the natural
entry point for bulk or automated work -- was routed away from where the
subject-matter discussion actually is.
update_forum_status.py parses the forum index, which lists every thread on one
page, and records a post count per problem. `forum` is derived like
`formalized`, and a problem with no thread carries no key at all, so the
field's presence is the signal.
Only the post count is taken. The index dates threads relatively ("a month
ago"), so an exact last-post date would mean fetching all ~900 threads
individually -- much heavier for much less, and better left out than
approximated.
The workflow is manual-only; adding a schedule is a maintainer's call.
Generated by scripts/update_forum_status.py against the forum index. Purely additive: 901 problems gain a `forum` block, nothing else moves.
|
Reviewed. The engineering here is in good shape: the data change is purely additive (exactly 901 One thing to resolve before this goes in, about coverage rather than correctness. The PR says non-problem threads are "the site's own Those are tied to a specific problem, so What that costs, measured against today's index:
I don't think this is obviously a bug — there's a reasonable position that a proof claim is a distinct object and shouldn't be folded into a single Three options, roughly in increasing order of work:
My inclination is (1) or (3) — folding them into one number loses a distinction that looks worth keeping. Your call, and Terry's. One smaller note: unlike |
The index carries 235 proof-claim threads coded <number>/proof-claims#proof-claim-<id>, which code.isdigit() dropped along with the blog and named topic threads. They are tied to a problem, so 13 problems whose only discussion is a proof claim got no forum key at all, and 110 more understated their discussion. A proof claim is a distinct object from a thread, so rather than folding it into posts, record proof_claims (how many claims) and proof_claim_posts (posts in reply to them). The index badges a claim only once it has replies, so an unanswered claim counts in the former and not the latter; the claim itself is never counted as a post. Also document the named topic threads as a second skipped kind, and note on the delete path that it assumes the index is a single page.
|
Thanks — you were right that the description undercounted the skips, and I went with option (3) in 8b6701f.
forum:
posts: 13
proof_claims: 2
proof_claim_posts: 2One thing I had to settle to make (3) work: the index badges a proof-claim item only once it has replies — 78 of the 235 carry a Reproducing your measurements on today's index: 1153 items, 901 problem threads, 235 proof claims over 123 problems, 7 On the smaller note: the delete path now carries a comment saying it assumes the index is a single page, and that the zero-thread guard only catches a total parse failure, not a partial one. The description and the |
Closes #370.
data/problems.yamlcarried no signal that a problem has discussion on erdosproblems.com. The export is the natural entry point for bulk or automated work, so anyone starting there is routed away from where the subject-matter discussion actually is — which is what the issue was filed about.scripts/update_forum_status.pyparses the forum index, which lists every thread on a single page, and records per problem:forumis derived, likeformalized, and a problem with no discussion carries no key at all — so the field's presence is itself the signal. The script followsupdate_formalization_status.py: same YAML round-trip, same--checkmode asderive_status.py.What the index contains, and what is counted
The index has 1153
thread-itemblocks, of three kinds:posts.<number>/proof-claims#proof-claim-<id>, spread over 123 problems. These are tied to a problem but are a distinct object — a claimed proof, plus whatever discussion it drew — so they are counted separately rather than folded intoposts:proof_claimsis how many claims the problem has,proof_claim_postshow many posts were made in reply to them. The index badges a claim only once it has replies (78 of the 235 carry a badge), so an unanswered claim counts inproof_claimsand contributes nothing toproof_claim_posts; the claim itself is never counted as a post.blog:N) and 10 named topic threads (Site suggestions, Formalisation, AI Contributions, and so on). Both kinds are skipped.Counting the proof claims matters for the issue: 13 problems have a proof claim and no thread of their own — 117, 119, 131, 319, 416, 424, 450, 538, 634, 653, 882, 959, 1059 — and under a problem-threads-only reading the export would still report no discussion for them. A further 110 have both.
Only counts are recorded. The issue suggested
last_posttoo, but the index dates each thread relatively ("a month ago"), so an exact date would mean fetching all ~900 threads individually. That is a much heavier job for a much smaller gain, and I would rather leave it out than approximate it. Easy to add later if you want it.The workflow is
workflow_dispatchonly. Adding a schedule is your call, not something a contributor should switch on for you.Evidence
Run against the live index today:
(5191 posts in problem threads, 244 in reply to proof claims.) The issue measured 894 threads / 5121 posts on 2026-07-30, three weeks earlier — consistent growth, which is the cross-check I wanted before trusting the parse. Every thread and proof-claim code maps to a problem in the export, with no orphans, and the export's 1217 problems match the issue's count exactly.
After the update:
scripts/validate.pyis✅ Validation OK.,derive_status.py --checkis up to date,generate_readme.pyreports the README already up to date (no column was added), and a secondupdate_forum_status.py --checkreports no drift, so the script is idempotent.The data change is purely additive apart from two post counts that moved with the live index since the first commit.
The schema gains a
forumentry, needed because the schema isadditionalProperties: false. Each of the three keys is an integer>= 1and is omitted when its count is zero, withminProperties: 1so an emptyforumis rejected;additionalProperties: falsestill rejects an unexpectedlast_post.Uncertainty
The script parses HTML with a regex over
<li class="thread-item">blocks. That is fine for a page this regular and avoids a new dependency, but it will need a touch if the forum markup changes. It fails loudly rather than quietly if it parses nothing — a zero-thread result is treated as "the markup moved", not as "no problem has a thread", so a rendering change can never strip the field from every entry. That guard does not catch a partial failure, though: the script deletesforumfor any problem missing from the listing, which assumes the index really is one page. There is now a comment on the delete path saying so.This was AI-assisted.