Skip to main content

Module dynamic

Module dynamic 

Source
Expand description

Exposes the dynamic runtime module.

§Examples

ⓘ
use pharos_native::runtime::dynamic;

Structs§

RuntimeJsonValueList
Public struct RuntimeJsonValueList used by this module.

Enums§

DeclarativeActionResponse
Declared document-action response captured from the successfully committed view.

Constants§

DYNAMIC_HOST_PROFILE
Public constant DYNAMIC_HOST_PROFILE exposed 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.