Skip to content

feat(demos): end-to-end demonstrations that recover input traps + cold front door (Phase 4)#4

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/phase4-demos
Jul 17, 2026
Merged

feat(demos): end-to-end demonstrations that recover input traps + cold front door (Phase 4)#4
Jammy2211 merged 1 commit into
mainfrom
feature/phase4-demos

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Phase 4 of the autocti_assistant epic (PyAutoBrain#136). The demonstrations that
prove the assistant works — and the cold-session front door that makes it usable.

Four runnable demonstrations (scripts/demonstrations/)

Each is small enough to run on a laptop in minutes, and each asserts its
result — a clean run is proof the pipeline works, not just that it executes. All
were run for real against the live stack (arctic clocking, real Nautilus fits):

Demo Proves Result
demo_1_calibrate_1d simulate a 1D dataset from known traps, fit, recover the input density 0.1300 → 0.1323, release 1.2500 → 1.2608
demo_2_calibrate_imaging_ci the same in the 2D charge-injection geometry (Clocker2D) density 0.1300 → 0.1334, release 1.2500 → 1.3123
demo_3_correct_1d clocker.remove_cti suppresses the EPER trail trail power 3.9× lower after correction ✅
demo_4_aggregate_results reload demo 1 through the aggregator; the model round-trips recovered density 0.1323 from disk ✅

Two of these caught real issues that I fixed rather than papered over:

  • Demo 4 — factor-graph aggregation. ac.agg.CTIAgg and
    max_log_likelihood_instance assume the single-analysis model layout; a
    factor-graph fit stores results per-factor, so the reloaded instance is
    indexed (instance[0].cti...). Demo 4 uses the samples-based path that works.
  • Demo 2 — honest recovery. My first over-trimmed version (2 noisy injection
    levels) recovered the density but not the release timescale (1.25 → 2.90).
    That's a genuine under-constraint, not a tolerance issue, so I fixed the data
    (three cleaner injection levels, more live points) rather than loosen the
    assertion.

Cold-session front door

Fixed llms.txt — the file a fresh chat session reads to bootstrap. It described
the assistant as "for doing strong-lens science" and told agents it could
"explain lensing"; now it correctly frames CTI calibration and routes to the
CTI reference. The two canonical cold-start questions are answerable from the repo
alone: install (the arcticpy recipe in ac_setup_environment) and
calibration (ac_fit_cti_model + the calibration-strategy wiki).

Validation

--scope all · --check-citations · --lint-idioms · --check-provenance ·
--check-version all pass. wiki-currency should stay green; boundary skips.

Remaining lensing leak (systemic, flagged not fixed here)

scripts/AGENTS.md still describes lensing SLaM pipelines (/init-slam, MGE
lens light, pixelised source) — it needs a real CTI-pipeline rewrite, which is
beyond a demonstrations PR. It's part of the same reference-side boundary finding
already on #136 (generic files that absorbed lensing content: the audit's
autogalaxy, the PyPI-install shape, _bootstrap_skill.md, and now scripts/AGENTS.md).

Publish gate — legs 1–4

Legs 1–3 stay green; the demonstrations and the cold-front-door fix are the
substance of leg 4. The final act — flipping the repo public — is left for
explicit human approval
and is not done in this PR.

Part of #136 (Phase 4, the last phase).

…+ cold front door (Phase 4)

The demonstrations that prove the assistant works, each run for real against the
live stack (arctic clocking, real Nautilus fits) and each asserting its result.

scripts/demonstrations/
  demo_1_calibrate_1d       — simulate a 1D dataset from known traps, fit, recover
                              the input: density 0.1300->0.1323, release 1.25->1.261
  demo_2_calibrate_imaging_ci — the same in the 2D charge-injection geometry
                              (Clocker2D): density 0.1300->0.1334, release 1.25->1.312
  demo_3_correct_1d         — clocker.remove_cti suppresses the EPER trail 3.9x
  demo_4_aggregate_results  — reload demo 1 through the aggregator; model round-trips

Two caught real issues, fixed honestly rather than papered over:
  - demo 4: a factor-graph fit stores results per-factor, so the aggregator's
    reloaded instance is indexed (instance[0].cti...), not the single-analysis
    layout ac.agg.CTIAgg / max_log_likelihood_instance assume.
  - demo 2: an over-trimmed first version (2 noisy injection levels) recovered
    density but not release timescale (1.25->2.90) — a genuine under-constraint,
    so the data was fixed (three cleaner levels, more live points), not the
    assertion loosened.

llms.txt — de-lensed the cold-session front door: it described the assistant as
"for doing strong-lens science" and able to "explain lensing"; now it frames CTI
calibration and routes to the CTI reference + the demonstrations. The two
cold-start questions (install, calibration) are answerable from the repo alone.

Validation: --scope all / --check-citations / --lint-idioms / --check-provenance
/ --check-version all pass.

Part of #136 (Phase 4). scripts/AGENTS.md still carries lensing SLaM content — a
bigger CTI-pipeline rewrite, flagged with the systemic boundary finding on #136.
The public flip is left for explicit human approval.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 1337a68 into main Jul 17, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/phase4-demos branch July 17, 2026 16:18
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