From 78bcdfe01d4a30404b917469002d8828b65c112a Mon Sep 17 00:00:00 2001 From: Hoid Date: Thu, 26 Feb 2026 13:05:15 +0000 Subject: [PATCH] docfast session 99: usage middleware tests (177 total) --- projects/business/memory/sessions.md | 10 +++++++ projects/business/memory/state.json | 4 +-- projects/snapapi/memory/bugs.md | 17 +++++++++++ projects/snapapi/memory/sessions.md | 42 ++++++++++++++++++++++++++++ projects/snapapi/memory/state.json | 8 +++--- 5 files changed, 75 insertions(+), 6 deletions(-) diff --git a/projects/business/memory/sessions.md b/projects/business/memory/sessions.md index aaab8fa..f70ef59 100644 --- a/projects/business/memory/sessions.md +++ b/projects/business/memory/sessions.md @@ -1,5 +1,15 @@ # Session Log +## Session 99 — 2026-02-26 13:00 UTC (Thursday Afternoon) +- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts +- **Staging:** v0.5.1 ✅ healthy (3 test-only commits ahead of prod) +- **K8s cluster:** All 3 nodes Ready +- **Support:** Zero tickets +- **Proactive improvements completed:** + 1. **Usage middleware tests** — New `src/__tests__/usage.test.ts` with 14 tests covering: loadUsageData (DB populate, empty results, error handling), getUsageStats (unknown key, masking), usageMiddleware (free/pro under limit → next(), free 100 → 429, pro 5000 → 429, count increment, month reset, missing apiKeyInfo). + 2. **177 tests total** (up from 163), all passing across 13 test files. +- **Investor test:** All 5 checks pass ✅ + ## Session 98 — 2026-02-26 10:00 UTC (Thursday Mid-Morning) - **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts - **Staging:** v0.5.1 ✅ healthy diff --git a/projects/business/memory/state.json b/projects/business/memory/state.json index 66d0c5c..cc5edf5 100644 --- a/projects/business/memory/state.json +++ b/projects/business/memory/state.json @@ -3,7 +3,7 @@ "phaseLabel": "Build Production-Grade Product", "status": "launch-ready", "product": "DocFast — HTML/Markdown to PDF API", - "currentPriority": "Production on v0.5.1, staging 2 commits ahead (test-only). Test suite: 163 tests passing (12 test files), 0 npm vulnerabilities. Still need SDK tokens + GSC verification.", + "currentPriority": "Production on v0.5.1, staging 3 commits ahead (test-only). Test suite: 177 tests passing (13 test files), 0 npm vulnerabilities. Still need SDK tokens + GSC verification.", "ownerDirectives_PRIORITY": "Process these IN ORDER. Do not skip. Remove items marked ✅ DONE/FIXED during housekeeping.", "ownerDirectives": [ "Stripe Product ID for DocFast: prod_TygeG8tQPtEAdE — webhook handler must filter by this product_id to ignore events from other projects on the same Stripe account." @@ -85,5 +85,5 @@ }, "blockers": [], "startDate": "2026-02-14", - "sessionCount": 98 + "sessionCount": 99 } diff --git a/projects/snapapi/memory/bugs.md b/projects/snapapi/memory/bugs.md index b2a22bd..6ccd5b4 100644 --- a/projects/snapapi/memory/bugs.md +++ b/projects/snapapi/memory/bugs.md @@ -60,6 +60,23 @@ - **Deployed to staging:** Yes (commit db1fa8d). Full link crawl: zero 404s across all pages. - **Production:** Awaiting investor approval for v* tag +### BUG-012: /health reports hardcoded version 0.1.0 (LOW) — IN PROGRESS +- **Found:** Session 27 +- **Impact:** Health endpoint shows wrong version, makes monitoring/debugging harder +- **Fix:** Read version from package.json dynamically +- **Status:** Sub-agent working on fix + +### BUG-013: OpenAPI spec stale — missing GET /v1/screenshot, /v1/usage; has removed /v1/signup/free (MEDIUM) — IN PROGRESS +- **Found:** Session 27 +- **Impact:** API docs misleading for developers +- **Status:** Sub-agent working on fix + +### BUG-014: /usage.html missing from production (MEDIUM) +- **Found:** Session 27 +- **Impact:** Landing page may link to usage dashboard that doesn't exist on production +- **Root cause:** v0.5.2 image was built before usage dashboard commit (5b59a7a) +- **Fix:** Needs new production deploy after staging verified + ## Open ### BUG-007: Simultaneous browser restart causes QUEUE_FULL (HIGH) — FIXED (staging) diff --git a/projects/snapapi/memory/sessions.md b/projects/snapapi/memory/sessions.md index c6bd2e7..c051ed0 100644 --- a/projects/snapapi/memory/sessions.md +++ b/projects/snapapi/memory/sessions.md @@ -1,5 +1,47 @@ # SnapAPI Session Log +## Session 27 — 2026-02-26 11:00 UTC (Quality Fixes + State Accuracy Audit) + +**Goal:** Fix documentation/API accuracy issues, audit state.json accuracy. + +### Findings + +1. **State.json was inaccurate** — claimed "v0.5.2 deployed with all staging features" but production is missing `usage.html` (added in commit 5b59a7a, after v0.5.2 image was built). Fixed state.json. +2. **`/health` reports version `0.1.0`** — hardcoded, never updated +3. **OpenAPI spec stale** — missing GET /v1/screenshot, GET /v1/usage; still had removed /v1/signup/free +4. **Container registry push broken** — token lacks `write:package` scope (same root cause as CI/CD blocker) + +### What Was Done + +1. **Spawned backend dev** (TDD approach): + - Bumped `package.json` version to `0.6.0` + - Fixed `/health` to read version from `package.json` dynamically + - Removed `/v1/signup/free` from OpenAPI spec + - Added 3 new OpenAPI spec tests + - Tests: 136 passing (up from 133), all green + - Commit: `2eca4e7` pushed to main + - **NOT deployed** — can't push Docker image (registry auth issue) + +2. **Filed new bugs**: BUG-012 (health version), BUG-013 (OpenAPI), BUG-014 (usage.html missing from prod) + +3. **Fixed state.json** — corrected version info and deployment status + +### Investor Test +1. Trust with money? **Mostly** — Stripe checkout works, webhook unregistered +2. Data loss on crash? **No** — PostgreSQL +3. Free tier abuse? **Low** — playground IP-limited + watermarked +4. Key recovery? **Yes on staging**, production has recovery.html but image may be stale +5. Website features? **Mostly** — usage page 404 on production + +### Blockers +- **Container registry push** — Forgejo token needs `write:package` scope (blocks ALL deploys) +- **Stripe webhook** — needs dashboard registration +- **CI/CD** — blocked by same Forgejo token issue + +**Assessment:** Code improvements pushed but deployment pipeline is broken. Need Forgejo API token with `write:package` scope to unblock ALL deployment. + +--- + ## Session 26 — 2026-02-26 08:00 UTC (Morning Health Check) **Goal:** Morning health check, verify systems, push for production deploy. diff --git a/projects/snapapi/memory/state.json b/projects/snapapi/memory/state.json index f9a4bae..3656d8d 100644 --- a/projects/snapapi/memory/state.json +++ b/projects/snapapi/memory/state.json @@ -1,11 +1,11 @@ { "phase": "production-live", - "version": "0.5.2-prod / 0.5.2-staging", + "version": "0.5.2-prod (missing usage dashboard+v0.6.0 fixes) / 0.5.2-staging (also missing v0.6.0, deploy blocked)", "staging": { "status": "running", "namespace": "snapapi-staging", "replicas": 1, - "image": "git.cloonar.com/openclawd/snapapi:b2688c0cce6dc8d5a97907c050da3b6143e86228", + "image": "git.cloonar.com/openclawd/snapapi:5b59a7a01078ad1f296feb80a8feddd149e8e6a1", "healthCheck": "passing" }, "production": { @@ -68,7 +68,7 @@ "CI/CD pipeline: workflows updated, RBAC+kubeconfig ready, BLOCKED on Forgejo token scope (needs write:repository)", "Staging TLS (blocked on DNS for staging.snapapi.eu — no DNS record exists)", "External uptime monitoring (no UptimeRobot account/key)", - "Deploy all staging features to production — DONE (v0.5.2 deployed 2026-02-26)" + "Deploy staging features to production — PARTIAL (v0.5.2 deployed but missing usage dashboard, openapi updates)" ], "stripeProducts": { "starter": { @@ -84,6 +84,6 @@ "priceId": "price_1T2XHpRtlDv9c8GoThHfd8kS" } }, - "lastSession": "2026-02-25T14:00:00Z", + "lastSession": "2026-02-26T11:00:00Z", "codeLocation": "Forgejo repo openclawd/SnapAPI. Clone: git clone forgejo-snapapi:openclawd/SnapAPI.git" }