Skip to content

feat: AI-powered project price evaluation using LLM (#3)#117

Merged
TUPM96 merged 1 commit into
mergeos-bounties:masterfrom
CHY9213:feat/ai-price-evaluation
May 29, 2026
Merged

feat: AI-powered project price evaluation using LLM (#3)#117
TUPM96 merged 1 commit into
mergeos-bounties:masterfrom
CHY9213:feat/ai-price-evaluation

Conversation

@CHY9213
Copy link
Copy Markdown
Contributor

@CHY9213 CHY9213 commented May 28, 2026

Summary

Implements AI project evaluation for price suggestion (#3). The feature enriches the existing project creation flow by providing intelligent, LLM-powered price suggestions with structured justification.

Changes

Backend (Go)

  • New file: backend/internal/core/llm_price_evaluation.go
    • LLMPriceEvaluationRequest / LLMPriceEvaluationResponse types with fields for suggested price range, confidence, task breakdown, assumptions, risks, and rationale
    • EvaluateProjectLLM method on *Server that uses the existing GeminiReviewService.generate() to query the configured LLM (Gemini/OpenAI/Anthropic)
    • buildLLMPriceEvaluationPrompt() - constructs a structured prompt instructing the LLM to return JSON with price estimate, task breakdown, assumptions, risks, and rationale
    • parseLLMPriceEvaluation() - parses and validates the LLM JSON response, stripping markdown fences
    • fallbackPriceEvaluation() - sophisticated rule-based fallback when LLM is unavailable (considers tech stack, deliverables, complexity, timeline, constraints, reference budget)
  • Modified: backend/internal/core/server.go
    • Added route POST /api/projects/evaluate-llm at line 68
    • Added handler evaluateProjectWithLLM that decodes the request, calls EvaluateProjectLLM, and returns the structured response

Frontend (Vue.js)

  • Modified: frontend/src/App.vue
    • Updated triggerAiEvaluation() to first attempt /api/projects/evaluate-llm, with graceful fallback to /api/projects/evaluate if the LLM endpoint is unavailable

How It Works

  1. User fills in project details (description, requirements, deliverables, timeline, tech stack, complexity, constraints)
  2. Clicking "Get AI Price Recommendation" sends a POST to /api/projects/evaluate-llm
  3. Backend builds a structured prompt and sends it to the configured LLM via GeminiReviewService
  4. LLM returns JSON with suggested price range, task breakdown, confidence, assumptions, risks, and rationale
  5. Response is displayed in the AI evaluation dialog
  6. Users can apply the suggested budget or manually edit
  7. If the LLM is unavailable, the system falls back to a heuristic rule-based estimator

Quality

  • No API keys or secrets hardcoded
  • AI logic stays backend-side; frontend only posts to API endpoint
  • Graceful degradation when LLM is unavailable
  • Structured response with task breakdown, assumptions, rationale, risks
  • All existing functionality preserved
  • Editable price suggestion before publishing

- New backend endpoint POST /api/projects/evaluate-llm that uses the
  existing GeminiReviewService to produce structured price suggestions
- LLMPriceEvaluationRequest/Response types with task breakdown,
  assumptions, risks, rationale, and confidence scoring
- Fallback rule-based estimation when LLM provider is unavailable
- Frontend triggerAiEvaluation now calls the new LLM endpoint first,
  with graceful fallback to the existing rule-based /api/projects/evaluate
- Proper markdown fence stripping and JSON validation for LLM responses

Closes: mergeos-bounties#3
@TUPM96 TUPM96 added enhancement New feature or request bounty Eligible work for the MergeOS bounty program bounty: feature Feature or enhancement bounty work. reward:1500-mrg Bounty reward is 1500 MRG tokens. frontend Frontend UI and interaction work. project-creation Project creation and project intake flow. qa Quality assurance, regression testing, and verification work. evidence: provided PR includes acceptable screenshot, GIF, video, or other visual evidence. star: verified PR author has starred this repository. labels May 28, 2026
Copy link
Copy Markdown
Contributor

@eliasx45 eliasx45 left a comment

Choose a reason for hiding this comment

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

Reviewed PR #117 for bounty #3.

Verification performed:

npm test
# 9 passed

npm run build:local
# client + SSR builds completed successfully

git diff --check
# clean

GitHub checks on the PR are also green, including Backend build and test, frontend/admin/scan builds, and secret scan. I could not run go test ./... locally on this Windows host because go is not installed here, so I relied on the green GitHub backend job for backend execution proof.

Code review notes:

  • The new /api/projects/evaluate-llm route is authenticated and falls back to rule-based pricing when no runnable LLM key is configured or the LLM response cannot be parsed.
  • The frontend keeps the existing rule-based endpoint as an outer fallback, and the existing /api/projects/evaluate response shape already matches the suggested_low / suggested_high / task_breakdown UI contract.
  • I did not find a blocking regression in the changed files.

Verdict: looks ready from my verification pass.

@jakerated-r
Copy link
Copy Markdown

Supplemental verification for bounty verifier issue #64.

Target

GitHub Actions

All visible PR checks are green at review time:

  • Secret scan: success
  • Backend build and test: success
  • Web build and test (frontend): success
  • Web build and test (admin): success
  • Web build and test (scan): success

Local verification run on macOS arm64

go version
# go version go1.26.3 darwin/arm64

go test ./...
# ?    mergeos/backend/cmd/mergeos        [no test files]
# ok   mergeos/backend/internal/core      1.761s

go test ./internal/core -run 'Test.*Price|Test.*Evaluate' -v
# PASS
# ok   mergeos/backend/internal/core      0.323s

npm test
# tests 9, pass 9, fail 0

npm run build:local
# client build passed
# SSR build passed

git diff --check origin/master...HEAD
# clean

Code review notes

  • The new POST /api/projects/evaluate-llm route is authenticated via requireUser, so the estimator is not exposed as an unauthenticated LLM relay.
  • LLM request logic stays backend-side and uses the existing GeminiReviewService; I did not see hardcoded API keys or client-side secret exposure.
  • The frontend keeps an outer fallback to /api/projects/evaluate if /api/projects/evaluate-llm fails.
  • The backend also has an internal fallback path when the configured LLM reviewer is absent or not ready.

Gaps / follow-up before award

  • There are no dedicated tests for the new code paths: parseLLMPriceEvaluation, stripMarkdownFence, fallbackPriceEvaluation, or the POST /api/projects/evaluate-llm handler. The existing price tests pass, but they cover the older route/price evaluator rather than this new LLM route.
  • The bounty amount is inconsistent: issue [1500 MRG] AI project evaluation for price suggestion #3 body currently says 50 MRG, while the PR body and claim comment say 1500 MRG. Maintainers should resolve that before award.
  • I did not find PR-attached UI screenshots or a recording proving the “Get AI price recommendation” flow in-browser. Build/test proof is present, but visual feature evidence would make the bounty packet stronger.

Verdict

Needs maintainer review / minor follow-up, not a blind approve. The implementation builds and the existing test suite is green, but I would ask for at least focused unit tests around the new LLM parse/fallback route plus clarification of the reward amount before marking this bounty fully ready.

@barnacleagent-svg
Copy link
Copy Markdown
Contributor

Verification Report for PR #117

Target PR

Build & Test Results

Check Result
go build ./cmd/mergeos ✅ Passed (no errors)
go vet ./backend/... ✅ Passed (no warnings)

Files Changed

  • backend/internal/core/llm_price_evaluation.go (new, 273 lines)
  • backend/internal/core/server.go (+18 lines)
  • frontend/src/App.vue (+21/-6 lines)

Code Review Summary

  • New LLMPriceEvaluationRequest and LLMPriceEvaluationResponse types are well-structured
  • Prompt builder for LLM price analysis is comprehensive with clear instructions and JSON schema enforcement
  • New endpoint POST /api/projects/evaluate-llm properly authenticated via requireUser
  • All existing eslint/formatting conventions followed

Manual Test Summary

  • go build compiles successfully
  • go vet reports no issues
  • No frontend build errors in the Vue changes
  • Changes are backwards compatible (additive API endpoint, no existing behavior changed)

Evidence Status

  • ✅ Code compiles and builds
  • ✅ Backend vet passes
  • ⚠️ No automated tests included for the new LLM evaluation logic (would benefit from unit tests on the prompt builder and response parser)
  • ⚠️ No screenshot/GIF of the UI changes (would be good to include a demo of the new "evaluate with LLM" button/flow)

Recommendation

Approve with minor suggestion – Code is functionally correct and builds cleanly. Consider adding unit tests for buildLLMPriceEvaluationPrompt() and the response parsing logic, and a UI screenshot for evidence. Merge is safe.

@barnacleagent-svg
Copy link
Copy Markdown
Contributor

Verification Report for PR #117

Target

Build Results

Check Result
Frontend npm run build:local ✅ PASS (1735 modules, 1.97s)
Backend go build ./... ✅ PASS
Backend go test ./... ✅ PASS (8.585s)

Code Review

  • New file: backend/internal/core/llm_price_evaluation.go — well-structured with LLM evaluation request/response types, prompt builder, response parser, and fallback estimator
  • Modified: backend/internal/core/server.go — added route POST /api/projects/evaluate-llm with proper handler
  • Modified: frontend/src/App.vue — updated triggerAiEvaluation() to try LLM endpoint first with graceful fallback
  • No API keys or secrets hardcoded
  • No linting or formatting issues detected
  • Follows existing code patterns and conventions

Evidence Status

  • PR body includes detailed summary with code structure breakdown
  • Labels include evidence: provided
  • However, screenshots or video of the feature working would strengthen the evidence for a UI-facing feature

Manual Test Summary

  • Tested the build output: client and SSR bundles produced without errors
  • Code paths are clear: LLM endpoint is tried first, falls back gracefully
  • New Go code compiles cleanly and tests pass

Final Recommendation

Approve — Code is well-structured, builds pass, tests pass, follows project conventions. Adding visual evidence (screenshots of the AI evaluation dialog) would make this complete, but the code itself is ready for review.

Copy link
Copy Markdown
Contributor

@eliasx45 eliasx45 left a comment

Choose a reason for hiding this comment

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

Re-reviewed current head 83aacd6a88ac4b606b6d3ead24dd0a2ff8db33df for bounty #3.

Verdict: approve from code/build verification.

What I verified locally on this Windows checkout:

git diff --check origin/master...HEAD
# clean

git merge-tree --write-tree origin/master HEAD
# clean merge tree: 4a611cbd781147fcac765d0afb2486d1d57da098

cd frontend
npm ci
# 0 vulnerabilities

npm test -- --runInBand
# 9 passed

npm run build:local
# client + SSR builds passed

GitHub PR checks are also green, including Secret scan, Backend build and test, Web build/test for frontend/admin/scan.

Code review notes:

  • The new /api/projects/evaluate-llm route is authenticated via requireUser, so it is not an unauthenticated LLM relay.
  • LLM request/response handling stays backend-side in backend/internal/core/llm_price_evaluation.go; I did not see hardcoded API keys or client-side secret exposure.
  • The backend falls back to rule-based pricing if no runnable LLM key is configured or if LLM JSON parsing fails.
  • The frontend keeps an outer fallback to the existing /api/projects/evaluate endpoint if /api/projects/evaluate-llm errors, so the UI degrades gracefully.
  • The response shape matches the existing AI price recommendation UI contract (suggested_low, suggested_high, confidence_level, task_breakdown, assumptions, risks, rationale) and users can still apply/edit the suggested budget before publishing.

Non-blocking follow-up: the bounty text/title/comments disagree on reward amount (50 MRG in the body vs 1500 MRG elsewhere), so maintainers should settle that before payout. A screenshot or short recording of the dialog would also strengthen the evidence packet, but the implementation and hosted backend checks look merge-ready to me.

I could not run go test ./... locally because go is not installed on this Windows host; I relied on the green GitHub backend check for backend execution proof.

@TUPM96 TUPM96 merged commit 45e8bad into mergeos-bounties:master May 29, 2026
5 checks passed
@doudoufbi
Copy link
Copy Markdown

🚨 URGENT: Payout Address Tampered — Funds Went to Wrong Address!

@TUPM96 @eliasx45

I am the original author of PR #117 (1500 MRG for Issue #3).

Critical Issue Found:

  • ✅ My registered payout: 0x3267520cc8be36da6ece967f89ce6a6dc2961b12
  • ❌ But MRG credited to: 0x8bEF7ba775bC7657D0819440c262965F9E1218F1 (NOT MINE!)
  • ✅ Confirmed by email: "credited to 0x8bEF..."

Evidence:

  1. My MergeOS Settings → Payout Address: 0x3267... (confirmed)
  2. Email shows: credited to 0x8bEF... (wrong address)
  3. PR feat: AI-powered project price evaluation using LLM (#3) #117 is my work, approved and merged!

Request:

  1. Please re-issue 1500 MRG to my correct address: 0x3267520cc8be36da6ece967f89ce6a6dc2961b12
  2. Investigate how payout address was changed from mine to 0x8bEF...

This is a critical payout error. Please resolve ASAP! 🚨

@doudoufbi
Copy link
Copy Markdown

🚨 URGENT: Payout Address Tampered — Funds Went to Wrong Address!

@TUPM96 @eliasx45

I am the original author of PR #117 (1500 MRG for Issue #3).

Critical Issue Found:

  • ✅ My registered payout: 0x3267520cc8be36da6ece967f89ce6a6dc2961b12
  • ❌ But MRG credited to: 0x8bEF7ba775bC7657D0819440c262965F9E1218F1 (NOT MINE!)
  • ✅ Confirmed by email: "credited to 0x8bEF..."

Evidence:

  1. My MergeOS Settings → Payout Address: 0x3267... (confirmed)
  2. Email shows: credited to 0x8bEF... (wrong address)
  3. PR feat: AI-powered project price evaluation using LLM (#3) #117 was my work, approved and merged!

Request:

  1. Please re-issue 1500 MRG to my correct address: 0x3267520cc8be36da6ece967f89ce6a6dc2961b12
  2. Investigate how payout address was changed from mine to 0x8bEF...

This is a critical payout error. Please resolve ASAP! 🚨

@eliasx45
Copy link
Copy Markdown
Contributor

Reviewer note for the payout-address dispute above: I checked the public GitHub metadata for this PR.

PR #117 state: MERGED
public author: CHY9213
base: master
head: 83aacd6a88ac4b606b6d3ead24dd0a2ff8db33df
merged_at: 2026-05-29T02:23:09Z
merged_by: TUPM96

I posted the broader public PR-state audit for the listed PR set here: #106 (comment)

I cannot verify private wallet settings, email notifications, or ledger payouts from public GitHub data; maintainer-side ledger review is required for any reissue decision.

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

Labels

bounty: feature Feature or enhancement bounty work. bounty Eligible work for the MergeOS bounty program enhancement New feature or request evidence: provided PR includes acceptable screenshot, GIF, video, or other visual evidence. frontend Frontend UI and interaction work. project-creation Project creation and project intake flow. qa Quality assurance, regression testing, and verification work. reward:1500-mrg Bounty reward is 1500 MRG tokens. star: verified PR author has starred this repository.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants