1. DevCraft Platform
  2. Documentation
  3. Decisions and roadmap

Contributing

Decisions and roadmap

Describes the development build as of 2026-10-11. The platform is under active development; statuses are marked on each page.

This page collects the architecture decision records (ADRs) of DevCraft Platform and the current project status against the roadmap. It is for developers who need to know why the platform is built the way it is, which decisions are binding, and what is delivered, partial or still planned.

What an ADR is in this project

An architecture decision record is a short document that captures one significant decision: the situation that forced it, what was decided, and what follows from it. ADRs live in the repository under docs/adr/, one Markdown file per decision, numbered with four digits and a kebab-case title, for example docs/adr/0004-generic-jsonb-record-store-for-m1.md.

The architecture documents (docs/ARCHITECTURE.md, docs/DATA_MODEL.md, docs/SECURITY.md, docs/ROADMAP.md) describe the intended design. ADRs amend that design. When an ADR and an older design section disagree, the ADR wins, and the design document carries a note pointing at it. For example, the storage section of the architecture is marked as amended by ADR 0004, and every mention of Inertia is read through ADR 0001.

ADRs are not rewritten after the fact. A later decision that changes an earlier one is a new ADR that names what it supersedes or amends.

When an ADR is required

An ADR is required in these cases:

  • Before changing a decision on the "expensive to change" list. The architecture lists fifteen such decisions (record storage, inheritance strategy, primary keys, scopes, access default, audit, tenancy, identifier rules, filter contract, scripting, metadata-as-code format, API shape, records not being Eloquent models, licence, vendor prefix). They are summarised on the Architecture page. None of them changes without an ADR in docs/adr/ first.
  • When a decision is added to that list. The roadmap's definition of done requires an ADR for every decision that changed or was added to the list during a milestone.
  • When a milestone deliberately deviates from its planned order or scope in a way that affects the data model or the public contract. ADR 0004 (interim record store before the schema synchronizer) is the example.

Smaller design choices are documented in the feature documents under docs/ (for example docs/UPDATE_SETS.md or docs/SYSTEM_LOGGING.md) and do not need an ADR.

ADR format

Every ADR in the repository follows the same structure:

Title
# ADR NNNN — Decision in one line.
Header
A short list with Status (proposed or accepted, with the date, and the milestone it applies to when it is interim), and where relevant Supersedes, Amends, Related and Deciders.
Context
The forces and constraints that made a decision necessary, including what the earlier design said.
Decision
Numbered, concrete statements: names of tables, classes, endpoints and rules.
Consequences
What becomes easier, what becomes harder, what follow-up work is now required, and which documents must be read differently.
Optional sections
Alternatives rejected with the reason for each, or a table of known limitations and their planned remedies.
# ADR 0006 — Short decision title

- Status: proposed (YYYY-MM-DD)
- Amends: docs/ARCHITECTURE.md section N
- Related: ADR 000X

## Context
## Decision
## Consequences
## Alternatives rejected

The template above is illustrative; ADR 0006 does not exist.

ADR 0001: Vue SPA with a Laravel REST API

Implemented Status: accepted (2026-10-10). Supersedes the Inertia.js proposal in the architecture's technology section.

Context. The architecture proposed Inertia.js so that one person could ship a first web application quickly without designing an API. Phase 1 had already been built as a standalone Vue 3 and TypeScript SPA with Vue Router, a typed data-access layer and in-memory mocks. The platform is metadata-driven: lists and forms render from definitions, every list request is a serialisable query and every write is a change. Those are exactly what a server-driven UI exchanges over an API, so Inertia's advantage was small and its cost, a second rendering path integrations cannot use, was real.

Decision.

  • The frontend stays a standalone SPA in frontend/, built and deployed as static assets.
  • The backend in backend/ exposes a versioned REST API under /api/v1. The SPA is the first client; integrations use the same endpoints and the same authorisation.
  • Sanctum in two modes: cookie sessions for the SPA (GET /sanctum/csrf-cookie, then POST /api/v1/auth/login; SANCTUM_STATEFUL_DOMAINS; CORS with credentials for those origins only) and personal access tokens with abilities for integrations (POST /api/v1/auth/tokens, Authorization: Bearer).
  • Errors are RFC 9457 problem details with a stable code, field errors on 422 and the logged X-Request-Id.
  • One SPA origin and one API origin per installation, single tenant.
  • Controllers live in each module's Http folder, not in app/Http.

Consequences. Two deployables instead of one. The API contract must be documented and versioned from the start; breaking changes go to /api/v2. Inertia features such as shared props are unavailable. The SPA's binding in frontend/src/api/index.ts is switched from mocks to HTTP contract by contract, and mocks remain for component development and tests.

ADR 0002: Metadata contracts

Partial Status: accepted (2026-10-10).

Context. Phase 1 rendered lists from ListDefinition and forms from FormDefinition, both hand-written TypeScript in frontend/src/definitions/. The goal is that administrators define tables, fields, lists and forms as data, so the renderers must accept the same shapes from the server without changing.

