Metadata-Version: 2.4
Name: talocode-leanlane
Version: 0.1.1
Summary: Stop AI agents from over-building — decision ladder, diff scoreboard, prune review (LeanLane)
Author: Talocode
License: MIT
Project-URL: Homepage, https://github.com/talocode/leanlane
Project-URL: Documentation, https://docs.talocode.site
Project-URL: Repository, https://github.com/talocode/leanlane
Project-URL: Issues, https://github.com/talocode/leanlane/issues
Project-URL: PyPI, https://pypi.org/project/talocode-leanlane/
Keywords: talocode,agents,leanlane,yagni,mcp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# LeanLane (Python)

**Stop AI agents from over-building** — decision ladder, diff scoreboard, prune review, and cloud client. Local helpers need no API key; cloud uses Talocode.

Part of **[Talocode](https://talocode.site)**. Hosted at `/v1/leanlane/*`.

| | |
|--|--|
| **Package** | `pip install talocode-leanlane` |
| **Import** | `from leanlane import LeanLaneClient, decide, score_diff` |
| **npm** | `@talocode/leanlane` |
| **Cloud** | `https://api.talocode.site` |
| **Auth** | `TALOCODE_API_KEY` (cloud only) |
| **Repo** | [github.com/talocode/leanlane](https://github.com/talocode/leanlane) |
| **License** | MIT |

## Why LeanLane?

Agents over-generate code: new packages, wrappers, and speculative frameworks. LeanLane forces a **decide → score → review** loop so you ship smaller, safer diffs.

## Install

```bash
pip install -U talocode-leanlane
```

## Quickstart

```python
from leanlane import decide, score_diff, review_code, get_ruleset, LeanLaneClient
import os

print(decide(task="add a date picker to the form"))
print(score_diff(diff="""--- a/x.ts
+++ b/x.ts
@@
+import moment from 'moment'
+export class DatePickerFactory {}
"""))
print(review_code(text="abstract class BaseThing {} // for future use"))
print(get_ruleset(mode="full")[:200])

client = LeanLaneClient(api_key=os.environ.get("TALOCODE_API_KEY"))
# print(client.health())  # when cloud route is deployed
```

## Auth / env

```bash
export TALOCODE_API_KEY=...
export TALOCODE_BASE_URL=https://api.talocode.site  # optional
```

## API surface

### Local

| Function | Purpose |
|----------|---------|
| `decide(...)` | Ladder recommendation before coding |
| `score_diff(diff=...)` | Over-build score A–F on unified diffs |
| `review_code(text=...)` | Findings + delete-list |
| `get_ruleset(mode=...)` | Always-on agent rules markdown |

### Cloud client (`LeanLaneClient`)

| Method | Route | Credits |
|--------|-------|---------|
| `health()` | `GET /v1/leanlane/health` | 0 |
| `pricing()` | `GET /v1/leanlane/pricing` | 0 |
| `capabilities()` | `GET /v1/leanlane/capabilities` | 0 |
| `decide(...)` | `POST /v1/leanlane/decide` | 2 |
| `score(...)` | `POST /v1/leanlane/score` | 5 |
| `review(...)` | `POST /v1/leanlane/review` | 5 |
| `rules(...)` | `POST /v1/leanlane/rules` | 1 |
| `skill(...)` | `GET /v1/leanlane/skill` | 1 |

## CLI

```bash
leanlane --help
leanlane decide --task "add date picker"
leanlane score --diff "..."
```

The Python console script is a thin client. For full MCP/git integration use the Node CLI: `npm i -g @talocode/leanlane`.

## Related packages

| Package | Install |
|---------|---------|
| LeanLane (this) | `pip install talocode-leanlane` |
| VerifyLane | `pip install talocode-verifylane` |
| SearchLane | `pip install talocode-searchlane` |
| Tera | `pip install talocode-tera` |
| ContextLane | `pip install contextlane` |
| StackLane | `pip install talocode` |

## Talocode ecosystem

| Product | Role |
|---------|------|
| **[LeanLane](https://github.com/talocode/leanlane)** | **(this package)** stop agent over-building |
| **[VerifyLane](https://github.com/talocode/verifylane)** · `pip install talocode-verifylane` | Deterministic code verification |
| **[PolicyLane](https://github.com/talocode/policylane)** | Allow/deny + redaction |
| **[StyleLane](https://github.com/talocode/stylelane)** | Constitution packs |
| **[EvalLane](https://github.com/talocode/evallane)** | Assertion eval suites |
| **[TraceLane](https://github.com/talocode/tracelane)** | Agent run tracing |
| **[RetryLane](https://github.com/talocode/retrylane)** | Retries & circuit breakers |
| **[PromptLane](https://github.com/talocode/promptlane)** | Prompt versioning |
| **[HandoffLane](https://github.com/talocode/handofflane)** | Schema handoffs |
| **[GateLane](https://github.com/talocode/gatelane)** | MCP gateway |
| **[SearchLane](https://github.com/talocode/searchlane)** · `pip install talocode-searchlane` | Agent web search |
| **[ContextLane](https://github.com/talocode/contextlane)** · `pip install contextlane` | Shared agent context |
| **[MemoryLane](https://github.com/talocode/memorylane)** | Agent memory |
| **[Tera](https://github.com/talocode/tera)** · `pip install talocode-tera` | Capability API |
| **[Codra](https://github.com/talocode/codra)** · `pip install talocode-codra` | Coding agent |
| **[StackLane](https://github.com/talocode/stacklane)** · `pip install talocode` | Keys, wallet, metering |
| **[Tradia](https://github.com/talocode/tradia)** · `pip install tradia` | Trading agents |
| **[ScreenLane](https://github.com/talocode/screenlane)** · `pip install talocode-screenlane` | Screen context |
| **[XSearchLane](https://github.com/talocode/xsearchlane)** · `npm i @talocode/xsearchlane` | X search |
| **[XProLane](https://github.com/talocode/xprolane)** · `pip install talocode-xprolane` | X pro workflows |
| **[Agent Browser](https://github.com/talocode/agent-browser)** | Browser automation |
| **[ClipLoop](https://github.com/talocode/cliploop)** | Clip / media loops |
| **[InvoiceLane](https://github.com/talocode/invoicelane)** | Invoicing |
| **[GeoLane](https://github.com/talocode/geolane)** | Geo utilities |
| **[DevTool](https://github.com/talocode/devtool)** · `pip install talocode-devtool` | Dev tooling |

More: [github.com/talocode](https://github.com/talocode) · [talocode.site](https://talocode.site) · [docs.talocode.site](https://docs.talocode.site)

## License

MIT © Talocode
