pactkit-opencode 5.1.0__tar.gz → 5.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/PKG-INFO +2 -2
  2. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/pyproject.toml +2 -2
  3. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode/enforcement.py +3 -6
  4. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode.egg-info/PKG-INFO +2 -2
  5. pactkit_opencode-5.2.2/src/pactkit_opencode.egg-info/requires.txt +1 -0
  6. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_opencode_enforcement_channel.py +13 -15
  7. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_story_work_units.py +2 -1
  8. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_user_command_scope.py +17 -9
  9. pactkit_opencode-5.1.0/src/pactkit_opencode.egg-info/requires.txt +0 -1
  10. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/README.md +0 -0
  11. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/setup.cfg +0 -0
  12. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode/__init__.py +0 -0
  13. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode/declarations.py +0 -0
  14. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode/deployer.py +0 -0
  15. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode.egg-info/SOURCES.txt +0 -0
  16. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode.egg-info/dependency_links.txt +0 -0
  17. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode.egg-info/entry_points.txt +0 -0
  18. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/src/pactkit_opencode.egg-info/top_level.txt +0 -0
  19. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_a1_config_recovery.py +0 -0
  20. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_a2_mcp_retired.py +0 -0
  21. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_bug035_opencode_dual_layer.py +0 -0
  22. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_capability_contract.py +0 -0
  23. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_command_models_honesty.py +0 -0
  24. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_deploy_opencode_parity.py +0 -0
  25. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_gate_plugin_deploy.py +0 -0
  26. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_global_agents_ownership.py +0 -0
  27. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_host_body_snapshot.py +0 -0
  28. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_legacy_agents_migration.py +0 -0
  29. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_profile_contract.py +0 -0
  30. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_review_round13_order.py +0 -0
  31. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_review_round14.py +0 -0
  32. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_step6_self_sufficiency.py +0 -0
  33. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_step8_declaration_search_producer.py +0 -0
  34. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_story069_opencode_format.py +0 -0
  35. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_story070_opencode_compliance.py +0 -0
  36. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_story071_opencode_config_parity.py +0 -0
  37. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_story073_command_model_routing.py +0 -0
  38. {pactkit_opencode-5.1.0 → pactkit_opencode-5.2.2}/tests/test_wire_format_contract.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pactkit-opencode
3
- Version: 5.1.0
3
+ Version: 5.2.2
4
4
  Summary: PactKit adapter for OpenCode IDE
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.10
7
- Requires-Dist: pactkit<5.2.0,>=5.1.0
7
+ Requires-Dist: pactkit<5.3.0,>=5.2.2
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pactkit-opencode"
7
- version = "5.1.0"
7
+ version = "5.2.2"
8
8
  description = "PactKit adapter for OpenCode IDE"
9
9
  requires-python = ">=3.10"
10
10
  license = "MIT"
11
11
  dependencies = [
12
12
  # round4 #4: resolve_integration_config first ships in core 5.0.2.
13
- "pactkit>=5.1.0,<5.2.0",
13
+ "pactkit>=5.2.2,<5.3.0",
14
14
  ]
15
15
 
16
16
  [project.entry-points."pactkit.deployers"]
@@ -13,12 +13,9 @@ opencode and ``deploy("all")`` skips it, both correct — the plugin is this
13
13
  adapter's to deploy and always was.
14
14
 
15
15
  What registering buys is the *other* reader. ``gate_matrix.host_channel_registered``
16
- asks "did this host register?", and until this module existed the answer was
17
- no, so ``gate_coverage("opencode")`` reported ``spec_guard`` and
18
- ``tamper_guard`` as not enforced — while the plugin was on disk and blocking.
19
- Measured 2026-09-22: those two gates flipped from ``not_enforced`` to
20
- ``enforced`` with the registration and nothing else, and no deploy behaviour
21
- changed.
16
+ asks "did this host register?" so ``gate_coverage("opencode")`` can credit
17
+ the host's ``tamper_guard`` protection. Registration does not change deployment
18
+ or guarantee that the plugin reached disk.
22
19
 
23
20
  The looseness is the same one Codex already carries, accepted deliberately
24
21
  (owner ruling 2026-09-22): registration is evidence that the *adapter* is
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pactkit-opencode
3
- Version: 5.1.0
3
+ Version: 5.2.2
4
4
  Summary: PactKit adapter for OpenCode IDE
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.10
7
- Requires-Dist: pactkit<5.2.0,>=5.1.0
7
+ Requires-Dist: pactkit<5.3.0,>=5.2.2
@@ -0,0 +1 @@
1
+ pactkit<5.3.0,>=5.2.2
@@ -9,9 +9,8 @@ That makes this the one host whose channel is registered but not installable
9
9
  by Core, and the distinction is the whole point of the file:
10
10
 
11
11
  * registering is what makes `gate_matrix.host_channel_registered` answer yes,
12
- which is what makes `gate_coverage("opencode")` credit `spec_guard` and
13
- `tamper_guard` — measured 2026-09-22, those two flipped from `not_enforced`
14
- to `enforced` with this registration and nothing else;
12
+ which is what makes `gate_coverage("opencode")` credit the host's
13
+ `tamper_guard` protection;
15
14
  * it must NOT make Core write anything, because the plugin is already this
