Skip to content

feat(citation-manager): move session cache from bash hook to TypeScript tool#98

Merged
WesleyMFrederick merged 6 commits intomainfrom
citation-manager/cache-refactor-extract-links
Feb 17, 2026
Merged

feat(citation-manager): move session cache from bash hook to TypeScript tool#98
WesleyMFrederick merged 6 commits intomainfrom
citation-manager/cache-refactor-extract-links

Conversation

@WesleyMFrederick
Copy link
Copy Markdown
Owner

Summary

  • Moves session-based extract caching from extractor.sh bash hook into citation-manager TypeScript tool via new --session <id> flag
  • New checkExtractCache module (src/cache/checkExtractCache.ts) with content-hash-based cache key (sessionId_md5(content))
  • Hook simplified to pass --session to CLI; cache logic fully testable with Vitest
  • Hook now prefers local dist/ build over global CLI, with distinct log messages for cache hit / no-links / error

Test plan

  • 4 unit tests for cache module (miss, hit, invalidation, auto-creation)
  • 4 CLI integration tests (cache miss, cache hit, no-links-no-cache, backward compat)
  • 429/429 tests passing, zero regressions
  • Manual end-to-end verification: cache miss extracts citations, cache hit returns silently

Closes #92

🤖 Generated with Claude Code

WesleyMFrederick and others added 6 commits February 11, 2026 10:43
Remove obsolete systems that are no longer actively maintained:
- Observer and homunculus initialization and hook infrastructure
- Instinct CLI and learning utilities (replaced by Modern Instincts)
- Related evaluation and observation hook scripts
- Deprecated skill definitions

Modernize remaining systems:
- Consolidate hooks.json to remove observer/evaluation hooks
- Update agent definitions with refined scopes and tooling
- Clean up workspace configuration and settings

This reduces technical debt and clarifies the active codebase.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add openspec CLI skills, commands, and schema for spec-driven change management.
Update citation-manager component guides and add SessionCache documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests referenced instinct-cli.js and learning-utils.js which were
removed in 0b529ac but their test files were not cleaned up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… tool

Move session-based caching logic from extractor.sh into citation-manager tool:
- Add cache module with checkExtractCache() and writeExtractCache() functions
- Implement --session flag in extract links CLI action
- Update extractor hook to delegate caching to tool
- Add comprehensive unit and integration tests (all 428 tests passing)

This centralizes cache management in TypeScript where it's easier to test and
maintain, while keeping the bash hook minimal and focused on orchestration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Guard cache write with `process.exitCode !== 1` so failed extractions (no
eligible links) don't write a cache marker. This allows retry on the same
session when links are added. Includes regression test for no-links file
with --session flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… distinct log messages

Resolve citation-manager from local dist/ build before falling back to
global CLI. Capture CLI exit code to distinguish cache hit, no-links,
and error conditions with clear debug log messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@WesleyMFrederick WesleyMFrederick merged commit bb85022 into main Feb 17, 2026
1 check failed
@WesleyMFrederick WesleyMFrederick deleted the citation-manager/cache-refactor-extract-links branch February 17, 2026 17:23
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.

refactor(citation-manager): move session cache from extractor hook into CLI tool

1 participant