Decision.

  • The TypeScript shapes are the contract: FieldDefinition, ColumnDefinition, ListDefinition, FormDefinition, ListQuery, FilterCondition, PageResult and the record wire format are frozen as v1 metadata DTOs. The ADR proposes publishing them as JSON Schema and generating TypeScript from PHP DTOs.
  • Metadata endpoints under /api/v1/meta/tables deliver tables, fields, list and form definitions; responses are meant to carry an ETag from the dictionary version.
  • Mapping rules: field types map 1:1; mandatory becomes required; read-only or a denied field write becomes readOnly; a denied field read removes the field from both definition and record; choices become options; reference qualifiers are applied only on the server.
  • List filters are the leaf form of the condition AST; nested groups are an additive extension.
  • Breaking DTO changes need a new major API version; additive fields must be optional.

Consequences. The backend owns validation rules; the client keeps only an instant-feedback mirror. Identity tables created by migrations are described in the dictionary and adopted, not recreated.

ADR 0003: Configuration identity, versioning, audit and change sets

Partial Status in the ADR header: proposed (2026-10-10), to be accepted before milestone M1. Its foundations were built with M1 and the update set phases.

Context. Configuration (dictionary, layouts, access rules, rules, flows) is data in the same database as operational records. Before the dictionary tables existed, the project had to decide how configuration is identified across environments, versioned, grouped, promoted and undone. Retrofitting this later would mean migrating every installation.

Decision (twelve points, condensed).

  • Every table has a data_class: configuration, environment, operational or reference. Only the first two are versioned and captured.
  • Configuration objects keep their UUIDv7 id across environments, carry a deterministic package_key (scope/table/natural-name) and a content_hash of one canonical serialisation that excludes system columns, secrets and environment-specific values.
  • Object-level versions in sys_config_version with base_version_id; diffs are computed, never stored; restore writes a new version.
  • One append-only, in-transaction sys_audit extended with source, change set, version, data class, actor kind and client.
  • Automatic capture into change sets with an explicit state machine; dependencies computed and blocking; conflicts found by three-way hash comparison; rollback by a generated back-out set; DDL that loses data never automatic.
  • Code is not configuration: PHP rules live in git. Flow executions pin a flow version.

Consequences. The writers emit versions and change set items in the same transaction from day one, even before change sets had a UI.

ADR 0004: Generic JSONB record store for M1

Implemented Status: accepted (2026-10-10) for milestone M1, to be revisited in M2. Amends the architecture's storage section and decision 1 of the expensive-to-change list.

Context. The architecture decided on real tables and columns generated by a SchemaSynchronizer, and that remains the target. Building the synchronizer first would have meant shipping runtime DDL, advisory locks, idempotent plans and two database roles before a single record could be read through metadata. The metadata engine milestone asked for the opposite order and explicitly ruled out creating PostgreSQL tables from user input.

Decision.

  • Metadata is storage-agnostic. sys_table.storage is jsonb (rows in the shared sys_record table, the default for API-created tables) or physical (an existing migrated table named in physical_table, used to adopt sys_user).
  • RecordQuery and RecordWriter are the only read and write paths; they validate against the dictionary and delegate SQL to a StorageDriver (JsonbStorage or PhysicalStorage).
  • No identifier from request input reaches SQL. Query expressions are confined to App\Platform\Records\Storage by an architecture test.
  • sys_user is the one user table; password and token columns are absent from the dictionary.
  • Dictionary tables use Eloquent models written only through MetadataWriter; application records are not Eloquent models.

Consequences. Creating a table is instant, transactional and reversible. Known limits: no per-field indexes, no database-level foreign keys or uniqueness, decimals as JSON numbers, casts on comparisons, one shared table. Tens of thousands of rows per logical table are acceptable; high-volume data must wait for M2. Moving a table to physical storage later is a data move, not an API change.

ADR 0005: Table inheritance on the record store

Implemented Status: accepted (2026-10-11) for the core tables milestone; the physical layout is revisited with the schema synchronizer in M2. Amends ADR 0004's "no inheritance" limitation.

Context. The task family (incident, problem, change_request, change_task) and the configuration item class tree under cmdb_ci cannot be modelled without inheritance. A child must carry its parent's fields, a parent query must return every class, references to a parent must accept any class, and each class needs its own choices and defaults.

Decision.

  • Logical inheritance is real now on the JSONB store. Child records are sys_record rows whose table_id and sys_class_name name the class; a query covers the table and all descendants.
  • MetadataRepository computes the effective schema along the ancestor chain (at most five levels): ancestors' fields, own fields, overrides, inherited access, display field and numbering.
  • Overrides (sys_field_override, table-scoped sys_choice) are versioned configuration written by MetadataWriter::overrideField. Type, name, reference target and uniqueness cannot be overridden; children cannot redeclare inherited fields.
  • Reads through a parent report the actual class; updates through a parent merge, never replace; references accept any descendant; audit rows carry class and root.
  • Numbering from the number attribute with a locked counter in sys_number_counter; composite uniqueness through unique_together; layouts fall back to the nearest ancestor.

