Skip to content

docs+tests: architecture diagrams, E2E integration tests, webhook persistence update#43

Open
thedgarg31 wants to merge 3 commits into
Life-Atlas:stagingfrom
thedgarg31:daksh-25-june-work
Open

docs+tests: architecture diagrams, E2E integration tests, webhook persistence update#43
thedgarg31 wants to merge 3 commits into
Life-Atlas:stagingfrom
thedgarg31:daksh-25-june-work

Conversation

@thedgarg31

Copy link
Copy Markdown
Collaborator

Summary

This PR covers two deliverables assigned to Daksh (Phase 4), plus a README update for the GitHub webhook persistence fix from PR #41.


What was added

Task 1 — E2E Integration Tests (three-module flow)

New test file: \ ests/test_e2e_three_module_flow.py\ — 25 tests across 4 classes verifying the complete Goals → Signals → Recommendations pipeline.

TestGitHubWebhookParsing (5 tests)

  • Webhook parses \pr_merged, \pr_reviewed, \commit_pushed\ events correctly
  • Unknown event types return 200 gracefully (no crash)
  • Non-merged PRs are silently ignored

TestGitHubSignalIngestion (4 tests)

  • GitHub \pr_merged\ signal is persisted to Supabase \�ctivity_signals\ table
  • Stored signal is queryable via \GET /api/v1/signals/\
  • Queryable by \source=github_webhook\ filter
  • Fetchable by UUID via \GET /api/v1/signals/{id}\

TestThreeModuleFlow (7 tests) — the core E2E flow

  • GitHub signal surfaces in \GET /api/v1/recommendations/{user_id}\ — full three-module trace verified
  • Goal at
    eality-emulation\ → recommendation advances to \concurrent-engineering\
  • Each of all 6 SMILE phases advances exactly one step forward
  • Goal at \perpetual-wisdom\ (final phase) handled gracefully — no crash
  • Recommendation schema matches the \Recommendation\ Pydantic model exactly
  • Recommendations sorted by priority descending
  • No cross-module data leak (user A's signals don't appear in user B's recommendations)

TestPipelineThreeModuleFlow (5 tests) — the \POST /run\ endpoint

  • Pipeline always returns exactly 3 cards
  • All cards are valid \Recommendation\ objects
  • Guaranteed 3 cards even with zero goals and zero signals (cold-start fallback)
  • Pipeline references real goal UUID in \source_goals\
  • Cards sorted priority descending

TestFeedbackLoop (4 tests)

  • Accept feedback stored in
    ecommendation_feedback\ table
  • Dismiss feedback stored correctly
  • Requires JWT auth (401 without token)
  • Cross-user feedback rejected (403)

Task 2 — Architecture Diagrams + README

New Section 2: System Architecture added to \README.md\ — did not exist before this PR.

Diagrams added:

Diagram What it shows
High-level data flow FastAPI → 3 modules → store.py → 6 Supabase tables
Database relationships \goal_id\ FK on \�ctivity_signals, \
ecommendation_feedback\ schema
Goals → Recommendations \score_goal()\ trace, \source_goals\ traceability
Signals → Recommendations 3 ingestion paths: GitHub webhook / manual POST / external (Boardy)
LangGraph pipeline All 7 nodes (fetch/classify/reason/validate/enrich/fallback/finalise) with branching
Three-tier fallback LLM → deterministic → cold-start, when each fires
Feedback loop accept/dismiss → \
ecommendation_feedback\ → future re-ranking
End-to-end trace Complete flow from user login to recommendation card

Other README updates:

New doc: \docs/boardy-integration-plan.md\ — integration guide for Boardy as first external data source (webhook URL, shared secret auth, event schema mapping, checklist).


Type

  • Docs / reports
  • Feature (new E2E test suite)

Checklist

  • \make lint\ exits 0 (ruff + mypy clean)
  • \make test\ exits 0 — 197 passed, 0 failed
  • Tests added for changed behaviour (\ est_e2e_three_module_flow.py)
  • No .env\ secrets committed
  • PR targets \staging\

Tests passing

\
tests/test_e2e_three_module_flow.py — 25 tests (new)
tests/test_recommendations.py — 25 tests
tests/test_activity_signals.py — 23 tests
tests/test_goal_crud.py — 9 tests
tests/test_scoring.py — 48 tests
tests/test_smile.py — 19 tests
tests/test_rate_limit.py — 18 tests
tests/test_github_auth.py — 3 tests
tests/test_webhooks.py — 6 tests
tests/test_smoke.py — 3 tests
─────────────────────────────────────
TOTAL: 197 passed, 0 failed
\\

Daily report reference

Branch: \daksh-25-june-work\ — June 25, 2026

…fe-Atlas#41)

- Updated signal ingestion diagram to show 3 signal paths:
  GitHub webhook (auto, repo_db resolves user_id), manual POST, external sources
- Updated end-to-end trace: step 2 now shows track-repo populating repo_db,
  step 4 shows webhook resolving user_id from repo_db instead of default_user
- Updated GitHub Auth API table with repo_db explanation note
- Webhook now fully wired: GitHub event -> activity_signals -> recommendations
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