|
| 1 | +-- SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +-- VQL schema: Repository octad |
| 3 | +-- Each repository is an 8-modality entity in VeriSimDB |
| 4 | + |
| 5 | +DEFINE SCHEMA repo VERSION 1.0.0; |
| 6 | + |
| 7 | +-- Graph modality: relationships between repos |
| 8 | +DEFINE GRAPH repo { |
| 9 | + depends_on: [UUID], -- repos this depends on |
| 10 | + depended_by: [UUID], -- repos depending on this |
| 11 | + clade_edge: UUID, -- link to clade octad |
| 12 | + monorepo_parent: UUID?, -- parent monorepo (if child) |
| 13 | + monorepo_children: [UUID], -- children (if monorepo) |
| 14 | + forge_links: { -- primary + foreign key links |
| 15 | + github: STRING, |
| 16 | + gitlab: STRING?, |
| 17 | + bitbucket: STRING?, |
| 18 | + codeberg: STRING?, |
| 19 | + sourcehut: STRING?, |
| 20 | + radicle: STRING? |
| 21 | + }, |
| 22 | + tags: [STRING] -- free-form tags |
| 23 | +}; |
| 24 | + |
| 25 | +-- Vector modality: semantic embedding for similarity search |
| 26 | +DEFINE VECTOR repo { |
| 27 | + purpose_embedding: FLOAT[384], -- sentence-transformer embedding of description |
| 28 | + tech_embedding: FLOAT[384] -- embedding of technology stack |
| 29 | +}; |
| 30 | + |
| 31 | +-- Tensor modality: numeric metrics over time |
| 32 | +DEFINE TENSOR repo { |
| 33 | + completion: FLOAT, -- 0.0 to 100.0 |
| 34 | + loc: INT, -- lines of code |
| 35 | + test_count: INT, -- number of tests |
| 36 | + open_issues: INT, -- open issue count |
| 37 | + dependency_count: INT -- direct dependencies |
| 38 | +} TEMPORAL; -- time-series tracking enabled |
| 39 | + |
| 40 | +-- Semantic modality: typed metadata |
| 41 | +DEFINE SEMANTIC repo { |
| 42 | + type: ENUM("repo"), |
| 43 | + clade_primary: STRING(2), -- 2-char clade code |
| 44 | + clade_secondary: [STRING(2)], |
| 45 | + license: STRING, -- SPDX identifier |
| 46 | + languages: [STRING], -- programming languages used |
| 47 | + version: STRING?, -- current version if applicable |
| 48 | + status: ENUM("active", "stale", "archived", "experimental", "complete"), |
| 49 | + lineage_type: ENUM("standalone", "monorepo", "monorepo-child", "inflated", "deflated") |
| 50 | +}; |
| 51 | + |
| 52 | +-- Document modality: full-text searchable content |
| 53 | +DEFINE DOCUMENT repo { |
| 54 | + title: STRING, -- display name |
| 55 | + description: TEXT, -- one-line description |
| 56 | + readme_summary: TEXT?, -- first section of README |
| 57 | + setup_instructions: TEXT?, -- extracted setup/install docs |
| 58 | + changelog_latest: TEXT?, -- latest changelog entry |
| 59 | + state_body: TEXT? -- STATE.a2ml content cache |
| 60 | +} INDEXED; -- full-text search enabled |
| 61 | + |
| 62 | +-- Temporal modality: time tracking |
| 63 | +DEFINE TEMPORAL repo { |
| 64 | + created: TIMESTAMP, -- repo creation date |
| 65 | + last_commit: TIMESTAMP?, -- most recent git commit |
| 66 | + last_state_change: TIMESTAMP?,-- last meaningful state update |
| 67 | + last_activity: TIMESTAMP, -- max(commit, state_change, bot_finding) |
| 68 | + sessions: [{ -- work sessions |
| 69 | + id: STRING, |
| 70 | + started: TIMESTAMP, |
| 71 | + ended: TIMESTAMP?, |
| 72 | + agent: STRING -- "claude-code", "jonathan", etc. |
| 73 | + }] |
| 74 | +}; |
| 75 | + |
| 76 | +-- Provenance modality: origin and authority tracking |
| 77 | +DEFINE PROVENANCE repo { |
| 78 | + creator: STRING, -- who created the repo |
| 79 | + last_modifier: STRING, -- who last changed state |
| 80 | + authority_pointers: [{ -- pointer authority system |
| 81 | + field: STRING, -- which field |
| 82 | + type: ENUM("pointer", "local", "derived"), |
| 83 | + source: STRING?, -- external source path (if pointer) |
| 84 | + hash: STRING?, -- SHA-256 of cached value |
| 85 | + synced_at: TIMESTAMP? |
| 86 | + }], |
| 87 | + attestations: [{ -- signed attestations |
| 88 | + claim: STRING, |
| 89 | + signer: STRING, |
| 90 | + signature: STRING, |
| 91 | + timestamp: TIMESTAMP |
| 92 | + }] |
| 93 | +}; |
| 94 | + |
| 95 | +-- Spatial modality: reserved for future use |
| 96 | +DEFINE SPATIAL repo { |
| 97 | + org_x: FLOAT?, -- position in org hierarchy visualisation |
| 98 | + org_y: FLOAT? |
| 99 | +}; |
0 commit comments