Skip to content
Alpha: see what works today →
Menu

For tools: runtime/consent.feature

Consent tiers

The scenario the examples run

What a model may do with a person's pods, and what the person must say first: a runtime or an app offers a model tools, and each tool takes one kind of act, at that kind's consent tier. The tools themselves, their names and their inputs, are each runtime's own.

Each pod starts empty, at https://pod.example/, with Ada as its subject (scripted-input/people.ttl).

3 rules, 9 examples: 9 pass, 0 fail, 0 not run

Y1. Each tool a runtime offers a model takes one kind of act and runs at that kind's tier, free or ask

Ruled by What a model may do with a person's pods, rows kind of act, a tool's tier, never

The kinds are cascade:ModelToolActKinds in ontologies/cascade.ttl, each with its cascade:consentTier. A tool declares the one kind it takes and its tier, by the tier's skos:notation, and the tier is its kind's. No tool takes a kind whose tier is cascade:ConsentTierNever, so no door offers one, whatever the person says. A runtime that offers no tool offers nothing to consent to, and passes.

Why the tier belongs to a kind of act, not to a tool. The tools are each implementation's own: the kit has open_trend, the runtime find_changes, and another app will have neither. What must be alike from app to app is what the person is asked before, and that depends on what the tool does, not on its name. So the protocol names what tools do, in nine kinds, and gives each kind its tier; a tool declares which kind it takes. A tool whose declared tier is not its kind's is the one mistake a check can catch without knowing the tool, and Y1's query catches it.

What a model may do with a person's pods: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passno tool the runtime offers a model runs at a tier other than its kind's, or takes a kind whose tier is never
Example: no tool the runtime offers a model runs at a tier other than its kind's, or takes a kind whose tier is never
  Given a new pod for Ada on 2026-01-01 at 09:00
  When the tools offered a model are listed
  When the query is:
    """
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT DISTINCT ?tool WHERE {
      GRAPH <urn:cascade:tools> { ?tool rdfs:label ?name }
      FILTER (NOT EXISTS {
        GRAPH <urn:cascade:tools> { ?tool cascade:modelToolActKind ?kind ; cascade:consentTier ?tier }
        GRAPH <urn:cascade:vocabulary> { ?kind skos:inScheme cascade:ModelToolActKinds ; cascade:consentTier ?tier }
        FILTER (?tier != cascade:ConsentTierNever)
      } || EXISTS {
        GRAPH <urn:cascade:tools> { ?tool ?declares ?one , ?other }
        FILTER (?declares IN (cascade:modelToolActKind, cascade:consentTier) && ?one != ?other)
      })
    }
    """
  Then it answers nothing

Y2. A tool at ask does nothing until the person says yes to that call

Ruled by What a model may do with a person's pods, rows ask, a door that cannot ask; What a write a model proposed records, row asking

The door that offers the tool shows the person what this call will do, and runs it only once they say yes to it. A no, or a question dismissed or left unanswered, does nothing. A yes is for the one call it answers. A door that cannot ask the person offers no tool at cascade:ConsentTierAsk.

Why three tiers, and these. ODRL's permission, permission with an obtainConsent duty, and prohibition are the same three answers, and the kit's two tiers and its NEVER list already sort every tool it has and the ten operations of NEVER into them with nothing left over. A read, and a move of what the app shows, change nothing the person keeps: they are what offering a model the pods means, as a SMART read scope is granted once. A write to a pod cannot be undone by editing it away (X1): a judgment can be retracted, but the pod keeps both, so the person says yes before it exists. Changing the app's tables or settings writes no pod, but changes what every later read says, so it waits for a yes too.

What a model may do with a person's pods: the whole Why, the alternatives that lost and what would change our mind.

5 examples: 5 pass, 0 fail, 0 not run

passa no writes nothing
Example: a no writes nothing
  Given a new pod for Ada on 2026-01-01 at 09:00
  When a model proposes "asthma" and Ada says no on 2026-01-02 at 09:00
  Then that step wrote no file
passa question dismissed writes nothing
Example: a question dismissed writes nothing
  Given a new pod for Ada on 2026-01-01 at 09:00
  When a model proposes "asthma" and Ada dismisses the question on 2026-01-02 at 09:00
  Then that step wrote no file
passa question left unanswered writes nothing
Example: a question left unanswered writes nothing
  Given a new pod for Ada on 2026-01-01 at 09:00
  When a model proposes "asthma" and Ada leaves the question unanswered on 2026-01-02 at 09:00
  Then that step wrote no file
passa yes is for the one call it answers, so the same proposal is asked again
Example: a yes is for the one call it answers, so the same proposal is asked again
  Given a new pod for Ada on 2026-01-01 at 09:00
  And a model proposes "asthma" and Ada says yes on 2026-01-02 at 09:00
  When a model proposes "asthma" and Ada says no on 2026-01-02 at 09:05 (asthma-again)
  Then that step wrote no file
passa door that cannot ask offers no tool at ask
Example: a door that cannot ask offers no tool at ask
  Given a new pod for Ada on 2026-01-01 at 09:00
  When the tools offered a model through a door that cannot ask are listed
  When the query is:
    """
    SELECT ?tool WHERE {
      GRAPH <urn:cascade:tools> { ?tool cascade:consentTier cascade:ConsentTierAsk }
    }
    """
  Then it answers nothing

Y3. A write a model proposed names the model as its proposer, and the person who said yes

Ruled by What a write a model proposed records, rows where it is said, the model, the person who said yes, a judgment's author, told apart, when

The act that wrote it, an entry's session, the act that generated a judgment or a retraction, has one prov:qualifiedAssociation in cascade:ModelProposerRole, whose prov:agent is the model, a prov:SoftwareAgent named by an IRI and typed in the act's file, never the runtime; and one in cascade:PatientRole, whose prov:agent is the person who said yes. A judgment is prov:wasAttributedTo that person, and a retraction prov:wasAssociatedWith them, as the person's own are, and the agent of a retraction's association in cascade:PatientRole is that same person. The door writes the person's prov:Person type in the act's own file, and no prov:wasAssociatedWith from the act to the model. Its time is the yes. A write the person makes themselves names no model, so a reader tells the two apart by the role alone.

Why on the act, as the person's role already is. A person's judgment names its author's role on the act that generated it, and a document names its author, custodian and transmitter on the act that wrote it (judgments.md, row "maker"; republishing-sources.md). The model's part is one more association on the same act, so a query that reads prov:wasGeneratedBy/prov:qualifiedAssociation reads it with no new path, and one that reads prov:wasAttributedTo is unchanged. PROV-O's own property chain makes each qualified association a prov:wasAssociatedWith, so the unqualified statement is not written twice.

What a write a model proposed records: the whole Why, the alternatives that lost and what would change our mind.

3 examples: 3 pass, 0 fail, 0 not run

passan entry a model proposed names, on its session, the model and the person who said yes
Example: an entry a model proposed names, on its session, the model and the person who said yes
  Given a new pod for Ada on 2026-01-01 at 09:00
  When a model proposes "asthma" and Ada says yes on 2026-01-02 at 09:00
  When the query is:
    """
    SELECT ?record ?started ?person ?proposedByAModel WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:asthma> prov:generated ?sessionFile , ?revisionFile }
      GRAPH ?sessionFile {
        ?session a cascade:HandEntrySession ; prov:startedAtTime ?started ;
          prov:qualifiedAssociation [ prov:hadRole cascade:PatientRole ; prov:agent ?person ] .
          ?person a prov:Person .
        OPTIONAL {
          ?session prov:qualifiedAssociation [ prov:hadRole cascade:ModelProposerRole ; prov:agent ?model ] .
          ?model a prov:SoftwareAgent
          FILTER NOT EXISTS { ?session prov:wasAssociatedWith ?model }
        }
      }
      GRAPH ?revisionFile { ?revision a cascade:Revision ; cascade:revisionOf ?record ; prov:wasGeneratedBy ?session }
      BIND (BOUND(?model) AS ?proposedByAModel)
    }
    """
  Then it answers:
    | record             | started                              | person                                    | proposedByAModel |
    | condition "Asthma" | "2026-01-02T09:00:00Z"^^xsd:dateTime | <https://pod.example/profile/card.ttl#me> | true             |
passa judgment a model proposed is the person's and names the model, and one the person made names none
Example: a judgment a model proposed is the person's and names the model, and one the person made names none
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  And Ada files the judgment "latex-mango-different" on 2026-01-03 at 09:00
  When a model proposes "peanut-shellfish-different" and Ada says yes on 2026-01-04 at 09:00
  When the query is:
    """
    SELECT ?member ?author ?at ?proposedByAModel WHERE {
      GRAPH <urn:cascade:steps> { ?step prov:generated ?file }
      FILTER (?step IN (<urn:cascade:step:latex-mango-different>, <urn:cascade:step:peanut-shellfish-different>))
      GRAPH ?file {
        ?judgment a cascade:Judgment ; cascade:verdict cascade:Different ; prov:hadMember ?member ;
          prov:wasAttributedTo ?author ; prov:generatedAtTime ?at ; prov:wasGeneratedBy ?act .
        ?act prov:qualifiedAssociation [ prov:hadRole cascade:PatientRole ; prov:agent ?author ] .
        ?author a prov:Person .
        OPTIONAL {
          ?act prov:qualifiedAssociation [ prov:hadRole cascade:ModelProposerRole ; prov:agent ?model ] .
          ?model a prov:SoftwareAgent
        }
      }
      BIND (BOUND(?model) AS ?proposedByAModel)
    }
    """
  Then it answers:
    | member              | author                                    | at                                   | proposedByAModel |
    | allergy "Latex"     | <https://pod.example/profile/card.ttl#me> | "2026-01-03T09:00:00Z"^^xsd:dateTime | false            |
    | allergy "Mango"     | <https://pod.example/profile/card.ttl#me> | "2026-01-03T09:00:00Z"^^xsd:dateTime | false            |
    | allergy "Peanut"    | <https://pod.example/profile/card.ttl#me> | "2026-01-04T09:00:00Z"^^xsd:dateTime | true             |
    | allergy "Shellfish" | <https://pod.example/profile/card.ttl#me> | "2026-01-04T09:00:00Z"^^xsd:dateTime | true             |
passa retraction a model proposed names, on itself, the model and the person who said yes
Example: a retraction a model proposed names, on itself, the model and the person who said yes
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  And Ada files the judgment "latex-mango-different" on 2026-01-03 at 09:00
  When a model proposes "retract-latex-mango-different" and Ada says yes on 2026-01-04 at 09:00
  When the query is:
    """
    SELECT ?retracted ?person ?at ?proposedByAModel WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:retract-latex-mango-different> prov:generated ?file }
      GRAPH ?file {
        ?retraction prov:invalidated ?retracted ; prov:wasAssociatedWith ?person ; prov:startedAtTime ?at ;
          prov:qualifiedAssociation [ prov:hadRole cascade:PatientRole ; prov:agent ?person ] .
          ?person a prov:Person .
        OPTIONAL {
          ?retraction prov:qualifiedAssociation [ prov:hadRole cascade:ModelProposerRole ; prov:agent ?model ] .
          ?model a prov:SoftwareAgent
        }
      }
      BIND (BOUND(?model) AS ?proposedByAModel)
    }
    """
  Then it answers:
    | retracted                                       | person                                    | at                                   | proposedByAModel |
    | <urn:uuid:5e068021-5ff8-4580-8246-4f28453ace64> | <https://pod.example/profile/card.ttl#me> | "2026-01-04T09:00:00Z"^^xsd:dateTime | true             |