Skip to content

Define reusable reference-document model (ExecPlan 2.2.6) - #48

Draft
leynos wants to merge 1 commit into
mainfrom
define-reference-document-model-csrt6h
Draft

Define reusable reference-document model (ExecPlan 2.2.6)#48
leynos wants to merge 1 commit into
mainfrom
define-reference-document-model-csrt6h

Conversation

@leynos

@leynos leynos commented Feb 28, 2026

Copy link
Copy Markdown
Owner

Summary

Introduce ExecPlan for roadmap item 2.2.6 to define a reusable ReferenceDocument model with hexagonal-architecture boundaries. Adds a Makefile gate for static type checks and a design-focused planning document detailing entities, ports, and phased work.

Changes

  • Added docs/execplans/2-2-6-define-reusable-reference-document-model.md
  • Updated Makefile: added typecheck target to run cargo check

Rationale

  • Establishes domain-boundaries and repository contracts independent of ingestion-job scope.
  • Enables versioned ReferenceDocument artifacts (Document, Revision, Binding) and their persistent adapters.
  • Provides a clear, auditable plan with staged milestones and acceptance criteria.

Plan of work (high level)

  • Stage A: baseline source verification and architecture boundary lock
  • Stage B: domain model and ER design for ReferenceDocument, ReferenceDocumentRevision, ReferenceBinding
  • Stage C: repository ports and persistence adapters
  • Stage D: API contract and behavioural flows
  • Stage E: documentation, roadmap closure, and quality gates

Acceptance criteria (high level)

  • ER diagram for ReferenceDocument, ReferenceDocumentRevision, ReferenceBinding
  • Glossary entries for all three entities
  • Documented repository contracts and API surface (transport layer unchanged)
  • Gate checks in Makefile (check-fmt, typecheck, lint, test) pass
  • Relevant design, user, and developer documentation updated
  • Roadmap item 2.2.6 marked done after gates pass

Validation and testing

  • Local gates to run: make check-fmt, make typecheck, make lint, make test
  • Unit tests and behavioural tests to be added/updated as work proceeds

Notes & risks

  • If referenced docs are missing, Stage A requires creating substitutes and documenting rationale
  • Ensures end-user and internal documentation stays in sync with planned changes

Artifacts

  • ExecPlan document detailing constraints, tolerances, risks, interfaces, and staged deliverables
  • Design decisions and mappings to domain entities

◳ Generated by DevBoxer


ℹ️ Tag @devboxerhub to ask questions and address PR feedback

📎 Task: https://www.devboxer.com/task/70ae7028-3ced-4255-8cf1-178102b86640

Summary by Sourcery

Define an execution plan for introducing a reusable, hexagonally-architected reference document model and add a type-checking quality gate to the build.

Build:

  • Add a Makefile typecheck target that runs cargo check as part of the standard quality gates.

Documentation:

  • Add an ExecPlan document outlining constraints, risks, entities, interfaces, and staged work for the reusable ReferenceDocument model feature.

- Added comprehensive ExecPlan document outlining roadmap item 2.2.6
- Defines reusable ReferenceDocument domain model with hexagonal boundaries
- Details constraints, risks, interfaces, and staged implementation plan
- Includes added Makefile target 'typecheck' for gate completeness
- Provides architectural and testing strategies with acceptance criteria

This lays groundwork for decoupled document modeling and API contracts as scoped.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@sourcery-ai

sourcery-ai Bot commented Feb 28, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds an ExecPlan design document for roadmap item 2.2.6 that defines a reusable ReferenceDocument domain model and introduces a new make typecheck gate wired to cargo check to support static type/borrow checks in the Rust toolchain.

ER diagram for planned ReferenceDocument domain model

erDiagram
  ReferenceDocument {
    uuid document_id
    string external_key
    string title
    string kind
    json metadata
    datetime created_at
  }

  ReferenceDocumentRevision {
    uuid revision_id
    uuid document_id
    int revision_number
    text content
    json content_metadata
    datetime created_at
  }

  ReferenceBinding {
    uuid binding_id
    uuid revision_id
    uuid series_id
    string profile_kind
    datetime bound_at
  }

  SeriesProfile {
    uuid series_id
    string profile_kind
  }

  ReferenceDocument ||--o{ ReferenceDocumentRevision : has
  ReferenceDocumentRevision ||--o{ ReferenceBinding : selected_by
  SeriesProfile ||--o{ ReferenceBinding : owns
Loading

Class diagram for planned repositories and domain entities

classDiagram
  class ReferenceDocument {
    +document_id
    +external_key
    +title
    +kind
    +metadata
    +created_at
  }

  class ReferenceDocumentRevision {
    +revision_id
    +document_id
    +revision_number
    +content
    +content_metadata
    +created_at
  }

  class ReferenceBinding {
    +binding_id
    +revision_id
    +series_id
    +profile_kind
    +bound_at
  }

  class ReferenceDocumentRepository {
    <<interface>>
    +create_document(command)
    +get_document(document_id)
    +add_revision(command)
    +list_revisions(document_id)
  }

  class ReferenceBindingRepository {
    <<interface>>
    +bind_revision(command)
    +get_binding(series_id, profile_kind)
  }

  class SqlAlchemyReferenceDocumentRepository {
    +create_document(command)
    +get_document(document_id)
    +add_revision(command)
    +list_revisions(document_id)
  }

  class SqlAlchemyReferenceBindingRepository {
    +bind_revision(command)
    +get_binding(series_id, profile_kind)
  }

  ReferenceDocumentRepository <|.. SqlAlchemyReferenceDocumentRepository
  ReferenceBindingRepository <|.. SqlAlchemyReferenceBindingRepository

  ReferenceDocumentRepository --> ReferenceDocument
  ReferenceDocumentRepository --> ReferenceDocumentRevision
  ReferenceBindingRepository --> ReferenceBinding
Loading

File-Level Changes

Change Details Files
Add a static type-check Makefile target integrated into existing quality gates.
  • Extend the PHONY target list to include the new typecheck goal.
  • Define a typecheck target that runs cargo check with existing CARGO_FLAGS.
  • Document the target as running static type and borrow checks in its help description.
Makefile
Introduce an ExecPlan document that specifies the staged design and implementation plan for a reusable ReferenceDocument model within hexagonal architecture boundaries.
  • Create a roadmap-aligned ExecPlan markdown file for step 2.2.6 under docs/execplans.
  • Document constraints, tolerances, risks, and architecture boundaries for ReferenceDocument, ReferenceDocumentRevision, and ReferenceBinding entities.
  • Define repository port interfaces, planned Falcon API endpoints, staged work plan (A–E), acceptance criteria, and validation commands including the new typecheck gate.
docs/execplans/2-2-6-define-reusable-reference-document-model.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch define-reference-document-model-csrt6h

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant