Remove dead "daemon not yet ported" panic and four stale porting-era code comments #15

Open
opened 2026-08-09 03:45:38 +02:00 by clawbot · 0 comments
Collaborator

Problem

The port is complete, but the code still reads as if it is half-finished.
Five places claim work is pending that has in fact been done.

1. Dead panic("daemon not yet ported")

// game/daemons.go:8-17
func (g *RogueGame) runDaemon(id DaemonID, arg int) {
	h := g.data.daemonHandlers[id]
	if h == nil {
		// Handlers are added to the table as their subsystems are
		// ported; reaching one that isn't there is a porting bug.
		panic("daemon not yet ported")
	}

daemonHandlers in game/tables.go populates all 13 DaemonID values
(DRollwandDTurnSee), so this branch is unreachable. It is the only
panic("not implemented")-shaped construct in the repo and it makes the port
look unfinished to any reader.

2. Four stale "arrives with a later phase" comments

Location Claim Reality
game/daemons.go:5 "stomach() arrives with the endgame phase" stomach is at daemons.go:116
game/misc.go:5 "call_it arrives with the scroll/potion phase" callIt is at misc.go:563
game/game.go:149 "the player roll-up and first level arrive with later porting phases" New calls initPlayer() at game.go:194
game/game.go:270 "The final scoring display arrives with the endgame phase" quit calls g.score(...) at game.go:288

Definition of done

  1. The unreachable panic branch is resolved — either deleted (if the
    invariant is genuinely guaranteed by the table's construction) or
    kept with a corrected comment explaining it is a defensive invariant check,
    not a porting placeholder. State which you chose and why in the PR.
  2. The four stale comments are corrected to describe what the code does now,
    keeping the (file.c func_name) C-lineage breadcrumbs intact.
  3. A check that no other "arrives with", "not yet ported", "will be added",
    or similar porting-era language remains anywhere in the tree — grep for it
    and report what you found.
  4. make check fully green.
  5. TODO.md updated in the same commit.
  6. Commit title ends with (closes #N).

Implementation requirements

  • Zero behavior change. If deleting the panic branch, confirm first that
    every DaemonID really is populated — read tables.go and verify, do not
    assume. If any is not, that is a bug: stop and report it instead.
  • Do not remove or reword the (file.c func_name) breadcrumbs; they are
    deliberate and required by MEMORY.md.
  • Do not "tidy" anything else while in these files. Keep the diff surgical.
  • make targets only. Do NOT modify .golangci.yml.
  • Never mention Claude or Anthropic anywhere.

Note

This touches .go files, so it goes through normal adversarial review — it is
not eligible for the docs-only fast path even though it changes only comments.

## Problem The port is complete, but the code still reads as if it is half-finished. Five places claim work is pending that has in fact been done. ### 1. Dead `panic("daemon not yet ported")` ```go // game/daemons.go:8-17 func (g *RogueGame) runDaemon(id DaemonID, arg int) { h := g.data.daemonHandlers[id] if h == nil { // Handlers are added to the table as their subsystems are // ported; reaching one that isn't there is a porting bug. panic("daemon not yet ported") } ``` `daemonHandlers` in `game/tables.go` populates **all 13** `DaemonID` values (`DRollwand` … `DTurnSee`), so this branch is unreachable. It is the only `panic("not implemented")`-shaped construct in the repo and it makes the port look unfinished to any reader. ### 2. Four stale "arrives with a later phase" comments | Location | Claim | Reality | | --- | --- | --- | | `game/daemons.go:5` | "stomach() arrives with the endgame phase" | `stomach` is at `daemons.go:116` | | `game/misc.go:5` | "call_it arrives with the scroll/potion phase" | `callIt` is at `misc.go:563` | | `game/game.go:149` | "the player roll-up and first level arrive with later porting phases" | `New` calls `initPlayer()` at `game.go:194` | | `game/game.go:270` | "The final scoring display arrives with the endgame phase" | `quit` calls `g.score(...)` at `game.go:288` | ## Definition of done 1. The unreachable panic branch is resolved — **either** deleted (if the invariant is genuinely guaranteed by the table's construction) **or** kept with a corrected comment explaining it is a defensive invariant check, not a porting placeholder. State which you chose and why in the PR. 2. The four stale comments are corrected to describe what the code does now, keeping the `(file.c func_name)` C-lineage breadcrumbs intact. 3. A check that no other "arrives with", "not yet ported", "will be added", or similar porting-era language remains anywhere in the tree — grep for it and report what you found. 4. `make check` fully green. 5. `TODO.md` updated in the same commit. 6. Commit title ends with ` (closes #N)`. ## Implementation requirements - **Zero behavior change.** If deleting the panic branch, confirm first that every `DaemonID` really is populated — read `tables.go` and verify, do not assume. If any is not, that is a bug: stop and report it instead. - Do not remove or reword the `(file.c func_name)` breadcrumbs; they are deliberate and required by MEMORY.md. - Do not "tidy" anything else while in these files. Keep the diff surgical. - `make` targets only. Do NOT modify `.golangci.yml`. - Never mention Claude or Anthropic anywhere. ## Note This touches `.go` files, so it goes through normal adversarial review — it is not eligible for the docs-only fast path even though it changes only comments.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/rgoue#15