Generation deadlines¶
Status: implemented on the v0.17 development branch. Release acceptance is still pending; this page does not announce a published version.
Omit --dry-run to publish the generated lock. Without --timeout, generation
keeps its existing execution and output path.
What the deadline covers¶
The budget starts before source capture, after argument parsing and repository discovery. It includes controller preparation, worker startup, validation, fingerprinting, serialization and result transfer. Expiry exits with code 2 without admitting the result to controller-managed publication.
Git preparation uses the remaining operation budget rather than restarting a fresh command allowance for every Git call. Other controller-side parsing and serialization remain bounded operations, not asynchronously interruptible Python code: expiry is checked before their results can be used or published.
This is not a hard command-wall-time limit. Atomic commit, stalled filesystem operations and final stdout/error rendering can take longer. A blocked consumer cannot keep a supervised worker computing through the diagnostic-output path. Worker cleanup has a separate five-second polling budget; diagnostic delivery has a separate one-second drain allowance.
Sources and computation¶
HEAD and index requests carry the controller's captured snapshot. The worker does not resolve those moving refs again. Object IDs, file modes, tracked paths and sparse-checkout membership survive the handoff. Working-tree inputs remain live, with tracking captured by the existing accessors; this is not an immutable filesystem snapshot or a promise of unchanged index membership across passes.
The controller validates declarations without importing custom providers. The
worker performs full runtime validation and computation. Scoped generation
still checks unselected-component integrity. --allow-partial retains its
existing meaning. No files are staged to construct worker inputs.
Only the controller's publication step chooses and writes the destination. The worker protocol has no output-destination field. Workers start from the controller's own installed package or archive, not cwd or PYTHONPATH. Runtime version mismatches fail closed and identify both versions.
Processes and trust¶
Windows creates the worker inside a non-inheritable, kill-on-close Job Object without breakaway permissions. Cleanup confirms both job membership is empty and the worker process has signalled exit. Microsoft documents job ownership and creation-time assignment.
POSIX creates an owned session/process group before worker execution. A
parent-lifetime pipe starts a watchdog before Boundver imports; EOF after
controller death stops that group. Python documents the ordering of
start_new_session.
Neither path is a security sandbox. Custom providers remain explicitly trusted Python with the same user's filesystem and network capabilities. Their side effects cannot be rolled back. Deliberately detached POSIX children are outside the owned group. A native extension monopolizing the worker's interpreter can delay its Python parent-death watchdog; the live controller can still signal the group independently. Timed custom-provider use prints a warning.
Publication outcomes¶
Cancellation and commit admission share one guarded state transition. A late successful worker cannot reopen an expired or cancelled operation. After admission, the existing hardened atomic writer completes its transaction; asynchronous timeout does not tear apart a replacement or its recovery steps.
| Outcome | Controller-managed destination guarantee |
|---|---|
| Cancelled or expired before admission | This operation did not replace the destination. |
| Commit confirmed | Generated bytes were published; another writer can change them later. |
| Commit interrupted or outcome uncertain | Inspect the destination before retrying. |
Never restore old bytes blindly after commit: that could overwrite another
session's work. The diagnostic publication values are not-attempted,
dry-run, written and attempted-outcome-unconfirmed.
Transfer and diagnostic bounds¶
Requests use strict JSON and a 64 MiB transfer ceiling. Results use a bounded length-prefixed JSON header (1 KiB) followed by the existing bounded lock JSON. Decoding checks exact length, request identity, payload checksum and current lock structure. These checks are not authentication against trusted native code. Config, lock, tree and path budgets remain separately enforced; escaped snapshot metadata may hit the transfer limit first.
Private transfer files use fixed names and exclusive 0600 creation outside the checkout. They are flushed and closed, not disk-synced deployment evidence. The atomic lock writer's durability steps are unchanged. Failed or uncertain cleanup retains private transfer storage rather than deleting files still in use. Abrupt controller death can also leave bounded private storage for manual cleanup; it cannot grant the worker publication authority.
Worker progress/timing is bounded, escaped again by the controller, and prefixed
Worker: on stderr. Component counts belong to worker computation; controller
phase counts are separate, not additive. Malformed or rewritten diagnostic logs
are omitted, never treated as result instructions.
Timed stderr retains at most 128 queued records and accepts at most 64 KiB, including 2 KiB reserved for one terminal outcome and 512 bytes for a truncation notice. The terminal outcome may precede queued progress at shutdown. A stalled consumer can retain one daemon writer and descriptor until it unblocks or the CLI exits, but does not hold supervision. Diagnostics are best-effort: an unread pipe cannot receive an outcome. Machine-readable stdout is never sent through this lossy queue.
Evidence and remaining release gates¶
Local Windows/Linux tests cover source equivalence, guarded commit races, malformed envelopes, runtime mismatch, package-in-zip handoff, ordinary child cleanup, abrupt controller death, full stderr pipes and expiry with blocked diagnostic delivery. Tests use synchronization barriers for cancellation races. The synthetic storage profiles are described in Performance.
The adoption fixture also compares timed full/scoped output byte-for-byte with their ordinary counterparts across all source modes: six built-in provider families, derivation receipts, slices and version sources. HEAD runs with a held index lock. Full versus scoped output can retain different historical key layouts; transport preserves each path's configuration/base-lock ordering.
A separate disposable-interpreter test installs a provider module in private site-packages without pip or network access. Both paths refuse to import it without authorization. Authorized ordinary generation imports in the controller; timed generation imports in the worker and returns byte-identical JSON. Process identity is captured inside Python, not inferred from a Windows venv launcher.
This does not close issue #164 or satisfy the complete v0.17 release gate. Supported Python/platform CI, macOS evidence, production wheel/standalone-format installation checks, no-fetch and filesystem-safety regressions, and exact-commit review remain required. Native-provider residual risks must remain explicit in release acceptance.