1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Codegen policy for maintenance.
#
# `user_owned` globs are hand-written files that live inside generator-owned trees but are
# NOT schema-derived. `metaphor schema generate [--force]` skips them wholesale (never reads,
# merges, or deletes them). Everything else in src/ is regenerated from schema/models.
#
# Re-exports/declarations that must sit alongside generated code live inside
# `// <<< CUSTOM ... // END CUSTOM` markers (service/mod.rs, presentation/http/mod.rs) and are
# preserved by the marker mechanism, not listed here. lib.rs is the one exception — see its
# entry below.
#
# Add your hand-authored services, handlers, tests, and docs below as you write them.
user_owned:
# src/lib.rs is claimed wholesale: the module builder carries custom state (the GL/inventory/event
# ports behind with_gl_sink/with_inventory_port/with_event_sink, the visit + request write
# services) whose `new()` initializers the marker mechanism can no longer hold — the current
# generator emits no custom slot inside `MaintenanceModuleBuilder::new()` and silently relocates
# that block into the build() struct literal, which then fails to compile (missing/duplicate
# fields). The builder's public API is consumed by host services, so the fields stay; the file is
# therefore hand-owned. Consequence: adding a model now requires hand-wiring its service into the
# struct, build(), and all_crud_routes()/readonly_routes() here.
- "src/lib.rs"
- "src/application/service/maintenance_events.rs"
- "src/application/service/maintenance_gl.rs"
- "src/application/service/maintenance_ports.rs"
- "src/application/service/maintenance_write_service.rs"
- "src/application/service/maintenance_query_service.rs"
# The request-family write path (create/update/transition verbs + the clone-on-done successor
# engine). Same ownership shape as the visit write service above.
- "src/application/service/maintenance_request_write_service.rs"
# Own the hand-written maintenance SQL (the schedule definition + its recurrence advance, the visit
# plan/freeze/complete CAS chain, the part set and its valuation write-back, and the request
# create/transition CAS + successor-spawn SQL) that the write services orchestrate. Declared here —
# not renamed with a `_custom` suffix — so the generator skips them wholesale; this declaration is
# what makes editing them legitimate.
- "src/infrastructure/persistence/maintenance_schedule_repository.rs"
- "src/infrastructure/persistence/maintenance_visit_repository.rs"
- "src/infrastructure/persistence/maintenance_visit_part_repository.rs"
- "src/infrastructure/persistence/maintenance_request_repository.rs"
- "tests/integrity_probes.rs"
- "tests/maintenance_gl_seam.rs"
- "tests/maintenance_golden_cases.rs"
- "tests/request_family_probes.rs"
# Hand-authored shared test harness (pool/GL adapters/fakes) — currently undeclared is the wipe
# class the council flagged on backbone-project; declared here for the same reason.
- "tests/common/mod.rs"
- "scripts/**"
# Hand-authored `impl MaintenanceModule` extension + its regression test (council 2026-08-02 rec #1):
# the safe default route composer that closes the visit invariant-bypass.
- "src/maintenance_module_ext.rs"
- "src/presentation/http/maintenance_lifecycle_handler.rs"
# The request lifecycle HTTP surface (create/transition/recurrence-update verbs).
- "src/presentation/http/maintenance_request_lifecycle_handler.rs"
- "tests/guarded_routes_test.rs"
- "tests/lifecycle_routes_test.rs"
# The request-family tables are created by ONE hand-written migration (20260829150000_create_request_family)
# instead of the per-model pair the generator emits for new models. The generated pair has a cross-file
# FK ordering bug (the requests migration's stage FK references a table the later-numbered stages
# migration creates), and its timestamp derives from the model creation dates, so BOTH possible
# timestamped spellings are claimed here and the files removed — the generator skips user_owned
# paths wholesale, so it will not re-emit them.
- "migrations/20260821140001_create_maintenance_request_table.up.sql"
- "migrations/20260821140001_create_maintenance_request_table.down.sql"
- "migrations/20260821140002_create_maintenance_stage_table.up.sql"
- "migrations/20260821140002_create_maintenance_stage_table.down.sql"
- "migrations/20260829150001_create_maintenance_request_table.up.sql"
- "migrations/20260829150001_create_maintenance_request_table.down.sql"
- "migrations/20260829150002_create_maintenance_stage_table.up.sql"
- "migrations/20260829150002_create_maintenance_stage_table.down.sql"
# The ADR-0029 tenancy strip: drops the company_isolation policies, the
# company-leading indexes and the company_id columns under the ordering
# guard (decorator-first); the composing service's tenancy decorator
# re-declares the fence.
- "migrations/*strip_tenancy*"
# Hand-authored behavior (services + their HTTP surface). Examples:
# - "src/application/service/onboarding_service.rs"
# - "src/presentation/http/guarded_routes.rs"
# Behavior tests (the golden cases / oracle) + BDD features.
- "tests/features/**"
# - "tests/*_golden_cases.rs"
# - "tests/integrity_probes.rs"
# Hand-authored module documentation.
- "docs/**"