Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.1.0-beta.2

- Compare the crate and an in-tree helper on eight edit scenarios, including Cancel, Undo and changes to the target or revision. Run `cargo test --locked --example helper_comparison` for the executable checks.
- Document dependency source choices for hosts with an approval policy. The host maintainers choose their source.

## 0.1.0-beta.1

Published on 1 November 2026 (Europe/Kyiv) to [crates.io](https://crates.io/crates/edit-session/0.1.0-beta.1)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "edit-session"
version = "0.1.0-beta.1"
version = "0.1.0-beta.2"
edition = "2024"
rust-version = "1.88"
description = "Toolkit-independent preview, validation and commit lifecycle"
Expand All @@ -16,6 +16,10 @@ include = ["src/**", "tests/**", "examples/**", "docs/**", "tools/context_eviden
name = "retry_command"
test = true

[[example]]
name = "helper_comparison"
test = true

[lints.rust]
unsafe_code = "forbid"

Expand Down
6 changes: 2 additions & 4 deletions PACKAGE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# edit-session

**Published beta:** `0.1.0-beta.1` is available on
[crates.io](https://crates.io/crates/edit-session/0.1.0-beta.1), verified 1 November 2026
(Europe/Kyiv). Read the [compatibility boundary](https://github.com/PerchAnton/edit-session/blob/main/docs/COMPATIBILITY.md) before upgrading.
Beta **0.1.0-beta.2** includes the runnable local-helper comparison and the dependency source guide. Read the [compatibility boundary](https://github.com/PerchAnton/edit-session/blob/main/docs/COMPATIBILITY.md) before upgrading.

A small, toolkit-independent Rust library for preview, validation and commit
lifecycles. **`no_std`, zero runtime dependencies, Rust 1.88+.** MIT OR Apache-2.0.
Expand All @@ -17,7 +15,7 @@ Add a published copy of this prerelease to your dependencies:

```toml
[dependencies]
edit-session = "=0.1.0-beta.1"
edit-session = "=0.1.0-beta.2"
```

This is an experimental beta. Pin an exact version and keep `Cargo.lock` for
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# edit-session

**Published beta:** `0.1.0-beta.1` is available on
[crates.io](https://crates.io/crates/edit-session/0.1.0-beta.1), verified 1 November 2026
(Europe/Kyiv). Read the [compatibility boundary](https://github.com/PerchAnton/edit-session/blob/main/docs/COMPATIBILITY.md) before upgrading.
Beta **0.1.0-beta.2** includes the runnable local-helper comparison and the dependency source guide. Read the [compatibility boundary](https://github.com/PerchAnton/edit-session/blob/main/docs/COMPATIBILITY.md) before upgrading.

Keep an editable draft separate from live data, then check that its document, target
and revision are still current before the host applies a change. A standalone Rust
Expand Down Expand Up @@ -54,9 +52,9 @@ development tool is optional. Neither project depends on the other.

## Current prerelease

**[0.1.0-beta.1 on crates.io](https://crates.io/crates/edit-session/0.1.0-beta.1) · published 1 November 2026 (Europe/Kyiv) · Rust 1.88+**
**[0.1.0-beta.2 on crates.io](https://crates.io/crates/edit-session/0.1.0-beta.2) · Rust 1.88+**

**[GitHub prerelease and checksums](https://github.com/PerchAnton/edit-session/releases/tag/v0.1.0-beta.1)** · **[API documentation](https://docs.rs/edit-session/0.1.0-beta.1/edit_session/)** · [Download the crate](https://crates.io/api/v1/crates/edit-session/0.1.0-beta.1/download) · [SHA-256 and installation evidence](docs/evidence/release-beta1.json) · [Changelog](CHANGELOG.md) · [Use as a dependency](#use-from-another-project)
**[GitHub prerelease and checksums](https://github.com/PerchAnton/edit-session/releases/tag/v0.1.0-beta.2)** · **[API documentation](https://docs.rs/edit-session/0.1.0-beta.2/edit_session/)** · [Download the crate](https://crates.io/api/v1/crates/edit-session/0.1.0-beta.2/download) · [Beta.1 installation evidence](docs/evidence/release-beta1.json) · [Changelog](CHANGELOG.md) · [Use as a dependency](#use-from-another-project)

<details>
<summary>Historical alpha.5 package snapshot and verification</summary>
Expand Down Expand Up @@ -92,7 +90,7 @@ correction, Cancel, preserved Redo and duplicate confirmation.
From a checkout of this release:

```sh
git clone --branch v0.1.0-beta.1 --depth 1 https://github.com/PerchAnton/edit-session.git
git clone --branch v0.1.0-beta.2 --depth 1 https://github.com/PerchAnton/edit-session.git
cd edit-session
cargo run --locked --example retry_command
cargo test --locked --example retry_command
Expand Down Expand Up @@ -123,7 +121,7 @@ dated measurements. Each figure has a source and a defined scope.
| Proposal/check loop | **999 pairs; 0 additional clones** | [Instrumented test](tests/lifecycle.rs); one clone at construction, one more on Reset; caller work excluded |
| Integration cost | **+217 production UI lines** | [267 added / 50 removed](docs/ADOPTION.md#count-the-cost-as-well); no total-code or speed improvement is claimed |

**Experimental beta, 0.1.0-beta.1.** Maintained by [PerchAnton](https://github.com/PerchAnton).
**Experimental beta, 0.1.0-beta.2.** Maintained by [PerchAnton](https://github.com/PerchAnton).
Available on crates.io and as a Git dependency. PhotoCraft and PdfCraft
integrations are proposed and await upstream approval.

Expand Down Expand Up @@ -175,11 +173,11 @@ sequence and shared report help your consumer. The [API contracts](src/lib.rs) a
Add this exact prerelease to your crate's `[dependencies]`:

```toml
edit-session = "=0.1.0-beta.1"
edit-session = "=0.1.0-beta.2"
```

Commit the resulting `Cargo.lock`. For a Git dependency, the same release is pinned
at revision `e3da338fdfa15190f98111cb57f9b3f25c1c2f2f`.
Commit the resulting `Cargo.lock`. For a Git dependency, resolve the release tag
`v0.1.0-beta.2` to its full commit SHA and pin that revision.
The companion
[interaction-check](https://github.com/PerchAnton/interaction-check) project replays semantic
scenarios against adapters using this library.
Expand Down
7 changes: 7 additions & 0 deletions docs/ADOPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,10 @@ had to write and the production lines added or removed. Count tests separately.
If both versions pass and the second dialog reuses as much with the local
helper, keep the helper. A useful trial result is the pair of diffs and tests,
including the cases where the crate added work.

## Source policy comes before a dependency trial

See [dependency-source options and the executable local-helper comparison](source-policy.md).
The same eight lifecycle scenarios run against both implementations, including Cancel,
a changed object and edit/Undo with the original value. No library advantage or host
approval follows from equivalent results.
2 changes: 1 addition & 1 deletion docs/COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ lock. An `Rc<RefCell<_>>` clone is not an independent snapshot.

## Upgrading and evidence

Pin the exact prerelease (`=0.1.0-beta.1`). Re-run the host's native
Pin the exact prerelease (`=0.1.0-beta.2`). Re-run the host's native
regressions before changing the pin. The beta adds no fields to stored documents:
sessions are in-memory state, not a serialization format. Error variants are for
branching; Display/Debug prose and memory layout are not a machine protocol.
Expand Down
64 changes: 64 additions & 0 deletions docs/source-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Dependency sources and a local-helper alternative

Correctness and source approval are separate gates. A commit pin fixes content;
it does not show that the receiving organisation reviewed or accepted that source.

## PhotoCraft proposal: current obstacle

At integration head [`df2b3a7`](https://github.com/PerchAnton/photocraft/commit/df2b3a722660d72634fb445ef860b0aca0d4d58b),
[PhotoCraft #9190](https://github.com/storytold/photocraft/pull/9190) still pins
edit-session alpha.1 to an external Git source. The exception has been removed,
but the unchanged **Git dependencies come from storytold** gate rejects that source.
The old standalone interaction workflow is also absent from this head. A previous
successful CI run does not establish that the current dependency is acceptable.

The [maintainer review](https://github.com/storytold/photocraft/pull/9190#pullrequestreview-5727709694)
requests an organisation-owned source or an explicitly reviewed vendor patch with
provenance. No such source decision has been granted. Do not change the source gate,
hide a dependency with Cargo configuration, or switch to crates.io merely because
the Git-only check would stop detecting it.

| Option | Concrete preparation | Remaining decision / cost |
| --- | --- | --- |
| Organisation-owned component | Propose the existing small lifecycle to an approved repository; pin the revision after review | Maintainers choose ownership, location and maintenance responsibility; no URL or approval is assumed |
| Reviewed vendor patch | Keep source, licence, exact upstream revision and a numbered patch with a `vendor/README.md` entry | Maintainers must approve the vendor layout and update process; passing a gate alone is insufficient |
| Application-local helper | Use the native lifecycle demonstrated below; remove the library entries from workspace/UI manifests and regenerate the lockfile | No external source for this lifecycle, but the host owns its tests, updates and command integration |

The local helper is the immediate dependency-free comparison option. These are
preparation options, not an approved change to PhotoCraft. Full host tests, layers,
wasm and unchanged source checks must run on the actual chosen application patch.
The separate interaction-check runner remains a separate CI-policy decision.

## Reproduce the local-helper comparison

```sh
cargo test --locked --example helper_comparison
cargo run --locked --example helper_comparison
```

[The example](../examples/helper_comparison.rs) exercises both a small in-tree helper
and the existing EditSession API through the same synchronous host. It reuses the
Cancel and context/revision cases; it adds no library API or runtime dependency.

| Scenario | Required for both implementations |
| --- | --- |
| Cancel after another edit | Preserve the host value and all history counters |
| Same value, different object | Reject the old context; perform no command |
| Same value, different document | Reject the old context; perform no command |
| Edit then Undo to original value | Reject the changed revision; retain Redo |
| Changed value without revision | Reject the changed live value |
| Invalid input after a valid preview | Prevent committing the previous preview |
| Confirm unchanged draft | Preserve Redo and avoid an empty command |
| Confirm valid changed draft | Dispatch exactly one host update |

Eight tests execute both implementations: sixteen scenario/implementation checks.
This is a teaching model, not a rerun of PhotoCraft's UI integration. Host identity,
monotonic revision, permissions, parsing, dialog lifetime and serialized command
execution remain necessary in either option. The helper intentionally implements
only this example's lifecycle; it is not a replacement for every library method.

Equivalent results establish no code-size or performance advantage for the crate.
If a small local helper meets the host's needs and source policy, retaining it is a
valid outcome. Consider the library only if reuse across real dialogs offsets its
approval and maintenance cost. The existing [Cancel/retry example](../examples/retry_command.rs)
and [Undo/context walkthrough](../examples/context_walkthrough.rs) remain available.
Loading