myxce/.wolf/bugs/bug-1856.md
Rongsong Shen 84a93a0199
chore: wrap-up -- spec phase, roadmap ticks, Gitea sync
- job-array-one-based-index spec.json phase -> implementation-complete
- roadmap: job-array-one-based-index entry updated (validated, bugs
  fixed); 7 implemented specs ticked (component-failover-adoption,
  config-upgrade-snapshot, ha-term-safety, job-array-single-wal-record,
  raft-sim-conformance, scheduler-sim-diagnostics, worker-rejoin-resync)
- Gitea #89 (bug-1856, wontfix), #331 (bug-1880), #335 (bug-1884) closed;
  records carry the synced status

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 08:57:39 +00:00

3 KiB

id status status_updated status_note component severity timestamp last_seen occurrences files tags related legacy gitea_issue gitea_synced_status gitea_synced_hash
bug-1856 wontfix 2026-10-02 upstream OpenWolf defect; mitigated durably by auto_detect=false (kept by openwolf update) and the pre-commit stale-index check; fix belongs in OpenWolf unknown unknown 2026-09-24T09:39:50Z 2026-09-24T09:39:50Z 1
.wolf/hooks/post-write.js
.wolf/config.json
openwolf
buglog
upstream
bug-1630
true 89 wontfix 7cb91d8459cb

bug-1856: OpenWolf post-write hook numbers auto-detected bugs bug-<count+1>, duplicating ids in a sparse buglog

Description

OpenWolf 2.5.0 post-write hook would create a duplicate bug id: autoDetectBugFix numbers new entries bug-<len(bugs)+1> (next: bug-1194), but ids run to bug-1854 and bug-1194 already exists

Environment

Not recorded (migrated from buglog.json).

Reproduction

Not recorded (migrated from buglog.json).

Root cause

Upstream OpenWolf hook (.wolf/hooks/post-write.js autoDetectBugFix, nextId = bugLog.bugs.length + 1) assumes ids are dense and never renumbered; this buglog's ids are sparse after renumbering/consolidation (see bug-1630). The hook also never sets the project's status field.

Fix

Not fixed here -- upstream defect, closed wontfix 2026-10-02 (user decision). Reviewed against OpenWolf 2.5.0 (nix openwolf-2.5.0, built from the npm tarball): .wolf/hooks/post-write.js autoDetectBugFix() still numbers new entries bug-<bugs.length + 1> (line 337) and appends them straight to buglog.json. This repo's copy is the package's file unchanged (only a trailing source-map comment differs), and openwolf update (dist/src/cli/update.js, copyHookScripts) overwrites .wolf/hooks on every update, so a local patch would be silently reverted.

Mitigation, durable in this repo:

  • .wolf/config.json openwolf.buglog.auto_detect: false -- autoDetectBugFix() returns before touching the log (bugAutoDetectEnabled()); openwolf update only adds missing config keys (mergeConfigDefaults), never overwrites this one.
  • bug records are .wolf/bugs/<id>.md, created only by scripts/buglog.py new; buglog.json is a generated index, and the pre-commit hook rejects a stale index ("buglog.json is stale: run python3 scripts/buglog.py index", seen 2026-10-01), so any entry a hook did append would be caught before commit. The fix belongs in OpenWolf: derive the next id from the highest existing id (or let the project own numbering) and leave status to the project.

Verification

  • Test: n/a (no code change); reviewed post-write.js lines 290-350 and update.js 2026-10-02 against the installed 2.5.0 package
  • Suites: n/a
  • Live: auto_detect: false present in .wolf/config.json; of the 537 records, 3 carry the auto-detected tag (bug-1462, bug-1463 from 2026-07-23; bug-1841 from 2026-09-22) -- all real, fixed records with unique ids, no duplicate id among them

References

  • Related: bug-1630
  • Gitea: #89