diff --git a/README.md b/README.md index d4160b5..963c9de 100644 --- a/README.md +++ b/README.md @@ -1,118 +1,34 @@ -
+# Open CoT -Open CoT banner +Open CoT is **Cognitive Operations Theory**: a compact, schema-first standard for the boundary between cognition and execution. -### Schemas for Cognitive Artifacts, Capabilities, and Reconciliation +The model contributes a typed cognitive artifact. Runtime code validates, authorizes, executes endpoint capabilities, records observations, and reconciles final state. Reasoning remains important as evidence, but it is never authority. -**Open CoT** — an open standard for portable cognitive artifacts, capability snapshots, execution intent, observations, policy boundaries, receipts, and reconciliation results. +## Core RFCs -Open CoT -License: MIT -Contributions welcome -JSON Schema +The active RFC set is intentionally small and sequential: -
+1. Cognitive Artifact & Reasoning Evidence +2. Capability Snapshot & Endpoint Descriptor +3. Execution Intent & Endpoint Invocation +4. Policy Gate & Permission Evaluation +5. Observation, Receipt & Audit Evidence +6. Reconciliation Result & Error Taxonomy +7. Runtime Boundary & Cognitive Pipeline +8. Budget, Cost & Temporal Bounds +9. Requester Identity & Governance Context +10. Human Approval, Yield & Resume +11. Conformance, Registry & Compatibility Rules +12. Compact Context Serialization ---- +Schemas are embedded in the RFC markdown and generated into `schemas/` with `python3 tools/sync_schemas_from_rfcs.py`. -## Why This Exists - -Modern AI systems need a stable contract between fuzzy cognition and concrete capability. The model-like component can interpret, summarize, propose, and produce typed artifacts, but it must not own runtime authority or side effects. - -Open CoT defines the portable interface layer for that boundary: - -- what cognitive artifacts look like, -- how available capabilities are represented, -- how execution intent binds to an immutable capability snapshot, -- how policy, delegation, budget, and receipts are recorded, -- how observations and final reconciliation results are serialized. - -Earlier runtime-governance language was useful while the project was searching for the right security shape. The standard is now moving toward a sharper inversion: **cognition emits structured artifacts; runtimes reconcile those artifacts against capability, policy, budget, and evidence**. - -## The Core Insight - -The LLM is not the runtime, orchestrator, or authority boundary. It is a non-deterministic cognitive function. A runtime can use its output only after validation and reconciliation. - -**Cognition emits.** Schemas express. Capability snapshots bound what may be requested. Policy gates authorize or refuse. Runtimes execute through explicit endpoints. Observations, receipts, and reconciliation results prove what happened. - -This makes Open CoT useful beyond any one framework. An implementation can use Restate, Temporal, a queue worker, a local process, MCP, HTTP, or a custom executor. The portable layer is the schema contract, not the implementation stack. - -## What This Repo Contains - -| Area | Role | -|------|------| -| [`rfcs/`](./rfcs/) | **53 RFCs** covering reasoning traces, tool invocation, governed execution, policy, delegation, receipts, capability manifests, cognitive artifacts, and reconciliation results | -| [`schemas/`](./schemas/) | Versioned JSON Schemas per RFC, including `registry.json` | -| [`harness/`](./harness/) | Reference TypeScript core package that exercises earlier governed execution RFCs | -| [`examples/`](./examples/) | Validated instance fixtures keyed by registry shortname | -| [`reference/python/`](./reference/python/) | Reference Python tooling | -| [`tools/`](./tools/) | Schema and fixture validation, registry sync, and RFC helpers | -| [`standards/`](./standards/) | Human-readable reasoning patterns and evaluation metrics | -| [`datasets/`](./datasets/) | Conventions and converters for training-ready data | -| [`benchmarks/`](./benchmarks/) | Tasks, scoring, leaderboards | -| [`conformance/`](./conformance/) | Conformance and interoperability material | -| [`docs/`](./docs/) | Architecture, philosophy, contributing, experiments, and launch notes | - -For the current architecture framing, see [`docs/architecture.md`](./docs/architecture.md). - -## Forward Spine - -The newer reconciliation-oriented spine is: - -- **RFC 0052** — cognitive artifacts, execution intent, observations, and immutable capability snapshots. -- **RFC 0053** — reconciliation result envelope and structured error taxonomy. -- **RFC 0049** — capability manifests, now a predecessor to more precise capability snapshots. -- **RFC 0041** — policy documents and policy gate semantics. -- **RFC 0047** — delegation requests, decisions, and authority receipts. -- **RFC 0048** — execution receipts and audit envelopes. -- **RFC 0051** — temporal semantics for validity, replay, and ordering. - -Older RFCs still matter. RFC 0001, 0003, and 0007 define foundational reasoning, tool invocation, and governed execution concepts. The new RFCs clarify how those ideas become a portable schema layer for reconciliation runtimes. - -## Design Principles - -- **Typed artifacts over prompt contracts** — model output is structured input, not authority. -- **Capability snapshots over ambient tools** — cognition sees an explicit inventory and cannot invent endpoints. -- **Execution intent over direct execution** — proposed work is reconciled before side effects. -- **Policy gates over schema-only safety** — valid shape is not permission. -- **Observations and receipts over logs alone** — every side effect should leave replayable evidence. -- **Implementation neutrality** — Open CoT should not require Restate, MCP, Vercel AI SDK, Open Lagrange, or any specific runtime. -- **Spec gaps become RFC work** — if an implementation needs a general interface, it belongs here. - -## Quick Start - -Validate schemas and examples: - -```bash -python3 -m venv .venv && source .venv/bin/activate -pip install -r requirements-tools.txt -python tools/validate.py -``` - -Run the reference package: +## Validate ```bash -cd harness && npm install && npm test +python3 tools/sync_schemas_from_rfcs.py +python3 tools/validate.py +cd harness && npm test ``` -## Open Lagrange Relationship - -Open Lagrange is the opinionated TypeScript proving ground for this standard. It uses Restate for durable reconciliation, Zod for runtime boundaries, Vercel AI SDK for structured cognitive artifact generation, and MCP-shaped endpoints for side effects. - -That implementation pressure-tests Open CoT. If Open Lagrange needs a portable structure, this repo should receive the RFC/schema update instead of letting a private dialect grow elsewhere. - -## Current Status - -- **53 RFCs** and a versioned JSON Schema registry. -- New draft schemas for cognitive artifacts and reconciliation results. -- Reference package coverage for governed execution, policy, delegation, receipts, budgets, and capability manifests. -- Cross-language validation tooling for schemas and examples. -- Experiment cards and local runbooks under [`docs/experiments/`](./docs/experiments/). - -## Contributing - -See [`docs/contributing.md`](./docs/contributing.md). Normative changes belong in RFCs first; implementations should follow the spec and feed gaps back into it. - -## License - -This project is licensed under the **MIT License**. See [`LICENSE`](./LICENSE). +Open Lagrange is the opinionated implementation proving this interface under durable execution, policy gates, endpoint execution, and reconciliation. diff --git a/conformance/fixtures/fixture_matrix.json b/conformance/fixtures/fixture_matrix.json index e6000cd..2838ae0 100644 --- a/conformance/fixtures/fixture_matrix.json +++ b/conformance/fixtures/fixture_matrix.json @@ -1,30 +1,17 @@ { - "version": "0.1.0", "profiles": { - "A": [ + "core": [ { - "shortname": "reasoning", - "path": "conformance/fixtures/profile_a/reasoning.json" - } - ], - "B": [ - { - "shortname": "reasoning", - "path": "conformance/fixtures/profile_b/reasoning.json" + "shortname": "cognitive_artifact", + "path": "conformance/fixtures/profile_core/cognitive_artifact.json" }, { - "shortname": "tool_invocation", - "path": "conformance/fixtures/profile_b/tool_invocation.json" + "shortname": "capability_snapshot", + "path": "conformance/fixtures/profile_core/capability_snapshot.json" }, { - "shortname": "verifier_output", - "path": "conformance/fixtures/profile_b/verifier_output.json" - } - ], - "C": [ - { - "shortname": "dataset_packaging", - "path": "conformance/fixtures/profile_c/manifest.json" + "shortname": "reconciliation_result", + "path": "conformance/fixtures/profile_core/reconciliation_result.json" } ] } diff --git a/conformance/fixtures/profile_a/reasoning.json b/conformance/fixtures/profile_a/reasoning.json deleted file mode 100644 index 88fb40e..0000000 --- a/conformance/fixtures/profile_a/reasoning.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "0.1", - "task": "Compute 9 * 8.", - "steps": [ - { - "id": "s1", - "type": "calculation", - "content": "9 * 8 = 72" - } - ], - "final_answer": "72" -} diff --git a/conformance/fixtures/profile_b/reasoning.json b/conformance/fixtures/profile_b/reasoning.json deleted file mode 100644 index 8027a35..0000000 --- a/conformance/fixtures/profile_b/reasoning.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "0.1", - "task": "What is 17 * 23?", - "steps": [ - { - "id": "s1", - "type": "thought", - "content": "Break 23 into 20 + 3." - }, - { - "id": "s2", - "type": "calculation", - "content": "17 * 20 = 340", - "parent": "s1" - }, - { - "id": "s3", - "type": "calculation", - "content": "17 * 3 = 51", - "parent": "s1" - } - ], - "final_answer": "391" -} diff --git a/conformance/fixtures/profile_b/tool_invocation.json b/conformance/fixtures/profile_b/tool_invocation.json deleted file mode 100644 index 59613c0..0000000 --- a/conformance/fixtures/profile_b/tool_invocation.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "tool_name": "search", - "arguments": { - "query": "population of Tokyo" - }, - "result": { - "output": { - "population": 13960000 - } - }, - "triggered_by_step": "s1", - "observation_step": "s2" -} diff --git a/conformance/fixtures/profile_b/verifier_output.json b/conformance/fixtures/profile_b/verifier_output.json deleted file mode 100644 index 3b0cde5..0000000 --- a/conformance/fixtures/profile_b/verifier_output.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "0.1", - "trace_id": "trace_001", - "verifier": "symbolic_math_v1", - "results": [ - { - "step_id": "s2", - "correct": "true", - "confidence": 0.99 - } - ] -} diff --git a/conformance/fixtures/profile_c/manifest.json b/conformance/fixtures/profile_c/manifest.json deleted file mode 100644 index 9b76b29..0000000 --- a/conformance/fixtures/profile_c/manifest.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "0.1", - "name": "conformance-fixture-dataset", - "description": "Minimal profile C fixture for Open CoT conformance checks.", - "schemas": { - "reasoning": "0.1", - "verifier_output": "0.1", - "tool_invocation": "0.1", - "branching": "0.1", - "reward": "0.1", - "ensemble": "0.1" - }, - "counts": { - "traces": 1, - "verifier_outputs": 1, - "ensembles": 0, - "rewards": 0 - }, - "splits": [ - "train", - "validation", - "test" - ], - "created_at": "2026-04-14T00:00:00Z", - "license": "MIT" -} diff --git a/conformance/fixtures/profile_core/capability_snapshot.json b/conformance/fixtures/profile_core/capability_snapshot.json new file mode 100644 index 0000000..41e12f8 --- /dev/null +++ b/conformance/fixtures/profile_core/capability_snapshot.json @@ -0,0 +1,18 @@ +{ + "snapshot_id": "snapshot-1", + "created_at": "2026-04-27T15:00:00Z", + "capabilities_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "capabilities": [ + { + "endpoint_id": "repo-status", + "capability_name": "status", + "description": "Read repository status.", + "input_schema": { + "type": "object" + }, + "risk_level": "read", + "requires_approval": false, + "capability_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] +} diff --git a/conformance/fixtures/profile_core/cognitive_artifact.json b/conformance/fixtures/profile_core/cognitive_artifact.json new file mode 100644 index 0000000..08ba221 --- /dev/null +++ b/conformance/fixtures/profile_core/cognitive_artifact.json @@ -0,0 +1,39 @@ +{ + "artifact_id": "artifact-1", + "schema_version": "open-cot.core.v1", + "capability_snapshot_id": "snapshot-1", + "intent_verification": { + "objective": "Summarize repository status.", + "request_boundaries": [ + "read-only" + ], + "allowed_scope": [ + "inspect files" + ], + "prohibited_scope": [ + "write files" + ] + }, + "reasoning_trace": { + "evidence_mode": "audit_summary", + "summary": "The request is read-only and can use the repository status endpoint.", + "steps": [ + { + "step_id": "r1", + "kind": "interpretation", + "content": "Classified as read-only inspection.", + "visibility": "audit_summary", + "confidence": 0.9 + } + ] + }, + "assumptions": [ + "Repository access is available." + ], + "execution_intents": [], + "observations": [], + "uncertainty": { + "level": "low", + "explanation": "The requested operation is narrow." + } +} diff --git a/conformance/fixtures/profile_core/reconciliation_result.json b/conformance/fixtures/profile_core/reconciliation_result.json new file mode 100644 index 0000000..6719c58 --- /dev/null +++ b/conformance/fixtures/profile_core/reconciliation_result.json @@ -0,0 +1,89 @@ +{ + "reconciliation_id": "recon-1", + "status": "completed", + "capability_snapshot": { + "snapshot_id": "snapshot-1", + "created_at": "2026-04-27T15:00:00Z", + "capabilities_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "capabilities": [ + { + "endpoint_id": "repo-status", + "capability_name": "status", + "description": "Read repository status.", + "input_schema": { + "type": "object" + }, + "risk_level": "read", + "requires_approval": false, + "capability_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] + }, + "artifact": { + "artifact_id": "artifact-1", + "schema_version": "open-cot.core.v1", + "capability_snapshot_id": "snapshot-1", + "intent_verification": { + "objective": "Summarize repository status.", + "request_boundaries": [ + "read-only" + ], + "allowed_scope": [ + "inspect files" + ], + "prohibited_scope": [ + "write files" + ] + }, + "reasoning_trace": { + "evidence_mode": "audit_summary", + "summary": "The request is read-only and can use the repository status endpoint.", + "steps": [ + { + "step_id": "r1", + "kind": "interpretation", + "content": "Classified as read-only inspection.", + "visibility": "audit_summary", + "confidence": 0.9 + } + ] + }, + "assumptions": [ + "Repository access is available." + ], + "execution_intents": [], + "observations": [], + "uncertainty": { + "level": "low", + "explanation": "The requested operation is narrow." + } + }, + "executed_intents": [ + { + "intent_id": "intent-1", + "snapshot_id": "snapshot-1", + "endpoint_id": "repo-status", + "capability_name": "status", + "capability_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "risk_level": "read", + "requires_approval": false, + "idempotency_key": "idem-1", + "arguments": {} + } + ], + "skipped_intents": [], + "observations": [ + { + "observation_id": "obs-1", + "intent_id": "intent-1", + "status": "recorded", + "summary": "Repository status was read.", + "output": { + "clean": true + }, + "observed_at": "2026-04-27T15:00:00Z" + } + ], + "errors": [], + "final_message": "Completed read-only inspection." +} diff --git a/docs/architecture.md b/docs/architecture.md index 765104e..dba3901 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,82 +1,14 @@ # Architecture -Open CoT is a portable schema layer for reconciling non-deterministic cognition with concrete capability. +Open CoT defines a stable interface between non-deterministic cognition and deterministic execution. -It does not require a particular runtime, model provider, endpoint protocol, storage backend, or workflow engine. It defines the artifacts that let those systems coordinate safely. +## Boundary -## Cognitive Layer vs Runtime Layer +- Cognition emits a `cognitive_artifact`. +- The artifact references a `capability_snapshot`. +- Requested work is expressed as `execution_intent`. +- Runtime code applies a `policy_gate`, budget bounds, and schema validation. +- Endpoint results become observations and receipts. +- The run ends with a `reconciliation_result`. -| Cognitive layer | Runtime layer | -|-----------------|---------------| -| Emits a typed cognitive artifact | Validates and reconciles that artifact | -| Sees a capability snapshot | Discovers and signs capability inventory | -| Proposes execution intent | Applies policy, budget, and preconditions | -| Produces explanatory reasoning trace | Treats trace as audit material, not proof | -| Consumes observations | Executes endpoints and records receipts | - -The boundary is intentionally asymmetric. Cognition may propose. Runtime reconciles. - -## Core Data Flow - -The current forward path is: - -`Capability discovery` → **Capability Snapshot** → `Cognitive step` → **Cognitive Artifact** → `Runtime validation` → `Policy gate` → `Endpoint execution` → **Observation** → **Reconciliation Result** → `Receipts / audit`. - -The cognitive step receives only the capability snapshot and prior observations. It does not receive ambient authority, live tool handles, filesystem access, credentials, or transport configuration. - -## Primary Artifacts - -1. **Capability Snapshot** — Immutable inventory of available endpoints. Each capability carries server name, capability name, JSON-schema-compatible input shape, optional output shape, risk level, approval requirement, and stable digest. -2. **Cognitive Artifact** — Structured proposal emitted by a model-like component. It includes intent verification, assumptions, reasoning trace, execution intent, uncertainty, observations, and optional yield reason. -3. **Execution Intent** — A requested endpoint action bound to a specific snapshot ID and capability digest. -4. **Policy Gate Result** — Runtime authorization result. Shape validation does not imply permission. -5. **Observation** — Structured record of endpoint output, skipped work, validation failure, or policy refusal. -6. **Reconciliation Result** — Final envelope describing completed, yielded, approval-required, failed, or completed-with-errors outcomes. -7. **Receipts and Audit Envelopes** — Integrity-backed execution and lifecycle evidence from RFC 0048 and related RFCs. - -## Trust Boundaries - -| Source | May supply | Must not supply | -|--------|------------|-----------------| -| Cognitive function | Structured artifact, execution intent, assumptions, explanation | Authority, forged receipts, endpoints outside the snapshot | -| Runtime | Validation, reconciliation, policy gates, endpoint dispatch, observations | Silent policy bypass, hidden side effects | -| Policy layer | Allow, deny, narrow, approval, yield semantics | Direct endpoint side effects | -| Endpoint executor | Endpoint output, errors, metadata | Expanded authority or altered snapshot semantics | -| Audit layer | Integrity and replay evidence | Retroactive mutation of prior artifacts | - -## Validation Order - -A conforming reconciliation runtime should evaluate execution intent in this order: - -1. Validate the cognitive artifact shape. -2. Confirm the referenced snapshot ID. -3. Confirm endpoint server and capability names exist in the snapshot. -4. Confirm the capability digest. -5. Validate arguments against the original capability input schema. -6. Apply policy gates. -7. Check approval requirements, risk, budget, and preconditions. -8. Execute the endpoint through the runtime boundary. -9. Validate endpoint result shape when available. -10. Record observation, receipt, and reconciliation result. - -## Normative vs Reference - -- **Normative:** RFC text and JSON Schemas under `schemas/`. -- **Reference:** TypeScript harness, Python helpers, examples, and downstream implementations such as Open Lagrange. - -Open Lagrange is an opinionated implementation: Restate for durable execution, Zod for runtime validation, Vercel AI SDK for structured generation, and MCP-shaped endpoint execution. Those choices prove the standard under pressure, but they are not required by Open CoT. - -## RFC Map - -- **RFC 0052** — Cognitive artifact and capability snapshot. -- **RFC 0053** — Reconciliation result and error taxonomy. -- **RFC 0049** — Capability manifest precursor and model-facing capability projection. -- **RFC 0041** — Policy documents and policy gate inputs. -- **RFC 0047** — Delegation and authority material. -- **RFC 0048** — Execution receipts and audit envelopes. -- **RFC 0051** — Temporal semantics, validity, replay, and ordering. -- **RFC 0001 / 0003 / 0007** — Foundational reasoning, tool invocation, and governed execution lineage. - -## Closing Note - -The standard should make implementations interchangeable at the artifact boundary. If a runtime discovers a missing portable concept, that concept should become an Open CoT RFC/schema change rather than a private extension. +Reasoning is evidence for audit and review. It cannot grant permission, execute endpoints, or override policy. diff --git a/docs/conformance-fixtures.md b/docs/conformance-fixtures.md index 8168672..fcd6668 100644 --- a/docs/conformance-fixtures.md +++ b/docs/conformance-fixtures.md @@ -1,6 +1,6 @@ # Conformance Fixtures -Open CoT includes executable fixtures aligned to profile levels from RFC 0046. +Open CoT includes executable fixtures aligned to the compact core conformance profile. ## Fixture Matrix @@ -13,9 +13,8 @@ python3 tools/check_conformance_fixtures.py ## Profiles -- **Profile A** (`conformance/fixtures/profile_a`): core reasoning trace validation -- **Profile B** (`conformance/fixtures/profile_b`): reasoning + tool invocation + verifier output -- **Profile C** (`conformance/fixtures/profile_c`): dataset packaging manifest +- **Core profile** (`conformance/fixtures/profile_core`): cognitive artifact, + capability snapshot, and reconciliation result validation. ## Why this exists @@ -25,4 +24,4 @@ These fixtures provide stable, versioned examples for: - quickstart validation - downstream implementation testing -This keeps profile claims auditable and reduces ambiguity for adopters integrating Open CoT in training/evaluation pipelines. +This keeps profile claims auditable and reduces ambiguity for adopters integrating Open CoT at runtime boundaries. diff --git a/docs/contributing.md b/docs/contributing.md index b81b84e..38ce9f3 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1,88 +1,15 @@ # Contributing -Thank you for helping improve open-cot. +Open CoT accepts changes that strengthen the compact Cognitive Operations Theory core. -## Principles +## Required Pattern -- Prefer changes that align with `schemas/rfc-0001-reasoning.json` (RFC 0001) or propose a schema bump with clear migration notes. -- Keep benchmark tasks and scoring reproducible; document expected inputs and outputs. -- Match existing tone and structure in docs under `docs/` and `standards/`. +- Update the RFC markdown first. +- Embed normative JSON Schema inside `` and `` markers. +- Run `python3 tools/sync_schemas_from_rfcs.py` and commit generated schemas. +- Add or update a valid example under `examples//`. +- Run `python3 tools/validate.py`. -## Naming and versioning contract +## Scope -Open CoT uses three naming layers; keep them distinct and intentional: - -1. **RFC prose id**: `rfcs/NNNN-*.md` (exactly one file per id). -2. **Registry shortname**: canonical integration identifier in `schemas/registry.json` (snake_case). -3. **Schema artifact file**: `schemas/rfc-NNNN-.json` (slug may differ from shortname for legacy ids). - -Rules: - -- `examples//` MUST use the exact registry shortname from `schemas/registry.json`. -- Additions or renames should update `tools/schema_lib.py` (`RFC_SHORTNAME` and, if needed, `RFC_FILE_SLUG`). -- Tier A compatibility scope is RFC 0001-0008. A stricter extraction subset currently applies to RFC 0001-0006, which require explicit schema markers in RFC prose: - - `` - - `` - -Registry semver policy: - -- **major**: backward-incompatible schema semantics. -- **minor**: new optional schema/features. -- **patch**: docs/examples/tooling-only or non-semantic changes. - -Version taxonomy: - -- **Registry version** (`schemas/registry.json`): version of the published schema set. -- **Schema instance version** (for example, trace `version: "0.1"`): version of individual documents validated by a schema. -- **Dataset/benchmark manifest versions**: package/spec versions for data and task bundles. - -## Suggested workflow - -1. For RFC feedback, use the RFC's linked **GitHub Discussion** thread as the canonical conversation channel. -2. Use GitHub **Issues** for actionable implementation work (bugs, tasks, follow-ups), not normative RFC discussion. -3. For RFC-changing PRs, link both the RFC file and its discussion thread in the PR description. - - Discover discussion threads quickly: `docs/rfc-discussions.md`. -4. Use small, focused pull requests with a short description of intent and impact. -5. Add or update **validated** JSON examples under `examples//` (see `schemas/registry.json`) when you change a schema; keep narrative examples under `standards/` when appropriate. - -## Contribution paths - -Choose the smallest path that matches your goal: - -1. **Quick docs fix (novice-friendly)**: improve wording, broken links, examples, or readability in `README.md` / `docs/`. -2. **Add one example fixture**: add a valid JSON fixture under `examples//` and run `python3 tools/validate.py`. -3. **Add one experiment card**: add/update docs under `docs/experiments/` with command + metrics + failure modes. -4. **Advanced schema/RFC change**: update RFC prose + sync schemas + fixtures + migration notes if needed. - -Tier context: - -- Tier A compatibility scope: RFC 0001-0008. -- Tier C items should be promoted only with a consumer-backed vertical slice. - -## Project lanes (required artifacts) - -| Lane | Purpose | Minimum artifact set | -|------|---------|----------------------| -| **Spec lane** | RFCs, schemas, examples, validation | RFC update + `sync_schemas` output + `examples//` fixture + passing `validate.py` | -| **Data lane** | Synthetic/human/converter datasets | Dataset README/manifest + provenance/license notes + schema target declaration | -| **Harness lane** | Mock execution and loop behavior | Deterministic harness code + tests + schema-valid outputs | -| **Benchmark lane** | Reproducible scoring and reporting | Task spec + scorer + run card (model, seed, decoding config) | -| **Model lane** | Demo model prove-outs | Reproducible experiment config + outputs + validation report | - -## Schemas, RFCs, validation, and hooks - -- After editing `rfcs/*.md`, run `python3 tools/sync_schemas_from_rfcs.py` and commit everything under `schemas/`. -- Run `python3 tools/validate.py` before pushing (or rely on CI). This now enforces: - - schema syntax and `$ref` resolution, - - registry/shortname example folder matching, - - minimum Tier A fixture coverage, - - Profile A/B/C conformance checks. -- For schema evolution review, run: - - `python3 tools/diff_checker.py --strict --min-severity major` -- `tools/diff_checker.py` severities (`major`/`minor`/`patch`) indicate schema-diff impact, and should inform (but are not identical to) registry semver decisions. -- Optional: install [pre-commit](https://pre-commit.com) and run `pre-commit install`. Hooks run `tools/validate.py` and ensure `schemas/` stays in sync with the RFC extractors. -- Pull requests that touch `schemas/` run semantic diff checks (`tools/diff_checker.py` vs PR base branch). Tightening constraints should include migration notes in the RFC or changelog. -- Major-impact schema changes MUST include migration notes and expected upgrade path. -- RFC lifecycle guidance is documented in `docs/governance-rfc-lifecycle.md`. -- Update `CHANGELOG.md` when user-visible behavior, schema semantics, public workflows, or release-facing docs change. -- See `RELEASE_CHECKLIST.md` and `docs/maintainers.md` for release/maintainer workflow. +Runtime-boundary interfaces belong here. Training datasets, reward modeling, benchmark execution, and model adaptation should become separate projects or future extensions after the core stabilizes. diff --git a/docs/experiments/README.md b/docs/experiments/README.md index b887d23..08d8c38 100644 --- a/docs/experiments/README.md +++ b/docs/experiments/README.md @@ -1,24 +1,20 @@ -# Experiment Cards (Ideas to Chew On) +# Experiment Cards -These cards are designed for quick, reproducible community experiments around reasoning transparency, control, and safety. +Experiment cards are paused during the compact core reset. -Each card includes: +Future cards should target the current Open CoT runtime-boundary contract: -- hypothesis -- relevant RFC/schema artifacts -- runnable commands -- metrics to report -- expected failure modes +- cognitive artifacts +- capability snapshots +- execution intents +- policy gates +- observations +- reconciliation results -## Cards +Each card should include the hypothesis, referenced RFCs, runnable commands, +metrics to report, and expected failure modes. -- `encrypted_reasoning_observability.md` -- `runaway_loop_detection.md` -- `token_budget_enforcement.md` -- `adversarial_tool_misbehavior.md` -- `policy_constrained_execution.md` - -When reporting results, open an issue using the `experiment-feedback.yml` template and attach: +When reporting results, attach: - config used - output artifact hashes diff --git a/docs/experiments/adversarial_tool_misbehavior.md b/docs/experiments/adversarial_tool_misbehavior.md deleted file mode 100644 index a3eda02..0000000 --- a/docs/experiments/adversarial_tool_misbehavior.md +++ /dev/null @@ -1,29 +0,0 @@ -# Adversarial Tool Misbehavior Stress Test - -## Hypothesis - -Structured tool invocation and error taxonomy reduce catastrophic failure propagation under adversarial or flaky tool responses. - -## Required RFC/schema artifacts - -- `schemas/rfc-0003-tool.json` -- `schemas/rfc-0018-tool-error-taxonomy.json` -- `schemas/rfc-0041-policy-enforcement.json` - -## Run command - -```bash -python experiments/factory/eval_pre_post.py --tasks benchmarks/tasks/task_specs.json --output-dir experiments/runs/tool_card --use-mock --split test -``` - -## Metrics to report - -- tool error categorization coverage -- recovery success rate after injected tool failures -- rate of unsafe tool retries - -## Expected failure modes - -- untyped error blobs that bypass policy checks -- invalid tool arguments causing repeated failures -- answer hallucination after tool failure diff --git a/docs/experiments/encrypted_reasoning_observability.md b/docs/experiments/encrypted_reasoning_observability.md deleted file mode 100644 index 9e0332f..0000000 --- a/docs/experiments/encrypted_reasoning_observability.md +++ /dev/null @@ -1,30 +0,0 @@ -# Encrypted/Hidden Reasoning Observability - -## Hypothesis - -If models hide internal reasoning, enforcing RFC0001 structured traces with verifier sidecars still provides useful observability. - -## Required RFC/schema artifacts - -- `schemas/rfc-0001-reasoning.json` -- `schemas/rfc-0002-verifier.json` -- `schemas/rfc-0007-cognitive-pipeline.json` - -## Run command - -```bash -bash scripts/quickstart_experiment.sh -python experiments/factory/eval_pre_post.py --tasks benchmarks/tasks/task_specs.json --output-dir experiments/runs/obs_card --use-mock --split test -``` - -## Metrics to report - -- schema validity rate -- step_validity_proxy -- proportion of traces with minimally interpretable reasoning steps - -## Expected failure modes - -- empty or generic step content while final answer is correct -- non-actionable verifier outputs -- model outputs that avoid structured reasoning even when prompted diff --git a/docs/experiments/policy_constrained_execution.md b/docs/experiments/policy_constrained_execution.md deleted file mode 100644 index 1ce7dc1..0000000 --- a/docs/experiments/policy_constrained_execution.md +++ /dev/null @@ -1,29 +0,0 @@ -# Policy-Constrained Execution - -## Hypothesis - -Applying policy enforcement and ethical constraints at run time catches unsafe behavior before irreversible actions occur. - -## Required RFC/schema artifacts - -- `schemas/rfc-0041-policy-enforcement.json` -- `schemas/rfc-0045-ethics.json` -- `schemas/rfc-0043-auditing-compliance-logs.json` - -## Run command - -```bash -python experiments/factory/eval_pre_post.py --tasks benchmarks/tasks/task_specs.json --output-dir experiments/runs/policy_card --use-mock --split test -``` - -## Metrics to report - -- policy violation detection rate -- blocked action precision (true unsafe vs false positive) -- audit log completeness - -## Expected failure modes - -- missing policy context on tool calls -- ethics constraints not propagated into decisions -- silent allow of disallowed actions diff --git a/docs/experiments/runaway_loop_detection.md b/docs/experiments/runaway_loop_detection.md deleted file mode 100644 index f79ee37..0000000 --- a/docs/experiments/runaway_loop_detection.md +++ /dev/null @@ -1,29 +0,0 @@ -# Runaway Reasoning Loop Detection - -## Hypothesis - -Loop-level guardrails can prevent infinite/redundant reasoning traces without collapsing answer quality. - -## Required RFC/schema artifacts - -- `schemas/rfc-0007-cognitive-pipeline.json` -- `schemas/rfc-0017-cognitive-pipeline-safety-sandboxing.json` -- `schemas/rfc-0038-cost-aware-reasoning-budget.json` - -## Run command - -```bash -python experiments/factory/eval_pre_post.py --tasks benchmarks/tasks/task_specs.json --output-dir experiments/runs/loop_card --use-mock --split test -``` - -## Metrics to report - -- average steps per trace -- number of repeated step patterns -- termination reason distribution - -## Expected failure modes - -- repetitive thought loops -- missing explicit termination -- excessive token/step growth on simple tasks diff --git a/docs/experiments/token_budget_enforcement.md b/docs/experiments/token_budget_enforcement.md deleted file mode 100644 index 080fb94..0000000 --- a/docs/experiments/token_budget_enforcement.md +++ /dev/null @@ -1,29 +0,0 @@ -# Token Budget Enforcement - -## Hypothesis - -Explicit token/step budgets improve predictability and cost control while maintaining acceptable answer quality. - -## Required RFC/schema artifacts - -- `schemas/rfc-0038-cost-aware-reasoning-budget.json` -- `schemas/rfc-0039-tool-cost-modeling.json` -- `schemas/rfc-0040-multi-party-economic-incentives.json` - -## Run command - -```bash -python experiments/factory/eval_pre_post.py --tasks benchmarks/tasks/task_specs.json --output-dir experiments/runs/budget_card --use-mock --split test -``` - -## Metrics to report - -- completion under budget rate -- final_answer_exact vs baseline -- schema validity under constrained decoding - -## Expected failure modes - -- premature truncation causing wrong final answers -- hidden over-budget behavior not reflected in traces -- budget policy mismatches between components diff --git a/docs/experiments/toon_format_efficiency.md b/docs/experiments/toon_format_efficiency.md deleted file mode 100644 index dc426ae..0000000 --- a/docs/experiments/toon_format_efficiency.md +++ /dev/null @@ -1,111 +0,0 @@ -# Experiment Card: TOON Format Token Efficiency - -**RFC:** [0050 — TOON Adapter](../../rfcs/0050-toon-adapter.md) -**Status:** Planned -**Related schemas:** `capability_manifest`, `reasoning`, `tool_invocation` - ---- - -## Hypothesis - -TOON (Token-Oriented Object Notation) reduces model-facing token consumption by 20–40% compared to equivalent JSON for structured harness payloads, without degrading parse success rate or task completion quality. The savings should be most pronounced for schemas with uniform arrays of objects (tool lists, reasoning steps) and least for flat scalar objects. - -## Background - -Published research supports the hypothesis: - -- arXiv 2603.03306 reports TOON's efficiency follows a non-linear curve — advantageous beyond a structural complexity threshold. -- arXiv 2604.05865 (JTON) reports 15–60% reduction with 100% syntactic validity across 12 LLMs. -- ATON V2 whitepaper reports 56% reduction vs JSON. - -The harness already uses hand-coded compact text for capability manifests (~200 tokens for a five-tool profile). This experiment measures whether the general-purpose TOON adapter achieves comparable or better efficiency while being reusable across schemas. - -## Method - -### 1. Static token count comparison - -For each schema in the fixture set, serialize the same object as: - -- **(a)** Pretty JSON (`JSON.stringify(obj, null, 2)`) -- **(b)** Minified JSON (`JSON.stringify(obj)`) -- **(c)** Compact text (where available — currently only capability manifest) -- **(d)** TOON (`toToon(obj, schema)`) - -Measure token count using `tiktoken` (cl100k_base for GPT-4 class, o200k_base for GPT-4o class). Report absolute counts and percentage reduction vs (a) and (b). - -### 2. Round-trip validation - -For each fixture, verify: `fromToon(toToon(obj, schema), schema)` deeply equals `obj` and validates against the JSON Schema via Ajv. - -### 3. Model generation test (live) - -Prompt a model (at least one small 7B–13B, one large GPT-4 class) to generate TOON output given: - -- A TOON header + 1-shot example -- A natural language instruction - -Measure: - -- **Parse success rate:** Does `fromToon` produce a valid object? -- **Repair loops:** How many re-prompts needed for a valid parse? -- **Token consumption:** prompt + completion tokens per successful generation. - -### 4. End-to-end cognitive pipeline run - -Run the governed cognitive pipeline demo with `wireFormat: "toon"` vs `wireFormat: "compact-text"` vs `wireFormat: "json"` on the same objective. Compare: - -- Total prompt tokens across all LLM calls -- Total completion tokens -- Task success (same final answer quality) -- Number of wasted delegation cycles - -## Fixture set - -| Schema | Description | Expected TOON advantage | -|--------|-------------|------------------------| -| `capability_manifest` | 5 tools, 1 blocked, medium trust, 2 constraints | Moderate (tabular tool list) | -| `reasoning` (5 steps) | Multi-step reasoning trace | High (uniform step array) | -| `tool_invocation` | Single tool call with nested arguments | Low (mostly flat) | -| `reasoning` (15 steps) | Long reasoning trace | Very high (amortized header cost) | - -Fixture files: [`examples/toon/`](../../examples/toon/) - -## Metrics - -| Metric | Unit | Collection | -|--------|------|-----------| -| Token count (prompt side) | integer | tiktoken on serialized string | -| Token count (completion side) | integer | API response or tiktoken | -| Reduction vs JSON (pretty) | percentage | `(json_tokens - toon_tokens) / json_tokens * 100` | -| Reduction vs JSON (minified) | percentage | same formula | -| Parse success rate | percentage | `fromToon` success / total attempts | -| Repair loop count | integer | re-prompts until valid parse | -| Task completion rate | percentage | cognitive pipeline runs with correct final answer | -| Total tokens per successful run | integer | sum of all LLM calls | - -## Expected failure modes - -- TOON parse failures on model output with misaligned pipes or missing fields. -- Small models (7B) may struggle with the TOON header convention without fine-tuning. -- The "prompt tax" (arXiv 2603.03306) — instructional overhead for TOON may negate savings on very small payloads. - -## Run commands - -```bash -# Static comparison (once fixture scripts are ready) -npx tsx harness/examples/toon-benchmark.ts - -# Governed cognitive pipeline with TOON -WIRE_FORMAT=toon npx tsx harness/examples/governed-pipeline-demo.ts - -# Governed cognitive pipeline with compact-text (baseline) -WIRE_FORMAT=compact-text npx tsx harness/examples/governed-pipeline-demo.ts -``` - -## Success criteria - -- TOON achieves at least 20% token reduction vs minified JSON for the capability manifest fixture. -- TOON achieves at least 30% token reduction vs minified JSON for multi-step reasoning traces. -- Round-trip validation passes for 100% of fixtures. -- Parse success rate on model-generated TOON is at least 90% for GPT-4 class models without repair loops. -- No regression in task completion quality when governed cognitive pipeline uses `wireFormat: "toon"`. diff --git a/docs/governance-rfc-lifecycle.md b/docs/governance-rfc-lifecycle.md index 6748871..ed613ac 100644 --- a/docs/governance-rfc-lifecycle.md +++ b/docs/governance-rfc-lifecycle.md @@ -1,31 +1,17 @@ # RFC Lifecycle Governance -Open CoT uses this lifecycle for RFCs: +Open CoT now keeps only active core RFCs in `rfcs/`. -1. `draft` -2. `implementation_required` -3. `stable` -4. `superseded` or `archived` +## States -## Label semantics +- `draft`: active proposal in the compact core. +- `stable`: accepted core contract with generated schema and examples. +- `archived`: removed from the active tree and retained only in Git history. -- **draft**: idea/proposal stage; may not have complete schema coverage. -- **implementation_required**: accepted direction, must ship schema artifacts + examples + consumer path. -- **stable**: production-ready contract for the targeted tier. -- **superseded**: replaced by newer RFC; include replacement links. -- **archived**: inactive and not promoted. +## Reset Rule -## Promotion expectations +The core reset is intentionally breaking. Removed RFCs are not compatibility targets, and missing RFC numbers should not remain in the active set. Renumbering is allowed when the active core is reset. -- Tier A promotion to `stable` requires: - - deterministic sync output, - - conformance profile coverage, - - migration notes for major schema changes. +## Schema Rule -## Deprecation notes - -When superseding an RFC, document: - -- replacement RFC id(s), -- compatibility impact, -- migration path and timeline. +Normative schemas MUST be embedded in RFC markdown between `opencot:schema` markers. Generated files in `schemas/` are derived artifacts. diff --git a/docs/philosophy.md b/docs/philosophy.md index ab7ad8d..52c3d13 100644 --- a/docs/philosophy.md +++ b/docs/philosophy.md @@ -1,39 +1,7 @@ # Philosophy -Open CoT exists to make the boundary between cognition and capability portable. +Open CoT is Cognitive Operations Theory. -The model-like component is useful because it can interpret, compress, explain, and propose. It is not useful as an authority boundary. Open CoT treats its output as a cognitive artifact: structured, inspectable, and untrusted until a runtime reconciles it against capability, policy, budget, and evidence. +A model is a fuzzy cognitive function, not the runtime boundary. The useful abstraction is not a personality or a worker. It is an API-shaped cognitive participant whose output must be validated and reconciled before anything happens. -## Principles - -### Typed artifacts over ambiguous prose - -Every serious boundary should be expressed as JSON Schema: cognitive artifact, capability snapshot, execution intent, policy material, observation, receipt, and reconciliation result. Natural language can explain context; it cannot grant permission. - -### Capability snapshots over ambient access - -Cognition receives an explicit snapshot of available endpoints. The snapshot binds endpoint names, input shape, risk, approval requirement, and digest. Requests outside that snapshot are invalid. - -### Execution intent is not execution - -An execution intent is a proposal. A runtime must validate shape, snapshot identity, capability digest, arguments, policy, risk, approval, budget, and preconditions before side effects occur. - -### Policy is separate from validation - -Zod, JSON Schema, or any other validator can prove shape. They cannot prove permission. Policy gates are separate artifacts and should leave their own evidence. - -### Observations over transcript trust - -Endpoint output becomes an observation. Observations are structured runtime records, not loose transcript text. They can carry result data, skipped work, validation failures, policy refusals, and reconciliation errors. - -### Reconciliation over orchestration by text - -The runtime owns progression. The cognitive step emits an artifact, then yields to the runtime boundary. This keeps retries, crash recovery, endpoint execution, and audit in deterministic code. - -### Implementation pressure should improve the standard - -Open Lagrange is a proving ground, not a competing dialect. If it needs a portable structure, Open CoT should gain or refine an RFC/schema. Runtime-specific choices stay local; reusable interfaces belong here. - -### Backward compatibility without freezing vocabulary - -Earlier RFCs use historical terms from the project’s transitional period. Those documents remain part of the record. New work should prefer cognition, capability, execution intent, observation, policy gate, runtime boundary, and reconciliation terminology. +The standard therefore focuses on typed artifacts, capability scope, execution intent, policy gates, observations, and reconciliation. Training, reward modeling, benchmark packaging, and model adaptation are important, but they are not part of this core repository reset. diff --git a/docs/rfc-discussion-index.json b/docs/rfc-discussion-index.json index 73236a5..bcfc21f 100644 --- a/docs/rfc-discussion-index.json +++ b/docs/rfc-discussion-index.json @@ -1,325 +1,79 @@ { "repository": "supernovae/open-cot", "category_slug": "ideas", - "count": 53, + "count": 12, "rfcs": { "0001": { - "rfc_title": "Initial Structured Reasoning Schema", - "rfc_path": "rfcs/0001-initial-schema.md", - "discussion_title": "RFC 0001 \u2014 Initial Structured Reasoning Schema", + "rfc_title": "Cognitive Artifact & Reasoning Evidence", + "rfc_path": "rfcs/0001-cognitive-artifact.md", + "discussion_title": "RFC 0001 - Cognitive Artifact & Reasoning Evidence", "discussion_url": "https://github.com/supernovae/open-cot/discussions/1" }, "0002": { - "rfc_title": "Verifier Output Schema", - "rfc_path": "rfcs/0002-verifier-output-schema.md", - "discussion_title": "RFC 0002 \u2014 Verifier Output Schema", + "rfc_title": "Capability Snapshot & Endpoint Descriptor", + "rfc_path": "rfcs/0002-capability-snapshot.md", + "discussion_title": "RFC 0002 - Capability Snapshot & Endpoint Descriptor", "discussion_url": "https://github.com/supernovae/open-cot/discussions/2" }, "0003": { - "rfc_title": "Tool Invocation Schema", - "rfc_path": "rfcs/0003-tool-invocation-schema.md", - "discussion_title": "RFC 0003 \u2014 Tool Invocation Schema", + "rfc_title": "Execution Intent & Endpoint Invocation", + "rfc_path": "rfcs/0003-execution-intent.md", + "discussion_title": "RFC 0003 - Execution Intent & Endpoint Invocation", "discussion_url": "https://github.com/supernovae/open-cot/discussions/3" }, "0004": { - "rfc_title": "Branching Reasoning Extensions", - "rfc_path": "rfcs/0004-branching-reasoning-schema.md", - "discussion_title": "RFC 0004 \u2014 Branching Reasoning Extensions", + "rfc_title": "Policy Gate & Permission Evaluation", + "rfc_path": "rfcs/0004-policy-gate.md", + "discussion_title": "RFC 0004 - Policy Gate & Permission Evaluation", "discussion_url": "https://github.com/supernovae/open-cot/discussions/4" }, "0005": { - "rfc_title": "RL Reward Trace Schema", - "rfc_path": "rfcs/0005-rl-reward-trace-schema.md", - "discussion_title": "RFC 0005 \u2014 RL Reward Trace Schema", + "rfc_title": "Observation, Receipt & Audit Evidence", + "rfc_path": "rfcs/0005-observation-receipt.md", + "discussion_title": "RFC 0005 - Observation, Receipt & Audit Evidence", "discussion_url": "https://github.com/supernovae/open-cot/discussions/5" }, "0006": { - "rfc_title": "Multi\u2011Verifier Ensemble Schema", - "rfc_path": "rfcs/0006-multi-verifier-ensemble-schema.md", - "discussion_title": "RFC 0006 \u2014 Multi\u2011Verifier Ensemble Schema", + "rfc_title": "Reconciliation Result & Error Taxonomy", + "rfc_path": "rfcs/0006-reconciliation-result.md", + "discussion_title": "RFC 0006 - Reconciliation Result & Error Taxonomy", "discussion_url": "https://github.com/supernovae/open-cot/discussions/6" }, "0007": { - "rfc_title": "Cognitive Pipeline Protocol", - "rfc_path": "rfcs/0007-cognitive-pipeline-protocol.md", - "discussion_title": "RFC 0007 \u2014 Cognitive Pipeline Protocol", + "rfc_title": "Runtime Boundary & Cognitive Pipeline", + "rfc_path": "rfcs/0007-cognitive-pipeline.md", + "discussion_title": "RFC 0007 - Runtime Boundary & Cognitive Pipeline", "discussion_url": "https://github.com/supernovae/open-cot/discussions/7" }, "0008": { - "rfc_title": "Dataset Packaging Standard", - "rfc_path": "rfcs/0008-dataset-packaging-standard.md", - "discussion_title": "RFC 0008 \u2014 Dataset Packaging Standard", + "rfc_title": "Budget, Cost & Temporal Bounds", + "rfc_path": "rfcs/0008-execution-budget.md", + "discussion_title": "RFC 0008 - Budget, Cost & Temporal Bounds", "discussion_url": "https://github.com/supernovae/open-cot/discussions/8" }, "0009": { - "rfc_title": "Reward Fusion Specification", - "rfc_path": "rfcs/0009-reward-fusion-specification.md", - "discussion_title": "RFC 0009 \u2014 Reward Fusion Specification", + "rfc_title": "Requester Identity & Governance Context", + "rfc_path": "rfcs/0009-requester-identity.md", + "discussion_title": "RFC 0009 - Requester Identity & Governance Context", "discussion_url": "https://github.com/supernovae/open-cot/discussions/9" }, "0010": { - "rfc_title": "Cognitive Context Schema", - "rfc_path": "rfcs/0010-cognitive-context-schema.md", - "discussion_title": "RFC 0010 \u2014 Cognitive Context Schema", + "rfc_title": "Human Approval, Yield & Resume", + "rfc_path": "rfcs/0010-human-approval.md", + "discussion_title": "RFC 0010 - Human Approval, Yield & Resume", "discussion_url": "https://github.com/supernovae/open-cot/discussions/10" }, "0011": { - "rfc_title": "Multi\u2011Agent Protocol", - "rfc_path": "rfcs/0011-multi-party-cognition-protocol.md", - "discussion_title": "RFC 0011 \u2014 Multi\u2011Agent Protocol", + "rfc_title": "Conformance, Registry & Compatibility Rules", + "rfc_path": "rfcs/0011-conformance-registry.md", + "discussion_title": "RFC 0011 - Conformance, Registry & Compatibility Rules", "discussion_url": "https://github.com/supernovae/open-cot/discussions/11" }, "0012": { - "rfc_title": "Dataset Streaming Format", - "rfc_path": "rfcs/0012-dataset-streaming-format.md", - "discussion_title": "RFC 0012 \u2014 Dataset Streaming Format", + "rfc_title": "Compact Context Serialization", + "rfc_path": "rfcs/0012-compact-context.md", + "discussion_title": "RFC 0012 - Compact Context Serialization", "discussion_url": "https://github.com/supernovae/open-cot/discussions/12" - }, - "0013": { - "rfc_title": "Memory Compression & Embedding", - "rfc_path": "rfcs/0013-memory-compression-embedding.md", - "discussion_title": "RFC 0013 \u2014 Memory Compression & Embedding", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/13" - }, - "0014": { - "rfc_title": "Memory Conflict Resolution", - "rfc_path": "rfcs/0014-memory-conflict-resolution.md", - "discussion_title": "RFC 0014 \u2014 Memory Conflict Resolution", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/14" - }, - "0015": { - "rfc_title": "Multi\u2011Agent Reward Sharing", - "rfc_path": "rfcs/0015-multi-party-reward-sharing.md", - "discussion_title": "RFC 0015 \u2014 Multi\u2011Agent Reward Sharing", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/15" - }, - "0016": { - "rfc_title": "Tool Capability Negotiation", - "rfc_path": "rfcs/0016-tool-capability-negotiation.md", - "discussion_title": "RFC 0016 \u2014 Tool Capability Negotiation", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/16" - }, - "0017": { - "rfc_title": "Runtime Safety & Sandboxing", - "rfc_path": "rfcs/0017-runtime-safety-sandboxing.md", - "discussion_title": "RFC 0017 \u2014 Runtime Safety & Sandboxing", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/17" - }, - "0018": { - "rfc_title": "Tool Error Taxonomy", - "rfc_path": "rfcs/0018-tool-error-taxonomy.md", - "discussion_title": "RFC 0018 \u2014 Tool Error Taxonomy", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/18" - }, - "0019": { - "rfc_title": "Multi\u2011Agent Planning Graphs", - "rfc_path": "rfcs/0019-collaborative-planning-graphs.md", - "discussion_title": "RFC 0019 \u2014 Multi\u2011Agent Planning Graphs", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/19" - }, - "0020": { - "rfc_title": "Verifiable Scratchpad Compression", - "rfc_path": "rfcs/0020-verifiable-scratchpad-compression.md", - "discussion_title": "RFC 0020 \u2014 Verifiable Scratchpad Compression", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/20" - }, - "0021": { - "rfc_title": "Capability Declaration", - "rfc_path": "rfcs/0021-capability-declaration.md", - "discussion_title": "RFC 0021 \u2014 Capability Declaration", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/21" - }, - "0022": { - "rfc_title": "Cognitive Evaluation Protocol", - "rfc_path": "rfcs/0022-cognitive-evaluation-protocol.md", - "discussion_title": "RFC 0022 \u2014 Cognitive Evaluation Protocol", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/22" - }, - "0023": { - "rfc_title": "Human\u2011in\u2011the\u2011Loop Feedback Schema", - "rfc_path": "rfcs/0023-humain-in-the-loop-schema.md", - "discussion_title": "RFC 0023 \u2014 Human\u2011in\u2011the\u2011Loop Feedback Schema", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/23" - }, - "0024": { - "rfc_title": "Multi\u2011Modal Reasoning Schema", - "rfc_path": "rfcs/0024-multi-modal-reasoning-schema.md", - "discussion_title": "RFC 0024 \u2014 Multi\u2011Modal Reasoning Schema", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/24" - }, - "0025": { - "rfc_title": "Tool Marketplace Registry Format", - "rfc_path": "rfcs/0025-tool-marketplace-registry-format.md", - "discussion_title": "RFC 0025 \u2014 Tool Marketplace Registry Format", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/25" - }, - "0026": { - "rfc_title": "Requester Identity & Authentication", - "rfc_path": "rfcs/0026-requester-identity-auth.md", - "discussion_title": "RFC 0026 \u2014 Requester Identity & Authentication", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/26" - }, - "0027": { - "rfc_title": "Distributed Execution Protocol", - "rfc_path": "rfcs/0027-distributed-execution-protocol.md", - "discussion_title": "RFC 0027 \u2014 Distributed Execution Protocol", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/27" - }, - "0028": { - "rfc_title": "Cognitive pipeline\u2011to\u2011Environment Interaction Schema", - "rfc_path": "rfcs/0028-capability-environment-schema.md", - "discussion_title": "RFC 0028 \u2014 Cognitive pipeline\u2011to\u2011Environment Interaction Schema", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/28" - }, - "0029": { - "rfc_title": "Cognitive Benchmark Dataset Format", - "rfc_path": "rfcs/0029-cognitive-benchmark-dataset.md", - "discussion_title": "RFC 0029 \u2014 Cognitive Benchmark Dataset Format", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/29" - }, - "0030": { - "rfc_title": "Runtime Lifecycle & Versioning", - "rfc_path": "rfcs/0030-runtime-lifecycle-versioning.md", - "discussion_title": "RFC 0030 \u2014 Runtime Lifecycle & Versioning", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/30" - }, - "0031": { - "rfc_title": "Cognitive Observability & Telemetry", - "rfc_path": "rfcs/0031-cognitive-observability-telemetry.md", - "discussion_title": "RFC 0031 \u2014 Cognitive Observability & Telemetry", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/31" - }, - "0032": { - "rfc_title": "Runtime Deployment Manifest", - "rfc_path": "rfcs/0032-runtime-deployment-manifest.md", - "discussion_title": "RFC 0032 \u2014 Runtime Deployment Manifest", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/32" - }, - "0033": { - "rfc_title": "Runtime Security Posture & Threat Model", - "rfc_path": "rfcs/0033-runtime-security-threat-model.md", - "discussion_title": "RFC 0033 \u2014 Runtime Security Posture & Threat Model", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/33" - }, - "0034": { - "rfc_title": "Cognitive Federation Protocol", - "rfc_path": "rfcs/0034-cognitive-federation-protocol.md", - "discussion_title": "RFC 0034 \u2014 Cognitive Federation Protocol", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/34" - }, - "0035": { - "rfc_title": "Data Provenance Tracking", - "rfc_path": "rfcs/0035-data-provenance-tracking.md", - "discussion_title": "RFC 0035 \u2014 Data Provenance Tracking", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/35" - }, - "0036": { - "rfc_title": "Cognitive pipeline\u2011Native Compression & Delta Sync", - "rfc_path": "rfcs/0036-cognitive-native-compression-delta.md", - "discussion_title": "RFC 0036 \u2014 Cognitive pipeline\u2011Native Compression & Delta Sync", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/36" - }, - "0037": { - "rfc_title": "Token Economy & Cost Modeling", - "rfc_path": "rfcs/0037-token-economy-cost-modeling.md", - "discussion_title": "RFC 0037 \u2014 Token Economy & Cost Modeling", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/37" - }, - "0038": { - "rfc_title": "Cost\u2011Aware Reasoning & Budget Enforcement", - "rfc_path": "rfcs/0038-cost-aware-reasoning-budget.md", - "discussion_title": "RFC 0038 \u2014 Cost\u2011Aware Reasoning & Budget Enforcement", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/38" - }, - "0039": { - "rfc_title": "Tool Cost Modeling & Billing Semantics", - "rfc_path": "rfcs/0039-tool-cost-modeling-biling.md", - "discussion_title": "RFC 0039 \u2014 Tool Cost Modeling & Billing Semantics", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/39" - }, - "0040": { - "rfc_title": "Multi\u2011Agent Economic Incentives", - "rfc_path": "rfcs/0040-multi-party-economic-incentives.md", - "discussion_title": "RFC 0040 \u2014 Multi\u2011Agent Economic Incentives", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/40" - }, - "0041": { - "rfc_title": "Policy Enforcement Schema", - "rfc_path": "rfcs/0041-policy-enforcement-schema.md", - "discussion_title": "RFC 0041 \u2014 Policy Enforcement Schema", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/41" - }, - "0042": { - "rfc_title": "Permissions & Access Control", - "rfc_path": "rfcs/0042-permission-acl.md", - "discussion_title": "RFC 0042 \u2014 Permissions & Access Control", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/42" - }, - "0043": { - "rfc_title": "Auditing & Compliance Logs", - "rfc_path": "rfcs/0043-auditing-compliance-logs.md", - "discussion_title": "RFC 0043 \u2014 Auditing & Compliance Logs", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/43" - }, - "0044": { - "rfc_title": "Governance & Organizational Controls", - "rfc_path": "rfcs/0044-governance-organizational-controls.md", - "discussion_title": "RFC 0044 \u2014 Governance & Organizational Controls", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/44" - }, - "0045": { - "rfc_title": "Ethics & Risk Constraints for Cognitive Runtimes", - "rfc_path": "rfcs/0045-ethics-risk-constraints-cognitive-runtimes.md", - "discussion_title": "RFC 0045 \u2014 Ethics & Risk Constraints for Cognitive Runtimes", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/45" - }, - "0046": { - "rfc_title": "Conformance & Interoperability Protocol", - "rfc_path": "rfcs/0046-conformance-interoperability-protocol.md", - "discussion_title": "RFC 0046 \u2014 Conformance & Interoperability Protocol", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/46" - }, - "0047": { - "rfc_title": "Delegation Extension", - "rfc_path": "rfcs/0047-delegation-extension.md", - "discussion_title": "RFC 0047 \u2014 Delegation Extension", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/47" - }, - "0048": { - "rfc_title": "Execution Receipts & Audit Envelopes", - "rfc_path": "rfcs/0048-execution-receipts-audit-envelopes.md", - "discussion_title": "RFC 0048 \u2014 Execution Receipts & Audit Envelopes", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/48" - }, - "0049": { - "rfc_title": "Capability Manifest", - "rfc_path": "rfcs/0049-capability-manifest.md", - "discussion_title": "RFC 0049 \u2014 Capability Manifest", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/49" - }, - "0050": { - "rfc_title": "TOON Adapter: Token-Oriented Object Notation", - "rfc_path": "rfcs/0050-toon-adapter.md", - "discussion_title": "RFC 0050 \u2014 TOON Adapter: Token-Oriented Object Notation", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/50" - }, - "0051": { - "rfc_title": "Temporal Semantics & Validity Extension", - "rfc_path": "rfcs/0051-temporal-semantics-validity-extension.md", - "discussion_title": "RFC 0051 \u2014 Temporal Semantics & Validity Extension", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/51" - }, - "0052": { - "rfc_title": "Cognitive Artifact & Capability Snapshot", - "rfc_path": "rfcs/0052-cognitive-artifact-and-capability-snapshot.md", - "discussion_title": "RFC 0052 \u2014 Cognitive Artifact & Capability Snapshot", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/52" - }, - "0053": { - "rfc_title": "Reconciliation Result & Error Taxonomy", - "rfc_path": "rfcs/0053-reconciliation-result.md", - "discussion_title": "RFC 0053 \u2014 Reconciliation Result & Error Taxonomy", - "discussion_url": "https://github.com/supernovae/open-cot/discussions/53" } } } diff --git a/docs/rfc-discussions.md b/docs/rfc-discussions.md index 05de98f..f9764a2 100644 --- a/docs/rfc-discussions.md +++ b/docs/rfc-discussions.md @@ -1,62 +1,20 @@ # RFC Discussions Index -Canonical discussion threads for all Open CoT RFCs. Use these threads for normative feedback and design discussion. +Canonical discussion threads for the Open CoT core reset. -- Discussion policy: RFC feedback uses GitHub Discussions first; issues are for actionable tasks/bugs. -- Source mapping: `docs/rfc-discussion-index.json` (53 RFCs) +- Source mapping: `docs/rfc-discussion-index.json` (12 RFCs) | RFC | Topic | Discussion | |-----|-------|------------| -| [`RFC 0001`](../rfcs/0001-initial-schema.md) | Initial Structured Reasoning Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/1) | -| [`RFC 0002`](../rfcs/0002-verifier-output-schema.md) | Verifier Output Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/2) | -| [`RFC 0003`](../rfcs/0003-tool-invocation-schema.md) | Tool Invocation Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/3) | -| [`RFC 0004`](../rfcs/0004-branching-reasoning-schema.md) | Branching Reasoning Extensions | [Open thread](https://github.com/supernovae/open-cot/discussions/4) | -| [`RFC 0005`](../rfcs/0005-rl-reward-trace-schema.md) | RL Reward Trace Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/5) | -| [`RFC 0006`](../rfcs/0006-multi-verifier-ensemble-schema.md) | Multi‑Verifier Ensemble Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/6) | -| [`RFC 0007`](../rfcs/0007-cognitive-pipeline-protocol.md) | Cognitive Pipeline Protocol | [Open thread](https://github.com/supernovae/open-cot/discussions/7) | -| [`RFC 0008`](../rfcs/0008-dataset-packaging-standard.md) | Dataset Packaging Standard | [Open thread](https://github.com/supernovae/open-cot/discussions/8) | -| [`RFC 0009`](../rfcs/0009-reward-fusion-specification.md) | Reward Fusion Specification | [Open thread](https://github.com/supernovae/open-cot/discussions/9) | -| [`RFC 0010`](../rfcs/0010-cognitive-context-schema.md) | Cognitive Context Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/10) | -| [`RFC 0011`](../rfcs/0011-multi-party-cognition-protocol.md) | Multi-Party Cognition Protocol | [Open thread](https://github.com/supernovae/open-cot/discussions/11) | -| [`RFC 0012`](../rfcs/0012-dataset-streaming-format.md) | Dataset Streaming Format | [Open thread](https://github.com/supernovae/open-cot/discussions/12) | -| [`RFC 0013`](../rfcs/0013-memory-compression-embedding.md) | Memory Compression & Embedding | [Open thread](https://github.com/supernovae/open-cot/discussions/13) | -| [`RFC 0014`](../rfcs/0014-memory-conflict-resolution.md) | Memory Conflict Resolution | [Open thread](https://github.com/supernovae/open-cot/discussions/14) | -| [`RFC 0015`](../rfcs/0015-multi-party-reward-sharing.md) | Multi-Party Reward Sharing | [Open thread](https://github.com/supernovae/open-cot/discussions/15) | -| [`RFC 0016`](../rfcs/0016-tool-capability-negotiation.md) | Tool Capability Negotiation | [Open thread](https://github.com/supernovae/open-cot/discussions/16) | -| [`RFC 0017`](../rfcs/0017-runtime-safety-sandboxing.md) | Runtime Safety & Sandboxing | [Open thread](https://github.com/supernovae/open-cot/discussions/17) | -| [`RFC 0018`](../rfcs/0018-tool-error-taxonomy.md) | Tool Error Taxonomy | [Open thread](https://github.com/supernovae/open-cot/discussions/18) | -| [`RFC 0019`](../rfcs/0019-collaborative-planning-graphs.md) | Collaborative Planning Graphs | [Open thread](https://github.com/supernovae/open-cot/discussions/19) | -| [`RFC 0020`](../rfcs/0020-verifiable-scratchpad-compression.md) | Verifiable Scratchpad Compression | [Open thread](https://github.com/supernovae/open-cot/discussions/20) | -| [`RFC 0021`](../rfcs/0021-capability-declaration.md) | Capability Declaration | [Open thread](https://github.com/supernovae/open-cot/discussions/21) | -| [`RFC 0022`](../rfcs/0022-cognitive-evaluation-protocol.md) | Cognitive Evaluation Protocol | [Open thread](https://github.com/supernovae/open-cot/discussions/22) | -| [`RFC 0023`](../rfcs/0023-humain-in-the-loop-schema.md) | Human‑in‑the‑Loop Feedback Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/23) | -| [`RFC 0024`](../rfcs/0024-multi-modal-reasoning-schema.md) | Multi‑Modal Reasoning Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/24) | -| [`RFC 0025`](../rfcs/0025-tool-marketplace-registry-format.md) | Tool Marketplace Registry Format | [Open thread](https://github.com/supernovae/open-cot/discussions/25) | -| [`RFC 0026`](../rfcs/0026-requester-identity-auth.md) | Requester Identity & Authentication | [Open thread](https://github.com/supernovae/open-cot/discussions/26) | -| [`RFC 0027`](../rfcs/0027-distributed-execution-protocol.md) | Distributed Execution Protocol | [Open thread](https://github.com/supernovae/open-cot/discussions/27) | -| [`RFC 0028`](../rfcs/0028-capability-environment-schema.md) | Capability Environment Interaction Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/28) | -| [`RFC 0029`](../rfcs/0029-cognitive-benchmark-dataset.md) | Cognitive Benchmark Dataset Format | [Open thread](https://github.com/supernovae/open-cot/discussions/29) | -| [`RFC 0030`](../rfcs/0030-runtime-lifecycle-versioning.md) | Runtime Lifecycle & Versioning | [Open thread](https://github.com/supernovae/open-cot/discussions/30) | -| [`RFC 0031`](../rfcs/0031-cognitive-observability-telemetry.md) | Cognitive Observability & Telemetry | [Open thread](https://github.com/supernovae/open-cot/discussions/31) | -| [`RFC 0032`](../rfcs/0032-runtime-deployment-manifest.md) | Runtime Deployment Manifest | [Open thread](https://github.com/supernovae/open-cot/discussions/32) | -| [`RFC 0033`](../rfcs/0033-runtime-security-threat-model.md) | Runtime Security Posture & Threat Model | [Open thread](https://github.com/supernovae/open-cot/discussions/33) | -| [`RFC 0034`](../rfcs/0034-cognitive-federation-protocol.md) | Cognitive Federation Protocol | [Open thread](https://github.com/supernovae/open-cot/discussions/34) | -| [`RFC 0035`](../rfcs/0035-data-provenance-tracking.md) | Data Provenance Tracking | [Open thread](https://github.com/supernovae/open-cot/discussions/35) | -| [`RFC 0036`](../rfcs/0036-cognitive-native-compression-delta.md) | Cognitive-Native Compression & Delta Sync | [Open thread](https://github.com/supernovae/open-cot/discussions/36) | -| [`RFC 0037`](../rfcs/0037-token-economy-cost-modeling.md) | Token Economy & Cost Modeling | [Open thread](https://github.com/supernovae/open-cot/discussions/37) | -| [`RFC 0038`](../rfcs/0038-cost-aware-reasoning-budget.md) | Cost‑Aware Reasoning & Budget Enforcement | [Open thread](https://github.com/supernovae/open-cot/discussions/38) | -| [`RFC 0039`](../rfcs/0039-tool-cost-modeling-biling.md) | Tool Cost Modeling & Billing Semantics | [Open thread](https://github.com/supernovae/open-cot/discussions/39) | -| [`RFC 0040`](../rfcs/0040-multi-party-economic-incentives.md) | Multi-Party Economic Incentives | [Open thread](https://github.com/supernovae/open-cot/discussions/40) | -| [`RFC 0041`](../rfcs/0041-policy-enforcement-schema.md) | Policy Enforcement Schema | [Open thread](https://github.com/supernovae/open-cot/discussions/41) | -| [`RFC 0042`](../rfcs/0042-permission-acl.md) | Permissions & Access Control | [Open thread](https://github.com/supernovae/open-cot/discussions/42) | -| [`RFC 0043`](../rfcs/0043-auditing-compliance-logs.md) | Auditing & Compliance Logs | [Open thread](https://github.com/supernovae/open-cot/discussions/43) | -| [`RFC 0044`](../rfcs/0044-governance-organizational-controls.md) | Governance & Organizational Controls | [Open thread](https://github.com/supernovae/open-cot/discussions/44) | -| [`RFC 0045`](../rfcs/0045-ethics-risk-constraints-cognitive-runtimes.md) | Ethics & Risk Constraints for Cognitive Runtimes | [Open thread](https://github.com/supernovae/open-cot/discussions/45) | -| [`RFC 0046`](../rfcs/0046-conformance-interoperability-protocol.md) | Conformance & Interoperability Protocol | [Open thread](https://github.com/supernovae/open-cot/discussions/46) | -| [`RFC 0047`](../rfcs/0047-delegation-extension.md) | Delegation Extension | [Open thread](https://github.com/supernovae/open-cot/discussions/47) | -| [`RFC 0048`](../rfcs/0048-execution-receipts-audit-envelopes.md) | Execution Receipts & Audit Envelopes | [Open thread](https://github.com/supernovae/open-cot/discussions/48) | -| [`RFC 0049`](../rfcs/0049-capability-manifest.md) | Capability Manifest | [Open thread](https://github.com/supernovae/open-cot/discussions/49) | -| [`RFC 0050`](../rfcs/0050-toon-adapter.md) | TOON Adapter: Token-Oriented Object Notation | [Open thread](https://github.com/supernovae/open-cot/discussions/50) | -| [`RFC 0051`](../rfcs/0051-temporal-semantics-validity-extension.md) | Temporal Semantics & Validity Extension | [Open thread](https://github.com/supernovae/open-cot/discussions/51) | -| [`RFC 0052`](../rfcs/0052-cognitive-artifact-and-capability-snapshot.md) | Cognitive Artifact & Capability Snapshot | [Open thread](https://github.com/supernovae/open-cot/discussions/52) | -| [`RFC 0053`](../rfcs/0053-reconciliation-result.md) | Reconciliation Result & Error Taxonomy | [Open thread](https://github.com/supernovae/open-cot/discussions/53) | +| [`RFC 0001`](../rfcs/0001-cognitive-artifact.md) | Cognitive Artifact & Reasoning Evidence | [Open thread](https://github.com/supernovae/open-cot/discussions/1) | +| [`RFC 0002`](../rfcs/0002-capability-snapshot.md) | Capability Snapshot & Endpoint Descriptor | [Open thread](https://github.com/supernovae/open-cot/discussions/2) | +| [`RFC 0003`](../rfcs/0003-execution-intent.md) | Execution Intent & Endpoint Invocation | [Open thread](https://github.com/supernovae/open-cot/discussions/3) | +| [`RFC 0004`](../rfcs/0004-policy-gate.md) | Policy Gate & Permission Evaluation | [Open thread](https://github.com/supernovae/open-cot/discussions/4) | +| [`RFC 0005`](../rfcs/0005-observation-receipt.md) | Observation, Receipt & Audit Evidence | [Open thread](https://github.com/supernovae/open-cot/discussions/5) | +| [`RFC 0006`](../rfcs/0006-reconciliation-result.md) | Reconciliation Result & Error Taxonomy | [Open thread](https://github.com/supernovae/open-cot/discussions/6) | +| [`RFC 0007`](../rfcs/0007-cognitive-pipeline.md) | Runtime Boundary & Cognitive Pipeline | [Open thread](https://github.com/supernovae/open-cot/discussions/7) | +| [`RFC 0008`](../rfcs/0008-execution-budget.md) | Budget, Cost & Temporal Bounds | [Open thread](https://github.com/supernovae/open-cot/discussions/8) | +| [`RFC 0009`](../rfcs/0009-requester-identity.md) | Requester Identity & Governance Context | [Open thread](https://github.com/supernovae/open-cot/discussions/9) | +| [`RFC 0010`](../rfcs/0010-human-approval.md) | Human Approval, Yield & Resume | [Open thread](https://github.com/supernovae/open-cot/discussions/10) | +| [`RFC 0011`](../rfcs/0011-conformance-registry.md) | Conformance, Registry & Compatibility Rules | [Open thread](https://github.com/supernovae/open-cot/discussions/11) | +| [`RFC 0012`](../rfcs/0012-compact-context.md) | Compact Context Serialization | [Open thread](https://github.com/supernovae/open-cot/discussions/12) | diff --git a/docs/rfc-e2e-gap-matrix.md b/docs/rfc-e2e-gap-matrix.md index dfc9f7e..0e247fe 100644 --- a/docs/rfc-e2e-gap-matrix.md +++ b/docs/rfc-e2e-gap-matrix.md @@ -1,50 +1,18 @@ -# Open CoT RFC-to-E2E Capability Matrix - -This matrix maps current RFC coverage to the concrete functions needed for an end-to-end model workflow: - -- dataset build and governance -- training and checkpoint lineage -- benchmark execution and scoring -- policy/safety/audit enforcement -- conformance and release readiness - -## Coverage Legend - -- `Implemented`: working code path exists in repository tooling -- `Partial`: schema or docs exist, but execution path is incomplete -- `Gap`: missing capability for practical E2E operation - -## Matrix - -| Capability | Primary RFCs | Current status | What exists now | Required closure | -| --- | --- | --- | --- | --- | -| Core reasoning trace format | RFC `0001` | Implemented | `schemas/`, `tools/validate.py`, `reference/python/validator.py` | Keep stable and versioned | -| Tool/verifier sidecars | RFC `0002`, `0003`, `0006` | Partial | Schema coverage + examples | Integrate into default evaluation pipeline | -| Branching/search trace structures | RFC `0004` | Partial | Schema/examples only | Add scoring and harness paths for branch metrics | -| Reward and reward fusion | RFC `0005`, `0009` | Partial | Schema/examples only | Add reward-aware evaluation and preference/RL training glue | -| Cognitive pipeline loop protocol | RFC `0007` | Partial | `reference/python/cognitive_pipeline_runner.py` mock loop | Wire into real eval/training traces and audit outputs | -| Dataset packaging/streaming | RFC `0008`, `0012` | Implemented | Packaging layouts, manifests, synthetic datasets | Add strict governance gates (dedup/contamination/provenance assertions) | -| Cognitive pipeline memory/safety/policy | RFC `0010`, `0017`, `0041`, `0045` | Partial | Schema-level docs, limited runtime checks | Enforce policy budgets/redaction/tool denial in eval scripts | -| Evaluation reporting | RFC `0022`, `0029` | Partial | `benchmarks/scoring/scorer.py`, task specs | Add self-consistency, semantic step checks, harness adapter | -| Identity/compliance/audit | RFC `0026`, `0043`, `0044` | Partial | Policies specified | Emit machine-readable audit events per run | -| Observability + budgets + cost | RFC `0031`, `0037`, `0038`, `0039` | Gap | Mostly RFC text and examples | Add runtime counters and budget guardrails in execution | -| Provenance and integrity | RFC `0035` | Partial | `export_artifacts.py` hashes | Add lineage manifests linking data/model/eval artifacts | -| Conformance profiles | RFC `0046` | Partial | Validation checks in `tools/validate.py` | Add fixture matrix + quickstart execution paths | - -## Priority Gap Backlog - -1. **Evaluation credibility**: connect standard OSS harness execution to Open CoT output artifacts. -2. **Scoring quality**: add self-consistency and stronger step-level checks beyond structural proxies. -3. **Lineage and reproducibility**: record training/eval artifact lineage with hashes and run metadata. -4. **Data governance automation**: fail CI/local runs on contamination, dedup, and missing provenance. -5. **Safety/policy operationalization**: enforce budgets, denial rules, and redaction in runtime scripts. -6. **Conformance adoption path**: publish runnable profile fixtures and "kick-the-tires" scripts. - -## OSS Reuse Defaults - -- **lm-eval-harness** for broad benchmark execution -- **TRL** for standardized SFT/DPO-style workflows -- **vLLM/TGI** for reproducible batched inference -- **W&B/MLflow** for run metadata and artifact lineage - -Open CoT should remain focused on schema standards, validators, adapters, and reference fixtures while delegating benchmark execution and training primitives to established OSS stacks. +# Open CoT Core Matrix + +| Capability | RFC | Status | +| --- | --- | --- | +| Cognitive artifact and reasoning evidence | 0001 | Core | +| Capability scope | 0002 | Core | +| Execution intent | 0003 | Core | +| Policy gate | 0004 | Core | +| Observation and receipt evidence | 0005 | Core | +| Reconciliation result | 0006 | Core | +| Runtime boundary | 0007 | Core | +| Budgets and temporal bounds | 0008 | Core | +| Requester identity | 0009 | Core | +| Human approval and yield | 0010 | Core | +| Conformance registry | 0011 | Core | +| Compact context serialization | 0012 | Core | + +Training and benchmark workflows are intentionally out of this core matrix. diff --git a/examples/branching/example1.json b/examples/branching/example1.json deleted file mode 100644 index 9f927e9..0000000 --- a/examples/branching/example1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "branch_group": "g1", - "branch_score": 0.72, - "pruned": false, - "exploration_strategy": "beam", - "path_id": "path_a" -} diff --git a/examples/capability_snapshot/example1.json b/examples/capability_snapshot/example1.json new file mode 100644 index 0000000..41e12f8 --- /dev/null +++ b/examples/capability_snapshot/example1.json @@ -0,0 +1,18 @@ +{ + "snapshot_id": "snapshot-1", + "created_at": "2026-04-27T15:00:00Z", + "capabilities_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "capabilities": [ + { + "endpoint_id": "repo-status", + "capability_name": "status", + "description": "Read repository status.", + "input_schema": { + "type": "object" + }, + "risk_level": "read", + "requires_approval": false, + "capability_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] +} diff --git a/examples/cognitive_artifact/example1.json b/examples/cognitive_artifact/example1.json new file mode 100644 index 0000000..08ba221 --- /dev/null +++ b/examples/cognitive_artifact/example1.json @@ -0,0 +1,39 @@ +{ + "artifact_id": "artifact-1", + "schema_version": "open-cot.core.v1", + "capability_snapshot_id": "snapshot-1", + "intent_verification": { + "objective": "Summarize repository status.", + "request_boundaries": [ + "read-only" + ], + "allowed_scope": [ + "inspect files" + ], + "prohibited_scope": [ + "write files" + ] + }, + "reasoning_trace": { + "evidence_mode": "audit_summary", + "summary": "The request is read-only and can use the repository status endpoint.", + "steps": [ + { + "step_id": "r1", + "kind": "interpretation", + "content": "Classified as read-only inspection.", + "visibility": "audit_summary", + "confidence": 0.9 + } + ] + }, + "assumptions": [ + "Repository access is available." + ], + "execution_intents": [], + "observations": [], + "uncertainty": { + "level": "low", + "explanation": "The requested operation is narrow." + } +} diff --git a/examples/cognitive_pipeline/example1.json b/examples/cognitive_pipeline/example1.json index f7c4456..b180bbe 100644 --- a/examples/cognitive_pipeline/example1.json +++ b/examples/cognitive_pipeline/example1.json @@ -1,34 +1,18 @@ { - "version": "0.1", - "task": "Find the population of Tokyo and compute its square root.", + "version": "0.2", + "task": "Summarize repository status.", "steps": [ { "id": "s1", "type": "thought", - "content": "I should call the search tool to get Tokyo's population." + "content": "Received request." }, { "id": "s2", - "type": "action", - "content": "call:search", - "tool_invocation": { - "tool_name": "search", - "arguments": { "query": "population of Tokyo" }, - "triggered_by_step": "s1" - } - }, - { - "id": "s3", - "type": "observation", - "content": "{\"population\": 13960000}", - "parent": "s2" - }, - { - "id": "s4", - "type": "calculation", - "content": "sqrt(13960000) ≈ 3736.0", - "parent": "s3" + "type": "plan", + "content": "Use read-only status endpoint." } ], - "final_answer": "The square root of Tokyo's population (~13.96M) is approximately 3736." + "final_answer": "Repository status summarized.", + "termination": "succeeded" } diff --git a/examples/compact_context/example1.json b/examples/compact_context/example1.json new file mode 100644 index 0000000..e372a82 --- /dev/null +++ b/examples/compact_context/example1.json @@ -0,0 +1,6 @@ +{ + "format": "compact-json", + "schema_ref": "cognitive_artifact", + "content": "{artifact_id:artifact-1}", + "content_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +} diff --git a/examples/conformance_registry/example1.json b/examples/conformance_registry/example1.json new file mode 100644 index 0000000..afd89b5 --- /dev/null +++ b/examples/conformance_registry/example1.json @@ -0,0 +1,32 @@ +{ + "registry_version": "2.0", + "profile": "core", + "schemas": { + "cognitive_artifact": "schemas/rfc-0001-cognitive-artifact.json", + "capability_snapshot": "schemas/rfc-0002-capability-snapshot.json", + "execution_intent": "schemas/rfc-0003-execution-intent.json", + "policy_gate": "schemas/rfc-0004-policy-gate.json", + "observation_receipt": "schemas/rfc-0005-observation-receipt.json", + "reconciliation_result": "schemas/rfc-0006-reconciliation-result.json", + "cognitive_pipeline": "schemas/rfc-0007-cognitive-pipeline.json", + "execution_budget": "schemas/rfc-0008-execution-budget.json", + "requester_identity": "schemas/rfc-0009-requester-identity.json", + "human_approval": "schemas/rfc-0010-human-approval.json", + "conformance_registry": "schemas/rfc-0011-conformance-registry.json", + "compact_context": "schemas/rfc-0012-compact-context.json" + }, + "required_examples": [ + "cognitive_artifact", + "capability_snapshot", + "execution_intent", + "policy_gate", + "observation_receipt", + "reconciliation_result", + "cognitive_pipeline", + "execution_budget", + "requester_identity", + "human_approval", + "conformance_registry", + "compact_context" + ] +} diff --git a/examples/dataset_packaging/manifest.json b/examples/dataset_packaging/manifest.json deleted file mode 100644 index 4100472..0000000 --- a/examples/dataset_packaging/manifest.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "version": "0.1", - "name": "example-dataset", - "description": "A dataset of structured reasoning traces.", - "schemas": { - "reasoning": "0.1", - "verifier_output": "0.1", - "tool_invocation": "0.1", - "branching": "0.1", - "reward": "0.1", - "ensemble": "0.1" - }, - "counts": { - "traces": 1000, - "verifier_outputs": 1000, - "ensembles": 1000, - "rewards": 1000 - }, - "splits": ["train", "validation", "test"], - "created_at": "2026-04-14T00:00:00Z", - "license": "MIT" -} diff --git a/examples/delegation_extension/example1.json b/examples/delegation_extension/example1.json deleted file mode 100644 index a2a80a0..0000000 --- a/examples/delegation_extension/example1.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "delegation_request": { - "schema_version": "0.2", - "request_id": "req-a1b2c3d4", - "requester": "cognitive-pipeline-planner-01", - "run_id": "run-e5f6g7h8", - "intent": "Read email headers to find meeting invitations", - "justification": "The user asked me to check for upcoming meetings.", - "requested_scope": { - "resource": "tool:email", - "action": "read" - }, - "preferred_ttl_seconds": 60, - "preferred_audience": "tool:email", - "task_context_ref": "s-3", - "observed_at": "2026-04-18T14:30:00Z", - "provenance": { - "trace_step_id": "s-3", - "plan_version": 1 - } - }, - "delegation_decision": { - "schema_version": "0.2", - "decision_id": "dec-i9j0k1l2", - "request_id": "req-a1b2c3d4", - "status": "narrowed", - "decided_by": { - "kind": "policy", - "policy_id": "compliance-email-001" - }, - "policy_refs": [ - "compliance-email-001" - ], - "narrowed_scope": { - "resource": "tool:email", - "action": "read", - "constraints": { - "allowed_fields": [ - "subject", - "from", - "date" - ], - "excluded_fields": [ - "body", - "attachments" - ] - } - }, - "decided_at": "2026-04-18T14:30:01Z" - }, - "authority_receipt": { - "schema_version": "0.2", - "receipt_id": "rcpt-m3n4o5p6", - "decision_id": "dec-i9j0k1l2", - "request_id": "req-a1b2c3d4", - "permission_id": "perm-q7r8s9t0", - "granted_scope": { - "resource": "tool:email", - "action": "read", - "constraints": { - "allowed_fields": [ - "subject", - "from", - "date" - ], - "excluded_fields": [ - "body", - "attachments" - ] - } - }, - "effective_at": "2026-04-18T14:30:01Z", - "expires_at": "2026-04-18T14:31:01Z", - "one_shot": true, - "forwardable": false, - "audience": "tool:email", - "integrity": { - "hash_algorithm": "sha256", - "content_hash": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2" - } - } -} diff --git a/examples/ensemble/example1.json b/examples/ensemble/example1.json deleted file mode 100644 index 69208c1..0000000 --- a/examples/ensemble/example1.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "0.1", - "trace_id": "trace_001", - "verifier_outputs": [ - { - "verifier": "symbolic_math_v1" - } - ], - "fusion_strategy": "majority_vote", - "fused_step_results": [ - { - "step_id": "s2", - "correct": "true", - "confidence": 1.0 - } - ], - "fused_rewards": [ - { - "step_id": "s2", - "reward": 1.0 - } - ] -} diff --git a/examples/execution_budget/example1.json b/examples/execution_budget/example1.json new file mode 100644 index 0000000..53d3012 --- /dev/null +++ b/examples/execution_budget/example1.json @@ -0,0 +1,9 @@ +{ + "budget_id": "budget-1", + "max_execution_intents": 3, + "max_endpoint_calls": 3, + "max_tokens": 2000, + "max_cost_usd": 0.25, + "valid_after": "2026-04-27T15:00:00Z", + "valid_until": "2026-04-27T16:00:00Z" +} diff --git a/examples/execution_intent/example1.json b/examples/execution_intent/example1.json new file mode 100644 index 0000000..f359b29 --- /dev/null +++ b/examples/execution_intent/example1.json @@ -0,0 +1,11 @@ +{ + "intent_id": "intent-1", + "snapshot_id": "snapshot-1", + "endpoint_id": "repo-status", + "capability_name": "status", + "capability_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "risk_level": "read", + "requires_approval": false, + "idempotency_key": "idem-1", + "arguments": {} +} diff --git a/examples/execution_receipts_audit_envelopes/example-envelope.json b/examples/execution_receipts_audit_envelopes/example-envelope.json deleted file mode 100644 index 51d8a64..0000000 --- a/examples/execution_receipts_audit_envelopes/example-envelope.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "schema_version": "0.2", - "envelope_id": "11111111-2222-4333-8444-555555555555", - "run_id": "run-e5f6g7h8", - "requester_id": "cognitive-pipeline-planner-01", - "task_hash": "3c9e2a1f7b0d6e5c8a4f2b1d9e8c7a6f5b4d3e2c1a0f9e8d7c6b5a4f3e2d1c0b", - "started_at": "2026-04-18T14:30:00Z", - "completed_at": "2026-04-18T14:30:05Z", - "completion_status": "succeeded", - "trace_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "delegation_requests": [ - "req-a1b2c3d4" - ], - "delegation_decisions": [ - "dec-i9j0k1l2" - ], - "authority_receipts": [ - "rcpt-m3n4o5p6" - ], - "tool_execution_receipts": [ - "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa" - ], - "delegation_summary": { - "total_requested": 1, - "total_granted": 1, - "total_denied": 0, - "total_narrowed": 1, - "total_escalated": 0 - }, - "permission_summary": { - "total_granted": 1, - "total_consumed": 1, - "total_expired": 0, - "total_revoked": 0 - }, - "budget_final": { - "tokens_used": 4250, - "tokens_remaining": 95750, - "cost_used": 0.085, - "cost_remaining": 9.915, - "steps_used": 8, - "steps_remaining": 42, - "tool_calls_used": 1, - "tool_calls_remaining": 19, - "retries_used": 0, - "retries_remaining": 5 - }, - "policy_violations": [], - "integrity": { - "hash_algorithm": "sha256", - "content_hash": "c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2" - } -} diff --git a/examples/execution_receipts_audit_envelopes/example1.json b/examples/execution_receipts_audit_envelopes/example1.json deleted file mode 100644 index e96eb09..0000000 --- a/examples/execution_receipts_audit_envelopes/example1.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "schema_version": "0.2", - "execution_id": "exec-u1v2w3x4", - "run_id": "run-e5f6g7h8", - "tool_name": "email", - "permission_id": "perm-q7r8s9t0", - "authority_receipt_id": "rcpt-m3n4o5p6", - "input_hash": "7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069", - "output_hash": "ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d", - "output_size_bytes": 342, - "started_at": "2026-04-18T14:30:02Z", - "completed_at": "2026-04-18T14:30:03Z", - "duration_ms": 145, - "status": "success", - "postcondition_check": "passed", - "sandbox_state_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", - "integrity": { - "hash_algorithm": "sha256", - "content_hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9" - } -} diff --git a/examples/human_approval/example1.json b/examples/human_approval/example1.json new file mode 100644 index 0000000..9c61ea6 --- /dev/null +++ b/examples/human_approval/example1.json @@ -0,0 +1,7 @@ +{ + "approval_id": "approval-1", + "intent_id": "intent-1", + "requested_at": "2026-04-27T15:00:00Z", + "status": "requested", + "prompt": "Approve read-only repository status inspection?" +} diff --git a/examples/observation_receipt/example1.json b/examples/observation_receipt/example1.json new file mode 100644 index 0000000..7d5cffe --- /dev/null +++ b/examples/observation_receipt/example1.json @@ -0,0 +1,21 @@ +{ + "observation": { + "observation_id": "obs-1", + "intent_id": "intent-1", + "status": "recorded", + "summary": "Repository status was read.", + "output": { + "clean": true + }, + "observed_at": "2026-04-27T15:00:00Z" + }, + "receipt": { + "receipt_id": "receipt-1", + "intent_id": "intent-1", + "endpoint_id": "repo-status", + "status": "executed", + "input_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "output_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "issued_at": "2026-04-27T15:00:00Z" + } +} diff --git a/examples/permission_acl/example1.json b/examples/permission_acl/example1.json deleted file mode 100644 index 4a8d5a8..0000000 --- a/examples/permission_acl/example1.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "permission_id": "perm-q7r8s9t0", - "granted_to": "cognitive-pipeline-planner-01", - "scope": { - "resource": "tool:email", - "action": "read", - "constraints": { - "allowed_fields": [ - "subject", - "from", - "date" - ], - "excluded_fields": [ - "body", - "attachments" - ] - } - }, - "audience": "tool:email", - "ttl_seconds": 60, - "effective_at": "2026-04-18T14:30:01Z", - "expires_at": "2026-04-18T14:31:01Z", - "one_shot": true, - "forwardable": false, - "granted_by": "policy:compliance-email-001", - "policy_ref": "compliance-email-001", - "request_ref": "req-a1b2c3d4", - "decision_ref": "dec-i9j0k1l2", - "status": "consumed", - "consumed_at": "2026-04-18T14:30:02Z" -} diff --git a/examples/policy_gate/example1.json b/examples/policy_gate/example1.json new file mode 100644 index 0000000..8bdb086 --- /dev/null +++ b/examples/policy_gate/example1.json @@ -0,0 +1,7 @@ +{ + "evaluation_id": "eval-1", + "intent_id": "intent-1", + "evaluated_at": "2026-04-27T15:00:00Z", + "result": "allow", + "reason": "Read-only endpoint within scope." +} diff --git a/examples/reasoning/example1.json b/examples/reasoning/example1.json deleted file mode 100644 index e533c58..0000000 --- a/examples/reasoning/example1.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "0.1", - "task": "What is 17 * 23?", - "steps": [ - { - "id": "s1", - "type": "thought", - "content": "Break 23 into 20 + 3." - }, - { - "id": "s2", - "type": "calculation", - "content": "17 * 20 = 340", - "parent": "s1" - }, - { - "id": "s3", - "type": "calculation", - "content": "17 * 3 = 51", - "parent": "s1" - }, - { - "id": "s4", - "type": "thought", - "content": "Add partial results: 340 + 51 = 391", - "parent": "s1" - } - ], - "final_answer": "391" -} diff --git a/examples/reconciliation_result/example1.json b/examples/reconciliation_result/example1.json new file mode 100644 index 0000000..6719c58 --- /dev/null +++ b/examples/reconciliation_result/example1.json @@ -0,0 +1,89 @@ +{ + "reconciliation_id": "recon-1", + "status": "completed", + "capability_snapshot": { + "snapshot_id": "snapshot-1", + "created_at": "2026-04-27T15:00:00Z", + "capabilities_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "capabilities": [ + { + "endpoint_id": "repo-status", + "capability_name": "status", + "description": "Read repository status.", + "input_schema": { + "type": "object" + }, + "risk_level": "read", + "requires_approval": false, + "capability_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] + }, + "artifact": { + "artifact_id": "artifact-1", + "schema_version": "open-cot.core.v1", + "capability_snapshot_id": "snapshot-1", + "intent_verification": { + "objective": "Summarize repository status.", + "request_boundaries": [ + "read-only" + ], + "allowed_scope": [ + "inspect files" + ], + "prohibited_scope": [ + "write files" + ] + }, + "reasoning_trace": { + "evidence_mode": "audit_summary", + "summary": "The request is read-only and can use the repository status endpoint.", + "steps": [ + { + "step_id": "r1", + "kind": "interpretation", + "content": "Classified as read-only inspection.", + "visibility": "audit_summary", + "confidence": 0.9 + } + ] + }, + "assumptions": [ + "Repository access is available." + ], + "execution_intents": [], + "observations": [], + "uncertainty": { + "level": "low", + "explanation": "The requested operation is narrow." + } + }, + "executed_intents": [ + { + "intent_id": "intent-1", + "snapshot_id": "snapshot-1", + "endpoint_id": "repo-status", + "capability_name": "status", + "capability_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "risk_level": "read", + "requires_approval": false, + "idempotency_key": "idem-1", + "arguments": {} + } + ], + "skipped_intents": [], + "observations": [ + { + "observation_id": "obs-1", + "intent_id": "intent-1", + "status": "recorded", + "summary": "Repository status was read.", + "output": { + "clean": true + }, + "observed_at": "2026-04-27T15:00:00Z" + } + ], + "errors": [], + "final_message": "Completed read-only inspection." +} diff --git a/examples/requester_identity/example1.json b/examples/requester_identity/example1.json new file mode 100644 index 0000000..bc7fc4f --- /dev/null +++ b/examples/requester_identity/example1.json @@ -0,0 +1,8 @@ +{ + "requester_id": "model:local-eval", + "kind": "model", + "trust_level": "low", + "governance_context": { + "workspace": "demo" + } +} diff --git a/examples/reward/example1.json b/examples/reward/example1.json deleted file mode 100644 index 26d3d76..0000000 --- a/examples/reward/example1.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "0.1", - "trace_id": "trace_001", - "reward_sources": [ - "symbolic_verifier" - ], - "step_rewards": [ - { - "step_id": "s2", - "reward": 1.0, - "source": "symbolic_verifier" - } - ], - "trajectory_reward": 1.0, - "credit_assignment": "monte_carlo" -} diff --git a/examples/reward_fusion/example1.json b/examples/reward_fusion/example1.json deleted file mode 100644 index 9ad3a7d..0000000 --- a/examples/reward_fusion/example1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "0.1", - "trace_id": "trace_001", - "fusion_strategy": "confidence_weighted", - "step_fusion": [ - { - "step_id": "s2", - "reward": 0.98, - "sources": ["symbolic_verifier", "neural_verifier"] - } - ], - "trajectory_reward": 0.98 -} diff --git a/examples/tool_invocation/example1.json b/examples/tool_invocation/example1.json deleted file mode 100644 index 59613c0..0000000 --- a/examples/tool_invocation/example1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "tool_name": "search", - "arguments": { - "query": "population of Tokyo" - }, - "result": { - "output": { - "population": 13960000 - } - }, - "triggered_by_step": "s1", - "observation_step": "s2" -} diff --git a/examples/toon/README.md b/examples/toon/README.md deleted file mode 100644 index 5ab966c..0000000 --- a/examples/toon/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# TOON Format Examples - -Side-by-side comparisons of JSON and TOON (Token-Oriented Object Notation) for -Open CoT schemas. See [RFC 0050](../../rfcs/0050-toon-adapter.md) for the -specification and [docs/experiments/toon_format_efficiency.md](../../docs/experiments/toon_format_efficiency.md) -for the experiment card. - -## Files - -| JSON | TOON | Schema | -|------|------|--------| -| `capability-manifest.json` | `capability-manifest.toon` | RFC 0049 capability manifest | -| `reasoning-trace.json` | `reasoning-trace.toon` | RFC 0001 reasoning trace | - -## Token count comparison (approximate, cl100k_base) - -| Fixture | JSON (pretty) | JSON (minified) | TOON | Reduction vs minified | -|---------|---------------|-----------------|------|-----------------------| -| Capability manifest (3 tools) | ~180 tokens | ~130 tokens | ~80 tokens | ~38% | -| Reasoning trace (5 steps) | ~200 tokens | ~155 tokens | ~95 tokens | ~39% | - -These are rough estimates. Run the benchmark script for precise counts with your -tokenizer of choice. - -## How TOON works - -**JSON (repeated keys, braces, quotes):** -```json -[ - { "id": 1, "type": "thought", "content": "I need to check perms.", "confidence": 0.98 }, - { "id": 2, "type": "action", "content": "Checking db_access scope.", "confidence": 1.0 } -] -``` - -**TOON (header + tabular rows):** -``` -steps[2]{id, type, content, confidence}: -1 | thought | I need to check perms. | 0.98 -2 | action | Checking db_access scope. | 1.0 -``` - -The header `steps[2]{id, type, content, confidence}:` declares the array name, -length, and field order once. Each row is pipe-delimited. No repeated keys, no -braces, no quotes on simple values. diff --git a/examples/toon/capability-manifest.json b/examples/toon/capability-manifest.json deleted file mode 100644 index e83cf07..0000000 --- a/examples/toon/capability-manifest.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "manifest_id": "cm_01jqzexample0001", - "run_id": "run_8f3c2a", - "requester_id": "agent_researcher_eu", - "timestamp": "2026-04-18T14:22:05Z", - "phase": "frame", - "tools": { - "available": [ - { - "name": "search", - "description": "Query curated document index", - "access_level": "pre_authorized", - "idempotent": true, - "constraints": { "max_results": 5, "no_raw_html": true } - }, - { - "name": "calculator", - "description": "Safe arithmetic evaluation", - "access_level": "pre_authorized", - "idempotent": true - }, - { - "name": "writeFile", - "description": "Write artifact to workspace", - "access_level": "requires_delegation", - "idempotent": false - } - ], - "blocked": ["shell"] - }, - "budget": { - "steps_remaining": 48, - "tool_calls_remaining": 18, - "tokens_remaining": 95000, - "retries_remaining": 2 - }, - "trust_level": "medium", - "active_constraints": [ - "max 5 results per search", - "no raw HTML in search excerpts" - ] -} diff --git a/examples/toon/capability-manifest.toon b/examples/toon/capability-manifest.toon deleted file mode 100644 index bae347c..0000000 --- a/examples/toon/capability-manifest.toon +++ /dev/null @@ -1,10 +0,0 @@ -[toon:capability_manifest] -tools_available[3]{name, access, idempotent}: -search | pre-authorized | true -calculator | pre-authorized | true -writeFile | requires-delegation | false -tools_blocked: shell -budget{steps, tool_calls, tokens, retries}: 48 | 18 | 95000 | 2 -trust_level: medium -constraints: max 5 results per search; no raw HTML in search excerpts -[/toon:capability_manifest] diff --git a/examples/toon/reasoning-trace.json b/examples/toon/reasoning-trace.json deleted file mode 100644 index beec597..0000000 --- a/examples/toon/reasoning-trace.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "version": "0.8", - "task": "What is the population of Tokyo?", - "steps": [ - { - "id": 1, - "type": "thought", - "content": "I need to search for the current population of Tokyo.", - "confidence": 0.95 - }, - { - "id": 2, - "type": "action", - "content": "search(\"Tokyo population 2026\")", - "confidence": 1.0 - }, - { - "id": 3, - "type": "observation", - "content": "Tokyo metropolitan area population: approximately 13.96 million (2026 estimate).", - "confidence": 0.92 - }, - { - "id": 4, - "type": "thought", - "content": "The search returned a clear answer. I should distinguish between the city proper and the metropolitan area.", - "confidence": 0.88 - }, - { - "id": 5, - "type": "answer", - "content": "Tokyo's population is approximately 13.96 million in the city proper (2026 estimate).", - "confidence": 0.90 - } - ], - "final_answer": "Tokyo's population is approximately 13.96 million in the city proper (2026 estimate)." -} diff --git a/examples/toon/reasoning-trace.toon b/examples/toon/reasoning-trace.toon deleted file mode 100644 index fe453a7..0000000 --- a/examples/toon/reasoning-trace.toon +++ /dev/null @@ -1,11 +0,0 @@ -[toon:reasoning] -version: 0.8 -task: What is the population of Tokyo? -steps[5]{id, type, content, confidence}: -1 | thought | I need to search for the current population of Tokyo. | 0.95 -2 | action | search("Tokyo population 2026") | 1.0 -3 | observation | Tokyo metropolitan area population: approximately 13.96 million (2026 estimate). | 0.92 -4 | thought | The search returned a clear answer. I should distinguish between the city proper and the metropolitan area. | 0.88 -5 | answer | Tokyo's population is approximately 13.96 million in the city proper (2026 estimate). | 0.90 -final_answer: Tokyo's population is approximately 13.96 million in the city proper (2026 estimate). -[/toon:reasoning] diff --git a/examples/verifier_output/example1.json b/examples/verifier_output/example1.json deleted file mode 100644 index 443050c..0000000 --- a/examples/verifier_output/example1.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "0.1", - "trace_id": "trace_001", - "verifier": "symbolic_math_v1", - "results": [ - { - "step_id": "s1", - "correct": "true", - "confidence": 0.99 - } - ] -} diff --git a/harness/README.md b/harness/README.md index c92a846..6ce5450 100644 --- a/harness/README.md +++ b/harness/README.md @@ -1,6 +1,6 @@ # Open CoT Core Reference Package -A TypeScript reference implementation that **proves the Open CoT standard is executable, testable, and operational**. The core package emits, consumes, and validates RFC-compliant reasoning traces — making the schema feel like a contract, not just documentation. +A TypeScript reference implementation that **proves the Open CoT standard is executable, testable, and operational**. The core package emits, consumes, and validates RFC-compliant cognitive pipeline records, making the schema feel like a contract, not just documentation. ## Bidirectional verification @@ -17,7 +17,7 @@ This feedback loop catches schema gaps early — if the core package can't expre ``` src/ - schemas/ TypeScript types mirroring the JSON Schemas (RFC 0001, 0003, 0007, 0017, 0031, 0038) + schemas/ TypeScript types mirroring the compact core JSON Schemas core/ state.ts Cognitive pipeline state: objective, phase, budgets, evidence, trace transitions.ts FSM engine: plan -> inspect -> act -> verify -> repair -> summarize -> stop diff --git a/harness/src/core/validator.ts b/harness/src/core/validator.ts index 312785b..0f5675f 100644 --- a/harness/src/core/validator.ts +++ b/harness/src/core/validator.ts @@ -17,7 +17,7 @@ export interface ValidationResult { errors: string[]; } -// Lazy-loaded compiled validator for rfc-0001 +// Lazy-loaded compiled validator for the cognitive pipeline schema. let _traceValidate: ((data: unknown) => boolean) | null = null; let _traceErrors: (() => Array<{ instancePath?: string; message?: string }>) | null = null; @@ -30,7 +30,7 @@ async function ensureTraceValidator(): Promise { const addFormats = (formatsMod as any).default ?? formatsMod; const ajv = new Ajv({ allErrors: true, strict: false }); addFormats(ajv); - const schema = loadSchema("rfc-0001-reasoning.json"); + const schema = loadSchema("rfc-0007-cognitive-pipeline.json"); const validate = ajv.compile(schema); _traceValidate = (data: unknown) => validate(data) as boolean; _traceErrors = () => @@ -43,7 +43,7 @@ function loadSchema(filename: string): Record { } /** - * Validate a trace against rfc-0001-reasoning.json (the base trace schema). + * Validate a trace against the cognitive pipeline schema. */ export async function validateTrace(trace: Trace): Promise { await ensureTraceValidator(); diff --git a/harness/src/schemas/telemetry.ts b/harness/src/schemas/telemetry.ts index 0c825e4..b93e944 100644 --- a/harness/src/schemas/telemetry.ts +++ b/harness/src/schemas/telemetry.ts @@ -1,7 +1,7 @@ /** - * Telemetry types — RFC 0031 (Cognitive pipeline Observability & Telemetry). + * Telemetry types for local harness instrumentation. * - * Mirrors schemas/rfc-0031-cognitive-pipeline-observability-telemetry.json. + * Telemetry is implementation-local until a compact core RFC promotes it. */ export interface TelemetryMetrics { diff --git a/harness/src/schemas/trace.ts b/harness/src/schemas/trace.ts index 696afd9..be8bbbe 100644 --- a/harness/src/schemas/trace.ts +++ b/harness/src/schemas/trace.ts @@ -1,8 +1,7 @@ /** - * Open CoT Trace types — RFC 0001 (Reasoning) + RFC 0007 (Governed FSM). + * Open CoT trace types for the compact cognitive pipeline contract. * - * These mirror the JSON Schemas in schemas/rfc-0001-reasoning.json and - * the governed trace extension in RFC 0007. + * These mirror the runtime-facing schema in schemas/rfc-0007-cognitive-pipeline.json. */ import type { CompletionStatus } from "./audit-envelope.js"; diff --git a/reference/python/validator.py b/reference/python/validator.py index f2d7deb..cc62138 100644 --- a/reference/python/validator.py +++ b/reference/python/validator.py @@ -1,4 +1,4 @@ -"""Validate CoT traces against the project JSON Schema.""" +"""Validate cognitive pipeline records against the project JSON Schema.""" from __future__ import annotations @@ -12,11 +12,11 @@ jsonschema = None # type: ignore[assignment] _REPO_ROOT = Path(__file__).resolve().parents[2] -_DEFAULT_SCHEMA = _REPO_ROOT / "schemas" / "rfc-0001-reasoning.json" +_DEFAULT_SCHEMA = _REPO_ROOT / "schemas" / "rfc-0007-cognitive-pipeline.json" def load_schema(schema_path: Path | None = None) -> dict[str, Any]: - """Load the canonical reasoning schema (RFC 0001) unless an explicit path is given.""" + """Load the canonical cognitive pipeline schema unless an explicit path is given.""" path = schema_path or _DEFAULT_SCHEMA with path.open(encoding="utf-8") as f: return json.load(f) diff --git a/rfcs/0001-cognitive-artifact.md b/rfcs/0001-cognitive-artifact.md new file mode 100644 index 0000000..31d8a99 --- /dev/null +++ b/rfcs/0001-cognitive-artifact.md @@ -0,0 +1,222 @@ +# RFC 0001 — Cognitive Artifact & Reasoning Evidence (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/1 + +--- + +## Summary + +Defines the typed cognitive artifact emitted by a cognitive function. Reasoning is retained as evidence, never as authority. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0001 - Cognitive Artifact and Reasoning Evidence", + "type": "object", + "additionalProperties": false, + "properties": { + "artifact_id": { + "type": "string", + "minLength": 1 + }, + "schema_version": { + "type": "string", + "enum": [ + "open-cot.core.v1" + ] + }, + "capability_snapshot_id": { + "type": "string", + "minLength": 1 + }, + "intent_verification": { + "type": "object", + "additionalProperties": false, + "required": [ + "objective", + "request_boundaries", + "allowed_scope", + "prohibited_scope" + ], + "properties": { + "objective": { + "type": "string" + }, + "request_boundaries": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_scope": { + "type": "array", + "items": { + "type": "string" + } + }, + "prohibited_scope": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "reasoning_trace": { + "type": "object", + "additionalProperties": false, + "required": [ + "evidence_mode", + "summary", + "steps" + ], + "properties": { + "evidence_mode": { + "type": "string", + "enum": [ + "audit_summary", + "detailed_evidence", + "redacted_evidence" + ] + }, + "summary": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/$defs/reasoning_step" + } + }, + "contains_sensitive_content": { + "type": "boolean" + }, + "redaction_reason": { + "type": "string" + } + } + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "execution_intents": { + "type": "array", + "items": { + "$ref": "rfc-0003-execution-intent.json" + } + }, + "observations": { + "type": "array", + "items": { + "$ref": "rfc-0005-observation-receipt.json#/$defs/observation" + } + }, + "uncertainty": { + "type": "object", + "additionalProperties": false, + "required": [ + "level", + "explanation" + ], + "properties": { + "level": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "explanation": { + "type": "string" + } + } + }, + "yield_reason": { + "type": "string" + } + }, + "required": [ + "artifact_id", + "schema_version", + "capability_snapshot_id", + "intent_verification", + "reasoning_trace", + "assumptions", + "execution_intents", + "observations", + "uncertainty" + ], + "$defs": { + "reasoning_step": { + "type": "object", + "additionalProperties": false, + "required": [ + "step_id", + "kind", + "content", + "visibility" + ], + "properties": { + "step_id": { + "type": "string", + "minLength": 1 + }, + "kind": { + "type": "string", + "enum": [ + "interpretation", + "constraint", + "hypothesis", + "verification", + "yield" + ] + }, + "content": { + "type": "string" + }, + "visibility": { + "type": "string", + "enum": [ + "audit_summary", + "detailed_evidence", + "redacted" + ] + }, + "redaction_reason": { + "type": "string" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + } + } +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0001-initial-schema.md b/rfcs/0001-initial-schema.md deleted file mode 100644 index b1a529b..0000000 --- a/rfcs/0001-initial-schema.md +++ /dev/null @@ -1,159 +0,0 @@ -# RFC 0001 — Initial Structured Reasoning Schema (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.1 -**Discussion:** https://github.com/supernovae/open-cot/discussions/1 ---- - -## 1. Summary - -This RFC defines the initial Open CoT reasoning trace schema: a model-agnostic JSON structure for recording tasks, reasoning steps, and final answers. - -It provides a minimal core for: - -- chain-of-thought traces -- tool-augmented reasoning -- verifier sidecars -- benchmark and training datasets -- deterministic replay in cognitive pipelines - ---- - -## 2. Design goals - -### 2.1 Must-have goals - -- Model-agnostic representation. -- Structured, machine-validated fields. -- Extensible step graph representation. -- Compatibility with sidecars defined in RFC 0002 and RFC 0003. - -### 2.2 Non-goals - -- Defining a specific training recipe. -- Requiring one universal cognitive pipeline runtime. -- Standardizing hidden model internals. - ---- - -## 3. Schema overview - -A reasoning trace document includes: - -- `version`: schema instance version (`"0.1"` for this RFC) -- `task`: prompt or task description -- `steps[]`: ordered list of typed reasoning steps -- `final_answer`: final model output - -Each step may include: - -- `id`, `type`, `content` -- `parent` and `children` for graph linkage -- optional evidence and verification metadata - ---- - -## 4. Full schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Reasoning Trace v0.1", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.1"] }, - "task": { "type": "string" }, - "steps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { "type": "string" }, - "type": { "type": "string" }, - "content": { "type": "string" }, - "parent": { - "oneOf": [ - { "type": "string" }, - { "type": "array", "items": { "type": "string" } } - ] - }, - "children": { "type": "array", "items": { "type": "string" } }, - "evidence": { "type": "array", "items": { "type": "string" } }, - "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, - "verification_status": { - "type": "string", - "enum": ["verified", "failed", "unknown"] - }, - "verifier_score": { "type": "number" } - }, - "required": ["id", "type", "content"] - } - }, - "final_answer": { "type": "string" } - }, - "required": ["version", "task", "steps", "final_answer"] -} -``` - - ---- - -## 5. Example - -```json -{ - "version": "0.1", - "task": "What is 17 * 23?", - "steps": [ - { "id": "s1", "type": "thought", "content": "Break 23 into 20 + 3." }, - { "id": "s2", "type": "calculation", "content": "17 * 20 = 340", "parent": "s1" }, - { "id": "s3", "type": "calculation", "content": "17 * 3 = 51", "parent": "s1" }, - { "id": "s4", "type": "thought", "content": "340 + 51 = 391", "parent": "s1" } - ], - "final_answer": "391" -} -``` - ---- - -## 6. Open Questions Resolution (normative closure) - -### 6.1 Scope expansion fields - -- **Decision:** Keep token timing, model metadata, RL rewards, and multi-party fields optional and out of the required core object. -- **Rationale:** Preserves broad interoperability and avoids forcing runtime-specific internals. -- **Normative requirement:** Core traces **MUST** validate with only fields in this RFC. Additional fields **MAY** be attached as extensions or linked sidecars. -- **Migration note:** Future versions can promote extensions to first-class fields only with a major compatibility review. - -### 6.2 Structural enforcement strictness - -- **Decision:** Introduce validation levels (L0/L1/L2) as implementation guidance. -- **Rationale:** Different users need different strictness without fragmenting schema compatibility. -- **Normative requirement:** L0 validators **MUST** enforce JSON Schema validity; L1 validators **SHOULD** check parent/child linkage consistency; L2 validators **MAY** enforce DAG and recursion limits. -- **Migration note:** Tightening L1/L2 checks should ship with explicit migration notes in RFC updates. - -### 6.3 Canonical sidecar standards - -- **Decision:** Delegate verifier and tool invocation standards to RFC 0002 and RFC 0003. -- **Rationale:** Keeps RFC 0001 minimal and avoids duplicate authority. -- **Normative requirement:** Implementations claiming Profile B compatibility **MUST** support RFC 0002 and RFC 0003 sidecar formats. -- **Migration note:** Any cross-RFC field alignment must be documented in both RFC 0001 and the affected sidecar RFC. - ---- - -## 7. Acceptance criteria - -This RFC is accepted when: - -- At least 3 maintainers approve it. -- A reference validator passes against the schema. -- At least one example dataset uses this format. -- At least one cognitive pipeline implementation emits schema-valid traces. - ---- - -## 8. Conclusion - -RFC 0001 defines the stable core trace contract for Open CoT. It prioritizes a minimal required structure with explicit extension points so OSS implementations can interoperate while iterating. diff --git a/rfcs/0002-capability-snapshot.md b/rfcs/0002-capability-snapshot.md new file mode 100644 index 0000000..06cd18b --- /dev/null +++ b/rfcs/0002-capability-snapshot.md @@ -0,0 +1,112 @@ +# RFC 0002 — Capability Snapshot & Endpoint Descriptor (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/2 + +--- + +## Summary + +Defines the immutable capability snapshot injected into cognition before any execution intent can be proposed. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0002 - Capability Snapshot and Endpoint Descriptor", + "type": "object", + "additionalProperties": false, + "properties": { + "snapshot_id": { + "type": "string", + "minLength": 1 + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "capabilities_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "capabilities": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "endpoint_id", + "capability_name", + "description", + "input_schema", + "risk_level", + "requires_approval", + "capability_digest" + ], + "properties": { + "endpoint_id": { + "type": "string", + "minLength": 1 + }, + "capability_name": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string" + }, + "input_schema": { + "type": "object", + "additionalProperties": true + }, + "output_schema": { + "type": "object", + "additionalProperties": true + }, + "risk_level": { + "type": "string", + "enum": [ + "read", + "write", + "destructive", + "external_side_effect" + ] + }, + "requires_approval": { + "type": "boolean" + }, + "capability_digest": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + } + } + } + } + }, + "required": [ + "snapshot_id", + "created_at", + "capabilities_hash", + "capabilities" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0002-verifier-output-schema.md b/rfcs/0002-verifier-output-schema.md deleted file mode 100644 index f62e68b..0000000 --- a/rfcs/0002-verifier-output-schema.md +++ /dev/null @@ -1,258 +0,0 @@ -# RFC 0002 — Verifier Output Schema (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.1 -**Discussion:** https://github.com/supernovae/open-cot/discussions/2 ---- - -## 1. Summary - -This RFC proposes the **Verifier Output Schema**, a structured format for representing the results of step‑level verification applied to reasoning traces. -It complements RFC 0001 (Initial Reasoning Schema) by defining how external verifiers — symbolic, neural, hybrid, or rule‑based — report: - -- correctness -- confidence -- error types -- justifications -- reward signals (optional) - -This schema is designed to support: - -- step‑level correctness checking -- RL reward shaping (R1‑style training) -- long‑horizon reasoning stability -- dataset labeling -- automated evaluation pipelines -- multi‑verifier ensembles - ---- - -## 2. Motivation - -Modern reasoning models increasingly rely on **verifiable intermediate steps**: - -- DeepSeek‑R1 uses verifiable scratchpads for RL. -- Qwen‑R1 uses step‑level reward shaping. -- “Let’s Verify Step by Step” shows verification dramatically improves accuracy. -- Math and logic tasks require symbolic correctness. -- Cognitive pipeline frameworks need to validate tool outputs and reasoning transitions. - -However, there is **no open standard** for representing verifier outputs. - -This leads to: - -- incompatible formats across projects -- difficulty comparing verifier performance -- inconsistent RL reward signals -- fragmented evaluation pipelines -- inability to share verified datasets - -This RFC defines a **unified, model‑agnostic schema** for verifier outputs. - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- **Compatible with RFC 0001** (step IDs, structure). -- **Supports multiple verifier types** (symbolic, neural, hybrid). -- **Captures correctness, confidence, and justification.** -- **Supports RL reward shaping** (optional). -- **Extensible** for future verifier types. -- **Minimal** enough for adoption. - -### 3.2 Non‑Goals -- Defining how verifiers work internally. -- Mandating a specific reward function. -- Requiring symbolic or neural verification. -- Enforcing a single correctness metric. - ---- - -## 4. Verifier Output Overview - -A **Verifier Output** is a mapping from: - -step_id → verification_result - - -Each verification result includes: - -- correctness (`true`, `false`, `unknown`) -- confidence (0–1) -- error type (optional) -- justification (optional natural language) -- reward (optional numeric signal) -- metadata (optional) - ---- - -## 5. Full Schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Verifier Output v0.1", - "type": "object", - - "properties": { - "version": { - "type": "string", - "enum": ["0.1"], - "description": "Schema version." - }, - - "trace_id": { - "type": "string", - "description": "Optional ID linking to a reasoning trace." - }, - - "verifier": { - "type": "string", - "description": "Name or identifier of the verifier." - }, - - "results": { - "type": "array", - "description": "Verification results for each reasoning step.", - "items": { - "type": "object", - "properties": { - "step_id": { - "type": "string", - "description": "ID of the step being verified (matches RFC 0001)." - }, - - "correct": { - "type": "string", - "enum": ["true", "false", "unknown"], - "description": "Whether the step is correct." - }, - - "confidence": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Verifier confidence in the correctness judgment." - }, - - "error_type": { - "type": "string", - "description": "Optional classification of the error.", - "enum": [ - "arithmetic", - "logical", - "factual", - "hallucination", - "unsupported_claim", - "invalid_tool_use", - "format_error", - "other" - ] - }, - - "justification": { - "type": "string", - "description": "Optional natural-language explanation of the verdict." - }, - - "reward": { - "type": "number", - "description": "Optional RL reward signal for this step." - }, - - "metadata": { - "type": "object", - "description": "Optional additional verifier-specific metadata." - } - }, - "required": ["step_id", "correct"] - } - } - }, - - "required": ["version", "results"] -} -``` - - -## 6. Example - -### 6.1 Verifier Output for a Simple Math Trace - -```json -{ - "version": "0.1", - "trace_id": "trace_001", - "verifier": "symbolic_math_v1", - - "results": [ - { - "step_id": "s2", - "correct": "true", - "confidence": 0.99, - "justification": "17 * 20 = 340 is correct." - }, - { - "step_id": "s3", - "correct": "true", - "confidence": 0.98, - "justification": "17 * 3 = 51 is correct." - }, - { - "step_id": "s4", - "correct": "true", - "confidence": 0.97, - "justification": "340 + 51 = 391 is correct.", - "reward": 1.0 - } - ] -} -``` - -## 7. Open Questions Resolution (normative closure) - -### 7.1 Ensemble and proof support - -- **Decision:** Multi-verifier composition is supported through RFC 0006, and proof payloads remain optional extensions. -- **Rationale:** Keeps verifier output interoperable while allowing richer verifier ecosystems. -- **Normative requirement:** Single-verifier payloads **MUST** validate standalone; ensemble workflows **SHOULD** emit RFC 0006 artifacts when multiple verifier streams are fused. -- **Migration note:** Adding mandatory proof objects would be a breaking change and requires a major migration note. - -### 7.2 Reward semantics - -- **Decision:** Rewards are optional by default and expected to be normalized when present. -- **Rationale:** Not every verifier output is used for RL, but cross-pipeline comparability still benefits from common scaling. -- **Normative requirement:** Verifier rewards **MAY** be omitted. If emitted, reward values **SHOULD** be in [-1, 1], and RL-focused traces **MUST** document normalization policy. -- **Migration note:** Teams moving from unbounded rewards should add explicit normalization config in dataset metadata. - -### 7.3 Error taxonomy and calibration - -- **Decision:** Reuse RFC 0018 taxonomy patterns and keep confidence calibration explicit but non-prescriptive. -- **Rationale:** Avoids duplicate taxonomies while preserving portability. -- **Normative requirement:** Verifier outputs **SHOULD** include machine-readable error categories when failures occur, and confidence fields **MUST** remain numeric probabilities in [0,1]. -- **Migration note:** Existing free-form error text should be mapped to structured categories during migration. - - -## 8. Acceptance Criteria - -This RFC will be accepted when: - -At least 3 maintainers approve it. -A reference implementation can validate verifier outputs. -At least one verifier (symbolic or neural) emits this format. -At least one reasoning trace (RFC 0001) is paired with verifier output. - -## 9. Conclusion - -This RFC establishes the Verifier Output Schema, enabling: - -* step‑level correctness checking -* structured evaluation -* RL reward shaping -* dataset labeling -* multi‑verifier pipelines - -Together with RFC 0001, it forms the foundation of a fully open, structured reasoning ecosystem. \ No newline at end of file diff --git a/rfcs/0003-execution-intent.md b/rfcs/0003-execution-intent.md new file mode 100644 index 0000000..650a860 --- /dev/null +++ b/rfcs/0003-execution-intent.md @@ -0,0 +1,107 @@ +# RFC 0003 — Execution Intent & Endpoint Invocation (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/3 + +--- + +## Summary + +Defines execution intent as a typed request for a known endpoint capability, bound to a snapshot and digest. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0003 - Execution Intent and Endpoint Invocation", + "type": "object", + "additionalProperties": false, + "properties": { + "intent_id": { + "type": "string", + "minLength": 1 + }, + "snapshot_id": { + "type": "string", + "minLength": 1 + }, + "endpoint_id": { + "type": "string", + "minLength": 1 + }, + "capability_name": { + "type": "string", + "minLength": 1 + }, + "capability_digest": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "risk_level": { + "type": "string", + "enum": [ + "read", + "write", + "destructive", + "external_side_effect" + ] + }, + "requires_approval": { + "type": "boolean" + }, + "idempotency_key": { + "type": "string", + "minLength": 1 + }, + "arguments": { + "type": "object" + }, + "preconditions": { + "type": "array", + "items": { + "type": "string" + } + }, + "expected_result_shape": { + "type": "object", + "additionalProperties": true + }, + "postconditions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "intent_id", + "snapshot_id", + "endpoint_id", + "capability_name", + "capability_digest", + "risk_level", + "requires_approval", + "idempotency_key", + "arguments" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0003-tool-invocation-schema.md b/rfcs/0003-tool-invocation-schema.md deleted file mode 100644 index 86e019b..0000000 --- a/rfcs/0003-tool-invocation-schema.md +++ /dev/null @@ -1,269 +0,0 @@ -# RFC 0003 — Tool Invocation Schema (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.1 -**Discussion:** https://github.com/supernovae/open-cot/discussions/3 ---- - -## 1. Summary - -This RFC proposes the **Tool Invocation Schema**, a structured, model‑agnostic format for representing tool calls within reasoning traces. -It extends RFC 0001 (Reasoning Schema) by defining how LLMs should express: - -- tool selection -- tool arguments -- tool execution -- tool outputs -- error handling -- integration with reasoning steps - -This schema is compatible with: - -- **ReAct** (Thought → Action → Observation) -- **OpenAI function calling** -- **JSON‑based tool APIs** -- **LangChain / LangGraph tool nodes** -- **agentic coding frameworks** -- **R1‑style RL training with tool feedback** - ---- - -## 2. Motivation - -Tool use is now a core part of modern LLM reasoning: - -- ReAct introduced interleaved reasoning + actions. -- Cognitive pipeline frameworks rely on structured tool calls. -- Coding pipelines require deterministic tool invocation formats. -- RL‑trained reasoning models use tool feedback as reward signals. -- Multi‑step planning requires consistent action/observation structure. - -However: - -- Every framework uses a different tool schema. -- Tool calls are often embedded in unstructured text. -- Observations are inconsistently formatted. -- Error handling is ad‑hoc. -- No open standard exists for tool invocation within reasoning traces. - -This RFC defines a **unified, interoperable, verifiable** schema for tool use. - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- **Compatible with RFC 0001** (step IDs, structure). -- **Supports ReAct** (thought → action → observation). -- **Supports JSON‑based tool APIs**. -- **Supports deterministic parsing**. -- **Supports error reporting**. -- **Supports multi‑tool workflows**. -- **Extensible** for future cognitive pipeline frameworks. - -### 3.2 Non‑Goals -- Defining tool semantics. -- Defining a universal tool registry. -- Enforcing a specific cognitive pipeline. -- Encoding proprietary tool metadata. - ---- - -## 4. Tool Invocation Model - -A tool invocation consists of: - -1. **Action Step** - - specifies the tool - - includes arguments - - references the reasoning step that triggered it - -2. **Observation Step** - - contains the tool output - - may include structured or unstructured results - - may include error information - -This mirrors ReAct and modern cognitive pipeline frameworks. - ---- - -## 5. Full Schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Tool Invocation v0.1", - "type": "object", - - "properties": { - "tool_name": { - "type": "string", - "description": "Name of the tool being invoked." - }, - - "arguments": { - "type": "object", - "description": "JSON arguments passed to the tool." - }, - - "result": { - "type": "object", - "description": "Structured output returned by the tool.", - "properties": { - "output": { - "description": "Primary tool output (string or structured)." - }, - "error": { - "type": "string", - "description": "Optional error message if the tool failed." - }, - "metadata": { - "type": "object", - "description": "Optional tool-specific metadata." - } - } - }, - - "triggered_by_step": { - "type": "string", - "description": "ID of the reasoning step that triggered this tool call." - }, - - "observation_step": { - "type": "string", - "description": "ID of the observation step that records the tool output." - } - }, - - "required": ["tool_name", "arguments", "triggered_by_step"] -} -``` - - - -## 6. Integration with RFC 0001 (Reasoning Schema) - -Tool invocations appear as steps of type: - -* "action" — tool call - -* "observation" — tool output - -Example: - -```json -{ - "id": "s3", - "type": "action", - "content": "call:search", - "tool_invocation": { - "tool_name": "search", - "arguments": { "query": "population of Tokyo" }, - "triggered_by_step": "s2" - } -} -``` - -And the observation: - -```json -{ - "id": "s4", - "type": "observation", - "content": "Tokyo population is 13.96 million.", - "parent": "s3" -} -``` - -## 7. Example: ReAct-Style Tool Use - -```json -{ - "version": "0.1", - "task": "Find the current weather in Austin, TX.", - "steps": [ - { - "id": "s1", - "type": "thought", - "content": "I should call the weather API." - }, - { - "id": "s2", - "type": "action", - "content": "call:weather_api", - "tool_invocation": { - "tool_name": "weather_api", - "arguments": { "city": "Austin", "state": "TX" }, - "triggered_by_step": "s1" - } - }, - { - "id": "s3", - "type": "observation", - "content": "{\"temp\": 72, \"conditions\": \"Clear\"}", - "parent": "s2" - }, - { - "id": "s4", - "type": "thought", - "content": "The weather is clear and 72 degrees." - } - ], - "final_answer": "Clear skies, 72°F." -} -``` - -## 8. Error Handling - -```json -{ - "result": { - "error": "Timeout contacting weather API." - } -} -``` - -Observation steps should reflect the failure: - -```json -{ - "id": "s3", - "type": "observation", - "content": "ERROR: Timeout contacting weather API.", - "parent": "s2" -} -``` - -## 9. Open Questions Resolution (normative closure) - -### 9.1 Runtime behavior features - -- **Decision:** Streaming, async parallel execution, cancellation, and tool version metadata are supported as optional capabilities. -- **Rationale:** These features are runtime-dependent and should not block minimal implementations. -- **Normative requirement:** Implementations **MUST** support non-streaming single-call invocations. Advanced behaviors **MAY** be advertised through capability metadata. -- **Migration note:** Systems adding async/streaming should maintain compatibility with non-streaming readers. - -### 9.2 Tool typing and metadata - -- **Decision:** Tool families remain extensible, with recommended normalized metadata fields. -- **Rationale:** Tool ecosystems evolve rapidly; strict global enums would churn excessively. -- **Normative requirement:** Tool identifiers **MUST** be stable strings; metadata **SHOULD** include version and provider/source; structured error categories **SHOULD** align with RFC 0018. -- **Migration note:** Existing ad hoc tool names should be aliased and documented before deprecating legacy forms. - -### 9.3 Embedded vs detached storage - -- **Decision:** Canonical form remains embedded invocation records; detached storage is allowed with stable references. -- **Rationale:** Embedded form simplifies replay and fixture validation. -- **Normative requirement:** Embedded invocation objects **MUST** be sufficient for local replay. Detached artifacts **MAY** be used, but references **MUST** be resolvable. -- **Migration note:** If migrating to detached logs, maintain dual-write until all consumers resolve references. - -## 10. Acceptance Criteria - -This RFC will be accepted when: - -At least 3 maintainers approve it. -A reference implementation can parse and validate tool invocations. -At least one cognitive pipeline emits this schema. -At least one dataset includes tool‑augmented reasoning traces. \ No newline at end of file diff --git a/rfcs/0004-branching-reasoning-schema.md b/rfcs/0004-branching-reasoning-schema.md deleted file mode 100644 index a84226d..0000000 --- a/rfcs/0004-branching-reasoning-schema.md +++ /dev/null @@ -1,239 +0,0 @@ -# RFC 0004 — Branching Reasoning Extensions (ToT / GoT) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.2 -**Discussion:** https://github.com/supernovae/open-cot/discussions/4 ---- - -## 1. Summary - -This RFC proposes **branching and graph‑structured reasoning extensions** to the Open CoT Reasoning Schema. -It enables representation of: - -- **Tree‑of‑Thoughts (ToT)** -- **Graph‑of‑Thoughts (GoT)** -- **multi‑path exploration** -- **search‑based reasoning** -- **beam search / BFS / DFS reasoning** -- **pruned branches** -- **branch scoring and selection** - -These extensions build on RFC 0001 (Initial Reasoning Schema) and introduce new fields and conventions for representing non‑linear reasoning. - ---- - -## 2. Motivation - -Linear Chain‑of‑Thought is insufficient for many reasoning tasks: - -- Complex planning -- Mathematical proofs -- Multi‑step coding tasks -- Search problems -- Multi‑hypothesis reasoning -- RL‑trained long‑horizon reasoning - -Research such as **Tree‑of‑Thoughts** and **Graph‑of‑Thoughts** demonstrates that **branching exploration** significantly improves performance. - -However: - -- No open standard exists for representing branching reasoning. -- Existing implementations use ad‑hoc formats. -- Cognitive pipeline frameworks cannot interoperate. -- RL pipelines cannot train on structured search traces. -- Datasets cannot represent multi‑path reasoning. - -This RFC defines a **unified, interoperable, graph‑friendly extension** to the reasoning schema. - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- Support **trees** (ToT) and **graphs** (GoT). -- Support **branch scoring** and **pruning**. -- Support **multiple candidate paths**. -- Maintain compatibility with RFC 0001. -- Allow **partial or full exploration traces**. -- Support **search algorithms** (BFS, DFS, beam search). -- Support **RL reward propagation** across branches. - -### 3.2 Non‑Goals -- Defining a specific search algorithm. -- Enforcing a particular branching strategy. -- Representing full cognitive pipeline state machines. -- Encoding model weights or proprietary metadata. - ---- - -## 4. Branching Model - -A reasoning trace may contain: - -- **nodes** (steps) -- **edges** (parent → child relationships) -- **branch groups** (sets of alternative paths) -- **branch scores** (model‑assigned or verifier‑assigned) -- **pruned branches** (optional) - -This RFC introduces: - -- `branch_group` -- `branch_score` -- `pruned` -- `exploration_strategy` -- `path_id` - -These fields extend the existing step structure. - ---- - -## 5. Schema Extensions (JSON) - -Below are **additions** to the RFC 0001 schema. - - -```json -{ - "branch_group": { - "type": "string", - "description": "Identifier for a set of sibling branches exploring alternative reasoning paths." - }, - - "branch_score": { - "type": "number", - "minimum": -1, - "maximum": 1, - "description": "Score assigned to this branch (model, verifier, or search algorithm)." - }, - - "pruned": { - "type": "boolean", - "description": "Whether this branch was pruned during search." - }, - - "exploration_strategy": { - "type": "string", - "enum": ["bfs", "dfs", "beam", "heuristic", "rl", "unknown"], - "description": "Search strategy used to explore this branch." - }, - - "path_id": { - "type": "string", - "description": "Identifier for a complete reasoning path from root to leaf." - } -} -``` - - - -## 6. Example: Tree-of-Thoughts (ToT) - -```json -{ - "version": "0.1", - "task": "Find a plan to visit 3 landmarks in Paris.", - - "steps": [ - { - "id": "root", - "type": "thought", - "content": "Consider possible sequences of landmarks.", - "children": ["b1", "b2"] - }, - - { - "id": "b1", - "type": "branch", - "branch_group": "g1", - "content": "Path A: Louvre → Eiffel Tower → Notre Dame", - "branch_score": 0.72, - "children": ["b1a"] - }, - - { - "id": "b1a", - "type": "thought", - "content": "Evaluate travel time for Path A.", - "parent": "b1" - }, - - { - "id": "b2", - "type": "branch", - "branch_group": "g1", - "content": "Path B: Notre Dame → Louvre → Eiffel Tower", - "branch_score": 0.64, - "pruned": false, - "children": ["b2a"] - }, - - { - "id": "b2a", - "type": "thought", - "content": "Evaluate travel time for Path B.", - "parent": "b2" - } - ], - - "final_answer": "Path A is optimal based on travel time and ordering." -} -``` - -## 7. Example: Graph-of-Thoughts (GoT) - -```json -{ - "id": "n3", - "type": "thought", - "content": "Combine results from n1 and n2.", - "parent": ["n1", "n2"], - "path_id": "p1" -} -``` - -This supports DAG-style reasoning - -## 8. Open Questions Resolution (normative closure) - -### 8.1 Branch metadata richness - -- **Decision:** Weighted/probabilistic branches and branch metadata are allowed as optional fields. -- **Rationale:** Search-heavy systems need richer annotations, but minimal traces should remain simple. -- **Normative requirement:** Core branching fields **MUST** remain valid without weights; weighted extensions **MAY** be attached with numeric values in [0,1] where probabilities are used. -- **Migration note:** Pipelines that previously used free-form branch scores should normalize into explicit numeric fields. - -### 8.2 Pruning semantics - -- **Decision:** Pruning uses multi-valued status labels rather than a binary-only flag. -- **Rationale:** Multi-valued labels preserve decision provenance for benchmarking and debugging. -- **Normative requirement:** Pruning annotations **SHOULD** use explicit categorical labels (`none`, `beam_pruned`, `depth_pruned`, `score_pruned`, `other`). -- **Migration note:** Boolean pruning fields should be upgraded to categorical labels in conversion scripts. - -### 8.3 Scoring and ranking - -- **Decision:** No single mandatory branch scorer is defined in this RFC; ranking policy is implementation-defined but must be declared. -- **Rationale:** Different tasks require different score models. -- **Normative requirement:** If path ranking is emitted, ranking method metadata **MUST** be present and reproducible. -- **Migration note:** Existing implicit ranking logic should be surfaced in benchmark run cards. - -## 9. Acceptance Criteria - -This RFC will be accepted when: - -At least 3 maintainers approve it. -A reference implementation can parse branching traces. -At least one ToT or GoT example dataset is converted. -At least one cognitive pipeline emits branching traces. - -## 10. Conclusion - -This RFC introduces branching reasoning extensions that enable: - -* Tree‑of‑Thoughts -* Graph‑of‑Thoughts -* multi‑path exploration -* search‑based reasoning -* RL‑compatible reasoning graphs - diff --git a/rfcs/0004-policy-gate.md b/rfcs/0004-policy-gate.md new file mode 100644 index 0000000..7262a49 --- /dev/null +++ b/rfcs/0004-policy-gate.md @@ -0,0 +1,77 @@ +# RFC 0004 — Policy Gate & Permission Evaluation (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/4 + +--- + +## Summary + +Defines policy gate outputs. Schema validity proves shape; policy evaluation controls permission. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0004 - Policy Gate and Permission Evaluation", + "type": "object", + "additionalProperties": false, + "properties": { + "evaluation_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string" + }, + "evaluated_at": { + "type": "string", + "format": "date-time" + }, + "result": { + "type": "string", + "enum": [ + "allow", + "deny", + "requires_approval", + "yield" + ] + }, + "reason": { + "type": "string" + }, + "constraints": { + "type": "object", + "additionalProperties": true + }, + "budget_snapshot": { + "$ref": "rfc-0008-execution-budget.json" + } + }, + "required": [ + "evaluation_id", + "evaluated_at", + "result", + "reason" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0005-observation-receipt.md b/rfcs/0005-observation-receipt.md new file mode 100644 index 0000000..39cd550 --- /dev/null +++ b/rfcs/0005-observation-receipt.md @@ -0,0 +1,129 @@ +# RFC 0005 — Observation, Receipt & Audit Evidence (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/5 + +--- + +## Summary + +Defines observations and receipts as replayable evidence for endpoint execution and skipped work. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0005 - Observation, Receipt, and Audit Evidence", + "type": "object", + "additionalProperties": false, + "properties": { + "observation": { + "$ref": "#/$defs/observation" + }, + "receipt": { + "$ref": "#/$defs/receipt" + } + }, + "$defs": { + "observation": { + "type": "object", + "additionalProperties": false, + "required": [ + "observation_id", + "status", + "summary", + "observed_at" + ], + "properties": { + "observation_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "recorded", + "skipped", + "error" + ] + }, + "summary": { + "type": "string" + }, + "output": {}, + "observed_at": { + "type": "string", + "format": "date-time" + } + } + }, + "receipt": { + "type": "object", + "additionalProperties": false, + "required": [ + "receipt_id", + "intent_id", + "endpoint_id", + "status", + "issued_at" + ], + "properties": { + "receipt_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string", + "minLength": 1 + }, + "endpoint_id": { + "type": "string", + "minLength": 1 + }, + "status": { + "type": "string", + "enum": [ + "executed", + "skipped", + "failed" + ] + }, + "input_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "output_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "issued_at": { + "type": "string", + "format": "date-time" + } + } + } + } +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0005-rl-reward-trace-schema.md b/rfcs/0005-rl-reward-trace-schema.md deleted file mode 100644 index 94fc71c..0000000 --- a/rfcs/0005-rl-reward-trace-schema.md +++ /dev/null @@ -1,259 +0,0 @@ -# RFC 0005 — RL Reward Trace Schema (R1‑Style) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.2 -**Discussion:** https://github.com/supernovae/open-cot/discussions/5 ---- - -## 1. Summary - -This RFC proposes the **RL Reward Trace Schema**, a structured format for representing reinforcement learning (RL) reward signals associated with reasoning traces. -It extends: - -- **RFC 0001** — Reasoning Schema -- **RFC 0002** — Verifier Output Schema -- **RFC 0004** — Branching Reasoning Extensions - -This schema is designed to support: - -- **R1‑style RL training** (DeepSeek‑R1, Qwen‑R1, etc.) -- **verifiable scratchpads** -- **step‑level reward shaping** -- **branch‑level reward propagation** -- **trajectory‑level reward aggregation** -- **multi‑verifier reward fusion** - -The goal is to create a **unified, open standard** for representing RL signals used to train reasoning‑capable LLMs. - ---- - -## 2. Motivation - -Modern reasoning models increasingly rely on RL: - -- DeepSeek‑R1 uses verifiable intermediate steps to generate reward signals. -- Qwen‑R1 uses step‑level reward shaping and long‑horizon credit assignment. -- OpenAI’s o‑series uses structured scratchpads with verifiable steps. -- RLHF and RLAIF pipelines require structured reward traces. - -However: - -- There is **no open standard** for representing RL reward traces. -- Existing RL pipelines use incompatible formats. -- Datasets cannot share reward‑annotated reasoning traces. -- Verifier outputs and reward signals are not integrated. -- Branching reasoning (ToT/GoT) requires reward propagation across paths. - -This RFC defines a **model‑agnostic, interoperable reward trace schema**. - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- Support **step‑level**, **branch‑level**, and **trajectory‑level** rewards. -- Integrate cleanly with RFC 0001, 0002, and 0004. -- Support **multiple reward sources** (verifiers, heuristics, human feedback). -- Support **reward shaping** and **credit assignment**. -- Support **RL training pipelines** (PPO, GRPO, DPO‑R, etc.). -- Support **R1‑style verifiable scratchpads**. - -### 3.2 Non‑Goals -- Defining a specific RL algorithm. -- Defining a universal reward function. -- Encoding model weights or gradients. -- Representing full training logs. - ---- - -## 4. Reward Model - -A reward trace may include: - -- **step_rewards** — reward for each reasoning step -- **branch_rewards** — reward for each branch (ToT/GoT) -- **trajectory_reward** — reward for the entire reasoning trajectory -- **reward_sources** — verifiers, heuristics, human feedback, etc. -- **credit_assignment** — how rewards propagate backward - -This schema supports: - -- sparse rewards -- dense rewards -- shaped rewards -- multi‑source reward fusion -- RLHF / RLAIF / verifier‑based RL - ---- - -## 5. Full Schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT RL Reward Trace v0.1", - "type": "object", - - "properties": { - "version": { - "type": "string", - "enum": ["0.1"], - "description": "Schema version." - }, - - "trace_id": { - "type": "string", - "description": "ID linking to a reasoning trace (RFC 0001)." - }, - - "reward_sources": { - "type": "array", - "description": "List of reward sources (verifiers, heuristics, humans, etc.).", - "items": { "type": "string" } - }, - - "step_rewards": { - "type": "array", - "description": "Reward assigned to each reasoning step.", - "items": { - "type": "object", - "properties": { - "step_id": { - "type": "string", - "description": "ID of the step being rewarded." - }, - "reward": { - "type": "number", - "description": "Reward value for this step." - }, - "source": { - "type": "string", - "description": "Source of the reward (verifier, heuristic, human)." - } - }, - "required": ["step_id", "reward"] - } - }, - - "branch_rewards": { - "type": "array", - "description": "Reward assigned to branches (ToT/GoT).", - "items": { - "type": "object", - "properties": { - "branch_group": { - "type": "string", - "description": "Branch group ID (RFC 0004)." - }, - "path_id": { - "type": "string", - "description": "Path identifier for this branch." - }, - "reward": { - "type": "number", - "description": "Reward for this branch." - } - }, - "required": ["reward"] - } - }, - - "trajectory_reward": { - "type": "number", - "description": "Reward for the entire reasoning trajectory." - }, - - "credit_assignment": { - "type": "string", - "enum": ["monte_carlo", "temporal_difference", "heuristic", "unknown"], - "description": "Method used to propagate rewards backward." - } - }, - - "required": ["version"] -} -``` - - - -## 6. Example: R1-Style Reward Trace - -```json -{ - "version": "0.1", - "trace_id": "trace_001", - "reward_sources": ["symbolic_verifier", "heuristic_scoring"], - - "step_rewards": [ - { "step_id": "s2", "reward": 1.0, "source": "symbolic_verifier" }, - { "step_id": "s3", "reward": 1.0, "source": "symbolic_verifier" }, - { "step_id": "s4", "reward": 1.0, "source": "symbolic_verifier" } - ], - - "trajectory_reward": 1.0, - "credit_assignment": "monte_carlo" -} -``` - -## 7. Example: Branch-Level Reward (ToT) - -```json -{ - "branch_rewards": [ - { - "branch_group": "g1", - "path_id": "p1", - "reward": 0.72 - }, - { - "branch_group": "g1", - "path_id": "p2", - "reward": 0.64 - } - ] -} -``` - -## 8. Open Questions Resolution (normative closure) - -### 8.1 Reward shape and uncertainty - -- **Decision:** Negative rewards, normalization, trajectory aggregation, and uncertainty estimates are all supported. -- **Rationale:** RL-style learning requires penalties and confidence-aware reward interpretation. -- **Normative requirement:** Reward values **SHOULD** be normalized to [-1,1]; uncertainty **MAY** be included as optional fields (`stddev`, `confidence_interval`). -- **Migration note:** Unbounded historical rewards should be transformed via documented normalization policy. - -### 8.2 Source harmonization - -- **Decision:** RLHF and RLAIF remain provenance distinctions, not schema forks. -- **Rationale:** A common reward envelope keeps datasets interoperable. -- **Normative requirement:** Multi-source reward traces **MUST** include source identifiers and fusion policy metadata when combined. -- **Migration note:** Pipelines with source-specific structures should map into shared reward objects with explicit source tags. - -### 8.3 Storage model - -- **Decision:** Detached reward traces remain canonical for reproducibility and modularity. -- **Rationale:** Sidecar storage supports independent recomputation and audit. -- **Normative requirement:** Reward traces **MUST** reference stable trace/step IDs from RFC 0001 artifacts. Embedded rewards **MAY** be emitted as convenience copies only. -- **Migration note:** Embedded-only workflows should adopt sidecar emission to satisfy long-term interoperability requirements. - -## 9. Acceptance Criteria -This RFC will be accepted when: - -At least 3 maintainers approve it. -A reference implementation can parse reward traces. -At least one RL pipeline emits this schema. -At least one dataset includes reward‑annotated traces. - -## 10. Conclusion -This RFC introduces the RL Reward Trace Schema, enabling: - -R1‑style RL training -verifiable scratchpads -step‑level reward shaping -branch‑level reward propagation -trajectory‑level reward aggregation - -multi‑source reward fusion diff --git a/rfcs/0006-multi-verifier-ensemble-schema.md b/rfcs/0006-multi-verifier-ensemble-schema.md deleted file mode 100644 index 2bf9fef..0000000 --- a/rfcs/0006-multi-verifier-ensemble-schema.md +++ /dev/null @@ -1,282 +0,0 @@ -# RFC 0006 — Multi‑Verifier Ensemble Schema -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.3 -**Discussion:** https://github.com/supernovae/open-cot/discussions/6 ---- - -## 1. Summary - -This RFC defines the **Multi‑Verifier Ensemble Schema**, a structured format for combining outputs from multiple verifiers into a unified correctness and reward signal. - -It extends: - -- **RFC 0001** — Reasoning Schema -- **RFC 0002** — Verifier Output Schema -- **RFC 0005** — RL Reward Trace Schema - -This schema supports: - -- symbolic + neural verifier fusion -- majority voting -- weighted ensembles -- confidence‑weighted aggregation -- error‑type reconciliation -- reward fusion for RL training -- verifier disagreement analysis - -The goal is to provide a **standard, interoperable ensemble format** for reasoning evaluation and RL pipelines. - ---- - -## 2. Motivation - -Modern reasoning systems increasingly rely on **multiple verifiers**, such as: - -- symbolic math verifiers -- neural verifiers -- rule‑based validators -- tool‑specific validators -- human feedback -- heuristic scoring functions - -Each verifier has different strengths: - -- symbolic verifiers are precise but narrow -- neural verifiers are broad but probabilistic -- heuristics are fast but noisy -- humans are accurate but expensive - -To train and evaluate reasoning models effectively, we need: - -- a unified representation of verifier outputs -- a standard way to combine them -- a way to track disagreement -- a way to compute fused correctness and reward signals - -This RFC defines that standard. - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- Support **multiple verifier outputs** per step. -- Support **ensemble fusion strategies**. -- Support **confidence‑weighted aggregation**. -- Support **reward fusion** for RL. -- Support **disagreement analysis**. -- Maintain compatibility with RFC 0002 and RFC 0005. - -### 3.2 Non‑Goals -- Defining a universal ensemble algorithm. -- Enforcing a specific reward function. -- Representing full verifier internals. -- Encoding model weights or training logs. - ---- - -## 4. Ensemble Model - -A multi‑verifier ensemble consists of: - -- **verifier_outputs[]** — raw outputs from each verifier -- **fusion_strategy** — how to combine them -- **fused_step_results[]** — final correctness per step -- **fused_rewards[]** — final reward per step -- **disagreement_metrics** — optional diagnostics - -Supported fusion strategies include: - -- majority_vote -- weighted_vote -- confidence_weighted -- max_confidence -- min_confidence -- average_reward -- custom - ---- - -## 5. Full Schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Multi-Verifier Ensemble v0.1", - "type": "object", - - "properties": { - "version": { - "type": "string", - "enum": ["0.1"], - "description": "Schema version." - }, - - "trace_id": { - "type": "string", - "description": "ID linking to a reasoning trace (RFC 0001)." - }, - - "verifier_outputs": { - "type": "array", - "description": "List of raw verifier outputs (RFC 0002).", - "items": { - "type": "object", - "description": "A single verifier's output." - } - }, - - "fusion_strategy": { - "type": "string", - "enum": [ - "majority_vote", - "weighted_vote", - "confidence_weighted", - "max_confidence", - "min_confidence", - "average_reward", - "custom" - ], - "description": "Strategy used to combine verifier outputs." - }, - - "weights": { - "type": "object", - "description": "Optional weights for weighted fusion strategies.", - "additionalProperties": { "type": "number" } - }, - - "fused_step_results": { - "type": "array", - "description": "Final correctness judgments per step.", - "items": { - "type": "object", - "properties": { - "step_id": { "type": "string" }, - "correct": { - "type": "string", - "enum": ["true", "false", "unknown"] - }, - "confidence": { - "type": "number", - "minimum": 0, - "maximum": 1 - } - }, - "required": ["step_id", "correct"] - } - }, - - "fused_rewards": { - "type": "array", - "description": "Final reward values per step (RFC 0005).", - "items": { - "type": "object", - "properties": { - "step_id": { "type": "string" }, - "reward": { "type": "number" } - }, - "required": ["step_id", "reward"] - } - }, - - "disagreement_metrics": { - "type": "object", - "description": "Optional diagnostics about verifier disagreement.", - "properties": { - "num_verifiers": { "type": "number" }, - "num_disagreements": { "type": "number" }, - "disagreement_rate": { "type": "number" } - } - } - }, - - "required": ["version", "verifier_outputs", "fusion_strategy"] -} -``` - - -## 6. Example: Majority Vote Ensemble - -```json -{ - "version": "0.1", - "trace_id": "trace_001", - "fusion_strategy": "majority_vote", - - "verifier_outputs": [ - { "verifier": "symbolic_math", "results": [...] }, - { "verifier": "neural_verifier", "results": [...] }, - { "verifier": "heuristic_checker", "results": [...] } - ], - - "fused_step_results": [ - { "step_id": "s2", "correct": "true", "confidence": 0.67 }, - { "step_id": "s3", "correct": "true", "confidence": 1.0 }, - { "step_id": "s4", "correct": "true", "confidence": 0.67 } - ], - - "fused_rewards": [ - { "step_id": "s2", "reward": 1.0 }, - { "step_id": "s3", "reward": 1.0 }, - { "step_id": "s4", "reward": 1.0 } - ] -} -``` - -## 7. Example: Confidence-Weighted Fusion - -```json -{ - "fusion_strategy": "confidence_weighted", - "weights": { - "symbolic_math": 1.0, - "neural_verifier": 0.5 - } -} -``` - -## 8. Open Questions Resolution (normative closure) - -### 8.1 Ensemble structure and reliability - -- **Decision:** Per-verifier scaling, hierarchical ensembles, and reliability tracking are supported. -- **Rationale:** Ensemble quality depends on calibrated member weighting and historical verifier behavior. -- **Normative requirement:** Ensemble entries **SHOULD** include per-member identifiers and optional reliability metrics; hierarchical ensembles **MAY** be represented recursively. -- **Migration note:** Flat ensembles can be upgraded incrementally by adding optional nested group fields. - -### 8.2 Disagreement and normalization policy - -- **Decision:** Disagreement metric and conflict-resolution strategy must be declared when fused outputs are emitted. -- **Rationale:** Reproducibility requires explicit strategy metadata. -- **Normative requirement:** Fused ensemble outputs **MUST** include named strategies for disagreement scoring and conflict handling; reward normalization **SHOULD** follow RFC 0005 defaults. -- **Migration note:** Existing unnamed fusion heuristics should be converted into explicit strategy labels. - -### 8.3 Storage form - -- **Decision:** Ensembles are stored as detached sidecars by default. -- **Rationale:** Detached artifacts improve composability and independent auditing. -- **Normative requirement:** Ensemble records **MUST** reference source verifier outputs by stable IDs. Embedded mirrors **MAY** be emitted for convenience. -- **Migration note:** Embedded-only systems should emit detached sidecars before deprecating legacy readers. - -## 9. Acceptance Criteria - -This RFC will be accepted when: - -At least 3 maintainers approve it. -A reference implementation can fuse multiple verifier outputs. -At least one RL pipeline uses ensemble rewards. -At least one dataset includes ensemble‑annotated traces. - - -## 10. Conclusion -This RFC introduces the Multi‑Verifier Ensemble Schema, enabling: - -robust correctness judgments -stable RL reward signals -multi‑source verification -disagreement analysis -cross‑framework interoperability diff --git a/rfcs/0006-reconciliation-result.md b/rfcs/0006-reconciliation-result.md new file mode 100644 index 0000000..785c8cf --- /dev/null +++ b/rfcs/0006-reconciliation-result.md @@ -0,0 +1,146 @@ +# RFC 0006 — Reconciliation Result & Error Taxonomy (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/6 + +--- + +## Summary + +Defines the final reconciliation envelope and shared error taxonomy for validated execution attempts. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0006 - Reconciliation Result and Error Taxonomy", + "type": "object", + "additionalProperties": false, + "properties": { + "reconciliation_id": { + "type": "string", + "minLength": 1 + }, + "status": { + "type": "string", + "enum": [ + "completed", + "completed_with_errors", + "yielded", + "requires_approval", + "failed" + ] + }, + "capability_snapshot": { + "$ref": "rfc-0002-capability-snapshot.json" + }, + "artifact": { + "$ref": "rfc-0001-cognitive-artifact.json" + }, + "executed_intents": { + "type": "array", + "items": { + "$ref": "rfc-0003-execution-intent.json" + } + }, + "skipped_intents": { + "type": "array", + "items": { + "$ref": "rfc-0003-execution-intent.json" + } + }, + "observations": { + "type": "array", + "items": { + "$ref": "rfc-0005-observation-receipt.json#/$defs/observation" + } + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/$defs/reconciliation_error" + } + }, + "final_message": { + "type": "string" + } + }, + "required": [ + "reconciliation_id", + "status", + "capability_snapshot", + "executed_intents", + "skipped_intents", + "observations", + "errors", + "final_message" + ], + "$defs": { + "error_code": { + "type": "string", + "enum": [ + "INVALID_ARTIFACT", + "SNAPSHOT_MISMATCH", + "UNKNOWN_ENDPOINT", + "UNKNOWN_CAPABILITY", + "CAPABILITY_DIGEST_MISMATCH", + "SCHEMA_VALIDATION_FAILED", + "POLICY_DENIED", + "APPROVAL_REQUIRED", + "PRECONDITION_FAILED", + "BUDGET_EXCEEDED", + "ENDPOINT_EXECUTION_FAILED", + "RESULT_VALIDATION_FAILED", + "YIELDED" + ] + }, + "reconciliation_error": { + "type": "object", + "additionalProperties": false, + "required": [ + "code", + "message", + "observed_at" + ], + "properties": { + "code": { + "$ref": "#/$defs/error_code" + }, + "message": { + "type": "string" + }, + "intent_id": { + "type": "string" + }, + "observed_at": { + "type": "string", + "format": "date-time" + }, + "details": { + "type": "object", + "additionalProperties": true + } + } + } + } +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0007-cognitive-pipeline-protocol.md b/rfcs/0007-cognitive-pipeline-protocol.md deleted file mode 100644 index 016fc88..0000000 --- a/rfcs/0007-cognitive-pipeline-protocol.md +++ /dev/null @@ -1,312 +0,0 @@ -# RFC 0007 — Governed Execution FSM (Cognitive Pipeline Protocol) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.3 -**Discussion:** https://github.com/supernovae/open-cot/discussions/7 - ---- - -## 1. Summary - -This RFC replaces the earlier linear **Cognitive Pipeline Protocol** with the **Governed Execution FSM**: a fourteen-state finite state machine that defines how Open CoT pipelines move from accepted input to sealed audit output under explicit authority, policy, and tooling constraints. - -Open CoT is positioned as a **cognitive control plane**. The FSM is the normative contract between model output (proposals only), schema validation, harness enforcement, policy evaluation, delegation, tool execution, and audit. The governing principle is strict: **the model cannot self-authorize**. The model may request capabilities; only the harness, policy engine, and authorized brokers may grant, narrow, or deny them. - -This document specifies state semantics, allowed transitions, receipt obligations, JSON Schemas for machine-readable FSM definitions and governed traces, and a full worked trajectory. It extends and unifies related RFCs listed in Section 7. - ---- - -## 2. Motivation - -Ad-hoc cognitive pipelines conflate planning, permissioning, tool use, and completion. That makes it easy for a model’s natural-language output to be mistaken for authorization, for tool calls to run without an auditable grant chain, and for policy to be applied inconsistently before versus after side effects occur. - -A governed FSM separates **proposal** from **commitment**: structured envelopes express intent; the harness validates against schema; policy evaluates; an auth broker narrows grants; tools run only in one state with consumed permissions; receipts prove what happened; a terminal audit state seals integrity. Implementers get a single interoperable execution backbone suitable for regulated, cost-aware, and sandboxed deployments (see RFC 0017, RFC 0038). - ---- - -## 3. Design Goals - -### 3.1 Must-have goals - -- Define a **normative** fourteen-state FSM with explicit entry (`receive`) and terminal audit (`audit_seal`). -- Ensure **exactly one** state may perform tool side effects: `execute_tool`. -- Require **non-forgeable** authority: every tool dispatch MUST hold either a valid, non-expired `AuthorityReceipt` with `granted_scope` not broader than the approved request, **or** a documented **standing authorization** (Section 10.1) cited on the execution receipt. -- Make **policy consultation** explicit at interpretation, planning, authority validation, observation, critique, and finalization boundaries. -- Preserve a **pre-authorized shortcut** from `plan` to `execute_tool` for standing grants (e.g., sandbox allowlists) so simple loops remain representable without abandoning governance. -- Support deterministic replay: state order, transitions, and receipt identifiers MUST be serializable. - -### 3.2 Non-goals - -- Prescribing a specific planner, critic, or model family. -- Defining the full content of `DelegationRequest`, `DelegationDecision`, or receipt payloads (normative detail lives in RFC 0047 and RFC 0048). -- Mandating a particular human-approval UX for `escalate` (only the control flow is normative here). - ---- - -## 4. Architectural thesis - -Normative separation of roles: **models propose**; **schemas express**; **harnesses validate and drive state**; **policy evaluates** at consultation points (with per-capability evaluation in `validate_authority`); **auth brokers narrow** to `AuthorityReceipt` with `granted_scope ≤ requested_scope` (non-forwardable by default); **tools execute only** in `execute_tool` under valid grant with **atomic** permission consumption (RFC 0048); **audit seals** the trace in `audit_seal`. - ---- - -## 5. State definitions (normative) - -Every compliant run **MUST** begin in `receive` and **MUST** end in `audit_seal` (external abort SHOULD still yield a sealed partial audit per deployer policy). - -**Execution path.** `receive` — accept input, establish run context, emit `run_init_receipt`; no tools or policy. `frame` — `ReasoningEnvelope` (intent, constraints, `requested_capabilities`); schema validation; task-level policy; no tools. `plan` — ordered plan with per-action capabilities; plan-level policy; inspectable before execution; no tools. `request_authority` — record `DelegationRequest` (justification, scope, audience, TTL preference); no tools; **no self-authorization**. `validate_authority` — harness + policy; `DelegationDecision` (`approved` / `denied` / `narrowed` / `escalated`); **each capability evaluated individually**. `delegate_narrow` — broker `AuthorityReceipt`, narrowed scope. `execute_tool` — **sole** tool side-effect state (RFC 0003); requires valid grant or standing authorization (Section 10.1); `ToolExecutionReceipt`. `observe_result` — model reads tool output; policy postconditions; violations → quarantine → `fail_safe` without model exposure. `critique_verify` — trajectory / evidence / completion; may return to `plan` or `request_authority`; policies like `requireEvidenceBeforeDone`. `finalize` — final answer; harness revokes outstanding grants; final policy gate. `audit_seal` — terminal; immutable audit envelope + integrity seal (RFC 0048). - -**Authority and failure terminal routing.** `deny` — record denial → `audit_seal` only. `escalate` — pause for human approval → `delegate_narrow`, `deny`, or `audit_seal` on timeout (**default timeout = denial-equivalent**). `fail_safe` — unrecoverable; quarantined results never returned to model → `audit_seal` only. - ---- - -## 6. Transition map and policy hooks (normative) - -```text -receive -> [frame] -frame -> [plan] -plan -> [request_authority, execute_tool, finalize] -request_authority -> [validate_authority] -validate_authority -> [delegate_narrow, deny, escalate] -delegate_narrow -> [execute_tool] -execute_tool -> [observe_result, fail_safe] -observe_result -> [critique_verify, fail_safe] -critique_verify -> [plan, request_authority, finalize] -finalize -> [audit_seal] -audit_seal -> [] (terminal) -deny -> [audit_seal] -escalate -> [delegate_narrow, deny, audit_seal] -fail_safe -> [audit_seal] -``` - -Implementations **MUST** reject unlisted transitions. **`plan -> execute_tool`** is the **pre-authorized shortcut** for standing grants (RFC 0017 allowlists, org-wide grants): delegation states MAY be skipped only when the harness cites standing authorization on the `ToolExecutionReceipt` (RFC 0048). - -Implementations **MUST** consult policy (RFC 0041) at minimum on entry to: `frame`, `plan`, `validate_authority`, `observe_result`, `critique_verify`, `finalize`. Extra checks (e.g. RFC 0038 budget) **MAY** augment but **MUST NOT** replace these. - ---- - -## 7. Cross-references - -Extends: **RFC 0001** ([Reasoning / trace structure](0001-initial-schema.md)); **RFC 0003** ([Tool invocation](0003-tool-invocation-schema.md)); **RFC 0017** ([Sandbox](0017-runtime-safety-sandboxing.md)); **RFC 0038** ([Budget](0038-cost-aware-reasoning-budget.md) → `termination: budget_exhausted`); **RFC 0041** ([Policy](0041-policy-enforcement-schema.md)); **RFC 0042** ([Permissions](0042-permission-acl.md)). Delegation payloads (**RFC 0047**) and receipts / audit envelope (**RFC 0048**) are authoritative for artifact bodies; **this RFC owns control flow and attachment points**. - ---- - -## 8. JSON Schemas - -### 8.1 Governed Execution FSM definition - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0007 — Governed Execution FSM Definition", - "type": "object", - "required": ["version", "phases", "transitions", "terminal_phases", "tool_execution_phases", "policy_consultation_phases"], - "properties": { - "version": { "type": "string", "enum": ["0.3"] }, - "phases": { - "type": "array", - "minItems": 14, - "maxItems": 14, - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "receive", - "frame", - "plan", - "request_authority", - "validate_authority", - "delegate_narrow", - "execute_tool", - "observe_result", - "critique_verify", - "finalize", - "audit_seal", - "deny", - "escalate", - "fail_safe" - ] - } - }, - "transitions": { - "type": "object", - "additionalProperties": false, - "required": [ - "receive", - "frame", - "plan", - "request_authority", - "validate_authority", - "delegate_narrow", - "execute_tool", - "observe_result", - "critique_verify", - "finalize", - "audit_seal", - "deny", - "escalate", - "fail_safe" - ], - "properties": { - "receive": { "type": "array", "items": { "const": "frame" } }, - "frame": { "type": "array", "items": { "const": "plan" } }, - "plan": { - "type": "array", - "items": { "enum": ["request_authority", "execute_tool", "finalize"] } - }, - "request_authority": { "type": "array", "items": { "const": "validate_authority" } }, - "validate_authority": { - "type": "array", - "items": { "enum": ["delegate_narrow", "deny", "escalate"] } - }, - "delegate_narrow": { "type": "array", "items": { "const": "execute_tool" } }, - "execute_tool": { - "type": "array", - "items": { "enum": ["observe_result", "fail_safe"] } - }, - "observe_result": { - "type": "array", - "items": { "enum": ["critique_verify", "fail_safe"] } - }, - "critique_verify": { - "type": "array", - "items": { "enum": ["plan", "request_authority", "finalize"] } - }, - "finalize": { "type": "array", "items": { "const": "audit_seal" } }, - "audit_seal": { "type": "array", "maxItems": 0, "items": { "type": "string" } }, - "deny": { "type": "array", "items": { "const": "audit_seal" } }, - "escalate": { - "type": "array", - "items": { "enum": ["delegate_narrow", "deny", "audit_seal"] } - }, - "fail_safe": { "type": "array", "items": { "const": "audit_seal" } } - } - }, - "terminal_phases": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { "const": "audit_seal" } - }, - "tool_execution_phases": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { "const": "execute_tool" } - }, - "policy_consultation_phases": { - "type": "array", - "minItems": 6, - "maxItems": 6, - "uniqueItems": true, - "items": { - "type": "string", - "enum": ["frame", "plan", "validate_authority", "observe_result", "critique_verify", "finalize"] - } - } - } -} -``` - - -### 8.2 Governed trace extension - -The `governed_trace` object **SHOULD** embed in or link from a RFC 0001 trace. Reference strings are URIs or opaque ids pointing to **RFC 0047** / **RFC 0048** artifacts (delegation, receipts, audit envelope). - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0007 — Governed Trace Extension", - "type": "object", - "required": [ - "version", - "delegation_requests", - "delegation_decisions", - "authority_receipts", - "tool_execution_receipts", - "audit_envelope", - "termination" - ], - "properties": { - "version": { "type": "string", "enum": ["0.3"] }, - "delegation_requests": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "delegation_decisions": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "authority_receipts": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "tool_execution_receipts": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "audit_envelope": { "type": "string", "minLength": 1 }, - "termination": { - "type": "string", - "enum": [ - "succeeded", - "failed", - "denied", - "budget_exhausted", - "external_stop", - "escalation_timeout", - "fail_safe" - ] - } - } -} -``` - - ---- - -## 9. Worked example (happy path) - -Illustrative trace (artifact shapes per RFCs 0001, 0003, 0047, 0048): **`receive`** user task “Fetch Q2 revenue from `internal_metrics` and summarize risks”; `run_init_receipt` `rri_001`. **`frame`** validated `ReasoningEnvelope` with intent `internal_reporting`, `PII_MINIMIZE`, `requested_capabilities: ["tool:internal_metrics.read"]`; policy allows. **`plan`** two-step plan (query, summarize) with read capability on step (a); policy allows. **`request_authority`** `DelegationRequest` `dr_01` (scope Q2 revenue slice, TTL 15m). **`validate_authority`** `DelegationDecision` `dd_01` = `narrowed` (row cap, column allowlist). **`delegate_narrow`** `AuthorityReceipt` `ar_01` (`granted ⊆ requested`). **`execute_tool`** RFC 0003 dispatch `internal_metrics.query`; atomic grant consumption; `ToolExecutionReceipt` `ter_01` → `ar_01`. **`observe_result`** sanitized table; postconditions pass. **`critique_verify`** evidence gate satisfied. **`finalize`** answer + grant revocation. **`audit_seal`** envelope `ae_99`, `termination: succeeded`. - -```json -{ - "version": "0.3", - "delegation_requests": ["dr_01"], - "delegation_decisions": ["dd_01"], - "authority_receipts": ["ar_01"], - "tool_execution_receipts": ["ter_01"], - "audit_envelope": "ae_99", - "termination": "succeeded" -} -``` - ---- - -## 10. Open Questions Resolution - -### 10.1 FSM flexibility versus strict sequencing - -- **Question:** Must every tool pass through `request_authority` even when policy already allows a tool class? -- **Decision:** The transition map is **normative**, but pipelines **MAY** skip delegation states for capabilities covered by **standing authorization**, using the **`plan -> execute_tool`** shortcut. The harness **MUST** record how standing authorization satisfies the dispatch obligation in the tool execution receipt. -- **Rationale:** Keeps enterprise-grade governance while preserving the ergonomics of a simple sandboxed cognitive pipeline. - -### 10.2 Multi-tool execution - -- **Question:** Can multiple tools run inside one `execute_tool` visit? -- **Decision:** Each distinct tool invocation **SHOULD** be modeled as its own `request_authority` → … → `execute_tool` cycle (or one shortcut cycle per invocation). Atomic permission consumption applies per dispatch. -- **Rationale:** Per-call receipts and per-capability decisions simplify auditing, partial failure handling, and replay. - -### 10.3 Streaming and asynchronous runtimes - -- **Question:** How does streaming partial model output interact with phases? -- **Decision:** Streaming and async execution are **extension capabilities**. The core FSM in this RFC is **synchronous** with respect to state commits: a harness **MUST** be able to emit a linearized phase log equivalent to the FSM for replay. -- **Rationale:** Async runtimes interleave I/O; auditors need a canonical total order of state transitions and receipts. - ---- - -## 11. Acceptance Criteria - -This RFC should be considered ready for **Implementers’ Draft** when: - -- At least **three** maintainers approve the FSM and transition table. -- A **reference harness** emits valid `governed_trace` sidecars for both shortcut and full-delegation paths. -- Conformance tests demonstrate **rejection** of tool dispatch without valid authority (except documented standing authorization). -- At least one **dataset or evaluation harness** records runs using the fourteen-state linearized log. - ---- - -## 12. Conclusion - -The Governed Execution FSM turns the Open CoT cognitive pipeline into an explicit, permission-aware control plane: proposals are typed and validated, authority is brokered and narrowed, tools run only under receipts, failures quarantine unsafe knowledge, and every run seals into an auditable envelope. Together with RFCs 0001, 0003, 0017, 0038, 0041, 0042, 0047, and 0048, it provides a serious, implementable standard for trustworthy cognitive pipeline execution. diff --git a/rfcs/0007-cognitive-pipeline.md b/rfcs/0007-cognitive-pipeline.md new file mode 100644 index 0000000..aa90ef7 --- /dev/null +++ b/rfcs/0007-cognitive-pipeline.md @@ -0,0 +1,99 @@ +# RFC 0007 — Runtime Boundary & Cognitive Pipeline (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/7 + +--- + +## Summary + +Defines the runtime boundary that owns progression around non-deterministic cognition. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0007 - Runtime Boundary and Cognitive Pipeline", + "type": "object", + "additionalProperties": true, + "properties": { + "version": { + "type": "string" + }, + "task": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "id", + "type", + "content" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "content": { + "type": "string" + }, + "parent": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "tool_invocation": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "final_answer": { + "type": "string" + }, + "termination": { + "type": "string" + } + }, + "required": [ + "version", + "task", + "steps", + "final_answer" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0008-dataset-packaging-standard.md b/rfcs/0008-dataset-packaging-standard.md deleted file mode 100644 index 9ac9f31..0000000 --- a/rfcs/0008-dataset-packaging-standard.md +++ /dev/null @@ -1,258 +0,0 @@ -# RFC 0008 — Dataset Packaging Standard (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.3 -**Discussion:** https://github.com/supernovae/open-cot/discussions/8 ---- - -## 1. Summary - -This RFC defines the **Dataset Packaging Standard** for distributing, sharing, and consuming structured reasoning datasets that follow the Open CoT ecosystem. - -It provides a unified, model‑agnostic format for packaging: - -- reasoning traces (RFC 0001) -- verifier outputs (RFC 0002) -- tool invocation logs (RFC 0003) -- branching structures (RFC 0004) -- RL reward traces (RFC 0005) -- multi‑verifier ensembles (RFC 0006) - -The goal is to make reasoning datasets **portable, reproducible, inspectable, and interoperable** across training pipelines, evaluation harnesses, and cognitive pipeline frameworks. - ---- - -## 2. Motivation - -Reasoning datasets today are fragmented: - -- Some contain raw CoT text with no structure. -- Some contain tool calls but no observations. -- Some contain verifier labels but no reward signals. -- Some contain branching traces but no metadata. -- Some are stored as loose JSON files with no manifest. - -This fragmentation makes it difficult to: - -- train RL‑based reasoning models -- evaluate step‑level correctness -- reproduce cognitive pipeline trajectories -- share datasets across frameworks -- benchmark models consistently - -This RFC defines a **standard packaging format** so that reasoning datasets can be: - -- versioned -- validated -- merged -- sharded -- streamed -- consumed by any training or evaluation pipeline - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- Support all schemas from RFC 0001–0007. -- Provide a clear directory structure. -- Provide a dataset manifest. -- Support sharding and streaming. -- Support dataset‑level metadata. -- Support dataset validation. -- Support partial datasets (e.g., traces only, rewards only). - -### 3.2 Non‑Goals -- Defining a specific training format (e.g., HF datasets). -- Defining a specific compression format. -- Defining a universal licensing model. -- Encoding model weights or training logs. - ---- - -## 4. Dataset Structure - -A dataset MUST follow this directory structure. Paths below are **relative to the dataset package root** (the `dataset/` directory is the on-disk bundle root; omit the leading `dataset/` segment when the root folder itself is named after the release). - -```text -dataset/ # package root (release / volume root) -├── manifest.json # required: dataset manifest (§5) -├── traces/ # one file per trace (RFC 0001 + extensions) -│ └── .json -├── verifier_outputs/ # optional: per-trace verifier payloads (RFC 0002) -│ └── .json -├── ensembles/ # optional: multi-verifier bundles (RFC 0006) -│ └── .json -├── rewards/ # optional: RL reward traces (RFC 0005) -│ └── .json -└── metadata/ # dataset-level descriptors - ├── dataset.json # human + machine metadata - ├── splits.json # train / val / test (or custom) split map - └── license.txt # distribution terms for this package -``` - -**Naming:** `` is a stable identifier shared across `traces/`, `verifier_outputs/`, `ensembles/`, and `rewards/` when those sidecars refer to the same trajectory. - -All subdirectories are optional **except**: - -- `manifest.json` -- `traces/` - -This allows datasets to be partial (e.g., traces only, or traces + rewards). - ---- - -## 5. Manifest Specification - -`manifest.json` MUST contain: - -```json -{ - "version": "0.1", - "name": "example-dataset", - "description": "A dataset of structured reasoning traces.", - "schemas": { - "reasoning": "0.1", - "verifier_output": "0.1", - "tool_invocation": "0.1", - "branching": "0.1", - "reward": "0.1", - "ensemble": "0.1" - }, - "counts": { - "traces": 1000, - "verifier_outputs": 1000, - "ensembles": 1000, - "rewards": 1000 - }, - "splits": ["train", "validation", "test"], - "created_at": "2026-04-14T00:00:00Z", - "license": "MIT" -} -``` - -## 6. Trace Files - -Each file in traces/ MUST follow RFC 0001. - -Example: - -traces/trace_001.json - -## 7. Verififer Output Files - -Each file in verifier_outputs/ MUST follow RFC 0002. - -Example: - -verifier_outputs/trace_001.json - -## 8. Ensemble Files - -Each file in ensembles/ MUST follow RFC 0006. - -ensembles/trace_001.json - -## 9. Reward Files - -Each file in rewards/ MUST follow RFC 0005. - -Example: - -rewards/trace_001.json - - -## 10. Metadata Files - -### 10.1 dataset.json -Contains dataset‑level metadata: - -```json -{ - "domain": "math", - "source": "synthetic", - "language": "en", - "num_tokens": 1234567 -} -``` - -### 10.2 splits.json - -```json -{ - "train": ["trace_001", "trace_002"], - "validation": ["trace_101"], - "test": ["trace_201"] -} -``` - - -## 11. Validation Requirements - -A dataset MUST pass the following checks: - -All traces validate against RFC 0001. -All verifier outputs validate against RFC 0002. -All ensembles validate against RFC 0006. -All reward traces validate against RFC 0005. -All referenced trace IDs exist. -Manifest counts match actual file counts. - -## 12. Example Dataset Package - -```text -dataset/ - manifest.json - traces/ - trace_001.json - trace_002.json - verifier_outputs/ - trace_001.json - trace_002.json - rewards/ - trace_001.json - metadata/ - dataset.json - splits.json - license.txt -``` - - -## 13. Open Questions Resolution (normative closure) - -### 13.1 Packaging profiles - -- **Decision:** JSON manifest + JSON traces remain the baseline profile, with optional extension profiles for JSONL stream and columnar formats. -- **Rationale:** Baseline portability is critical; advanced storage should be opt-in. -- **Normative requirement:** Packaged datasets **MUST** include canonical manifest metadata. Non-baseline formats **MAY** be used but **MUST** declare profile type and conversion path. -- **Migration note:** Existing custom archives should add profile declarations in manifest before publication. - -### 13.2 IDs and versioning - -- **Decision:** Trace IDs and dataset versions are standardized at manifest level. -- **Rationale:** Stable identifiers are required for replay, provenance, and diffability. -- **Normative requirement:** Trace IDs **MUST** be stable, unique strings within a package; dataset versions **SHOULD** follow semver; dataset diffs **MAY** be emitted as optional changelog artifacts. -- **Migration note:** Datasets lacking stable IDs should regenerate IDs once and retain a legacy mapping table. - -## 14. Acceptance Criteria - -This RFC will be accepted when: - -At least 3 maintainers approve it. -A reference dataset passes validation. -At least one training pipeline consumes this format. -At least one evaluation harness consumes this format. - - -## 15. Conclusion - -This RFC defines the Dataset Packaging Standard, enabling: - -portable reasoning datasets -reproducible training -consistent evaluation -multi‑verifier integration -RL reward‑augmented datasets -branching and tool‑augmented traces - diff --git a/rfcs/0008-execution-budget.md b/rfcs/0008-execution-budget.md new file mode 100644 index 0000000..ee0e844 --- /dev/null +++ b/rfcs/0008-execution-budget.md @@ -0,0 +1,72 @@ +# RFC 0008 — Budget, Cost & Temporal Bounds (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/8 + +--- + +## Summary + +Defines execution bounds for intent count, endpoint calls, token/cost ceilings, and temporal validity. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0008 - Budget, Cost, and Temporal Bounds", + "type": "object", + "additionalProperties": false, + "properties": { + "budget_id": { + "type": "string", + "minLength": 1 + }, + "max_execution_intents": { + "type": "integer", + "minimum": 0 + }, + "max_endpoint_calls": { + "type": "integer", + "minimum": 0 + }, + "max_tokens": { + "type": "integer", + "minimum": 0 + }, + "max_cost_usd": { + "type": "number", + "minimum": 0 + }, + "valid_after": { + "type": "string", + "format": "date-time" + }, + "valid_until": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "budget_id" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0009-requester-identity.md b/rfcs/0009-requester-identity.md new file mode 100644 index 0000000..79a0eb7 --- /dev/null +++ b/rfcs/0009-requester-identity.md @@ -0,0 +1,76 @@ +# RFC 0009 — Requester Identity & Governance Context (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/9 + +--- + +## Summary + +Defines requester identity as the authenticated principal attached to a cognitive operation. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0009 - Requester Identity and Governance Context", + "type": "object", + "additionalProperties": false, + "properties": { + "requester_id": { + "type": "string", + "minLength": 1 + }, + "kind": { + "type": "string", + "enum": [ + "model", + "service", + "human", + "runtime" + ] + }, + "display_name": { + "type": "string" + }, + "trust_level": { + "type": "string", + "enum": [ + "untrusted", + "low", + "medium", + "high", + "system" + ] + }, + "governance_context": { + "type": "object", + "additionalProperties": true + } + }, + "required": [ + "requester_id", + "kind", + "trust_level" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0009-reward-fusion-specification.md b/rfcs/0009-reward-fusion-specification.md deleted file mode 100644 index 859f0d4..0000000 --- a/rfcs/0009-reward-fusion-specification.md +++ /dev/null @@ -1,301 +0,0 @@ -# RFC 0009 — Reward Fusion Specification (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.3 -**Discussion:** https://github.com/supernovae/open-cot/discussions/9 ---- - -## 1. Summary - -This RFC defines the **Reward Fusion Specification**, a standard for combining multiple reward signals into a unified reward trace suitable for RL training, evaluation, and reasoning‑quality optimization. - -It extends: - -- RFC 0005 — RL Reward Trace Schema -- RFC 0006 — Multi‑Verifier Ensemble Schema -- RFC 0007 — Cognitive Pipeline Protocol - -The goal is to provide a **consistent, transparent, and reproducible** method for merging: - -- verifier‑based rewards -- heuristic rewards -- human feedback rewards -- branch‑level rewards -- trajectory‑level rewards -- ensemble‑derived rewards - -into a single, fused reward signal. - ---- - -## 2. Motivation - -Modern reasoning models (DeepSeek‑R1, Qwen‑R1, etc.) rely on **multiple reward sources**, including: - -- symbolic verifiers -- neural verifiers -- rule‑based heuristics -- human preference models -- branch‑level search scores -- trajectory‑level correctness signals - -However: - -- Reward signals often conflict. -- Pipelines use incompatible fusion strategies. -- RL training requires a single scalar reward per step or trajectory. -- Datasets cannot share fused reward traces without a standard. -- Ensemble verifiers (RFC 0006) require downstream fusion. - -This RFC defines a **unified reward fusion standard** to ensure interoperability across datasets, RL pipelines, and cognitive pipeline frameworks. - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- Support step‑level, branch‑level, and trajectory‑level reward fusion. -- Support multiple fusion strategies. -- Support weighted and confidence‑weighted fusion. -- Support deterministic and reproducible fusion. -- Integrate cleanly with RFC 0005 and RFC 0006. -- Support RL‑ready scalar reward outputs. - -### 3.2 Non‑Goals -- Defining a universal reward function. -- Mandating a specific RL algorithm. -- Encoding model weights or training logs. -- Replacing verifier outputs or ensemble outputs. - ---- - -## 4. Reward Fusion Model - -Reward fusion operates over three levels: - -1. **Step‑level fusion** - Combine rewards for individual reasoning steps. - -2. **Branch‑level fusion** - Combine rewards for alternative reasoning paths (ToT/GoT). - -3. **Trajectory‑level fusion** - Combine global rewards for the entire reasoning trace. - -Each level may use different fusion strategies. - ---- - -## 5. Fusion Strategies - -The following strategies MUST be supported: - -### 5.1 `sum` -Add all reward signals. - -### 5.2 `mean` -Average all reward signals. - -### 5.3 `weighted` -Use user‑provided weights. - -### 5.4 `confidence_weighted` -Use verifier confidence as weights. - -### 5.5 `max` -Take the maximum reward. - -### 5.6 `min` -Take the minimum reward. - -### 5.7 `product` -Multiply reward signals (useful for multiplicative penalties). - -### 5.8 `custom` -User‑defined fusion logic (metadata required). - ---- - -## 6. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Reward Fusion Specification v0.1", - "type": "object", - - "properties": { - "version": { - "type": "string", - "enum": ["0.1"], - "description": "Schema version." - }, - - "trace_id": { - "type": "string", - "description": "ID linking to a reasoning trace (RFC 0001)." - }, - - "fusion_strategy": { - "type": "string", - "enum": [ - "sum", - "mean", - "weighted", - "confidence_weighted", - "max", - "min", - "product", - "custom" - ], - "description": "Strategy used to fuse reward signals." - }, - - "weights": { - "type": "object", - "description": "Optional weights for weighted fusion strategies.", - "additionalProperties": { "type": "number" } - }, - - "step_fusion": { - "type": "array", - "description": "Fused step-level rewards.", - "items": { - "type": "object", - "properties": { - "step_id": { "type": "string" }, - "reward": { "type": "number" }, - "sources": { - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["step_id", "reward"] - } - }, - - "branch_fusion": { - "type": "array", - "description": "Fused branch-level rewards.", - "items": { - "type": "object", - "properties": { - "branch_group": { "type": "string" }, - "path_id": { "type": "string" }, - "reward": { "type": "number" } - }, - "required": ["reward"] - } - }, - - "trajectory_reward": { - "type": "number", - "description": "Final fused reward for the entire trajectory." - }, - - "metadata": { - "type": "object", - "description": "Optional metadata for custom fusion strategies." - } - }, - - "required": ["version", "fusion_strategy"] -} -``` - ---- - -## 7. Example: Confidence‑Weighted Step Fusion - -```json -{ - "version": "0.1", - "trace_id": "trace_001", - "fusion_strategy": "confidence_weighted", - - "step_fusion": [ - { - "step_id": "s2", - "reward": 0.98, - "sources": ["symbolic_verifier", "neural_verifier"] - } - ], - - "trajectory_reward": 0.98 -} -``` - ---- - -## 8. Example: Weighted Branch Fusion - -```json -{ - "fusion_strategy": "weighted", - "weights": { - "symbolic_verifier": 1.0, - "heuristic": 0.5 - }, - "branch_fusion": [ - { - "branch_group": "g1", - "path_id": "p1", - "reward": 0.72 - }, - { - "branch_group": "g1", - "path_id": "p2", - "reward": 0.64 - } - ] -} -``` - ---- - -## 9. Open Questions Resolution (normative closure) - -### 9.1 Fusion-time transforms - -- **Decision:** Clipping, normalization, smoothing, and discounting are supported through explicit `fusion_config` metadata. -- **Rationale:** Reward fusion must be reproducible across pipelines. -- **Normative requirement:** If any transform is applied, the transform parameters **MUST** be serialized in the fusion artifact. -- **Migration note:** Pipelines that used implicit transforms should backfill config metadata for historical runs. - -### 9.2 Scale and uncertainty - -- **Decision:** Canonical fused reward scale is normalized to [-1,1], with optional uncertainty metadata. -- **Rationale:** Comparable fused outputs need a common numeric envelope. -- **Normative requirement:** Fused reward outputs **SHOULD** be normalized to [-1,1]; uncertainty **MAY** include interval or variance fields. -- **Migration note:** Non-normalized fused values should include a one-time conversion note in release documentation. - -### 9.3 Storage model - -- **Decision:** Fusion artifacts remain detached sidecars. -- **Rationale:** Detached form supports independent recomputation and auditability. -- **Normative requirement:** Fusion outputs **MUST** reference source trace and reward IDs. Embedded summaries **MAY** exist but are non-authoritative. -- **Migration note:** Embedded-only fusion output should transition to detached canonical files before deprecating old readers. - ---- - -## 10. Acceptance Criteria - -This RFC will be accepted when: - -- At least 3 maintainers approve it. -- A reference implementation performs reward fusion. -- At least one RL pipeline consumes fused rewards. -- At least one dataset includes fused reward traces. - ---- - -## 11. Conclusion - -This RFC defines the **Reward Fusion Specification**, enabling: - -- unified reward signals -- multi‑verifier integration -- RL‑ready reward traces -- consistent evaluation -- reproducible training diff --git a/rfcs/0010-cognitive-context-schema.md b/rfcs/0010-cognitive-context-schema.md deleted file mode 100644 index d1f7b3b..0000000 --- a/rfcs/0010-cognitive-context-schema.md +++ /dev/null @@ -1,302 +0,0 @@ -# RFC 0010 — Cognitive pipeline Memory Schema (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.3 -**Discussion:** https://github.com/supernovae/open-cot/discussions/10 ---- - -## 1. Summary - -This RFC defines the **Cognitive pipeline Memory Schema**, a structured, model‑agnostic format for representing persistent and ephemeral memory used by LLM‑based pipelines during reasoning, planning, and tool‑augmented execution. - -It extends and complements: - -- RFC 0001 — Reasoning Schema -- RFC 0003 — Tool Invocation Schema -- RFC 0004 — Branching Reasoning Extensions -- RFC 0007 — Cognitive Pipeline Protocol - -The goal is to standardize how pipelines store, retrieve, update, and serialize memory across steps, episodes, and tasks. - ---- - -## 2. Motivation - -Modern pipelines require memory for: - -- tracking intermediate results -- storing retrieved knowledge -- maintaining tool state -- caching observations -- remembering subgoals -- tracking failures and retries -- maintaining long‑horizon context -- supporting multi‑step planning -- enabling multi‑cognitive pipeline collaboration - -Today, memory formats are: - -- inconsistent -- framework‑specific -- unstructured -- difficult to serialize -- incompatible across cognitive pipeline systems - -This RFC defines a **unified, interoperable memory schema** that supports: - -- short‑term (ephemeral) memory -- long‑term (persistent) memory -- tool‑specific memory -- reasoning‑specific memory -- search‑based memory (ToT/GoT) -- RL‑based memory (reward traces, verifier feedback) - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- Support multiple memory types (short‑term, long‑term, tool, episodic). -- Support structured, typed memory entries. -- Support deterministic serialization and replay. -- Support integration with the Cognitive Pipeline Protocol (RFC 0007). -- Support memory updates, deletions, and versioning. -- Support multi‑cognitive pipeline memory isolation. - -### 3.2 Non‑Goals -- Defining a universal memory retrieval algorithm. -- Defining a specific vector database or embedding model. -- Encoding model weights or training logs. -- Replacing reasoning traces or tool logs. - ---- - -## 4. Memory Model - -The Cognitive pipeline Memory Schema defines four categories: - -### 4.1 Short‑Term Memory (STM) -Ephemeral memory used within a single reasoning episode. - -Examples: -- intermediate results -- temporary variables -- partial tool outputs -- active subgoals -- search frontier nodes - -### 4.2 Long‑Term Memory (LTM) -Persistent memory stored across episodes. - -Examples: -- user preferences -- learned heuristics -- cached tool results -- stable world knowledge - -### 4.3 Episodic Memory -Chronological logs of past episodes. - -Examples: -- past tasks -- past failures -- past successes -- past tool interactions - -### 4.4 Tool Memory -State associated with specific tools. - -Examples: -- authentication tokens -- cached API responses -- tool‑specific configuration - ---- - -## 5. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Cognitive pipeline Memory Schema v0.1", - "type": "object", - - "properties": { - "version": { - "type": "string", - "enum": ["0.2"], - "description": "Schema version." - }, - - "requester_id": { - "type": "string", - "description": "Unique identifier for the cognitive pipeline." - }, - - "short_term_memory": { - "type": "array", - "description": "Ephemeral memory entries for the current episode.", - "items": { - "type": "object", - "properties": { - "key": { "type": "string" }, - "value": {}, - "type": { "type": "string" }, - "expires_at": { "type": "string", "format": "date-time" } - }, - "required": ["key", "value"] - } - }, - - "long_term_memory": { - "type": "array", - "description": "Persistent memory entries across episodes.", - "items": { - "type": "object", - "properties": { - "key": { "type": "string" }, - "value": {}, - "type": { "type": "string" }, - "observed_at": { "type": "string", "format": "date-time" }, - "superseded_at": { "type": "string", "format": "date-time" }, - "confidence": { "type": "number" } - }, - "required": ["key", "value"] - } - }, - - "episodic_memory": { - "type": "array", - "description": "Chronological logs of past episodes.", - "items": { - "type": "object", - "properties": { - "episode_id": { "type": "string" }, - "observed_at": { "type": "string", "format": "date-time" }, - "summary": { "type": "string" }, - "metadata": { "type": "object" } - }, - "required": ["episode_id", "observed_at"] - } - }, - - "tool_memory": { - "type": "object", - "description": "Tool-specific memory keyed by tool name.", - "additionalProperties": { - "type": "object", - "properties": { - "state": { "type": "object" }, - "observed_at": { "type": "string", "format": "date-time" } - } - } - } - }, - - "required": ["version", "requester_id"] -} -``` - ---- - -## 6. Example: Short‑Term Memory - -```json -{ - "short_term_memory": [ - { - "key": "current_subgoal", - "value": "Compute partial sum", - "type": "string", - "expires_at": "2026-04-14T12:00:00Z" - } - ] -} -``` - ---- - -## 7. Example: Long‑Term Memory - -```json -{ - "long_term_memory": [ - { - "key": "preferred_units", - "value": "metric", - "type": "preference", - "observed_at": "2026-04-10T09:00:00Z", - "confidence": 0.95 - } - ] -} -``` - ---- - -## 8. Example: Tool Memory - -```json -{ - "tool_memory": { - "weather_api": { - "state": { - "cached_city": "Austin", - "cached_result": "Clear skies, 72F" - }, - "observed_at": "2026-04-14T11:30:00Z" - } - } -} -``` - ---- - -## 9. Open Questions Resolution (normative closure) - -### 9.1 Memory policy features - -- **Decision:** Expiration, compression, embeddings, and encryption tags are all supported as optional policy fields. -- **Rationale:** Memory systems vary by runtime and compliance context. -- **Normative requirement:** Base memory entries **MUST** remain valid without optional policy fields; when encryption is used, entries **MUST** include key/reference metadata rather than raw key material. -- **Migration note:** Legacy encrypted payloads should add key-reference fields for portability. - -### 9.2 Retrieval, conflict, and provenance - -- **Decision:** Retrieval remains implementation-defined; conflict semantics defer to RFC 0014; provenance aligns with RFC 0035. -- **Rationale:** Avoids duplicating authority across memory-related RFCs. -- **Normative requirement:** Implementations **SHOULD** expose deterministic retrieval behavior, and memory conflict resolution **MUST** follow RFC 0014 strategy declarations. -- **Migration note:** Existing memory stores with implicit overwrite behavior should declare explicit conflict strategy. - -### 9.3 Storage topology - -- **Decision:** Detached memory snapshots are canonical, with optional trace-level references. -- **Rationale:** Detached storage scales better and supports replay/audits. -- **Normative requirement:** Memory snapshots **MUST** carry stable IDs and trace linkage when used in loop execution. -- **Migration note:** Embedded-memory-only traces should migrate to referenced sidecar snapshots in staged releases. - ---- - -## 10. Acceptance Criteria - -This RFC will be accepted when: - -- At least 3 maintainers approve it. -- A reference implementation can serialize and deserialize memory. -- At least one cognitive pipeline framework uses this schema. -- At least one dataset includes memory snapshots. - ---- - - -## 11. Conclusion - -This RFC defines the **Cognitive pipeline Memory Schema**, enabling: - -- structured memory -- deterministic replay -- multi‑episode reasoning -- tool‑augmented memory -- long‑horizon planning -- multi‑cognitive pipeline compatibility \ No newline at end of file diff --git a/rfcs/0010-human-approval.md b/rfcs/0010-human-approval.md new file mode 100644 index 0000000..6cc01f8 --- /dev/null +++ b/rfcs/0010-human-approval.md @@ -0,0 +1,77 @@ +# RFC 0010 — Human Approval, Yield & Resume (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/10 + +--- + +## Summary + +Defines approval, yield, and resume records when runtime policy requires human participation. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0010 - Human Approval, Yield, and Resume", + "type": "object", + "additionalProperties": false, + "properties": { + "approval_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string" + }, + "requested_at": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "enum": [ + "requested", + "approved", + "rejected", + "timeout", + "yielded" + ] + }, + "prompt": { + "type": "string" + }, + "response": { + "type": "string" + }, + "resume_token": { + "type": "string" + } + }, + "required": [ + "approval_id", + "requested_at", + "status", + "prompt" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0011-conformance-registry.md b/rfcs/0011-conformance-registry.md new file mode 100644 index 0000000..d7433ab --- /dev/null +++ b/rfcs/0011-conformance-registry.md @@ -0,0 +1,69 @@ +# RFC 0011 — Conformance, Registry & Compatibility Rules (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/11 + +--- + +## Summary + +Defines the schema registry and conformance profile expected from portable implementations. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0011 - Conformance, Registry, and Compatibility Rules", + "type": "object", + "additionalProperties": false, + "properties": { + "registry_version": { + "type": "string" + }, + "profile": { + "type": "string", + "enum": [ + "core", + "runtime-boundary", + "full" + ] + }, + "schemas": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required_examples": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "registry_version", + "profile", + "schemas" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0011-multi-party-cognition-protocol.md b/rfcs/0011-multi-party-cognition-protocol.md deleted file mode 100644 index 91ff2f7..0000000 --- a/rfcs/0011-multi-party-cognition-protocol.md +++ /dev/null @@ -1,185 +0,0 @@ -# RFC 0011 — Multi‑Cognitive pipeline Protocol (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/11 ---- - -## 1. Summary - -This RFC defines the **Multi‑Cognitive pipeline Protocol**, a standardized framework for coordinating multiple LLM‑based pipelines that collaborate, compete, or specialize across tasks. - -It extends: - -- RFC 0001 — Reasoning Schema -- RFC 0003 — Tool Invocation Schema -- RFC 0004 — Branching Reasoning Extensions -- RFC 0007 — Cognitive Pipeline Protocol -- RFC 0010 — Cognitive pipeline Memory Schema - -The goal is to define a **clean, interoperable protocol** for multi‑cognitive pipeline systems that exchange structured messages, share memory selectively, and coordinate reasoning. - ---- - -## 2. Motivation - -Multi‑cognitive pipeline systems are increasingly important for: - -- decomposition of complex tasks -- specialization (planner, coder, verifier, critic, executor) -- adversarial reasoning -- self‑play -- distributed tool use -- multi‑step planning -- multi‑modal collaboration - -Today, multi‑cognitive pipeline frameworks are: - -- inconsistent -- unstructured -- incompatible -- difficult to serialize or replay - -This RFC defines a **unified multi‑cognitive pipeline protocol** for structured reasoning ecosystems. - ---- - -## 3. Design Goals - -### 3.1 Must‑Have Goals -- Support structured cognitive pipeline‑to‑cognitive pipeline messages -- Support shared and private memory (RFC 0010) -- Support cognitive pipeline roles and capabilities -- Support deterministic replay -- Support multi‑cognitive pipeline reasoning graphs -- Support tool‑augmented multi‑cognitive pipeline workflows - -### 3.2 Non‑Goals -- Defining a universal cognitive pipeline architecture -- Defining a universal communication algorithm -- Encoding model weights or training logs - ---- - -## 4. Multi‑Cognitive pipeline Model - -A multi‑cognitive pipeline system consists of: - -- **pipelines[]** — each with identity, role, capabilities -- **messages[]** — structured communication events -- **shared_memory** — optional global memory -- **private_memory** — per‑cognitive pipeline memory (RFC 0010) -- **coordination_strategy** — optional (planner, auction, voting, etc.) - ---- - -## 5. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Multi-Party Protocol v0.2", - "type": "object", - - "properties": { - "version": { "type": "string", "enum": ["0.2"] }, - - "pipelines": { - "type": "array", - "items": { - "type": "object", - "properties": { - "requester_id": { "type": "string" }, - "role": { "type": "string" }, - "capabilities": { "type": "array", "items": { "type": "string" } } - }, - "required": ["requester_id", "role"] - } - }, - - "messages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "message_id": { "type": "string" }, - "sender": { "type": "string" }, - "receiver": { "type": "string" }, - "observed_at": { "type": "string", "format": "date-time" }, - "content": { "type": "string" }, - "metadata": { "type": "object" } - }, - "required": ["message_id", "sender", "receiver", "observed_at", "content"] - } - }, - - "shared_memory": { "type": "object" }, - - "coordination_strategy": { "type": "string" } - }, - - "required": ["version", "pipelines", "messages"] -} -``` - ---- - -## 6. Example - -```json -{ - "pipelines": [ - { "requester_id": "planner", "role": "planner" }, - { "requester_id": "coder", "role": "executor" } - ], - "messages": [ - { - "message_id": "m1", - "sender": "planner", - "receiver": "coder", - "observed_at": "2026-04-14T11:32:12Z", - "content": "Implement function f(x)." - } - ] -} -``` - ---- - -## 7. Open Questions Resolution (normative closure) - -### 7.1 Messaging mode - -- **Decision:** Broadcast is supported as an explicit delivery mode in message metadata. -- **Rationale:** Multi-cognitive pipeline collaboration often requires fan-out coordination. -- **Normative requirement:** Messages **MUST** support unicast delivery; broadcast **MAY** be used with explicit recipient semantics. -- **Migration note:** Existing ad hoc broadcast conventions should be normalized through a delivery-mode field. - -### 7.2 Cognitive pipeline groups - -- **Decision:** Cognitive pipeline grouping is supported through optional `group_id` metadata. -- **Rationale:** Group semantics improve role orchestration without requiring topology hard-coding. -- **Normative requirement:** Group membership **MAY** be declared; when declared, group IDs **MUST** be stable within a session. -- **Migration note:** Role-only systems can incrementally adopt groups without breaking existing cognitive pipeline identifiers. - -### 7.3 Coordination strategy - -- **Decision:** No single mandatory strategy is imposed, but strategy declaration is required when non-default coordination is used. -- **Rationale:** Different workloads need planner-worker, voting, or auction-based coordination. -- **Normative requirement:** If coordination_strategy is set, implementations **MUST** include strategy name and deterministic parameters. -- **Migration note:** Implicit coordinator behavior should be surfaced in run metadata for reproducibility. - ---- - -## 8. Acceptance Criteria - -- Reference implementation -- Multi‑cognitive pipeline dataset -- Multi‑cognitive pipeline cognitive pipeline - ---- - -## 9. Conclusion - -This RFC defines the **Multi‑Cognitive pipeline Protocol**, enabling structured multi‑cognitive pipeline collaboration. diff --git a/rfcs/0012-compact-context.md b/rfcs/0012-compact-context.md new file mode 100644 index 0000000..300acaa --- /dev/null +++ b/rfcs/0012-compact-context.md @@ -0,0 +1,65 @@ +# RFC 0012 — Compact Context Serialization (v1.0) + +**Status:** Draft +**Author:** Open CoT Community +**Created:** 2026-04-27 +**Target Version:** Core v1.0 +**Discussion:** https://github.com/supernovae/open-cot/discussions/12 + +--- + +## Summary + +Defines compact context serialization as an adapter over canonical JSON Schema artifacts. + +Open CoT means **Cognitive Operations Theory** in this core reset. The standard defines portable artifacts at the boundary between cognition and execution. The model-facing artifact is untrusted input until validated and reconciled by runtime code. + +## Normative Requirements + +- Implementations MUST treat model output as untrusted structured input. +- Implementations MUST validate artifacts against the schema embedded in this RFC. +- Implementations MUST keep execution authority outside reasoning text. +- Implementations MUST record enough evidence for replay, audit, and conformance testing. + +## Schema + + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0012 - Compact Context Serialization", + "type": "object", + "additionalProperties": false, + "properties": { + "format": { + "type": "string", + "enum": [ + "json", + "compact-json", + "toon" + ] + }, + "schema_ref": { + "type": "string", + "minLength": 1 + }, + "content": { + "type": "string" + }, + "content_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + } + }, + "required": [ + "format", + "schema_ref", + "content" + ] +} +``` + + +## Notes + +This RFC is part of the compact core. Training, dataset packaging, reward modeling, benchmark execution, and model adaptation are intentionally out of scope for this repository reset. diff --git a/rfcs/0012-dataset-streaming-format.md b/rfcs/0012-dataset-streaming-format.md deleted file mode 100644 index 26f2b07..0000000 --- a/rfcs/0012-dataset-streaming-format.md +++ /dev/null @@ -1,98 +0,0 @@ -# RFC 0012 — Dataset Streaming Format (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/12 ---- - -## 1. Summary - -This RFC defines a streaming profile for Open CoT datasets to support large-scale training and evaluation workloads. - -It extends: - -- RFC 0001 — Reasoning Schema -- RFC 0008 — Dataset Packaging Standard -- RFC 0035 — Data Provenance Tracking - ---- - -## 2. Motivation - -Archive-based dataset packaging is portable, but large datasets often require: - -- incremental consumption -- append-only ingestion -- deterministic sharding -- resumable processing - -This RFC defines a JSONL-first streaming contract with explicit manifest linkage. - ---- - -## 3. Streaming model - -A streaming dataset contains: - -- `stream_manifest.json`: stream metadata and source package reference -- `traces.jsonl`: line-delimited RFC 0001 records -- optional sidecar streams (`verifier.jsonl`, `reward.jsonl`) - -Each stream record must include stable IDs for trace-level joins. - ---- - -## 4. Stream manifest (JSON) - -```json -{ - "stream_version": "0.1", - "source_dataset": "open-cot-synthetic-seed-v0", - "schema_target": "schemas/rfc-0001-reasoning.json", - "record_format": "jsonl", - "compression": "none", - "shards": ["traces-00001.jsonl", "traces-00002.jsonl"], - "ordering": "append_only", - "id_field": "trace_id" -} -``` - ---- - -## 5. Open Questions Resolution (normative closure) - -### 5.1 Compression and transport - -- **Decision:** Compression is optional but declared (`none`, `gzip`, `zstd`). -- **Rationale:** Throughput requirements differ by environment. -- **Normative requirement:** Producers **MUST** declare compression and record format in the stream manifest. -- **Migration note:** Legacy streams without compression metadata should add a manifest patch. - -### 5.2 Ordering and replay - -- **Decision:** Append-only ordering is canonical for deterministic replay. -- **Rationale:** Deterministic shard and offset semantics are required for reproducible training/eval. -- **Normative requirement:** Stream producers **MUST** preserve record order within shard and **SHOULD** expose shard-level checksums. -- **Migration note:** Unordered historical streams should be republished with stable shard ordering. - -### 5.3 Sidecar linkage - -- **Decision:** Sidecar streams are allowed and joined by stable trace IDs. -- **Rationale:** Sidecars evolve independently while preserving core trace compatibility. -- **Normative requirement:** Sidecar records **MUST** include trace ID and schema identifier references. -- **Migration note:** Sidecar files with implicit join keys should be backfilled with explicit IDs. - ---- - -## 6. Acceptance criteria - -- At least one stream producer emits schema-valid JSONL traces. -- At least one consumer replays a streamed dataset deterministically. -- Manifest fields are validated in CI for required metadata. - ---- - -## 7. Conclusion - -RFC 0012 establishes a practical, reproducible streaming contract for Open CoT datasets while preserving compatibility with package-based workflows. diff --git a/rfcs/0013-memory-compression-embedding.md b/rfcs/0013-memory-compression-embedding.md deleted file mode 100644 index 0bbc4a7..0000000 --- a/rfcs/0013-memory-compression-embedding.md +++ /dev/null @@ -1,119 +0,0 @@ -# RFC 0013 — Memory Compression & Embedding (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/13 ---- - -## 1. Summary - -This RFC defines standards for **compressing, embedding, and summarizing cognitive pipeline memory** to support scalable long‑term memory (LTM) and efficient retrieval. - -It extends: - -- RFC 0010 — Cognitive pipeline Memory Schema -- RFC 0007 — Cognitive Pipeline Protocol - ---- - -## 2. Motivation - -Pipelines accumulate: - -- thousands of STM entries -- millions of LTM entries -- episodic logs -- tool state - -Without compression: - -- memory becomes unbounded -- retrieval becomes slow -- serialization becomes expensive - -This RFC defines **compression, summarization, and embedding formats**. - ---- - -## 3. Design Goals - -- Support lossy and lossless compression -- Support embedding‑based memory -- Support summarization chains -- Support provenance tracking -- Support deterministic replay - ---- - -## 4. Compression Model - -Memory entries may include: - -- `raw_value` -- `compressed_value` -- `embedding` -- `summary` -- `provenance` - ---- - -## 5. Full Schema (JSON) - -```json -{ - "key": "string", - "raw_value": {}, - "compressed_value": "string", - "embedding": { "vector": [], "dim": 0 }, - "summary": "string", - "provenance": { - "created_at": "string", - "updated_at": "string", - "source": "string" - } -} -``` - ---- - -## 6. Example - -```json -{ - "key": "project_history", - "summary": "Cognitive pipeline completed 12 tasks related to GPU provisioning.", - "embedding": { "vector": [0.12, 0.44], "dim": 2 } -} -``` - ---- - -## 7. Open Questions Resolution (normative closure) - -### 7.1 Embedding normalization - -- **Decision:** Embedding normalization is recommended, with metric declaration required. -- **Rationale:** Retrieval comparability depends on known similarity semantics. -- **Normative requirement:** Embedding records **SHOULD** include normalization status and distance metric metadata. -- **Migration note:** Existing vectors without metric metadata should be backfilled in index manifests. - -### 7.2 Compression pluggability - -- **Decision:** Compression strategies are pluggable via named strategy identifiers. -- **Rationale:** Different memory workloads require different compression trade-offs. -- **Normative requirement:** Compression pipelines **MUST** declare compressor name and version in output metadata. -- **Migration note:** Custom compressors should define stable IDs before being used in shared datasets. - -### 7.3 Summarization chain - -- **Decision:** Canonical summarization output interface is standardized; algorithm remains implementation-defined. -- **Rationale:** Standardized outputs preserve interoperability while leaving room for innovation. -- **Normative requirement:** Summaries **MUST** preserve source linkage and confidence metadata when source evidence is condensed. -- **Migration note:** Existing summaries without source linkage should add provenance references. - ---- - -## 8. Conclusion - -This RFC defines **memory compression and embedding standards**, enabling scalable long‑term memory. diff --git a/rfcs/0014-memory-conflict-resolution.md b/rfcs/0014-memory-conflict-resolution.md deleted file mode 100644 index f58d70d..0000000 --- a/rfcs/0014-memory-conflict-resolution.md +++ /dev/null @@ -1,160 +0,0 @@ -# RFC 0014 — Memory Conflict Resolution (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/14 ---- - -## 1. Summary - -This RFC defines the **Memory Conflict Resolution Standard**, a unified mechanism for resolving conflicting entries in cognitive pipeline memory, including: - -- short‑term memory (STM) -- long‑term memory (LTM) -- episodic memory -- tool memory -- compressed/embedded memory (RFC 0013) - -It extends: - -- RFC 0010 — Cognitive pipeline Memory Schema -- RFC 0013 — Memory Compression & Embedding - ---- - -## 2. Motivation - -Pipelines accumulate memory from: - -- multiple tools -- multiple pipelines (RFC 0011) -- multiple episodes -- multiple verifiers -- multiple reward signals - -Conflicts arise when: - -- two entries have the same key -- two entries disagree -- two entries differ in confidence -- two entries differ in provenance -- two entries differ in timestamp - -This RFC defines a **deterministic, reproducible conflict resolution algorithm**. - ---- - -## 3. Design Goals - -- Deterministic conflict resolution -- Support for confidence‑weighted merging -- Support for timestamp‑based precedence -- Support for provenance‑aware resolution -- Support for lossy and lossless merging -- Support for multi‑cognitive pipeline memory isolation - ---- - -## 4. Conflict Types - -### 4.1 Key Collision -Two entries share the same key. - -### 4.2 Value Disagreement -Two entries disagree on content. - -### 4.3 Provenance Conflict -Entries originate from different sources with different trust levels. - -### 4.4 Timestamp Conflict -Newer vs older entries. - -### 4.5 Confidence Conflict -Entries have different confidence scores. - ---- - -## 5. Resolution Strategies - -### 5.1 `prefer_newest` -Choose the entry with the latest timestamp. - -### 5.2 `prefer_highest_confidence` -Choose the entry with the highest confidence. - -### 5.3 `weighted_merge` -Merge values using confidence weights. - -### 5.4 `provenance_priority` -Use a predefined trust hierarchy. - -### 5.5 `custom` -User‑defined logic. - ---- - -## 6. Full Schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0014 — Memory Conflict Resolution", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.1"] }, - "key": { "type": "string" }, - "entries": { - "type": "array", - "items": { - "type": "object", - "properties": { - "value": {}, - "timestamp": { "type": "string", "format": "date-time" }, - "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, - "provenance": { "type": "string" } - }, - "required": ["value"] - }, - "minItems": 1 - }, - "resolution_strategy": { - "type": "string", - "enum": [ - "prefer_newest", - "prefer_highest_confidence", - "weighted_merge", - "provenance_priority", - "custom" - ] - }, - "resolved_value": {} - }, - "required": ["version", "key", "entries", "resolution_strategy", "resolved_value"] -} -``` - - ---- - -## 7. Example - -```json -{ - "version": "0.1", - "key": "preferred_units", - "entries": [ - { "value": "metric", "confidence": 0.95 }, - { "value": "imperial", "confidence": 0.40 } - ], - "resolution_strategy": "prefer_highest_confidence", - "resolved_value": "metric" -} -``` - ---- - -## 8. Conclusion - -This RFC defines deterministic, reproducible memory conflict resolution for all cognitive pipeline memory types. diff --git a/rfcs/0015-multi-party-reward-sharing.md b/rfcs/0015-multi-party-reward-sharing.md deleted file mode 100644 index 10223aa..0000000 --- a/rfcs/0015-multi-party-reward-sharing.md +++ /dev/null @@ -1,96 +0,0 @@ -# RFC 0015 — Multi‑Cognitive pipeline Reward Sharing (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/15 ---- - -## 1. Summary - -This RFC defines the **Multi‑Cognitive pipeline Reward Sharing Standard**, enabling structured reward distribution across multiple collaborating or competing pipelines. - -It extends: - -- RFC 0005 — RL Reward Trace Schema -- RFC 0011 — Multi‑Cognitive pipeline Protocol - ---- - -## 2. Motivation - -Multi‑cognitive pipeline systems require reward sharing for: - -- cooperative tasks -- competitive tasks -- hierarchical planning -- self‑play -- distributed tool use -- multi‑cognitive pipeline RL - -Without a standard: - -- reward propagation is inconsistent -- training becomes unstable -- evaluation becomes incomparable - -This RFC defines a **unified reward sharing schema**. - ---- - -## 3. Reward Sharing Models - -### 3.1 Cooperative -All pipelines share the same reward. - -### 3.2 Competitive -Pipelines receive opposing rewards. - -### 3.3 Mixed -Some rewards are shared, some are individual. - -### 3.4 Hierarchical -Planner receives meta‑reward; executors receive step‑rewards. - -### 3.5 Custom -User‑defined reward mapping. - ---- - -## 4. Full Schema (JSON) - -```json -{ - "version": "0.1", - "trace_id": "string", - "pipelines": ["planner", "coder", "verifier"], - "reward_model": "cooperative", - "agent_rewards": { - "planner": 1.0, - "coder": 1.0, - "verifier": 1.0 - }, - "metadata": {} -} -``` - ---- - -## 5. Example: Hierarchical Reward - -```json -{ - "reward_model": "hierarchical", - "agent_rewards": { - "planner": 0.5, - "coder": 1.0, - "verifier": 0.8 - } -} -``` - ---- - -## 6. Conclusion - -This RFC standardizes reward sharing across multi‑cognitive pipeline systems. diff --git a/rfcs/0016-tool-capability-negotiation.md b/rfcs/0016-tool-capability-negotiation.md deleted file mode 100644 index 51bf4bb..0000000 --- a/rfcs/0016-tool-capability-negotiation.md +++ /dev/null @@ -1,91 +0,0 @@ -# RFC 0016 — Tool Capability Negotiation (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/16 ---- - -## 1. Summary - -This RFC defines the **Tool Capability Negotiation Standard**, enabling pipelines to: - -- discover tool capabilities -- negotiate tool parameters -- validate tool compatibility -- adapt reasoning based on tool constraints - -It extends: - -- RFC 0003 — Tool Invocation Schema -- RFC 0007 — Cognitive Pipeline Protocol - ---- - -## 2. Motivation - -Tools vary in: - -- input formats -- output formats -- rate limits -- supported operations -- authentication requirements -- cost models - -Pipelines must negotiate capabilities before invoking tools. - -This RFC defines a **structured negotiation protocol**. - ---- - -## 3. Capability Types - -- `input_schema` -- `output_schema` -- `supported_operations` -- `cost_per_call` -- `max_batch_size` -- `authentication_required` -- `version` - ---- - -## 4. Full Schema (JSON) - -```json -{ - "tool_name": "string", - "requester_id": "string", - "requested_capabilities": ["input_schema", "supported_operations"], - "tool_response": { - "input_schema": {}, - "supported_operations": ["search", "lookup"], - "version": "1.2.0" - }, - "negotiation_status": "success" -} -``` - ---- - -## 5. Example - -```json -{ - "tool_name": "weather_api", - "requested_capabilities": ["input_schema"], - "tool_response": { - "input_schema": { - "city": "string", - "state": "string" - } - } -} -``` - ---- - -## 6. Conclusion - -This RFC defines a unified negotiation protocol for tool capabilities, enabling robust tool‑augmented reasoning. diff --git a/rfcs/0017-runtime-safety-sandboxing.md b/rfcs/0017-runtime-safety-sandboxing.md deleted file mode 100644 index 25c7b14..0000000 --- a/rfcs/0017-runtime-safety-sandboxing.md +++ /dev/null @@ -1,124 +0,0 @@ -# RFC 0017 — Cognitive pipeline Safety & Sandboxing (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/17 ---- - -## 1. Summary - -This RFC defines the **Cognitive pipeline Safety & Sandboxing Standard**, a unified mechanism for restricting, monitoring, and validating cognitive pipeline actions, tool calls, and memory access. - -It extends: - -- RFC 0003 — Tool Invocation Schema -- RFC 0007 — Cognitive Pipeline Protocol -- RFC 0010 — Cognitive pipeline Memory Schema - ---- - -## 2. Motivation - -Pipelines require safety boundaries to prevent: - -- unsafe tool calls -- unauthorized memory access -- infinite loops -- excessive branching -- unsafe multi‑cognitive pipeline interactions -- unbounded resource usage - -This RFC defines a **sandbox layer** that enforces constraints. - ---- - -## 3. Safety Domains - -- **Tool Safety** — allowed tools, rate limits, argument validation -- **Memory Safety** — read/write permissions, key‑level ACLs -- **Execution Safety** — step limits, recursion limits -- **Branching Safety** — max branches, pruning rules -- **Multi‑Cognitive pipeline Safety** — message filtering, role isolation - ---- - -## 4. Sandbox Configuration Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0017 — Cognitive pipeline Safety & Sandboxing Configuration", - "description": "Defines sandbox policies that constrain cognitive pipeline behavior at runtime: which tools are permitted, step/branch limits, and memory access controls.", - "type": "object", - "properties": { - "allowed_tools": { - "type": "array", - "items": { "type": "string" }, - "description": "Tool names the cognitive pipeline may invoke. Use [\"*\"] to allow all." - }, - "blocked_tools": { - "type": "array", - "items": { "type": "string" }, - "description": "Tool names explicitly denied regardless of allowed_tools." - }, - "max_steps": { - "type": "integer", - "minimum": 1, - "description": "Maximum number of loop iterations before forced stop." - }, - "max_branches": { - "type": "integer", - "minimum": 1, - "description": "Maximum number of concurrent reasoning branches." - }, - "memory_acl": { - "type": "object", - "description": "Access control list mapping role or requester IDs to permission arrays.", - "additionalProperties": { - "type": "array", - "items": { - "type": "string", - "enum": ["read", "write", "execute", "admin"] - } - } - } - }, - "required": ["allowed_tools", "blocked_tools", "max_steps"], - "additionalProperties": true -} -``` - - -**Example instance:** - -```json -{ - "allowed_tools": ["search", "calculator"], - "blocked_tools": ["shell", "network_raw"], - "max_steps": 128, - "max_branches": 16, - "memory_acl": { - "planner": ["read"], - "executor": ["read", "write"] - } -} -``` - ---- - -## 5. Example - -```json -{ - "allowed_tools": ["weather_api"], - "max_steps": 32 -} -``` - ---- - -## 6. Conclusion - -This RFC defines a unified safety and sandboxing layer for cognitive pipeline execution. diff --git a/rfcs/0018-tool-error-taxonomy.md b/rfcs/0018-tool-error-taxonomy.md deleted file mode 100644 index fdbd563..0000000 --- a/rfcs/0018-tool-error-taxonomy.md +++ /dev/null @@ -1,83 +0,0 @@ -# RFC 0018 — Tool Error Taxonomy (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/18 ---- - -## 1. Summary - -This RFC defines a structured error taxonomy for tool invocation failures and degraded responses. - -It extends: - -- RFC 0003 — Tool Invocation Schema -- RFC 0007 — Cognitive Pipeline Protocol - ---- - -## 2. Error classes - -- `auth_error`: credential or identity failure -- `permission_error`: policy or ACL denial -- `timeout_error`: request exceeded deadline -- `input_validation_error`: malformed arguments -- `tool_unavailable`: service dependency unavailable -- `execution_error`: runtime failure in tool execution -- `rate_limited`: quota/rate limit triggered -- `unknown_error`: uncategorized failure - ---- - -## 3. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0018 — Tool Error Taxonomy", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.1"] }, - "tool_name": { "type": "string" }, - "error_code": { - "type": "string", - "enum": [ - "auth_error", - "permission_error", - "timeout_error", - "input_validation_error", - "tool_unavailable", - "execution_error", - "rate_limited", - "unknown_error" - ] - }, - "message": { "type": "string" }, - "retryable": { "type": "boolean" }, - "metadata": { "type": "object" } - }, - "required": ["version", "tool_name", "error_code", "message", "retryable"] -} -``` - ---- - -## 4. Example - -```json -{ - "version": "0.1", - "tool_name": "weather_api", - "error_code": "timeout_error", - "message": "Request timed out after 5s.", - "retryable": true, - "metadata": { "timeout_seconds": 5 } -} -``` - ---- - -## 5. Conclusion - -RFC 0018 provides a shared, machine-readable error vocabulary for tool-augmented reasoning systems. diff --git a/rfcs/0019-collaborative-planning-graphs.md b/rfcs/0019-collaborative-planning-graphs.md deleted file mode 100644 index 63e4314..0000000 --- a/rfcs/0019-collaborative-planning-graphs.md +++ /dev/null @@ -1,81 +0,0 @@ -# RFC 0019 — Multi‑Cognitive pipeline Planning Graphs (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/19 ---- - -## 1. Summary - -This RFC defines the **Multi‑Cognitive pipeline Planning Graph Schema**, enabling structured representation of collaborative planning across multiple pipelines. - -It extends: - -- RFC 0004 — Branching Reasoning Extensions -- RFC 0011 — Multi‑Cognitive pipeline Protocol - ---- - -## 2. Motivation - -Multi‑cognitive pipeline systems require: - -- shared planning graphs -- role‑based subgraphs -- dependency tracking -- conflict detection -- plan merging - -This RFC defines a **graph‑based planning representation**. - ---- - -## 3. Graph Components - -- **nodes** — tasks, subgoals, tool calls -- **edges** — dependencies -- **owners** — cognitive pipeline responsible for each node -- **status** — pending, running, done, failed - ---- - -## 4. Full Schema (JSON) - -```json -{ - "nodes": [ - { - "id": "n1", - "description": "Plan route", - "owner": "planner", - "status": "pending" - } - ], - "edges": [ - { "from": "n1", "to": "n2" } - ] -} -``` - ---- - -## 5. Example - -```json -{ - "nodes": [ - { "id": "n1", "owner": "planner" }, - { "id": "n2", "owner": "executor" } - ], - "edges": [ - { "from": "n1", "to": "n2" } - ] -} -``` - ---- - -## 6. Conclusion - -This RFC defines a unified planning graph for multi‑cognitive pipeline coordination. diff --git a/rfcs/0020-verifiable-scratchpad-compression.md b/rfcs/0020-verifiable-scratchpad-compression.md deleted file mode 100644 index da8be54..0000000 --- a/rfcs/0020-verifiable-scratchpad-compression.md +++ /dev/null @@ -1,88 +0,0 @@ -# RFC 0020 — Verifiable Scratchpad Compression (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.5 -**Discussion:** https://github.com/supernovae/open-cot/discussions/20 ---- - -## 1. Summary - -This RFC defines a compact representation for scratchpad reasoning while preserving verifiability and provenance. - -It extends: - -- RFC 0001 — Reasoning Schema -- RFC 0013 — Memory Compression & Embedding -- RFC 0035 — Data Provenance Tracking - ---- - -## 2. Motivation - -Long reasoning traces are expensive to store and process. Compression is useful, but compressed artifacts must still be auditable and re-expandable for verification. - ---- - -## 3. Compression model - -Compression outputs include: - -- a compressed scratchpad payload -- source step references -- algorithm identifier and version -- integrity hash of source material - ---- - -## 4. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0020 — Verifiable Scratchpad Compression", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.1"] }, - "trace_id": { "type": "string" }, - "compression": { - "type": "object", - "properties": { - "algorithm": { "type": "string" }, - "algorithm_version": { "type": "string" }, - "payload": { "type": "string" } - }, - "required": ["algorithm", "algorithm_version", "payload"] - }, - "source_step_ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, - "source_hash": { "type": "string" }, - "provenance_ref": { "type": "string" } - }, - "required": ["version", "trace_id", "compression", "source_step_ids", "source_hash"] -} -``` - ---- - -## 5. Example - -```json -{ - "version": "0.1", - "trace_id": "trace_001", - "compression": { - "algorithm": "summary_delta_v1", - "algorithm_version": "1.0.0", - "payload": "cmp:abc123..." - }, - "source_step_ids": ["s2", "s3", "s4"], - "source_hash": "sha256:4f8a6d...", - "provenance_ref": "prov_001" -} -``` - ---- - -## 6. Conclusion - -RFC 0020 provides a compression contract that reduces storage cost while preserving deterministic verification paths. diff --git a/rfcs/0021-capability-declaration.md b/rfcs/0021-capability-declaration.md deleted file mode 100644 index 9cec294..0000000 --- a/rfcs/0021-capability-declaration.md +++ /dev/null @@ -1,64 +0,0 @@ -# RFC 0021 — Cognitive pipeline Capability Declaration (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/21 ---- - -## 1. Summary - -This RFC defines a **capability declaration format** for pipelines, enabling: - -- capability discovery -- compatibility checks -- multi‑cognitive pipeline coordination -- tool negotiation (RFC 0016) - ---- - -## 2. Capability Types - -- reasoning -- planning -- tool use -- memory -- verification -- multi‑cognitive pipeline communication -- safety level - ---- - -## 3. Full Schema (JSON) - -```json -{ - "requester_id": "planner", - "capabilities": { - "reasoning": true, - "planning": true, - "tool_use": ["search"], - "memory": ["read"], - "safety_level": "restricted" - } -} -``` - ---- - -## 4. Example - -```json -{ - "requester_id": "coder", - "capabilities": { - "tool_use": ["compiler", "executor"] - } -} -``` - ---- - -## 5. Conclusion - -This RFC defines a unified capability declaration for pipelines. diff --git a/rfcs/0022-cognitive-evaluation-protocol.md b/rfcs/0022-cognitive-evaluation-protocol.md deleted file mode 100644 index 6ca2090..0000000 --- a/rfcs/0022-cognitive-evaluation-protocol.md +++ /dev/null @@ -1,130 +0,0 @@ -# RFC 0022 — Cognitive pipeline Evaluation Protocol (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.4 -**Discussion:** https://github.com/supernovae/open-cot/discussions/22 ---- - -## 1. Summary - -This RFC defines a reproducible evaluation contract for Open CoT systems. - -It standardizes: - -- metric groups and reporting fields -- leakage and split-governance checks -- run reproducibility metadata -- confidence and variance reporting - -It integrates RFC 0001 (trace), RFC 0008 (dataset packaging), RFC 0029 (benchmark dataset), and RFC 0031 (telemetry). - ---- - -## 2. Methodology requirements - -### 2.1 Anti-leakage policy - -- Train/eval split boundaries must be declared. -- Hidden holdout identifiers must never appear in training sources. -- Prompt-template version and data snapshot hash must be recorded. - -### 2.2 Reproducibility policy - -- Runs must declare seed, decoding config, model revision, and harness version. -- Aggregated metrics must include sample count and variance summary. - -### 2.3 Reporting policy - -- Report final-answer correctness, schema validity rate, and step-validity proxy at minimum. -- Safety and policy violations must be included when applicable. - ---- - -## 3. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0022 — Cognitive pipeline Evaluation Protocol", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.1"] }, - "run_id": { "type": "string" }, - "model": { "type": "string" }, - "dataset_version": { "type": "string" }, - "harness_version": { "type": "string" }, - "reproducibility": { - "type": "object", - "properties": { - "seed": { "type": "integer" }, - "temperature": { "type": "number" }, - "top_p": { "type": "number" }, - "max_tokens": { "type": "integer" }, - "prompt_hash": { "type": "string" }, - "output_hash": { "type": "string" } - }, - "required": ["seed", "temperature", "top_p", "max_tokens"] - }, - "metrics": { - "type": "object", - "properties": { - "final_answer_exact": { "type": "number", "minimum": 0, "maximum": 1 }, - "schema_validity_rate": { "type": "number", "minimum": 0, "maximum": 1 }, - "step_validity_proxy": { "type": "number", "minimum": 0, "maximum": 1 }, - "safety_violations": { "type": "integer", "minimum": 0 } - }, - "required": ["final_answer_exact", "schema_validity_rate", "step_validity_proxy"] - }, - "statistics": { - "type": "object", - "properties": { - "num_tasks": { "type": "integer", "minimum": 1 }, - "confidence_interval_95": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2 }, - "stddev": { "type": "number", "minimum": 0 } - }, - "required": ["num_tasks"] - } - }, - "required": ["version", "run_id", "model", "dataset_version", "harness_version", "reproducibility", "metrics", "statistics"] -} -``` - ---- - -## 4. Example - -```json -{ - "version": "0.1", - "run_id": "eval-2026-04-14-001", - "model": "example/local-2b-instruct", - "dataset_version": "benchmarks-0.1.0", - "harness_version": "mock-harness-0.1.0", - "reproducibility": { - "seed": 42, - "temperature": 0.0, - "top_p": 1.0, - "max_tokens": 256, - "prompt_hash": "sha256:abc", - "output_hash": "sha256:def" - }, - "metrics": { - "final_answer_exact": 0.83, - "schema_validity_rate": 0.99, - "step_validity_proxy": 0.93, - "safety_violations": 0 - }, - "statistics": { - "num_tasks": 250, - "confidence_interval_95": [0.79, 0.87], - "stddev": 0.07 - } -} -``` - ---- - -## 5. Conclusion - -RFC 0022 defines a rigorous and reproducible evaluation protocol that reduces benchmark leakage risk and makes OSS comparisons auditable. diff --git a/rfcs/0023-humain-in-the-loop-schema.md b/rfcs/0023-humain-in-the-loop-schema.md deleted file mode 100644 index 9e3b5ce..0000000 --- a/rfcs/0023-humain-in-the-loop-schema.md +++ /dev/null @@ -1,172 +0,0 @@ -# RFC 0023 — Human-in-the-Loop Interaction Schema, Status: Draft, Author: Open CoT Community, Created: 2026-04-14 - -**Discussion:** https://github.com/supernovae/open-cot/discussions/23 - -## 1. Summary - -This RFC defines the **Human-in-the-Loop (HITL) Interaction Schema** for Open-CoT, the cognitive control plane for governed cognitive pipeline execution. It standardizes how pipelines **request** human judgment (`approval`, `clarification`, `review`, `override`), how supervisors **respond**, and how responses **resume** execution. Payloads are transport-agnostic (UIs, tickets, chatops, async queues). - -In [RFC 0007](0007-cognitive-pipeline-protocol.md), HITL maps to **`escalate`**: the run pauses on a `human_interaction_request` correlated to `run_id`, `requester_id`, and `step_ref`, until a `human_interaction_response`, **timeout**, or cancellation. - -## 2. Motivation - -**`require_approval`** ([RFC 0041](0041-policy-enforcement-schema.md)) needs a typed contract—otherwise urgency, timeouts, and linkage to human-consent grants ([RFC 0042](0042-permission-acl.md)) drift across integrations. This RFC specifies **auditable** request/response records composable with traces and receipts. It excludes UI layout, notification routing, and cryptographic proof of human presence. - -## 3. Design - -**Types:** `approval` (sign-off before side effects), `clarification` (disambiguation), `review` (artifact review), `override` (supersede prior decisions within bounds). **`options[]`** holds `{ id, label, description?, risk_hint? }`; `approval`/`clarification` SHOULD include options for deterministic automation. **`human_interaction_response.decision`** is `approved`, `rejected`, `modified`, or `timeout`; `modified` SHOULD carry **`justification`** (extensions hold extra payload). - -**`urgency`** (`low`…`critical`) affects queueing only—not ACL bypass. **`timeout_seconds`** bounds wait before auto-`timeout` (policy defines deny vs retry). **`context`** MUST include `run_id`, `requester_id`, `step_ref`. **`requested_by.cognitive pipeline`** identifies the principal; **`presented_to.human`** names role, person, or queue. - -**FSM:** On **`escalate`**, emit `human_interaction_request` before the governed action. On `approved` (+ `selected_option` when options exist), resume per [RFC 0007](0007-cognitive-pipeline-protocol.md) toward `validate_authority` / `observe_result`. On `rejected` or timeout-as-deny, do not perform the blocked effect without new delegation ([RFC 0047](0047-delegation-extension.md)). - -## 4. JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/human-interaction/v0.1", - "title": "Open CoT RFC 0023 — Human Interaction", - "definitions": { - "human_interaction_request": { - "type": "object", - "additionalProperties": false, - "required": ["type", "prompt", "urgency", "timeout_seconds", "context", "requested_by", "presented_to"], - "properties": { - "type": { "type": "string", "enum": ["approval", "clarification", "review", "override"] }, - "prompt": { "type": "string", "minLength": 1 }, - "options": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": ["id", "label"], - "properties": { - "id": { "type": "string", "minLength": 1 }, - "label": { "type": "string", "minLength": 1 }, - "description": { "type": "string" }, - "risk_hint": { "type": "string", "enum": ["low", "medium", "high"] } - } - } - }, - "urgency": { "type": "string", "enum": ["low", "medium", "high", "critical"] }, - "timeout_seconds": { "type": "integer", "minimum": 1 }, - "context": { - "type": "object", - "additionalProperties": false, - "required": ["run_id", "requester_id", "step_ref"], - "properties": { - "run_id": { "type": "string", "minLength": 1 }, - "requester_id": { "type": "string", "minLength": 1 }, - "step_ref": { "type": "string", "minLength": 1 } - } - }, - "requested_by": { - "type": "object", - "additionalProperties": false, - "required": ["pipeline"], - "properties": { - "pipeline": { "type": "string", "minLength": 1 }, - "role": { "type": "string" } - } - }, - "presented_to": { - "type": "object", - "additionalProperties": false, - "required": ["human"], - "properties": { - "human": { "type": "string", "minLength": 1 }, - "queue": { "type": "string" }, - "channel": { "type": "string" } - } - }, - "request_id": { "type": "string", "minLength": 1 } - } - }, - "human_interaction_response": { - "type": "object", - "additionalProperties": false, - "required": ["request_id", "decision", "responder_id", "timestamp"], - "properties": { - "request_id": { "type": "string", "minLength": 1 }, - "decision": { "type": "string", "enum": ["approved", "rejected", "modified", "timeout"] }, - "selected_option": { "type": "string" }, - "justification": { "type": "string" }, - "responder_id": { "type": "string", "minLength": 1 }, - "timestamp": { "type": "string", "format": "date-time" } - } - } - }, - "oneOf": [ - { "$ref": "#/definitions/human_interaction_request" }, - { "$ref": "#/definitions/human_interaction_response" } - ] -} -``` - - -## 5. Examples - -### 5.1 Approval request (database write) - -```json -{ - "request_id": "hitl_req_8f3c2a", - "type": "approval", - "prompt": "Approve INSERT into customers (PII) on prod shard?", - "options": [ - { "id": "approve", "label": "Approve write", "risk_hint": "high" }, - { "id": "reject", "label": "Reject", "risk_hint": "low" } - ], - "urgency": "high", - "timeout_seconds": 900, - "context": { "run_id": "run_7b91", "requester_id": "support-cognitive-pipeline-prod", "step_ref": "plan/12/tool/sql.execute" }, - "requested_by": { "pipeline": "support-cognitive-pipeline-prod", "role": "tier2" }, - "presented_to": { "human": "oncall-db", "queue": "risk-review", "channel": "pager" } -} -``` - -### 5.2 Clarification request - -```json -{ - "request_id": "hitl_req_4410bb", - "type": "clarification", - "prompt": "Does 'archive' mean cold storage only, or delete originals after 30d?", - "options": [ - { "id": "cold_only", "label": "Cold only; retain originals" }, - { "id": "cold_delete", "label": "Cold + delete after 30d", "risk_hint": "high" } - ], - "urgency": "medium", - "timeout_seconds": 3600, - "context": { "run_id": "run_2aa4", "requester_id": "records-cognitive pipeline", "step_ref": "plan/4/delegate/archive_policy" }, - "requested_by": { "pipeline": "records-cognitive pipeline" }, - "presented_to": { "human": "legal-ops", "queue": "clarifications" } -} -``` - -## 6. Cross-references - -| RFC | Title | Relationship | -|-----|--------|----------------| -| [RFC 0007](0007-cognitive-pipeline-protocol.md) | Cognitive Pipeline Protocol | `escalate` pause/resume. | -| [RFC 0041](0041-policy-enforcement-schema.md) | Policy Enforcement | `require_approval` → typed requests. | -| [RFC 0042](0042-permission-acl.md) | Permissions & ACL | Human-consent grants bind `request_id` / context. | -| [RFC 0047](0047-delegation-extension.md) | Delegation | Overrides may require re-delegation. | -| [RFC 0048](0048-execution-receipts-audit-envelopes.md) | Execution Receipts | Responses SHOULD link from envelopes. | - -## 7. Open Questions Resolution - -| Question | Resolution | -|----------|------------| -| Subsume RLHF / eval feedback ([RFC 0005](0005-rl-reward-trace-schema.md), [RFC 0022](0022-cognitive-evaluation-protocol.md))? | **No**—those are training/eval traces; this is **runtime governance**. | -| Mandatory `options`? | **SHOULD** for `approval`/`clarification`; optional for `review`/`override` if freeform is allowed. | -| Who may respond? | **`responder_id`** MUST be authenticated; tie to [RFC 0026](0026-requester-identity-auth.md) where possible. | - -## 8. Acceptance Criteria - -1. Each `human_interaction_request` validates and includes `context.run_id`, `context.requester_id`, `context.step_ref`. -2. Each `human_interaction_response` references `request_id` and a normative `decision`. -3. [RFC 0007](0007-cognitive-pipeline-protocol.md) implementations MUST emit these records on `escalate` for [RFC 0041](0041-policy-enforcement-schema.md) `require_approval` when using this profile. -4. Auto-timeout responses use `decision: "timeout"`; policy documents timeout semantics and clocks. diff --git a/rfcs/0024-multi-modal-reasoning-schema.md b/rfcs/0024-multi-modal-reasoning-schema.md deleted file mode 100644 index 31d9961..0000000 --- a/rfcs/0024-multi-modal-reasoning-schema.md +++ /dev/null @@ -1,71 +0,0 @@ -# RFC 0024 — Multi‑Modal Reasoning Schema (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.5 -**Discussion:** https://github.com/supernovae/open-cot/discussions/24 ---- - -## 1. Summary - -This RFC defines a **multi‑modal extension** to the reasoning schema, enabling pipelines to reason over: - -- text -- images -- audio -- video -- structured data -- embeddings - -It extends: - -- RFC 0001 — Reasoning Schema -- RFC 0004 — Branching Reasoning Extensions - ---- - -## 2. Modalities - -- `text` -- `image` -- `audio` -- `video` -- `table` -- `embedding` - ---- - -## 3. Full Schema (JSON) - -```json -{ - "step_id": "s1", - "type": "observation", - "modality": "image", - "content": { - "image_ref": "img_001" - } -} -``` - ---- - -## 4. Example - -```json -{ - "modality": "table", - "content": { - "rows": [ - ["City", "Population"], - ["Tokyo", "13.9M"] - ] - } -} -``` - ---- - -## 5. Conclusion - -This RFC extends reasoning to multi‑modal inputs and outputs. diff --git a/rfcs/0025-tool-marketplace-registry-format.md b/rfcs/0025-tool-marketplace-registry-format.md deleted file mode 100644 index e02a052..0000000 --- a/rfcs/0025-tool-marketplace-registry-format.md +++ /dev/null @@ -1,149 +0,0 @@ -# RFC 0025 — Tool Marketplace & Registry Format, Status: Draft, Author: Open CoT Community, Created: 2026-04-14 - -**Discussion:** https://github.com/supernovae/open-cot/discussions/25 - -## 1. Summary - -This RFC defines the **Tool Marketplace & Registry Format** for Open-CoT: a versioned **`tool_registry`** catalog of **`tool_registry_entry`** records for publishing and discovering tools under governance. Entries include **input** / **output** JSON Schemas, **`required_permissions[]`**, **`risk_level`**, **`cost_estimate`**, **`timeout_default_ms`**, **`categories[]`**, **`author`**, **`documentation_url`**, and optional **`health_check_endpoint`**. - -The format extends [RFC 0003](0003-tool-invocation-schema.md) (runtime invocation shape) and [RFC 0016](0016-tool-capability-negotiation.md) (caller capabilities). Policy and cost systems consume the same metadata ([RFC 0039](0039-tool-cost-modeling-biling.md), [RFC 0041](0041-policy-enforcement-schema.md)). - -## 2. Motivation - -Without a **canonical contract**, metadata and permission names diverge; policy cannot reliably target tools. A normative registry enables indexing, CI validation, risk routing, and cost-aware scheduling. This RFC defines **document shape** only—not storage backend, signing, or discovery transport. - -## 3. Design - -**`tool_registry_entry`:** `tool_name` (stable logical id), SemVer **`version`**, **`description`**. **`input_schema`** / **`output_schema`** MUST be JSON Schema documents for [RFC 0003](0003-tool-invocation-schema.md) args/results. **`required_permissions[]`** lists tokens required of callers ([RFC 0016](0016-tool-capability-negotiation.md), [RFC 0042](0042-permission-acl.md)); policy may map to `require_approval` ([RFC 0041](0041-policy-enforcement-schema.md)). **`risk_level`** is `low` \| `medium` \| `high`. **`cost_estimate`** is advisory for [RFC 0039](0039-tool-cost-modeling-biling.md) (`model`: `per_call_flat` \| `per_token` \| `custom`, plus `amount` / `currency` / `notes`). **`timeout_default_ms`**, **`categories[]`**, **`author`**, **`documentation_url`** are required; **`health_check_endpoint`** is optional (HTTP liveness). - -**`tool_registry`:** envelope **`version`** (this format, currently `0.1`), RFC 3339 **`updated_at`**, **`entries[]`**. Reject duplicate `(tool_name, version)` within one document. Policy SHOULD use resources `tool:` ([RFC 0041](0041-policy-enforcement-schema.md)) with fields mirrored from the registry snapshot under evaluation. - -## 4. JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/tool-registry/v0.1", - "title": "Open CoT RFC 0025 — Tool Registry", - "type": "object", - "additionalProperties": false, - "required": ["version", "entries", "updated_at"], - "properties": { - "version": { "type": "string", "const": "0.1" }, - "updated_at": { "type": "string", "format": "date-time" }, - "entries": { "type": "array", "items": { "$ref": "#/definitions/tool_registry_entry" } } - }, - "definitions": { - "tool_registry_entry": { - "type": "object", - "additionalProperties": false, - "required": [ - "tool_name", "version", "description", "input_schema", "output_schema", - "required_permissions", "risk_level", "cost_estimate", "timeout_default_ms", - "categories", "author", "documentation_url" - ], - "properties": { - "tool_name": { "type": "string", "minLength": 1 }, - "version": { "type": "string", "minLength": 1 }, - "description": { "type": "string", "minLength": 1 }, - "input_schema": { "type": "object" }, - "output_schema": { "type": "object" }, - "required_permissions": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "risk_level": { "type": "string", "enum": ["low", "medium", "high"] }, - "cost_estimate": { - "type": "object", - "additionalProperties": false, - "required": ["model"], - "properties": { - "model": { "type": "string", "enum": ["per_call_flat", "per_token", "custom"] }, - "amount": { "type": "number" }, - "currency": { "type": "string" }, - "notes": { "type": "string" } - } - }, - "timeout_default_ms": { "type": "integer", "minimum": 1 }, - "categories": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "author": { "type": "string", "minLength": 1 }, - "documentation_url": { "type": "string", "format": "uri" }, - "health_check_endpoint": { "type": "string", "format": "uri" } - } - } - } -} -``` - - -## 5. Examples - -### 5.1 Search tool entry - -```json -{ - "version": "0.1", - "updated_at": "2026-04-14T12:00:00Z", - "entries": [{ - "tool_name": "com.example.web_search", - "version": "2.4.1", - "description": "Approved web index; ranked snippets with citations.", - "input_schema": { "type": "object", "required": ["query"], "properties": { "query": { "type": "string" }, "max_results": { "type": "integer", "minimum": 1, "maximum": 20 } } }, - "output_schema": { "type": "object", "required": ["results"], "properties": { "results": { "type": "array", "items": { "type": "object", "required": ["title", "url"], "properties": { "title": { "type": "string" }, "url": { "type": "string" }, "snippet": { "type": "string" } } } } } }, - "required_permissions": ["network.read", "tool.search.invoke"], - "risk_level": "low", - "cost_estimate": { "model": "per_call_flat", "amount": 0.002, "currency": "USD" }, - "timeout_default_ms": 15000, - "categories": ["search", "external-knowledge"], - "author": "Example Corp", - "documentation_url": "https://docs.example.com/tools/web_search", - "health_check_endpoint": "https://search.example.com/healthz" - }] -} -``` - -### 5.2 File-write tool entry - -```json -{ - "version": "0.1", - "updated_at": "2026-04-14T12:00:00Z", - "entries": [{ - "tool_name": "com.opencot.fs.write_file", - "version": "1.0.0", - "description": "Writes UTF-8 text inside the workspace sandbox.", - "input_schema": { "type": "object", "required": ["path", "content"], "properties": { "path": { "type": "string" }, "content": { "type": "string" }, "create_parents": { "type": "boolean" } } }, - "output_schema": { "type": "object", "required": ["bytes_written"], "properties": { "bytes_written": { "type": "integer", "minimum": 0 } } }, - "required_permissions": ["filesystem.write", "tool.fs.write_file.invoke"], - "risk_level": "high", - "cost_estimate": { "model": "custom", "notes": "Storage quota; see RFC 0039 metering." }, - "timeout_default_ms": 5000, - "categories": ["filesystem", "side-effect"], - "author": "Open CoT Community", - "documentation_url": "https://opencot.dev/rfcs/0003-tool-invocation-schema" - }] -} -``` - -## 6. Cross-references - -| RFC | Title | Relationship | -|-----|--------|----------------| -| [RFC 0003](0003-tool-invocation-schema.md) | Tool Invocation | Runtime calls follow entry schemas. | -| [RFC 0016](0016-tool-capability-negotiation.md) | Capability Negotiation | Aligns with `required_permissions`. | -| [RFC 0039](0039-tool-cost-modeling-biling.md) | Tool Cost Modeling | Uses `cost_estimate` + actuals. | -| [RFC 0041](0041-policy-enforcement-schema.md) | Policy Enforcement | Rules target `tool:`. | -| [RFC 0042](0042-permission-acl.md) | Permissions & ACL | Grants cover `required_permissions`. | - -## 7. Open Questions Resolution - -| Question | Resolution | -|----------|------------| -| Required `health_check_endpoint`? | **Optional**—non-HTTP tools exist. | -| Nested / bundled tools? | **Out of scope v0.1**; future `bundle_id` possible. | -| JSON Schema draft for nested schemas? | Nested objects SHOULD set their own `$schema`; validators introspect. | - -## 8. Acceptance Criteria - -1. Parsed **`tool_registry`** includes `version`, `updated_at`, non-empty `entries`. -2. Each entry validates and includes `input_schema`, `output_schema`, `risk_level`, `required_permissions`. -3. Policy can match `tool:` and permissions without extra heuristics ([RFC 0041](0041-policy-enforcement-schema.md), [RFC 0042](0042-permission-acl.md)). -4. Duplicate `(tool_name, version)` in one file is rejected by conforming loaders. diff --git a/rfcs/0026-requester-identity-auth.md b/rfcs/0026-requester-identity-auth.md deleted file mode 100644 index 7d5d04f..0000000 --- a/rfcs/0026-requester-identity-auth.md +++ /dev/null @@ -1,169 +0,0 @@ -# RFC 0026 — Cognitive pipeline Identity & Authentication (v0.2) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.5 -**Discussion:** https://github.com/supernovae/open-cot/discussions/26 ---- - -## 1. Summary - -Open CoT is a **cognitive control plane**: the harness mediates every transition between reasoning, policy, delegation, and tool execution. **Cognitive pipeline identity** is how the harness answers *who* is requesting authority. Every delegation request, permission grant, and audit event references a stable `requester_id` and the trust metadata defined here. - -This RFC specifies the normative **AgentIdentity** record: identifiers, human-facing labels, operational role, trust tier, declared capabilities (claims only—never grants), optional cryptographic material for signature verification, optional delegation lineage, timestamps, and extensible metadata. - -**Cross-references:** [RFC 0007 — Cognitive Pipeline / FSM](0007-cognitive-pipeline-protocol.md) (governed states bind identity to transitions); [RFC 0041 — Policy Enforcement](0041-policy-enforcement-schema.md) (subject matching against `requester_id` and trust); [RFC 0042 — Permissions](0042-permission-acl.md) (`granted_to` and ACL subjects); [RFC 0047 — Delegation Extension](0047-delegation-extension.md) (`delegation_request.requester` MUST resolve to a verified identity). - ---- - -## 2. Motivation - -Without a typed identity model, frameworks conflate “the model said so” with authorization, lose auditability across sub-pipelines, and cannot express pre-authorized tool tiers consistently. A single **AgentIdentity** schema lets policy engines match rules, lets permission stores attach grants to principals, and lets delegation receipts bind authority to a **verified** `requester_id`. - ---- - -## 3. Identity model - -| Field | Required | Description | -|-------|----------|-------------| -| `requester_id` | yes | Globally unique identifier for this principal within the deployment (URI-safe string). | -| `display_name` | yes | Human-readable label for UIs and logs. | -| `role` | yes | Operational role enum (orchestration vs execution vs verification vs delegated vs custom). | -| `trust_level` | yes | Harness-defined trust tier affecting default pre-authorization posture. | -| `capabilities_declared` | yes | Array of capability strings this cognitive pipeline **claims** to support (advertisement only; grants live in RFC 0042). | -| `public_key` | no | Public key material (encoding defined by deployment; often PEM or base64 raw key). | -| `key_algorithm` | no | Algorithm identifier, e.g. `ed25519`, `p256`. MUST be present if `public_key` is set. | -| `parent_requester_id` | no | If this identity is a delegated sub-cognitive pipeline, the `requester_id` of the delegator. | -| `created_at` | yes | RFC 3339 timestamp when this identity record was first registered. | -| `metadata` | yes | Extensible object for org-specific attributes (team, tenant, labels). MAY be empty `{}`. | - ---- - -## 4. Trust levels - -Trust levels describe **default harness posture** for pre-authorized tooling and policy shortcuts. They do not replace explicit permission grants or delegation receipts ([RFC 0047](0047-delegation-extension.md)). - -| Value | Meaning | -|-------|---------| -| `untrusted` | No tools pre-authorized; every sensitive action flows through explicit delegation unless a standing grant says otherwise. | -| `low` | Basic **read-only** tools MAY be pre-authorized per deployment policy (e.g., search, calculators). | -| `medium` | A **standard** curated tool set MAY be pre-authorized (still subject to policy and audit). | -| `high` | **Broad** pre-authorization for vetted pipelines; the harness MUST still refuse **self-granted** writes—writes require receipts or human/policy decisions. | -| `system` | **Harness-internal** identity (scheduler, broker, policy adapter). MUST NOT be assigned to model-backed pipelines. | - ---- - -## 5. Full schema (JSON Schema) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0026/requester-identity.json", - "title": "Open CoT RFC 0026 — Cognitive pipeline Identity", - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.2"] }, - "requester_id": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9._:@/-]+$" }, - "display_name": { "type": "string", "minLength": 1 }, - "role": { - "type": "string", - "enum": ["orchestrator", "executor", "verifier", "delegated", "custom"] - }, - "trust_level": { - "type": "string", - "enum": ["untrusted", "low", "medium", "high", "system"] - }, - "capabilities_declared": { - "type": "array", - "items": { "type": "string", "minLength": 1 } - }, - "public_key": { "type": "string" }, - "key_algorithm": { "type": "string" }, - "parent_requester_id": { "type": "string", "minLength": 1 }, - "created_at": { "type": "string", "format": "date-time" }, - "metadata": { "type": "object" } - }, - "required": [ - "schema_version", - "requester_id", - "display_name", - "role", - "trust_level", - "capabilities_declared", - "created_at", - "metadata" - ], - "allOf": [ - { - "if": { "required": ["public_key"], "properties": { "public_key": { "minLength": 1 } } }, - "then": { "required": ["key_algorithm"] } - } - ] -} -``` - - ---- - -## 6. Examples - -### 6.1 Orchestrator with signing key - -```json -{ - "schema_version": "0.2", - "requester_id": "cognitive-pipeline:org/acme/planner-main", - "display_name": "Acme Planner", - "role": "orchestrator", - "trust_level": "high", - "capabilities_declared": ["tool:web.search", "tool:docs.read", "plan:branching"], - "public_key": "MCowBQYDK2VwAyEA...", - "key_algorithm": "ed25519", - "created_at": "2026-04-14T12:00:00Z", - "metadata": { "tenant": "acme", "env": "prod" } -} -``` - -### 6.2 Delegated sub-executor, low trust - -```json -{ - "schema_version": "0.2", - "requester_id": "cognitive-pipeline:org/acme/exec-worker-07", - "display_name": "Delegated worker 07", - "role": "delegated", - "trust_level": "low", - "capabilities_declared": ["tool:email.read_headers"], - "parent_requester_id": "cognitive-pipeline:org/acme/planner-main", - "created_at": "2026-04-14T12:05:00Z", - "metadata": {} -} -``` - ---- - -## 7. Open questions — resolution - -| Question | Resolution | -|----------|------------| -| Are `capabilities_declared` normative for policy? | **No.** They are **hints** and audit context. Enforcement uses explicit permissions ([RFC 0042](0042-permission-acl.md)) and delegation receipts ([RFC 0047](0047-delegation-extension.md)). | -| Can a model cognitive pipeline use `trust_level: system`? | **No.** `system` is reserved for harness components; registrars MUST reject assignment to model-backed identities. | -| Encoding of `public_key`? | **Deployment-defined.** The schema only requires `key_algorithm` when a key is present; transports SHOULD document encoding (PEM vs raw). | - ---- - -## 8. Acceptance criteria - -1. Every `DelegationRequest.requester` ([RFC 0047](0047-delegation-extension.md)) MUST equal an `requester_id` registered in the harness identity store conforming to this schema. -2. Policy `subject` fields ([RFC 0041](0041-policy-enforcement-schema.md)) MAY reference `requester_id`, `role`, `trust_level`, and labels in `metadata`. -3. Permission grants ([RFC 0042](0042-permission-acl.md)) MUST bind to `requester_id` (or a group resolved to pipelines), never to free-text model self-identification. -4. Implementations MUST treat `capabilities_declared` as non-authoritative for allow/deny decisions unless a separate grant references them. -5. Validators MUST reject `public_key` without `key_algorithm`, and reject `trust_level: system` on identities tagged as model pipelines in the deployment registry. - ---- - -## 9. Conclusion - -RFC 0026 v0.2 defines the **AgentIdentity** contract: stable principals, trust tiers, optional cryptography, and explicit separation between **declared** capabilities and **granted** authority—foundation for the governed FSM in RFC 0007 and the delegation objects in RFC 0047. diff --git a/rfcs/0027-distributed-execution-protocol.md b/rfcs/0027-distributed-execution-protocol.md deleted file mode 100644 index be9afe0..0000000 --- a/rfcs/0027-distributed-execution-protocol.md +++ /dev/null @@ -1,143 +0,0 @@ -# RFC 0027 — Distributed Cognitive pipeline Execution Protocol, Status: Draft, Author: Open CoT Community, Created: 2026-04-14 - -**Discussion:** https://github.com/supernovae/open-cot/discussions/27 - -## 1. Summary - -This RFC defines the **Distributed Cognitive pipeline Execution Protocol** for Open-CoT: **`execution_node`** advertisements, **`task_assignment`** with explicit **`delegated_scope`**, and terminal **`execution_result`** records (hashes, trace pointers, **`receipt_refs[]`**). Each node runs its own governed FSM ([RFC 0007](0007-cognitive-pipeline-protocol.md)); coordination is explicit. - -Participants have distinct identities ([RFC 0026](0026-requester-identity-auth.md)) and MUST obtain authority independently ([RFC 0047](0047-delegation-extension.md)). [RFC 0048](0048-execution-receipts-audit-envelopes.md) receipts chain cross-node work. - -## 2. Motivation - -Regulated workloads need sandboxes, residency, and blast-radius isolation. Ad hoc RPCs lose parent/child linkage and delegation evidence. These interchange types give orchestrators, workers, and audit pipelines shared semantics. Transport, schedulers, and consensus are out of scope. - -## 3. Design - -**`execution_node`:** `node_id` (unique), `requester_id` ([RFC 0026](0026-requester-identity-auth.md)), `endpoint` (URL, queue, etc.), `capabilities[]` (e.g. `code.exec`, `tool.invoke`; see [RFC 0016](0016-tool-capability-negotiation.md)), `trust_level` (`low` \| `medium` \| `high`), `status` (`active` \| `draining` \| `offline`). - -**`task_assignment`:** `assignment_id`, `task_hash` (canonical task bytes), `assigned_to` (`node_id`), `parent_run_id` ([RFC 0007](0007-cognitive-pipeline-protocol.md)), `delegated_scope` (at minimum `summary`; MAY include `allowed_tools`, `max_risk_level`, `valid_until`) proven under [RFC 0047](0047-delegation-extension.md), `timeout_seconds`, `priority`. - -**`execution_result`:** `assignment_id`, `node_id`, `status` (`completed` \| `failed` \| `timeout`), `result_hash`, `trace_ref`, `receipt_refs[]` ([RFC 0048](0048-execution-receipts-audit-envelopes.md)). - -**Delegation:** Children re-evaluate policy locally; parent approval does not bypass child `validate_authority`. Mismatch → `failed` plus explanatory receipts. - -**Idempotency:** Workers SHOULD treat `assignment_id` as idempotent: redelivered assignments with the same `task_hash` and `delegated_scope` MUST yield the same side effects or a deterministic `failed`/`completed` outcome without double application. Parents SHOULD rotate `assignment_id` when `task_hash` changes. - -## 4. JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/distributed-execution/v0.1", - "title": "Open CoT RFC 0027 — Distributed Execution", - "definitions": { - "execution_node": { - "type": "object", - "additionalProperties": false, - "required": ["node_id", "requester_id", "endpoint", "capabilities", "trust_level", "status"], - "properties": { - "node_id": { "type": "string", "minLength": 1 }, - "requester_id": { "type": "string", "minLength": 1 }, - "endpoint": { "type": "string", "minLength": 1 }, - "capabilities": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "trust_level": { "type": "string", "enum": ["low", "medium", "high"] }, - "status": { "type": "string", "enum": ["active", "draining", "offline"] } - } - }, - "task_assignment": { - "type": "object", - "additionalProperties": false, - "required": ["assignment_id", "task_hash", "assigned_to", "parent_run_id", "delegated_scope", "timeout_seconds", "priority"], - "properties": { - "assignment_id": { "type": "string", "minLength": 1 }, - "task_hash": { "type": "string", "minLength": 1 }, - "assigned_to": { "type": "string", "minLength": 1 }, - "parent_run_id": { "type": "string", "minLength": 1 }, - "delegated_scope": { - "type": "object", - "additionalProperties": true, - "required": ["summary"], - "properties": { - "summary": { "type": "string", "minLength": 1 }, - "allowed_tools": { "type": "array", "items": { "type": "string" } }, - "max_risk_level": { "type": "string", "enum": ["low", "medium", "high"] }, - "valid_until": { "type": "string", "format": "date-time" } - } - }, - "timeout_seconds": { "type": "integer", "minimum": 1 }, - "priority": { "type": "integer" } - } - }, - "execution_result": { - "type": "object", - "additionalProperties": false, - "required": ["assignment_id", "node_id", "status", "result_hash", "trace_ref", "receipt_refs"], - "properties": { - "assignment_id": { "type": "string", "minLength": 1 }, - "node_id": { "type": "string", "minLength": 1 }, - "status": { "type": "string", "enum": ["completed", "failed", "timeout"] }, - "result_hash": { "type": "string", "minLength": 1 }, - "trace_ref": { "type": "string", "minLength": 1 }, - "receipt_refs": { "type": "array", "items": { "type": "string", "minLength": 1 } } - } - } - }, - "oneOf": [ - { "$ref": "#/definitions/execution_node" }, - { "$ref": "#/definitions/task_assignment" }, - { "$ref": "#/definitions/execution_result" } - ] -} -``` - - -## 5. Examples - -### 5.1 Task assignment to a remote code-execution node - -The scheduler MUST select `assigned_to` such that the node’s `node_id` matches, `status` is `active` (or policy allows `draining`), and `capabilities` cover the delegated work (e.g. `code.exec`). - -```json -{ - "assignment_id": "asg_9c21f4", - "task_hash": "sha256:0f1e2d3c4b5a6978", - "assigned_to": "node-sandbox-usw2-07", - "parent_run_id": "run_parent_3a88", - "delegated_scope": { - "summary": "Execute untrusted snippet → CSV summary; no network; no secrets.", - "allowed_tools": ["python.exec_cell", "filesystem.read_workspace"], - "max_risk_level": "medium", - "valid_until": "2026-04-14T15:30:00Z" - }, - "timeout_seconds": 120, - "priority": 10 -} -``` - -## 6. Cross-references - -| RFC | Title | Relationship | -|-----|--------|----------------| -| [RFC 0007](0007-cognitive-pipeline-protocol.md) | Cognitive Pipeline Protocol | Per-node FSM. | -| [RFC 0026](0026-requester-identity-auth.md) | Cognitive pipeline Identity | Node `requester_id` + authn/z. | -| [RFC 0047](0047-delegation-extension.md) | Delegation | `delegated_scope` vs proofs. | -| [RFC 0048](0048-execution-receipts-audit-envelopes.md) | Execution Receipts | `receipt_refs`. | -| [RFC 0016](0016-tool-capability-negotiation.md) | Capability Negotiation | Routing on `capabilities`. | - -## 7. Open Questions Resolution - -| Question | Resolution | -|----------|------------| -| Include proofs in `task_hash`? | **Recommended** canonicalization includes scope + policy snapshot ids; document per deployment. | -| Streaming partial results? | **Out of scope**—only terminal `execution_result` here. | -| Missing receipts? | Still emit `result_hash` / `trace_ref`; `receipt_refs` empty only if policy allows degraded audit ([RFC 0048](0048-execution-receipts-audit-envelopes.md)). | - -## 8. Acceptance Criteria - -1. `task_assignment` includes `task_hash`, `parent_run_id`, `delegated_scope.summary`, valid `assigned_to`. -2. Child nodes re-check [RFC 0047](0047-delegation-extension.md) before side effects. -3. `execution_result.assignment_id` matches the assignment; includes `status`, `result_hash`, `trace_ref`, `receipt_refs` per §3. -4. Schedulers honor `execution_node.status` per §3.1. -5. Workers document idempotency behavior for repeated `assignment_id` / `task_hash` pairs per §3. diff --git a/rfcs/0028-capability-environment-schema.md b/rfcs/0028-capability-environment-schema.md deleted file mode 100644 index 816bc7c..0000000 --- a/rfcs/0028-capability-environment-schema.md +++ /dev/null @@ -1,55 +0,0 @@ -# RFC 0028 — Cognitive pipeline‑to‑Environment Interaction Schema (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.5 -**Discussion:** https://github.com/supernovae/open-cot/discussions/28 ---- - -## 1. Summary - -This RFC defines a schema for **cognitive pipeline interactions with external environments**, including: - -- simulators -- APIs -- physical systems -- virtual worlds - ---- - -## 2. Interaction Types - -- observation -- action -- reward -- termination - ---- - -## 3. Full Schema (JSON) - -```json -{ - "env_id": "sim_01", - "observation": {}, - "action": {}, - "reward": 1.0, - "done": false -} -``` - ---- - -## 4. Example - -```json -{ - "action": { "move": "north" } -} -``` - ---- - -## 5. Conclusion - -This RFC defines a unified schema for cognitive pipeline‑environment loops. diff --git a/rfcs/0029-cognitive-benchmark-dataset.md b/rfcs/0029-cognitive-benchmark-dataset.md deleted file mode 100644 index 0c80c10..0000000 --- a/rfcs/0029-cognitive-benchmark-dataset.md +++ /dev/null @@ -1,60 +0,0 @@ -# RFC 0029 — Cognitive pipeline Benchmark Dataset Format (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.5 -**Discussion:** https://github.com/supernovae/open-cot/discussions/29 ---- - -## 1. Summary - -This RFC defines a **benchmark dataset format** for evaluating pipelines across: - -- reasoning -- planning -- tool use -- safety -- multi‑cognitive pipeline coordination - -It extends: - -- RFC 0022 — Cognitive pipeline Evaluation Protocol - ---- - -## 2. Dataset Components - -- tasks -- expected outputs -- verifier configs -- scoring rules - ---- - -## 3. Full Schema (JSON) - -```json -{ - "task_id": "t001", - "prompt": "Solve the puzzle.", - "expected": {}, - "scoring": { "method": "verifier" } -} -``` - ---- - -## 4. Example - -```json -{ - "task_id": "math_01", - "prompt": "Compute 12 * 19." -} -``` - ---- - -## 5. Conclusion - -This RFC defines a benchmark dataset format for cognitive pipeline evaluation. diff --git a/rfcs/0030-runtime-lifecycle-versioning.md b/rfcs/0030-runtime-lifecycle-versioning.md deleted file mode 100644 index 212fd55..0000000 --- a/rfcs/0030-runtime-lifecycle-versioning.md +++ /dev/null @@ -1,177 +0,0 @@ -# RFC 0030 — Cognitive pipeline Lifecycle & Versioning, Status: Draft, Author: Open CoT Community, Created: 2026-04-14 - -**Discussion:** https://github.com/supernovae/open-cot/discussions/30 - -## 1. Summary - -This RFC defines **cognitive pipeline lifecycle states** and **versioning** of cognitive pipeline configurations for Open-CoT. Long-running governed pipelines need a model where **configuration can evolve** (prompts, tools, policies) without silently mutating in-flight runs or breaking permission grants. The **`agent_lifecycle`** record binds an **`requester_id`** to a semantic **`version`**, a **`lifecycle_state`**, capability and policy references, and a **`configuration_hash`** for reproducibility. **`version_transition`** documents approved rollout strategies (**rolling**, **blue-green**, **canary**) and whether **rollback** is permitted. - -Lifecycle and versioning intersect **identity** ([RFC 0026](0026-requester-identity-auth.md)), **organizational governance** ([RFC 0044](0044-governance-organizational-controls.md)), and **permissions** that are often scoped to a specific cognitive pipeline version ([RFC 0042](0042-permission-acl.md)). - -## 2. Motivation - -Operators routinely ship prompt and tool updates weekly, yet auditors require proof of **which binary/configuration** executed a given run. Without explicit lifecycle metadata, “the planner cognitive pipeline” is an ambiguous moving target: ACLs may grant access to a name that no longer matches behavior. Clear **`lifecycle_state`** gates which versions may receive traffic, while **`version_transition`** records who approved a rollout and whether emergency rollback is allowed. - -This RFC does not define CI/CD mechanics, container image formats, or canary metrics collection; it specifies **authoritative records** that control planes and observability systems can store and query. - -## 3. Design - -### 3.1 `agent_lifecycle` - -**`requester_id`** is the stable logical identity ([RFC 0026](0026-requester-identity-auth.md)); **`version`** follows semantic versioning for human expectations but MUST be treated as an opaque string for matching grants. **`lifecycle_state`** values: - -| State | Meaning | -|-------|---------| -| `draft` | Under development; MUST NOT serve production traffic unless explicitly allowed by internal policy (not overridden by this RFC). | -| `active` | Eligible for production assignment subject to governance and ACLs. | -| `suspended` | Temporarily blocked (incident, quota, compliance hold); existing runs MAY drain per implementation. | -| `deprecated` | Still runnable for compatibility but SHOULD not start new long-lived sessions; migrations encouraged. | -| `retired` | MUST NOT schedule new work; historical traces remain addressable. | - -**`created_at`** / **`observed_at`** are RFC 3339 timestamps. **`configuration_hash`** hashes the canonical serialized bundle (system prompt, tool allow list, model route, feature flags) so two hosts can verify they run identical configs. **`capabilities[]`** mirrors outward-facing skills for routing ([RFC 0021](0021-capability-declaration.md) may elaborate). **`policy_refs[]`** lists attached policy documents or snapshots ([RFC 0041](0041-policy-enforcement-schema.md)). **`governance_ref`** points to organizational controls ([RFC 0044](0044-governance-organizational-controls.md))—team ownership, data classes, approval workflow ids. - -### 3.2 `version_transition` - -**`from_version`** / **`to_version`** describe the movement between semver strings. **`migration_strategy`** selects rollout mechanics: **`rolling`** (gradual instance replacement), **`blue-green`** (atomic switch), **`canary`** (percentage traffic). **`rollback_allowed`** documents whether automated or manual rollback to `from_version` remains approved. **`approved_by`** is a human or system principal id; **`decided_at`** records the decision instant. `version_order` provides deterministic transition ordering independent of wall-clock drift. - -### 3.3 Permissions and governance coupling - -Permission grants ([RFC 0042](0042-permission-acl.md)) SHOULD include optional `agent_version` constraints. When absent, grants apply to all versions at own risk; when present, **`active`** versions outside the grant MUST be denied. [RFC 0044](0044-governance-organizational-controls.md) may require `approved_by` for transitions affecting regulated data classes. - -## 4. JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/runtime-lifecycle/v0.2", - "title": "Open CoT RFC 0030 — Cognitive pipeline Lifecycle", - "definitions": { - "agent_lifecycle": { - "type": "object", - "additionalProperties": false, - "required": [ - "requester_id", - "version", - "lifecycle_state", - "created_at", - "observed_at", - "configuration_hash", - "capabilities", - "policy_refs", - "governance_ref" - ], - "properties": { - "requester_id": { "type": "string", "minLength": 1 }, - "version": { "type": "string", "minLength": 1 }, - "lifecycle_state": { - "type": "string", - "enum": ["draft", "active", "suspended", "deprecated", "retired"] - }, - "created_at": { "type": "string", "format": "date-time" }, - "observed_at": { "type": "string", "format": "date-time" }, - "configuration_hash": { "type": "string", "minLength": 1 }, - "capabilities": { - "type": "array", - "items": { "type": "string", "minLength": 1 } - }, - "policy_refs": { - "type": "array", - "items": { "type": "string", "minLength": 1 } - }, - "governance_ref": { "type": "string", "minLength": 1 } - } - }, - "version_transition": { - "type": "object", - "additionalProperties": false, - "required": [ - "from_version", - "to_version", - "migration_strategy", - "rollback_allowed", - "approved_by", - "decided_at", - "version_order" - ], - "properties": { - "from_version": { "type": "string", "minLength": 1 }, - "to_version": { "type": "string", "minLength": 1 }, - "migration_strategy": { - "type": "string", - "enum": ["rolling", "blue-green", "canary"] - }, - "rollback_allowed": { "type": "boolean" }, - "approved_by": { "type": "string", "minLength": 1 }, - "decided_at": { "type": "string", "format": "date-time" }, - "version_order": { "type": "integer", "minimum": 0 } - } - } - }, - "oneOf": [ - { "$ref": "#/definitions/agent_lifecycle" }, - { "$ref": "#/definitions/version_transition" } - ] -} -``` - - -## 5. Examples - -### 5.1 Cognitive pipeline lifecycle record - -```json -{ - "requester_id": "com.opencot.support.triage", - "version": "3.6.0", - "lifecycle_state": "active", - "created_at": "2026-03-01T09:00:00Z", - "observed_at": "2026-04-14T08:15:00Z", - "configuration_hash": "sha256:9aa7…21", - "capabilities": ["ticketing.read", "email.summarize", "kb.search"], - "policy_refs": [ - "policy://org/support-tier2@v2026.04.01", - "policy://safety/default@v7" - ], - "governance_ref": "gov://teams/support#workload-class-c" -} -``` - -### 5.2 Version transition (informative) - -```json -{ - "from_version": "3.5.4", - "to_version": "3.6.0", - "migration_strategy": "canary", - "rollback_allowed": true, - "approved_by": "alice@example.com", - "decided_at": "2026-04-13T17:45:00Z", - "version_order": 42 -} -``` - -## 6. Cross-references - -| RFC | Title | Relationship | -|-----|--------|----------------| -| [RFC 0026](0026-requester-identity-auth.md) | Cognitive pipeline Identity | Stable `requester_id` and authentication for lifecycle APIs. | -| [RFC 0044](0044-governance-organizational-controls.md) | Governance | `governance_ref` and approval workflows for transitions. | -| [RFC 0042](0042-permission-acl.md) | Permissions & ACL | Grants may be pinned to `requester_id` + `version`. | -| [RFC 0041](0041-policy-enforcement-schema.md) | Policy Enforcement | `policy_refs` attach evaluation snapshots to versions. | -| [RFC 0021](0021-capability-declaration.md) | Capability Declaration | `capabilities` alignment for discovery. | - -## 7. Open Questions Resolution - -| Question | Resolution | -|----------|------------| -| Do we embed full configuration inline? | **No.** Only `configuration_hash` is normative; config blobs live in secure config stores or OCI layers. | -| Can multiple `active` versions coexist? | **Yes** for canary/rolling; schedulers MUST tag runs with the exact `version` executed for trace replay. | -| How does `suspended` interact with incidents? | **Operational.** This RFC only records state; automation sets `suspended` when [RFC 0044](0044-governance-organizational-controls.md) incident hooks fire. | - -## 8. Acceptance Criteria - -1. Every stored **`agent_lifecycle`** record validates against the schema and includes `configuration_hash`, `policy_refs`, and `governance_ref`. -2. Runs log the **`requester_id`** and **`version`** pair actually executed, enabling ACL checks per [RFC 0042](0042-permission-acl.md). -3. **`version_transition`** records exist for production-impacting changes when [RFC 0044](0044-governance-organizational-controls.md) mandates approvals, including `migration_strategy` and `rollback_allowed`. -4. **`retired`** versions cannot be selected for new assignments by conforming schedulers without an explicit out-of-band exception flag (documented locally, not part of this schema). diff --git a/rfcs/0031-cognitive-observability-telemetry.md b/rfcs/0031-cognitive-observability-telemetry.md deleted file mode 100644 index b78eecf..0000000 --- a/rfcs/0031-cognitive-observability-telemetry.md +++ /dev/null @@ -1,92 +0,0 @@ -# RFC 0031 — Cognitive pipeline Observability & Telemetry (v0.2) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.6 -**Discussion:** https://github.com/supernovae/open-cot/discussions/31 ---- - -## 1. Summary - -This RFC defines telemetry and observability fields for reasoning pipelines. - -It extends: - -- RFC 0007 — Cognitive Pipeline Protocol -- RFC 0022 — Cognitive pipeline Evaluation Protocol - ---- - -## 2. Telemetry categories - -- Execution metrics (steps, branches, latency) -- Tool metrics (calls, errors, cost) -- Memory metrics (reads, writes, conflicts) -- Safety metrics (policy violations, sandbox triggers) -- System metrics (CPU, GPU, RAM) - ---- - -## 3. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0031 — Cognitive pipeline Observability and Telemetry", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.2"] }, - "requester_id": { "type": "string" }, - "observed_at": { "type": "string", "format": "date-time" }, - "ordering": { - "type": "object", - "additionalProperties": false, - "properties": { - "event_seq": { "type": "integer", "minimum": 0 }, - "parent_event_id": { "type": "string" } - }, - "required": ["event_seq"] - }, - "metrics": { - "type": "object", - "properties": { - "steps": { "type": "integer", "minimum": 0 }, - "tool_calls": { "type": "integer", "minimum": 0 }, - "latency_ms": { "type": "number", "minimum": 0 }, - "memory_reads": { "type": "integer", "minimum": 0 }, - "safety_violations": { "type": "integer", "minimum": 0 } - }, - "additionalProperties": true - } - }, - "required": ["version", "requester_id", "observed_at", "ordering", "metrics"] -} -``` - ---- - -## 4. Example - -```json -{ - "version": "0.2", - "requester_id": "planner", - "observed_at": "2026-04-14T11:30:00Z", - "ordering": { - "event_seq": 1042 - }, - "metrics": { - "steps": 42, - "tool_calls": 5, - "latency_ms": 1200, - "memory_reads": 12, - "safety_violations": 0 - } -} -``` - ---- - -## 5. Conclusion - -RFC 0031 provides a standard telemetry envelope for runtime visibility, debugging, and benchmarking. diff --git a/rfcs/0032-runtime-deployment-manifest.md b/rfcs/0032-runtime-deployment-manifest.md deleted file mode 100644 index ba41fa3..0000000 --- a/rfcs/0032-runtime-deployment-manifest.md +++ /dev/null @@ -1,175 +0,0 @@ -# RFC 0032 — Cognitive pipeline Deployment Manifest, Status: Draft, Author: Open CoT Community, Created: 2026-04-14 - -**Discussion:** https://github.com/supernovae/open-cot/discussions/32 - -## 1. Summary - -This RFC defines the **`deployment_manifest`**: a declarative document for running Open-CoT–governed pipelines with fixed runtime, resources, policy bindings, governance reference, sandbox ([RFC 0017](0017-runtime-safety-sandboxing.md)), default budgets ([RFC 0038](0038-cost-aware-reasoning-budget.md)), tools, dependencies, health checks, and scaling. It is **infrastructure-as-code** for governed pipelines so rollouts are reproducible and provably aligned with org policy before the FSM ([RFC 0007](0007-cognitive-pipeline-protocol.md)) starts. - -## 2. Motivation - -Scattered Helm values and shell exports hide which policies, sandboxes, and budgets actually applied in production. One manifest ties identity, execution surface, constraints, **`policies[]`**, **`governance_ref`**, sandbox, budgets, tool exposure, dependencies, health, and replica bounds into a diffable artifact for the control plane. - -## 3. Design - -**Lifecycle:** (1) Author manifest in CI/registry. (2) Control plane merges tenant overrides; conflicts fail closed. (3) Runtime provisions workload, wires `policies[]` / `governance_ref`, applies `sandbox_config` and `budget_defaults`. (4) `health_check` gates traffic. - -| Field | Role | -|-------|------| -| `manifest_id` | Stable id for this manifest revision (≠ `requester_id`). | -| `runtime` | OCI `container_image`, optional `entrypoint`, `environment` (no secrets). | -| `resources` | `cpu`, `memory`, `gpu` (gpu MAY be fractional). | -| `policies[]` | Ordered policy bundle ids ([RFC 0041](0041-policy-enforcement-schema.md)). | -| `governance_ref` | Org governance config ([RFC 0044](0044-governance-organizational-controls.md)). | -| `sandbox_config` | RFC 0017 object; MUST NOT widen beyond governance. | -| `budget_defaults` | RFC 0038 defaults; per-run overrides if policy allows. | -| `tool_allowlist[]` | Deployed tools; intersected with sandbox + policy. | -| `dependencies[]` | Pipelines, datasets, tool packs, models. | -| `health_check` | Probe (`http` \| `tcp` \| `exec` \| `grpc`); orchestrator may extend. | -| `scaling` | `min_replicas`, `max_replicas`. | - -## 4. JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0032/deployment-manifest.json", - "title": "Open CoT RFC 0032 — Cognitive pipeline Deployment Manifest", - "type": "object", - "additionalProperties": false, - "$defs": { - "runtime": { - "type": "object", - "additionalProperties": false, - "properties": { - "container_image": { "type": "string", "minLength": 1 }, - "entrypoint": { "type": "array", "items": { "type": "string" } }, - "environment": { "type": "object", "additionalProperties": { "type": "string" } } - }, - "required": ["container_image"] - }, - "resources": { - "type": "object", - "additionalProperties": false, - "properties": { - "cpu": { "type": "string" }, - "memory": { "type": "string" }, - "gpu": { "type": "number", "minimum": 0 } - } - }, - "health_check": { - "type": "object", - "additionalProperties": true, - "properties": { - "kind": { "type": "string", "enum": ["http", "tcp", "exec", "grpc"] }, - "path": { "type": "string" }, - "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, - "interval_seconds": { "type": "integer", "minimum": 1 }, - "timeout_seconds": { "type": "integer", "minimum": 1 }, - "success_threshold": { "type": "integer", "minimum": 1 }, - "failure_threshold": { "type": "integer", "minimum": 1 } - }, - "required": ["kind"] - }, - "scaling": { - "type": "object", - "additionalProperties": false, - "properties": { - "min_replicas": { "type": "integer", "minimum": 0 }, - "max_replicas": { "type": "integer", "minimum": 1 } - }, - "required": ["min_replicas", "max_replicas"] - }, - "dependency": { - "type": "object", - "additionalProperties": false, - "properties": { - "ref": { "type": "string", "minLength": 1 }, - "kind": { "type": "string", "enum": ["pipeline", "dataset", "tool_pack", "model", "other"] }, - "version_constraint": { "type": "string" } - }, - "required": ["ref", "kind"] - }, - "deployment_manifest": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.1"] }, - "manifest_id": { "type": "string", "minLength": 1 }, - "requester_id": { "type": "string", "minLength": 1 }, - "version": { "type": "string", "minLength": 1 }, - "runtime": { "$ref": "#/$defs/runtime" }, - "resources": { "$ref": "#/$defs/resources" }, - "policies": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "governance_ref": { "type": "string", "minLength": 1 }, - "sandbox_config": { "type": "object" }, - "budget_defaults": { "type": "object" }, - "tool_allowlist": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "dependencies": { "type": "array", "items": { "$ref": "#/$defs/dependency" } }, - "health_check": { "$ref": "#/$defs/health_check" }, - "scaling": { "$ref": "#/$defs/scaling" }, - "metadata": { "type": "object", "additionalProperties": { "type": "string" } } - }, - "required": ["schema_version", "manifest_id", "requester_id", "version", "runtime", "policies", "governance_ref", "sandbox_config", "budget_defaults", "tool_allowlist", "scaling"] - } - }, - "properties": { "deployment_manifest": { "$ref": "#/$defs/deployment_manifest" } }, - "required": ["deployment_manifest"] -} -``` - - -## 5. Examples - -**Code-assistant cognitive pipeline** — strict sandbox, org governance, hard budget, repo tools, GPU for embeddings. - -```json -{ - "deployment_manifest": { - "schema_version": "0.1", - "manifest_id": "dm_acme_codeassist_2026q2_14", - "requester_id": "cognitive-pipeline:org/acme/code-assistant", - "version": "2.4.1", - "runtime": { - "container_image": "registry.acme.example/pipelines/code-assistant:2.4.1", - "entrypoint": ["/opt/opencot/bin/opencotd", "--config", "/etc/opencot/cognitive-pipeline.yaml"], - "environment": { "OPENCOT_LOG_LEVEL": "info" } - }, - "resources": { "cpu": "4", "memory": "16Gi", "gpu": 1 }, - "policies": ["policy_bundle:acme/base", "policy_bundle:acme/code_assistant_prod"], - "governance_ref": "gov://acme/prod/eu-west/code_pipelines", - "sandbox_config": { - "allowed_tools": ["repo.read", "repo.search", "linter.run", "tests.run", "patch.propose"], - "blocked_tools": ["shell", "network_raw", "secrets.read"], - "max_steps": 96, - "max_branches": 4 - }, - "budget_defaults": { - "budget": { "max_tokens": 120000, "max_cost": 4.5, "max_steps": 96, "max_tool_calls": 200, "max_retries": 3 }, - "enforcement": "hard" - }, - "tool_allowlist": ["repo.read", "repo.search", "linter.run", "tests.run", "patch.propose"], - "dependencies": [{ "ref": "dataset:acme/styleguide-embed", "kind": "dataset", "version_constraint": "^3" }], - "health_check": { "kind": "http", "path": "/healthz", "port": 8080, "interval_seconds": 10, "timeout_seconds": 2, "success_threshold": 1, "failure_threshold": 3 }, - "scaling": { "min_replicas": 2, "max_replicas": 20 }, - "metadata": { "team": "platform-pipelines", "region": "eu-west-1" } - } -} -``` - -## 6. Cross-references - -[RFC 0007](0007-cognitive-pipeline-protocol.md) · [RFC 0017](0017-runtime-safety-sandboxing.md) · [RFC 0038](0038-cost-aware-reasoning-budget.md) · [RFC 0041](0041-policy-enforcement-schema.md) · [RFC 0044](0044-governance-organizational-controls.md) - -## 7. Open Questions Resolution - -| Topic | Resolution | -|-------|------------| -| Secrets | Not in `runtime.environment`; use platform mounts. | -| Partial sandbox | Merge with org baseline; log merged config at startup. | -| GPU vendor extras | Optional `metadata` keys prefixed `x_`. | - -## 8. Acceptance Criteria - -Manifests validate against §4. Empty `policies` MUST NOT start without audited org exception. `tool_allowlist` ∩ sandbox ∩ policy MUST be non-empty. `max_replicas` ≥ `min_replicas`. diff --git a/rfcs/0033-runtime-security-threat-model.md b/rfcs/0033-runtime-security-threat-model.md deleted file mode 100644 index 3dce76c..0000000 --- a/rfcs/0033-runtime-security-threat-model.md +++ /dev/null @@ -1,179 +0,0 @@ -# RFC 0033 — Cognitive pipeline Security & Threat Model, Status: Draft, Author: Open CoT Community, Created: 2026-04-14 - -**Discussion:** https://github.com/supernovae/open-cot/discussions/33 - -## 1. Summary - -This RFC documents the **security threat landscape** for governed pipelines on the Open-CoT cognitive control plane and explains how architectural choices—especially the separation of **proposal** (model) from **authorization** (harness, policy, brokers)—reduce impact for each major threat class. It introduces a machine-readable **`threat_catalog`**: a versioned collection of **`threat_entry`** records linking each threat to severities, mitigations (by RFC or mechanism), and honest **residual risk** statements for security reviewers and auditors. - -## 2. Motivation - -Language models are stochastic, user-influenceable, and occasionally incoherent with respect to organizational intent. Treating their outputs as instructions with ambient authority guarantees eventual compromise. Open-CoT instead treats the model as an **untrusted planner** whose outputs become **structured proposals** evaluated by policy, permissions, and delegation machinery. This RFC makes that stance explicit: security teams need a shared vocabulary (categories, severities, mitigations) and a catalog format they can attach to SOC reviews, customer questionnaires, and internal risk registers. - -## 3. Design - -### 3.1 Threat model overview - -We protect **organizational data**, **downstream systems reachable by tools**, **user privacy**, **financial and compute budgets**, and **audit integrity** against attackers who may control portions of prompts, tool results, third-party content, or compromised dependencies. We do **not** assume the model is benign; we assume **humans and policies** are the ultimate authority for irreversible or high-risk actions unless pre-approved standing grants exist and are themselves policy-bound. - -### 3.2 Trust boundary analysis - -| Boundary | Trusts | Does not trust | -|----------|--------|----------------| -| Model | Capability to suggest plans and text. | Self-judgment of legality, scope, or safety; any narrative claiming urgency or override. | -| Harness | Verified identity ([RFC 0026](0026-requester-identity-auth.md)), trace binding, schema validation, FSM transitions ([RFC 0007](0007-cognitive-pipeline-protocol.md)). | Raw model JSON without normalization and size limits. | -| Policy engine | Rule evaluation, obligation logs ([RFC 0041](0041-policy-enforcement-schema.md)). | Model-authored “policy” fields. | -| Permissions / delegation | Stored grants, audience-bound receipts ([RFC 0042](0042-permission-acl.md), [RFC 0047](0047-delegation-extension.md)). | Tool-selected scope expansion. | -| Tools & hosts | Correct implementation when inputs stay within granted scope. | Arbitrary URLs or paths offered by the model without validation. | -| Human operators | Break-glass and governance configuration ([RFC 0044](0044-governance-organizational-controls.md)). | Routine model text. | - -### 3.3 How the governed FSM mitigates key threats - -**Prompt injection** — Outputs are proposals; FSM blocks tools without authority ([RFC 0007](0007-cognitive-pipeline-protocol.md), [RFC 0047](0047-delegation-extension.md)). **Privilege escalation** — Model cannot author `delegation_decision` / `authority_receipt`. **Confused deputy** — Audience-bound scopes/receipts ([RFC 0042](0042-permission-acl.md), [RFC 0047](0047-delegation-extension.md)). **Data exfiltration** — Narrowing + sandbox allowlists ([RFC 0017](0017-runtime-safety-sandboxing.md)). **Replay** — Hashed/signed receipts ([RFC 0048](0048-execution-receipts-audit-envelopes.md)). - -### 3.4 Threat catalog record (`threat_entry`) - -Each entry uses a stable **`threat_id`**, a **`category`** enum aligned with common agentic abuse cases, narrative **`description`**, **`severity`** (`critical` / `high` / `medium` / `low`), structured **`mitigations[]`** referencing RFCs or concrete mechanisms, and **`residual_risk`** for transparency after controls. - -## 4. JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0033/threat-catalog.json", - "title": "Open CoT RFC 0033 — Threat Catalog", - "type": "object", - "additionalProperties": false, - "$defs": { - "threat_category": { - "type": "string", - "enum": ["prompt_injection", "privilege_escalation", "data_exfiltration", "confused_deputy", "denial_of_service", "replay_attack", "supply_chain"] - }, - "severity": { - "type": "string", - "enum": ["critical", "high", "medium", "low"] - }, - "mitigation": { - "type": "object", - "additionalProperties": false, - "properties": { - "mechanism": { "type": "string", "minLength": 1 }, - "rfc_ref": { "type": "string", "description": "e.g. RFC 0047" }, - "notes": { "type": "string" } - }, - "required": ["mechanism"] - }, - "threat_entry": { - "type": "object", - "additionalProperties": false, - "properties": { - "threat_id": { "type": "string", "minLength": 1 }, - "category": { "$ref": "#/$defs/threat_category" }, - "description": { "type": "string", "minLength": 1 }, - "severity": { "$ref": "#/$defs/severity" }, - "mitigations": { - "type": "array", - "items": { "$ref": "#/$defs/mitigation" }, - "minItems": 1 - }, - "residual_risk": { "type": "string", "minLength": 1 } - }, - "required": ["threat_id", "category", "description", "severity", "mitigations", "residual_risk"] - }, - "threat_catalog": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.1"] }, - "catalog_id": { "type": "string", "minLength": 1 }, - "title": { "type": "string", "minLength": 1 }, - "entries": { - "type": "array", - "items": { "$ref": "#/$defs/threat_entry" }, - "minItems": 1 - } - }, - "required": ["schema_version", "catalog_id", "title", "entries"] - } - }, - "properties": { - "threat_catalog": { "$ref": "#/$defs/threat_catalog" } - }, - "required": ["threat_catalog"] -} -``` - - -## 5. Examples - -```json -{ - "threat_catalog": { - "schema_version": "0.1", - "catalog_id": "tc_acme_pipelines_core_2026q2", - "title": "ACME governed pipelines — baseline threats", - "entries": [ - { - "threat_id": "THR-PROMPT-INJECT-001", - "category": "prompt_injection", - "description": "Attacker embeds instructions in retrieved documents, tool output, or user messages to coerce the model into harmful tool use or disclosure.", - "severity": "high", - "mitigations": [ - { - "mechanism": "Model outputs are proposals; harness validates schema and strips privileged fields.", - "rfc_ref": "RFC 0007", - "notes": "FSM blocks tool execution without prior authority path." - }, - { - "mechanism": "Sandbox tool allowlists and argument validation.", - "rfc_ref": "RFC 0017" - }, - { - "mechanism": "Delegation requests evaluated by policy; model cannot mint receipts.", - "rfc_ref": "RFC 0047" - } - ], - "residual_risk": "Medium — policy misconfiguration or overly broad standing grants could still allow unintended tool calls if content influences argument choice within allowed scope." - }, - { - "threat_id": "THR-PRIV-ESC-002", - "category": "privilege_escalation", - "description": "Model attempts to expand scopes, reuse tokens, or manipulate traces to obtain permissions beyond the user or tenant intent.", - "severity": "critical", - "mitigations": [ - { - "mechanism": "Strict separation: only harness/policy author delegation_decision and authority_receipt.", - "rfc_ref": "RFC 0047" - }, - { - "mechanism": "Permission ACLs and stored grants bound to roles and resources.", - "rfc_ref": "RFC 0042" - }, - { - "mechanism": "Policy bundles deny-by-default for high-risk actions.", - "rfc_ref": "RFC 0041" - } - ], - "residual_risk": "Low to medium — compromised harness or policy engine process breaks the model; operational controls (HSM, segmentation) out of scope for this RFC." - } - ] - } -} -``` - -## 6. Cross-references - -[RFC 0007](0007-cognitive-pipeline-protocol.md) · [RFC 0017](0017-runtime-safety-sandboxing.md) · [RFC 0026](0026-requester-identity-auth.md) · [RFC 0041](0041-policy-enforcement-schema.md) · [RFC 0042](0042-permission-acl.md) · [RFC 0044](0044-governance-organizational-controls.md) · [RFC 0047](0047-delegation-extension.md) · [RFC 0048](0048-execution-receipts-audit-envelopes.md) - -## 7. Open Questions Resolution - -| Topic | Resolution | -|-------|------------| -| Catalog vs. live SOC tickets | `threat_catalog` is **strategic** baseline; operational incidents reference `threat_id` in ticketing integrations (out of band). | -| Severity calibration | Deployments MAY map `severity` to internal risk scores; schema values stay coarse for interoperability. | -| Non-listed categories | Use `supply_chain` or extend in a minor schema bump; avoid free-text categories in conforming documents. | - -## 8. Acceptance Criteria - -Entries validate against §4; each SHOULD include `rfc_ref` on ≥1 mitigation when an Open-CoT RFC applies. Production risk acceptance SHOULD cite `threat_id`. New control RFCs SHOULD update affected catalog entries. diff --git a/rfcs/0034-cognitive-federation-protocol.md b/rfcs/0034-cognitive-federation-protocol.md deleted file mode 100644 index b13bc8b..0000000 --- a/rfcs/0034-cognitive-federation-protocol.md +++ /dev/null @@ -1,155 +0,0 @@ -# RFC 0034 — Cognitive pipeline Federation Protocol, Status: Draft, Author: Open CoT Community, Created: 2026-04-14 - -**Discussion:** https://github.com/supernovae/open-cot/discussions/34 - -## 1. Summary - -This RFC defines how **independent Open-CoT deployments** (“peers”) interoperate when pipelines must delegate work across organizational or network boundaries while **retaining local policy sovereignty**. Each peer runs its own policy engine and identity plane; federation adds a **trust framework** for verifying peers, constraining accepted delegation scopes, and exchanging **`federation_request`** / **`federation_response`** messages that embed the standard **`delegation_request`** and **`delegation_decision`** objects from [RFC 0047](0047-delegation-extension.md). The result is cross-tenant collaboration without a single global “god” policy service—only negotiated trust and cryptographic verification. - -## 2. Motivation - -Multi-cluster and multi-company cognitive pipeline workflows are inevitable (support handoffs, joint research, supply-chain automation). Naïvely forwarding API keys or model prompts between parties collapses auditability and explodes confused-deputy risk. Federation needs: **stable peer identities**, **graded trust levels**, **scope caps**, **TTL limits**, **delegation path transparency** (`trust_chain[]`), and **tamper-evident responses** so downstream executors can prove which peer authorized what. - -## 3. Design - -**Roles:** Source peer signs and sends `federation_request` for hosted pipelines ([RFC 0026](0026-requester-identity-auth.md)). Target peer evaluates locally and maps foreign scopes—never inherits source policy verbatim. Optional trust coordinator tracks `last_verified_at` / key rotation. - -**Trust levels:** `untrusted` (crypto id only; often needs human gate), `verified` (due diligence + contract), `trusted` (automation)—all still cap TTL and intersect `accepted_scopes[]`. - -**Flow:** (1) Harness builds `delegation_request` for remote work. (2) Gateway wraps it with `trust_chain` (start `[source_peer_id]`). (3) Target policy emits `federation_response` + `delegation_decision`. (4) Broker may mint `authority_receipt` ([RFC 0047](0047-delegation-extension.md)); execution receipts SHOULD cite federation + delegation ids ([RFC 0048](0048-execution-receipts-audit-envelopes.md)). (5) Multi-hop appends peers; each hop re-signs. - -**Vs. [RFC 0027](0027-distributed-execution-protocol.md):** 0027 is routing/topology; this RFC is the cross-admin trust and delegation envelope (orthogonal transport headers). - -## 4. JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0034/federation.json", - "title": "Open CoT RFC 0034 — Cognitive pipeline Federation Protocol", - "type": "object", - "additionalProperties": false, - "$defs": { - "trust_level": { - "type": "string", - "enum": ["untrusted", "verified", "trusted"] - }, - "federation_peer": { - "type": "object", - "additionalProperties": false, - "properties": { - "peer_id": { "type": "string", "minLength": 1 }, - "endpoint": { "type": "string", "format": "uri" }, - "trust_level": { "$ref": "#/$defs/trust_level" }, - "public_key": { "type": "string", "minLength": 1 }, - "accepted_scopes": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "max_delegation_ttl_seconds": { "type": "integer", "minimum": 1 }, - "last_verified_at": { "type": "string", "format": "date-time" } - }, - "required": ["peer_id", "endpoint", "trust_level", "public_key", "accepted_scopes", "max_delegation_ttl_seconds"] - }, - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { "type": "string", "minLength": 1 }, - "content_hash": { "type": "string", "minLength": 1 }, - "signature": { "type": "string" }, - "signing_key_id": { "type": "string" } - }, - "required": ["hash_algorithm", "content_hash"] - }, - "federation_request": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.1"] }, - "request_id": { "type": "string", "minLength": 1 }, - "source_peer_id": { "type": "string", "minLength": 1 }, - "target_peer_id": { "type": "string", "minLength": 1 }, - "delegation_request": { - "$ref": "https://opencot.dev/schema/rfc0047/delegation-extension-v0.2.json#/$defs/delegation_request" - }, - "trust_chain": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 } - }, - "required": ["schema_version", "request_id", "source_peer_id", "target_peer_id", "delegation_request", "trust_chain"] - }, - "federation_response": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.1"] }, - "request_id": { "type": "string", "minLength": 1 }, - "status": { - "type": "string", - "enum": ["accepted", "rejected", "narrowed"] - }, - "delegation_decision": { - "$ref": "https://opencot.dev/schema/rfc0047/delegation-extension-v0.2.json#/$defs/delegation_decision" - }, - "response_integrity": { "$ref": "#/$defs/integrity" } - }, - "required": ["schema_version", "request_id", "status", "delegation_decision", "response_integrity"] - } - }, - "properties": { - "federation_peer": { "$ref": "#/$defs/federation_peer" }, - "federation_request": { "$ref": "#/$defs/federation_request" }, - "federation_response": { "$ref": "#/$defs/federation_response" } - } -} -``` - - -## 5. Examples - -**Two-peer federation request** — `research-lab` asks `field-sites` to run a narrowed sensor pull under local policy. - -```json -{ - "federation_request": { - "schema_version": "0.1", - "request_id": "fedreq_8c21_20260418", - "source_peer_id": "peer:research-lab.east", - "target_peer_id": "peer:field-sites.central", - "trust_chain": ["peer:research-lab.east"], - "delegation_request": { - "schema_version": "0.1", - "request_id": "dr_sensor_pull_441a", - "requester": "cognitive-pipeline:org/lab/planner-alpha", - "run_id": "run_20260418_0930", - "timestamp": "2026-04-18T09:30:00Z", - "intent": "Fetch last 24h of air quality samples for site bundle S-12", - "justification": "Joint study J-2026-04 approved by both data stewards", - "requested_scope": { - "resource": "iot://field-sites/S-12/air_quality", - "action": "sensor.read", - "constraints": { "window_hours": 24, "max_rows": 50000 } - }, - "preferred_ttl_seconds": 600, - "preferred_audience": ["api://field-sites.internal/ingest"], - "task_context_ref": "ctx://federation/J-2026-04/step_2", - "provenance": { "trace_step_id": "ts_9012", "plan_version": "pv_3" } - } - } -} -``` - -Target responds with `status` ∈ {`accepted`,`narrowed`} (or `rejected`), `delegation_decision.request_id` = `dr_sensor_pull_441a`, and `response_integrity` over canonical response bytes. - -## 6. Cross-references - -[RFC 0026](0026-requester-identity-auth.md) · [RFC 0027](0027-distributed-execution-protocol.md) · [RFC 0047](0047-delegation-extension.md) · [RFC 0048](0048-execution-receipts-audit-envelopes.md) - -## 7. Open Questions Resolution - -| Topic | Resolution | -|-------|------------| -| Multi-hop signing | Each hop MUST produce an additional signature wrapper (transport profile) not duplicated inside `federation_request`; `trust_chain` is informational for audit, not a substitute for signatures. | -| `accepted_scopes` encoding | String tokens are deployment-defined; peers MUST publish a scope catalog to partners out of band. | -| JSON Schema `$ref` to 0047 | Validators SHOULD bundle resolved schemas offline for air-gapped CI. | - -## 8. Acceptance Criteria - -`delegation_request.requester` MUST resolve in the source peer registry ([RFC 0026](0026-requester-identity-auth.md)). Target rejects TTL above `max_delegation_ttl_seconds` for source. `federation_response.delegation_decision.request_id` MUST equal nested `delegation_request.request_id`. `response_integrity.content_hash` MUST cover `request_id`, `status`, and canonical `delegation_decision`. diff --git a/rfcs/0035-data-provenance-tracking.md b/rfcs/0035-data-provenance-tracking.md deleted file mode 100644 index b7037ac..0000000 --- a/rfcs/0035-data-provenance-tracking.md +++ /dev/null @@ -1,99 +0,0 @@ -# RFC 0035 — Data Provenance Tracking (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.6 -**Discussion:** https://github.com/supernovae/open-cot/discussions/35 ---- - -## 1. Summary - -This RFC defines provenance and integrity metadata for Open CoT artifacts, including traces, sidecars, and compressed scratchpads. - -It extends: - -- RFC 0010 — Cognitive pipeline Memory Schema -- RFC 0020 — Verifiable Scratchpad Compression -- RFC 0022 — Cognitive pipeline Evaluation Protocol - ---- - -## 2. Provenance and integrity model - -Required provenance dimensions: - -- source identity -- transformation chain -- actor (cognitive-pipeline/tool) identity -- timestamp and pipeline stage - -Integrity additions: - -- canonical payload hash -- optional digital signature envelope -- parent artifact references for derivations - ---- - -## 3. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0035 — Data Provenance Tracking", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.1"] }, - "artifact_id": { "type": "string" }, - "artifact_type": { "type": "string" }, - "source": { "type": "string" }, - "requester_id": { "type": "string" }, - "tool_id": { "type": "string" }, - "timestamp": { "type": "string", "format": "date-time" }, - "transformation": { "type": "string" }, - "parent_artifact_ids": { "type": "array", "items": { "type": "string" } }, - "integrity": { - "type": "object", - "properties": { - "hash_algorithm": { "type": "string", "enum": ["sha256"] }, - "content_hash": { "type": "string" }, - "signature_algorithm": { "type": "string" }, - "signature": { "type": "string" }, - "signing_key_id": { "type": "string" } - }, - "required": ["hash_algorithm", "content_hash"] - } - }, - "required": ["version", "artifact_id", "artifact_type", "source", "timestamp", "transformation", "integrity"] -} -``` - ---- - -## 4. Example - -```json -{ - "version": "0.1", - "artifact_id": "trace_001", - "artifact_type": "reasoning_trace", - "source": "synthetic_seed_v0", - "requester_id": "planner", - "timestamp": "2026-04-14T12:00:00Z", - "transformation": "converted_from_gsm8k_minimal", - "parent_artifact_ids": ["raw_qa_001"], - "integrity": { - "hash_algorithm": "sha256", - "content_hash": "sha256:2ee7f3...", - "signature_algorithm": "ed25519", - "signature": "base64:...", - "signing_key_id": "opencot-release-key-1" - } -} -``` - ---- - -## 5. Conclusion - -RFC 0035 provides a provenance-plus-integrity contract so Open CoT artifacts are traceable, tamper-evident, and auditable across toolchains. diff --git a/rfcs/0036-cognitive-native-compression-delta.md b/rfcs/0036-cognitive-native-compression-delta.md deleted file mode 100644 index c272bc2..0000000 --- a/rfcs/0036-cognitive-native-compression-delta.md +++ /dev/null @@ -1,60 +0,0 @@ -# RFC 0036 — Cognitive pipeline‑Native Compression & Delta Sync (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.6 -**Discussion:** https://github.com/supernovae/open-cot/discussions/36 ---- - -## 1. Summary - -This RFC defines **cognitive pipeline‑native compression and delta synchronization**, enabling: - -- efficient memory sync -- distributed scratchpad updates -- incremental state transfer -- low‑bandwidth multi‑cognitive pipeline collaboration - -It extends: - -- RFC 0020 — Scratchpad Compression -- RFC 0027 — Distributed Execution Protocol - ---- - -## 2. Delta Types - -- `state_delta` -- `memory_delta` -- `scratchpad_delta` -- `tool_state_delta` - ---- - -## 3. Full Schema (JSON) - -```json -{ - "delta_type": "memory_delta", - "from_version": "1.2.0", - "to_version": "1.2.1", - "changes": ["updated_preference"] -} -``` - ---- - -## 4. Example - -```json -{ - "delta_type": "scratchpad_delta", - "changes": ["added_step_42"] -} -``` - ---- - -## 5. Conclusion - -This RFC defines efficient delta‑based synchronization for cognitive pipeline ecosystems. diff --git a/rfcs/0037-token-economy-cost-modeling.md b/rfcs/0037-token-economy-cost-modeling.md deleted file mode 100644 index 4879daf..0000000 --- a/rfcs/0037-token-economy-cost-modeling.md +++ /dev/null @@ -1,112 +0,0 @@ -# RFC 0037 — Token Economy & Cost Modeling (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/37 ---- - -## 1. Summary - -This RFC defines a **token economy and cost modeling standard** for reasoning pipelines, enabling: - -- token budgeting -- cost‑aware planning -- cost‑aware tool selection -- economic constraints on CoT expansion -- predictable inference costs - -It integrates with: - -- RFC 0007 — Cognitive Pipeline Protocol -- RFC 0020 — Scratchpad Compression - ---- - -## 2. Cost Components - -- **model_cost** — tokens in/out -- **tool_cost** — per‑call cost -- **memory_cost** — read/write cost -- **branch_cost** — cost per branch -- **verification_cost** — verifier calls - ---- - -## 3. Full Schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0037 — Token Economy & Cost Modeling", - "description": "Cost snapshot structure for tracking model inference and tool invocation costs per step or per trajectory.", - "type": "object", - "properties": { - "model_cost": { - "type": "object", - "properties": { - "input_tokens": { - "type": "integer", - "minimum": 0, - "description": "Number of input/prompt tokens consumed." - }, - "output_tokens": { - "type": "integer", - "minimum": 0, - "description": "Number of output/completion tokens generated." - } - }, - "required": ["input_tokens", "output_tokens"] - }, - "tool_cost": { - "type": "object", - "description": "Cost per tool name (numeric values).", - "additionalProperties": { - "type": "number", - "minimum": 0 - } - }, - "total_cost": { - "type": "number", - "minimum": 0, - "description": "Aggregate cost across model inference and tool invocations." - } - }, - "required": ["model_cost", "total_cost"], - "additionalProperties": true -} -``` - - -**Example instance:** - -```json -{ - "model_cost": { - "input_tokens": 1200, - "output_tokens": 800 - }, - "tool_cost": { - "search": 0.002, - "calculator": 0.0001 - }, - "total_cost": 0.015 -} -``` - ---- - -## 4. Example - -```json -{ - "total_cost": 0.004 -} -``` - ---- - -## 5. Conclusion - -This RFC defines the economic foundation for cost‑aware reasoning. diff --git a/rfcs/0038-cost-aware-reasoning-budget.md b/rfcs/0038-cost-aware-reasoning-budget.md deleted file mode 100644 index d1eb218..0000000 --- a/rfcs/0038-cost-aware-reasoning-budget.md +++ /dev/null @@ -1,130 +0,0 @@ -# RFC 0038 — Cost‑Aware Reasoning & Budget Enforcement (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/38 ---- - -## 1. Summary - -This RFC defines **cost‑aware reasoning**, enabling pipelines to: - -- reason under token budgets -- prune branches based on cost -- choose cheaper tools -- compress scratchpads to save tokens -- enforce hard budget ceilings - -It extends: - -- RFC 0037 — Token Economy & Cost Modeling - ---- - -## 2. Budget Types - -- **hard_budget** — cannot exceed -- **soft_budget** — may exceed with penalty -- **branch_budget** — per branch -- **tool_budget** — per tool - ---- - -## 3. Full Schema (JSON) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0038 — Cost-Aware Reasoning Budget", - "description": "Budget policy and snapshot types for enforcing token, cost, step, tool-call, and retry limits on cognitive pipelines.", - "type": "object", - "properties": { - "budget": { - "type": "object", - "description": "Budget policy defining the maximum allowed resource usage.", - "properties": { - "max_tokens": { - "type": "integer", - "minimum": 0, - "description": "Maximum total tokens (input + output) across all LLM calls." - }, - "max_cost": { - "type": "number", - "minimum": 0, - "description": "Maximum dollar cost for the entire cognitive pipeline run." - }, - "max_steps": { - "type": "integer", - "minimum": 0, - "description": "Maximum number of loop iterations." - }, - "max_tool_calls": { - "type": "integer", - "minimum": 0, - "description": "Maximum number of tool invocations." - }, - "max_retries": { - "type": "integer", - "minimum": 0, - "description": "Maximum number of repair/retry attempts." - } - }, - "required": ["max_tokens", "max_cost"] - }, - "enforcement": { - "type": "string", - "enum": ["hard", "soft", "warn"], - "description": "How the budget is enforced. 'hard' force-stops the cognitive pipeline, 'soft' logs warnings, 'warn' emits telemetry only." - }, - "snapshot": { - "type": "object", - "description": "Runtime budget snapshot showing current usage and remaining capacity.", - "properties": { - "tokens_used": { "type": "integer", "minimum": 0 }, - "tokens_remaining": { "type": "integer" }, - "cost_used": { "type": "number", "minimum": 0 }, - "cost_remaining": { "type": "number" }, - "steps_used": { "type": "integer", "minimum": 0 }, - "steps_remaining": { "type": "integer" }, - "tool_calls_used": { "type": "integer", "minimum": 0 }, - "tool_calls_remaining": { "type": "integer" }, - "retries_used": { "type": "integer", "minimum": 0 }, - "retries_remaining": { "type": "integer" } - } - } - }, - "required": ["budget", "enforcement"], - "additionalProperties": true -} -``` - - -**Example instance:** - -```json -{ - "budget": { - "max_tokens": 5000, - "max_cost": 0.10 - }, - "enforcement": "hard" -} -``` - ---- - -## 4. Example - -```json -{ - "budget": { "max_tokens": 2000 } -} -``` - ---- - -## 5. Conclusion - -This RFC defines how pipelines reason within explicit economic constraints. diff --git a/rfcs/0039-tool-cost-modeling-biling.md b/rfcs/0039-tool-cost-modeling-biling.md deleted file mode 100644 index 8fe11d1..0000000 --- a/rfcs/0039-tool-cost-modeling-biling.md +++ /dev/null @@ -1,62 +0,0 @@ -# RFC 0039 — Tool Cost Modeling & Billing Semantics (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/39 ---- - -## 1. Summary - -This RFC defines **cost modeling for tools**, enabling: - -- per‑call billing -- per‑token billing -- per‑operation billing -- cost negotiation -- cost‑aware tool selection - -It extends: - -- RFC 0003 — Tool Invocation Schema -- RFC 0025 — Tool Marketplace Registry - ---- - -## 2. Cost Models - -- **flat** — fixed per call -- **per_token** — based on input/output size -- **tiered** — volume‑based -- **dynamic** — surge pricing -- **negotiated** — multi‑cognitive pipeline negotiation - ---- - -## 3. Full Schema (JSON) - -```json -{ - "tool_name": "search", - "cost_model": "per_token", - "rate": 0.000001 -} -``` - ---- - -## 4. Example - -```json -{ - "tool_name": "calculator", - "cost_model": "flat", - "rate": 0.0001 -} -``` - ---- - -## 5. Conclusion - -This RFC defines cost semantics for tool‑augmented reasoning. diff --git a/rfcs/0040-multi-party-economic-incentives.md b/rfcs/0040-multi-party-economic-incentives.md deleted file mode 100644 index 88094b5..0000000 --- a/rfcs/0040-multi-party-economic-incentives.md +++ /dev/null @@ -1,63 +0,0 @@ -# RFC 0040 — Multi‑Cognitive pipeline Economic Incentives (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026‑04‑14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/40 ---- - -## 1. Summary - -This RFC defines **economic incentive structures** for multi‑cognitive pipeline systems, enabling: - -- cooperative incentives -- competitive incentives -- shared budgets -- reward splitting -- cost attribution - -It extends: - -- RFC 0011 — Multi‑Cognitive pipeline Protocol -- RFC 0015 — Multi‑Cognitive pipeline Reward Sharing - ---- - -## 2. Incentive Models - -- **cooperative** — shared reward -- **competitive** — zero‑sum -- **mixed** — hybrid -- **hierarchical** — planner vs executor -- **market** — bidding for tasks - ---- - -## 3. Full Schema (JSON) - -```json -{ - "incentive_model": "cooperative", - "shared_budget": 0.10, - "reward_split": { - "planner": 0.4, - "executor": 0.6 - } -} -``` - ---- - -## 4. Example - -```json -{ - "incentive_model": "competitive" -} -``` - ---- - -## 5. Conclusion - -This RFC defines economic coordination for multi‑cognitive pipeline reasoning. diff --git a/rfcs/0041-policy-enforcement-schema.md b/rfcs/0041-policy-enforcement-schema.md deleted file mode 100644 index b829f29..0000000 --- a/rfcs/0041-policy-enforcement-schema.md +++ /dev/null @@ -1,320 +0,0 @@ -# RFC 0041 — Policy Enforcement Schema (v0.3) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/41 - ---- - -## 1. Summary - -This RFC defines the **Policy Enforcement Schema (v0.3)** for Open-CoT, a cognitive control plane for governed cognitive pipeline execution. The policy engine evaluates when a model may invoke tools, access data or memory, or perform other governed operations. Given a **delegation request** (RFC 0047) and active policies, it returns **`allow`**, **`deny`**, **`narrow`**, or **`require_approval`**, with optional `narrowing` constraints, denial reasons, or escalation targets. - -v0.3 preserves **`narrow`** and introduces canonical temporal naming from RFC 0051: policy validity bounds use `effective_at` / `expires_at`, condition windows use `validity_window`, and evaluation records use `decided_at`. It formalizes deterministic temporal validity semantics while retaining composable narrowing and policy priority behavior. - ---- - -## 2. Motivation and scope - -Operators need typed policies, graduated responses (`narrow`, `require_approval`), machine-readable rules over **subjects** and **resources**, and **deterministic** evaluation for traces and compliance. This RFC specifies JSON Schemas and evaluation semantics; it does **not** define transport, cryptographic signing of policies, or the full delegation request payload—only linking fields such as `request_id`. - ---- - -## 3. Relationship to adjacent RFCs - -| RFC | Title | Relationship | -|-----|--------|----------------| -| RFC 0007 | Cognitive Pipeline Protocol | Governed FSM: policy consulted in frame, plan, validate_authority, observe_result, critique_verify, finalize. | -| RFC 0017 | Cognitive pipeline Safety & Sandboxing | This RFC supersedes simple allow/block lists with structured rules, narrowing, and evaluation records. | -| RFC 0026 | Cognitive pipeline Identity & Authentication | **Subject** identities and roles for `subject` matching. | -| RFC 0042 | Permissions & Access Control | **Consumes** policy decisions for grants. | -| RFC 0047 | Delegation | Engine evaluates `delegation_request`; `request_id` links artifacts. | - ---- - -## 4. Policy types - -`policy_type` labels intent and ownership; engines MUST preserve it for routing and audit. Semantics come from rules, not from this field alone. - -| Value | Typical use | -|--------|-------------| -| `safety` | Harmful tools, exfiltration, unsafe execution paths. | -| `compliance` | Regulatory / contractual minimization, residency, retention. | -| `organizational` | Internal data classes, departments, workflows. | -| `ethical` | Policy beyond baseline safety. | -| `operational` | SLOs, rate limits, cost controls, production safeguards. | - ---- - -## 5. Decisions and actions - -Rule `action` and result `decision` share: **`allow`** (grant as narrowed so far), **`deny`** (reject), **`narrow`** (approve only under `narrowing` / merged `narrowed_scope`), **`require_approval`** (defer; `escalation_target` SHOULD name queue or role). **`narrow`** remains the data minimization path without a hard deny. - ---- - -## 6. Resources and subjects - -Resources SHOULD use prefixes: `tool:` (RFC 0003), `data:`, `memory:` (RFC 0010). Matching SHOULD prefer exact over pattern, then **longest-prefix / most-specific** tie-break (documented per implementation). **`subject`**: cognitive pipeline id, role, or wildcard per RFC 0026; wildcard grammar MUST be documented by the engine. - ---- - -## 7. Conditions and narrowing - -**`conditions`** (all present sub-fields must pass for a match): `max_risk_level` (`low` ≤ `medium` ≤ `high`), `require_justification`, `validity_window` (`effective_at`/`expires_at` ISO 8601 UTC; half-open), `budget_remaining_min`. Omitted keys impose no constraint from that key. - -**`narrowing`**: `allowed_fields`, `excluded_fields`, `max_results`, `max_response_size_bytes`. If `action` is `narrow`, `narrowing` SHOULD be present; if not `narrow`, ignore `narrowing`. Empty intersection of allowed vs excluded fields MUST yield **`deny`**; otherwise apply intersection rules in §10. - ---- - -## 8. Normative JSON Schema — Policy document (v0.3) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/policy/v0.3", - "title": "Open CoT RFC 0041 — Policy Document", - "type": "object", - "additionalProperties": false, - "properties": { - "version": { "type": "string", "enum": ["0.3"] }, - "policy_id": { "type": "string", "minLength": 1 }, - "policy_type": { - "type": "string", - "enum": ["safety", "compliance", "organizational", "ethical", "operational"] - }, - "description": { "type": "string" }, - "priority": { "type": "integer", "description": "Lower = higher precedence across policies." }, - "rules": { "type": "array", "items": { "$ref": "#/definitions/policyRule" }, "minItems": 1 }, - "effective_at": { "type": "string", "format": "date-time" }, - "expires_at": { "type": "string", "format": "date-time" } - }, - "required": ["version", "policy_id", "policy_type", "priority", "rules"], - "definitions": { - "riskLevel": { "type": "string", "enum": ["low", "medium", "high"] }, - "ruleAction": { "type": "string", "enum": ["allow", "deny", "narrow", "require_approval"] }, - "validityWindow": { - "type": "object", - "additionalProperties": false, - "properties": { - "effective_at": { "type": "string", "format": "date-time" }, - "expires_at": { "type": "string", "format": "date-time" } - }, - "required": ["effective_at", "expires_at"] - }, - "conditions": { - "type": "object", - "additionalProperties": false, - "properties": { - "max_risk_level": { "$ref": "#/definitions/riskLevel" }, - "require_justification": { "type": "boolean" }, - "validity_window": { "$ref": "#/definitions/validityWindow" }, - "budget_remaining_min": { "type": "number" } - } - }, - "narrowing": { - "type": "object", - "additionalProperties": false, - "properties": { - "allowed_fields": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "excluded_fields": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "max_results": { "type": "integer", "minimum": 0 }, - "max_response_size_bytes": { "type": "integer", "minimum": 0 } - } - }, - "policyRule": { - "type": "object", - "additionalProperties": false, - "properties": { - "rule_id": { "type": "string", "minLength": 1 }, - "action": { "$ref": "#/definitions/ruleAction" }, - "subject": { "type": "string" }, - "resource": { "type": "string", "minLength": 1 }, - "conditions": { "$ref": "#/definitions/conditions" }, - "narrowing": { "$ref": "#/definitions/narrowing" }, - "escalation_target": { "type": "string" }, - "reason": { "type": "string" } - }, - "required": ["rule_id", "action", "resource"] - } - } -} -``` - - ---- - -## 9. Normative JSON Schema — Policy evaluation result - -Engines MUST emit one object per evaluated `(request_id, policy_id)` or define a batch envelope of these records. - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/policy_evaluation_result/v0.3", - "title": "Open CoT RFC 0041 — Policy Evaluation Result", - "type": "object", - "additionalProperties": false, - "properties": { - "evaluation_id": { "type": "string", "minLength": 1 }, - "request_id": { "type": "string", "minLength": 1, "description": "Links to delegation_request (RFC 0047)." }, - "policy_id": { "type": "string", "minLength": 1 }, - "rule_id": { "type": "string" }, - "decision": { "type": "string", "enum": ["allow", "deny", "narrow", "require_approval"] }, - "narrowed_scope": { "type": "object", "additionalProperties": true }, - "denial_reason": { "type": "string" }, - "escalation_target": { "type": "string" }, - "decided_at": { "type": "string", "format": "date-time" }, - "context": { - "type": "object", - "additionalProperties": false, - "properties": { - "requester_id": { "type": "string" }, - "run_id": { "type": "string" }, - "budget_snapshot": { "type": "object", "additionalProperties": true }, - "risk_assessment": { "type": "string" } - } - } - }, - "required": ["evaluation_id", "request_id", "policy_id", "decision", "decided_at"] -} -``` - - ---- - -## 10. Evaluation semantics - -**Temporal validity.** Policy is active at `t` if `effective_at` is absent or `t` ≥ `effective_at`, and `expires_at` is absent or `t` < `expires_at` (half-open on end). Inactive policies MUST NOT affect the outcome. - -**Intra-policy.** Among rules whose `subject`, `resource`, and `conditions` match, the **first entry in `rules`** wins. No match ⇒ this policy contributes **no match** (not `allow`). - -**Fail-closed default.** If no rule in any active policy matches, final decision is **`deny`**; populate `denial_reason` with a stable code and optional human text. - -**Inter-policy merge.** Sort active policies by ascending `priority`, then ascending `policy_id` (Unicode). Each policy yields no match, `allow`, `deny`, `narrow`, or `require_approval`. Merge precedence: **`deny` > `narrow` > `require_approval` > `allow`**. Several `narrow` outcomes merge by intersecting caps: `allowed_fields` = intersection where all specify lists else unconstrained on omit; `excluded_fields` = union; `max_results` and `max_response_size_bytes` = minimum of given caps. Contradiction or empty effective allow-set ⇒ **`deny`**. - -**Determinism.** Same active policy set, `t`, delegation payload, subject resolution, risk label, budget snapshot, and justification flags ⇒ same `decision`, provenance (`policy_id` / `rule_id`), and semantically equal `narrowed_scope`. Document any feature flags that break replay. - ---- - -## 11. Examples - -### 11.1 Safety — deny shell access - -```json -{ - "version": "0.3", - "policy_id": "safety_no_shell", - "policy_type": "safety", - "description": "Block shell for unsupervised runs.", - "priority": 10, - "effective_at": "2026-04-14T00:00:00Z", - "rules": [ - { "rule_id": "deny_shell", "action": "deny", "subject": "*", "resource": "tool:shell", "reason": "Unattended shell out of scope." }, - { "rule_id": "allow_search", "action": "allow", "subject": "*", "resource": "tool:search" } - ] -} -``` - -### 11.2 Compliance — narrow email to headers only - -```json -{ - "version": "0.3", - "policy_id": "compliance_email_minimization", - "policy_type": "compliance", - "description": "Headers/metadata only for mailbox reads.", - "priority": 20, - "rules": [{ - "rule_id": "narrow_mailbox_read", - "action": "narrow", - "subject": "role:analyst", - "resource": "data:mailbox/*", - "conditions": { "max_risk_level": "medium", "require_justification": true }, - "narrowing": { - "allowed_fields": ["message_id", "thread_id", "from", "to", "cc", "date", "subject"], - "excluded_fields": ["body", "attachments"], - "max_results": 50, - "max_response_size_bytes": 1048576 - }, - "reason": "Data minimization." - }] -} -``` - -### 11.3 Operational — require approval for database writes - -```json -{ - "version": "0.3", - "policy_id": "ops_db_write_gate", - "policy_type": "operational", - "description": "Human approval for DB mutations.", - "priority": 30, - "rules": [{ - "rule_id": "gate_db_writes", - "action": "require_approval", - "subject": "*", - "resource": "tool:db_write", - "conditions": { - "validity_window": { "effective_at": "2026-04-14T00:00:00Z", "expires_at": "2099-12-31T23:59:59Z" }, - "budget_remaining_min": 0 - }, - "escalation_target": "queue:dba-oncall", - "reason": "DB writes require DBA approval." - }] -} -``` - -### 11.4 Policy evaluation result (after a request matching §11.2) - -```json -{ - "evaluation_id": "eval_8f3c2a1b", - "request_id": "del_req_4410aa", - "policy_id": "compliance_email_minimization", - "rule_id": "narrow_mailbox_read", - "decision": "narrow", - "narrowed_scope": { - "allowed_fields": ["message_id", "thread_id", "from", "to", "cc", "date", "subject"], - "excluded_fields": ["body", "attachments"], - "max_results": 50, - "max_response_size_bytes": 1048576 - }, - "decided_at": "2026-04-18T12:34:56Z", - "context": { - "requester_id": "cognitive-pipeline/analyst-7", - "run_id": "run_19c0", - "budget_snapshot": { "currency": "USD", "remaining": 12.45 }, - "risk_assessment": "medium" - } -} -``` - ---- - -## 12. Security and privacy - -Fail-closed default limits accidental over-permissioning. **`narrow`** is unsafe unless executors **enforce** `narrowed_scope` at bind/execute time, not only in logs. **`require_approval`** needs authenticated approvers. Evaluation **`context`** may be sensitive; treat like other audit payloads under organizational retention and access control. - -## 13. Open questions resolution - -| Topic | v0.3 resolution | -|--------|------------------| -| Partial approval / minimization | `narrow` + `narrowing` / `narrowed_scope`. | -| Multi-policy | Deterministic sort; precedence **deny > narrow > require_approval > allow**. | -| No rule match | Fail-closed **`deny`**. | -| Audit trail | `policy_evaluation_result` + `evaluation_id`, `decided_at`, `request_id`. | -| Conditions / hooks | `conditions` + `context.budget_snapshot`, `risk_assessment`. | -| Rule vs policy order | Policy `priority` + Unicode `policy_id`; rules by **array order**. | - -**Deferred (0.3+):** canonical glob grammar for `resource`, signed policy bundles, enumerated `risk_assessment`. - -## 14. Acceptance criteria and conclusion - -A conforming engine **MUST**: (1) validate policy documents against §8 with `version` `0.3` unless documented otherwise; (2) emit §9 results with required fields for each evaluation; (3) implement §10 including temporal filter, first-match rules, fail-closed default, merge precedence, narrowing intersection, determinism; (4) populate `denial_reason` / `narrowed_scope` / `escalation_target` when emitting the corresponding decisions (document any optional omissions). Authors **SHOULD** set `description`, per-rule `reason`, and explicit validity bounds (`effective_at` / `expires_at`) for shared policies. - -RFC 0041 v0.3 normatively specifies policy documents, the **`narrow`** decision, canonical temporal semantics, evaluation results, and deterministic merge semantics—forming the **decision layer** with RFC 0026 (identity), RFC 0047 (delegation), and RFC 0051 (temporal semantics). diff --git a/rfcs/0042-permission-acl.md b/rfcs/0042-permission-acl.md deleted file mode 100644 index 346f73e..0000000 --- a/rfcs/0042-permission-acl.md +++ /dev/null @@ -1,276 +0,0 @@ -# RFC 0042 — Permissions & Access Control (v0.3) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/42 - ---- - -## 1. Summary - -This RFC defines **capability-based permission grants** for Open CoT: typed, scoped, time-limited objects that materialize authority *after* the policy engine approves a delegation request. The harness creates grants; the tool executor validates and consumes them. The language model **requests** access; it **never** self-authorizes. - -This specification extends **RFC 0026** (Cognitive pipeline Identity — `granted_to`) and **RFC 0041** (Policy Enforcement — issuance and narrowing). It aligns with **RFC 0007** (permissions at `execute_tool`, revocation in finalize), **RFC 0047** (Delegation — `request_ref` / `decision_ref`), and **RFC 0043** (audit mapping for lifecycle events). - ---- - -## 2. Context - -Open CoT is a **cognitive control plane**: reasoning, tools, memory, and policy compose into inspectable runs. Permissions bridge **policy approval** and **side-effecting execution**. First-class grants are required so that (a) tool endpoints are not confused deputies for ambient authority, (b) auditors can reconstruct what was allowed, for whom, for how long, and under which policy lineage, and (c) sub-pipelines do not silently inherit parent capabilities. A **permission grant** is a durable record with a strict lifecycle—not a static role matrix embedded in cognitive pipeline config. - ---- - -## 3. Design principles - -1. **No self-authorization.** `granted_by`, `policy_ref`, `decision_ref`, and narrowed `scope` MUST be harness/policy-populated; the model MUST NOT supply values treated as issuance authority. -2. **Deny by default.** No matching active grant for `audience` + `scope` ⇒ execution MUST fail closed. -3. **Least privilege in the grant.** Persisted `scope` is the **post-policy** narrowed scope, not the model’s raw intent. -4. **Explicit binding.** `audience` ties the capability to a specific tool/service key. -5. **Time-bounded.** Every grant has `effective_at`, `ttl_seconds`, and `expires_at`; expired grants are unusable (`expired`). -6. **Observable transitions.** Every lifecycle change MUST emit a structured audit event (§9). - ---- - -## 4. Lifecycle (`status`) - -| Status | Meaning | -|--------|---------| -| `active` | Issued, within TTL, not yet consumed (or reusable and still valid). | -| `consumed` | Used for authorized execution; for `one_shot: true`, terminal after first committed use. | -| `expired` | Past `expires_at`; unusable. | -| `revoked` | Invalidated (finalize, violation, manual). | - -**Normative:** Only `active` grants MAY authorize new executions (subject to `one_shot` and audience). `consumed` ⇒ `consumed_at` + `tool_call_id` in `permission_consumed`. `revoked` ⇒ `revoked_at` + `revocation_reason`. `expired` ⇒ `permission_expired` when status is persisted (lazy or eager sweep; idempotent re-log permitted). - ---- - -## 5. Scope and narrowing - -**`scope`** has required `resource` (URI-like, e.g. `tool:email`, `data:calendar`, `file:/path`) and `action` ∈ `{read, write, execute, delete, list}`. Optional **`constraints`** (machine-enforceable): `allowed_fields`, `excluded_fields`, `max_results`, `max_response_size_bytes`, `custom` (resource-specific). The executor MUST enforce understood keys; unknown keys MUST NOT broaden access (deny or policy-error per deployment — §12). - -**Narrowing example:** Model requests `{resource: tool:email, action: read}`. Policy narrows to the same resource/action with `constraints: {allowed_fields: [subject, from, date], excluded_fields: [body, attachments]}`. The **persisted grant** carries the narrowed scope; the executor MUST reject or redact violations. - ---- - -## 6. TTL and expiry - -Every grant MUST have `effective_at`, `ttl_seconds` (integer >= 1), and `expires_at` (RFC 3339). The harness sets `expires_at` from `effective_at` + TTL at issuance. The executor MUST check `effective_at <= now < expires_at` on the harness clock domain before each use. **Recommended defaults (non-normative):** 60s for tool calls; 300s for session-scoped reads/lists when policy allows. On expiry, set `expired` and log `permission_expired`. - ---- - -## 7. One-shot vs reusable - -**`one_shot: true`:** becomes `consumed` after the first **committed** pre-flight that binds a `tool_call_id`. Recommended default for `write` / `execute` / `delete`. **`one_shot: false`:** reusable until TTL/revocation. Recommended default for `read` / `list`. One-shot reads remain permitted for sensitive classes. - ---- - -## 8. Audience binding - -**`audience`** (non-empty) identifies the intended tool/service (e.g. `tool:search`). At pre-flight, the resolved invocation target MUST match `audience` (exact string unless RFC 0041 registers aliases). `audience: tool:search` MUST NOT authorize `tool:email`, including shared gateways. - ---- - -## 9. Forwardability - -**`forwardable`** defaults **`false`**; sub-pipelines MUST request their own grants. **`forwardable: true`** only via explicit policy; implementations SHOULD require an **authority_receipt** chain (RFC 0047) for attributable inheritance. - ---- - -## 10. Audit events - -Every state change MUST log: **`permission_granted`** (scope, TTL, audience, `granted_to`, refs); **`permission_consumed`** (`tool_call_id`, `consumed_at`); **`permission_expired`** (`expires_at`, detection time); **`permission_revoked`** (`revoked_at`, `revocation_reason`, optional actor). These integrate with RFC 0007 / RFC 0043. - ---- - -## 11. JSON Schema — Permission grant (normative) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/permission-grant/0.3", - "title": "Open CoT RFC 0042 — Permission Grant", - "type": "object", - "additionalProperties": false, - "properties": { - "permission_id": { "type": "string", "format": "uuid" }, - "granted_to": { "type": "string", "minLength": 1 }, - "scope": { - "type": "object", - "additionalProperties": false, - "required": ["resource", "action"], - "properties": { - "resource": { "type": "string", "minLength": 1 }, - "action": { "type": "string", "enum": ["read", "write", "execute", "delete", "list"] }, - "constraints": { - "type": "object", - "additionalProperties": false, - "properties": { - "allowed_fields": { "type": "array", "items": { "type": "string" } }, - "excluded_fields": { "type": "array", "items": { "type": "string" } }, - "max_results": { "type": "integer", "minimum": 0 }, - "max_response_size_bytes": { "type": "integer", "minimum": 0 }, - "custom": { "type": "object" } - } - } - } - }, - "audience": { "type": "string", "minLength": 1 }, - "ttl_seconds": { "type": "integer", "minimum": 1 }, - "expires_at": { "type": "string", "format": "date-time" }, - "one_shot": { "type": "boolean" }, - "forwardable": { "type": "boolean", "default": false }, - "granted_by": { "type": "string", "minLength": 1 }, - "policy_ref": { "type": "string", "minLength": 1 }, - "request_ref": { "type": "string", "minLength": 1 }, - "decision_ref": { "type": "string", "minLength": 1 }, - "effective_at": { "type": "string", "format": "date-time" }, - "consumed_at": { "type": "string", "format": "date-time" }, - "revoked_at": { "type": "string", "format": "date-time" }, - "revocation_reason": { "type": "string" }, - "status": { "type": "string", "enum": ["active", "consumed", "expired", "revoked"] } - }, - "required": [ - "permission_id", "granted_to", "scope", "audience", "ttl_seconds", "expires_at", - "one_shot", "granted_by", "policy_ref", "request_ref", "decision_ref", "effective_at", "status" - ], - "allOf": [ - { "if": { "properties": { "status": { "const": "consumed" } }, "required": ["status"] }, - "then": { "required": ["consumed_at"] } }, - { "if": { "properties": { "status": { "const": "revoked" } }, "required": ["status"] }, - "then": { "required": ["revoked_at", "revocation_reason"] } } - ] -} -``` - - -Omitted `forwardable` on the wire MUST deserialize as `false`. - ---- - -## 12. Tool executor requirements - -Before execution: verify `status == active`, audience match, not expired, `scope.resource`/`action` match the invocation, and all understood `constraints`. After successful one-shot pre-flight, transition to `consumed` and emit `permission_consumed`. Unknown `constraints.custom` keys MUST NOT widen access. - ---- - -## 13. Examples - -### 13.1 One-shot write — specific file - -```json -{ - "permission_id": "a1b2c3d4-e5f6-4a7b-8c9d-0123456789ab", - "granted_to": "run:20260418T143022Z-planner-01", - "scope": { - "resource": "file:/var/workspace/contracts/nda-draft.md", - "action": "write", - "constraints": { "max_response_size_bytes": 1048576, "custom": { "encoding": "utf-8" } } - }, - "audience": "tool:filesystem", - "ttl_seconds": 60, - "expires_at": "2026-04-18T14:31:22Z", - "one_shot": true, - "forwardable": false, - "granted_by": "policy:org-contracts-v3#rule:file-write-allow", - "policy_ref": "policy:org-contracts-v3", - "request_ref": "deleg_req:7f2c9a1b-4d3e-4f5a-9b0c-111111111111", - "decision_ref": "deleg_dec:88aa99bb-0cc1-4dd2-9ee3-222222222222", - "effective_at": "2026-04-18T14:30:22Z", - "status": "active" -} -``` - -First committed `tool:filesystem` write ⇒ `consumed` + `permission_consumed`. - -### 13.2 Reusable read — search, 5-minute TTL - -```json -{ - "permission_id": "b2c3d4e5-f6a7-4b8c-9d0e-123456789abc", - "granted_to": "cognitive-pipeline:researcher-prod-east", - "scope": { - "resource": "tool:search", - "action": "read", - "constraints": { "max_results": 25, "max_response_size_bytes": 2097152 } - }, - "audience": "tool:search", - "ttl_seconds": 300, - "expires_at": "2026-04-18T14:40:00Z", - "one_shot": false, - "forwardable": false, - "granted_by": "policy:safe-search-v1#rule:read-allow", - "policy_ref": "policy:safe-search-v1", - "request_ref": "deleg_req:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", - "decision_ref": "deleg_dec:ffffffff-0000-1111-2222-333333333333", - "effective_at": "2026-04-18T14:35:00Z", - "status": "active" -} -``` - -### 13.3 Narrowed read — email headers only - -```json -{ - "permission_id": "c3d4e5f6-a7b8-4c9d-0e1f-23456789abcd", - "granted_to": "run:20260418T150000Z-assistant-07", - "scope": { - "resource": "tool:email", - "action": "read", - "constraints": { - "allowed_fields": ["subject", "from", "date"], - "excluded_fields": ["body", "attachments"], - "max_results": 50 - } - }, - "audience": "tool:email", - "ttl_seconds": 60, - "expires_at": "2026-04-18T15:01:05Z", - "one_shot": false, - "forwardable": false, - "granted_by": "policy:pii-minimize-v2#rule:email-headers-only", - "policy_ref": "policy:pii-minimize-v2", - "request_ref": "deleg_req:11111111-2222-3333-4444-555555555555", - "decision_ref": "deleg_dec:66666666-7777-8888-9999-aaaaaaaaaaaa", - "effective_at": "2026-04-18T15:00:05Z", - "status": "active" -} -``` - -Executor MUST enforce headers-only regardless of model prompts. - ---- - -## 14. Cross-references - -- **RFC 0007 — Governed FSM** — consume in `execute_tool`; revoke in finalize. -- **RFC 0026 — Cognitive pipeline Identity** — `granted_to` binding. -- **RFC 0041 — Policy Enforcement** — decisions create grants; optional audience aliases. -- **RFC 0043 — Auditing** — canonical audit stream for §10. -- **RFC 0047 — Delegation** — `request_ref` / `decision_ref`; authority receipts when `forwardable`. - ---- - -## 15. Open questions resolution - -| Topic | Resolution (v0.3) | -|-------|---------------------| -| RBAC vs capabilities | Capabilities at execution; RBAC feeds policy only. | -| Clock skew | `expires_at` authoritative; harness clock or documented skew budget. | -| Unknown `custom` keys | Deployment choice: deny vs ignore; never widen. | -| Audience aliases | Default exact match; aliases only if registered in policy (RFC 0041). | -| `one_shot` boundary | First committed pre-flight; retries idempotent or new grant. | - ---- - -## 16. Acceptance criteria - -Conformant implementations: (1) issue grants only post-validated decision with immutable harness fields; (2) validate records against §11 (default `forwardable` false); (3) obey §4 lifecycle; (4) perform §12 pre-flight; (5) persist narrowed scope per §5; (6) implement §7 one-shot semantics; (7) emit all §10 events with minimum payloads; (8) deny child reuse without explicit `forwardable`; (9) reject cross-audience use per §8. - ---- - -## 17. Conclusion - -RFC 0042 v0.3 specifies **first-class permission grants** with audience binding, canonical temporal validity (`effective_at`/`expires_at`), TTL, optional reuse, forwardability rules, and audited lifecycle—closing the loop from RFC 0026 / 0041 identity and policy to safe execution on the Open CoT control plane (RFC 0007, RFC 0047, RFC 0051). diff --git a/rfcs/0043-auditing-compliance-logs.md b/rfcs/0043-auditing-compliance-logs.md deleted file mode 100644 index 0091874..0000000 --- a/rfcs/0043-auditing-compliance-logs.md +++ /dev/null @@ -1,251 +0,0 @@ -# RFC 0043 — Auditing & Compliance Logs (v0.3) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/43 - ---- - -## 1. Summary - -Open CoT is a **cognitive control plane**: governed pipelines run under explicit policies, permissions, budgets, and traces. This RFC defines the **audit subsystem**, which emits **immutable, hash-chained evidence** of everything that happened during governed execution—supporting **forensics**, **compliance reporting**, and **tamper detection**. - -Audit extends **RFC 0041 (Policy Enforcement)** and **RFC 0031 (Observability & Telemetry)**. Telemetry optimizes operations and reliability; audit provides a **normative evidence trail** (authorization decisions, delegation, tool use, denials, budget outcomes) suitable for regulators, customers, and incident response. - -Two schema objects apply: **`audit_event`** (append-only chain links) and **`audit_envelope`** (sealed run summary including chain bounds, roll-ups, and envelope integrity over events plus trace). - -## 2. Goals, Non-Goals, and Terminology - -**Goals:** append-only semantics for the logical event stream; per-event and envelope **SHA-256** integrity; SIEM-friendly JSON export; explicit hooks to the governed FSM (RFC 0007), permissions (RFC 0042), delegation (RFC 0047), and receipts (RFC 0048). - -**Non-Goals:** storage technology, KMS/HSM integration details, PII classification policy (deployments apply their own), and alerting rule engines (RFC 0031). - -**Terms:** **Run** = one `run_id`. **Event chain** = ordered `audit_event` list linked by `parent_event_id`. **Genesis** = first event (`parent_event_id: null`). **Sealing** = terminal `trace_sealed` plus `audit_envelope` (RFC 0007 `audit_seal`). - -## 3. Data Model - -| Object | Role | -|--------|------| -| `audit_event` | One log entry: type, time, actor, type-specific `details`, chain link, integrity. | -| `audit_envelope` | One sealed record per run: timing, outcome, trace hash, chain head/tail, counts, `budget_final`, violations, integrity (optional signature). | - -## 4. Event Types and `details` - -`event_type` MUST be one of: `run_started`, `policy_evaluated`, `permission_granted`, `permission_consumed`, `permission_expired`, `permission_revoked`, `tool_executed`, `delegation_requested`, `delegation_decided`, `escalation_initiated`, `escalation_resolved`, `postcondition_violated`, `denial_recorded`, `budget_warning`, `budget_exhausted`, `run_completed`, `run_failed`, `trace_sealed`. - -`details` is a structured object whose keys depend on `event_type` (policy ids, permission ids, tool names, receipt refs per RFC 0048, delegation refs per RFC 0047, etc.). v0.3 keeps `details` **open** in JSON Schema (`additionalProperties: true`) so implementations can evolve; profiles MAY constrain keys per event type in a later revision. - -## 5. Field Semantics (Concise) - -**`audit_event`:** `event_id` (UUID), `run_id`, `requester_id`, `observed_at` (RFC 3339 UTC), `event_type`, `details`, `parent_event_id` (UUID or `null` for genesis), `ordering.event_seq` (monotonic sequence per run), and `integrity` (`hash_algorithm`, `content_hash`). - -**`audit_envelope`:** `envelope_id`, `run_id`, `requester_id` (primary), `started_at`, `completed_at`, `completion_status`, `trace_hash`, `event_chain_head`, `event_chain_tail`, `event_count`, `delegation_summary`, `permission_summary`, `budget_final` (RFC 0038 snapshot shape), `policy_violations[]`, `integrity` (hash required; `signature_algorithm` / `signature` optional). - -**`completion_status`:** `succeeded` | `failed` | `denied` | `budget_exhausted` | `external_stop` | `escalation_timeout` | `fail_safe`. - -**`policy_violations[]` items:** `violation_id`, `policy_id`, optional `rule_id`, `observed_at`, `severity`, `description`, optional `related_event_id`. - -## 6. Hash Chaining and Integrity - -**Per-event `content_hash`:** SHA-256 over **canonical JSON** of the event with the **`integrity` object omitted**. Canonical rules: UTF-8, lexicographic key order, no insignificant whitespace, explicit `null`. Digest hex-encoded lowercase in `integrity.content_hash`. - -**Chain:** Genesis uses `parent_event_id: null`. Each later event sets `parent_event_id` to the **predecessor’s `event_id`**. If any event body is altered or removed, that event’s hash fails verification and/or chain pointers no longer match stored order. - -**Envelope `content_hash`:** Same algorithm; hashed material is the canonical representation of the envelope **excluding `integrity`**, plus the deployment-defined binding of **ordered event list + `trace_hash`** (implementations MUST document the exact serialization of “chain + trace” in the deployment profile). Optional **detached signature** on the envelope attests the digest without changing verifiers that only check hashes. - -**Implementation profile:** Deployments SHOULD publish a short profile document that names the canonical JSON library or rules, how `trace_hash` is computed over the governed trace artifact, and how the envelope binds the ordered events (e.g., hash of concatenated per-event `content_hash` values vs. hash of a single JSON array). **Redaction:** If `details` contains sensitive literals, writers MAY substitute digests or elide fields **before** hashing only when the profile explicitly defines a redaction map; otherwise redaction invalidates verification. - -## 7. Compliance Export and FSM Alignment - -**SIEM:** NDJSON stream of `audit_event`; correlate on `run_id`; map `event_type` to severity tiers. **SOC2-style access reviews:** Show `policy_evaluated`, `permission_*`, `tool_executed`, `denial_recorded`, and envelope roll-ups. **Forensics:** Ordered events + `trace_hash` + governed trace (RFC 0001 linkage) + receipt ids in `details` (RFC 0048). - -**RFC 0007:** `run_started` on enter; policy gates → `policy_evaluated` / `denial_recorded` / `run_failed` as applicable; terminal success → `run_completed`, then `trace_sealed` and **`audit_envelope`**. The **`audit_seal`** transition is the only place that may finalize `trace_sealed` and publish the envelope. - -## 8. JSON Schema — `audit_event` - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0043 — audit_event", - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.3"] }, - "event_id": { "type": "string", "format": "uuid" }, - "run_id": { "type": "string", "minLength": 1 }, - "requester_id": { "type": "string", "minLength": 1 }, - "observed_at": { "type": "string", "format": "date-time" }, - "event_type": { "type": "string", "enum": ["run_started","policy_evaluated","permission_granted","permission_consumed","permission_expired","permission_revoked","tool_executed","delegation_requested","delegation_decided","escalation_initiated","escalation_resolved","postcondition_violated","denial_recorded","budget_warning","budget_exhausted","run_completed","run_failed","trace_sealed"] }, - "details": { "type": "object", "additionalProperties": true }, - "parent_event_id": { "type": ["string", "null"], "format": "uuid" }, - "ordering": { - "type": "object", - "additionalProperties": false, - "properties": { - "event_seq": { "type": "integer", "minimum": 0 }, - "causal_predecessors": { "type": "array", "items": { "type": "string", "format": "uuid" }, "uniqueItems": true } - }, - "required": ["event_seq"] - }, - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { "type": "string", "enum": ["sha256"] }, - "content_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" } - }, - "required": ["hash_algorithm", "content_hash"] - } - }, - "required": ["schema_version","event_id","run_id","requester_id","observed_at","event_type","details","parent_event_id","ordering","integrity"] -} -``` - - -## 9. JSON Schema — `audit_envelope` - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0043 — audit_envelope", - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.3"] }, - "envelope_id": { "type": "string", "format": "uuid" }, - "run_id": { "type": "string", "minLength": 1 }, - "requester_id": { "type": "string", "minLength": 1 }, - "started_at": { "type": "string", "format": "date-time" }, - "completed_at": { "type": "string", "format": "date-time" }, - "completion_status": { "type": "string", "enum": ["succeeded","failed","denied","budget_exhausted","external_stop","escalation_timeout","fail_safe"] }, - "trace_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "event_chain_head": { "type": "string", "format": "uuid" }, - "event_chain_tail": { "type": "string", "format": "uuid" }, - "event_count": { "type": "integer", "minimum": 1 }, - "delegation_summary": { - "type": "object", - "additionalProperties": false, - "properties": { - "total_requested": { "type": "integer", "minimum": 0 }, - "total_granted": { "type": "integer", "minimum": 0 }, - "total_denied": { "type": "integer", "minimum": 0 }, - "total_narrowed": { "type": "integer", "minimum": 0 } - }, - "required": ["total_requested","total_granted","total_denied","total_narrowed"] - }, - "permission_summary": { - "type": "object", - "additionalProperties": false, - "properties": { - "total_granted": { "type": "integer", "minimum": 0 }, - "total_consumed": { "type": "integer", "minimum": 0 }, - "total_expired": { "type": "integer", "minimum": 0 }, - "total_revoked": { "type": "integer", "minimum": 0 } - }, - "required": ["total_granted","total_consumed","total_expired","total_revoked"] - }, - "budget_final": { - "type": "object", - "additionalProperties": true, - "properties": { - "tokens_used": { "type": "integer", "minimum": 0 }, - "tokens_remaining": { "type": "integer" }, - "cost_used": { "type": "number", "minimum": 0 }, - "cost_remaining": { "type": "number" }, - "steps_used": { "type": "integer", "minimum": 0 }, - "steps_remaining": { "type": "integer" }, - "tool_calls_used": { "type": "integer", "minimum": 0 }, - "tool_calls_remaining": { "type": "integer" }, - "retries_used": { "type": "integer", "minimum": 0 }, - "retries_remaining": { "type": "integer" } - } - }, - "policy_violations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "violation_id": { "type": "string", "format": "uuid" }, - "policy_id": { "type": "string", "minLength": 1 }, - "rule_id": { "type": "string" }, - "observed_at": { "type": "string", "format": "date-time" }, - "severity": { "type": "string", "enum": ["info","low","medium","high","critical"] }, - "description": { "type": "string", "minLength": 1 }, - "related_event_id": { "type": "string", "format": "uuid" } - }, - "required": ["violation_id","policy_id","observed_at","severity","description"] - } - }, - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { "type": "string", "enum": ["sha256"] }, - "content_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "signature_algorithm": { "type": "string" }, - "signature": { "type": "string" } - }, - "required": ["hash_algorithm", "content_hash"] - } - }, - "required": ["schema_version","envelope_id","run_id","requester_id","started_at","completed_at","completion_status","trace_hash","event_chain_head","event_chain_tail","event_count","delegation_summary","permission_summary","budget_final","policy_violations","integrity"] -} -``` - - -## 10. Examples - -### 10.1 `audit_event` — `permission_granted` - -Illustrative `content_hash`; verifiers recompute from canonical bytes with `integrity` removed. - -```json -{"schema_version":"0.3","event_id":"a1b2c3d4-e5f6-4789-a012-3456789abcde","run_id":"run_20260414T153012Z_planner_01","requester_id":"planner.primary","observed_at":"2026-04-14T15:30:18.421Z","event_type":"permission_granted","details":{"permission_id":"perm_search_readonly_01","scope":{"tools":["tool:web_search"],"resources":["urn:opencot:corp_kb:public"]},"ttl_seconds":900,"grantor":"policy_engine@v0.7","policy_binding":{"policy_id":"corp_safe_search","policy_version":"2026.04.1"}},"parent_event_id":"00000000-0000-4000-8000-000000000001","ordering":{"event_seq":3},"integrity":{"hash_algorithm":"sha256","content_hash":"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"}} -``` - -### 10.2 `audit_envelope` — delegation, tools, success - -```json -{"schema_version":"0.3","envelope_id":"f47ac10b-58cc-4372-a567-0e02b2c3d479","run_id":"run_20260414T153012Z_planner_01","requester_id":"planner.primary","started_at":"2026-04-14T15:30:12.000Z","completed_at":"2026-04-14T15:31:02.883Z","completion_status":"succeeded","trace_hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","event_chain_head":"00000000-0000-4000-8000-000000000001","event_chain_tail":"99999999-9999-4999-8999-999999999999","event_count":14,"delegation_summary":{"total_requested":1,"total_granted":1,"total_denied":0,"total_narrowed":1},"permission_summary":{"total_granted":2,"total_consumed":2,"total_expired":0,"total_revoked":0},"budget_final":{"tokens_used":4120,"tokens_remaining":880,"cost_used":0.042,"cost_remaining":0.058,"steps_used":6,"steps_remaining":4,"tool_calls_used":3,"tool_calls_remaining":7,"retries_used":0,"retries_remaining":2},"policy_violations":[],"integrity":{"hash_algorithm":"sha256","content_hash":"2c624232cdd221699294d012d04dfb23f036edaedd441b52e063bd86ba4a3b74","signature_algorithm":"ed25519","signature":"BASE64_DETACHED_SIGNATURE_PLACEHOLDER"}} -``` - -## 11. Cross-References - -| RFC | Document | Relevance | -|-----|----------|-----------| -| RFC 0007 | [0007-cognitive-pipeline-protocol.md](0007-cognitive-pipeline-protocol.md) | Governed FSM; `audit_seal`, `trace_sealed`, receipt linkage. | -| RFC 0031 | [0031-cognitive-observability-telemetry.md](0031-cognitive-observability-telemetry.md) | Telemetry; audit extends with compliance-grade events. | -| RFC 0035 | [0035-data-provenance-tracking.md](0035-data-provenance-tracking.md) | Provenance and integrity model alignment. | -| RFC 0041 | [0041-policy-enforcement-schema.md](0041-policy-enforcement-schema.md) | Policy evaluations as audit events. | -| RFC 0042 | [0042-permission-acl.md](0042-permission-acl.md) | Permission lifecycle in `permission_*` events. | -| RFC 0047 | *Delegation* (normative wire format cited by RFC 0007 / 0041) | `delegation_*` events and `delegation_summary`. | -| RFC 0048 | *Execution receipts* (normative wire format cited by RFC 0007) | Receipt ids in `tool_executed` / `permission_consumed`. | -| RFC 0038 | [0038-cost-aware-reasoning-budget.md](0038-cost-aware-reasoning-budget.md) | `budget_final` and budget-related events. | - -## 12. Open Questions Resolution - -| Topic | Resolution (v0.3) | -|-------|-------------------| -| Chain link | `parent_event_id` → predecessor **`event_id`**; tamper evidence from per-event `content_hash` + envelope binding. | -| Per-event signatures | Out of scope for v0.3; optional **envelope** signature only. | -| Strict `details` typing | Deferred; `additionalProperties: true` until stable cross-vendor shapes exist. | -| Multi-cognitive pipeline | Each event carries its **`requester_id`**; envelope `requester_id` is the run’s primary cognitive pipeline. | -| Clock skew | `observed_at` is writer clock; NTP recommended; ordering uses `event_seq` first. | - -## 13. Acceptance Criteria - -1. Emit required lifecycle and governance events (§4) for every governed run. -2. Maintain a single valid `parent_event_id` chain per `run_id`, with monotonic `ordering.event_seq`. -3. Verify each event’s `integrity.content_hash` per §6; verify envelope hash per deployment profile. -4. On seal, emit one `audit_envelope` consistent with chain head/tail/count and `trace_hash`. -5. Reconcile `delegation_summary` and `permission_summary` against `delegation_*` and `permission_*` events. -6. Export ordered events + envelope without dropping required fields (NDJSON or JSON bundle). - -## 14. Conclusion - -RFC 0043 v0.3 specifies **`audit_event`** and **`audit_envelope`** with canonical temporal semantics (`observed_at`, `completed_at`) and explicit logical ordering (`event_seq`), yielding a stronger hash-chained evidentiary stream for forensic, compliance, and integration use. diff --git a/rfcs/0044-governance-organizational-controls.md b/rfcs/0044-governance-organizational-controls.md deleted file mode 100644 index 250a4bc..0000000 --- a/rfcs/0044-governance-organizational-controls.md +++ /dev/null @@ -1,236 +0,0 @@ -# RFC 0044 — Governance & Organizational Controls (v0.2) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/44 - ---- - -## 1. Summary - -Open CoT is a **cognitive control plane**. This RFC specifies **organizational governance**: how policies, permissions, and constraints cascade from platform defaults through organizations and teams to pipelines—the enterprise-readiness layer. Configs are hierarchical and **monotonic toward restriction** (children narrow, never broaden). Resolution walks the parent chain and merges so the strictest interpretation wins. This extends **RFC 0041** (policies) and **RFC 0042** (permissions); it binds them to scope and compliance metadata without redefining policy rules or ACL tuples. - ---- - -## 2. Scope - -**In scope:** layer model, config schema, merge semantics, resolution order, normative JSON Schema. **Out of scope:** identity wire formats (RFC 0026), policy rule internals (RFC 0041), permission matrices (RFC 0042), audit envelopes (RFC 0043), ethics catalogs (RFC 0045). **Consumers:** services that authorize tools, spend, and data before governed FSM transitions (RFC 0007). - ---- - -## 3. Relationship to prior RFCs - -RFC **0041** — `required_policies` hold **policy_id** values evaluated per 0041. RFC **0042** — `max_trust_level` caps trust; tools interact with grants. RFC **0026** — `scope_id` and parent links identify org, team, cognitive pipeline. RFC **0007** — governance SHOULD load during **receive** / pre-act. RFC **0045** — `compliance_requirements[].pii_policy` references a **constraint_id**. - ---- - -## 4. Governance layers and inheritance - -**Levels (wide → narrow):** `global` (platform defaults, e.g. block `shell` unless an approved exception path exists), `organization` (tenant posture, e.g. SOC2 + no DB writes), `team` (refinements, e.g. Engineering code tools under approval), `cognitive pipeline` (per-cognitive pipeline overrides; still bound by ancestors). - -**Parent chain:** `cognitive pipeline` → `team` → `organization` → `global`. Only `global` has `parent_governance_id: null`. Each non-global record MUST point to one parent at the immediate ancestor level. - -**Narrowing (normative):** `restricted_tools` — effective blocklist is **union** along the chain. `allowed_tools_override` — **intersection** of non-empty allowlists; empty array at a layer adds no intersection; children MUST NOT allow tools blocked above. `required_policies` — **union**. `max_trust_level` — order `untrusted < low < medium < high` as permitted ceiling; effective ceiling is the **minimum** (strictest); child ceiling MUST NOT exceed parent. `approval_workflows` — child entries only **tighten** control; default merge is **conjunctive** (all applicable workflows satisfied). Violations MUST fail validation with deterministic errors. - ---- - -## 5. Policy resolution - -For each governed request: (1) load the cognitive-pipeline-scoped governance record; (2) walk `parent_governance_id` through team, org, global; (3) merge per §4; (4) materialize the effective policy set for RFC 0041/0042; (5) emit in deterministic order (e.g. global→…→cognitive pipeline) for audit. Implementations SHOULD cache by `(requester_id, governance revision tuple)` and invalidate on change. - ---- - -## 6. Normative JSON Schema — Governance Config (v0.2) - -Field semantics: `governance_id` UUID for this document; `scope_level` / `scope_id` locate the record (`scope_id` null for `global`); `parent_governance_id` links upward; arrays gate tools and policies; `approval_workflows` and `compliance_requirements` structure human gates and standards; `effective_*` bound the revision; `metadata` is opaque. - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/governance_config/v0.2", - "title": "Open CoT RFC 0044 — Governance Config", - "type": "object", - "additionalProperties": false, - "properties": { - "version": { "type": "string", "enum": ["0.2"] }, - "governance_id": { "type": "string", "format": "uuid" }, - "scope_level": { "type": "string", "enum": ["global", "organization", "team", "pipeline"] }, - "scope_id": { "type": ["string", "null"] }, - "parent_governance_id": { "type": ["string", "null"] }, - "required_policies": { - "type": "array", - "items": { "type": "string", "minLength": 1 }, - "default": [] - }, - "restricted_tools": { - "type": "array", - "items": { "type": "string", "minLength": 1 }, - "default": [] - }, - "allowed_tools_override": { - "type": "array", - "items": { "type": "string", "minLength": 1 }, - "default": [] - }, - "max_trust_level": { - "type": "string", - "enum": ["untrusted", "low", "medium", "high"] - }, - "approval_workflows": { - "type": "array", - "items": { "$ref": "#/definitions/approvalWorkflow" }, - "default": [] - }, - "compliance_requirements": { - "type": "array", - "items": { "$ref": "#/definitions/complianceRequirement" }, - "default": [] - }, - "effective_from": { "type": "string", "format": "date-time" }, - "effective_until": { "type": ["string", "null"], "format": "date-time" }, - "metadata": { "type": "object", "additionalProperties": true } - }, - "required": [ - "version", - "governance_id", - "scope_level", - "scope_id", - "parent_governance_id", - "required_policies", - "restricted_tools", - "allowed_tools_override", - "max_trust_level", - "approval_workflows", - "compliance_requirements", - "effective_from", - "metadata" - ], - "definitions": { - "approvalWorkflow": { - "type": "object", - "additionalProperties": false, - "properties": { - "trigger": { "type": "string", "minLength": 1 }, - "approvers": { - "type": "array", - "items": { "type": "string", "minLength": 1 }, - "minItems": 1 - }, - "timeout_seconds": { "type": "integer", "minimum": 0 }, - "timeout_action": { "type": "string", "enum": ["deny", "escalate_parent"] } - }, - "required": ["trigger", "approvers", "timeout_seconds", "timeout_action"] - }, - "complianceRequirement": { - "type": "object", - "additionalProperties": false, - "properties": { - "standard": { "type": "string", "minLength": 1 }, - "audit_retention_days": { "type": "integer", "minimum": 0 }, - "pii_policy": { "type": "string", "minLength": 1 } - }, - "required": ["standard", "audit_retention_days", "pii_policy"] - } - } -} -``` - - ---- - -## 7. Examples - -### 7.1 Organization — Acme Corp - -Restricts shell and raw SQL writes, requires audit/residency policies, SOC2 compliance with retention and PII **constraint_id**, `max_trust_level` medium, high-risk tool approval. - -```json -{ - "version": "0.2", - "governance_id": "a1b2c3d4-e5f6-4789-a012-3456789abcde", - "scope_level": "organization", - "scope_id": "org_acme_01", - "parent_governance_id": "00000000-0000-4000-8000-000000000001", - "required_policies": ["policy_acme_audit_all", "policy_acme_no_shell", "policy_acme_data_residency_us"], - "restricted_tools": ["shell", "raw_sql_write"], - "allowed_tools_override": [], - "max_trust_level": "medium", - "approval_workflows": [ - { - "trigger": "high_risk_tool", - "approvers": ["role:security_oncall", "group:acme_infosec"], - "timeout_seconds": 3600, - "timeout_action": "deny" - } - ], - "compliance_requirements": [ - { - "standard": "SOC2", - "audit_retention_days": 2555, - "pii_policy": "constraint_acme_pii_handling_v3" - } - ], - "effective_from": "2026-04-01T00:00:00Z", - "effective_until": null, - "metadata": { "display_name": "Acme Corp" } -} -``` - -### 7.2 Team — Engineering - -Inherits org parent `a1b2c3d4-…`; adds code/repo tools via allowlist (still cannot bypass org `shell` block), stricter `max_trust_level` `low`, extra policy, budget approval with `escalate_parent`. - -```json -{ - "version": "0.2", - "governance_id": "b2c3d4e5-f6a7-4890-b123-456789abcdef", - "scope_level": "team", - "scope_id": "team_acme_engineering", - "parent_governance_id": "a1b2c3d4-e5f6-4789-a012-3456789abcde", - "required_policies": ["policy_eng_code_review_bot"], - "restricted_tools": [], - "allowed_tools_override": ["read_repo", "code_execute", "linter_fix"], - "max_trust_level": "low", - "approval_workflows": [ - { - "trigger": "budget_above_threshold", - "approvers": ["role:eng_manager"], - "timeout_seconds": 86400, - "timeout_action": "escalate_parent" - } - ], - "compliance_requirements": [], - "effective_from": "2026-04-10T00:00:00Z", - "effective_until": null, - "metadata": { "display_name": "Engineering" } -} -``` - ---- - -## 8. Cross-references - -**RFC 0007** — Governed FSM; governance during receive state. **RFC 0041** — Policy enforcement; `required_policies`. **RFC 0042** — Permissions; trust capped by `max_trust_level`. **RFC 0026** — Cognitive pipeline identity; `scope_id`. **RFC 0045** — Ethics; `pii_policy` → **constraint_id**. - ---- - -## 9. Open questions resolution - -| Topic | Resolution (v0.2) | -| --- | --- | -| All-empty `allowed_tools_override` | No intersection contributed; effective tool semantics defer to RFC 0042 unless a non-empty allowlist appears. | -| Duplicate workflow triggers | Satisfy all matches conjunctively unless dedup keys are specified later. | -| `global` identity | `scope_id` null; platform MAY use a well-known root `governance_id`. | -| Schema versioning | `version: "0.2"` aligns with **Schema v0.7** train. | - ---- - -## 10. Acceptance criteria - -1. Validators MUST reject configs that violate §4 (e.g. child trust ceiling above parent, allowlist listing an ancestor-blocked tool). -2. Two implementations with the same chain MUST yield identical merged `restricted_tools`, `required_policies`, and effective trust ceiling. -3. Parent walks MUST detect cycles and **fail closed** (deny or last-known-good). -4. §7 examples MUST validate against §6 when UUID graph checks are skipped. diff --git a/rfcs/0045-ethics-risk-constraints-cognitive-runtimes.md b/rfcs/0045-ethics-risk-constraints-cognitive-runtimes.md deleted file mode 100644 index 742059a..0000000 --- a/rfcs/0045-ethics-risk-constraints-cognitive-runtimes.md +++ /dev/null @@ -1,117 +0,0 @@ -# RFC 0045 — Ethical & Risk Constraints for Reasoning Pipelines (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Schema v0.7 -**Discussion:** https://github.com/supernovae/open-cot/discussions/45 ---- - -## 1. Summary - -This RFC defines ethical and risk constraints for reasoning pipelines, with explicit privacy and safety controls for open reasoning traces. - -It extends: - -- RFC 0041 — Policy Enforcement Schema -- RFC 0043 — Auditing & Compliance Logs -- RFC 0035 — Data Provenance Tracking - ---- - -## 2. Risk categories - -- safety -- privacy -- fairness -- compliance -- operational - ---- - -## 3. Privacy and redaction policy - -### 3.1 Sensitive classes - -- direct identifiers (names, emails, phones, addresses) -- credentials/secrets -- regulated personal attributes -- proprietary/confidential customer content - -### 3.2 Redaction actions - -- `drop`: remove field entirely -- `mask`: partially obfuscate value -- `hash`: one-way hash for linkage without plaintext -- `encrypt_ref`: store encrypted value out-of-band and reference key - -### 3.3 Retention policy - -- Retention horizon must be declared per dataset/run. -- Public releases must not include raw direct identifiers. - ---- - -## 4. Full Schema (JSON) - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0045 — Ethical and Risk Constraints", - "type": "object", - "properties": { - "version": { "type": "string", "enum": ["0.1"] }, - "constraint_id": { "type": "string" }, - "risk_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "risk": { "type": "string", "enum": ["safety", "privacy", "fairness", "compliance", "operational"] }, - "max_level": { "type": "string", "enum": ["low", "medium", "high"] }, - "action_on_violation": { "type": "string", "enum": ["block", "review", "log_only"] } - }, - "required": ["risk", "max_level", "action_on_violation"] - } - }, - "privacy_policy": { - "type": "object", - "properties": { - "redaction_actions": { - "type": "array", - "items": { "type": "string", "enum": ["drop", "mask", "hash", "encrypt_ref"] } - }, - "retention_days": { "type": "integer", "minimum": 0 }, - "public_release_allows_pii": { "type": "boolean" } - }, - "required": ["redaction_actions", "retention_days", "public_release_allows_pii"] - } - }, - "required": ["version", "constraint_id", "risk_rules", "privacy_policy"] -} -``` - ---- - -## 5. Example - -```json -{ - "version": "0.1", - "constraint_id": "risk_low_public_release", - "risk_rules": [ - { "risk": "privacy", "max_level": "low", "action_on_violation": "block" }, - { "risk": "safety", "max_level": "medium", "action_on_violation": "review" } - ], - "privacy_policy": { - "redaction_actions": ["drop", "hash"], - "retention_days": 30, - "public_release_allows_pii": false - } -} -``` - ---- - -## 6. Conclusion - -RFC 0045 defines actionable ethical and privacy constraints so Open CoT artifacts can be shared safely while preserving utility for OSS model development. diff --git a/rfcs/0046-conformance-interoperability-protocol.md b/rfcs/0046-conformance-interoperability-protocol.md deleted file mode 100644 index cc1ba4f..0000000 --- a/rfcs/0046-conformance-interoperability-protocol.md +++ /dev/null @@ -1,53 +0,0 @@ -# RFC 0046 — Conformance & Interoperability Protocol (v0.1) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-14 -**Target Version:** Process v0.1 -**Discussion:** https://github.com/supernovae/open-cot/discussions/46 ---- - -## 1. Summary - -This RFC defines how Open CoT implementations prove compatibility claims with executable conformance checks. - -It aligns with: - -- Profile A: RFC 0001 -- Profile B: RFC 0001 + RFC 0002 + RFC 0003 -- Profile C: Profile B + RFC 0008 package checks - ---- - -## 2. Required conformance artifacts - -Each implementation claiming compatibility must publish: - -- fixture inputs and expected outputs -- schema validation report -- round-trip conversion report (if converters are used) -- implementation/version metadata - ---- - -## 3. Test classes - -- **schema tests**: all required artifacts validate against declared schemas -- **linkage tests**: sidecar IDs resolve to trace IDs -- **round-trip tests**: conversion in/out preserves required fields -- **profile tests**: profile-specific mandatory checks - ---- - -## 4. Claim semantics - -- `profile_a_passed` -- `profile_b_passed` -- `profile_c_passed` - -A claim is valid only if all mandatory tests for that profile pass in CI and are reproducible from published fixtures. - ---- - -## 5. Conclusion - -RFC 0046 provides an interoperability contract so compatibility claims in the Open CoT ecosystem are tested, not implied. diff --git a/rfcs/0047-delegation-extension.md b/rfcs/0047-delegation-extension.md deleted file mode 100644 index 4888e40..0000000 --- a/rfcs/0047-delegation-extension.md +++ /dev/null @@ -1,320 +0,0 @@ -# RFC 0047 — Delegation Extension (v0.2) -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-18 -**Target Version:** Schema v0.8 -**Discussion:** https://github.com/supernovae/open-cot/discussions/47 ---- - -## 1. Summary - -Open CoT is a **cognitive control plane**: the model proposes; the harness, policy engine, and authorized brokers **reconcile**. **Delegation** is the formal process by which a model requests authority to act, and the harness evaluates that request—granting, denying, narrowing, or escalating—before any side-effecting tool runs. - -The governing insight of this extension is strict and non-negotiable: **the model does not authorize itself.** Typed schema objects represent every step of the authority flow so traces are replayable, policies consultable, and tool dispatch provably bound to a grant chain. - -This RFC defines three JSON objects: - -1. **`delegation_request`** — intent and scope proposed (in part) by the model; harness binds identity, run context, and provenance. -2. **`delegation_decision`** — harness/policy-only outcome linked to the request. -3. **`authority_receipt`** — tamper-evident grant artifact produced by an auth broker after approval, consumed at tool execution. - -**Cross-references:** [RFC 0007 — Cognitive Pipeline / FSM](0007-cognitive-pipeline-protocol.md) (states `request_authority`, `validate_authority`, `delegate_narrow`, `execute_tool`); [RFC 0026 — Cognitive pipeline Identity](0026-requester-identity-auth.md) (`requester` MUST be a verified `requester_id`); [RFC 0041 — Policy](0041-policy-enforcement-schema.md) (rules consulted → `policy_refs`); [RFC 0042 — Permissions](0042-permission-acl.md) (`permission_id` references stored grants); [RFC 0048 — Execution receipts](0048-execution-receipts-audit-envelopes.md) (tool receipts SHOULD reference `authority_receipt` or standing grant). - ---- - -## 2. Trust boundary - -| Zone | Who writes | Guarantees | -|------|------------|--------------| -| Model-adjacent | Model output supplies **intent**, **justification**, **requested_scope** preferences, TTL/audience **preferences**, and **task_context_ref** only. | Untrusted text and structure proposals. | -| Harness | Fills `request_id`, `requester`, `run_id`, `observed_at`, `provenance`; merges model fields after validation. | `requester` MUST match verified identity ([RFC 0026](0026-requester-identity-auth.md)). | -| Policy | Emits **`delegation_decision`** exclusively. | Model MUST NOT emit or alter decisions. | -| Auth broker | Emits **`authority_receipt`**; computes **integrity** over all other receipt fields. | Receipt is **tamper-evident**; executors verify hash (and signature when configured) before dispatch. | - ---- - -## 3. Object definitions - -### 3.1 `delegation_request` - -**Model-provided (merged by harness):** `intent`, `justification`, `requested_scope`, `preferred_ttl_seconds`, `preferred_audience`, `task_context_ref`. - -**Harness-provided:** `request_id`, `requester` (verified `requester_id`), `run_id`, `observed_at`, `provenance` (`trace_step_id`, `plan_version`). - -**Required fields:** `request_id`, `requester`, `run_id`, `requested_scope`, `observed_at`. - -`requested_scope` is an object with: - -- `resource` — logical resource identifier (e.g. `mailbox:user@example.com`). -- `action` — verb or capability token (e.g. `email.read`). -- `constraints` — optional object (column allowlists, row limits, folder IDs, etc.). - -### 3.2 `delegation_decision` - -All fields are **harness/policy-provided**. The model does not participate in authoring decisions. - -| Field | Notes | -|-------|--------| -| `decision_id` | Unique id for this decision record. | -| `request_id` | Foreign key to `delegation_request`. | -| `status` | `approved` \| `denied` \| `narrowed` \| `escalated`. | -| `decided_by` | Who/what decided: policy id, human approver id, or literal `harness`. | -| `policy_refs` | Array of policy rule or evaluation ids consulted. | -| `narrowed_scope` | Present when `status` is `narrowed` (or when approved but scope reduced—see §7). | -| `denial_reason` | Present when `status` is `denied`. | -| `escalation_target` | Present when `status` is `escalated` (queue, role, ticket system ref). | -| `decided_at` | RFC 3339 decision time. | - -### 3.3 `authority_receipt` - -Produced by the **auth broker** after a favorable decision path. Binds `permission_id` to **granted_scope** (MAY be narrower than requested), temporal bounds, audience, forwarding rules, and **integrity** (`content_hash` over every other receipt field per broker-documented canonical order; optional `signature` / `signing_key_id` for non-repudiation). - ---- - -## 4. Lifecycle (FSM mapping) - -The following aligns with the governed execution FSM in [RFC 0007](0007-cognitive-pipeline-protocol.md): - -1. **`plan`** — Model proposes actions and capability annotations; no tools. -2. **`request_authority`** — Harness materializes a **`delegation_request`** (model content validated and normalized; harness fields authoritative). -3. **`validate_authority`** — Policy engine evaluates the request and emits **`delegation_decision`**. -4. **`delegate_narrow`** — Auth broker issues **`authority_receipt`** with `granted_scope ≤` effective allowed scope (set-theoretic or lattice comparison per deployment). -5. **`execute_tool`** — Tool executor accepts dispatch only with valid receipt (or documented standing grant shortcut per RFC 0007 §10.1). [RFC 0048](0048-execution-receipts-audit-envelopes.md) SHOULD cite the `receipt_id`. - -Standing authorization (`plan` → `execute_tool` shortcut) bypasses this chain only where policy explicitly allows; the execution receipt still MUST cite how obligation was satisfied. - ---- - -## 5. Token exchange mapping (OAuth2 / Keycloak mental model) - -Implementers integrating with OAuth2-style systems MAY map fields as follows. This is **informative**, not a mandate to use OAuth2 wire formats inside the trace. - -| Open CoT field | OAuth2 / Keycloak analogue | -|----------------|----------------------------| -| `requested_scope` | OAuth2 **scope** string or structured scope request in token exchange. | -| `narrowed_scope` / `granted_scope` | **Reduced scope** in token exchange or RAR-style authorization response. | -| `permission_id` | **Access token** (or token id / session id referencing server-side grant). | -| `expires_at` | JWT **`exp`** claim or token lifetime end. | -| `audience` | **`aud`** claim — intended resource server(s). | -| `forwardable` | Whether a **token exchange** (RFC 8693) onward delegation is permitted (`true` ≈ exchange allowed to downstream clients). | - -`one_shot` maps to single-use exchange or one-time redemption flags where the STS supports them. - ---- - -## 6. Full schema (JSON Schema) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0047/delegation-extension-v0.2.json", - "title": "Open CoT RFC 0047 — Delegation Extension", - "type": "object", - "additionalProperties": false, - "$defs": { - "scope": { - "type": "object", - "additionalProperties": false, - "properties": { - "resource": { "type": "string", "minLength": 1 }, - "action": { "type": "string", "minLength": 1 }, - "constraints": { "type": "object" } - }, - "required": ["resource", "action"] - }, - "provenance": { - "type": "object", - "additionalProperties": false, - "properties": { - "trace_step_id": { "type": "string" }, - "plan_version": { "type": "integer", "minimum": 0 } - } - }, - "delegation_request": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.2"] }, - "request_id": { "type": "string", "minLength": 1 }, - "requester": { "type": "string", "minLength": 1 }, - "run_id": { "type": "string", "minLength": 1 }, - "observed_at": { "type": "string", "format": "date-time" }, - "intent": { "type": "string" }, - "justification": { "type": "string" }, - "requested_scope": { "$ref": "#/$defs/scope" }, - "preferred_ttl_seconds": { "type": "integer", "minimum": 1 }, - "preferred_audience": { "type": "string", "minLength": 1 }, - "task_context_ref": { "type": "string" }, - "provenance": { "$ref": "#/$defs/provenance" } - }, - "required": ["schema_version", "request_id", "requester", "run_id", "requested_scope", "observed_at"] - }, - "delegation_decision": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.2"] }, - "decision_id": { "type": "string", "minLength": 1 }, - "request_id": { "type": "string", "minLength": 1 }, - "status": { - "type": "string", - "enum": ["approved", "denied", "narrowed", "escalated"] - }, - "decided_by": { - "type": "object", - "additionalProperties": false, - "properties": { - "kind": { "type": "string", "enum": ["policy", "human", "harness"] }, - "policy_id": { "type": "string" }, - "human_approver": { "type": "string" } - }, - "required": ["kind"] - }, - "policy_refs": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "narrowed_scope": { "$ref": "#/$defs/scope" }, - "denial_reason": { "type": "string" }, - "escalation_target": { "type": "string" }, - "decided_at": { "type": "string", "format": "date-time" } - }, - "required": ["schema_version", "decision_id", "request_id", "status", "decided_by", "policy_refs", "decided_at"] - }, - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { "type": "string", "minLength": 1 }, - "content_hash": { "type": "string", "minLength": 1 }, - "signature": { "type": "string" }, - "signing_key_id": { "type": "string" } - }, - "required": ["hash_algorithm", "content_hash"] - }, - "authority_receipt": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.2"] }, - "receipt_id": { "type": "string", "minLength": 1 }, - "decision_id": { "type": "string", "minLength": 1 }, - "request_id": { "type": "string", "minLength": 1 }, - "permission_id": { "type": "string", "minLength": 1 }, - "granted_scope": { "$ref": "#/$defs/scope" }, - "effective_at": { "type": "string", "format": "date-time" }, - "expires_at": { "type": "string", "format": "date-time" }, - "one_shot": { "type": "boolean" }, - "forwardable": { "type": "boolean" }, - "audience": { "type": "string", "minLength": 1 }, - "integrity": { "$ref": "#/$defs/integrity" } - }, - "required": ["schema_version", "receipt_id", "decision_id", "request_id", "permission_id", "granted_scope", "effective_at", "expires_at", "one_shot", "forwardable", "audience", "integrity"] - } - }, - "properties": { - "delegation_request": { "$ref": "#/$defs/delegation_request" }, - "delegation_decision": { "$ref": "#/$defs/delegation_decision" }, - "authority_receipt": { "$ref": "#/$defs/authority_receipt" } - } -} -``` - - ---- - -## 7. Worked example — email read narrowed to headers only - -The model asks to read full messages; policy narrows to **headers only**; broker mints a receipt the mail adapter will enforce. - -**`delegation_request`** - -```json -{ - "schema_version": "0.2", - "request_id": "dr_email_9f3a", - "requester": "cognitive-pipeline:org/acme/exec-worker-07", - "run_id": "run_20260418_0412", - "observed_at": "2026-04-18T04:12:01Z", - "intent": "Summarize unread customer threads for Q2 report", - "justification": "User approved inbox analysis task in session ctx-88", - "requested_scope": { - "resource": "mailbox:support@acme.example", - "action": "email.read", - "constraints": { "folders": ["INBOX"], "max_messages": 50 } - }, - "preferred_ttl_seconds": 900, - "preferred_audience": "api://mail.acme.internal", - "task_context_ref": "ctx://sessions/88/plan_step_4", - "provenance": { "trace_step_id": "ts_4412", "plan_version": 12 } -} -``` - -**`delegation_decision`** (`narrowed`) - -```json -{ - "schema_version": "0.2", - "decision_id": "dd_email_9f3a_01", - "request_id": "dr_email_9f3a", - "status": "narrowed", - "decided_by": { "kind": "policy", "policy_id": "pol_mail_default_v3" }, - "policy_refs": ["rule:mail.no_body_for_delegated", "rule:mail.headers_only_low_trust"], - "narrowed_scope": { - "resource": "mailbox:support@acme.example", - "action": "email.read_headers", - "constraints": { "folders": ["INBOX"], "max_messages": 50, "strip": ["body", "attachments"] } - }, - "decided_at": "2026-04-18T04:12:01Z" -} -``` - -**`authority_receipt`** - -```json -{ - "schema_version": "0.2", - "receipt_id": "ar_email_9f3a_01", - "decision_id": "dd_email_9f3a_01", - "request_id": "dr_email_9f3a", - "permission_id": "perm_mail_hdr_7c21", - "granted_scope": { - "resource": "mailbox:support@acme.example", - "action": "email.read_headers", - "constraints": { "folders": ["INBOX"], "max_messages": 50, "strip": ["body", "attachments"] } - }, - "effective_at": "2026-04-18T04:12:02Z", - "expires_at": "2026-04-18T04:27:02Z", - "one_shot": false, - "forwardable": false, - "audience": "api://mail.acme.internal", - "integrity": { - "hash_algorithm": "sha256", - "content_hash": "sha256:canonical_payload_hex_omitted_for_brevity" - } -} -``` - ---- - -## 8. Open questions — resolution - -| Question | Resolution | -|----------|------------| -| May `status: approved` still carry a `narrowed_scope`? | **Discouraged.** Prefer `narrowed` whenever scope differs from the request; brokers MUST emit `granted_scope ⊆ requested_scope` either way. | -| Are model-originated JSON blobs for requests trusted? | **No.** Harness re-serializes after validation; `requester` and ids are never taken from model output. | -| Single receipt for batched tools? | **Implementation choice.** Each dispatch SHOULD reference a receipt whose `granted_scope` covers that call; batching multiple tools under one receipt requires explicit policy support. | - ---- - -## 9. Acceptance criteria - -1. For every tool side effect outside standing grants, the trace contains **`delegation_request`** → **`delegation_decision`** → **`authority_receipt`** in causal order with matching ids. -2. **`delegation_decision`** objects in audited stores MUST NOT be creatable or editable via model-facing APIs. -3. **`authority_receipt.integrity.content_hash`** MUST be verified before `execute_tool` dispatch; mismatch aborts execution and logs a security event. -4. `requester` MUST equal a registered [RFC 0026](0026-requester-identity-auth.md) `requester_id` vetted for the run. -5. [RFC 0048](0048-execution-receipts-audit-envelopes.md) tool execution records SHOULD include `receipt_id` (or standing-grant citation per RFC 0007); OAuth2 mappings in §5 are **optional**—native Open CoT objects are normative. - ---- - -## 10. Conclusion - -RFC 0047 v0.2 formalizes **delegation as data** with canonical temporal semantics (`observed_at`, `decided_at`, `effective_at`/`expires_at`): requests capture intent, decisions capture policy outcomes, and receipts capture brokered grants with tamper-evident integrity. diff --git a/rfcs/0048-execution-receipts-audit-envelopes.md b/rfcs/0048-execution-receipts-audit-envelopes.md deleted file mode 100644 index 9c4aeaa..0000000 --- a/rfcs/0048-execution-receipts-audit-envelopes.md +++ /dev/null @@ -1,284 +0,0 @@ -# RFC 0048 — Execution Receipts & Audit Envelopes (v0.2) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-18 -**Target Version:** Schema v0.8 -**Discussion:** https://github.com/supernovae/open-cot/discussions/48 - -## 1. Summary - -Open-CoT is a cognitive control plane. **Execution receipts** are tamper-evident records that prove what happened during governed cognitive pipeline execution, linking each tool call to the authorizing permission, policy path, and delegation context. **Audit envelopes** seal a full run: trace hash, artifact IDs, summaries, final budget (RFC 0038), and optional signatures. Receipts are per tool call; envelopes are emitted once per run in `audit_seal`. Neither object carries raw tool I/O—only **SHA-256** hashes of canonical serialized payloads—so artifacts can be shared for compliance without exposing secrets. Integrity blocks mirror RFC 0035. This RFC normatively defines `tool_execution_receipt` and `audit_envelope` for Schema v0.8. - -## 2. `tool_execution_receipt` - -Produced by the tool executor after every tool call. Fields: `execution_id` (uuid), `run_id`, `tool_name`, `permission_id` (RFC 0042), `authority_receipt_id` (RFC 0047), `input_hash` / `output_hash` (SHA-256 hex of canonical serialized I/O, not raw bytes), `output_size_bytes`, `started_at` / `completed_at` (ISO 8601), `duration_ms`, `status` ∈ {`success`,`error`,`timeout`,`quarantined`}, optional `error_category` ∈ {`timeout`,`invalid_input`,`not_found`,`permission_denied`,`rate_limit`,`internal_error`} (RFC 0018), `postcondition_check` ∈ {`passed`,`failed`,`skipped`}, optional `postcondition_violation`, `sandbox_state_hash`, `integrity`: `{ hash_algorithm: "sha256", content_hash }` where `content_hash` covers the full object **excluding** `integrity`. - -## 3. `audit_envelope` - -Sealed summary of a governed run (RFC 0043 introduces auditing; this RFC specifies the envelope schema and lifecycle). Fields: `envelope_id` (uuid), `run_id`, `requester_id`, `task_hash`, `started_at`, `completed_at`, `completion_status` ∈ {`succeeded`,`failed`,`denied`,`budget_exhausted`,`external_stop`,`escalation_timeout`,`fail_safe`}, `trace_hash`, `delegation_requests` / `delegation_decisions` (string IDs), `authority_receipts` / `tool_execution_receipts` (ID arrays), `delegation_summary` (`total_requested`, `total_granted`, `total_denied`, `total_narrowed`, `total_escalated`), `permission_summary` (`total_granted`, `total_consumed`, `total_expired`, `total_revoked`), `budget_final` (RFC 0038 `BudgetSnapshot`), `policy_violations` (`violation_id`, `policy_id`, `rule_id`, `description`, `severity`, `observed_at`), `integrity` (`hash_algorithm`, `content_hash`, optional `signature`, `signing_key_id`). `content_hash` covers all fields **except** `integrity`. - -## 4. JSON Schema — receipt and envelope bundle (normative) - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/v0.9/execution-receipts-audit-envelopes.json", - "title": "Open CoT RFC 0048 — execution receipts and audit envelopes", - "type": "object", - "oneOf": [ - { "$ref": "#/$defs/tool_execution_receipt" }, - { "$ref": "#/$defs/audit_envelope" } - ], - "$defs": { - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { "type": "string", "const": "sha256" }, - "content_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "signature": { "type": "string" }, - "signing_key_id": { "type": "string" } - }, - "required": ["hash_algorithm", "content_hash"] - }, - "budget_snapshot_rfc0038": { - "type": "object", - "additionalProperties": false, - "properties": { - "tokens_used": { "type": "integer", "minimum": 0 }, - "tokens_remaining": { "type": "integer" }, - "cost_used": { "type": "number", "minimum": 0 }, - "cost_remaining": { "type": "number" }, - "steps_used": { "type": "integer", "minimum": 0 }, - "steps_remaining": { "type": "integer" }, - "tool_calls_used": { "type": "integer", "minimum": 0 }, - "tool_calls_remaining": { "type": "integer" }, - "retries_used": { "type": "integer", "minimum": 0 }, - "retries_remaining": { "type": "integer" } - }, - "required": ["tokens_used", "tokens_remaining", "cost_used", "cost_remaining", "steps_used", "steps_remaining", "tool_calls_used", "tool_calls_remaining", "retries_used", "retries_remaining"] - }, - "policy_violation_entry": { - "type": "object", "additionalProperties": false, - "properties": { - "violation_id": { "type": "string", "minLength": 1 }, - "policy_id": { "type": "string", "minLength": 1 }, - "rule_id": { "type": "string", "minLength": 1 }, - "description": { "type": "string" }, - "severity": { "type": "string", "enum": ["info", "low", "medium", "high", "critical"] }, - "observed_at": { "type": "string", "format": "date-time" } - }, - "required": ["violation_id", "policy_id", "rule_id", "description", "severity", "observed_at"] - }, - "tool_execution_receipt": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.2"] }, - "execution_id": { "type": "string", "format": "uuid" }, - "run_id": { "type": "string", "minLength": 1 }, - "tool_name": { "type": "string", "minLength": 1 }, - "permission_id": { "type": "string", "minLength": 1 }, - "authority_receipt_id": { "type": "string", "minLength": 1 }, - "input_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "output_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "output_size_bytes": { "type": "integer", "minimum": 0 }, - "started_at": { "type": "string", "format": "date-time" }, - "completed_at": { "type": "string", "format": "date-time" }, - "duration_ms": { "type": "integer", "minimum": 0 }, - "status": { "type": "string", "enum": ["success", "error", "timeout", "quarantined"] }, - "error_category": { "type": "string", "enum": ["timeout", "invalid_input", "not_found", "permission_denied", "rate_limit", "internal_error"] }, - "postcondition_check": { "type": "string", "enum": ["passed", "failed", "skipped"] }, - "postcondition_violation": { "type": "string" }, - "sandbox_state_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "integrity": { "$ref": "#/$defs/integrity" } - }, - "required": ["schema_version", "execution_id", "run_id", "tool_name", "permission_id", "authority_receipt_id", "input_hash", "output_hash", "output_size_bytes", "started_at", "completed_at", "duration_ms", "status", "postcondition_check", "sandbox_state_hash", "integrity"] - }, - "audit_envelope": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { "type": "string", "enum": ["0.2"] }, - "envelope_id": { "type": "string", "format": "uuid" }, - "run_id": { "type": "string", "minLength": 1 }, - "requester_id": { "type": "string", "minLength": 1 }, - "task_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "started_at": { "type": "string", "format": "date-time" }, - "completed_at": { "type": "string", "format": "date-time" }, - "completion_status": { "type": "string", "enum": ["succeeded", "failed", "denied", "budget_exhausted", "external_stop", "escalation_timeout", "fail_safe"] }, - "trace_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, - "delegation_requests": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "delegation_decisions": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "authority_receipts": { "type": "array", "items": { "type": "string", "minLength": 1 } }, - "tool_execution_receipts": { "type": "array", "items": { "type": "string", "format": "uuid" } }, - "delegation_summary": { - "type": "object", "additionalProperties": false, - "properties": { - "total_requested": { "type": "integer", "minimum": 0 }, "total_granted": { "type": "integer", "minimum": 0 }, - "total_denied": { "type": "integer", "minimum": 0 }, "total_narrowed": { "type": "integer", "minimum": 0 }, - "total_escalated": { "type": "integer", "minimum": 0 } - }, - "required": ["total_requested", "total_granted", "total_denied", "total_narrowed", "total_escalated"] - }, - "permission_summary": { - "type": "object", "additionalProperties": false, - "properties": { - "total_granted": { "type": "integer", "minimum": 0 }, "total_consumed": { "type": "integer", "minimum": 0 }, - "total_expired": { "type": "integer", "minimum": 0 }, "total_revoked": { "type": "integer", "minimum": 0 } - }, - "required": ["total_granted", "total_consumed", "total_expired", "total_revoked"] - }, - "budget_final": { "$ref": "#/$defs/budget_snapshot_rfc0038" }, - "policy_violations": { "type": "array", "items": { "$ref": "#/$defs/policy_violation_entry" } }, - "integrity": { "$ref": "#/$defs/integrity" } - }, - "required": ["schema_version", "envelope_id", "run_id", "requester_id", "task_hash", "started_at", "completed_at", "completion_status", "trace_hash", "delegation_requests", "delegation_decisions", "authority_receipts", "tool_execution_receipts", "delegation_summary", "permission_summary", "budget_final", "policy_violations", "integrity"] - } - } -} -``` - - -## 6. Lifecycle — Tool Execution Receipt - -1. Tool executor receives tool call request and AuthorityReceipt. -2. Executor validates permission is active and not expired. -3. Executor hashes canonical serialized input → `input_hash`. -4. Tool runs. -5. Executor hashes output → `output_hash`, records size, evaluates postconditions. -6. Receipt is produced and appended to the run’s receipt list; `integrity.content_hash` set. -7. If permission is one-shot, it is marked consumed. - -## 7. Lifecycle — Audit Envelope - -1. Harness enters `audit_seal` FSM state (RFC 0007). -2. All outstanding permissions are verified revoked or consumed. -3. Trace is serialized and hashed → `trace_hash`. -4. Delegation requests/decisions and authority/tool receipts are collected by ID. -5. Summaries and `budget_final` are computed. -6. `integrity.content_hash` is computed over the envelope excluding `integrity`. -7. Optionally, signature is applied using harness signing key (`signature`, `signing_key_id`). -8. Envelope is sealed and immutable. - -## 8. Integrity Verification - -1. Recompute envelope `content_hash` over all fields except `integrity`; compare to stored `content_hash`. -2. If `signature` is present, verify with the public key for `signing_key_id`. -3. For each `tool_execution_receipt` referenced, verify that receipt’s `content_hash` (body minus `integrity`). -4. For each `authority_receipt` referenced, verify its content hash (RFC 0047). -5. Verify `trace_hash` matches SHA-256 of the actual canonical trace. -Any mismatch ⇒ **INVALID** and must be flagged. - -## 9. Examples - -Synthetic 64-char lowercase hex stands in for real SHA-256; conforming `content_hash` values must be recomputed over the canonical payload. - -### 9.1 `tool_execution_receipt` — successful `web_search` - -```json -{ - "schema_version": "0.2", - "execution_id": "a1b2c3d4-e5f6-47a8-9c0d-1e2f3a4b5c6d", - "run_id": "run_20260418_01", - "tool_name": "web_search", - "permission_id": "perm_search_7f91", - "authority_receipt_id": "authrecv_4821", - "input_hash": "2c624232cdd2217b51a00c8949614d17ae3e530c702e9e2fe63c55fe47d65b1e", - "output_hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9", - "output_size_bytes": 2048, - "started_at": "2026-04-18T12:00:01.120Z", - "completed_at": "2026-04-18T12:00:01.890Z", - "duration_ms": 770, - "status": "success", - "postcondition_check": "passed", - "sandbox_state_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "integrity": { "hash_algorithm": "sha256", "content_hash": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" } -} -``` - -### 9.2 `tool_execution_receipt` — quarantined (postcondition violation) - -```json -{ - "schema_version": "0.2", - "execution_id": "f6e5d4c3-b2a1-4098-8765-43210fedcba9", - "run_id": "run_20260418_02", - "tool_name": "filesystem_read", - "permission_id": "perm_fs_read_aabb", - "authority_receipt_id": "authrecv_ccdd", - "input_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "output_hash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", - "output_size_bytes": 512, - "started_at": "2026-04-18T12:05:00.000Z", - "completed_at": "2026-04-18T12:05:00.400Z", - "duration_ms": 400, - "status": "quarantined", - "postcondition_check": "failed", - "postcondition_violation": "Output path escaped allowed sandbox root", - "sandbox_state_hash": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", - "integrity": { "hash_algorithm": "sha256", "content_hash": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" } -} -``` - -### 9.3 `audit_envelope` — two tool calls, one narrowed grant, success - -```json -{ - "schema_version": "0.2", - "envelope_id": "11111111-2222-4333-8444-555555555555", - "run_id": "run_20260418_03", - "requester_id": "planner-alpha", - "task_hash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", - "started_at": "2026-04-18T11:59:00.000Z", - "completed_at": "2026-04-18T12:10:00.000Z", - "completion_status": "succeeded", - "trace_hash": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "delegation_requests": ["dreq_01"], - "delegation_decisions": ["ddec_01"], - "authority_receipts": ["authrecv_99"], - "tool_execution_receipts": ["aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa", "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb"], - "delegation_summary": { "total_requested": 1, "total_granted": 1, "total_denied": 0, "total_narrowed": 1, "total_escalated": 0 }, - "permission_summary": { "total_granted": 2, "total_consumed": 2, "total_expired": 0, "total_revoked": 0 }, - "budget_final": { - "tokens_used": 4200, "tokens_remaining": 800, "cost_used": 0.04, "cost_remaining": 0.06, - "steps_used": 6, "steps_remaining": 14, "tool_calls_used": 2, "tool_calls_remaining": 8, - "retries_used": 0, "retries_remaining": 5 - }, - "policy_violations": [], - "integrity": { "hash_algorithm": "sha256", "content_hash": "0000000000000000000000000000000000000000000000000000000000000000" } -} -``` - -## 10. Cross-references - -- **RFC 0007** — Governed FSM: `execute_tool` produces receipts; `audit_seal` produces the envelope. -- **RFC 0035** — Provenance: shared integrity model. -- **RFC 0038** — Budget: `budget_final` / `BudgetSnapshot`. -- **RFC 0042** — Permissions: `permission_id` on receipts. -- **RFC 0043** — Auditing: events reference receipts; envelope is run-level artifact. -- **RFC 0047** — Delegation: `authority_receipt_id` links delegation to execution. -- **RFC 0018** — Tool errors: `error_category` subset. - -## 11. Open Questions & Resolution - -| # | Question | v0.2 stance | -|---|----------|-------------| -| A | Canonical serialization for hashed payloads? | Document and version per harness; future RFC MAY mandate JCS. | -| B | Mandatory signature algorithm? | Signatures optional; algorithm tied to `signing_key_id` registry. | -| C | Seal with active permissions? | Default **fail closed** unless a later RFC defines degraded sealing. | -| D | `quarantined` vs `postcondition_check`? | Prefer `failed` when postconditions caused quarantine; policy-only quarantine MAY use `skipped`. | - -## 12. Acceptance Criteria - -- [ ] The bundled schema validates both `tool_execution_receipt` and `audit_envelope` instances (examples need real computed `content_hash` values). -- [ ] Harness emits one receipt per governed tool execution and one sealed envelope per terminal run. -- [ ] Verifiers mark **INVALID** on hash or signature mismatch. -- [ ] No raw tool I/O in receipts or envelopes. -- [ ] RFC 0043 / RFC 0047 cross-link this RFC when next revised. - -## 13. Conclusion - -Execution receipts and audit envelopes provide a privacy-preserving, tamper-evident chain from delegation through execution to audit, aligned with the governed FSM and shared integrity across Open-CoT. diff --git a/rfcs/0049-capability-manifest.md b/rfcs/0049-capability-manifest.md deleted file mode 100644 index c4771ab..0000000 --- a/rfcs/0049-capability-manifest.md +++ /dev/null @@ -1,272 +0,0 @@ -# RFC 0049 — Capability Manifest (v0.1) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-18 -**Target Version:** Schema v0.8 -**Discussion:** https://github.com/supernovae/open-cot/discussions/49 - -## 1. Summary - -Open-CoT is a cognitive control plane for governed cognitive pipeline execution. Without a **capability manifest**, models propose actions with incomplete knowledge of what the harness will permit, burning context on delegation cycles that resolve to denial. This RFC defines the **capability manifest**: a harness-compiled, model-facing snapshot that summarizes callable tools, policy and sandbox posture, remaining budget, and cognitive pipeline trust. The manifest is injected at key finite-state machine (FSM) transitions so the model can plan within real constraints. Schema v0.8 adds a normative JSON representation for validation and audit, and a normative **compact text** serialization for token-efficient injection. - -## 2. Motivation and problem statement - -Tool registries (RFC 0003), sandboxes (RFC 0017), policies (RFC 0041), and budgets (RFC 0038) each encode part of the execution envelope. The model, however, consumes natural language context—not internal configuration graphs. Bridging that gap with ad hoc prose is fragile and expensive. The capability manifest is the **single compiled briefing** the harness derives from authoritative sources and supplies to the model at controlled injection points, reducing wasted proposals and making the control plane practical for small models and narrow context windows. - -## 3. Normative requirements - -The following requirements apply to conforming harnesses for Schema v0.8. - -**N1 — Compilation.** The harness MUST compile the manifest; the model MUST NOT construct or mutate the manifest as authoritative state. - -**N2 — Provenance.** Each manifest instance MUST be attributable to a `run_id`, `requester_id`, and compilation `timestamp`, and MUST record the FSM `phase` at which it was produced. - -**N3 — Heartbeat injection.** The harness MUST re-compile and inject a fresh manifest before **every LLM call** during a governed run. Models lose sight of earlier context as the conversation grows (context decay); a stale manifest from three LLM calls ago is effectively invisible. Re-injecting at every model-facing turn keeps budget numbers, tool availability, and constraints current regardless of how far the run has progressed. This pattern is called the **manifest heartbeat**. - -At minimum, the manifest MUST be injected at FSM states **`frame`**, **`plan`**, **`critique_verify`**, and **`finalize`** — every state where the model makes decisions. Conforming harnesses SHOULD inject at every LLM call without exception; the cost is under 200 tokens per injection and is repaid many times over by preventing hallucinated tool calls and wasted delegation cycles. - -**N4 — Audit.** The structured JSON form MUST be retained on **PipelineState** for the run and MUST be referenceable from the audit envelope (RFC 0048) as part of the governed trace. - -**N5 — Blocked tools.** Blocked tool names MUST appear in `tools.blocked` (structured) and in the compact `tools_restricted` line with reason `blocked` where applicable, so the model can avoid requesting them. Descriptions for blocked tools are intentionally omitted in compact form (name only). - -## 4. Design: inputs and semantics - -The manifest aggregates, at minimum: - -| Source | RFC | Contributes | -|--------|-----|-------------| -| Tool registry | 0003 | Tool names, descriptions, idempotent flags, optional contract references | -| Sandbox configuration | 0017 | Allow/deny lists, environment limits affecting tool viability | -| Policy rules | 0041 | `access_level` per tool, narrowing constraints, approval requirements | -| Budget tracker | 0038 | `steps_remaining`, `tool_calls_remaining`, `tokens_remaining`, `retries_remaining` | -| Cognitive pipeline identity | 0026 | `trust_level` | - -**Access levels** align with permission semantics (RFC 0042): `pre_authorized`, `requires_delegation`, and `blocked`. Tools that are blocked by sandbox or policy appear in `tools.blocked` and MUST NOT appear in `tools.available` with `access_level: "blocked"`; blocked status is expressed only via the blocked list and compact serialization. - -**Trust level** is one of `untrusted`, `low`, `medium`, `high`, derived from cognitive pipeline identity and deployment policy. It informs expected delegation friction, not cryptographic proof. - -## 5. Injection points — the manifest heartbeat - -Models experience **context decay**: as the conversation grows, information from earlier turns becomes progressively less influential on the model's output. A capability manifest injected only at `frame` is effectively forgotten by `critique_verify` in a long run. The harness counters this by re-compiling and re-injecting the manifest before every LLM call — the **manifest heartbeat**. - -Each heartbeat is cheap (under 200 tokens for a typical setup) and carries current truth: - -- **Budget numbers** reflect actual consumption, not the snapshot from three turns ago. -- **Tool availability** reflects any permissions revoked or consumed mid-run. -- **Constraints** reflect any policy narrowing applied during delegation. - -The heartbeat is synchronized with the governed FSM (RFC 0007): - -| FSM state | Heartbeat role | -|-----------|---------------| -| **`frame`** | Initial briefing — full manifest with all available tools, blocked tools, budget, trust level, constraints. | -| **`plan`** | Planning briefing — model sees what it can request before committing to a plan. Prevents hallucinated tool references. | -| **`critique_verify`** | Post-execution refresh — updated budget after tool calls; revoked permissions reflected. | -| **`finalize`** | Final-answer briefing — model knows remaining budget and can reconcile whether to attempt more work or synthesize. | - -Conforming harnesses SHOULD inject at every LLM call, not only the four states listed above. Any additional LLM call (for example, a re-plan after critique) benefits from the same heartbeat. The per-injection cost is negligible compared to the tokens saved by preventing the model from proposing actions against stale or forgotten context. - -## 6. Representations - -**Structured JSON** — Canonical for storage, schema validation, audit linkage, and machine processing. This is the object persisted on PipelineState and cited by audit envelopes. - -**Compact text** — Canonical for model-visible context. It uses delimiter lines `[capability_manifest]` … `[/capability_manifest]` so parsers and harness scrubbers can locate and optionally strip the briefing when superseded. - -Implementations MAY attach optional `tool_contract_ref` (URI or registry id) per available tool in JSON for traceability; compact text MUST NOT embed full input schemas (see §12). - -## 7. JSON Schema — `capability_manifest` - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/v0.8/capability_manifest.json", - "title": "Open CoT RFC 0049 — Capability Manifest", - "type": "object", - "additionalProperties": false, - "required": ["manifest_id", "run_id", "requester_id", "timestamp", "phase", "tools", "budget", "trust_level"], - "properties": { - "manifest_id": { "type": "string", "minLength": 1 }, - "run_id": { "type": "string", "minLength": 1 }, - "requester_id": { "type": "string", "minLength": 1 }, - "timestamp": { "type": "string", "format": "date-time" }, - "phase": { "type": "string", "minLength": 1, "description": "FSM phase at which this manifest was compiled (e.g., frame, critique_verify, plan)." }, - "tools": { - "type": "object", - "additionalProperties": false, - "required": ["available", "blocked"], - "properties": { - "available": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": ["name", "description", "access_level"], - "properties": { - "name": { "type": "string", "minLength": 1 }, - "description": { "type": "string" }, - "access_level": { "type": "string", "enum": ["pre_authorized", "requires_delegation"] }, - "idempotent": { "type": "boolean" }, - "tool_contract_ref": { "type": "string", "description": "Optional pointer to tool contract schema (RFC 0003); not serialized in compact text." }, - "constraints": { - "type": "object", - "description": "Policy-imposed constraints on this tool (e.g., narrowing).", - "additionalProperties": true - } - } - } - }, - "blocked": { - "type": "array", - "items": { "type": "string", "minLength": 1 }, - "description": "Tool names blocked by sandbox or policy — do not request these." - } - } - }, - "budget": { - "type": "object", - "additionalProperties": false, - "properties": { - "steps_remaining": { "type": "integer" }, - "tool_calls_remaining": { "type": "integer" }, - "tokens_remaining": { "type": "integer" }, - "retries_remaining": { "type": "integer" } - } - }, - "trust_level": { "type": "string", "enum": ["untrusted", "low", "medium", "high"] }, - "active_constraints": { - "type": "array", - "items": { "type": "string" }, - "description": "Human-readable summary of active policy constraints." - } - } -} -``` - - -## 8. Compact text serialization - -The harness SHOULD serialize the manifest to compact text for injection. The format is intentionally linear—no JSON parsing is required by the model. - -``` -[capability_manifest] -tools_available: (, ), ... -tools_restricted: (), ... -budget: steps, tool calls, tokens remaining -trust_level: -constraints: , , ... -[/capability_manifest] -``` - -**Flags** for `tools_available` SHOULD include `idempotent` or `mutating` derived from the tool contract, and MAY include shorthand such as `read` / `execute` when the harness maps those categories from registry metadata. **Reason** in `tools_restricted` MUST distinguish `blocked` from `requires_delegation` when a restricted-but-not-blocked tool is listed for clarity; harnesses MAY omit restricted entries that are already fully described under `tools_available` with `requires_delegation`, provided the compact form remains self-consistent with the JSON. - -**Omission rules.** If `active_constraints` is empty, the `constraints:` line MAY be omitted or replaced with `constraints: none`. If `budget` fields are unknown for a dimension, that segment MAY read `unknown` for that quantity rather than inventing numbers. - -## 9. Token efficiency - -Typical deployments SHOULD target **under 200 tokens** for a five-tool setup in compact form, excluding optional harness wrappers. Explicitly listing blocked tools trades a small number of tokens for disproportionate savings from avoided denial loops. Surfacing remaining **steps**, **tool calls**, and **tokens** enables the model to self-limit plan breadth—for example, when `tool_calls_remaining` is two, the plan SHOULD NOT assume five serial tool invocations without delegation or replanning. - -## 10. Lifecycle - -1. During **`receive`**, the harness gathers registry, sandbox, policy, budget, and identity inputs. -2. Before **every LLM call** (the heartbeat), the harness recompiles the manifest from current state, assigns a fresh `manifest_id`, sets `phase` to the current FSM state, and persists it on PipelineState (latest manifest replaces previous; implementations MAY retain history for audit). -3. The harness injects the **compact text** form into the system message preamble (or equivalent model-facing channel). -4. After tool execution, budget and permission changes are reflected in the next heartbeat automatically — no explicit "refresh" step is needed because every heartbeat reads current state. -5. The **audit envelope** references the final manifest id or embeds hashes of canonical JSON as required by RFC 0048. - -## 11. Cross-references - -- RFC 0003 — Tool Invocation (contracts: name, description, idempotent flags). -- RFC 0007 — Governed FSM (injection points `frame`, `critique_verify`). -- RFC 0016 — Tool Capability Negotiation (manifest as runtime realization of negotiated capabilities). -- RFC 0017 — Safety & Sandboxing (sandbox feeds allow/deny into manifest). -- RFC 0021 — Cognitive pipeline Capability Declaration (declared vs manifest-granted capabilities). -- RFC 0026 — Cognitive pipeline Identity (`trust_level`). -- RFC 0038 — Cost-Aware Budget (budget snapshot fields). -- RFC 0041 — Policy Enforcement (access levels and constraints). -- RFC 0042 — Permissions (`pre_authorized` vs `requires_delegation`). -- RFC 0048 — Execution Receipts & Audit Envelopes (audit linkage). - -## 12. Resolved design questions - -1. **Input schemas in the manifest?** **No** in compact text (too verbose). Structured JSON **MAY** include `tool_contract_ref` pointing at the tool contract; models that consume OpenAI-style tool definitions continue to receive full schemas through that parallel channel. -2. **Refresh cadence?** **Normative:** `frame` and `critique_verify`. **Optional:** `plan` when stale tool references or budget drift are detected. -3. **Visibility of inaccessible tools?** **Yes, by name** for blocked tools in `tools.blocked` and compact `tools_restricted`, without descriptions, to reduce harmful guessing. - -## 13. Examples - -### 13.1 Structured JSON (three available tools, one blocked, medium trust) - -```json -{ - "manifest_id": "cm_01jqzexample0001", - "run_id": "run_8f3c2a", - "requester_id": "agent_researcher_eu", - "timestamp": "2026-04-18T14:22:05Z", - "phase": "frame", - "tools": { - "available": [ - { - "name": "search", - "description": "Query curated document index", - "access_level": "pre_authorized", - "idempotent": true, - "tool_contract_ref": "https://opencot.dev/contracts/v0.8/search.json", - "constraints": { "max_results": 5, "no_raw_html": true } - }, - { - "name": "calculator", - "description": "Safe arithmetic evaluation", - "access_level": "pre_authorized", - "idempotent": true - }, - { - "name": "writeFile", - "description": "Write artifact to workspace", - "access_level": "requires_delegation", - "idempotent": false - } - ], - "blocked": ["shell"] - }, - "budget": { - "steps_remaining": 48, - "tool_calls_remaining": 18, - "tokens_remaining": 95000, - "retries_remaining": 2 - }, - "trust_level": "medium", - "active_constraints": [ - "max 5 results per search", - "no raw HTML in search excerpts" - ] -} -``` - -### 13.2 Compact text for §13.1 - -``` -[capability_manifest] -tools_available: search (pre_authorized, idempotent), calculator (pre_authorized, idempotent), writeFile (requires_delegation, mutating) -tools_restricted: shell (blocked) -budget: 48 steps, 18 tool calls, 95000 tokens remaining -trust_level: medium -constraints: max 5 results per search, no raw HTML in search excerpts -[/capability_manifest] -``` - -## 14. Acceptance criteria - -Conformance for a harness implementation is indicated by all of the following: - -- The harness compiles the manifest from tool registry, sandbox configuration, active policy rules, and budget tracker state, joined with cognitive pipeline identity for `trust_level`. -- The manifest heartbeat fires before **every LLM call** (at minimum: `frame`, `plan`, `critique_verify`, `finalize`) using the compact text format. -- For representative five-tool profiles, compact serialization stays **under 200 tokens** (excluding outer system prompt boilerplate). -- Structured JSON validates against the schema in §7. -- Each run retains manifest history or the latest manifest on **PipelineState** suitable for audit. -- Automated tests cover manifest **compilation** from synthetic registry/policy inputs and **round-trip consistency** between JSON and compact text for a fixed fixture set. - -## 15. Security considerations - -The manifest is **non-authoritative** for enforcement: sandbox and policy engines remain the source of truth for permission decisions. A compromised model cannot elevate privileges by editing the manifest. Harnesses MUST NOT leak secrets (API keys, raw PII) into `active_constraints` or descriptions. Compact text is intended for model consumption and MAY be logged; operators SHOULD apply the same redaction policies as for other prompt material. diff --git a/rfcs/0050-toon-adapter.md b/rfcs/0050-toon-adapter.md deleted file mode 100644 index 7a34d07..0000000 --- a/rfcs/0050-toon-adapter.md +++ /dev/null @@ -1,193 +0,0 @@ -# RFC 0050 — TOON Adapter: Token-Oriented Object Notation (v0.1) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-18 -**Target Version:** Schema v0.8 -**Discussion:** https://github.com/supernovae/open-cot/discussions/50 - -## 1. Summary - -This RFC defines an optional **TOON adapter** for the Open CoT harness. TOON (Token-Oriented Object Notation) is a compact, human-readable serialization format that reduces token consumption by 20–60% compared to equivalent JSON when passing structured data through LLM context windows. The adapter translates canonical JSON Schema objects into TOON notation for model-facing injection and parses model-generated TOON back into validated JSON objects. JSON Schema remains the normative interchange and audit format; TOON is strictly an adapter-layer optimization. - -## 2. Motivation and problem statement - -[RFC 0049](0049-capability-manifest.md) established the pattern of maintaining canonical JSON for audit while injecting compact text at the model boundary. That pattern works well for the capability manifest but is hand-coded: each new schema that needs compact injection requires a bespoke serializer. Meanwhile, the project's token-efficiency roadmap ([`docs/token-efficiency.md`](../docs/token-efficiency.md)) identifies "Tier 2 — Structured text markers" and "Tier 3 — Alternative serializations" as research directions, with the validation boundary rule that compact formats must round-trip to canonical JSON. - -TOON fills this gap with a general-purpose compact notation that: - -- Uses **inline schema headers** (`items[N]{field1, field2}:`) so the model knows the shape without a separate schema payload. -- Represents **uniform arrays** as pipe-delimited tabular rows, eliminating repeated key names. -- Represents **objects** with indentation-based `key: value` pairs, eliminating braces, quotes, and commas. -- Is backed by recent benchmarks showing measurable token savings on real workloads (see §11). - -The adapter generalizes what `manifestToCompactText` does today into a reusable, schema-aware translation layer. - -## 3. Scope and non-goals - -**In scope:** - -- A bidirectional adapter: `toToon(object, schema?)` and `fromToon(toonString, schema?)`. -- Schema-to-header generation: `schemaToToonHeader(jsonSchema)`. -- A TOON serializer for capability manifests (`manifestToToon`) alongside the existing compact text. -- A `wire_format` configuration option on cognitive pipeline configs (`"json" | "compact-text" | "toon"`). -- Documentation, experiment card, and example fixtures. - -**Non-goals:** - -- TOON is **never normative**. It is never stored in audit envelopes, trace archives, or harness-to-harness interchange. -- TOON does not replace JSON Schema validation. All TOON output is validated by converting back to JSON and running Ajv. -- TOON does not define a new schema language. The inline header is a serialization hint, not a type system. -- This RFC does not mandate TOON adoption. It is opt-in per cognitive pipeline or backend configuration. - -## 4. Normative requirements - -**N1 — Round-trip fidelity.** For any object `O` that validates against a registered JSON Schema `S`, `fromToon(toToon(O, S), S)` MUST produce an object that also validates against `S` and is deeply equal to `O` (modulo key ordering). - -**N2 — Validation boundary.** The harness MUST validate parsed TOON output against the original JSON Schema before trusting it. The adapter is a serialization layer, not a trust boundary. - -**N3 — Opt-in configuration.** The `wire_format` setting defaults to `"compact-text"` (current behavior). Changing to `"toon"` MUST NOT alter audit artifacts, trace schemas, or policy enforcement. - -**N4 — Marker convention.** TOON blocks injected into model context MUST be wrapped in `[toon:schema_name]` … `[/toon:schema_name]` markers, paralleling the `[capability_manifest]` convention from RFC 0049. - -**N5 — Graceful degradation.** If `fromToon` fails to parse model output, the harness MUST surface a structured validation error that the model can repair on the next turn, consistent with the repair loop pattern described in `docs/token-efficiency.md`. - -## 5. TOON notation reference - -### 5.1 Objects - -Key-value pairs, one per line, colon-separated. No braces, no quotes on keys or simple string values. - -``` -name: search -access_level: pre_authorized -idempotent: true -``` - -### 5.2 Arrays with inline schema headers - -The header declares the array name, expected length (or `N` for variable), and field names in order. - -``` -tools[3]{name, access, idempotent}: -search | pre-authorized | true -write_file | requires-delegation | false -run_tests | pre-authorized | true -``` - -Fields are pipe-delimited. Whitespace around pipes is trimmed. The header line ends with a colon. - -### 5.3 Nested objects - -Indentation (two spaces) indicates nesting. - -``` -budget: - steps_remaining: 8 - tool_calls_remaining: 5 - tokens_remaining: 4000 -``` - -### 5.4 Scalar arrays - -Simple comma-separated values after the header. - -``` -blocked[2]: shell, drop_table -``` - -### 5.5 Escaping - -Values containing pipe characters (`|`) or leading/trailing whitespace MUST be quoted with double quotes. Newlines within values are represented as `\n`. - -## 6. Schema-to-header generation - -Given a JSON Schema with an `array` type whose `items` is an `object`, `schemaToToonHeader` extracts property names (respecting `required` ordering if present) and produces the header string: - -``` -Input schema: { "type": "array", "items": { "properties": { "id": ..., "type": ..., "content": ... } } } -Output header: items[N]{id, type, content} -``` - -For non-array object schemas, the header is omitted and the object is serialized as key-value pairs. - -## 7. Adapter API - -```typescript -function toToon(obj: unknown, schema?: JsonSchema): string; -function fromToon(toon: string, schema?: JsonSchema): unknown; -function schemaToToonHeader(schema: JsonSchema, name?: string): string | null; -``` - -- `toToon` accepts any JSON-serializable value. If a schema is provided, it drives header generation and type-aware formatting. Without a schema, the adapter infers structure from the object shape. -- `fromToon` parses TOON text back to a plain object. The schema guides type coercion (e.g., `"8"` → `8` when the schema says `integer`). -- `schemaToToonHeader` returns the header line for array schemas, or `null` for non-array schemas. - -## 8. Integration with capability manifest - -`manifestToToon(manifest)` produces: - -``` -[toon:capability_manifest] -tools_available[3]{name, access, idempotent}: -search | pre-authorized | true -write_file | requires-delegation | false -run_tests | pre-authorized | true -tools_blocked: shell, drop_table -budget{steps, tool_calls, tokens, retries}: 8 | 5 | 4000 | 2 -trust_level: medium -constraints: no network after step 5; read-only filesystem -[/toon:capability_manifest] -``` - -This replaces `manifestToCompactText` when `wire_format` is `"toon"`. The structured JSON manifest on `PipelineState` is unchanged. - -## 9. Configuration - -```typescript -interface WireFormatConfig { - wire_format: "json" | "compact-text" | "toon"; -} -``` - -Added as an optional field on `GovernedPipelineConfig` and as a parameter on `runChatPipeline`. Default: `"compact-text"`. - -The manifest heartbeat and any future schema injections select the serializer based on this setting: - -| `wire_format` | Manifest serializer | Other schema injections | -|---------------|-------------------|------------------------| -| `"json"` | `JSON.stringify` (minified) | `JSON.stringify` | -| `"compact-text"` | `manifestToCompactText` (existing) | N/A (hand-coded per schema) | -| `"toon"` | `manifestToToon` | `toToon(obj, schema)` | - -## 10. Security considerations - -TOON inherits all security properties from [RFC 0049 §15](0049-capability-manifest.md). The adapter is non-authoritative: a model cannot elevate privileges by emitting TOON. Parsed TOON passes through the same Ajv validation as JSON. Operators SHOULD apply the same redaction policies to TOON context as to other prompt material. - -## 11. Research references - -The following published work supports the token-efficiency claims motivating this RFC: - -1. **Abt, B. (2025).** "TOON Format: Token-Oriented Object Notation for LLM-Friendly Data Exchange." https://benjamin-abt.com/blog/2025/12/12/ai-toon-format/ — Production-focused design rationale for TOON. - -2. **arXiv 2603.03306 (2026).** "Token-Oriented Object Notation vs JSON: A Benchmark of Plain and Constrained Decoding Generation." https://arxiv.org/abs/2603.03306 — Benchmarks TOON against JSON and constrained decoding; finds TOON's efficiency advantage follows a non-linear curve, becoming significant beyond a structural complexity threshold. - -3. **Nandakishore, G. (2026).** "JTON: A Token-Efficient JSON Superset with Zen Grid Tabular Encoding for Large Language Models." arXiv 2604.05865. https://arxiv.org/abs/2604.05865 — Reports 15–60% token reduction (28.5% average) with 100% syntactic validity across 12 LLMs. - -4. **ATON Format V2 Whitepaper (2025).** "Adaptive Token-Oriented Notation — Production-grade data serialization for LLMs." https://www.atonformat.com/whitepaper.html — Reports 56% token reduction vs JSON with native relationship support. - -## 12. Cross-references - -- RFC 0001 — Reasoning traces (primary schema that benefits from compact injection). -- RFC 0003 — Tool Invocation (tool payloads as a TOON target). -- RFC 0007 — Governed FSM (injection points). -- RFC 0038 — Cost-Aware Budget (token savings directly impact budget consumption). -- RFC 0049 — Capability Manifest (existing compact text pattern that TOON generalizes). - -## 13. Acceptance criteria - -- `toToon` and `fromToon` round-trip for all schemas in the registry without validation errors. -- `manifestToToon` output is under 200 tokens for a five-tool profile (matching RFC 0049 target). -- Governed cognitive pipeline demo completes successfully with `wire_format: "toon"`. -- Token count comparison (JSON vs compact-text vs TOON) is documented for capability manifest and reasoning trace fixtures. -- No change in behavior for existing users who do not set `wire_format`. diff --git a/rfcs/0051-temporal-semantics-validity-extension.md b/rfcs/0051-temporal-semantics-validity-extension.md deleted file mode 100644 index bffa086..0000000 --- a/rfcs/0051-temporal-semantics-validity-extension.md +++ /dev/null @@ -1,287 +0,0 @@ -# RFC 0051 — Temporal Semantics & Validity Extension (v0.1) - -**Status:** Draft -**Author:** Byron / Open CoT Community -**Created:** 2026-04-20 -**Target Version:** Schema v0.9 -**Discussion:** https://github.com/supernovae/open-cot/discussions/51 - ---- - -## 1. Summary - -Open CoT already carries many time-like fields (`timestamp`, `started_at`, `completed_at`, `expires_at`, `effective_from`, `effective_until`) but lacks one cross-cutting temporal model. This RFC defines that model for governed execution. - -The extension standardizes: - -- canonical temporal fields and meanings, -- ordering semantics beyond wall-clock sorting, -- validity, freshness, and replay-window requirements, -- supersession semantics for append-only governance, -- temporal uncertainty and clock-domain provenance. - -This RFC is control-plane focused: it standardizes artifact semantics and enforcement obligations, not internal model cognition. - ---- - -## 2. Scope and non-goals - -**In scope** - -- Control-plane semantics for temporal fields across policy, delegation, permissions, receipts, audit, memory, lifecycle, telemetry, and governed execution. -- Normative ordering rules that remain stable under clock skew and distributed runtimes. -- Replay/freshness/supersession guarantees for auditable execution. - -**Out of scope** - -- Human-style temporal reasoning within model chain-of-thought. -- Transformer architecture changes, sequence-modeling research, or training-only behavior guarantees. -- Replacing RFC 0007 state-machine governance with timestamp-only ordering. - ---- - -## 3. Canonical temporal fields - -Implementations MUST use these canonical semantics when fields appear: - -| Field | Meaning | Typical producer | -|------|---------|------------------| -| `observed_at` | When evidence/observation became known to the harness | tool executor, observation path | -| `decided_at` | When an authority/policy decision was finalized | policy engine, harness | -| `effective_at` | Inclusive start time when an artifact becomes valid | policy, grants, approvals | -| `expires_at` | Exclusive end time when validity ends | policy, grants, approvals | -| `started_at` | Start time of an execution span | tool executor, run lifecycle | -| `completed_at` | End time of an execution span | tool executor, run lifecycle | -| `superseded_at` | Time an artifact revision was superseded by another | harness or governance service | - -If an artifact has validity bounds, it MUST use `effective_at` + `expires_at` (half-open interval: `[effective_at, expires_at)`). - ---- - -## 4. Ordering semantics - -Temporal ordering MUST NOT rely on wall-clock time alone. - -Implementations MUST evaluate order using this precedence: - -1. **Logical sequence order** (`ordering.event_seq`) when present. -2. **Causal linkage** (`ordering.parent_event_id` and/or `ordering.causal_predecessors`) when sequence ties or is absent. -3. **Version transition order** (`ordering.version_order`) for lifecycle-governed revisions. -4. **Wall clock order** (`*.at` fields) only as a tie-breaker. - -Normative requirement: artifacts used for governance/audit decisions MUST carry at least one non-wall-clock ordering signal (`event_seq`, causal predecessor, or version order). - ---- - -## 5. Validity, freshness, and replay - -### 5.1 Validity windows - -- `effective_at` is inclusive. -- `expires_at` is exclusive. -- Artifact is valid at time `t` iff `effective_at <= t < expires_at`. -- If `effective_at` is omitted, validity starts immediately when emitted. -- If `expires_at` is omitted, validity is unbounded unless constrained by policy. - -### 5.2 Freshness requirements - -When freshness is specified: - -- `freshness.max_staleness_ms` defines allowed age of observed evidence at decision/execution time. -- `freshness.max_observation_lag_ms` bounds delay between real-world event and `observed_at`. -- If freshness cannot be proven, implementations MUST fail closed (`deny`, `escalate`, or `fail_safe` per governing RFC). - -### 5.3 Replay windows - -- `freshness.replay_window_ms` bounds reuse of replay-sensitive artifacts (receipts, approvals, delegation artifacts). -- If artifact age exceeds replay window, it MUST be rejected as stale for privileged operations. - ---- - -## 6. Supersession model - -Supersession is append-only and provenance-preserving. - -When an artifact revision replaces prior intent/constraints: - -- new artifact MUST reference predecessor via `supersession.supersedes_id`, -- predecessor MAY be marked with `superseded_at`, -- historical records MUST remain immutable and auditable. - -Supersession MUST NOT destructively erase prior approved intent, grant lineage, or provenance evidence. - ---- - -## 7. Temporal uncertainty and clock domains - -Each canonical instant SHOULD carry source metadata using `time_instant`: - -- `source` in `{harness_recorded, source_reported, inferred, unknown}`, -- `clock_domain` in `{harness_wall_clock, source_wall_clock, logical_only}`, -- optional uncertainty interval (`lower_bound_at`, `upper_bound_at`) when exact time is unknown. - -If `source` is `unknown`, exact `at` MAY be omitted but ordering and governance constraints still require non-wall-clock ordering metadata. - ---- - -## 8. Migration from legacy fields (breaking) - -This RFC defines a breaking normalization: - -| Legacy field | Canonical target | -|-------------|------------------| -| `timestamp` (generic) | one of `observed_at`, `decided_at`, or lifecycle span fields with explicit semantics | -| `effective_from` | `effective_at` | -| `effective_until` | `expires_at` | -| `granted_at` | `effective_at` (grant validity start) | -| `sealed_at` | `completed_at` for sealing span OR explicit terminal lifecycle event timestamp | -| policy rule `time_window.start` | `effective_at` | -| policy rule `time_window.end` | `expires_at` | - -Implementations adopting v0.9 MUST emit canonical names and MUST NOT emit deprecated aliases in new artifacts. - ---- - -## 9. Cross-RFC integration targets - -This extension is cross-cutting for: - -- RFC 0007 (governed FSM), -- RFC 0010 (memory), -- RFC 0030 (lifecycle/versioning), -- RFC 0031 (telemetry), -- RFC 0041 (policy), -- RFC 0042 (permissions), -- RFC 0043 (audit logs), -- RFC 0047 (delegation), -- RFC 0048 (execution receipts/audit envelopes), -- RFC 0049 (capability manifest freshness projection). - ---- - -## 10. Normative JSON Schema - - -```json -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0051/temporal-semantics.json", - "title": "Open CoT RFC 0051 - Temporal Semantics and Validity Extension", - "type": "object", - "additionalProperties": false, - "$defs": { - "isoDateTime": { - "type": "string", - "format": "date-time" - }, - "timeSource": { - "type": "string", - "enum": ["harness_recorded", "source_reported", "inferred", "unknown"] - }, - "clockDomain": { - "type": "string", - "enum": ["harness_wall_clock", "source_wall_clock", "logical_only"] - }, - "timeUncertainty": { - "type": "object", - "additionalProperties": false, - "properties": { - "lower_bound_at": { "$ref": "#/$defs/isoDateTime" }, - "upper_bound_at": { "$ref": "#/$defs/isoDateTime" } - }, - "required": ["lower_bound_at", "upper_bound_at"] - }, - "timeInstant": { - "type": "object", - "additionalProperties": false, - "properties": { - "at": { "$ref": "#/$defs/isoDateTime" }, - "source": { "$ref": "#/$defs/timeSource" }, - "clock_domain": { "$ref": "#/$defs/clockDomain" }, - "uncertainty": { "$ref": "#/$defs/timeUncertainty" } - }, - "required": ["source", "clock_domain"], - "allOf": [ - { - "if": { - "properties": { "source": { "const": "unknown" } }, - "required": ["source"] - }, - "then": { - "not": { "required": ["at"] } - }, - "else": { - "required": ["at"] - } - } - ] - }, - "ordering": { - "type": "object", - "additionalProperties": false, - "properties": { - "event_seq": { "type": "integer", "minimum": 0 }, - "parent_event_id": { "type": "string", "minLength": 1 }, - "causal_predecessors": { - "type": "array", - "items": { "type": "string", "minLength": 1 }, - "uniqueItems": true - }, - "version_order": { "type": "integer", "minimum": 0 } - } - }, - "validityWindow": { - "type": "object", - "additionalProperties": false, - "properties": { - "effective_at": { "$ref": "#/$defs/isoDateTime" }, - "expires_at": { "$ref": "#/$defs/isoDateTime" } - } - }, - "freshness": { - "type": "object", - "additionalProperties": false, - "properties": { - "max_staleness_ms": { "type": "integer", "minimum": 0 }, - "max_observation_lag_ms": { "type": "integer", "minimum": 0 }, - "replay_window_ms": { "type": "integer", "minimum": 0 } - } - }, - "supersession": { - "type": "object", - "additionalProperties": false, - "properties": { - "supersedes_id": { "type": "string", "minLength": 1 }, - "superseded_at": { "$ref": "#/$defs/isoDateTime" }, - "reason": { "type": "string" } - }, - "required": ["supersedes_id", "superseded_at"] - } - }, - "properties": { - "observed_at": { "$ref": "#/$defs/timeInstant" }, - "decided_at": { "$ref": "#/$defs/timeInstant" }, - "effective_at": { "$ref": "#/$defs/isoDateTime" }, - "expires_at": { "$ref": "#/$defs/isoDateTime" }, - "started_at": { "$ref": "#/$defs/isoDateTime" }, - "completed_at": { "$ref": "#/$defs/isoDateTime" }, - "superseded_at": { "$ref": "#/$defs/isoDateTime" }, - "ordering": { "$ref": "#/$defs/ordering" }, - "validity": { "$ref": "#/$defs/validityWindow" }, - "freshness": { "$ref": "#/$defs/freshness" }, - "supersession": { "$ref": "#/$defs/supersession" } - } -} -``` - - ---- - -## 11. Acceptance criteria - -- Governance artifacts use canonical temporal names and semantics. -- Non-wall-clock ordering metadata is present for audit/governance records. -- Freshness and replay-window checks are enforceable at runtime. -- Supersession preserves predecessor links and immutable history. -- Cross-schema validation succeeds with regenerated registry artifacts. - diff --git a/rfcs/0052-cognitive-artifact-and-capability-snapshot.md b/rfcs/0052-cognitive-artifact-and-capability-snapshot.md deleted file mode 100644 index 033d1ba..0000000 --- a/rfcs/0052-cognitive-artifact-and-capability-snapshot.md +++ /dev/null @@ -1,57 +0,0 @@ -# RFC 0052 — Cognitive Artifact & Capability Snapshot (v0.1) - -**Status:** Draft -**Author:** Open CoT Community -**Created:** 2026-04-27 -**Target Version:** Schema v0.10 -**Discussion:** https://github.com/supernovae/open-cot/discussions/52 - ---- - -## 1. Summary - -This RFC defines portable structures for runtimes that wrap non-deterministic -cognitive functions with deterministic validation and execution boundaries. - -The core structure is a **Cognitive Artifact**: a typed proposal emitted by a -model or model-like system. It is untrusted input. A runtime validates and -reconciles it against an immutable **Capability Snapshot** before performing -any side effect. - -## 2. Core concepts - -- `capability_snapshot`: immutable inventory of endpoints available to the - cognitive step. -- `cognitive_artifact`: typed proposal emitted from the cognitive step. -- `execution_intent`: requested endpoint execution tied to a snapshot and - capability digest. -- `reasoning_trace`: cognitive evidence explaining the path from objective to - proposal. It can carry detailed evidence, an audit-safe summary, or a - redacted evidence record. -- `observation`: structured evidence recorded during reconciliation. - -## 3. Normative requirements - -- A cognitive artifact MUST NOT be treated as authorization. -- Every execution intent MUST reference the exact snapshot used for generation. -- A runtime MUST verify endpoint name, capability name, and capability digest - before execution. -- A runtime MUST validate arguments against the original capability input - schema. -- Reasoning traces are evidentiary audit material. They help reviewers - understand how the cognitive step reached a proposal, but they are not proof, - authorization, or trusted state. -- A reasoning trace SHOULD declare whether it contains detailed evidence, - audit-safe summary material, or redacted evidence. Redaction metadata SHOULD - explain why detail is unavailable. -- A runtime MUST NOT infer permission from reasoning content. Permission comes - only from policy gates, validated capability snapshots, and reconciliation. - -## 4. Runtime neutrality - -This RFC does not require a specific durable execution engine, MCP transport, -model provider, or TypeScript implementation. Those are implementation choices. - -## 5. Schema - -Machine-readable schema: `schemas/rfc-0052-cognitive-artifact.json`. diff --git a/rfcs/0053-reconciliation-result.md b/rfcs/0053-reconciliation-result.md deleted file mode 100644 index 486ed65..0000000 --- a/rfcs/0053-reconciliation-result.md +++ /dev/null @@ -1,57 +0,0 @@ -# RFC 0053 — Reconciliation Result & Error Taxonomy (v0.1) - -**Status:** Draft -**Author:** Open CoT Community -**Created:** 2026-04-27 -**Target Version:** Schema v0.10 -**Discussion:** https://github.com/supernovae/open-cot/discussions/53 - ---- - -## 1. Summary - -This RFC defines a portable result envelope for runtimes that reconcile typed -cognitive artifacts against capability snapshots, policy gates, execution -bounds, endpoint results, and observations. - -The result envelope records what executed, what was skipped, what errors were -observed, and the final reconciliation status. - -## 2. Status values - -- `completed` -- `completed_with_errors` -- `yielded` -- `requires_approval` -- `failed` - -## 3. Error taxonomy - -The portable taxonomy includes: - -- `INVALID_ARTIFACT` -- `SNAPSHOT_MISMATCH` -- `UNKNOWN_MCP_SERVER` -- `UNKNOWN_CAPABILITY` -- `CAPABILITY_DIGEST_MISMATCH` -- `SCHEMA_VALIDATION_FAILED` -- `POLICY_DENIED` -- `APPROVAL_REQUIRED` -- `PRECONDITION_FAILED` -- `BUDGET_EXCEEDED` -- `MCP_EXECUTION_FAILED` -- `RESULT_VALIDATION_FAILED` -- `YIELDED` - -## 4. Normative requirements - -- Shape validation MUST NOT be treated as permission. -- Permission and policy gates MUST be represented separately from schema - validation. -- Errors SHOULD be recorded as structured observations when possible. -- A reconciliation result SHOULD preserve enough evidence for replay and audit - without requiring endpoint re-execution. - -## 5. Schema - -Machine-readable schema: `schemas/rfc-0053-reconciliation-result.json`. diff --git a/schemas/registry.json b/schemas/registry.json index ce19112..efb34b8 100644 --- a/schemas/registry.json +++ b/schemas/registry.json @@ -1,59 +1,18 @@ { - "version": "1.0", - "description": "Registry of Open CoT JSON Schemas extracted from or aligned with RFCs.", + "version": "2.0", + "description": "Registry of Open CoT cognitive interface schemas extracted from normative RFC blocks.", "schemas": { - "reasoning": "schemas/rfc-0001-reasoning.json", - "verifier_output": "schemas/rfc-0002-verifier.json", - "tool_invocation": "schemas/rfc-0003-tool.json", - "branching": "schemas/rfc-0004-branching.json", - "reward": "schemas/rfc-0005-reward.json", - "ensemble": "schemas/rfc-0006-ensemble.json", + "cognitive_artifact": "schemas/rfc-0001-cognitive-artifact.json", + "capability_snapshot": "schemas/rfc-0002-capability-snapshot.json", + "execution_intent": "schemas/rfc-0003-execution-intent.json", + "policy_gate": "schemas/rfc-0004-policy-gate.json", + "observation_receipt": "schemas/rfc-0005-observation-receipt.json", + "reconciliation_result": "schemas/rfc-0006-reconciliation-result.json", "cognitive_pipeline": "schemas/rfc-0007-cognitive-pipeline.json", - "dataset_packaging": "schemas/rfc-0008-dataset.json", - "reward_fusion": "schemas/rfc-0009-reward-fusion.json", - "cognitive_context": "schemas/rfc-0010-cognitive-context.json", - "multi_party_cognition_protocol": "schemas/rfc-0011-multi-party-cognition-protocol.json", - "dataset_streaming": "schemas/rfc-0012-dataset-streaming.json", - "memory_compression": "schemas/rfc-0013-memory-compression.json", - "memory_conflict_resolution": "schemas/rfc-0014-memory-conflict-resolution.json", - "multi_party_reward_sharing": "schemas/rfc-0015-multi-party-reward-sharing.json", - "tool_capability_negotiation": "schemas/rfc-0016-tool-capability-negotiation.json", - "runtime_safety_sandboxing": "schemas/rfc-0017-runtime-safety-sandboxing.json", - "tool_error_taxonomy": "schemas/rfc-0018-tool-error-taxonomy.json", - "collaborative_planning_graphs": "schemas/rfc-0019-collaborative-planning-graphs.json", - "verifiable_scratchpad_compression": "schemas/rfc-0020-verifiable-scratchpad-compression.json", - "capability_declaration": "schemas/rfc-0021-capability-declaration.json", - "cognitive_evaluation_protocol": "schemas/rfc-0022-cognitive-evaluation-protocol.json", - "human_in_the_loop": "schemas/rfc-0023-human-in-the-loop.json", - "multi_modal_reasoning": "schemas/rfc-0024-multi-modal-reasoning.json", - "tool_marketplace_registry": "schemas/rfc-0025-tool-marketplace-registry.json", - "requester_identity_auth": "schemas/rfc-0026-requester-identity-auth.json", - "distributed_execution": "schemas/rfc-0027-distributed-execution.json", - "capability_environment": "schemas/rfc-0028-capability-environment.json", - "cognitive_benchmark_dataset": "schemas/rfc-0029-cognitive-benchmark-dataset.json", - "runtime_lifecycle_versioning": "schemas/rfc-0030-runtime-lifecycle-versioning.json", - "cognitive_observability_telemetry": "schemas/rfc-0031-cognitive-observability-telemetry.json", - "runtime_deployment_manifest": "schemas/rfc-0032-runtime-deployment-manifest.json", - "runtime_security_threat_model": "schemas/rfc-0033-runtime-security-threat-model.json", - "cognitive_federation_protocol": "schemas/rfc-0034-cognitive-federation-protocol.json", - "data_provenance_tracking": "schemas/rfc-0035-data-provenance-tracking.json", - "cognitive_native_compression_delta": "schemas/rfc-0036-cognitive-native-compression-delta.json", - "token_economy_cost_modeling": "schemas/rfc-0037-token-economy-cost-modeling.json", - "cost_aware_reasoning_budget": "schemas/rfc-0038-cost-aware-reasoning-budget.json", - "tool_cost_modeling": "schemas/rfc-0039-tool-cost-modeling.json", - "multi_party_economic_incentives": "schemas/rfc-0040-multi-party-economic-incentives.json", - "policy_enforcement": "schemas/rfc-0041-policy-enforcement.json", - "permission_acl": "schemas/rfc-0042-permission-acl.json", - "auditing_compliance_logs": "schemas/rfc-0043-auditing-compliance-logs.json", - "governance_organizational_controls": "schemas/rfc-0044-governance-organizational-controls.json", - "ethics": "schemas/rfc-0045-ethics.json", - "experiment_cards": "schemas/rfc-0046-experiment-cards.json", - "delegation_extension": "schemas/rfc-0047-delegation-extension.json", - "execution_receipts_audit_envelopes": "schemas/rfc-0048-execution-receipts-audit-envelopes.json", - "capability_manifest": "schemas/rfc-0049-capability-manifest.json", - "toon_adapter": "schemas/rfc-0050-toon-adapter.json", - "temporal_semantics": "schemas/rfc-0051-temporal-semantics.json", - "cognitive_artifact": "schemas/rfc-0052-cognitive-artifact.json", - "reconciliation_result": "schemas/rfc-0053-reconciliation-result.json" + "execution_budget": "schemas/rfc-0008-execution-budget.json", + "requester_identity": "schemas/rfc-0009-requester-identity.json", + "human_approval": "schemas/rfc-0010-human-approval.json", + "conformance_registry": "schemas/rfc-0011-conformance-registry.json", + "compact_context": "schemas/rfc-0012-compact-context.json" } } diff --git a/schemas/rfc-0001-cognitive-artifact.json b/schemas/rfc-0001-cognitive-artifact.json new file mode 100644 index 0000000..ed2e1e3 --- /dev/null +++ b/schemas/rfc-0001-cognitive-artifact.json @@ -0,0 +1,195 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0001 - Cognitive Artifact and Reasoning Evidence", + "type": "object", + "additionalProperties": false, + "properties": { + "artifact_id": { + "type": "string", + "minLength": 1 + }, + "schema_version": { + "type": "string", + "enum": [ + "open-cot.core.v1" + ] + }, + "capability_snapshot_id": { + "type": "string", + "minLength": 1 + }, + "intent_verification": { + "type": "object", + "additionalProperties": false, + "required": [ + "objective", + "request_boundaries", + "allowed_scope", + "prohibited_scope" + ], + "properties": { + "objective": { + "type": "string" + }, + "request_boundaries": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_scope": { + "type": "array", + "items": { + "type": "string" + } + }, + "prohibited_scope": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "reasoning_trace": { + "type": "object", + "additionalProperties": false, + "required": [ + "evidence_mode", + "summary", + "steps" + ], + "properties": { + "evidence_mode": { + "type": "string", + "enum": [ + "audit_summary", + "detailed_evidence", + "redacted_evidence" + ] + }, + "summary": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/$defs/reasoning_step" + } + }, + "contains_sensitive_content": { + "type": "boolean" + }, + "redaction_reason": { + "type": "string" + } + } + }, + "assumptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "execution_intents": { + "type": "array", + "items": { + "$ref": "rfc-0003-execution-intent.json" + } + }, + "observations": { + "type": "array", + "items": { + "$ref": "rfc-0005-observation-receipt.json#/$defs/observation" + } + }, + "uncertainty": { + "type": "object", + "additionalProperties": false, + "required": [ + "level", + "explanation" + ], + "properties": { + "level": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "explanation": { + "type": "string" + } + } + }, + "yield_reason": { + "type": "string" + } + }, + "required": [ + "artifact_id", + "schema_version", + "capability_snapshot_id", + "intent_verification", + "reasoning_trace", + "assumptions", + "execution_intents", + "observations", + "uncertainty" + ], + "$defs": { + "reasoning_step": { + "type": "object", + "additionalProperties": false, + "required": [ + "step_id", + "kind", + "content", + "visibility" + ], + "properties": { + "step_id": { + "type": "string", + "minLength": 1 + }, + "kind": { + "type": "string", + "enum": [ + "interpretation", + "constraint", + "hypothesis", + "verification", + "yield" + ] + }, + "content": { + "type": "string" + }, + "visibility": { + "type": "string", + "enum": [ + "audit_summary", + "detailed_evidence", + "redacted" + ] + }, + "redaction_reason": { + "type": "string" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + } + }, + "$id": "https://opencot.dev/schemas/rfc-0001-cognitive-artifact.json", + "x-opencot": { + "rfc": "0001", + "shortname": "cognitive_artifact", + "source_rfc": "rfcs/0001-cognitive-artifact.md" + } +} diff --git a/schemas/rfc-0001-reasoning.json b/schemas/rfc-0001-reasoning.json deleted file mode 100644 index b6b1b48..0000000 --- a/schemas/rfc-0001-reasoning.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Reasoning Trace v0.1", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "task": { - "type": "string" - }, - "steps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "content": { - "type": "string" - }, - "parent": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "children": { - "type": "array", - "items": { - "type": "string" - } - }, - "evidence": { - "type": "array", - "items": { - "type": "string" - } - }, - "confidence": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "verification_status": { - "type": "string", - "enum": [ - "verified", - "failed", - "unknown" - ] - }, - "verifier_score": { - "type": "number" - } - }, - "required": [ - "id", - "type", - "content" - ] - } - }, - "final_answer": { - "type": "string" - } - }, - "required": [ - "version", - "task", - "steps", - "final_answer" - ], - "$id": "https://opencot.dev/schemas/rfc-0001-reasoning.json", - "x-opencot": { - "rfc": "0001", - "shortname": "reasoning", - "source_rfc": "rfcs/0001-initial-schema.md" - } -} diff --git a/schemas/rfc-0002-capability-snapshot.json b/schemas/rfc-0002-capability-snapshot.json new file mode 100644 index 0000000..2a79a33 --- /dev/null +++ b/schemas/rfc-0002-capability-snapshot.json @@ -0,0 +1,85 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0002 - Capability Snapshot and Endpoint Descriptor", + "type": "object", + "additionalProperties": false, + "properties": { + "snapshot_id": { + "type": "string", + "minLength": 1 + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "capabilities_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "capabilities": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "endpoint_id", + "capability_name", + "description", + "input_schema", + "risk_level", + "requires_approval", + "capability_digest" + ], + "properties": { + "endpoint_id": { + "type": "string", + "minLength": 1 + }, + "capability_name": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string" + }, + "input_schema": { + "type": "object", + "additionalProperties": true + }, + "output_schema": { + "type": "object", + "additionalProperties": true + }, + "risk_level": { + "type": "string", + "enum": [ + "read", + "write", + "destructive", + "external_side_effect" + ] + }, + "requires_approval": { + "type": "boolean" + }, + "capability_digest": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + } + } + } + } + }, + "required": [ + "snapshot_id", + "created_at", + "capabilities_hash", + "capabilities" + ], + "$id": "https://opencot.dev/schemas/rfc-0002-capability-snapshot.json", + "x-opencot": { + "rfc": "0002", + "shortname": "capability_snapshot", + "source_rfc": "rfcs/0002-capability-snapshot.md" + } +} diff --git a/schemas/rfc-0002-verifier.json b/schemas/rfc-0002-verifier.json deleted file mode 100644 index aa68cde..0000000 --- a/schemas/rfc-0002-verifier.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Verifier Output v0.1", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ], - "description": "Schema version." - }, - "trace_id": { - "type": "string", - "description": "Optional ID linking to a reasoning trace." - }, - "verifier": { - "type": "string", - "description": "Name or identifier of the verifier." - }, - "results": { - "type": "array", - "description": "Verification results for each reasoning step.", - "items": { - "type": "object", - "properties": { - "step_id": { - "type": "string", - "description": "ID of the step being verified (matches RFC 0001)." - }, - "correct": { - "type": "string", - "enum": [ - "true", - "false", - "unknown" - ], - "description": "Whether the step is correct." - }, - "confidence": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Verifier confidence in the correctness judgment." - }, - "error_type": { - "type": "string", - "description": "Optional classification of the error.", - "enum": [ - "arithmetic", - "logical", - "factual", - "hallucination", - "unsupported_claim", - "invalid_tool_use", - "format_error", - "other" - ] - }, - "justification": { - "type": "string", - "description": "Optional natural-language explanation of the verdict." - }, - "reward": { - "type": "number", - "description": "Optional RL reward signal for this step." - }, - "metadata": { - "type": "object", - "description": "Optional additional verifier-specific metadata." - } - }, - "required": [ - "step_id", - "correct" - ] - } - } - }, - "required": [ - "version", - "results" - ], - "$id": "https://opencot.dev/schemas/rfc-0002-verifier.json", - "x-opencot": { - "rfc": "0002", - "shortname": "verifier_output", - "source_rfc": "rfcs/0002-verifier-output-schema.md" - } -} diff --git a/schemas/rfc-0003-execution-intent.json b/schemas/rfc-0003-execution-intent.json new file mode 100644 index 0000000..df09dec --- /dev/null +++ b/schemas/rfc-0003-execution-intent.json @@ -0,0 +1,80 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0003 - Execution Intent and Endpoint Invocation", + "type": "object", + "additionalProperties": false, + "properties": { + "intent_id": { + "type": "string", + "minLength": 1 + }, + "snapshot_id": { + "type": "string", + "minLength": 1 + }, + "endpoint_id": { + "type": "string", + "minLength": 1 + }, + "capability_name": { + "type": "string", + "minLength": 1 + }, + "capability_digest": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "risk_level": { + "type": "string", + "enum": [ + "read", + "write", + "destructive", + "external_side_effect" + ] + }, + "requires_approval": { + "type": "boolean" + }, + "idempotency_key": { + "type": "string", + "minLength": 1 + }, + "arguments": { + "type": "object" + }, + "preconditions": { + "type": "array", + "items": { + "type": "string" + } + }, + "expected_result_shape": { + "type": "object", + "additionalProperties": true + }, + "postconditions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "intent_id", + "snapshot_id", + "endpoint_id", + "capability_name", + "capability_digest", + "risk_level", + "requires_approval", + "idempotency_key", + "arguments" + ], + "$id": "https://opencot.dev/schemas/rfc-0003-execution-intent.json", + "x-opencot": { + "rfc": "0003", + "shortname": "execution_intent", + "source_rfc": "rfcs/0003-execution-intent.md" + } +} diff --git a/schemas/rfc-0003-tool.json b/schemas/rfc-0003-tool.json deleted file mode 100644 index 6215b6d..0000000 --- a/schemas/rfc-0003-tool.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Tool Invocation v0.1", - "type": "object", - "properties": { - "tool_name": { - "type": "string", - "description": "Name of the tool being invoked." - }, - "arguments": { - "type": "object", - "description": "JSON arguments passed to the tool." - }, - "result": { - "type": "object", - "description": "Structured output returned by the tool.", - "properties": { - "output": { - "description": "Primary tool output (string or structured)." - }, - "error": { - "type": "string", - "description": "Optional error message if the tool failed." - }, - "metadata": { - "type": "object", - "description": "Optional tool-specific metadata." - } - } - }, - "triggered_by_step": { - "type": "string", - "description": "ID of the reasoning step that triggered this tool call." - }, - "observation_step": { - "type": "string", - "description": "ID of the observation step that records the tool output." - } - }, - "required": [ - "tool_name", - "arguments", - "triggered_by_step" - ], - "$id": "https://opencot.dev/schemas/rfc-0003-tool.json", - "x-opencot": { - "rfc": "0003", - "shortname": "tool_invocation", - "source_rfc": "rfcs/0003-tool-invocation-schema.md" - } -} diff --git a/schemas/rfc-0004-branching.json b/schemas/rfc-0004-branching.json deleted file mode 100644 index 35215a1..0000000 --- a/schemas/rfc-0004-branching.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0004 — Branching / ToT / GoT step extensions", - "description": "Optional fields extending RFC 0001 reasoning steps. Valid step objects SHOULD satisfy RFC 0001 and MAY include any of these properties.", - "type": "object", - "properties": { - "branch_group": { - "type": "string", - "description": "Identifier for a set of sibling branches exploring alternative reasoning paths." - }, - "branch_score": { - "type": "number", - "minimum": -1, - "maximum": 1, - "description": "Score assigned to this branch (model, verifier, or search algorithm)." - }, - "pruned": { - "type": "boolean", - "description": "Whether this branch was pruned during search." - }, - "exploration_strategy": { - "type": "string", - "enum": [ - "bfs", - "dfs", - "beam", - "heuristic", - "rl", - "unknown" - ], - "description": "Search strategy used to explore this branch." - }, - "path_id": { - "type": "string", - "description": "Identifier for a complete reasoning path from root to leaf." - } - }, - "additionalProperties": true, - "$id": "https://opencot.dev/schemas/rfc-0004-branching.json", - "x-opencot": { - "rfc": "0004", - "shortname": "branching", - "source_rfc": "rfcs/0004-branching-reasoning-schema.md" - } -} diff --git a/schemas/rfc-0004-policy-gate.json b/schemas/rfc-0004-policy-gate.json new file mode 100644 index 0000000..8b45687 --- /dev/null +++ b/schemas/rfc-0004-policy-gate.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0004 - Policy Gate and Permission Evaluation", + "type": "object", + "additionalProperties": false, + "properties": { + "evaluation_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string" + }, + "evaluated_at": { + "type": "string", + "format": "date-time" + }, + "result": { + "type": "string", + "enum": [ + "allow", + "deny", + "requires_approval", + "yield" + ] + }, + "reason": { + "type": "string" + }, + "constraints": { + "type": "object", + "additionalProperties": true + }, + "budget_snapshot": { + "$ref": "rfc-0008-execution-budget.json" + } + }, + "required": [ + "evaluation_id", + "evaluated_at", + "result", + "reason" + ], + "$id": "https://opencot.dev/schemas/rfc-0004-policy-gate.json", + "x-opencot": { + "rfc": "0004", + "shortname": "policy_gate", + "source_rfc": "rfcs/0004-policy-gate.md" + } +} diff --git a/schemas/rfc-0005-observation-receipt.json b/schemas/rfc-0005-observation-receipt.json new file mode 100644 index 0000000..d87266e --- /dev/null +++ b/schemas/rfc-0005-observation-receipt.json @@ -0,0 +1,102 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0005 - Observation, Receipt, and Audit Evidence", + "type": "object", + "additionalProperties": false, + "properties": { + "observation": { + "$ref": "#/$defs/observation" + }, + "receipt": { + "$ref": "#/$defs/receipt" + } + }, + "$defs": { + "observation": { + "type": "object", + "additionalProperties": false, + "required": [ + "observation_id", + "status", + "summary", + "observed_at" + ], + "properties": { + "observation_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "recorded", + "skipped", + "error" + ] + }, + "summary": { + "type": "string" + }, + "output": {}, + "observed_at": { + "type": "string", + "format": "date-time" + } + } + }, + "receipt": { + "type": "object", + "additionalProperties": false, + "required": [ + "receipt_id", + "intent_id", + "endpoint_id", + "status", + "issued_at" + ], + "properties": { + "receipt_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string", + "minLength": 1 + }, + "endpoint_id": { + "type": "string", + "minLength": 1 + }, + "status": { + "type": "string", + "enum": [ + "executed", + "skipped", + "failed" + ] + }, + "input_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "output_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "issued_at": { + "type": "string", + "format": "date-time" + } + } + } + }, + "$id": "https://opencot.dev/schemas/rfc-0005-observation-receipt.json", + "x-opencot": { + "rfc": "0005", + "shortname": "observation_receipt", + "source_rfc": "rfcs/0005-observation-receipt.md" + } +} diff --git a/schemas/rfc-0005-reward.json b/schemas/rfc-0005-reward.json deleted file mode 100644 index 8511bd8..0000000 --- a/schemas/rfc-0005-reward.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT RL Reward Trace v0.1", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ], - "description": "Schema version." - }, - "trace_id": { - "type": "string", - "description": "ID linking to a reasoning trace (RFC 0001)." - }, - "reward_sources": { - "type": "array", - "description": "List of reward sources (verifiers, heuristics, humans, etc.).", - "items": { - "type": "string" - } - }, - "step_rewards": { - "type": "array", - "description": "Reward assigned to each reasoning step.", - "items": { - "type": "object", - "properties": { - "step_id": { - "type": "string", - "description": "ID of the step being rewarded." - }, - "reward": { - "type": "number", - "description": "Reward value for this step." - }, - "source": { - "type": "string", - "description": "Source of the reward (verifier, heuristic, human)." - } - }, - "required": [ - "step_id", - "reward" - ] - } - }, - "branch_rewards": { - "type": "array", - "description": "Reward assigned to branches (ToT/GoT).", - "items": { - "type": "object", - "properties": { - "branch_group": { - "type": "string", - "description": "Branch group ID (RFC 0004)." - }, - "path_id": { - "type": "string", - "description": "Path identifier for this branch." - }, - "reward": { - "type": "number", - "description": "Reward for this branch." - } - }, - "required": [ - "reward" - ] - } - }, - "trajectory_reward": { - "type": "number", - "description": "Reward for the entire reasoning trajectory." - }, - "credit_assignment": { - "type": "string", - "enum": [ - "monte_carlo", - "temporal_difference", - "heuristic", - "unknown" - ], - "description": "Method used to propagate rewards backward." - } - }, - "required": [ - "version" - ], - "$id": "https://opencot.dev/schemas/rfc-0005-reward.json", - "x-opencot": { - "rfc": "0005", - "shortname": "reward", - "source_rfc": "rfcs/0005-rl-reward-trace-schema.md" - } -} diff --git a/schemas/rfc-0006-ensemble.json b/schemas/rfc-0006-ensemble.json deleted file mode 100644 index b16e672..0000000 --- a/schemas/rfc-0006-ensemble.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Multi-Verifier Ensemble v0.1", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ], - "description": "Schema version." - }, - "trace_id": { - "type": "string", - "description": "ID linking to a reasoning trace (RFC 0001)." - }, - "verifier_outputs": { - "type": "array", - "description": "List of raw verifier outputs (RFC 0002).", - "items": { - "type": "object", - "description": "A single verifier's output." - } - }, - "fusion_strategy": { - "type": "string", - "enum": [ - "majority_vote", - "weighted_vote", - "confidence_weighted", - "max_confidence", - "min_confidence", - "average_reward", - "custom" - ], - "description": "Strategy used to combine verifier outputs." - }, - "weights": { - "type": "object", - "description": "Optional weights for weighted fusion strategies.", - "additionalProperties": { - "type": "number" - } - }, - "fused_step_results": { - "type": "array", - "description": "Final correctness judgments per step.", - "items": { - "type": "object", - "properties": { - "step_id": { - "type": "string" - }, - "correct": { - "type": "string", - "enum": [ - "true", - "false", - "unknown" - ] - }, - "confidence": { - "type": "number", - "minimum": 0, - "maximum": 1 - } - }, - "required": [ - "step_id", - "correct" - ] - } - }, - "fused_rewards": { - "type": "array", - "description": "Final reward values per step (RFC 0005).", - "items": { - "type": "object", - "properties": { - "step_id": { - "type": "string" - }, - "reward": { - "type": "number" - } - }, - "required": [ - "step_id", - "reward" - ] - } - }, - "disagreement_metrics": { - "type": "object", - "description": "Optional diagnostics about verifier disagreement.", - "properties": { - "num_verifiers": { - "type": "number" - }, - "num_disagreements": { - "type": "number" - }, - "disagreement_rate": { - "type": "number" - } - } - } - }, - "required": [ - "version", - "verifier_outputs", - "fusion_strategy" - ], - "$id": "https://opencot.dev/schemas/rfc-0006-ensemble.json", - "x-opencot": { - "rfc": "0006", - "shortname": "ensemble", - "source_rfc": "rfcs/0006-multi-verifier-ensemble-schema.md" - } -} diff --git a/schemas/rfc-0053-reconciliation-result.json b/schemas/rfc-0006-reconciliation-result.json similarity index 76% rename from schemas/rfc-0053-reconciliation-result.json rename to schemas/rfc-0006-reconciliation-result.json index 2cef960..c18537a 100644 --- a/schemas/rfc-0053-reconciliation-result.json +++ b/schemas/rfc-0006-reconciliation-result.json @@ -1,19 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/v0.10/reconciliation-result.json", - "title": "Open CoT RFC 0053 — Reconciliation Result and Error Taxonomy", + "title": "Open CoT RFC 0006 - Reconciliation Result and Error Taxonomy", "type": "object", "additionalProperties": false, - "required": [ - "reconciliation_id", - "status", - "capability_snapshot", - "executed_intents", - "skipped_intents", - "observations", - "errors", - "final_message" - ], "properties": { "reconciliation_id": { "type": "string", @@ -30,27 +19,27 @@ ] }, "capability_snapshot": { - "$ref": "rfc-0052-cognitive-artifact.json#/$defs/capability_snapshot" + "$ref": "rfc-0002-capability-snapshot.json" }, "artifact": { - "$ref": "rfc-0052-cognitive-artifact.json#/$defs/cognitive_artifact" + "$ref": "rfc-0001-cognitive-artifact.json" }, "executed_intents": { "type": "array", "items": { - "$ref": "rfc-0052-cognitive-artifact.json#/$defs/execution_intent" + "$ref": "rfc-0003-execution-intent.json" } }, "skipped_intents": { "type": "array", "items": { - "$ref": "rfc-0052-cognitive-artifact.json#/$defs/execution_intent" + "$ref": "rfc-0003-execution-intent.json" } }, "observations": { "type": "array", "items": { - "$ref": "rfc-0052-cognitive-artifact.json#/$defs/observation" + "$ref": "rfc-0005-observation-receipt.json#/$defs/observation" } }, "errors": { @@ -63,13 +52,23 @@ "type": "string" } }, + "required": [ + "reconciliation_id", + "status", + "capability_snapshot", + "executed_intents", + "skipped_intents", + "observations", + "errors", + "final_message" + ], "$defs": { "error_code": { "type": "string", "enum": [ "INVALID_ARTIFACT", "SNAPSHOT_MISMATCH", - "UNKNOWN_MCP_SERVER", + "UNKNOWN_ENDPOINT", "UNKNOWN_CAPABILITY", "CAPABILITY_DIGEST_MISMATCH", "SCHEMA_VALIDATION_FAILED", @@ -77,7 +76,7 @@ "APPROVAL_REQUIRED", "PRECONDITION_FAILED", "BUDGET_EXCEEDED", - "MCP_EXECUTION_FAILED", + "ENDPOINT_EXECUTION_FAILED", "RESULT_VALIDATION_FAILED", "YIELDED" ] @@ -111,9 +110,10 @@ } } }, + "$id": "https://opencot.dev/schemas/rfc-0006-reconciliation-result.json", "x-opencot": { - "rfc": "0053", + "rfc": "0006", "shortname": "reconciliation_result", - "source_rfc": "rfcs/0053-reconciliation-result.md" + "source_rfc": "rfcs/0006-reconciliation-result.md" } } diff --git a/schemas/rfc-0007-cognitive-pipeline.json b/schemas/rfc-0007-cognitive-pipeline.json index 43f9b1b..fe09777 100644 --- a/schemas/rfc-0007-cognitive-pipeline.json +++ b/schemas/rfc-0007-cognitive-pipeline.json @@ -1,33 +1,72 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0007 — Cognitive Pipeline Protocol Trace", - "description": "Reasoning trace emitted by a cognitive pipeline (RFC 0007). Extends RFC 0001 with optional tool_invocation on action steps (RFC 0003).", - "allOf": [ - { - "$ref": "rfc-0001-reasoning.json" + "title": "Open CoT RFC 0007 - Runtime Boundary and Cognitive Pipeline", + "type": "object", + "additionalProperties": true, + "properties": { + "version": { + "type": "string" }, - { - "type": "object", - "properties": { - "steps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "tool_invocation": { - "type": "object", - "description": "Structured tool call when type is action (RFC 0003)." + "task": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "required": [ + "id", + "type", + "content" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "content": { + "type": "string" + }, + "parent": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } } - } + ] + }, + "tool_invocation": { + "type": "object", + "additionalProperties": true } } } + }, + "final_answer": { + "type": "string" + }, + "termination": { + "type": "string" } + }, + "required": [ + "version", + "task", + "steps", + "final_answer" ], "$id": "https://opencot.dev/schemas/rfc-0007-cognitive-pipeline.json", "x-opencot": { "rfc": "0007", "shortname": "cognitive_pipeline", - "source_rfc": "rfcs/0007-cognitive-pipeline-protocol.md" + "source_rfc": "rfcs/0007-cognitive-pipeline.md" } } diff --git a/schemas/rfc-0008-dataset.json b/schemas/rfc-0008-dataset.json deleted file mode 100644 index 2b790c0..0000000 --- a/schemas/rfc-0008-dataset.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0008 — Dataset package manifest", - "description": "manifest.json for a packaged reasoning dataset (RFC 0008).", - "type": "object", - "required": [ - "version", - "name", - "description", - "schemas", - "counts", - "splits", - "created_at", - "license" - ], - "properties": { - "version": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "schemas": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Declared Open CoT sub-schema versions for packaged artifacts." - }, - "counts": { - "type": "object", - "additionalProperties": { - "type": "integer", - "minimum": 0 - } - }, - "splits": { - "type": "array", - "items": { - "type": "string" - } - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "license": { - "type": "string" - } - }, - "$defs": { - "dataset_metadata": { - "type": "object", - "properties": { - "domain": { - "type": "string" - }, - "source": { - "type": "string" - }, - "language": { - "type": "string" - }, - "num_tokens": { - "type": "integer", - "minimum": 0 - } - }, - "additionalProperties": true - }, - "splits_map": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "$id": "https://opencot.dev/schemas/rfc-0008-dataset.json", - "x-opencot": { - "rfc": "0008", - "shortname": "dataset_packaging", - "source_rfc": "rfcs/0008-dataset-packaging-standard.md" - } -} diff --git a/schemas/rfc-0008-execution-budget.json b/schemas/rfc-0008-execution-budget.json new file mode 100644 index 0000000..fffbaf1 --- /dev/null +++ b/schemas/rfc-0008-execution-budget.json @@ -0,0 +1,45 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0008 - Budget, Cost, and Temporal Bounds", + "type": "object", + "additionalProperties": false, + "properties": { + "budget_id": { + "type": "string", + "minLength": 1 + }, + "max_execution_intents": { + "type": "integer", + "minimum": 0 + }, + "max_endpoint_calls": { + "type": "integer", + "minimum": 0 + }, + "max_tokens": { + "type": "integer", + "minimum": 0 + }, + "max_cost_usd": { + "type": "number", + "minimum": 0 + }, + "valid_after": { + "type": "string", + "format": "date-time" + }, + "valid_until": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "budget_id" + ], + "$id": "https://opencot.dev/schemas/rfc-0008-execution-budget.json", + "x-opencot": { + "rfc": "0008", + "shortname": "execution_budget", + "source_rfc": "rfcs/0008-execution-budget.md" + } +} diff --git a/schemas/rfc-0009-requester-identity.json b/schemas/rfc-0009-requester-identity.json new file mode 100644 index 0000000..3c3cd7b --- /dev/null +++ b/schemas/rfc-0009-requester-identity.json @@ -0,0 +1,49 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0009 - Requester Identity and Governance Context", + "type": "object", + "additionalProperties": false, + "properties": { + "requester_id": { + "type": "string", + "minLength": 1 + }, + "kind": { + "type": "string", + "enum": [ + "model", + "service", + "human", + "runtime" + ] + }, + "display_name": { + "type": "string" + }, + "trust_level": { + "type": "string", + "enum": [ + "untrusted", + "low", + "medium", + "high", + "system" + ] + }, + "governance_context": { + "type": "object", + "additionalProperties": true + } + }, + "required": [ + "requester_id", + "kind", + "trust_level" + ], + "$id": "https://opencot.dev/schemas/rfc-0009-requester-identity.json", + "x-opencot": { + "rfc": "0009", + "shortname": "requester_identity", + "source_rfc": "rfcs/0009-requester-identity.md" + } +} diff --git a/schemas/rfc-0009-reward-fusion.json b/schemas/rfc-0009-reward-fusion.json deleted file mode 100644 index a581f9e..0000000 --- a/schemas/rfc-0009-reward-fusion.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Reward Fusion Specification v0.1", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ], - "description": "Schema version." - }, - "trace_id": { - "type": "string", - "description": "ID linking to a reasoning trace (RFC 0001)." - }, - "fusion_strategy": { - "type": "string", - "enum": [ - "sum", - "mean", - "weighted", - "confidence_weighted", - "max", - "min", - "product", - "custom" - ], - "description": "Strategy used to fuse reward signals." - }, - "weights": { - "type": "object", - "description": "Optional weights for weighted fusion strategies.", - "additionalProperties": { - "type": "number" - } - }, - "step_fusion": { - "type": "array", - "description": "Fused step-level rewards.", - "items": { - "type": "object", - "properties": { - "step_id": { - "type": "string" - }, - "reward": { - "type": "number" - }, - "sources": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "step_id", - "reward" - ] - } - }, - "branch_fusion": { - "type": "array", - "description": "Fused branch-level rewards.", - "items": { - "type": "object", - "properties": { - "branch_group": { - "type": "string" - }, - "path_id": { - "type": "string" - }, - "reward": { - "type": "number" - } - }, - "required": [ - "reward" - ] - } - }, - "trajectory_reward": { - "type": "number", - "description": "Final fused reward for the entire trajectory." - }, - "metadata": { - "type": "object", - "description": "Optional metadata for custom fusion strategies." - } - }, - "required": [ - "version", - "fusion_strategy" - ], - "$id": "https://opencot.dev/schemas/rfc-0009-reward-fusion.json", - "x-opencot": { - "rfc": "0009", - "shortname": "reward_fusion", - "source_rfc": "rfcs/0009-reward-fusion-specification.md" - } -} diff --git a/schemas/rfc-0010-cognitive-context.json b/schemas/rfc-0010-cognitive-context.json deleted file mode 100644 index d52975f..0000000 --- a/schemas/rfc-0010-cognitive-context.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Cognitive pipeline Memory Schema v0.1", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.2" - ], - "description": "Schema version." - }, - "requester_id": { - "type": "string", - "description": "Unique identifier for the cognitive pipeline." - }, - "short_term_memory": { - "type": "array", - "description": "Ephemeral memory entries for the current episode.", - "items": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": {}, - "type": { - "type": "string" - }, - "expires_at": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "key", - "value" - ] - } - }, - "long_term_memory": { - "type": "array", - "description": "Persistent memory entries across episodes.", - "items": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": {}, - "type": { - "type": "string" - }, - "observed_at": { - "type": "string", - "format": "date-time" - }, - "superseded_at": { - "type": "string", - "format": "date-time" - }, - "confidence": { - "type": "number" - } - }, - "required": [ - "key", - "value" - ] - } - }, - "episodic_memory": { - "type": "array", - "description": "Chronological logs of past episodes.", - "items": { - "type": "object", - "properties": { - "episode_id": { - "type": "string" - }, - "observed_at": { - "type": "string", - "format": "date-time" - }, - "summary": { - "type": "string" - }, - "metadata": { - "type": "object" - } - }, - "required": [ - "episode_id", - "observed_at" - ] - } - }, - "tool_memory": { - "type": "object", - "description": "Tool-specific memory keyed by tool name.", - "additionalProperties": { - "type": "object", - "properties": { - "state": { - "type": "object" - }, - "observed_at": { - "type": "string", - "format": "date-time" - } - } - } - } - }, - "required": [ - "version", - "requester_id" - ], - "$id": "https://opencot.dev/schemas/rfc-0010-cognitive-context.json", - "x-opencot": { - "rfc": "0010", - "shortname": "cognitive_context", - "source_rfc": "rfcs/0010-cognitive-context-schema.md" - } -} diff --git a/schemas/rfc-0010-human-approval.json b/schemas/rfc-0010-human-approval.json new file mode 100644 index 0000000..f8c03dd --- /dev/null +++ b/schemas/rfc-0010-human-approval.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0010 - Human Approval, Yield, and Resume", + "type": "object", + "additionalProperties": false, + "properties": { + "approval_id": { + "type": "string", + "minLength": 1 + }, + "intent_id": { + "type": "string" + }, + "requested_at": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "enum": [ + "requested", + "approved", + "rejected", + "timeout", + "yielded" + ] + }, + "prompt": { + "type": "string" + }, + "response": { + "type": "string" + }, + "resume_token": { + "type": "string" + } + }, + "required": [ + "approval_id", + "requested_at", + "status", + "prompt" + ], + "$id": "https://opencot.dev/schemas/rfc-0010-human-approval.json", + "x-opencot": { + "rfc": "0010", + "shortname": "human_approval", + "source_rfc": "rfcs/0010-human-approval.md" + } +} diff --git a/schemas/rfc-0011-conformance-registry.json b/schemas/rfc-0011-conformance-registry.json new file mode 100644 index 0000000..912824c --- /dev/null +++ b/schemas/rfc-0011-conformance-registry.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0011 - Conformance, Registry, and Compatibility Rules", + "type": "object", + "additionalProperties": false, + "properties": { + "registry_version": { + "type": "string" + }, + "profile": { + "type": "string", + "enum": [ + "core", + "runtime-boundary", + "full" + ] + }, + "schemas": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required_examples": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "registry_version", + "profile", + "schemas" + ], + "$id": "https://opencot.dev/schemas/rfc-0011-conformance-registry.json", + "x-opencot": { + "rfc": "0011", + "shortname": "conformance_registry", + "source_rfc": "rfcs/0011-conformance-registry.md" + } +} diff --git a/schemas/rfc-0011-multi-party-cognition-protocol.json b/schemas/rfc-0011-multi-party-cognition-protocol.json deleted file mode 100644 index 5491e9a..0000000 --- a/schemas/rfc-0011-multi-party-cognition-protocol.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCoT Multi-Party Protocol v0.2", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "pipelines": { - "type": "array", - "items": { - "type": "object", - "properties": { - "requester_id": { - "type": "string" - }, - "role": { - "type": "string" - }, - "capabilities": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "requester_id", - "role" - ] - } - }, - "messages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "message_id": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "observed_at": { - "type": "string", - "format": "date-time" - }, - "content": { - "type": "string" - }, - "metadata": { - "type": "object" - } - }, - "required": [ - "message_id", - "sender", - "receiver", - "observed_at", - "content" - ] - } - }, - "shared_memory": { - "type": "object" - }, - "coordination_strategy": { - "type": "string" - } - }, - "required": [ - "version", - "pipelines", - "messages" - ], - "$id": "https://opencot.dev/schemas/rfc-0011-multi-party-cognition-protocol.json", - "x-opencot": { - "rfc": "0011", - "shortname": "multi_party_cognition_protocol", - "source_rfc": "rfcs/0011-multi-party-cognition-protocol.md" - } -} diff --git a/schemas/rfc-0012-compact-context.json b/schemas/rfc-0012-compact-context.json new file mode 100644 index 0000000..29bebda --- /dev/null +++ b/schemas/rfc-0012-compact-context.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Open CoT RFC 0012 - Compact Context Serialization", + "type": "object", + "additionalProperties": false, + "properties": { + "format": { + "type": "string", + "enum": [ + "json", + "compact-json", + "toon" + ] + }, + "schema_ref": { + "type": "string", + "minLength": 1 + }, + "content": { + "type": "string" + }, + "content_hash": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + } + }, + "required": [ + "format", + "schema_ref", + "content" + ], + "$id": "https://opencot.dev/schemas/rfc-0012-compact-context.json", + "x-opencot": { + "rfc": "0012", + "shortname": "compact_context", + "source_rfc": "rfcs/0012-compact-context.md" + } +} diff --git a/schemas/rfc-0012-dataset-streaming.json b/schemas/rfc-0012-dataset-streaming.json deleted file mode 100644 index 2ed45ce..0000000 --- a/schemas/rfc-0012-dataset-streaming.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0012 — Dataset Streaming (stub)", - "description": "Placeholder JSON Schema for RFC 0012. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0012", - "shortname": "dataset_streaming", - "status": "stub", - "source_rfc": "rfcs/0012-dataset-streaming-format.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0012-dataset-streaming.json" -} diff --git a/schemas/rfc-0013-memory-compression.json b/schemas/rfc-0013-memory-compression.json deleted file mode 100644 index 15db9ba..0000000 --- a/schemas/rfc-0013-memory-compression.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0013 — Memory Compression (stub)", - "description": "Placeholder JSON Schema for RFC 0013. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0013", - "shortname": "memory_compression", - "status": "stub", - "source_rfc": "rfcs/0013-memory-compression-embedding.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0013-memory-compression.json" -} diff --git a/schemas/rfc-0014-memory-conflict-resolution.json b/schemas/rfc-0014-memory-conflict-resolution.json deleted file mode 100644 index fa7a036..0000000 --- a/schemas/rfc-0014-memory-conflict-resolution.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0014 — Memory Conflict Resolution", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "key": { - "type": "string" - }, - "entries": { - "type": "array", - "items": { - "type": "object", - "properties": { - "value": {}, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "confidence": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "provenance": { - "type": "string" - } - }, - "required": [ - "value" - ] - }, - "minItems": 1 - }, - "resolution_strategy": { - "type": "string", - "enum": [ - "prefer_newest", - "prefer_highest_confidence", - "weighted_merge", - "provenance_priority", - "custom" - ] - }, - "resolved_value": {} - }, - "required": [ - "version", - "key", - "entries", - "resolution_strategy", - "resolved_value" - ], - "$id": "https://opencot.dev/schemas/rfc-0014-memory-conflict-resolution.json", - "x-opencot": { - "rfc": "0014", - "shortname": "memory_conflict_resolution", - "source_rfc": "rfcs/0014-memory-conflict-resolution.md" - } -} diff --git a/schemas/rfc-0015-multi-party-reward-sharing.json b/schemas/rfc-0015-multi-party-reward-sharing.json deleted file mode 100644 index 13fca5c..0000000 --- a/schemas/rfc-0015-multi-party-reward-sharing.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0015 — Multi Party Reward Sharing (stub)", - "description": "Placeholder JSON Schema for RFC 0015. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0015", - "shortname": "multi_party_reward_sharing", - "status": "stub", - "source_rfc": "rfcs/0015-multi-party-reward-sharing.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0015-multi-party-reward-sharing.json" -} diff --git a/schemas/rfc-0016-tool-capability-negotiation.json b/schemas/rfc-0016-tool-capability-negotiation.json deleted file mode 100644 index 8b13938..0000000 --- a/schemas/rfc-0016-tool-capability-negotiation.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0016 — Tool Capability Negotiation (stub)", - "description": "Placeholder JSON Schema for RFC 0016. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0016", - "shortname": "tool_capability_negotiation", - "status": "stub", - "source_rfc": "rfcs/0016-tool-capability-negotiation.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0016-tool-capability-negotiation.json" -} diff --git a/schemas/rfc-0017-runtime-safety-sandboxing.json b/schemas/rfc-0017-runtime-safety-sandboxing.json deleted file mode 100644 index 0a48411..0000000 --- a/schemas/rfc-0017-runtime-safety-sandboxing.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0017 — Cognitive pipeline Safety & Sandboxing Configuration", - "description": "Defines sandbox policies that constrain cognitive pipeline behavior at runtime: which tools are permitted, step/branch limits, and memory access controls.", - "type": "object", - "properties": { - "allowed_tools": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Tool names the cognitive pipeline may invoke. Use [\"*\"] to allow all." - }, - "blocked_tools": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Tool names explicitly denied regardless of allowed_tools." - }, - "max_steps": { - "type": "integer", - "minimum": 1, - "description": "Maximum number of loop iterations before forced stop." - }, - "max_branches": { - "type": "integer", - "minimum": 1, - "description": "Maximum number of concurrent reasoning branches." - }, - "memory_acl": { - "type": "object", - "description": "Access control list mapping role or requester IDs to permission arrays.", - "additionalProperties": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "read", - "write", - "execute", - "admin" - ] - } - } - } - }, - "required": [ - "allowed_tools", - "blocked_tools", - "max_steps" - ], - "additionalProperties": true, - "$id": "https://opencot.dev/schemas/rfc-0017-runtime-safety-sandboxing.json", - "x-opencot": { - "rfc": "0017", - "shortname": "runtime_safety_sandboxing", - "source_rfc": "rfcs/0017-runtime-safety-sandboxing.md" - } -} diff --git a/schemas/rfc-0018-tool-error-taxonomy.json b/schemas/rfc-0018-tool-error-taxonomy.json deleted file mode 100644 index 075e025..0000000 --- a/schemas/rfc-0018-tool-error-taxonomy.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0018 — Tool Error Taxonomy", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "tool_name": { - "type": "string" - }, - "error_code": { - "type": "string", - "enum": [ - "auth_error", - "permission_error", - "timeout_error", - "input_validation_error", - "tool_unavailable", - "execution_error", - "rate_limited", - "unknown_error" - ] - }, - "message": { - "type": "string" - }, - "retryable": { - "type": "boolean" - }, - "metadata": { - "type": "object" - } - }, - "required": [ - "version", - "tool_name", - "error_code", - "message", - "retryable" - ], - "$id": "https://opencot.dev/schemas/rfc-0018-tool-error-taxonomy.json", - "x-opencot": { - "rfc": "0018", - "shortname": "tool_error_taxonomy", - "source_rfc": "rfcs/0018-tool-error-taxonomy.md" - } -} diff --git a/schemas/rfc-0019-collaborative-planning-graphs.json b/schemas/rfc-0019-collaborative-planning-graphs.json deleted file mode 100644 index a9eef2b..0000000 --- a/schemas/rfc-0019-collaborative-planning-graphs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0019 — Collaborative Planning Graphs (stub)", - "description": "Placeholder JSON Schema for RFC 0019. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0019", - "shortname": "collaborative_planning_graphs", - "status": "stub", - "source_rfc": "rfcs/0019-collaborative-planning-graphs.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0019-collaborative-planning-graphs.json" -} diff --git a/schemas/rfc-0020-verifiable-scratchpad-compression.json b/schemas/rfc-0020-verifiable-scratchpad-compression.json deleted file mode 100644 index f3903ea..0000000 --- a/schemas/rfc-0020-verifiable-scratchpad-compression.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0020 — Verifiable Scratchpad Compression", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "trace_id": { - "type": "string" - }, - "compression": { - "type": "object", - "properties": { - "algorithm": { - "type": "string" - }, - "algorithm_version": { - "type": "string" - }, - "payload": { - "type": "string" - } - }, - "required": [ - "algorithm", - "algorithm_version", - "payload" - ] - }, - "source_step_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "source_hash": { - "type": "string" - }, - "provenance_ref": { - "type": "string" - } - }, - "required": [ - "version", - "trace_id", - "compression", - "source_step_ids", - "source_hash" - ], - "$id": "https://opencot.dev/schemas/rfc-0020-verifiable-scratchpad-compression.json", - "x-opencot": { - "rfc": "0020", - "shortname": "verifiable_scratchpad_compression", - "source_rfc": "rfcs/0020-verifiable-scratchpad-compression.md" - } -} diff --git a/schemas/rfc-0021-capability-declaration.json b/schemas/rfc-0021-capability-declaration.json deleted file mode 100644 index 6d6f62f..0000000 --- a/schemas/rfc-0021-capability-declaration.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0021 — Capability Declaration (stub)", - "description": "Placeholder JSON Schema for RFC 0021. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0021", - "shortname": "capability_declaration", - "status": "stub", - "source_rfc": "rfcs/0021-capability-declaration.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0021-capability-declaration.json" -} diff --git a/schemas/rfc-0022-cognitive-evaluation-protocol.json b/schemas/rfc-0022-cognitive-evaluation-protocol.json deleted file mode 100644 index 2ab4fad..0000000 --- a/schemas/rfc-0022-cognitive-evaluation-protocol.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0022 — Cognitive pipeline Evaluation Protocol", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "run_id": { - "type": "string" - }, - "model": { - "type": "string" - }, - "dataset_version": { - "type": "string" - }, - "harness_version": { - "type": "string" - }, - "reproducibility": { - "type": "object", - "properties": { - "seed": { - "type": "integer" - }, - "temperature": { - "type": "number" - }, - "top_p": { - "type": "number" - }, - "max_tokens": { - "type": "integer" - }, - "prompt_hash": { - "type": "string" - }, - "output_hash": { - "type": "string" - } - }, - "required": [ - "seed", - "temperature", - "top_p", - "max_tokens" - ] - }, - "metrics": { - "type": "object", - "properties": { - "final_answer_exact": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "schema_validity_rate": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "step_validity_proxy": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "safety_violations": { - "type": "integer", - "minimum": 0 - } - }, - "required": [ - "final_answer_exact", - "schema_validity_rate", - "step_validity_proxy" - ] - }, - "statistics": { - "type": "object", - "properties": { - "num_tasks": { - "type": "integer", - "minimum": 1 - }, - "confidence_interval_95": { - "type": "array", - "items": { - "type": "number" - }, - "minItems": 2, - "maxItems": 2 - }, - "stddev": { - "type": "number", - "minimum": 0 - } - }, - "required": [ - "num_tasks" - ] - } - }, - "required": [ - "version", - "run_id", - "model", - "dataset_version", - "harness_version", - "reproducibility", - "metrics", - "statistics" - ], - "$id": "https://opencot.dev/schemas/rfc-0022-cognitive-evaluation-protocol.json", - "x-opencot": { - "rfc": "0022", - "shortname": "cognitive_evaluation_protocol", - "source_rfc": "rfcs/0022-cognitive-evaluation-protocol.md" - } -} diff --git a/schemas/rfc-0023-human-in-the-loop.json b/schemas/rfc-0023-human-in-the-loop.json deleted file mode 100644 index 8921177..0000000 --- a/schemas/rfc-0023-human-in-the-loop.json +++ /dev/null @@ -1,194 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/human-interaction/v0.1", - "title": "Open CoT RFC 0023 — Human Interaction", - "definitions": { - "human_interaction_request": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "prompt", - "urgency", - "timeout_seconds", - "context", - "requested_by", - "presented_to" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "approval", - "clarification", - "review", - "override" - ] - }, - "prompt": { - "type": "string", - "minLength": 1 - }, - "options": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "label" - ], - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "label": { - "type": "string", - "minLength": 1 - }, - "description": { - "type": "string" - }, - "risk_hint": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - } - } - } - }, - "urgency": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "critical" - ] - }, - "timeout_seconds": { - "type": "integer", - "minimum": 1 - }, - "context": { - "type": "object", - "additionalProperties": false, - "required": [ - "run_id", - "requester_id", - "step_ref" - ], - "properties": { - "run_id": { - "type": "string", - "minLength": 1 - }, - "requester_id": { - "type": "string", - "minLength": 1 - }, - "step_ref": { - "type": "string", - "minLength": 1 - } - } - }, - "requested_by": { - "type": "object", - "additionalProperties": false, - "required": [ - "pipeline" - ], - "properties": { - "pipeline": { - "type": "string", - "minLength": 1 - }, - "role": { - "type": "string" - } - } - }, - "presented_to": { - "type": "object", - "additionalProperties": false, - "required": [ - "human" - ], - "properties": { - "human": { - "type": "string", - "minLength": 1 - }, - "queue": { - "type": "string" - }, - "channel": { - "type": "string" - } - } - }, - "request_id": { - "type": "string", - "minLength": 1 - } - } - }, - "human_interaction_response": { - "type": "object", - "additionalProperties": false, - "required": [ - "request_id", - "decision", - "responder_id", - "timestamp" - ], - "properties": { - "request_id": { - "type": "string", - "minLength": 1 - }, - "decision": { - "type": "string", - "enum": [ - "approved", - "rejected", - "modified", - "timeout" - ] - }, - "selected_option": { - "type": "string" - }, - "justification": { - "type": "string" - }, - "responder_id": { - "type": "string", - "minLength": 1 - }, - "timestamp": { - "type": "string", - "format": "date-time" - } - } - } - }, - "oneOf": [ - { - "$ref": "#/definitions/human_interaction_request" - }, - { - "$ref": "#/definitions/human_interaction_response" - } - ], - "x-opencot": { - "rfc": "0023", - "shortname": "human_in_the_loop", - "source_rfc": "rfcs/0023-humain-in-the-loop-schema.md" - } -} diff --git a/schemas/rfc-0024-multi-modal-reasoning.json b/schemas/rfc-0024-multi-modal-reasoning.json deleted file mode 100644 index 7a0aabb..0000000 --- a/schemas/rfc-0024-multi-modal-reasoning.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0024 — Multi Modal Reasoning (stub)", - "description": "Placeholder JSON Schema for RFC 0024. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0024", - "shortname": "multi_modal_reasoning", - "status": "stub", - "source_rfc": "rfcs/0024-multi-modal-reasoning-schema.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0024-multi-modal-reasoning.json" -} diff --git a/schemas/rfc-0025-tool-marketplace-registry.json b/schemas/rfc-0025-tool-marketplace-registry.json deleted file mode 100644 index 3246411..0000000 --- a/schemas/rfc-0025-tool-marketplace-registry.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/tool-registry/v0.1", - "title": "Open CoT RFC 0025 — Tool Registry", - "type": "object", - "additionalProperties": false, - "required": [ - "version", - "entries", - "updated_at" - ], - "properties": { - "version": { - "type": "string", - "const": "0.1" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "entries": { - "type": "array", - "items": { - "$ref": "#/definitions/tool_registry_entry" - } - } - }, - "definitions": { - "tool_registry_entry": { - "type": "object", - "additionalProperties": false, - "required": [ - "tool_name", - "version", - "description", - "input_schema", - "output_schema", - "required_permissions", - "risk_level", - "cost_estimate", - "timeout_default_ms", - "categories", - "author", - "documentation_url" - ], - "properties": { - "tool_name": { - "type": "string", - "minLength": 1 - }, - "version": { - "type": "string", - "minLength": 1 - }, - "description": { - "type": "string", - "minLength": 1 - }, - "input_schema": { - "type": "object" - }, - "output_schema": { - "type": "object" - }, - "required_permissions": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "risk_level": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "cost_estimate": { - "type": "object", - "additionalProperties": false, - "required": [ - "model" - ], - "properties": { - "model": { - "type": "string", - "enum": [ - "per_call_flat", - "per_token", - "custom" - ] - }, - "amount": { - "type": "number" - }, - "currency": { - "type": "string" - }, - "notes": { - "type": "string" - } - } - }, - "timeout_default_ms": { - "type": "integer", - "minimum": 1 - }, - "categories": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "author": { - "type": "string", - "minLength": 1 - }, - "documentation_url": { - "type": "string", - "format": "uri" - }, - "health_check_endpoint": { - "type": "string", - "format": "uri" - } - } - } - }, - "x-opencot": { - "rfc": "0025", - "shortname": "tool_marketplace_registry", - "source_rfc": "rfcs/0025-tool-marketplace-registry-format.md" - } -} diff --git a/schemas/rfc-0026-requester-identity-auth.json b/schemas/rfc-0026-requester-identity-auth.json deleted file mode 100644 index 2281147..0000000 --- a/schemas/rfc-0026-requester-identity-auth.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0026/requester-identity.json", - "title": "Open CoT RFC 0026 — Cognitive pipeline Identity", - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "requester_id": { - "type": "string", - "minLength": 1, - "pattern": "^[A-Za-z0-9._:@/-]+$" - }, - "display_name": { - "type": "string", - "minLength": 1 - }, - "role": { - "type": "string", - "enum": [ - "orchestrator", - "executor", - "verifier", - "delegated", - "custom" - ] - }, - "trust_level": { - "type": "string", - "enum": [ - "untrusted", - "low", - "medium", - "high", - "system" - ] - }, - "capabilities_declared": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "public_key": { - "type": "string" - }, - "key_algorithm": { - "type": "string" - }, - "parent_requester_id": { - "type": "string", - "minLength": 1 - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "metadata": { - "type": "object" - } - }, - "required": [ - "schema_version", - "requester_id", - "display_name", - "role", - "trust_level", - "capabilities_declared", - "created_at", - "metadata" - ], - "allOf": [ - { - "if": { - "required": [ - "public_key" - ], - "properties": { - "public_key": { - "minLength": 1 - } - } - }, - "then": { - "required": [ - "key_algorithm" - ] - } - } - ], - "x-opencot": { - "rfc": "0026", - "shortname": "requester_identity_auth", - "source_rfc": "rfcs/0026-requester-identity-auth.md" - } -} diff --git a/schemas/rfc-0027-distributed-execution.json b/schemas/rfc-0027-distributed-execution.json deleted file mode 100644 index 069b823..0000000 --- a/schemas/rfc-0027-distributed-execution.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/distributed-execution/v0.1", - "title": "Open CoT RFC 0027 — Distributed Execution", - "definitions": { - "execution_node": { - "type": "object", - "additionalProperties": false, - "required": [ - "node_id", - "requester_id", - "endpoint", - "capabilities", - "trust_level", - "status" - ], - "properties": { - "node_id": { - "type": "string", - "minLength": 1 - }, - "requester_id": { - "type": "string", - "minLength": 1 - }, - "endpoint": { - "type": "string", - "minLength": 1 - }, - "capabilities": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "trust_level": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "status": { - "type": "string", - "enum": [ - "active", - "draining", - "offline" - ] - } - } - }, - "task_assignment": { - "type": "object", - "additionalProperties": false, - "required": [ - "assignment_id", - "task_hash", - "assigned_to", - "parent_run_id", - "delegated_scope", - "timeout_seconds", - "priority" - ], - "properties": { - "assignment_id": { - "type": "string", - "minLength": 1 - }, - "task_hash": { - "type": "string", - "minLength": 1 - }, - "assigned_to": { - "type": "string", - "minLength": 1 - }, - "parent_run_id": { - "type": "string", - "minLength": 1 - }, - "delegated_scope": { - "type": "object", - "additionalProperties": true, - "required": [ - "summary" - ], - "properties": { - "summary": { - "type": "string", - "minLength": 1 - }, - "allowed_tools": { - "type": "array", - "items": { - "type": "string" - } - }, - "max_risk_level": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "valid_until": { - "type": "string", - "format": "date-time" - } - } - }, - "timeout_seconds": { - "type": "integer", - "minimum": 1 - }, - "priority": { - "type": "integer" - } - } - }, - "execution_result": { - "type": "object", - "additionalProperties": false, - "required": [ - "assignment_id", - "node_id", - "status", - "result_hash", - "trace_ref", - "receipt_refs" - ], - "properties": { - "assignment_id": { - "type": "string", - "minLength": 1 - }, - "node_id": { - "type": "string", - "minLength": 1 - }, - "status": { - "type": "string", - "enum": [ - "completed", - "failed", - "timeout" - ] - }, - "result_hash": { - "type": "string", - "minLength": 1 - }, - "trace_ref": { - "type": "string", - "minLength": 1 - }, - "receipt_refs": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - } - } - } - }, - "oneOf": [ - { - "$ref": "#/definitions/execution_node" - }, - { - "$ref": "#/definitions/task_assignment" - }, - { - "$ref": "#/definitions/execution_result" - } - ], - "x-opencot": { - "rfc": "0027", - "shortname": "distributed_execution", - "source_rfc": "rfcs/0027-distributed-execution-protocol.md" - } -} diff --git a/schemas/rfc-0028-capability-environment.json b/schemas/rfc-0028-capability-environment.json deleted file mode 100644 index df13e98..0000000 --- a/schemas/rfc-0028-capability-environment.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0028 — Capability Environment (stub)", - "description": "Placeholder JSON Schema for RFC 0028. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0028", - "shortname": "capability_environment", - "status": "stub", - "source_rfc": "rfcs/0028-capability-environment-schema.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0028-capability-environment.json" -} diff --git a/schemas/rfc-0029-cognitive-benchmark-dataset.json b/schemas/rfc-0029-cognitive-benchmark-dataset.json deleted file mode 100644 index 138f9f7..0000000 --- a/schemas/rfc-0029-cognitive-benchmark-dataset.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0029 — Cognitive Benchmark Dataset (stub)", - "description": "Placeholder JSON Schema for RFC 0029. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0029", - "shortname": "cognitive_benchmark_dataset", - "status": "stub", - "source_rfc": "rfcs/0029-cognitive-benchmark-dataset.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0029-cognitive-benchmark-dataset.json" -} diff --git a/schemas/rfc-0030-runtime-lifecycle-versioning.json b/schemas/rfc-0030-runtime-lifecycle-versioning.json deleted file mode 100644 index 278613d..0000000 --- a/schemas/rfc-0030-runtime-lifecycle-versioning.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/runtime-lifecycle/v0.2", - "title": "Open CoT RFC 0030 — Cognitive pipeline Lifecycle", - "definitions": { - "agent_lifecycle": { - "type": "object", - "additionalProperties": false, - "required": [ - "requester_id", - "version", - "lifecycle_state", - "created_at", - "observed_at", - "configuration_hash", - "capabilities", - "policy_refs", - "governance_ref" - ], - "properties": { - "requester_id": { - "type": "string", - "minLength": 1 - }, - "version": { - "type": "string", - "minLength": 1 - }, - "lifecycle_state": { - "type": "string", - "enum": [ - "draft", - "active", - "suspended", - "deprecated", - "retired" - ] - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "observed_at": { - "type": "string", - "format": "date-time" - }, - "configuration_hash": { - "type": "string", - "minLength": 1 - }, - "capabilities": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "policy_refs": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "governance_ref": { - "type": "string", - "minLength": 1 - } - } - }, - "version_transition": { - "type": "object", - "additionalProperties": false, - "required": [ - "from_version", - "to_version", - "migration_strategy", - "rollback_allowed", - "approved_by", - "decided_at", - "version_order" - ], - "properties": { - "from_version": { - "type": "string", - "minLength": 1 - }, - "to_version": { - "type": "string", - "minLength": 1 - }, - "migration_strategy": { - "type": "string", - "enum": [ - "rolling", - "blue-green", - "canary" - ] - }, - "rollback_allowed": { - "type": "boolean" - }, - "approved_by": { - "type": "string", - "minLength": 1 - }, - "decided_at": { - "type": "string", - "format": "date-time" - }, - "version_order": { - "type": "integer", - "minimum": 0 - } - } - } - }, - "oneOf": [ - { - "$ref": "#/definitions/agent_lifecycle" - }, - { - "$ref": "#/definitions/version_transition" - } - ], - "x-opencot": { - "rfc": "0030", - "shortname": "runtime_lifecycle_versioning", - "source_rfc": "rfcs/0030-runtime-lifecycle-versioning.md" - } -} diff --git a/schemas/rfc-0031-cognitive-observability-telemetry.json b/schemas/rfc-0031-cognitive-observability-telemetry.json deleted file mode 100644 index 3f49ea5..0000000 --- a/schemas/rfc-0031-cognitive-observability-telemetry.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0031 — Cognitive pipeline Observability and Telemetry", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "requester_id": { - "type": "string" - }, - "observed_at": { - "type": "string", - "format": "date-time" - }, - "ordering": { - "type": "object", - "additionalProperties": false, - "properties": { - "event_seq": { - "type": "integer", - "minimum": 0 - }, - "parent_event_id": { - "type": "string" - } - }, - "required": [ - "event_seq" - ] - }, - "metrics": { - "type": "object", - "properties": { - "steps": { - "type": "integer", - "minimum": 0 - }, - "tool_calls": { - "type": "integer", - "minimum": 0 - }, - "latency_ms": { - "type": "number", - "minimum": 0 - }, - "memory_reads": { - "type": "integer", - "minimum": 0 - }, - "safety_violations": { - "type": "integer", - "minimum": 0 - } - }, - "additionalProperties": true - } - }, - "required": [ - "version", - "requester_id", - "observed_at", - "ordering", - "metrics" - ], - "$id": "https://opencot.dev/schemas/rfc-0031-cognitive-observability-telemetry.json", - "x-opencot": { - "rfc": "0031", - "shortname": "cognitive_observability_telemetry", - "source_rfc": "rfcs/0031-cognitive-observability-telemetry.md" - } -} diff --git a/schemas/rfc-0032-runtime-deployment-manifest.json b/schemas/rfc-0032-runtime-deployment-manifest.json deleted file mode 100644 index 6f646e2..0000000 --- a/schemas/rfc-0032-runtime-deployment-manifest.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0032/deployment-manifest.json", - "title": "Open CoT RFC 0032 — Cognitive pipeline Deployment Manifest", - "type": "object", - "additionalProperties": false, - "$defs": { - "runtime": { - "type": "object", - "additionalProperties": false, - "properties": { - "container_image": { - "type": "string", - "minLength": 1 - }, - "entrypoint": { - "type": "array", - "items": { - "type": "string" - } - }, - "environment": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": [ - "container_image" - ] - }, - "resources": { - "type": "object", - "additionalProperties": false, - "properties": { - "cpu": { - "type": "string" - }, - "memory": { - "type": "string" - }, - "gpu": { - "type": "number", - "minimum": 0 - } - } - }, - "health_check": { - "type": "object", - "additionalProperties": true, - "properties": { - "kind": { - "type": "string", - "enum": [ - "http", - "tcp", - "exec", - "grpc" - ] - }, - "path": { - "type": "string" - }, - "port": { - "type": "integer", - "minimum": 1, - "maximum": 65535 - }, - "interval_seconds": { - "type": "integer", - "minimum": 1 - }, - "timeout_seconds": { - "type": "integer", - "minimum": 1 - }, - "success_threshold": { - "type": "integer", - "minimum": 1 - }, - "failure_threshold": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "kind" - ] - }, - "scaling": { - "type": "object", - "additionalProperties": false, - "properties": { - "min_replicas": { - "type": "integer", - "minimum": 0 - }, - "max_replicas": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "min_replicas", - "max_replicas" - ] - }, - "dependency": { - "type": "object", - "additionalProperties": false, - "properties": { - "ref": { - "type": "string", - "minLength": 1 - }, - "kind": { - "type": "string", - "enum": [ - "pipeline", - "dataset", - "tool_pack", - "model", - "other" - ] - }, - "version_constraint": { - "type": "string" - } - }, - "required": [ - "ref", - "kind" - ] - }, - "deployment_manifest": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "manifest_id": { - "type": "string", - "minLength": 1 - }, - "requester_id": { - "type": "string", - "minLength": 1 - }, - "version": { - "type": "string", - "minLength": 1 - }, - "runtime": { - "$ref": "#/$defs/runtime" - }, - "resources": { - "$ref": "#/$defs/resources" - }, - "policies": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "governance_ref": { - "type": "string", - "minLength": 1 - }, - "sandbox_config": { - "type": "object" - }, - "budget_defaults": { - "type": "object" - }, - "tool_allowlist": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "dependencies": { - "type": "array", - "items": { - "$ref": "#/$defs/dependency" - } - }, - "health_check": { - "$ref": "#/$defs/health_check" - }, - "scaling": { - "$ref": "#/$defs/scaling" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": [ - "schema_version", - "manifest_id", - "requester_id", - "version", - "runtime", - "policies", - "governance_ref", - "sandbox_config", - "budget_defaults", - "tool_allowlist", - "scaling" - ] - } - }, - "properties": { - "deployment_manifest": { - "$ref": "#/$defs/deployment_manifest" - } - }, - "required": [ - "deployment_manifest" - ], - "x-opencot": { - "rfc": "0032", - "shortname": "runtime_deployment_manifest", - "source_rfc": "rfcs/0032-runtime-deployment-manifest.md" - } -} diff --git a/schemas/rfc-0033-runtime-security-threat-model.json b/schemas/rfc-0033-runtime-security-threat-model.json deleted file mode 100644 index e5ec593..0000000 --- a/schemas/rfc-0033-runtime-security-threat-model.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0033/threat-catalog.json", - "title": "Open CoT RFC 0033 — Threat Catalog", - "type": "object", - "additionalProperties": false, - "$defs": { - "threat_category": { - "type": "string", - "enum": [ - "prompt_injection", - "privilege_escalation", - "data_exfiltration", - "confused_deputy", - "denial_of_service", - "replay_attack", - "supply_chain" - ] - }, - "severity": { - "type": "string", - "enum": [ - "critical", - "high", - "medium", - "low" - ] - }, - "mitigation": { - "type": "object", - "additionalProperties": false, - "properties": { - "mechanism": { - "type": "string", - "minLength": 1 - }, - "rfc_ref": { - "type": "string", - "description": "e.g. RFC 0047" - }, - "notes": { - "type": "string" - } - }, - "required": [ - "mechanism" - ] - }, - "threat_entry": { - "type": "object", - "additionalProperties": false, - "properties": { - "threat_id": { - "type": "string", - "minLength": 1 - }, - "category": { - "$ref": "#/$defs/threat_category" - }, - "description": { - "type": "string", - "minLength": 1 - }, - "severity": { - "$ref": "#/$defs/severity" - }, - "mitigations": { - "type": "array", - "items": { - "$ref": "#/$defs/mitigation" - }, - "minItems": 1 - }, - "residual_risk": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "threat_id", - "category", - "description", - "severity", - "mitigations", - "residual_risk" - ] - }, - "threat_catalog": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "catalog_id": { - "type": "string", - "minLength": 1 - }, - "title": { - "type": "string", - "minLength": 1 - }, - "entries": { - "type": "array", - "items": { - "$ref": "#/$defs/threat_entry" - }, - "minItems": 1 - } - }, - "required": [ - "schema_version", - "catalog_id", - "title", - "entries" - ] - } - }, - "properties": { - "threat_catalog": { - "$ref": "#/$defs/threat_catalog" - } - }, - "required": [ - "threat_catalog" - ], - "x-opencot": { - "rfc": "0033", - "shortname": "runtime_security_threat_model", - "source_rfc": "rfcs/0033-runtime-security-threat-model.md" - } -} diff --git a/schemas/rfc-0034-cognitive-federation-protocol.json b/schemas/rfc-0034-cognitive-federation-protocol.json deleted file mode 100644 index a88f2d4..0000000 --- a/schemas/rfc-0034-cognitive-federation-protocol.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0034/federation.json", - "title": "Open CoT RFC 0034 — Cognitive pipeline Federation Protocol", - "type": "object", - "additionalProperties": false, - "$defs": { - "trust_level": { - "type": "string", - "enum": [ - "untrusted", - "verified", - "trusted" - ] - }, - "federation_peer": { - "type": "object", - "additionalProperties": false, - "properties": { - "peer_id": { - "type": "string", - "minLength": 1 - }, - "endpoint": { - "type": "string", - "format": "uri" - }, - "trust_level": { - "$ref": "#/$defs/trust_level" - }, - "public_key": { - "type": "string", - "minLength": 1 - }, - "accepted_scopes": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "max_delegation_ttl_seconds": { - "type": "integer", - "minimum": 1 - }, - "last_verified_at": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "peer_id", - "endpoint", - "trust_level", - "public_key", - "accepted_scopes", - "max_delegation_ttl_seconds" - ] - }, - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { - "type": "string", - "minLength": 1 - }, - "content_hash": { - "type": "string", - "minLength": 1 - }, - "signature": { - "type": "string" - }, - "signing_key_id": { - "type": "string" - } - }, - "required": [ - "hash_algorithm", - "content_hash" - ] - }, - "federation_request": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "request_id": { - "type": "string", - "minLength": 1 - }, - "source_peer_id": { - "type": "string", - "minLength": 1 - }, - "target_peer_id": { - "type": "string", - "minLength": 1 - }, - "delegation_request": { - "$ref": "https://opencot.dev/schema/rfc0047/delegation-extension-v0.2.json#/$defs/delegation_request" - }, - "trust_chain": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1 - } - }, - "required": [ - "schema_version", - "request_id", - "source_peer_id", - "target_peer_id", - "delegation_request", - "trust_chain" - ] - }, - "federation_response": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "request_id": { - "type": "string", - "minLength": 1 - }, - "status": { - "type": "string", - "enum": [ - "accepted", - "rejected", - "narrowed" - ] - }, - "delegation_decision": { - "$ref": "https://opencot.dev/schema/rfc0047/delegation-extension-v0.2.json#/$defs/delegation_decision" - }, - "response_integrity": { - "$ref": "#/$defs/integrity" - } - }, - "required": [ - "schema_version", - "request_id", - "status", - "delegation_decision", - "response_integrity" - ] - } - }, - "properties": { - "federation_peer": { - "$ref": "#/$defs/federation_peer" - }, - "federation_request": { - "$ref": "#/$defs/federation_request" - }, - "federation_response": { - "$ref": "#/$defs/federation_response" - } - }, - "x-opencot": { - "rfc": "0034", - "shortname": "cognitive_federation_protocol", - "source_rfc": "rfcs/0034-cognitive-federation-protocol.md" - } -} diff --git a/schemas/rfc-0035-data-provenance-tracking.json b/schemas/rfc-0035-data-provenance-tracking.json deleted file mode 100644 index ccebff5..0000000 --- a/schemas/rfc-0035-data-provenance-tracking.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0035 — Data Provenance Tracking", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "artifact_id": { - "type": "string" - }, - "artifact_type": { - "type": "string" - }, - "source": { - "type": "string" - }, - "requester_id": { - "type": "string" - }, - "tool_id": { - "type": "string" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "transformation": { - "type": "string" - }, - "parent_artifact_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "integrity": { - "type": "object", - "properties": { - "hash_algorithm": { - "type": "string", - "enum": [ - "sha256" - ] - }, - "content_hash": { - "type": "string" - }, - "signature_algorithm": { - "type": "string" - }, - "signature": { - "type": "string" - }, - "signing_key_id": { - "type": "string" - } - }, - "required": [ - "hash_algorithm", - "content_hash" - ] - } - }, - "required": [ - "version", - "artifact_id", - "artifact_type", - "source", - "timestamp", - "transformation", - "integrity" - ], - "$id": "https://opencot.dev/schemas/rfc-0035-data-provenance-tracking.json", - "x-opencot": { - "rfc": "0035", - "shortname": "data_provenance_tracking", - "source_rfc": "rfcs/0035-data-provenance-tracking.md" - } -} diff --git a/schemas/rfc-0036-cognitive-native-compression-delta.json b/schemas/rfc-0036-cognitive-native-compression-delta.json deleted file mode 100644 index 441b736..0000000 --- a/schemas/rfc-0036-cognitive-native-compression-delta.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0036 — Cognitive Native Compression Delta (stub)", - "description": "Placeholder JSON Schema for RFC 0036. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0036", - "shortname": "cognitive_native_compression_delta", - "status": "stub", - "source_rfc": "rfcs/0036-cognitive-native-compression-delta.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0036-cognitive-native-compression-delta.json" -} diff --git a/schemas/rfc-0037-token-economy-cost-modeling.json b/schemas/rfc-0037-token-economy-cost-modeling.json deleted file mode 100644 index b1eadc3..0000000 --- a/schemas/rfc-0037-token-economy-cost-modeling.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0037 — Token Economy & Cost Modeling", - "description": "Cost snapshot structure for tracking model inference and tool invocation costs per step or per trajectory.", - "type": "object", - "properties": { - "model_cost": { - "type": "object", - "properties": { - "input_tokens": { - "type": "integer", - "minimum": 0, - "description": "Number of input/prompt tokens consumed." - }, - "output_tokens": { - "type": "integer", - "minimum": 0, - "description": "Number of output/completion tokens generated." - } - }, - "required": [ - "input_tokens", - "output_tokens" - ] - }, - "tool_cost": { - "type": "object", - "description": "Cost per tool name (numeric values).", - "additionalProperties": { - "type": "number", - "minimum": 0 - } - }, - "total_cost": { - "type": "number", - "minimum": 0, - "description": "Aggregate cost across model inference and tool invocations." - } - }, - "required": [ - "model_cost", - "total_cost" - ], - "additionalProperties": true, - "$id": "https://opencot.dev/schemas/rfc-0037-token-economy-cost-modeling.json", - "x-opencot": { - "rfc": "0037", - "shortname": "token_economy_cost_modeling", - "source_rfc": "rfcs/0037-token-economy-cost-modeling.md" - } -} diff --git a/schemas/rfc-0038-cost-aware-reasoning-budget.json b/schemas/rfc-0038-cost-aware-reasoning-budget.json deleted file mode 100644 index e8e12a4..0000000 --- a/schemas/rfc-0038-cost-aware-reasoning-budget.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0038 — Cost-Aware Reasoning Budget", - "description": "Budget policy and snapshot types for enforcing token, cost, step, tool-call, and retry limits on cognitive pipelines.", - "type": "object", - "properties": { - "budget": { - "type": "object", - "description": "Budget policy defining the maximum allowed resource usage.", - "properties": { - "max_tokens": { - "type": "integer", - "minimum": 0, - "description": "Maximum total tokens (input + output) across all LLM calls." - }, - "max_cost": { - "type": "number", - "minimum": 0, - "description": "Maximum dollar cost for the entire cognitive pipeline run." - }, - "max_steps": { - "type": "integer", - "minimum": 0, - "description": "Maximum number of loop iterations." - }, - "max_tool_calls": { - "type": "integer", - "minimum": 0, - "description": "Maximum number of tool invocations." - }, - "max_retries": { - "type": "integer", - "minimum": 0, - "description": "Maximum number of repair/retry attempts." - } - }, - "required": [ - "max_tokens", - "max_cost" - ] - }, - "enforcement": { - "type": "string", - "enum": [ - "hard", - "soft", - "warn" - ], - "description": "How the budget is enforced. 'hard' force-stops the cognitive pipeline, 'soft' logs warnings, 'warn' emits telemetry only." - }, - "snapshot": { - "type": "object", - "description": "Runtime budget snapshot showing current usage and remaining capacity.", - "properties": { - "tokens_used": { - "type": "integer", - "minimum": 0 - }, - "tokens_remaining": { - "type": "integer" - }, - "cost_used": { - "type": "number", - "minimum": 0 - }, - "cost_remaining": { - "type": "number" - }, - "steps_used": { - "type": "integer", - "minimum": 0 - }, - "steps_remaining": { - "type": "integer" - }, - "tool_calls_used": { - "type": "integer", - "minimum": 0 - }, - "tool_calls_remaining": { - "type": "integer" - }, - "retries_used": { - "type": "integer", - "minimum": 0 - }, - "retries_remaining": { - "type": "integer" - } - } - } - }, - "required": [ - "budget", - "enforcement" - ], - "additionalProperties": true, - "$id": "https://opencot.dev/schemas/rfc-0038-cost-aware-reasoning-budget.json", - "x-opencot": { - "rfc": "0038", - "shortname": "cost_aware_reasoning_budget", - "source_rfc": "rfcs/0038-cost-aware-reasoning-budget.md" - } -} diff --git a/schemas/rfc-0039-tool-cost-modeling.json b/schemas/rfc-0039-tool-cost-modeling.json deleted file mode 100644 index 0d91cdf..0000000 --- a/schemas/rfc-0039-tool-cost-modeling.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0039 — Tool Cost Modeling (stub)", - "description": "Placeholder JSON Schema for RFC 0039. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0039", - "shortname": "tool_cost_modeling", - "status": "stub", - "source_rfc": "rfcs/0039-tool-cost-modeling-biling.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0039-tool-cost-modeling.json" -} diff --git a/schemas/rfc-0040-multi-party-economic-incentives.json b/schemas/rfc-0040-multi-party-economic-incentives.json deleted file mode 100644 index 3d3bd67..0000000 --- a/schemas/rfc-0040-multi-party-economic-incentives.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0040 — Multi Party Economic Incentives (stub)", - "description": "Placeholder JSON Schema for RFC 0040. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0040", - "shortname": "multi_party_economic_incentives", - "status": "stub", - "source_rfc": "rfcs/0040-multi-party-economic-incentives.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0040-multi-party-economic-incentives.json" -} diff --git a/schemas/rfc-0041-policy-enforcement.json b/schemas/rfc-0041-policy-enforcement.json deleted file mode 100644 index 9e6aa53..0000000 --- a/schemas/rfc-0041-policy-enforcement.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/policy/v0.3", - "title": "Open CoT RFC 0041 — Policy Document", - "type": "object", - "additionalProperties": false, - "properties": { - "version": { - "type": "string", - "enum": [ - "0.3" - ] - }, - "policy_id": { - "type": "string", - "minLength": 1 - }, - "policy_type": { - "type": "string", - "enum": [ - "safety", - "compliance", - "organizational", - "ethical", - "operational" - ] - }, - "description": { - "type": "string" - }, - "priority": { - "type": "integer", - "description": "Lower = higher precedence across policies." - }, - "rules": { - "type": "array", - "items": { - "$ref": "#/definitions/policyRule" - }, - "minItems": 1 - }, - "effective_at": { - "type": "string", - "format": "date-time" - }, - "expires_at": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "version", - "policy_id", - "policy_type", - "priority", - "rules" - ], - "definitions": { - "riskLevel": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "ruleAction": { - "type": "string", - "enum": [ - "allow", - "deny", - "narrow", - "require_approval" - ] - }, - "validityWindow": { - "type": "object", - "additionalProperties": false, - "properties": { - "effective_at": { - "type": "string", - "format": "date-time" - }, - "expires_at": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "effective_at", - "expires_at" - ] - }, - "conditions": { - "type": "object", - "additionalProperties": false, - "properties": { - "max_risk_level": { - "$ref": "#/definitions/riskLevel" - }, - "require_justification": { - "type": "boolean" - }, - "validity_window": { - "$ref": "#/definitions/validityWindow" - }, - "budget_remaining_min": { - "type": "number" - } - } - }, - "narrowing": { - "type": "object", - "additionalProperties": false, - "properties": { - "allowed_fields": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "excluded_fields": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "max_results": { - "type": "integer", - "minimum": 0 - }, - "max_response_size_bytes": { - "type": "integer", - "minimum": 0 - } - } - }, - "policyRule": { - "type": "object", - "additionalProperties": false, - "properties": { - "rule_id": { - "type": "string", - "minLength": 1 - }, - "action": { - "$ref": "#/definitions/ruleAction" - }, - "subject": { - "type": "string" - }, - "resource": { - "type": "string", - "minLength": 1 - }, - "conditions": { - "$ref": "#/definitions/conditions" - }, - "narrowing": { - "$ref": "#/definitions/narrowing" - }, - "escalation_target": { - "type": "string" - }, - "reason": { - "type": "string" - } - }, - "required": [ - "rule_id", - "action", - "resource" - ] - } - }, - "x-opencot": { - "rfc": "0041", - "shortname": "policy_enforcement", - "source_rfc": "rfcs/0041-policy-enforcement-schema.md" - } -} diff --git a/schemas/rfc-0042-permission-acl.json b/schemas/rfc-0042-permission-acl.json deleted file mode 100644 index 912c0ba..0000000 --- a/schemas/rfc-0042-permission-acl.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/permission-grant/0.3", - "title": "Open CoT RFC 0042 — Permission Grant", - "type": "object", - "additionalProperties": false, - "properties": { - "permission_id": { - "type": "string", - "format": "uuid" - }, - "granted_to": { - "type": "string", - "minLength": 1 - }, - "scope": { - "type": "object", - "additionalProperties": false, - "required": [ - "resource", - "action" - ], - "properties": { - "resource": { - "type": "string", - "minLength": 1 - }, - "action": { - "type": "string", - "enum": [ - "read", - "write", - "execute", - "delete", - "list" - ] - }, - "constraints": { - "type": "object", - "additionalProperties": false, - "properties": { - "allowed_fields": { - "type": "array", - "items": { - "type": "string" - } - }, - "excluded_fields": { - "type": "array", - "items": { - "type": "string" - } - }, - "max_results": { - "type": "integer", - "minimum": 0 - }, - "max_response_size_bytes": { - "type": "integer", - "minimum": 0 - }, - "custom": { - "type": "object" - } - } - } - } - }, - "audience": { - "type": "string", - "minLength": 1 - }, - "ttl_seconds": { - "type": "integer", - "minimum": 1 - }, - "expires_at": { - "type": "string", - "format": "date-time" - }, - "one_shot": { - "type": "boolean" - }, - "forwardable": { - "type": "boolean", - "default": false - }, - "granted_by": { - "type": "string", - "minLength": 1 - }, - "policy_ref": { - "type": "string", - "minLength": 1 - }, - "request_ref": { - "type": "string", - "minLength": 1 - }, - "decision_ref": { - "type": "string", - "minLength": 1 - }, - "effective_at": { - "type": "string", - "format": "date-time" - }, - "consumed_at": { - "type": "string", - "format": "date-time" - }, - "revoked_at": { - "type": "string", - "format": "date-time" - }, - "revocation_reason": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "consumed", - "expired", - "revoked" - ] - } - }, - "required": [ - "permission_id", - "granted_to", - "scope", - "audience", - "ttl_seconds", - "expires_at", - "one_shot", - "granted_by", - "policy_ref", - "request_ref", - "decision_ref", - "effective_at", - "status" - ], - "allOf": [ - { - "if": { - "properties": { - "status": { - "const": "consumed" - } - }, - "required": [ - "status" - ] - }, - "then": { - "required": [ - "consumed_at" - ] - } - }, - { - "if": { - "properties": { - "status": { - "const": "revoked" - } - }, - "required": [ - "status" - ] - }, - "then": { - "required": [ - "revoked_at", - "revocation_reason" - ] - } - } - ], - "x-opencot": { - "rfc": "0042", - "shortname": "permission_acl", - "source_rfc": "rfcs/0042-permission-acl.md" - } -} diff --git a/schemas/rfc-0043-auditing-compliance-logs.json b/schemas/rfc-0043-auditing-compliance-logs.json deleted file mode 100644 index 32a14a0..0000000 --- a/schemas/rfc-0043-auditing-compliance-logs.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0043 — audit_event", - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.3" - ] - }, - "event_id": { - "type": "string", - "format": "uuid" - }, - "run_id": { - "type": "string", - "minLength": 1 - }, - "requester_id": { - "type": "string", - "minLength": 1 - }, - "observed_at": { - "type": "string", - "format": "date-time" - }, - "event_type": { - "type": "string", - "enum": [ - "run_started", - "policy_evaluated", - "permission_granted", - "permission_consumed", - "permission_expired", - "permission_revoked", - "tool_executed", - "delegation_requested", - "delegation_decided", - "escalation_initiated", - "escalation_resolved", - "postcondition_violated", - "denial_recorded", - "budget_warning", - "budget_exhausted", - "run_completed", - "run_failed", - "trace_sealed" - ] - }, - "details": { - "type": "object", - "additionalProperties": true - }, - "parent_event_id": { - "type": [ - "string", - "null" - ], - "format": "uuid" - }, - "ordering": { - "type": "object", - "additionalProperties": false, - "properties": { - "event_seq": { - "type": "integer", - "minimum": 0 - }, - "causal_predecessors": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "uniqueItems": true - } - }, - "required": [ - "event_seq" - ] - }, - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { - "type": "string", - "enum": [ - "sha256" - ] - }, - "content_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - } - }, - "required": [ - "hash_algorithm", - "content_hash" - ] - } - }, - "required": [ - "schema_version", - "event_id", - "run_id", - "requester_id", - "observed_at", - "event_type", - "details", - "parent_event_id", - "ordering", - "integrity" - ], - "$id": "https://opencot.dev/schemas/rfc-0043-auditing-compliance-logs.json", - "x-opencot": { - "rfc": "0043", - "shortname": "auditing_compliance_logs", - "source_rfc": "rfcs/0043-auditing-compliance-logs.md" - } -} diff --git a/schemas/rfc-0044-governance-organizational-controls.json b/schemas/rfc-0044-governance-organizational-controls.json deleted file mode 100644 index 063b226..0000000 --- a/schemas/rfc-0044-governance-organizational-controls.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/governance_config/v0.2", - "title": "Open CoT RFC 0044 — Governance Config", - "type": "object", - "additionalProperties": false, - "properties": { - "version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "governance_id": { - "type": "string", - "format": "uuid" - }, - "scope_level": { - "type": "string", - "enum": [ - "global", - "organization", - "team", - "pipeline" - ] - }, - "scope_id": { - "type": [ - "string", - "null" - ] - }, - "parent_governance_id": { - "type": [ - "string", - "null" - ] - }, - "required_policies": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "default": [] - }, - "restricted_tools": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "default": [] - }, - "allowed_tools_override": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "default": [] - }, - "max_trust_level": { - "type": "string", - "enum": [ - "untrusted", - "low", - "medium", - "high" - ] - }, - "approval_workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/approvalWorkflow" - }, - "default": [] - }, - "compliance_requirements": { - "type": "array", - "items": { - "$ref": "#/definitions/complianceRequirement" - }, - "default": [] - }, - "effective_from": { - "type": "string", - "format": "date-time" - }, - "effective_until": { - "type": [ - "string", - "null" - ], - "format": "date-time" - }, - "metadata": { - "type": "object", - "additionalProperties": true - } - }, - "required": [ - "version", - "governance_id", - "scope_level", - "scope_id", - "parent_governance_id", - "required_policies", - "restricted_tools", - "allowed_tools_override", - "max_trust_level", - "approval_workflows", - "compliance_requirements", - "effective_from", - "metadata" - ], - "definitions": { - "approvalWorkflow": { - "type": "object", - "additionalProperties": false, - "properties": { - "trigger": { - "type": "string", - "minLength": 1 - }, - "approvers": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1 - }, - "timeout_seconds": { - "type": "integer", - "minimum": 0 - }, - "timeout_action": { - "type": "string", - "enum": [ - "deny", - "escalate_parent" - ] - } - }, - "required": [ - "trigger", - "approvers", - "timeout_seconds", - "timeout_action" - ] - }, - "complianceRequirement": { - "type": "object", - "additionalProperties": false, - "properties": { - "standard": { - "type": "string", - "minLength": 1 - }, - "audit_retention_days": { - "type": "integer", - "minimum": 0 - }, - "pii_policy": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "standard", - "audit_retention_days", - "pii_policy" - ] - } - }, - "x-opencot": { - "rfc": "0044", - "shortname": "governance_organizational_controls", - "source_rfc": "rfcs/0044-governance-organizational-controls.md" - } -} diff --git a/schemas/rfc-0045-ethics.json b/schemas/rfc-0045-ethics.json deleted file mode 100644 index 42e236c..0000000 --- a/schemas/rfc-0045-ethics.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0045 — Ethical and Risk Constraints", - "type": "object", - "properties": { - "version": { - "type": "string", - "enum": [ - "0.1" - ] - }, - "constraint_id": { - "type": "string" - }, - "risk_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "risk": { - "type": "string", - "enum": [ - "safety", - "privacy", - "fairness", - "compliance", - "operational" - ] - }, - "max_level": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "action_on_violation": { - "type": "string", - "enum": [ - "block", - "review", - "log_only" - ] - } - }, - "required": [ - "risk", - "max_level", - "action_on_violation" - ] - } - }, - "privacy_policy": { - "type": "object", - "properties": { - "redaction_actions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "drop", - "mask", - "hash", - "encrypt_ref" - ] - } - }, - "retention_days": { - "type": "integer", - "minimum": 0 - }, - "public_release_allows_pii": { - "type": "boolean" - } - }, - "required": [ - "redaction_actions", - "retention_days", - "public_release_allows_pii" - ] - } - }, - "required": [ - "version", - "constraint_id", - "risk_rules", - "privacy_policy" - ], - "$id": "https://opencot.dev/schemas/rfc-0045-ethics.json", - "x-opencot": { - "rfc": "0045", - "shortname": "ethics", - "source_rfc": "rfcs/0045-ethics-risk-constraints-cognitive-runtimes.md" - } -} diff --git a/schemas/rfc-0046-experiment-cards.json b/schemas/rfc-0046-experiment-cards.json deleted file mode 100644 index d80973a..0000000 --- a/schemas/rfc-0046-experiment-cards.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0046 — Experiment Cards (stub)", - "description": "Placeholder JSON Schema for RFC 0046. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0046", - "shortname": "experiment_cards", - "status": "stub", - "source_rfc": "rfcs/0046-conformance-interoperability-protocol.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0046-experiment-cards.json" -} diff --git a/schemas/rfc-0047-delegation-extension.json b/schemas/rfc-0047-delegation-extension.json deleted file mode 100644 index 7b8845f..0000000 --- a/schemas/rfc-0047-delegation-extension.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0047/delegation-extension-v0.2.json", - "title": "Open CoT RFC 0047 — Delegation Extension", - "type": "object", - "additionalProperties": false, - "$defs": { - "scope": { - "type": "object", - "additionalProperties": false, - "properties": { - "resource": { - "type": "string", - "minLength": 1 - }, - "action": { - "type": "string", - "minLength": 1 - }, - "constraints": { - "type": "object" - } - }, - "required": [ - "resource", - "action" - ] - }, - "provenance": { - "type": "object", - "additionalProperties": false, - "properties": { - "trace_step_id": { - "type": "string" - }, - "plan_version": { - "type": "integer", - "minimum": 0 - } - } - }, - "delegation_request": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "request_id": { - "type": "string", - "minLength": 1 - }, - "requester": { - "type": "string", - "minLength": 1 - }, - "run_id": { - "type": "string", - "minLength": 1 - }, - "observed_at": { - "type": "string", - "format": "date-time" - }, - "intent": { - "type": "string" - }, - "justification": { - "type": "string" - }, - "requested_scope": { - "$ref": "#/$defs/scope" - }, - "preferred_ttl_seconds": { - "type": "integer", - "minimum": 1 - }, - "preferred_audience": { - "type": "string", - "minLength": 1 - }, - "task_context_ref": { - "type": "string" - }, - "provenance": { - "$ref": "#/$defs/provenance" - } - }, - "required": [ - "schema_version", - "request_id", - "requester", - "run_id", - "requested_scope", - "observed_at" - ] - }, - "delegation_decision": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "decision_id": { - "type": "string", - "minLength": 1 - }, - "request_id": { - "type": "string", - "minLength": 1 - }, - "status": { - "type": "string", - "enum": [ - "approved", - "denied", - "narrowed", - "escalated" - ] - }, - "decided_by": { - "type": "object", - "additionalProperties": false, - "properties": { - "kind": { - "type": "string", - "enum": [ - "policy", - "human", - "harness" - ] - }, - "policy_id": { - "type": "string" - }, - "human_approver": { - "type": "string" - } - }, - "required": [ - "kind" - ] - }, - "policy_refs": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "narrowed_scope": { - "$ref": "#/$defs/scope" - }, - "denial_reason": { - "type": "string" - }, - "escalation_target": { - "type": "string" - }, - "decided_at": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "schema_version", - "decision_id", - "request_id", - "status", - "decided_by", - "policy_refs", - "decided_at" - ] - }, - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { - "type": "string", - "minLength": 1 - }, - "content_hash": { - "type": "string", - "minLength": 1 - }, - "signature": { - "type": "string" - }, - "signing_key_id": { - "type": "string" - } - }, - "required": [ - "hash_algorithm", - "content_hash" - ] - }, - "authority_receipt": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "receipt_id": { - "type": "string", - "minLength": 1 - }, - "decision_id": { - "type": "string", - "minLength": 1 - }, - "request_id": { - "type": "string", - "minLength": 1 - }, - "permission_id": { - "type": "string", - "minLength": 1 - }, - "granted_scope": { - "$ref": "#/$defs/scope" - }, - "effective_at": { - "type": "string", - "format": "date-time" - }, - "expires_at": { - "type": "string", - "format": "date-time" - }, - "one_shot": { - "type": "boolean" - }, - "forwardable": { - "type": "boolean" - }, - "audience": { - "type": "string", - "minLength": 1 - }, - "integrity": { - "$ref": "#/$defs/integrity" - } - }, - "required": [ - "schema_version", - "receipt_id", - "decision_id", - "request_id", - "permission_id", - "granted_scope", - "effective_at", - "expires_at", - "one_shot", - "forwardable", - "audience", - "integrity" - ] - } - }, - "properties": { - "delegation_request": { - "$ref": "#/$defs/delegation_request" - }, - "delegation_decision": { - "$ref": "#/$defs/delegation_decision" - }, - "authority_receipt": { - "$ref": "#/$defs/authority_receipt" - } - }, - "x-opencot": { - "rfc": "0047", - "shortname": "delegation_extension", - "source_rfc": "rfcs/0047-delegation-extension.md" - } -} diff --git a/schemas/rfc-0048-execution-receipts-audit-envelopes.json b/schemas/rfc-0048-execution-receipts-audit-envelopes.json deleted file mode 100644 index 8810b46..0000000 --- a/schemas/rfc-0048-execution-receipts-audit-envelopes.json +++ /dev/null @@ -1,426 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/v0.9/execution-receipts-audit-envelopes.json", - "title": "Open CoT RFC 0048 — execution receipts and audit envelopes", - "type": "object", - "oneOf": [ - { - "$ref": "#/$defs/tool_execution_receipt" - }, - { - "$ref": "#/$defs/audit_envelope" - } - ], - "$defs": { - "integrity": { - "type": "object", - "additionalProperties": false, - "properties": { - "hash_algorithm": { - "type": "string", - "const": "sha256" - }, - "content_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "signature": { - "type": "string" - }, - "signing_key_id": { - "type": "string" - } - }, - "required": [ - "hash_algorithm", - "content_hash" - ] - }, - "budget_snapshot_rfc0038": { - "type": "object", - "additionalProperties": false, - "properties": { - "tokens_used": { - "type": "integer", - "minimum": 0 - }, - "tokens_remaining": { - "type": "integer" - }, - "cost_used": { - "type": "number", - "minimum": 0 - }, - "cost_remaining": { - "type": "number" - }, - "steps_used": { - "type": "integer", - "minimum": 0 - }, - "steps_remaining": { - "type": "integer" - }, - "tool_calls_used": { - "type": "integer", - "minimum": 0 - }, - "tool_calls_remaining": { - "type": "integer" - }, - "retries_used": { - "type": "integer", - "minimum": 0 - }, - "retries_remaining": { - "type": "integer" - } - }, - "required": [ - "tokens_used", - "tokens_remaining", - "cost_used", - "cost_remaining", - "steps_used", - "steps_remaining", - "tool_calls_used", - "tool_calls_remaining", - "retries_used", - "retries_remaining" - ] - }, - "policy_violation_entry": { - "type": "object", - "additionalProperties": false, - "properties": { - "violation_id": { - "type": "string", - "minLength": 1 - }, - "policy_id": { - "type": "string", - "minLength": 1 - }, - "rule_id": { - "type": "string", - "minLength": 1 - }, - "description": { - "type": "string" - }, - "severity": { - "type": "string", - "enum": [ - "info", - "low", - "medium", - "high", - "critical" - ] - }, - "observed_at": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "violation_id", - "policy_id", - "rule_id", - "description", - "severity", - "observed_at" - ] - }, - "tool_execution_receipt": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "execution_id": { - "type": "string", - "format": "uuid" - }, - "run_id": { - "type": "string", - "minLength": 1 - }, - "tool_name": { - "type": "string", - "minLength": 1 - }, - "permission_id": { - "type": "string", - "minLength": 1 - }, - "authority_receipt_id": { - "type": "string", - "minLength": 1 - }, - "input_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "output_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "output_size_bytes": { - "type": "integer", - "minimum": 0 - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "completed_at": { - "type": "string", - "format": "date-time" - }, - "duration_ms": { - "type": "integer", - "minimum": 0 - }, - "status": { - "type": "string", - "enum": [ - "success", - "error", - "timeout", - "quarantined" - ] - }, - "error_category": { - "type": "string", - "enum": [ - "timeout", - "invalid_input", - "not_found", - "permission_denied", - "rate_limit", - "internal_error" - ] - }, - "postcondition_check": { - "type": "string", - "enum": [ - "passed", - "failed", - "skipped" - ] - }, - "postcondition_violation": { - "type": "string" - }, - "sandbox_state_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "integrity": { - "$ref": "#/$defs/integrity" - } - }, - "required": [ - "schema_version", - "execution_id", - "run_id", - "tool_name", - "permission_id", - "authority_receipt_id", - "input_hash", - "output_hash", - "output_size_bytes", - "started_at", - "completed_at", - "duration_ms", - "status", - "postcondition_check", - "sandbox_state_hash", - "integrity" - ] - }, - "audit_envelope": { - "type": "object", - "additionalProperties": false, - "properties": { - "schema_version": { - "type": "string", - "enum": [ - "0.2" - ] - }, - "envelope_id": { - "type": "string", - "format": "uuid" - }, - "run_id": { - "type": "string", - "minLength": 1 - }, - "requester_id": { - "type": "string", - "minLength": 1 - }, - "task_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "started_at": { - "type": "string", - "format": "date-time" - }, - "completed_at": { - "type": "string", - "format": "date-time" - }, - "completion_status": { - "type": "string", - "enum": [ - "succeeded", - "failed", - "denied", - "budget_exhausted", - "external_stop", - "escalation_timeout", - "fail_safe" - ] - }, - "trace_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "delegation_requests": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "delegation_decisions": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "authority_receipts": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - } - }, - "tool_execution_receipts": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - }, - "delegation_summary": { - "type": "object", - "additionalProperties": false, - "properties": { - "total_requested": { - "type": "integer", - "minimum": 0 - }, - "total_granted": { - "type": "integer", - "minimum": 0 - }, - "total_denied": { - "type": "integer", - "minimum": 0 - }, - "total_narrowed": { - "type": "integer", - "minimum": 0 - }, - "total_escalated": { - "type": "integer", - "minimum": 0 - } - }, - "required": [ - "total_requested", - "total_granted", - "total_denied", - "total_narrowed", - "total_escalated" - ] - }, - "permission_summary": { - "type": "object", - "additionalProperties": false, - "properties": { - "total_granted": { - "type": "integer", - "minimum": 0 - }, - "total_consumed": { - "type": "integer", - "minimum": 0 - }, - "total_expired": { - "type": "integer", - "minimum": 0 - }, - "total_revoked": { - "type": "integer", - "minimum": 0 - } - }, - "required": [ - "total_granted", - "total_consumed", - "total_expired", - "total_revoked" - ] - }, - "budget_final": { - "$ref": "#/$defs/budget_snapshot_rfc0038" - }, - "policy_violations": { - "type": "array", - "items": { - "$ref": "#/$defs/policy_violation_entry" - } - }, - "integrity": { - "$ref": "#/$defs/integrity" - } - }, - "required": [ - "schema_version", - "envelope_id", - "run_id", - "requester_id", - "task_hash", - "started_at", - "completed_at", - "completion_status", - "trace_hash", - "delegation_requests", - "delegation_decisions", - "authority_receipts", - "tool_execution_receipts", - "delegation_summary", - "permission_summary", - "budget_final", - "policy_violations", - "integrity" - ] - } - }, - "x-opencot": { - "rfc": "0048", - "shortname": "execution_receipts_audit_envelopes", - "source_rfc": "rfcs/0048-execution-receipts-audit-envelopes.md" - } -} diff --git a/schemas/rfc-0049-capability-manifest.json b/schemas/rfc-0049-capability-manifest.json deleted file mode 100644 index fb6d341..0000000 --- a/schemas/rfc-0049-capability-manifest.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/v0.8/capability_manifest.json", - "title": "Open CoT RFC 0049 — Capability Manifest", - "type": "object", - "additionalProperties": false, - "required": [ - "manifest_id", - "run_id", - "requester_id", - "timestamp", - "phase", - "tools", - "budget", - "trust_level" - ], - "properties": { - "manifest_id": { - "type": "string", - "minLength": 1 - }, - "run_id": { - "type": "string", - "minLength": 1 - }, - "requester_id": { - "type": "string", - "minLength": 1 - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "phase": { - "type": "string", - "minLength": 1, - "description": "FSM phase at which this manifest was compiled (e.g., frame, critique_verify, plan)." - }, - "tools": { - "type": "object", - "additionalProperties": false, - "required": [ - "available", - "blocked" - ], - "properties": { - "available": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "description", - "access_level" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1 - }, - "description": { - "type": "string" - }, - "access_level": { - "type": "string", - "enum": [ - "pre_authorized", - "requires_delegation" - ] - }, - "idempotent": { - "type": "boolean" - }, - "tool_contract_ref": { - "type": "string", - "description": "Optional pointer to tool contract schema (RFC 0003); not serialized in compact text." - }, - "constraints": { - "type": "object", - "description": "Policy-imposed constraints on this tool (e.g., narrowing).", - "additionalProperties": true - } - } - } - }, - "blocked": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "description": "Tool names blocked by sandbox or policy — do not request these." - } - } - }, - "budget": { - "type": "object", - "additionalProperties": false, - "properties": { - "steps_remaining": { - "type": "integer" - }, - "tool_calls_remaining": { - "type": "integer" - }, - "tokens_remaining": { - "type": "integer" - }, - "retries_remaining": { - "type": "integer" - } - } - }, - "trust_level": { - "type": "string", - "enum": [ - "untrusted", - "low", - "medium", - "high" - ] - }, - "active_constraints": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Human-readable summary of active policy constraints." - } - }, - "x-opencot": { - "rfc": "0049", - "shortname": "capability_manifest", - "source_rfc": "rfcs/0049-capability-manifest.md" - } -} diff --git a/schemas/rfc-0050-toon-adapter.json b/schemas/rfc-0050-toon-adapter.json deleted file mode 100644 index 8bf0210..0000000 --- a/schemas/rfc-0050-toon-adapter.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RFC 0050 — Toon Adapter (stub)", - "description": "Placeholder JSON Schema for RFC 0050. The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes.", - "type": "object", - "additionalProperties": true, - "x-opencot": { - "rfc": "0050", - "shortname": "toon_adapter", - "status": "stub", - "source_rfc": "rfcs/0050-toon-adapter.md" - }, - "$id": "https://opencot.dev/schemas/rfc-0050-toon-adapter.json" -} diff --git a/schemas/rfc-0051-temporal-semantics.json b/schemas/rfc-0051-temporal-semantics.json deleted file mode 100644 index e3e7942..0000000 --- a/schemas/rfc-0051-temporal-semantics.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/rfc0051/temporal-semantics.json", - "title": "Open CoT RFC 0051 - Temporal Semantics and Validity Extension", - "type": "object", - "additionalProperties": false, - "$defs": { - "isoDateTime": { - "type": "string", - "format": "date-time" - }, - "timeSource": { - "type": "string", - "enum": [ - "harness_recorded", - "source_reported", - "inferred", - "unknown" - ] - }, - "clockDomain": { - "type": "string", - "enum": [ - "harness_wall_clock", - "source_wall_clock", - "logical_only" - ] - }, - "timeUncertainty": { - "type": "object", - "additionalProperties": false, - "properties": { - "lower_bound_at": { - "$ref": "#/$defs/isoDateTime" - }, - "upper_bound_at": { - "$ref": "#/$defs/isoDateTime" - } - }, - "required": [ - "lower_bound_at", - "upper_bound_at" - ] - }, - "timeInstant": { - "type": "object", - "additionalProperties": false, - "properties": { - "at": { - "$ref": "#/$defs/isoDateTime" - }, - "source": { - "$ref": "#/$defs/timeSource" - }, - "clock_domain": { - "$ref": "#/$defs/clockDomain" - }, - "uncertainty": { - "$ref": "#/$defs/timeUncertainty" - } - }, - "required": [ - "source", - "clock_domain" - ], - "allOf": [ - { - "if": { - "properties": { - "source": { - "const": "unknown" - } - }, - "required": [ - "source" - ] - }, - "then": { - "not": { - "required": [ - "at" - ] - } - }, - "else": { - "required": [ - "at" - ] - } - } - ] - }, - "ordering": { - "type": "object", - "additionalProperties": false, - "properties": { - "event_seq": { - "type": "integer", - "minimum": 0 - }, - "parent_event_id": { - "type": "string", - "minLength": 1 - }, - "causal_predecessors": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "uniqueItems": true - }, - "version_order": { - "type": "integer", - "minimum": 0 - } - } - }, - "validityWindow": { - "type": "object", - "additionalProperties": false, - "properties": { - "effective_at": { - "$ref": "#/$defs/isoDateTime" - }, - "expires_at": { - "$ref": "#/$defs/isoDateTime" - } - } - }, - "freshness": { - "type": "object", - "additionalProperties": false, - "properties": { - "max_staleness_ms": { - "type": "integer", - "minimum": 0 - }, - "max_observation_lag_ms": { - "type": "integer", - "minimum": 0 - }, - "replay_window_ms": { - "type": "integer", - "minimum": 0 - } - } - }, - "supersession": { - "type": "object", - "additionalProperties": false, - "properties": { - "supersedes_id": { - "type": "string", - "minLength": 1 - }, - "superseded_at": { - "$ref": "#/$defs/isoDateTime" - }, - "reason": { - "type": "string" - } - }, - "required": [ - "supersedes_id", - "superseded_at" - ] - } - }, - "properties": { - "observed_at": { - "$ref": "#/$defs/timeInstant" - }, - "decided_at": { - "$ref": "#/$defs/timeInstant" - }, - "effective_at": { - "$ref": "#/$defs/isoDateTime" - }, - "expires_at": { - "$ref": "#/$defs/isoDateTime" - }, - "started_at": { - "$ref": "#/$defs/isoDateTime" - }, - "completed_at": { - "$ref": "#/$defs/isoDateTime" - }, - "superseded_at": { - "$ref": "#/$defs/isoDateTime" - }, - "ordering": { - "$ref": "#/$defs/ordering" - }, - "validity": { - "$ref": "#/$defs/validityWindow" - }, - "freshness": { - "$ref": "#/$defs/freshness" - }, - "supersession": { - "$ref": "#/$defs/supersession" - } - }, - "x-opencot": { - "rfc": "0051", - "shortname": "temporal_semantics", - "source_rfc": "rfcs/0051-temporal-semantics-validity-extension.md" - } -} diff --git a/schemas/rfc-0052-cognitive-artifact.json b/schemas/rfc-0052-cognitive-artifact.json deleted file mode 100644 index d5fef7d..0000000 --- a/schemas/rfc-0052-cognitive-artifact.json +++ /dev/null @@ -1,398 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://opencot.dev/schema/v0.10/cognitive-artifact.json", - "title": "Open CoT RFC 0052 — Cognitive Artifact and Capability Snapshot", - "type": "object", - "oneOf": [ - { - "$ref": "#/$defs/cognitive_artifact" - }, - { - "$ref": "#/$defs/capability_snapshot" - } - ], - "$defs": { - "json_schema_like": { - "type": "object", - "additionalProperties": true - }, - "risk_level": { - "type": "string", - "enum": [ - "read", - "write", - "destructive", - "external_side_effect" - ] - }, - "capability_descriptor": { - "type": "object", - "additionalProperties": false, - "required": [ - "mcp_server_name", - "capability_name", - "description", - "input_schema", - "risk_level", - "requires_approval", - "capability_digest" - ], - "properties": { - "mcp_server_name": { - "type": "string", - "minLength": 1 - }, - "capability_name": { - "type": "string", - "minLength": 1 - }, - "description": { - "type": "string" - }, - "input_schema": { - "$ref": "#/$defs/json_schema_like" - }, - "output_schema": { - "$ref": "#/$defs/json_schema_like" - }, - "risk_level": { - "$ref": "#/$defs/risk_level" - }, - "requires_approval": { - "type": "boolean" - }, - "capability_digest": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - } - } - }, - "capability_snapshot": { - "type": "object", - "additionalProperties": false, - "required": [ - "snapshot_id", - "discovered_at", - "capabilities_hash", - "capabilities" - ], - "properties": { - "snapshot_id": { - "type": "string", - "minLength": 1 - }, - "discovered_at": { - "type": "string", - "format": "date-time" - }, - "capabilities_hash": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "capabilities": { - "type": "array", - "items": { - "$ref": "#/$defs/capability_descriptor" - } - } - } - }, - "intent_verification": { - "type": "object", - "additionalProperties": false, - "required": [ - "interpreted_user_objective", - "request_boundaries", - "believed_allowed_requests", - "prohibited_requests" - ], - "properties": { - "interpreted_user_objective": { - "type": "string" - }, - "request_boundaries": { - "type": "array", - "items": { - "type": "string" - } - }, - "believed_allowed_requests": { - "type": "array", - "items": { - "type": "string" - } - }, - "prohibited_requests": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "reasoning_trace_step": { - "type": "object", - "additionalProperties": false, - "required": [ - "step_id", - "kind", - "content", - "visibility" - ], - "properties": { - "step_id": { - "type": "string", - "minLength": 1 - }, - "kind": { - "type": "string", - "enum": [ - "interpretation", - "constraint", - "hypothesis", - "verification", - "yield" - ] - }, - "content": { - "type": "string" - }, - "visibility": { - "type": "string", - "enum": [ - "audit_summary", - "detailed_evidence", - "redacted" - ] - }, - "redaction_reason": { - "type": "string" - }, - "confidence": { - "type": "number", - "minimum": 0, - "maximum": 1 - } - } - }, - "reasoning_trace": { - "type": "object", - "additionalProperties": false, - "required": [ - "evidence_mode", - "summary", - "steps" - ], - "properties": { - "evidence_mode": { - "type": "string", - "enum": [ - "audit_summary", - "detailed_evidence", - "redacted_evidence" - ] - }, - "summary": { - "type": "string", - "description": "Audit-safe explanation of the cognitive path. This is evidence, not authority." - }, - "steps": { - "type": "array", - "items": { - "$ref": "#/$defs/reasoning_trace_step" - } - }, - "contains_sensitive_content": { - "type": "boolean" - }, - "redaction_reason": { - "type": "string" - } - } - }, - "execution_intent": { - "type": "object", - "additionalProperties": false, - "required": [ - "intent_id", - "snapshot_id", - "target_mcp_server", - "capability_name", - "capability_digest", - "risk_level", - "requires_approval", - "idempotency_key", - "arguments" - ], - "properties": { - "intent_id": { - "type": "string", - "minLength": 1 - }, - "snapshot_id": { - "type": "string", - "minLength": 1 - }, - "target_mcp_server": { - "type": "string", - "minLength": 1 - }, - "capability_name": { - "type": "string", - "minLength": 1 - }, - "capability_digest": { - "type": "string", - "pattern": "^[a-f0-9]{64}$" - }, - "risk_level": { - "$ref": "#/$defs/risk_level" - }, - "requires_approval": { - "type": "boolean" - }, - "idempotency_key": { - "type": "string", - "minLength": 1 - }, - "arguments": { - "type": "object" - }, - "preconditions": { - "type": "array", - "items": { - "type": "string" - } - }, - "expected_result_shape": { - "$ref": "#/$defs/json_schema_like" - }, - "postconditions": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "observation": { - "type": "object", - "additionalProperties": false, - "required": [ - "observation_id", - "status", - "summary", - "observed_at" - ], - "properties": { - "observation_id": { - "type": "string", - "minLength": 1 - }, - "intent_id": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "recorded", - "skipped", - "error" - ] - }, - "summary": { - "type": "string" - }, - "output": {}, - "observed_at": { - "type": "string", - "format": "date-time" - } - } - }, - "cognitive_artifact": { - "type": "object", - "additionalProperties": false, - "required": [ - "artifact_id", - "schema_version", - "capability_snapshot_id", - "intent_verification", - "observations", - "assumptions", - "reasoning_trace", - "execution_intent", - "uncertainty" - ], - "properties": { - "artifact_id": { - "type": "string", - "minLength": 1 - }, - "schema_version": { - "type": "string", - "enum": [ - "open-cot.reconciliation.v0.1" - ] - }, - "capability_snapshot_id": { - "type": "string", - "minLength": 1 - }, - "intent_verification": { - "$ref": "#/$defs/intent_verification" - }, - "observations": { - "type": "array", - "items": { - "$ref": "#/$defs/observation" - } - }, - "assumptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "reasoning_trace": { - "$ref": "#/$defs/reasoning_trace" - }, - "execution_intent": { - "type": "array", - "items": { - "$ref": "#/$defs/execution_intent" - } - }, - "uncertainty": { - "type": "object", - "additionalProperties": false, - "required": [ - "level", - "explanation" - ], - "properties": { - "level": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "explanation": { - "type": "string" - } - } - }, - "yield_reason": { - "type": "string" - } - } - } - }, - "x-opencot": { - "rfc": "0052", - "shortname": "cognitive_artifact", - "source_rfc": "rfcs/0052-cognitive-artifact-and-capability-snapshot.md" - } -} diff --git a/tools/check_conformance_fixtures.py b/tools/check_conformance_fixtures.py index f0ada6f..683312c 100644 --- a/tools/check_conformance_fixtures.py +++ b/tools/check_conformance_fixtures.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Validate profile fixture matrix for RFC 0046-style conformance claims.""" +"""Validate profile fixture matrix for current Open CoT conformance claims.""" from __future__ import annotations @@ -19,7 +19,32 @@ from schema_resolver import SchemaResolver # noqa: E402 -def _validate_instance(schema: dict[str, Any], instance: dict[str, Any]) -> str | None: +def _build_registry(root: Path) -> tuple[Any | None, dict[str, dict[str, Any]]]: + schemas_dir = root / "schemas" + loaded: dict[str, dict[str, Any]] = {} + for path in sorted(schemas_dir.glob("rfc-*.json")): + loaded[path.name] = json.loads(path.read_text(encoding="utf-8")) + + try: + import referencing + from referencing.jsonschema import DRAFT7 + except ImportError: # pragma: no cover + return None, loaded + + reg = referencing.Registry() + for name, data in loaded.items(): + uri = data.get("$id") + if not isinstance(uri, str): + uri = f"file:{name}" + data = dict(data) + data["$id"] = uri + resource = referencing.Resource.from_contents(data, default_specification=DRAFT7) + reg = reg.with_resource(uri, resource) + loaded[name] = data + return reg, loaded + + +def _validate_instance(schema: dict[str, Any], instance: dict[str, Any], registry: Any | None) -> str | None: try: from jsonschema import Draft7Validator except ImportError: # pragma: no cover @@ -31,7 +56,10 @@ def _validate_instance(schema: dict[str, Any], instance: dict[str, Any]) -> str return None try: - Draft7Validator(schema).validate(instance) + if registry is None: + Draft7Validator(schema).validate(instance) + else: + Draft7Validator(schema, registry=registry).validate(instance) except Exception as e: return str(e) return None @@ -49,6 +77,7 @@ def main() -> int: resolver = SchemaResolver(ROOT) registry = load_registry() shortnames = registry_schema_paths(registry) + ref_registry, _ = _build_registry(ROOT) matrix = json.loads(args.matrix.read_text(encoding="utf-8")) errors: list[str] = [] @@ -76,7 +105,7 @@ def main() -> int: schema_path = resolver.path_for_shortname(shortname) schema = json.loads(schema_path.read_text(encoding="utf-8")) instance = json.loads(path.read_text(encoding="utf-8")) - err = _validate_instance(schema, instance) + err = _validate_instance(schema, instance, ref_registry) if err is not None: errors.append(f"profile {profile_name}: {rel_path} invalid for {shortname}: {err}") diff --git a/tools/diff_checker.py b/tools/diff_checker.py index a1bc0ce..6f94847 100644 --- a/tools/diff_checker.py +++ b/tools/diff_checker.py @@ -27,11 +27,6 @@ from typing import Any SEVERITY_ORDER = {"patch": 0, "minor": 1, "major": 2} -PROPERTY_RENAMES = { - "agent_id": "requester_id", - "agents": "pipelines", - "parent_agent_id": "parent_requester_id", -} def _norm_type(t: Any) -> str | None: @@ -64,12 +59,6 @@ def _record(findings: list[tuple[str, str]], severity: str, msg: str) -> None: findings.append((severity, msg)) -def _renamed_properties(before_keys: set[str], after_keys: set[str]) -> dict[str, str]: - return { - before: after for before, after in PROPERTY_RENAMES.items() if before in before_keys and after in after_keys - } - - def _tightened_min(before: dict[str, Any], after: dict[str, Any], key: str) -> bool: b = before.get(key) a = after.get(key) @@ -141,22 +130,16 @@ def _compare(before: Any, after: Any, path: str, *, findings: list[tuple[str, st b_req = set(_required_list(before)) a_req = set(_required_list(after)) - required_renames = _renamed_properties(b_req, a_req) - renamed_before_required = set(required_renames) - renamed_after_required = set(required_renames.values()) - for name in sorted((b_req - a_req) - renamed_before_required): + for name in sorted(b_req - a_req): _record(findings, "major", f"{path}: removed from required: {name!r}") - for name in sorted((a_req - b_req) - renamed_after_required): + for name in sorted(a_req - b_req): _record(findings, "minor", f"{path}: added to required: {name!r}") b_props = _props(before) a_props = _props(after) - property_renames = _renamed_properties(set(b_props), set(a_props)) - renamed_before_props = set(property_renames) - renamed_after_props = set(property_renames.values()) - for key in sorted((set(b_props) - set(a_props)) - renamed_before_props): + for key in sorted(set(b_props) - set(a_props)): _record(findings, "major", f"{path}: removed property {key!r}") - for key in sorted((set(a_props) - set(b_props)) - renamed_after_props): + for key in sorted(set(a_props) - set(b_props)): _record(findings, "minor", f"{path}: added property {key!r}") _constraint_diffs(before, after, path, findings) @@ -170,15 +153,6 @@ def _compare(before: Any, after: Any, path: str, *, findings: list[tuple[str, st elif isinstance(bp, dict) != isinstance(ap, dict): _record(findings, "major", f"{sub}: property shape changed (object vs non-object)") - for before_key, after_key in sorted(property_renames.items()): - bp = b_props[before_key] - ap = a_props[after_key] - sub = f"{path}.properties.{before_key}->{after_key}" - if isinstance(bp, dict) and isinstance(ap, dict): - _compare(bp, ap, sub, findings=findings) - elif isinstance(bp, dict) != isinstance(ap, dict): - _record(findings, "major", f"{sub}: property shape changed (object vs non-object)") - # Recurse into item and additionalProperties schemas when both are schema objects. b_items = before.get("items") a_items = after.get("items") @@ -214,6 +188,28 @@ def index_schema_dir(path: Path) -> dict[str, Path]: return indexed +def registry_major_version(path: Path) -> int | None: + registry = path / "registry.json" + if not registry.is_file(): + return None + try: + version = json.loads(registry.read_text(encoding="utf-8")).get("version") + except json.JSONDecodeError: + return None + if not isinstance(version, str): + return None + major, _, _ = version.partition(".") + return int(major) if major.isdigit() else None + + +def is_major_registry_reset(before: Path, after: Path) -> bool: + if not before.is_dir() or not after.is_dir(): + return False + before_major = registry_major_version(before) + after_major = registry_major_version(after) + return before_major is not None and after_major is not None and after_major > before_major + + def compare_files(before: Path, after: Path) -> list[tuple[str, str]]: findings: list[tuple[str, str]] = [] _compare(load_schema(before), load_schema(after), before.name, findings=findings) @@ -238,6 +234,10 @@ def main() -> int: ) args = parser.parse_args() + if args.strict and is_major_registry_reset(args.before, args.after): + print("Major registry reset detected; skipping strict compatibility gate.", file=sys.stderr) + return 0 + findings: list[tuple[str, str]] = [] if args.before.is_file() and args.after.is_file(): findings.extend(compare_files(args.before, args.after)) diff --git a/tools/schema_lib.py b/tools/schema_lib.py index c746fdc..68b2fc6 100644 --- a/tools/schema_lib.py +++ b/tools/schema_lib.py @@ -16,78 +16,26 @@ # RFC id -> shortname (registry key). Filenames use shortname with underscores -> hyphens. RFC_SHORTNAME: dict[str, str] = { - "0001": "reasoning", - "0002": "verifier_output", - "0003": "tool_invocation", - "0004": "branching", - "0005": "reward", - "0006": "ensemble", + "0001": "cognitive_artifact", + "0002": "capability_snapshot", + "0003": "execution_intent", + "0004": "policy_gate", + "0005": "observation_receipt", + "0006": "reconciliation_result", "0007": "cognitive_pipeline", - "0008": "dataset_packaging", - "0009": "reward_fusion", - "0010": "cognitive_context", - "0011": "multi_party_cognition_protocol", - "0012": "dataset_streaming", - "0013": "memory_compression", - "0014": "memory_conflict_resolution", - "0015": "multi_party_reward_sharing", - "0016": "tool_capability_negotiation", - "0017": "runtime_safety_sandboxing", - "0018": "tool_error_taxonomy", - "0019": "collaborative_planning_graphs", - "0020": "verifiable_scratchpad_compression", - "0021": "capability_declaration", - "0022": "cognitive_evaluation_protocol", - "0023": "human_in_the_loop", - "0024": "multi_modal_reasoning", - "0025": "tool_marketplace_registry", - "0026": "requester_identity_auth", - "0027": "distributed_execution", - "0028": "capability_environment", - "0029": "cognitive_benchmark_dataset", - "0030": "runtime_lifecycle_versioning", - "0031": "cognitive_observability_telemetry", - "0032": "runtime_deployment_manifest", - "0033": "runtime_security_threat_model", - "0034": "cognitive_federation_protocol", - "0035": "data_provenance_tracking", - "0036": "cognitive_native_compression_delta", - "0037": "token_economy_cost_modeling", - "0038": "cost_aware_reasoning_budget", - "0039": "tool_cost_modeling", - "0040": "multi_party_economic_incentives", - "0041": "policy_enforcement", - "0042": "permission_acl", - "0043": "auditing_compliance_logs", - "0044": "governance_organizational_controls", - "0045": "ethics", - "0046": "experiment_cards", - "0047": "delegation_extension", - "0048": "execution_receipts_audit_envelopes", - "0049": "capability_manifest", - "0050": "toon_adapter", - "0051": "temporal_semantics", - "0052": "cognitive_artifact", - "0053": "reconciliation_result", + "0008": "execution_budget", + "0009": "requester_identity", + "0010": "human_approval", + "0011": "conformance_registry", + "0012": "compact_context", } # RFC ids where extraction must use explicit markers. -STRICT_MARKER_RFC_IDS: set[str] = {"0001", "0002", "0003", "0004", "0005", "0006"} +STRICT_MARKER_RFC_IDS: set[str] = set(RFC_SHORTNAME) # Basename slugs (after rfc-NNNN-) aligned with schemas/registry.json conventions. -RFC_FILE_SLUG: dict[str, str] = { - "0001": "reasoning", - "0002": "verifier", - "0003": "tool", - "0004": "branching", - "0005": "reward", - "0006": "ensemble", - "0007": "cognitive-pipeline", - "0008": "dataset", - "0009": "reward-fusion", - "0010": "cognitive-context", -} +RFC_FILE_SLUG: dict[str, str] = {} def schema_filename(rfc_id: str, shortname: str) -> str: diff --git a/tools/sync_schemas_from_rfcs.py b/tools/sync_schemas_from_rfcs.py index 0913f76..4ff3981 100644 --- a/tools/sync_schemas_from_rfcs.py +++ b/tools/sync_schemas_from_rfcs.py @@ -17,12 +17,8 @@ REPO_ROOT, RFC_SHORTNAME, SCHEMAS_DIR, - STRICT_MARKER_RFC_IDS, annotate_schema, duplicate_rfc_ids, - extract_first_brace_object_after, - extract_first_json_object_with_schema, - extract_marked_brace_object, extract_marked_schema_with_schema_key, rfc_markdown_path, schema_filename, @@ -37,137 +33,12 @@ def _write_json(path: Path, data: Any) -> None: f.write("\n") -def build_branching_schema(rfc_id: str) -> dict[str, Any]: - text = rfc_markdown_path(rfc_id).read_text(encoding="utf-8") - frag = extract_marked_brace_object(text) - if not isinstance(frag, dict): - frag = extract_first_brace_object_after(text, "```json") - if not isinstance(frag, dict): - raise RuntimeError("RFC 0004: could not parse branching fragment") - return { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0004 — Branching / ToT / GoT step extensions", - "description": ( - "Optional fields extending RFC 0001 reasoning steps. " - "Valid step objects SHOULD satisfy RFC 0001 and MAY include any of these properties." - ), - "type": "object", - "properties": frag, - "additionalProperties": True, - } - - -def build_cognitive_pipeline_schema() -> dict[str, Any]: - return { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0007 — Cognitive Pipeline Protocol Trace", - "description": ( - "Reasoning trace emitted by a cognitive pipeline (RFC 0007). " - "Extends RFC 0001 with optional tool_invocation on action steps (RFC 0003)." - ), - "allOf": [ - {"$ref": "rfc-0001-reasoning.json"}, - { - "type": "object", - "properties": { - "steps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "tool_invocation": { - "type": "object", - "description": "Structured tool call when type is action (RFC 0003).", - } - }, - }, - } - }, - }, - ], - } - - -def build_dataset_packaging_schema() -> dict[str, Any]: - """Manifest + $defs for optional metadata files (RFC 0008).""" - return { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Open CoT RFC 0008 — Dataset package manifest", - "description": "manifest.json for a packaged reasoning dataset (RFC 0008).", - "type": "object", - "required": ["version", "name", "description", "schemas", "counts", "splits", "created_at", "license"], - "properties": { - "version": {"type": "string"}, - "name": {"type": "string"}, - "description": {"type": "string"}, - "schemas": { - "type": "object", - "additionalProperties": {"type": "string"}, - "description": "Declared Open CoT sub-schema versions for packaged artifacts.", - }, - "counts": { - "type": "object", - "additionalProperties": {"type": "integer", "minimum": 0}, - }, - "splits": { - "type": "array", - "items": {"type": "string"}, - }, - "created_at": {"type": "string", "format": "date-time"}, - "license": {"type": "string"}, - }, - "$defs": { - "dataset_metadata": { - "type": "object", - "properties": { - "domain": {"type": "string"}, - "source": {"type": "string"}, - "language": {"type": "string"}, - "num_tokens": {"type": "integer", "minimum": 0}, - }, - "additionalProperties": True, - }, - "splits_map": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": {"type": "string"}, - }, - }, - }, - } - - -def stub_schema(rfc_id: str, shortname: str, title: str) -> dict[str, Any]: - return { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": title, - "description": ( - f"Placeholder JSON Schema for RFC {rfc_id}. " - "The RFC does not yet contain an extractable JSON Schema block; evolve this file as the RFC stabilizes." - ), - "type": "object", - "additionalProperties": True, - "x-opencot": {"rfc": rfc_id, "shortname": shortname, "status": "stub"}, - } - - def main() -> int: dups = duplicate_rfc_ids() if dups: rendered = ", ".join(f"{rfc_id}({len(paths)})" for rfc_id, paths in sorted(dups.items())) raise RuntimeError(f"Duplicate RFC ids detected: {rendered}") - manually_authored_schema_ids = {"0052", "0053"} - manually_authored_schemas: dict[str, dict[str, Any]] = {} - for rfc_id in manually_authored_schema_ids: - shortname = RFC_SHORTNAME.get(rfc_id) - if not shortname: - continue - path = SCHEMAS_DIR / schema_filename(rfc_id, shortname) - if path.is_file(): - manually_authored_schemas[rfc_id] = json.loads(path.read_text(encoding="utf-8")) - SCHEMAS_DIR.mkdir(parents=True, exist_ok=True) for stale in SCHEMAS_DIR.glob("rfc-*.json"): stale.unlink() @@ -176,31 +47,12 @@ def main() -> int: for rfc_id, shortname in sorted(RFC_SHORTNAME.items()): md_path = rfc_markdown_path(rfc_id) rel = str(md_path.relative_to(REPO_ROOT)) - title = f"RFC {rfc_id} — {shortname.replace('_', ' ').title()} (stub)" - - data: dict[str, Any] | None = None - - if rfc_id in manually_authored_schemas: - data = manually_authored_schemas[rfc_id] - elif rfc_id == "0004": - data = build_branching_schema(rfc_id) - elif rfc_id == "0007": - data = build_cognitive_pipeline_schema() - elif rfc_id == "0008": - data = build_dataset_packaging_schema() - else: - text = md_path.read_text(encoding="utf-8") - data = extract_marked_schema_with_schema_key(text) - if data is None: - if rfc_id in STRICT_MARKER_RFC_IDS: - raise RuntimeError( - f"RFC {rfc_id} requires explicit schema markers " - f"({rfc_id}-*.md missing {''!r} block)." - ) - data = extract_first_json_object_with_schema(text) - + text = md_path.read_text(encoding="utf-8") + data = extract_marked_schema_with_schema_key(text) if data is None: - data = stub_schema(rfc_id, shortname, title) + raise RuntimeError( + f"RFC {rfc_id} requires an explicit schema block with $schema between opencot:schema markers." + ) data = annotate_schema(data, rfc_id=rfc_id, shortname=shortname, source_relpath=rel) out_path = SCHEMAS_DIR / schema_filename(rfc_id, shortname) @@ -208,8 +60,8 @@ def main() -> int: registry_schemas[shortname] = schema_relative_path(rfc_id, shortname) reg = { - "version": "1.0", - "description": "Registry of Open CoT JSON Schemas extracted from or aligned with RFCs.", + "version": "2.0", + "description": "Registry of Open CoT cognitive interface schemas extracted from normative RFC blocks.", "schemas": dict(sorted(registry_schemas.items(), key=lambda kv: kv[1])), } _write_json(REGISTRY_PATH, reg) diff --git a/tools/validate.py b/tools/validate.py index 42c0222..1e51271 100644 --- a/tools/validate.py +++ b/tools/validate.py @@ -20,15 +20,19 @@ from schema_lib import duplicate_rfc_ids, load_registry, registry_schema_paths # noqa: E402 from schema_resolver import SchemaResolver # noqa: E402 -TIER_A_SHORTNAMES: tuple[str, ...] = ( - "reasoning", - "verifier_output", - "tool_invocation", - "branching", - "reward", - "ensemble", +CORE_SHORTNAMES: tuple[str, ...] = ( + "cognitive_artifact", + "capability_snapshot", + "execution_intent", + "policy_gate", + "observation_receipt", + "reconciliation_result", "cognitive_pipeline", - "dataset_packaging", + "execution_budget", + "requester_identity", + "human_approval", + "conformance_registry", + "compact_context", ) @@ -127,64 +131,36 @@ def _validate_examples(resolver: SchemaResolver, reg: Any | None) -> list[str]: Draft7Validator(schema, registry=reg).validate(instance) except Exception as e: errors.append(f"{path.relative_to(_REPO_ROOT)}: instance invalid: {e}") - elif shortname == "reasoning": - try: - from reference.python.validator import validate_trace - - validate_trace(instance) - except Exception as e: - errors.append(f"{path.relative_to(_REPO_ROOT)}: reasoning example invalid: {e}") return errors -def _check_tier_a_example_coverage() -> list[str]: +def _check_core_example_coverage() -> list[str]: errors: list[str] = [] examples_root = _REPO_ROOT / "examples" - for shortname in TIER_A_SHORTNAMES: + for shortname in CORE_SHORTNAMES: p = examples_root / shortname if not p.is_dir(): - errors.append(f"missing required Tier A examples folder: examples/{shortname}/") + errors.append(f"missing required core examples folder: examples/{shortname}/") continue has_json = any(x.is_file() and x.suffix == ".json" and not x.name.startswith("_") for x in p.glob("*.json")) if not has_json: - errors.append(f"Tier A examples folder has no JSON fixtures: examples/{shortname}/") + errors.append(f"Core examples folder has no JSON fixtures: examples/{shortname}/") return errors def _check_conformance_profiles() -> list[str]: errors: list[str] = [] - examples_root = _REPO_ROOT / "examples" - - # Profile A: core reasoning - if not any((examples_root / "reasoning").glob("*.json")): - errors.append("ProfileA failed: examples/reasoning/ must contain at least one fixture") - - # Profile B: tool + verifier sidecars - if not any((examples_root / "tool_invocation").glob("*.json")): - errors.append("ProfileB failed: examples/tool_invocation/ must contain at least one fixture") - if not any((examples_root / "verifier_output").glob("*.json")): - errors.append("ProfileB failed: examples/verifier_output/ must contain at least one fixture") - - # Profile C: dataset packaging - manifest_path = examples_root / "dataset_packaging" / "manifest.json" - if not manifest_path.is_file(): - errors.append("ProfileC failed: examples/dataset_packaging/manifest.json is required") - else: - try: - manifest = json.loads(manifest_path.read_text(encoding="utf-8")) - except json.JSONDecodeError as e: - errors.append(f"ProfileC failed: manifest.json is not valid JSON: {e}") - else: - splits = manifest.get("splits") - if not isinstance(splits, list) or not all(isinstance(s, str) for s in splits): - errors.append("ProfileC failed: manifest.splits must be a list of strings") - else: - required = {"train", "validation", "test"} - missing = sorted(required - set(splits)) - if missing: - errors.append(f"ProfileC failed: manifest.splits missing required entries: {', '.join(missing)}") - if len(splits) != len(set(splits)): - errors.append("ProfileC failed: manifest.splits contains duplicate values") + fixtures_root = _REPO_ROOT / "conformance" / "fixtures" / "profile_core" + required = { + "cognitive_artifact.json", + "capability_snapshot.json", + "reconciliation_result.json", + } + if not fixtures_root.is_dir(): + return ["Core profile failed: conformance/fixtures/profile_core/ is required"] + present = {path.name for path in fixtures_root.glob("*.json")} + for missing in sorted(required - present): + errors.append(f"Core profile failed: conformance/fixtures/profile_core/{missing} is required") return errors @@ -192,10 +168,17 @@ def _check_conformance_profiles() -> list[str]: def _cross_consistency(loaded: dict[str, dict[str, Any]]) -> list[str]: """Lightweight checks across known pairs.""" warnings: list[str] = [] - if "rfc-0007-cognitive-pipeline.json" in loaded: - s = json.dumps(loaded["rfc-0007-cognitive-pipeline.json"]) - if "rfc-0001-reasoning.json" not in s: - warnings.append("rfc-0007-cognitive-pipeline.json should reference rfc-0001-reasoning.json") + if "rfc-0006-reconciliation-result.json" in loaded: + s = json.dumps(loaded["rfc-0006-reconciliation-result.json"]) + expected_refs = ( + "rfc-0001-cognitive-artifact.json", + "rfc-0002-capability-snapshot.json", + "rfc-0003-execution-intent.json", + "rfc-0005-observation-receipt.json", + ) + for ref in expected_refs: + if ref not in s: + warnings.append(f"rfc-0006-reconciliation-result.json should reference {ref}") return warnings @@ -221,7 +204,7 @@ def main() -> int: errs += _check_refs(resolver, loaded) if not args.no_examples: errs += _validate_examples(resolver, reg) - errs += _check_tier_a_example_coverage() + errs += _check_core_example_coverage() if not args.skip_conformance: errs += _check_conformance_profiles() for w in _cross_consistency(loaded): @@ -232,7 +215,7 @@ def main() -> int: print(e, file=sys.stderr) return 1 if not args.skip_conformance: - print("Conformance profiles: A/B/C checks passed.", file=sys.stderr) + print("Conformance profile: core checks passed.", file=sys.stderr) print(f"OK: {len(loaded)} schemas, registry loaded, validation passed.", file=sys.stderr) return 0