Skip to main content

Module authoring

Module authoring 

Source
Expand description

Authoring vocabulary + render planner (Phase 5): a qapp declares 3D + 2D views over one manifold; the planner enforces attestation gates, rights-bounded contexts, and budget-driven 3D→2D degradation before drawing. Gated like place_time (needs crate::modalities). Phase 5 — the authoring vocabulary (ns/ui) + render planner (the qapps upgrade; §6/§7).

Upgrades the qapps model ([docs/manuals/qapps_specification.md]) from 2D-pane CSS-grid layouts to manifold worlds: a qapp declares views over one manifold (a 3D scene and a 2D pane from the SAME source), each carrying governance + budget annotations the engine enforces at plan time — before anything is drawn.

This module is the in-memory vocabulary + planner. The wire-form (yaml-ld-q42 → RDF → CBOR-LD → NQuin @context expansion) is task #8; ShEx describes the contract and SHACL enforces the shape (ADR 0009) — one source. Those are deliberately not duplicated here; this is the runtime the parsed document drives.

§The rails (RENDERER_DEFINITION §8) — enforced, not reinvented

  • Governance primitives are the §8 substrate surfaced. Rights-bounded refusal reuses the inherited logic::deontic gate (the same one Phases 3–4 use); this module authors no new normative rules — it only applies caller-supplied norms.
  • Wisdom-out-of-band (attestation gates). A view marked requires_attestation is withheld until an attestation is present — the human ratifies by attesting (a DID-signature trigger). Signature verification is the identity/key-vault layer’s job (it fails closed there); this gate enforces the presence of an attestation, the out-of-band hook.
  • Affordability at authoring time. Budget is declared, not hoped-for: on a constrained device tier a Scene3D view degrades to 2D ([ViewDisposition::Collapsed2D]) rather than failing — graceful 3D→2D, so the qapp still works on hardware people own.
  • Fail closed. Rights-bounded render in a shared/civic standpoint defaults to refuse.

Structs§

QappView
One declared view in a qapp: a projection of manifold, with governance + budget annotations.
RenderStandpoint
The standpoint a qapp is being rendered into.

Enums§

Sensitivity
Sensitivity class — surfaces the §8 rights-bounded context primitive (not new doctrine).
ViewDisposition
What the planner decides for a view (before any drawing happens).
ViewKind
A view onto the manifold within a qapp.

Constants§

MAX_GOV_NORMS
Max governance norms evaluated per rights-bounded check (stack-bounded, zero-heap).
MAX_QAPP_VIEWS
Max views planned in one plan_qapp pass (stack-bounded, zero-heap).
P_ATTESTS
Predicate stamp for an attestation (attester) attests (manifold).
P_VIEW_RENDER
Property-path for a view-render action governed by a deontic norm.

Functions§

attestation_quin
Build an attestation quin (attester) attests (manifold) in a frame. Real DID-signature verification belongs to the identity/key-vault layer; this is the presence hook the gate checks.
has_attestation
Whether some attestation in attestations ratifies this view’s manifold.
plan_qapp
Plan a whole qapp: write each view’s disposition into out. Zero-heap (caller slices). Returns the number of dispositions written (min(views.len(), out.len())).
plan_view
Resolve one view’s disposition, applying the gates in order: attestation → rights-bounded → budget. (Governance refusals take precedence over budget degradation — a refused view is not “degraded”, it is withheld/refused.)
rights_render_permitted
Whether sensitive content for manifold may render into standpoint.
sample_world_qapp
A sample qapp: a Scene3D + a Pane2D over the same manifold — “one manifold, two views”.
supports_3d
Whether the device tier supports the full 3D scene — delegates to the single-source budget rule OperationalMode::supports_3d (shared with the portal facade). Eco/Reserve degrade 3D → 2D — the affordability rail.
view_render_norm
Build a civic-render consent norm (standpoint) OPCODE render(manifold) in a frame.