Skip to content

feat(profiling): lifecycle template, profiling-summary@3 coverage grid, samplers 0C paths, Pulse/Insight read prose (likelihood-lifecycle 0E) - #536

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-p0-brain
Oct 23, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-p0-brain

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Phase 0, sub-issue 0E of the likelihood-lifecycle epic. This is the Brain side of the lifecycle. PyAutoBrain is the only repo changed: no autolens_profiling, autolens_inference, Pulse, Insight or Mind edits, and nothing under .github/ or the token files (#534 is live on another branch).

What and why

(a) skills/profiling/lifecycle.md: the report §3.9 sequence L0 register → L1 figures → L2 profile → L3 designate → L4 validate → L5 gradient → L6 samplers → L7 close, written as a phase-prompt template.

  • Each step has a table row (owning repos, Brain door, human gate, witness) and one fenced prompt <draft path> block. Each block holds the full Mind header (Type, Target, Repos, Themes, Difficulty, Autonomy, Priority, Status, Consequence, Witness, Review-minutes, Unattended, Epic: lifecycle-<dataset_type>-<variant>, integer Phase 0–7, Blocked-by) followed by a short body.
  • The only placeholders are <dataset_type>, <variant>, <instrument>, <regime> and <trigger>.
  • Five numbered rendering rules make it mechanical for phase 8's verb:
    • reoptimised enters at L2 and drops L2's Blocked-by.
    • L6 is rendered only on a yes at the L3 gate.
  • It is linked from skills/profiling/SKILL.md, profiling.md and the conductor AGENTS.md.
  • New test tests/test_profiling_lifecycle_template.py renders the template for imaging/delaunay, files the prompts into a temporary Mind and runs intake's own census(), which is the same check pyauto-brain intake census applies, so no header rule is restated. It asserts:
    • no missing header fields, hygiene, theme or drift flags;
    • a witness and the epic on every prompt;
    • integer phases 0–7;
    • each prompt's Type/Target matches its folder;
    • for reoptimised, rendering starts at L2 with L2 unblocked.

(b) Profiling conductor (_catalogue.py, _profiling.py)

  • read_lifecycle() detects a published dashboard/catalogue.json with profiling-summary@3. When one is present, campaign reports coverage per likelihood × class × measurement over planned_cells. Each cell is current, stale, superseded or missing. "Stale" means the current record's release_pin is behind the catalogue's pin; that pin is the envelope's own, otherwise the newest pin among the records, and the output says which.
  • It reads results/<dataset_type>/<variant>/<instrument>/<setup_id>/<host_class>/ when it exists: per cell it reports the tree as present, directory only or absent, and it lists tree directories that have no catalogue row.
  • It parses setup_id by the R1 grammar and refuses violations with a named SetupIdError. That covers records, planned cells and tree directory names, and includes an explicit _na.
  • local_* hosts are flagged and never count as current (R7).
  • Class is reported exactly as declared (R3). A record whose class differs from its planned cell is flagged; the conductor never assigns a class.
  • The plan routes CPU cells to --partition=ral and A100 cells to gpu with --gres, with the 3600 s cap. It only plans and never runs anything.
  • read_catalogue now also accepts script_routes from a v3 published catalogue.
  • With a v2 or absent catalogue the code path is unchanged.

(c) Samplers faculty

  • The mature tier now reads autolens_inference's scripts/<dataset_type>/<variant>/samplers/<sampler>.py (or samplers/<sampler>/<leaf>.py) through the path-shape fallback. autofit_inference keeps its searches/<sampler>/<model_type>.py shape.
  • validation/ leaves get their own tier (TIER_LENS_VALIDATION) and are never sampler cells.
  • The mature tier label changed from "searches cells" to "sampler cells".
  • The "Empty until autolens-inference phase 3" prose is replaced with what the tier actually holds today.

(d) Prose (skills/profiling/profiling.md, conductor AGENTS.md, skills/sampler_pipeline/{SKILL,reference}.md, samplers AGENTS.md)

  • Lookups read class: optimal + status: current unless asked otherwise.
  • optimal is always a Pulse designation decision.
  • Full-fit wall-time validation is Pulse's axis (walltime-validation@1, instance lens-walltime, producer autolens_inference), never Insight's.
  • Insight sampler campaigns record setup_mode: auto, with setup_resolved as provenance.
  • The Pulse selector order is Class → Likelihood → Instrument → Hardware class → Measurement.

Live dry-run proof (canonical checkouts)

  • bin/pyauto-brain profiling campaign --json: the before and after output is byte-identical (sha256 be73b898…0714 both times): grid_cells 22, runs_done 23, runs_unusable 4, runs_missing 17. The --tier a100 --json output, the --axis compile --json output and the human-readable text output are also byte-identical before and after.
  • bin/pyauto-brain samplers:
    • The mature autolens_inference tier still lists the 3 point_source cells.
    • It now also lists the 8 imaging delaunay/rectangular sampler cells (emcee, nautilus, nuts, smc) from the 0C tree.
    • The new validation tier lists imaging/{delaunay,rectangular}/baseline_slam.
    • The autofit_inference tier is unchanged (90).
  • As a sanity check, Pulse's own tests/fixtures/setup_summary_v3.json, read through the conductor (in a scratch copy), gives 4 current and 1 missing (euclid) of 5 planned cells, plus 1 superseded record.

Tests

  • python -m pytest tests -q -n auto: 1268 → 1282 passed.
    • +8 in test_profiling_conductor.py (48 → 56): new-tree coverage, dispatch routing, class mismatch, envelope pin, v2 byte-identical, bad grammar in records and tree, archived/unknown class refused.
    • +3 in test_samplers_surface.py (17 → 20).
    • +3 in the new template test.
  • ruff check .: 59 findings both before and after. None are new; the only one in a touched file is a pre-existing E741 in _samplers.benchmarks.

Deviations

  • The v3 fixture is built in tmp_path following the existing hermetic _workspace(tmp_path) pattern. There is no tests/fixtures/profiling_v3_tree/, which the issue allowed.
  • profiling-summary@3 has no envelope release pin, so "the catalogue's pin" is the envelope's release_pin if one is present, otherwise the newest record pin. The output reports which.
  • On a v3 catalogue, cells are routed by host_class and --tier is echoed but not used to filter (tier_note in the output).
  • The Pulse selector order is not quoted anywhere in the board or memory faculty prose, so it is stated in profiling.md and lifecycle.md only.
  • Blocked-by: values in the template name the epic phase (lifecycle-<…> Phase N), because the earlier phase's issue number is not known when the template is rendered. Rendering rule 4 allows replacing it with a Repo#N ref at filing.

Closes #535

🤖 Generated with Claude Code

API Changes

  • pyauto-brain profiling campaign output: unchanged for v2/absent catalogues (byte-identical); on a profiling-summary@3 catalogue the decision carries the new lifecycle coverage grid (per likelihood × class × measurement, cells current/stale/superseded/missing) and routes by host_class (--tier echoed).
  • New SetupIdError raised on a setup_id that violates <backend>_<device>_<operator>_<precision>[_<transformer>], in the catalogue or in results-tree folder names.
  • Samplers faculty: autolens_inference mature-tier label renamed "searches cells" → "sampler cells"; new validation tier for scripts/<dataset_type>/<variant>/validation/ leaves. autofit_inference tier unchanged.
  • New skill page skills/profiling/lifecycle.md (no CLI change; phase 8 adds the verb).

…d, samplers 0C paths, Pulse/Insight read prose (likelihood-lifecycle 0E)

(a) skills/profiling/lifecycle.md: the L0-L7 lifecycle as a phase-prompt
template (one placeholder set; one fenced prompt block per step with owning
repos, Brain door, human gate, witness and a full Mind header). Linked from the
profiling skill, its command page and the conductor AGENTS.md. A test renders
it for imaging/delaunay and judges the prompts with intake's own census.

(b) Profiling conductor: a published profiling-summary@3 catalogue switches
`campaign` to the lifecycle grid (likelihood x class x measurement; cells
current / stale / superseded / missing), reads the mirrored results tree,
refuses setup_ids off the R1 grammar (SetupIdError), never counts local_*
hosts as current, reports class as declared. v2/absent catalogue: unchanged
(live dry-run JSON byte-identical).

(c) Samplers faculty: mature tier reads autolens_inference's
scripts/<dataset_type>/<variant>/samplers/ (path fallback; old searches/ shape
kept for autofit_inference); validation/ leaves listed as their own tier.

(d) Prose: optimal+current default reads, optimal is a Pulse designation,
walltime-validation@1 / lens-walltime is Pulse's, Insight records
setup_mode: auto with setup_resolved, Pulse selector order.

Closes #535

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit a64b799 into main Oct 23, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/likelihood-lifecycle-p0-brain branch October 23, 2026 15:11
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.

feat: likelihood-lifecycle 0E — lifecycle template, conductor @3/mirrored-tree grid, samplers paths, Pulse/Insight prose

1 participant