tigrbl-kernel 0.4.2.dev3__tar.gz → 0.4.3.dev4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. tigrbl_kernel-0.4.3.dev4/NOTICE +7 -0
  2. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/PKG-INFO +183 -28
  3. tigrbl_kernel-0.4.3.dev4/README.md +226 -0
  4. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/pyproject.toml +1 -1
  5. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/__init__.py +1 -19
  6. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/_build.py +1 -1
  7. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/_compile.py +100 -1
  8. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/channel_taxonomy.py +142 -0
  9. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/cross_transport.py +167 -0
  10. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/dispatch_taxonomy.py +47 -0
  11. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/events.py +16 -0
  12. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/helpers.py +2 -2
  13. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/loop_modes.py +19 -1
  14. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/measure.py +1 -1
  15. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/ordering.py +1 -0
  16. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/packed_access.py +131 -0
  17. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/packed_selectors.py +239 -0
  18. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/protocol_anchors.py +49 -0
  19. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_bindings.py +26 -7
  20. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/protocol_chains/http_stream.py +71 -0
  21. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/protocol_streams.py +470 -0
  22. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/resume_policy.py +78 -0
  23. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/runtime_contracts.py +254 -0
  24. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/rust_compile.py +24 -0
  25. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/rust_plan.py +20 -0
  26. tigrbl_kernel-0.4.3.dev4/tigrbl_kernel/rust_spec.py +36 -0
  27. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/transport_events.py +5 -2
  28. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/types.py +1 -0
  29. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/webtransport_events.py +65 -3
  30. tigrbl_kernel-0.4.2.dev3/README.md +0 -72
  31. tigrbl_kernel-0.4.2.dev3/tigrbl_kernel/events.py +0 -6
  32. tigrbl_kernel-0.4.2.dev3/tigrbl_kernel/protocol_chains/http_stream.py +0 -38
  33. tigrbl_kernel-0.4.2.dev3/tigrbl_kernel/rust_compile.py +0 -40
  34. tigrbl_kernel-0.4.2.dev3/tigrbl_kernel/rust_plan.py +0 -14
  35. tigrbl_kernel-0.4.2.dev3/tigrbl_kernel/rust_spec.py +0 -419
  36. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/LICENSE +0 -0
  37. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/atoms.py +0 -0
  38. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/cache.py +0 -0
  39. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/callbacks.py +0 -0
  40. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/contract_classification.py +0 -0
  41. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/core.py +0 -0
  42. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/eventkey.py +0 -0
  43. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/eventkey_hooks.py +0 -0
  44. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/hook_types.py +0 -0
  45. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/labels.py +0 -0
  46. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/lifecycle_matrix.py +0 -0
  47. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/loop_regions.py +0 -0
  48. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/models.py +0 -0
  49. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/opchannel_capabilities.py +0 -0
  50. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/opview_compiler.py +0 -0
  51. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/payload.py +0 -0
  52. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_chains/__init__.py +0 -0
  53. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_chains/http_unary.py +0 -0
  54. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_chains/lifespan.py +0 -0
  55. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_chains/sse.py +0 -0
  56. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_chains/static_files.py +0 -0
  57. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_chains/websocket.py +0 -0
  58. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_completion.py +0 -0
  59. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_fusion.py +0 -0
  60. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_legality_matrix.py +0 -0
  61. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/protocol_phase_tree.py +0 -0
  62. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/segment_fusion.py +0 -0
  63. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/subevent_handlers.py +0 -0
  64. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/subevent_taxonomy.py +0 -0
  65. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/trace.py +0 -0
  66. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/transaction_units.py +0 -0
  67. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/transport_atoms.py +0 -0
  68. {tigrbl_kernel-0.4.2.dev3 → tigrbl_kernel-0.4.3.dev4}/tigrbl_kernel/utils.py +0 -0
@@ -0,0 +1,7 @@
1
+ Tigrbl
2
+ Copyright 2026 Swarmauri
3
+
4
+ This product includes software developed by Swarmauri.
5
+
6
+ Tigrbl is licensed under the Apache License, Version 2.0.
7
+ See the LICENSE file distributed with this work for the full license text.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tigrbl-kernel
3
- Version: 0.4.2.dev3
3
+ Version: 0.4.3.dev4
4
4
  Summary: Kernel orchestration for composing Tigrbl runtime plans, bindings, operation dispatch, and optimized ASGI execution.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -204,6 +204,7 @@ License: Apache License
204
204
  See the License for the specific language governing permissions and
205
205
  limitations under the License.
206
206
  License-File: LICENSE
207
+ License-File: NOTICE
207
208
  Keywords: tigrbl,asgi,api,json-rpc,rest,sqlalchemy,pydantic,kernel,orchestration,dispatch,openapi,openrpc,schema-first
208
209
  Author: Jacob Stewart
209
210
  Author-email: jacob@swarmauri.com
@@ -240,12 +241,45 @@ Description-Content-Type: text/markdown
240
241
  <p><strong>Kernel orchestration for composing Tigrbl runtime plans, bindings, operation dispatch, and optimized ASGI execution.</strong></p>
241
242
  <a href="https://pypi.org/project/tigrbl-kernel/"><img src="https://img.shields.io/pypi/v/tigrbl-kernel?label=PyPI" alt="PyPI version for tigrbl-kernel"/></a>
