Skip to content

[US-72] feat: separate KB dataset release with auto-download#83

Merged
rucka merged 16 commits into
mainfrom
feature/#72-kb-dataset-release
Nov 23, 2025
Merged

[US-72] feat: separate KB dataset release with auto-download#83
rucka merged 16 commits into
mainfrom
feature/#72-kb-dataset-release

Conversation

@rucka

@rucka rucka commented Nov 23, 2025

Copy link
Copy Markdown
Collaborator

Summary

What Changed

Implemented separate KB dataset release as GitHub release artifact alongside CLI binaries. KB dataset excluded from CLI bundle and auto-downloaded on first run to ~/.pair/kb/{version}/ cache.

Why This Change

Enables independent versioning of KB content while maintaining single release workflow. Reduces CLI bundle size from 6M to ~300KB (-95%). Satisfies Epic #65 AC3 requirement for KB separation.

Story Context

User Story: As a knowledge-hub maintainer, I want KB dataset as separate GitHub release artifact alongside CLI, so that KB content is versioned independently while keeping single release workflow.

Acceptance Criteria: All 8/8 acceptance criteria satisfied - single release with dual artifacts, complete dataset preservation, manifest metadata, atomic workflow, CLI bundle exclusion, auto-download with cache.

Changes Made

Implementation Details

  • KB Packaging Script: scripts/workflows/release/package-kb-dataset.sh creates ZIP from knowledge-hub/dataset/ with manifest.json and SHA256 checksum
  • Manifest Generation: Recursive file scanning with per-file checksums, version and timestamp metadata
  • Release Workflow Integration: KB packaging step added after CLI build, atomic failure on errors
  • GitHub Release Enhancement: create-github-release.sh uploads KB ZIP + checksum alongside CLI binaries
  • Dataset Size Validation: 50MB threshold check with warnings before packaging
  • CLI Bundle Modification: KB dataset excluded from package-manual.sh bundle
  • KB Manager Implementation: Auto-download from GitHub releases with cache at ~/.pair/kb/{version}/
  • Path Resolution Update: Fallback chain: cache → local → download

Files Changed

Modified:

  • scripts/workflows/release/package-kb-dataset.sh (new - KB packaging + manifest + checksum)
  • .github/workflows/release.yml (KB packaging workflow step)
  • scripts/workflows/release/create-github-release.sh (dual artifact upload)
  • scripts/workflows/release/package-manual.sh (KB dataset exclusion)
  • scripts/workflows/release/README.md (comprehensive KB documentation)
  • apps/pair-cli/src/kb-manager.ts (new - auto-download + cache manager, 197 lines)
  • apps/pair-cli/src/config-utils.ts (KB fallback path resolution)
  • apps/pair-cli/src/cli.ts (KB availability check on startup)
  • apps/pair-cli/src/cli.e2e.test.ts (2 KB availability e2e tests)
  • apps/pair-cli/package.json (adm-zip, @types/adm-zip, @types/fs-extra dependencies)

Added:

  • apps/pair-cli/src/kb-manager.test.ts (17 unit tests - cache, download, errors)
  • apps/pair-cli/test-utils/http-mocks.ts (HTTP mock helpers)
  • apps/pair-cli/test-utils/test-setup.ts (test setup utilities)

Database Changes

  • Schema Changes: N/A
  • Migration Scripts: N/A
  • Data Changes: N/A
  • Performance Impact: N/A

API Changes

  • New Endpoints: N/A
  • Modified Endpoints: GitHub release upload (dual artifacts)
  • Breaking Changes: None - backward compatible
  • Documentation: Release workflow README updated

Testing

Test Coverage

  • Unit Tests: 17 KB manager tests (cache, download, extraction, errors) - 100% passing
  • Integration Tests: KB manager + config-utils + CLI startup integration - 100% passing
  • End-to-End Tests: 2 KB availability scenarios (unavailability, fallback path) - 100% passing
  • Manual Testing: KB packaging script, manifest generation, checksum validation

Test Results

Test Suite: ✅ Passing
Total Tests: 134/134 (100%)
Coverage: KB manager 100%, config-utils KB paths 100%
Linting: ✅ 0 errors
TypeScript: ✅ Clean

Testing Strategy

  • Happy Path: KB packaging → ZIP creation → manifest generation → checksum → release upload → CLI auto-download → cache reuse
  • Edge Cases: Large dataset warnings, missing files, packaging failures, network errors (404, 403, timeouts)
  • Error Handling: Atomic workflow failures, download errors with clear messages, graceful fallbacks
  • Performance: KB packaging <30s for 431 files (5.7M → 1.7M ZIP)

Quality Assurance

Code Quality Checklist

  • Code follows established style guides and conventions
  • Functions and classes have appropriate documentation
  • Error handling implemented for edge cases (network, filesystem, packaging)
  • Security best practices followed (SHA256 checksums, secure downloads)
  • Performance considerations addressed (size validation, compression, caching)
  • No debugging code or console logs left behind

Review Areas

  • Business Logic: Single release with dual artifacts, version coordination via changeset
  • Code Structure: KB manager with dependency injection, clear separation of concerns
  • Error Handling: Atomic workflow failures, clear error messages for users
  • Performance: Dataset size validation, efficient caching strategy
  • Security: SHA256 checksums for integrity, secure download protocol
  • Testing: Comprehensive unit/integration/e2e coverage (134/134 tests)

Deployment Information

Environment Impact

  • Development: Ready - KB manager fallback to local dataset works
  • Staging: Ready - workflow integration tested
  • Production: Ready - all tests passing, documentation complete
  • Configuration: No environment-specific config needed

Deployment Notes

  • Database Migration: None required
  • Configuration Changes: None required
  • Feature Flags: None required
  • Dependencies: Added adm-zip (^0.5.16), @types/adm-zip (^0.5.5), @types/fs-extra (^11.0.4)

Rollback Plan

  1. Revert commits 21ca86e137847d (10 commits)
  2. KB dataset restored to CLI bundle via package-manual.sh
  3. Release workflow reverted to single-artifact mode
  4. Users continue with bundled KB (backward compatible)

Breaking Changes

API Breaking Changes

  • Endpoint Changes: None
  • Request/Response Format: None
  • Authentication: None

Integration Breaking Changes

  • Third-party Services: None - GitHub release API used consistently
  • Internal Services: None - backward compatible path resolution
  • Client Applications: None - transparent KB download for users

Migration Guide

No migration required - changes are backward compatible. CLI automatically downloads KB on first run if not cached.

Documentation

Documentation Updates

  • README: Release workflow documentation enhanced with KB sections
  • API Documentation: N/A
  • User Documentation: N/A (CLI behavior transparent to users)
  • Technical Documentation: Comprehensive KB Manager & Auto-Download Behavior section added

Documentation Highlights

  • KB Manager & Auto-Download Behavior (first run, subsequent runs, error handling, dev mode)
  • Overall Release Process Overview (workflow sequence, artifact lifecycle, version coordination)
  • Troubleshooting section for KB-specific issues
  • KB packaging script usage and parameters

Related Issues

Tasks Completed

  • T-72.1: Create KB packaging bash script (3h)
  • T-72.2: Implement manifest.json generation logic (4h)
  • T-72.3: Generate SHA256 checksum file for KB ZIP (1h)
  • T-72.4: Integrate KB packaging into release workflow (2h)
  • T-72.5: Enhance GitHub release upload for dual artifacts (2h)
  • T-72.6: Add dataset size validation with warnings (1h)
  • T-72.7: Create tests and update documentation (3h)
  • T-72.8: Remove KB from CLI bundle + implement minimal auto-download (4h)

Story Status: 8/8 tasks complete (100%) ✅

rucka added 12 commits November 9, 2025 15:40
- create zip from knowledge-hub/dataset preserving structure
- generate manifest.json w/ version, file list, sha256 per file, timestamp
- generate .sha256 checksum file for zip integrity
- dataset size validation w/ 50mb threshold warning
- --clean flag to remove previous artifacts (follows package-manual.sh pattern)
- tested: 431 files, 5.7m → 1.7m zip w/ valid manifest & checksum
- add package-kb-dataset.sh documentation (usage, params, outputs)
- complete workflow sequence diagram (7 steps w/ dual artifacts)
- artifact lifecycle explanation (cli + kb coordination)
- version coordination via changeset (single version both artifacts)
- atomic workflow behavior (fail all if any step fails)
- integration points between scripts
- troubleshooting section for kb packaging failures
- update execution sequence (added step 4: kb packaging)
- update test commands (added kb packaging tests)
- clean-only mode: remove kb artifacts, then rmdir release/ if empty
- clean w/ version: remove kb artifacts, rmdir release/ if empty (recreated by mkdir)
- consistent w/ package-manual.sh: release/ removed when no other artifacts
- tested: empty dir removed, non-empty dir kept
- add missing tools to all chatmodes: createFile, createDirectory, todos, runSubagent, runTests, fetch, githubRepo
- standardize tools order: edit tools first, then search, runCommands, github, others, vscode/problems/changes
- apply same config to both repo root & kb dataset chatmodes
- format README.md troubleshooting section (prettier)
- Added KB packaging step after CLI manual packaging
- Upload KB dataset as separate workflow artifact
- Enhanced GitHub release notes with dual artifact structure
- Updated create-github-release.sh to upload KB ZIP & checksum

Integration complete: KB dataset released alongside CLI artifacts
- impl KB cache manager (getCachedKBPath, isKBCached, ensureKBAvailable)
- auto-download KB from GitHub releases if not cached
- use adm-zip for extraction, fs-extra for filesystem ops
- dependency injection for testing (fs, extract)
- 17 unit tests: cache ops, download flow, error handling, console output
- HTTP mock helpers for testing (createMockResponse, createMockRequest)
- InMemoryFileSystemService pattern (no filesystem mocks)
- all tests pass, 0 lint errors, no eslint-disable/ts-ignore
- Add getKnowledgeHubDatasetPathWithFallback to config-utils
- Fallback to KB download when local dataset unavailable
- Call ensureKBAvailable on CLI startup
- Add tests for KB manager integration
- 132 tests passing, 0 lint errors
- Comment out dataset copy in package-manual.sh
- KB manager downloads dataset to ~/.pair/kb/{version} on first run
- Reduces bundle size significantly
- 2 e2e tests for KB fallback scenarios
- docs: KB Manager & Auto-Download behavior
- T-72.7 complete: 134/134 tests passing
@rucka rucka linked an issue Nov 23, 2025 that may be closed by this pull request
40 tasks
@rucka rucka mentioned this pull request Nov 23, 2025
40 tasks
@rucka

rucka commented Nov 23, 2025

Copy link
Copy Markdown
Collaborator Author

Code Review Report: PR #83

PR: #83 - [US-72] feat: separate KB dataset release with auto-download
Story: US-72 - Separate KB Dataset Release
Epic: #65 Enhanced CLI Packaging & Distribution
Reviewer: Staff Engineer Agent
Review Date: 2025-11-23


Summary

Overall Assessment: ✅ APPROVED WITH MINOR RECOMMENDATIONS

This PR successfully implements dual-artifact release packaging (CLI + KB dataset) with automatic KB download capability. The implementation satisfies all 8 acceptance criteria from US-72, includes comprehensive test coverage (134/134 passing), and achieves the key epic goal of reducing CLI bundle size from 6MB to ~300KB (-95%).

