๐Ÿ’ก Inspiration

Every software engineer, DevOps architect, and machine learning researcher has experienced the agonizing friction of "Dependency Hell." You clone a cutting-edge repository, execute pip install -r requirements.txt, and are immediately greeted by an unresolvable cascade of red terminal text: conflicting transitive constraints, missing native C-headers, broken wheel builds, port socket collisions, or silent Python 3.12+ ABI incompatibilities.

The typical developer response is hours of frustrating trial-and-error: scouring outdated StackOverflow threads, blindly running pip install --force-reinstall --no-cache-dir, or wiping virtual environments from scratchโ€”often corrupting global system packages in the process.

Yet, dependency resolution is fundamentally a mathematical constraint satisfaction problem. I asked myself:

Why are developers relying on generic search engines and guesswork when environment conflicts can be parsed deterministically with set theory and augmented with predictive AI?

That question inspired DependenceDocโ€”a self-healing DevOps workstation designed to turn minutes of chaotic debugging into seconds of automated recovery.


๐Ÿš€ What It Does

DependenceDoc is an intelligent, multi-domain environment recovery framework available both as an interactive web workstation and a high-speed CLI tool:

  1. ๐Ÿšฆ Multi-Domain Sentinel Signal Matrix: Automatically classifies chaotic terminal dumps into four operational fault sectors:

    • ๐Ÿ–ฅ๏ธ System C-Library: Missing GCC toolchains, OpenSSL headers, and wheel compilation failures.
    • ๐ŸŒ Environment Path: Module import mismatches (e.g., cv2 โ†’ opencv-python), missing .env tokens, and scope leaks.
    • โš™๏ธ Runtime Infrastructure: Port socket collisions (lsof/kill) and database connection refusals.
    • ๐Ÿ“ฆ Package Dependency: Complex version bounds, conflicting requirements, and unresolvable deadlocks.
  2. ๐Ÿ•ต๏ธ PEP 440 Mathematical Constraint Solver: Parses version specifiers into formal intervals and determines the intersection of permissible version sets: V_valid = โ‹‚(i=1 to n) S_i โІ U_PyPI

If V_valid = โˆ…, the engine isolates the exact deadlock boundary, queries the live PyPI registry index, and pinpoints the newest stable release that satisfies all parent package requirements without breaking downstream dependencies.

  1. ๐Ÿค– Dual AI Insight Air-Lock & Strict BYOK Architecture:

    • Leverages Google Gemini 3.8 Flash / Pro and Groq Cloud (GPT OSS 120B) to provide deep root-cause explanation and predictive "pre-thinking" risk simulation.
    • Warns developers of latent side-effects (e.g., Python 3.12 C-API deprecations or headless server graphics conflicts) before any command is executed.
    • Features a built-in Bring-Your-Own-Key (BYOK) system with tiered quotas protecting shared keys (10 runs for Flash Lite, 5 for Flash, 2 for Pro) and instant unlimited runs upon supplying personal keys.
  2. โšก Deterministic 1-Click Export:

    • Generates executable, self-contained shell scripts (.sh) with exact pinned versions.
    • Compiles an ISO-compliant, multi-page vector forensic PDF audit report on the fly using ReportLab.

๐Ÿ› ๏ธ How I Built It

  • Interactive UI & Workstation: Developed using Streamlit Cloud and custom Cyber-Glass CSS styling, featuring live system health gauges (H_initial โ†’ H_recovered), interactive Graphviz architecture graphs, and anonymous telemetry via Pendo/Novus.
  • Mathematical Constraint Engine: Built on top of Python's formal packaging specification (packaging.specifiers, packaging.version.Version) implementing rigorous PEP 440 interval algebra.
  • Registry Sieve & Live Verification: Queries PyPI JSON APIs asynchronously with localized LRU caching to eliminate network bottlenecks.
  • Multi-Model Orchestrator: Integrated Googleโ€™s modern google-genai SDK for Gemini 3.8 Flash alongside the groq SDK for ultra-low latency LLaMA / GPT OSS 120B inference, guarded by an execution circuit breaker to ensure zero-downtime offline fallbacks.
  • Automated Video Production Pipeline: Built an automated verification and recording pipeline utilizing headless Playwright Chromium, Edge-TTS neural audio synthesis, and FFmpeg for 1080p 30fps remuxing and synchronized soft/hard subtitles.

๐Ÿง— Challenges I Faced

  1. Non-Trivial PEP 440 Interval Intersections: Python dependency specifiers can combine arbitrary prefixes (~=, ===, !=, >=, <*). Transforming these heterogeneous rules into closed mathematical intervals [v_min, v_max] and handling pre-release tags (1.24.0rc1) without false positive rejections required custom constraint normalization algorithms.

  2. AI Guardrails & Deterministic Isolation: LLMs are notoriously prone to hallucinating package version numbers that do not exist on PyPI. I solved this by designing an "Air-Lock Architecture": the AI model is never allowed to guess package versions. All version numbers and shell remediation commands are derived mathematically by the deterministic rule engine; the AI's role is strictly confined to explanatory triage and risk pre-thinking.

  3. High-Concurrence Cloud Deployment: Hosting the application on Streamlit Cloud required bulletproof exception wrapping, preventing thread deadlocks, rate-limit crashes, and secret leaks while enabling live user BYOK credential injection.


๐Ÿ† Accomplishments That I'm Proud Of

  • Sub-Second Mathematical Triage: The core signal detector, PEP 440 solver, and PyPI historical sieve execute in under 0.81s, achieving a 100% recovery confidence score.
  • 100% Mathematical Certainty: Every recommended command is backed by historical PyPI registry releases and constraint verification.
  • Complete End-to-End Delivery: Deployed live on Streamlit Cloud with zero setup required, accompanied by a comprehensive CLI, rich PDF reporting, and an automated 1080p demo video with neural voiceover.

๐Ÿ“š What I Learned

  • The deep mathematical subtleties of the PEP 440 version specification and how modern package managers resolve directed acyclic dependency graphs (DAGs).
  • How to architect resilient multi-model LLM pipelines that gracefully cascade from Google Gemini to Groq Cloud with deterministic fail-safes.
  • The vital necessity of predictive pre-thinking: fixing an immediate package conflict is useless if the downgrade silently breaks C-extension binary compatibility or drops Python 3.12 compatibility.

๐Ÿ”ฎ What's Next for DependenceDoc

  • Terminal Daemon & Hook: A lightweight background daemon (dependencedoc watch) that hooks into shell PROMPT_COMMAND or Python's sys.excepthook to automatically catch broken environments the moment an error occurs.
  • Cross-Ecosystem Expansion: Expanding the constraint solver beyond Python to Cargo (Rust), npm / pnpm (JavaScript), and Conda / Mamba environments.
  • Self-Healing CI/CD GitHub Action: An automated GitHub Action that catches dependency collision failures in CI workflows and automatically opens a pull request with the mathematically proven fix.

๐Ÿ”— Project Links

Built With

Share this project:

Updates

Submission history