mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 14:37:26 +00:00
feat(openontology): implement OpenOntology Phase 0 + local engine and CLI (#99)
Implements OpenPRD 0001 through Phase 0 (specification, schemas, example, docs surface) and Phase 1 (local engine, CLI, conformance tests). Schemas (17 contracts, JSON Schema Draft 2020-12, additionalProperties:false) manifest, namespace, entity-type, property, relationship-type, constraint, query, action, entity, claim, source, evidence, changeset, review, approval, event, package — registered in @logicsrc/validators and exported from @logicsrc/schemas under https://logicsrc.com/schemas/openontology/. @logicsrc/openontology - canonical JSON + sha256 package digests; YAML, JSON, NDJSON, and inline authoring all compile to the same bytes, so digests are authoring-agnostic - id profile: compact / IRI / urn with one canonicalization rule, prefix bound by a Namespace object so IRIs reverse unambiguously - validation: schema, graph (domain/range, datatypes, dangling refs), provenance (source-or-firstParty, agent runId, derivation inputs), policy (excerpt limits, licensing, visibility, staleness) and declared constraints; four severities, stable codes, text/json/yaml/markdown - portable triple-pattern query AST: multi-hop, 14 operators, asOf and recordedAsOf, per-status filtering, distinct/order/limit, explanation mode, and enforced depth/binding/row limits - append-only store: claims are immutable; dispute/retract/supersede append status transitions and the effective status is the latest one - change sets: 9 operations, atomic pre-flight, conflict detection on stale base revisions, semantic diff with duplicate-identity warnings and affected-query deltas, per-operation reviewer decisions - policy: agents propose but can never apply — the denial keys on actor type, so every scope plus high confidence plus --yolo still cannot apply; merges need approval, bulk retractions need two, undeclared action side effects are denied - JSON-LD 1.1 export/import with PROV-O aliases and lossy-field reporting - pluggable signature envelope with a jws-ed25519 reference profile and a fail-closed trust policy CLI: logicsrc ontology init|validate|lint|build|inspect, entity, claim, query, changeset, import, export, audit. Reads take --format, writes default to a proposal, exit codes are stable for CI. Example: examples/openontology/ethereum-ecosystem — 12 entity types, 17 relationship types, 63 entities, 169 claims, 25 sources, 31 evidence records, 5 saved queries, every claim lifecycle state, and a pending merge proposal. All data is fictional; the directory is removable without affecting any core test. Docs: docs/openontology{,-governance,-interoperability}.md, a real /openontology route, homepage + nav + sitemap entries, and a root README section. Verification: 112 new tests; full monorepo build and every workspace test pass; conformance bundle (18 valid + 13 invalid fixtures) runs against the published schemas alone; Node.js 25 and Bun 1.3 produce byte-identical digests, revisions, event trails, and query results. Not included (later PRD phases): MCP resources, REST/SSE, Turso adapter, TUI and PWA surfaces, RDF/SHACL mappings, source adapters, governed actions. Refs: prd/0001-add-logicsrc-openontology-spec.md Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0d9dab0447
commit
58c942c67f
101 changed files with 11934 additions and 10 deletions
25
examples/openontology/ethereum-ecosystem/data/sources.ndjson
Normal file
25
examples/openontology/ethereum-ecosystem/data/sources.ndjson
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{"openontology":"0.1","kind":"Source","id":"eth:source:northwind-team","sourceType":"web-page","uri":"https://example.org/team","title":"Northwind Labs team page","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:bluebird-team","sourceType":"web-page","uri":"https://example.org/bluebird/team","title":"Bluebird Foundation team page","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:cinder-team","sourceType":"web-page","uri":"https://example.org/cinder/team","title":"Cinder Collective contributors","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:harbor-team","sourceType":"web-page","uri":"https://example.org/harbor/people","title":"Harbor Research people","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:tessellate-members","sourceType":"web-page","uri":"https://example.org/tessellate/members","title":"Tessellate DAO members","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:quill-about","sourceType":"web-page","uri":"https://example.org/quill/about","title":"Quill Systems about page","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:zk-prover-readme","sourceType":"markdown","uri":"https://example.org/repo/zk-prover/README.md","title":"zk-prover README","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:indexer-readme","sourceType":"markdown","uri":"https://example.org/repo/indexer/README.md","title":"indexer README","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:sync-readme","sourceType":"markdown","uri":"https://example.org/repo/sync/README.md","title":"sync-engine README","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:bridge-readme","sourceType":"markdown","uri":"https://example.org/repo/bridge/README.md","title":"bridge-contracts README","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:account-readme","sourceType":"markdown","uri":"https://example.org/repo/account/README.md","title":"account-sdk README","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:light-readme","sourceType":"markdown","uri":"https://example.org/repo/light/README.md","title":"light-client README","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:commit-a41f","sourceType":"git-commit","uri":"https://example.org/repo/zk-prover/commit/a41f","title":"zk-prover commit a41f","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/plain","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:commit-b72c","sourceType":"git-commit","uri":"https://example.org/repo/indexer/commit/b72c","title":"indexer commit b72c","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/plain","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:commit-c93d","sourceType":"git-commit","uri":"https://example.org/repo/sync/commit/c93d","title":"sync-engine commit c93d","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/plain","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:commit-d10e","sourceType":"git-commit","uri":"https://example.org/repo/bridge/commit/d10e","title":"bridge commit d10e","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/plain","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:grants-ledger","sourceType":"api-response","uri":"https://example.org/api/grants","title":"Grants ledger API","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:roadmap-2026","sourceType":"web-page","uri":"https://example.org/roadmap/2026","title":"2026 ecosystem roadmap","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0","stale":true,"lastCheckedAt":"2026-07-26T00:00:00Z"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:proof-summit-program","sourceType":"web-page","uri":"https://example.org/events/proof-summit","title":"Proof Summit program","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:rollup-workshop-notes","sourceType":"web-page","uri":"https://example.org/events/rollup-workshop","title":"Rollup Workshop notes","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:l2-registry","sourceType":"api-response","uri":"https://example.org/api/l2s","title":"Layer-2 registry","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:app-registry","sourceType":"api-response","uri":"https://example.org/api/apps","title":"Application registry","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:spec-index","sourceType":"web-page","uri":"https://example.org/specs","title":"Protocol specification index","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:paper-index","sourceType":"web-page","uri":"https://example.org/papers","title":"Publication index","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
{"openontology":"0.1","kind":"Source","id":"eth:source:dependency-manifest","sourceType":"csv","uri":"https://example.org/data/dependencies.csv","title":"Dependency manifest export","publisher":"example.org","retrievedAt":"2026-07-26T00:00:00Z","mediaType":"text/html","license":"CC-BY-4.0"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue