5 Commits
Author SHA1 Message Date
a99d541b45 fix(db): actors outlived their accounts — the last table in the family (#655)
profiles (#637) and cat_conversations (#651) both cascade from the account
now. Each sweep stopped one table short of done, and `actors.user_id` is
what was left: it references nothing at all. Deleting an account still
leaves the actor standing — the row that owns every product, service,
project, cause, event, loan and asset the person ever published.

15 orphaned actors were live in production. They were `e2e-reset-*`,
`cat-wallet-eval-*` and `cascade-proof-*` rows: the verification of the
earlier fixes leaked rows into the table the next fix would be about.
Purged, behind a guard that proved they owned 0 rows across all 25 child
foreign keys before deleting anything.

Unlike its siblings this one cannot be closed with a constraint, which is
why this adds a check rather than a migration:

  - ON DELETE CASCADE would delete the actor, which cascades on into
    contracts, investments and bookings — destroying the COUNTERPARTY's
    record of an agreement because the other side closed their account.
  - ON DELETE SET NULL is rejected outright by actor_type_check, which
    requires actor_type='user' to have a non-null user_id.

The honest fix is a tombstone — keep the actor, sever the identity — which
needs a deleted/anonymous actor_type. That is a schema decision, not a
drive-by, so it is stated here and left for one.

Until it lands:

  - `actors.orphaned` in the nightly invariant gate. This is the part that
    covers call sites nobody thought to patch, including future ones.
  - the two known leak sites delete the actor explicitly:
    refresh-e2e-reset-tokens.mjs (every CI run) and write-test-supabase.js,
    whose comment claimed "cascade removes profile" — true, and precisely
    the trap: it names the fixed thing while missing the one still broken.

Mutation-tested both directions with --gate: one injected orphan makes it
exit 1, removing it exits 0.

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 19:39:49 +00:00
Your Name 38cc4669d8 chore: comprehensive codebase cleanup and organization
- Move 100+ files from root to proper directories
  - Migration scripts → scripts/db/
  - SQL files → supabase/sql/archive/
  - Test/debug scripts → scripts/test/
  - Documentation → docs/archive/ (organized by category)
  - Shell scripts → scripts/ (organized by category)

- Fix test organization
  - Remove nested tests/unit/tests/unit/ structure
  - Consolidate test files to proper locations

- Update documentation references
  - Update migration script paths in workflow docs
  - Update scripts/README.md with moved file notes

- Delete placeholder files
  - Remove empty placeholder.ipynb

- Result: Root directory now contains only essential config files
- Result: Professional, organized codebase structure
- Result: All files in proper locations per project standards

See docs/CLEANUP_COMPLETE.md for full details.
2025-12-21 22:57:54 +01:00
Your Name 94bfe613b6 chore: deploy local snapshot
Commit current local state for production deploy.
2025-12-10 16:56:40 +01:00
Your NameandClaude 4d26977e39 feat: Implement consistent navigation naming across app
Major consistency improvements:
- Renamed "My Journey" → "My Timeline" in sidebar
- Added "My" prefix to sidebar items (My Wallets, My Info)
- Added People tab to public profiles
- Renamed /journey route to /timeline
- Updated all code references from journey to timeline

Sidebar Navigation (My View):
- Dashboard
- My Timeline (was: My Journey)
- My Projects
- My People
- My Wallets (was: Wallets)
- My Info (new)

Public Profile Tabs:
- Overview (matches Dashboard)
- Timeline
- Projects
- People (new)
- Wallets
- Info

Route Changes:
- /journey → /timeline

Files Changed:
- src/config/navigationConfig.ts - Updated sidebar nav
- src/components/profile/PublicProfileClient.tsx - Added People tab
- src/components/profile/ProfilePeopleTab.tsx - New component
- src/components/timeline/SocialTimeline.tsx - journey → timeline
- src/app/(authenticated)/timeline/ - Renamed from journey
- src/app/(authenticated)/timeline/page.tsx - Updated references

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 16:14:30 +01:00
Your NameandClaude 2872828779 chore: version 0.1.1 deployment - fix configuration and dependencies
- Bump version to 0.1.1 for tracking
- Add webpack-bundle-optimizer script for Next.js config
- Simplify ESLint configuration to resolve missing dependencies
- Prepare for production deployment with proper version control

This deployment includes:
- Profile update fixes with banner_url support
- LN address validation
- Auth cookie fixes for profile updates
- Various documentation and testing improvements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 09:30:45 +02:00