Metadata-Version: 2.5
Name: civon-image-edit-audit
Version: 0.1.0
Summary: Audit human image-edit records and quote totals with a dependency-free Python library and CLI.
Project-URL: Homepage, https://civon.ai/image-editor
License-Expression: LicenseRef-NoLicenseGrant
License-File: LICENSE
Keywords: image-editing,manual-review,record-validation,workflow
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# civon-image-edit-audit

A dependency-free Python audit library and local CLI for **human-entered image-edit records**. It validates a JSON interchange format, identifies incomplete checks and failed candidates, counts manual acceptances, and sums recorded credit quotes with decimal arithmetic. It also produces a compact Markdown report.

This is an independent workflow utility, not an official Civon generation SDK. It does not generate, inspect, edit, hash or upload images, read an account balance, fetch current prices, run a model or verify rights. The decisions reflect only the supplied human assertions. Original AI-assisted code and text; no private product implementation, image, credential or third-party runtime package is included.

## Local installation and runtime

The prepared release contains a real wheel and source distribution. Install the actual local wheel in a virtual environment:

```sh
python -m pip install --no-index --no-deps /absolute/path/to/civon_image_edit_audit-0.1.0-py3-none-any.whl
civon-edit-audit records.json
civon-edit-audit --markdown records.json
civon-edit-audit - < records.json
```

Python 3.10 or later is declared. Local preparation tests the installed artifacts on the available Python runtime and records that version; it does not claim a full version matrix. Hatchling and build are build tools, not runtime dependencies. No PyPI or TestPyPI upload, live project URL or name reservation is established by this bundle.

## Python API

```python
from civon_image_edit_audit import audit_record, audit_records, load_records, to_markdown

candidate = {
    "schema": "civon-image-edit-record/v1",
    "id": "draft-1",
    "candidate": "mug-background-v1.png",
    "prompt": "Explore a warmer backdrop; inspect lettering.",
    "settings": "Manually recorded model, ratio and resolution",
    "quotedCredits": "2.5",  # synthetic example, not a product price
    "checks": {
        "subject": "pass", "text": "fail", "geometry": "pass",
        "edges": "pass", "lighting": "pass", "delivery": "pass"
    },
    "permissionsConfirmed": False
}

result = audit_record(candidate)
assert result.status == "revise"
assert result.failed == ("text",)
report = audit_records([candidate])
assert report["quotedCredits"] == "2.5"
print(to_markdown([candidate]))
```

These sample checks are fictional and do not describe an actual image analysis or product result. `AuditResult` is a frozen dataclass; audit functions do not mutate the supplied records.

## Interchange contract

The input is an array of `civon-image-edit-record/v1` records, compatible with JSON-serialised records from the separately prepared JavaScript record utility. This Python package does not require or execute that JavaScript package.

- Required non-empty strings: `id` (up to 160 characters), `candidate` (250), `prompt` (2000), `settings` (2000).
- `quotedCredits` is a decimal string with at most six whole digits and three fractional digits, or null/omitted for unknown. An explicit `"0"` is distinct from unknown. Numbers, negative values, exponent notation and excessive precision are rejected. Decimal arithmetic totals all known quotes, including rejected candidates; these are entries, not charges, prices or an account balance.
- Optional `sourceSha256` and `candidateSha256` contain 64 hexadecimal characters or null. Only their syntax is checked; files are not opened or hashed. Optional `notes` is non-empty text up to 2000 characters, or null/omitted.
- `checks` contains exactly `subject`, `text`, `geometry`, `edges`, `lighting` and `delivery`. Each value is `pending`, `pass`, `fail` or `na`. `permissionsConfirmed` must be an actual boolean, not a string or number.
- A failed check yields `revise`; a pending check yields `pending`. All N/A is insufficient. Acceptance requires at least one Pass and confirmed permissions after all checks resolve. The permissions field records a user assertion, not legal clearance.
- Arrays are limited to 10,000 records, with unique trimmed ids. Errors identify the zero-based record index where applicable. `load_records` rejects duplicate JSON keys, non-finite constants and malformed/deeply nested JSON. Unknown top-level extra fields are ignored; unknown check fields are rejected.

The CLI reads at most 5 MiB plus one byte to detect oversized input. It accepts one local UTF-8 file or stdin, prints a report and writes no file. Invalid data returns status 1, argument errors 2, and valid reports/help 0. `to_markdown` escapes table delimiters and line breaks; it is not an HTML sanitiser. Keep exported prompts, filenames, settings and notes private when needed.

## Provenance and license posture

Metadata uses `LicenseRef-NoLicenseGrant` with the included notice. This preparation grants no open-source or other package-use license and makes no ownership or exclusivity assurance. Account authority, distribution rights, namespace/version availability and final publication remain execution checks. No author, email, source repository or issue tracker is invented.

## Related product context

[Civon AI Image Editor](https://civon.ai/image-editor) is a browser-based, prompt-led still-image editor. Model choices, usable reference counts, settings, access and quoted credits vary. This audit utility works without visiting or connecting to it and provides no model integration, endorsement by PyPI or guarantee about an edited image.
