Skip to content

Latest commit

 

History

History
360 lines (336 loc) · 20.3 KB

Memory.md

File metadata and controls

360 lines (336 loc) · 20.3 KB

Agent Memory

Session Summary

Last Session: 2026-07-15 20:30 Active Task: T-024 — Auto-Replacement Queue — PENDING Last File Touched: apps/api/app/routers/webhooks.py Immediate Next Step: Implement auto-replacement queue for removed links.

Active Task

T-024 — Auto-Replacement Queue State: PENDING Started: 2026-07-15 20:30 Last Updated: 2026-07-15 20:30 Weight: STANDARD Spec Reference: spec-023-v1

Task Log

[2026-07-15 20:30] — T-023: Webhooks CRUD

Goal: Implement full webhook CRUD endpoints (currently stubbed). Spec Reference: spec-022-v1 Approach: Implemented all 5 webhook endpoints with Pydantic schemas for validation. Added URL validation, secret generation, and proper error handling. Checklist:

  • Backend: Implemented GET / - list webhooks
  • Backend: Implemented POST / - create webhook with secret generation
  • Backend: Implemented GET /{id} - get webhook
  • Backend: Implemented PUT /{id} - update webhook
  • Backend: Implemented DELETE /{id} - delete webhook
  • Backend: Added Pydantic schemas for validation
  • Tests: 33/33 pass
  • TypeScript: clean Outcome: Full webhook CRUD implemented. Users can create, list, update, and delete webhooks. Secrets auto-generated on creation. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Revert webhooks.py to stubbed version.

[2026-07-15 20:00] — T-022: ROI Estimator Widget

Task Log

[2026-07-15 20:00] — T-022: ROI Estimator Widget

Goal: Add ROI estimator widget to dashboard showing estimated value of backlinks earned. Spec Reference: spec-021-v1 Approach: Added backend endpoint to calculate ROI based on live backlinks and industry average cost ($150/link). Created frontend widget component with gradient styling. Checklist:

  • Backend: Added /api/v1/auth/roi endpoint
  • Frontend: Added getROI method to WeaveClient
  • Frontend: Created ROIWidget component
  • Frontend: Added widget to dashboard
  • Tests: 33/33 pass
  • TypeScript: clean Outcome: ROI widget displays estimated value of backlinks earned. Shows $0 message when no backlinks, otherwise displays total value with industry average context. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Remove /roi endpoint, remove ROIWidget component, revert dashboard changes.

[2026-07-15 19:30] — T-021: Plan Enforcement (Domain Limits)

Task Log

[2026-07-15 19:30] — T-021: Plan Enforcement (Domain Limits)

Goal: Enforce plan-based domain limits when users add domains. Spec Reference: spec-020-v1 Approach: Added domain limit constants to backend, updated domain creation to check limits, added API endpoint to get limit status, created frontend banner component. Checklist:

  • Backend: Added PLAN_DOMAIN_LIMITS constant
  • Backend: Updated create_domain to check limits
  • Backend: Added /api/v1/auth/limits endpoint
  • Frontend: Added getLimits method to WeaveClient
  • Frontend: Created DomainLimitBanner component
  • Frontend: Added banner to dashboard layout
  • Tests: 33/33 pass
  • TypeScript: clean Outcome: Plan-based domain limits enforced. Users see warning banner when at limit. Free users limited to 5 domains, Starter to 25, Pro to 100, Agency unlimited. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Revert domain.py changes, remove /limits endpoint, remove banner component.

[2026-07-15 19:00] — T-020: Placeholder Pages

Task Log

[2026-07-15 19:00] — T-020: Placeholder Pages

Goal: Create placeholder pages for /docs, /blog, /privacy, /terms to fix broken navigation links. Spec Reference: spec-019-v1 Approach: Created simple "Coming soon" pages with consistent styling and navigation back to home. Checklist:

  • Created /docs placeholder page
  • Created /blog placeholder page
  • Created /privacy placeholder page
  • Created /terms placeholder page
  • TypeScript: clean Outcome: All four placeholder pages created with consistent design. Navigation links now work correctly. Test Evidence: TypeScript compiles clean. Blockers: NONE Rollback: Delete the four page files.

[2026-07-15 18:30] — T-019: Auth Overhaul (Password + Magic Link + Email Verification)

Task Log

[2026-07-15 18:30] — T-019: Auth Overhaul (Password + Magic Link + Email Verification)

Goal: Implement complete auth system with password-based login, magic link (passwordless), OAuth, email verification, and password reset. Spec Reference: spec-018-v1 Approach: Implemented all three auth methods plus email verification and password reset flows. Used passlib for password hashing, created token models for verification/magic-link/password-reset, built email service with Resend and console fallback. Checklist:

  • Database: Added password_hash, email_verified, jwt_version to User model
  • Database: Created email_verifications, password_resets, magic_links tables
  • Migration: e7f1a2b3c4d5_auth_overhaul.py
  • Backend: EmailService with Resend + Console fallback
  • Backend: AuthService with password hashing, magic link, verification, reset
  • Backend: Updated auth router with new endpoints
  • Backend: Updated dependencies.py to check JWT version
  • Frontend: Updated login page with password + magic link + OAuth
  • Frontend: Created register page
  • Frontend: Created verify-email page
  • Frontend: Created forgot-password page
  • Frontend: Created reset-password page
  • Frontend: Created magic-link verification page
  • Frontend: Updated NextAuth to support password login
  • Tests: 33/33 pass
  • TypeScript: clean Outcome: Complete auth system implemented with all three methods (password, magic link, OAuth), email verification, and password reset. All tests pass, TypeScript compiles cleanly. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Revert auth.py router, services/auth.py, services/email.py, User model changes, migrations. Remove new frontend pages.

Task Log

[2026-07-15 17:30] — T-018: Data Export (CSV)

Goal: Add CSV export for links, credits, and domains. Plan-gated (Pro/Agency only). Spec Reference: spec-017-v1 Checklist:

  • Backend: GET /links/export, /credits/export, /domains/export endpoints
  • Backend: plan gating (403 for free/starter)
  • Frontend: export-button.tsx client component
  • Frontend: export buttons on links, credits, domains pages
  • Tests: 33/33 pass, TypeScript clean Outcome: CSV export fully operational. 3 endpoints generate CSV files. Download buttons on 3 dashboard pages. Plan-gated with upgrade redirect for non-Pro users. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Remove export endpoints from routers, remove export-button.tsx, revert page changes

[2026-07-15 17:00] — T-017: Landing Page Redesign

Goal: Redesign landing page with Hrefmatch-inspired UX: animated hero, problem/solution, 4-step flow, product demo, network preview, vetting card, pricing, FAQ. Spec Reference: spec-016-v1 Checklist:

  • Minimal nav (Logo | Pricing | Join Now)
  • Hero with animated A-B-C chain (CSS keyframes)
  • Problem/Solution before/after section
  • How It Works (4 steps)
  • Product Demo (MCP Connector + Dashboard preview)
  • Authority Growth section with search engine logos
  • Network Preview table (masked domains)
  • Quality Vetting card + match scoring table
  • Pricing (4 tiers)
  • FAQ (accordion with
    Details)
  • Footer
  • SEO metadata + JSON-LD preserved
  • Tests: 33/33 pass, TypeScript clean Outcome: Landing page fully redesigned with 11 sections. Animated hero, tabbed product demo, network preview, vetting card, FAQ accordion all implemented. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Revert apps/web/app/page.tsx from git history

[2026-07-15 16:30] — T-016: Dashboard Layout Redesign

Goal: Build shared UI components and redesign overview page with stat cards, DR chart, DR badges, status pills. Spec Reference: spec-013-v1 Checklist:

  • dr-badge.tsx component
  • status-pill.tsx component
  • stat-card.tsx component
  • Overview page redesigned (stat cards, DR chart, recent backlinks)
  • Links page uses StatusPill
  • Network page uses DrBadge
  • Tests: 33/33 pass, TypeScript clean Outcome: Dashboard redesign complete. Shared components used consistently across pages. Overview page now has stat cards with trends, DR chart, and recent backlinks table. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Revert dashboard pages, remove shared UI components

[2026-07-15 16:00] — T-015: Analytics & DR History Charts

Goal: Replace chart placeholders with real Recharts-based analytics. Spec Reference: spec-011-v1 Checklist:

  • Backend: analytics router (metrics, links, credits endpoints)
  • Backend: registered in main.py
  • Frontend: recharts installed
  • Frontend: api-client analytics methods
  • Frontend: analytics-content.tsx with 4 charts (DR/DA trend, links over time, credit flow, organic traffic)
  • Tests: 33/33 pass, TypeScript clean Outcome: Analytics page fully functional with 4 interactive Recharts charts and stat cards with trend indicators. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Remove analytics router, revert analytics page, remove recharts dependency

[2026-07-15 15:30] — T-014: Dashboard Domain Switcher Sidebar

Goal: Add domain switcher to sidebar with DR badges and context-based domain selection. Spec Reference: spec-012-v1 Checklist:

  • domain-context.tsx — React context with URL-persisted selection
  • domain-switcher.tsx — Sidebar component with DR badges
  • Layout updated with DomainProvider + DomainSwitcher + Suspense
  • TypeScript: clean Outcome: Domain switcher operational in sidebar. DR badges color-coded. Selection persists via URL query param. Test Evidence: TypeScript compiles clean. Blockers: NONE Rollback: Remove domain-context.tsx, domain-switcher.tsx, revert layout.tsx

[2026-07-15 15:15] — T-013: Notification System

Goal: Add database-backed notification system with bell icon, polling, and service integration. Spec Reference: spec-015-v1 Approach:

  1. Created Notification model (JSON type for cross-DB compat), Alembic migration, notification router (list/mark-read/mark-all-read)
  2. Created NotificationService.create() helper
  3. Integrated notifications into 4 services: crawler (link_removed), credits (credits_low), domain (domain_vetted), matching (link_placed)
  4. Created notification-bell.tsx client component with 60s polling, click-to-mark-read, dropdown
  5. Added bell to dashboard layout header Checklist:
  • Notification model + migration
  • NotificationService helper
  • Router: GET /, POST /{id}/read, POST /read-all
  • Integration: crawler, credits, domain, matching services
  • Frontend: api-client notification methods
  • Frontend: notification-bell.tsx component
  • Frontend: bell added to dashboard layout
  • Tests: 33/33 pass
  • TypeScript: clean Outcome: Full notification system operational. 4 notification types fire from existing services. Bell polls every 60s with unread badge. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Remove notification model/migration/router/service, revert service integrations, remove bell component

[2026-07-15 14:30] — T-012: Settings & Profile Management

Goal: Transform read-only settings page into functional account management — edit name, view plan, delete account. Spec Reference: spec-014-v1 Approach:

  1. Backend: Added ProfileUpdateRequest/AccountDeleteRequest schemas, update_profile/delete_account methods to AuthService, PUT /profile and DELETE /account endpoints
  2. Frontend: Created settings-content.tsx client component with editable name, plan display with upgrade CTA, delete account with email confirmation dialog Checklist:
  • Schemas: ProfileUpdateRequest, AccountDeleteRequest
  • Service: update_profile(), delete_account() in AuthService
  • Router: PUT /api/v1/auth/profile, DELETE /api/v1/auth/account
  • Frontend: api-client.ts updateProfile(), deleteAccount() methods
  • Frontend: settings-content.tsx client component
  • Frontend: settings/page.tsx server wrapper
  • Tests: 33/33 pass
  • TypeScript: clean Outcome: Settings page fully functional. Name editable, plan displayed from user.plan, account deletion requires email confirmation. Test Evidence: 33/33 tests pass. TypeScript compiles clean. Blockers: NONE Rollback: Revert settings/page.tsx, remove settings-content.tsx, remove auth.py endpoints and service methods

Task Log

[2026-07-15 13:30] — T-011: DoDo Payment Scaffolding + Remaining Defect Fixes

Goal: Scaffold DoDo payment integration (config, migration, router stubs with 503 graceful degradation), fix remaining defects (bonus worker, webhook worker, low-balance notification). Spec Reference: spec-010-v1.md (DoDo), spec-003-v1.md (Credits: bonus, low-balance), spec-006-v1.md (Webhooks) Approach:

  1. DoDo scaffolding: config.py, billing.py rewrite, user model rename, DB migration, frontend schema update
  2. Created bonus_worker.py for monthly plan bonuses (spec-003 §3)
  3. Created webhook_worker.py for HMAC-signed webhook dispatch with retry (D-008)
  4. Added low-balance notification in spend_credits (D-005)
  5. Updated all exports, scheduler, .env.example, CONTEXT.md Checklist:
  • Config: stripe_* → dodo_* vars
  • Billing router: rewritten for DoDo stubs (checkout, webhook, portal, plans)
  • User model: stripe_customer_id → dodo_customer_id
  • Migration: c5d9e4f6a7b8_rename_stripe_to_dodo_customer_id.py
  • Frontend schema: stripeCustomerId → dodoCustomerId
  • .env.example updated
  • CONTEXT.md updated
  • Bonus worker created + scheduled (CronTrigger day=1)
  • Webhook dispatcher worker created (HMAC signing, 3 retry attempts)
  • Low-balance notification fires webhook when balance < 10
  • Full test suite (33/33 passed) Outcome: DoDo payments scaffolded with 503 graceful fallback. Bonus worker distributes plan bonuses monthly. Webhook worker dispatches signed events with retry. Low-balance notification integrated. Test Evidence: 33/33 tests pass. All new workers import successfully. Blockers: DoDo API docs needed for full integration (checkout/webhook endpoints) Rollback: Revert config.py, billing.py, user model, migration, schema.ts

Task Log

[2026-07-15 12:30] — T-009: Audit & Complete Background Workers (7 workers)

Goal: Audit all 7 background workers against PRD/TDD requirements and ensure all are implemented, scheduled, and tested. Spec Reference: spec-006-v1.md (Link Validator), spec-008-v1.md (Triangulation), TDD §7 Approach:

  1. Listed all 7 workers: crawl, embedding, expiry, triangle, sla, metrics, digest
  2. Verified each worker implementation exists in apps/api/app/workers/
  3. Confirmed all 7 are registered in scheduler.py with appropriate intervals
  4. Ran full test suite (33/33 passed)
  5. Verified worker imports and scheduler import Checklist:
  • crawl_worker — validates all placed links daily ✅
  • embedding_worker — generates pgvector embeddings daily ✅ (new)
  • expiry_worker — expires old credits daily ✅
  • triangle_worker — forms A-B-C triangles hourly ✅
  • sla_worker — checks SLA deadlines daily ✅
  • metrics_worker — refreshes domain metrics weekly ✅
  • digest_worker — sends weekly email digest ✅
  • All 7 registered in scheduler with correct intervals
  • Full test suite passes (33/33) Outcome: All 7 background workers are implemented, tested, and scheduled. No missing workers. Test Evidence: All 33 tests pass. Worker imports and scheduler import successfully. Blockers: NONE Rollback: N/A

[2026-07-15 12:15] — T-008: Wire MCP Server Tools (6 tools)

