Skip to content

Commit 5a76f76

Browse files
authored
Merge pull request #11 from commandlayer/codex/fix-validation-surface-credibility
Strengthen fixture coverage and simplify validation commands
2 parents 9ebbc93 + c392c1d commit 5a76f76

File tree

173 files changed

+1094
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+1094
-355
lines changed

ONBOARDING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ Canonical definitions → `SPEC.md`.
8181
```
8282
npm install
8383
npm run validate
84+
```
85+
86+
Use the subcommands only when you need a narrower loop:
87+
88+
```
89+
npm run validate:schemas
8490
npm run validate:examples
8591
```
8692
5. Update `RESOLUTION.md`, provenance
@@ -96,6 +102,16 @@ Once approved → tagged + pinned.
96102
- Fully traceable governance + checksums
97103
- Deterministic $id + HTTP resolution
98104

105+
## 5A. Fixture Rules
106+
107+
When you touch `examples/`, keep the validation surface credible:
108+
109+
- valid examples should be realistic, not cartoon placeholders
110+
- invalid examples should usually test one clear failure, not five at once
111+
- filenames should explain the scenario (`missing-input`, `invalid-version`, `extra-property`, etc.)
112+
- request examples must stay verb-aligned; do not copy an invalid fixture from one verb directory into another
113+
- valid receipts should use realistic `sha256:` digests and CID-shaped values
114+
99115
Default assumption: **new version** for any semantic change.
100116

101117
## 6. Support

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ If agents cannot agree on what actions mean, interoperability breaks.
7777
"status": "ok",
7878
"timestamp": "2026-03-18T12:00:00Z",
7979
"agent": "summarizeagent.eth",
80-
"request_hash": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
81-
"result_hash": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
82-
"result_cid": "bafybeisummarizereceiptokexample0001",
80+
"request_hash": "sha256:4b87d90208e62430a5d8f577938fd26d02d646f092d137cee66216c0daac8243",
81+
"result_hash": "sha256:8b5d2d4dfb4a8bb7d4d1ed436e78c5f4bcf6ca9714ec93a8db8e5ec6ed8b1b8d",
82+
"result_cid": "bafybeif6h8j0l2n4p6r8t0v2x4z6b8d0f2h4j6l8n0p2r4t6v8x0z2bd",
8383
"summary": "Commons v1.1.0 makes requests smaller and receipts easier to verify while preserving stable verb semantics.",
8484
"signature": "sigAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
8585
}
@@ -107,13 +107,15 @@ Install Commons and AJV:
107107
npm install @commandlayer/commons ajv ajv-formats ajv-errors
108108
```
109109

110-
**Validate all schemas and examples with the repo's working commands**
110+
**Validate the full repo surface**
111111

112112
```bash
113113
npm install
114114
npm run validate
115115
```
116116

117+
`npm run validate` is the primary command: it compiles every schema and then checks that all shipped examples pass or fail exactly as intended.
118+
117119
**Validate a specific example against the published schema using AJV**
118120

119121
```bash
@@ -384,7 +386,6 @@ Commons gives upper layers a stable meaning layer to build around.
384386
│ ├── <verb>.request.schema.json
385387
│ └── <verb>.receipt.schema.json
386388
└── scripts/
387-
├── ajv-run.mjs
388389
├── validate-all.mjs
389390
└── validate-examples.mjs
390391
```
@@ -421,15 +422,30 @@ Published version directories must not be edited in place.
421422
Available commands:
422423
423424
```bash
425+
npm run validate
424426
npm run validate:schemas
425427
npm run validate:examples
426-
npm run validate
427428
```
428429
429-
These commands compile schemas in strict Ajv mode and validate the shipped examples for both `v1.0.0` and `v1.1.0`.
430+
- `npm run validate` — the main contributor command. Compiles every schema, then validates every shipped example.
431+
- `npm run validate:schemas` — schema compilation only. Useful when changing schema files or Ajv configuration.
432+
- `npm run validate:examples` — fixture pass/fail verification only. Useful when editing examples or improving failure coverage.
433+
434+
For `v1.1.0`, fixture discipline matters as much as schema compilation: valid examples must look operationally plausible, and invalid examples should usually fail for one clear reason that matches the filename.
430435
431436
---
432437
438+
## Fixture discipline
439+
440+
For `examples/v1.1.0/commons/`, contributors should treat fixtures as protocol evidence, not filler:
441+
442+
- valid examples should look realistic enough that an implementer could model against them
443+
- invalid examples should usually exercise one clear failure mode
444+
- filenames should describe the exact failure being tested
445+
- request fixtures must stay aligned with the verb directory they live in; deliberate wrong-verb cases must be explicitly named
446+
- valid receipts should use realistic digest and CID-shaped values instead of toy placeholders
447+
448+
433449
## License
434450
435451
MIT.

examples/v1.1.0/commons/analyze/json/invalid/001-analyze.request.invalid.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version": "1.1.0",
3+
"input": "Find the hidden assumptions in this release checklist.",
4+
"mode": "extract"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"verb": "analyze",
3+
"version": "1.1.0",
4+
"mode": "extract"
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"verb": "analyze",
3+
"version": "1.1.0",
4+
"input": "",
5+
"mode": "extract"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"verb": "analyze",
3+
"version": "1.1",
4+
"input": "Review the incident summary.",
5+
"mode": "extract"
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"verb": "analyze",
3+
"version": "1.1.0",
4+
"input": "Review the incident summary.",
5+
"mode": "extract",
6+
"trace_id": "req_01"
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"verb": "analyze",
3+
"version": "1.1.0",
4+
"input": "Review the incident summary.",
5+
"mode": "bullet-points"
6+
}

examples/v1.1.0/commons/summarize/json/invalid/001-summarize.request.invalid.json renamed to examples/v1.1.0/commons/analyze/json/invalid/007-wrong-input-type.request.invalid.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"input": {
55
"text": "This should be a string."
66
},
7-
"mode": "tweet"
7+
"mode": "extract"
88
}

0 commit comments

Comments
 (0)