forked from gotchoices/MyCHIPs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
300 lines (283 loc) · 14 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
TODO:
Immediate:
X- Integrate DSR phase-1 work into source tree
X- Why can't user UI connect to sim spa hosts?
X- Set user host/port and peer port correctly on simulated hosts
X- Can view/modify/render .puml diagrams
X- Edit Tally, Lift documents, include diagrams
- Make a sequence diagram for each use case
- Port state diagrams to puml
- Make chit consensus sequence/state diagrams
- Make a master protocol document/folder to hold all diagrams
- Include property descriptions used by spin models
-
- Extend Wyseman to receive connections on TCP socket
- Make command-line user interface?
-
- Integrate DSR patches into simulation folder?
-
General roadmap:
X- Public Proof-of-Concept release
- Iterate on TLA+ modeling until protocol is sufficiently safe/live
- Integrate improved protocol into source code
- Improve/expand agent model (see below)
- Write more unit tests
- Implement basic contract handling (author, display, print, publish)
- Make Wylib User SPA GUI useable (or jump to basic mobile app?)
- Implement digital signatures for tallies, chits, contracts, lifts
- Implement encrypted peer-to-peer communications using noise protocol
- Harden database schema, nothing accessible except user-based views/functions
- Finish schema version control/upgrade mechanism in wyseman
- Docker-based production server
- Production rollout
- Create more optimal User SPA GUI for mobile
- Async email/text notifications
- Native mobile user app
- Tally confirmations
- Standardized export/import of user accounts via Admin interface
- Emergency lock-down mode
- Backup/restore sharding among peers
- Advanced Features:
- Implement writing a check:
- User mobile clients can talk to each other in absense of internet or server connection
- They exchange a check (paper or image)
- The check is 'cashed' or recorded once the network comes back up
-
General tasks by level of expertise required (redundant)
- Low Level: (code validation)
- Write unit tests, which become part of the integrated test suite.
- Test existing state transition graphs for all conceivable combinations of state.
- Attempt to request multiple, conflicting state transitions at once.
- Proper retry/recovery of records that get stranded in a transitional state
- Medium Level: (network simulation)
- Implement peer communication channel based on "noise protocol" to replace current lib/peercomm.js module
- Write a more advanced agent model that reasonably simulates the choices an actual human would make when interacting with the system.
- Examples include: (where each character is randomly determined for individual agents)
- Spending consumption costs at a regular rate
- Luxury spending when more money is available
- Being more or less of a saver
- Accumulating varying amounts of foil-debit balances (savings bonds)
- Getting a job when you are out of money
- Finding other income sources
- Acquiring capital assets (with and without associated debt)
- Spending money with non-connected nodes (i.e. requesting linear lifts/drops)
- Developing a reasonable number of downstream tally relationships (i.e. vendors)
- Starting a credit certification aggregator (savings and loan)
- Starting a vendor aggregator (credit card company)
- High Level: (architecture/design)
- Close security holes found by DSR study (implement arbiter into protocol?)
- Does the existing tally state transition chart accurately represent all necessary cases?
- Does the existing chit state transition chart accurately represent all necessary cases?
- Augment the chit state transition chart to model distributed lifts
- Augment the chit state machine to implement distributed lifts
- Add key signing/validation regimen to tally process
- Add key signing/validation regimen to chit/lift process
- Chit consensus:
- Can tolerate network outages
- Will re-synch chain no matter how many chits got added during outage
- Need ack/nak added to chit protocol?
- Ack/naks include chits and/or chain segments as applicable
- Need to handle more than one lift per site with the same guid (when a lift passes through the same site more than once)
- Routes count how many successful lifts they have conveyed
- Routes refresh their expiration upon last successful lift
- Does it work to re-probe for an existing (expired, pending or railed) route?
- Need a scheduler to do this occasionally (and particularly when necessary)
- How to trigger a manual signature query if a lift times out?
- Create function in server to call circular lift function on specified interval
-
State Transition Refinements:
- How to resolve order conflict if two chits are committed at once on the same tally?
- Foil always relents and reorders?
- How to determine if end of chain hash matches my peer (our tallies are in sync)
- Try to acknowledge at end of chit transaction?
- Or wait for next transaction?
- Deleting chits properly resets sequence counter in mychips.tallies?
- Prevent deleting a chit in the middle of a valid chain?
- Test/validate retry mechanism (tallies,chits,routes,lifts)
- Can I mark a chit as refused, some way other than text in the signature?
- Change to aborted state after max number of retries/time (peer.js)
-
Server Refinements:
- Should server launch with fewer default behaviors?
- Test: can the server recover if the database goes down and back up?
X- Show graphical view of all users connected via a set of specified SQL servers
- Server listens for authenticated peer connections
- Peers can connect and validate
- Server initiates trade requests
-
- Tallies/paths:
- Which parameters are signed in the tally, which can be changed later?
X- Consider all tally parameters when computing min/max on segment
X- Generate min/max/cost in mychips.routes
X- Compute min/max/cost in mychips.routes_v_lifts
X- Allow user to generate path request to unknown user
X- Can differentiate between user-generated path requests and auto-generated
X- Stored procedure to check for needed retries (routes, tallies, chits)
-
- Structured Documents:
- Build parameterized, local hyperlink from formal URL
- Export defaults to reasonable filename
- Contract json import works properly
- Files in contract folder are Real strdoc json format
- Bulk export action from dbp?
- Generate a digest on publish
- Lock the document on publish
- When/how do people verify the hash?
- Integrate document server with SPA server? (or have separate static folder)
-
- Strdoc:
- Can I edit/author documents now?
- What if I import a document into strdoc and then try to update? (Do an insert?)
- Make source field I can enable with a button; Turns off other fields
- Preview mode includes language to refer to the included document (in current language?)
- Implement a few basic contracts using strdoc widget
- Harden contract views so you can only update working contracts (test)
- Implement publish procedure in backend (share code between reports)
- Begin wyseman library of server-side query builder functions (that reports can use)
- How to serve my documents in HTML-viewable form if .html suffix given to web server
- Coded errors in wyseman.js get translated "badTuples" "badUpdate" etc
- Reports/strdoc:
- Report windows fetch wm object/fields if/when needed from main (make strdoc work)
- Report windows implement optional control/parameter menu at top
- Strdoc and/or others put their menu next to the main control menu
- Reports have optional slave setting where they respond to key changes
- Auto update can be switched off in the report menu
- Reports have optional update setting where they can push data back to dbe and update database
- Strdoc now working good enough to build/edit MyCHIPs documents
- Implement document publish
- Published documents no longer writable
- Can reference documents within documents
- Do/can they print/render in-line or only separately?
- Can I query/fetch any document from any SPA (or peer?) server?
- Can I easily load them into my own database to keep a local mirror copy?
- I should have a copy of any contract referenced in any of my tallies (FK reference?)?
- Make tallies actually reference contracts existing in the DB
-
X- Wyseman DB connection with no schema info should wait/retry for DB to exist rather than failing
X- Can then get rid of "npm firstrun" in package.json and doc/Development
X- Get wysegi working (where does it go)?
X- Wyseman won't open dbe for chit view (no wmd?)
- Test SSL connection to postgres
- Where to best put:
X- Wysegi
- WyattERP Admin console
- WyattERP User (all available functions in tabs)
- Reports work in WyattERP
X- clientinfo ajax (wyclif)
-
User Agent2 process:
X- Learns about other peers through central repository
X- Some users are in same DB, others in a different one
- BUG: Some tallies being established twice with same peer
- What happens if a state transition fails due to contention? Does it retry for success?
- Don't try to add same peer again to mychips.peers if we connect to him twice (add on conflict clause ?)
- Some chits are not getting beyond draft mode. Why?
- Spend CHIPs with more sensitivity to current net worth (other factors)
- Seek/establish vendors, in addition to clients
- Honor max clients, max vendors parameters from DB
- Work harder if my accrued receivables get low
- Raise vendor accumulation limits if my receivables get high
- Create lift incentives if I get stale imbalances
- Extend credit to peers based only on their credit-worthiness
- Be more random on search for new client tally connection
- Find a foil tally and pay some credits on it
- Agent establishes reasonable number of tallies with other users
- If I already have a tally with you, don't do another one
- Try installing/running with SL and NA
- Fill in tally limits data for all users
- Each agent pays his downstreamers periodically
- Fill in buy/sell orders data for all users (Can I derive this from existing tally limits)
- Develop state machine for data queries
- Can you find a path to user X?
- Store data about known pathways
- Develop state machine for lift execution
- Would you participate in a lift destined for user X, for Y CHIPs?
X- Dummy sql to create initial draft tally
- Dummy sql files to simulate other required user actions
- User agent process runs randomized strategy
-
DB/schema:
X- Change base.ent to make id, unique to ent_type
X- Make consolidated key target field: P100, A100, G100
X- Adjust all subordinate tables to point to the target field
- Test json tally import/export
- Only allow minimum, required access/permissions
- Can run equally well from schema source build, or from compiled schema build
-
Peer-to-peer:
X- Socket connections should time out and close after an idle period
X- Create state diagram for chits
X- Implement chit state map that runs under standard state interpretor
- Cache chit totals for each tally, on the fly
- State diagram for lifts
- Table for buy/sell preferences
- Make command handler for peer server
- Make ssl socket server for peer interface
- Handle user command to issue stock ticket
- User agent reads stock ticket, connects to peer
- Can user stock ticket to establish stock tally with issuing peer
- Can connect to multiple ID's over same peer server port
- Separate SSL certificate for each peer connection
- User initiated commands:
- Initiate tally with (peer)
- Send money to (peer)
- Send invoice to (peer)
- Set sell target of (issue)
- Set buy target for (issue)
- Get balance summary (date)
- Get income/expense summary (start, end)
-
- User SPA:
- Visual balance sheet
- Can generate, configure keys
- User can generate tickets for other peers
- Can register/update buy/sell parameters
-
- Admin SPA:
X- Optimize SVG user graph reactivity. Only update what has changed.
X- User can connect/initialize using ticket
- Server listens on ticket port for specified timeout period
- Enable user permission editor in admin app user tab
- Can export user to JSON
- Can export user to paper, w/ QR code
- Admin can edit, create documents
-
Wyseman:
- Can apply incremental delta scripts to go from one release to another
- Modify wyseman/lib/wyseman.js to also listen on regular unix socket for admin connections
- Regular socket connection relies solely on an auth key (key file, not keys stored in DB user tables)
- Use SNI extension for client to provide db config payload
- Is there any use case for a user connecting via regular socket? (native app?)
- If so, socket connection needs to use connection tokens/keys just like websocket
- Make database owned by mychips? (give admin read/write/delete but not create/drop)
-
- Preferences:
- App widget responsible for saving/restoring preference settings
- Other modules can supply their own prefs defaults until better DB metadata arrives
- Request wm Language object from app instead of direct from wyseman?
- Request pr object from app instead of from prefs?
- Make pdm option for fetching options from database via query (idx,title,help)
- Make standard shortcut for language (there will be others too)
- Can now select languages from prefs menu and app updates reactively
- Make standard shortcut for exists, given DB table, column
-
Wylib:
- I get errors on reload when dbe and dbs both open on a dbp
- Implement default load column in views, wylib uses it if present
- Implement default order column in views, wylib uses it if present
- Update audit tables to store changes as JSON
X- Automatic reconnect retry working right
- Handle state changes correctly when connecting to new/different backend
X- Wylib login/validation for SPA client/server connections
- Wylib report
- Can print from strdoc component
- Can print out tally contract (with QR code paper backup)?
- Can export dbp view to a spreadsheet
- Report graphics (i.e. ticket) can export to graphic, attach to email, etc.
- Support for spreadsheet reports?
- Should we use a spreadsheet widget with file export?
X- Write wmd files for wyselib parameters
- Write wmd defaults for other wyselib/base files?
- Can launch actions from a dbp with multiple keys
- Should each tab have a menu that launches new previews, and can save/restore state?
-