Metadata-Version: 2.5
Name: narrative-craft
Version: 0.8.0
Summary: A standalone five-phase story development, critique, revision, and verification toolkit.
Project-URL: Homepage, https://github.com/clchinkc/narrative-craft
Project-URL: Repository, https://github.com/clchinkc/narrative-craft
Project-URL: Issues, https://github.com/clchinkc/narrative-craft/issues
Author: Kevin Chin
License: MIT License
        
        Copyright (c) 2026 Kevin Chin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        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. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS 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.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Text Processing
Requires-Python: >=3.14
Requires-Dist: jsonschema[format-nongpl]>=4.20
Requires-Dist: opencc>=1.1.9
Requires-Dist: pyyaml>=6.0
Requires-Dist: referencing>=0.30
Requires-Dist: zhconv>=1.4.3
Description-Content-Type: text/markdown

# Narrative Craft

Narrative Craft is a local toolkit for shaping, drafting, critiquing, revising,
verifying and exporting stories. It ships a Python package, the `narrative-craft`
CLI, an agent skill, typed contracts and a reproducible Traditional Chinese example.
It requires Python 3.14+ and no external service or agent framework.

## Status

`0.8.0` is the current release. The narrative system organizes
work around Plan, Character and Story, with Evaluation evidence, Owner Decisions
and a stateless orchestration loop. Pre-1.0 interfaces may change without compatibility
aliases. Read the [changelog](CHANGELOG.md) before upgrading.

A release is qualified by the gate suite CI runs on the tagged commit, which the
`develop → main` promotion and publication steps in [Release](docs/release.md)
depend on. The release path retains `zhconv` under the owner-approved ADR-009
exception: its bundled GPLv2-or-later conversion data reproduces protected
published export bytes, and the package ships the corresponding third-party notice.

## Install

```bash
uv tool install narrative-craft
# or
pipx install narrative-craft
# or
pip install narrative-craft
```

Development checkout:

```bash
git clone https://github.com/clchinkc/narrative-craft.git
cd narrative-craft
uv sync
uv run narrative-craft doctor
```

## Quick start

Author a Plan before creating a workspace. Initialization preserves that source and
records attributed genesis acceptances for the initial models.

```bash
mkdir lighthouse-story
cd lighthouse-story
printf '# The Second Signal\n\nThe premise, ending and scene intentions.\n' > Plan.md
narrative-craft project init --story . --id lighthouse-story \
  --title "The Second Signal" --locale en --decided-by author:you
narrative-craft project get --story .
narrative-craft check all --story .
narrative-craft story frontier --story .
```

Follow [Quick start](docs/quick-start.md) or inspect a copy of
[《留聲》](examples/liu-sheng/README.md), a reproducible story built through genesis,
Plan change and scene drafting. Author-facing SHAPE, BUILD, POLISH, CRITIQUE and
PUBLISH describe the work; accepted narrative moves implement changes.

The current commands are `run`, `project`, `plan`, `character`, `story`, `eval`,
`decision`, `check`, `doctor`, `export` and `release-check`. Use their `--help`
for leaf arguments. Every product command uses the `narrative-craft` prefix.

```bash
narrative-craft run --story .
narrative-craft plan model get --story .
narrative-craft character list --story .
narrative-craft story model get --story .
narrative-craft decision wave --story .
narrative-craft eval list --story .
narrative-craft export ao3 --story . --output export.html
```

Export prepares a file; publishing remains an author action.

## Workspace and narrative loop

[Workspace authorities](docs/state-format.md) owns the storage guide. The
[system spec](spec/narrative-system.yaml) defines authority and mutation laws;
[the architecture map](docs/architecture/INTERFACE.md) presents those relationships.

```text
GROUND → CHOOSE → FRAME → OWNER WAVE? → REALIZE → PROVE → OWNER WAVE → RECONCILE → ADVANCE
```

The loop handles Plan changes, Character changes, scene drafting, scene revision,
Story-model corrections and publication. The public `run` command stages candidate
files and resumes their persisted bundle. `decision answer` records the author's
answer to an exact request. RECONCILE writes accepted changes under
incumbent checks; a refusal preserves the existing authority. Human sources never
become subordinate to their machine interpretations.

Frontier, Owner Wave and matrices are derived on read. UNKNOWN remains distinct
from FALSE and cannot silently become a passing proof. Use
`narrative-craft eval proof families --move <kind>` to inspect current proof coverage.
Semantic judgment requires attributed reviewer evidence; a missing review remains
UNKNOWN. Acceptance and reconciliation verify the proof's current profile, exact
candidate and input bindings, evidence references and deterministic obligations.
See the [runbook](docs/runbook.md) for the complete review and resume sequence.
`eval plan` has no record writer and is not exposed as a stub command.

Semantic packets bind actual authorities, sources, acceptance records and evaluator
identity. Finding retrieval derives staleness and joins Owner Decisions by exact
references. Checks write no currentness cache. See [Semantic checking](docs/semantic-checking.md)
and [Evaluation infrastructure](docs/eval-infrastructure.md).

## Programmatic use

```python
from narrative_craft import api

manifest = api.project.get(workspace)
model = api.story.get_story_model_authority(workspace)
report = api.check.all(workspace)
```

[The typed API](docs/api.md) exposes the current domains without printing or exiting
the host process. Internal modules are not compatibility interfaces. External tools
integrate through public artifacts and the declared [first-party integrations](docs/integrations/);
there is no third-party code-loading extension system.

## Documentation

- [Installation](docs/installation.md)
- [Quick start](docs/quick-start.md)
- [Pipeline](docs/pipeline.md)
- [Narrative-loop runbook](docs/runbook.md)
- [Publication metadata](docs/publication.md)
- [Locales and bilingual workflows](docs/locale.md)
- [Native critique](docs/native-critique.md)
- [Author gates](docs/author-gates.md)
- [Failure modes](docs/failure-modes.md)
- [Falsification and rollback](docs/falsification-rollback.md)
- [State format](docs/state-format.md)
- [First-party integrations](docs/integrations/) (ADR-019: AO3 export, live bridge, remote execution, external-review interchange, vault knowledge/config)
- [Eval infrastructure](docs/eval-infrastructure.md) (evidence records, supported packet workflows and installed qualification)
- [Versioned schema index](docs/schema-index.md)
- [`narrative_craft.api` reference](docs/api.md)
- [Architecture decision records](docs/adr/README.md)
- [Release process](docs/release.md)
- [Changelog](https://github.com/clchinkc/narrative-craft/blob/main/CHANGELOG.md) — pre-1.0, see the loud breaking-change notice for 0.3.0

## Repository layout

```text
src/narrative_craft/       package and CLI
skills/narrative-craft/    installable agent skill
spec/                     narrative-system and locale specifications
schemas/                  public JSON Schema contracts
assets/                   rubrics and templates
docs/                     current guides and architecture decisions
examples/                 native workspace and artifact examples
tests/                    feature behavior and shared contract suites
```

## Development

```bash
uv sync
uv run pytest -q
uv run ruff check .
uv build
narrative-craft release-check --root . --allow-dirty
```

`release-check` is the repository-checkout release-readiness gate CI runs
before a tag: schema-index staleness, the import boundary, sanitized-fixture
scanning, declared-dependency coverage, and that README documents every
live top-level command. Drop `--allow-dirty` to also require a clean
working tree (what CI itself runs); `--write-schema-index` regenerates
[docs/schema-index.md](docs/schema-index.md) when a schema changed.

**The documentation check is one-directional.** It asserts every live
top-level command appears in README; it reads no other file, so nothing
asserts the reverse — that a *documented* command still exists. A passing
`release-check` is never proof the docs are current, only that README has
not fallen behind the live tree.

See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).

## License

MIT. See [LICENSE](LICENSE) and the dependency gate in [Release](docs/release.md).
