Skip to content

Re/01 gsasii extraction - #1

Merged
AdamCorrao merged 6 commits into
refactor/multi-enginefrom
re/01-gsasii-extraction
Sep 29, 2026
Merged

AdamCorrao merged 6 commits into
refactor/multi-enginefrom
re/01-gsasii-extraction

Conversation

@AdamCorrao

Copy link
Copy Markdown
Owner

First branch of the v0.2.0 multi-engine refactor (master plan §5, re/01).
Moves kicker.py's GSAS-II code into src/powderline/gateways/gsasii/
without modifying any moved code. Shims keep every existing import path working.

Commits

  • 3f35c26, daace24 — @require_phase cherry-picks of scratch e3e91c1 + dc2a0d2 (A46)
  • ab87cc3 — move into helpers/project/setters/executors/extractors; constraints/server/client relocated unchanged; old-path shims + kicker re-exports (A49)
  • 1384755 — tests: retarget patches of moved internals (A47)
  • 6603574 — 3-line server/client __file__ path fix (A48; the only non-move src edit)
  • c471b19 — code-hash tripwire now covers the six gateway modules

Verification

  • Move fidelity: 56/56 top-level definitions + __main__ byte-identical; banners preserved; constraints.py identical (devkit tasks/re01-move-fidelity.md)
  • Suite: baseline 492 passed / 3 skipped → final 498 passed / 3 skipped (+6 = new per-module hash tests); easydiff env 54 passed before and after
  • Server round-trip (autostart + pixi run gsas-server): LaB6 within regression tolerance
  • examples/ untouched; no engine imports added to core; no frozen-edits ledger entry needed

Maintainer line-by-line review: approved 2026-09-29.

🤖 Generated with Claude Code

AdamCorrao and others added 6 commits September 28, 2026 16:36
…ator

Validation exercise per devkit dossiers/multi-engine A22: byte-identical
error messages (probe diff empty) and full suite green (492 passed, 3
skipped), matching the v0.1.1 baseline. See devkit
dossiers/multi-engine/tasks/require-phase-validation.md.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…/proj

Devkit PR review finding (confirmed): the None special-case skipped the
existence check, but the original inline checks raise ValueError for
phase_name=None and AttributeError for proj=None. Also let sig.bind
TypeErrors fall through so native missing-argument messages are preserved.
Edge-case probe (phase=None x5 setters, proj=None, missing-args) diff empty
vs main; original probe diff empty; full suite 492 passed, 3 skipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rbatim)

Pure cut-paste split of the kicker.py monolith (multi-engine refactor,
re/01). Every moved function/class/assignment body is byte-identical;
only module docstrings and import lines are new.

- gateways/gsasii/{helpers,project,setters,executors,extractors}.py:
  moved per the re/01 move map. Each module carries kicker.py's import
  block verbatim (constraints import pointed at its new home) plus
  explicit sibling imports. DEFAULT_* constants -> helpers.py, InstParm
  aliases -> project.py (A49).
- constraints.py, gsas_server.py, gsas_client.py relocated unchanged to
  gateways/gsasii/{constraints,server,client}.py; explicit re-export
  shims at the old paths (gsas_server shim keeps its __main__).
- kicker.py keeps run/validate/load_recipe_asset/is_template_file/
  validate_simulation_mode_parameters + CLI and its original import
  block, and re-exports every moved name, so existing imports resolve.
- gateways/gsasii/__init__.py imports nothing (GSAS-II stays lazy).

Move fidelity: all 56 top-level nodes + __main__ byte-identical,
banner comments preserved, relocated files identical (devkit probe
re01_move_fidelity.py, source-rev daace24).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_refinement now resolves its callees from
powderline.gateways.gsasii.executors (and _extract_phase_reports from
.extractors), so patch("powderline.kicker.<name>") no longer intercepts
them. Retarget those patch strings (pure substitution, 83 targets;
powderline.kicker.G2.G2Project unchanged - it patches the shared module
object) and point test_gsas_server_unit at the real server module so its
PID_FILE/_pid_alive monkeypatches take effect. Maintainer decision A47.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…move

The relocated client computed the src dir and the server script path
relative to its old location (src/powderline/gsas_client.py), so server
autostart would spawn a nonexistent gateways/gsasii/gsas_server.py.
Point src_dir at parents[3] (= src/) in client.py and server.py and
spawn gateways/gsasii/server.py. Three lines; not GSAS-II project-dict
code (outside the A39 freeze) - maintainer decision A48, flagged OTHER
for the re/01 review. The old-path gsas_server.py shim keeps __main__,
so the gsas-server pixi task and docs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dules

_code_hash.json becomes a manifest of MD5s for the frozen GSAS-II code:
gateways/gsasii/{helpers,project,setters,executors,extractors,
constraints}.py (kicker.py is now a facade; server/client are not
hashed). update_code_hash.py regenerates the manifest (drops the
obsolete kicker_hash key, errors if a module is missing);
test_code_hash.py checks the manifest covers exactly those six modules
(independent tripwire list) and each file's hash. constraints.py hash is
unchanged from the pre-move file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AdamCorrao
AdamCorrao merged commit ae415c8 into refactor/multi-engine Sep 29, 2026
2 checks 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.

1 participant