Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/readme-source.json

This file was deleted.

5 changes: 5 additions & 0 deletions .github/readme-source.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version = 1
sha256 = "fded3f18b290aa29d4d317358c5296e9477be3c5b785449f0b0066a6e3d3f08c"

[history]
forbidden_commits = ["3cbdabb71650fbca119b17e89ceed577f6bf81cd"]
6 changes: 0 additions & 6 deletions .github/runtime-sources.json

This file was deleted.

3 changes: 3 additions & 0 deletions .github/runtime-sources.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[sources]]
source = "SKILL.prompt"
target = "SKILL.md"
6 changes: 3 additions & 3 deletions .github/scripts/check-documentation.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
"""Check tracked documentation layout and the reviewed usage README digest."""
import hashlib
import json
import os
from pathlib import Path, PurePosixPath
import subprocess
import sys
import tomllib

MARKDOWN = {'.md', '.markdown', '.mdown', '.mkd', '.mkdn', '.mdwn', '.mdx', '.rmd', '.qmd'}
OTHER_DOCS = {'.rst', '.adoc', '.asciidoc'}
Expand Down Expand Up @@ -39,10 +39,10 @@ def check(root, include_history=True, history_required=False):
body = readme.read_bytes()
if not any(line.startswith('# ') for line in body.decode('utf-8').splitlines()):
errors.append('root README.md needs a product heading')
policy_path = root / '.github/readme-source.json'
policy_path = root / '.github/readme-source.toml'
if policy_path.is_symlink():
raise ValueError('README source policy cannot be a symlink')
policy = json.loads(policy_path.read_text())
policy = tomllib.loads(policy_path.read_text())
if policy.get('version') != 1:
raise ValueError('unsupported README source policy')
if hashlib.sha256(body).hexdigest() != policy.get('sha256'):
Expand Down
10 changes: 8 additions & 2 deletions scripts/prepare-runtime.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env python3
"""Materialize native runtime filenames from tracked functional inputs."""
import json
import tomllib
from pathlib import Path
import os
import sys

ROOT = Path(__file__).resolve().parents[1]

def prepare():
records = json.loads((ROOT / '.github/runtime-sources.json').read_text())
manifest = ROOT / '.github/runtime-sources.toml'
if manifest.is_symlink() or not manifest.is_file() or manifest.stat().st_size > 262144:
raise ValueError('runtime manifest must be a bounded regular TOML source')
declaration = tomllib.loads(manifest.read_text(encoding='utf-8'))
if set(declaration) != {'sources'} or not isinstance(declaration['sources'], list) or len(declaration['sources']) > 128:
raise ValueError('runtime manifest requires one bounded sources array')
records = declaration['sources']
for row in records:
source, target = ROOT / row['source'], ROOT / row['target']
if not source.resolve().is_relative_to(ROOT.resolve()) or not target.parent.resolve().is_relative_to(ROOT.resolve()):
Expand Down
Loading