Metadata-Version: 2.4
Name: aildv
Version: 1.0.0
Summary: AI-Assisted Local Development and Verification
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML<7,>=6
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.9; extra == "dev"
Dynamic: license-file

# AILDV — AI-Assisted Local Development & Verification

A read-only-first, cross-language CLI that **inspects existing repositories** and creates **tool-neutral, short AI collaboration instructions** without replacing your framework, tests, deployment tooling, or repository conventions.

Current release: **1.0.0**. Supported inspection patterns include Flutter/Dart, Go, Java/Maven/Gradle, .NET/C#/ASP.NET Core, Python, and Node.js/React/Vite, validated against real repositories (see `docs/VALIDATION.md`). This is heuristic inspection, not universal language/framework proof. Two release-gate items are still outstanding and are documented, not claimed: the with/without-AILDV benchmark and three coding-agent integrations — see `docs/BENCHMARKS.md` and `docs/VALIDATION.md`.

## Prerequisites

- Python 3.11 or newer
- A repository to inspect
- Optional: the relevant language SDK and test runner to execute checks

### Installation (Windows PowerShell)

```powershell
cd D:\faiz-personal\aildv
py -3.13 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
python -m pytest -q
python -m ruff check src tests
```

macOS/Linux: use `python3 -m venv .venv` and `source .venv/bin/activate`.

## Commands

```powershell
# Read-only discovery
aildv inspect D:\repo\project
aildv inspect D:\repo\project --json

# Preview six generated files, no writes
aildv init D:\repo\project --dry-run

# Write only missing AI docs, preserving all pre-existing files
aildv init D:\repo\project

# Optional thin per-agent pointer files (canonical guidance stays in AGENTS.md)
aildv init D:\repo\project --agents claude,gemini,cursor

# Explicitly replace those generated document paths (review first)
aildv init D:\repo\project --force

# Preview detected unit/lint checks, no commands are executed
aildv verify D:\repo\project
aildv verify D:\repo\project --json

# Explicit opt-in to execute the detected commands locally
aildv verify D:\repo\project --run --timeout 300

# Deterministic feature impact analysis (no network, no LLM)
aildv feature plan "add caching to the order service" D:\repo\project
aildv feature plan "add caching to the order service" D:\repo\project --json
aildv feature context "add caching to the order service" D:\repo\project

# Read-only local toolchain discovery (never installs anything)
aildv env D:\repo\project
aildv env D:\repo\project --json

# Discover Compose services and running state (read-only)
aildv services D:\repo\project
# Start/stop only with explicit approval; never starts a duplicate
aildv services D:\repo\project --start --approve

# Discover OpenAPI endpoints and match a request to affected endpoints
aildv api D:\repo\project --request "update the orders endpoint"
# Diff two OpenAPI contracts (exit 1 when breaking changes exist)
aildv api D:\repo\project --base old-openapi.yml --head new-openapi.yml

# Discover database tech and migrations (local 127.0.0.1 probes only)
aildv db D:\repo\project

# Diagnose a saved verification results file (nothing executed)
aildv verify D:\repo\project --run --json --output results.json
aildv diagnose results.json

# Requirement -> files -> evidence traceability, with doc-impact suggestions
aildv trace "add caching to the order service" D:\repo\project --results results.json
# Local run history (recorded with `verify --run --history`)
aildv history D:\repo\project
```

`verify --run` **does** execute project tests/scripts, which may have side effects of their own. Review the preview before running it; use a safe, isolated development environment. The CLI itself never automatically starts Docker, runs deployments, creates test databases, or launches load/security tests. Executed steps report a preserved argument array, exit code, duration, capped and redacted output, and — when the runner reports one — a parsed test summary (counts and detail line, never invented). `approval-required` steps are never executed.

### Feature impact analysis

`aildv feature plan "<request>"` reports the repository evidence a request is
likely to touch — components, source files, tests, config, API definitions,
docs, contracts to preserve, and local verification commands — plus an explicit
**Unknowns** section. `aildv feature context "<request>"` emits a smaller,
deterministic bundle for an agent to read first. Both are heuristic
(path/keyword/manifest matching over inspected metadata): no network, no LLM
calls, and no invented requirements. Repeated runs are identical.

### Generated files

`aildv init` creates:

| File | Purpose |
| --- | --- |
| `AGENTS.md` | concise, tool-neutral agent rules |
| `ai/workflow.md` | reuse-first development loop |
| `ai/repository.md` | detected languages, infrastructure, component map |
| `ai/test-matrix.md` | discovered check commands, explicitly *not run* |
| `ai/qa-test-guide.md` | reusable functional/E2E QA checklist |
| `ai/report-template.md` | actual pass/fail/skip evidence template |
| `ai/handoff.md` | standard handoff format (observed vs claimed evidence) |

The CLI does not overwrite these files unless `--force` is explicitly supplied.

### Current detection behavior

- Inspects filenames, small known manifests, and package scripts; avoids reading arbitrary application code.
- Detects primary application candidates conservatively; a single recognized ASP.NET Core Web SDK project can be selected over unrelated console/test projects.
- Treats Flutter Android Gradle modules as supporting the root Flutter app.
- Excludes known generated Flutter plugin sources and vendored ASP.NET `wwwroot/lib` assets.
- Preserves `.NET projects` as a list of paths, with `project_details` exposing SDK/framework/test/reference metadata.
- Detects existing Go, Flutter, pytest, npm, Gradle, Maven, and `.NET` tests (subject to repository evidence).
- Provides a `project_map` alongside raw component evidence in JSON.

### Limitations

- Language discovery is based on manifest/file patterns. Monorepos, dynamic MSBuild imports, nonstandard project layouts, nested frontend workspaces, and custom scripts can require manual interpretation.
- Primary project remains unknown if multiple plausible applications exist without strong evidence.
- The inspector caps matched examples per label and the overall file scan. Truncated scans warn you; a tool not detected is not proof it does not exist.
- Docker Compose service discovery and approved start/stop are implemented (`aildv services`), but AILDV never deploys, destroys, or switches traffic. API-level test *generation*, authentication fixtures, performance/security testing, and autonomous repair loops are **not implemented**; AILDV discovers and classifies these but does not run them. The QA guide documents how to handle them manually.
- Automatic test execution is intentionally limited to test runners detected from evidence and never implies those checks passed until actually run.
- Do not run against untrusted repositories with `--run`: npm and other test scripts can execute arbitrary repository code.

## Validate common stacks

```powershell
$repositories = [ordered]@{
    "Flutter" = "D:\repo\flutterproject"
    "Go" = "D:\repo\GOproject"
    "Java" = "D:\repo\javaproject"
    ".NET" = "D:\repo\DotNETproject"
    "React" = "D:\repo\Reactproject"
}
foreach ($repo in $repositories.GetEnumerator()) {
    Write-Host "`n========== $($repo.Key) ==========" -ForegroundColor Cyan
    aildv inspect $repo.Value
    aildv verify $repo.Value
    aildv init $repo.Value --dry-run
}
```

For maintainers: tests are under `tests/`; local CLI entry point is `aildv.cli:main`; the packaged Agent Skill guidance is in `skills/aildv-onboard/SKILL.md`. Verify the CLI in a fresh environment with `python -m pytest -q` before releasing.

## Documentation

Detailed docs live in `docs/`: `ARCHITECTURE.md`, `CLI.md` (the output
contract), `CONFIGURATION.md`, `SAFETY.md`, `SUPPORT_MATRIX.md`,
`EXTENDING.md`, `TESTING.md`, `WORKFLOWS.md`, `TROUBLESHOOTING.md`,
`LIMITATIONS.md`, `VALIDATION.md`, `BENCHMARKS.md`, `DECISIONS.md`, and
`CONTRIBUTING_WITH_AI.md`. `AGENTS.md` is the concise entry point for a coding
agent.

## Feedback and support (post-release process)

AILDV is honest about what it does not do, so feedback that names a wrong
detection, a missed verification command, or a false pass is the most useful
kind. Please include:

1. The exact command and the AILDV version (`aildv --version`).
2. The repository type (language/framework) and its rough shape — not a
   private repository's contents.
3. The output, with anything sensitive removed. Never paste secrets.

Use the bug-report issue template. Reported false passes and any secret that
reaches output are treated as release-blocking. See `docs/VALIDATION.md` for
the two gate items that are still outstanding, and `docs/LIMITATIONS.md` for
what is out of scope.

## License and third-party notices

AILDV is released under the MIT License (see `LICENSE`). Its single runtime
dependency is **PyYAML** (`PyYAML>=6,<7`), also MIT-licensed. Development
extras are `pytest` (MIT) and `ruff` (MIT). No other third-party code is
bundled. Redaction is best-effort and is not a security boundary; see
`docs/SAFETY.md`.

### GitLab CI verification discovery

`aildv verify .` now also reads a repository's `.gitlab-ci.yml` or
`.gitlab-ci.yaml` (up to 512 KB), without executing CI scripts during
inspection. It recognizes literal local test-runner commands including
`python -m unittest`, `python -m pytest`, coverage-wrapped Python tests,
`go test`, `dotnet test`, `flutter test`, basic Maven/Gradle test commands,
and `npm/pnpm/yarn/bun run test`. A literal `cd app` sets the command's working
directory. Discovered commands include their CI job and file origin.

Unsupported, dynamic, inherited and shell-chained commands are shown as
`unsupported` and are **not executable** by AILDV. Setup statements are
listed as prerequisites, not run automatically. Every CI job is classified
(`local-unit`, `integration`, `api`, `smoke`, `performance`, `external-scan`,
`deployment`, `setup`, `unknown`) and none is silently dropped; each
non-runnable job carries a human-readable reason. Jobs needing Docker,
external APIs, or AWS are `approval-required` (or `blocked` when the tool is
missing) and are never auto-run. `verify` remains a side-effect-free preview
unless `--run` is explicitly supplied. Executing a local test may invoke
repository-controlled scripts, so review the plan before opting in. GitLab
`include`, `extends`, conditional `rules`, shell expansion, and CI-only
environments are not fully resolved by M2. The original v0.1.0 commands and
JSON keys remain available.
