feat(#90): IMP-56 u1-u19 catch-up before final close (post-u20 push fix)
Some checks failed
Multi-MDX Regression (IMP-91) / multi-mdx-regression (push) Failing after 20s
Some checks failed
Multi-MDX Regression (IMP-91) / multi-mdx-regression (push) Failing after 20s
u1: text_overrides axis in user_overrides_io u2: structure_overrides axis in user_overrides_io u3: vite allowlist for new endpoints u4: text_override_resolver u5: Step 12 text_overrides apply in phase_z2_pipeline u6: structure_override_resolver u7: text_path_stamper u8: SlideCanvas text-edit capture u9: SlideCanvas structure-edit overlay u10: userOverridesApi service extension u11: designAgent types extension u12: slidePlanUtils restore u13: user_overrides endpoint tests u14: user_overrides restore tests u15: pipeline fallback tests u16: edit-mode state + gating tests u17: slide_base print mode CSS u18: /api/connect endpoint (vite) u19: /api/export endpoint (vite) Recovery scope: 29 files (12 modified + 17 new). u20 already pushed in 9439575; this commit lands u1-u19 that were authored but not committed before #90 was externally closed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,13 @@ def _exec_main_block(
|
||||
# the section-assignment axis; the new kwargs are captured here so any
|
||||
# follow-up test can pin them without re-touching this harness.
|
||||
override_slide_css=None,
|
||||
# IMP-56 (#90) u16 — absorb the two new file-only axes added to
|
||||
# ``run_phase_z2_mvp1`` so the existing harness keeps working when
|
||||
# the CLI dispatch passes the new kwargs through. Both default to
|
||||
# ``None`` so the no-file / corrupt-file / invalid-stem tests can
|
||||
# continue asserting "all overrides None".
|
||||
override_text_overrides=None,
|
||||
override_structure_overrides=None,
|
||||
reuse_from=None,
|
||||
):
|
||||
captured["mdx_path"] = mdx_path
|
||||
@@ -65,6 +72,8 @@ def _exec_main_block(
|
||||
captured["override_section_assignments"] = override_section_assignments
|
||||
captured["override_image_overrides"] = override_image_overrides
|
||||
captured["override_slide_css"] = override_slide_css
|
||||
captured["override_text_overrides"] = override_text_overrides
|
||||
captured["override_structure_overrides"] = override_structure_overrides
|
||||
captured["reuse_from"] = reuse_from
|
||||
|
||||
monkeypatch.setattr(_pz2, "run_phase_z2_mvp1", _fake_run)
|
||||
@@ -600,3 +609,69 @@ def test_cli_section_assignment_works_without_persisted_file(
|
||||
)
|
||||
|
||||
assert captured["override_section_assignments"] == {"top": ["cli-only"]}
|
||||
|
||||
|
||||
# -- 6. IMP-56 (#90) u16 — text_overrides + structure_overrides file fallback
|
||||
|
||||
|
||||
def test_file_text_overrides_flow_through_when_no_cli(tmp_path, monkeypatch):
|
||||
"""text_overrides axis is file-only — JSON payload reaches run kwarg."""
|
||||
_redirect_overrides_root(tmp_path, monkeypatch)
|
||||
(tmp_path / "03.json").write_text(
|
||||
json.dumps({
|
||||
"text_overrides": {
|
||||
"top": {"title.0": "edited title", "body.1": "edited line"},
|
||||
"bottom_l": {"caption.0": "edited caption"},
|
||||
},
|
||||
}),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
captured: dict[str, Any] = {}
|
||||
_exec_main_block(
|
||||
captured, ["src.phase_z2_pipeline", "03.mdx"], monkeypatch,
|
||||
)
|
||||
|
||||
assert captured["override_text_overrides"] == {
|
||||
"top": {"title.0": "edited title", "body.1": "edited line"},
|
||||
"bottom_l": {"caption.0": "edited caption"},
|
||||
}
|
||||
# No structure payload on file → kwarg collapses to None via ``or None``.
|
||||
assert captured["override_structure_overrides"] is None
|
||||
|
||||
|
||||
def test_file_structure_overrides_flow_through_when_no_cli(
|
||||
tmp_path, monkeypatch
|
||||
):
|
||||
"""structure_overrides axis is file-only; inner keys locked to
|
||||
slot_order + hidden_slots (any other inner key is dropped by the
|
||||
CLI gate). Non-string list elements are dropped too."""
|
||||
_redirect_overrides_root(tmp_path, monkeypatch)
|
||||
(tmp_path / "03.json").write_text(
|
||||
json.dumps({
|
||||
"structure_overrides": {
|
||||
"top": {
|
||||
"slot_order": ["c", "a", "b"],
|
||||
"hidden_slots": ["d"],
|
||||
# foreign key — must be dropped by the CLI gate
|
||||
"frame_id": "swap_attempt",
|
||||
# non-string elements — must be dropped per-entry
|
||||
"slot_order_with_junk": ["x", 1, None, "y"],
|
||||
},
|
||||
"bottom": {"hidden_slots": ["e"]},
|
||||
},
|
||||
}),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
captured: dict[str, Any] = {}
|
||||
_exec_main_block(
|
||||
captured, ["src.phase_z2_pipeline", "03.mdx"], monkeypatch,
|
||||
)
|
||||
|
||||
assert captured["override_structure_overrides"] == {
|
||||
"top": {"slot_order": ["c", "a", "b"], "hidden_slots": ["d"]},
|
||||
"bottom": {"hidden_slots": ["e"]},
|
||||
}
|
||||
# No text payload on file → kwarg collapses to None.
|
||||
assert captured["override_text_overrides"] is None
|
||||
|
||||
Reference in New Issue
Block a user