📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -27,7 +27,7 @@ from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
from _project_paths import find_repo_root
|
||||
from validate_skills import configure_utf8_output, parse_frontmatter
|
||||
from validate_skills import configure_utf8_output
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -38,6 +38,7 @@ BASELINE_FILE = Path("data") / "drift-baseline.json"
|
||||
BASELINE_SCHEMA_VERSION = 1
|
||||
|
||||
# Fields excluded from hash to prevent false positives on metadata-only edits.
|
||||
_FRONTMATTER_RE = re.compile(r"^---\s*\n(.*?)\n?---(?:\s*\n|$)", re.DOTALL)
|
||||
_STRIP_PATTERNS = [
|
||||
re.compile(r"^date_added:.*$", re.MULTILINE),
|
||||
re.compile(r"^author:.*$", re.MULTILINE),
|
||||
@@ -109,8 +110,12 @@ def _normalize(content: str) -> str:
|
||||
whitespace changes or metadata-only edits (date_added, author).
|
||||
"""
|
||||
normalized = content
|
||||
for pattern in _STRIP_PATTERNS:
|
||||
normalized = pattern.sub("", normalized)
|
||||
fm_match = _FRONTMATTER_RE.search(content)
|
||||
if fm_match:
|
||||
frontmatter = fm_match.group(1)
|
||||
for pattern in _STRIP_PATTERNS:
|
||||
frontmatter = pattern.sub("", frontmatter)
|
||||
normalized = f"---\n{frontmatter}\n---\n{content[fm_match.end():]}"
|
||||
# Collapse multiple blank lines and strip trailing whitespace per line
|
||||
lines = [line.rstrip() for line in normalized.splitlines()]
|
||||
normalized = "\n".join(line for line in lines if line or lines)
|
||||
|
||||
@@ -157,8 +157,31 @@ def _humanize_skill_label(skill_id: str) -> str:
|
||||
return " ".join(words)
|
||||
|
||||
|
||||
def _string_list(value: Any) -> list[str]:
|
||||
if not isinstance(value, list):
|
||||
return []
|
||||
return [str(item).strip() for item in value if str(item).strip()]
|
||||
|
||||
|
||||
def _bundle_codex_short_description(bundle: dict[str, Any], category: str, skill_count: int) -> str:
|
||||
positioning = str(bundle.get("positioning", "")).strip()
|
||||
if positioning:
|
||||
return positioning
|
||||
return f"{category} · {skill_count} curated skills"
|
||||
|
||||
|
||||
def _format_codex_audience(prefix: str, values: list[str]) -> str:
|
||||
if not values:
|
||||
return ""
|
||||
return f"{prefix}: {', '.join(values)}."
|
||||
|
||||
|
||||
def _bundle_codex_long_description(bundle: dict[str, Any]) -> str:
|
||||
audience = bundle.get("audience") or bundle["description"]
|
||||
audience = str(bundle.get("audience") or bundle["description"]).strip()
|
||||
positioning = str(bundle.get("positioning", "")).strip()
|
||||
why = str(bundle.get("why", "")).strip()
|
||||
recommended_for = _string_list(bundle.get("recommendedFor"))
|
||||
not_for = _string_list(bundle.get("notFor"))
|
||||
highlights = [
|
||||
_humanize_skill_label(skill["id"])
|
||||
for skill in bundle["skills"][:2]
|
||||
@@ -167,15 +190,27 @@ def _bundle_codex_long_description(bundle: dict[str, Any]) -> str:
|
||||
remaining = len(bundle["skills"]) - len(highlights)
|
||||
|
||||
if not highlights:
|
||||
return f'{audience} Includes {len(bundle["skills"])} curated skills from Antigravity Awesome Skills.'
|
||||
coverage = f'Includes {len(bundle["skills"])} curated skills from Antigravity Awesome Skills.'
|
||||
elif remaining > 0:
|
||||
coverage = f"Covers {', '.join(highlights)}, and {remaining} more skills."
|
||||
elif len(highlights) == 1:
|
||||
coverage = f"Covers {highlights[0]}."
|
||||
else:
|
||||
coverage = f"Covers {' and '.join(highlights)}."
|
||||
|
||||
if remaining > 0:
|
||||
return f"{audience} Covers {', '.join(highlights)}, and {remaining} more skills."
|
||||
|
||||
if len(highlights) == 1:
|
||||
return f"{audience} Covers {highlights[0]}."
|
||||
|
||||
return f"{audience} Covers {' and '.join(highlights)}."
|
||||
parts = [positioning or audience]
|
||||
if why and why not in parts:
|
||||
parts.append(why)
|
||||
parts.extend(
|
||||
part
|
||||
for part in (
|
||||
_format_codex_audience("Recommended for", recommended_for),
|
||||
_format_codex_audience("Not for", not_for),
|
||||
coverage,
|
||||
)
|
||||
if part
|
||||
)
|
||||
return " ".join(parts)
|
||||
|
||||
|
||||
def _format_count_label(count: int) -> str:
|
||||
@@ -226,6 +261,10 @@ def _validate_editorial_bundles(root: Path, payload: dict[str, Any]) -> list[dic
|
||||
if not str(bundle.get(key, "")).strip():
|
||||
raise ValueError(f"Editorial bundle '{bundle_id}' is missing required field '{key}'.")
|
||||
|
||||
for key in ("recommendedFor", "notFor", "defaultPrompts"):
|
||||
if key in bundle and not _string_list(bundle[key]):
|
||||
raise ValueError(f"Editorial bundle '{bundle_id}' field '{key}' must be a non-empty string array.")
|
||||
|
||||
skills = bundle.get("skills")
|
||||
if not isinstance(skills, list) or not skills:
|
||||
raise ValueError(f"Editorial bundle '{bundle_id}' must include a non-empty 'skills' array.")
|
||||
@@ -438,12 +477,30 @@ def _bundle_codex_plugin_manifest(metadata: dict[str, Any], bundle: dict[str, An
|
||||
category = _clean_group_label(bundle["group"])
|
||||
plugin_name = _bundle_codex_plugin_name(bundle["id"])
|
||||
skill_count = len(bundle["skills"])
|
||||
is_productized = bool(str(bundle.get("positioning", "")).strip() or _string_list(bundle.get("defaultPrompts")))
|
||||
description = (
|
||||
f'Install the "{bundle["name"]}" workflow plugin from Antigravity Awesome Skills.'
|
||||
if is_productized
|
||||
else f'Install the "{bundle["name"]}" editorial skill bundle from Antigravity Awesome Skills.'
|
||||
)
|
||||
interface = {
|
||||
"displayName": bundle["name"],
|
||||
"shortDescription": _bundle_codex_short_description(bundle, category, skill_count),
|
||||
"longDescription": _bundle_codex_long_description(bundle),
|
||||
"developerName": AUTHOR["name"],
|
||||
"category": category,
|
||||
"capabilities": ["Interactive", "Write"],
|
||||
"websiteURL": REPO_URL,
|
||||
"brandColor": "#111827",
|
||||
}
|
||||
default_prompts = _string_list(bundle.get("defaultPrompts"))
|
||||
if default_prompts:
|
||||
interface["defaultPrompt"] = default_prompts
|
||||
|
||||
return {
|
||||
"name": plugin_name,
|
||||
"version": metadata["version"],
|
||||
"description": (
|
||||
f'Install the "{bundle["name"]}" editorial skill bundle from Antigravity Awesome Skills.'
|
||||
),
|
||||
"description": description,
|
||||
"author": AUTHOR,
|
||||
"homepage": REPO_URL,
|
||||
"repository": REPO_URL,
|
||||
@@ -456,16 +513,7 @@ def _bundle_codex_plugin_manifest(metadata: dict[str, Any], bundle: dict[str, An
|
||||
"productivity",
|
||||
],
|
||||
"skills": "./skills/",
|
||||
"interface": {
|
||||
"displayName": bundle["name"],
|
||||
"shortDescription": f"{category} · {skill_count} curated skills",
|
||||
"longDescription": _bundle_codex_long_description(bundle),
|
||||
"developerName": AUTHOR["name"],
|
||||
"category": category,
|
||||
"capabilities": ["Interactive", "Write"],
|
||||
"websiteURL": REPO_URL,
|
||||
"brandColor": "#111827",
|
||||
},
|
||||
"interface": interface,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ def sync_bundles_doc(content: str, metadata: dict, base_dir: str | Path | None =
|
||||
content, _ = replace_if_present(
|
||||
content,
|
||||
BUNDLES_FOOTER_RE,
|
||||
f"_Last updated: March 2026 | Total Skills: {metadata['total_skills_label']} | Total Bundles: {bundle_count}_",
|
||||
f"_Last updated: June 2026 | Total Skills: {metadata['total_skills_label']} | Total Bundles: {bundle_count}_",
|
||||
)
|
||||
return content
|
||||
|
||||
|
||||
@@ -35,6 +35,11 @@ for (const candidate of candidates) {
|
||||
const bundle = bundlesById.get(candidate.id);
|
||||
assert.ok(bundle, `candidate ${candidate.id} must be enabled in data/editorial-bundles.json`);
|
||||
assert.strictEqual(bundle.name, candidate.name, `candidate ${candidate.id} bundle name should match`);
|
||||
assert.strictEqual(bundle.why, candidate.why, `candidate ${candidate.id} should carry candidate rationale into bundles`);
|
||||
assert.ok(
|
||||
Array.isArray(bundle.defaultPrompts) && bundle.defaultPrompts.length >= 2,
|
||||
`candidate ${candidate.id} should include productized default prompts`,
|
||||
);
|
||||
assert.deepStrictEqual(
|
||||
bundle.skills.map((skill) => skill.id),
|
||||
candidate.skills,
|
||||
|
||||
@@ -103,7 +103,7 @@ class AuditConsistencyTests(unittest.TestCase):
|
||||
encoding="utf-8",
|
||||
)
|
||||
(root / "docs" / "users" / "bundles.md").write_text(
|
||||
f'### 🚀 The "Essentials" Pack\n_Last updated: March 2026 | Total Skills: {count_label} | Total Bundles: 1_\n',
|
||||
f'### 🚀 The "Essentials" Pack\n_Last updated: June 2026 | Total Skills: {count_label} | Total Bundles: 1_\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
(root / "docs" / "users" / "kiro-integration.md").write_text(
|
||||
|
||||
@@ -88,6 +88,20 @@ class HashComputationTests(unittest.TestCase):
|
||||
h_b = detect_drift.compute_hash(content_b)
|
||||
self.assertEqual(h_a, h_b, "author change should not affect hash")
|
||||
|
||||
def test_body_author_line_affects_hash(self):
|
||||
content_a = "---\nname: skill\n---\n\n## Notes\nauthor: alice"
|
||||
content_b = "---\nname: skill\n---\n\n## Notes\nauthor: bob"
|
||||
h_a = detect_drift.compute_hash(content_a)
|
||||
h_b = detect_drift.compute_hash(content_b)
|
||||
self.assertNotEqual(h_a, h_b, "body author lines are meaningful content")
|
||||
|
||||
def test_body_date_added_line_affects_hash(self):
|
||||
content_a = "---\nname: skill\n---\n\n## Notes\ndate_added: 2026-01-01"
|
||||
content_b = "---\nname: skill\n---\n\n## Notes\ndate_added: 2026-06-15"
|
||||
h_a = detect_drift.compute_hash(content_a)
|
||||
h_b = detect_drift.compute_hash(content_b)
|
||||
self.assertNotEqual(h_a, h_b, "body date_added lines are meaningful content")
|
||||
|
||||
def test_meaningful_content_change_changes_hash(self):
|
||||
content_a = "---\nname: skill\n---\n\nOriginal body."
|
||||
content_b = "---\nname: skill\n---\n\nCompletely different body content."
|
||||
|
||||
@@ -127,6 +127,10 @@ class EditorialBundlesTests(unittest.TestCase):
|
||||
bundle,
|
||||
)
|
||||
self.assertEqual(manifest["name"], plugin_name)
|
||||
if bundle.get("defaultPrompts"):
|
||||
self.assertEqual(manifest["interface"]["defaultPrompt"], bundle["defaultPrompts"])
|
||||
if bundle.get("positioning"):
|
||||
self.assertEqual(manifest["interface"]["shortDescription"], bundle["positioning"])
|
||||
self.assertLessEqual(
|
||||
len(plugin_name),
|
||||
max_name_length,
|
||||
|
||||
@@ -81,7 +81,7 @@ class SyncRepoMetadataTests(unittest.TestCase):
|
||||
encoding="utf-8",
|
||||
)
|
||||
(root / "docs" / "users" / "bundles.md").write_text(
|
||||
'### 🚀 The "Essentials" Pack\n### 🌐 The "Web Wizard" Pack\n_Last updated: March 2026 | Total Skills: 1,254+ | Total Bundles: 99_\n',
|
||||
'### 🚀 The "Essentials" Pack\n### 🌐 The "Web Wizard" Pack\n_Last updated: June 2026 | Total Skills: 1,254+ | Total Bundles: 99_\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
(root / "docs" / "users" / "kiro-integration.md").write_text(
|
||||
|
||||
@@ -127,4 +127,4 @@ Found a skill that should be in a bundle? Or want to create a new bundle? [Open
|
||||
|
||||
---
|
||||
|
||||
_Last updated: March 2026 | Total Skills: {{total_skills_label}} | Total Bundles: {{bundle_count}}_
|
||||
_Last updated: June 2026 | Total Skills: {{total_skills_label}} | Total Bundles: {{bundle_count}}_
|
||||
|
||||
Reference in New Issue
Block a user