Slice #3: the job loop — crew, clock, aftermath, betrayals surface
Shipped as 939876d.
What Changed
This entry documents the deterministic netrun foundation: repeatable runs, ICE/program data, and engine behavior that later browser features build on.
The core state machine closes: lifepath → crew → job → run → aftermath.
JobRunner orchestrates:
- Crew resolves on-site obstacles via skill checks (best-suited member per beat).
- Netrunner descends the NET on the same MissionClock.
- Success = data extracted + ground held + clock intact.
- Economy pays eddies + street cred on success.
- Hidden agendas surface only when their
trigger_oncondition fired this run.
Proof run (seed 2077, Arasaka extraction): JOB SUCCESS, 10,500 eddies, cred → 7 — and a Corp Plant betrayal surfaces on the Tech while two crew lock in as True Believers.
php bin/job-demo.php --seed=2077 --job=job.arasaka-substation
Tests: 34/34 at this commit.
Why It Matters
Campaign state gives each run consequence. Reputation, money, and history make the simulator feel like a sequence of choices instead of isolated demos.
Implementation Notes
The commit message for this slice was:
Closes the core state-machine loop. A crew pulls a job, resolves on-site
obstacles via skill checks while the netrunner descends the NET, all on one
shared mission clock; the aftermath pays out, moves street cred, and surfaces
any hidden agendas whose trigger fired.
- Economy: eddies wallet + street cred with rep tiers (nobody/known/reputable/
legend gate for The Last Job). MissionClock: shared tick budget for crew +
netrun; expiry blows the window.
- Job model + JSON (Arasaka extraction, pawnshop smash-grab) + a 2nd NET arch.
Obstacles pick the best-suited crew member (stat + role bonus).
- JobRunner: orchestrates crew checks + netrun on the shared clock, computes
success (data pulled, ground held, clock intact), applies payout iff success.
- Hidden-agenda triggers (deterministic): run emits fired conditions
(run_success/failed, big_payout, corp_job, crew_wounded, enemy_present); each
crew member's sealed agenda surfaces only when its trigger_on fires (or
'always'); 'never' stays sealed. The multi-agent betrayal/loyalty payoff.
- Demo bin/job-demo.php prints a full after-action report.
- Tests now 34/34 (economy, clock, jobrunner determinism, payout-iff-success,
trigger soundness + secrecy at the report layer).
Refs project #16, doc #345.
Files touched in this slice included:
bin/job-demo.phpdata/hidden_agendas.jsondata/jobs/extraction-arasaka-substation.jsondata/jobs/smashgrab-pawnshop.jsondata/netrun/architectures/pawnshop-2floor.jsonincludes/Economy.phpincludes/Job.phpincludes/JobRunner.phpincludes/MissionClock.phpincludes/Rules.phptests/run-tests.php
Verification
- The entry is part of the devlog archive and renders through the same PHP Markdown pipeline as current posts.
- The test suite now requires every devlog post to carry substantive details, illustration and screenshot figures, and valid visual asset references.
- Current browser smoke checks cover representative rich posts and older auto-generated posts after expansion.
Visuals
