Metadata-Version: 2.4
Name: sembl
Version: 0.1.0
Summary: Turn messy repo intent into scoped AI Work Orders
Author-email: speedvibecode <f20220620@hyderabad.bits-pilani.ac.in>, Siddharth Totla <totlasiddharth@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://sembl.vercel.app
Project-URL: Repository, https://github.com/speedvibecode/sembl
Project-URL: Issues, https://github.com/speedvibecode/sembl/issues
Keywords: ai,coding-agents,work-order,code-review,llm,developer-tools
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai>=1.30.0
Requires-Dist: anthropic>=0.25.0
Requires-Dist: click>=8.1.0
Requires-Dist: rich>=13.0.0
Provides-Extra: graph
Requires-Dist: graphifyy>=0.8.0; extra == "graph"
Provides-Extra: crg
Requires-Dist: code-review-graph; extra == "crg"
Provides-Extra: graph-pipeline
Requires-Dist: graphifyy>=0.8.0; extra == "graph-pipeline"
Requires-Dist: code-review-graph; extra == "graph-pipeline"
Dynamic: license-file

# Sembl

Turn messy repo intent into scoped AI Work Orders.

Sembl is not an AI coding agent. It is the layer that runs before one:

```text
repo + task -> Work Order -> agent executes with tighter scope
```

A Work Order is an execution contract. It tells an agent:

- what the goal is, and what it is not
- which files it can touch
- which files it should inspect but not modify
- what must be true when it finishes
- how to prove it succeeded
- when to stop and ask a human

Website: https://sembl.vercel.app

## Current Status

Sembl is early but usable for testing. The current CLI supports:

- repo probing for language/framework/branch/dirty state
- optional Graphify context
- optional code-review-graph context
- graph-required mode with `--require-graph-context`
- OpenAI, Anthropic, Gemini, and NVIDIA NIM providers
- work-order output as Markdown, JSON, executor prompt, and validation plan

The best current test path is graph-first:

```powershell
uv pip install "sembl[graph-pipeline] @ git+https://github.com/speedvibecode/sembl.git"
sembl generate --repo C:\path\to\repo --task "fix the failing login redirect test" --provider nvidia --require-graph-context
```

## Install From GitHub

For tester installs without cloning the repo:

```powershell
uv pip install "sembl[graph-pipeline] @ git+https://github.com/speedvibecode/sembl.git"
```

For a CLI tool install without graph extras:

```powershell
uv tool install git+https://github.com/speedvibecode/sembl.git
```

The future public package path is:

```powershell
uv tool install sembl
pip install sembl
```

That requires publishing the package to PyPI first.

## Install From Source

```powershell
git clone https://github.com/speedvibecode/sembl
cd sembl
uv pip install -e ".[graph-pipeline]"
```

Plain pip also works:

```powershell
pip install -e ".[graph-pipeline]"
```

## Provider Keys

Set one provider key before generation:

```powershell
$env:OPENAI_API_KEY="..."
$env:ANTHROPIC_API_KEY="..."
$env:GEMINI_API_KEY="..."
$env:NVIDIA_API_KEY="..."
```

Then choose the provider:

```powershell
sembl generate --repo C:\path\to\repo --task "replace starter screen text" --provider nvidia
```

## Optional Graph Context

Sembl can run without graph tools, but the strongest results come from Graphify plus code-review-graph.

```powershell
graphify update C:\path\to\repo --no-cluster
code-review-graph build --repo C:\path\to\repo --data-dir C:\path\to\repo-specific-crg-data --skip-flows

$env:CRG_DATA_DIR="C:\path\to\repo-specific-crg-data"
sembl generate --repo C:\path\to\repo --task "fix the failing login redirect test" --provider nvidia --require-graph-context
```

Sembl guards against stale generic `CRG_DATA_DIR` values by deriving a repo-specific graph data directory when the env var does not look like it belongs to the target repo.

## Usage

```powershell
# Generate a Work Order for the current repo
sembl generate --task "add recurring expenses to this tracker" --provider nvidia

# Generate for an explicit repo
sembl generate --repo C:\path\to\repo --task "fix the login redirect bug" --provider nvidia

# Refuse direct-probe fallback
sembl generate --repo C:\path\to\repo --task "fix the login redirect bug" --provider nvidia --require-graph-context

# List Work Orders
sembl list

# Show latest Work Order
sembl show

# Show the executor prompt
sembl show --file executor-prompt
```

## Output

```text
.sembl/work-orders/wo-myproject-{timestamp}-{slug}/
  work-order.md       - read this
  executor-prompt.md  - paste into your agent
  validation-plan.md  - run this after
  work-order.json     - machine-readable
```

## The 8 Locks

| Lock | Purpose |
|------|---------|
| Intent | Goal, outcome, task type |
| Boundary | Non-goals, forbidden areas |
| Scope | Editable paths, read-only context |
| Context | Files to inspect, architecture notes |
| Success | Acceptance criteria, regressions |
| Proof | Validation commands, tests to add |
| Safety | Stop conditions, risk level |
| Executor | Agent-ready prompt, patch expectations |

## Local Test

```powershell
python -m unittest discover -s tests -v
python -m compileall -q sembl tests
```

## Testing Notes

If you test Sembl on a real repo, the best feedback is:

- the exact command you ran
- whether graph context was available
- the generated `work-order.md`
- whether the executor agent could complete the task without scope confusion
- any hallucinated files, missing validation commands, or false stop conditions

Models write code. Sembl makes the work governable.
