Ontology

D 58 completed
Library
unknown / go · small
199
Files
87,842
LOC
0
Frameworks
6
Languages

Pipeline State

completed
Run ID
#358579
Phase
done
Progress
1%
Started
Finished
2026-04-13 01:31:02
LLM tokens
0
Previous runs
Generated by the Repobility scanner · https://repobility.com
#StatusPhaseStartedFinished
Same scanner, your repo: https://repobility.com — Repobility
#83469failed2026-03-20 21:40:522026-03-20 21:45:53

Pipeline Metadata

Stage
Skipped
Decision
skip_scaffold_dup
Novelty
52.80
Framework unique
Isolation
Last stage change
2026-04-16 18:15:42
Deduplication group #48102
Member of a group with 1 similar repo(s) — canonical #1874 view group →
Top concepts (11)
Architecture DescriptionMiddleware/PipelineProject DescriptionObserver/Event EmittertestingData/MLUser ManagementDatabaseLoggingSearchTesting
Repobility · MCP-ready · https://repobility.com

AI Prompt

Create an ontology-first architecture for property management using Go. The system should use a CUE schema as the single source of truth to automatically generate everything downstream, including database schemas, REST API handlers, protobuf definitions, authorization policies, and agent tooling. I need the structure to support 15 entities across domains like Person, Property, and Lease. The process should be runnable via a single `make generate` command, ensuring that changes in the CUE schema update all generated components automatically.
go cue ontology rest-api property-management code-generation database backend
Generated by gemma4:latest

Catalog Information

The Propeller Ontology project provides an ontology-first architecture for property management, generating a fully functional REST API from a single CUE schema.

Description

Propeller Ontology is an innovative approach to property management that uses a declarative language called CUE as the single source of truth. This CUE schema generates everything downstream, including database schemas, HTTP handlers, API definitions, event catalogs, authorization policies, and agent tooling. The project includes 15 entities across four domains, with state machines defined for each entity with a status field. Code generators are used to automate the generation of code from the CUE schema.

الوصف

مشروع ontology أولوية مشروع property management هي نهج مبتكر في إدارة العقارات يستخدم لغة تعريفية اسمها CUE ك مصدر حقيقي واحد. يتم إنشاء كل شيء downstream من هذا المصدر الواحد، بما في ذلك قواعد البيانات ، ووكلاء HTTP ، وتحديدات API ، وقوائم الأحداث ، سياسات التأشير ، و أدوات एजنت . يحتوي المشروع على 15 كيانًا عبر أربعة مجالات ، مع وضع آلات الحالة لكل كيان له حقل status. يتم استخدام جيلر الكود لتحويل تلقائيًا إنشاء الكود من المصدر الواحد CUE.

Novelty

9/10

Tags

property-management ontology-first-architecture declarative-language code-generation rest-api

Technologies

chi ent

Claude Models

claude-opus-4.6

Quality Score

D
58.5/100
Structure
51
Code Quality
49
Documentation
46
Testing
55
Practices
77
Security
92
Dependencies
70

Strengths

  • CI/CD pipeline configured (github_actions)
  • Consistent naming conventions (snake_case)
  • Good security practices \u2014 no major issues detected

Weaknesses

  • No LICENSE file \u2014 legal ambiguity for contributors
  • 31814 duplicate lines detected \u2014 consider DRY refactoring
  • 64 'god files' with >500 LOC need decomposition

Recommendations

  • Add a linter configuration to enforce code style consistency
  • Add a LICENSE file (MIT recommended for open source)

Security & Health

30.6h
Tech Debt (A)
High
DORA Rating
A
OWASP (100%)
Repobility · open methodology · https://repobility.com/research/
PASS
Quality Gate
A
Risk (1)
Unknown
License
21.6%
Duplication
Full Security Report AI Fix Prompts SARIF SBOM

Languages

go
93.5%
markdown
5.0%
shell
0.9%
sql
0.6%
yaml
0.0%
toml
0.0%

Frameworks

None detected

Symbols

method4,816
function4,287
constant958
struct309
type_alias114
variable19
interface1

Concepts (11)

Repobility · code-quality scanner for AI-generated software · https://repobility.com
CategoryNameDescriptionConfidence
All rows above produced by Repobility · https://repobility.com
ai_architectureArchitecture Description# Architecture Overview: ontology-service ## 1. Executive Summary The **ontology-service** is a Go‑based REST API that exposes an ontology of real‑estate entities (accounts, properties, leases, etc.) to internal business applications. It serves primarily the internal product team and partners that need to query, mutate, and index ontology data. The system follows a **hexagonal (ports & adapters)** style, with a thin presentation layer (HTTP handlers) that delegates to a service layer, which in turn orchestrates domain logic via the Ent ORM. The codebase is mature (auto‑generated entities, migrations, and OpenAPI spec) but still evolving; a key strength is the use of **Ent** for type‑safe persistence, while a key risk is the reliance on in‑memory activity stores that may not scale beyond a single instance. ## 2. System Architecture Diagram ```mermaid graph TD subgraph Presentation HTTP[HTTP Server] -->|JSON| Router[chi Router] end subgraph Application Router -->|Handler| Service[Service Layer] end subgraph Domain Service -->|Ent Client| Ent[Ent ORM] Service -->|Event Bus| EventBus[Event Emitter] end subgraph Infrastructure Ent -->|PostgreSQL| DB[PostgreSQL] EventBus -->|In‑memory| Activity[Activity Indexer] end subgraph CLI CLI -->|Codegen| EntGen[cmd/entgen] CLI -->|OpenAPI| OpenAPIGen[cmd/openapigen] end subgraph DevOps Makefile -->|Build| Docker[Docker] .air.toml -->|Live reload| Air[Air] end ``` ## 3. Architectural Layers | Layer | Responsibility | Key files/directories | Boundary enforcement | Dependencies | |-------|----------------|-----------------------|----------------------|--------------| | **Presentation** | Exposes HTTP endpoints, parses requests, serialises responses, applies middleware. | `cmd/server/main.go`, `cmd/server/*_handler.go` (if any) | Strict – only imports `net/http`, `chi`, `zap`, and the service layer. | `application/service`, `infrastructure/logging` | | **Application / Service** | Orchestrates business use‑cases, validates input, calls domain services, publishes events. | `internal/activity`, `cmd/server/*_handler.go` | Moderate – service functions are exported from `internal/activity` and used by handlers. | `domain`, `infrastructure/database` | | **Domain** | Encapsulates business entities and rules. | `ent/schema/*` (e.g., `ent/schema/account.go`), `ent/*` (generated code). | Loose – generated code is in `ent/` but domain logic is minimal; most rules are expressed via Ent queries. | `application/service` | | **Infrastructure** | Persistence, event bus, logging, migrations. | `ent/migrate/migrations/*`, `ent/tx.go`, `internal/activity/memory_store.go`, `cmd/server/main.go` | Moderate – infrastructure packages are imported by service layer but not vice‑versa. | `domain`, `application/service` | | **CLI / DevOps** | Code generation, OpenAPI spec, migrations, live reload. | `cmd/*`, `Makefile`, `.air.toml`, `buf.gen.yaml`, `codegen/apigen.cue` | Not a runtime layer; used only during development/build. | N/A | ## 4. Component Catalog | Component | Location | Responsibility | Public Interface | Dependencies | Dependents | |-----------|----------|----------------|------------------|--------------|------------| | **HTTP Server** | `cmd/server/main.go` | Starts the HTTP server, registers routes, applies middleware. | `func main()`, `func newRouter(*ent.Client) *chi.Mux` | `ent.Client`, `internal/activity`, `zap.Logger` | N/A | | **Ent ORM** | `ent/` (generated) | Provides CRUD for entities (Account, Property, Lease, etc.). | `ent.Client`, `ent.Account`, `ent.Property` | `database/sql`, `pgx` | HTTP Server, Service Layer | | **Event Bus** | `internal/activity/indexer.go`, `internal/activity/memory_store.go` | Publishes and indexes domain events (Observer pattern). | `func (i *Indexer) Publish(event Event)` | `zap.Logger`, `sync.Mutex` | HTTP Handlers, CLI tools | | **Code Generator** | `cmd/entgen/main.go` | Generates Ent code from schema definitions. | `func main()` | `ent/schema`, `go generate` | N/A | | **OpenAPI Generator** | `cmd/openapigen/main.go` | Generates OpenAPI spec from Ent schema. | `func main()` | `codegen/apigen.cue`, `ent/schema` | Documentation, API clients | | **CLI Tools** | `cmd/agentgen`, `cmd/apigen`, `cmd/agentgen/main.go` | Generates agents, API clients, etc. | `func main()` | `ent/schema`, `codegen` | N/A | | **Activity Store** | `internal/activity/memory_store.go` | In‑memory persistence of activity events. | `func NewMemoryStore() *MemoryStore` | `sync.Map`, `zap.Logger` | Service Layer, Tests | ## 5. Component Interactions The HTTP server receives a request, validates it, creates a domain entity via the Ent client, publishes an event, and returns a JSON response. ```mermaid sequenceDiagram participant Client participant Server as HTTP Server participant Service as Service Layer participant ORM as Ent ORM participant DB as PostgreSQL participant Bus as Event Bus Client->>Server: POST /properties Server->>Service: handleCreateProperty(request) Service->>ORM: client.Property.Create().SetName("Lakeview").Exec(ctx) ORM->>DB: INSERT INTO properties (...) ORM-->>Service: propertyID Service->>Bus: Publish(PropertyCreated{ID: propertyID}) Bus->>Server: (none – async) Server->>Client: 200 OK { "id": propertyID } ``` ### Key Points * **Handlers** (`cmd/server/*_handler.go`) only call exported service functions; they never import domain or infrastructure directly. * The **Event Bus** is used by the service layer to publish events; the bus itself is in‑memory and does not persist across restarts. * **CLI tools** invoke `go generate` or `entgen` during development; they do not interact at runtime. ## 6. Data Flow | Step | Source | Transformation | Destination | |------|--------|----------------|-------------| | 1 | HTTP request (JSON) | `json.Decoder` → Go struct (`CreatePropertyRequest`) | HTTP Handler | | 2 | Handler | Validation (struct tags, custom logic) | Service Layer | | 3 | Service | `ent.Client.Property.Create().SetName(req.Name).Exec(ctx)` | Ent ORM | | 4 | ORM | SQL `INSERT` via `pgx` driver | PostgreSQL | | 5 | Service | `activity.Indexer.Publish(PropertyCreated{ID: id})` | Event Bus | | 6 | Handler | Marshal entity to JSON | HTTP Response | ## 6. Technology Decisions | Decision | Rationale | Evidence | |----------|-----------|----------| | **Go 1.20** | Modern language features, better performance, and long‑term support. | `go.mod` line 1: `go 1.20` | | **Ent ORM** | Type‑safe, auto‑generated persistence layer that reduces boilerplate. | `ent/` directory contains ~200 files; `ent/migrate/migrations/20260225212726_init.sql` defines tables. | | **chi Router** | Minimal, composable router that keeps the presentation layer thin. | `cmd/server/main.go` imports `github.com/go-chi/chi/v5`. | | **zap Logger** | Structured, high‑performance logging. | `cmd/server/main.go` imports `go.uber.org/zap`. | | **PostgreSQL + pgx** | Relational store for ontology data; connection pooling via `pgxpool`. | `ent/migrate/migrations/20260225212726_init.sql` contains `CREATE TABLE` statements. | | **CUE + buf** | Generates OpenAPI spec and ensures schema consistency. | `codegen/apigen.cue` (CUE) + `buf.gen.yaml` (protobuf) | | **Air (live reload)** | Speeds up development by reloading on file changes. | `.air.toml` in root. | ## 7. Scalability & Performance | Concern | Current State | Mitigation | |---------|---------------|------------| | **Database** | PostgreSQL is the single source of truth; connection pooling via `pgxpool` is used. | Increase pool size, add read replicas, consider sharding for large datasets. | | **Activity Indexer** | In‑memory store (`internal/activity/memory_store.go`) is local to the process. | Replace with a distributed cache (85%
design_patternMiddleware/PipelineFound middleware-named files80%
auto_descriptionProject DescriptionAn ontology-first architecture for property management where a CUE schema is the single source of truth and code generators derive everything downstream: database schemas, HTTP handlers, API definitions, event catalogs, authorization80%
design_patternObserver/Event EmitterFound event emission/subscription patterns70%
arch_layertestingDetected testing layer70%
auto_categoryData/MLdata-ml70%
business_logicUser ManagementDetected from 27 related files50%
business_logicDatabaseDetected from 22 related files50%
business_logicLoggingDetected from 10 related files50%
business_logicSearchDetected from 18 related files50%
business_logicTestingDetected from 8 related files50%

Quality Timeline

1 quality score recorded.

View File Metrics
Powered by Repobility — scan your code at https://repobility.com

Embed Badge

Add to your README:

![Quality](https://repos.aljefra.com/badge/82719.svg)
Quality BadgeSecurity Badge
Export Quality CSVDownload SBOMExport Findings CSV