Skip to content

Final small fixes#13

Merged
JTuffy merged 3 commits into
mainfrom
tiny-fixes
Mar 18, 2026
Merged

Final small fixes#13
JTuffy merged 3 commits into
mainfrom
tiny-fixes

Conversation

@emlynsg
Copy link
Copy Markdown
Collaborator

@emlynsg emlynsg commented Mar 12, 2026

Fixes from code review of #11: seeded RNG bug, misleading metric names, and scenario cleanup.

  • RNG fix: fixed-price market tie-breaking now uses the sim's seeded RNG instead of the global one, so results are reproducible
  • Metric renames: false_positive_ratecompliant_audit_fraction (no longer clashes with the config param), detection_ratedetection_rate_given_audit (clarifies it's conditional on audit). Updated everywhere — schemas, MC service, CSV/Excel export, dashboard UI.
  • Scenario consolidation: merged scenario 4 (dynamic) and 5 (reputation ratchet) into a single Scenario 4 — Feedback-Driven Compliance with weaker parameters (base_prob=0.20, penalty=$50M) that still converges to ~97% compliance. Renamed scenario 6 → 5 (enforcement cycles). Removed lawless scenario (degenerate, already covered by scenario 1).
  • Name cleanup: replaced all remaining "lawless/crisis/maxwell" references with "minimal/strict/smart" across Makefile, main.py, defaults, config_manager, sweep files
  • Docstring fixes: corrected p_catch formula in AuditConfig, "six-phase" → "seven-phase" in game loop

Let me know what you think about the tweaks to the dynamic scenario. Can always revert, I just figured it would be good to compare the reputation-driven compliance with the audit feedback driven compliance in scenario 5.

emlynsg and others added 3 commits March 12, 2026 20:30
Metric rename (batch.py, monte_carlo.py, export.py, batch_results.py):
  false_positive_rate  → compliant_audit_fraction
  detection_rate       → detection_rate_given_audit
Avoids collision with the input config parameter false_positive_rate (alpha)
and clarifies that the metric was conditional on audit, not population-level.

RNG fix (market.py, game_loop.py): fixed-price over-subscription path used
global random.sample(); now accepts and threads the caller's seeded rng so
exact reproduction is possible across all audit steps.

Scenario files:
  scenario_5_ratchet       → scenario_5_reputation_ratchet
  scenario_7_oscillation   → scenario_6_enforcement_cycles
  scenario_6_lawless       deleted
Sweep configs updated to match. Adds scripts/generate_figure_data.py to
regenerate compliance_ratchet.csv / compliance_oscillation.csv.

Minor doc fixes: AuditConfig p_catch formula (was missing p_w, p_m terms);
game_loop docstring six-phase → seven-phase; Makefile figure-data target.
Also move type: ignore[misc] to lambda definition line (pre-existing mypy
false negative caused by comment being on the wrong line of a multi-line expr).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove generate_figure_data.py from tracking (local tooling, gitignored)
- Remove figure-data Makefile target that referenced it
- Update .agents/ docs: detection_rate → detection_rate_given_audit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Merge scenario 4 (dynamic) + 5 (reputation ratchet) into scenario 4
  "Feedback-Driven Compliance" with weaker params (base_prob=0.20,
  penalty=$50M) — still converges to ~97% compliance
- Rename scenario 6 → 5 (enforcement cycles)
- Rename sweep files: lawless→minimal, maxwell→smart
- Replace all remaining lawless/crisis/maxwell references in code
- Add PR.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JTuffy JTuffy merged commit dee3205 into main Mar 18, 2026
1 check passed
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.

2 participants