Commit graph

9 commits

Author SHA1 Message Date
3467909b80
feat: MPS-24 — manual tags are ghost metadata; hide behind a flag
Operator direction: stop hand-attaching tags ('ghost metadata'
invisible to the humans and agents reading the page). Derive tags
from title + description (auto-hydrate + suggest engine) instead.

- New MPS-22-style kill switch: app.features.manual_tags.enabled
  (request.manual_tags_enabled, DEFAULT FALSE, env
  MPS_FEATURES_MANUAL_TAGS_ENABLED, =True in test.ini so the existing
  tag suite keeps passing).
- product_edit.j2: hides the chip editor + comma tags field +
  product_tags.js; shows a 'tags are derived from your title &
  description' note (lists current auto-derived tags read-only).
- shop_tags.j2: hides 'Create a tag' + the per-product apply (focus)
  section; shows a 'How tags work' note. Suggest categories + the
  category overview stay (the blessed linguistic path).
- Endpoints remain functional -> flipping the flag On is instant and
  lossless ('until further notice').
- CLAUDE.md: 'Tag Philosophy' section + manual_tags row in the
  kill-switch matrix. mps-24.md Phase 2.8o.
- Tests: TestManualTagsKillSwitch (fresh app, flag False; mirrors
  TestKillSwitches). 1147 passed; existing tag suite green under
  test.ini (flag True).
2026-05-17 12:08:55 -04:00
157e6f769a
feat: bounded SSE feeds for offer & auction state machines
New text/event-stream endpoints — /o/{offer_id}/events (buyer/seller only)
and /a/{auction_id}/events (public). Each polls the row ~every 1.5s, emits
a `data: {json}` frame on connect and whenever the state-machine state
changes, sends a heartbeat comment, then closes after ~25s so the browser
EventSource reconnects — "bounded" because uWSGI is sync (~16 worker
threads) and a long-lived SSE would starve the pool. Shared helper
lib/sse.py (sse_response / event_stream); it uses its own short-lived DB
session per poll (request.dbsession is already closed by pyramid_tm by the
time the streaming generator runs). Timings come from settings
(app.sse.hold_seconds / app.sse.poll_interval_seconds; test.ini sets them
tiny so the streaming tests finish in ~0.06s).

Client: auction.js opens the EventSource and feeds each frame into its
existing applyState(); it falls back to polling /a/{id}.json every 5s
where EventSource is unavailable. offer.js opens the EventSource on the
offer page and reload()s on a state change (the whole layout depends on
state / can_act). offer.j2 carries data-offer-state. Caddy auto-detects
text/event-stream and stops buffering — no Salt change.

Tests: 4 new functional tests (both endpoints stream the right
content-type + a state frame; 404 for outsiders / unknown ids). 994 passed.
2026-05-12 21:03:50 -04:00
2659ebdcbe
MPS-22: kill-switch feature flags for karaoke + torrent
Karaoke (MPS-18) and torrent (MPS-19) are broken in production. Adding
two global feature flags off by default so neither feature surfaces in
UI or accepts route traffic until they're fixed.

Pattern mirrors app.features.popout_player.enabled — reified request
properties (request.karaoke_enabled, request.torrent_enabled) read from
ini settings. Templates wrap UI in {% if %}, views return HTTPNotFound
on form sections + routes, view contexts blank out feature-specific
keys when flag off so SPA navigation does not try to render them.

test.ini sets both flags True so existing feature tests keep working.
TestKillSwitches builds a fresh app with both False and verifies the
off path: form_section POSTs return 404, settings page omits sections,
karaoke route 404s, landing page omits karaoke marketing copy.

GET /s/{shop_id}/torrent-backfill-status is shadowed by an earlier
shop_slug catch-all route in production — pre-existing routing defect
that MPS-19 needs to fix when it lands.
2026-05-09 16:51:24 -04:00
af4b70a160 Fix parallel test execution with isolated per-worker databases
The previous parallel test attempt failed because all workers were trying
to use the same SQLite database file, causing locking errors.

Solution:
- Created conftest.py to configure pytest-xdist workers
- Each worker gets a unique database file (test_make_post_sell_gw0.sqlite, etc.)
- Enabled SQLite WAL (Write-Ahead Logging) mode for better concurrency
- WAL allows multiple readers while a writer is active
- Modified test.ini to use $TEST_DATABASE_PATH environment variable
- Automatic cleanup of worker databases after test completion

Benefits:
- True isolation between test workers
- No database locking conflicts
- Tests can run fully in parallel
- Expected test time reduction from 30min to ~5-10min

Each worker's database is completely isolated, preventing the SQLite
"database is locked" errors that plagued the previous attempt.
2026-01-21 12:07:16 -05:00
31592b6923 Add PayPal unit, integration, and sandbox functional tests 2025-12-22 15:21:46 -05:00
f3cd1e7116 Add Monero (XMR) payment support 2025-09-22 01:45:54 +00:00
e84a58061d stripe test mode 2024-12-13 00:58:29 +00:00
ff8bddadbb shop_id & active on cart table 2022-07-13 18:11:40 +00:00
c211df66a8 Time to open the sauce : )
Dead man switch activated. Good luck everyone, I wish you the best.

 - BDFL

	new file:   .gitignore
	new file:   MANIFEST.in
	new file:   Makefile
	new file:   README.rst
	new file:   development.ini
	new file:   journal.rst
	new file:   make_post_sell/__init__.py
	new file:   make_post_sell/config_jinja2.py
	new file:   make_post_sell/lib/__init__.py
	new file:   make_post_sell/lib/mail.py
	new file:   make_post_sell/lib/mail_messages.py
	new file:   make_post_sell/lib/render.py
	new file:   make_post_sell/models/__init__.py
	new file:   make_post_sell/models/cart.py
	new file:   make_post_sell/models/cart_coupon.py
	new file:   make_post_sell/models/coupon.py
	new file:   make_post_sell/models/coupon_redemption.py
	new file:   make_post_sell/models/invoice.py
	new file:   make_post_sell/models/market.py
	new file:   make_post_sell/models/meta.py
	new file:   make_post_sell/models/price.py
	new file:   make_post_sell/models/product.py
	new file:   make_post_sell/models/shop.py
	new file:   make_post_sell/models/shop_search_request.py
	new file:   make_post_sell/models/stripe_user_shop.py
	new file:   make_post_sell/models/user.py
	new file:   make_post_sell/models/user_product.py
	new file:   make_post_sell/models/user_shop.py
	new file:   make_post_sell/request_methods.py
	new file:   make_post_sell/routes.py
	new file:   make_post_sell/scripts/__init__.py
	new file:   make_post_sell/scripts/alembic/README
	new file:   make_post_sell/scripts/alembic/env.py
	new file:   make_post_sell/scripts/alembic/script.py.mako
	new file:   make_post_sell/scripts/alembic/versions/15751f5d7a03_add_active_cart_total_in_cents_to_user_.py
	new file:   make_post_sell/scripts/alembic/versions/24662905655f_create_new_active_shop_id_column_on_.py
	new file:   make_post_sell/scripts/alembic/versions/3e1e70bfe89d_google_analytics_id.py
	new file:   make_post_sell/scripts/alembic/versions/4d9da43b0e86_product_visibility_column.py
	new file:   make_post_sell/scripts/alembic/versions/5c40dfb56179_shop_ribbon_columns.py
	new file:   make_post_sell/scripts/alembic/versions/6da97f2f913f_add_updated_timestamp_to_cart.py
	new file:   make_post_sell/scripts/alembic/versions/96f851cbab01_terms_and_privacy.py
	new file:   make_post_sell/scripts/alembic/versions/ab7338eaedf1_add_price_in_cents_column.py
	new file:   make_post_sell/scripts/alembic/versions/af28cc35ed6f_product_bundles.py
	new file:   make_post_sell/scripts/alembic/versions/b0d5604d9255_add_active_cart_count_to_user_table.py
	new file:   make_post_sell/scripts/alembic/versions/bfc4195a7f56_product_is_sellable_coluumn.py
	new file:   make_post_sell/scripts/alembic/versions/c4d5566ec87d_coupon_stackable_and_couponredemption.py
	new file:   make_post_sell/scripts/alembic/versions/e12bbe39d87e_cart_coupon_table.py
	new file:   make_post_sell/scripts/alembic/versions/eadd0d69e133_shop_ribbon_text_color.py
	new file:   make_post_sell/scripts/alembic/versions/f3aa57777025_coupon_table.py
	new file:   make_post_sell/scripts/alembic/versions/f882f2255cd1_add_stripe_secret_and_public_key_to_shop.py
	new file:   make_post_sell/scripts/alembic/versions/fd9f7e2f2b78_user_full_name.py
	new file:   make_post_sell/scripts/initialize_db.py
	new file:   make_post_sell/scripts/pshell.py
	new file:   make_post_sell/static/css/alerts.css
	new file:   make_post_sell/static/css/common.css
	new file:   make_post_sell/static/css/lib.css
	new file:   make_post_sell/static/css/mps.css
	new file:   make_post_sell/static/favicon.ico
	new file:   make_post_sell/static/js/custom.js
	new file:   make_post_sell/static/js/jquery-3.4.1.min.js
	new file:   make_post_sell/static/js/jquery.min.js
	new file:   make_post_sell/static/makepostsell-3.png
	new file:   make_post_sell/static/makepostsell.png
	new file:   make_post_sell/static/mps.png
	new file:   make_post_sell/templates/actions_new.j2
	new file:   make_post_sell/templates/actions_view.j2
	new file:   make_post_sell/templates/base.j2
	new file:   make_post_sell/templates/billing.j2
	new file:   make_post_sell/templates/cart.j2
	new file:   make_post_sell/templates/cart_checkout.j2
	new file:   make_post_sell/templates/carts.j2
	new file:   make_post_sell/templates/content.j2
	new file:   make_post_sell/templates/content_new.j2
	new file:   make_post_sell/templates/coupon.j2
	new file:   make_post_sell/templates/coupon_new.j2
	new file:   make_post_sell/templates/coupons.j2
	new file:   make_post_sell/templates/home.j2
	new file:   make_post_sell/templates/join-or-log-in.j2
	new file:   make_post_sell/templates/markup_editor.j2
	new file:   make_post_sell/templates/markup_renderer.j2
	new file:   make_post_sell/templates/product.j2
	new file:   make_post_sell/templates/product_edit.j2
	new file:   make_post_sell/templates/product_new.j2
	new file:   make_post_sell/templates/products.j2
	new file:   make_post_sell/templates/shop.j2
	new file:   make_post_sell/templates/shop_about.j2
	new file:   make_post_sell/templates/shop_new.j2
	new file:   make_post_sell/templates/shop_products.j2
	new file:   make_post_sell/templates/shop_settings.j2
	new file:   make_post_sell/templates/shops.j2
	new file:   make_post_sell/templates/snippets/csrf.j2
	new file:   make_post_sell/templates/snippets/flash-alerts.j2
	new file:   make_post_sell/templates/snippets/google-analytics.j2
	new file:   make_post_sell/templates/snippets/optional-javascript.j2
	new file:   make_post_sell/templates/snippets/ribbon.j2
	new file:   make_post_sell/templates/snippets/search.j2
	new file:   make_post_sell/templates/snippets/stripe.j2
	new file:   make_post_sell/templates/update-card.j2
	new file:   make_post_sell/templates/user_settings.j2
	new file:   make_post_sell/tests/__init__.py
	new file:   make_post_sell/tests/test_functional.py
	new file:   make_post_sell/tests/test_models.py
	new file:   make_post_sell/views/__init__.py
	new file:   make_post_sell/views/actions.py
	new file:   make_post_sell/views/authentication.py
	new file:   make_post_sell/views/billing.py
	new file:   make_post_sell/views/cart.py
	new file:   make_post_sell/views/content.py
	new file:   make_post_sell/views/coupon.py
	new file:   make_post_sell/views/misc.py
	new file:   make_post_sell/views/product.py
	new file:   make_post_sell/views/shop.py
	new file:   make_post_sell/views/user.py
	new file:   pytest.ini
	new file:   requirements-dev.txt
	new file:   requirements-prod.txt
	new file:   requirements-test.txt
	new file:   requirements.py3.txt
	new file:   requirements.txt
	new file:   setup.py
	new file:   test.ini
2021-12-31 21:39:40 -05:00