backend-manager 5.8.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
14
14
  - `Fixed` for any bug fixes.
15
15
  - `Security` in case of vulnerabilities.
16
16
 
17
+ # [5.8.1] - 2026-06-19
18
+
19
+ ### Fixed
20
+ - **Ghostii 502 timeout fix.** Switched `writeArticle()` from the Firebase Hosting URL (`api.ghostii.ai`) to the raw Cloud Functions URL. Firebase Hosting rewrites have a hard 60-second proxy timeout that caused 502 errors when the AI article pipeline exceeded that limit. The raw URL uses the function's own 5-minute timeout.
21
+
22
+ ### Added
23
+ - **Ghostii call duration logging.** `writeArticle()` now logs the round-trip time of each Ghostii API call (`[ghostii] writeArticle() completed in Xms`).
24
+
17
25
  # [5.8.0] - 2026-06-19
18
26
 
19
27
  ### Added
package/PROGRESS.md CHANGED
@@ -3,10 +3,10 @@
3
3
 
4
4
  ## 🎯 Current Focus
5
5
  * **Goal:** RSS/Atom feed-based article generation for the Ghostii system
6
- * **Current Phase:** Implementation complete, pending deploy
7
- * **Priority:** High
8
- * **Last Updated:** 2026-06-18 6:45 PM PDT
9
- * **Notes:** All code + tests complete. Found and fixed humanizer bug — `injectBurstiness` was destroying markdown links by splitting on commas inside `[text](url)` syntax. Fixed with protect-and-restore pattern. Also fixed 403 links treated as "working" in verification step. Ghostii backend needs deploy.
6
+ * **Current Phase:** Shipped
7
+ * **Priority:** Complete
8
+ * **Last Updated:** 2026-06-18 7:30 PM PDT
9
+ * **Notes:** BEM v5.8.0 published to npm. Ghostii-backend v1.0.5 deployed to Firebase. All code, tests, and docs shipped.
10
10
 
11
11
  ## 📌 Active Task List
12
12
  * [ ] Phase 5: Ghostii feed-based article system
@@ -28,7 +28,8 @@
28
28
  * [x] Task 5.16: Fix humanizer stripping links — `injectBurstiness` was breaking `[text](url)` syntax; added protect-and-restore pattern + tests
29
29
  * [x] Task 5.17: Fix 403 links treated as "working" in link verification step
30
30
  * [x] Task 5.18: Add detective-level `[LINKS]` diagnostic logging to article pipeline
31
- * [ ] Task 5.19: Deploy Ghostii backend
31
+ * [x] Task 5.19: Ship BEM v5.8.0 to npm
32
+ * [x] Task 5.20: Ship Ghostii-backend v1.0.5 + deploy to Firebase
32
33
  * [ ] Task 5.17: Publish BEM with feed support
33
34
  * [ ] Task 5.12: Publish BEM with feed support
34
35
  * [ ] Task 5.13: Configure consumer project(s) with `$feed:` sources
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "5.8.0",
3
+ "version": "5.8.1",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -37,7 +37,7 @@ const powertools = require('node-powertools');
37
37
  * where `json` is the structured block array ([{ name, content }]) that
38
38
  * blocksToPost() consumes to build BEM's post shape.
39
39
  */
40
- function writeArticle({ brand, description, links, sourceContent, overrides }) {
40
+ async function writeArticle({ brand, description, links, sourceContent, overrides }) {
41
41
  const o = overrides || {};
42
42
 
43
43
  const body = {
@@ -60,13 +60,24 @@ function writeArticle({ brand, description, links, sourceContent, overrides }) {
60
60
  body.sourceContent = sourceContent;
61
61
  }
62
62
 
63
- return fetch('https://api.ghostii.ai/write/article', {
63
+ const start = Date.now();
64
+
65
+ // Original URL: https://api.ghostii.ai/write/article
66
+ // Firebase Hosting rewrites have a hard 60s proxy timeout that causes 502s
67
+ // on slow AI pipelines. The raw Cloud Functions URL uses the function's own
68
+ // 5-minute timeout instead.
69
+ const result = await fetch('https://us-central1-ghostii.cloudfunctions.net/writeGlobal/write/article', {
64
70
  method: 'post',
65
71
  timeout: 180000,
66
72
  tries: 1,
67
73
  response: 'json',
68
74
  body: body,
69
75
  });
76
+
77
+ const duration = Date.now() - start;
78
+ console.log(`[ghostii] writeArticle() completed in ${duration}ms (${(duration / 1000).toFixed(1)}s)`);
79
+
80
+ return result;
70
81
  }
71
82
 
72
83
  /**