Skip to content
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

Refactor Wirings, Routes, Paths #331

Open
16 of 32 tasks
epost opened this issue Jan 30, 2020 · 2 comments
Open
16 of 32 tasks

Refactor Wirings, Routes, Paths #331

epost opened this issue Jan 30, 2020 · 2 comments
Assignees
Labels

Comments

@epost
Copy link
Member

epost commented Jan 30, 2020

goals

  1. Clarify and enforce separation between serialisation format and core data structures.
  2. Make stbx-core data structures addressable in a well-typed way (paths, routes, etc).

tasks

  • Path should be defined in Statebox.Core.WiringTree. (See also Marco's executions PR WIP: 328/transition firing #334 for work on this.)
    • ...or Wiring.Tree or whatever
  • Newtype the labels in Wiring; is now Array Int, should be Array <some newtype>
    • introduce Wiring newtype vs. WiringRaw
    • Split off module Statebox.Core.Net from Statebox.Core.Types
    • Split off module Statebox.Core.Diagram from Statebox.Core.Types
    • Split off module Statebox.Core.Wiring from Statebox.Core.Types
      • Introduce the labels newtype mentioned in parent task.
      • Fix transaction codec breakage.
    • Split off module Statebox.Core.Firing from Statebox.Core.Types
    • Split off module Statebox.Core.Initial from Statebox.Core.Types
  • Statebox.Core.Types
    • Move all definitions from Statebox.Core.Types into submodules, and re-export them.
    • Get rid of explicit Statebox.Core.Types imports; use Statebox.Core instead?
    • Get rid of explicit Statebox.Core.Types module altogether?
  • Dedupe and move types.
    • Singleton should go into `Statebox.Core.Common.
    • Message should go into `Statebox.Core.Common.
    • TxId should go into Statebox.Core.Common.
    • TxId should be removed from Statebox.Transaction (duplication).
    • HexStr should go into Statebox.Core.Common.
    • HexStr should be removed elsewhere.
    • HashStr (should go into Statebox.Core.Common instead of Statebox.Transaction).
    • Make sure stbx-protocol/src/Statebox/Protocol/Fire.purs doesn't have the duplicated Marking stuff (see here).
    • Make sure Tokens, TransitionMarkingF, PlaceMarkingF are not duplicated (see here).
  • Newtype all the things!
    • in stbx-core under Statebox or Statebox.Core look for Ints, type aliases, etc.
  • Addressable Statebox API 'objects' (wirings, diagrams, nets, places, transitions, nets, execution states, etc.) should have their own address/path/route type.
  • Studio Routes should be implemented in terms of these.
  • the findXXX methods in Studio.Model should be split off and factored out into their own module; Transaction.Cache perhaps?
  • Sjoerd: Should the Operator type also be in Statebox.Core? See b591ca5
  • ...
@epost epost added the refactor label Jan 30, 2020
@epost epost changed the title Refactor Route, Paths Refactor Wirings, Routes, Paths Jan 30, 2020
epost added a commit that referenced this issue Jan 30, 2020
…oduce wiring label newtype. #331

- [x] Newtype the `labels` in `Wiring`; is now `Array Int`, should be `Array <some newtype>`
  - [x] Split off module `Statebox.Core.Net` from `Statebox.Core.Types`
  - [x] Split off module `Statebox.Core.Diagram` from `Statebox.Core.Types`
  - [x] Split off module `Statebox.Core.Wiring` from `Statebox.Core.Types`
    - [x] Introduce the `labels` newtype mentioned in parent task.
  - [x] Fix transaction codec breakage.
epost added a commit that referenced this issue Jan 31, 2020
* stbx-core: Split Wiring, Net, Diagram into their own modules and introduce wiring label newtype. #331

- [x] Newtype the `labels` in `Wiring`; is now `Array Int`, should be `Array <some newtype>`
  - [x] Split off module `Statebox.Core.Net` from `Statebox.Core.Types`
  - [x] Split off module `Statebox.Core.Diagram` from `Statebox.Core.Types`
  - [x] Split off module `Statebox.Core.Wiring` from `Statebox.Core.Types`
    - [x] Introduce the `labels` newtype mentioned in parent task.
  - [x] Fix transaction codec breakage.

* stbx-core: Move Firing, Initial, Common submodules out of Statebox.Core.Types. #331

* stbx-core: Define GluedTransitionId(Raw) alongside Wiring and use it in Execution. #331
@sjoerdvisscher
Copy link
Member

Should the Operator type also be in Statebox.Core? See b591ca5

@epost
Copy link
Member Author

epost commented Feb 11, 2020

I added this to the checklist to look into, thanks @sjoerdvisscher.

@epost epost self-assigned this Feb 13, 2020
epost added a commit that referenced this issue Feb 18, 2020
* stbx-core: Split Wiring, Net, Diagram into their own modules and introduce wiring label newtype. #331

- [x] Newtype the `labels` in `Wiring`; is now `Array Int`, should be `Array <some newtype>`
  - [x] Split off module `Statebox.Core.Net` from `Statebox.Core.Types`
  - [x] Split off module `Statebox.Core.Diagram` from `Statebox.Core.Types`
  - [x] Split off module `Statebox.Core.Wiring` from `Statebox.Core.Types`
    - [x] Introduce the `labels` newtype mentioned in parent task.
  - [x] Fix transaction codec breakage.

* stbx-core: Move Firing, Initial, Common submodules out of Statebox.Core.Types. #331

* stbx-core: Define GluedTransitionId(Raw) alongside Wiring and use it in Execution. #331

* stbx-core: Move Path, PathElem into Statebox.Core.Wiring.Tree. #331

* stbx-core: Remove redirects to Path, PathElem from Statebox.Core.Execution. #331

* stbx-core: Alias Transaction.TxId to Core.Types.TxId. #331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants