Skip to content

fix: add missing posts search_topic column#3

Open
777genius wants to merge 1 commit into
m13v:mainfrom
777genius:fix/posts-search-topic-schema
Open

fix: add missing posts search_topic column#3
777genius wants to merge 1 commit into
m13v:mainfrom
777genius:fix/posts-search-topic-schema

Conversation

@777genius

@777genius 777genius commented May 13, 2026

Copy link
Copy Markdown

Hi! Nice project!

Summary:

  • Add the missing posts.search_topic column to schema-postgres.sql
  • Keep the migration idempotent with ADD COLUMN IF NOT EXISTS

Why:

  • Several scripts already read or write posts.search_topic, including top_search_topics.py and platform logging helpers

Tests:

  • git diff --cached --check
  • staged diff reviewed for local config, accounts, tokens, and product-specific data

m13v added a commit that referenced this pull request Jul 6, 2026
)

Root cause of lost drafts: a producer cycle that dies after its worker writes the
result but before consuming it strands the result in claude-queue/result/ (a
consumed result is deleted, so a surviving one = never consumed) -> no plan, no
merge, no card. Nothing detected or recovered these.

#1 Salvage (scripts/salvage_orphaned_prep_results.py, wired into run-draft-and-publish.sh):
   scans result/ for orphaned twitter-prep results (past the queue timeout so no
   live producer is racing, and within a max-age so stale threads are retired) and
   merges their candidates into the review queue via merge_review_queue.py (dedup-safe).
   Recovered 11 real stranded drafts on first run.

#2 Success/orphan visibility (claude_job.py): log a "consumed result for job X"
   event on the success path (the silent gap that made an orphaned result look
   identical to a healthy one); the salvage script logs the "ORPHAN ..." event.

#3 Correlation (claude_job.py): every provider.log line now carries batch=<BATCH_ID>
   so it links to the cycle's own twitter-cycle-<batch>.log.

#4 Remote visibility (scripts/relay_provider_log.py, wired into mcp/src/index.ts):
   tail claude-queue/provider.log to Cloud Logging (context="queue-provider"),
   incremental + self-locking + forward-only baseline, so a stranded batch on a
   customer box is queryable remotely instead of only on the box.

Also: refresh the CLAUDE.md note now that the persona lane is arm-aware.

Co-Authored-By: Claude Opus 4.8 <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