feat: add tree forking, custom steps, and session sharing #39

Merged
chihlasm merged 1 commits from feat/foundational-schema into main 2026-02-08 00:31:21 +00:00
chihlasm commented 2026-02-08 00:21:24 +00:00 (Migrated from github.com)

Summary

  • Tree Forking (Migration 022): Engineers can fork any accessible tree to create personal copies with full lineage tracking (parent_tree_id, root_tree_id, fork_depth), supporting the junior→senior review workflow. 3 new endpoints: fork, list forks, lineage chain.
  • Custom Step Enhancement: CustomStepSchema with source tracking (ad-hoc, step-library, forked-tree) — backward compatible with existing JSONB sessions.
  • Session Sharing (Migration 023): Read-only share links with session_shares and session_share_views tables, public/account-scoped visibility, cryptographic tokens, view counting, expiration support, and allow_public_shares account policy. 4 new endpoints.
  • SaaS Consultant Hardening: NULL account_id guard, rate limiting on public share access (30/min), denormalized account_id on shares and session_id on views for analytics.
  • Test Fix: Disabled REQUIRE_INVITE_CODE in test conftest to fix pre-existing 400 errors on registration.

Test plan

  • 9 tree forking tests (fork creation, lineage, access control, structure preservation)
  • 12 session sharing tests (create, access, revoke, view count, ownership, auth)
  • Full suite: 103/103 tests passing

🤖 Generated with Claude Code

## Summary - **Tree Forking (Migration 022):** Engineers can fork any accessible tree to create personal copies with full lineage tracking (`parent_tree_id`, `root_tree_id`, `fork_depth`), supporting the junior→senior review workflow. 3 new endpoints: fork, list forks, lineage chain. - **Custom Step Enhancement:** `CustomStepSchema` with source tracking (`ad-hoc`, `step-library`, `forked-tree`) — backward compatible with existing JSONB sessions. - **Session Sharing (Migration 023):** Read-only share links with `session_shares` and `session_share_views` tables, public/account-scoped visibility, cryptographic tokens, view counting, expiration support, and `allow_public_shares` account policy. 4 new endpoints. - **SaaS Consultant Hardening:** NULL `account_id` guard, rate limiting on public share access (30/min), denormalized `account_id` on shares and `session_id` on views for analytics. - **Test Fix:** Disabled `REQUIRE_INVITE_CODE` in test conftest to fix pre-existing 400 errors on registration. ## Test plan - [x] 9 tree forking tests (fork creation, lineage, access control, structure preservation) - [x] 12 session sharing tests (create, access, revoke, view count, ownership, auth) - [x] Full suite: 103/103 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code)
railway-app[bot] commented 2026-02-08 00:21:55 +00:00 (Migrated from github.com)

🚅 Deployed to the patherly-pr-39 environment in selfless-grace

Service Status Web Updated (UTC)
hopeful-liberation Success (View Logs) Web Feb 8, 2026 at 12:27 am
patherly Success (View Logs) Web Feb 8, 2026 at 12:26 am
<!-- railway-bot-comment-version=2 --> <!-- railway-project-id="22b9b58c-271b-42e5-a10e-6fdec8d00134" railway-project-name="selfless-grace" --> 🚅 Deployed to the [patherly-pr-39](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134?environmentId=0b820e05-3ef2-4954-a718-22cfcffbea04) environment in **[selfless-grace](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134)** | **Service** | **Status** | **Web** | **Updated** (UTC) | | :--- | :--- | :--- | :--- | | hopeful-liberation | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/e1db2ee3-d241-4f45-abe4-c9c5fdf483d5?id=c8d09574-fb2c-43e0-913a-892ff1d9660c&environmentId=0b820e05-3ef2-4954-a718-22cfcffbea04)) | [Web](https://hopeful-liberation-patherly-pr-39.up.railway.app) | Feb 8, 2026 at 12:27 am | | patherly | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/95f556ff-5264-4116-a0c2-618a2fc53ba4?id=f86d5382-6e23-43c5-8629-016c0a7c1829&environmentId=0b820e05-3ef2-4954-a718-22cfcffbea04)) | [Web](https://patherly-patherly-pr-39.up.railway.app) | Feb 8, 2026 at 12:26 am |
Sign in to join this conversation.