myxce/.wolf/bugs/bug-1591.md
Rongsong Shen d26ff8870d
feat(buglog): one Markdown record per bug, checked against a record standard
The buglog was one 27K-line JSON file whose fields covered only symptom,
root cause and fix, as free text: 2% of entries named the code version a
bug was found on, 12% the build profile, 36% a way to reproduce, and 58% of
the file was OpenWolf hook auto-detections ("Missing guard clause",
"Function not marked async" on .md files).

- .claude/skills/buglog/bug-record.md: the record standard. Eight
  sections (Summary as the title, Description, Environment, Reproduction;
  Root cause, Fix, Verification, References once fixed), each with the
  content it must contain -- e.g. Environment needs the OS, the libc the
  failing binary loads (from its ELF interpreter: glibc 2.42 in the nix
  shell vs 2.40 on the host), toolchain, build profile and commit.
- .wolf/bugs/<id>.md: 500 records migrated from buglog.json; every field
  verified to round-trip. They carry legacy: true and an explicit "not
  recorded" where the old log had no such field; component derived from
  file paths, severity from keywords (else unknown), fix_commits from
  hashes in status_note/fix that git resolves (91 of 463 fixed).
- .wolf/buglog-archive.json: the 710 hook auto-detections, verbatim.
- .wolf/buglog.json is now an index generated from the records, keeping
  the fields OpenWolf's hooks and `openwolf bug search` read.
- scripts/buglog.py rewritten: new (template + Environment collected from
  the machine and --binary), check, status (refuses a status the record
  doesn't support; fixed needs Root cause, Fix, Verification and
  --commit hashes git resolves), note, recur, set, show, list, triage,
  env, index. 29 unittest cases in scripts/tests/test_buglog.py.
- scripts/git-hooks/pre-commit runs `check --staged`: incomplete staged
  records, a legacy record hand-changed to fixed without the fix-time
  sections, a new record claiming legacy: true, or a stale index refuse
  the commit.
- scripts/gitea-sync.py reads the records: issue body = the record's
  sections plus linked fix commits (origin remote, GITEA_COMMIT_REPO to
  override), and a body hash so an issue's text is refreshed when the
  record changes.
- bug-1866 rewritten to the full standard as the worked example.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 03:40:11 +00:00

4.5 KiB

id status status_updated status_note component severity timestamp last_seen occurrences files tags related legacy
bug-1591 fixed 2026-09-24 scheduler unknown 2026-08-19T03:45:00Z 2026-09-19T09:00:00Z 2
src/scheduler/src/repl_info.c (queued job: ~230
assigned job: ~356)
src/scheduler/src/repl_break.c (~665)
src/scheduler/src/sim_loop.c (~379
383
387)
src/scheduler/src/sim_verify.c (~293
325
335
346
373
380
389)
src/scheduler/src/driver.c (~652)
src/scheduler/src/core_events.c (~872
907
979)
src/scheduler/src/recording_session.c (~173) -- full raw-jobid-print inventory for the scheduler tree
not yet fixed
scheduler
repl
jobid
human-readable
logging
ux
not-yet-fixed
bug-1588
true

bug-1591: User-reported: (sim) info queue all in the scheduler's interactive REPL prints raw packed jobids…

Description

User-reported: (sim) info queue all in the scheduler's interactive REPL prints raw packed jobids instead of the human-readable form, e.g. [sim] queued job: jobid=4645085138445664257 priority=0 instead of the 'cluster-apiserver-timestamp-sequence' form (e.g. '3-1-1755590313-976') already used elsewhere in this codebase (bug-1588 fixed the same class of issue in src/controller/job.c's TRACE lines).

Environment

Not recorded (migrated from buglog.json).

Reproduction

Not recorded (migrated from buglog.json).

Root cause

Same class as bug-1588 (already fixed for src/controller/job.c): fmt_jobid()/fmt_jobid_ex() (src/lib/utils.c, declared src/include/utils.h:132-133) is the established human-readable jobid formatter already used elsewhere in this exact scheduler tree -- scheduler.c, handler.c, plugins/limit.c, plugins/fcfs.c, and even repl_info.c ITSELF at other call sites (e.g. line 119/143/184, per bug-1588's original grep) already call it correctly. The two sites the user's info queue all output actually exercises -- repl_info.c's 'queued job: jobid=%llu' (~230, the queue-dump command, info queue <name>|all) and its sibling 'assigned job: jobid=%llu' (~356, inside repl_info_worker_one, info worker <name>|all) -- were simply never converted, the same oversight bug-1588 already found and fixed in job.c. A broader grep of src/scheduler/src/ for the raw jobid=%llu/jobid: %llu pattern (see file field above) found ~15 more sites across repl_break.c (breakpoint-hit message), sim_loop.c/sim_verify.c (batch --sim DISPATCH/PEND/PREEMPT decision output and --sim-verify divergence reports), driver.c/core_events.c/recording_session.c (WARN/ERROR log lines for unknown-jobid and preemption-not-yet-implemented conditions) -- all likely candidates for the same fix, not yet individually confirmed to be in-scope (some may be deliberately terse WARN/ERROR paths where the raw id is acceptable; needs a per-site judgment call when this is picked up, not a blanket mechanical replace).

Fix

Fixed. All 15 raw jobid=%llu sites converted to fmt_jobid() across src/scheduler/src/repl_info.c (2), repl_break.c (1), sim_loop.c (3), sim_verify.c (7), driver.c (1), recording_session.c (1), core_events.c (3) -- same mechanical pattern as bug-1588's job.c fix. This intentionally changed observable REPL/--sim/--sim-verify output text, which broke 5 test binaries' assertions that hardcoded the OLD raw-numeric jobid format (e.g. strstr(captured, "jobid=4242")); updated all affected assertions in test_sim_alt_events.c, test_repl_execution_control.c, test_sim_event_loop.c, test_sim_verify.c, and test_repl_breakpoints_inspection.c to compute their expected marker strings dynamically via fmt_jobid() too, matching the existing precedent already used in src/controller/testsuite/test.c. Verified via two /xce-build scheduler asan --incremental runs: first run caught a genuine test regression (5 unexpected failures, all traced to the hardcoded-format issue above, not a production bug); after the test fixes, final run is Ok:41/Fail:1 out of 42 -- all 10 affected tests confirmed individually passing, the only remaining failure is the pre-existing unrelated bug-1560 (test_admin_request's symlink-escape test). One build-tooling wrinkle encountered along the way (not a code bug): an --incremental ninja run once silently skipped recompiling one changed test object, giving a stale Ok:40/Fail:2 result until the object was force-rebuilt -- worth a non-incremental rebuild if an --incremental result ever looks surprising.

Verification

Not recorded (migrated from buglog.json).

References

  • Related: bug-1588