Skip to content

feat(fetcher): CLI entry point + observability metrics#157

Merged
williamzujkowski merged 1 commit intomainfrom
feat/fetcher-cli-metrics
Apr 2, 2026
Merged

feat(fetcher): CLI entry point + observability metrics#157
williamzujkowski merged 1 commit intomainfrom
feat/fetcher-cli-metrics

Conversation

@williamzujkowski
Copy link
Copy Markdown
Collaborator

Summary

  • CLI entry point (openlaw-fetch): list, history, download commands for standalone fetcher operation
  • Observability metrics: FetcherMetrics class tracks discovered/downloaded/skipped/errors/durations, integrated into OlrcFetcher
  • 118 tests passing (up from 68)

Changes

File Change
packages/fetcher/src/cli.ts New CLI with list/history/download commands
packages/fetcher/src/metrics.ts New FetcherMetrics class
packages/fetcher/src/__tests__/metrics.test.ts 25 new tests
packages/fetcher/src/fetcher.ts Metrics integration into OlrcFetcher
packages/fetcher/src/index.ts New exports
packages/fetcher/package.json bin field for CLI

Related

Test plan

  • 118/118 tests passing (4 test files)
  • Build clean
  • CLI commands parse correctly

🤖 Generated with Claude Code

)

CLI (packages/fetcher/src/cli.ts):
- `openlaw-fetch list` — list current release point titles
- `openlaw-fetch history` — list all 250+ historical release points
- `openlaw-fetch download --title <N>` — download specific title XML
- `openlaw-fetch download --all` — download all titles
- Minimal arg parsing, human-readable table output

Metrics (packages/fetcher/src/metrics.ts):
- FetcherMetrics class: discovered, downloaded, skipped, errors, durations
- Integrated into OlrcFetcher: auto-tracks all operations
- getSnapshot() for reporting with shallow-copy isolation
- 25 new tests (metrics unit + integration)

Tests: 118 passing across 4 files (up from 68)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@williamzujkowski williamzujkowski merged commit 7c2575e into main Apr 2, 2026
1 check passed
@williamzujkowski williamzujkowski deleted the feat/fetcher-cli-metrics branch April 2, 2026 02:16
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.

feat: Add observability metrics to fetcher package feat: Add fetcher CLI entry point for standalone pipeline runs

1 participant