PersonafileSpecification
On this page1. Architecture & Responsibility Boundaries2. Normative Conformance Matrix3. Behavioral & Protocol Requirements4. Non-Normative Example (Shop → Order #1042)

Agentic MVC & Personafile Dynamic View Layer — Conformance Profile (Shop / Order #1042)

Status: Proposed specification — Working Draft 0.1
Maturity: Experimental; companion profile to Personafile Format specification
Scope: Agentic MVC as a server-side architectural pattern, with Personafile (PERSONAFILE/1.0) as the reference View representation for dynamic, state-dependent, hypermedia-driven applications.

Design goal: In Agentic MVC, the server retains full ownership of Models, authorization, and state transitions, while the View layer renders agent-consumable representations instead of HTML or raw JSON. In this profile, that View representation is an ordinary UTF-8 PERSONAFILE/1.0 text document (with any filename or URL path, no .pfs extension required) supporting stable resource identity, <pf:a> hypermedia navigation, access control, and state-consistent <pf:form> / <pf:api> actions.

1. Architecture & Responsibility Boundaries

Layer / Actor Owns Must Not
Server (Model + Controller + View Renderer) Canonical domain state, authentication & authorization, template sanitization, personafile-core output validation, and state checks on every mutation Trust client-held views as proof of current state or authorization
Agent / Client Runtime Conversation rendering, following <pf:a> links, and submitting <pf:form> / <pf:api> requests Enforce server permissions, mutate state locally, or fabricate unverified views

2. Normative Conformance Matrix

Implementations of an Agentic MVC Personafile view layer MUST satisfy the following end-to-end scenarios:

Test Expected result
Follow the Shop’s link to Order #1042 The destination identifies Order #1042 as a distinct persona.
Open Order #1042 before and after shipment Its identity is stable. Its state and available actions reflect shipment.
Open the order as a caller without access The application withholds the order’s private state and actions.
Submit an address change from a view rendered before shipment The application rejects the request if the order has since shipped.
Submit an authorized address change while the order is editable The application confirms the change and makes the updated view available.

3. Behavioral & Protocol Requirements

  1. Distinct Persona Identity (Persona-ID & Hypermedia Links)
    • Navigating from an index/storefront persona (such as Shop) via <pf:a pref="..."> to a child resource (Order #1042) MUST resolve to a valid PERSONAFILE/1.0 document whose Persona-ID and metadata uniquely identify that resource as its own persona.
  2. Identity Stability vs. State Reflection
    • Re-opening Order #1042 after a domain state transition (pending → shipped) MUST preserve its Persona-ID (and canonical resource identity) while dynamically updating the rendered body state and declared <pf:form> / <pf:api> actions to reflect shipment.
  3. Authorization & Private State Withholding
    • When an unauthenticated or unauthorized caller requests Order #1042, the server MUST either deny access (401/403) or return a redacted view that withholds all private order details (items, shipping address, PII) and omits privileged <pf:form> / <pf:api> declarations.
  4. Optimistic / State-Consistent Action Validation
    • Submitting a state-mutating action (such as an address change) rendered in an earlier view MUST be re-validated against the current server-side domain state (and optionally an ETag or state token) at submission time. If the order has shipped in the meantime, the server MUST reject the stale mutation with an explicit conflict/rejection response (e.g. 409 Conflict or 422 Unprocessable Content).
  5. Authorized Mutation & Fresh View Availability
    • When an authorized caller submits a valid address change while the order is still editable, the server MUST confirm the update and ensure subsequent fetches of Order #1042 render the updated address and state.
  6. Extension-Agnostic Recognition & Output Safety
    • Clean URLs (such as /shop/ or /orders/1042/) MUST NOT require a .pfs suffix. Untrusted model strings interpolated into templates MUST be sanitized against delimiter (---) smuggling and <pf:...> tag injection before validation.

4. Non-Normative Example (Shop → Order #1042)

Personafile bodies are free-form plain text: authors may write in second-person role voice ("You are...", shown below for direct LLM runtime adoption) or first-person entity voice ("I am..."). In both cases, each route renders a talkable conversational entity, not a raw data dump.

Shop (/shop/):

PERSONAFILE/1.0
---
Persona-ID: shop-front
Name: Example Shop
---
You are the Example Shop assistant. Help customers browse products, check store policies, and navigate to their orders.

When a customer asks about Order #1042, open or direct them to that order's persona:
<pf:a pref="/orders/1042/">Talk to Order #1042</pf:a>

Order #1042 (/orders/1042/) — Before Shipment:

PERSONAFILE/1.0
---
Persona-ID: order-1042
Name: Order #1042
---
You are Order #1042 for Example Shop.
Your current status is pending (not yet shipped), and your current shipping address is 123 Main St.

Because you have not shipped yet, you can help the authorized customer review items or update the shipping address:
<pf:form action="/orders/1042/address" method="POST">
  Update shipping address (only valid while pending).
</pf:form>

Order #1042 (/orders/1042/) — After Shipment:

PERSONAFILE/1.0
---
Persona-ID: order-1042
Name: Order #1042
---
You are Order #1042 for Example Shop.
Your current status is shipped, and your shipping address is locked to 123 Main St.

Because you have already shipped, help with tracking and delivery questions, and explain that shipping address changes are no longer accepted.