WIP

[?]
Dec 6, 2014, 4:36 AM
LAROLAYUGJ4Q5AEFV5EJMIA2ZKBNCBWHHHPCJ3CKCNIUIYUKRFVQC

Dependencies

  • [2] 5W5M56VJ Move library code to 'lib'
  • [3] EMVTF2IW WIP moving back to snap.
  • [4] Z3M53KTL Adrift.
  • [5] ADMKQQGC Initial empty Snap project.
  • [6] RSEB2NFG Replacing Snap with Scotty.
  • [7] 64VI73NP Server now compiles using abstracted SQLite
  • [8] WZUHEZSB Start of migration back toward snap.
  • [9] NTPC7KJE Trivial changes, feature scratchpad.
  • [10] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [*] AXKKXBWN Initial attempt at writing down my ideas for a company based on trust.

Change contents

  • file addition: README.md (----------)
    [12.2]
    The 3-minute Tour
    =================
    A quixotic company is a group of independent actors who distribute revenue
    among themselves according to the amount of time they've each spent
    contributing to a project. As soon as any revenue is received, it is
    immediately paid out to the contributors in proportion to their contributions.
    In a sense, the hours contributed to the project form the "shares" of the
    company, with a caveat as will be described below.
    Any hour logged is equivalent to any other hour logged that ends at the same
    moment; this produces a situation where the value of each individual's life is
    considered to be equal, at the outset. However, it is acceptable for one
    contributor to explicitly "work for" another, by either donating some of their
    share of revenue to their collaborators, or by allocating time that they have
    worked to another's account. In this way, a market for talent can evolve within
    a company; however, all such actions are public, and at the sole discretion of
    the individuals making them.
    The caveat: for numerous philosophical and practical reasons, the value of an
    hour contributed is not constant. Instead, the value of an hour decays
    according to a tunable function of time elapsed since the hour was logged. For
    example, after 6 months from the time of the original contribution, an hour
    contributed begins to decay at a rate of 2 minutes per month, such that after 5
    years, the value of the hour has been completely exhausted, and when revenue is
    distributed, that hour will no longer be compensated. Of course, hour-shares of
    the company are also subject to constant inflation as more contributions are
    continuously being made.
    If the company needs to rent a shared resource, the money needed to pay for
    that resource may be raised from the contributors, or from others, by
    auctioning hours of time that are then logged to the accounts of the
    purchasers. It is not recommended that the company, as an entity, own anything;
    ownership is a privilege reserved individuals.
    There is, of course, nothing preventing a subset of collaborators from making
    an external agreement for shared ownership of a resource that is then rented to
    the company; however, the particulars of such agreements are outside the scope
    of the quixotic company structure.
    What Is a Quixotic Company?
    ===========================
    The idea of the quixotic company arose out of my experience in the open-source
    community. Something we have learned from the past couple of decades of
    experimentation with open-source projects is that a group of motivated
    individuals, working in their own individual interest in a framework of
    collaboration and trust, can achieve amazing things.
    The modern corporation is essentially feudal in structure; a hierarchy of lords
    to whom the greatest benefits accrue, lieutenants who provide command and
    control, and serfs, whose labor fuels the enterprise but who may never achieve
    the level of financial independence of the upper classes. The lore of modern
    business is that those at the top of these hierarchies are justly compensated
    for providing the greatest contribution or taking the most significant risks
    but I believe this justification is contrived to mitigate the natural
    dissatisfaction that people feel when confronted with inequality; the simple
    fact is that hierarchical structures are relatively stable. However, as the
    open-source software development world has shown us, this sort of hierarchy
    is not the only kind of organization that can create great things.
    Open-source development, however, has a couple of problems. While it's true
    that a great deal of open-source work is paid for by conventional corporations,
    it is actually remarkably difficult to make a living as an independent
    contributor to an open-source project. The quixotic company is intended to
    provide the minimal structure that is needed for a group of individuals to
    collaborate on a project for which they hope to be paid.
    The Value of Time
    =================
    What is the value of an hour of your life? This is a question that I've spent
    years wrestling with while trying to balance time spent with my family and
    friends, time spent working, and time alone with my thoughts. In my consulting
    life I've assigned monetary value to my hours somewhat arbitrarily; I determine
    an hour to be worth enough to maintain a certain lifestyle and yet not be so much
    that nobody will be willing to pay it. Yet, the question has always remained with
    me: what is the actual value, in terms of revenue, of the effort of the hours that
    I've put in?
    A related question is, how does the value of my time genuinely compare to the
    value of the time of others? The premise that an hour of my life is somehow more
    or less valuable than an hour of someone else's seems a little problematic;
    we don't know how long we'll live. What is your last hour worth, or your first?
    The only answer that I can come up with is this. We should begin with an idea of equality.
    Resources
    =========
    Tithes
    ======
    Investment
    ==========
  • edit in TASKS at line 5
    [4.70][4.70:107]()
    * Evaluate transition back to Snap
  • file addition: Auction.hs (----------)
    [2.18]
    {-# LANGUAGE ScopedTypeVariables, OverloadedStrings, NoImplicitPrelude #-}
    module Quixotic.Auction where
    import ClassyPrelude
    newtype AuctionId = AuctionId Int
    data Auction = Auction
    { raiseAmount :: BTC
    , endsAt :: UTCTime
    }
    data Bid = Bid
    { userId :: UserId
    , hours :: Hours
    , btcAmount :: BTC
    }
    winningBids :: Foldable f -> Auction -> f Bid -> [Bid]
    winningBids =
    let
  • edit in lib/Quixotic/Database.hs at line 8
    [4.5020]
    [4.5020]
    import Quixotic.Auction
    import Quixotic.Users
  • replacement in lib/Quixotic/Database.hs at line 14
    [4.5065][4.5065:5106](),[4.5106][4.1672:1725]()
    { recordEvent :: a -> LogEntry -> m ()
    , readWorkIndex :: a -> EitherT T.Text m WorkIndex
    [4.5065]
    [4.5159]
    { recordEvent :: LogEntry -> ReaderT a m ()
    , readWorkIndex :: EitherT T.Text (ReaderT a m) WorkIndex
    , newAuction :: Auction -> ReaderT a m AuctionId
    , readAuction :: AuctionId -> ReaderT a m Auction
    , recordBid :: UTCTime -> Bid -> ReaderT a m ()
    , readBids :: AuctionId -> ReaderT a m [(UTCTime, Bid)]
    , createUser :: User -> ReaderT a m UserId
  • file addition: Users.hs (----------)
    [2.18]
    {-# LANGUAGE ScopedTypeVariables, OverloadedStrings, NoImplicitPrelude #-}
    module Quixotic.Users where
    import ClassyPrelude
    newtype UserId = UserId Int
    data User = User
    { userAddress :: BtcAddr
    , userEmail :: Text
    }
  • replacement in quixotic.cabal at line 25
    [4.838][3.1212:1265]()
    , classy-prelude >= 0.10.2
    [4.838]
    [4.838]
    , classy-prelude >= 0.10.1
  • replacement in server/Main.hs at line 28
    [4.189][4.189:225]()
    db <- openConnection $ dbName cfg
    [4.189]
    [4.266]
    db <- openConnection $ dbName cfg
  • replacement in server/Main.hs at line 30
    [4.288][4.1645:1673]()
    quickHttpServe $ site cfg
    [4.288]
    [4.2594]
    quickHttpServe $ runReaderT (site adb) db
  • replacement in server/Main.hs at line 32
    [4.2595][4.1674:1931]()
    site :: QConfig -> a -> ADB IO a -> Snap ()
    site cfg db adb =
    route [ ("logStart/:btcAddr", handleLogRequest db adb StartWork)
    , ("logEnd/:btcAddr", handleLogRequest db adb StopWork)
    , ("payouts", currentPayouts db adb)
    ]
    [4.2595]
    [4.1931]
    site :: ADB IO a -> ReaderT a Snap ()
    site adb = route
    [ ("logStart/:btcAddr", handleLogRequest adb StartWork)
    , ("logEnd/:btcAddr", handleLogRequest adb StopWork)
    , ("payouts", currentPayouts adb)
    ]
  • replacement in server/Main.hs at line 49
    [4.5696][4.1956:2027]()
    handleLogRequest :: a -> ADB IO a -> (UTCTime -> WorkEvent) -> Snap ()
    [4.5696]
    [4.587]
    handleLogRequest :: ADB IO a -> (UTCTime -> WorkEvent) -> ReaderT a Snap ()
  • replacement in server/Main.hs at line 51
    [4.620][4.2028:2062]()
    addrBytes <- getParam "btcAddr"
    [4.620]
    [4.2062]
    addrBytes <- lift $ getParam "btcAddr"
  • replacement in server/Main.hs at line 56
    [4.6063][4.2116:2159]()
    currentPayouts :: a -> ADB IO a -> Snap ()
    [4.6063]
    [4.729]
    currentPayouts :: ADB IO a -> ReaderT a Snap ()
  • replacement in server/Main.hs at line 67
    [4.1017][4.1017:1086]()
    eitherT (raise . LT.fromStrict) buildPayoutsResponse payoutsAction
    [4.1017]
    [4.8456]
    lift $ eitherT (raise . LT.fromStrict) buildPayoutsResponse payoutsAction