@@ -328,13 +328,37 @@ def test_bootstrap_plan_is_read_only(tmp_path: Path) -> None:
328328 assert data ["status" ] == "ready"
329329 assert data ["writes" ] is False
330330 assert any (item ["path" ] == "AGENTS.md" for item in data ["actions" ])
331- schema_action = next (item for item in data ["actions" ] if item ["path" ] == "aisee-plugin marketplace" )
332- assert "codex plugin marketplace add AISEE-LAB/aisee-plugin --ref main" in schema_action ["reason" ]
331+ marketplace_action = next (item for item in data ["actions" ] if item ["path" ] == "aisee-plugin marketplace" )
332+ assert "codex plugin marketplace add AISEE-LAB/aisee-plugin --ref main" in marketplace_action ["reason" ]
333+ schema_action = next (item for item in data ["actions" ] if item ["path" ] == "openspec/schemas" )
334+ assert schema_action ["kind" ] == "create"
335+ assert "aisee:schema-pack" in schema_action ["reason" ]
333336 assert "aisee schemas install" not in schema_action ["reason" ]
334337 assert all (not item ["path" ].endswith ("id-registry.json" ) for item in data ["actions" ])
335338 assert not (tmp_path / "AGENTS.md" ).exists ()
336339
337340
341+ def test_bootstrap_plan_does_not_reinstall_marketplace_when_only_project_schemas_are_missing (tmp_path : Path , monkeypatch ) -> None :
342+ write (tmp_path / "AGENTS.md" , "# Rules\n " )
343+ write (tmp_path / "openspec" / "config.yaml" , "schema: aisee-app-spec-driven\n " )
344+ write (tmp_path / "openspec" / "changes" / ".gitkeep" , "" )
345+ write (tmp_path / "aisee" / "registry" / "sources.json" , '{"version":1,"sources":[]}\n ' )
346+ codex_home = tmp_path / "home" / ".codex"
347+ write (codex_home / "config.toml" , """[marketplaces.aisee-plugin]\n source = "AISEE-LAB/aisee-plugin"\n \n [plugins."aisee-plugin@aisee-plugin"]\n enabled = true\n """ )
348+ create_schema_pack (codex_home / ".tmp" / "marketplaces" / "aisee-plugin" / "plugins" / "aisee-plugin" )
349+ write (
350+ codex_home / ".tmp" / "marketplaces" / "aisee-plugin" / "plugins" / "aisee-plugin" / ".codex-plugin" / "plugin.json" ,
351+ '{"name":"aisee-plugin","version":"0.7.2"}\n ' ,
352+ )
353+ monkeypatch .setenv ("CODEX_HOME" , str (codex_home ))
354+
355+ data = run_json (tmp_path , "bootstrap" , "--plan" , "--json" )
356+
357+ assert not any (item ["path" ] == "aisee-plugin marketplace" for item in data ["actions" ])
358+ schema_action = next (item for item in data ["actions" ] if item ["path" ] == "openspec/schemas" )
359+ assert schema_action ["kind" ] == "create"
360+
361+
338362def test_doctor_and_bootstrap_report_legacy_aisee_layout (tmp_path : Path ) -> None :
339363 write (tmp_path / "AGENTS.md" , "# Rules\n " )
340364 write (tmp_path / "openspec" / "config.yaml" , "schema: aisee-app-spec-driven\n " )
@@ -501,4 +525,3 @@ def test_root_resolution_falls_back_to_git_root_without_aisee_markers(tmp_path:
501525 assert data ["project_rules" ]["primary" ] == "AGENTS.md"
502526 assert data ["status" ] == "blocked"
503527 assert any (item ["code" ] == "OPENSPEC_CONFIG_MISSING" for item in data ["issues" ])
504-
0 commit comments