|
| 1 | +#!/usr/bin/env pwsh |
| 2 | + |
| 3 | +# Create Phase 3 GitHub Issues for ElBruno.MarkItDotNet |
| 4 | +# Usage: ./create-github-issues.ps1 |
| 5 | +# |
| 6 | +# Prerequisites: |
| 7 | +# 1. Set GITHUB_TOKEN environment variable with a personal access token |
| 8 | +# 2. Token must have 'repo' scope |
| 9 | +# |
| 10 | +# Steps: |
| 11 | +# $env:GITHUB_TOKEN = "your_token_here" |
| 12 | +# ./create-github-issues.ps1 |
| 13 | + |
| 14 | +param( |
| 15 | + [string]$Owner = "elbruno", |
| 16 | + [string]$Repo = "ElBruno.MarkItDotNet", |
| 17 | + [string]$Token = $env:GITHUB_TOKEN |
| 18 | +) |
| 19 | + |
| 20 | +if (-not $Token) { |
| 21 | + Write-Error @" |
| 22 | +Error: GITHUB_TOKEN environment variable not set. |
| 23 | +
|
| 24 | +Please set your GitHub personal access token: |
| 25 | + `$env:GITHUB_TOKEN = 'ghp_xxxxxxxxxxxxxxxxxxxx' |
| 26 | +
|
| 27 | +Then run this script again. |
| 28 | +
|
| 29 | +To create a personal access token: |
| 30 | + 1. Go to https://github.com/settings/tokens |
| 31 | + 2. Click "Generate new token (classic)" |
| 32 | + 3. Select scopes: 'repo' (full control) |
| 33 | + 4. Copy the token and set it as above |
| 34 | +"@ |
| 35 | + exit 1 |
| 36 | +} |
| 37 | + |
| 38 | +$headers = @{ |
| 39 | + "Authorization" = "Bearer $Token" |
| 40 | + "Accept" = "application/vnd.github.v3+json" |
| 41 | + "X-GitHub-Api-Version" = "2022-11-28" |
| 42 | +} |
| 43 | + |
| 44 | +function Create-GitHubIssue { |
| 45 | + param( |
| 46 | + [string]$Title, |
| 47 | + [string]$Body, |
| 48 | + [string[]]$Labels = @() |
| 49 | + ) |
| 50 | + |
| 51 | + $bodyJson = @{ |
| 52 | + title = $Title |
| 53 | + body = $Body |
| 54 | + labels = $Labels |
| 55 | + } | ConvertTo-Json -Depth 10 |
| 56 | + |
| 57 | + try { |
| 58 | + $response = Invoke-RestMethod ` |
| 59 | + -Uri "https://api.github.com/repos/$Owner/$Repo/issues" ` |
| 60 | + -Method Post ` |
| 61 | + -Headers $headers ` |
| 62 | + -Body $bodyJson ` |
| 63 | + -ContentType "application/json" |
| 64 | + |
| 65 | + Write-Host "✅ Issue #$($response.number) created: $($response.title)" -ForegroundColor Green |
| 66 | + Write-Host " URL: $($response.html_url)" -ForegroundColor Cyan |
| 67 | + return $response |
| 68 | + } catch { |
| 69 | + Write-Error "Failed to create issue '$Title': $($_)" |
| 70 | + return $null |
| 71 | + } |
| 72 | +} |
| 73 | + |
| 74 | +Write-Host "Creating Phase 3 GitHub Issues for $Owner/$Repo..." -ForegroundColor Cyan |
| 75 | +Write-Host "" |
| 76 | + |
| 77 | +# Issue 1: Connectors Foundation |
| 78 | +$issue1 = Create-GitHubIssue ` |
| 79 | + -Title "Phase 3: Connectors Foundation" ` |
| 80 | + -Body @" |
| 81 | +# Phase 3: Connectors Foundation |
| 82 | +
|
| 83 | +## Overview |
| 84 | +Implement the abstraction layer and initial connectors for document sourcing, enabling MarkItDotNet to pull from multiple data sources beyond local file systems. |
| 85 | +
|
| 86 | +## Implementation Details |
| 87 | +
|
| 88 | +### 1. IDocumentSource Interface (Core Abstraction) |
| 89 | +Create the foundational interface for document sources. |
| 90 | +
|
| 91 | +**Location:** ``src/ElBruno.MarkItDotNet.Connectors/IDocumentSource.cs`` |
| 92 | +
|
| 93 | +### 2. FileSystem Connector |
| 94 | +Implement local directory scanning with: |
| 95 | +- Recursive directory traversal |
| 96 | +- File type filtering (configurable include/exclude patterns) |
| 97 | +- Metadata extraction (size, modified date, permissions) |
| 98 | +- Stream-based file reading (memory efficient) |
| 99 | +
|
| 100 | +**Location:** ``src/ElBruno.MarkItDotNet.Connectors/FileSystemConnector.cs`` |
| 101 | +
|
| 102 | +### 3. Azure Blob Storage Connector |
| 103 | +Implement Azure Blob sourcing with: |
| 104 | +- BlobContainerClient integration |
| 105 | +- Blob metadata mapping (tags, properties) |
| 106 | +- Streaming blob content (no download-to-memory) |
| 107 | +- Resumable iteration (continuation tokens) |
| 108 | +
|
| 109 | +**Location:** ``src/ElBruno.MarkItDotNet.Connectors/AzureBlobConnector.cs`` |
| 110 | +
|
| 111 | +### 4. Dependency Injection Registration |
| 112 | +Create ServiceCollectionExtensions for transparent connector wiring. |
| 113 | +
|
| 114 | +## Package Details |
| 115 | +- **Package ID:** ``ElBruno.MarkItDotNet.Connectors`` |
| 116 | +- **Version:** 0.7.0 |
| 117 | +- **Target Frameworks:** net8.0; net10.0 |
| 118 | +- **Dependencies:** Azure.Storage.Blobs (for Azure connector) |
| 119 | +
|
| 120 | +## Testing Requirements |
| 121 | +- FileSystemConnector: 20+ tests covering directory traversal, filtering, metadata |
| 122 | +- AzureBlobConnector: 15+ tests with mock Azure SDK |
| 123 | +- IDocumentSource: Contract tests ensuring all implementations honor interface |
| 124 | +
|
| 125 | +## Acceptance Criteria |
| 126 | +- [ ] IDocumentSource interface is stable and documented |
| 127 | +- [ ] FileSystemConnector handles all tested edge cases (nested dirs, symlinks, permissions) |
| 128 | +- [ ] AzureBlobConnector streams efficiently (no buffering entire blobs) |
| 129 | +- [ ] All tests passing (40+) |
| 130 | +- [ ] Package builds and publishes with v0.7.0 |
| 131 | +- [ ] Demo sample runs end-to-end |
| 132 | +- [ ] Documentation complete with examples |
| 133 | +"@ ` |
| 134 | + -Labels @("Phase 3", "connectors") |
| 135 | + |
| 136 | +Write-Host "" |
| 137 | + |
| 138 | +# Issue 2: Security Hardening |
| 139 | +$issue2 = Create-GitHubIssue ` |
| 140 | + -Title "Phase 3: Security Hardening & Policy Engine" ` |
| 141 | + -Body @" |
| 142 | +# Phase 3: Security Hardening & Policy Engine |
| 143 | +
|
| 144 | +## Overview |
| 145 | +Expand the Security package foundation with policy-driven content filtering, PII detection/redaction, and production guardrails for large-scale ingestion pipelines. |
| 146 | +
|
| 147 | +## Implementation Details |
| 148 | +
|
| 149 | +### 1. Policy Definition & Enforcement |
| 150 | +Create a policy abstraction for consistent security rules via ``ISecurityPolicy`` interface and ``PolicyResult`` class. |
| 151 | +
|
| 152 | +### 2. PII Detection & Redaction Pipeline |
| 153 | +- Detect common PII: emails, phone numbers, SSN, credit card patterns |
| 154 | +- Configurable redaction strategies (mask, replace, remove) |
| 155 | +- Metadata tagging (confidence levels, detection method) |
| 156 | +- Integration with Citations package |
| 157 | +
|
| 158 | +**Location:** ``src/ElBruno.MarkItDotNet.Security/PiiDetector.cs`` |
| 159 | +
|
| 160 | +### 3. Content Allow/Deny Policies |
| 161 | +- Source-level policies (e.g., allow only specific domains in URLs) |
| 162 | +- Content-type policies (block certain media types) |
| 163 | +- Path patterns for file ingestion (e.g., exclude /node_modules) |
| 164 | +- Policy evaluation result propagation into downstream chunking |
| 165 | +
|
| 166 | +**Location:** ``src/ElBruno.MarkItDotNet.Security/ContentPolicyEngine.cs`` |
| 167 | +
|
| 168 | +### 4. File-Size & Page-Count Guardrails |
| 169 | +- Configurable limits on max file size, max page count (for PDFs) |
| 170 | +- Streaming validation (reject before full download) |
| 171 | +- Quota tracking per source/session |
| 172 | +
|
| 173 | +**Location:** ``src/ElBruno.MarkItDotNet.Security/GuardrailsPolicy.cs`` |
| 174 | +
|
| 175 | +## Testing Requirements |
| 176 | +- PiiDetector: 25+ tests with real PII patterns (SSN, phone, email, credit card) |
| 177 | +- ContentPolicyEngine: 15+ tests for path patterns, domain filtering |
| 178 | +- GuardrailsPolicy: 10+ tests for size/quota enforcement |
| 179 | +- Integration: 5+ end-to-end tests with Security + Citations + Chunking |
| 180 | +
|
| 181 | +## Acceptance Criteria |
| 182 | +- [ ] ISecurityPolicy interface is extensible and documented |
| 183 | +- [ ] PII detection covers common patterns with >90% accuracy |
| 184 | +- [ ] Allow/deny policies can be chained and composed |
| 185 | +- [ ] Guardrails enforce limits without memory spikes |
| 186 | +- [ ] Policy metadata flows seamlessly into Citations |
| 187 | +- [ ] All tests passing (50+) |
| 188 | +- [ ] Performance: policy evaluation <10ms per chunk |
| 189 | +"@ ` |
| 190 | + -Labels @("Phase 3", "security") |
| 191 | + |
| 192 | +Write-Host "" |
| 193 | + |
| 194 | +# Issue 3: Evaluation Tooling |
| 195 | +$issue3 = Create-GitHubIssue ` |
| 196 | + -Title "Phase 3: Evaluation Tooling & Benchmark Suite" ` |
| 197 | + -Body @" |
| 198 | +# Phase 3: Evaluation Tooling & Benchmark Suite |
| 199 | +
|
| 200 | +## Overview |
| 201 | +Expand the Evals package foundation with corpus-based benchmarking, multi-strategy comparison reports, and exportable metrics for CI/CD integration. |
| 202 | +
|
| 203 | +## Implementation Details |
| 204 | +
|
| 205 | +### 1. Benchmark Corpus & Fixtures |
| 206 | +- Create test corpus: diverse file formats, document types, sizes (10KB to 100MB) |
| 207 | +- Immutable fixtures for reproducible measurements |
| 208 | +- Metadata: expected output characteristics, known edge cases |
| 209 | +
|
| 210 | +**Location:** ``src/tests/ElBruno.MarkItDotNet.Evals.Tests/Fixtures/BenchmarkCorpus.cs`` |
| 211 | +
|
| 212 | +### 2. Multi-Strategy Evaluation Reports |
| 213 | +Extend ConversionEvaluationEngine to compare chunking strategies and generate ranking reports with recommendations. |
| 214 | +
|
| 215 | +**Location:** ``src/ElBruno.MarkItDotNet.Evals/StrategyComparison.cs`` |
| 216 | +
|
| 217 | +### 3. Citation Coverage Metrics |
| 218 | +- Measure % of original citations retained post-conversion |
| 219 | +- Track citation accuracy (correct mapping of references) |
| 220 | +- Correlation with chunking strategy (heading-based vs. paragraph-based) |
| 221 | +
|
| 222 | +**Location:** ``src/ElBruno.MarkItDotNet.Evals/CitationCoverageEvaluator.cs`` |
| 223 | +
|
| 224 | +### 4. Performance Metrics Collection |
| 225 | +- Latency: time-to-conversion by format type |
| 226 | +- Memory: peak memory usage during conversion and chunking |
| 227 | +- Throughput: documents/second for batch operations |
| 228 | +- Exportable JSON/CSV for CI dashboards |
| 229 | +
|
| 230 | +**Location:** ``src/ElBruno.MarkItDotNet.Evals/PerformanceMetrics.cs`` |
| 231 | +
|
| 232 | +## Testing Requirements |
| 233 | +- BenchmarkCorpus: reproducible, versioned test data |
| 234 | +- StrategyComparison: 10+ tests comparing chunking strategies |
| 235 | +- CitationCoverageEvaluator: 8+ tests with known citation patterns |
| 236 | +- PerformanceMetrics: 5+ tests with synthetic load |
| 237 | +
|
| 238 | +## Acceptance Criteria |
| 239 | +- [ ] Benchmark corpus is reproducible and comprehensive (50+ files) |
| 240 | +- [ ] StrategyComparisonReport provides actionable rankings |
| 241 | +- [ ] Citation coverage metrics >90% for valid conversions |
| 242 | +- [ ] Performance metrics exportable in JSON/CSV |
| 243 | +- [ ] All tests passing (30+) |
| 244 | +- [ ] Demo benchmark runs in <5 seconds on single file |
| 245 | +- [ ] CI integration shows metrics trending |
| 246 | +"@ ` |
| 247 | + -Labels @("Phase 3", "evals") |
| 248 | + |
| 249 | +Write-Host "" |
| 250 | + |
| 251 | +# Issue 4: End-to-End Samples |
| 252 | +$issue4 = Create-GitHubIssue ` |
| 253 | + -Title "Phase 3: End-to-End Samples & Integration" ` |
| 254 | + -Body @" |
| 255 | +# Phase 3: End-to-End Samples & Integration |
| 256 | +
|
| 257 | +## Overview |
| 258 | +Create comprehensive runnable samples demonstrating the full Phase 3 ecosystem: connectors, security policies, evaluations, and real-world ingestion workflows. |
| 259 | +
|
| 260 | +## Implementation Details |
| 261 | +
|
| 262 | +### 1. Connectors Demo |
| 263 | +**Path:** ``src/samples/ConnectorsDemo/Program.cs`` |
| 264 | +
|
| 265 | +Demonstrates: |
| 266 | +- FileSystem connector scanning a directory |
| 267 | +- Azure Blob connector with connection string |
| 268 | +- Mixing connectors in a unified ingestion loop |
| 269 | +- Error handling and retry strategies |
| 270 | +
|
| 271 | +### 2. Security & Policies Demo |
| 272 | +**Path:** ``src/samples/SecurityPoliciesDemo/Program.cs`` |
| 273 | +
|
| 274 | +Demonstrates: |
| 275 | +- Applying PII detection and redaction |
| 276 | +- Chaining multiple policies (content + guardrails) |
| 277 | +- Exporting policy violations for audit |
| 278 | +- Integration with Security package |
| 279 | +
|
| 280 | +### 3. Evaluation & Benchmarking Demo |
| 281 | +**Path:** ``src/samples/EvaluationDemo/Program.cs`` |
| 282 | +
|
| 283 | +Demonstrates: |
| 284 | +- Running ConversionEvaluationEngine on converted output |
| 285 | +- Comparing multiple chunking strategies |
| 286 | +- Generating strategy comparison reports |
| 287 | +- Exporting metrics for dashboards |
| 288 | +
|
| 289 | +### 4. Full Ingestion Workflow |
| 290 | +**Path:** ``src/samples/IngestionWorkflow/Program.cs`` |
| 291 | +
|
| 292 | +End-to-end flow: |
| 293 | +1. **Source (Connectors):** Read from FileSystem or Azure Blob |
| 294 | +2. **Security (Policies):** Apply PII redaction + content policies |
| 295 | +3. **Conversion:** Convert to Markdown |
| 296 | +4. **Chunking:** Apply chunking strategy |
| 297 | +5. **Evaluation:** Score output quality |
| 298 | +6. **Output:** Export to Azure Search or save to disk |
| 299 | +
|
| 300 | +### 5. Updated Ingestion Walkthroughs |
| 301 | +**Path:** ``docs/ingestion-workflows.md`` |
| 302 | +
|
| 303 | +Create/update walkthroughs for: |
| 304 | +- "Ingest a local folder" |
| 305 | +- "Ingest from Azure Blob Storage" |
| 306 | +- "Apply security policies to sensitive documents" |
| 307 | +- "Compare chunking strategies and pick the best one" |
| 308 | +- "Export evaluation metrics to CI dashboard" |
| 309 | +
|
| 310 | +## Testing Requirements |
| 311 | +- Each sample compiles and runs without errors |
| 312 | +- Sample output matches expected format |
| 313 | +- Samples work with all supported .NET versions (8.0, 10.0) |
| 314 | +- No hardcoded paths or secrets in samples |
| 315 | +
|
| 316 | +## Acceptance Criteria |
| 317 | +- [ ] ConnectorsDemo compiles and runs |
| 318 | +- [ ] SecurityPoliciesDemo compiles and runs |
| 319 | +- [ ] EvaluationDemo compiles and runs |
| 320 | +- [ ] IngestionWorkflow compiles and runs end-to-end |
| 321 | +- [ ] Updated ingestion walkthroughs are clear and copy-paste-able |
| 322 | +- [ ] README.md links to all new samples |
| 323 | +- [ ] No sample depends on external services (use mocks/stubs) |
| 324 | +- [ ] All samples include error handling and logging |
| 325 | +"@ ` |
| 326 | + -Labels @("Phase 3", "samples", "documentation") |
| 327 | + |
| 328 | +Write-Host "" |
| 329 | +Write-Host "✅ All 4 Phase 3 issues created successfully!" -ForegroundColor Green |
| 330 | +Write-Host "" |
| 331 | +Write-Host "Next steps:" -ForegroundColor Yellow |
| 332 | +Write-Host "1. ✅ v0.6.1 is published to NuGet" |
| 333 | +Write-Host "2. ✅ 4 Phase 3 issues created in GitHub" |
| 334 | +Write-Host "3. 📝 Review issues and begin Phase 3 implementation" |
| 335 | +Write-Host "" |
| 336 | +Write-Host "View issues at: https://github.com/$Owner/$Repo/issues" -ForegroundColor Cyan |
0 commit comments