Run artifact

workspace/targets/LayersTesting/LINEAGE.json

{
  "version": 1,
  "import": {
    "root": "/mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/sources",
    "format": "markdown"
  },
  "sources": {
    "INSTRUCTIONS.md": {
      "state": "current",
      "versions": [
        {
          "commit": "091e6bb",
          "date": "2026-10-27",
          "hash": "5fe5f2b8c018d49d6767f97136987b24127f9646c97098cc93f8879d1f0c5ccd",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "cli-executable",
              "text": "The product is an executable named `ledger` at the application root.",
              "stories": [
                "foundation-cli",
                "foundation-python"
              ]
            },
            {
              "name": "python-sqlite-stack",
              "text": "Implement in Python 3.11 or newer over SQLite, through the shipped Python persistence library. Tests run under pytest.",
              "stories": [
                "foundation-python",
                "foundation-database"
              ]
            },
            {
              "name": "database-tables",
              "text": "Three tables. Amounts are stored as integer cents and never as floating point.",
              "stories": [
                "foundation-database"
              ]
            },
            {
              "name": "database-access-layer",
              "text": "All database access goes through the shipped persistence library and the relational layer\ngenerated from `DATABASE.md`. Application code never opens a database driver directly.",
              "stories": [
                "foundation-database"
              ]
            },
            {
              "name": "atomic-commands",
              "text": "1. **A rejected command changes nothing.** A command checks every input and rule before its\n   first write. A load that rejects row 11 stores none of rows 1 to 10. A transfer stores both of\n   its rows or neither.",
              "stories": [
                "feature-balance-rule",
                "feature-load-accounts",
                "feature-load-categories",
                "feature-load-transactions",
                "feature-transfer",
                "feature-no-negative-balance"
              ]
            },
            {
              "name": "no-negative-balance",
              "text": "2. **No command leaves an account balance below zero.** An account's balance is the sum of its\n   transaction amounts. Posting, amending, deleting, transferring, and loading are all subject to\n   this rule, checked before the command writes anything.",
              "stories": [
                "feature-balance-rule",
                "feature-no-negative-balance",
                "feature-txn-post",
                "feature-txn-amend",
                "feature-txn-delete",
                "feature-transfer",
                "feature-load-transactions"
              ]
            },
            {
              "name": "code-format",
              "text": "3. **Codes** (`account`, `category`) are 1 to 12 characters from `A-Z` and `0-9`.",
              "stories": [
                "feature-validation"
              ]
            },
            {
              "name": "text-field-format",
              "text": "4. **Names and descriptions** are 1 to 40 characters. **Memos** are 0 to 60 characters. None of\n   them contains a comma or a newline.",
              "stories": [
                "feature-validation"
              ]
            },
            {
              "name": "amount-format",
              "text": "5. **Amounts** on input match `-?DIGITS[.D[D]]`: at most two decimal places, never zero. On output\n   an amount is written with exactly two decimal places, a leading `-` when negative, and no\n   thousands separator: `-12.50`, `0.00`, `5000.00`.",
              "stories": [
                "feature-validation"
              ]
            },
            {
              "name": "date-format",
              "text": "6. **Dates** are real calendar dates written `YYYY-MM-DD`. `2026-02-30` is rejected.",
              "stories": [
                "feature-validation"
              ]
            },
            {
              "name": "transaction-ids",
              "text": "7. **Transaction ids.** A loaded transaction keeps the `txn_id` from its file. A posted\n   transaction receives one more than the largest `txn_id` present, or `1` in an empty table. A\n   transfer's outgoing row takes that id and its incoming row the next.",
              "stories": [
                "feature-txn-post",
                "feature-transfer",
                "feature-load-transactions"
              ]
            },
            {
              "name": "csv-output",
              "text": "Every successful command except `init` writes CSV to standard output: one header row, then data\nrows, comma-separated, no quoting, no trailing spaces, `\\n` line endings. `init` writes nothing.\nA failing command writes nothing to standard output and one diagnostic line to standard error.",
              "stories": [
                "foundation-cli",
                "feature-command-contract"
              ]
            },
            {
              "name": "row-formats",
              "text": "The account row is `account,name,transactions,balance`, where `transactions` counts the account's\ntransactions. The transaction row is `txn_id,date,account,category,amount,memo`.",
              "stories": [
                "feature-command-contract",
                "feature-account-get",
                "feature-txn-get"
              ]
            },
            {
              "name": "init-command",
              "text": "| `ledger init` | Prepares an empty ledger for loading and use; removes existing ledger records when rerun. Nothing written. |",
              "stories": [
                "feature-init-count"
              ]
            },
            {
              "name": "count-command",
              "text": "| `ledger count` | `table,rows`, then `accounts`, `categories`, `transactions` rows in that order. |",
              "stories": [
                "feature-init-count"
              ]
            },
            {
              "name": "load-command",
              "text": "| `ledger load <table> <csv>` | Loads `accounts`, `categories`, or `transactions` from a file whose header matches the table's columns in the order above. Writes `table,loaded` and `<table>,<rows>`. |",
              "stories": [
                "feature-load-csv-reader",
                "feature-load-accounts",
                "feature-load-categories",
                "feature-load-transactions"
              ]
            },
            {
              "name": "account-add",
              "text": "| `ledger account add <code> <name>` | The new account row. |",
              "stories": [
                "feature-account-add"
              ]
            },
            {
              "name": "account-get",
              "text": "| `ledger account get <code>` | The account row. |",
              "stories": [
                "feature-account-get"
              ]
            },
            {
              "name": "account-rename",
              "text": "| `ledger account rename <code> <name>` | The updated account row. |",
              "stories": [
                "feature-account-rename"
              ]
            },
            {
              "name": "account-delete",
              "text": "| `ledger account delete <code>` | `deleted` and the code. Refused while the account has transactions. |",
              "stories": [
                "feature-account-delete"
              ]
            },
            {
              "name": "txn-post",
              "text": "| `ledger txn post <account> <category> <amount> <date> [<memo>]` | The new transaction row. |",
              "stories": [
                "feature-txn-post"
              ]
            },
            {
              "name": "txn-get",
              "text": "| `ledger txn get <id>` | The transaction row. |",
              "stories": [
                "feature-txn-get"
              ]
            },
            {
              "name": "txn-amend",
              "text": "| `ledger txn amend <id> <amount>` | The updated transaction row. Only the amount changes. |",
              "stories": [
                "feature-txn-amend"
              ]
            },
            {
              "name": "txn-delete",
              "text": "| `ledger txn delete <id>` | `deleted` and the id. |",
              "stories": [
                "feature-txn-delete"
              ]
            },
            {
              "name": "transfer-command",
              "text": "| `ledger transfer <from> <to> <amount> <date>` | Two transaction rows in category `TRANSFER`: `-amount` on `<from>` with memo `transfer to <to>`, then `+amount` on `<to>` with memo `transfer from <from>`. The amount is positive and the accounts differ. |",
              "stories": [
                "feature-transfer"
              ]
            },
            {
              "name": "report-balances",
              "text": "| `ledger report balances` | `account,name,transactions,balance` per account ordered by code, then `TOTAL,,<count>,<sum>`. |",
              "stories": [
                "feature-report-balances"
              ]
            },
            {
              "name": "report-categories",
              "text": "| `ledger report categories` | `category,description,transactions,inflow,outflow,net` per category ordered by code, including categories with no transactions, then `TOTAL,,<count>,<inflow>,<outflow>,<net>`. |",
              "stories": [
                "feature-report-categories"
              ]
            },
            {
              "name": "report-monthly",
              "text": "| `ledger report monthly` | `month,transactions,inflow,outflow,net` per `YYYY-MM` that has transactions, ascending, then `TOTAL,<count>,<inflow>,<outflow>,<net>`. |",
              "stories": [
                "feature-report-monthly"
              ]
            },
            {
              "name": "inflow-outflow-net",
              "text": "`inflow` is the sum of positive amounts. `outflow` is the sum of the absolute values of negative\namounts, written as a positive number. `net` is `inflow - outflow`.",
              "stories": [
                "feature-report-categories",
                "feature-report-monthly"
              ]
            },
            {
              "name": "exit-codes",
              "text": "| `1` | Operational failure: a file named on the command line cannot be read. |\n| `2` | Usage error: unknown command, unknown table or report, wrong argument count. |\n| `3` | Rejected: invalid code, name, amount, date, or file row; duplicate key; unknown account or category; account in use; any change that would leave a negative balance. |\n| `4` | Not found: `account get/rename/delete` of an absent account, `txn get/amend/delete` of an absent id. |",
              "stories": [
                "foundation-cli",
                "feature-command-contract",
                "feature-load-csv-reader"
              ]
            },
            {
              "name": "automated-tests",
              "text": "The completed application provides a POSIX-compatible `bin/test.sh` that runs its own automated\ntest suite from the application root and exits zero only when every test passes. The suite\ncovers each command, each exit code, and each rule above against a real temporary database.",
              "stories": [
                "foundation-python",
                "feature-verification"
              ]
            },
            {
              "name": "run-harness-score",
              "text": "`sources/run.sh` is the scoring entry point. It is supplied, not authored, and is staged verbatim\ninto the application root with the seed files. `drydock uat` runs `sh sources/run.sh` from the\ncompleted application root and takes its exit code and output as the score.",
              "stories": [
                "feature-verification"
              ]
            },
            {
              "name": "database-location",
              "text": "The database is SQLite. `DATABASE_URL` names the SQLite file path, optionally prefixed\n`sqlite://`. When `DATABASE_URL` is unset, `DATABASE_PATH` is used, then `data/app.db`.",
              "stories": [
                "foundation-database"
              ]
            }
          ]
        }
      ]
    },
    "run.sh": {
      "state": "current",
      "versions": [
        {
          "commit": "091e6bb",
          "date": "2026-10-27",
          "hash": "744a2165699ea832a9b8679b0dc2792664336184ec88d63045829c969f6d1639",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "schema-lifecycle-init-count",
              "text": "check A1 0 init < /dev/null\ncheck A2 0 count <<'EOF'",
              "stories": []
            },
            {
              "name": "reinit-drops-rows",
              "text": "# \u2500\u2500 Z. Re-initialization drops every row \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\ncheck Z1 0 init < /dev/null",
              "stories": []
            },
            {
              "name": "bulk-load-accounts",
              "text": "check B1 0 load accounts \"$SEED/seed_accounts.csv\" <<'EOF'",
              "stories": []
            },
            {
              "name": "bulk-load-categories",
              "text": "check B2 0 load categories \"$SEED/seed_categories.csv\" <<'EOF'",
              "stories": []
            },
            {
              "name": "bulk-load-transactions",
              "text": "check B3 0 load transactions \"$SEED/seed_transactions.csv\" <<'EOF'",
              "stories": []
            },
            {
              "name": "report-balances",
              "text": "check C1 0 report balances <<'EOF'",
              "stories": []
            },
            {
              "name": "report-categories",
              "text": "check C2 0 report categories <<'EOF'",
              "stories": []
            },
            {
              "name": "report-monthly",
              "text": "check C3 0 report monthly <<'EOF'",
              "stories": []
            },
            {
              "name": "rejected-load-changes-nothing",
              "text": "# \u2500\u2500 D. A rejected load changes nothing \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\ncheck D1 3 load transactions \"$SEED/seed_transactions_bad.csv\" < /dev/null\ncheck D2 3 load accounts \"$SEED/seed_accounts.csv\" < /dev/null",
              "stories": []
            },
            {
              "name": "account-add",
              "text": "check E1 0 account add CASH9 \"Event Float\" <<'EOF'\ncheck E2 3 account add CASH9 \"Event Float\" < /dev/null",
              "stories": []
            },
            {
              "name": "account-get",
              "text": "check E3 0 account get CASH9 <<'EOF'\ncheck E5 4 account get NOSUCH < /dev/null",
              "stories": []
            },
            {
              "name": "account-rename",
              "text": "check E4 0 account rename CASH9 \"Event Cash Box\" <<'EOF'",
              "stories": []
            },
            {
              "name": "account-delete",
              "text": "check E6 3 account delete DRAWER1 < /dev/null\ncheck E7 0 account delete CASH9 <<'EOF'\ncheck E8 4 account get CASH9 < /dev/null",
              "stories": []
            },
            {
              "name": "txn-post",
              "text": "check F1 0 txn post DRAWER1 SALES 45.50 2026-04-01 \"walk in sale\" <<'EOF'\ncheck F5 3 txn post DRAWER1 NOSUCH 1.00 2026-04-01 < /dev/null\ncheck F6 3 txn post DRAWER1 SALES 1.234 2026-04-01 < /dev/null\ncheck F7 3 txn post DRAWER1 SALES 1.00 2026-02-30 < /dev/null\ncheck F10 0 txn post PETTY SUPPLY -12.34 2026-04-02 tape <<'EOF'",
              "stories": []
            },
            {
              "name": "txn-get",
              "text": "check F2 0 txn get 121 <<'EOF'\ncheck F4 4 txn get 999 < /dev/null\ncheck F9 4 txn get 121 < /dev/null",
              "stories": []
            },
            {
              "name": "txn-amend",
              "text": "check F3 0 txn amend 121 54.50 <<'EOF'",
              "stories": []
            },
            {
              "name": "txn-delete",
              "text": "check F8 0 txn delete 121 <<'EOF'",
              "stories": []
            },
            {
              "name": "atomic-transfer",
              "text": "# \u2500\u2500 G. Transfers are atomic; no command leaves a negative balance \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\ncheck G1 0 transfer DRAWER1 SAFE 500.00 2026-04-03 <<'EOF'\ncheck G2 3 transfer SAFE PETTY 999.99 2026-04-04 < /dev/null",
              "stories": []
            },
            {
              "name": "no-negative-balance",
              "text": "check G3 3 txn post PETTY SUPPLY -1000.00 2026-04-04 < /dev/null\ncheck G4 3 txn amend 1 1.00 < /dev/null\ncheck G5 3 txn delete 1 < /dev/null",
              "stories": []
            },
            {
              "name": "reports-after-changes",
              "text": "# \u2500\u2500 H. Reports after the changes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
              "stories": []
            },
            {
              "name": "usage-errors",
              "text": "check U1 2 frobnicate < /dev/null\ncheck U2 2 report nosuch < /dev/null",
              "stories": []
            },
            {
              "name": "ledger-executable",
              "text": "The deliverable is an executable named ledger at the application root.",
              "stories": []
            },
            {
              "name": "grader-passes",
              "text": "Exit 0 only when every check passes.",
              "stories": []
            }
          ]
        }
      ]
    },
    "seed_accounts.csv": {
      "state": "current",
      "versions": [
        {
          "commit": "091e6bb",
          "date": "2026-10-27",
          "hash": "48f83f688324264fd811a0a363418c867454043e30ce02bc8bc81683ed28625b",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "seed-accounts-data",
              "text": "account,name\nDRAWER1,Front Drawer\nDRAWER2,Back Drawer\nPETTY,Petty Cash\nSAFE,Store Safe",
              "stories": [
                "feature-load-accounts",
                "feature-load-csv-reader",
                "feature-account-add",
                "feature-validation",
                "foundation-database"
              ]
            }
          ]
        }
      ]
    },
    "seed_categories.csv": {
      "state": "current",
      "versions": [
        {
          "commit": "091e6bb",
          "date": "2026-10-27",
          "hash": "265d594bf154ef991105beec15a61241f46bb2b330aff215f9bffad2a0602b43",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "seed-categories-data",
              "text": "category,description\nOPENING,Opening balance\nPAYROLL,Payroll\nREFUND,Customer refunds\nRENT,Rent\nSALES,Sales receipts\nSUPPLY,Supplies\nTRANSFER,Internal transfer",
              "stories": [
                "feature-load-categories",
                "feature-load-csv-reader",
                "foundation-database",
                "feature-validation"
              ]
            }
          ]
        }
      ]
    },
    "seed_transactions.csv": {
      "state": "current",
      "versions": [
        {
          "commit": "091e6bb",
          "date": "2026-10-27",
          "hash": "c208c69039e28ebe36c868726a0ed8e3ce5e11d54bb52d636a952631446038da",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "load-transactions-csv",
              "text": "txn_id,date,account,category,amount,memo\n1,2026-01-01,SAFE,OPENING,5000.00,opening float\n2,2026-01-01,PETTY,OPENING,200.00,opening float\n3,2026-01-02,DRAWER1,SALES,155.26,sales day 1",
              "stories": [
                "feature-load-csv-reader",
                "feature-load-transactions",
                "feature-validation",
                "foundation-database"
              ]
            },
            {
              "name": "paired-transfer-rows",
              "text": "27,2026-01-14,DRAWER1,TRANSFER,-1000.00,transfer to SAFE\n28,2026-01-14,SAFE,TRANSFER,1000.00,transfer from DRAWER1",
              "stories": [
                "feature-transfer"
              ]
            }
          ]
        }
      ]
    },
    "seed_transactions_bad.csv": {
      "state": "current",
      "versions": [
        {
          "commit": "091e6bb",
          "date": "2026-10-27",
          "hash": "a7cffd87094d0bec741438e34dd8992f893d2e93ec0d32dad8395502d4b5af46",
          "release": "",
          "state": "consumed",
          "via": "plan",
          "ticket": null,
          "requirements": [
            {
              "name": "load-transactions-rejects-unknown-account",
              "text": "211,2026-04-01,NOSUCH,SALES,10.00,unknown account",
              "stories": [
                "feature-load-transactions",
                "feature-load-csv-reader",
                "feature-validation",
                "feature-command-contract"
              ]
            },
            {
              "name": "load-transactions-rejects-overdraft-batch",
              "text": "txn_id,date,account,category,amount,memo\n201,2026-04-01,DRAWER1,SALES,10.00,bad batch 1\n202,2026-04-01,DRAWER1,SALES,10.00,bad batch 2\n203,2026-04-01,DRAWER1,SALES,10.00,bad batch 3\n204,2026-04-01,DRAWER1,SALES,10.00,bad batch 4\n205,2026-04-01,DRAWER1,SALES,10.00,bad batch 5\n206,2026-04-01,DRAWER1,SALES,10.00,bad batch 6\n207,2026-04-01,DRAWER1,SALES,10.00,bad batch 7\n208,2026-04-01,DRAWER1,SALES,10.00,bad batch 8\n209,2026-04-01,DRAWER1,SALES,10.00,bad batch 9\n210,2026-04-01,DRAWER1,SALES,10.00,bad batch 10",
              "stories": [
                "feature-load-transactions",
                "feature-balance-rule",
                "feature-no-negative-balance",
                "feature-load-csv-reader",
                "feature-validation",
                "feature-command-contract"
              ]
            }
          ]
        }
      ]
    }
  }
}