Skip to content

Commit 7142233

Browse files
authored
fix: remove gameable Runs succeeded stat from actor search/details (#1182)
Adresses https://apify.slack.com/archives/C04URRT3934/p1785403187603329 ## What Removes the per-Actor \"Runs succeeded\" success-rate stat from `search-actors` and `fetch-actor-details` (markdown card, structured output, and JSON schema), plus the now-stale dev-harness mock fixture and test assertions. ## Why Reported in Slack: this metric is gamed by developers and was already pulled from public Actor pages on apify.com. MCP/API/CLI should mirror that. This PR covers the MCP surface only, per team decision — API/CLI and a follow-up \"show verified creators\" feature (blocked on apify-core exposing that field publicly) are tracked separately. ## Testing `pnpm run type-check`, `pnpm run lint`, `pnpm run test:unit` (89 files, 1245 passed / 1 skipped), `pnpm run format` (no diff), `pnpm run check:agents` — all clean. Confirmed via grep that `successRate`/\"Runs succeeded\" has zero remaining references in `src/` and `tests/`, and that the widget/apps-mode path never carried this field (nothing to change there). Independently re-verified by a fresh subagent (PASS).
1 parent 75c1627 commit 7142233

5 files changed

Lines changed: 0 additions & 32 deletions

File tree

src/tools/structured_output_schemas.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export const statsSchema = {
116116
properties: {
117117
totalUsers: { type: 'number', description: 'Total users' },
118118
monthlyUsers: { type: 'number', description: 'Monthly active users' },
119-
successRate: { type: 'number', description: 'Success rate percentage' },
120119
bookmarks: { type: 'number', description: 'Number of bookmarks' },
121120
},
122121
};

src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ export type StructuredActorCard = {
641641
stats?: {
642642
totalUsers: number;
643643
monthlyUsers: number;
644-
successRate?: number;
645644
bookmarks?: number;
646645
};
647646
rating?: {

src/utils/actor_card.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ type ExtractedActorData = {
9797
stats?: {
9898
totalUsers: number;
9999
monthlyUsers: number;
100-
successRate?: number;
101100
bookmarks?: number;
102101
};
103102
rating?: {
@@ -145,17 +144,6 @@ function extractActorData(actor: Actor | ActorStoreList, options: ActorCardOptio
145144
};
146145
}
147146

148-
if ('publicActorRunStats30Days' in stats && stats.publicActorRunStats30Days) {
149-
const runStats = stats.publicActorRunStats30Days as {
150-
SUCCEEDED: number;
151-
TOTAL: number;
152-
};
153-
if (runStats.TOTAL > 0) {
154-
data.stats ??= { totalUsers: 0, monthlyUsers: 0 };
155-
data.stats.successRate = Number(((runStats.SUCCEEDED / runStats.TOTAL) * 100).toFixed(1));
156-
}
157-
}
158-
159147
const bookmarkCount =
160148
('bookmarkCount' in actor && actor.bookmarkCount) || ('bookmarkCount' in stats && stats.bookmarkCount);
161149
if (bookmarkCount) {
@@ -230,9 +218,6 @@ export function formatActorToActorCard(
230218
const statsParts = [
231219
`${data.stats.totalUsers.toLocaleString()} total users, ${data.stats.monthlyUsers.toLocaleString()} monthly users`,
232220
];
233-
if (data.stats.successRate !== undefined) {
234-
statsParts.push(`Runs succeeded: ${data.stats.successRate}%`);
235-
}
236221
if (data.stats.bookmarks) {
237222
statsParts.push(`${data.stats.bookmarks} bookmarks`);
238223
}

src/web/src/utils/mock-actor-details.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export const MOCK_ACTOR_DETAILS_RESPONSE = {
9191
stats: {
9292
totalUsers: 734,
9393
monthlyUsers: 113,
94-
successRate: 100,
9594
bookmarks: 5,
9695
},
9796
modifiedAt: '2026-01-23T08:11:16.995Z',

tests/unit/utils.actor_card.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,6 @@ describe('formatActorToActorCard', () => {
202202
expect(result).not.toContain('- **Pricing');
203203
});
204204

205-
it('should include success rate in stats', () => {
206-
const result = formatActorToActorCard(mockActor, {
207-
includeDescription: false,
208-
includeStats: true,
209-
includePricing: false,
210-
includeRating: false,
211-
includeMetadata: false,
212-
});
213-
214-
// Success rate: 68663/69395 = 98.9%
215-
expect(result).toContain('Runs succeeded: 98.9%');
216-
});
217-
218205
it('should include bookmark count from Actor.stats', () => {
219206
const result = formatActorToActorCard(mockActor, {
220207
includeDescription: false,
@@ -453,7 +440,6 @@ describe('formatActorToStructuredCard', () => {
453440
expect(result.stats).toBeDefined();
454441
expect(result.stats?.totalUsers).toBe(8594);
455442
expect(result.stats?.monthlyUsers).toBe(904);
456-
expect(result.stats?.successRate).toBe(98.9);
457443
});
458444

459445
it('should include bookmarks from Actor.stats', () => {

0 commit comments

Comments
 (0)