Skip to content

fix: updating metric library - #111

Merged
TEJASNARAYANS merged 9 commits into
mainfrom
feat/metric-library
Aug 14, 2026
Merged

fix: updating metric library#111
TEJASNARAYANS merged 9 commits into
mainfrom
feat/metric-library

Conversation

@TEJASNARAYANS

Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR introduces Metrics Studio, platform administration, gated signup, workspace activation controls, call-import enhancements, and associated frontend, worker, migration, and test changes.

  • Adds Metrics Studio run creation, evaluation, result display, and retry workflows.
  • Adds platform-admin and signup-reference-code functionality.
  • Extends call-import schemas, manual audio uploads, telephony validation, retries, and sharding behavior.
  • Updates workspace and organization access controls across backend and frontend.

Confidence Score: 4/5

The PR does not appear safe to merge until signup-code consumption is made atomic and Metric Studio retries are restricted to eligible results or protected against overlapping workers.

Concurrent signups can still pass the same unlocked reference-code usage check and create more accounts than allowed, while explicit Studio retries can still dispatch a second worker for an active result and permit stale or conflicting terminal writes.

Files Needing Attention: app/services/signup_reference_codes.py, app/api/v1/routes/auth.py, app/api/v1/routes/metric_studio.py, app/workers/tasks/evaluate_studio_run_item.py

Important Files Changed

Filename Overview
app/services/signup_reference_codes.py Implements reference-code validation and consumption, but the previously reported concurrent overuse path remains.
app/api/v1/routes/metric_studio.py Adds the Metrics Studio API; explicit retries still accept active results and dispatch overlapping workers.
app/workers/tasks/evaluate_studio_run_item.py Evaluates Studio results and persists scores, but has no stale-task ownership guard to prevent an older worker from overwriting a retry.
app/api/v1/routes/call_imports.py Expands call-import validation, retry handling, telephony checks, and manual audio upload and append support.
app/api/v1/routes/auth.py Adds gated signup and active-organization enforcement while retaining the non-atomic reference-code consumption flow.

Reviews (2): Last reviewed commit: "feat: updating some of the changes" | Re-trigger Greptile

Comment thread app/services/signup_reference_codes.py Outdated
Comment on lines +46 to +50
row = (
db.query(SignupReferenceCode)
.filter(SignupReferenceCode.code_hash == code_hash)
.first()
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Non-atomic signup code consumption

If concurrent signup requests use the final available reference-code slot, each request reads the same use_count before the later increment and all pass validation, causing more accounts to be created than max_uses permits. Make validation and consumption a single locked or atomic conditional operation. How this was verified: The signup path performs an unlocked read and a later ORM increment with no database constraint or atomic update enforcing the limit.

Comment thread app/api/v1/routes/metric_studio.py Outdated
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Too many files changed for review (126 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

TEJASNARAYANS and others added 2 commits August 11, 2026 11:58
Resolve merge conflicts by combining metric-library feature changes with main import audit metadata and PDF report caching updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
@TEJASNARAYANS TEJASNARAYANS added the fix Fix version release label Aug 13, 2026
@TEJASNARAYANS
TEJASNARAYANS merged commit 20f56fe into main Aug 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix version release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant