Metadata-Version: 2.4
Name: l9-ci
Version: 1.0.0
Summary: Canonical analysis contracts, provider adapters, normalized findings, validation, and deterministic artifact generation for Quantum-L9 CI.
Project-URL: Repository, https://github.com/Quantum-L9/l9-ci-sdk
License: QUANTUM AI PARTNERS — L9 PROPRIETARY SOFTWARE LICENSE
        Version 1.0 — 2026
        
        Copyright (c) 2026 Quantum AI Partners ("Licensor"). All rights reserved.
        
        This software and associated documentation files (the "Software") are the
        proprietary and confidential property of Quantum AI Partners. The Software
        is made source-available on this repository for transparency, audit, and
        evaluation purposes only, under the terms below. NO OPEN-SOURCE LICENSE IS
        GRANTED. No prior license grant by Licensor (if any) shall be construed as
        a waiver of these terms.
        
        1. DEFINITIONS
        
           "Software" means the source code, object code, documentation, domain
           specs, configuration, and all other files contained in this repository,
           and any modifications or derivative works thereof.
        
           "Commercial Use" means any use of the Software, in whole or in part,
           directly or indirectly, from which any person or entity derives revenue,
           profit, cost savings, competitive advantage, or other commercial benefit.
           This includes, without limitation: selling, sublicensing, or hosting the
           Software or a derivative work; incorporating the Software into a product
           or service offered to third parties (including as part of a SaaS,
           managed service, or consulting engagement); and internal use by a
           for-profit entity in its business operations beyond internal evaluation.
        
           "You" / "Licensee" means any individual or entity that accesses, clones,
           copies, or otherwise makes use of the Software.
        
        2. LIMITED GRANT
        
           Subject to Your compliance with this License, Licensor grants You a
           limited, non-exclusive, non-transferable, revocable license to view,
           clone, and use the Software solely for personal, academic, or internal
           evaluation purposes that do NOT constitute Commercial Use.
        
        3. COMMERCIAL USE REQUIRES A PAID LICENSE
        
           Any Commercial Use of the Software requires a separate written commercial
           license agreement with Quantum AI Partners, negotiated in advance, which
           may include license fees, royalties, or a revenue/profit share. Engaging
           in Commercial Use without such an agreement is a material breach of this
           License and constitutes copyright infringement.
        
           To request a commercial license, contact: eng@l9.dev
        
        4. RESTRICTIONS
        
           Except as expressly permitted under Section 2, You may NOT, without prior
           written consent from Licensor:
        
           a. Copy, reproduce, or redistribute the Software, in source or object
              form, to any third party;
           b. Modify, create derivative works of, reverse-engineer, or decompile
              the Software, except as necessary for permitted evaluation;
           c. Sublicense, sell, rent, lease, or otherwise transfer any rights in
              the Software;
           d. Host, deploy, or offer the Software (or a derivative work) as a
              hosted or managed service to any third party;
           e. Remove, obscure, or alter any copyright, trademark, or proprietary
              notice contained in the Software;
           f. Use the Software to build, train, or benchmark a directly competing
              product or service.
        
        5. OWNERSHIP
        
           The Software is licensed, not sold. Licensor retains all right, title,
           and interest in and to the Software, including all intellectual property
           rights therein. No rights are granted to You other than as expressly set
           forth in this License.
        
        6. TERMINATION
        
           This License terminates automatically, without notice, if You breach any
           term of this License. Upon termination, You must cease all use of the
           Software and destroy all copies in Your possession or control. Sections
           3, 5, 7, and 8 survive termination.
        
        7. NO WARRANTY
        
           THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
           OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
           FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
        
        8. LIMITATION OF LIABILITY
        
           IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
           LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING
           FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
           DEALINGS IN THE SOFTWARE.
        
        9. GOVERNING LAW
        
           This License shall be governed by the laws of the jurisdiction in which
           Quantum AI Partners is organized, without regard to conflict-of-law
           principles. [Confirm jurisdiction/venue with counsel before relying on
           this in a dispute.]
        
        ---
        NOTE: This template was drafted to match your stated intent (restrict
        copying, require payment for commercial/profit-driven use) but has not been
        reviewed by an attorney. Have counsel review before relying on it in an
        actual dispute or before this repository accepts external contributions.
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: jsonschema==4.26.0
Requires-Dist: pyyaml==6.0.3
Requires-Dist: referencing==0.37.0
Provides-Extra: ci
Requires-Dist: mypy==2.3.0; extra == 'ci'
Requires-Dist: pytest-cov==7.1.0; extra == 'ci'
Requires-Dist: pytest==9.1.1; extra == 'ci'
Requires-Dist: rfc3339-validator==0.1.4; extra == 'ci'
Requires-Dist: ruff==0.16.0; extra == 'ci'
Requires-Dist: types-jsonschema==4.26.0.20260518; extra == 'ci'
Requires-Dist: types-pyyaml==6.0.12.20260724; extra == 'ci'
Description-Content-Type: text/markdown

---
# l9-ci-sdk

Canonical analysis contracts, provider adapters, normalized findings,
validation, and deterministic artifact generation for the L9 CI constellation.

> **CI Core orchestrates. CI SDK observes.** Downstream products diagnose,
> mutate, learn, prevent, and decide — they are not implemented here.

Agent operating law (architecture, phases, layer edges, git hygiene):
[`AGENTS.md`](AGENTS.md). Deep SSOT: [`docs/architecture/`](docs/architecture/),
[`docs/adr/`](docs/adr/), [`.l9/`](.l9/).

## Install

Python **≥ 3.11**. Two supported paths (keep deps aligned):

```bash
# Local editable install (console script `l9-ci`)
python -m venv .venv && source .venv/bin/activate
pip install -e ".[ci]"

# Or: runtime deps only (matches Core provision-sdk)
pip install -r requirements.txt
export PYTHONPATH=.
python -m l9_ci --help
```

- Runtime pins: [`requirements.txt`](requirements.txt) **and**
  [`pyproject.toml`](pyproject.toml) (must stay in sync).
- CI toolchain pins: [`requirements-ci.txt`](requirements-ci.txt).
- Core’s `provision-sdk` still runs this tree from source on `PYTHONPATH`
  and installs `requirements.txt` into its venv.
- Publishing notes: [`docs/PUBLISHING.md`](docs/PUBLISHING.md).

## CLI map

Entry points: `l9-ci` (after editable/wheel install) or `python -m l9_ci`.

| Group | Commands |
|---|---|
| `semgrep` | `detect`, `normalize` |
| `bundle` | `validate`, `project-agent-payload` |
| `compatibility` | `check` |
| `gate` | `evaluate` |
| `providers` | `list`, `detect` |
| `baseline` | `compare-tests`, `scan-packet-envelope`, `compare-scan`, `validate-ledger` |
| `manifest` | `generate`, `check` |

Core happy path:

```text
semgrep JSON → l9-ci semgrep normalize → l9-ci bundle validate
  → l9-ci bundle project-agent-payload → Core upload / publish
```

Exit codes and contract details: [`docs/architecture/cli-contract.md`](docs/architecture/cli-contract.md),
[`.l9/integration-contract.yaml`](.l9/integration-contract.yaml).

## Local gate (fail-closed)

Mechanical checks SSOT: [`.pre-commit-config.yaml`](.pre-commit-config.yaml).
Orchestration: [`Makefile`](Makefile).

```bash
make bootstrap   # .venv + deps + install pre-commit/pre-push hooks + doctor
make fmt         # intentional autofix (commit results)
make check       # hooks → clean tree → mypy → pytest
make push        # check, then git push
```

Do not bypass with `git push --no-verify`. Prefer `make push`.
Local zizmor is fail-closed even when dogfood CI is advisory.
`actionlint` remains CI-only until a pre-commit hook is added.

**Dropbox / mypy:** a `.venv` inside Dropbox often breaks mypy’s native
extensions. Prefer a clone outside Dropbox, or point Make at an off-Dropbox
interpreter (see `AGENTS.md` §10).

## CI surfaces in this repo

| Surface | Workflows | Role |
|---|---|---|
| Core-driven self-analysis | `l9-analysis*.yml` | Pins `l9-ci-core` by immutable SHA; advisory dogfood today |
| Self-CI (no Core) | `l9-self-ci.yml` | Classifier / rule-modes gate (`engine: ci-debt`) |
| YAML governance | `l9-yaml-governance.yml` + dogfood | Reusable yamllint / governance JSON / Action pins / actionlint / zizmor |
| Biome static checks | `l9-biome-scan.yml` + dogfood | JSON/JS/TS formatter+linter ownership (`biome.json`) |
| Manifest reconcile | `l9-manifest-reconcile.yml` | Keeps root `MANIFEST.md` aligned with tracked truth |

YAML governance configs: root [`lint/`](lint/). Biome config: root
[`biome.json`](biome.json). Downstream callers pin immutable SDK SHAs.
Details: [`docs/architecture/yaml-governance.md`](docs/architecture/yaml-governance.md),
[`docs/architecture/biome.md`](docs/architecture/biome.md),
[`docs/architecture/repository-manifest.md`](docs/architecture/repository-manifest.md).

## Constellation

| Product | Role |
|---|---|
| [`l9-ci-core`](https://github.com/Quantum-L9/l9-ci-core) | Orchestrates |
| **l9-ci-sdk** (this repo) | Observes / contracts |
| [`l9-ci-debt-resolver`](https://github.com/Quantum-L9/l9-ci-debt-resolver) | Diagnoses |
| [`PR_Repair`](https://github.com/Quantum-L9/PR_Repair) | Mutates |
| [`l9-ci-debt-intelligence`](https://github.com/Quantum-L9/l9-ci-debt-intelligence) | Learns |
| [`l9-ci-debt-lsp`](https://github.com/Quantum-L9/l9-ci-debt-lsp) | Prevents |
| [`l9-assurance`](https://github.com/Quantum-L9/l9-assurance) | Decides |

## Docs for agents (collision policy)

- **`README.md`** — short human entrypoint. Agents must **not** rewrite it
  from unrelated feature PRs (see `AGENTS.md` §13).
- **`AGENTS.md`** — agent operating law; update when law/surface changes.
- **Git hygiene** — WIP commits over stashes; never switch branches over
  uncommitted work (see `AGENTS.md` §12).