16
15
  adapter's to deploy and is global by design.
17
16
 
@@ -48,28 +47,27 @@ class TestRegistration:
48
47
  def test_the_registration_is_what_credits_the_host_gates(self):
49
48
  """The observable consequence, and the reason this module exists.
50
49
 
51
- Before it, `gate_coverage("opencode")` reported `spec_guard` and
52
- `tamper_guard` as not enforced. Both halves are asserted: the default
53
- (measured) path credits them, and taking the registration away puts
54
- them back — so the credit is coming from the registry, not from the
55
- channel list alone.
50
+ Registration credits the active tamper guard; removing registration
51
+ makes the gap visible. The retired Spec lock is neither enforced nor
52
+ a missing protection.
56
53
  """
57
54
  import pactkit_opencode # noqa: F401
58
55
 
59
56
  measured = gate_coverage_for("opencode")
60
57
  assert measured["channel_basis"] == "registered"
61
- for gate in ("spec_guard", "tamper_guard"):
62
- assert gate in measured["enforced"], (
63
- f"{gate} is not credited although the adapter registered — this "
64
- "is the display defect the registration fixes"
65
- )
58
+ assert "tamper_guard" in measured["enforced"]
59
+ assert "tamper_guard" not in measured["not_enforced"]
60
+ assert "spec_guard" not in measured["enforced"]
61
+ assert "spec_guard" not in measured["not_enforced"]
66
62
 
67
63
  saved = dict(commit_gate._ENFORCEMENT_CHANNELS)
68
64
  try:
69
65
  commit_gate._ENFORCEMENT_CHANNELS.pop("opencode")
70
66
  gap = gate_coverage_for("opencode")
71
- for gate in ("spec_guard", "tamper_guard"):
72
- assert gate in gap["not_enforced"], gate
67
+ assert "spec_guard" not in gap["enforced"]
68
+ assert "spec_guard" not in gap["not_enforced"]
69
+ assert "tamper_guard" in gap["not_enforced"]
70
+ assert "tamper_guard" not in gap["enforced"]
73
71
  assert "not registered" in gap["not_enforced"]["tamper_guard"], (
74
72
  "the reason must name the missing registration, not blame the "
75
73
  "host — opencode does offer a pre-tool surface"
@@ -19,7 +19,8 @@ def test_opencode_uses_native_current_session_contract_without_portable_methods(
19
19
  manifest = json.loads((tmp_path / ".pactkit-deployed.json").read_text())
20
20
  assert manifest["host_capabilities"]["execution_mode"] == "portable"
21
21
  assert manifest["workflow_continuation"]["stop_hook_required"] is False
22
- assert len(manifest["skills"]) == 13
22
+ assert len(manifest["skills"]) == 11
23
+ assert {"pactkit-draw", "pactkit-review"}.isdisjoint(manifest["skills"])
23
24
 
24
25
 
25
26
  def test_opencode_upgrade_removes_only_unmodified_portable_methods(tmp_path):
@@ -39,16 +39,24 @@ def test_user_command_not_rewritten(tmp_path):
39
39
  assert user_cmd.read_text(encoding="utf-8") == original, "用户自建命令被转换改写"
40
40
 
41
41
 
42
- def test_pactkit_commands_still_transformed(tmp_path):
43
- """AC2:PactKit 管理的命令文件仍做 CLI→脚本转换(既有功能不回归)。"""
42
+ def test_pactkit_commands_still_transformed(tmp_path, monkeypatch):
43
+ """A managed command with legacy CLI text still gets translated on deploy."""
44
+ from pactkit_opencode.deployer import OpenCodeDeployer
45
+
46
+ from pactkit.prompts import commands
47
+
44
48
  home = tmp_path / "home"
45
49
  target = tmp_path / "deploy"
46
50
  home.mkdir()
47
51
  target.mkdir()
48
- assert _deploy_opencode(target, home).returncode == 0
49
- cmd_dir = target / "commands"
50
- pactkit_cmds = [p for p in cmd_dir.glob("*.md") if p.name != "my-team.md"]
51
- assert pactkit_cmds, "无 PactKit 命令部署"
52
- assert any("scripts/" in p.read_text(encoding="utf-8") for p in pactkit_cmds), (
53
- "PactKit 命令未被转换(CLI→脚本回归)"
54
- )
52
+ monkeypatch.setenv("HOME", str(home))
53
+ monkeypatch.setenv("USERPROFILE", str(home))
54
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(home / ".config"))
55
+ original = "---\ndescription: synthetic legacy managed command\n---\nRun `pactkit visualize` for graphs.\n"
56
+ monkeypatch.setattr(commands, "get_deployable_commands", lambda: {"project-debug.md": original})
57
+
58
+ OpenCodeDeployer().deploy(config={}, target=target)
59
+
60
+ rendered = (target / "commands/project-debug.md").read_text(encoding="utf-8")
61
+ assert "`pactkit visualize`" not in rendered
62
+ assert "python3 ~/.config/opencode/skills/pactkit-visualize/scripts/visualize.py" in rendered
@@ -1 +0,0 @@
1
- pactkit<5.2.0,>=5.1.0