Skip to content

Commit ec40f57

Browse files
Tighten public-safe context validation
1 parent b02e805 commit ec40f57

5 files changed

Lines changed: 25 additions & 5 deletions

File tree

.github/workflows/validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ jobs:
2525

2626
- name: Run manifest status checks
2727
run: npm run validate:manifest
28+
29+
- name: Run repository guardrail
30+
run: python3 scripts/validate_repo.py

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ flowchart LR
4343

4444
The repo includes package metadata and a validation script. The validation flow checks that the working context bundle exists, JSON files are parseable, the asset manifest has rows, every manifest row points to a committed file, and text files do not contain unresolved scaffold language.
4545

46+
Run validation with `npm run check` and `npm run validate:manifest` when Node and npm are available. If npm is unavailable but Node is available, run the underlying scripts directly: `node scripts/check-context-bundle.js` and `node scripts/check-manifest-status.js`.
47+
4648
## Working files
4749

4850
| Path | Purpose |
@@ -105,4 +107,4 @@ Usage and rights: see [USAGE.md](USAGE.md).
105107

106108
This repo shows the intake side of a design-system workflow: how to make brand, design, code, asset, and prompt context structured enough for consistent extraction and review.
107109

108-
It is not just storage. It is a working context layer with source files, validation, and an example output.
110+
It is not just storage. It is a working context layer with source files, validation, and an example output.

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
This repository is a public brand-design-system and AI-context bundle. It is not a production software package, deployed application, API, authentication system, or runtime service.
66

7-
Security updates apply to the current `master` branch only.
7+
Security updates apply to the current `main` branch only.
88

99
| Version / Branch | Supported |
1010
|---|---|
11-
| `master` | :white_check_mark: |
11+
| `main` | :white_check_mark: |
1212
| Archived branches, forks, or local copies | :x: |
1313

1414
## Scope

examples/example-output.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ Recommended use:
143143
| Asset | Status | Action |
144144
|---|---|---|
145145
| Primary logo reference | Manifested sample reference | Replace with approved production asset before use |
146-
| Reversed logo reference | Manifested sample reference | Replace with approved production asset before use |
147146
| Inter font reference | Reference only | Confirm font rights before bundling |
148147
| Icon set reference | Manifested sample reference | Replace with approved production icon set before use |
149148
| Hero image reference | Manifested sample reference | Replace with approved image before use |
@@ -158,6 +157,7 @@ Source file:
158157
|---|---|---|
159158
| Figma file is documented but not included | Medium | Add a real file link in a private implementation repo |
160159
| Logo files are manifested as sample references | Medium | Add approved assets before production work |
160+
| Additional logo variants are not in the manifest | Low | Add approved variants to the manifest before referencing them |
161161
| Button states are incomplete | Medium | Add focus, disabled, and loading guidance |
162162
| Form component is not represented in sample HTML | Low | Add a sample form block if form extraction is required |
163163

@@ -172,4 +172,4 @@ Source file:
172172

173173
## Recommended next action
174174

175-
Move the high-confidence token candidates and the Hero, Button, Card, and Review Panel component candidates into `brand-design-system-starter` as a draft extraction, then review manually before implementation.
175+
Move the high-confidence token candidates and the Hero, Button, Card, and Review Panel component candidates into `brand-design-system-starter` as a draft extraction, then review manually before implementation.

scripts/check-context-bundle.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ const allowedPathStatuses = new Set(['committed', 'documented-only']);
3939
const ignoreDirs = new Set(['.git', 'node_modules']);
4040
const textExtensions = new Set(['.md', '.json', '.js', '.css', '.html', '.csv', '.txt', '.svg']);
4141
const blockedWords = ['TO' + 'DO', 'T' + 'BD', 'placeholder' + ' only'];
42+
const privateUrlPatterns = [
43+
/https?:\/\/(?:www\.)?figma\.com/i,
44+
/https?:\/\/docs\.google\.com/i,
45+
/https?:\/\/drive\.google\.com/i,
46+
/https?:\/\/(?:www\.)?notion\.so/i
47+
];
48+
const disallowedAssetReference = 'Reversed logo ' + 'reference';
4249
let failed = false;
4350

4451
function walk(dir) {
@@ -141,6 +148,14 @@ for (const file of allFiles) {
141148
fail(`Unresolved scaffold text found in: ${file}`);
142149
}
143150
}
151+
for (const pattern of privateUrlPatterns) {
152+
if (pattern.test(body)) {
153+
fail(`Private design/document URL found in public bundle: ${file}`);
154+
}
155+
}
156+
if (body.includes(disallowedAssetReference.toLowerCase())) {
157+
fail(`Example output references an asset variant not listed in the manifest: ${file}`);
158+
}
144159
}
145160

146161
const manifestPath = 'fonts-logos-assets/manifest.csv';

0 commit comments

Comments
 (0)