{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/tofino/pulls/comments/68622592","id":68622592,"diff_hunk":"@@ -25,81 +25,123 @@ import microtime from 'microtime-fast';\n import { Bookmark } from '../../shared/model';\n import { logger } from '../../shared/logging';\n \n-import { SessionEndReason, SessionStartReason, SnippetSize, StarOp, VisitType } from './storage';\n+import {\n+  SessionEndReason,\n+  SessionStartReason,\n+  SnippetSize,\n+  // StarOp,\n+  // VisitType\n+} from './storage';\n+\n+const { lazySeq, vector, parse, getIn } = mori;\n+const { DB_ADD, TEMPIDS } = helpers;\n+\n+const profileSchema = {\n+  'page/url': {\n+    ':db/cardinality': ':db.cardinality/one',\n+    ':db/unique': ':db.unique/identity',\n+    ':db/doc': 'A page\\'s URL.',\n+    ':db.install/_attribute': ':db.part/db',\n+  },\n+\n+  'page/title': {\n+    ':db/ident': ':page/title',\n+    ':db/cardinality': ':db.cardinality/one',      // We supersede as we see new titles.\n+    ':db/doc': 'A page\\'s title.',\n+    ':db.install/_attribute': ':db.part/db',\n+  },\n+\n+  'event/visit': {\n+    ':db/valueType': ':db.type/ref',\n+    ':db/cardinality': ':db.cardinality/many',\n+    ':db/doc': 'A visit to the page.',\n+  },\n+\n+  'event/star': {\n+    ':db/valueType': ':db.type/ref',\n+    ':db/cardinality': ':db.cardinality/many',\n+    ':db/doc': 'A starring to the page.',\n+  },\n+\n+  // TODO: model sessions.\n+  'visit/instant': {\n+    ':db/cardinality': ':db.cardinality/one',\n+    ':db/doc': 'When the visit occurred.',\n+    ':db/index': true,\n+    // ':db/valueType': 'db.type/instant',        // Not supported by Datascript.\n+  },\n+\n+  'session/startedFromAncestor': {\n+    ':db/valueType': ':db.type/ref',     // To a session.\n+    ':db/cardinality': ':db.cardinality/one',\n+    ':db/doc': 'The ancestor of a session.',\n+  },\n+\n+  'session/startedInScope': {","path":"app/services/user-agent-service/datomstore.js","position":58,"original_position":57,"commit_id":"cf59dbee63b164b6d570f04985a01b4fb75bff1c","original_commit_id":"4c094c853acce25d1561a967b77f49aec439ad22","user":{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false},"body":"These are `namespace/propertyName`, rather than being hierarchical — they're Clojure packages.","created_at":"2016-06-27T17:47:16Z","updated_at":"2016-06-27T17:47:16Z","html_url":"https://github.com/mozilla/tofino/pull/681#discussion_r68622592","pull_request_url":"https://api.github.com/repos/mozilla/tofino/pulls/681","_links":{"self":{"href":"https://api.github.com/repos/mozilla/tofino/pulls/comments/68622592"},"html":{"href":"https://github.com/mozilla/tofino/pull/681#discussion_r68622592"},"pull_request":{"href":"https://api.github.com/repos/mozilla/tofino/pulls/681"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/tofino/pulls/681","id":73439303,"html_url":"https://github.com/mozilla/tofino/pull/681","diff_url":"https://github.com/mozilla/tofino/pull/681.diff","patch_url":"https://github.com/mozilla/tofino/pull/681.patch","issue_url":"https://api.github.com/repos/mozilla/tofino/issues/681","number":681,"state":"open","locked":false,"title":"Visit fetching in Datascript.","user":{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-10T21:33:35Z","updated_at":"2016-06-27T17:47:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a500b66d00273565906cb4430f96423ae5ec173a","assignee":{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false},"assignees":[{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/tofino/pulls/681/commits","review_comments_url":"https://api.github.com/repos/mozilla/tofino/pulls/681/comments","review_comment_url":"https://api.github.com/repos/mozilla/tofino/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/tofino/issues/681/comments","statuses_url":"https://api.github.com/repos/mozilla/tofino/statuses/cf59dbee63b164b6d570f04985a01b4fb75bff1c","head":{"label":"rnewman:rnewman/visited","ref":"rnewman/visited","sha":"cf59dbee63b164b6d570f04985a01b4fb75bff1c","user":{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false},"repo":{"id":59784671,"name":"tofino","full_name":"rnewman/tofino","owner":{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rnewman/tofino","description":"Project Tofino is a browser interaction experiment.","fork":true,"url":"https://api.github.com/repos/rnewman/tofino","forks_url":"https://api.github.com/repos/rnewman/tofino/forks","keys_url":"https://api.github.com/repos/rnewman/tofino/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rnewman/tofino/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rnewman/tofino/teams","hooks_url":"https://api.github.com/repos/rnewman/tofino/hooks","issue_events_url":"https://api.github.com/repos/rnewman/tofino/issues/events{/number}","events_url":"https://api.github.com/repos/rnewman/tofino/events","assignees_url":"https://api.github.com/repos/rnewman/tofino/assignees{/user}","branches_url":"https://api.github.com/repos/rnewman/tofino/branches{/branch}","tags_url":"https://api.github.com/repos/rnewman/tofino/tags","blobs_url":"https://api.github.com/repos/rnewman/tofino/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rnewman/tofino/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rnewman/tofino/git/refs{/sha}","trees_url":"https://api.github.com/repos/rnewman/tofino/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rnewman/tofino/statuses/{sha}","languages_url":"https://api.github.com/repos/rnewman/tofino/languages","stargazers_url":"https://api.github.com/repos/rnewman/tofino/stargazers","contributors_url":"https://api.github.com/repos/rnewman/tofino/contributors","subscribers_url":"https://api.github.com/repos/rnewman/tofino/subscribers","subscription_url":"https://api.github.com/repos/rnewman/tofino/subscription","commits_url":"https://api.github.com/repos/rnewman/tofino/commits{/sha}","git_commits_url":"https://api.github.com/repos/rnewman/tofino/git/commits{/sha}","comments_url":"https://api.github.com/repos/rnewman/tofino/comments{/number}","issue_comment_url":"https://api.github.com/repos/rnewman/tofino/issues/comments{/number}","contents_url":"https://api.github.com/repos/rnewman/tofino/contents/{+path}","compare_url":"https://api.github.com/repos/rnewman/tofino/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rnewman/tofino/merges","archive_url":"https://api.github.com/repos/rnewman/tofino/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rnewman/tofino/downloads","issues_url":"https://api.github.com/repos/rnewman/tofino/issues{/number}","pulls_url":"https://api.github.com/repos/rnewman/tofino/pulls{/number}","milestones_url":"https://api.github.com/repos/rnewman/tofino/milestones{/number}","notifications_url":"https://api.github.com/repos/rnewman/tofino/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rnewman/tofino/labels{/name}","releases_url":"https://api.github.com/repos/rnewman/tofino/releases{/id}","deployments_url":"https://api.github.com/repos/rnewman/tofino/deployments","created_at":"2016-05-26T21:33:40Z","updated_at":"2016-06-06T17:19:59Z","pushed_at":"2016-06-27T15:41:56Z","git_url":"git://github.com/rnewman/tofino.git","ssh_url":"git@github.com:rnewman/tofino.git","clone_url":"https://github.com/rnewman/tofino.git","svn_url":"https://github.com/rnewman/tofino","homepage":"http://mozilla.github.io/tofino","size":4434,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"633f39dc0d38d395fcc5294863efd6d38c0776aa","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":55401807,"name":"tofino","full_name":"mozilla/tofino","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/tofino","description":"Project Tofino is a browser interaction experiment.","fork":false,"url":"https://api.github.com/repos/mozilla/tofino","forks_url":"https://api.github.com/repos/mozilla/tofino/forks","keys_url":"https://api.github.com/repos/mozilla/tofino/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/tofino/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/tofino/teams","hooks_url":"https://api.github.com/repos/mozilla/tofino/hooks","issue_events_url":"https://api.github.com/repos/mozilla/tofino/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/tofino/events","assignees_url":"https://api.github.com/repos/mozilla/tofino/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/tofino/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/tofino/tags","blobs_url":"https://api.github.com/repos/mozilla/tofino/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/tofino/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/tofino/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/tofino/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/tofino/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/tofino/languages","stargazers_url":"https://api.github.com/repos/mozilla/tofino/stargazers","contributors_url":"https://api.github.com/repos/mozilla/tofino/contributors","subscribers_url":"https://api.github.com/repos/mozilla/tofino/subscribers","subscription_url":"https://api.github.com/repos/mozilla/tofino/subscription","commits_url":"https://api.github.com/repos/mozilla/tofino/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/tofino/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/tofino/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/tofino/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/tofino/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/tofino/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/tofino/merges","archive_url":"https://api.github.com/repos/mozilla/tofino/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/tofino/downloads","issues_url":"https://api.github.com/repos/mozilla/tofino/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/tofino/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/tofino/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/tofino/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/tofino/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/tofino/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/tofino/deployments","created_at":"2016-04-04T10:13:26Z","updated_at":"2016-06-24T06:22:19Z","pushed_at":"2016-06-27T17:46:14Z","git_url":"git://github.com/mozilla/tofino.git","ssh_url":"git@github.com:mozilla/tofino.git","clone_url":"https://github.com/mozilla/tofino.git","svn_url":"https://github.com/mozilla/tofino","homepage":"http://mozilla.github.io/tofino","size":5104,"stargazers_count":462,"watchers_count":462,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":47,"mirror_url":null,"open_issues_count":87,"forks":47,"open_issues":87,"watchers":462,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/tofino/pulls/681"},"html":{"href":"https://github.com/mozilla/tofino/pull/681"},"issue":{"href":"https://api.github.com/repos/mozilla/tofino/issues/681"},"comments":{"href":"https://api.github.com/repos/mozilla/tofino/issues/681/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/tofino/pulls/681/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/tofino/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/tofino/pulls/681/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/tofino/statuses/cf59dbee63b164b6d570f04985a01b4fb75bff1c"}}}}
{"actor":{"display_login":"rnewman"}}