Skip to content

chore: strip operator-of-the-SaaS layer (build-validation before history scrub) - #15

Merged
seungdo-keum merged 1 commit into
mainfrom
chore/strip-operator-layer
May 28, 2026
Merged

chore: strip operator-of-the-SaaS layer (build-validation before history scrub)#15
seungdo-keum merged 1 commit into
mainfrom
chore/strip-operator-layer

Conversation

@seungdo-keum

Copy link
Copy Markdown
Member

Removes Practiq's internal GTM/ops tooling that the extraction left in the repo (admin dashboards+components, outreach lib+20 crons, lib/admin, google-sc, instantly webhook, lead-gen + ops scripts incl. a prospect-PII CSV). Kept: admin-auth (middleware dep), product crons, slack/email utils (integrated into product). This PR validates the cleaned tree BUILDS; a history scrub of the same paths follows. 100 files removed.

The extraction left Practiq's own GTM/ops tooling in the public repo. Remove
it (no product code depends on it; admin-auth.ts is kept for middleware):
- src/app/admin/* + src/app/api/admin/* (operator dashboards: leads, analytics,
  funnels, agent-metrics, signups, incidents, blog, crawler) + components/admin/*
- src/lib/outreach/* + src/lib/admin/* + src/lib/seo/google-sc.ts
- 20 operator crons (cold-send, reply-monitor, discovery-outreach, email-nurture,
  slack-*, seo-fetch/submit, trade-press-send, ... ) — kept product crons
  (anomaly-detector, digest-compactor, embeddings-backfill, factedge-inference,
  freshness-refresh, health-check, nightly-briefing)
- src/app/api/webhooks/instantly (cold-email webhook; kept resend + stripe)
- operator scripts (lead-gen incl. a prospect-PII CSV, gsc-*, dogfood-*,
  jobspy-hiring-trigger, press-drafts, inspect-prod-*, ...)
- next.config: drop the .cycle/customer-discovery-kit tracing block

Build-validation only (this branch) before the history rewrite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@seungdo-keum
seungdo-keum merged commit 523c37a into main May 28, 2026
7 of 8 checks passed
@seungdo-keum
seungdo-keum deleted the chore/strip-operator-layer branch May 28, 2026 01:59
seungdo-keum added a commit that referenced this pull request May 28, 2026
…page + extended E2E

Three additive surfaces, all read-only / no risk to existing flows.

1. **FoundingCounter** (`src/components/founding-counter.tsx`)
   - Reads the singleton `FoundingSlot` row (cap default 50) and
     renders "X of 50 claimed" + progress bar + low-slots warning.
   - Two variants: `hero` (stacked card) for landing pages, `inline`
     (compact pill) for nav / sticky footer reuse.
   - DB blip fallback: renders "Limited to 50 firms · founding cohort"
     instead of "0 of 50" so the public page never shows a confusing
     zero-claimed scarcity number pre-launch.
   - Mounted on `/founding-member` (hero) AND `/pricing` (hero,
     beneath the existing rounded badge). Both pages set
     `dynamic = "force-dynamic"` + `revalidate = 0` so the counter
     reflects every Stripe-webhook write within seconds.
   - Side-effect safety: this component is READ-ONLY. The Stripe
     webhook holds the only write path with the atomic `UPDATE …
     WHERE claimed_count < cap` pattern. Re-rendering the counter
     a million times produces zero writes.

2. **/app/settings/learned-patterns** (`src/app/app/settings/learned-patterns/page.tsx`)
   - Operator-facing read view of every AgentRule the pattern learner
     has accumulated. Bucketed identically to the T4 firm-patterns
     reader: APPLY (promoted, ≥0.85) / Consider (candidate, 0.6-0.85) /
     DO NOT produce (RUN 21 unsafe within 30d) / Below threshold.
   - Each rule renders: title pattern · item type · client name ·
     confidence + visual bar · times applied · first-seen date.
     `promoted` and `unsafe` flags get colored badges.
   - Empty state nudges the operator to the approval queue.
   - Closes audit finding #15: "skill-generator writes patterns;
     promised UI doesn't exist." It does now — and matches the
     operator's mental model from the AI's perspective (same
     buckets the model sees in T4 firm-patterns prompt).

3. **Extended agent-pipeline E2E** (`tests/e2e/agent-pipeline.spec.ts`)
   - 4 new tests: a14 (download 401 anonymous), a15 (download
     unknown-format 400), a16 (/pricing renders counter), a17
     (/founding-member renders counter + Offer JSON-LD with
     LimitedAvailability).
   - All four explicitly tolerate the cap-only fallback so a
     pre-seeded DB doesn't fail the suite.

233/233 vitest pass · type-check ✅ · lint ✅. New surfaces are
backward-compatible and don't touch any existing write path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
seungdo-keum added a commit that referenced this pull request May 29, 2026
…page + extended E2E

Three additive surfaces, all read-only / no risk to existing flows.

1. **FoundingCounter** (`src/components/founding-counter.tsx`)
   - Reads the singleton `FoundingSlot` row (cap default 50) and
     renders "X of 50 claimed" + progress bar + low-slots warning.
   - Two variants: `hero` (stacked card) for landing pages, `inline`
     (compact pill) for nav / sticky footer reuse.
   - DB blip fallback: renders "Limited to 50 firms · founding cohort"
     instead of "0 of 50" so the public page never shows a confusing
     zero-claimed scarcity number pre-launch.
   - Mounted on `/founding-member` (hero) AND `/pricing` (hero,
     beneath the existing rounded badge). Both pages set
     `dynamic = "force-dynamic"` + `revalidate = 0` so the counter
     reflects every Stripe-webhook write within seconds.
   - Side-effect safety: this component is READ-ONLY. The Stripe
     webhook holds the only write path with the atomic `UPDATE …
     WHERE claimed_count < cap` pattern. Re-rendering the counter
     a million times produces zero writes.

2. **/app/settings/learned-patterns** (`src/app/app/settings/learned-patterns/page.tsx`)
   - Operator-facing read view of every AgentRule the pattern learner
     has accumulated. Bucketed identically to the T4 firm-patterns
     reader: APPLY (promoted, ≥0.85) / Consider (candidate, 0.6-0.85) /
     DO NOT produce (RUN 21 unsafe within 30d) / Below threshold.
   - Each rule renders: title pattern · item type · client name ·
     confidence + visual bar · times applied · first-seen date.
     `promoted` and `unsafe` flags get colored badges.
   - Empty state nudges the operator to the approval queue.
   - Closes audit finding #15: "skill-generator writes patterns;
     promised UI doesn't exist." It does now — and matches the
     operator's mental model from the AI's perspective (same
     buckets the model sees in T4 firm-patterns prompt).

3. **Extended agent-pipeline E2E** (`tests/e2e/agent-pipeline.spec.ts`)
   - 4 new tests: a14 (download 401 anonymous), a15 (download
     unknown-format 400), a16 (/pricing renders counter), a17
     (/founding-member renders counter + Offer JSON-LD with
     LimitedAvailability).
   - All four explicitly tolerate the cap-only fallback so a
     pre-seeded DB doesn't fail the suite.

233/233 vitest pass · type-check ✅ · lint ✅. New surfaces are
backward-compatible and don't touch any existing write path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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