Expand description
Exposes the dynamic runtime module.
§Examples
ⓘ
use pharos_native::runtime::dynamic;§Related
crate::runtimefor sibling modules in the same crate.
Structs§
- Runtime
Json Value List - Public struct
RuntimeJsonValueListused by this module.
Enums§
- Declarative
Action Response - Declared document-action response captured from the successfully committed view.
Constants§
- DYNAMIC_
HOST_ PROFILE - Public constant
DYNAMIC_HOST_PROFILEexposed by this module.
Functions§
- action_
resource_ 🔒binding - Resolves a declared action’s resource label without a vendor or table guess.
- active_
user_ id_ from_ cookie - Returns the active user id for a session cookie, rejecting expired or revoked rows.
- admit_
rate_ limited_ request_ runtime_ local - Atomically admits one request under a bounded state-backed rate-limit window.
- append_
bytes_ logic_ local - Appends bytes to a bounded mutable byte buffer.
- append_
rate_ limit_ event_ runtime_ local - Appends one rate-limit event with a monotonic state-local identifier.
- append_
webhook_ receipt - Records one webhook receipt in the app state document with bounded payload size.
- constant_
time_ 🔒equal - Performs constant time equal.
- cookie_
value 🔒 - Performs cookie value.
- csrf_
generate_ random_ hex - Generates a cryptographically sourced hexadecimal token, failing closed on entropy errors.
- csrf_
inject_ hidden_ inputs - Adds the CSRF hidden-input fragment to POST forms without altering other markup.
- csrf_
request_ valid - Parses one bounded runtime timestamp from either epoch seconds or UTC text.
- csrf_
token_ for_ response - Extracts the CSRF token from the cookie header or creates a fresh token.
- csrf_
token_ from_ cookie - Returns the CSRF cookie token when present.
- current_
epoch_ 🔒seconds - Performs current epoch seconds.
- declared_
document_ 🔒storage - Document persistence requires an explicit app declaration; relational actions cannot opt in implicitly.
- declared_
effect_ 🔒steps - Converts the shared action-effect preparation into insertion-only logical operations. This reads declarations, never an app-state projection.
- deliver_
file_ 🔒record - Executes only a validated, committed file-record envelope below its data root.
- deliver_
integration_ webhook - Queues one declaratively configured webhook delivery for background execution.
- dispatch_
response_ file_ for_ request - Serves a bounded route fixture file directly as response bytes.
- dynamic_
action_ 🔒annotations - Builds one bounded action-report annotation map from a declared hook key.
- dynamic_
action_ 🔒failure_ annotations - Builds one bounded action-report annotation map from declared failure hooks.
- dynamic_
action_ 🔒failure_ code - Maps one action failure status to a stable bounded failure code.
- dynamic_
action_ 🔒failure_ report_ root - Builds the failure report without selecting or writing a persistence medium.
- dynamic_
action_ 🔒input_ overrides - Returns one stable action-owned input override map after applying declared normalization hooks.
- dynamic_
action_ 🔒input_ value - Resolves one request input value after applying any declared action normalization hooks.
- dynamic_
action_ 🔒report_ annotations - Builds one bounded action-report annotation map from declared success hooks.
- dynamic_
action_ 🔒resource_ id - Resolves the best available resource identity for one declarative action report or effect.
- dynamic_
append_ 🔒audit_ record - Performs dynamic append audit record.
- dynamic_
append_ 🔒notification - Appends one local notification delivery row.
- dynamic_
append_ 🔒record_ primitive - Performs dynamic append record primitive.
- dynamic_
append_ 🔒records_ from_ input_ list_ primitive - Performs dynamic append records from input list primitive.
- dynamic_
append_ 🔒records_ from_ related_ collection_ primitive - Performs dynamic append records from related collection primitive.
- dynamic_
append_ 🔒scheduled_ job - Appends one durable queued scheduled-job execution for the background worker.
- dynamic_
append_ 🔒webhook_ delivery - Appends one webhook delivery row for the durable background worker.
- dynamic_
append_ 🔒workflow_ events - Appends two minimal workflow events for the applied transition.
- dynamic_
append_ 🔒workflow_ execution - Appends one workflow execution row and returns its id.
- dynamic_
append_ 🔒workflow_ execution_ event - Appends one bounded workflow execution event row tied to a queued or processed job.
- dynamic_
apply_ 🔒approval_ transition - Performs dynamic apply approval transition.
- dynamic_
apply_ 🔒default_ input_ hooks - Performs dynamic apply default input hooks.
- dynamic_
apply_ 🔒scoped_ assignment_ or_ bulk_ update_ primitive - Performs dynamic apply scoped assignment or bulk update primitive.
- dynamic_
apply_ 🔒scoped_ status_ transition_ primitive - Performs dynamic apply scoped status transition primitive.
- dynamic_
contract_ 🔒doc - Loads one app contract document from the active app root.
- dynamic_
cookie_ value - Returns the value of a cookie field using bounded case-sensitive parsing.
- dynamic_
delete_ 🔒records_ by_ scope_ primitive - Performs dynamic delete records by scope primitive.
- dynamic_
delivery_ 🔒payload_ body - Resolves the outbound HTTP request body for one declared adapter kind.
- dynamic_
derived_ 🔒input_ value - Resolves one bounded derived input from the request envelope.
- dynamic_
dispatch_ free_ match - Releases an owned dynamic route match value.
- dynamic_
execute_ declarative_ action - Executes the bounded declarative dynamic-app action contract against persisted state.
- dynamic_
execute_ 🔒declarative_ action_ attempt - Plans one document action; marks only definitely rejected commits for retry.
- dynamic_
find_ 🔒action_ contract - Finds one declarative action contract by id.
- dynamic_
find_ 🔒integration_ adapter - Finds one declared outbound adapter by adapter id.
- dynamic_
find_ 🔒workflow_ transition - Finds one workflow transition contract by action id.
- dynamic_
form_ value - Returns the request form value from the already buffered request body.
- dynamic_
framework_ 🔒notification_ params - Performs dynamic framework notification params.
- dynamic_
generated_ admin_ context_ binding_ mut - Adds the generated-surface context binding to a mutable object.
- dynamic_
http_ 🔒form_ payload - Builds one bounded form-encoded HTTP payload from a flat JSON object.
- dynamic_
http_ 🔒post_ status - Sends one bounded, policy-validated webhook POST.
- dynamic_
integration_ 🔒audit_ adapter_ kind - Performs dynamic integration audit adapter kind.
- dynamic_
integration_ 🔒file_ adapter_ kind - Performs dynamic integration file adapter kind.
- dynamic_
integration_ 🔒http_ adapter_ kind - Performs dynamic integration HTTP adapter kind.
- dynamic_
job_ cancel_ report_ json - Builds a deterministic cancellation report without a shell or external process.
- dynamic_
job_ retry_ report_ json - Builds a deterministic retry report without a shell or external process.
- dynamic_
notification_ 🔒absolute_ url - Performs dynamic notification absolute URL.
- dynamic_
notification_ 🔒origin - Performs dynamic notification origin.
- dynamic_
notification_ 🔒parameter_ value - Resolves one bounded notification parameter value from action input or runtime context.
- dynamic_
notification_ 🔒template_ id_ from_ row - Performs dynamic notification template ID from row.
- dynamic_
notification_ 🔒template_ params - Builds the flat template-parameter map for one declarative notification row.
- dynamic_
presentation_ 🔒text - Reads one text-valued presentation field from a contract node.
- dynamic_
process_ 🔒webhook_ delivery - Processes one queued or retryable webhook delivery in place.
- dynamic_
record_ 🔒contract_ value - Performs dynamic record contract value.
- dynamic_
replace_ 🔒records_ from_ input_ list_ primitive - Performs dynamic replace records from input list primitive.
- dynamic_
resolve_ 🔒ref_ target - Resolves one entity-field reference from the built app contract tree.
- dynamic_
row_ 🔒i64 - Performs dynamic row i64.
- dynamic_
runtime_ host_ profile - Performs dynamic runtime host profile.
- dynamic_
set_ 🔒root_ fields_ primitive - Performs dynamic set root fields primitive.
- dynamic_
state_ 🔒rows - Performs dynamic state rows.
- dynamic_
state_ 🔒rows_ mut - Returns one mutable array section, creating it when absent.
- dynamic_
store_ 🔒last_ action_ report - Appends the last action report and mirrors it into the action report list.
- dynamic_
take_ 🔒next_ global_ id - Returns the next global state id for domain records and advances the root counter.
- dynamic_
take_ 🔒next_ section_ id - Returns the next per-section identifier without consuming the root domain record counter.
- dynamic_
transition_ 🔒presentation_ text - Reads one text field from a workflow transition presentation node.
- dynamic_
update_ 🔒notification_ delivery - Performs dynamic update notification delivery.
- dynamic_
update_ 🔒record_ primitive - Performs dynamic update record primitive.
- dynamic_
upsert_ 🔒record_ primitive - Performs dynamic upsert record primitive.
- dynamic_
url_ 🔒encode_ component - Percent-encodes one bounded form or query component.
- dynamic_
value_ 🔒order_ cmp - Performs dynamic value order cmp.
- dynamic_
webhook_ 🔒payload_ json - Builds one HTTP webhook payload for integration delivery.
- enqueue_
file_ 🔒record - Queues the local effect in the same document commit as its domain mutation.
- ensure_
media_ subtree - Ensures the managed media subtree exists below an app root.
- extract_
ip_ from_ peer_ info_ cookie - Extracts an address-like value from peer metadata cookie text.
- find_
webhook_ endpoint - Finds one framework webhook endpoint in a declarative integration document.
- framework_
webhook_ endpoint_ id - Validates a webhook endpoint identifier against the framework-owned route shape.
- generated_
surface_ label - Performs generated surface label.
- generated_
surface_ user_ has_ capability - Validates a state-backed capability for the current user and tenant.
- handle_
password_ reset_ complete_ action - Updates the password for a reset token in a persisted state document.
- handle_
password_ reset_ request_ action - Returns a password-reset request outcome without sending email or invoking scripts.
- handle_
register_ account_ action - Handles registration by validating form input and appending a password-hash user row.
- handle_
verify_ email_ action - Claims an active email verification row and marks its user verified.
- hash_
password - Creates a salted production PBKDF2-SHA256 password hash.
- hex_
digest 🔒 - Performs hex digest.
- hmac_
sha256 - Computes HMAC-SHA256 with a fixed-size key block and no external process.
- html_
escape 🔒 - Performs HTML escape.
- input_
field_ value_ dup_ logic_ local - Reads one named scalar from a JSON object as owned text.
- integration_
contract_ doc - Loads the active app integration contract from the app root.
- integration_
fixture_ path - Resolves the app-owned integration fixture without leaving the app root.
- is_
declarative_ document_ action - Identifies an app-declared document mutation without choosing a database vendor.
- media_
disk_ path - Resolves a validated media URL to a file below the app media tree.
- mut_
json_ obj_ get_ long_ default - Reads a numeric object field with a bounded fallback.
- mut_
json_ obj_ get_ string - Performs mut JSON obj get string.
- mut_
object_ field_ logic_ local - Inserts one validated field value into a mutable JSON object.
- normalized_
public_ origin - Normalizes a public origin and rejects control characters or unsupported schemes.
- now_
iso_ 🔒utc - Performs now iso utc.
- now_
unix_ epoch_ text_ logic_ local - Returns the current Unix epoch as decimal text.
- page_
title - Returns a page title from declared metadata or a body parameter fallback.
- parse_
http_ url_ logic_ local - Parses and validates an HTTP URL into scheme, host, and optional port.
- pattern_
matches - Returns whether a route pattern matches a request path using bounded segments.
- persist_
app_ state_ text - Persists a complete state JSON document through the bounded filesystem helper.
- prepare_
action_ 🔒effects - Prepares declared effects in memory so their persistence shares the domain transaction. It performs no network request or local-file write.
- prepare_
file_ 🔒record - Prepares an app-declared file effect without touching the filesystem.
- process_
one_ 🔒due_ file_ delivery - Delivers one committed local outbox record. Replayed JSONL writes use the persisted delivery key, and JSON replacement remains naturally idempotent.
- process_
one_ due_ integration_ delivery - Processes one due queued or retryable integration delivery in a worker-owned state transaction.
- process_
one_ due_ notification_ delivery - Processes one due queued or retryable notification delivery in a worker-owned state transaction.
- random_
secret_ hex - Generates a cryptographically random secret encoded as lowercase hexadecimal text.
- record_
field_ matches_ text_ value_ logic_ local - Compares a JSON record field with a bounded text value.
- render_
declared_ page_ response - Renders a declared page without additional response headers.
- render_
declared_ page_ response_ with_ headers - Renders one declared page into a complete response string with bounded headers.
- request_
body_ bytes - Returns a bounded copy of the request body.
- request_
body_ text - Returns the request body as UTF-8 text when valid.
- request_
form_ value - Extracts one form value from the request body with multipart support delegated to the bounded parser.
- request_
has_ session_ cookie - Performs request has session cookie.
- request_
header_ value - Resolves one request header without accepting folded lines.
- request_
is_ hx - Detects the HTMX request header using case-insensitive line parsing.
- request_
origin_ scheme - Returns the scheme trusted for one request transport.
- request_
path - Returns the request path without a query string.
- request_
query_ value - Extracts one decoded query parameter from the request target.
- resolve_
declared_ page_ params_ json - Resolves the small page parameter contract needed by the final Rust renderer.
- resolve_
route_ fixture_ path - Resolves a route fixture below an app root with traversal protection.
- resource_
numeric_ id_ jobs_ logic_ local - Returns a bounded numeric resource identifier from a job resource key.
- revoke_
session_ by_ cookie - Revokes a matching session cookie from a persisted state document.
- route_
pattern_ specificity_ score - Scores a route pattern by its number of literal segments.
- runtime_
json_ value_ list_ append - Performs runtime JSON value list append.
- runtime_
json_ value_ list_ free - Performs runtime JSON value list free.
- runtime_
text_ buffer_ append_ format - Performs runtime text buffer append format.
- runtime_
text_ buffer_ append_ html_ escaped - Performs runtime text buffer append HTML escaped.
- safe_
upload_ filename - Normalizes an uploaded filename to one safe basename.
- session_
cookie_ header - Formats a scoped session cookie with secure defaults and an optional clear operation.
- streq_
casefold_ management_ local - Performs an ASCII case-insensitive string comparison.
- update_
notification_ delivery_ status - Updates one notification delivery row and persists the validated state document.
- value_
long_ equals_ runtime_ local - Compares two numeric JSON values without coercing arbitrary objects.
- value_
to_ 🔒text - Performs value to text.
- verification_
token_ path - Builds the app-relative verification route after validating the token.
- verification_
url - Builds a verification URL from configured origin or a validated Host header.
- verify_
password_ hash - Verifies the native PBKDF2 or development password format without leaking timing information.
- webhook_
request_ signature_ valid - Verifies a declarative webhook signature and timestamp without exposing secret material.
- webhook_
signature_ header_ value_ dup_ logic_ local - Builds the HMAC signature header for an outbound webhook payload.
- write_
app_ state_ text_ file_ runtime_ local - Persists a validated state document at the app-owned state path.
- write_
error_ envelope - Produces a bounded JSON error envelope for direct HTTP handling.
- write_
generated_ surface_ api_ item_ response - Builds one generated API item response with a bounded status envelope.
- write_
generated_ surface_ api_ list_ response - Builds a generated API list response from an array-valued source document.
- write_
generated_ surface_ api_ schema_ response - Applies a route operation response directly as a JSON document.
- write_
html_ response - Builds a complete bounded HTML response envelope.
- write_
html_ response_ with_ headers - Builds an HTML response with caller-supplied validated header lines.
- write_
hx_ fragment_ response_ with_ csrf - Builds an HTMX fragment response with a scoped base path and CSRF cookie.
- write_
json_ error - Renders a bounded JSON error HTTP response without interpolating unescaped data.