Skip to content

feat(server): add tags, pin, timeline, and edges HTTP endpoints - #566

Merged
ajianaz merged 1 commit into
developfrom
feat/tags-pin-timeline-edges
Jul 5, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/tags-pin-timeline-edges

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add 7 new HTTP endpoints to uteke-server for tag management, pinning, timeline, and edge operations.

New Endpoints

Method Path Description
GET /tags[?namespace=...] List tags with usage counts
POST /tags/rename Rename a tag across a namespace
POST /tags/delete Delete a tag from a namespace
POST /pin Pin a memory by ID
POST /unpin Unpin a memory by ID
GET /timeline?id=...&limit=... Memory timeline events
GET /edges?id=... Memory edges (incoming + outgoing)

Changes

  • types.rs: Added TagRenameRequest, TagDeleteRequest, PinRequest structs
  • handlers.rs: 7 new route handlers following existing auth/error/JSON patterns

Notes

  • All write endpoints require write-capable tokens (not read-only)
  • GET endpoints are accessible to read-only tokens
  • Uses existing uteke-core methods: tags_with_counts, rename_tag, delete_tag, pin, unpin, timeline, edges_for

Closes part of tags/pin/timeline/edges feature set.

New endpoints:
- GET /tags[?namespace=...] — list tags with counts
- POST /tags/rename — rename a tag across a namespace
- POST /tags/delete — delete a tag from a namespace
- POST /pin — pin a memory by ID
- POST /unpin — unpin a memory by ID
- GET /timeline?id=...&limit=... — memory timeline events
- GET /edges?id=... — memory edges (incoming + outgoing)

All endpoints follow existing auth, error handling, and JSON response patterns.
},
Err(e) => ctx.error_response_for(req, 400, e),
},

error!("Timeline error: {e}");
ctx.error_response_for(req, 500, "Internal server error")
}
}
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

❌ Blocked — critical issues found.

🔴 Error (2)

  • crates/uteke-server/src/handlers.rs:1142 — The new match arm only handles p.starts_with("/timeline?") || p.starts_with("/timeline?id="). A normal request path like /timeline?id=123&limit=10 is covered, but /timeline?limit=10&id=123 only matches because of the first condition, while /timeline without a query never reaches this arm and returns 404 instead of the existing 400-style validation used inside the handler. Since the code already checks for a missing id and returns Missing 'id' query parameter, the route guard should allow /timeline as well so malformed or incomplete requests get a deterministic client error rather than a not-found response.
  • crates/uteke-server/src/handlers.rs:1159 — The route guard for edges is p.starts_with("/edges?") || p.starts_with("/edges?id="). As with the timeline handler, /edges without a query string will bypass this arm entirely and fall through to the global 404, even though the handler body is written to validate id and return Missing 'id' query parameter. This creates inconsistent API behavior for a malformed request to a valid endpoint.

Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit 03c14fa into develop Jul 5, 2026
8 of 9 checks passed
@ajianaz
ajianaz deleted the feat/tags-pin-timeline-edges branch July 5, 2026 11:11
ajianaz added a commit that referenced this pull request Aug 13, 2026
feat(server): add tags, pin, timeline, and edges HTTP endpoints
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.

2 participants