A fully client-side prototype of the Delfour “insight economy” pipeline. Reasoning runs in your browser via eye-js (EYE in WebAssembly); orchestration is written in Python running in Pyodide. No servers, no build.
use@shopping_assist
, prohibition share@marketing
, duty delete@expiresAt
.use@shopping_assist
) + policy + “now”, rules derive Allowed/Blocked; expiry is enforced.act:Decision
(Allowed/Blocked) and a close-out act:Duty "delete_due"
when expired.--pass-only-new
).The original Python pipeline uses a file bus (data/bus/
). In this browser demo, we mimic the same contract in memory as strings passed to eye-js
. Conceptually, the bus “files” are:
“Bus file” (concept) | Purpose |
---|---|
events.ttl |
Human-readable timeline events (pickup, auth, scan, audit, drop). |
insight.ttl |
The retailer-facing neutral INSIGHT envelope. |
odrl.ttl |
Policy derived from the INSIGHT (shown via Timeline; not physically written). |
now.ttl |
[] ex:now "…ISO…" . — string time fact for rule comparisons. |
request.ttl |
req:r1 odrl:action odrl:use; … purpose "shopping_assist". |
scan.ttl |
The simulated scanned product [] shop:scannedProduct prod:… . |
runtime_out.json |
Device banner JSON (headline, note, suggested alternative). |
audit.ttl |
Derived act:Decision and close-out act:Duty entries. |
In the browser we don’t write files; we compose these strings and feed them to
eye-js
runs. The UI shows their content (Insight, Audit, Banner).
demo.html
)ctx:
context (retailer, device, event, timestamp, expiresAt).health:Diabetes ⇒ need:needsLowSugar true.
ins:Insight
(metric/threshold/scope/expiry).AUTHORIZATION BUNDLE — Single eye-js
run combining:
ex:now
)use@shopping_assist
)ex:Expired
when expiresAt < now
)act:Decision
, and at close act:Duty "delete_due"
)math:
built-ins; typed decimals).delete_due
duty to the audit if applicable.health:householdCondition health:Diabetes
(never shown to retailer).schema:Product
items with schema:sugarContent
and schema:price
typed as xsd:decimal
.Rules:
desensitize
→ need:needsLowSugar true
derive_insight
→ neutral ins:Insight
with ins:expiresAt
policy_from_insight
→ ODRL permission/prohibition/duty targeting the Insightexpiry_guard
→ mark ex:Expired
if expiresAt < now
(uses math:lessThan
)odrl_enforce
→ ex:Allowed
/ ex:Blocked
from policy + request (+ expired)audit_rules
→ act:Decision
and close-out act:Duty "delete_due"
shopping_rule
→ when Allowed and scanned product’s sugar ≥ threshold, attach note and alternativePrefix map used throughout:
ins: https://example.org/insight#
ctx: https://example.org/context#
need: https://example.org/need#
health: https://example.org/health#
shop: https://example.org/shop#
ex: https://example.org/enforce#
act: https://example.org/activity#
odrl: http://www.w3.org/ns/odrl/2/
math: http://www.w3.org/2000/10/swap/math#
str: http://www.w3.org/2000/10/swap/string#
xsd: http://www.w3.org/2001/XMLSchema#
schema: http://schema.org/
PICKUP
, POLICY
, AUTH (Allowed/Blocked)
, EXPIRY
(if any), SCAN
, RUNTIME
, AUDIT
, DROP
.act:Decision
and (on close-out) act:Duty "delete_due"
entries.Change the scanned product In the Python code string near the end, change:
scan_ttl = "... [] shop:scannedProduct prod:BIS_001 ."
derive_insight
, set ins:threshold
to another xsd:decimal
.build_context()
, change expiresAt
to now + timedelta(seconds=5)
; rerun after a few seconds to see AUTH: Blocked (expired)
and a delete_due
duty on close.policy_from_insight
to tweak actions (odrl:use
, odrl:share
), purposes, or duties.demo.html
anywhere inside your Pages-served branch; link to it directly.illegal_token
parsing errors — Usually a prefix typo (ensure @prefix schema: <…> .
has a space) or SPARQL FILTER
(not used here; we rely on math:
/str:
built-ins).Retailer sees only the neutral INSIGHT and its ODRL policy.
The “Reason Why” (diabetes → needs low sugar) remains private for the user/agent UI.
ODRL constrains purpose (shopping_assist
), prohibits sharing for marketing
, and requires deletion at expiry.