WEEK_3_REBASE_PLAN

Week 3 Rebase Plan

69 commits from 25e2c0200616b315096750 (HEAD). Goal: squash down to ~12-15 logical commits.


Group 1: Formatting + artifact test baseline (commits 1-5)

Squash into 1 commit.

#HashMessage
171cb0492a9Formatting…
2aaa999c521Formatting.
3ff4c8cc43dFormatting.
4bd3cc7f5ebRebase into artifact gaps.
548022a0720Add connection-only section test, structured BenignArtifact catalog.

Message hint: Start with “Add connection-only section test + BenignArtifact catalog”. Formatting is just cleanup, don’t need to mention.


Group 2: gxformat2 normalized model migration (commits 6-14)

Squash into 1 commit. All of this is migrating validation, roundtrip, and export_format2 from raw dicts to gxformat2 NormalizedNativeWorkflow/NormalizedFormat2 models.

#HashMessage
6dcf32131c6Migrate validation to gxformat2 normalized models, bump dep.
752d29f899eReplace deprecated gxformat2 shims with to_format2/to_native + ConversionOptions.
8826afe8f28Remove class_ hack and ensure_export_defaults, pass model to to_native.
99e753b4b65Retype roundtrip comparison to use NormalizedNativeWorkflow models.
102285cafea7Remove dead compare_connections.
111816cb29f2Rework export_format2 to use NormalizedFormat2 models throughout.
12dc5468b20bUse ensure_native + convenience properties, drop str(type_) casts.
13d151393f25Replace _replace_states with callback-based export via to_format2.
14c6165394a9Use to_dict(), drop connection list wrapping.

Message hint: Start with “Migrate workflow_state to gxformat2 normalized models”. Mention bumping dep, dropping deprecated shims, callback-based export rewrite. The dead code removal (compare_connections, class_ hack) follows naturally.


Group 3: CLI dedup + ToolCacheOptions extraction + typed model migration (commits 15-20)

Squash into 1 commit. Shared CLI infra, ToolCacheOptions base model, roundtrip/validation typed models, shared utils.

#HashMessage
15cfef709f03Extract ToolCacheOptions base model and setup_tool_info helper.
165227770a1bMigrate roundtrip_native_workflow/step to typed models.
17e9588a8af3Deduplicate CLI scripts with build_base_parser + cli_main helpers.
1807e1e1afb4Migrate validation_native + convert to accept NormalizedNativeStep.
198ec1fc7f93Extract shared utils, fix validate_workflow_native type hint.
20eb1f9e69f6Consolidate workflow_state helpers, fix convert/roundtrip bugs.

Message hint: Start with “Extract shared CLI infra and migrate to typed models”. Mention ToolCacheOptions, build_base_parser, NormalizedNativeStep acceptance, _util extraction.

Model migration work (should fold into Group 2 or be its own “model migration continued”):

CLI dedup (separate concern):

Consolidation (bugs/cleanup from the above):


Group 4: Docs (commit 21)

Keep as-is — standalone docs commit is clean.

#HashMessage
21ed372f312dWorkflow CLI Docs.

Group 5: Roundtrip reporting — Pydantic models + report output (commits 22-26)

Squash into 1 commit. Roundtrip went from dataclasses → Pydantic, gained step ID mapping, stale key data, report-json/markdown output. #26 is the polish of #25.

#HashMessage
22393d947339Migrate connection_graph.py to NormalizedNativeWorkflow Pydantic models.
236cbc40c119Convert roundtrip dataclasses to Pydantic models.
249d26a17499Surface step ID mapping, stale key data, and original dict in roundtrip results.
25780c46d9a6Add —report-json and —report-markdown to roundtrip validate CLI.
26e7519ae012Polish roundtrip report models: fix serialization, typing, and code quality.

Message hint: Start with “Rework roundtrip to Pydantic models with structured report output”. Mention connection_graph migration, —report-json/—report-markdown, step ID mapping. Serialization fixes from the polish commit are just “the rest of the work”.


Group 6: Agent cleanup + extract_all_tools replacement + walker extraction (commits 27-33)

