index:   /home/flesler/.cache/scip-cli/projects/amazix-ai-bot-ba7e97/index.db
sidecar: /home/flesler/.cache/scip-cli/projects/amazix-ai-bot-ba7e97/atlas.db
index size:   2940.0 KB
sidecar size: 368.0 KB

========================================================================
META
========================================================================
  atlas_schema_version: 3
  git_head: d0eea7eabccadb9f68c4871e48a9c1d8dc758cbd
  last_sync_at: 2026-09-19T19:23:47+00:00
  last_summarize_at: 2026-09-19T19:26:56+00:00
  index_fingerprint: 1789845825205030567:3010560

========================================================================
COUNTS
========================================================================
  index documents:        115
  index symbols:          1172
  test files in index:    0
  atlas files (git):      115
  test files in atlas:    0
  atlas dirs:             17
  files with summary:     115
  dirs with summary:      17
  search_docs rows:       376

========================================================================
TOP-LEVEL DIRS (parent_path IS NULL OR parent_path = '')
========================================================================

  [(root)]
    author: Ariel Flesler  time: 1787000436
    summary: Atlas folder; devops tooling and Telegram bot source. Ops: log checker, config sync CLI, slug dry-run, HTTP tests, Telegram link parser, deletion cache, staggered broadcast, backup orchestrator. App: 

  [bin]
    author: Ariel Flesler  time: 1785248947
    summary: Dev ops folder; log checker, config sync CLI, slug dry-run simulator. HTTP tests post JSON with JWT to /message and /post. Telegram bot tools parse t.me links, cache deletions, broadcast staggered mes

  [src]
    author: Ariel Flesler  time: 1787000436
    summary: Telegram bot source; Express server, config loader, type declarations, entry wiring, utility helpers. Controllers wrap tables with typed queries; middlewares route commands and gate roles; actions and

========================================================================
DIR TREE (depth 2 from root)
========================================================================
  bin/ — Dev ops folder; log checker, config sync CLI, slug dry-run simulator. HTTP tests post JSON with JWT to /message and /post. Telegram bot tools parse t.me links, 
    └ author: Ariel Flesler
    heroku/ — Heroku ops folder; log checker parses timestamps and filters logs; config sync CLI reads .env and sets Heroku vars; slug dry-run simulator checks .slugignore ag
      └ author: Ariel Flesler
    http/ — Dev HTTP test scripts; get-reply posts JSON to /message with a Bearer JWT, post sends context and text to /post. Both import node:http, node:https, src/config, 
      └ author: Ariel Flesler
    tg/ — Telegram bot tooling; deletion checker, group-exit script, message-link parser, poster, reply-to handler. Parses t.me URLs, detects Cyrillic homoglyphs, caches 
      └ author: Ariel Flesler
  src/ — Telegram bot source; Express server, config loader, type declarations, entry wiring, utility helpers. Controllers wrap tables with typed queries; middlewares ro
    └ author: Ariel Flesler
    @types/ — Type declarations; Express type augmentation, JwtSession local, no runtime code, no deps.
      └ author: Ariel Flesler
    actions/ — Actions folder; message deletion, forwarding, reactions, replies, typing, text sending, document uploads, media routing.
      └ author: Ariel Flesler
    commands/ — Command handlers; about, help, ping, restart, lock, leave dispatchers; facts, ignored, schedules add/remove/managers; generate, answer, goodbot, config; each ex
      └ author: Ariel Flesler
    config/ — Config loader; dotenv parse, typed config object with http, log, db, telegram, openai, bot, jwt sections; env var helpers string, number, boolean, optionalStrin
      └ author: Ariel Flesler
    controllers/ — Controllers folder; db wrapper, entities, events, facts, groups, messages, onboarding, reactions, schedules, storage, subscriptions. Each wraps its table with t
      └ author: Ariel Flesler
    integrations/ — Integrations folder; web crawler, ExaAI contents client, knowledge uploader, LLM chat helpers, OpenAI client, Telegram bot, X/Twitter fetcher.
      └ author: Ariel Flesler
    middlewares/ — Middleware folder; command routing, mention handling, role gating, bot-question replies, fact augmentation, message threading, session store, forwarding, reacti
      └ author: Ariel Flesler
    modules/ — Auto-generated barrels; actions, commands, middlewares, rules each re-export their submodules as default arrays; typed via BotModule; build:barrels generates; n
      └ author: Ariel Flesler
    routes/ — src/routes; Telegram message router; message handler, reply/send actions, db, entities, subscriptions, storage controllers, telegram api, session types, enums, 
      └ author: Ariel Flesler
    types/ — Types folder; bot module contract, command metadata model, config types, telegram bot session types, JWT session.
      └ author: Ariel Flesler
    util/ — Utility helpers; text normalizer, JWT signer, token counter, HTTP error classes, regex patterns, logger, zod schema builders. Telegram file fetcher, LLM prompt 
      └ author: Ariel Flesler

========================================================================
DIRS BY FILE COUNT (top 12)
========================================================================

  src (96 files)
    rollup author: Ariel Flesler
    summary: Telegram bot source; Express server, config loader, type declarations, entry wiring, utility helpers. Controllers wrap tables with typed queries; middlewares route commands and gate roles; actions and

  bin (19 files)
    rollup author: Ariel Flesler
    summary: Dev ops folder; log checker, config sync CLI, slug dry-run simulator. HTTP tests post JSON with JWT to /message and /post. Telegram bot tools parse t.me links, cache deletions, broadcast staggered mes

========================================================================
SAMPLE FILES (first 15 by path)
========================================================================

  bin/backup-facts.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: Backup orchestrator for facts contexts; exports none; deps node:child_process, node:fs/promises, node:path, node:url, lodash, src/controllers/facts, src/util. Loads facts, writes per-context .txt files, prunes stale ones, then commits and…

  bin/build-barrels.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: Barrel generator for src/modules; imports node fs, path, child_process execSync, src/util; exports run; scans rules, middlewares, commands, actions dirs; writes auto-generated barrels listing each module as a BotModule entry with id…

  bin/changelog.ts
    git: Ariel Flesler @ 1785173104 — Clarify changelog version must be read after npm version bump.
    summary: Release automation; exports none; deps node:child_process, node:fs, src/util. Runs git, npm, and auto-changelog to bump version, prune old tags, and rewrite CHANGELOG.md.

  bin/create-db.ts
    git: Ariel Flesler @ 1784312136 — Work in progress huge freemium overhaul
    summary: Database schema bootstrap for a Node/Sequelize app; imports db, subscriptions, util; exports a create-db CLI invoked as `npm run bin -- bin/create-db.ts`; accepts `--drop` to wipe facts, reactions, schedules, crawls, subscriptions tables…

  bin/generate-jwt.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: CLI script bin/generate-jwt.ts; signs a JWT from argv subject and optional audience; imports src/util/jwt.js sign/decode and src/config/index.js; prints token and decoded claims; no expiration; dev-only note.

  bin/generate-keys.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: Key generation bootstrap; exports none; deps node:crypto, src/util. Produces P-256 EC key pair as PEM and prints private/public keys to stdout.

  bin/heroku/check-logs.ts
    git: Ariel Flesler @ 1785169812 — Move heroku scripts to bin/heroku
    summary: Heroku log checker; exports parseLogTimestamp, filterLogsByTime, filterAndDisplay; deps node:child_process, moment, src/controllers/entities, src/controllers/messages, src/util. Fetches Heroku logs via execSync, parses timestamps, filters…

  bin/heroku/config-set.ts
    git: Ariel Flesler @ 1785169834 — Add heroku config management script
    summary: Heroku config sync CLI; exports none; deps node:child_process, node:fs, dotenv, src/util. Reads .env, runs util.run; no-arg lists vars differing between .env and Heroku, one-arg sets VAR on Heroku from .env via heroku config

  bin/heroku/slug-dry-run.ts
    git: Ariel Flesler @ 1785169812 — Move heroku scripts to bin/heroku
    summary: Slug dry-run simulator; exports nothing, runs util.run; imports child_process, fs, ignore, src/util; simulates .slugignore over git-tracked files; reports kept/dropped/src/dist sizes; fails if package.json, package-lock.json, Procfile…

  bin/http/get-reply.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: Dev test script; posts JSON to /message with a Bearer JWT; imports node:http, node:https, src/config, src/util/jwt, src/util; deps none.

  bin/http/post.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: Dev test script for POSTing to /post with JWT auth; no exports, no public API; imports node:http, node:https, src/config/index.js, src/util/jwt.js, src/util/index.js; runs via npm bin with context and text args.

  bin/knowledge.ts
    git: Ariel Flesler @ 1785248947 — Keep track of source URLs and files per group
    summary: CLI uploader for knowledge documents; exports no public API; deps node:fs/promises, node:path, src/controllers/entities, src/controllers/facts, src/integrations/knowledge, src/util/enum, src/util/index; reads URL or file args, uploads to…

  bin/readme.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: README generator; runs util.run to emit README.md; imports node:fs, package.json, src/util/modules, src/commands/help, src/util/index; reads .env.example and LICENSE, lists commands/middlewares, prints examples; writes file or prints with…

  bin/simulate.ts
    git: Ariel Flesler @ 1781719603 — Migrate bin scripts to util.run async arrow entry pattern
    summary: Simulation harness; exports mockAction, wrapForLogging, loadMessage, simulate; deps node:module via createRequire to resolve and cache-mock src modules; simplifies args, logs middleware actions and mocked DB writes.

  bin/tg/is-deleted.ts
    git: Ariel Flesler @ 1781737940 — Fix util module had dual export, switch all to default
    summary: Telegram deletion checker; exports isDeleted(chatId, messageId) which resolves whether a message was deleted, caching the result in the DB via messages.update; deps telegram, messages, util, logger.

========================================================================
FTS SAMPLES
========================================================================

  MATCH 'message':
    [dir] bin — bin: Dev ops folder; log checker, config sync CLI, slug dry-run simulator. HTTP tests
    [dir] bin/http — http: Dev HTTP test scripts; get-reply posts JSON to /message with a Bearer JWT, post 
    [dir] bin/tg — tg: Telegram bot tooling; deletion checker, group-exit script, message-link parser, 
    [dir] src/actions — actions: Actions folder; message deletion, forwarding, reactions, replies, typing, text s
    [dir] src/middlewares — middlewares: Middleware folder; command routing, mention handling, role gating, bot-question 
    [dir] src/routes — routes: src/routes; Telegram message router; message handler, reply/send actions, db, en
    [file] bin/http/get-reply.ts — get-reply.ts: Dev test script; posts JSON to /message with a Bearer JWT; imports node:http, no
    [file] bin/tg/is-deleted.ts — is-deleted.ts: Telegram deletion checker; exports isDeleted(chatId, messageId) which resolves w

  MATCH 'telegram':
    [dir]  — : Atlas folder; devops tooling and Telegram bot source. Ops: log checker, config s
    [dir] bin — bin: Dev ops folder; log checker, config sync CLI, slug dry-run simulator. HTTP tests
    [dir] bin/tg — tg: Telegram bot tooling; deletion checker, group-exit script, message-link parser, 
    [dir] src — src: Telegram bot source; Express server, config loader, type declarations, entry wir
    [dir] src/config — config: Config loader; dotenv parse, typed config object with http, log, db, telegram, o
    [dir] src/integrations — integrations: Integrations folder; web crawler, ExaAI contents client, knowledge uploader, LLM
    [dir] src/routes — routes: src/routes; Telegram message router; message handler, reply/send actions, db, en
    [dir] src/types — types: Types folder; bot module contract, command metadata model, config types, telegra

  MATCH 'middleware':
    [dir] src/middlewares — middlewares: Middleware folder; command routing, mention handling, role gating, bot-question 
    [file] bin/simulate.ts — simulate.ts: Simulation harness; exports mockAction, wrapForLogging, loadMessage, simulate; d
    [file] src/middlewares/commands.ts — commands.ts: Command middleware; exports handler, run, split, parseMention; deps util, comman
    [file] src/middlewares/context.ts — context.ts: Middleware that extends Telegraf's built-in context; exports handler, getMention
    [file] src/middlewares/discovery.ts — discovery.ts: Discovery middleware; exports description, order, handler; deps lodash, entities
    [file] src/middlewares/forwards.ts — forwards.ts: Forwarding middleware; exports handler; deps roles, reply, llm, entities, messag
    [file] src/middlewares/invites.ts — invites.ts: Invite middleware; exports handler, reportAdded; deps say, groups, onboarding, c
    [file] src/middlewares/logs.ts — logs.ts: Logging middleware; exports description, order, handler; deps util, logger, rege

  MATCH 'llm':
    [dir] src/integrations — integrations: Integrations folder; web crawler, ExaAI contents client, knowledge uploader, LLM
    [dir] src/routes — routes: src/routes; Telegram message router; message handler, reply/send actions, db, en
    [dir] src/util — util: Utility helpers; text normalizer, JWT signer, token counter, HTTP error classes,
    [file] src/commands/answer.ts — answer.ts: Answer command handler; exports handler; deps reply, imageUtil, roles, llm, Meta
    [file] src/commands/facts_compress.ts — facts_compress.ts: Facts compress command; exports compress, handler, role, description, MIN_FACTS,
    [file] src/commands/generate.ts — generate.ts: Generate command handler; exports handler; deps reply, erase, imageUtil, reactio
    [file] src/commands/summarize.ts — summarize.ts: Group summarize command; exports role, description, handler, postProcess, getBat
    [file] src/integrations/llm.ts — llm.ts: LLM chat helpers; exports ROLES, ChatMessage, chat; deps zod, openai.

  MATCH 'route':
    [dir] src — src: Telegram bot source; Express server, config loader, type declarations, entry wir
    [file] src/server.ts — server.ts: Express app entrypoint; exports app; deps cors, express, helmet, db, messageRout

========================================================================
COVERAGE GAPS
========================================================================
  indexed files without atlas git row (non-test, show 20): 0
  atlas files without summary (show 20): 0

========================================================================
SUMMARY ARTIFACTS (thinking tags, empty)
========================================================================
  (none)

========================================================================
SUMMARIES OVER 240 CHARS
========================================================================
  (none)

