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
28 changes: 28 additions & 0 deletions .github/DISCUSSION_TEMPLATE/ideas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
title: "[Idea] "
labels: ["idea"]
body:
- type: markdown
attributes:
value: |
Ideas for new packing rules, outputs or integrations. An idea the maintainers take on
is moved to an issue and linked back here, so you can follow it.
- type: textarea
id: problem
attributes:
label: The problem behind the idea
description: What real shipment or load does today's library not handle?
validations:
required: true
- type: textarea
id: idea
attributes:
label: The idea
validations:
required: true
- type: input
id: package
attributes:
label: Package(s) you use
placeholder: "packvium"
validations:
required: false
30 changes: 30 additions & 0 deletions .github/DISCUSSION_TEMPLATE/q-a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
title: "[Q&A] "
labels: ["question"]
body:
- type: markdown
attributes:
value: |
Ask anything about using the library. If you have found a wrong result or an error,
a bug report is the better place.
- type: input
id: package-version
attributes:
label: Package and version
placeholder: "packvium 1.8.0 (Rust)"
validations:
required: true
- type: textarea
id: question
attributes:
label: Your question
description: What you are trying to pack, and what you tried.
validations:
required: true
- type: textarea
id: request
attributes:
label: Request (optional)
description: The JSON request or code, if it helps.
render: json
validations:
required: false
33 changes: 33 additions & 0 deletions .github/DISCUSSION_TEMPLATE/show-and-tell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
title: "[Show and tell] "
labels: ["show-and-tell"]
body:
- type: markdown
attributes:
value: |
Using the library in a shop, a warehouse tool or a load planner? Tell us how. Leave out
anything confidential about your business.
- type: textarea
id: what
attributes:
label: What you built
validations:
required: true
- type: input
id: package-version
attributes:
label: Package and version
placeholder: "packvium 1.8.0 (Rust)"
validations:
required: false
- type: textarea
id: lessons
attributes:
label: What worked, and what got in the way
validations:
required: false
- type: input
id: link
attributes:
label: Link (optional)
validations:
required: false
105 changes: 105 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Bug report
description: A result that is wrong, an error you did not expect, or a crash.
title: "[Bug]: "
labels: ["bug", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Thanks for reporting. A report we can run is a report we can fix, so the most useful
thing below is the smallest request that shows the problem.

**Security problems do not belong here.** Use **Report a vulnerability** under the
Security tab instead; it opens a private advisory.
- type: dropdown
id: package
attributes:
label: Package
description: Which package did you call?
options:
- "packvium (PyPI) — Packvium for Python"
- "packvium-native (PyPI) — Packvium native backend selector for Python"
- "packvium/packvium (Packagist) — Packvium for PHP"
- "packvium/native-bridge (Packagist) — Packvium native bridge for PHP"
- "@packvium/engine (npm) — Packvium for Node.js"
- "@packvium/browser (npm) — Packvium for browsers"
- "packvium (crates.io) — Packvium for Rust"
- "packvium-native-rust (PyPI) — Packvium native engines: Python wheels, Node addons and the C library"
- Not sure
default: 6
validations:
required: true
- type: input
id: version
attributes:
label: Package version
description: The exact version installed, for example 1.8.0.
placeholder: "1.8.0"
validations:
required: true
- type: input
id: runtime
attributes:
label: Runtime and operating system
description: Language runtime version and OS, for example "Python 3.12, Ubuntu 24.04" or "PHP 8.3, macOS 15".
validations:
required: true
- type: dropdown
id: profile
attributes:
label: Search profile
options:
- fast
- balanced
- quality
- exact_small
- Not set / default
- Not sure
validations:
required: false
- type: textarea
id: request
attributes:
label: Request that reproduces it
description: |
The JSON request, or the code that builds it, cut down as far as it still shows the
problem. Remove anything confidential; renamed item ids are fine.
render: json
validations:
required: true
- type: textarea
id: actual
attributes:
label: What happened
description: The result (or its relevant part), or the full error message and stack trace.
render: text
validations:
required: true
- type: textarea
id: expected
attributes:
label: What you expected
description: What the result should have been, and why. If another of the packages gives a different answer for the same request, say which.
validations:
required: true
- type: dropdown
id: stopped-by
attributes:
label: How was the search limited?
description: A search stopped by a time limit can differ between runs by design; one stopped by an effort budget cannot.
options:
- effort_budget
- time_limit_ms
- Both
- Neither / not sure
validations:
required: false
- type: checkboxes
id: checks
attributes:
label: Before submitting
options:
- label: I searched the existing issues and did not find this one.
required: true
- label: I read [docs/GUARANTEES.md](https://github.com/toxakara/packvium-rust/blob/HEAD/docs/GUARANTEES.md) and this is not something it says the library does not guarantee.
required: false
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Question or help with a request
url: https://github.com/toxakara/packvium-rust/discussions/categories/q-a
about: Ask in Discussions → Q&A. Answers there help the next person too.
- name: Report a security vulnerability
url: https://github.com/toxakara/packvium-rust/security/advisories/new
about: Report privately. Do not open a public issue for a security problem.
- name: Documentation
url: https://packvium.com/docs
about: Guides, the request contract and the constraint reference.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Feature request
description: A packing rule, constraint, output or integration the library does not support yet.
title: "[Feature]: "
labels: ["enhancement", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Open-ended ideas are welcome in **Discussions → Ideas** first. Use this form when you can
describe a concrete problem the library does not solve today.
- type: dropdown
id: package
attributes:
label: Package you use
options:
- "packvium (PyPI) — Packvium for Python"
- "packvium-native (PyPI) — Packvium native backend selector for Python"
- "packvium/packvium (Packagist) — Packvium for PHP"
- "packvium/native-bridge (Packagist) — Packvium native bridge for PHP"
- "@packvium/engine (npm) — Packvium for Node.js"
- "@packvium/browser (npm) — Packvium for browsers"
- "packvium (crates.io) — Packvium for Rust"
- "packvium-native-rust (PyPI) — Packvium native engines: Python wheels, Node addons and the C library"
- More than one
default: 6
validations:
required: true
- type: input
id: version
attributes:
label: Package version
placeholder: "1.8.0"
validations:
required: true
- type: textarea
id: problem
attributes:
label: The problem
description: What are you packing, into what, and what rule or output is missing? A real (anonymised) example helps more than a general description.
validations:
required: true
- type: textarea
id: proposal
attributes:
label: What you would like
description: The behaviour or field you have in mind, if you have one.
validations:
required: false
- type: textarea
id: workaround
attributes:
label: What you do today
description: Any workaround you use, and what it costs you.
validations:
required: false
- type: markdown
attributes:
value: |
Every package implements one shared contract, so a new rule or result field lands in all
of them together, and a change to the request or result format waits for a release that
is allowed to change it. A request that is accepted may therefore take more than one
release to ship.
60 changes: 60 additions & 0 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: rc

# A pre-release tag (`v1.9.0-rc.1`) builds and tests exactly as `release.yml` does and then
# runs `cargo publish --dry-run`. Nothing is uploaded: crates.io has no test registry, and a
# version published there "can never be overwritten, and the code cannot be deleted". A
# consumer tries the RC as a git dependency on the tag:
# packvium = { git = "https://github.com/toxakara/packvium-rust", tag = "v<version>" }
# Publishing real `-rc` versions to crates.io would be the owner's decision; it needs no new
# account, but every one stays on the crate page for good. There is no GitHub Release.

on:
push:
tags: ["v*-*"]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@46511b1c83438f0dd37c02d843619ece5a4abb5b # 1.97.1
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

# The tag and the packaged version must agree. Without this, `git tag v0.2.0` on a
# tree that still says 0.1.0 publishes 0.1.0 under a name that claims otherwise,
# and the mistake is only visible after it is public and immutable.
- name: The tag must match the version in Cargo.toml
run: |
tagged="${GITHUB_REF_NAME#v}"
built=$(grep -m1 '^version = ' Cargo.toml | sed -E 's/version = "(.*)"/\1/')
if [ "$tagged" != "$built" ]; then
echo "tag $GITHUB_REF_NAME does not match Cargo.toml version $built" >&2
exit 1
fi

- name: The tag must have a changelog entry
run: |
tagged="${GITHUB_REF_NAME#v}"
if ! grep -q "^## \[${tagged}\]" CHANGELOG.md; then
echo "CHANGELOG.md has no '## [${tagged}]' section for tag $GITHUB_REF_NAME" >&2
exit 1
fi

- run: cargo test
- run: cargo package --locked

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: crate
path: target/package/*.crate

publish-dry-run:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@46511b1c83438f0dd37c02d843619ece5a4abb5b # 1.97.1
- run: cargo publish --dry-run --locked
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ name: release
# as CARGO_REGISTRY_TOKEN in a GitHub environment named `crates-io` with whatever
# reviewers the project wants.

# A pre-release tag (`v1.9.0-rc.1`) never reaches the production registries: the negated
# pattern must follow the positive one, and `rc.yml` takes those tags instead.
on:
push:
tags: ["v*"]
tags: ["v*", "!v*-*"]

permissions:
contents: read
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,40 @@ What changed in `packvium` on crates.io, release by release. The format follows
[Keep a Changelog](https://keepachangelog.com/1.1.0/) and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.0]

Results now say how far they can be from the best possible answer, `Optimal` means a proof,
and a mistyped flag is refused instead of defaulted.

### Added

- **`optimality.lower_bound` and the gap** under the `default` and `lowest_cost` objectives,
with `bounds::for_request`, `from_items`, `statement` and `Statement`; `validate_json`
checks them.

### Changed

- **Only attaining the bound sets `Optimal`;** a registry solver's `Optimal` is demoted to
`Feasible` first.
- **An effort budget names a stop:** a run that ends on exactly its budget is `complete`.
- **A non-boolean `keep_upright`, `stackable`, `must_be_on_floor` or
`require_placement_coordinates` is `invalid_request` / `wrong_type`**; it was read as the
field's default.
`validate_json` returns `MalformedResult` (`contract`) for such a request, and reads `null` as
the default.
- **Faster with identical answers:** loading-order checks about 3x, `exact_small` about 2x on
larger requests (the preflight answer is reused instead of solved twice), axle-limited solves
up to 25%, `rebalance_weight` about 18%.

### Fixed

- **`homogeneous_blocks` named alone packs under `fast` and `balanced`**; it stopped before
its first block and placed nothing.
- **`validate` reads `units: null` and `units.length: null` as millimetres**, as the engines do,
and refuses a `units` that is not an object, or an unknown `units.length`, as a `contract`
`MalformedResult` naming the field. `units.weight` is not a field and is ignored: put the unit
on each weight.

## [1.7.0]

The reference validator ships in the crate, `quality` looks ahead in its block solver and
Expand Down
Loading
Loading