URI resolution and resource discovery
PFS uses existing URI references. Relative references MUST be resolved against the containing document's actual base URI using RFC 3986 §5. A Personafile loaded from an embedded source retains its own base URI for references inside that embedded source.
4.1 Exact-target resolution
When following a pref, a client MUST first resolve the
reference to an exact target:
#fragment: navigate within the current document; do not fetch a different resource.- A local file: read bytes and inspect the content signature. If not a Personafile, offer normal file handling.
- A local directory: look for a default entry file
named exactly
personafilein that directory. Other Personafiles MAY be listed after permissioned scanning. - An HTTP(S) resource URL: request the exact
resource, with
Accept: application/personafile, text/plain;q=0.9, */*;q=0.1as a suggested unregistered media-type preference. If the returned bytes have a valid PFS envelope, open as a persona; otherwise use a fallback content handler.
A website URL is not automatically assumed to have an associated persona just because it returns HTML. Discovery is an additional step, described next.
4.2 Website-level discovery (proposed profile)
For an HTTPS origin, the Personafile browser MAY try:
https://example.com/.well-known/personafile
This is a proposed well-known suffix, not an
IANA-registered one. Registration would be needed before claiming
standards-compliant globally interoperable use. The browser MUST not
blindly transform a deep path like /support/article to the
origin's home persona without user intent or a documented site
mapping.
A Personafile-enabled site MAY also serve different representations
at / according to the HTTP Accept header,
returning HTML for ordinary web clients and PFS for clients requesting
the proposed PFS media type. Both behaviors are optional and do not
require a new transport.
When HTTP retrieval is used, HTTPS SHOULD be required by default
except for explicitly authorized local development. The server SHOULD
use Content-Type: text/plain; charset=utf-8 until a
dedicated Personafile media type is registered. The signature remains
authoritative for PFS file detection.
4.3 Folder-level discovery and frontal persona
A local directory MAY contain numerous independent Personafiles, any
filename or extension. The optional file named exactly
personafile serves as its frontal persona,
analogous to a conventional index entry. A browser opening the folder
SHOULD load this default when present, otherwise display a permissioned
directory listing. It MUST NOT silently read all nested folders or
unrelated user files merely because the folder contains a
Personafile.
Example:
MyCompany/
personafile (front desk)
sales.txt (independent persona)
support.md (independent persona)
accounting (independent persona, no extension)
notes.txt (ordinary file)
The frontend can link to the others with
<pf:a pref="./sales.txt">Sales</pf:a>. Links
open separate personas; they do not embed them. A directory scan MUST
validate content signatures; .md and .txt
extensions alone do not qualify a file as a persona.