GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pstack-codex/scripts/validate.py at main · ScriptedAlchemy/pstack-codex

Expand file tree

/

validate.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
68 lines (63 loc) · 3.65 KB
/

validate.py

Copy path

File metadata and controls

executable file
·
68 lines (63 loc) · 3.65 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python3
"""Portable package preflight; not a substitute for host integration testing."""
import json
import pathlib
import re
import sys
import tomllib
ROOT = pathlib.Path(__file__).resolve().parent.parent
PLUGIN = ROOT / "plugins/pstack"
errors = []
def check(ok, message):
if not ok:
errors.append(message)
manifest = json.loads((PLUGIN / ".codex-plugin/plugin.json").read_text())
marketplace = json.loads((ROOT / ".agents/plugins/marketplace.json").read_text())
check(manifest.get("name") == "pstack", "Plugin name must be pstack")
check(re.fullmatch(r"\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?", manifest.get("version", "")), "Invalid version")
check("hooks" not in manifest, "hooks is not a supported manifest field; use default discovery")
check(marketplace.get("name") == "pstack-codex", "Wrong marketplace name")
entries = marketplace.get("plugins", [])
check(len(entries) == 1, "Expected one plugin in marketplace")
check(entries and entries[0].get("source") == {"source": "local", "path": "./plugins/pstack"}, "Wrong marketplace source")
for entry in entries:
check(entry.get("name") == "pstack", "Wrong marketplace plugin name")
check(entry.get("policy", {}).get("installation") == "AVAILABLE", "Wrong installation policy")
check(entry.get("policy", {}).get("authentication") == "ON_INSTALL", "Wrong authentication policy")
check(bool(entry.get("category")), "Missing category")
for key in ("skills", "mcpServers", "apps"):
path = manifest.get(key)
if isinstance(path, str):
resolved = (PLUGIN / path).resolve()
check(resolved.is_relative_to(PLUGIN.resolve()) and resolved.exists(), f"Missing/escaping manifest path: {key}")
for key in ("logo", "logoDark", "composerIcon"):
path = manifest.get("interface", {}).get(key)
if path:
check((PLUGIN / path).is_file(), f"Missing interface asset: {path}")
skills = sorted((PLUGIN / "skills").glob("*/SKILL.md"))
inventory = json.loads((ROOT / "upstream-inventory.json").read_text())
source_skills = {item["path"].split("/")[1] for item in inventory
if re.fullmatch(r"skills/[^/]+/SKILL\.md", item["path"])}
expected_skills = source_skills | {"automate-maintainer", "automate-team"}
check({skill.parent.name for skill in skills} == expected_skills,
"Skill directories must match the reviewed upstream inventory and Codex additions")
for skill in skills:
content = skill.read_text()
check(content.startswith("---\n"), f"Missing frontmatter: {skill}")
check("../../CODEX.md" in content and (skill.parent / "../../CODEX.md").is_file(), f"Missing runtime contract: {skill}")
frontmatter = content.split("---", 2)[1] if content.startswith("---") else ""
check(not re.search(r"^(mode|reminder|disable-model-invocation):", frontmatter, re.M), f"Cursor frontmatter: {skill}")
name = re.search(r"^name: (.+)$", frontmatter, re.M)
check(name is not None and name[1] == skill.parent.name, f"Skill name must match its folder: {skill}")
metadata = skill.parent / "agents/openai.yaml"
if skill.parent.name != "setup-pstack":
check(metadata.is_file() and "allow_implicit_invocation: false" in metadata.read_text(), f"Missing explicit invocation policy: {skill}")
for agent in (PLUGIN / "codex-agents").glob("*.toml"):
data = tomllib.loads(agent.read_text())
for key in ("name", "description", "developer_instructions"):
check(bool(data.get(key)), f"Missing {key} in {agent}")
check((PLUGIN / "LICENSE").is_file(), "Missing upstream license")
if errors:
print("\n".join(errors), file=sys.stderr)
sys.exit(1)
print(f"Package preflight passed: {len(skills)} skills; marketplace, paths, policies, agents, license.")
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.