Skip to content

revert(install-flow): remove template-install pipeline#372

Merged
buremba merged 1 commit into
mainfrom
revert/install-flow
Apr 26, 2026
Merged

revert(install-flow): remove template-install pipeline#372
buremba merged 1 commit into
mainfrom
revert/install-flow

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented Apr 26, 2026

Removes the install flow merged earlier today (#369, #357, #362, and the install-side helpers from #359). Per the world-model discussion: schema-mirror is the wrong abstraction; cross-org vocabulary is the planned direction.

What this removes

  • `packages/owletto-backend/src/agents/install.ts` — `installAgentFromTemplate`, `resyncInstalledAgent`
  • `packages/owletto-backend/src/agents/install-routes.ts` — `POST /api/install`
  • `packages/owletto-backend/src/agents/install-manifest-routes.ts` — `GET /api/install/manifest/:slug`
  • All install integration tests
  • WhatsApp linking helpers from `subject-identities.ts` (`normalizePhoneE164`, `phoneToWhatsAppJid`, `linkWhatsAppToMember`) + their unit tests
  • Migration `20260425120000_add_template_mirror_tracking.sql`
  • Route registrations from `src/index.ts`

What this keeps

DB state

Prod was already migrated. Sequence run before this PR:

  1. `dbmate down` — rolled back `20260426120000_entities_entity_type_fk.sql` (will re-apply)
  2. `dbmate down` — rolled back `20260425120000_add_template_mirror_tracking.sql` (mirror columns dropped)
  3. Deleted the mirror migration file from disk
  4. `dbmate up` — re-applied only `20260426120000_entities_entity_type_fk.sql`

Pre-verified: 0 rows used the mirror columns (`managed_by_template_agent_id`, `source_template_org_id` across all affected tables) and 0 agents had `template_agent_id IS NOT NULL`. No user-visible data lost.

Net diff

```
11 files changed, 6 insertions(+), 2025 deletions(-)
```

Test plan

  • `bunx tsc --noEmit` clean
  • `make build-packages` clean
  • `bun run check` (Biome) clean
  • Migration sequence applied to prod (verified `entities.entity_type_id NOT NULL` post-revert)

, #359 install-half)

The install flow as built — schema-mirror clones a template's entity types /
relationship types / classifiers / watchers into each user's personal org —
was the wrong abstraction. Cross-org vocabulary (an entity in tenant org A
referencing a type defined in a public-catalog org B by FK) is the planned
direction; the mirror pipeline duplicated rows per user and added re-sync
complexity for no working installs (verified 0 rows used the mirror columns
in prod).

Removed:
- packages/owletto-backend/src/agents/install.ts (installAgentFromTemplate, resyncInstalledAgent)
- packages/owletto-backend/src/agents/install-routes.ts (POST /api/install)
- packages/owletto-backend/src/agents/install-manifest-routes.ts (GET /api/install/manifest/:slug)
- All associated integration tests
- subject-identities WhatsApp helpers (normalizePhoneE164, phoneToWhatsAppJid, linkWhatsAppToMember) + their unit tests
- db/migrations/20260425120000_add_template_mirror_tracking.sql (rolled back on prod first)
- Route registrations from src/index.ts

Kept:
- subject-identities.ts provisionMemberAndCoreIdentities — used by the signup
  hook in personal-org-provisioning.ts, orthogonal to install flow.
- #352 personal-org-on-signup, #350/#354/#355/#356 personal-finance content —
  no install dependencies.

DB state: prod migrated down via dbmate (mirror columns dropped), then
20260426120000_entities_entity_type_fk re-applied. 0 user-visible data lost.
@buremba buremba added the skip-size-check Bypass PR size gate for intentionally large single-concern changes label Apr 26, 2026
@buremba buremba merged commit d5dfbc2 into main Apr 26, 2026
14 of 15 checks passed
@buremba buremba deleted the revert/install-flow branch April 26, 2026 21:35
@github-actions github-actions Bot added the triage:needs-human Triage agent escalated for human review label Apr 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Triage decision: needs-human

Reasons:

  • PR size exceeds auto-merge threshold (2031 lines, 11 files; limits 300 lines, 10 files)
  • Failed pr-size status check due to exceeding 1000-line validation gate
  • No approved reviews yet

Next: merge manually after final review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-size-check Bypass PR size gate for intentionally large single-concern changes triage:needs-human Triage agent escalated for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant