Skip to content

HostSpark v0.4

Choose a tag to compare

@gemini960114 gemini960114 released this 03 Sep 08:44
· 27 commits to main since this release

HostSpark v0.4

A structural refactor: the codebase moves from 12 flat root-level modules
(bot.py alone was over 2,000 lines) into a proper src/hostspark/ package,
plus new security tooling and CI fixes. No user-facing bot behavior
changes -- all 107 existing tests pass unchanged in intent, and every
Telegram command from v0.3 is preserved.

Highlights:

  • Full package restructure into src/hostspark/: config, state, core
    (executor/prompt/sanitizer/cli_args/pty/streaming), storage (chat_state/
    conversation_db/schedule_store), telegram (app/formatters/media/auth/
    dispatcher/handlers), and runtime (job_queue/instance_lock/
    pending_actions/scheduler)
  • Standard packaging via pyproject.toml: pip install -e . gives both a
    hostspark console script and python -m hostspark; install.sh and the
    generated systemd unit now launch the package instead of a flat script
  • bot.py kept as a thin backward-compatible launcher (sys.path bootstrap
    into src/, delegates to hostspark.cli.main) for anyone still invoking it
    directly
  • Centralized runtime state (CONFIG/SCHEDULE_STORE/CHAT_STATE_STORE/...)
    into hostspark.state as the single source of truth, and migrated the
    test suite to patch it directly instead of monkey-patching module
    globals on the old flat bot.py
  • New security-scan.sh: pip-audit, bandit, semgrep, and gitleaks in a
    self-contained tool venv, writing timestamped reports to
    security-reports/ (gitignored)
  • security-scan.sh now also installs a gitleaks pre-commit hook that
    blocks any commit whose staged changes contain a secret, instead of
    relying solely on a later manual scan
  • Fixed CI (.github/workflows/ci.yml), which still referenced the
    pre-refactor flat file layout and never installed the package itself;
    also pinned actions/checkout and actions/setup-python to commit SHAs
    instead of mutable version tags
  • Repo hygiene: removed an unrelated local AI-skill directory (.agents/)
    that had been accidentally committed, and cross-linked README's Quick
    Install section with INSTALL_BY_AI.md for AI-agent-assisted installs

Upgrade notes:

  • Existing systemd deployments should re-run ./install.sh to pick up
    the new package install step and regenerated ExecStart
    (python -m hostspark)
  • No .env changes required