Consequences. The family tables have their own states, defaults, labels, numbering and layouts through the unchanged APIs. The synchronizer can later move a hierarchy to one physical root table by changing only the storage driver. Still missing: field access per class, reclassification of a record, dependent choices.

Project status and roadmap

The roadmap in docs/ROADMAP.md splits the work into milestones with acceptance criteria and required tests. Milestones M0 to M4 are mandatory before any application is built; after M4 the order can follow demand. The status below uses the status notes in the roadmap as of 2026-10-11. Where the roadmap has no explicit note for a milestone (M4, M6), the status reflects what exists in the code and says so.

MilestoneScopeStatusWhat exists / what remains
M0 FoundationsRepository, Docker, CI, authentication, design tokens, shellPartialDelivered as Phase 1 and 2: CI, Laravel modules, Docker Compose, Sanctum sessions and tokens, problem details, structured logging, shell, users and roles, AGPL-3.0-only licence. Open: Playwright end-to-end suite, security headers middleware.
M1 Metadata kernelDictionary, field types, metadata APIsDeliveredDelivered 2026-10-10 as the first metadata engine on the JSONB record store (ADR 0004), extended 2026-10-11 with inheritance and the core tables. The schema synchronizer moved to M2.
M2 Record engineQuery, write, validate, audit, lock, numberingPartialNumbering, inheritance semantics and composite uniqueness delivered 2026-10-11 (ADR 0005). Physical tables and the schema synchronizer remain.
M3 Access controlGroups, roles, ACL engine, redaction, elevationPartialStarted 2026-10-11: effective roles through groups, field read and write access. Open: access rule tables, record conditions, role containment, redaction, elevation.
M4 Dynamic UIGeneric list and form, filter builder, related lists, navigationPartialNo roadmap status note. The generic list and form screens render any dictionary table; related lists and the history tab are listed as next steps in the metadata engine document.
M5 Rules and notificationsDeclarative and code rules, notifications, scheduled jobsPlannedNot started.
M6 REST API v1Table, metadata and aggregate APIs, tokens, OpenAPIPartialNo roadmap status note. Table and metadata APIs and tokens with abilities exist; aggregate API, OpenAPI document, idempotency keys and keyset pagination do not.
M7 WorkflowState machines, approvals, flow enginePartialVisual Flow Designer (frontend) delivered 2026-10-10; the flow runtime is open.
M8a Change setsLocal update setsDeliveredDelivered 2026-10-11 as local update sets, followed the same day by Phases 3.2 to 3.6: XML package export and preview, remote instances, remote update sets, conflict resolution and the application engine.
M8b Packages, promotion, back-outPromotion between environments with preview and back-outPartialPackages, preview, remote retrieval, conflict handling and application are covered by the phases above. Back-out, dictionary deletes, physical tables and signatures remain.
M8 Scopes and releasesScoped applications, metadata-as-code, bundled demo appPartialRecord data transfer (XML export and import per table) delivered 2026-10-10. Application scopes and the bundled application remain.
System logging (Phase 3)Platform event logDeliveredDelivered 2026-10-11: SystemLogger, the syslog table in the generic list, request and correlation ids, sanitisation, 7-day retention with a scheduled pruner.
M9 Hardening and 1.0Attachments, search, MFA, SSO, dashboards, production compose, penetration testPlannedNot started.

The roadmap's effort figures are indicative sizes for one developer, not commitments, and this page does not repeat them. A list of post-1.0 items (runtime script sandbox hardening, import sets, SLA engine, reporting, live lists and others) is kept in the roadmap as a backlog, not as a plan.

Definition of done

The roadmap defines what "done" means for every milestone:

  • All acceptance criteria are demonstrated by automated tests that run in CI on a fresh database created through the platform's own bootstrap.
  • Pest unit and feature tests are green; static analysis passes at the agreed level; Pint and ESLint are clean; vue-tsc strict passes; architecture tests pass.
  • The Playwright end-to-end suite is green against the Docker stack. This gate is not in place yet Planned.
  • The security tests listed for the milestone in docs/SECURITY.md exist and pass.
  • Documentation is updated: docs/ for design changes, the changelog, and an ADR in docs/adr/ for every decision that changed or was added to the expensive-to-change list.
  • No TODO that affects security or data integrity remains in merged code.

In practice, CI (GitHub Actions) runs the baseline guard node scripts/check-baseline.mjs, the frontend gates (npm run typecheck, npm run lint, npm test, npm run build), the runner's Node tests, and the backend gates (Pint, PHPStan level 6, Pest on PostgreSQL and on SQLite). Locally, the backend suite runs only through the script below, because it uses a dedicated devcraft_test database and forces test-only cache, session, queue and mail drivers. Plain php artisan test inside the container would run against the development database and the shared Redis cache.

scripts/backend-test.sh                          # Pest on PostgreSQL (devcraft_test) and SQLite
docker compose exec api vendor/bin/pint --test
docker compose exec api vendor/bin/phpstan analyse --memory-limit=1G

See the Development guide for the full workflow.