Skip to content

Commit 8196d5d

Browse files
committed
Add validation evals and tighten protocol checks
1 parent e1d98aa commit 8196d5d

16 files changed

Lines changed: 2260 additions & 1309 deletions

.github/workflows/validate.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
20+
- run: npm ci
21+
- run: npm run validate

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
.AppleDouble
44
.LSOverride
55
._*
6+
.Spotlight-V100
7+
.Trashes
8+
Icon?
9+
10+
# Windows local metadata
11+
Thumbs.db
12+
ehthumbs.db
13+
Desktop.ini
614

715
# Editor / IDE
816
*.swp

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Each agent maintains a self-contained skill file encoding the full protocol work
109109
|------|-------------|
110110
| [skills/claude-opus_4.6/SKILL.md](skills/claude-opus_4.6/SKILL.md) | Claude protocol execution guide (v0.2.0) |
111111
| [skills/codex_5.3/SKILL.md](skills/codex_5.3/SKILL.md) | Codex protocol execution guide |
112-
| [skills/skill-versioning/SKILL.md](skills/skill-versioning/SKILL.md) | Shared metaskill for versioning skill bundles across Codex + Claude |
112+
| [skills/skill-versioning/SKILL.md](skills/skill-versioning/SKILL.md) | Shared metaskill for versioning skill bundles across Codex + Claude. Current installs may expose the same bundle as `skill-provenance`. |
113113
| [templates/SKILL.md](templates/SKILL.md) | Skill template for onboarding new agents |
114114

115115
### Coordination artifacts
@@ -119,6 +119,7 @@ Each agent maintains a self-contained skill file encoding the full protocol work
119119
| [VISION.md](VISION.md) | Maintainer intent and alignment reference |
120120
| [schemas/turnfile/](schemas/turnfile/) | JSON Schema for TURNFILE.yaml validation |
121121
| [tools/](tools/) | Validators and helpers (turnfile-lint, mailbox invariants, PRD promotion, payload envelopes) |
122+
| [Validation](docs/VALIDATION.md) | Readiness gate, eval suite, and CI validation commands |
122123

123124
### Templates (copy and fill)
124125

@@ -163,6 +164,7 @@ node tools/validate-skills-preflight.mjs # verify skill install/parity/ve
163164
Package scripts:
164165

165166
```bash
167+
npm run validate # run the full repo readiness suite
166168
npm run validate:skills # strict preflight (requires global skill install)
167169
npm run validate:skills:ci # repo-only checks (CI-safe)
168170
```

docs/NOTIFICATION_PROTOCOL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ Field requirements:
9292
3. Long-form content is moved/preserved in `MAILBOX_ARCHIVE.md`.
9393
4. Archive references must retain message IDs so context is recoverable.
9494

95+
Closed Summary rows use this compact schema:
96+
97+
```text
98+
| ID | Date | From -> To | Final status | Outcome |
99+
|----|------|------------|--------------|---------|
100+
| MSG-YYYYMMDD-### | YYYY-MM-DD | <sender> -> <receiver> | <closed|actioned|superseded|withdrawn|abandoned> | <short outcome summary> |
101+
```
102+
95103
## Delivery semantics
96104

97105
1. Sender appends new message in newest-first position.

