Repository navigation
Limit /trends producer data to public fields - #198
Open
NetworkTheoryAppliedResearchInstitute wants to merge 1 commit into
Open
NetworkTheoryAppliedResearchInstitute wants to merge 1 commit into
NetworkTheoryAppliedResearchInstitute wants to merge 1 commit into
Conversation
/trends/top-rated and the /trends/ai/insight text now take producer data from one allowlist in aiTrendHelper (publicProducers): id, username, locationType, reputationScore and reputationWeight, the same fields as the public user DTO proposed in #197. Insight text names producers by username only. Region-filtered results leave out producers with locationPrivacy set. A truthy locationPrivacy is read as private; getPublicLocations reads it the other way, so that meaning is still to be confirmed. Tests: a new trendsRoutes test calls every GET route registered on the trends router, with and without a region, and checks that producer fields outside the allowlist stay out of every response. It also checks the /top-rated field set and the locationPrivacy exclusion, including non-boolean values. aiTrendHelper tests check the insight text the same way. The existing fixture now uses username, the field Users records carry. Signed-off-by: Jodson Graves <info@ntari.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/trends/top-ratedand the/trends/ai/insighttext now carry only public producer fields, from one allowlist inaiTrendHelper:id,username,locationType,reputationScore,reputationWeight(matching #197's public user DTO). Insight text names producers byusernameonly. Region-filtered results leave out producers withlocationPrivacyset. Bylaws §2.4, JFA line 7. No binding changes, so CONFORMANCE.md is unchanged.Please confirm before merge: this reads a truthy
locationPrivacyas private;getPublicLocationsreads it the other way.Tests
New
trendsRoutes.test.jscalls every trends GET route, with and without a region, and checks that fields outside the allowlist stay out. It also checks the/top-ratedfield set and privacy exclusion.aiTrendHelper.test.jschecks the insight text the same way. 11 tests fail with the fix reverted. Full suite: node:test 61/61, Jest 63/63.Separate item:
/top-ratedstill ranks producers by one score (covenant rule, JFA line 8).🤖 Generated with Claude Code