Skip to content

Topic routing, dedup, attachments, sweep + pytest test framework#1

Merged
RonShih merged 2 commits into
mainfrom
feature/topic-routing-and-test-framework
Jun 30, 2026
Merged

Topic routing, dedup, attachments, sweep + pytest test framework#1
RonShih merged 2 commits into
mainfrom
feature/topic-routing-and-test-framework

Conversation

@RonShih

@RonShih RonShih commented Jun 30, 2026

Copy link
Copy Markdown
Owner

What

Builds out agent-notes and adds a proper test framework.

Product

  • Topic routing: inline #tag routes each job to a per-topic NotebookLM notebook + Notion DB (topics.json registry; db ids cached under .state/).
  • Dedup: per-topic processed index keyed on normalized URL / file content hash; #force to re-do; recorded only on full success (failures stay retriable).
  • Attachments (UC2): accept Telegram PDF/DOCX/TXT/MD uploads.
  • Sweep (UC3): #topic 整理現有 exports every not-yet-done source already in a topic's notebook.
  • Clearer auth errors: the SDK's cryptic "returned an error result: success" (CLI not logged in) is mapped to an actionable claude auth login message.

Testing / tooling

  • Converted ad-hoc scripts to pytest with shared fixtures (tests/conftest.py): cfg/registry/index/good_report, a configurable fake-agents harness, and a no-network poll() driver.
  • 151 tests, all offline (no NotebookLM/Notion/Telegram, no real .state/ writes).
  • Added ruff + pytest-cov config, a GitHub Actions CI workflow (ruff + pytest on push/PR), and a fresh-context test-runner subagent.

Verify

pip install -e ".[dev]"
pytest            # 151 passed
ruff check src tests

Notes

  • Secrets stay out: .env and .state/ are gitignored.
  • Coverage 83% overall; core logic modules 89–100% (the low ones — agent.py network boundary, notebooklm_cli.py subprocess boundary — can't be unit-tested offline).

🤖 Generated with Claude Code

RonShih and others added 2 commits July 1, 2026 02:17
… errors

Route each job to a per-topic NotebookLM notebook + Notion DB via an inline
#tag (topics.json registry; db ids cached in .state). Add duplicate prevention
(per-topic processed index keyed on normalized URL / file content hash, #force
to override; record only on full success). Accept Telegram file attachments
(PDF/DOCX/TXT/MD). Add "整理現有" sweep that exports every not-yet-done source
already in a topic's notebook. Map the SDK's cryptic "returned an error result:
success" (CLI not logged in) into an actionable re-login message.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nner agent

Convert the ad-hoc test scripts to pytest with shared fixtures in conftest.py
(cfg/registry/index/good_report, a configurable fake-agents harness, and a
no-network poll() driver). Cover config, contract, evaluators, topics, dedup,
gate logic, attachments, sweep, telegram routing, main dispatch, and the agent
SDK wrapper (incl. the auth-error mapping). Add pytest/ruff/coverage config to
pyproject, a GitHub Actions CI workflow (ruff + pytest on push/PR), and a
fresh-context "test-runner" subagent that runs the suite and reports PASS/FAIL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RonShih
RonShih merged commit 40e618f into main Jun 30, 2026
2 checks passed
@RonShih
RonShih deleted the feature/topic-routing-and-test-framework branch June 30, 2026 18:27
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