Skip to content

Harden + scaffold: FastAPI/Celery/Postgres/Redis dynamic-pricing skeleton#1

Merged
MacFall7 merged 11 commits into
mainfrom
claude/harden-ecom-pricing-doxsG
May 12, 2026
Merged

Harden + scaffold: FastAPI/Celery/Postgres/Redis dynamic-pricing skeleton#1
MacFall7 merged 11 commits into
mainfrom
claude/harden-ecom-pricing-doxsG

Conversation

@MacFall7
Copy link
Copy Markdown
Owner

Summary

Greenfield scaffold of an authority-separated Shopify dynamic-pricing service. Pricing engine proposes, merchant policy gates, Shopify client executes, audit trail records. Guardrails are constructor inputs, not exception handlers. Rollback reads back through the append-only price_events table.

9 commits, ~1,800 LOC across 47 new files. Do NOT merge before reviewing the README narrative against the engineering — they should match.

Pre-merge checklist

Hygiene

  • Working-tree secrets scan clean — only legitimate field/argument names (shopify_api_key, sentry_dsn, secret: str) match (api_key|secret|password|token|dsn|bearer); no actual secret values
  • Brand/operator-language scan clean — zero matches for claude|anthropic|cowork|lovable|ai-generated|gpt|gemini|last updated|voice match|audit-defensible|operator note|justin|krishnamurthy
  • .env.example placeholders only (your-shopify-api-key-here, change-me)
  • .gitignore covers .env, *.db, __pycache__, .venv, node_modules, dist, .idea, .vscode, .DS_Store, *.log

License + attribution

  • LICENSE: MIT, Copyright (c) 2026 Mac McFall / M87 Studio
  • backend/app/__init__.py author block in place
  • frontend/package.json author and repository.url set (uses current repo name E-Commerce; GitHub redirect will handle post-rename)

README rewrite

  • Authority-separation framing (engine → policy → Shopify → audit)
  • Plain markdown headers, no emoji, no marketing language
  • "Known limitations" table is honest about the Shopify-client stub, the frontend stub, the toy pricing signal, and the missing API auth
  • Stack table, architecture diagram, design notes, quick-start, tests subsection, roadmap pointer, MIT footer

Tests / migrations / CI

  • backend/tests/test_smoke.py — 3 tests (health, root, X-Process-Time header)
  • backend/tests/test_pricing_engine.py — 8 tests covering cost floor, merchant min/max, max-change-pct caps (up + down), new-product protection, neutral-signal no-op, suggestion-id uniqueness
  • backend/tests/test_policy.py — 4 tests covering auto-apply window, manual-review hold, large-delta reject, no-change approval
  • backend/alembic/versions/0001_initial_schema.py — hand-written baseline for merchants, products, price_events (no live DB available to autogenerate against)
  • .github/workflows/ci.yml — ruff + pytest on backend, vite build on frontend, runs on push to main and on PR

Items NOT in this PR (your hand-off)

  • Repo rename e-commerceecom-dynamic-pricing (Settings → Rename — keyword surface matters for recruiter search)
  • Repo description: FastAPI + Celery + Postgres + Redis SaaS skeleton for Shopify dynamic pricing with guardrails, rollback, and audit trail.
  • Topics: fastapi celery postgres redis shopify saas marketplace dynamic-pricing python react typescript docker
  • Visibility flip if private
  • Profile pin on github.com/MacFall7

Test plan

  • cd backend && pip install -r requirements-dev.txt && pytest — expect 15 tests pass
  • cd backend && ruff check . — expect clean
  • cp .env.example .env && docker compose up --build — api on :8000, worker running, alembic migrations apply on startup
  • curl http://localhost:8000/health/ready — Postgres + Redis both report ok
  • cd frontend && npm install && npm run build — vite build succeeds
  • Read TECHNICAL_DEBT.md against backend/app/shopify/client.py — confirm the stub is documented as a stub and the cutover plan is reachable

Generated by Claude Code

claude added 11 commits May 12, 2026 22:10
- PricingEngine with guardrails as constructor inputs (min margin, max change pct, new-product protection)
- MerchantPolicy gates suggestions before any external write
- AuditTrail is append-only and is the rollback substrate
- ShopifyClient stubbed; HMAC webhook verification is real
- Structured JSON logging, X-Process-Time middleware, optional Sentry
- /health and /health/ready probe Postgres and Redis independently
The local alembic/ directory was tripping ruff's first-party autodetection,
so 'from alembic import ...' was being grouped with first-party imports.
@MacFall7 MacFall7 merged commit b969ad9 into main May 12, 2026
2 checks passed
@MacFall7 MacFall7 deleted the claude/harden-ecom-pricing-doxsG branch May 12, 2026 23:48
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.

2 participants