tigrbl 0.4.2.dev4__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.
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/PKG-INFO +276 -4
- tigrbl-0.4.3.dev4/README.md +442 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/pyproject.toml +1 -1
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/__init__.py +74 -7
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/cli.py +11 -2
- tigrbl-0.4.3.dev4/tigrbl/hook/exceptions.py +3 -0
- tigrbl-0.4.3.dev4/tigrbl/middlewares/__init__.py +13 -0
- tigrbl-0.4.3.dev4/tigrbl/schema/jsonrpc.py +1 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/diagnostics/__init__.py +19 -12
- tigrbl-0.4.3.dev4/tigrbl/system/diagnostics/kernelz.py +15 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/diagnostics/methodz.py +2 -0
- tigrbl-0.4.3.dev4/tigrbl/system/diagnostics/utils.py +17 -0
- tigrbl-0.4.3.dev4/tigrbl/transport/jsonrpc/helpers.py +7 -0
- tigrbl-0.4.3.dev4/tigrbl/transport/jsonrpc/models.py +7 -0
- tigrbl-0.4.3.dev4/tigrbl/transport/rest/aggregator.py +7 -0
- tigrbl-0.4.2.dev4/README.md +0 -170
- tigrbl-0.4.2.dev4/tigrbl/hook/exceptions.py +0 -3
- tigrbl-0.4.2.dev4/tigrbl/middlewares/__init__.py +0 -11
- tigrbl-0.4.2.dev4/tigrbl/system/diagnostics/kernelz.py +0 -57
- tigrbl-0.4.2.dev4/tigrbl/system/diagnostics/utils.py +0 -63
- tigrbl-0.4.2.dev4/tigrbl/transport/jsonrpc/helpers.py +0 -1
- tigrbl-0.4.2.dev4/tigrbl/transport/jsonrpc/models.py +0 -1
- tigrbl-0.4.2.dev4/tigrbl/transport/rest/aggregator.py +0 -1
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/LICENSE +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/NOTICE +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/__main__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/canonical_json.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/config/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/config/constants.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/config/defaults.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/ddl/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/allow_anon.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/engine.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/hook.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/middlewares.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/op.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/response.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/rest.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/schema.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/decorators/session.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/bind.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/builders.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/capabilities.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/collect.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/plugins.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/registry.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/engine/resolver.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/app.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/column.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/engine.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/hook.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/op.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/responses.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/router.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/schema.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/factories/table.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/hook/types.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/middlewares/compose.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/op/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/op/canonical.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/op/collect.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/op/types.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/orm/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/requests.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/rest/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/builder/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/builder/build_schema.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/builder/cache.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/builder/extras.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/builder/helpers.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/builder/list_params.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/builder/strip_parent_fields.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/schema/utils.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/security/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/security/dependencies.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/session/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/session/base.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/session/spec.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/app.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/column.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/engine.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/hook.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/op.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/responses.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/rest.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/router.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/schema.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/shortcuts/table.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/specs.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/diagnostics/healthz.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/diagnostics/hookz.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/diagnostics/router.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/lens.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/openapi/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/openapi/helpers.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/openapi/metadata.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/openapi/mount.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/openapi/schema.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/openrpc.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/docs/swagger.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/favicon/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/favicon/assets/favicon.svg +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/system/uvicorn.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/transport/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/transport/jsonrpc/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/transport/rest/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/types/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/utils/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/utils/schema.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/vendor/__init__.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/vendor/jinja.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/vendor/pydantic.py +0 -0
- {tigrbl-0.4.2.dev4 → tigrbl-0.4.3.dev4}/tigrbl/vendor/sqlalchemy.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tigrbl
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3.dev4
|
|
4
4
|
Summary: Schema-first ASGI framework for REST and JSON-RPC APIs with OpenAPI, OpenRPC, SQLAlchemy, typed validation, hooks, and engine plugins.
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -271,7 +271,7 @@ Description-Content-Type: text/markdown
|
|
|
271
271
|
<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"/></a>
|
|
272
272
|
<a href="https://github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl/README.md"><img src="https://hits.sh/github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl/README.md.svg?label=hits" alt="Repository hits for tigrbl README"/></a>
|
|
273
273
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-525252" alt="Apache 2.0 license"/></a>
|
|
274
|
-
<a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.10%
|
|
274
|
+
<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"/></a>
|
|
275
275
|
<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"/></a>
|
|
276
276
|
</div>
|
|
277
277
|
|
|
@@ -334,7 +334,7 @@ pip install "tigrbl[postgres,servers,templates,tests]"
|
|
|
334
334
|
| Entry points | none declared |
|
|
335
335
|
| Optional extras | `postgres`, `servers`, `templates`, `tests` |
|
|
336
336
|
| Legal files | `LICENSE`, `NOTICE` |
|
|
337
|
-
| Supported Python | `3.10
|
|
337
|
+
| Supported Python | `3.10, 3.11, 3.12, 3.13, 3.14` |
|
|
338
338
|
|
|
339
339
|
## What It Owns
|
|
340
340
|
|
|
@@ -343,6 +343,12 @@ pip install "tigrbl[postgres,servers,templates,tests]"
|
|
|
343
343
|
Implementation orientation:
|
|
344
344
|
- `tigrbl`: __main__, canonical_json, cli, config/, ddl/, decorators/, engine/, factories/, hook/, middlewares/, op/, orm/
|
|
345
345
|
|
|
346
|
+
Facade orientation:
|
|
347
|
+
- Authoring API: app/router factories, table helpers, column helpers, schema helpers, operation decorators, hook decorators, response decorators, and engine decorators.
|
|
348
|
+
- Compatibility imports: facade modules such as `tigrbl.op`, `tigrbl.config`, `tigrbl.schema`, `tigrbl.ddl`, `tigrbl.security`, and `tigrbl.system` forward into the split packages that now own the implementation.
|
|
349
|
+
- Runtime projection: model operations are compiled into REST bindings, JSON-RPC methods, OpenAPI, OpenRPC, diagnostics, schemas, and engine-backed handlers.
|
|
350
|
+
- Operational boundary: this package is the application-facing install target; lower-level packages own specs, atoms, kernel planning, runtime execution, base abstractions, concrete adapters, ORM helpers, and engine plugins.
|
|
351
|
+
|
|
346
352
|
## Public API and Import Surface
|
|
347
353
|
|
|
348
354
|
- Import roots: `tigrbl`.
|
|
@@ -393,6 +399,270 @@ tigrbl --help
|
|
|
393
399
|
python -m tigrbl --help
|
|
394
400
|
```
|
|
395
401
|
|
|
402
|
+
## Framework Catalog
|
|
403
|
+
|
|
404
|
+
Tigrbl is organized as a split framework behind this facade:
|
|
405
|
+
|
|
406
|
+
| Layer | Package | Responsibility |
|
|
407
|
+
|---|---|---|
|
|
408
|
+
| Facade | `tigrbl` | Public authoring imports, shortcuts, compatibility modules, CLI entry point, and application-facing docs. |
|
|
409
|
+
| Core specs | `tigrbl-core` | App, router, table, column, op, hook, schema, response, binding, engine, storage, path, docs, session, and middleware specs. |
|
|
410
|
+
| Base contracts | `tigrbl-base` | Abstract app/router/table/session/request/response/binding/security/middleware/storage interfaces and mapping helpers. |
|
|
411
|
+
| Concrete adapters | `tigrbl-concrete` | Concrete app/router/table/response/request/security/decorator/engine/system/transport implementations. |
|
|
412
|
+
| Atoms | `tigrbl-atoms` | Phase names, stage transitions, typed contexts, ingress/dispatch/wire/storage/handler/egress/error atoms, transaction atoms, batch atoms, and transport atoms. |
|
|
413
|
+
| Kernel | `tigrbl-kernel` | Operation-view compilation, hook ordering, labels, packed plans, protocol chains, lifecycle rows, event keys, capability masks, and dispatch plans. |
|
|
414
|
+
| Runtime | `tigrbl-runtime` | Runtime-owned routing, request execution, framing atoms, transport channels, and default kernel integration. |
|
|
415
|
+
| Operation packs | `tigrbl-ops-oltp`, `tigrbl-ops-olap`, `tigrbl-ops-realtime` | Canonical operation definitions for CRUD, analytics, and realtime/streaming workloads. |
|
|
416
|
+
| ORM | `tigrbl-orm` | SQLAlchemy-facing table and mixin helpers used by application models. |
|
|
417
|
+
| Engines | `tigrbl-engine-*` | Persistence, cache, queue, rate, bloom, dedupe, dataframe, warehouse, and database engine integrations. |
|
|
418
|
+
|
|
419
|
+
Use the facade for application code unless you are maintaining a framework layer, testing a boundary in isolation, or writing a package that intentionally plugs into one of the lower layers.
|
|
420
|
+
|
|
421
|
+
## Authoring BCP
|
|
422
|
+
|
|
423
|
+
The facade is the normal application authoring surface. Use `docs/developer/AUTHORING_BCP.md` for the full policy; this package README keeps the public-package guidance explicit because it is the README most application developers see first.
|
|
424
|
+
|
|
425
|
+
Do:
|
|
426
|
+
|
|
427
|
+
- Do import application-facing classes, decorators, helpers, and shortcuts from `tigrbl` unless you are intentionally maintaining a lower-level package.
|
|
428
|
+
- Do create services with `TigrblApp`, `TigrblRouter`, facade route/operation decorators, table helpers, column helpers, hook decorators, response decorators, schema helpers, and engine decorators.
|
|
429
|
+
- Do model domain actions as Tigrbl operations, including canonical CRUD operations, operation-pack verbs, or explicit custom operation specs.
|
|
430
|
+
- Do use operation handlers through Tigrbl specs and kernel/runtime dispatch so REST, JSON-RPC, OpenAPI, OpenRPC, diagnostics, schemas, hooks, and tests stay aligned.
|
|
431
|
+
- Do express field behavior through Tigrbl table, column, datatype, storage, IO, request, response, and operation specs.
|
|
432
|
+
- Do use `get_schema(...)` or schema helpers for operation request/response payloads.
|
|
433
|
+
- Do bind engines declaratively at app, router, table, or operation scope.
|
|
434
|
+
- Do use lifecycle hooks for policy, validation, enrichment, audit, response shaping, and post-response work.
|
|
435
|
+
- Do use `/system/methodz`, `/system/hookz`, `/system/kernelz`, OpenAPI, and OpenRPC to inspect the registered framework state.
|
|
436
|
+
|
|
437
|
+
Do not:
|
|
438
|
+
|
|
439
|
+
- Do not author application endpoints with FastAPI `FastAPI`, `APIRouter`, dependency wiring, route decorators, middleware registration, docs generation, or lifecycle hooks.
|
|
440
|
+
- Do not author application endpoints with Starlette route, request, response, middleware, background-task, or lifecycle classes.
|
|
441
|
+
- Do not use raw SQLAlchemy `mapped_column(...)` or `Column(...)` as the primary application authoring surface when Tigrbl column helpers or specs can represent the field behavior.
|
|
442
|
+
- Do not build ad-hoc SQLAlchemy engines, sessions, or sessionmakers inside request handlers.
|
|
443
|
+
- Do not call direct database/session methods such as `flush()` or `commit()` from application hooks or handlers unless you are implementing a framework-level atom with the correct lifecycle guard contract.
|
|
444
|
+
- Do not wrap model behavior in one-off route handlers when an operation spec can represent the behavior.
|
|
445
|
+
- Do not bypass kernel/runtime plans when wiring REST, JSON-RPC, stream, SSE, WebSocket, or WebTransport behavior.
|
|
446
|
+
|
|
447
|
+
Avoid:
|
|
448
|
+
|
|
449
|
+
- Avoid treating ASGI, FastAPI, Starlette, SQLAlchemy ORM materialization, or direct DB methods as the user-facing application contract. Tigrbl owns the authoring contract; lower-level libraries are implementation substrates behind Tigrbl-owned adapters, engines, tests, or benchmarks.
|
|
450
|
+
- Avoid duplicating field behavior in SQLAlchemy, Pydantic, docs, and route handlers. Put reusable behavior in Tigrbl specs so storage, schema, docs, runtime, hooks, and diagnostics read the same source.
|
|
451
|
+
- Avoid hand-written Pydantic envelopes for payloads that belong to a Tigrbl operation.
|
|
452
|
+
- Avoid transport-specific wrappers for authentication, authorization, validation, or dispatch when security dependencies, hooks, operation specs, or lifecycle phases can express the rule once.
|
|
453
|
+
- Avoid teaching lower-level internals in application README examples unless the example is clearly marked as a test, benchmark, migration, engine adapter, or framework-internal compatibility surface.
|
|
454
|
+
|
|
455
|
+
## Default CRUD and Operation Semantics
|
|
456
|
+
|
|
457
|
+
The canonical default operation set is `create`, `read`, `update`, `replace`, `delete`, `list`, and `clear`. Tables can opt out, opt into a subset, or add explicit operation specs. Additional operation packs provide bulk, analytical, and realtime verbs such as `bulk_create`, `bulk_update`, `bulk_replace`, `bulk_merge`, `bulk_delete`, `count`, `exists`, `aggregate`, `group_by`, `tail`, `subscribe`, `publish`, `upload`, `download`, `append_chunk`, `checkpoint`, and transport-oriented handlers.
|
|
458
|
+
|
|
459
|
+
| Operation | REST shape | JSON-RPC shape | Arity | Semantics |
|
|
460
|
+
|---|---|---|---|---|
|
|
461
|
+
| `create` | `POST /{resource}` | `Model.create` | collection | Validate input, apply defaults/policies, persist one record, return the output schema. |
|
|
462
|
+
| `read` | `GET /{resource}/{id}` | `Model.read` | member | Fetch one record by identity and serialize through the output schema. |
|
|
463
|
+
| `update` | `PATCH /{resource}/{id}` | `Model.update` | member | Apply partial update semantics; omitted fields remain unchanged. |
|
|
464
|
+
| `replace` | `PUT /{resource}/{id}` | `Model.replace` | member | Apply replacement semantics; the submitted representation is the desired record shape. |
|
|
465
|
+
| `delete` | `DELETE /{resource}/{id}` | `Model.delete` | member | Remove or policy-delete one record and return the configured result envelope. |
|
|
466
|
+
| `list` | `GET /{resource}` | `Model.list` | collection | Resolve filters, pagination, ordering, visibility policy, and output collection shape. |
|
|
467
|
+
| `clear` | `DELETE /{resource}` | `Model.clear` | collection | Delete a collection according to policy and filter configuration. |
|
|
468
|
+
| `bulk_create` | `POST /{resource}` | `Model.bulk_create` | collection | Create many records from an array of row objects and return the created row outputs. |
|
|
469
|
+
| `bulk_update` | `PATCH /{resource}` | `Model.bulk_update` | collection | Patch many existing records by primary key and return the updated row outputs. |
|
|
470
|
+
| `bulk_replace` | `PUT /{resource}` | `Model.bulk_replace` | collection | Replace many existing records by primary key and return the replaced row outputs. |
|
|
471
|
+
| `bulk_merge` | `PATCH /{resource}` | `Model.bulk_merge` | collection | Upsert or merge many records by primary key and return the resulting row outputs. |
|
|
472
|
+
| `bulk_delete` | `DELETE /{resource}` | `Model.bulk_delete` | collection | Delete many records by primary key and return a deleted-count envelope. |
|
|
473
|
+
| `custom` | op-defined | op-defined | op-defined | Use explicit `op_ctx`/operation specs for domain-specific verbs while keeping schemas, hooks, and policies unified. |
|
|
474
|
+
|
|
475
|
+
Route conflicts are intentional. A collection `POST` cannot simultaneously mean scalar `create` and `bulk_create` on the same REST path, and a collection `DELETE` cannot simultaneously mean `clear` and `bulk_delete`. JSON-RPC methods remain independently addressable by method name, so RPC is the right surface when both scalar and bulk forms must be exposed without path ambiguity.
|
|
476
|
+
|
|
477
|
+
## Bulk Operation Shape Reference
|
|
478
|
+
|
|
479
|
+
Bulk operations are collection-arity operations. REST binds them to the collection path, while JSON-RPC binds them to `Model.<bulk_op>`. The public wire shape is intentionally simple: row bulk operations take a JSON array of row objects, and `bulk_delete` takes a JSON array of primary-key values. Wrapper objects such as `{ "data": ... }`, `{ "payload": ... }`, `{ "body": ... }`, and `{ "item": ... }` are rejected unless those names are real schema fields for the operation.
|
|
480
|
+
|
|
481
|
+
| Operation | REST request | JSON-RPC params | Success response | Required shape rules |
|
|
482
|
+
|---|---|---|---|---|
|
|
483
|
+
| `bulk_create` | `POST /{resource}` with `[{...row}, {...row}]` | `[{...row}, {...row}]` | `[{...created_row}, {...created_row}]` | Each item is a create input row. Primary keys may be supplied or generated according to the table schema. Empty input creates nothing and returns `[]`. |
|
|
484
|
+
| `bulk_update` | `PATCH /{resource}` with `[{pk: value, ...patch}, ...]` | `[{pk: value, ...patch}, ...]` | `[{...updated_row}, ...]` | Each item must include the model primary-key field. Non-PK fields are patched; omitted mutable fields remain unchanged. Immutable columns for `update` are skipped. |
|
|
485
|
+
| `bulk_replace` | `PUT /{resource}` with `[{pk: value, ...replacement}, ...]` | `[{pk: value, ...replacement}, ...]` | `[{...replaced_row}, ...]` | Each item must include the model primary-key field. Replacement semantics apply per row: missing mutable attributes are cleared according to replace behavior, while immutable columns for `replace` are skipped. |
|
|
486
|
+
| `bulk_merge` | `PATCH /{resource}` with `[{pk: value, ...fields}, ...]` | `[{pk: value, ...fields}, ...]` | `[{...merged_or_created_row}, ...]` | Rows with an existing primary key are merged; rows with no key or a non-existing key are created/upserted. Existing-row merge follows the scalar `merge` semantics. |
|
|
487
|
+
| `bulk_delete` | `DELETE /{resource}` with `[pk1, pk2]` | `[pk1, pk2]` | `{ "deleted": N }` | Input is a sequence of primary-key values. The schema/docs layer may expose an `ids` wrapper for component naming, but REST and JSON-RPC call paths normalize a bare ID list. Empty input returns `{ "deleted": 0 }`. |
|
|
488
|
+
|
|
489
|
+
Example REST payloads:
|
|
490
|
+
|
|
491
|
+
```json
|
|
492
|
+
[
|
|
493
|
+
{ "id": "w-1", "name": "first" },
|
|
494
|
+
{ "id": "w-2", "name": "second" }
|
|
495
|
+
]
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
```json
|
|
499
|
+
["w-1", "w-2"]
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
Example JSON-RPC calls:
|
|
503
|
+
|
|
504
|
+
```json
|
|
505
|
+
{
|
|
506
|
+
"jsonrpc": "2.0",
|
|
507
|
+
"method": "Widget.bulk_update",
|
|
508
|
+
"params": [
|
|
509
|
+
{ "id": "w-1", "name": "renamed" },
|
|
510
|
+
{ "id": "w-2", "name": "retitled" }
|
|
511
|
+
],
|
|
512
|
+
"id": 1
|
|
513
|
+
}
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
```json
|
|
517
|
+
{
|
|
518
|
+
"jsonrpc": "2.0",
|
|
519
|
+
"method": "Widget.bulk_delete",
|
|
520
|
+
"params": ["w-1", "w-2"],
|
|
521
|
+
"id": 2
|
|
522
|
+
}
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Bulk operations are not part of the minimal canonical default set. They are enabled by operation specs, mixins such as `BulkCapable`, `Replaceable`, and `Mergeable`, or explicit table configuration. `bulk_replace` depends on replacement support, and `bulk_merge` depends on merge support. When a bulk REST route claims the same collection method as a scalar route, the bulk route suppresses the conflicting scalar REST route; the scalar JSON-RPC method can still be exposed by name.
|
|
526
|
+
|
|
527
|
+
## REST, JSON-RPC, and Transport Projection
|
|
528
|
+
|
|
529
|
+
Tigrbl projects the same operation inventory across multiple protocol surfaces:
|
|
530
|
+
|
|
531
|
+
| Surface | Binding family | Framing | Primary use |
|
|
532
|
+
|---|---|---|---|
|
|
533
|
+
| REST over HTTP/HTTPS | request | JSON | Resource-oriented CRUD and conventional HTTP clients. |
|
|
534
|
+
| JSON-RPC over HTTP/HTTPS | request | JSON-RPC | Method-oriented clients, batch-capable RPC contracts, and OpenRPC generation. |
|
|
535
|
+
| HTTP stream | stream | stream or configured stream framing | Server-streaming outputs and progressive responses. |
|
|
536
|
+
| SSE | stream | SSE | Browser-friendly event streams. |
|
|
537
|
+
| WebSocket/WSS | message | text or JSON-RPC when negotiated | Bidirectional message workflows. |
|
|
538
|
+
| WebTransport | session, stream, or datagram | WebTransport outer framing plus lane-specific inner framing | Session, stream, and datagram transports with fail-closed lane validation. |
|
|
539
|
+
|
|
540
|
+
The framework keeps protocol, exchange, and framing separate. For example, strict JSON-RPC document framing is `jsonrpc`; newline-delimited JSON-RPC should be modeled distinctly rather than collapsed into plain `ndjson`. Unsupported combinations fail closed during binding or runtime planning instead of being guessed.
|
|
541
|
+
|
|
542
|
+
## Request Lifecycle and Hook Phases
|
|
543
|
+
|
|
544
|
+
Runtime-owned routing flows through stable phases. Hooks attach to phases, atoms provide framework work, and the kernel records the plan used for each model operation.
|
|
545
|
+
|
|
546
|
+
| Phase | Role |
|
|
547
|
+
|---|---|
|
|
548
|
+
| `INGRESS_BEGIN` | Start request or transport-unit handling and initialize context. |
|
|
549
|
+
| `INGRESS_PARSE` | Parse transport payloads, request metadata, path variables, query data, or message bodies. |
|
|
550
|
+
| `INGRESS_DISPATCH` | Resolve the target operation, binding, and protocol subevent. |
|
|
551
|
+
| `PRE_TX_BEGIN` | Run pre-transaction checks before a database transaction exists. |
|
|
552
|
+
| `START_TX` | Open or attach transaction/session state when the operation requires it. |
|
|
553
|
+
| `PRE_HANDLER` | Resolve dependencies, validate inputs, enforce policy, and prepare handler state. |
|
|
554
|
+
| `HANDLER` | Execute the operation handler or system handler. |
|
|
555
|
+
| `POST_HANDLER` | Normalize handler output and run in-transaction post-processing. |
|
|
556
|
+
| `PRE_COMMIT` | Run final in-transaction checks before commit. |
|
|
557
|
+
| `TX_COMMIT` | Flush/commit when Tigrbl owns the transaction; also exposed historically as `END_TX`. |
|
|
558
|
+
| `POST_COMMIT` | Run committed-side effects before response shaping. |
|
|
559
|
+
| `EGRESS_SHAPE` | Build response envelopes, apply masks, negotiate output shape, and prepare transport response data. |
|
|
560
|
+
| `EGRESS_FINALIZE` | Apply headers/status/renderers and finalize transport response. |
|
|
561
|
+
| `POST_RESPONSE` | Run after-response work that should not affect the returned payload. |
|
|
562
|
+
| `ON_*_ERROR` | Phase-specific error handling; falls back to `ON_ERROR` when no specific chain handles the failure. |
|
|
563
|
+
| `TX_ROLLBACK` | Roll back transaction-owned work and perform cleanup; also exposed historically as `ON_ROLLBACK`. |
|
|
564
|
+
|
|
565
|
+
Happy path:
|
|
566
|
+
|
|
567
|
+
```text
|
|
568
|
+
INGRESS_BEGIN
|
|
569
|
+
INGRESS_PARSE
|
|
570
|
+
INGRESS_DISPATCH
|
|
571
|
+
PRE_TX_BEGIN
|
|
572
|
+
START_TX
|
|
573
|
+
PRE_HANDLER
|
|
574
|
+
HANDLER
|
|
575
|
+
POST_HANDLER
|
|
576
|
+
PRE_COMMIT
|
|
577
|
+
TX_COMMIT
|
|
578
|
+
POST_COMMIT
|
|
579
|
+
EGRESS_SHAPE
|
|
580
|
+
EGRESS_FINALIZE
|
|
581
|
+
POST_RESPONSE
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
Use hooks for policy, validation, enrichment, audit, response shaping, and post-response work. Keep core persistence and transport handling inside ops and atoms so REST, JSON-RPC, diagnostics, and schemas stay aligned.
|
|
585
|
+
|
|
586
|
+
```python
|
|
587
|
+
from tigrbl import hook_ctx
|
|
588
|
+
|
|
589
|
+
@hook_ctx(ops="create", phase="PRE_HANDLER")
|
|
590
|
+
async def validate_name(ctx):
|
|
591
|
+
payload = ctx["request"].payload
|
|
592
|
+
if payload.get("name") == "reserved":
|
|
593
|
+
raise ValueError("reserved name")
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
Hooks can also be registered imperatively on the model or composed by packages that build operation specs. Running apps can expose `/system/hookz` to inspect registered hook order and `/system/kernelz` to inspect the compiled phase plan.
|
|
597
|
+
|
|
598
|
+
## Step Types and Kernel Labels
|
|
599
|
+
|
|
600
|
+
Execution plans are composed from labeled steps:
|
|
601
|
+
|
|
602
|
+
| Step type | Owner | Purpose |
|
|
603
|
+
|---|---|---|
|
|
604
|
+
| `secdep` | Application or security package | Authentication and authorization dependencies that run before ordinary dependencies. |
|
|
605
|
+
| `dep` | Application or extension package | General dependency resolution and request context hydration. |
|
|
606
|
+
| `hook:sys` | Tigrbl | Built-in system hooks for runtime behavior, transaction handling, schema work, and transport work. |
|
|
607
|
+
| `hook:wire` | Application or extension package | User hooks registered through decorators or specs. |
|
|
608
|
+
| `atom:<domain>:<subject>` | Tigrbl atoms/kernel | Small runtime units such as ingress parsing, dispatch, validation, handler invocation, response shaping, or transport emission. |
|
|
609
|
+
|
|
610
|
+
Kernel labels make execution order reviewable, for example `PRE_HANDLER:hook:wire:myapp.audit@PRE_HANDLER` or `EGRESS_SHAPE:atom:wire:dump`. Treat labels as diagnostics, not as a stable replacement for the public decorator/spec APIs.
|
|
611
|
+
|
|
612
|
+
## Engine and Session Semantics
|
|
613
|
+
|
|
614
|
+
Engines are declared through specs, providers, decorators, or concrete engine instances. Resolution chooses the most specific binding:
|
|
615
|
+
|
|
616
|
+
```text
|
|
617
|
+
operation > table/model > router > app > defaults
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
Use engine specs and Tigrbl's engine decorators instead of creating ad-hoc SQLAlchemy engines inside handlers. This keeps transaction ownership, routing, diagnostics, engine plugins, and tests coherent.
|
|
621
|
+
|
|
622
|
+
```python
|
|
623
|
+
from tigrbl.decorators.engine import engine_ctx
|
|
624
|
+
from tigrbl.engine.shortcuts import engine_spec
|
|
625
|
+
|
|
626
|
+
db = engine_spec(kind="sqlite", mode="memory")
|
|
627
|
+
|
|
628
|
+
@engine_ctx(db)
|
|
629
|
+
class Item:
|
|
630
|
+
__tablename__ = "items"
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
Database sessions are guarded by lifecycle phase. Do not call `flush()` or `commit()` directly from application hooks or handlers unless you are implementing a framework-level atom with the correct guard contract. Let `START_TX`, `PRE_HANDLER`, `HANDLER`, `POST_HANDLER`, `PRE_COMMIT`, and `TX_COMMIT` own transaction progression.
|
|
634
|
+
|
|
635
|
+
## Configuration and Schema Precedence
|
|
636
|
+
|
|
637
|
+
Tigrbl resolves configuration by layering broad defaults first and specific intent last:
|
|
638
|
+
|
|
639
|
+
```text
|
|
640
|
+
per-request overrides > operation spec > column spec > table spec > router spec > app spec > framework defaults
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
Use that same mental model for schema, response, path, engine, and operation behavior. Put shared policy at app/router scope, model-specific behavior at table scope, field behavior at column scope, and exceptional behavior in operation specs or request overrides.
|
|
644
|
+
|
|
645
|
+
Common table-level declarations include:
|
|
646
|
+
|
|
647
|
+
- `__tigrbl_request_extras__` and `__tigrbl_response_extras__` for operation-scoped virtual fields.
|
|
648
|
+
- `__tigrbl_register_hooks__` or hook decorators for lifecycle customization.
|
|
649
|
+
- `__tigrbl_nested_paths__` for hierarchical REST paths.
|
|
650
|
+
- `__tigrbl_allow_anon__` for anonymous operation access.
|
|
651
|
+
- `__tigrbl_owner_policy__` and `__tigrbl_tenant_policy__` for ownership and tenancy injection.
|
|
652
|
+
- `__tigrbl_verb_aliases__` and `__tigrbl_verb_alias_policy__` for operation naming and alias behavior.
|
|
653
|
+
|
|
654
|
+
## Best Practices
|
|
655
|
+
|
|
656
|
+
- Use `tigrbl` facade imports in application code; import split packages directly only for framework extension work.
|
|
657
|
+
- Model domain actions as operations, not ad-hoc routes, so REST, JSON-RPC, schemas, hooks, OpenAPI, OpenRPC, and diagnostics stay in sync.
|
|
658
|
+
- Use `get_schema(...)` or schema helpers for request/response envelopes instead of hand-rolled Pydantic classes when the payload belongs to a Tigrbl operation.
|
|
659
|
+
- Keep `Table` first in model inheritance when using ORM table classes so table inspection and MRO-sensitive behavior stay deterministic.
|
|
660
|
+
- Bind engines declaratively at app, router, table, or operation scope; do not create engines inside request handlers.
|
|
661
|
+
- Let the lifecycle own transaction boundaries; avoid direct `flush()`, `commit()`, and SQLAlchemy session mutation from user hooks.
|
|
662
|
+
- Put authentication/authorization in security dependencies or `PRE_HANDLER` hooks, not in transport-specific route wrappers.
|
|
663
|
+
- Use `/system/hookz`, `/system/kernelz`, docs endpoints, OpenAPI, and OpenRPC outputs as operational inspection surfaces during debugging.
|
|
664
|
+
- Treat unsupported transport/framing combinations as unsupported, not broken. Preserve fail-closed behavior unless the underlying binding and runtime packages are intentionally extended.
|
|
665
|
+
|
|
396
666
|
## How To Choose This Package
|
|
397
667
|
|
|
398
668
|
Choose `tigrbl` when you want the full public facade: app composition, schema-first routing, REST and JSON-RPC projection, docs generation, engine integration, and CLI workflow. 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/) only when you are building framework extensions or testing a specific internal boundary.
|
|
@@ -416,6 +686,8 @@ Choose `tigrbl` when you want the full public facade: app composition, schema-fi
|
|
|
416
686
|
- [Package layout](https://github.com/tigrbl/tigrbl/blob/master/docs/developer/PACKAGE_LAYOUT.md)
|
|
417
687
|
- [Current target](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/CURRENT_TARGET.md)
|
|
418
688
|
- [Current state](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/CURRENT_STATE.md)
|
|
689
|
+
- [Next steps](https://github.com/tigrbl/tigrbl/blob/master/docs/conformance/NEXT_STEPS.md)
|
|
690
|
+
- [Documentation pointers](https://github.com/tigrbl/tigrbl/blob/master/docs/governance/DOC_POINTERS.md)
|
|
419
691
|
- [SSOT registry](https://github.com/tigrbl/tigrbl/blob/master/.ssot/registry.json)
|
|
420
692
|
- [Release workflow](https://github.com/tigrbl/tigrbl/actions/workflows/publish.yml)
|
|
421
693
|
|
|
@@ -427,7 +699,7 @@ Choose `tigrbl` when you want the full public facade: app composition, schema-fi
|
|
|
427
699
|
|
|
428
700
|
## Package-local Boundary
|
|
429
701
|
|
|
430
|
-
This README is the package-local distribution entry point for `tigrbl`. 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.
|
|
702
|
+
This file is a package-local distribution entry point. This README is the package-local distribution entry point for `tigrbl`. 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.
|
|
431
703
|
|
|
432
704
|
## License
|
|
433
705
|
|