Skip to content

Record the pipeline's scientific decisions in astra.yaml - #875

Draft
cailmdaley wants to merge 1 commit into
feat/snakemake-orchestrationfrom
docs/astra-decision-record
Draft

Record the pipeline's scientific decisions in astra.yaml#875
cailmdaley wants to merge 1 commit into
feat/snakemake-orchestrationfrom
docs/astra-decision-record

Conversation

@cailmdaley

Copy link
Copy Markdown
Contributor

Stacked on #852 (base is feat/snakemake-orchestration, since the record anchors into workflow/config/cfis/*). Documentation only — no code, no config, no behaviour change.

What

astra.yaml at the repo root records the scientific decisions embedded in ShapePipe's code and committed configs: 50 decisions across eight sub-analyses (masking, detection, preparation, star selection + PSF, shape measurement, PSF diagnostics, survey geometry, catalogue assembly), plus four cross-cutting ones. Each carries its rationale, the alternatives that were considered and why they were rejected, and an anchor back to the code or config that implements it. universes/committed.yaml pins the option this branch selects for every decision.

The format is ASTRA (uvx astra-tools@0.2.17 guide), applied at codebase level rather than to a single analysis. uvx astra-tools@0.2.17 validate passes on both files; all 146 anchors resolve.

Conventions live in the file's own header. In short: anchors are path::symbol or path#SECTION.KEY and never cite line numbers; [HARDCODED] marks a scientific value with no config exposure; [LINT] marks a place where the record and the code — or the code and itself — disagree; [PENDING #NNN] marks state not yet on develop.

Why it is worth reading

Writing it was not a documentation exercise. It surfaced:

  • Nine lints — the code disagreeing with itself or its docs. Two are fixed by fix(psf): deterministic star train/validation split; align tile STAR_THRESH with the 80% convention #873 (the unseeded rand_split in setools, and the 22-vs-20 STAR_THRESH mismatch between PSF validation and science interpolation). The other seven stand, e.g. final_cat.param requesting IMAFLAGS_ISO the merged catalogue never receives; the documented-but-unimplemented TILE_LIST overlap flagging; additive rather than bitwise mask-plane combination.
  • Nine [HARDCODED] values — scientific numbers with no config exposure, including PSFEx's compiled-in SAMPLE_AUTOSELECT defaults, which are a second star selection no config records.
  • Ten drifts since publication — where Guinot+22 / Farrens+22 describe something the code no longer does (DETECT_MINAREA 10→5, DEBLEND_MINCONT 0.001→0.0005 on tiles, tile background AUTO→MANUAL 0, in-line spread-model classification disabled and deferred downstream, HSM moment initialisation→WCS centroids, ...). 16 decisions carry verbatim quotes from those papers as prior insights, machine-verified against the PDFs.

The standing instruction

CLAUDE.md gains a section stating that a scientific change is not finished until the record is — amended in the same PR. The membership test: would a different defensible choice change which objects enter the shear catalogue, or the numbers attached to them? Detection thresholds, masking geometry, star cuts, PSF degree, ngmix priors, flag semantics, completeness floors are in; manifest sentinels, chunk sizes, allocation strategy, directory layout are out.

Open for discussion

  • Whether the record belongs at the repo root or under a subdirectory.
  • The anchor grammar is prose today (a sentence in each rationale). A structured anchor field would be an upstream astra-spec change.
  • Two sub-analyses (psf_diagnostics, survey_geometry) are thin: the committed Snakemake chain runs neither.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y2muA2sRojbxRNxU2SKQeP

ShapePipe's scientific choices — detection thresholds, masking geometry,
star selection, PSF model, ngmix priors and seeding, flag semantics,
completeness floors — live in code and committed configs with their
reasoning nowhere, or spread across PRs, papers and comments. astra.yaml
gathers them: 50 decisions across eight sub-analyses, each with its
rationale, the alternatives that were rejected and why, and a greppable
anchor back to the code or config that implements it.
universes/committed.yaml pins the option this branch selects for every one.

The record is ASTRA (astra-tools; `uvx astra-tools@0.2.17 guide`), applied
here at codebase level rather than to a single analysis. Conventions are
stated in the file's header: anchors as `path::symbol` / `path#SECTION.KEY`
and never line numbers, [HARDCODED] for a scientific value with no config
exposure, [LINT] for a place where the record and the code — or the code and
itself — disagree, [PENDING #NNN] for state not yet on develop.

Authoring it surfaced nine such lints, two of which #873 fixes, and mapped
ten places where the published Guinot+22 / Farrens+22 descriptions have
drifted from the code since publication; 16 decisions carry verbatim
paper quotes as prior insights.

CLAUDE.md gains the standing instruction: a scientific change is not
finished until the record is, amended in the same PR. The membership test
is whether a different defensible choice would change which objects enter
the shear catalogue, or the numbers attached to them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2muA2sRojbxRNxU2SKQeP
@cailmdaley
cailmdaley marked this pull request as draft August 31, 2026 01:49
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