Key Achievements:

  • KB dataset packaged as separate GitHub release artifact with manifest
  • KB auto-download on first CLI run with cache at ~/.pair/kb/{version}/
  • CLI bundle excludes KB dataset (Epic Simple KB Distribution & Installation #65 AC3 satisfied)
  • 17 comprehensive unit tests for KB manager (100% coverage)
  • Atomic release workflow (both artifacts or complete failure)
  • Comprehensive documentation updates

Risks: Low - implementation follows established patterns, comprehensive testing, clear rollback path


Phase 1: Technical Standards Validation

ADR & Adoption Compliance

New Technical Decisions:

  1. adm-zip library adoption

    • Decision: Use adm-zip v0.5.16 for ZIP extraction in KB manager
    • Rationale: Simple API, cross-platform, no native dependencies
    • Status: Added to package.json, properly typed with @types/adm-zip
    • ADR Required: No - standard ZIP library, minimal architectural impact
    • Recommendation: Document in tech-stack.md under "Bundling & packaging"
  2. fs-extra library adoption

    • Decision: Use fs-extra v11.2.0 for filesystem operations
    • Status: Already adopted in tech-stack.md
    • Compliance: ✅ Matches adopted version
  3. KB Cache Location

    • Decision: ~/.pair/kb/{version}/ for version-isolated caching
    • Rationale: User home directory, version isolation, no permission issues
    • Architecture Compliance: ✅ Aligns with "self-hosted, desktop usage" requirement
    • Recommendation: Document cache strategy in architecture.md

Tech Stack Compliance:

  • ✅ TypeScript v5.x for KB manager implementation
  • ✅ Bash v5.x for packaging scripts
  • ✅ vitest v3.2.4 for testing (17 KB manager tests)
  • ✅ pnpm workspace structure maintained
  • ✅ turbo build integration preserved

Security Considerations:

  • ✅ SHA256 checksums for ZIP integrity
  • ✅ HTTPS downloads from github.com
  • ✅ Clear error messages for download failures
  • ⚠️ Minor: No checksum validation in kb-manager.ts download flow

Architecture Guidelines Compliance

Architecture Principle: "Small team, rapid development, self-hosted desktop usage"

Compliant:

  • KB cache in user home directory (self-hosted)
  • Simple download mechanism (rapid development)
  • No external services beyond GitHub releases (self-hosted)
  • Clear error handling for network failures

Desktop Usage Pattern:

  • Version-isolated cache allows multiple CLI versions
  • Cache reuse across projects reduces download overhead
  • Simple extraction with adm-zip (cross-platform)

Phase 2: Story & Requirements Validation

Acceptance Criteria Coverage

AC Requirement Status Evidence
AC1 Single release v1.2.3 contains CLI + KB ZIP .github/workflows/release.yml uploads both artifact types
AC2 KB ZIP preserves complete directory structure package-kb-dataset.sh uses relative paths with ZIP
AC3 manifest.json in ZIP root with metadata Script generates JSON with version, files, checksums, timestamp
AC4 Manifest includes version, file list, checksums Lines 95-116 in package-kb-dataset.sh
AC5 GitHub release shows CLI + KB artifacts create-github-release.sh lines 184-186 upload KB assets
AC6 CLI auto-downloads KB if not cached ensureKBAvailable in kb-manager.ts
AC7 CLI reuses cached KB without re-download isKBCached check in ensureKBAvailable
AC8 CLI bundle excludes KB dataset package-manual.sh lines 201-208 commented out

Edge Cases Addressed:

  • ✅ KB packaging failure (atomic workflow with bash set -e)
  • ✅ Large dataset size (validation with 50MB threshold warning)
  • ✅ Missing dataset files (existsSync validation before packaging)
  • ✅ Checksum generation failure (script exits on error)
  • ✅ Manifest generation error (temp file cleanup on failure)
  • ✅ KB download failure (clear error with GitHub URL)
  • ✅ Network unavailable (graceful error with actionable message)

Task Breakdown Validation

8/8 Tasks Complete:

  • ✅ T-72.1: KB packaging script (package-kb-dataset.sh - 145 lines)
  • ✅ T-72.2: Manifest generation (integrated in T-72.1)
  • ✅ T-72.3: SHA256 checksum file (integrated in T-72.1)
  • ✅ T-72.4: Release workflow integration (.github/workflows/release.yml)
  • ✅ T-72.5: Dual artifact upload (create-github-release.sh)
  • ✅ T-72.6: Dataset size validation (package-kb-dataset.sh lines 84-88)
  • ✅ T-72.7: Tests + documentation (2 e2e tests, comprehensive README)
  • ✅ T-72.8: Remove KB from bundle + auto-download (kb-manager.ts - 197 lines)

Phase 3: Code Quality Assessment

Functionality Review

KB Packaging Script (scripts/workflows/release/package-kb-dataset.sh):

  • ✅ Clear parameter handling (--clean flag pattern)
  • ✅ Robust error handling (bash set -euo pipefail)
  • ✅ Comprehensive manifest generation (recursive file scan)
  • ✅ Size validation with threshold warnings
  • ✅ Clean-only mode for artifact cleanup
  • ✅ Manifest generation uses find ... -print0 | sort -z - good practice

KB Manager (apps/pair-cli/src/kb-manager.ts):

  • ✅ Clear separation of concerns (cache, download, extract)
  • ✅ Dependency injection for testability (KBManagerDeps)
  • ✅ Comprehensive error handling (404, 403, network failures)
  • ✅ HTTP redirect support (301, 302)
  • ✅ Version normalization (strips leading 'v')
  • ⚠️ Minor: No checksum validation in download flow (defer to CLI Default KB Installation #78)

Path Resolution (apps/pair-cli/src/config-utils.ts):

  • ✅ Clear fallback chain (local → cache → download)
  • ✅ DIAG logging for troubleshooting
  • ✅ Dependency injection for testing
  • ✅ Proper error propagation

CLI Integration (apps/pair-cli/src/cli.ts):

  • ✅ Async startup check (ensureKBAvailableOnStartup)
  • ✅ Clear error messages on KB unavailable
  • ✅ Exit code 1 on failure
  • ✅ Local dataset fallback for dev mode

Test Coverage

Unit Tests: 17/17 KB Manager Tests Passing ✅

  • Cache operations (getCachedKBPath, isKBCached)
  • Download flow (URL construction, HTTP mocking)
  • Error handling (404, 403, network failures, extraction errors)
  • Version handling (leading 'v' normalization)
  • ZIP cleanup on failure
  • Success/failure messaging

Integration Tests: 21/21 Config Utils Tests Passing ✅

  • KB fallback path logic
  • Local dataset prioritization
  • Cache hit/miss scenarios

E2E Tests: 2/2 CLI Tests Passing ✅

  • KB unavailability graceful failure
  • KB manager fallback path exercise

Test Quality:

  • ✅ Comprehensive HTTP mocking (test-utils/http-mocks.ts)
  • ✅ Dependency injection pattern enables full coverage
  • ✅ Clear test descriptions and scenarios
  • ✅ Edge case coverage (network failures, extraction errors)

Total Coverage: 134/134 tests passing (100%) ✅

Security Review

Input Validation:

  • ✅ Version parameter validated (non-empty check)
  • ✅ Dataset path validation (existsSync before packaging)
  • ✅ URL construction uses known pattern (no user input)

Data Protection:

  • ✅ KB cache in user home directory (~/.pair/kb/)
  • ✅ File permissions preserved in ZIP
  • ✅ No sensitive data in manifest.json

Download Security:

  • ✅ HTTPS downloads from github.com
  • ✅ SHA256 checksums generated for integrity
  • ⚠️ Enhancement: Checksum validation not implemented in kb-manager.ts

Error Handling:

  • ✅ Network errors clearly logged
  • ✅ No sensitive information in error messages
  • ✅ Graceful degradation on failures

Performance Assessment

KB Packaging Performance:

  • ✅ Dataset size: 5.7M → 1.7M ZIP (70% compression)
  • ✅ 431 files packaged successfully
  • ✅ Manifest generation efficient (file scanning <10s estimate)

KB Download Performance:

  • ✅ Simple https.get implementation (no streaming complexity)
  • ✅ Cache reuse eliminates re-download overhead
  • ⚠️ Enhancement: No progress indication (defer to CLI Default KB Installation #78)

CLI Bundle Size:

  • Major Win: 6MB → ~300KB (-95% reduction)
  • ✅ Significantly improves install time
  • ✅ Reduces npm package size

Documentation Quality

Scripts Documentation (scripts/workflows/release/README.md):

  • ✅ Comprehensive KB packaging section added
  • ✅ Complete workflow sequence documented
  • ✅ KB Manager & Auto-Download Behavior section (excellent)
  • ✅ Troubleshooting guidance for KB-specific issues
  • ✅ Clear examples and usage patterns

Code Comments:

  • ✅ kb-manager.ts functions well-documented
  • ✅ Complex logic explained (redirect handling, checksums)
  • ✅ Error messages actionable and clear

Agent/Prompt Updates:

  • ✅ All agents renamed (chatmode → agent)
  • ✅ Tool lists updated consistently
  • ✅ Frontmatter updated (mode:agent:)

Recommendations

High Priority

None - implementation meets all requirements

Medium Priority

  1. Add ADR or tech-stack.md entry for adm-zip

    • Reason: Document ZIP library choice for future reference
    • Impact: Documentation completeness
    • Effort: 15 minutes
  2. Document KB cache strategy in architecture.md

    • Reason: Cache location and versioning strategy is architectural decision
    • Impact: Future maintainability
    • Effort: 30 minutes

Low Priority

  1. Consider checksum validation in kb-manager.ts download

    • Reason: Extra integrity verification layer
    • Impact: Security hardening
    • Effort: Can defer to CLI Default KB Installation #78 enhancement story
    • Note: HTTPS already provides transport security
  2. Add DIAG logging to kb-manager.ts

    • Reason: Consistency with rest of CLI codebase
    • Impact: Troubleshooting capability
    • Effort: 30 minutes

Decision

Status: ✅ APPROVED

Rationale:

  • All 8 acceptance criteria satisfied with evidence
  • Comprehensive test coverage (134/134 passing, 100%)
  • Epic Simple KB Distribution & Installation #65 AC3 satisfied (CLI bundle excludes KB)
  • No blocking issues identified
  • Recommendations are enhancements, not blockers
  • Clean implementation following established patterns
  • Excellent documentation coverage

Next Steps:

  1. Merge PR [US-72] feat: separate KB dataset release with auto-download #83 to main
  2. Tag release to trigger dual-artifact workflow
  3. Verify GitHub release contains both CLI + KB artifacts
  4. Consider medium-priority recommendations for follow-up
  5. Epic CLI Default KB Installation #78 adds enhancement features (progress bar, flags)

Review Checklist

  • All acceptance criteria validated
  • Technical standards compliance verified
  • Architecture guidelines followed
  • Code quality assessed (functionality, structure, clarity)
  • Test coverage comprehensive (134/134 passing)
  • Security review completed (no major concerns)
  • Performance acceptable (bundle size -95%)
  • Documentation comprehensive and accurate
  • Edge cases handled appropriately
  • Error handling robust and actionable

Reviewed By: Staff Engineer Agent
Review Completed: 2025-11-23

- Add adm-zip@0.5.16 to catalog
- Add @types/adm-zip@0.5.7 to catalog
- Add @types/fs-extra@11.0.4 to catalog
- Update pair-cli to use catalog refs for all deps
- Follow project practice of centralized version management
@rucka rucka mentioned this pull request Nov 23, 2025
42 tasks
- Document adm-zip adoption in tech-stack.md
- Document KB cache strategy in architecture.md
- Add DIAG logging to kb-manager.ts for troubleshooting
- Update US-78 with checksum validation requirement (AC7)
- Document adm-zip adoption in tech-stack.md
- Document KB cache strategy in architecture.md
- Add DIAG logging to kb-manager.ts for troubleshooting
- Update US-78 with checksum validation requirement (AC7)
- Extract helper functions to reduce cyclomatic complexity
@rucka

rucka commented Nov 23, 2025

Copy link
Copy Markdown
Collaborator Author

✅ Code Review Action Items - Resolved

All recommendations from the code review have been addressed:

1. ✅ Catalog Compliance (Medium Priority) - RESOLVED

Issue: adm-zip dependencies using hardcoded versions instead of pnpm catalog pattern.

Resolution (commit 41d7b72):

  • Added adm-zip: 0.5.16 to pnpm-workspace.yaml catalog
  • Added @types/adm-zip: 0.5.7 to catalog
  • Added @types/fs-extra: 11.0.4 to catalog (needed for TypeScript compilation)
  • Updated apps/pair-cli/package.json to use "catalog:" references
  • All dependencies now follow project's centralized version management pattern

2. ✅ Tech Stack Documentation (Low Priority) - RESOLVED

Issue: adm-zip not documented in adopted tech stack.

Resolution (commit 41d7b72):

  • Added entry in .pair/adoption/tech/tech-stack.md under "Bundling & packaging":

    adm-zip v0.5.16 is adopted for ZIP archive extraction in Node.js runtime (CLI KB installation).

3. ✅ Architecture Documentation (Low Priority) - RESOLVED

Issue: KB cache strategy not documented in architecture decisions.

Resolution (commit 41d7b72):

  • Added "Knowledge Base Distribution" section to .pair/adoption/tech/architecture.md:
    • KB dataset distributed separately as GitHub release artifact
    • CLI auto-downloads on first run from GitHub releases or custom URL
    • Cache location: ~/.pair/kb/{version}/ (version-specific isolation)
    • Fallback chain: cache hit → default GitHub release → custom URL
    • Version coordination: CLI version maps to KB version

4. ✅ Checksum Validation Tracking (Medium Priority) - POSTPONED TO US-78

Issue: Checksum validation missing from kb-manager.ts (identified as enhancement, not blocking).

Resolution:

  • Updated story US-78 (CLI Default KB Installation) to include checksum validation as AC7
  • Story re-scoped from 0.5 to 1 story point to account for added security enhancement
  • New AC: Download .sha256 file, validate KB ZIP integrity, handle mismatch with retry
  • Risk assessment: Low (HTTPS provides transport security, checksum adds defense-in-depth)
  • Will be implemented in next sprint as part of UX enhancements

5. ✅ DIAG Logging (Low Priority) - RESOLVED

Issue: No diagnostic logging in kb-manager.ts for troubleshooting.

Resolution (commit 41d7b72):

  • Added DIAG flag support (follows cli.ts pattern: PAIR_DIAG=1)
  • Logging added for:
    • Cache checks (Checking KB cache at..., Cache hit/miss)
    • Download initiation (KB cache miss, downloading v{version})
    • Download URL and temp ZIP path
    • Extraction progress (Starting KB download..., Download complete, extracting...)
    • Success/failure outcomes (KB installation successful/failed)
  • Extracted helper functions (logDiag, buildDownloadUrl, downloadAndInstallKB) to maintain cyclomatic complexity ≤10

Summary:

  • 4/5 items resolved in this PR (catalog compliance, documentation, DIAG logging)
  • 1/5 item tracked for future implementation (checksum validation → US-78)
  • Quality gate passing ✅
  • No blocking issues remaining

@rucka
rucka merged commit 8579f9f into main Nov 23, 2025
2 checks passed
@rucka
rucka deleted the feature/#72-kb-dataset-release branch November 23, 2025 15:43
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.

Separate KB Dataset Release

1 participant