Goal: Verify all MCP tools are properly registered and wired to backend API endpoints. Spec Reference: spec-005-v1.md (MCP Server), PRD FR-4.1, TDD §4.1 Approach:

  1. Reviewed packages/mcp-server/src/index.ts — all 6 tools already registered
  2. Verified each tool calls the correct client method in client.ts
  3. Verified each client method maps to an existing FastAPI endpoint
  4. Ran TypeScript compilation — no errors Checklist:
  • Step 1: Review existing index.ts tool registrations
  • Step 2: Verify client.ts method mappings
  • Step 3: Confirm all backend endpoints exist
  • Step 4: Run TypeScript compilation (clean) Outcome: All 6 MCP tools already fully wired and functional:
  • get_backlink → /api/v1/matching/discover (discover link opportunities)
  • place_link → /api/v1/matching/place (place outbound link, earn credits)
  • check_credits → /api/v1/credits/balance/by-name/{domain} (credit balance)
  • browse_network → /api/v1/network/ (browse vetted member sites)
  • domain_status → /api/v1/domains/by-name/{domain}/status (vetting status)
  • link_health → /api/v1/links/health (live/removed/broken status) Test Evidence: TypeScript compiles clean (npx tsc --noEmit passes). All 33 Python tests pass. Blockers: NONE Rollback: N/A (no changes needed)

[2026-07-15 11:30] — T-007: Implement Embedding Worker (pgvector pipeline for page indexing)

Goal: Create a background worker that periodically finds pages without embeddings and generates pgvector embeddings for them, enabling semantic matching. Spec Reference: spec-004-v1.md (Matching Engine), TDD §5.1, PRD FR-2.1 Approach:

  1. Created embedding_worker.py following the existing worker pattern (expiry_worker, triangle_worker)
  2. Worker queries for pages with embedding IS NULL and status = 'active'
  3. For each page, fetches content (via crawler or stored content) and generates embedding via EmbeddingService
  4. Stores embedding in pgvector Vector(384) column
  5. Added worker to scheduler (runs daily)
  6. Updated workers/__init__.py to export the new worker Checklist:
  • Step 1: Create embedding_worker.py with run() function
  • Step 2: Add to workers/init.py exports
  • Step 3: Register in scheduler.py with daily interval
  • Step 4: Run full test suite (33/33 passed) Outcome: Embedding worker created and integrated. Processes pages without embeddings using OpenAI text-embedding-3-small (with hash fallback). Scheduler runs it daily. Test Evidence: All 33 tests pass. Worker imports and scheduler import successfully. Blockers: NONE Rollback: Remove embedding_worker.py, revert workers/init.py and scheduler.py changes

[2026-07-15 11:00] — T-006: Fix Triangulation (A-B-C auto-formation on place_link)

Goal: Wire automatic A-B-C triangle formation when a link is placed via place_link(). Previously only assigned to existing pending triangles; never created new ones. Spec Reference: spec-008-v1.md §2 (Gap A — Auto-Assignment on Place Link), PRD FR-2.4 Approach:

  1. In MatchingService.place_link(), after creating the link, check for pending triangles matching the source→target domains
  2. If found, assign link to the triangle slot (ab/bc/ca)
  3. If no pending triangle matches, call TriangulationService.form_triangle(source_domain_id, target_domain_id) to find/create C
  4. If triangle formed, assign the new link to slot "ab" (A→B) Checklist:
  • Step 1: Read existing triangulation.py and matching.py place_link logic
  • Step 2: Add form_triangle call when no pending triangle matches
  • Step 3: Run full test suite (33/33 passed) Outcome: Triangulation now auto-forms when user places A→B link. Triangle status transitions from "forming" → "complete" when all 3 links placed. complete_triangle() already checks all 3 slots filled. Test Evidence: All 33 existing tests pass. No regressions. Blockers: NONE Rollback: Revert matching.py place_link changes (lines 367-395)