Skip to content

feat(006/5): cleanup legacy — spec 006 complete#1129

Merged
zbigniewsobiecki merged 3 commits intodevfrom
feat/006-cleanup-legacy
Apr 16, 2026
Merged

feat(006/5): cleanup legacy — spec 006 complete#1129
zbigniewsobiecki merged 3 commits intodevfrom
feat/006-cleanup-legacy

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

Plan 006/5 of spec 006 — the final cleanup plan. Spec 006 is complete after this merges.

No operator-visible changes. Routing tables, webhook flows, trigger dispatch, wizard UX, save body shapes — everything behaves identically to `dev`.

What's landed

Backend

  • `src/integrations/bootstrap.ts` — DELETED. Its three responsibilities split cleanly:
    • PM manifests register via `src/integrations/pm/index.ts` (already in place from 006/1–006/4; this plan extends that barrel to mirror manifests into `integrationRegistry` for the cross-category capability resolver + integration-validation).
    • SCM (GitHub) self-registers via new `src/github/register.ts`.
    • Alerting (Sentry) self-registers via new `src/sentry/register.ts`.
  • `src/pm/registry.ts` — converted to a read-only adapter over `pmProviderRegistry`. `get`/`getOrNull`/`all`/`createProvider`/`resolveLifecycleConfig` all delegate. `register()` is a deprecation warn. The 9 unmigrated call sites (webhook handlers, manual runner, credential scope, lifecycle, GitHub adapter) keep working unchanged — they transparently read from the manifest registry now. Single source of truth = `pmProviderRegistry` with zero divergent registration.
  • `src/router/index.ts` + `src/worker-entry.ts` — import the three new side-effect modules instead of the deleted bootstrap.
  • `src/integrations/registry.ts` — header comment updated to reflect the new population topology.

Test wiring

  • `tests/unit/integrations/bootstrap.test.ts` — rewritten to assert the same end-state invariants against the new wiring (file name retained for audit lineage).
  • 8 other test files that imported `bootstrap.js` as a side effect are migrated to import the three new modules.

Docs

  • `src/integrations/README.md` — full rewrite. Transitional note + "Legacy path" section removed. The README is now the single canonical author's guide for adding a new PM provider.
  • `CLAUDE.md` — integration-abstraction pointer reflects the final state.
  • `CHANGELOG.md` — entry per plan.

Spec status

`docs/specs/006-pm-integration-plug-and-play.md.done` — the spec is marked complete in a trailing commit.

Plan-divergence (both documented in the `.done` plan)

  • AC chore: add .nvmrc for Node.js 22 #2 (delete `src/pm/registry.ts`) became "convert to a read-only delegate." Deleting the file outright would require migrating 9 call sites across webhook handlers, manual runner, credential scope, lifecycle, and the GitHub adapter — all out of spec 006 scope. The delegate preserves the spec's intent (single source of truth) without downstream churn. A follow-up PR can migrate the call sites to `pmProviderRegistry` directly and then delete the adapter.
  • AC feat: add UpdateChecklistItem gadget and improve agent workflow #5 (consolidate `createXxxLabel` / `createXxxCustomField` tRPC endpoints into `pm.discovery.*`) deferred to a follow-up PR. `useTrelloLabelCreation`, `useJiraCustomFieldCreation`, `useLinearLabelCreation` still call the per-provider endpoints and work correctly. Purely additive cleanup; not required for any spec AC.

Tests

  • 7809 / 7809 tests pass
  • Conformance harness still runs 44 assertions (11 × TestProvider + Trello + JIRA + Linear)
  • Lint + typecheck + backend build + web build all clean

Spec 006 outcome-level ACs — all satisfied

  1. ✅ New PM provider = one backend folder + one frontend folder; no edits to shared registries or wizard routing. Conformance harness fails CI on missing contract surface.
  2. ✅ Harness exercises every registered provider on every cross-cutting behavior (44 assertions across 4 providers).
  3. ✅ Trello, JIRA, Linear behave identically — zero operator-visible regressions across 5 PRs.
  4. ✅ Cross-cutting provider logic has one canonical implementation per concern. Divergent copies (Bearer-prefix auth, UUID resolver, Linear extractor branch) are physically impossible now.
  5. ✅ Wizard renders every PM provider via the manifest registry — no per-provider branches in `pm-wizard.tsx`.
  6. ✅ Migration rolled out with zero half-migrated states — each PR independently revertable.
  7. ✅ `src/integrations/README.md` rewritten as the single canonical author's guide.

Post-merge

  • Local: full `npm test` green (7809/7809); lint + typecheck + backend build + web build all clean
  • After deploy-dev: regression-test the three PM wizards — save each, trigger each provider's webhooks. Byte-for-byte identical behavior expected.

🤖 Generated with Claude Code

zbigniewsobiecki and others added 3 commits April 16, 2026 14:40
Closes plan 006/5 — the final cleanup plan of spec 006.

Backend:
- src/integrations/bootstrap.ts — DELETED. PM registrations flow through
  src/integrations/pm/index.ts (which also mirrors manifests into
  integrationRegistry). SCM (GitHub) and alerting (Sentry) self-register
  via new side-effect modules.
- src/github/register.ts + src/sentry/register.ts — new minimal
  side-effect modules that replace the respective branches of the
  deleted bootstrap. SCM + alerting stay on the legacy IntegrationModule
  pattern (out of spec 006 scope).
- src/pm/registry.ts — converted to a read-only adapter over
  pmProviderRegistry. get/getOrNull/all/createProvider/
  resolveLifecycleConfig all delegate to the manifest registry.
  register() is a deprecation warn. The ~9 unmigrated call sites
  (webhook handlers, manual runner, credential scope, lifecycle, GitHub
  adapter) keep working unchanged — they now transparently read from
  the manifest registry, so there is no divergent registration.
- src/router/index.ts + src/worker-entry.ts — updated to import the
  three new side-effect modules instead of the deleted bootstrap.
- src/integrations/registry.ts — header comment updated to reflect
  the new population topology.

Tests:
- tests/unit/integrations/bootstrap.test.ts — rewritten to cover the
  new side-effect-module wiring (the file name stays for audit clarity;
  its content asserts the same end-state invariants).
- 8 other test files that imported bootstrap.js for side effect are
  migrated to import the three new modules (pm barrel + github/register
  + sentry/register).

Docs:
- src/integrations/README.md — rewritten. Transitional note + "Legacy
  path" section removed. The README is now the single canonical
  author's guide for adding a new PM provider.
- CLAUDE.md — integration-abstraction pointer updated to final state.
- CHANGELOG.md — entry per plan.

Plan-divergence:
- AC #2 (delete pm/registry.ts) — became: convert to a read-only
  delegate. Deleting it would require migrating 9 call sites that are
  out of spec scope. The delegate preserves the end state (single
  source of truth = pmProviderRegistry) without downstream churn.
- AC #5 (consolidate createXxxLabel tRPC endpoints) — deferred to a
  follow-up PR. Purely additive cleanup; not required for any spec AC.

Both divergences documented in the .done plan.

Tests: 7809/7809 pass. Build + lint + typecheck clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 5 plans of spec 006 (pm-integration-plug-and-play) have landed:
- 006/1 infrastructure — manifest contract + registry + conformance
  harness + shared helpers + generic wizard renderer
- 006/2 migrate-trello
- 006/3 migrate-jira
- 006/4 migrate-linear — completes all 3 PM providers + shared-helper
  adoption (canonical auth headers + label resolver; divergent copies
  deleted)
- 006/5 cleanup-legacy — bootstrap.ts deleted; pmRegistry becomes a
  delegate; README rewritten as canonical author's guide

Outcome-level ACs of the spec all satisfied:
- A new PM provider is added by creating one backend folder + one
  frontend folder. No edits to shared registries, router routes,
  wizard routing, trigger dispatch, or job extractors.
- Conformance harness iterates every registered manifest (44 tests
  across TestProvider + Trello + JIRA + Linear) and fails CI on any
  missing contract surface.
- Trello, JIRA, Linear continue to work identically — operators see
  no change.
- Divergent cross-cutting copies (Bearer-prefix auth, UUID-vs-name
  label resolver, forgotten job-id extractor branch) are physically
  impossible now — shared helpers are the sole call sites.
- Wizard adapts entirely from the manifest registry.
- Each migration shipped independently and is independently revertable.
- src/integrations/README.md rewritten as the single canonical guide.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 491d965 into dev Apr 16, 2026
8 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feat/006-cleanup-legacy branch April 16, 2026 14:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pm/registry.ts 60.00% 6 Missing ⚠️
src/router/index.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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