Skip to content

[AI:zf-builder] refactor(server): remove dead ProductionEnvironment constant - #192

Merged
ntsd merged 2 commits into
mainfrom
task/zf-z-74d33f39
Nov 21, 2026
Merged

ntsd merged 2 commits into
mainfrom
task/zf-z-74d33f39

Conversation

@ntsd

@ntsd ntsd commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

[AI:zf-builder] Task: zf-z-74d33f39

refactor(server): remove dead ProductionEnvironment constant (Ponytail Rung 1)

Automated PR for task zf-z-74d33f39

Completed by: @zf-builder

ntsd added 2 commits November 21, 2026 18:52
Task: zf-z-74d33f39

refactor(server): remove dead ProductionEnvironment constant (Ponytail Rung 1)
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying zerohub with  Cloudflare Pages  Cloudflare Pages

Latest commit: 410dd73
Status: ✅  Deploy successful!
Preview URL: https://9414e96d.zerohub.pages.dev
Branch Preview URL: https://task-zf-z-74d33f39.zerohub.pages.dev

View logs

@ntsd ntsd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI:zf-reviewer] [Reviewer Feedback] Round 1: Approved for human review.

Scope (Rung 7 — Minimum Viable Solution): Diff is exactly the proposed change: 2 lines deleted from server/pkg/config/config.go (comment + constant) and 1 line updated in server/pkg/config/config_test.go:78. No drive-by churn, no reformatting, no debug artifacts, no unrelated files.

Correctness & completeness: grep -rn ProductionEnvironment across the whole repo (all languages, including docs/openwiki) returns zero hits after the removal. The surviving DevelopEnvironment is still referenced in production logic (server/pkg/logger/logger.go:15) and in TestLoadConfigDefaults (config_test.go:46), so the enum pair reduction is asymmetric but intentional: "prod" is the implicit else-branch of the only environment check in the codebase.

Test adequacy: TestLoadConfigEnvOverrides remains a genuine round-trip assertion — it sets APP_ENVIRONMENT=prod via os.Setenv and verifies LoadConfig() parses it into App.Environment. Replacing the constant with the raw literal Environment("prod") is the minimal correct choice; the assertion is not tautological, so it was rightly kept rather than dropped.

Dependency veto (Rungs 3 & 5): No manifest changes, no new packages.

Ponytail (Rung 1 — YAGNI / dead code): The constant had zero non-test references; its only use was the test literal it documented. Deletion is the correct call. The task's "keep enum pairs as documentation" caveat is noted, but the anti-slop rule prevails and the task description itself prescribed this exact change.

Verification (all green on this branch):

  • go build ./... — pass
  • go vet ./... — pass
  • go test ./... — all packages pass (config 0.010s, handler 9.007s, hub 2.724s, peer 0.021s, storage 0.003s, zerohub 0.012s)
  • Mergeability: PR is MERGEABLE against main (no conflicts)

CONVENTION: For ZeroHub dead-code removal PRs, grep the whole repo for the removed symbol (including non-Go/docs files) and gate on cd server && go build ./... && go vet ./... && go test ./... — the server Go suite is the only affected test surface.

@ntsd
ntsd merged commit 206aee4 into main Nov 21, 2026
3 checks passed
@ntsd
ntsd deleted the task/zf-z-74d33f39 branch November 21, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant