Skip to content

Mustafa Aytekin AI Usage

Mustafa edited this page May 16, 2026 · 4 revisions

Mustafa Aytekin — AI Usage

This page documents representative instances of how AI tooling was used in my contribution to the Mapcess project during Milestone 3 (Final).

Tool

Claude Code (Anthropic CLI) — model Claude Opus 4.7 + Sonnet 4.6.

Functional Roles

  • Debugging — Spring Boot 4 / Java 21 build errors, Mockito injection issues, Flyway migration ordering, Docker port conflicts, deployment env-var misconfigurations, runtime NPEs.
  • Code generation — component scaffolding, hooks, services, controllers, parsers.
  • Independent UI / code auditing — dark-mode surface elevation sweeps, hardcoded color sweeps, tutorial coverage gap analysis, design-system consistency checks.
  • Issue and PR body drafting — against the team template (scope, out-of-scope, AC, test plan).
  • Conflict resolution strategy — for stacked PRs and long-running integration branches.
  • Test scaffolding — every AI-produced test was reviewed locally and validated via npm run test:run / ./mvnw test before commit.

Workflow

Claude Code had read-write access to the local working tree. Every code change it produced was reviewed locally and validated via test runs before being committed. Issue and PR bodies were copy-pasted into GitHub by hand. No design generation, no fabricated test results. When the AI made flawed assumptions, I caught them and pushed back — see Instance 7 below.


Instance 1 — Bug Diagnosis and End-to-End Fix (Issue #462)

Task type: Bug diagnosis + code generation

Context: Issue #462 — the profile page's "routes planned" counter never incremented after creating a new route. Asked Claude Code to diagnose before opening a branch.

My prompt:

lets switch to this issue. first diagnose what is the problem then we will open a new branch and solve it and open PR. [Web][Bug] Profile route count not updating #462

AI response:

Diagnosis Two bugs compounding — both are in Home.jsx's fetchRoutes().

Bug 1 — backend never gets credit for the route. backend/.../RouteController.java:50-51 documents the contract: "Anonymous; if a Bearer token is supplied, the planned route is also recorded against the caller's contribution stats." But Home.jsx:322-330 sends the request without the Authorization header:

const res = await fetch(`${import.meta.env.VITE_API_URL}/api/routes`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },   // ← no Authorization
  body: JSON.stringify({ ... }),
})

So even for signed-in users, the backend treats every route as anonymous, the server-side routesPlanned counter is never incremented, and "refresh shows wrong count" is also broken.

Bug 2 — even when the count would increment, the cache doesn't know. useCurrentUser.js sets staleTime: 60_000. The contributionStats.routesPlanned value displayed by ProfilePage.jsx:117 comes from this query. After a route is created, nothing invalidates currentUserKey, so even after backend persistence is fixed, the UI keeps showing the stale value until either 60s pass or a hard reload.

The fix (two-line, plus an import):

  1. Pull token out of useAuth(), pull useQueryClient and currentUserKey.
  2. Send Authorization: Bearer <token> when authenticated.
  3. After a successful POST, queryClient.invalidateQueries({ queryKey: currentUserKey }).

Outcome: Diagnosis was correct on both counts. Branched off main, applied the fix, all 237 tests passed. Manual verification confirmed the counter incremented immediately after route creation and persisted across reloads. PR merged.

Related: Issue #462, PR #466.


Instance 2 — Test Failure Debugging (Mockito NPE)

Task type: Debugging test failure

Context: After introducing NominatimReverseGeocoder as a new dependency on ReportService (for the location-label feature), three service tests started failing with NPE on a new code path. Backend CI was red.

My prompt: (shared CI failure output and asked Claude Code to inspect the test class and find root cause)

AI response:

Pushed. Root cause: ReportServiceTest uses @InjectMocks and I added a new dep (NominatimReverseGeocoder) without adding the @Mock for it, so Mockito injected null → NPE on reverseLabel(...) in 3 create-test cases.

One-line fix: @Mock private NominatimReverseGeocoder reverseGeocoder; — Mockito's default returns null on un-stubbed methods, which is exactly the path the service is designed to tolerate (Nominatim outage → label stays null → report still creates).

CI should go green on the next run.

Outcome: Applied the one-line fix exactly as suggested. CI went green on the next run. The choice to rely on Mockito's null-default behavior was a deliberate match to the service's design (graceful degradation on geocoder failure).

Related: PR #623 (reverse-geocode + persist locationLabel).


Instance 3 — Production Environment Debugging (MapTiler 401)

Task type: Debugging deployment / environment

Context: The newly-merged dark-mode PR worked locally but printed a 401 authentication error on production (mapcess.live): "Learn more at docs.stadiamaps.com/authentication".

My prompt:

my PR for dark mode is merged but 401 authentication error is printed in live saying : Learn more at docs.stadiamaps.com/authentication on mapcess.live

AI response:

Expected — Stadia's tile endpoint is keyless only on localhost. From any other domain it 401s, which is why production hits it. Two fixes (pick one):

Option A — set VITE_MAPTILER_KEY in prod (recommended). Whatever pipeline deploys the frontend needs that env var at build time (Vite inlines it into the bundle, so it must be set before npm run build). Find the deploy config:

grep -rn "VITE_\|build\|MAPTILER" .github/workflows/ Dockerfile* docker-compose*.yml

[…after I pasted the workflow file:]

Found it — .github/workflows/deploy-frontend.yml injects VITE_API_URL from a GitHub secret at line 30. Add VITE_MAPTILER_KEY the same way.

  1. Repo on GitHub → Settings → Secrets and variables → Actions → New repository secret. Name: VITE_MAPTILER_KEY, value: your MapTiler key.

  2. Update the Build step in the workflow:

    VITE_API_URL: ${{ secrets.VITE_API_URL }}
    VITE_MAPTILER_KEY: ${{ secrets.VITE_MAPTILER_KEY }}

Commit + push to main. The deploy job re-runs, bakes the key into the bundle, and mapcess.live stops 401-ing.

Outcome: Added the GitHub Actions secret, updated deploy-frontend.yml to forward VITE_MAPTILER_KEY to the build step. Production tiles loaded from MapTiler with the key, no more 401.

Related: PR #460 (pass MapTiler key to frontend build).


Instance 4 — Local Environment Debugging

Task type: Debugging environment / connectivity

Context: Trying to smoke-test the user-search PR locally. curl to /api/auth/register returned 401 with a WWW-Authenticate: Basic realm="Realm" header instead of JSON.

My prompt: (shared curl output showing 401 with Basic-auth realm response)

AI response:

That 401 with WWW-Authenticate: Basic realm="Realm" is not the Mapcess backend — it's some other Spring app (likely from another project) hijacking port 8080. The Mapcess backend would return JSON, never Basic auth.

Confirm what process it actually is:

ps -p 55050 -o command=

[…later, after kill + retry:]

Found it. The public auth endpoints are at /auth/register and /auth/login, not /api/auth/.... That's why they 401 — Spring Security treats them as authenticated routes.

Outcome: Each diagnosis was accurate. A stray Spring app from a different project was indeed squatting on port 8080. The endpoint was indeed /auth/.... After killing the rogue process and using the correct path, register and login worked.

Related: PR #504 user search.


Instance 5 — Independent UI Audit and Issue Drafting (Dark Mode)

Task type: Independent visual audit + issue drafting

Context: Noticed during dark-mode polish that the Profile About edit controls were no longer distinguishable from their parent section, and separately that the Create-custom-preset modal still rendered white. Asked Claude Code to audit both independently and combine the findings.

My prompts:

the profile page display name box and bio box dont have any frame. independently audit the issue.

btw, the create custom preset, after pressing that : the panel that opens is not ready in dark mode. independently audit that too. then we can combine these into one issue

AI response:

Audit confirmed. The PR #612 dark-mode polish bumped the About section's background from surface-container-lowest to surface-container. The Display name and Bio inputs still use bg-surface-container border-none — so they're the same shade as their parent section now, with no border to delineate them. Result: invisible boxes.

Same issue affects three other nested elements inside the same section:

Element Line Class
Display name input 201 bg-surface-container border-none
Bio textarea 219 bg-surface-container border-none
Edit button 179 bg-surface-container
Cancel button 245 bg-surface-container

Fix: bump each from bg-surface-container → bg-surface-container-high so they sit one elevation above the section in both themes. Keeps the "no border" aesthetic, no new tokens needed.

[…then for the second audit:]

Issue 2 — CustomPresetEditorModal panel hardcoded white. CustomPresetEditorModal.jsx:155 uses bg-white on the modal panel:

<div className="bg-white rounded-2xl shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col">

In dark mode this renders as a white panel against the bg-black/50 backdrop — completely jarring. Worse, the controls inside use theme tokens (bg-surface-container, text-on-surface) which in dark mode look wrong on top of a white panel. Fix: swap bg-white → bg-surface-container-lowest.

Outcome: Combined issue body was opened verbatim as #624 with file:line references for both audits. Fix branched off, applied across both files, merged as PR #627.

Related: Issue #624, PR #627.


Instance 6 — Content Coverage Audit (Tutorial Consistency)

Task type: Independent content audit

Context: Suspected the per-object "How to measure" tutorial in CreateReportPanel might disagree with the first-visit onboarding tutorial on numeric thresholds. Asked Claude Code to diff the two side-by-side and confirm or refute.

My prompt:

seperate observation : how to measure tutorials in report panel have hardcoded instructions that may not be matching the tutorials that are shown to user when they come to map firstly. compare them side by side and diff the instructions. independently audit the problem. if confirmed, we will open issue to make them conform to the original one which is the main tutorials in map

AI response:

Audit complete. Verdict: No numeric conflicts, but coverage gaps exist.

Side-by-side of every numeric threshold in both sources:

