Skip to content

feat(wasteland): configurable upstream — read from mayor/wasteland.json#3501

Open
pratham-bhatnagar wants to merge 1 commit intogastownhall:mainfrom
masti-ai:feat/configurable-wasteland-upstream
Open

feat(wasteland): configurable upstream — read from mayor/wasteland.json#3501
pratham-bhatnagar wants to merge 1 commit intogastownhall:mainfrom
masti-ai:feat/configurable-wasteland-upstream

Conversation

@pratham-bhatnagar
Copy link
Copy Markdown

Summary

All wasteland read commands (browse, stamps, show, charsheet, scorekeeper) hardcode hop/wl-commons as the upstream database. This makes it impossible to use a private or custom wasteland federation.

This PR reads the upstream configuration from mayor/wasteland.json (already saved by gt wl join) instead of hardcoding, with full backward compatibility.

Changes

Core Infrastructure

internal/wasteland/wasteland.go

  • ResolveDBName(townRoot) — derives Dolt database name from config ForkDB field (hyphens → underscores). Falls back to "wl_commons".

internal/doltserver/wl_commons.go

  • NewWLCommonsWithDB(townRoot, dbName) — store constructor with custom database name
  • DBName() accessor on WLCommons
  • Exported QueryCSV() and QueryJSON() for server-side query execution

internal/doltserver/wl_charsheet.go

  • Refactored QueryStampsForSubject, QueryBadges, QueryAllSubjects, UpsertLeaderboard into wrapper + DB-parameterized implementations

Command Updates

Command Change
wl_browse.go Server fast path when DB registered; config-aware clone fallback
wl_stamps.go Config local dir check before clone; config-aware upstream
wl_show.go Server fast path via store; config-aware clone fallback
wl_charsheet.go ResolveDBName() + NewWLCommonsWithDB()
wl_scorekeeper.go Same as charsheet
wl_claim.go, wl_stamp.go, wl_done.go Resolved DB name for existence check

Resolution Order (read commands)

1. Dolt server (if database registered) → query via TCP
2. Config local dir (from mayor/wasteland.json) → dolt sql in directory  
3. Standard location (.wasteland/hop/wl-commons)
4. Common fallback locations
5. Clone-then-discard from config upstream (or hop/wl-commons default)

Backward Compatibility

  • No config → falls back to hardcoded hop/wl-commons
  • WLCommonsDB constant unchanged
  • Package-level functions still use default DB name
  • No changes to gt wl join, gt wl post, gt wl sync
  • All existing tests pass

Use Case

Anyone running gt wl join <custom-upstream> expects all gt wl commands to work with their configured upstream. Currently only join, post, claim, done, and sync respect the config — read commands ignore it.

Test Plan

  • gt wl join <custom/db> saves config correctly
  • gt wl browse reads from local fork (no DoltHub clone)
  • gt wl show <id> queries through Dolt server when DB registered
  • gt wl stamps <handle> works with custom DB name
  • gt wl charsheet resolves custom DB from config
  • gt wl scorekeeper --json uses resolved database
  • All commands fall back to hop/wl-commons with no config
  • Builds cleanly from v0.13.0

Notes

Submitted by @pratham-bhatnagar. We run a Gas Town with a private wasteland and discovered these hardcoded paths while setting up federation. Happy to iterate on the implementation.

🤖 Generated with Claude Code

…ad of hardcoding hop/wl-commons

Currently all wasteland read commands (browse, stamps, show, charsheet,
scorekeeper) hardcode 'hop/wl-commons' as the upstream database. This
makes it impossible to use a private wasteland with a different name.

Changes:
- wasteland.ResolveDBName() derives Dolt DB name from config ForkDB field
- wl_browse, wl_stamps: check config local dir before clone-then-discard
- wl_show: read upstream from config in fallback clone path
- wl_charsheet, wl_scorekeeper: use NewWLCommonsWithDB with resolved name
- wl_claim, wl_stamp, wl_done: use resolved DB name for existence check
- QueryCSV/QueryJSON exported for server-side query execution
- DB-parameterized helpers for QueryStampsForSubject, QueryBadges,
  QueryAllSubjects, UpsertLeaderboard

All changes are backward-compatible: when no wasteland config exists,
the default hop/wl-commons behavior is preserved.
@github-actions github-actions bot added the status/needs-triage Inbox — we haven't looked at it yet label Apr 2, 2026
pratham-bhatnagar pushed a commit to masti-ai/gascity that referenced this pull request Apr 2, 2026
…effort estimation, self-evolving knowledge

Generic production pack demonstrating:
- Private wasteland federation with bidirectional sync
- Deterministic effort estimation (trivial/small/medium/large/epic)
- Self-evolving knowledge base (6h cron evolution)
- 10 agent roles, governance rules with wasteland federation enforcement
- External contributor onboarding flow
- Smart internal-vs-external work filter in polecat formula

All project-specific details replaced with placeholders.
Requires: gastownhall/gastown#3501 (configurable wasteland upstream)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@pratham-bhatnagar
Copy link
Copy Markdown
Author

Updated implementation rebased on latest upstream (9f962c4). All changes on masti-ai/gastown main branch. 12 wl command files patched — browse, show, stamps, charsheet, scorekeeper, claim, done, stamp, post all read from local Dolt server via wasteland.json config. Zero DoltHub cloning. Binary tested and installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/needs-triage Inbox — we haven't looked at it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants