Skip to content

feed: add batched actor reaction lookup - #43

Open
Kzoeps wants to merge 2 commits into
mainfrom
feed/actor-reactions
Open

Kzoeps wants to merge 2 commits into
mainfrom
feed/actor-reactions

Conversation

@Kzoeps

@Kzoeps Kzoeps commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Implements TECH-711 actor-scoped reaction state through app.certified.feed.getActorReactions({ actor, subjects }).

Checks 1–100 subjects in one parameterized query; preserves request order and duplicates. Each result contains its subject and existing like/repost record views or null, retaining URIs for undo operations. Includes strict failure handling and endpoint-local collection NSID validation.

Reviewer guide

  1. api/lexicons/app.certified.feed.getActorReactions.json: public contract and representative ordering.
  2. api/lua/shared/feedActorReactions.lua: validation, ranking and ordered result reconstruction; thin source handler and generated bundle.
  3. api/tests/unit/tooling/feed-reactions.test.js: batching, nulls, duplicates and failure regressions.
  4. Registration, explorer snapshots, consumer skill and minor Changeset.

Validation

  • Independent worker/reviewer loop completed; two documentation findings corrected and re-reviewed.
  • Lua build/generated checks/lint and smoke harness passed.
  • Coordinator Lua syntax, 5 documentation tests and git diff --check passed.
  • Local API unit assertions did not run: missing worktree dependencies prevented test module loading.
  • HTTP/PostgreSQL tests and Changesets CLI validation were not run locally; CI is expected to execute its configured jobs.
  • No new installed HTTP test specifically exercises this endpoint; green runtime CI alone does not close that coverage gap.

Independent sibling PR to batch follows; both target main.

Summary by CodeRabbit

  • New Features
    • Added a batch query for checking an actor’s likes and reposts across 1–100 subject records in a single request.
    • Results follow the order of the requested subjects and preserve duplicates. Each result includes the matching like and repost when available, or null when no indexed reaction is found.
    • Subject matching uses the record URI and is unaffected by changes to its CID.

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
api-endpoints Skipped Skipped Oct 14, 2026 10:45am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4c1bd76

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hypercerts-org/hypercerts-api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fa94e51d-4985-4cb6-845f-6f23de36be30
📥 Commits

Reviewing files that changed from the base of the PR and between 4c1bd76 and 93becf9.

📒 Files selected for processing: 1
  • api/tests/http/feed-reactions.http.test.js

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e5f06cd8-5b85-4905-be04-908e8156caea
📥 Commits

Reviewing files that changed from the base of the PR and between 52658c3 and 4c1bd76.

📒 Files selected for processing: 19
  • .agents/skills/hypercerts-api/SKILL.md
  • .agents/skills/hypercerts-api/references/endpoint-map.md
  • .agents/skills/hypercerts-api/references/openapi.json
  • .agents/skills/hypercerts-api/references/recipes.md
  • .agents/skills/hypercerts-api/references/reliability.md
  • .agents/skills/hypercerts-api/references/request-patterns.md
  • .changeset/actor-reactions-batch-lookup.md
  • api/README.md
  • api/lexicons/app.certified.feed.getActorReactions.json
  • api/lua/endpoints/getActorReactions.lua
  • api/lua/shared/feedActorReactions.lua
  • api/lua/src/getActorReactions.lua
  • api/manifest.json
  • api/modules/feed-reactions/manifest.json
  • api/tests/unit/tooling/feed-reactions.test.js
  • docs/coverage.json
  • docs/openapi.json
  • docs/sources/index.json
  • docs/sources/lexicons/app.certified.feed.getActorReactions.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The pull request adds app.certified.feed.getActorReactions, a query that returns an actor’s indexed likes and reposts for 1–100 subject AT-URIs. It preserves input order and duplicates, returns null for missing reactions, and reports invalid requests or query failures as errors.

Changes: Actor Reactions Lookup

Layer / File(s) Summary
Query contract
api/lexicons/app.certified.feed.getActorReactions.json, docs/sources/lexicons/app.certified.feed.getActorReactions.json, docs/openapi.json, .agents/skills/hypercerts-api/references/openapi.json
Defines the actor and subject inputs, ordered per-occurrence results, nullable reaction views, reaction selection rules, and declared errors.
Query implementation and registration
api/lua/endpoints/getActorReactions.lua, api/lua/shared/feedActorReactions.lua, api/lua/src/getActorReactions.lua, api/manifest.json, api/modules/feed-reactions/manifest.json
Validates requests, queries indexed reactions, validates and assembles results in request order, and registers the endpoint and lexicon.
Tests and endpoint guidance
api/tests/unit/tooling/feed-reactions.test.js, api/README.md, .agents/skills/hypercerts-api/references/*, .agents/skills/hypercerts-api/SKILL.md, .changeset/actor-reactions-batch-lookup.md, docs/coverage.json, docs/sources/index.json
Tests request validation, duplicate and ordered results, reaction views, and query failures. Updates endpoint guidance, indexes, and endpoint counts.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant getActorReactions
  participant PostgreSQL
  Client->>getActorReactions: actor DID and subject AT-URIs
  getActorReactions->>PostgreSQL: query indexed likes and reposts
  PostgreSQL-->>getActorReactions: reaction rows
  getActorReactions-->>Client: ordered results with reaction views or null
Loading
Merge Risk: ⚪ Minimal · up to 4c1bd

The new batched actor reaction lookup is additive and follows the patterns of the existing feed reaction queries. No concrete defect was established. No HTTP test against a real database covers this endpoint yet, so a CI run is worthwhile, but nothing currently blocks merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 4 files. (15 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding a batched actor reaction lookup for the feed.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 4 files. (15 skipped: 15 unsupported.)

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

This branch was previously deployed

1 inactive deployment
Preview — 93becf97 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant