Skip to content

Add Telegram-sourced pipeline service with config, store, bot endpoints, and tests - #2

Open
yl124915300-dot wants to merge 1 commit into
mainfrom
codex/conduct-final-project-cleanup-and-audit-11ixoo
Open

Add Telegram-sourced pipeline service with config, store, bot endpoints, and tests#2
yl124915300-dot wants to merge 1 commit into
mainfrom
codex/conduct-final-project-cleanup-and-audit-11ixoo

Conversation

@yl124915300-dot

Copy link
Copy Markdown
Owner

Motivation

  • Provide a minimal, deployable service that fetches Telegram messages, analyzes them, generates drafts, and exposes a review/publish workflow.
  • Support both mock and live modes so the pipeline can run without Telegram/OpenAI credentials and degrade gracefully when config is missing.

Description

  • Introduce configuration handling via src/config.js with typed helpers and auto mode detection, and update package.json (version bump, test script, and optionalDependencies for telegram).
  • Implement the core service in src/server.js with pipeline orchestration (runPipeline), simple LLM integration fallback (generateDraft), review state machine, bot command handling, HTTP API endpoints (/health, /pipeline/run, /pending, /approve, /reject, /publish, /bot/webhook, etc.), and periodic auto-run timer.
  • Add persistent JSON-backed storage in src/store.js (JsonStore) with safe flush/backup and upsert helpers, and Telegram client integration in src/telegram.js with a mock fallback and sendBotMessage utility.
  • Add docs and housekeeping: update top-level README.md, add detailed ai-hot-comments-render-oneclick-v2/README-RENDER.md, add .gitignore entries, and add tests under ai-hot-comments-render-oneclick-v2/test/ (smoke.test.js, store.test.js).

Testing

  • Added unit tests test/smoke.test.js and test/store.test.js to validate config.mode and JsonStore.upsertMessages behavior.
  • Ran the test suite with npm test (which executes node --test test/*.test.js) and the tests passed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant