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
54 changes: 54 additions & 0 deletions .github/scripts/host-conformance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# Assert the reference host upholds every host-binding rule (SPEC.md §11.1,
# issue #14).
#
# This is the host-side dual of conformance-red.sh. The provider suite proves
# it catches broken *providers*; this proves the reference *host* catches broken
# providers — each host-side check drives an ADVERSARIAL in-process provider
# that tries to make the host fail (blow the budget, flood frames, egress
# without consent, tamper a provenance digest, ...) and passes only if the host
# catches it. So a CONFORMANT verdict here means every adversarial provider was
# caught: a host that failed to gate consent, drop an over-budget provider, or
# detect a tampered digest turns this red.
set -euo pipefail

BIN="${BIN:-./target/debug}"
INSPECT="$BIN/contextgraph-inspect"

if [[ ! -x "$INSPECT" ]]; then
echo "::error::$INSPECT not built — run 'cargo build --workspace --bins' first"
exit 1
fi

# `|| true` mirrors conformance-red.sh: inspect exits non-zero precisely when a
# host-binding rule is violated, which is the outcome this script inspects.
report=$("$INSPECT" host --json 2>&1 | sed -n '/^{/,$p' || true)

if [[ -z "$report" ]]; then
echo "::error::host conformance produced no JSON report"
exit 1
fi

echo "Host-binding checks:"
printf '%s' "$report" | python3 -c '
import json, sys
report = json.load(sys.stdin)
marks = {"pass": "PASS", "fail": "FAIL", "skipped": "SKIP"}
for check in report["checks"]:
status = marks.get(check["status"], check["status"].upper())
print(" [" + status + "] " + check["name"] + ": " + check["evidence"])
'
echo

failed=$(printf '%s' "$report" | python3 -c '
import json, sys
report = json.load(sys.stdin)
print(",".join(c["name"] for c in report["checks"] if c["status"] != "pass"))
')

if [[ -n "$failed" ]]; then
echo "::error::the reference host violated host-binding rule(s): $failed"
exit 1
fi

echo "The reference host upholds every checked host-binding rule."
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ jobs:
run: ./.github/scripts/conformance-green.sh
- name: Suite is red against every --misbehave mode
run: ./.github/scripts/conformance-red.sh
- name: Reference host upholds every host-binding rule (§11.1, #14)
run: ./.github/scripts/host-conformance.sh

sdk-typescript:
name: sdk (typescript) is a conformant implementation
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ which. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1
## [Unreleased]

### Added
- **`SPEC.md` normative completeness pass** — folds every shipped wire surface
into the single normative home ahead of the freeze (#49, #50, #48, #13). Adds
§9 **Verification** (`verify`/`verified`, V1–V4), §6.3 **Frame identity**
(D1–D4), §6.4 **Representations** (`full`/`compact`/`reference`, P1–P5) with an
explicit **1.0 scope boundary for `context/resolve`** — the operation is
deferred to a `1.x` additive minor (sketch: [docs/sketches/resolve.md](./docs/sketches/resolve.md)),
so a remote provider should not emit un-rehydratable `reference` frames (#50).
Adds §4.1 **egress scopes and consent receipts** (C5–C6) and §4.2 **transport
security** (C7 TLS-for-non-loopback, C8 credentials-never-logged, #13). Adds
§13 **Extensibility** (U1 ignore-unknown-members, U2 closed `FrameKind` /
open vocabularies, U3 reserved `:` namespaces, U4 no-repurpose/deprecation) —
the rules that make the additive-only freeze real, distinguishing the
authoring-strict JSON Schema from the U1 interop contract (#48). Adds the
`unsupported_representation` and `incompatible_version` error codes (#9). No
wire-shape change: all of this documents surfaces already carried by the
schema and reference types.
- **Restored `docs/context-reuse.md` §3** (Consent scopes and receipts), whose
normative text was dropped by the PR #38 merge — recovered from `d229ed9` and
reconnected to the C5/C6 requirements the schema and `consent-scope` check
already cite.
- **Host execution trace + replay oracles** (`contextgraph-trace`, sketch stage,
unpublished) — the host-side dual of the provider conformance suite. An
append-only NDJSON journal a harness (or a Harbor-adapter-style shim
Expand Down
8 changes: 4 additions & 4 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ contract — if it does any of the following:

- adds, removes, or renames a field in the wire types (`contextgraph-types`);
- changes a field's required-ness or its serialized name;
- adds or tightens a [conformance requirement](./docs/protocol-surface.md#conformance-requirements);
- changes the [version-compatibility rule](./docs/protocol-surface.md#version-strings); or
- adds or tightens a [conformance requirement](./SPEC.md) (the normative home; [protocol-surface.md](./docs/protocol-surface.md#conformance-requirements) mirrors it);
- changes the [version-compatibility rule](./SPEC.md) (SPEC.md §3.1); or
- changes the envelope vocabulary or framing.

A change is **non-normative** if it only touches host internals, documentation,
Expand Down Expand Up @@ -64,8 +64,8 @@ a removed or renamed field requires a new major family (`contextgraph/2`).
- **No blocking normative issues.** There are no open normative issues the
maintainer considers blocking.
- **Complete enforcement.** The conformance suite's checks are agreed to fully
enforce the documented
[conformance requirements](./docs/protocol-surface.md#conformance-requirements).
enforce the documented conformance requirements in [`SPEC.md`](./SPEC.md)
(indexed in [protocol-surface.md](./docs/protocol-surface.md#conformance-requirements)).

At the freeze, the `-draft` suffix is dropped, the crates move to `1.0.0` in
lockstep, and the major-family compatibility rule guarantees that
Expand Down
24 changes: 12 additions & 12 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Publishing the Context Graph Protocol crates to crates.io

This documents the release process for the three **Context Graph Protocol**
crates — `contextgraph-types`, `contextgraph-host`, `contextgraph-conformance` — to crates.io. It is
distinct from [`RELEASING.md`](./RELEASING.md), which covers the `stella`
binary's GitHub Releases / Homebrew pipeline; these crates are published
independently, on their own cadence, and are not part of that workflow.
crates — `contextgraph-types`, `contextgraph-host`, `contextgraph-conformance` — to crates.io. These
crates are published independently of any downstream consumer (such as the
`stella` binary), on their own cadence.

**Nobody has run these publish commands yet.** The workspace default is
`publish = false`; the three Context Graph Protocol crates override it explicitly (see their
Expand Down Expand Up @@ -46,8 +45,9 @@ This is also why local pre-publish verification is asymmetric:
## One-time prerequisites

1. A crates.io account with a verified email, linked to a GitHub account with
write access to `macanderson/stella` (or another account willing to transfer
ownership to the `macanderson` GitHub org's crates.io team once one exists).
write access to `macanderson/context-graph-protocol` (or another account
willing to transfer ownership to the `macanderson` GitHub org's crates.io
team once one exists).
2. `cargo login <token>` locally, using a crates.io API token scoped to
`publish-new` + `publish-update` (crates.io Account Settings → API
Tokens). Do not commit this token; it's not an env var this repo reads.
Expand Down Expand Up @@ -116,12 +116,12 @@ on crates.io before the next goes up.
&& cargo add contextgraph-types contextgraph-conformance` should resolve from the real
registry with no path override, and `cargo test` (after writing a trivial
conformance-suite invocation) should pass — proving "an external crate can
depend on `contextgraph-types` and pass `contextgraph-conformance` without vendoring stella"
(the issue's acceptance bar) against the *published* crates, not just the
workspace.
- Tag the release in this repo for traceability, e.g. `contextgraph-v0.1.0` (distinct
from the `stella` binary's `v<version>` tags in `RELEASING.md`, so the two
release trains don't collide in the tag namespace).
depend on `contextgraph-types` and pass `contextgraph-conformance` without
vendoring any downstream code" (the issue's acceptance bar) against the
*published* crates, not just the workspace.
- Tag the release in this repo for traceability, e.g. `contextgraph-v0.1.0`. Use
the `contextgraph-` tag prefix so the crate release train never collides with a
downstream consumer's own version tags in the tag namespace.

## This is a one-way door

Expand Down
Loading
Loading