Add the LogicSRC OpenContext specification

OpenContext is an open specification for durable, portable, permissioned,
provenance-aware context shared between humans and AI agents. It defines how
organizational knowledge is described, authorized, versioned, resolved,
audited, and handed between replaceable workers without losing institutional
state.

Follows the OpenPRD/OpenOntology pattern already in the repo: self-contained
JSON Schemas in @logicsrc/schemas, a reference implementation package, CLI
subcommands, docs, examples, and an OpenPRD record.

Schemas (8, all self-contained so a third party can fetch one file and
validate against it with no further resolution):
  manifest, object, bundle, role, provenance, decision, diagnostic,
  audit-event — registered in @logicsrc/validators and schemas:validate.

Reference implementation (@logicsrc/opencontext):
  loader with upward manifest discovery, the full resolution pipeline,
  authority/supersession, permissions, redaction, lifecycle, provenance,
  deterministic digests, doctor, search, graph, history/diff, guarded writes,
  audit events, and file/http/git/sqlite adapters.

CLI: all 15 specified commands, as a standalone `opencontext` binary and as
`logicsrc context`, sharing one implementation so the two cannot drift.

Design decisions worth noting:

- Supersession is declared, never inferred from version numbers. Inferring it
  would hide the governance failure it represents and make
  multiple-active-versions and duplicate-canonical impossible to detect.

- The bundle digest identifies the resolved context, not the moment it was
  computed, so generated_at/bundle_id/digest/as_of are excluded while objects,
  lifecycle states, exclusions and warnings are covered. That is what lets a
  decision record cite exactly the context that produced it.

- A role's own max_classification beats an inherited one, so a ceiling on a
  shared base role cannot silently cap a role deliberately granted more;
  requesting several roles at once still takes the lowest, so combining roles
  never escalates.

- Scope wildcards match whole dotted segments only. A trailing .* covers a
  subtree; an interior * matches exactly one segment. Substring matching here
  would be an access-control bug.

- --include narrows an existing scope and is applied after it, never merged
  into it, so a request can never widen what a role holds.

Verified: 226 tests across core primitives, permissions/redaction, the
resolution pipeline, security, the published conformance fixtures (13 valid,
35 invalid, 8 resolution scenarios), project behaviour, and the five shipped
examples — which are held to --strict and a 100% health score. Benchmarks meet
every published budget (resolve 1,000 objects in ~33ms against a 2s target).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-08-09 18:22:42 +00:00
parent 1bb7ba6e60
commit ec3ed64f20
211 changed files with 17234 additions and 6 deletions

View file

@ -0,0 +1,19 @@
---
id: brand
type: identity
layer: L1
title: How Northwind sounds
authority: canonical
owner: founders
durability: long-lived
classification: internal
canonical_source: true
updated: 2026-08-01T00:00:00Z
applies_to: [sales-agent, support]
---
Plain, specific, and never breathless. We say what a thing costs and what it
does not do.
- Say "shipments arrive late sometimes" rather than "industry-leading reliability".
- Never invent a number. If you do not know the figure, say so.

View file

@ -0,0 +1,30 @@
---
id: decisions.2026-08-01-usage-based-pricing
type: decision
layer: L5
title: Keep seat-free pricing
authority: approved
owner: founders
status: accepted
durability: long-lived
classification: internal
canonical_source: true
created: 2026-08-01T00:00:00Z
updated: 2026-08-01T00:00:00Z
decision: Price on lanes, never on seats or agent count.
rationale:
- Customers are adding agents faster than people; per-seat pricing would tax that.
- Lane count is the number customers already budget against.
alternatives:
- option: Per-seat pricing
rejected_because: Penalises exactly the automation we are selling.
consequences:
- Revenue does not grow when a customer adds agents; it grows when they ship more.
approved_by:
- role: founders
references: [policies.pricing]
tags: [pricing, governance]
---
Recorded so the next person to propose per-seat pricing can read why it was
already declined, rather than relitigating it from scratch.

View file

@ -0,0 +1,16 @@
---
id: glossary
type: glossary
layer: L1
title: Terminology
authority: canonical
owner: founders
durability: long-lived
classification: internal
canonical_source: true
updated: 2026-08-01T00:00:00Z
---
- **Lane** — an origin/destination pair we quote on.
- **Tender** — an offer of a shipment to a carrier.
- **Seat** — one human user. Agents do not consume seats.

View file

@ -0,0 +1,15 @@
---
id: mission
type: mission
layer: L0
title: Why Northwind exists
authority: canonical
owner: founders
durability: permanent
classification: public
canonical_source: true
updated: 2026-08-01T00:00:00Z
---
Small teams should be able to run serious logistics without hiring a
logistics department.

View file

@ -0,0 +1,24 @@
---
id: policies.pricing
type: policy
layer: L3
title: Pricing
authority: canonical
owner: finance
status: approved
version: 1
durability: long-lived
classification: internal
canonical_source: true
updated: 2026-08-01T00:00:00Z
tags: [pricing]
applies_to: [go-to-market]
review:
interval: 90d
next_review: 2027-01-01
---
Freight starts at $2,500/month for 10 lanes. Additional lanes are $120 each.
Discounts above 15% require finance approval. An agent may quote list price
and standard discounts; it may not invent a new pricing structure.

View file

@ -0,0 +1,18 @@
---
id: products.freight
type: product
layer: L2
title: Northwind Freight
authority: canonical
owner: product
durability: long-lived
classification: internal
canonical_source: true
updated: 2026-08-01T00:00:00Z
tags: [product, freight]
---
Books and tracks full-truckload shipments across 40 lanes.
Not a warehouse management system, and not a customs broker. Agents should
decline both requests rather than improvise.

View file

@ -0,0 +1,20 @@
---
id: procedures.quote
type: procedure
layer: L4
title: How to produce a quote
authority: approved
owner: sales
status: approved
durability: operational
classification: internal
canonical_source: true
updated: 2026-08-01T00:00:00Z
references: [policies.pricing, products.freight]
applies_to: [go-to-market]
---
1. Confirm the lane count and the contract length.
2. Apply list pricing from `policies.pricing`.
3. If the customer asks for more than 15% off, stop and escalate to finance.
4. Record the quote against the account before sending it.