magicciv/.project/objectives/p2-10k-followup-max-file-lines-policy.md
autocommit de21f96fe1 docs(plan): finish-game1 gap analysis (28 objectives) + plan of record
- true-state/path-forward/blockers section appended to every open objective
- status corrections: p2-48 done→partial (end_game_summary.tscn orphaned, over-claim); p2-72b blocked_by cleared (Path 2 chosen)
- .project/FINISH_GAME1_PLAN.md: 5 waves (wiring/lairs/AI-convergence/architecture/CI), AI refound-suppression flagged as the at-risk long pole, audio+paid-sprites+guide as accepted-open
- objectives.json regenerated

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 14:50:59 -07:00

5.4 KiB
Raw Blame History

id title priority status scope owner updated_at
p2-10k-followup Workflow policy decision: how to clear the 10 max-file-lines gdlint violations p2 stub game1 testwright 2026-05-14

Summary

Parent: p2-10k-gdlint-cleanup.md (audited and closed 2026-05-14 — see "Out of scope" closing note). Eleven max-file-lines violations remain on gdlint src/game/engine/src/ and are blocked on a workflow-policy decision above the gdlint-cleanup lane.

The original p2-10k plan called for inline # gdlint:disable=max-file-lines # tracked: p2-10k directives per file. That path is not executable from a Claude session: the global ~/.claude/hooks/enforce-gdscript-quality.sh PreToolUse hook hard-rejects any gdlint:disable / noqa insertion with Lint Suppression: fix the lint error instead of suppressing it.

Files over the 500-line cap (2026-05-13 measurement)

File Lines Notes
auto_play.gd 2818 Blocked on p0-26 Rust port — do NOT split
ai_turn_bridge_state.gd 647 AI bridge surface; split risk = bridge regressions
data_loader.gd 621 Split: manifest loading vs asset hydration
game_state.gd 590 Split: serialization helpers already partially extracted
turn_processor.gd (modules/management/) 583 Phase dispatch; split risk = turn-loop regressions
city.gd 560 Split: city state vs city UI helpers
procedural_renderer.gd 554 Split: biome pass vs overlay pass
combat_resolver.gd 540 Split: resolver vs keyword evaluation
unit.gd 538 Entity surface; split risk = entity ID/serialization regressions
fauna.gd 533 Ecology entity
audio_manager.gd 510 Split: audio routing vs bus management

Decision required (one of)

  1. File-split each non-auto_play.gd entry as its own objective. High-risk surface across autoloads, world rendering, combat resolver, AI bridge, ecology, entities. Realistically ~10 separate objectives.
  2. Amend the global hook (~/.claude/hooks/enforce-gdscript-quality.sh) to permit gdlint:disable=max-file-lines when the comment carries a tracked: <objective-id> cite. Lowest-risk path; matches the original p2-10k plan. Needs user approval (touches ~/.claude/).
  3. Raise .gdlintrc max-file-lines cap. E.g. 700 covers everything except auto_play.gd (still blocked on p0-26) and ai_turn_bridge_state.gd. 2900 covers everything. Documents codebase reality rather than masking it.
  4. Demote Stage 3 (gdlint) to advisory permanently for max-file-lines only. Other gdlint rules stay hard-gated; max-file-lines emits a warning. Lets CI Stage 3 go hard-green on all rules except the deferred structural one.

Acceptance

  • ✗ User picks option (1)/(2)/(3)/(4) — recorded in this objective inline.
  • ✗ The chosen path is executed (split objectives filed, hook amended, cap raised, or CI workflow edited).
  • gdlint src/game/engine/src/ exits 0 on apricot, OR Stage 3 hard-green on the agreed rule subset.

Out of scope

  • Splitting auto_play.gd — blocked on p0-26-ai-tactical-rust-port. Do not touch this file ahead of the Rust port; its tactical AI surface rewrites in Rust.

Non-goals

  • Re-litigating the mechanical fixes already shipped under p2-10k.

True state — 2026-06-04 gap analysis

Verified (3 acceptance bullets, K=0 ✓ / N=3): All three remain ✗ — no option (1/2/3/4) recorded, no path executed, gdlint not green. This is a policy decision, not a build task — there is no scene or script to author. Out of UI-specialist scope to DECIDE; in scope only to report current truth.

Re-measured 2026-06-04 (the table was dated 2026-05-13 and has drifted — values grew, not shrank):

File 2026-05-13 2026-06-04 Δ
entities/auto_play.gd 2818 2672 146 (still blocked on p0-26)
autoloads/game_state.gd 590 718 +128
modules/ai/ai_turn_bridge_state.gd 647→658 658 +11
autoloads/data_loader.gd 621 621 0
modules/management/turn_processor.gd 583 599 +16
entities/city.gd 560 567 +7
world/procedural_renderer.gd 554 554 0
modules/combat/combat_resolver.gd 540 540 0
entities/unit.gd 538 539 +1
modules/ecology/fauna.gd 533 533 0
autoloads/audio_manager.gd 510 510 0

11 files over the 500 cap (measured find src/game/engine/src -name '*.gd' | wc -l > 500). game_state.gd crossed from 590→718, so option (3)'s "700 cap" would now ALSO miss game_state.gd and ai_turn_bridge_state.gd — re-tune any cap to current reality before adopting.

Path forward: unchanged — operator/testwright picks option (1) split-objectives / (2) hook amend / (3) raise cap / (4) advisory-demote. Note the in-session constraint still holds: the enforce-gdscript-quality.sh PreToolUse hook hard-rejects any gdlint:disable insertion, so option (2) cannot be self-executed from a Claude session and needs operator approval to touch ~/.claude/.

Blockers: decision is the blocker — needs operator input. Not a code dependency.

Demo gate: full-game-only / CI-only. This is a lint/CI-policy item; it does not affect demo GAMEPLAY in any way. Zero player-facing surface.

Effort: S to record the decision; the execution effort varies wildly by option (S for cap-raise/advisory-demote, L for ~10 file-split objectives).