Partial / config source updates (set_bot_config)
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
- Tech stack
- javascript, typescript
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
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
configjsonb column to theapptable (server/src/services/AppService.ts, alongside the existingsource textcolumn) — no migration framework exists yet (see #142), so this is another lazyCREATE TABLE IF NOT EXISTS-style additive change plus anALTER TABLE ... ADD COLUMN IF NOT EXISTS config jsonb default '{}'. - Extend
server/src/types/app.ts(App) withgetConfig/setConfig(merge semantics, not replace) mirroring the existinggetSource/setSourcepattern, and updatehydrateto 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 — anExternalCopy/plain object injected at init (init/executefunctions), not a live reference, so bots can't mutate the host copy. - Add
mergeConfig/propagateConfigtoserver/src/util/botActions.tsnext topropagateSource, reusing the same "re-run in every live arena viaenv.execute" fan-out (no START re-fire, matchingpropagateSource's contract). - REST:
PATCH /api/user/:userId/app/:appId/configinserver/src/api/app.ts(owner-gated like the/sourceroute:loadUser,requireOwner,loadApp,requireAppOwner). - MCP:
set_bot_configtool inserver/src/api/mcp.ts, next toset_app_source, usingownedAppand the sameIDEMPOTENTannotation.
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_sourcealready 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.tsphysics 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 inarenaStatus.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 alongsideset_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
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LeeAdcock/robocodeJs.com
-
priority: medium tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
LeeAdcock/robocodeJs.com#411 ·
Maintainers usually reply within 1 day
-
enhancement priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LeeAdcock/robocodeJs.com#254 ·
Maintainers usually reply within 1 day
-
good first issue priority: low tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LeeAdcock/robocodeJs.com#146 ·
Maintainers usually reply within 1 day
-
dependencies priority: low tech-debt
Difficulty 1/5 Under an hour Newbie friendliness 15/100
LeeAdcock/robocodeJs.com#413 ·
Maintainers usually reply within 1 day
-
priority: low tech-debt
Difficulty 3/5 Half a day Newbie friendliness 32/100
LeeAdcock/robocodeJs.com#412 ·
Maintainers usually reply within 1 day
All issues in LeeAdcock/robocodeJs.com
Similar issues
-
documentation good first issue hacktoberfest help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
libredb/libredb-studio#1756 ·
Maintainers usually reply within 1 day
-
state:triage-needed
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
lingdojo/kana-dojo#32365 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
friction
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kentcdodds/kody#3706 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
copperheadhq/copperhead#378 ·
Maintainers usually reply within 1 day