@@ -1450,7 +1450,7 @@ def push(project_root, sftp_host, sftp_username, sftp_key, project_id, project_n
14501450 with open (project_json_path , "r" ) as f :
14511451 pj = _json .load (f )
14521452 try :
1453- _api_put (f"/projects/{ platform_id } " , {"cli_project_json" : pj , "cli_sync_source" : "push" })
1453+ _api_put (f"/projects/{ platform_id } " , {"cli_project_json" : _slim_project_json ( pj ) , "cli_sync_source" : "push" })
14541454 console .print ("[green]✓ Platform project synced[/green]" )
14551455 except SystemExit :
14561456 console .print ("[yellow]⚠ SFTP upload succeeded but platform sync failed[/yellow]" )
@@ -1595,7 +1595,7 @@ def pull(project_name, output_dir, sftp_host, sftp_username, sftp_key):
15951595 import json as _json
15961596 with open (local_pj , "r" ) as f :
15971597 pj = _json .load (f )
1598- _api_put (f"/projects/{ platform_id } " , {"cli_project_json" : pj , "cli_sync_source" : "pull" })
1598+ _api_put (f"/projects/{ platform_id } " , {"cli_project_json" : _slim_project_json ( pj ) , "cli_sync_source" : "pull" })
15991599 console .print ("[green]✓ Platform project synced[/green]" )
16001600 except SystemExit :
16011601 console .print ("[yellow]⚠ SFTP download succeeded but platform sync failed[/yellow]" )
@@ -3753,6 +3753,20 @@ def _api_put(path: str, json_data: dict):
37533753 client .close ()
37543754
37553755
3756+ _SYNC_KEEP_KEYS = {"project" , "tapeout" }
3757+
3758+
3759+ def _slim_project_json (pj : dict ) -> dict :
3760+ """Return a lightweight copy of project.json for API sync.
3761+
3762+ The full file can exceed the 8 KB AWS WAF body-inspection limit when it
3763+ contains DRC results, report summaries, etc. The backend only needs the
3764+ ``project`` and ``tapeout`` top-level sections; everything else is
3765+ stripped to keep the payload small.
3766+ """
3767+ return {k : v for k , v in pj .items () if k in _SYNC_KEEP_KEYS }
3768+
3769+
37563770def _load_project_platform_id (project_root : str ):
37573771 """Read platform_project_id from .cf/project.json, return None if absent."""
37583772 pj = Path (project_root ) / '.cf' / 'project.json'
0 commit comments