docs/VALIDATION.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Validation
2+
3+
Use `npm run validate` as the repo readiness gate before starting or resuming a Turnfile experiment.
4+
5+
## Commands
6+
7+
```bash
8+
npm run validate
9+
```
10+
11+
Runs the full local gate:
12+
1. `npm run lint:turnfile`
13+
2. `npm run lint:mailbox`
14+
3. `npm run lint:prds`
15+
4. `npm run validate:skills:ci`
16+
5. `npm run evals`
17+
18+
```bash
19+
npm run evals
20+
```
21+
22+
Runs fixture-based regression evals for the validators and exporters. The evals create temporary files and assert CLI exit codes plus stable output snippets.
23+
24+
```bash
25+
npm run validate:skills
26+
```
27+
28+
Runs strict skills preflight, including global Codex skill install checks. Use this on a configured local workstation. CI uses `validate:skills:ci` because global installs are environment-specific.
29+
30+
## Before an Experiment
31+
32+
1. Run `npm ci` after dependency changes.
33+
2. Run `npm run validate`.
34+
3. Confirm `working-session/MAILBOX.md` has expected active messages and Open Queue state.
35+
4. Regenerate `working-session/MAILBOX.json` after mailbox edits with `npm run export:mailbox`.
36+
5. Decide whether `working-session/` is the active experiment workspace or whether the previous run should be archived under `examples/`.
37+
38+
## CI
39+
40+
GitHub Actions runs `npm ci` and `npm run validate` on pushes to `main` and on pull requests.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
"url": "https://github.com/snapsynapse/turnfile.git"
1010
},
1111
"scripts": {
12+
"validate": "npm run lint:turnfile && npm run lint:mailbox && npm run lint:prds && npm run validate:skills:ci && npm run evals",
1213
"lint:turnfile": "node tools/turnfile-lint.mjs",
1314
"lint:mailbox": "node tools/validate-mailbox-invariants.mjs",
1415
"lint:prds": "node tools/validate-prd-promotion.mjs",
1516
"export:mailbox": "node tools/export-mailbox-json.mjs",
1617
"validate:skills": "node tools/validate-skills-preflight.mjs --strict-global",
17-
"validate:skills:ci": "node tools/validate-skills-preflight.mjs"
18+
"validate:skills:ci": "node tools/validate-skills-preflight.mjs",
19+
"evals": "node tools/run-evals.mjs"
1820
},
1921
"devDependencies": {
2022
"ajv": "^8.17.1",

skills/STRUCTURE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ All files must encode the same protocol outcomes while using agent-specific tool
1212

1313
## Shared Metaskills
1414

15-
1. `skills/skill-versioning/` — shared cross-agent metaskill for skill bundle version tracking (`SKILL.md`, `MANIFEST.yaml`, `CHANGELOG.md`, `README.md`, `evals.json`).
15+
1. `skills/skill-versioning/`repo-local compatibility path for the shared cross-agent metaskill for skill bundle version tracking (`SKILL.md`, `MANIFEST.yaml`, `CHANGELOG.md`, `README.md`, `evals.json`).
1616

1717
This metaskill is jointly consumed by all agents (Codex, Claude, Gemini) and versioned as part of the Turnfile repository.
18+
Current installs may expose the same bundle identity as `skill-provenance`; tools should accept both `skill-versioning` and `skill-provenance` while preserving `skills/skill-versioning/` as the stable repository path.
1819

1920
## Shared Policy Assertions
2021

templates/working-session/MAILBOX.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ per PRD-008 payload-first rule.
5454

5555
## Closed Summary
5656

57-
| ID | From -> To | Subject | Final status | Closed by |
58-
|----|------------|---------|--------------|-----------|
57+
| ID | Date | From -> To | Final status | Outcome |
58+
|----|------|------------|--------------|---------|
5959

6060
<!--
6161
Example row:
62-
| MSG-YYYYMMDD-001 | Claude -> Gemini | PRD review findings | actioned | Claude |
62+
| MSG-YYYYMMDD-001 | YYYY-MM-DD | Claude -> Gemini | closed | PRD review findings resolved. |
6363
-->

tools/export-mailbox-json.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ function parseTableAt(lines, tableHeaderIndex) {
8181
}
8282

8383
function parseSectionTable(lines, headingText) {
84-
const headingIndex = lines.findIndex((line) => line.trim() === headingText);
84+
const headingTexts = Array.isArray(headingText) ? headingText : [headingText];
85+
const headingIndex = lines.findIndex((line) => headingTexts.includes(line.trim()));
8586
if (headingIndex < 0) {
8687
return [];
8788
}
@@ -140,7 +141,9 @@ function parseActiveMessages(lines) {
140141
}
141142

142143
const end = lines.findIndex(
143-
(line, idx) => idx > start && line.trim() === "## Closed Summary (Newest First)",
144+
(line, idx) =>
145+
idx > start &&
146+
["## Closed Summary (Newest First)", "## Closed Summary"].includes(line.trim()),
144147
);
145148
const sliceEnd = end >= 0 ? end : lines.length;
146149
const section = lines.slice(start + 1, sliceEnd);
@@ -290,7 +293,7 @@ function main() {
290293
),
291294
active_messages: parseActiveMessages(lines),
292295
closed_summary: addStandardKeys(
293-
parseSectionTable(lines, "## Closed Summary (Newest First)"),
296+
parseSectionTable(lines, ["## Closed Summary (Newest First)", "## Closed Summary"]),
294297
),
295298
};
296299

0 commit comments

Comments
 (0)