Object Onboarding bullets ObjectTutorialModal Match?
Ramp Slope ≤ 10%; width ≥ 100 cm; handrails at 90 cm; tactile strip slope max 10%; width min 100 cm ✅ Numbers identical
Sidewalk Width ≥ 150 cm; overhead clearance ≥ 220 cm curb height max 15 cm; width min 150 cm ✅ Width matches
Elevator Door ≥ 90 cm; braille; visual floor display door min 90 cm; cabin min 120 cm ✅ Door matches
Door Width ≥ 90 cm; lever handle; glass contrast bands width min 90 cm; threshold max 0.6 cm ✅ Width matches

So the numbers don't disagree — wherever both mention a measurement, they're the same.

Where the gap is: The two screens have different scopes. OnboardingTutorial is a general accessibility primer (mixes measurements with qualitative items: handrails, tactile, lever, braille, glass contrast). ObjectTutorialModal is a strict form-filler reference (only the measurements that appear as numeric inputs). A user who reads the onboarding will expect to report on lever handles and tactile strips. They can — those exist as issue types in report_object_issues — but the per-object tutorial doesn't surface or describe them.

So the bug isn't divergent numbers — it's that ObjectTutorialModal only documents the measurement fields, while the onboarding implies a wider rule set the user expects to see explained when they're filling in a report.

Outcome: The AI's initial implied hypothesis (numbers might disagree) was overturned by its own audit. The real issue — coverage gap, not conflict — was scoped as a follow-up improvement; the fix did not ship within this milestone.

Related: Audit only. The original "How to measure" tutorial modal was delivered earlier in PR #484; the qualitative-issues coverage gap is logged as future work.


Instance 7 — Catching a Flawed AI Assumption (Theme Picker)

Task type: Issue scope correction

Context: Asked Claude Code to draft an issue for adding a three-mode (Light/Dark/System) theme picker to a new /settings page. The first draft assumed the existing ThemeContext only supported two modes and proposed adding system support from scratch — a multi-hour refactor.

My pushback:

this issue is flawed. current navbar toggle has system option too.

AI response after correction:

Right — ThemeContext already supports system and ThemePickerSegmented (the segmented version of the navbar toggle) is already exported from ThemePicker.jsx. Issue collapses to just mounting it inside the Settings shell.

Rewritten:

📝 Description

Mount the existing ThemePickerSegmented control inside the /settings shell (from #588). ThemeContext already supports system/light/dark and the segmented picker is already exported from ThemePicker.jsx; this issue is just placing it on the page.

Scope:

  • Settings page renders a Theme section that imports ThemePickerSegmented from ThemePicker.jsx
  • No changes to ThemeContext, no new keys, no removal of the navbar quick-toggle

⏱️ Review Time ~1 min

Outcome: Correctly scoped issue opened as #590. Implementation collapsed from a multi-hour ThemeContext refactor (that would have duplicated existing work) down to a 5-line file change mounting an already-built component. Shows the importance of validating AI assumptions against the actual codebase before accepting its scope estimate.

Related: Issue #590.


Instance 8 — Multi-PR Consolidation Strategy (i18n)

Task type: Strategic planning + git workflow + PR body drafting

Context: Ten stacked i18n PRs were in flight, each conflicting with the next after every parent rebase. A coherent way to land the work on main was needed.

My prompts:

what issue remains for en-tr work?

[…later, after the stack grew:] we need to go step by step. give the first issue title and body.

AI response (excerpt — strategy):

Don't merge yet. Two reasons:

  1. Base is still feat/backend-user-language-pref — if you merge now, all 50 commits land on the backend branch and bloat PR #533's diff with 1700 lines of frontend.
  2. The project requires at least one approving review — you can't self-merge anyway.

Sequence:

  1. Get PR #533 (backend) reviewed and merged to main.
  2. The moment #533 lands on main, GitHub auto-flips #534's base from feat/backend-user-language-pref to main. The diff shrinks to just the frontend changes and a clean review can start.
  3. Get PR #534 reviewed. Once approved, click merge.

[Later, when the stack outgrew the sequence:] Introduce the feature/language long-running integration branch, rebase each leaf PR onto the new tip, retarget all PRs to the branch, then open one consolidated PR into main.

Claude Code then drafted the consolidated PR body (structured backend / web sections, closes-issues list, test plan). I asked for it more concise framing.

Outcome: Strategy executed exactly as outlined. PR #583 opened with the cleaner body. 474/474 frontend tests passing on the consolidated branch.

Related: PR #583 (consolidated i18n), and the 10 stacked PRs: #533, #534, #547, #549, #551, #556, #558, #561, #563, #575.

logo Mapcess

Team Members

Final Milestone Deliverables

MVP Deliverables

Lab Reports

Communication Plan

Weekly Meetings

Sub-Group Meetings

Other Meetings

Project Documentation

RAM

Scenarios and Mock-ups

Use Case Diagrams (Initial)

Use Case Diagram (Final)

Class Diagram (Final)

Sequence Diagram (Final)

Standards & Conventions

Test & Coverage Plan

Mapping API Comparison Report

MVP Demo

Final Demo

Clone this wiki locally