Repository navigation
feat: add the household task workspace (#23) #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
efraespada
wants to merge
19
commits into
develop
Choose a base branch
from
feature/23-complete-relative-recurrence-lifecycle-and-protected-calendar-after-the-execution-checkpoint
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
91adfe9
docs(sdd): specify issue contract in specs/recurrence-lifecycle-calen…
github-actions[bot] 1bf29de
test: establish the genuine recurrence lifecycle baseline
efraespada 2046b40
docs: prioritize usable task workflows within M2
efraespada a954ce0
Merge develop into feature/23-complete-relative-recurrence-lifecycle-…
vypbot 2ee3ff4
feat: add the household task workspace
efraespada 7d28926
build: package the task workspace in Edge.8
efraespada 93d7d77
fix: preserve task recovery and enforce Unicode form limits
efraespada 2b2da5f
build: publish the corrected task workspace in Edge.9
efraespada 280cdd1
fix: require a reason before rejecting or reopening tasks
efraespada b2729f3
feat: define recurrence cycle closure and successor review policy
efraespada e687211
docs: prioritize shared components and Domus-specific household UX
efraespada fc90ba3
feat: read bounded live and historical recurrence source facts
efraespada a6715d8
docs: define shared UI repository and Storybook ownership
efraespada 992f96b
docs: retain recurrence capability readiness blockers
efraespada ef09331
test: capture reopening response before click auto-wait completes
efraespada 8d2742e
feat: materialize initial relative work atomically with original proof
efraespada 8654b8a
test: retain real reopening responses and per-CPU browser evidence
efraespada c6c2924
feat: encode closed relative lifecycle snapshots without implicit def…
efraespada 8c0a36c
docs: clarify the current recurrence implementation status
efraespada File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| """A composition-scoped source reads original current/history facts without granting effects.""" | ||
|
|
||
| from dataclasses import dataclass | ||
|
|
||
| from domus.application.fixed_materialization import MaintenanceScope | ||
| from domus.application.ports import Transactions | ||
| from domus.application.task_authorization import recorded_request | ||
| from domus.domain.errors import InvalidInput, StorageFailure | ||
| from domus.domain.restoration import RetainedOperation | ||
| from domus.domain.task_events import TaskLifecycleEvent, TaskSourceRecord | ||
|
|
||
|
|
||
| @dataclass(frozen=True, slots=True) | ||
| class RecurrenceObservation: | ||
| original: RetainedOperation | ||
| event: TaskLifecycleEvent | ||
|
|
||
|
|
||
| @dataclass(frozen=True, slots=True) | ||
| class RecurrenceSourcePage: | ||
| items: tuple[RecurrenceObservation, ...] | ||
| after_position: int | ||
| complete: bool | ||
| source_rows_examined: int | ||
|
|
||
|
|
||
| @dataclass(frozen=True, slots=True) | ||
| class RecurrenceSourceObservations: | ||
| transactions: Transactions | ||
| scope: MaintenanceScope | ||
|
|
||
| def read(self, *, limit: int = 100, after: int = 0) -> RecurrenceSourcePage: | ||
| if type(limit) is not int or not 1 <= limit <= 100: | ||
| raise InvalidInput("invalid_page_size") | ||
| if type(after) is not int or not 0 <= after <= 2**63 - 1: | ||
| raise InvalidInput("invalid_task_position") | ||
| with self.transactions.read() as unit: | ||
| self.scope.require(unit) | ||
| records = unit.tasks.lifecycle_sources( | ||
| self.scope.household_id, limit=limit, after=after | ||
| ) | ||
| if type(records) is not tuple or len(records) > limit: | ||
| raise StorageFailure("invalid_recurrence_source") | ||
| items = [] | ||
| previous = after | ||
| for record in records: | ||
| if not isinstance(record, TaskSourceRecord): | ||
| raise StorageFailure("invalid_recurrence_source") | ||
| recorded_request(record.original.evidence) | ||
| try: | ||
| event = record.event(self.scope.installation) | ||
| except InvalidInput, TypeError, ValueError: | ||
| raise StorageFailure("invalid_recurrence_source") from None | ||
| if ( | ||
| event.cycle.household_id != self.scope.household_id | ||
| or event.position <= previous | ||
| ): | ||
| raise StorageFailure("invalid_recurrence_source") | ||
| items.append(RecurrenceObservation(record.original, event)) | ||
| previous = event.position | ||
| # No lookahead is fetched or skipped. An exact full page is conservatively incomplete. | ||
| # Even an empty scan consumes one unit of the independent source currency. | ||
| return RecurrenceSourcePage( | ||
| tuple(items), previous, len(records) < limit, max(1, len(records)) | ||
| ) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.