← Back to Pull requests

feat(import): ICS/GPX/CSV/git/JSON importers + drop-folder watcher #7

Open
unknown opened this pull request with 251 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 04, 2026 01:30 UTC
Author

Summary


This PR lets you backfill years of real-world history into the event log from files you already have. Every importer is dependency-free and keyless, and imports are idempotent through the existing content_hash / external_id dedupe.

  • src/events/importers.ts (pure parsers):

  • - ICS: RFC 5545 line unfolding and unescaping. VALUE=DATE all-day events are supported. external_id = UID[@RECURRENCE-ID]. Output is calendar/event, with summary, location, organizer and rrule in data. TZID/floating times are treated as UTC (best effort).
    - GPX: produces trkpt as location/point (keeps lat/lon, downsampled with minIntervalSec, default 60) and wpt/rtept as waypoint.
    - CSV: an RFC 4180 parser. The first time-like column becomes occurred_at, and numeric columns become typed data. Optional columns: stream, kind/type, id, lat/lon, and text-like columns. Hex values such as 0x1F stay strings.
    - git: reads git log with \x1e/\x1f separators and produces git/commit with external_id = sha.
    - detectFormat detects the format from the file extension, falling back to sniffing the content.
  • importPath() (src/commands/import.ts) ingests in max_batch chunks and returns per-row errors. Both the CLI and the watcher use it.

  • dendrite import <file|repo-dir> [-f fmt] [-s stream] [-k kind] [--limit n] [--json]

  • Drop folder (inputs.drop_folder.{enabled,path,poll_seconds}): serve polls the folder. A file is imported only once its mtime is at least 2s old, so partly written files are skipped. Imported files move to processed/; failed files move to failed/ along with an .error.txt.

  • There are 29 keyless tests, including importing a real temp git repo and running a drop-folder sweep.
  • Link to Devin session: https://app.devin.ai/sessions/af5d3b29a40c4e0cbe388b087a3486a7
    Open in Devin Desktop: https://app.devin.ai/desktop/session/af5d3b29a40c4e0cbe388b087a3486a7?variant=devin
    Requested by: @mosesman831

    Diff: 251 lines (+188 / -63) across 3 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 0m
    All Vouch review confidence checks passed
    Residual risk 0.35 = Change Risk (0.39) × (1 − Review Confidence (0.11)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 251 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 7% · Reviewer familiarity: 35%
    11%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.331
    Real PR Conversation Timeline
    1 comments
    "Review active on #7"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 11.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39% (MEDIUM) · Higher = larger blast radius
    39%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 11.1% · Lower = rushed or shallow review
    11.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 34.7% · Safe to merge
    34.7%