pactkit-opencode 3.0.3__py3-none-any.whl → 3.0.4__py3-none-any.whl
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.
- pactkit_opencode/__init__.py +12 -0
- pactkit_opencode/enforcement.py +59 -0
- {pactkit_opencode-3.0.3.dist-info → pactkit_opencode-3.0.4.dist-info}/METADATA +1 -1
- pactkit_opencode-3.0.4.dist-info/RECORD +8 -0
- pactkit_opencode-3.0.3.dist-info/RECORD +0 -7
- {pactkit_opencode-3.0.3.dist-info → pactkit_opencode-3.0.4.dist-info}/WHEEL +0 -0
- {pactkit_opencode-3.0.3.dist-info → pactkit_opencode-3.0.4.dist-info}/entry_points.txt +0 -0
- {pactkit_opencode-3.0.3.dist-info → pactkit_opencode-3.0.4.dist-info}/top_level.txt +0 -0
pactkit_opencode/__init__.py
CHANGED
|
@@ -5,4 +5,16 @@ Auto-registers OpenCodeDeployer via entry_points when imported.
|
|
|
5
5
|
|
|
6
6
|
from pactkit_opencode.deployer import OpenCodeDeployer
|
|
7
7
|
|
|
8
|
+
# The second import is for its side effect: it registers OpenCode's
|
|
9
|
+
# enforcement channel (SPEC-4.0-06 R3), and registration IS Core's
|
|
10
|
+
# availability signal — an adapter that is not installed cannot register, so
|
|
11
|
+
# `format == "all"` never installs a channel for a host that never deployed.
|
|
12
|
+
#
|
|
13
|
+
# This adapter's channel is the one exception to that sentence: Core installs
|
|
14
|
+
# nothing for opencode, because `_deploy_gate_plugin()` installs the plugin
|
|
15
|
+
# itself, globally. Registering still matters — without it Core answers "no
|
|
16
|
+
# channel" for a host that has one, and `gate_coverage` reports the pre-tool
|
|
17
|
+
# gates as unenforced while the plugin is on disk and blocking.
|
|
18
|
+
from pactkit_opencode.enforcement import opencode_channel # noqa: F401
|
|
19
|
+
|
|
8
20
|
__all__ = ["OpenCodeDeployer"]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""OpenCode's enforcement channel, stated by its owner (SPEC-4.0-06 R3).
|
|
2
|
+
|
|
3
|
+
OpenCode's veto surface is a plugin hook (``tool.execute.before``, throwing
|
|
4
|
+
denies the call), not a PreToolUse hook. Unlike Codex's — and unlike the
|
|
5
|
+
classic host's — **Core does not install it**: ``_deploy_gate_plugin()``
|
|
6
|
+
writes it, globally, from this adapter. There is no project-relative config
|
|
7
|
+
file for Core to merge into, and the plugin lives outside the deploy root, so
|
|
8
|
+
Core can neither install nor verify it.
|
|
9
|
+
|
|
10
|
+
So the provider returns None. That is the registry's word for "this host has
|
|
11
|
+
no channel for Core to install": ``_selected_channels`` yields nothing for
|
|
12
|
+
opencode and ``deploy("all")`` skips it, both correct — the plugin is this
|
|
13
|
+
adapter's to deploy and always was.
|
|
14
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
The looseness is the same one Codex already carries, accepted deliberately
|
|
24
|
+
(owner ruling 2026-09-22): registration is evidence that the *adapter* is
|
|
25
|
+
installed, not that the plugin reached disk. A project that installed this
|
|
26
|
+
adapter and never ran ``pactkit init --format opencode`` is reported as
|
|
27
|
+
covered. Making that claim verifiable needs a channel shape for
|
|
28
|
+
adapter-installed plugins; it is not this module's job to fake it with a
|
|
29
|
+
``HookChannel`` whose ``relative_path`` would make Core write a
|
|
30
|
+
project-relative file for a channel that is global by design.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
from __future__ import annotations
|
|
34
|
+
|
|
35
|
+
from pathlib import Path
|
|
36
|
+
|
|
37
|
+
from pactkit.commit_gate import HookChannel, register_enforcement_channel
|
|
38
|
+
|
|
39
|
+
#: MUST equal the string `gate_matrix.channels_for("opencode")` advertises, or
|
|
40
|
+
#: the coverage notice names a channel that is not the one installed — the
|
|
41
|
+
#: divergence SPEC-4.0-06 R4 records as `HookChannel`'s standing tension.
|
|
42
|
+
#: There is no `HookChannel` here to carry it (Core installs nothing), so the
|
|
43
|
+
#: agreement is asserted by `test_opencode_enforcement_channel.py` instead of
|
|
44
|
+
#: being structural.
|
|
45
|
+
ADVERTISED_IDENTITY = "tool.execute.before plugin (veto by throwing)"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def opencode_channel(root: Path) -> HookChannel | None:
|
|
49
|
+
"""None: Core installs nothing for this host, and that is the whole point.
|
|
50
|
+
|
|
51
|
+
Returning a `HookChannel` would send Core's installer after a
|
|
52
|
+
project-relative file for a channel that is global by design. A None
|
|
53
|
+
provider is a registered host whose channel Core does not own — distinct
|
|
54
|
+
from a host that never registered at all.
|
|
55
|
+
"""
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
register_enforcement_channel("opencode", opencode_channel)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pactkit_opencode/__init__.py,sha256=eUyhW1gUrXXAgcGgPjNm-eddx7rji35WuzncsAqiW5U,934
|
|
2
|
+
pactkit_opencode/deployer.py,sha256=GsVBXEWOh1n3q1AinIhADc2QfFP8fXZWH6Am_dxiWq8,21313
|
|
3
|
+
pactkit_opencode/enforcement.py,sha256=aOaNYU30rF67PfJNSLXubAwJJfw88UbkE1JDDb7XGec,2897
|
|
4
|
+
pactkit_opencode-3.0.4.dist-info/METADATA,sha256=nZ5h5bGWvauv5XQsRPGyaHSXZuL5fvu3FWskoUziJk8,187
|
|
5
|
+
pactkit_opencode-3.0.4.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
6
|
+
pactkit_opencode-3.0.4.dist-info/entry_points.txt,sha256=By7lE89sPCfucVIOpDRWK2biKi_ZarkCltUidcCAo6Y,65
|
|
7
|
+
pactkit_opencode-3.0.4.dist-info/top_level.txt,sha256=kmFfcuDMNxmyylzdSsieob_DGbBJ43YN1_DOZMIrudA,17
|
|
8
|
+
pactkit_opencode-3.0.4.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pactkit_opencode/__init__.py,sha256=ZK-SR04GQwpZpH9SdTlNJWQXDJZgmUKLH70N2znpbNU,194
|
|
2
|
-
pactkit_opencode/deployer.py,sha256=GsVBXEWOh1n3q1AinIhADc2QfFP8fXZWH6Am_dxiWq8,21313
|
|
3
|
-
pactkit_opencode-3.0.3.dist-info/METADATA,sha256=QjqCGI4XImZ3_vPecGmiTGAn8K3B5Lk4B0I_HSrEk9E,187
|
|
4
|
-
pactkit_opencode-3.0.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
5
|
-
pactkit_opencode-3.0.3.dist-info/entry_points.txt,sha256=By7lE89sPCfucVIOpDRWK2biKi_ZarkCltUidcCAo6Y,65
|
|
6
|
-
pactkit_opencode-3.0.3.dist-info/top_level.txt,sha256=kmFfcuDMNxmyylzdSsieob_DGbBJ43YN1_DOZMIrudA,17
|
|
7
|
-
pactkit_opencode-3.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|