Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .map/scripts/map_step_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14725,7 +14725,7 @@ def refresh_blueprint_affected_files(
bp_data["blueprint"] = target_body
else:
bp_data = target_body
bp_path.write_text(json.dumps(bp_data, indent=2), encoding="utf-8")
_write_json_file(bp_path, bp_data)
return {
"status": "success",
"subtask_id": subtask_id,
Expand Down Expand Up @@ -14867,7 +14867,7 @@ def record_diagnostics_baseline(
"recorded_at": _utc_timestamp(),
"tools": results,
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload


Expand Down Expand Up @@ -15059,7 +15059,7 @@ def record_test_baseline(
),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload
run_dir = candidate
detected_module_dir = module_dir_arg
Expand All @@ -15086,7 +15086,7 @@ def record_test_baseline(
"candidate_module_dirs": names,
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload
detected_cmd = detection.get("command")
if detected_cmd:
Expand All @@ -15112,7 +15112,7 @@ def record_test_baseline(
),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload

started = time.time()
Expand Down Expand Up @@ -15184,7 +15184,7 @@ def record_test_baseline(
"baseline_failures": sorted(set(failures)),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload


Expand Down Expand Up @@ -15561,7 +15561,7 @@ def record_subtask_baseline(branch: str, subtask_id: str) -> dict:
"files": sorted(set(files)),
"head_sha": head_sha,
}
path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(path, payload)
return {
"status": "success",
"path": str(path),
Expand Down Expand Up @@ -19129,7 +19129,7 @@ def _reject(status: str, reason_text: str) -> dict[str, Any]:

# Durable human-readable blocker report.
artifact_path.parent.mkdir(parents=True, exist_ok=True)
artifact_path.write_text(_render_escalation_artifact(outcome), encoding="utf-8")
_write_text_file(artifact_path, _render_escalation_artifact(outcome))

# Register the manifest stage so run-health / resume can see the terminal stop.
manifest = load_artifact_manifest(branch_name)
Expand Down Expand Up @@ -19291,7 +19291,7 @@ def create_approval_hold(

report_path = _approval_hold_report_path(hold_id, branch_name)
report_path.parent.mkdir(parents=True, exist_ok=True)
report_path.write_text(_render_approval_hold_report(hold), encoding="utf-8")
_write_text_file(report_path, _render_approval_hold_report(hold))

manifest = load_artifact_manifest(branch_name)
_set_manifest_stage(
Expand Down Expand Up @@ -19366,7 +19366,7 @@ def decide_approval_hold(

report_path = _approval_hold_report_path(hold_id, branch_name)
report_path.parent.mkdir(parents=True, exist_ok=True)
report_path.write_text(_render_approval_hold_report(hold), encoding="utf-8")
_write_text_file(report_path, _render_approval_hold_report(hold))

pending_remaining = any(
isinstance(h, dict) and h.get("state") == "pending" for h in holds.values()
Expand Down
20 changes: 10 additions & 10 deletions src/mapify_cli/templates/map/scripts/map_step_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14725,7 +14725,7 @@ def refresh_blueprint_affected_files(
bp_data["blueprint"] = target_body
else:
bp_data = target_body
bp_path.write_text(json.dumps(bp_data, indent=2), encoding="utf-8")
_write_json_file(bp_path, bp_data)
return {
"status": "success",
"subtask_id": subtask_id,
Expand Down Expand Up @@ -14867,7 +14867,7 @@ def record_diagnostics_baseline(
"recorded_at": _utc_timestamp(),
"tools": results,
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload


Expand Down Expand Up @@ -15059,7 +15059,7 @@ def record_test_baseline(
),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload
run_dir = candidate
detected_module_dir = module_dir_arg
Expand All @@ -15086,7 +15086,7 @@ def record_test_baseline(
"candidate_module_dirs": names,
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload
detected_cmd = detection.get("command")
if detected_cmd:
Expand All @@ -15112,7 +15112,7 @@ def record_test_baseline(
),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload

started = time.time()
Expand Down Expand Up @@ -15184,7 +15184,7 @@ def record_test_baseline(
"baseline_failures": sorted(set(failures)),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload


Expand Down Expand Up @@ -15561,7 +15561,7 @@ def record_subtask_baseline(branch: str, subtask_id: str) -> dict:
"files": sorted(set(files)),
"head_sha": head_sha,
}
path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(path, payload)
return {
"status": "success",
"path": str(path),
Expand Down Expand Up @@ -19129,7 +19129,7 @@ def _reject(status: str, reason_text: str) -> dict[str, Any]:

# Durable human-readable blocker report.
artifact_path.parent.mkdir(parents=True, exist_ok=True)
artifact_path.write_text(_render_escalation_artifact(outcome), encoding="utf-8")
_write_text_file(artifact_path, _render_escalation_artifact(outcome))

# Register the manifest stage so run-health / resume can see the terminal stop.
manifest = load_artifact_manifest(branch_name)
Expand Down Expand Up @@ -19291,7 +19291,7 @@ def create_approval_hold(

report_path = _approval_hold_report_path(hold_id, branch_name)
report_path.parent.mkdir(parents=True, exist_ok=True)
report_path.write_text(_render_approval_hold_report(hold), encoding="utf-8")
_write_text_file(report_path, _render_approval_hold_report(hold))

manifest = load_artifact_manifest(branch_name)
_set_manifest_stage(
Expand Down Expand Up @@ -19366,7 +19366,7 @@ def decide_approval_hold(

report_path = _approval_hold_report_path(hold_id, branch_name)
report_path.parent.mkdir(parents=True, exist_ok=True)
report_path.write_text(_render_approval_hold_report(hold), encoding="utf-8")
_write_text_file(report_path, _render_approval_hold_report(hold))

pending_remaining = any(
isinstance(h, dict) and h.get("state") == "pending" for h in holds.values()
Expand Down
20 changes: 10 additions & 10 deletions src/mapify_cli/templates_src/map/scripts/map_step_runner.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -14700,7 +14700,7 @@ def refresh_blueprint_affected_files(
bp_data["blueprint"] = target_body
else:
bp_data = target_body
bp_path.write_text(json.dumps(bp_data, indent=2), encoding="utf-8")
_write_json_file(bp_path, bp_data)
return {
"status": "success",
"subtask_id": subtask_id,
Expand Down Expand Up @@ -14842,7 +14842,7 @@ def record_diagnostics_baseline(
"recorded_at": _utc_timestamp(),
"tools": results,
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload


Expand Down Expand Up @@ -15034,7 +15034,7 @@ def record_test_baseline(
),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload
run_dir = candidate
detected_module_dir = module_dir_arg
Expand All @@ -15061,7 +15061,7 @@ def record_test_baseline(
"candidate_module_dirs": names,
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload
detected_cmd = detection.get("command")
if detected_cmd:
Expand All @@ -15087,7 +15087,7 @@ def record_test_baseline(
),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload

started = time.time()
Expand Down Expand Up @@ -15159,7 +15159,7 @@ def record_test_baseline(
"baseline_failures": sorted(set(failures)),
"recorded_at": _utc_timestamp(),
}
baseline_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(baseline_path, payload)
return payload


Expand Down Expand Up @@ -15536,7 +15536,7 @@ def record_subtask_baseline(branch: str, subtask_id: str) -> dict:
"files": sorted(set(files)),
"head_sha": head_sha,
}
path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
_write_json_file(path, payload)
return {
"status": "success",
"path": str(path),
Expand Down Expand Up @@ -19104,7 +19104,7 @@ def build_escalation_outcome(

# Durable human-readable blocker report.
artifact_path.parent.mkdir(parents=True, exist_ok=True)
artifact_path.write_text(_render_escalation_artifact(outcome), encoding="utf-8")
_write_text_file(artifact_path, _render_escalation_artifact(outcome))

# Register the manifest stage so run-health / resume can see the terminal stop.
manifest = load_artifact_manifest(branch_name)
Expand Down Expand Up @@ -19266,7 +19266,7 @@ def create_approval_hold(

report_path = _approval_hold_report_path(hold_id, branch_name)
report_path.parent.mkdir(parents=True, exist_ok=True)
report_path.write_text(_render_approval_hold_report(hold), encoding="utf-8")
_write_text_file(report_path, _render_approval_hold_report(hold))

manifest = load_artifact_manifest(branch_name)
_set_manifest_stage(
Expand Down Expand Up @@ -19341,7 +19341,7 @@ def decide_approval_hold(

report_path = _approval_hold_report_path(hold_id, branch_name)
report_path.parent.mkdir(parents=True, exist_ok=True)
report_path.write_text(_render_approval_hold_report(hold), encoding="utf-8")
_write_text_file(report_path, _render_approval_hold_report(hold))

pending_remaining = any(
isinstance(h, dict) and h.get("state") == "pending" for h in holds.values()
Expand Down