Repository navigation
simplify: remove verified no-op machinery - #571
itsmiso-ai wants to merge 1 commit into
Conversation
…predicate, no-op dedup) - main.gd: drop the never-assigned 'tick' and 'active_goal' property setters; both properties are read-only in practice (zero assignments repo-wide), callers write state['tick']/state['active_goal'] directly. - main.gd: _is_valid_event_entry now uses ColonySim.is_numeric instead of a local duplicate of the same typeof predicate, matching the single-implementation pattern game_state.gd documents for _is_numeric. - rotating_goal.gd: rotate_after_completion built a deduplicated copy of completed_ids before selection, but select_next_active_goal only reads membership (Array.has), so order and duplicates cannot change the result. Append the completed goal id and pass the array through; duplicate() preserves the original's no-mutation-of-caller contract.
There was a problem hiding this comment.
{"schema":"review-handoff/v1","review_id":"a396a23d16327597","head_sha":"fb8dfffde7dc27ebc0a03079208bb7e5835649ce","verdict":"approve","review_result":"findings","required_checks":"none","items":[{"id":"3504301e17ba7ae6b080cef60591fbdf50d763c4cd3f536d1cc6adfe024ca285","severity":"info","category":"style","path":"scripts/rotating_goal.gd","line":132,"message":"The four-line comment explaining the removed dedup pass could be trimmed to one line per the AGENTS.md source-comment convention (the non-obvious why fits in a single line)."},{"id":"2c3891065d1a5d26341a7e73a810c61cca7733aad3622142359640015c434ce4","severity":"info","category":"docs","path":"scripts/main.gd","line":2213,"message":"The new two-line comment restates the existing doc block above `_is_valid_event_entry`; folding the single-definition rationale into that block would avoid duplicated prose."}],"items_total":2,"items_truncated":false,"unresolved_requirement_ids":[],"unresolved_requirement_ids_total":0,"unresolved_requirement_ids_truncated":false,"unresolved_requirement_ids_source_total":0,"unresolved_required_checks":[],"unresolved_required_checks_total":0,"unresolved_required_checks_truncated":false,"unresolved_required_checks_source_total":0,"unresolved_review_obligations":[],"unresolved_review_obligations_total":0,"unresolved_review_obligations_truncated":false,"derived_obligation_state":null}AI Automated Review
✅ Automated recommendation: APPROVE
Full PR review.
Analysis engine: MiniMax-M3.1-Flash (anthropic) — primary route · pr-reviewer-action v3.11.2
Findings (2 info)
| Severity | Location | Finding |
|---|---|---|
| Info | scripts/rotating_goal.gd:132 |
The four-line comment explaining the removed dedup pass could be trimmed to one line per the AGENTS.md source-comment convention (the non-obvious why fits in a single line). |
| Info | scripts/main.gd:2213 |
The new two-line comment restates the existing doc block above `_is_valid_event_entry`; folding the single-definition rationale into that block would avoid duplicated prose. |
Recommendation: approve — behavior-preserving cleanup; all three changes verified against current-head sources.
Findings by change
-
scripts/main.gd— dropping thetick/active_goalsetters: repo-wide grep finds no assignment tomain.tickormain.active_goalinscripts/,tests/, orscenes/main.tscn(the onlytickwriters arestate["tick"]incolony_sim.gdand test-localsim.state.tick = …dictionary writes, which bypass the facade property). Remaining uses ofmain.tick/main.active_goalinscripts/main.gd(L1618, L1813, L2056, L2253) andtests/test_save_failure_surfaced.gd:371are reads and keep the unchanged getters. GDScript accepts getter-only properties, so no warning-as-error risk. -
scripts/main.gd—_is_valid_event_entrynow callsColonySim.is_numeric, whichColonySimalready exposes (scripts/colony_sim.gd:199) with the identicalTYPE_INT or TYPE_FLOATpredicate;ColonySimis already preloaded inmain.gd, and the removed_is_event_tick_numerichad no other callers. The schema gate (game_state.gd:328) delegates to the same function, so renderer and validator now share one definition as claimed. -
scripts/rotating_goal.gd— the dedup pass only fedselect_next_active_goal, which reads membership viahas()(rotating_goal.gd:51), so order/duplicates cannot affect selection. The newduplicate()+appendstill leaves the caller's array untouched (the callergoal_progression.check_and_rotateappends its own id afterward), so the no-mutation contract holds. The duplicate-id case is still covered bytests/test_rotating_goal.gd:233.
Tool Harness Findings
40 read-only calls were used to verify the claims: full reads of scripts/main.gd, scripts/rotating_goal.gd, scripts/goal_progression.gd, scripts/colony_sim.gd, and tests/test_rotating_goal.gd, plus targeted greps for every setter/dedup/numeric-predicate call site in scripts/, tests/, scenes/, and docs/. The tool budget was exhausted before the final API probes, but the last three calls (PR metadata, check-runs, workflow runs) completed and confirm head fb8dfff with the full CI matrix green (headless smoke test, script suites on Linux/macOS/Windows, export validations).
No linked issue, so there is no acceptance-criteria ledger to reconcile; the gameplay skill's save/migration and validation invariants are unaffected by these hunks.
| seen[cid] = true | ||
|
|
||
| # Always include the just-completed goal's ID to prevent immediate repeat | ||
| # Select next non-completed goal from catalog. Only membership matters — |
There was a problem hiding this comment.
Info (style): The four-line comment explaining the removed dedup pass could be trimmed to one line per the AGENTS.md source-comment convention (the non-obvious why fits in a single line).
Automated finding from AI PR review.
| ## 'tick' and a 'text' key (matching what colony_sim.gd push_event writes and | ||
| ## what validate_save_schema now enforces at load). Used by the renderers to | ||
| ## skip malformed entries rather than crash on int(entry.tick). | ||
| ## Numeric is ColonySim.is_numeric — the same single definition the schema |
There was a problem hiding this comment.
Info (docs): The new two-line comment restates the existing doc block above _is_valid_event_entry; folding the single-definition rationale into that block would avoid duplicated prose.
Automated finding from AI PR review.
Motivation
Behavior-preserving simplify pass. Read of the whole
scripts/tree (all 16 modules) plus the shared test harness surfaced three pieces of machinery whose observable behavior is nil, verified by exhaustive repo grep before touching anything.Changes
main.gd: drop deadtick/active_goalproperty setters — zero assignments to either property anywhere in the repo (scripts, tests, scenes); every writer goes throughstate["tick"]/state["active_goal"]directly. The read-only properties keep their unchanged getters, so the facade API for readers is untouched.main.gd:_is_valid_event_entryusesColonySim.is_numericinstead of_is_event_tick_numeric, a local duplicate of the exact sametypeof == TYPE_INT or TYPE_FLOATpredicate. This follows the patterngame_state.gdalready documents for its_is_numeric("the single implementation lives in ColonySim so the schema gate and the sim cannot disagree") — the event renderer now shares that one definition too.rotating_goal.gd: remove the dedup pass inrotate_after_completion— it built an order-preserving deduplicated copy ofcompleted_ids, but the only consumer (select_next_active_goal) reads array membership viahas(), so order and duplicates cannot change the selection. The replacement appends the completed goal's id (on aduplicate(), preserving the original's no-mutation-of-caller contract) and passes the array through. The existing test that passes duplicate ids (["gather_wood", "gather_wood"]) confirms membership semantics.Validation
just validate/test-all(Godot 4.7.1-stable, sha256-verified againstgodot-toolchain.json): all 40 suites pass, 0 failures, no SCRIPT ERRORs (~2,100 assertions).