Squash into 1 commit. Agent did work, got manually reviewed, restored accidentally removed code, replaced extract_all_tools, extracted walk_format2_state.

#HashMessage
27a7f47e9a20Migrate clean.py reading path to NormalizedNativeStep, fix gxformat2 imports.
282b13d6b4c7Use connected_paths for membership checks in validation + convert.
2912864d3fe7Manual review of the agent work.
301bf2018ddeRestore CombinedGetToolInfo accidentally removed in cf9884f92e.
31175d38afdfReplace extract_all_tools with gxformat2 ensure_native + unique_tools.
322394ae5c75Extract walk_format2_state from convert.py inline traversal.
33d45b2929d4Add comment about json encoding…

Message hint: Start with “Extract walk_format2_state, replace extract_all_tools, migrate clean.py”. Mention connected_paths, CombinedGetToolInfo restore.


Group 7: Connected value injection + state_merge + legacy encoding/parameters (commits 34-44)

Squash into 1 commit. This is the big “make connected values and legacy encoding work correctly” block. Note: d125503aac (#41) is a subset of df2d3e1576 (#34) — same topic, just partial first attempt. 11ff6c5bba (#42) is legacy_encoding.py which evolved into legacy_parameters.py (#35) + precheck.py (#44).

#HashMessage
34df2d3e1576Make _inject_connected_value tool-aware to disambiguate repeat indices.
356693267efeAdd classified replacement parameter detection (legacy_parameters.py).
366af1a7c7a9Unify ConnectedValue injection into shared _state_merge.py.
37c2aaca51aaMake clean_stale_state take NormalizedNativeWorkflow.
38c15499ecb7Skip pydantic validators for optional text params with None/empty values.
3969ae5f95f2Fix optional text default_value handling across input formats.
409abdf9cd27Make workflow_step model fields optional — connected params are absent from state.
41d125503aacMake _inject_connected_value tool-aware (partial, superseded by #34).
4211ff6c5bbaAdd legacy parameter encoding detection (legacy_encoding.py).
43e9977359a4Don’t recursively try to deal with encoding stuff.
4493b72fb869Add uniform workflow prechecking for legacy encoding (precheck.py).

Message hint: Start with “Add state_merge, legacy parameter detection, and workflow prechecking”. Mention: tool-aware connected value injection for repeat disambiguation, optional model fields for connected params, optional text pydantic validator fixes (these are in tool_util_models so worth calling out), precheck.py as unified gate. legacy_encoding.py → legacy_parameters.py evolution doesn’t need explaining, just mention the final form.

Group A: Walker extraction + connected value injection (commits 5, 4, 1)

These are all about the _walker.py / convert.py refactor — pulling traversal logic out of convert and making connected value injection understand repeat indices.

Group B: State merge + legacy parameters (commits 3, 2)


Group 8: export_format2 rework + format2 validation unification (commits 45-47)

Squash into 1 commit.

#HashMessage
45e24329db9dRework export_format2 to use NormalizedNativeWorkflow + precheck.
46a50e57f1e3Unify format2 validation into shared validate_format2_state().
4735d8f844f8Fix remaining model gaps, remove ConnectedValue error catch.

Message hint: Start with “Rework export_format2 with precheck + unified format2 validation”. Mention model gap fixes in parameters.py.


Group 9: CLI rename + convergence (commits 48-54)

Squash into 1 commit. Rename galaxy-workflow-* → gxwf-*, add gxwf-to-native-stateful, gxwf-lint-stateful, converge options, docs + integration tests.

#HashMessage
48682cc05d65Rename galaxy-workflow-* CLIs to gxwf-* namespace.
4948cad3b152Converge gxwf-to-format2 and gxwf-to-format2-stateful CLI options.
50ccd8f5b7dfRemove —diff from gxwf-to-format2-stateful.
517173f7197eFix test_tool_cache: use NormalizedNativeWorkflow.unique_tools.
52dfc2b61a78Implement gxwf-to-native-stateful CLI (Step 2).
5323bc87deb3Implement gxwf-lint-stateful CLI (Step 3).
54eee9788c3dAdd docs and integration tests for new CLI commands (Step 5).

Message hint: Start with “Rename CLIs to gxwf-* namespace, add to-native-stateful + lint-stateful”. Mention option convergence, —diff removal, integration test coverage.

Unify workflow CLI naming and coverage with gxformat2.

The galaxy-tool-util workflow CLIs (galaxy-workflow-) lived in a separate namespace from gxformat2’s structural CLIs (gxwf-). They should feel like one toolkit — gxformat2 handles structural operations, galaxy-tool-util adds schema-aware variants via callback slots.

Rename galaxy-workflow-* → gxwf-* (state-validate, state-clean, roundtrip-validate, to-format2-stateful). Add two new CLIs completing the stateful layer:

Converge gxwf-to-format2-stateful options with gxwf-to-format2 (—compact, —json, -o, stdout default), remove —diff. Add wf_tooling developer docs, IWC sweep integration tests for new commands.


Group 10: JSON Schema validation — all 4 phases (commits 55-63)

Squash into 1-2 commits. Could keep as 1 (all of JSON Schema work) or split into “export infra” (55-56) and “validation + integration” (57-63). Recommend 1 since it’s all one feature.

#HashMessage
55b76c58babfAdd galaxy-tool-cache schema subcommand for JSON Schema export.
561998e2a663Add structural-schema subcommand, Phase 1 JSON Schema export tests.
57a00452e7e1Add two-level JSON Schema validation module, Phase 2 structural tests.
58a017daa005Fix schema dir layout to use subdirectories, add invalid step type test.
598b871ff136Type get_tool_info as GetToolInfo, fix test imports and assertion.
601214aea8bdAdd Phase 3 per-step tool state JSON Schema validation tests.
61b754cb20c8Add —mode json-schema to gxwf-state-validate, Phase 4 integration tests.
6208250d1150Fix review items: directory mode, imports, extra-key and strict tests.
63033a3a11d5Extract shared test helpers, add subworkflow/schema-dir/connections fixes.

Message hint: Start with “Add JSON Schema validation: export, structural checks, per-step validation, —mode json-schema”. Mention two-level validation module (validation_json_schema.py), schema subcommand on tool-cache CLI, 4-phase test suite. Polish items (dir layout fix, test helpers extraction) are just part of the work.


Group 11: Final polish + unification (commits 64-69)

Squash into 1 commit. Import cleanup, select_which_when unification, current_case removal, LeafCallback type, CLI common extraction, unified validation pipeline.

#HashMessage
645fa103a9d2Move deferred imports to module level, capture format2 state in StepResult.
6509100ee1c0Replace current_case usage with _select_which_when_native() walker.
66d12e899499Resolve 5 TODOs: type alias, computed property, YAML loader, docstrings.
676ad86966c7Add LeafCallback type, unify select_which_when_format2 with native.
68c7ea55d55dExtract add_report_args() into _cli_common, dedup across 3 scripts.
69b315096750Unify state + connection validation into single pipeline.

Message hint: Start with “Unify state + connection validation pipeline, replace current_case with walker”. Mention LeafCallback type, _cli_common extraction, format2 state in StepResult. TODO cleanup doesn’t need mention.


Summary

GroupCommitsResulting commit
1. Formatting + artifact baseline1-51
2. gxformat2 model migration6-141
3. CLI infra + typed models15-201
4. Docs211 (keep)
5. Roundtrip reporting22-261
6. Agent cleanup + walker extraction27-331
7. State merge + legacy params + precheck34-441
8. export_format2 rework45-471
9. CLI rename + convergence48-541
10. JSON Schema validation55-631
11. Final unification64-691
Total69~11

Execution Strategy

Since git rebase -i is off-limits (interactive tool config issue), we should do this with sequential git reset --soft operations on a fresh branch:

  1. Create new branch from 25e2c0200616
  2. Cherry-pick each group’s range, then git reset --soft to squash
  3. Commit with the composed message
  4. Repeat for each group in order
  5. Verify final tree matches current HEAD’s tree exactly (git diff should be empty)

Alternatively, simpler: git reset --soft from HEAD back to each group boundary, commit, repeat working backwards. But forward is safer for conflict-free results.