emacsway/grade
55.9
Adequate · 21 September 2026
4.8k
lines of production code
Go
primary language
4
measurements over time
What this system is
This system is a grade management service that tracks specialists, their competences, and endorsement-based grading workflows. It implements a domain model where specialists accumulate endorsements to progress through grades, with each state change captured as a domain event. The architecture relies on event sourcing for aggregates like Artifacts and Specialists, persisted via a PostgreSQL database using a DDD infrastructure layer.
How it got here
2022 — Domain model and event sourcing implementation
11 changes.
This period focused on implementing core domain models for the grading system, including Member, Artifact, Grade, Competence, and Specialist aggregates. The work established an event-sourced architecture with dedicated exporters, reconstitutors, and test fixtures for each entity. Additionally, the underlying SQL schema and public domain event interfaces were defined to support the new domain logic.
2023 — Domain model and repository implementation
18 changes.
This period focused on implementing the core domain models and their corresponding infrastructure layers. New aggregates for Tenant, Endorser, Member, Artifact, and Competence were introduced alongside their respective repositories, value objects, and database query handlers. The work also included organizing the codebase by extracting SQL queries into dedicated subdirectories and configuring the PostgreSQL database for Docker deployment.
Features
Add Competence Repository and Faker for Grade Module
The system now includes a new CompetenceRepository to handle persistence operations for the Competence domain, including methods for inserting, updating, and retrieving competence records. A corresponding CompetenceFaker has been added to facilitate testing and data generation. The repository implementation leverages the extracted 'ascetic-ddd-go' seedwork, which provides the underlying domain event handling and session management. Tests have been added to verify the repository's insert and get functionality against a PostgreSQL database.
grade/internal/infrastructure/repositories/competence · high confidence
Add TenantRepository with Get and Insert operations
The TenantRepository is introduced in the infrastructure layer, providing Get and Insert methods that interact with the database via the ascetic-ddd-go session abstraction. A corresponding test suite validates these operations against a PostgreSQL backend, ensuring that tenant entities can be persisted and retrieved correctly.
grade/internal/infrastructure/repositories/tenant · high confidence
Add database query handlers for Competence domain events and lookups
New SQL query implementations are added to the infrastructure layer to support the Competence domain. This includes a query to insert a new Competence record (CompetenceCreatedQuery), a query to retrieve a Competence by ID (CompetenceGetQuery), and queries to update a Competence's name (NameUpdatedQuery) with both standard and optimistic locking variants. These changes enable the system to persist and fetch Competence data in the database.
grade/internal/infrastructure/repositories/competence/queries · high confidence
Add member query handlers for retrieval and insertion
New query handlers have been introduced for the member repository: a MemberGetQuery that executes a SELECT statement to retrieve member data by tenant and member ID, and a MemberInsertQuery that executes an INSERT statement to create a new member record, returning the generated primary key. These changes implement the data access logic for reading and creating member entities within the infrastructure layer.
grade/internal/infrastructure/repositories/member/queries · high confidence
Added Member repository and test coverage
Introduced a new Member repository implementation that handles database interactions for the Member entity, including insertion and retrieval operations. The change also includes a corresponding test suite that validates the repository's functionality against a PostgreSQL database, ensuring that member data can be successfully persisted and fetched.
grade/internal/infrastructure/repositories/member · high confidence
Added PostgreSQL configuration for Docker deployment
A new PostgreSQL configuration file (grade.conf) has been added to the docker-compose directory, providing a customized setup for the database service. This change supports the project's Docker-based deployment process, allowing the database to be configured with specific memory, connection, and performance settings within the containerized environment.
docker-compose · high confidence
Added domain events for competence creation and name updates
New domain events, CompetenceCreated and NameUpdated, have been introduced to track when a competence is initially created and when its name is subsequently updated. These events capture the relevant state changes, including identifiers, timestamps, and aggregate versions, enabling downstream systems to react to these specific competence lifecycle moments.
grade/internal/domain/competence/events · high confidence
Endorser repository and specifications implemented with PostgreSQL support
Added the Endorser repository implementation, including a faker for testing, query extraction, and specification compilation for the EndorserCanCompleteEndorsementSpecification. The repository supports insert and get operations using PostgreSQL, with corresponding unit tests verifying the SQL generation and repository behavior.
grade/internal/infrastructure/repositories/endorser · high confidence
Initial SQL schema for tenant, member, competence, endorser, and event sourcing
The database initialization script (init.sql) now defines the core relational schema for the grading infrastructure. This includes tables for tenants, members, and competences, along with triggers to manage per-tenant sequences. It also introduces tables for endorser and specialist roles, a many-to-many endorsement relationship, and an event\_log table to support event sourcing. This establishes the foundational data model required for the application's domain logic.
grade/internal/infrastructure/sql · high confidence
Introduce Artifact repository with event-sourced persistence and tests
Added the Artifact repository implementation which persists and retrieves Artifact aggregates using an event store, including a new faker for test data and comprehensive unit tests for insert and get operations.
grade/internal/infrastructure/repositories/artifact · high confidence
Introduce ArtifactProposed domain event and reconstitution logic
Added the ArtifactProposed domain event to the system, including its data model, accessor methods, and an associated reconstitutor for deserializing past events. This change enables the application to track and reconstruct the state of an artifact when it is proposed, supporting event sourcing patterns for this specific entity.
grade/internal/domain/artifact/events · high confidence
Introduce Assignment domain model with export, faker, and reconstitution support
The Assignment entity is now defined in the specialist/assignment package, including the core struct, an exporter for serialization, a faker for test data generation, and a reconstitutor for deserialization. A dedicated values package provides a typed Reason string with export capabilities. These changes support the internal representation and data handling of assignments within the grade domain.
grade/internal/domain/specialist/assignment · high confidence
Introduce Endorsement domain model and supporting infrastructure
The system now supports an Endorsement concept, where a member can endorse an artifact with a specific grade and version. This change introduces the core Endorsement domain struct, along with an EndorsementExporter for serialization, an EndorsementReconstitutor for deserialization, and an EndorsementFaker for testing. The Endorsement entity tracks the specialist's and endorser's IDs, grades, and versions, and calculates a weight based on the relative grades. Tests verify the endorsement matching, weight calculation, and export functionality.
grade/internal/domain/specialist/endorsement · high confidence
Introduce Endorser domain model and specification pattern
The codebase now includes a new \Endorser\ aggregate root in \grade/internal/domain/endorser\, which manages endorsement counts and grade states. This change introduces a specification pattern (\EndorserCanCompleteEndorsementSpecification\) to encapsulate the business rules for completing an endorsement, separating the validation logic from the domain object. The implementation includes an exporter for serialization, a faker for testing, and comprehensive unit tests for both the aggregate and the specification.
grade/internal/domain/endorser · high confidence
Introduce Grade domain model with navigation and comparison capabilities
A new Grade domain model has been added to the internal domain layer, providing a value object that represents a grade with a maximum value of 5. The implementation includes a factory constructor that validates the grade value and associates it with a predefined endorsement count matrix. Users can navigate between grades using Next() and Previous() methods, which return errors if the grade exceeds the maximum or drops below zero. The model also supports comparison operations (LessThan, GreaterThan, Equal) and provides an Export method to retrieve the underlying uint8 value.
grade/internal/domain/grade · medium confidence
Introduce Member domain model with export, reconstitution, and test coverage
The Member domain entity is introduced, featuring an Export method that serializes state into a MemberExporter struct, a MemberReconstitutor that rebuilds the entity from exported data, and a MemberFaker for generating test instances. A corresponding unit test verifies the export behavior.
grade/internal/domain/member · high confidence
Introduce Specialist domain aggregate with endorsement and grade assignment logic
The Specialist aggregate is introduced to manage a member's received endorsements, grade progression, and assignments. It enforces business rules such as preventing cross-tenant endorsements, self-endorsement, and lower-grade endorsements, and automatically assigns a new grade when a threshold of endorsements is reached. The implementation includes domain events (EndorsementReceived, GradeAssigned), an exporter for state serialization, a reconstitutor for state reconstruction, and a testable factory for testing purposes.
grade/internal/domain/specialist · high confidence
Introduce SpecialistRepository with new insert queries for specialist, endorsement, and assignment records
The specialist repository layer now includes a new \SpecialistRepository\ that handles inserting specialist entities, along with dedicated insert queries for endorsements and assignments. These new query structs (\SpecialistInsertQuery\, \EndorsementInsertQuery\, \AssignmentInsertQuery\) map domain values to SQL \INSERT\ statements for the \specialist\, \specialist\_endorsement\, and \specialist\_assignment\ tables, utilizing the \ascetic-ddd-go\ session interface for database execution.
grade/internal/infrastructure/repositories/specialist · high confidence
Introduce Tenant aggregate and supporting domain components
Added the Tenant aggregate root, including its core model, export mechanism, and reconstitution logic. The change also introduces value objects for TenantId and Name, a TenantFaker for test data generation, and a TenantReconstitutor to rebuild the aggregate from exported data. A unit test is included to verify the export behavior.
grade/internal/domain/tenant · high confidence
Introduce event-sourced Artifact domain model with reconstitution and export support
The Artifact domain model now uses event sourcing, storing state via an internal EventSourcedAggregate. A new ArtifactReconstitutor reconstructs the aggregate from a snapshot and past events, while an ArtifactExporter serializes the domain state for external use. The domain also includes an ArtifactFaker for test data generation and a test verifying the export behavior.
grade/internal/domain/artifact · high confidence
Introduce new query handlers for artifact operations
Added two new query handlers in the artifact repository infrastructure: ArtifactNextIdGetQuery, which retrieves the next available artifact ID from a database sequence, and ArtifactProposedQuery, which handles inserting artifact proposed events with associated payload data such as status, name, URL, and related IDs. These changes support internal data access patterns for artifact management.
grade/internal/infrastructure/repositories/artifact/queries · high confidence
Introduced value objects for member identity and names
Added new value types for member identification and names, including MemberId (combining tenant and internal IDs), InternalMemberId, FirstName, LastName, and FullName. Each value object includes constructors, export methods for serialization, and dedicated test coverage.
grade/internal/domain/member/values · high confidence
Behavioural changes
Endorser repository queries extracted to separate subdirectory
The SQL query implementations for the endorser repository (insert, update, delete, and get) have been moved from the parent directory into a new \queries\ subdirectory. This change improves the internal organization of the infrastructure layer by grouping all endorser-related database operations together, making the codebase easier to navigate and maintain.
grade/internal/infrastructure/repositories/endorser/queries · high confidence
Introduce Competence domain model and supporting infrastructure
The Competence aggregate is now defined with its value objects, events, and a reconstitutor for state reconstruction. An exporter and a faker (with repository support) are added to support testing and data generation. The change also migrates the project's DDD seedwork to the 'ascetic-ddd-go' library, updating the import path and version.
grade/internal/domain/competence · medium confidence
Introduced PublicDomainEvent interface in buildingblocks
Added new interface definitions for public domain events in the buildingblocks package, specifically creating PublicDomainEvent interfaces in both the root and domain subdirectories to standardize event contracts.
buildingblocks · medium confidence
Introduces structured value objects for Artifact domain
The Artifact domain now uses dedicated value objects for its core properties, replacing primitive types with strongly-typed wrappers. This includes a composite ArtifactId (combining TenantId and an internal identifier), along with separate value objects for Description, Name, Status, and Url. Each value object includes a constructor, an Export method for serialization, and associated tests. This change enforces domain integrity by validating and encapsulating these values within the domain model.
grade/internal/domain/artifact/values · high confidence
Introduces structured value objects for Competence identification and naming
The codebase now defines explicit value objects for the Competence domain: a composite CompetenceId (combining a TenantId and an internal identifier), an InternalCompetenceId, and a Name type. These new types replace the previous primitive-based handling, providing stricter typing, validation, and serialization (via Export/Reconstitute patterns) for competence identifiers and names within the grade system.
grade/internal/domain/competence/values · medium confidence
Refactored tenant repository queries into a dedicated subdirectory
The SQL query implementations for the tenant repository have been moved from the parent directory into a new 'queries' subdirectory. This change reorganizes the internal structure of the infrastructure layer, separating the query definitions for tenant operations (such as Get and Insert) into their own package, while maintaining the same database interaction logic.
grade/internal/infrastructure/repositories/tenant/queries · medium confidence
Dependencies
Updated Go dependencies and upgraded to Go 1.25
The project's Go module has been updated to use Go 1.25. Several dependencies have been added or updated, including github.com/krew-solutions/ascetic-ddd-go v0.1.2, github.com/stretchr/testify v1.8.4, and github.com/hashicorp/go-multierror v1.1.1. Additionally, numerous indirect dependencies such as github.com/google/uuid, github.com/jackc/pgx/v5, and golang.org/x/crypto have been added to the go.sum file to support the new module configuration.
(dependencies) · medium confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 55 → 56 (+1.1)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 98 → 96 (-1.1)
- Architecture 100 → 89 (-11.4)
- Maturity 39 → 39 (-0.2)
- Readiness 64 → 70 (+5.9)
- Security 66 → 76 (+10.7)
- Domain Modelling 100 → 100 (+0.0)
- Event-Driven 100 → 100 (+0.0)
- Event Sourcing 60 → 60 (+0.0)
Resolved (19)
- Coverage not included — suite not readable by the collector
- Critical CVE: [GHSA redacted] (go.mod)
- Critical CVE: [GHSA redacted] (go.mod)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (10 lines × 3) (grade/internal/infrastructure/repositories/competence/queries/competence_created_query.go)
- Duplicated block (11 lines × 2) (grade/internal/domain/specialist/assignment/assignment_faker.go)
- Duplicated block (12 lines × 3) (grade/internal/domain/artifact/artifact_faker.go)
- Duplicated block (12 lines × 3) (grade/internal/infrastructure/repositories/competence/queries/name_updated_query.go)
- Duplicated block (14 lines × 2) (grade/internal/infrastructure/repositories/endorser/endorser_repository.go)
- Duplicated block (14 lines × 2) (grade/internal/infrastructure/repositories/member/member_repository.go)
- Duplicated block (9 lines × 2) (grade/internal/domain/artifact/artifact.go)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Medium CVE: GO-2026-5970 (go.mod)
- Medium IaC: CKV_DOCKER_3 (Dockerfile)
- No exposed public API
- Off-boarding risk: anonymized user #1
- Test reliability not included
New (46)
- Critical CVE: [GHSA redacted] (go.mod)
- Critical CVE: [GHSA redacted] (go.mod)
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (grade/internal/domain/endorser/endorser_faker.go)
- Duplicated block (11 lines × 2) (grade/internal/domain/specialist/assignment/assignment_faker.go)
- Duplicated block (11 lines × 3) (grade/internal/infrastructure/repositories/competence/queries/competence_created_query.go)
- Duplicated block (13 lines × 2) (grade/internal/domain/artifact/artifact.go)
- Duplicated block (13 lines × 3) (grade/internal/infrastructure/repositories/competence/queries/name_updated_query.go)
- Duplicated block (14 lines × 2) (grade/internal/infrastructure/repositories/endorser/endorser_repository.go)
- Duplicated block (14 lines × 2) (grade/internal/infrastructure/repositories/member/member_repository.go)
- Duplicated block (14 lines × 3) (grade/internal/domain/artifact/values/artifact_id.go)
- Duplicated block (15 lines × 3) (grade/internal/domain/artifact/artifact_faker.go)
- Duplicated block (39 lines × 2) (grade/internal/domain/artifact/artifact_reconstitutor.go)
- Duplicated block (5 lines × 2) (grade/internal/domain/competence/competence_faker.go)
- Duplicated block (6 lines × 2) (grade/internal/infrastructure/repositories/specialist/queries/assignment/assignment_insert_query.go)
- Duplicated block (7 lines × 2) (grade/internal/domain/competence/values/internal_competence_id.go)
- Edited copy of a member (41 corresponding lines) (grade/internal/domain/artifact/artifact_reconstitutor.go)
- FixmeComment (grade/internal/domain/endorser/endorser.go)
- …and 26 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
emacsway/grade was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit fd6b1cbe8f126cd1d1d3f8b05ae129c6dbb52028 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.