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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ jobs:
- run: cargo +${{ matrix.rust }} clippy --locked --all-targets -- -D warnings
- run: cargo +${{ matrix.rust }} publish --dry-run --locked --registry crates-io
- run: cargo +${{ matrix.rust }} package --locked
- name: Test the extracted crate contract
run: |
crate_version=$(python3 -c "import tomllib; print(tomllib.load(open('Cargo.toml', 'rb'))['package']['version'])")
cargo +${{ matrix.rust }} test --locked --manifest-path "target/package/edit-session-$crate_version/Cargo.toml"
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.0.0 — unreleased

- Commit to the documented API, supported platforms and compatible upgrades throughout 1.x.
- Preserve runtime behavior from 0.1.0 and check existing consumers before publication.
- Correct release instructions to require a new matching tag; retain older artifacts.

## 0.1.0

- First non-prerelease, with an explicit 0.1.x patch compatibility and best-effort
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.

2 changes: 1 addition & 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"
version = "1.0.0"
edition = "2024"
rust-version = "1.88"
description = "Toolkit-independent preview, validation and commit lifecycle"
Expand Down
8 changes: 5 additions & 3 deletions PACKAGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# edit-session

Version **0.1.0** preserves 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.
This page documents **1.0.0**. Check the [release status](https://github.com/PerchAnton/edit-session/releases/tag/v1.0.0) for registry availability.

Version **1.0.0** preserves 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 @@ -15,10 +17,10 @@ Add the release to your dependencies:

```toml
[dependencies]
edit-session = "=0.1.0"
edit-session = "=1.0.0"
```

The 0.1.x patch line preserves the documented API. Pin an exact version and keep `Cargo.lock` for
The 1.x line preserves the documented API. Pin an exact version and keep `Cargo.lock` for
applications. Read the
[compatibility policy](https://github.com/PerchAnton/edit-session/blob/main/docs/COMPATIBILITY.md)
before upgrading. For other distribution options and current publication status,
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# edit-session

**1.0.0 is being prepared and is not published yet.** Install 0.1.0 until the
[release checklist](https://github.com/PerchAnton/edit-session/blob/main/docs/RELEASE-1.0.md)
is complete. The candidate preserves behavior and defines the 1.x compatibility commitment.

Version **0.1.0** preserves 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
Expand Down Expand Up @@ -77,7 +81,7 @@ remains available.
</details>

Trying the library? [Report a bug](https://github.com/PerchAnton/edit-session/issues/new?template=bug_report.yml)
with your revision and a short sequence of calls, or read the [0.1.x compatibility policy](docs/COMPATIBILITY.md).
with your revision and a short sequence of calls, or read the [1.x candidate compatibility policy](docs/COMPATIBILITY.md).

## Retry after a rejected command

Expand Down
42 changes: 28 additions & 14 deletions docs/COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Compatibility for 0.1.x
# Compatibility for 1.x

## Maintenance and versioning

This is the first non-prerelease **0.1.0**. Patch releases in 0.1.x preserve the
supported interface below, defaults, error behavior and minimum platform version.
Incompatible changes require a new minor (0.2.0 or later), migration notes and
regression tests; they must not be hidden in a patch. A future 1.0 additionally
requires a separate long-term compatibility review. Internal implementation details
and the exclusions below are not added to the supported API.
This is the compatibility contract for **1.0.0 and the 1.x series**.
The earlier 0.1.0 contract remains available on the v0.1.0 tag.
Version 1.0 introduces a compatibility commitment, without changing runtime behavior.

Maintenance is best effort by PerchAnton. Fixes target the latest 0.1.x patch;
older patches and prereleases are not separate support branches. There is no SLA,
fixed maintenance end date, independent security audit or guaranteed response time.
Document deprecations and alternatives before removal. Report reproducible defects
Follow [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html): patches fix
bugs while preserving the documented contract; minor releases add compatible
features or deprecations; incompatible changes require a new major and migration
notes. Deprecations document a replacement and remain available throughout 1.x.
Changes to defaults, error semantics, minimum platforms or existing input limits
are breaking when they invalidate supported consumers. Internal details and the
exclusions below are outside this contract. A bug fix restores documented behavior;
it must include a reproducer and describe any changed result.

Maintenance by PerchAnton is best effort, targeting the latest 1.x release once
published. Older releases remain downloadable, not separate maintenance branches.
There is no SLA, fixed support term or independent security audit. Report defects
with exact versions and synthetic inputs, without secrets or personal documents.
Application owners remain responsible for native regression tests and rollout.

Expand All @@ -39,8 +44,8 @@ lock. An `Rc<RefCell<_>>` clone is not an independent snapshot.

## Upgrading and evidence

Pin the exact release (`=0.1.0`). Re-run the host's native
regressions before changing the pin. The upgrade from beta.2 adds no fields to stored documents:
After publication, upgrade the dependency to `=1.0.0` (or `1` for compatible updates). Re-run the host's native
regressions before changing the pin. The upgrade from 0.1.0 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 All @@ -50,7 +55,7 @@ examples remain required. Packaging runs those checks from the extracted crate o
the MSRV as well as testing the checkout. These are compatibility checks, not a
claim that an external dependency is better than a correct local helper.

The runtime is unchanged from 0.1.0-beta.2. Existing callers need only change
The runtime is unchanged from 0.1.0. Existing callers need only change
the dependency pin and run their native checks; there is no stored-data migration.
Never replace a published version.

Expand All @@ -63,3 +68,12 @@ the feature is useful, which source/owner to accept and how updates are maintain
Keep their source gate intact while that decision is pending; a pin, green CI or
release version does not mean a dependency was reviewed or approved. Running the
separate interaction-check tool in CI needs its own permission/workflow decision.

## Public type evolution

`FinishError` has three exhaustively matchable variants. Adding a variant, adding
fields to `Change<T>` (which supports struct literals), adding required trait
bounds, or losing existing trait implementations requires a major release.
Rust 1.88 and `no_std` remain supported throughout 1.x. New optional methods may
be minor additions only when existing source still compiles. Memory layout and
Debug/Display wording remain outside the contract.
37 changes: 37 additions & 0 deletions docs/RELEASE-1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 1.0.0 preparation

**Unreleased candidate.** The registry release remains 0.1.0. This change defines
the [1.x commitment](COMPATIBILITY.md), rather than adding another editing abstraction.
`src/lib.rs` is unchanged from 0.1.0; Rust 1.88, no_std and zero dependencies remain.

## Upgrade

After publication, change the dependency pin to `=1.0.0`, retain the lockfile and
run the host's Cancel, Reset, stale target/revision, no-op and rejected-command
regressions. No stored-data migration is needed. A host's source approval policy
still applies to a registry package, organisation-owned source or vendored copy.
See [the source choices and local-helper comparison](source-policy.md).

## Release gates

- [ ] Review the 1.x contract and candidate diff; confirm no runtime changes.
- [ ] Pass MSRV and stable CI, formatting, Clippy, lifecycle/consumer/example tests.
- [ ] Run the same consumer contract against the published 0.1.0 and extracted
1.0.0 crate. Preserve exhaustive error matching and minimal trait bounds.
- [ ] Review the archive inventory, licenses and exact hash, including packaged tests.
- [ ] Review and merge the candidate; require successful CI on main.
- [ ] Obtain release authorization, create a new v1.0.0 tag, then use the existing
crates-io workflow and environment approval. Never reuse v0.1.0.
- [ ] Compare registry archive bytes/hash; run a clean registry consumer before
marking README, release notes or installation instructions as published.

Local results and PR CI are preparation evidence, not proof of publication.
Do not imply that PhotoCraft uses a crates.io dependency: its accepted integration
uses an internal source module. Existing integrations are not upgraded by this release.

## Announcement draft (only after publication)

edit-session 1.0 defines a compatible Rust API for draft validation and one-time
commit decisions. An executable Undo/Reset example shows why restoring a value
does not make an old draft current. The host still owns revisions, commands and
history. Compare the crate with a correct local helper before adding a dependency.
27 changes: 16 additions & 11 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Releases and compatibility

## Next candidate: 1.0.0 (not published)

Follow [the 1.0 checklist](RELEASE-1.0.md). Use a **new** tag matching the reviewed
package version; never reuse v0.1.0. Preparation and CI do not publish a package.


## Current non-prerelease 0.1.0

Published on 7 November 2026 through Trusted Publishing. The exact crate from
Expand All @@ -8,14 +14,13 @@ crates.io matches the hosted artifact and passed a clean Rust 1.88 consumer.

For later releases, require the reviewed
commit to pass the full CI matrix, merge it into main and wait for main CI.
Then create the matching v0.1.0 tag and use the existing Trusted Publishing
Then create a new matching version tag and use the existing Trusted Publishing
workflow with publish=true. Keep environment approval and archive checks intact.
Do not mark the release published until registry hashes and a clean installation
are verified. Publish the GitHub release with prerelease=false and attach the
exact registry artifacts and checksums. Earlier prereleases stay unchanged.

The [0.1.x contract](COMPATIBILITY.md) defines patch compatibility and support;
this release does not claim the separate future 1.0 commitment.
The [published 0.1.x contract](https://github.com/PerchAnton/edit-session/blob/v0.1.0/docs/COMPATIBILITY.md) remains historical. The [candidate 1.x contract](COMPATIBILITY.md) awaits publication.

## Previous beta 0.1.0-beta.2

Expand Down Expand Up @@ -43,7 +48,7 @@ A fresh consumer checked commit, no-op, Undo freshness and Reset. Both packaged
and the generated context diagram pass. [Evidence](evidence/release-alpha5.json).
Earlier alpha.4 registry files and alpha.3 GitHub assets remain unchanged.

## Alpha compatibility
## Historical alpha compatibility

- Alpha releases are experimental. Public types, methods, trait bounds and behavior
may change between releases, even within `0.1.0`. Alpha.3 matching alpha.2 does not
Expand Down Expand Up @@ -84,10 +89,10 @@ checks the source and example on Rust 1.88 and stable. To validate packaged test
unpack the new `target/package/edit-session-<version>.crate` into a temporary directory
and run `cargo test --locked` and the example from that directory.

A GitHub prerelease can attach the checked `.crate` archive and SHA-256 checksum to
an exact green commit. It is a source archive, not a globally installed executable.
Consumers can continue using a fixed Git revision while the API is experimental.
Do not present an alpha release as the latest stable release.
Attach the checked `.crate` archive and SHA-256 checksum to a release on the
exact green commit. Set `prerelease=false` for 1.0.0; use a prerelease only for
versions labelled alpha, beta or rc. The crate is a source archive, not a globally
installed executable. Preserve the existing releases and their assets.

## Registry publication

Expand Down Expand Up @@ -160,15 +165,15 @@ the workflow to re-upload alpha.4 after its manual first publication.

### Verify installation after publication

Use a fresh consumer project and the exact prerelease dependency:
Use a fresh consumer project and the exact newly published dependency:

```toml
[dependencies]
edit-session = "=0.1.0-beta.1"
edit-session = "=<approved-version>"
```

Run `cargo check`, confirm `Cargo.lock` names the crates.io source (not a path/Git
override), and check the [API documentation](https://docs.rs/edit-session/0.1.0-beta.1/).
override), and check the [API documentation](https://docs.rs/edit-session/).
Only then mark the README/changelog as published. Never
overwrite a published version; fixes require a new version.

Expand Down
35 changes: 35 additions & 0 deletions tests/consumer_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,38 @@ fn simultaneous_conflicts_have_a_defined_priority() {
Err(FinishError::ContextChanged)
);
}

// Downstream code can exhaustively branch on all errors and destructure changes.
// These are source-compatibility promises, not an invitation to add variants in 1.x.
#[test]
fn exhaustive_error_handling_and_change_literals_remain_supported() {
fn reason(error: FinishError) -> u8 {
match error {
FinishError::InvalidProposal => 1,
FinishError::ContextChanged => 2,
FinishError::ValueChanged => 3,
}
}
assert_eq!(reason(FinishError::InvalidProposal), 1);
assert_eq!(reason(FinishError::ContextChanged), 2);
assert_eq!(reason(FinishError::ValueChanged), 3);
let Change { before, after } = Change {
before: 3,
after: 4,
};
assert_eq!((before, after), (3, 4));
}

#[test]
fn reset_does_not_require_context_traits_or_value_equality() {
#[derive(Clone)]
struct Value(u8);
struct Context;
let mut draft = EditSession::new(Value(3), Context);
assert_eq!(draft.propose::<()>(Ok(Value(4))), Ok(()));
assert_eq!(draft.propose::<()>(Err(())), Err(()));
draft.reset();
assert_eq!(draft.preview().0, 3);
assert!(draft.is_valid());
draft.cancel();
}