Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Partial / config source updates (set_bot_config)

Open
#138 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Domain
api, backend

Research direction

Start with the app persistence and source update paths in server/src/services/AppService.ts, server/src/types/app.ts, and server/src/api/app.ts; then trace config exposure and live arena updates through server/src/util/compiler.ts and server/src/util/botActions.ts. Read the related set_app_source flow and coordinate with #142 on migrations. Done means config can be merged, persisted, exposed safely to bots, and updated through the owner gated REST and MCP paths, with the listed tests covering those behaviors.

Written by the indexing model from the issue text.

Description

ai-mcp enhancement priority: medium

set_bot_source replaces the whole program, so tuning one constant means resending the entire bot each iteration. Add a patch path or a set_bot_config(appId, {...}) that merges a small config object, to shrink iterative-tuning payloads (a model may resend a bot 10–15× while tuning).

Effort: S–M


Migrated from ENHANCEMENTS.md (§6 AI / MCP integration).

Implementation notes

Priority: medium — Useful DX/efficiency improvement for MCP-driven tuning workflows, but purely additive/optional and doesn't affect core gameplay, stability, or security.

Purpose

Iterative tuning (tweaking a constant like a fire threshold or move speed) currently forces re-sending the entire bot source string through set_app_source/PUT .../app/:appId/source, which is wasteful for MCP-driven tuning loops and conflates "code" with "parameters." A small merge-only config path shrinks payloads and gives bot authors (and MCP tools) a cheap, structured tuning surface distinct from full rewrites.

Implementation approach
  • Add a config jsonb column to the app table (server/src/services/AppService.ts, alongside the existing source text column) — no migration framework exists yet (see #142), so this is another lazy CREATE TABLE IF NOT EXISTS-style additive change plus an ALTER TABLE ... ADD COLUMN IF NOT EXISTS config jsonb default '{}'.
  • Extend server/src/types/app.ts (App) with getConfig/setConfig (merge semantics, not replace) mirroring the existing getSource/setSource pattern, and update hydrate to read it back.
  • In server/src/util/compiler.ts, expose the config to bot code as a frozen global (e.g. bot.config/arena.config) built host-side like the other _bot_* natives — an ExternalCopy/plain object injected at init (init/execute functions), not a live reference, so bots can't mutate the host copy.
  • Add mergeConfig/propagateConfig to server/src/util/botActions.ts next to propagateSource, reusing the same "re-run in every live arena via env.execute" fan-out (no START re-fire, matching propagateSource's contract).
  • REST: PATCH /api/user/:userId/app/:appId/config in server/src/api/app.ts (owner-gated like the /source route: loadUser, requireOwner, loadApp, requireAppOwner).
  • MCP: set_bot_config tool in server/src/api/mcp.ts, next to set_app_source, using ownedApp and the same IDEMPOTENT annotation.
Key details to plan
  • Merge semantics need defining precisely: shallow key merge vs. deep merge vs. null-deletes-key — pick one and document it in robocode.d.ts/bot docs (ui/public/docs/*.md).
  • No sandbox risk beyond what set_app_source already carries — config values are plain JSON, not executable, so this is lower-risk than source changes.
  • Does not touch simulation.ts/ui/src/util/simulate.ts physics or the seeded PRNG (util/random.ts) — config is bot-author data, not sim state — so determinism is unaffected as long as config changes don't retroactively alter an in-progress match's already-decided values.
  • SSE/reducer (arenaReducer.ts) unaffected unless config is later surfaced in arenaStatus.ts.
  • Testing: extend compiler.test.ts (config exposed/frozen in the isolate), api.test.ts (new PATCH route, ownership enforcement), services.test.ts (AppService config persistence), and add an MCP tool test alongside set_app_source's.
  • Depends on/coordinate with #142 (DB migrations) if that lands first — otherwise this is one more manual ALTER TABLE.
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
8m
Merged PRs (30d)
8

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LeeAdcock/robocodeJs.com

All issues in LeeAdcock/robocodeJs.com

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.