242
243
  <a href="https://pypi.org/project/tigrbl-kernel/"><img src="https://static.pepy.tech/badge/tigrbl-kernel" alt="Downloads for tigrbl-kernel"/></a>
244
+ <a href="https://discord.gg/K4YTAPapjR"><img src="https://img.shields.io/badge/Discord-Join%20chat-5865F2?logo=discord&logoColor=white" alt="Discord community for tigrbl-kernel"/></a>
243
245
  <a href="https://github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_kernel/README.md"><img src="https://hits.sh/github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_kernel/README.md.svg?label=hits" alt="Repository hits for tigrbl-kernel README"/></a>
244
246
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-525252" alt="Apache 2.0 license"/></a>
245
- <a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.10%20to%203.15-3776ab" alt="Python requirement for tigrbl-kernel"/></a>
247
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.10%2C%203.11%2C%203.12%2C%203.13%2C%203.14-3776ab" alt="Python versions 3.10 | 3.11 | 3.12 | 3.13 | 3.14 for tigrbl-kernel"/></a>
246
248
  <a href="https://github.com/tigrbl/tigrbl/blob/master/docs/README.md"><img src="https://img.shields.io/badge/workspace-core-1f6feb" alt="Workspace group for tigrbl-kernel"/></a>
247
249
  </div>
248
250
 
