Skip to content

Conversation

@julwrites
Copy link
Owner

No description provided.

google-labs-jules bot and others added 9 commits December 13, 2025 13:38
Streamlined test execution by:
- Mocking `GetPassageHTML` in `pkg/app/passage_test.go` and `pkg/app/devo_test.go` to prevent external network calls to BibleGateway during unit tests.
- Updating `pkg/app/api_client_test.go` to conditionally run integration tests against the real Bible AI API only if `BIBLE_API_URL` is explicitly set and not equal to "https://example.com". Otherwise, it defaults to a safe mock environment.
- Adding a `Fallback: Scrape` test case in `passage_test.go` to verify the fallback logic without triggering actual network requests.

These changes ensure that standard "MR tests" are fast and isolated, while still allowing a "comprehensive eval" against the real API via environment configuration.
- Created `docs/TESTING.md` to outline the hybrid testing strategy (standard mocks vs. conditional live integration).
- Refactored `pkg/app/passage_test.go` and `pkg/app/devo_test.go` to mock `GetPassageHTML`, preventing external scraping during unit tests.
- Updated `pkg/app/api_client_test.go` to support conditional live API testing when `BIBLE_API_URL` is configured.
- Cleaned up test logic to ensure proper isolation of global variable mocks.
- Updated `scripts/tasks.py`, `scripts/memory.py`, and `scripts/bootstrap.py` to match `julwrites/agent-harness`.
- Updated `templates/GUIDE.md` and `templates/maintenance_mode.md`.
- Updated `docs/tasks/GUIDE.md` and `.cursorrules`.
- Verified `AGENTS.md` integrity and tool definitions.
- Ensured `CLAUDE.md` is aligned via bootstrap script.
- Updated `scripts/tasks.py`, `scripts/memory.py`, `scripts/bootstrap.py`
- Updated `scripts/tasks` wrapper
- Updated `AGENTS.md` and `CLAUDE.md`
- Updated `templates/task.md` and `templates/maintenance_mode.md`
- Removed invalid templates (`epic.md`, `sprint.md`)
- Preserved project-specific instructions in `AGENTS.md`
Updated `ScriptureBot` to perform server-side HTML preprocessing for Telegram messages.
- Replaced `FilterTree` logic in `pkg/app/passage.go` with a recursive `ParseNodesForPassage` function that walks the entire HTML tree.
- Implemented robust HTML tag conversion:
  - `<h1>`-`<h6>` -> `<b>` (bold with newlines)
  - `<ul>`/`<li>` -> Bullet points (`•`)
  - `div` -> Recurse children (stripping tag)
  - `b`/`strong` -> `<b>`
  - `i`/`em` -> `<i>`
  - `sup` -> Unicode superscripts (via `platform.TelegramSuperscript`)
- Added explicit HTML escaping for all text content to prevent injection or broken tags.
- Configured `env.Res.ParseMode = "HTML"` for `GetBiblePassage` responses.
- Updated unit tests in `pkg/app/passage_test.go` to verify new HTML output formats and correct handling of lists, headers, and superscripts.
…38505798009705932

Refactor passage HTML parsing for Telegram compatibility
@julwrites julwrites merged commit 1d1a359 into master Jan 5, 2026
1 check passed
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.

2 participants