Open
Conversation
## Summary Implement complete MVP of 3-stage knowledge unit segmentation pipeline as outlined in the plan. Sessions are now transformed into modular, independently-documentable knowledge units. ## Architecture Stage 1 (Segmentation): - LLM analyzes session, identifies distinct knowledge units - Extracts topic, category, relevance score (0-10) - Enriches prompt with operational metadata (tools, files, git ops, errors) - Gracefully degrades to single unit if LLM unavailable Stage 2 (Documentation): - Applies 7 category-specific templates (bug, architecture, code, feature, topic, project, base) - LLM synthesizes focused markdown per unit - Generates YAML frontmatter with metadata - Returns raw content if synthesis unavailable Stage 3 (Deferred to Phase 2): - Entity extraction, freshness detection, metadata enrichment ## Files Created (13) Type System & Core Logic: - src/team/types.ts - KnowledgeUnit, SegmentationResult, DocumentGenerationResult - src/team/segment.ts - Stage 1 segmentation with metadata injection - src/team/document.ts - Stage 2 documentation generation Prompts (8 templates): - src/team/prompts/stage1-segment.md - Segmentation with metadata injection - src/team/prompts/stage2-*.md (7 category-specific templates) Tests & Docs: - test/team-segmented.test.ts - 14 unit tests (all passing) - IMPLEMENTATION.md - Technical documentation - QUICKSTART.md - User guide - IMPLEMENTATION_CHECKLIST.md - Verification checklist - DEMO_RESULTS.md - Live demo results ## Files Modified (3) - src/db.ts - Extended smriti_shares table with unit_id, relevance_score, entities - src/team/share.ts - Added shareSegmentedKnowledge() + routing logic - src/index.ts - Added --segmented and --min-relevance CLI flags ## Key Features ✅ Graceful degradation at each stage ✅ Unit-level deduplication (content_hash + unit_id) ✅ Category validation against taxonomy ✅ Sequential processing (safe, monitorable) ✅ YAML frontmatter with unit metadata ✅ Auto-generated manifest and CLAUDE.md index ✅ Full backward compatibility (legacy pipeline unchanged) ✅ Database schema migration support ## Usage # Basic usage smriti share --project myapp --segmented # With custom relevance threshold smriti share --project myapp --segmented --min-relevance 7 # Share specific category smriti share --category bug --segmented ## Testing ✅ 14 unit tests passing ✅ Code compiles without errors ✅ CLI working and documented ✅ Graceful degradation verified ✅ Backward compatibility confirmed ## Demo Results - Cleared previous knowledge - Successfully shared session e38f63e5 - Graceful degradation working (Ollama unavailable) - Output created in .smriti/knowledge/uncategorized/ - Database migration successful - CLAUDE.md auto-generated for discovery Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add gitleaks pre-commit hook to detect secrets before commits - Configure .gitleaks.toml with allowlist for test tokens in knowledge base - Add GitHub Actions CI pipeline for automated secret scanning - Integrate detect-secrets as additional verification layer - All hooks pass with no false positives after baseline configuration Security improvements: - Prevents accidental credential commits - Scans full git history on each push - Configured to ignore test/demo tokens in documentation Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
3fe0551 to
72bb50f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#14