Skip to content

Fix the first sixty seconds: run.sh blocked every newcomer - #2

Merged
iamabhi9 merged 1 commit into
mainfrom
fix/first-run-experience
Sep 3, 2026
Merged

Fix the first sixty seconds: run.sh blocked every newcomer#2
iamabhi9 merged 1 commit into
mainfrom
fix/first-run-experience

Conversation

@iamabhi9

@iamabhi9 iamabhi9 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Reviewed the published repo the way a stranger would — cloned it from GitHub and followed
the README verbatim. Both commands it opens with are broken.

What a newcomer hits today

$ ./run.sh --demo
./run.sh: line 25: $2: unbound variable

$ ./run.sh
No config.json yet.
  cp config.example.json config.json
Then set your broker account number...

./run.sh --demo crashes. The script runs under set -u and passes "$2" through
unconditionally. This is the first command in the README.

./run.sh then refuses to start without a config.json containing a broker account
number. But config.json is needed to sync from a broker, not to run: the demo needs
no broker, no account, and no config. The only way through was to bypass run.sh and call
app/server.py directly — which is exactly what CI was doing, and why nobody noticed.

Changes

  • "$2""${2:-}".
  • A bare ./run.sh with no database and no config now offers the two real choices —
    try the demo, or set up a broker — instead of a dead end. Starting with a database
    but no config now works, noting only that broker sync is unavailable.
  • --help lists --demo and --clear-demo, which it never did despite the README
    leading with them.

Why CI stayed green

It called app/samples.py and app/server.py directly and never once invoked run.sh
testing around the entry point rather than through it. This PR adds a step that runs
./run.sh --help, asserts a bare ./run.sh points a newcomer at --demo, and runs
./run.sh --demo, so this class of failure cannot go green again.

Verified

From a clean checkout with no config and no database:

./run.sh          -> offers --demo or broker setup
./run.sh --demo   -> demo installed: 30 transactions, 10 positions
./run.sh 8783     -> HTTP 200

16/16 XIRR tests, scripts/check_clean.py clean.

Reviewed the published repo by cloning it and following the README
verbatim, which is not something I had done before. Both commands it
opens with are broken.

`./run.sh --demo` crashed with "line 25: $2: unbound variable" — the
script runs under `set -u` and passed "$2" through unconditionally. That
is the first command in the README.

`./run.sh` then refused to start at all without a config.json holding a
broker account number. But config.json is needed to SYNC from a broker,
not to run: the demo needs no broker, no account and no config. Anyone
following the README hit a wall, and the only way through was to bypass
run.sh and call app/server.py directly.

A bare `./run.sh` now offers the two real choices — try the demo, or set
up a broker — and starting without config.json works, saying only that
broker sync is unavailable. `--help` lists --demo and --clear-demo, which
it never did despite the README leading with them.

CI passed through all of this because it called app/samples.py and
app/server.py directly and never once invoked run.sh — testing around the
entry point rather than through it. It now runs `./run.sh --help`, checks
that a bare `./run.sh` points a newcomer at --demo, and runs
`./run.sh --demo`, so this class of failure cannot go green again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@iamabhi9
iamabhi9 merged commit af3ea4a into main Sep 3, 2026
3 checks passed
@iamabhi9
iamabhi9 deleted the fix/first-run-experience branch September 3, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant