5 Commits
Author SHA1 Message Date
james.maes ea3cbd2587 fix: retry on 429 / transient 5xx with backoff (#15) (#66)
* docs: add design spec for retry/backoff (#15)

* docs: add implementation plan for retry/backoff (#15)

* feat(providers): add HttpError class for typed retry classification (#15)

* feat(providers): classify retriable errors via isRetriable (#15)

* feat(providers): add parseRetryAfter and backoffDelay helpers (#15)

* feat(providers): add withRetry helper with abort-aware backoff (#15)

* feat(providers): expose response headers on StreamResult (#15)

* feat(providers): add maxRetries and onRetry to CompletionRequest (#15)

* feat(pipeline): add retry variant to ProgressEvent (#15)

* feat(settings): add maxRetries to PennySettings (default 3) (#15)

* feat(providers): apply withRetry to Anthropic complete() (#15)

* feat(providers): apply withRetry to OpenAI complete() (#15)

* feat(providers): apply withRetry to Google complete() (#15)

* feat(providers): apply withRetry to Ollama complete() (#15)

* feat(pipeline): forward maxRetries and surface retry events (#15)

* feat(settings): expose maxRetries in Behavior tab (#15)

* feat(progress-modal): render retry status events (#15)

* chore(ci): ratchet coverage thresholds for retry/backoff (#15)

* fix(tests): keep streaming-errors mock real for HttpError/withRetry exports (#15)

The streaming-errors mock returned only streamRequest/withTimeout, but the
post-#15 providers also import HttpError and withRetry from node-stream.
Spread the actual module via importActual; only override streamRequest and
withTimeout. Pass maxRetries: 0 in each test call so pre-token errors do
not trigger retry sleeps and exceed the test timeout.
2026-04-28 06:57:00 -05:00
james.maesandClaude Opus 4.6 2df6b79b0b feat: {{ }} block scope for multi-paragraph annotations
- Add block scope: wrap target text in {{ }} markers, place annotation
  after }}. Parser finds matching {{ and scopes to everything between.
- Rewrite annotation guide and settings help with clear examples for
  all four scope types (paragraph, block, inline, section)
- Add 6 new parser tests for block scope (393 total)
- Auto-deploy to Obsidian vault on production build

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 06:33:58 -05:00
james.maes 9369bc89cc fix: address all 23 audit findings
CRITICAL: Wire processChapter() pipeline (parse -> context -> draft ->
assemble -> version -> review -> log). Fix HTTP error handling in both
providers (check status, throw on non-2xx). Fix thinking mode (only for
opus/sonnet, not haiku). Add git safety checks (FileSystemAdapter, git
installed, is repo).

HIGH: Add migration checksum verification. Extract globMatch to utils.ts.
Fix regex state management (local instances). Fix requireProvider to
check all routes. Fix annotation guide claims.

MEDIUM: Quote YAML-unsafe strings. Handle CRLF in frontmatter. Filter
non-objects in readState. Fix save hook debounce. Remove countAnnotations
duplicate.

LOW: Remove unused registry singleton. Fix deprecated getLeaf API.
Update manifest description. Fix README links and screenshot. Fix prompt
duplication (task details only in user prompt).

New: pipeline.ts (pure logic), utils.ts, integration.test.ts,
utils.test.ts. 287 tests passing across 14 test files.
2026-04-16 12:10:50 -05:00
james.maes 9ca2192ed0 feat: LLM provider abstraction - service interface + model router
Add provider layer (src/providers/) with LLMService interface,
complexity-based model router (light/standard/heavy tiers),
provider registry, Anthropic and Ollama implementations.

Update settings UI with provider config and model routing.
Update drafter, context, commands for multi-provider support.
Migrate settings from old apiKey/model to new per-provider format.
81 new provider tests (244 total, all passing).
2026-04-16 11:40:24 -05:00
james.maes f3aff06227 feat: initial PENNY implementation - full Obsidian plugin
Complete implementation of PENNY (Prose Engine for Narrative, Notes,
and Yarns) as an Obsidian community plugin.

Core modules: annotation parser, version assembler, chapter versioner,
frontmatter manager, voice compliance checker, context assembler,
prompt drafter, chapter migrator.

Plugin shell: main plugin class, settings tab with 5 collapsible
sections, 11 command palette commands, project init wizard, status
bar widget, review note generator, activity logger.

Documentation: README, 9 user guides (getting started, annotations,
configuration, project structure, versioning, voice enforcement, git
workflow, troubleshooting, API costs), test fixtures.

Testing: 170 unit tests across 8 test files, all passing.
Build: esbuild production bundle (30KB main.js).
CI: GitHub Actions release workflow.
2026-04-16 09:20:18 -05:00