Commit Graph

53 Commits

Author SHA1 Message Date
949b7c8571 feat(backend): add location router with tRPC factory pattern
- Add createLocationRouter with location.update mutation
- Refactor tRPC to factory pattern (createTRPC, createTRPCRouter)
- Protected procedure by default (all routes require auth)
- Replace zod with arktype for input validation
- Wire location router in main() with dependency injection

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 22:58:32 +00:00
bd6cc3c963 Merge pull request #19 from kennethnym/feat/trpc
feat(backend): add tRPC with Hono adapter
2026-01-25 22:26:41 +00:00
aff9464245 feat(backend): add tRPC with Hono adapter
- Add @trpc/server, @hono/trpc-server, zod dependencies
- Create tRPC context with BetterAuth session
- Create router with publicProcedure and protectedProcedure
- Mount tRPC at /trpc/* via Hono adapter

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 22:19:05 +00:00
0db6cae82b Merge pull request #18 from kennethnym/feat/location-service
feat(backend): add LocationService
2026-01-25 19:41:26 +00:00
faad9e9736 feat(backend): add LocationService
- Add LocationService to manage LocationSource per user
- Add UserNotFoundError for generic user-related errors
- updateUserLocation throws if source not initialized

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 19:39:55 +00:00
da2c1b9ee7 Merge pull request #17 from kennethnym/feat/auth
feat(backend): add BetterAuth email/password authentication
2026-01-25 16:29:41 +00:00
c10c8a553a feat(backend): add BetterAuth email/password authentication
- Add PostgreSQL connection (src/db.ts)
- Configure BetterAuth with email/password (src/auth/index.ts)
- Add session middleware for route protection (src/auth/session-middleware.ts)
- Add registerAuthHandlers for mounting auth routes (src/auth/http.ts)
- Rename index.ts to server.ts
- Add .env.example with required environment variables

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 16:21:00 +00:00
fffcccc227 Merge pull request #16 from kennethnym/feat/aris-backend
feat(backend): init aris-backend with Hono
2026-01-25 14:55:17 +00:00
b744af9c51 feat(backend): init aris-backend with Hono
- Add apps/aris-backend package with Hono server
- Add /health endpoint
- Add backend-spec.md with design decisions

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 14:54:08 +00:00
13300fb6a6 Merge pull request #15 from kennethnym/feat/source-tfl
refactor: migrate aris-data-source-tfl to aris-source-tfl
2026-01-25 14:23:26 +00:00
66ee44b470 refactor: migrate aris-data-source-tfl to aris-source-tfl
Migrates TFL package from old DataSource interface to new FeedSource
interface for use with FeedEngine.

Changes:
- Rename package from @aris/data-source-tfl to @aris/source-tfl
- Replace TflDataSource class with TflSource implementing FeedSource
- Add dependency on @aris/source-location for LocationKey
- Use normalized priority values (0-1) instead of arbitrary numbers
- Update tests for FeedSource interface
- Update README.md with new package name

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 14:20:13 +00:00
1893c516f3 Merge pull request #14 from kennethnym/feat/feed-engine
feat(core): add FeedEngine for FeedSource orchestration
2026-01-24 23:07:41 +00:00
181160b018 feat(core): add FeedEngine for FeedSource orchestration
Introduces FeedEngine that consumes FeedSource instances and manages
the dependency graph for context flow and item collection.

- Validates dependency graph (missing deps, circular references)
- Topologically sorts sources for execution order
- Runs fetchContext() in dependency order, accumulating context
- Runs fetchItems() on all sources with final context
- Supports reactive updates via onContextUpdate/onItemsUpdate
- Graceful error handling (continues after source failures)

Marks DataSource, ContextProvider, ContextBridge, Reconciler, and
FeedController as deprecated in favor of FeedSource + FeedEngine.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-24 22:42:00 +00:00
559f82ce96 Merge pull request #13 from kennethnym/feat/source-weatherkit
feat: add @aris/source-weatherkit package
2026-01-19 00:56:32 +00:00
5e040470c7 feat: add @aris/source-weatherkit package
Implements FeedSource for WeatherKit API. Depends on location source,
provides weather context for downstream sources, and produces weather
feed items.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-19 00:50:13 +00:00
c2f2aeec1d Merge pull request #12 from kennethnym/feat/source-location
feat(source-location): add LocationSource for push-based location context
2026-01-19 00:38:28 +00:00
75ce06d39b feat(source-location): add LocationSource for push-based location context
Implements FeedSource interface. Accepts external location pushes,
provides context to downstream sources, does not produce feed items.

Supports configurable history size.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-19 00:37:35 +00:00
a7b6232058 Merge pull request #11 from kennethnym/fix/core-package-json-paths
fix(core): correct main and types paths in package.json
2026-01-19 00:29:50 +00:00
5df3dbd1b5 fix(core): correct main and types paths in package.json
Paths pointed to index.ts but actual file is at src/index.ts.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-19 00:08:04 +00:00
b7c7bcfc7c Merge pull request #9 from kennethnym/feat/feed-source-interface
feat(core): add FeedSource interface
2026-01-18 23:49:31 +00:00
9a47dda767 test(core): remove legacy integration tests
Tests were for DataSource/ContextProvider/ContextBridge which are now
deprecated in favor of FeedSource.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 23:46:38 +00:00
286a933d1e test(core): add FeedSource integration tests
Tests graph validation (dependency existence, cycle detection, topological
sort) and refresh behavior (context accumulation, item collection).

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 23:45:05 +00:00
1d9de2851a feat(core): add FeedSource interface
Unifies DataSource and ContextProvider into a single interface that
forms a dependency graph. Sources declare dependencies on other sources
and can provide context, feed items, or both.

Deprecates DataSource, ContextProvider, and ContextBridge.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 23:32:47 +00:00
80192c6dc1 Merge pull request #8 from kennethnym/docs/gpg-signing-instruction
docs: add GPG signing instruction to AGENTS.md
2026-01-18 20:41:06 +00:00
0eb77b73c6 docs: add GPG signing instruction to AGENTS.md
Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 20:39:26 +00:00
dfce846c9a Merge pull request #7 from kennethnym/feat/feed-controller-orchestration
feat(core): add FeedController orchestration layer
2026-01-18 20:30:27 +00:00
b73e603c90 feat(core): return RefreshResult from ContextBridge.refresh()
Surfaces provider errors through RefreshResult.errors instead of
silently ignoring them.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 20:28:54 +00:00
037589cf4f refactor(core): rename getCurrentValue to fetchCurrentValue
Also use Promise.allSettled in ContextBridge.refresh() to handle
provider errors gracefully.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 20:23:54 +00:00
3c16dd4275 feat(core): add FeedController orchestration layer
Adds orchestration for feed reconciliation with context-driven updates:

- FeedController: holds context, debounces updates, reconciles sources
- ContextBridge: bridges context providers to controller
- ContextProvider: reactive + on-demand context value interface
- Branded ContextKey<T> for type-safe context keys

Moves source files to src/ directory and consolidates tests into
integration test.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 00:58:29 +00:00
2eff7b49dc Merge pull request #6 from kennethnym/fix/oxfmt-ignore-patterns
fix: ignore .claude and fixtures in oxfmt
2026-01-17 16:11:31 +00:00
d9405a239a fix: ignore .claude and fixtures in oxfmt
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 16:03:12 +00:00
1ed335f783 Merge pull request #2 from kennethnym/feat/data-source-tfl
Add @aris/data-source-tfl package
2026-01-17 11:58:44 +00:00
6ecf080177 Merge pull request #5 from kennethnym/chore/add-claude-skills
Add Claude skills for React best practices and web design
2026-01-17 11:58:33 +00:00
331a2596fa Add Claude skills for React best practices and web design
- react-best-practices: Performance optimization patterns (client-side only)
- web-design-guidelines: UI review against Web Interface Guidelines

Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 11:53:08 +00:00
482c1c8b0f Resolve bun.lock conflict
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 11:50:41 +00:00
c90bef0330 Merge pull request #4 from kennethnym/dev/agents-md
docs: add AGENTS.md
2026-01-17 11:49:25 +00:00
de813d5b4a docs: add AGENTS.md
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 11:48:20 +00:00
552629bcdb Merge pull request #3 from kennethnym/feat/data-source-weatherkit
Add WeatherKit data source package
2026-01-17 01:18:27 +00:00
51749ad811 Include response body in API error messages
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 01:18:06 +00:00
6cf147989f Refactor WeatherKit client to injectable interface
- Add WeatherKitClient interface and DefaultWeatherKitClient class
- WeatherKitDataSource accepts either client or credentials
- Simplify tests by injecting mock client directly
- Update fixture generation script to use new client class

Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 01:14:18 +00:00
850d1925b6 Add query() tests with mocked API response
Tests transformation logic including:
- Feed item type assignment
- Hourly/daily limits
- Timestamp from context
- Unit conversion (metric/imperial)
- Priority assignment
- Unique ID generation

Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 01:09:39 +00:00
ceb9dbd576 Fix flaky test assertion on condition code
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 00:40:28 +00:00
7e0f30351f Merge origin/master into feat/data-source-weatherkit
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 00:39:07 +00:00
494e211844 Add fixture generation instructions to README
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 00:38:15 +00:00
06c568ad69 Minify fixture and fix lockfile
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 00:37:22 +00:00
785cbefce4 Add WeatherKit data source package
Implements @aris/data-source-weatherkit for fetching weather data from
Apple WeatherKit REST API.

- WeatherKitDataSource class implementing DataSource interface
- Feed items: current, hourly, daily, and alerts
- Priority adjustment based on weather conditions and alert severity
- Unit conversion (metric/imperial)
- Response validation with arktype
- Test fixtures from real API responses

Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 00:34:46 +00:00
20559b92ad Resolve bun.lock conflict
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 00:08:29 +00:00
c2f0b03924 Minify fixture JSON
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 00:07:22 +00:00
8ec8b9a13e Add @aris/data-source-tfl package
TfL data source for tube, overground, and Elizabeth line alerts.

- Fetches line statuses and filters to minor/major delays and closures
- Sorts alerts by severity, then by proximity to user location
- Caches station data after first fetch
- Uses arktype for API response validation
- Supports API injection for testing

Co-authored-by: Ona <no-reply@ona.com>
2026-01-16 23:57:29 +00:00
948ffa1125 Merge pull request #1 from kennethnym/ci/init
Add test script and CI workflow
2026-01-16 23:52:43 +00:00