This commit is contained in:
eddiesoehnel committed 2026-10-19 12:56:31 -06:00
1 parent df7571392e
commit a47b915ed5
27 files changed
+135 -1352

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ Run commands from the repository root with Python 3.11+ and `requirements.txt` d
| [folder_builder.py](folder_builder.py) | Inspect/prepare source folders; seed plans; build drafts; finalize explicitly approved content; verify and search drafts/finals |
| [media_approval.py](media_approval.py) | Final approval input binding and integrity checks, called by folder_builder |
| [media_builder.py](media_builder.py) | Optional reviewed public-export pipeline and collection search |
| [check_repository.py](check_repository.py) | Native schemas, identity/version/rights, catalog, links, paths, syntax, whitespace, and targeted credential-pattern checks |
| [check_repository.py](check_repository.py) | Native schemas, identity/version/rights, catalog, links, paths, syntax, whitespace, targeted credential-pattern checks, and public-template hygiene |
| [audit_repository.py](audit_repository.py) | Read-only software-automation profile audit adapted from the MIT AI-Ready Repository Template |
Use `python scripts/folder_builder.py --help` for commands and [the main README](../README.md) for the processing sequence. Finalize only on explicit approval of the specific reviewed draft, with `--reviewer`, `--approved-at`, and `--evidence`. Never invent those values to unblock a build.
+24 -2
View File
@@ -32,7 +32,9 @@ def validate_contracts(root=ROOT):
assert manifest['canonical_url'] in citation, 'Citation URL mismatch'
for record in manifest['authors']:
assert record['name'] in (root/'AUTHOR.md').read_text(encoding='utf-8'), 'Author notice mismatch'
assert 'Copyright (c) 2026 Eddie Soehnel' in (root/manifest['rights']['license_file']).read_text(encoding='utf-8'), 'License attribution mismatch'
license_text = (root/manifest['rights']['license_file']).read_text(encoding='utf-8')
assert re.search(r'Copyright \(c\) \d{4}', license_text), 'Missing copyright notice'
assert any(record['name'] in license_text for record in manifest['authors']), 'License attribution mismatch'
ids=[item['content_id'] for item in index['items']]
paths=[item['path'] for item in index['items']]
assert len(ids)==len(set(ids)) and len(paths)==len(set(paths)), 'Duplicate content identity/path'
@@ -46,6 +48,26 @@ def validate_contracts(root=ROOT):
return {'version':version,'license':manifest['rights']['license'],'indexed_documents':len(ids)}
def validate_public_template(root=ROOT):
"""Bounded repository hygiene checks; not a general PII detector."""
operational_roots = {'tasks', 'task-records', 'runtime', 'private', 'recordings', 'structured'}
generated_names = {'media-intake.json', 'structure-plan.json', 'build-receipt.json', 'approval.json'}
text_suffixes = {'.md', '.py', '.json', '.txt', '.vtt', '.cff'}
machine_path = re.compile(r'(?<![A-Za-z0-9])[A-Za-z]:[\\/]|/(?:Users|home)/[A-Za-z0-9_.-]+/')
checked = 0
for path in root.rglob('*'):
rel = path.relative_to(root)
if not path.is_file() or set(rel.parts) & SKIP:
continue
assert rel.parts[0] not in operational_roots and not rel.parts[0].startswith('structured-final'), 'Operational records in public template: ' + rel.as_posix()
assert path.name not in generated_names and not path.name.endswith(('.ticket.json', '.receipt.json', '.log')), 'Recording-specific output in public template: ' + rel.as_posix()
if path.suffix in text_suffixes or path.name in {'LICENSE', '.gitignore', '.gitattributes', 'VERSION'}:
text = path.read_text(encoding='utf-8-sig')
assert not machine_path.search(text), 'Absolute machine path in public template: ' + rel.as_posix()
checked += 1
return {'public_template_files': checked}
def check():
files = [p for p in ROOT.rglob('*') if p.is_file() and not (set(p.relative_to(ROOT).parts) & SKIP)]
count = {'json': 0, 'markdown_links': 0, 'schema_refs': 0, 'python': 0}
@@ -99,7 +121,7 @@ def check():
errors.append('Missing manifest path: ' + name)
if errors:
raise ValueError('\n'.join(errors))
print(json.dumps({'valid': True, **count, **validate_contracts(ROOT)}, indent=2))
print(json.dumps({'valid': True, **count, **validate_contracts(ROOT), **validate_public_template(ROOT)}, indent=2))
if __name__ == '__main__':