251
+ ## What is tigrbl-kernel?
252
+
253
+ Kernel orchestration for composing Tigrbl runtime plans, bindings, operation dispatch, and optimized ASGI execution.
254
+
255
+ ## Why use tigrbl-kernel?
256
+
257
+ Use it when you need this foundational Tigrbl layer directly as a small, focused dependency.
258
+
259
+ ## When should I install tigrbl-kernel?
260
+
261
+ Install it for extension packages, package-local tests, or internals that need this boundary without the whole facade.
262
+
263
+ ## Who is tigrbl-kernel for?
264
+
265
+ Framework maintainers, extension authors, and advanced users composing Tigrbl from split packages.
266
+
267
+ ## Where does tigrbl-kernel fit?
268
+
269
+ `tigrbl-kernel` lives at `pkgs/core/tigrbl_kernel` and serves a focused layer in the split Tigrbl framework.
270
+
271
+ ## How does tigrbl-kernel work?
272
+
273
+ It owns a narrow layer in the split workspace and is consumed by higher-level packages through explicit dependencies.
274
+
275
+ ## Certification Status
276
+
277
+ - Package status: governed package in the `tigrbl/tigrbl` workspace.
278
+ - Governance source: [SSOT registry](https://github.com/tigrbl/tigrbl/blob/master/.ssot/registry.json).
279
+ - Release evidence: [publish workflow](https://github.com/tigrbl/tigrbl/actions/workflows/publish.yml) validates package builds, tests, GitHub release assets, and PyPI publication for managed packages.
280
+ - Local certification guard: `pkgs/core/tigrbl_tests/tests/unit/test_package_badges_and_notices.py` verifies every package README keeps the Discord badge, Apache 2.0 badge, explicit Python-version badge, `LICENSE`, and `NOTICE`.
281
+ - Scope note: this README documents the package boundary. Runtime feature support remains governed by `.ssot/` entities and the conformance docs linked below.
282
+
249
283
  ## Install
250
284
 
251
285
  ```bash
@@ -256,54 +290,175 @@ uv add tigrbl-kernel
256
290
  pip install tigrbl-kernel
257
291
  ```
258
292
 
293
+ ## Surface Coverage
294
+
295
+ | Surface | Value |
296
+ |---|---|
297
+ | PyPI package | [`tigrbl-kernel`](https://pypi.org/project/tigrbl-kernel/) |
298
+ | Repository path | [`pkgs/core/tigrbl_kernel`](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_kernel) |
299
+ | Python import root | `tigrbl_kernel` |
300
+ | Console scripts | none declared |
301
+ | Entry points | none declared |
302
+ | Optional extras | none declared |
303
+ | Legal files | `LICENSE`, `NOTICE` |
304
+ | Supported Python | `3.10, 3.11, 3.12, 3.13, 3.14` |
305
+
259
306
  ## What It Owns
260
307
 
261
- `tigrbl-kernel` owns the kernel boundary inside the split Python workspace. Key implementation roots include `tigrbl_kernel` with `_build, _compile, atoms, cache, callbacks, core`.
308
+ `tigrbl-kernel` owns the `foundational framework package` boundary. It should be installed when you need this package's focused responsibility without assuming every other Tigrbl workspace package is present.
262
309
 
263
- ## Use It When
310
+ Implementation orientation:
311
+ - `tigrbl_kernel`: _build, _compile, atoms, cache, callbacks, contract_classification, core, eventkey, eventkey_hooks, events, helpers, hook_types
264
312
 
265
- Use `tigrbl-kernel` when you want this subsystem directly as a package boundary instead of consuming it only through the top-level `tigrbl` facade.
313
+ Package catalog:
314
+ - `tigrbl_kernel/core.py`, `tigrbl_kernel/_build.py`, `tigrbl_kernel/_compile.py`, `tigrbl_kernel/models.py`, `tigrbl_kernel/types.py`, and `tigrbl_kernel/payload.py`: kernel objects, operation views, packed plans, build/compile helpers, and payload contracts.
315
+ - `tigrbl_kernel/ordering.py`, `tigrbl_kernel/labels.py`, `tigrbl_kernel/hook_types.py`, `tigrbl_kernel/callbacks.py`, and `tigrbl_kernel/eventkey_hooks.py`: hook ordering, diagnostic labels, callback shape, and event-key-aware hook plumbing.
316
+ - `tigrbl_kernel/cache.py`, `tigrbl_kernel/trace.py`, and `tigrbl_kernel/measure.py`: cached plans, execution trace support, and measurement views.
317
+ - `tigrbl_kernel/atoms.py`, `tigrbl_kernel/transport_atoms.py`, and `tigrbl_kernel/transaction_units.py`: atom references and transaction/transport plan units.
318
+ - `tigrbl_kernel/protocol_bindings.py`, `tigrbl_kernel/protocol_phase_tree.py`, `tigrbl_kernel/protocol_chains/`, `tigrbl_kernel/protocol_completion.py`, `tigrbl_kernel/protocol_fusion.py`, and `tigrbl_kernel/protocol_legality_matrix.py`: transport-specific plan compilation, phase tree construction, chain definitions, completion semantics, fusion, and legality checks.
319
+ - `tigrbl_kernel/eventkey.py`, `tigrbl_kernel/events.py`, `tigrbl_kernel/transport_events.py`, `tigrbl_kernel/webtransport_events.py`, `tigrbl_kernel/subevent_taxonomy.py`, and `tigrbl_kernel/subevent_handlers.py`: event-key construction, subevent taxonomy, and protocol subevent handler mapping.
320
+ - `tigrbl_kernel/opchannel_capabilities.py`, `tigrbl_kernel/loop_modes.py`, `tigrbl_kernel/loop_regions.py`, `tigrbl_kernel/segment_fusion.py`, and `tigrbl_kernel/contract_classification.py`: channel capability checks, loop planning, segment grouping, and contract classification.
321
+ - `tigrbl_kernel/rust_plan.py`, `tigrbl_kernel/rust_compile.py`, and `tigrbl_kernel/rust_spec.py`: deprecated compatibility shims; kernel planning is Python-only.
266
322
 
267
- ## Public Surface
323
+ ## Public API and Import Surface
268
324
 
269
- - `tigrbl_kernel` exposes `import_module, Any, Dict, List, Mapping, build_rust_kernel, build_rust_parity_snapshot, normalize_rust_spec`.
325
+ - Import roots: `tigrbl_kernel`.
326
+ - Public symbols: `BatchOpPlan`, `Kernel`, `OpView`, `PackedKernel`, `SchemaIn`, `SchemaOut`, `build_kernel_plan`, `build_packed_kernel`, `build_packed_kernel_measurement_view`.
327
+ - Workspace dependencies: [`tigrbl-typing`](https://pypi.org/project/tigrbl-typing/), [`tigrbl-atoms`](https://pypi.org/project/tigrbl-atoms/), [`tigrbl-core`](https://pypi.org/project/tigrbl-core/).
328
+ - External runtime dependencies: none declared.
270
329
 
271
- ## Internal Layout
330
+ ## Kernel Semantics
272
331
 
273
- - Workspace path: `pkgs/core/tigrbl_kernel`.
274
- - Package class: `core framework package`.
275
- - Python requirement: `>=3.10,<3.15`.
276
- - `tigrbl_kernel` modules: `_build, _compile, atoms, cache, callbacks, core, eventkey, eventkey_hooks, events, helpers`.
332
+ The kernel turns specs, operation inventories, hooks, atoms, and protocol bindings into executable plans. It does not own app authoring syntax, persistence engines, or concrete ASGI classes. Its job is to compile the behavior that runtime-owned routing will execute.
277
333
 
278
- ## Dependency Surface
334
+ The basic flow is:
279
335
 
280
- - Workspace package dependencies: [`tigrbl-typing`](https://pypi.org/project/tigrbl-typing/), [`tigrbl-atoms`](https://pypi.org/project/tigrbl-atoms/), [`tigrbl-core`](https://pypi.org/project/tigrbl-core/).
281
- - External runtime dependencies: none declared.
282
- - Optional extras: none declared.
336
+ ```text
337
+ specs + model metadata + bindings + hooks
338
+ -> operation views
339
+ -> ordered phase plan
340
+ -> packed kernel
341
+ -> runtime execution and diagnostics
342
+ ```
343
+
344
+ `Kernel` and `PackedKernel` are the planning surfaces; `OpView` is the operation-level view of schemas, handlers, hooks, bindings, and labels. `build_kernel_plan(...)` and `build_packed_kernel(...)` are useful for tests and framework packages that need to verify the compiled plan without driving a full ASGI request.
345
+
346
+ ## Protocol Planning
347
+
348
+ Protocol planning keeps binding kind, family, framing, exchange, lane, subevent rows, and atom anchors separate. The current planner handles:
349
+
350
+ | Binding kind | Runtime family | Default framing | Plan shape |
351
+ |---|---|---|---|
352
+ | `http.rest` / `https.rest` | request | JSON | request received, handler invoke, response emit. |
353
+ | `http.jsonrpc` / `https.jsonrpc` | request | JSON-RPC | framing decode, dispatch, handler invoke, framing encode. |
354
+ | `http.stream` / `https.stream` | stream | stream | handler invoke, transport emit, stream close. |
355
+ | `http.sse` / `https.sse` | stream | SSE | encode event, emit event, close stream. |
356
+ | `ws` / `wss` / `websocket` | message | text or negotiated JSON-RPC | accept, decode, dispatch, handler, emit/close. |
357
+ | `webtransport` | session, stream, or datagram | WebTransport outer framing | lane-specific session, stream, or datagram rows with inner-framing validation. |
358
+
359
+ Unsupported or ambiguous bindings raise planning errors. For example, WebSocket bindings do not accept HTTP methods, HTTP JSON-RPC requires an RPC method, WebTransport request/response exchange is unsupported, and WebTransport outer framing must remain `webtransport`.
360
+
361
+ ## Hook Ordering and Labels
362
+
363
+ The kernel orders security dependencies, dependencies, system hooks, user hooks, atoms, and handlers into phase plans. Labels are part of the diagnostics contract:
364
+
365
+ ```text
366
+ PRE_HANDLER:secdep:myapp.auth.require_user
367
+ PRE_HANDLER:dep:myapp.context.load_tenant
368
+ HANDLER:hook:sys:handler:create@HANDLER
369
+ EGRESS_SHAPE:atom:wire:dump
370
+ ```
371
+
372
+ Use labels to debug and test ordering. Do not use them as application APIs; use specs, decorators, dependencies, and hooks for configuration.
373
+
374
+ ## Diagnostics and Traceability
375
+
376
+ Kernel plans feed `/system/kernelz` in concrete applications. Trace and measurement helpers make it possible to assert plan shape, count phase work, and inspect compiled execution without relying on a live server. This is especially important for transport work, where a route can look correct while the protocol chain is missing required event rows or capability masks.
377
+
378
+ ## Best Practices
379
+
380
+ - Compile plans from explicit specs and bindings; do not guess transport behavior from URL strings alone.
381
+ - Keep protocol support checks fail-closed and close to planning.
382
+ - Preserve separate event rows for request, stream, message, session, and datagram families.
383
+ - Add tests at the kernel layer when changing hook order, labels, phase rows, protocol legality, or capability masks.
384
+ - Use measurement views for plan review instead of parsing private object internals.
385
+ - Keep runtime side effects out of kernel code; the kernel should plan, classify, and label, not perform IO.
386
+
387
+ ## Usage Examples
388
+
389
+ ### Verify the installed package
390
+
391
+ ```bash
392
+ python -m pip show tigrbl-kernel
393
+ python - <<'PY'
394
+ from importlib.metadata import version
395
+ print(version("tigrbl-kernel"))
396
+ PY
397
+ ```
398
+
399
+ ### Import the package boundary
400
+
401
+ ```python
402
+ import importlib
403
+
404
+ module = importlib.import_module("tigrbl_kernel")
405
+ print(module.__name__)
406
+ ```
407
+
408
+ ### Import a public symbol
409
+
410
+ ```python
411
+ from tigrbl_kernel import BatchOpPlan
412
+
413
+ print(BatchOpPlan)
414
+ ```
415
+
416
+ ### Use with the facade when building applications
417
+
418
+ ```bash
419
+ uv add tigrbl tigrbl-kernel
420
+ python - <<'PY'
421
+ import tigrbl
422
+ print(tigrbl.__name__)
423
+ PY
424
+ ```
425
+
426
+ ## How To Choose This Package
427
+
428
+ Choose `tigrbl-kernel` when the quick-answer table matches your use case. Choose [`tigrbl`](https://pypi.org/project/tigrbl/) instead when you want the full public facade. Choose a lower-level package such as [`tigrbl-core`](https://pypi.org/project/tigrbl-core/), [`tigrbl-base`](https://pypi.org/project/tigrbl-base/), or [`tigrbl-runtime`](https://pypi.org/project/tigrbl-runtime/) when you are building framework extensions or testing a specific internal boundary.
283
429
 
284
430
  ## Related Packages
285
431
 
286
- - [`tigrbl`](https://pypi.org/project/tigrbl/)
287
432
  - [`tigrbl-typing`](https://pypi.org/project/tigrbl-typing/)
288
433
  - [`tigrbl-atoms`](https://pypi.org/project/tigrbl-atoms/)
289
434
  - [`tigrbl-core`](https://pypi.org/project/tigrbl-core/)
435
+ - [`tigrbl`](https://pypi.org/project/tigrbl/)
436
+ - [`tigrbl-base`](https://pypi.org/project/tigrbl-base/)
437
+ - [`tigrbl-runtime`](https://pypi.org/project/tigrbl-runtime/)
438
+
439
+ ## Documentation Links
440
+
441
+ - [Workspace docs](https://github.com/tigrbl/tigrbl/blob/master/docs/README.md)
442
+ - [Package catalog](https://github.com/tigrbl/tigrbl/blob/master/docs/developer/PACKAGE_CATALOG.md)
443
+ - [Package layout](https://github.com/tigrbl/tigrbl/blob/master/docs/developer/PACKAGE_LAYOUT.md)
444
+ - [Current target](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/CURRENT_TARGET.md)
445
+ - [Current state](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/CURRENT_STATE.md)
446
+ - [Next steps](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/NEXT_STEPS.md)
447
+ - [Documentation pointers](https://github.com/tigrbl/tigrbl/blob/master/docs/governance/DOC_POINTERS.md)
448
+ - [SSOT registry](https://github.com/tigrbl/tigrbl/blob/master/.ssot/registry.json)
449
+ - [Release workflow](https://github.com/tigrbl/tigrbl/actions/workflows/publish.yml)
290
450
 
291
- ## Canonical Repository Docs
451
+ ## Support
292
452
 
293
- - `docs/README.md`
294
- - `docs/conformance/CURRENT_TARGET.md`
295
- - `docs/conformance/CURRENT_STATE.md`
296
- - `docs/conformance/NEXT_STEPS.md`
297
- - `docs/governance/DOC_POINTERS.md`
298
- - `docs/developer/PACKAGE_CATALOG.md`
299
- - `docs/developer/PACKAGE_LAYOUT.md`
453
+ - Community: [Discord](https://discord.gg/K4YTAPapjR).
454
+ - Issues: [GitHub Issues](https://github.com/tigrbl/tigrbl/issues).
455
+ - Repository: [pkgs/core/tigrbl_kernel](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_kernel).
300
456
 
301
457
  ## Package-local Boundary
302
458
 
303
- This file is a package-local distribution entry point.
304
- Use this page for package installation and boundary orientation. Repository governance, conformance state, target status, and release evidence remain governed from `docs/` and `.ssot/`.
459
+ This file is a package-local distribution entry point. This README is the package-local distribution entry point for `tigrbl-kernel`. It answers install, usage, API, ownership, and certification-orientation questions for this package. Broader architectural decisions, release status, and cross-package proof chains remain in the repository-level docs and SSOT registry.
305
460
 
306
461
  ## License
307
462
 
308
- Licensed under the Apache License, Version 2.0. See `LICENSE` and the official [Apache 2.0 license text](https://www.apache.org/licenses/LICENSE-2.0).
463
+ Licensed under the Apache License, Version 2.0. See `LICENSE`, `NOTICE`, and the official [Apache 2.0 license text](https://www.apache.org/licenses/LICENSE-2.0).
309
464
 
@@ -0,0 +1,226 @@
1
+ <div align="center">
2
+ <h1>tigrbl-kernel</h1>
3
+ <img src="https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/tigrbl_full_logo.png" alt="Tigrbl logo" width="140"/>
4
+ <p><strong>Kernel orchestration for composing Tigrbl runtime plans, bindings, operation dispatch, and optimized ASGI execution.</strong></p>
5
+ <a href="https://pypi.org/project/tigrbl-kernel/"><img src="https://img.shields.io/pypi/v/tigrbl-kernel?label=PyPI" alt="PyPI version for tigrbl-kernel"/></a>
6
+ <a href="https://pypi.org/project/tigrbl-kernel/"><img src="https://static.pepy.tech/badge/tigrbl-kernel" alt="Downloads for tigrbl-kernel"/></a>
7
+ <a href="https://discord.gg/K4YTAPapjR"><img src="https://img.shields.io/badge/Discord-Join%20chat-5865F2?logo=discord&logoColor=white" alt="Discord community for tigrbl-kernel"/></a>
8
+ <a href="https://github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_kernel/README.md"><img src="https://hits.sh/github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_kernel/README.md.svg?label=hits" alt="Repository hits for tigrbl-kernel README"/></a>
9
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-525252" alt="Apache 2.0 license"/></a>
10
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.10%2C%203.11%2C%203.12%2C%203.13%2C%203.14-3776ab" alt="Python versions 3.10 | 3.11 | 3.12 | 3.13 | 3.14 for tigrbl-kernel"/></a>
11
+ <a href="https://github.com/tigrbl/tigrbl/blob/master/docs/README.md"><img src="https://img.shields.io/badge/workspace-core-1f6feb" alt="Workspace group for tigrbl-kernel"/></a>
12
+ </div>
13
+
14
+ ## What is tigrbl-kernel?
15
+
16
+ Kernel orchestration for composing Tigrbl runtime plans, bindings, operation dispatch, and optimized ASGI execution.
17
+
18
+ ## Why use tigrbl-kernel?
19
+
20
+ Use it when you need this foundational Tigrbl layer directly as a small, focused dependency.
21
+
22
+ ## When should I install tigrbl-kernel?
23
+
24
+ Install it for extension packages, package-local tests, or internals that need this boundary without the whole facade.
25
+
26
+ ## Who is tigrbl-kernel for?
27
+
28
+ Framework maintainers, extension authors, and advanced users composing Tigrbl from split packages.
29
+
30
+ ## Where does tigrbl-kernel fit?
31
+
32
+ `tigrbl-kernel` lives at `pkgs/core/tigrbl_kernel` and serves a focused layer in the split Tigrbl framework.
33
+
34
+ ## How does tigrbl-kernel work?
35
+
36
+ It owns a narrow layer in the split workspace and is consumed by higher-level packages through explicit dependencies.
37
+
38
+ ## Certification Status
39
+
40
+ - Package status: governed package in the `tigrbl/tigrbl` workspace.
41
+ - Governance source: [SSOT registry](https://github.com/tigrbl/tigrbl/blob/master/.ssot/registry.json).
42
+ - Release evidence: [publish workflow](https://github.com/tigrbl/tigrbl/actions/workflows/publish.yml) validates package builds, tests, GitHub release assets, and PyPI publication for managed packages.
43
+ - Local certification guard: `pkgs/core/tigrbl_tests/tests/unit/test_package_badges_and_notices.py` verifies every package README keeps the Discord badge, Apache 2.0 badge, explicit Python-version badge, `LICENSE`, and `NOTICE`.
44
+ - Scope note: this README documents the package boundary. Runtime feature support remains governed by `.ssot/` entities and the conformance docs linked below.
45
+
46
+ ## Install
47
+
48
+ ```bash
49
+ uv add tigrbl-kernel
50
+ ```
51
+
52
+ ```bash
53
+ pip install tigrbl-kernel
54
+ ```
55
+
56
+ ## Surface Coverage
57
+
58
+ | Surface | Value |
59
+ |---|---|
60
+ | PyPI package | [`tigrbl-kernel`](https://pypi.org/project/tigrbl-kernel/) |
61
+ | Repository path | [`pkgs/core/tigrbl_kernel`](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_kernel) |
62
+ | Python import root | `tigrbl_kernel` |
63
+ | Console scripts | none declared |
64
+ | Entry points | none declared |
65
+ | Optional extras | none declared |
66
+ | Legal files | `LICENSE`, `NOTICE` |
67
+ | Supported Python | `3.10, 3.11, 3.12, 3.13, 3.14` |
68
+
69
+ ## What It Owns
70
+
71
+ `tigrbl-kernel` owns the `foundational framework package` boundary. It should be installed when you need this package's focused responsibility without assuming every other Tigrbl workspace package is present.
72
+
73
+ Implementation orientation:
74
+ - `tigrbl_kernel`: _build, _compile, atoms, cache, callbacks, contract_classification, core, eventkey, eventkey_hooks, events, helpers, hook_types
75
+
76
+ Package catalog:
77
+ - `tigrbl_kernel/core.py`, `tigrbl_kernel/_build.py`, `tigrbl_kernel/_compile.py`, `tigrbl_kernel/models.py`, `tigrbl_kernel/types.py`, and `tigrbl_kernel/payload.py`: kernel objects, operation views, packed plans, build/compile helpers, and payload contracts.
78
+ - `tigrbl_kernel/ordering.py`, `tigrbl_kernel/labels.py`, `tigrbl_kernel/hook_types.py`, `tigrbl_kernel/callbacks.py`, and `tigrbl_kernel/eventkey_hooks.py`: hook ordering, diagnostic labels, callback shape, and event-key-aware hook plumbing.
79
+ - `tigrbl_kernel/cache.py`, `tigrbl_kernel/trace.py`, and `tigrbl_kernel/measure.py`: cached plans, execution trace support, and measurement views.
80
+ - `tigrbl_kernel/atoms.py`, `tigrbl_kernel/transport_atoms.py`, and `tigrbl_kernel/transaction_units.py`: atom references and transaction/transport plan units.
81
+ - `tigrbl_kernel/protocol_bindings.py`, `tigrbl_kernel/protocol_phase_tree.py`, `tigrbl_kernel/protocol_chains/`, `tigrbl_kernel/protocol_completion.py`, `tigrbl_kernel/protocol_fusion.py`, and `tigrbl_kernel/protocol_legality_matrix.py`: transport-specific plan compilation, phase tree construction, chain definitions, completion semantics, fusion, and legality checks.
82
+ - `tigrbl_kernel/eventkey.py`, `tigrbl_kernel/events.py`, `tigrbl_kernel/transport_events.py`, `tigrbl_kernel/webtransport_events.py`, `tigrbl_kernel/subevent_taxonomy.py`, and `tigrbl_kernel/subevent_handlers.py`: event-key construction, subevent taxonomy, and protocol subevent handler mapping.
83
+ - `tigrbl_kernel/opchannel_capabilities.py`, `tigrbl_kernel/loop_modes.py`, `tigrbl_kernel/loop_regions.py`, `tigrbl_kernel/segment_fusion.py`, and `tigrbl_kernel/contract_classification.py`: channel capability checks, loop planning, segment grouping, and contract classification.
84
+ - `tigrbl_kernel/rust_plan.py`, `tigrbl_kernel/rust_compile.py`, and `tigrbl_kernel/rust_spec.py`: deprecated compatibility shims; kernel planning is Python-only.
85
+
86
+ ## Public API and Import Surface
87
+
88
+ - Import roots: `tigrbl_kernel`.
89
+ - Public symbols: `BatchOpPlan`, `Kernel`, `OpView`, `PackedKernel`, `SchemaIn`, `SchemaOut`, `build_kernel_plan`, `build_packed_kernel`, `build_packed_kernel_measurement_view`.
90
+ - Workspace dependencies: [`tigrbl-typing`](https://pypi.org/project/tigrbl-typing/), [`tigrbl-atoms`](https://pypi.org/project/tigrbl-atoms/), [`tigrbl-core`](https://pypi.org/project/tigrbl-core/).
91
+ - External runtime dependencies: none declared.
92
+
93
+ ## Kernel Semantics
94
+
95
+ The kernel turns specs, operation inventories, hooks, atoms, and protocol bindings into executable plans. It does not own app authoring syntax, persistence engines, or concrete ASGI classes. Its job is to compile the behavior that runtime-owned routing will execute.
96
+
97
+ The basic flow is:
98
+
99
+ ```text
100
+ specs + model metadata + bindings + hooks
101
+ -> operation views
102
+ -> ordered phase plan
103
+ -> packed kernel
104
+ -> runtime execution and diagnostics
105
+ ```
106
+
107
+ `Kernel` and `PackedKernel` are the planning surfaces; `OpView` is the operation-level view of schemas, handlers, hooks, bindings, and labels. `build_kernel_plan(...)` and `build_packed_kernel(...)` are useful for tests and framework packages that need to verify the compiled plan without driving a full ASGI request.
108
+
109
+ ## Protocol Planning
110
+
111
+ Protocol planning keeps binding kind, family, framing, exchange, lane, subevent rows, and atom anchors separate. The current planner handles:
112
+
113
+ | Binding kind | Runtime family | Default framing | Plan shape |
114
+ |---|---|---|---|
115
+ | `http.rest` / `https.rest` | request | JSON | request received, handler invoke, response emit. |
116
+ | `http.jsonrpc` / `https.jsonrpc` | request | JSON-RPC | framing decode, dispatch, handler invoke, framing encode. |
117
+ | `http.stream` / `https.stream` | stream | stream | handler invoke, transport emit, stream close. |
118
+ | `http.sse` / `https.sse` | stream | SSE | encode event, emit event, close stream. |
119
+ | `ws` / `wss` / `websocket` | message | text or negotiated JSON-RPC | accept, decode, dispatch, handler, emit/close. |
120
+ | `webtransport` | session, stream, or datagram | WebTransport outer framing | lane-specific session, stream, or datagram rows with inner-framing validation. |
121
+
122
+ Unsupported or ambiguous bindings raise planning errors. For example, WebSocket bindings do not accept HTTP methods, HTTP JSON-RPC requires an RPC method, WebTransport request/response exchange is unsupported, and WebTransport outer framing must remain `webtransport`.
123
+
124
+ ## Hook Ordering and Labels
125
+
126
+ The kernel orders security dependencies, dependencies, system hooks, user hooks, atoms, and handlers into phase plans. Labels are part of the diagnostics contract:
127
+
128
+ ```text
129
+ PRE_HANDLER:secdep:myapp.auth.require_user
130
+ PRE_HANDLER:dep:myapp.context.load_tenant
131
+ HANDLER:hook:sys:handler:create@HANDLER
132
+ EGRESS_SHAPE:atom:wire:dump
133
+ ```
134
+
135
+ Use labels to debug and test ordering. Do not use them as application APIs; use specs, decorators, dependencies, and hooks for configuration.
136
+
137
+ ## Diagnostics and Traceability
138
+
139
+ Kernel plans feed `/system/kernelz` in concrete applications. Trace and measurement helpers make it possible to assert plan shape, count phase work, and inspect compiled execution without relying on a live server. This is especially important for transport work, where a route can look correct while the protocol chain is missing required event rows or capability masks.
140
+
141
+ ## Best Practices
142
+
143
+ - Compile plans from explicit specs and bindings; do not guess transport behavior from URL strings alone.
144
+ - Keep protocol support checks fail-closed and close to planning.
145
+ - Preserve separate event rows for request, stream, message, session, and datagram families.
146
+ - Add tests at the kernel layer when changing hook order, labels, phase rows, protocol legality, or capability masks.
147
+ - Use measurement views for plan review instead of parsing private object internals.
148
+ - Keep runtime side effects out of kernel code; the kernel should plan, classify, and label, not perform IO.
149
+
150
+ ## Usage Examples
151
+
152
+ ### Verify the installed package
153
+
154
+ ```bash
155
+ python -m pip show tigrbl-kernel
156
+ python - <<'PY'
157
+ from importlib.metadata import version
158
+ print(version("tigrbl-kernel"))
159
+ PY
160
+ ```
161
+
162
+ ### Import the package boundary
163
+
164
+ ```python
165
+ import importlib
166
+
167
+ module = importlib.import_module("tigrbl_kernel")
168
+ print(module.__name__)
169
+ ```
170
+
171
+ ### Import a public symbol
172
+
173
+ ```python
174
+ from tigrbl_kernel import BatchOpPlan
175
+
176
+ print(BatchOpPlan)
177
+ ```
178
+
179
+ ### Use with the facade when building applications
180
+
181
+ ```bash
182
+ uv add tigrbl tigrbl-kernel
183
+ python - <<'PY'
184
+ import tigrbl
185
+ print(tigrbl.__name__)
186
+ PY
187
+ ```
188
+
189
+ ## How To Choose This Package
190
+
191
+ Choose `tigrbl-kernel` when the quick-answer table matches your use case. Choose [`tigrbl`](https://pypi.org/project/tigrbl/) instead when you want the full public facade. Choose a lower-level package such as [`tigrbl-core`](https://pypi.org/project/tigrbl-core/), [`tigrbl-base`](https://pypi.org/project/tigrbl-base/), or [`tigrbl-runtime`](https://pypi.org/project/tigrbl-runtime/) when you are building framework extensions or testing a specific internal boundary.
192
+
193
+ ## Related Packages
194
+
195
+ - [`tigrbl-typing`](https://pypi.org/project/tigrbl-typing/)
196
+ - [`tigrbl-atoms`](https://pypi.org/project/tigrbl-atoms/)
197
+ - [`tigrbl-core`](https://pypi.org/project/tigrbl-core/)
198
+ - [`tigrbl`](https://pypi.org/project/tigrbl/)
199
+ - [`tigrbl-base`](https://pypi.org/project/tigrbl-base/)
200
+ - [`tigrbl-runtime`](https://pypi.org/project/tigrbl-runtime/)
201
+
202
+ ## Documentation Links
203
+
204
+ - [Workspace docs](https://github.com/tigrbl/tigrbl/blob/master/docs/README.md)
205
+ - [Package catalog](https://github.com/tigrbl/tigrbl/blob/master/docs/developer/PACKAGE_CATALOG.md)
206
+ - [Package layout](https://github.com/tigrbl/tigrbl/blob/master/docs/developer/PACKAGE_LAYOUT.md)
207
+ - [Current target](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/CURRENT_TARGET.md)
208
+ - [Current state](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/CURRENT_STATE.md)
209
+ - [Next steps](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/NEXT_STEPS.md)
210
+ - [Documentation pointers](https://github.com/tigrbl/tigrbl/blob/master/docs/governance/DOC_POINTERS.md)
211
+ - [SSOT registry](https://github.com/tigrbl/tigrbl/blob/master/.ssot/registry.json)
212
+ - [Release workflow](https://github.com/tigrbl/tigrbl/actions/workflows/publish.yml)
213
+
214
+ ## Support
215
+
216
+ - Community: [Discord](https://discord.gg/K4YTAPapjR).
217
+ - Issues: [GitHub Issues](https://github.com/tigrbl/tigrbl/issues).
218
+ - Repository: [pkgs/core/tigrbl_kernel](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_kernel).
219
+
220
+ ## Package-local Boundary
221
+
222
+ This file is a package-local distribution entry point. This README is the package-local distribution entry point for `tigrbl-kernel`. It answers install, usage, API, ownership, and certification-orientation questions for this package. Broader architectural decisions, release status, and cross-package proof chains remain in the repository-level docs and SSOT registry.
223
+
224
+ ## License
225
+
226
+ Licensed under the Apache License, Version 2.0. See `LICENSE`, `NOTICE`, and the official [Apache 2.0 license text](https://www.apache.org/licenses/LICENSE-2.0).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tigrbl-kernel"
3
- version = "0.4.2.dev3"
3
+ version = "0.4.3.dev4"
4
4
  description = "Kernel orchestration for composing Tigrbl runtime plans, bindings, operation dispatch, and optimized ASGI execution."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -3,19 +3,6 @@ from __future__ import annotations
3
3
  from importlib import import_module
4
4
  from typing import Any, Dict, List, Mapping
5
5
 
6
- try: # pragma: no cover - additive optional integration
7
- _runtime_rust = import_module("tigrbl_runtime.rust")
8
- ExecutionBackend = _runtime_rust.ExecutionBackend
9
- RustBackendConfig = _runtime_rust.RustBackendConfig
10
- except Exception: # pragma: no cover
11
- ExecutionBackend = RustBackendConfig = None
12
-
13
- from .rust_compile import (
14
- build_rust_kernel,
15
- build_rust_parity_snapshot,
16
- normalize_rust_spec,
17
- )
18
- from .rust_plan import RustPlan
19
6
  from .measure import (
20
7
  build_packed_kernel_measurement_view,
21
8
  load_packed_kernel_hot_block,
@@ -80,18 +67,13 @@ def plan_labels(model: type, alias: str) -> list[str]:
80
67
 
81
68
 
82
69
  __all__ = [
83
- "ExecutionBackend",
84
70
  "Kernel",
85
- "RustBackendConfig",
86
- "RustPlan",
87
71
  "BatchOpPlan",
88
72
  "OpView",
89
73
  "PackedKernel",
90
74
  "SchemaIn",
91
75
  "SchemaOut",
92
76
  "build_kernel_plan",
93
- "build_rust_kernel",
94
- "build_rust_parity_snapshot",
95
77
  "build_packed_kernel",
96
78
  "build_packed_kernel_measurement_view",
97
79
  "get_cached_specs",
@@ -99,9 +81,9 @@ __all__ = [
99
81
  "load_packed_kernel_hot_block",
100
82
  "load_packed_kernel_hot_sections",
101
83
  "measure_packed_kernel",
102
- "normalize_rust_spec",
103
84
  "packed_kernel_measurement",
104
85
  "plan_labels",
86
+ "protocol_streams",
105
87
  "serialize_packed_kernel_measurement_view",
106
88
  "segment_fusion",
107
89
  "transport_atoms",
@@ -15,7 +15,7 @@ from tigrbl_atoms.atoms.sys.phase_db import run as _bind_phase_db
15
15
  from tigrbl_atoms.phases import phase_info
16
16
  from tigrbl_atoms.types import EdgeTarget, PhaseTreeEdge, PhaseTreeNode, error_phase_for
17
17
  from tigrbl_core.config.resolver import resolve_cfg
18
- from tigrbl_typing.phases import normalize_phase
18
+ from tigrbl_typing.phases import canonicalize_phase_input as normalize_phase
19
19
 
20
20
  from . import events as _ev
21
21
  from .atoms import (