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
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ optional context with relations to other claims.
| Directory | Purpose |
|-----------|---------|
| `spec/` | Normative specification -- [CORE.md](spec/CORE.md), [SPEC.md](spec/SPEC.md), and companion documents |
| `conformance/` | PEG grammar, JSON Schema, and 10 test fixtures |
| `conformance/` | PEG grammar, JSON Schema, and 11 test fixtures |
| `examples/` | Two complete `.kpack` examples |
| `positioning/` | Public-facing positioning and design rationale |
| `research/` | Benchmark design and prior art analysis |
Expand Down Expand Up @@ -110,17 +110,18 @@ The [conformance suite](conformance/) provides formal validation tools:
definition of claims.md syntax
- **JSON Schema** (`conformance/grammar/kp-pack.schema.json`) -- validation
schema for PACK.yaml manifests
- **10 test fixtures** -- 5 valid packs that must be accepted, 5 invalid packs
- **11 test fixtures** -- 6 valid packs that must be accepted, 5 invalid packs
that must be rejected with specific errors
- **2 complete example packs** -- the kpacks in `examples/` are validated by
the runner as part of the suite, so the live examples are themselves
conformance tests

The runner (`conformance/run.py`) reports **12/12 passed** on a conformant
implementation: 10 fixture tests + 2 example validations. A conformant
The runner (`conformance/run.py`) reports **13/13 passed** on a conformant
implementation: 11 fixture tests + 2 example validations. A conformant
implementation parses all valid fixtures, rejects all invalid ones, validates
PACK.yaml against the schema, and enforces semantic constraints SC-01 through
SC-11. See [conformance/README.md](conformance/README.md) for details.
PACK.yaml against the schema, validates `signatures.yaml` against its schema
when present, and enforces semantic constraints SC-01 through SC-11. See
[conformance/README.md](conformance/README.md) for details.

## Interoperability

Expand All @@ -135,11 +136,11 @@ format's genuinely novel contributions.

## Status

This is an **editor's draft** maintained by a single editor in a public repository. It is published as `KP:1 Public Draft — 2026-04` (git tag `v0.7-preview`). It has a formal grammar, a JSON Schema, a conformance suite with 10 test fixtures, and two reference examples.
This is an **editor's draft** maintained by a single editor in a public repository. It is published as `KP:1 Public Draft — 2026-04` (git tag `v0.7-preview`, with subsequent preview revisions through v0.7.5 documented in [`spec/CHANGELOG.md`](spec/CHANGELOG.md)). It has a formal grammar, a JSON Schema, a conformance suite with 11 test fixtures, and two reference examples.

The specification is **not final** and may change in any way at any time, including breaking changes. It is **not yet ratified** by any standards body. Compatibility commitments will arrive only with a non-draft version. See [`GOVERNANCE.md`](GOVERNANCE.md) for the full governance picture, including how decisions are made during the preview phase and what changes when the Knowledge Pack Foundation is incorporated.

The current phase is **feedback-only**: the editor welcomes issues, comparisons, ambiguity reports, and adversarial review through GitHub issues, but does not accept external pull requests modifying normative spec text. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.
The current phase is **feedback-only**: the editor welcomes issues, comparisons, ambiguity reports, and critical review through GitHub issues, but does not accept external pull requests modifying normative spec text. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.

## License

Expand Down
11 changes: 6 additions & 5 deletions conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ conformance/
kp-signatures.schema.json JSON Schema for signatures.yaml
fixtures/
README.md Fixture catalog & coverage matrix
valid/ 5 packs that MUST be accepted
valid/ 6 packs that MUST be accepted
minimal.kpack/
typical.kpack/
verbose-claims.kpack/
mixed-syntax.kpack/
maximal.kpack/
composition.kpack/
invalid/ 5 packs that MUST be rejected
no-rosetta.kpack/
orphan-evidence-ref.kpack/
Expand All @@ -52,23 +53,23 @@ pip install -r requirements.txt
python3 conformance/run.py
```

Expected result: `12/12 passed`. The runner has two Python dependencies (`pyyaml`, `jsonschema`) declared in `requirements.txt`.
Expected result: `13/13 passed`. The runner has two Python dependencies (`pyyaml`, `jsonschema`) declared in `requirements.txt`.

## Grammar vs Runner

The PEG grammar in `grammar/kp-claims.peg` is the **normative** reference for KP:1 claim syntax. It is what implementations should target.

The `run.py` runner in this preview release validates fixtures against **equivalent regular-expression patterns** rather than parsing through the PEG grammar directly. The two paths are kept in sync by hand. A future phase will replace the regex layer with a PEG-driven parser using a library such as `parsimonious` or `lark`. The fixture suite is the contract: any future runner that passes 12/12 against these fixtures is acceptable.
The `run.py` runner in this preview release validates fixtures against **equivalent regular-expression patterns** rather than parsing through the PEG grammar directly. The two paths are kept in sync by hand. A future phase will replace the regex layer with a PEG-driven parser using a library such as `parsimonious` or `lark`. The fixture suite is the contract: any future runner that passes 13/13 against these fixtures is acceptable.
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence refers to passing "13/13 against these fixtures", but run.py's 13 total includes 11 fixtures plus 2 example packs. Consider rephrasing to avoid calling the examples "fixtures", or explicitly note the fixtures-vs-examples breakdown.

Suggested change
The `run.py` runner in this preview release validates fixtures against **equivalent regular-expression patterns** rather than parsing through the PEG grammar directly. The two paths are kept in sync by hand. A future phase will replace the regex layer with a PEG-driven parser using a library such as `parsimonious` or `lark`. The fixture suite is the contract: any future runner that passes 13/13 against these fixtures is acceptable.
The `run.py` runner in this preview release validates fixtures against **equivalent regular-expression patterns** rather than parsing through the PEG grammar directly. The two paths are kept in sync by hand. A future phase will replace the regex layer with a PEG-driven parser using a library such as `parsimonious` or `lark`. The conformance suite is the contract: any future runner that passes all 13 checks (11 fixtures plus 2 example packs) is acceptable.

Copilot uses AI. Check for mistakes.

If you want to implement a conforming parser today, target the PEG grammar, not the runner's regexes.

## Phase Status

| Phase | Description | Status |
|-------|-------------|--------|
| C1 | Formal grammar (PEG), JSON Schema, 10 fixtures | **Done** |
| C1 | Formal grammar (PEG), JSON Schema, 11 fixtures | **Done** |
| C2 | YAML schemas for signatures.yaml, composition.yaml | **Done** |
| C3 | Automated test runner (`run.py`, 12/12 pass) | **Done** |
| C3 | Automated test runner (`run.py`, 13/13 pass) | **Done** |
| C4 | Round-trip consistency tests | Not started |

## Key Design Decisions
Expand Down
23 changes: 17 additions & 6 deletions conformance/fixtures/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# KP:1 Conformance Fixtures

> **Status:** Complete — Phase C3 (automated runner passes 12/12)
> **Status:** Complete — Phase C3 (automated runner passes 13/13)
> **Spec version:** KP:1

Test fixtures for KP:1 conformance validation. Each fixture is a complete
`.kpack` directory with `PACK.yaml`, `claims.md`, and `evidence.md`.
`.kpack` directory. Standard packs include `PACK.yaml`, `claims.md`, and
`evidence.md`; composition packs (per SPEC.md §2) include `composition.yaml`
and MAY omit `evidence.md`.

## Valid Fixtures

Expand All @@ -16,7 +18,8 @@ Implementations MUST accept all valid fixtures without errors.
| `typical.kpack` | Realistic pack with common optional fields, relations, sections | 4 | Dense (4+6 pos) |
| `verbose-claims.kpack` | All claims use verbose named-field syntax | 3 | Verbose only |
| `mixed-syntax.kpack` | Dense and verbose claims coexist in one document | 5 | Both |
| `maximal.kpack` | Every optional field, all relation types, versioned IDs, cross-pack refs | 14 | Both |
| `maximal.kpack` | Every optional field, all relation types, versioned IDs, cross-pack refs; also includes a populated `signatures.yaml` exercising the v0.7.5 integrity schema | 14 | Both |
| `composition.kpack` | Structural fixture for composition packs: `composition.yaml` present, `evidence.md` omitted, prose-only `claims.md` (per SPEC.md §2) | 0 | N/A (structural) |

### Feature Coverage Matrix

Expand Down Expand Up @@ -45,6 +48,12 @@ Implementations MUST accept all valid fixtures without errors.
| Evidence: blockquote format | x | x | x | x | x |
| Evidence: list format | | | | | x |

The matrix covers claim-syntax features; `composition.kpack` is a structural
fixture (it has no claim bullets) and exercises the composition-pack
file-requirement rules from SPEC.md §2 instead. `maximal.kpack`'s
`signatures.yaml` exercises the v0.7.5 integrity schema
(`kp-signatures.schema.json`).

## Invalid Fixtures

Implementations MUST reject each fixture, flagging the specific violation.
Expand Down Expand Up @@ -87,6 +96,8 @@ python conformance/run.py
```

This parses each `claims.md` against `grammar/kp-claims.peg`, validates each
`PACK.yaml` against `grammar/kp-pack.schema.json`, runs semantic constraint
checks (SC-01 through SC-11), and verifies that all valid fixtures pass and all
invalid fixtures fail with expected errors. Current result: 12/12 tests pass.
`PACK.yaml` against `grammar/kp-pack.schema.json`, validates each
`signatures.yaml` against `grammar/kp-signatures.schema.json` when present,
runs semantic constraint checks (SC-01 through SC-11), and verifies that all
valid fixtures pass and all invalid fixtures fail with expected errors.
Comment on lines 98 to +102
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this runner description, run.py does not actually parse claims.md via the PEG grammar (grammar/kp-claims.peg); it uses regex patterns (as described in conformance/README.md). Consider rewording this sentence to avoid implying PEG parsing, and instead reference the regex-based validation path.

Copilot uses AI. Check for mistakes.
Current result: 13/13 tests pass.
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paragraph ends with "Current result: 13/13 tests pass", but this section describes fixture validation only. Since run.py reports 13/13 by counting 11 fixtures plus 2 example packs, consider clarifying the breakdown (e.g., 11/11 fixtures, 13/13 overall including examples) to prevent confusion when readers reconcile counts.

Suggested change
Current result: 13/13 tests pass.
Current result: 11/11 fixture tests pass; 13/13 overall including 2 example packs.

Copilot uses AI. Check for mistakes.
6 changes: 3 additions & 3 deletions spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ The normative contract for Knowledge Pack version 1.
-- everything required to build a conformant KP:1 parser and validator. If you
are implementing KP:1, CORE.md is sufficient.

**[SPEC.md](SPEC.md)** is the full specification (~107KB). It covers the same
ground as CORE.md plus all companion topics in a single document. It predates
CORE.md and contains additional discussion and rationale.
**[SPEC.md](SPEC.md)** is the full specification (~110 KB). It covers the
same ground as CORE.md plus all companion topics in a single document. It
predates CORE.md and contains additional discussion and rationale.

**Companion documents** extend the Core with optional features:

Expand Down