# HHY Language 1.7.1

This patch fixes Runtime resource ownership and introduces opt-in controlled concurrency scopes. Language 1.0 semantics remain frozen; Database stays independently versioned at 1.0.0.

## Fixes

- Keep long-lived Context environments rooted during GC, preventing invalid environment access across repeated host calls.
- Release closed Stream payload roots while preserving cleanup checkpoints.
- Give supervised task children their own memory-failure boundary and resource teardown; detect failed result writes.
- Use exclusive creation in the portable no-replace fallback and distinguish publication from incomplete source cleanup.

## Experimental APIs

Set `HHY_CONCURRENCY_EXPERIMENTS=1` to enable `atomic_state`, `atomic_read`, `atomic_update`, `atomic_close`, `atomic_file_update`, `transaction_strict` and `task_map`.

Strict callbacks enforce a closed effect allowlist and sticky rollback-only failures. AtomicState uses one Runtime/PID owner and immutable candidate publication. File updates use a cooperative sidecar lock. Strict database transactions bind all SQL to the current transaction and preserve unknown-commit outcomes. Bounded task scopes preserve result order and supervise direct children.

These APIs do not make arbitrary shared memory or external I/O globally atomic. They do not add coroutines, cross-Worker shared state, automatic transaction retries, or distributed transactions. See [the contract](https://github.com/hh696-wq/hhy-vm/blob/v1.7.1/docs/architecture/CONCURRENCY_SCOPES.md).

`HHY_BYTECODE_BINDING_CACHE` and `HHY_STREAM_SOURCE_FUSION` remain separate, off-by-default candidates. Current measurements do not justify default admission or general speedup claims.

## Validation and limits

Local release and ASan/UBSan suites passed, including 69 engine/configuration cases, owner/GC/quota checks, native and portable no-replace races, and 80 competing file updates. MySQL and PostgreSQL verified 32 requests against 8 durable idempotency keys and reconciled commits after dropped acknowledgements. A 120-second soak and 100,000-request Web test passed.

CI and release workflows run the target-platform matrix and real-database acceptance. A 24-hour soak, real power-loss testing and the complete fault matrix remain pending. Windows artifacts use MSYS2 and do not include the Database extension. This release bundles implemented follow-up stages; it does not claim every proposed 1.7.x optimization is admitted.
