Repository navigation
Bound schedules, instantiate scheduled duties, and window fulfilment (#273) - #274
matthiasautrata wants to merge 9 commits into
Conversation
|
@matthiasautrata is attempting to deploy a commit to the EKGF Team on Vercel. A member of the Team first needs to authorize it. |
7a3f1ac to
cf93e6a
Compare
…KGF#273) Resolves: EKGF#273 Rewrites EKGF#274 on top of the reusable schedule model (EKGF#280), following the EKGF#184 anchor rule: the schedule's DTSTART/TZ sets the occurrence times, and activation only limits the range. §5.5 left scheduled duties unbounded and partly undefined: - expand(schedule, processors, clock) had no lower bound, so a rule without COUNT or UNTIL generated infinitely many instances. - The condition guard evaluated ⟦duty.condition⟧(Σ.env): Σ has no env, the guard did not depend on the occurrence time, and under EKGF#267 the condition is three-valued. - instantiate gave equal values for every t, and nothing in §5.2 or §7.2 generated or evaluated instances: the template itself was fulfilled or violated like any duty. - performed had no time bounds, so one delivery fulfilled every daily instance, past and future. §5.2 also had a stuck state: D-FULFILL required deadline ≥ clock at evaluation time, and D-VIOLATE required no performance, so an action taken before the deadline but evaluated after it left the duty Active. Changes: - expand takes a range (from, to) and returns the schedule's own times within it. The expression alone fixes the times (DTSTART/TZID for RFC 5545, COUNT and UNTIL counted from DTSTART); the range never moves them, and whether expand errs does not depend on it. occurrences uses the range [activatedAt, clock], so a template never activated has no instances. The truncate(anchor, FREQ) of the previous EKGF#274 is no longer needed, since DTSTART fixes the time of day. - The template's condition is evaluated once, by D-ACTIVATE (= true). An error there leaves it Pending and is collected in E₃. - An instance is identified by (template, t), and is Active with activatedAt = t, so relative deadlines run from t. updateDutyStates updates instances after templates; templates are neither fulfilled nor violated, and Steps 6 and 8 of §7.2 report instances through tracked(D). - performed takes a window (since(d), effectiveDeadline(d, Σ)). An instance counts only actions at or after t; other duties count actions from their policy's effectiveDate (EKGF#269). D-FULFILL no longer compares the deadline with the evaluation time. A duty without an asset matches any performed asset. - Specification §4.3 and the dprod:schedule comment say the same. - Add tests/test_schedule_bounds.py, which fails on the previous text. Refs: EKGF#184, EKGF#274, EKGF#275, EKGF#280 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
392be9e to
add97d3
Compare
…KGF#273) Resolves: EKGF#273 Rewrites EKGF#274 on top of the reusable schedule model (EKGF#280), following the EKGF#184 anchor rule: the schedule's DTSTART/TZ sets the occurrence times, and activation only limits the range. §5.5 left scheduled duties unbounded and partly undefined: - expand(schedule, processors, clock) had no lower bound, so a rule without COUNT or UNTIL generated infinitely many instances. - The condition guard evaluated ⟦duty.condition⟧(Σ.env): Σ has no env, the guard did not depend on the occurrence time, and under EKGF#267 the condition is three-valued. - instantiate gave equal values for every t, and nothing in §5.2 or §7.2 generated or evaluated instances: the template itself was fulfilled or violated like any duty. - performed had no time bounds, so one delivery fulfilled every daily instance, past and future. §5.2 also had a stuck state: D-FULFILL required deadline ≥ clock at evaluation time, and D-VIOLATE required no performance, so an action taken before the deadline but evaluated after it left the duty Active. Changes: - expand takes a range (from, to) and returns the schedule's own times within it. The expression alone fixes the times (DTSTART/TZID for RFC 5545, COUNT and UNTIL counted from DTSTART); the range never moves them, and whether expand errs does not depend on it. occurrences uses the range [activatedAt, clock], so a template never activated has no instances. The truncate(anchor, FREQ) of the previous EKGF#274 is no longer needed, since DTSTART fixes the time of day. - The template's condition is evaluated once, by D-ACTIVATE (= true). An error there leaves it Pending and is collected in E₃. - An instance is identified by (template, t), and is Active with activatedAt = t, so relative deadlines run from t. updateDutyStates updates instances after templates; templates are neither fulfilled nor violated, and Steps 6 and 8 of §7.2 report instances through tracked(D). - performed takes a window (since(d), effectiveDeadline(d, Σ)). An instance counts only actions at or after t; other duties count actions from their policy's effectiveDate (EKGF#269). D-FULFILL no longer compares the deadline with the evaluation time. A duty without an asset matches any performed asset. - Specification §4.3 and the dprod:schedule comment say the same. - Add tests/test_schedule_bounds.py, which fails on the previous text. Refs: EKGF#184, EKGF#274, EKGF#275, EKGF#280 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…EKGF#271) Resolves EKGF#271. §7.2 Step 1 collected a duty only if `matches(n, request)`, i.e. if the duty's own action and asset matched the request. A duty states what the bearer must do, not what is requested, so a request to display ex:marketData never collected the duty to report on ex:usageStats, and §12.3's example returned no duties. Step 2 then partitioned by `d.subject = grantor` / `d.subject = grantee`, so a duty without dprod:subjectOfDuty belonged to neither party, though specification §3.2 and term-mapping describe consumer duties without a subject. The ontology comment on dprod:subjectOfDuty contradicted those documents: it defaulted the bearer to the data product owner, which is the provider. - §3.2: before evaluation, a duty without a subject takes the policy's grantee, or the requesting agent in a policy without one. `d.subject` is then the bearer everywhere, including `performed`. A duty borne by the requesting agent stands for one duty per agent, tracked separately in Σ, so one agent's missed duty is not held against another. - §7.2: duties are collected from every policy with a permission in force for the request; grantor duties are those borne by the grantor, and all others are grantee duties. §12.2 matches. - Collecting every duty of a granting policy makes a provider's missed delivery reachable from every consumer request. Violated is terminal, so denying on it would lock the consumer out permanently. Step 6 now denies only on violations by the grantee's side; the grantor's are reported in `violations` on the Permit. - dprod:subjectOfDuty comment, specification §4.10, and term-mapping state the default. - Add tests/test_duty_bearer.py, which fails on the previous text. Rebased onto EKGF#268 (order-independent errors): a policy grants only if a permission is active (= true), and a permission in error in a policy that does not otherwise grant (E4) gives Failure on the Permit path, since resolving it could engage that policy's duties. Section 9.7 now also keeps the grantor violations reported with a Permit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Carried forward onto develop for EKGF#275 by Matthias Autrata: conflicts resolved against EKGF#244/EKGF#245/EKGF#262/EKGF#268/EKGF#270/EKGF#272, the namespace changed from https://www.omg.org/spec/DPROD/dprod/ to https://ekgf.org/dprod/spec/develop/, and EKGF#244's duty-only shape and test migrated from dprod:recurrence to dprod:schedule, which is not duty-only.]
Shapes: accept tab-separated POSIX crontab fields and reject smuggled tab/CR/LF content; allow EXDATE/RDATE lines in RFC 5545 expressions while rejecting non-standard or duplicate RRULE parts; reject a dprod:scheduleTimeZone that conflicts with the embedded TZID; move the IRI-identifier message onto its own shape so it no longer annotates unrelated violations. Ontology: every dprod:ScheduleFormat now declares dprod:carriesTimeZone, and the timezone-required rule keys on it so extension formats get the same enforcement as POSIX crontab. Semantics: schedule errors freeze the affected duty (Rule D-FREEZE), surface in the result's errors field, and the processor registry is part of Σ, so the totality and determinism theorems hold for unprocessable schedules too. Tests and CI: every schedule case is validated both with the ontology graph and in the bare documented CLI configuration, making the sh:class constraints falsifiable; the obsolete-recurrence sweep covers specification.md; validate.py runs in the build workflow. Docs: define the previously missing example schedules, rewrite the RRULE components table as complete expressions, and sync the guide checklist and specification with the new rules. [Carried forward onto develop for EKGF#275 by Matthias Autrata: the build-spec.yml change is dropped (EKGF#262 already runs validate.py in CI), and the namespace in the new shapes is the develop one. Schedule errors are fitted to the error model of EKGF#267: instead of an `errors` field on a Permit result, an unprocessable schedule of a collected duty is gathered in E₅ and gives Failure on the Permit path, like E₃ and E₄. Deny and NotApplicable are unaffected, since resolving the schedule can only add duties or violations. EvaluationError admits ScheduleError, and §9.7's completion covers schedule errors.] Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…EKGF#184) The core spec's contract section, its worked contract example, the contracts examples under examples/contracts/ and the overview diagram were added after EKGF#234 and still used the removed dprod:recurrence. Each recurring duty now references an identified dprod:Schedule (an RFC 5545 DTSTART with TZID plus RRULE), embedded as a node object in the JSON-LD; all five documents expand without dropping a term and conform to the contracts shapes. The schedule identifier shape is renamed RejectAnonymousScheduleShape, following the Reject* convention, so the spec generator no longer renders it as a second Schedule class; it is listed with the other rejection shapes in the specification. Schedule and ScheduleFormat are now contract classes in the generated spec. dprod:schedule has no domain, so it is no longer expected among the properties extending ODRL classes. Refs: EKGF#184, EKGF#234, EKGF#275 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…KGF#273) Resolves: EKGF#273 Rewrites EKGF#274 on top of the reusable schedule model (EKGF#280), following the EKGF#184 anchor rule: the schedule's DTSTART/TZ sets the occurrence times, and activation only limits the range. §5.5 left scheduled duties unbounded and partly undefined: - expand(schedule, processors, clock) had no lower bound, so a rule without COUNT or UNTIL generated infinitely many instances. - The condition guard evaluated ⟦duty.condition⟧(Σ.env): Σ has no env, the guard did not depend on the occurrence time, and under EKGF#267 the condition is three-valued. - instantiate gave equal values for every t, and nothing in §5.2 or §7.2 generated or evaluated instances: the template itself was fulfilled or violated like any duty. - performed had no time bounds, so one delivery fulfilled every daily instance, past and future. §5.2 also had a stuck state: D-FULFILL required deadline ≥ clock at evaluation time, and D-VIOLATE required no performance, so an action taken before the deadline but evaluated after it left the duty Active. Changes: - expand takes a range (from, to) and returns the schedule's own times within it. The expression alone fixes the times (DTSTART/TZID for RFC 5545, COUNT and UNTIL counted from DTSTART); the range never moves them, and whether expand errs does not depend on it. occurrences uses the range [activatedAt, clock], so a template never activated has no instances. The truncate(anchor, FREQ) of the previous EKGF#274 is no longer needed, since DTSTART fixes the time of day. - The template's condition is evaluated once, by D-ACTIVATE (= true). An error there leaves it Pending and is collected in E₃. - An instance is identified by (template, t), and is Active with activatedAt = t, so relative deadlines run from t. updateDutyStates updates instances after templates; templates are neither fulfilled nor violated, and Steps 6 and 8 of §7.2 report instances through tracked(D). - performed takes a window (since(d), effectiveDeadline(d, Σ)). An instance counts only actions at or after t; other duties count actions from their policy's effectiveDate (EKGF#269). D-FULFILL no longer compares the deadline with the evaluation time. A duty without an asset matches any performed asset. - Specification §4.3 and the dprod:schedule comment say the same. - Add tests/test_schedule_bounds.py, which fails on the previous text. Refs: EKGF#184, EKGF#274, EKGF#275, EKGF#280 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under the instance generation in this PR, an occurrence becomes an instance only once its scheduled time has passed, and it is Active from then on. The example's 6 February instance, recorded as Pending and "not yet due", therefore cannot exist. It is removed, and the README says when an occurrence becomes an instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The overview gave each instance a "fulfilment window (dprod:deadline)". Under this PR the window runs from the occurrence to the deadline, and an unscheduled duty can have a deadline as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
add97d3 to
2199fae
Compare
|
Contradiction: does a scheduled duty instance start Active or Pending? The spec currently gives two answers, and they produce different deadlines. (Line numbers are Example. A daily 06:00 delivery duty with a relative deadline: ex:dailyDelivery a odrl:Duty ;
odrl:action ex:deliver ;
dprod:schedule ex:daily0600 ; # DTSTART;TZID=Europe/London:…T060000, RRULE:FREQ=DAILY
dprod:deadline "PT2H"^^xsd:duration .On 4 Feb nothing is delivered, and the first evaluation that day is at 10:00. Is the 4 Feb instance violated? Reading A — §5.5 (lines 632–641): yes.
So Reading B — Σ₀ (line 290) + §5.2 update rule (~line 495) + Σ₀ gives every duty So the instance starts Pending, and at 10:00 it becomes Active with
Under reading B the deadline also moves with whenever someone first evaluates (first check at 15:00 gives a 17:00 deadline), so a provider escapes violations simply because nobody checked. Reading A is clearly the intent. Suggested fix:
|
Resolves the conflicts with develop. EKGF#280 and EKGF#272 landed as squash merges, so this branch's copies of their commits conflicted with them. The resolved tree is this branch's own commits and EKGF#274's replayed on develop: - Shapes use the dprod-contracts-shapes: prefix that develop adopted (EKGF#295), including the new ActionShape and the specification's shape tables. - ActionShape gains the dct:description every contracts shape carries since EKGF#302. Core 93 OK, contracts 121 OK, validate.py clean (Python 3.13, as CI). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…KGF#273) EKGF#280 and EKGF#272 landed on develop as squash merges, so this branch's original copies of their commits conflicted with them in six files. The branch's base (ae26a40) has exactly the tree EKGF#280 merged, so the resolution is this PR's own three commits (0cd39d4, 4883ca3, 2199fae) replayed on develop; all three apply without conflict. Core 99 OK, contracts 117 OK, validate.py clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves #273. Step 8 of #275.
Rewritten on top of the reusable schedule model (#280). It follows the #184 anchor rule: the schedule's DTSTART/TZ sets the occurrence times, and activation only limits the range. The earlier version of this PR, written against
dprod:recurrence, is replaced.Stacking
This PR builds on #280, which itself contains #268, #272 and #270. Until those merge, the PR also shows their commits. The change in this PR is the last three commits,
cf93e6a,b178622and392be9e. Merge after #280. Then squash-merge directly, or first rebase those commits ontodevelop.Problem
§5.5 left scheduled duties unbounded and partly undefined:
expand(schedule, processors, clock)had no lower bound, so a rule withoutCOUNTorUNTILgenerated infinitely many instances.⟦duty.condition⟧(Σ.env), which is broken in three ways:env.instantiategave equal values for everyt. Nothing in §5.2 or §7.2 generated or evaluated instances, so the template itself was fulfilled or violated like any other duty.performedhad no time bounds, so one delivery fulfilled every daily instance, past and future.§5.2 also had a stuck state. D-FULFILL required
deadline ≥ clockat evaluation time, and D-VIOLATE required that no action had been performed. An action taken before the deadline but evaluated after it therefore left the duty Active.Changes
expandtakes a range(from, to)and returns the schedule's own times within it.DTSTART/TZIDfor RFC 5545 (withCOUNT/UNTILcounted fromDTSTART), and the five fields plusdprod:scheduleTimeZonefor crontab. The range never moves them.expandreturns an error does not depend on the range, so D-FREEZE and E₅ still catch a bad schedule on a template that hasn't activated yet.occurrencesuses[activatedAt, clock], so a template that was never activated has no instances.truncate(anchor, FREQ)is gone, becauseDTSTARTalready fixes the time of day.= true). An error leaves the template Pending, and the error is collected in E₃ (Failure on the Permit path).(template, t)and is Active withactivatedAt = t, so relative deadlines run fromt.updateDutyStatesupdates the instances after the templates.tracked(D).performed(…, (since(d), effectiveDeadline(d, Σ)), Σ).t.effectiveDate(Formal semantics: rules whose target differs from the policy's can never apply; validity dates are never evaluated #269). A payment made in advance counts, but an action from before the contract does not.dprod:schedulecomment say the same.dprod-contracts/tests/test_schedule_bounds.py. All 8 tests fail on Reusable schedule model (#184) #280's text.Tests
validate.pyclean.validate.pyclean.🤖 Generated with Claude Code