# PHASE_A_PROCESSING_INDEX.txt
# STELLAR_BOUNDARY_DYNAMICS_I
# Phase A — MESA Pre-Collapse Track Processing

PHASE:
A_mesa_precollapse_tracks

CURRENT STATUS:
Phase A is source-archived but not yet structurally processed.

AVAILABLE SOURCES:
A1_12M_pre_ms_to_core_collapse/
A2_20M_pre_ms_to_core_collapse/

SOURCE TYPE:
MESA test-suite source folders for pre-main-sequence to core-collapse stellar
evolution cases.

A1:
12M_pre_ms_to_core_collapse

A2:
20M_pre_ms_to_core_collapse

CURRENTLY AVAILABLE:
MESA inlists
MESA controls
test-suite source files
README/source notes where present

NOT YET AVAILABLE / NOT YET PROCESSED:
history.data
profile*.data
MESA LOGS output
physical time-series columns
actual stellar-evolution numerical trajectory

IMPORTANT DISTINCTION:
Phase A has not yet reached the same processing level as Phase B.

Phase B already has:
raw JSON
light-curve ladders
STRUC-PERC-I canonical inputs
numeric STRUC-PERC-I ladders
STRUC-PERC-I batch results
alpha-application grids
5D vectors
normalization-reviewed v2 vectors

Phase A currently has:
source folders only

Therefore, A–B comparison is not valid yet.

NEXT REQUIRED PROCESSING CHAIN:
MESA source folders
→ A scaffold ladder OR actual MESA history ladder
→ A STRUC-PERC-I canonical input
→ A numeric STRUC-PERC-I ladder
→ A STRUC-PERC-I batch result
→ A alpha-application
→ A 5D vector summary
→ A normalization-reviewed v2 vector summary
→ then A–B bridge

PROCESSING ROUTES:

============================================================
ROUTE A-SCAFFOLD:
Stage scaffold from MESA inlists

PURPOSE:
Create the first Phase A structural-stage ladder from the MESA inlist sequence.

USE WHEN:
history.data and profile*.data are not yet available.

STAGE CHAIN:
late pre-ZAMS
ZAMS
end core He burn
end core C burn
lgTmax / silicon-burning approach
core collapse

INPUT:
A1_12M_pre_ms_to_core_collapse/
A2_20M_pre_ms_to_core_collapse/

EXPECTED OUTPUT:
ladders/A1_12M_stage_ladder.csv
ladders/A2_20M_stage_ladder.csv

STATUS:
Next immediate route.

LIMITATION:
This is a structural-stage scaffold, not a physical MESA output trajectory.
It is useful for pipeline testing and structural alignment, but it should not be
presented as a full physical stellar-evolution result.

============================================================
ROUTE A-HISTORY:
Actual MESA output trajectory

PURPOSE:
Create physical pre-collapse ladders from real MESA run outputs.

USE WHEN:
history.data and profile*.data are available.

REQUIRED INPUTS:
LOGS/history.data
LOGS/profile*.data

TARGET COLUMNS:
model_number
star_age
log_L
log_R
log_Teff
center_h1
center_he4
center_c12
center_o16
center_ne20
center_si28
center_fe56
center_temperature
center_density
surface_h1
surface_he4
star_mass
he_core_mass
co_core_mass
fe_core_mass

EXPECTED OUTPUT:
ladders/A1_12M_history_ladder.csv
ladders/A2_20M_history_ladder.csv

STATUS:
Deferred until actual MESA output files are available.

============================================================

CURRENT CHOSEN ROUTE:
A-SCAFFOLD

REASON:
The current Phase A folders contain MESA source/test-suite files but no
processed MESA history.data or profile*.data outputs.

NEXT SCRIPT:
tools/a_inlists_to_stage_ladder.py

SCRIPT ROLE:
Read:
A1_12M_pre_ms_to_core_collapse/
A2_20M_pre_ms_to_core_collapse/

Write:
ladders/A1_12M_stage_ladder.csv
ladders/A2_20M_stage_ladder.csv

A_STAGE_LADDER_EXPECTED_COLUMNS:
ladder_id
source_id
source_name
object_name
mass_class
stage_index
phase_name
inlist_name
stage_role
stage_weight
expected_physical_state
boundary_role
struc_perc_role
unns_interpretation
raw_reference

A_STAGE_SEQUENCE:
1 late_pre_zams
2 zams
3 end_core_he_burn
4 end_core_c_burn
5 lgTmax_silicon_approach
6 core_collapse

A_STRUC_PERC_TARGET:
After stage ladders are created, convert them into:

struc_perc_i/canonical_inputs/A1_12M_struc_perc_input.csv
struc_perc_i/canonical_inputs/A2_20M_struc_perc_input.csv

struc_perc_i/numeric_ladders/A1_12M_numeric_ladder.txt
struc_perc_i/numeric_ladders/A2_20M_numeric_ladder.txt

A_STRUC_PERC_BATCH_TARGET:
Run the A numeric ladders in STRUC-PERC-I v2.5.0 batch mode.

Expected exported results:
struc_perc_i/struc_perc_batch_results.csv
struc_perc_i/struc_perc_batch_results.json

A_ALPHA_TARGET:
After STRUC-PERC-I results, run alpha application:

alpha_application/grids/
alpha_application/vectors/
alpha_application/summaries/
alpha_application/normalization_review/

A_FINAL_REQUIRED_FILE_FOR_BRIDGE:
alpha_application/normalization_review/A_5D_VECTOR_SUMMARY_v2.csv

ONLY AFTER THIS FILE EXISTS:
Proceed to A–B bridge.

A–B BRIDGE INPUTS:
A_mesa_precollapse_tracks/alpha_application/normalization_review/A_5D_VECTOR_SUMMARY_v2.csv
B_supernova_light_curves/alpha_application/normalization_review/B_5D_VECTOR_SUMMARY_v2.csv

A–B BRIDGE QUESTION:
Do pre-collapse structural-stage trajectories and post-collapse brightness-response
trajectories occupy compatible, separated, or transition-linked regions of the
same structural-vector space?

STATUS:
Phase A processing folders created.
Phase A processing index created.
Ready to create tools/a_inlists_to_stage_ladder.py.
