pactkit-codex 4.4.2__tar.gz → 5.0.3__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.
- {pactkit_codex-4.4.2/src/pactkit_codex.egg-info → pactkit_codex-5.0.3}/PKG-INFO +2 -2
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/pyproject.toml +6 -6
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex/deployer.py +197 -73
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3/src/pactkit_codex.egg-info}/PKG-INFO +2 -2
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex.egg-info/requires.txt +1 -1
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/LICENSE +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/README.md +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/setup.cfg +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex/__init__.py +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex/declarations.py +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex/enforcement.py +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex.egg-info/SOURCES.txt +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex.egg-info/dependency_links.txt +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex.egg-info/entry_points.txt +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/src/pactkit_codex.egg-info/top_level.txt +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/tests/test_capability_contract.py +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/tests/test_host_body_snapshot.py +0 -0
- {pactkit_codex-4.4.2 → pactkit_codex-5.0.3}/tests/test_profile_contract.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pactkit-codex
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.3
|
|
4
4
|
Summary: PactKit adapter for OpenAI Codex CLI
|
|
5
5
|
Author: Slim
|
|
6
6
|
License: MIT
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Quality Assurance
|
|
|
21
21
|
Requires-Python: >=3.10
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
|
-
Requires-Dist: pactkit<
|
|
24
|
+
Requires-Dist: pactkit<5.1.0,>=5.0.3
|
|
25
25
|
Requires-Dist: tomli>=1.1.0; python_version < "3.11"
|
|
26
26
|
Dynamic: license-file
|
|
27
27
|
|
|
@@ -4,17 +4,17 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pactkit-codex"
|
|
7
|
-
version = "
|
|
7
|
+
version = "5.0.3"
|
|
8
8
|
description = "PactKit adapter for OpenAI Codex CLI"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
11
11
|
requires-python = ">=3.10"
|
|
12
12
|
dependencies = [
|
|
13
|
-
# 2026-
|
|
14
|
-
# `pactkit.
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
"pactkit>=
|
|
13
|
+
# 2026-11-26 (review round4 #4): project integration imports
|
|
14
|
+
# `pactkit.config.resolve_integration_config`, which first ships in core
|
|
15
|
+
# 5.0.2. The previous floor (>=5.0.0) allowed released core 5.0.0/5.0.1,
|
|
16
|
+
# whose deploy raises ImportError. The floor matches the API's first version.
|
|
17
|
+
"pactkit>=5.0.3,<5.1.0",
|
|
18
18
|
"tomli>=1.1.0; python_version < '3.11'",
|
|
19
19
|
]
|
|
20
20
|
|
|
@@ -158,96 +158,144 @@ class CodexDeployer(DeployerBase):
|
|
|
158
158
|
"trust_review_command": None,
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
def deploy(self, config=None, target=None, project_root=None, no_redetect=False
|
|
161
|
+
def deploy(self, config=None, target=None, project_root=None, no_redetect=False,
|
|
162
|
+
global_only=False, project_only=False):
|
|
162
163
|
"""Deploy PactKit configuration for Codex CLI.
|
|
163
164
|
|
|
164
165
|
``project_root`` is **not** the deploy root (``~/.codex`` is): it names
|
|
165
166
|
the project whose config and overlay are read, which used to resolve
|
|
166
167
|
from the caller's cwd. ``no_redetect`` is accepted because Core passes
|
|
167
168
|
it alongside; it is a no-op here — the stack probe only reads.
|
|
169
|
+
|
|
170
|
+
``global_only`` (STORY-slim-20261125f4db76f08fc5): a global Host
|
|
171
|
+
deployment must not read or write any project file. ``project_only``
|
|
172
|
+
(R3, ``pactkit integrate``) is the inverse: write only project files,
|
|
173
|
+
never re-deploy the machine-global Codex components other projects load.
|
|
168
174
|
"""
|
|
175
|
+
if global_only and project_only:
|
|
176
|
+
raise ValueError("global_only and project_only are mutually exclusive")
|
|
169
177
|
codex_root = Path(target) if target else Path.home() / ".codex"
|
|
170
178
|
project_root = Path(project_root) if project_root is not None else Path.cwd()
|
|
171
179
|
|
|
172
180
|
print("🚀 PactKit Codex CLI Deployment")
|
|
173
181
|
|
|
182
|
+
# round18 #1: terminate before ANY global write (command Skills, references,
|
|
183
|
+
# post-processing) if a component dir or nested entry escapes into a project.
|
|
184
|
+
if not project_only:
|
|
185
|
+
from pactkit.deploy_shared import assert_global_component_boundary
|
|
186
|
+
|
|
187
|
+
assert_global_component_boundary(codex_root)
|
|
188
|
+
|
|
174
189
|
from pactkit.config import find_pactkit_yaml
|
|
175
190
|
|
|
176
|
-
|
|
191
|
+
if global_only:
|
|
192
|
+
project_yaml = None
|
|
193
|
+
elif project_only:
|
|
194
|
+
# Review A#1: integration is scoped to the target project — never walk
|
|
195
|
+
# up to an outer project's YAML. Imported here (not at module top) so a
|
|
196
|
+
# global-only deploy never needs the integration API (round4 #4).
|
|
197
|
+
from pactkit.config import resolve_integration_config
|
|
198
|
+
|
|
199
|
+
_scoped_cfg, project_yaml = resolve_integration_config(project_root, format="codex")
|
|
200
|
+
if config is None:
|
|
201
|
+
config = _scoped_cfg
|
|
202
|
+
else:
|
|
203
|
+
project_yaml = find_pactkit_yaml(project_root)
|
|
177
204
|
if config is not None:
|
|
178
205
|
cfg = config
|
|
179
|
-
elif project_yaml is not None:
|
|
206
|
+
elif project_yaml is not None and project_yaml.is_file():
|
|
180
207
|
auto_added = auto_merge_config_file(project_yaml)
|
|
181
208
|
for item in auto_added:
|
|
182
209
|
print(f" -> Auto-added: {item}")
|
|
183
210
|
cfg = load_config(project_yaml)
|
|
184
211
|
else:
|
|
185
212
|
cfg = {}
|
|
186
|
-
|
|
213
|
+
if not global_only:
|
|
214
|
+
cfg = activate_pactkit_maintainer_overlay(cfg, project_root)
|
|
187
215
|
|
|
188
216
|
enabled_skills = cfg.get("skills", sorted(VALID_SKILLS))
|
|
189
217
|
enabled_commands = cfg.get("commands")
|
|
190
218
|
|
|
191
|
-
|
|
192
|
-
#
|
|
193
|
-
#
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
219
|
+
n_skills = n_commands = 0
|
|
220
|
+
# A global-only deployment never touches the project, so the rollback
|
|
221
|
+
# scope must not include project paths either.
|
|
222
|
+
transaction_root = project_root if (target is None and not global_only) else None
|
|
223
|
+
with rollback_paths(self._transaction_paths(codex_root, transaction_root, project_only=project_only)):
|
|
224
|
+
# Project-only integration writes NO machine-global Codex components
|
|
225
|
+
# (R3): integrating a project must not re-select what other projects
|
|
226
|
+
# load. Only the default mixed path deploys global components.
|
|
227
|
+
if not project_only:
|
|
228
|
+
# Validate the complete generated artifact set before touching the
|
|
229
|
+
# current installation. A rejected rule, command, skill, or AGENTS
|
|
230
|
+
# document must preserve the prior usable Codex deployment.
|
|
231
|
+
self._preflight_deploy_artifacts(
|
|
232
|
+
codex_root, enabled_skills, enabled_commands, cfg.get("rules", sorted(DEFAULT_RULE_IDS)),
|
|
233
|
+
config=cfg,
|
|
234
|
+
)
|
|
235
|
+
self._cleanup_stale_command_references(
|
|
236
|
+
codex_root, enabled_commands,
|
|
237
|
+
cfg.get("rules", sorted(DEFAULT_RULE_IDS)),
|
|
238
|
+
)
|
|
239
|
+
skills_dir = codex_root / "skills"
|
|
240
|
+
skills_dir.mkdir(parents=True, exist_ok=True)
|
|
241
|
+
_cleanup_legacy_portable_methods(skills_dir, self.profile)
|
|
242
|
+
n_skills = self.deploy_codex_skills(skills_dir, enabled_skills, self.profile)
|
|
243
|
+
n_commands = self.deploy_codex_command_skills(
|
|
244
|
+
skills_dir, self.profile, enabled_commands=enabled_commands,
|
|
245
|
+
maintainer_overlay=cfg.get("_pactkit_self_development", False),
|
|
246
|
+
enabled_rules=cfg.get("rules", sorted(DEFAULT_RULE_IDS)),
|
|
247
|
+
config=cfg,
|
|
248
|
+
)
|
|
249
|
+
_cleanup_legacy(skills_dir)
|
|
250
|
+
# Legacy prompt/playbook directories have no ownership manifest.
|
|
251
|
+
# Their names alone are not deletion authority, so leave them for
|
|
252
|
+
# explicit user review instead of recursively deleting user content.
|
|
253
|
+
|
|
254
|
+
rules_dir = codex_root / "rules"
|
|
255
|
+
rules_dir.mkdir(parents=True, exist_ok=True)
|
|
256
|
+
self.deploy_codex_rules(
|
|
257
|
+
rules_dir, self.profile, enabled_commands=enabled_commands,
|
|
258
|
+
enabled_rules=cfg.get("rules", sorted(DEFAULT_RULE_IDS)),
|
|
259
|
+
)
|
|
260
|
+
self.deploy_codex_agents_md(
|
|
261
|
+
codex_root, self.profile, enabled_commands=enabled_commands,
|
|
262
|
+
enabled_rules=cfg.get("rules", sorted(DEFAULT_RULE_IDS)),
|
|
263
|
+
)
|
|
264
|
+
self.generate_codex_config_toml(codex_root)
|
|
265
|
+
self.remove_legacy_stop_hook(codex_root)
|
|
232
266
|
|
|
233
267
|
# Gate on `target is None`, not on `project_root is not None`: the
|
|
234
268
|
# two coincided only while `project_root` was *derived* from this
|
|
235
269
|
# condition, making it a flag as much as an identity. Separate them
|
|
236
270
|
# and `-C` reaches the identity while an explicit `-t` install still
|
|
237
271
|
# touches nothing outside its target (measured 2026-10-02).
|
|
238
|
-
if target is None:
|
|
272
|
+
if target is None and not global_only:
|
|
239
273
|
self.generate_codex_project_files(project_root)
|
|
240
274
|
|
|
241
|
-
|
|
242
|
-
|
|
275
|
+
if not project_only:
|
|
276
|
+
self.write_version_marker(codex_root)
|
|
277
|
+
self._write_deployment_manifest(codex_root, cfg)
|
|
243
278
|
|
|
244
279
|
print(
|
|
245
280
|
f"\n✅ Codex CLI: {n_skills} Skills, {n_commands} Commands → {codex_root}"
|
|
246
281
|
)
|
|
247
282
|
|
|
248
283
|
@staticmethod
|
|
249
|
-
def _transaction_paths(codex_root, project_root=None):
|
|
250
|
-
"""Return the exact Codex paths a deployment may mutate.
|
|
284
|
+
def _transaction_paths(codex_root, project_root=None, project_only=False):
|
|
285
|
+
"""Return the exact Codex paths a deployment may mutate.
|
|
286
|
+
|
|
287
|
+
Review #2: a project-only integration must NOT include machine-global
|
|
288
|
+
Codex paths in its rollback scope — a failed project write would otherwise
|
|
289
|
+
delete/restore ~/.codex files shared by every other project.
|
|
290
|
+
"""
|
|
291
|
+
if project_only:
|
|
292
|
+
if project_root is None:
|
|
293
|
+
return ()
|
|
294
|
+
return (
|
|
295
|
+
project_root / "AGENTS.md",
|
|
296
|
+
project_root / ".codex" / "AGENTS.local.md",
|
|
297
|
+
project_root / ".codex" / "pactkit.yaml",
|
|
298
|
+
)
|
|
251
299
|
from pactkit.portable_methods import get_portable_methods
|
|
252
300
|
from pactkit.prompts.skills import get_skill_manifest
|
|
253
301
|
|
|
@@ -281,10 +329,15 @@ class CodexDeployer(DeployerBase):
|
|
|
281
329
|
/ "phases" / f"{phase}.md"
|
|
282
330
|
for phase in ("plan", "act", "check", "done")
|
|
283
331
|
)
|
|
332
|
+
# round26 #4: the shared preserve writer now generates .pactkit-new
|
|
333
|
+
# candidates for plain skills, command SKILL.md and scripts too — not
|
|
334
|
+
# only references/. Snapshot every candidate path so a failed deploy
|
|
335
|
+
# removes newly-created candidates and restores pre-existing ones;
|
|
336
|
+
# residue would otherwise read as a conflict marker and skew later
|
|
337
|
+
# ownership reads (load_previous_hashes excludes candidate-marked paths).
|
|
284
338
|
skill_files.extend(
|
|
285
339
|
path.with_suffix(path.suffix + ".pactkit-new")
|
|
286
340
|
for path in tuple(skill_files)
|
|
287
|
-
if "references" in path.parts
|
|
288
341
|
)
|
|
289
342
|
skill_files.extend(
|
|
290
343
|
codex_root / "skills" / "_rules" / "guides" / filename
|
|
@@ -766,16 +819,12 @@ class CodexDeployer(DeployerBase):
|
|
|
766
819
|
if (normalized := normalize_rule_id(rule_id)) is not None
|
|
767
820
|
}
|
|
768
821
|
codex_root = skills_dir.parent
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
if isinstance(files, dict):
|
|
776
|
-
previous_hashes = files
|
|
777
|
-
except (OSError, ValueError, TypeError):
|
|
778
|
-
pass
|
|
822
|
+
# round25 #2 / round24 #1: conflict-aware ownership read (excludes records
|
|
823
|
+
# beside a .pactkit-new candidate) instead of a raw json read, so a stale
|
|
824
|
+
# old-manifest claim cannot authorize overwriting a preserved original.
|
|
825
|
+
from pactkit.deploy_manifest import load_previous_hashes, preserve_or_write
|
|
826
|
+
|
|
827
|
+
previous_hashes = load_previous_hashes(codex_root)
|
|
779
828
|
# STORY-slim-20260903a24e1ece0d7f: merged ownership view — the deploy
|
|
780
829
|
# check previously read only .pactkit-deployed.json (which never carries
|
|
781
830
|
# reference paths), so every content change produced a .pactkit-new
|
|
@@ -936,7 +985,13 @@ class CodexDeployer(DeployerBase):
|
|
|
936
985
|
for cmd_name, skill_content in rendered.items():
|
|
937
986
|
skill_path = skills_dir / cmd_name / "SKILL.md"
|
|
938
987
|
snapshots[skill_path] = skill_path.read_bytes() if skill_path.is_file() else None
|
|
939
|
-
|
|
988
|
+
# round25 #2: ownership judgment before overwrite (shared writer).
|
|
989
|
+
# A user-edited command SKILL.md is preserved + candidate, not
|
|
990
|
+
# clobbered; the preview classifies this path as preserve-writer.
|
|
991
|
+
skill_written = preserve_or_write(
|
|
992
|
+
codex_root, skill_path, skill_content,
|
|
993
|
+
ownership_proofs, f"command_skill:{cmd_name}",
|
|
994
|
+
)
|
|
940
995
|
for relative, reference_content in references_by_command[cmd_name].items():
|
|
941
996
|
reference = skill_path.parent / "references" / relative
|
|
942
997
|
snapshots[reference] = (
|
|
@@ -988,13 +1043,28 @@ class CodexDeployer(DeployerBase):
|
|
|
988
1043
|
_enforce_deploy_integrity(
|
|
989
1044
|
capsule, profile, f"sprint_phase:{phase}",
|
|
990
1045
|
)
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1046
|
+
# round26 #2: phase references go through the same shared
|
|
1047
|
+
# ownership writer as the main SKILL.md. A user-edited
|
|
1048
|
+
# phase file is preserved + candidate, not clobbered in the
|
|
1049
|
+
# same update that preserves the main skill. Only a
|
|
1050
|
+
# confirmed write is recorded in the reference ledger.
|
|
1051
|
+
phase_written = preserve_or_write(
|
|
1052
|
+
codex_root, reference, capsule,
|
|
1053
|
+
ownership_proofs, f"sprint_phase:{phase}",
|
|
996
1054
|
)
|
|
997
|
-
|
|
1055
|
+
if phase_written:
|
|
1056
|
+
record_deployed_reference(
|
|
1057
|
+
manifest_references,
|
|
1058
|
+
reference.relative_to(codex_root).as_posix(),
|
|
1059
|
+
reference,
|
|
1060
|
+
)
|
|
1061
|
+
# round25 #2: only a confirmed write may claim ownership. A
|
|
1062
|
+
# preserved user original must not be recorded in the command
|
|
1063
|
+
# ledger — that would authorize the next deploy to overwrite it.
|
|
1064
|
+
if skill_written:
|
|
1065
|
+
record_deployed_command(manifest, cmd_name, skill_path)
|
|
1066
|
+
else:
|
|
1067
|
+
manifest.pop(cmd_name, None)
|
|
998
1068
|
deployed += 1
|
|
999
1069
|
write_command_manifest(skills_dir, manifest, references=manifest_references)
|
|
1000
1070
|
except Exception:
|
|
@@ -1057,6 +1127,17 @@ class CodexDeployer(DeployerBase):
|
|
|
1057
1127
|
if project_root.resolve() == Path.home().resolve():
|
|
1058
1128
|
return
|
|
1059
1129
|
|
|
1130
|
+
# Review round4 #1: refuse an escaping .codex/ symlink before the first
|
|
1131
|
+
# write — AGENTS.md, the local copy, backups and the config YAML must stay
|
|
1132
|
+
# inside the project. Same predicate Core uses for the hook channel.
|
|
1133
|
+
from pactkit.deploy_shared import validate_project_write_boundary
|
|
1134
|
+
|
|
1135
|
+
validate_project_write_boundary(
|
|
1136
|
+
project_root,
|
|
1137
|
+
[".codex", "AGENTS.md", ".codex/AGENTS.local.md", ".codex/pactkit.yaml",
|
|
1138
|
+
".codex/.pactkit-backups"],
|
|
1139
|
+
)
|
|
1140
|
+
|
|
1060
1141
|
stack = _detect_stack(project_root)
|
|
1061
1142
|
project_name = project_root.name
|
|
1062
1143
|
codex_dir = project_root / ".codex"
|
|
@@ -1087,6 +1168,32 @@ class CodexDeployer(DeployerBase):
|
|
|
1087
1168
|
# a value Core's own validator rejects — see the classification row.
|
|
1088
1169
|
generate_config_if_missing(format="codex", project_root=project_root)
|
|
1089
1170
|
|
|
1171
|
+
def preserve_writer_paths(self, deploy_root, config=None):
|
|
1172
|
+
"""round27 #2: the sprint phase capsules go through the shared
|
|
1173
|
+
preserve_or_write writer (deploy_codex_command_skills), so a directory
|
|
1174
|
+
occupying one is preserved and the deploy continues — not a failure.
|
|
1175
|
+
Core's component enumeration does not know these Host-specific reference
|
|
1176
|
+
paths; the preview must take them from this actual write plan."""
|
|
1177
|
+
paths = super().preserve_writer_paths(deploy_root, config)
|
|
1178
|
+
for phase in ("plan", "act", "check", "done"):
|
|
1179
|
+
paths.add(f"skills/project-sprint/references/phases/{phase}.md")
|
|
1180
|
+
return paths
|
|
1181
|
+
|
|
1182
|
+
def ownership_hashes(self, deploy_root):
|
|
1183
|
+
"""round28 #2: the same merged ownership view execution uses
|
|
1184
|
+
(deploy_codex_command_skills): the conflict-aware deployment manifest
|
|
1185
|
+
plus the command-manifest reference table. The preview must judge a
|
|
1186
|
+
phase file's overwrite by this merged proof, not the global manifest
|
|
1187
|
+
alone."""
|
|
1188
|
+
from pactkit.deploy_manifest import load_previous_hashes
|
|
1189
|
+
from pactkit.generators.command_ownership import read_command_references
|
|
1190
|
+
|
|
1191
|
+
deploy_root = Path(deploy_root)
|
|
1192
|
+
return {
|
|
1193
|
+
**load_previous_hashes(deploy_root),
|
|
1194
|
+
**read_command_references(deploy_root / "skills"),
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1090
1197
|
@staticmethod
|
|
1091
1198
|
def deploy_codex_skills(skills_dir, enabled_skills, profile):
|
|
1092
1199
|
"""Deploy skills with Codex-specific path replacement in scripts."""
|
|
@@ -1095,30 +1202,47 @@ class CodexDeployer(DeployerBase):
|
|
|
1095
1202
|
# STORY-slim-139 R4: consume the core SKILL_MANIFEST — no local
|
|
1096
1203
|
# hardcoded skill list (the old 10-item snapshot silently dropped
|
|
1097
1204
|
# garden/audit/report when core added them).
|
|
1205
|
+
from pactkit.deploy_manifest import load_previous_hashes, preserve_or_write
|
|
1206
|
+
from pactkit.generators.deployer import _mkdir_within
|
|
1098
1207
|
from pactkit.prompts.skills import get_skill_manifest
|
|
1099
1208
|
|
|
1100
1209
|
enabled_set = set(enabled_skills)
|
|
1101
1210
|
deployed = 0
|
|
1211
|
+
deploy_root = skills_dir.parent
|
|
1212
|
+
# round25 #2: ownership judgment BEFORE overwrite — the same shared
|
|
1213
|
+
# writer Core/OpenCode use. A user-edited SKILL.md/script is preserved
|
|
1214
|
+
# with a .pactkit-new candidate instead of clobbered by atomic_write,
|
|
1215
|
+
# which also makes the preview's preserve-writer classification truthful.
|
|
1216
|
+
previous_hashes = load_previous_hashes(deploy_root)
|
|
1102
1217
|
|
|
1103
1218
|
for sd in get_skill_manifest():
|
|
1104
1219
|
if sd["name"] not in enabled_set:
|
|
1105
1220
|
continue
|
|
1106
1221
|
skill_dir = skills_dir / sd["name"]
|
|
1107
|
-
|
|
1222
|
+
# round17 #1: terminate on an escaping nested component dir, before
|
|
1223
|
+
# any create/write (a skills/<name>/ symlink into a project).
|
|
1224
|
+
_mkdir_within(deploy_root, skill_dir)
|
|
1108
1225
|
|
|
1109
1226
|
skill_md = render_skill_md(sd, profile, _prefix)
|
|
1110
1227
|
skill_md = _replace_cli_with_scripts(skill_md)
|
|
1111
1228
|
skill_md = CodexDeployer.strip_model_references(skill_md)
|
|
1112
1229
|
_enforce_deploy_integrity(skill_md, profile, f"skill:{sd['name']}")
|
|
1113
|
-
|
|
1230
|
+
written = preserve_or_write(
|
|
1231
|
+
deploy_root, skill_dir / "SKILL.md", skill_md,
|
|
1232
|
+
previous_hashes, f"skill:{sd['name']}",
|
|
1233
|
+
)
|
|
1114
1234
|
if sd["script_name"]:
|
|
1115
1235
|
scripts_dir = skill_dir / "scripts"
|
|
1116
|
-
scripts_dir
|
|
1236
|
+
_mkdir_within(deploy_root, scripts_dir)
|
|
1117
1237
|
script_content = sd["script_source"]
|
|
1118
1238
|
script_content = script_content.replace("~/.claude/", f"{profile.global_config_dir}/")
|
|
1119
1239
|
script_content = script_content.replace("~/.config/opencode/", f"{profile.global_config_dir}/")
|
|
1120
|
-
|
|
1121
|
-
|
|
1240
|
+
preserve_or_write(
|
|
1241
|
+
deploy_root, scripts_dir / sd["script_name"], script_content,
|
|
1242
|
+
previous_hashes, f"skill:{sd['name']} script",
|
|
1243
|
+
)
|
|
1244
|
+
if written:
|
|
1245
|
+
deployed += 1
|
|
1122
1246
|
|
|
1123
1247
|
return deployed
|
|
1124
1248
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pactkit-codex
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.3
|
|
4
4
|
Summary: PactKit adapter for OpenAI Codex CLI
|
|
5
5
|
Author: Slim
|
|
6
6
|
License: MIT
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Quality Assurance
|
|
|
21
21
|
Requires-Python: >=3.10
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
|
-
Requires-Dist: pactkit<
|
|
24
|
+
Requires-Dist: pactkit<5.1.0,>=5.0.3
|
|
25
25
|
Requires-Dist: tomli>=1.1.0; python_version < "3.11"
|
|
26
26
|
Dynamic: license-file
|
|
27
27
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|