Repository navigation
Expand file tree
/
Copy pathcustomization-surface.yaml
More file actions
1022 lines (1005 loc) · 63.6 KB
/
Copy pathcustomization-surface.yaml
File metadata and controls
1022 lines (1005 loc) · 63.6 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# customization-surface.yaml
# ─────────────────────────────────────────────────────────────────────────────
# Fork-ownership contract for kmp-project-template.
#
# A fork of this template runs `scripts/white-label/sync-dirs.sh` to pull template updates while
# keeping its own branding + features. This file is the SINGLE declared source of
# truth for "who owns this path?" — replacing the ownership knowledge previously
# scattered across scripts/white-label/sync-dirs.sh (SYNC_DIRS + EXCLUSIONS), scripts/white-label/fork-init.sh, and the
# syncForkConfig copy map.
#
# Every path resolves to exactly one owner:
#
# template — the template is the SOLE author. `scripts/white-label/sync-dirs.sh` OVERWRITES the fork's
# copy. A fork edit here is drift and will be clobbered — a genuine fix
# belongs UPSTREAM as a PR to openMF/kmp-project-template.
#
# fork — the fork is the SOLE author. sync NEVER touches it (branding, demo,
# the core/store seam, generated Config.xcconfig, local flavors, icons,
# store listings, fork identity).
#
# merge — BOTH author. sync must do a 3-way MERGE, never a blind copy. This is
# where the "fork permissions silently dropped on sync" class lives:
# AndroidManifest.xml is template-shipped AND fork-extended.
#
# Precedence: FIRST matching rule wins. Rules are ordered most-specific → most-
# general, so the narrow `merge`/`fork` carve-outs win over the broad `template`
# module globs that follow them.
#
# Glob syntax: `*` matches within one path segment; `**` matches across segments;
# `**/x` matches `x` at any depth (including the root).
#
# Coverage is enforced by `scripts/customization-surface.sh --verify` (CI): every
# tracked path must match a NON-default rule, so a new template file can never land
# unclassified and silently clobber a fork later.
# ─────────────────────────────────────────────────────────────────────────────
version: 1
# Path-ownership rules, evaluated FIRST-MATCH-WINS, in file order (see "Precedence" above — this line
# said LAST-MATCH-WINS until 2026-10-31, which contradicted both the header and the engine, and
# would lead anyone trusting it to put a new narrow rule BELOW the broad one it must beat).
# Each rule declares owner (template | fork | merge) and, for merge, the strategy. The default
# is template-first (`**` → template), so fork territory is claimed explicitly — a path no rule
# names resolves to template, which is why a new fork-owned directory needs a rule here before
# the next sync overwrites it.
rules:
# ── Test fixtures — FIRST, so no content-shaped rule below can claim them ──
# A fixture mimics a real tree, so its paths match rules written for real code: `**/demo/**`
# resolved canary fixtures `demo-showcase` and `**/composeResources/**/strings.xml` resolved them
# `merge`, and the sync never delivers either class to a fork that lacks them. Measured 2026-11-02 on
# mifos-x-field-officer-app: 8 fixture files dropped, so compose-strings-apostrophe-canary and
# secrets-needs-generated-canary failed in the fork while passing in the template. A fixture is the
# template's test code, whatever its path looks like.
- glob: "scripts/product-health/tests/**"
owner: template
# ── DEMO feature modules — declared before the merge-required globs below ──
# Same first-match accident as core-base. The repo-wide `**/composeResources/**/strings.xml → merge`
# rule below claims 280 strings.xml across the 14 DEMO feature modules (loans, bills, rates, …),
# while everything else in those same modules — their Kotlin, their build.gradle.kts — resolves
# `fork`. One module, two answers, and the strings half was never reachable anyway: demo modules are
# NOT in SYNC_DIRS (only the home/profile/settings BACKBONE is) and `remove-demo.sh --clean` deletes
# them outright. So the contract promised to sync 280 files the engine cannot fetch and the
# customizer will delete.
#
# Every feature module, the home/profile/settings/onboarding starters included, is the fork's — its
# strings and its manifest follow the module. The repo-wide manifest rule below would otherwise claim
# every feature's manifest (a starter's, and any feature a fork authors) for a merge the engine never
# runs: no feature module is a sync root.
- glob: "feature/**/composeResources/**/strings.xml"
owner: fork
- glob: "feature/**/AndroidManifest.xml"
owner: fork
# ── core-base is FRAMEWORK-SHARED — declared before the merge-required globs below ──
# `core-base/**` resolves `template` further down, but the two merge-required rules that follow
# are repo-WIDE (`**/AndroidManifest.xml`, `**/composeResources/**/strings.xml`) and first-match
# wins, so without this they capture 22 core-base paths: core-base/ui's own 21-locale i18n and the
# core-base/{common,observability} module manifests.
#
# Those globs exist so a FORK can union its own permissions and strings into files it legitimately
# extends — its app module, its features, its core/* packages. core-base is not one of those: it is
# framework-shared, a fork does not touch it, and 3-way merging the framework's own translations
# invites a fork to accumulate edits in a tree that upgrades wholesale. Declaring it template here
# keeps `core-base/**` exactly copy-and-replace, which is what it has always meant.
- glob: "core-base/**/composeResources/**/strings.xml"
owner: template
- glob: "core-base/**/AndroidManifest.xml"
owner: template
# The feature starters (home/profile/settings) are the FORK's foundation — shipped once, never synced
# (not in SYNC_DIRS). Declared here, above the repo-wide manifest/strings merge rules, so those do not
# claim the starters' files for a merge the engine can never reach (sync-coverage-reconcile CL-1).
- glob: "feature/home/**"
owner: fork
- glob: "feature/profile/**"
owner: fork
- glob: "feature/settings/**"
owner: fork
# ── merge-required (declared FIRST — must win over the template module globs) ──
# AndroidManifest: template ships the base manifest; forks add permissions
# (RECORD_AUDIO, FOREGROUND_SERVICE_*, etc). A blind copy DROPS the fork's — the
# exact loss class this contract exists to close.
- glob: "**/AndroidManifest.xml"
owner: merge
strategy: manifest-union
# String resources: template base keys + fork-added keys must union.
- glob: "**/composeResources/**/strings.xml"
owner: merge
strategy: strings-union
# Version catalog: fork pins versions + adds libs; template adds/bumps. Already a
# 3-way merge in scripts/white-label/sync-dirs.sh STEP 4.5 — declared here so the ownership is explicit.
- glob: "gradle/libs.versions.toml"
owner: merge
strategy: catalog-3way
# Settings: fork includes its own :feature:* modules; template adds core modules.
- glob: "settings.gradle.kts"
owner: merge
strategy: include-union
# Fork-owned settings-include seam (B1/T11). A fork adds its module includes HERE; the template
# settings.gradle.kts applies it via `apply(from = ...)` and stays full-copy / include-union.
- glob: "settings.local.gradle.kts"
owner: fork
# Template-sync version marker: records the template commit this fork last synced from. Written by
# scripts/white-label/sync-dirs.sh on every sync, so it is FORK-OWNED — a template dir-copy must
# never overwrite a fork's own last-synced pointer with the template's.
- glob: ".template-version"
owner: fork
# The fork's navigation seam package (see the registry block further down for what it holds). It has to
# come BEFORE the cmp-navigation merge rules: rules are first-match-wins, so a fork file such as
# registry/app/navigation/RootNavGraph.kt otherwise matched `RootNav*.kt` / `*Navigation*.kt` below and
# a sync tried to 3-way merge code the template never shipped.
- glob: "cmp-navigation/**/registry/**"
owner: fork
# Root navigation host: template owns the scaffold; forks wire feature routes in.
- glob: "cmp-navigation/**/*Navigation*.kt"
owner: merge
strategy: kotlin-3way
- glob: "cmp-navigation/**/RootNav*.kt"
owner: merge
strategy: kotlin-3way
# Nav DI + tab registry: template ships the base graph; forks add their feature
# modules + bottom-nav tabs. Blind copy drops them (the awaazly 2026-07-19 loss class).
- glob: "cmp-navigation/**/di/*.kt"
owner: merge
strategy: kotlin-3way
- glob: "cmp-navigation/**/*TabItem*.kt"
owner: merge
strategy: kotlin-3way
# Room database registry (E1/C7 — was the LAST hand-merged file under core/**).
# AppDatabase.kt has NO row — deliberately. It was the LAST hand-merged file under core/,
# because Room needs ONE compile-time `entities = [...]` literal and a fork's tables could not live
# in a separate file the way every other seam works. It is now GENERATED WHOLE by
# `tools/database-ksp` from the `@DbEntity` / `@DbDao` / `@DbConverters` annotations into
# `build/generated/ksp/`, so there is no committed file for a sync to copy, merge, or own — and
# re-adding a row would be a dead glob (`--verify` zero-match). Generating the literal removed the
# merge rather than arbitrating it.
# Fork-owned Room migration LEDGER — where each template migration unit landed in THIS fork's
# version sequence, plus the fork's own migrations. owner:fork is load-bearing, not tidiness: the
# template's ledger says v13, a fork's may say v27, and blind-copying ours over theirs would strand
# every installed device on a version with no path forward.
# Template-owned counterpart to the ledger: WHAT the template may add, with no version numbers.
# Full-copies, because a fork never edits it — its answer goes in the fork-owned ledger below.
# Framework tables, declared by the module that owns them. Template-owned: a fork that edited
# these would break core-base at runtime. A fork's OWN tables are not declared in YAML at all —
# they are `@DbEntity`-annotated classes, which is why this file has no fork counterpart.
- glob: "core-base/database/module-schema.yaml"
owner: template
# Per-module package lifecycle, declared next to the code it describes. TEMPLATE-ONLY and
# full-copying — the same split that took migration-units.yaml out of the `owner: merge` app.yaml,
# so a template package addition is never a 3-way merge against a fork's edit.
- glob: "core/*/module-packages.yaml"
owner: template
- glob: "core/database/migration-units.yaml"
owner: template
- glob: "app-profile/migration-ledger.yaml"
owner: fork
# The fork's half of module-packages.yaml: what it did to the template's declared packages
# (removed / kept / absent). app.yaml documented it as `owner: fork, never synced`, but no rule
# claimed it, so it resolved `template` — a sync would replace it and a strict mirror delete it.
- glob: "app-profile/package-ledger.yaml"
owner: fork
# WHOLE-FILE generated => owner:fork, the same call as GeneratedApiBindings. These are derived in
# full from the fork's app-profile (DB filename from its appId; schema version from its ledger), so
# a sync has nothing to contribute and blind-copying the template's values over a fork's is pure
# loss until the next syncForkConfig. Contrast the network `config/**` files, which are owner:
# template because only a SENTINEL REGION inside them is generated — the file itself is template
# content. The rule is: whole-file generated -> fork; region-generated -> template.
- glob: "**/core/database/**/config/DatabaseConfig.kt"
owner: fork
- glob: "**/core/database/**/config/ForkDatabaseConfig.kt"
owner: fork
# Fork-owned DB schema version (GENERATED from the ledger). PRESERVED.
- glob: "**/core/database/**/ForkDatabaseConfig.kt"
owner: fork
# Room exported schema JSONs (core/database/schemas/**/N.json) evolve per-fork: a fork adds entities
# + bumps the version in its own migration ledger, producing its OWN schema files at higher
# versions. sync-dirs.sh
# blind-preserves `*/schemas/*`; this rule makes the ownership contract agree (owner:fork), so a synced
# template never clobbers a fork's schema history.
- glob: "**/schemas/**"
owner: fork
# Android FileProvider paths: template ships base <paths>; forks add feature paths
# (exports/recordings/imports). Blind copy drops them → runtime FileProvider crash.
- glob: "**/res/xml/provider_paths.xml"
owner: merge
strategy: xml-union
# App entry point: template ships the base Activity; forks wire app-init/SDK hooks.
- glob: "**/MainActivity.kt"
owner: merge
strategy: kotlin-3way
# Android app build script: template updates plugins/config; forks add deps + flavors.
# Merge (conflicts surface) beats a blind overwrite that silently drops every fork dep.
- glob: "cmp-android/build.gradle.kts"
owner: merge
strategy: kotlin-3way
# Android Application class: template ships the base Application; forks wire app-init/SDK
# hooks (Koin start, crash reporting, deep-link handlers). Merge so a template update never
# drops them. S4 classification gap — was owner GAP (ForkInitializers seam lands in E1).
- glob: "**/AndroidApp.kt"
owner: merge
strategy: kotlin-3way
# Nav module build script: template updates plugins/config; forks add their feature-module
# dependencies. Merge (conflicts surface) beats a blind overwrite that drops fork feature deps.
# S7 classification gap — was owner GAP (feature-deps.gradle.kts seam lands in E1).
- glob: "cmp-navigation/build.gradle.kts"
owner: merge
strategy: kotlin-3way
# Fork-owned feature-dependency seam (S7/F4). A fork adds/removes feature-module deps HERE; the
# template-owned cmp-navigation/build.gradle.kts applies it via `apply(from = ...)` and stays full-copy.
# This closes the S7 gap where a fork had to edit the template build file to add a feature. (E1/T8, 2026-08-11)
- glob: "feature-deps.gradle.kts"
owner: fork
# Authenticated bottom-nav ViewModel: template ships the base tab graph; forks add tabs.
# Merge so a template update never drops fork-added tabs. S6 classification gap — was owner
# GAP (ForkTabRegistry seam lands in E1). Matches AuthenticatedNavbarNavigationViewModel.kt.
- glob: "cmp-navigation/**/*NavbarNavigationViewModel.kt"
owner: merge
strategy: kotlin-3way
# ── fork-owned (carve-outs INSIDE otherwise-template dirs; declared before template) ──
# app-profile/ — the fork-owned white-label deployment SoT (identity, text, media, icons, per platform).
# This is the ONLY fork-owned deployment surface. deployment/ LOGIC stays template-owned and reads this
# via _shared/config.rb (AppProfile.get) + syncForkConfig.
# (branding/icons was dissolved into app-profile/icons — there is no separate branding/ dir.)
#
# OWNERSHIP SPLIT (WS02, RULE-TEMPLATE-MODULE-FIX-UPSTREAM-001 / epic AC6): the STRUCTURED yaml config
# (app.yaml + platforms/<p>/*.yaml + deploy-targets.yaml) is now owner: merge / strategy:
# yaml-schema-merge — a 3-way merge built on the FORK's file: every fork value, comment and fork-only
# key stays; the template adds its new keys, demo access-points and the defaults the fork never
# changed (see scripts/customization-surface.sh#cs_merge_yaml_schema). The blind
# `app-profile/** → owner: fork` glob is GONE — it blind-preserved the whole surface, so a fork never
# received a freshly-added template key / demo access-point (schema silently skewed, RESEARCH F3).
# Questionnaire CONTENT (**/app-content/** — read by their own consumers, EXCLUDED from AppProfile._data),
# binary MEDIA (**/media/**), icons, and store-content json/md have no schema to evolve → stay owner: fork.
# app-content questionnaire answers — fork-authored, NOT identity config (config.rb rejects /app-content/
# from the merged _data). Declared FIRST so it wins over the platforms/**/*.yaml merge rule below.
- glob: "app-profile/**/app-content/**"
owner: fork
# structured yaml config — 3-way on the fork's file (fork keeps what it wrote; template adds what is new)
# key-ownership schemas (`<file>.schema.yaml`) — the template's rules for merging the yaml beside them
- glob: "app-profile/**/*.schema.yaml"
owner: template
- glob: "app-profile/app.yaml"
owner: merge
strategy: yaml-schema-merge
- glob: "app-profile/platforms/**/*.yaml"
owner: merge
strategy: yaml-schema-merge
- glob: "app-profile/deploy-targets.yaml"
owner: merge
strategy: yaml-schema-merge
# binary media / icons / store-content json + md — no schema to evolve, blind-preserved owner: fork
- glob: "app-profile/icons/**"
owner: fork
- glob: "app-profile/platforms/**/media/**"
owner: fork
- glob: "app-profile/platforms/**/*.json"
owner: fork
- glob: "app-profile/README.md"
owner: fork
# feature backbone (E1 / F1) — home/profile/settings are the TEMPLATE-owned minimal SHELL every fork
# keeps and receives upstream fixes for. Declared ABOVE the blanket `feature/** → fork` (first-match
# wins). Their INNER content is fork-owned via two distinct seams: (a) the `*Body` vals in the
# fork-owned ForkBackboneRegistry (cmp-navigation/**/registry — home/settings/profile inner content), and
# (b) demo showcases under `feature/**/demo/**` which are the DISTINCT `demo-showcase` class below.
#
# DEMO-SHOWCASE vs FORK (WS01 / epic AC8, LD3a): a demo showcase is template-SHIPPED (demo-only,
# updatable on sync) — a DIFFERENT ownership class from an arbitrary fork-added feature (which sync
# must NEVER touch). Before this split both funneled into `feature/** → fork`, indistinguishable
# except by the fence glob, so sync could not tell a showcase from a fork's own feature. Declared
# FIRST so the backbone template rules never capture a `**/demo/**` package. An arbitrary
# `feature/<x>` a fork authors is consumer-owned and falls through to the blanket `feature/** → fork`.
- glob: "feature/**/demo/**"
owner: demo-showcase
# ── BACKBONE STARTERS — fork-owned, so a fork can redesign them freely ────────────────────────
# home / profile / settings ship as a WORKING starting point and the fork owns them outright: it
# redesigns the screens in place, using the shipped code as the base, and a sync never overwrites
# that work. (They were `owner: template` with `ForkBackboneRegistry`'s homeBody/settingsBody/
# profileBody as the only sanctioned edit point. That kept upstream fixes flowing, but it meant a
# fork editing HomeScreen.kt directly — the obvious thing to do — silently lost the change on the
# next sync. Ownership now matches what a fork actually does.)
#
# The seams still exist and still work; they are simply no longer the ONLY way in.
#
# THE TRADE, stated plainly: these modules no longer receive upstream fixes. That is the cost of
# owning them, and it is deliberate.
#
# No carve-out: the starters are the app's FOUNDATION, handed over once. The template ships them for a
# new fork to start from; it does not sync them afterwards (they are not in SYNC_DIRS), so every file
# in them, the Platform.*.kt shims included, is the fork's to keep or change.
- glob: "feature/home/**"
owner: fork
- glob: "feature/profile/**"
owner: fork
- glob: "feature/settings/**"
owner: fork
- glob: "feature/**"
owner: fork
# core/store seam — the 4 seam files below are fork-authored (white-label-template-completion E0/T1, LD-2).
# The rest of core/store is template architecture (infra/, di aggregators) that MUST receive upstream fixes.
# The demo showcase stores NO LONGER live under core/store/**/demo/**: they are per-domain packages
# declared in app-profile/app.yaml#core_store.packages[], so they need explicit globs below rather
# than falling through to the generic `**/demo/**` rule.
# core/store fork seams — the `Fork*` files a fork edits. The sync never touches them, so a
# fork's error copy and branding survive; everything they extend lives in config/ and IS synced.
# These were previously the template files themselves (KptErrorMapper / KptScreenStateDefaults
# marked owner:fork because each carried a `TODO(fork)` extension point inside it), which meant a
# fork that customised one branch stopped receiving upstream fixes to the whole file.
- glob: "core/store/**/ForkErrorMapper.kt"
owner: fork
- glob: "core/store/**/ForkScreenStateDefaults.kt"
owner: fork
# The template's definition surface — full-copied on a sync so forks get upstream improvements.
- glob: "core/store/**/config/KptErrorMapper.kt"
owner: template
- glob: "core/store/**/config/KptScreenStateDefaults.kt"
owner: template
# AppStoreRegistry.kt / AppCacheKeys.kt / GeneratedStoreBindings.kt have NO row — deliberately.
# They were `owner: fork` while syncForkConfig wrote them into committed source. They are now KSP
# BUILD ARTIFACTS emitted from the `@StoreProvider` / `@CacheKey` annotations into
# `core/store/build/generated/ksp/…`, so there is no committed file for a sync to copy, merge, or
# own. Re-adding a row would be a dead glob (`--verify` zero-match) — the declaration IS the
# annotation on the provider fn, and that provider file is already covered by the rows below.
# StoreModule.kt is TEMPLATE-owned again. It used to be owner:fork because ~30 hand-written store
# bindings lived in it, which meant a fork never received upstream fixes to the framework wiring
# it also contains (CoreBaseStoreModule, StoreCacheManager, DraftInventory). With the bindings
# generated into GeneratedStoreBindings, nothing fork-specific is left and a sync can full-copy it.
- glob: "core/store/**/di/KptStoreModule.kt"
owner: template
# core/store demo showcases — the DISTINCT `demo-showcase` class: template-SHIPPED, demo-only,
# updatable on sync, and deleted by `remove-demo.sh --clean` per their `owner: template` row in
# app-profile/app.yaml#core_store.packages[]. Listed explicitly because the packages moved out of
# `demo/` (an earlier revision removed globs like `core/store/economic/**` as dead — they matched
# nothing while the stores sat under demo/; the move makes them live again, and demo-showcase is
# the correct class for them, not `template`).
# Demo packages per module — read from core/<module>/module-packages.yaml (`demo:` ids), not
# restated here. Each id becomes core/<module>/**/kpt/core/<module>/<id>/** → demo-showcase.
- packages: module-packages
# Demo-showcase cache keys — split out of the template-owned AppCacheKeys (E1/C5) and declared
# for deletion via app.yaml#core_store.template_files[].
# White-label registry seams — the fork-owned extension package (cmp.navigation.registry). The
# template infra (KoinModules, AuthenticatedNavigation, the navbar screen, cmp-shared's initKoin,
# feature/home's HomeScreen shell) READS these seams; a fork adds/removes features, tabs, the home
# body, and startup hooks by editing ONLY files here, so the infra modules stay full-copy
# `owner: template`. Covers ForkFeatureRegistry (routes+DI), ForkBackboneRegistry (home body, S5),
# ForkTabRegistry (bottom-nav tabs, S6), ForkInitializers (startup hooks, S3/S4) + the package README.
# The whole package is the seam — same pattern as the core/store block above. (E1/T7, 2026-08-11)
#
# Base-feature INNER-content seam (WS01 / epic AC7): ForkBackboneRegistry carries the fork-owned
# `homeBody` / `settingsBody` / `profileBody` `val`s. These remain a supported way to supply the
# backbone's inner content WITHOUT touching the module — useful when a fork wants the shipped shell
# to keep evolving around its own body.
#
# It is no longer the ONLY way in: `feature/{home,profile,settings}/**` is now `owner: fork`, so a
# fork may equally redesign those screens in place. The seam suits a fork that wants to swap content
# and leave the shell alone; direct ownership suits a fork that wants the whole surface.
- glob: "cmp-navigation/**/registry/ForkBackboneRegistry.kt"
owner: fork
- glob: "cmp-navigation/**/registry/**"
owner: fork
# Worker seam — the fork-owned @WorkerKmpWorkers site (cmp-shared). The template WorkerDeclarations.kt
# (base workers) stays owner:template; the KSP processor aggregates both. A fork declares its workers
# here, so a sync full-copies cmp-shared while the fork's workers survive.
- glob: "cmp-shared/**/ForkWorkerDeclarations.kt"
owner: fork
# demo showcase stores/data — the DISTINCT `demo-showcase` class (WS01 / epic AC8). Covers
# core/store/**/demo/{economic,banking,…} (the demo Store5 showcases) + every other **/demo/**
# package: template-SHIPPED, demo-only, updatable on sync — NOT the same class as a fork-added
# feature (`feature/** → fork`). The former dead globs `core/store/economic/**` +
# `core/store/banking/**` claimed `template` but matched ZERO real paths (the stores live under
# demo/), so they mis-declared ownership — removed (E0/T3).
# GeneratedApiBindings.kt has NO row — it is a BUILD ARTIFACT now, derived from `@ApiBinding` on
# the API types into `build/generated/ksp/`. It was `owner: fork` while syncForkConfig wrote it
# into committed source, because it was generated from the FORK's app-profile and a sync would
# otherwise have blind-copied the template's bindings over a fork's. (It deliberately did NOT live
# under demo/: remove-demo.sh deletes every `**/demo/**` package, which silently killed the codegen
# for any cleaned fork.)
- glob: "**/demo/**"
owner: demo-showcase
# The fork's preferences EXTEND the framework's: ForkPreferencesRepository inherits
# UserPreferencesRepository and its impl delegates to the template's, so a fork gets every
# framework preference for free, adds its own, and overrides any it needs to alter. The template's
# two files stay hand-managed and full-copy; these two are never synced. No declaration drives it —
# inheritance makes "a framework preference cannot be removed" a compile error rather than a rule.
- glob: "**/core/datastore/**/ForkPreferencesRepository.kt"
owner: fork
- glob: "**/core/datastore/**/ForkPreferencesRepositoryImpl.kt"
owner: fork
# Fork DI seams — `di/Fork<X>Module.kt` is the "yours to fill" per-layer seam (network, store,
# data, database). WLS-1..4 keep it alive through `remove-demo.sh`; ownership is what keeps it alive
# through a SYNC. As owner:template the template's EMPTY seam blind-copies over a fork's filled-in
# one on every sync — the same silent-loss class as AndroidManifest, and it defeats the entire point
# of the seam. Symmetric with `cmp-shared/**/ForkWorkerDeclarations.kt` above. Enforced by WLS-5
# (`scripts/product-health/checks/white-label-di-seams.sh`).
# Declared AFTER `**/demo/**` on purpose: a Fork*Module stranded under demo/ is a WLS-2
# violation and must keep classifying as demo-showcase, not silently become fork-owned.
- glob: "core/*/src/**/di/Fork*Module.kt"
owner: fork
- glob: "build-logic/**/kotlin/local/**" # LocalFlavors.kt fork flavor extensions
owner: fork
- glob: "cmp-android/src/main/res/**"
owner: fork
- glob: "cmp-android/src/main/ic_launcher-playstore.png"
owner: fork
- glob: "cmp-android/**/google-services.json"
owner: fork
- glob: "cmp-android/dependencies/**" # dependency-guard baseline
owner: fork
# The fork's own R8 keep rules (AdMob, Tink, its own models). proguard-rules.pro is template-owned and
# replaced on every sync, so app rules there were deleted; release/staging apply this file after it.
- glob: "cmp-android/fork-proguard-rules.pro"
owner: fork
- glob: "cmp-ios/iosApp/Assets.xcassets/**" # app icon + colors
owner: fork
- glob: "cmp-ios/Configuration/Config.xcconfig" # syncForkConfig-generated identity
owner: fork
# project.pbxproj — a serialized OBJECT GRAPH, not a document. It inherits `merge` from the
# cmp-ios blanket below, but must NOT take the default line-based `git merge-file`: adding a
# target rewrites UUID arrays far from the object it adds, so adjacent insertions read as
# conflicts, and a conflict marker inside a pbxproj makes the project UNOPENABLE — Xcode itself
# cannot be used to resolve it. Measured template ⋈ mbs/cappy: 6 markers from git merge-file,
# 0 from the structural merge. UUIDs are stable across the fork boundary (33 of 36 shared), so a
# keyed 3-way with array union is exact. Engine: scripts/white-label/merge-pbxproj.rb.
- glob: "**/*.xcodeproj/project.pbxproj"
owner: merge
strategy: pbxproj-3way
# Info.plist / *.entitlements — a flat <dict> both sides add their OWN keys to, so additions can
# collide in the TEXT while not overlapping in MEANING. Union is the only correct resolution: the
# template's keychain-access-groups (core-base/datastore needs it, or errSecMissingEntitlement
# -34018 at launch) and the fork's app-group + CFBundleURLTypes (widget shared container, OAuth
# redirect) are ALL required — neither side may win. Comment-preserving, so the rationale travels
# with the key it explains.
# Measured on mbs/cappy: `iosApp.entitlements` is add/add (absent at the fork's base b97eb73d),
# where a line merge conflicts and the output does not even parse — that file is why this exists.
# `Info.plist` has a real ancestor and line-merges cleanly TODAY; it is routed here because it is
# the same shape and one template key added near the fork's block turns it into the same case.
- glob: "cmp-ios/**/Info.plist"
owner: merge
strategy: plist-union
- glob: "cmp-ios/**/*.entitlements"
owner: merge
strategy: plist-union
- glob: "cmp-desktop/**/*.entitlements"
owner: merge
strategy: plist-union
# The Cloudflare Pages worker is MECHANISM (the CORS relay + isolation headers); everything a fork
# configures about it lives in the generated relay-allowlist.json beside it (owner: fork, through the
# globs below). Template-owned so relay fixes reach every fork — a fork copy would freeze its relay.
- glob: "cmp-web/src/*Main/resources/_worker.js"
owner: template
# relay-allowlist.json is WHOLE-FILE generated by syncForkConfig from the fork's app-profile -> fork.
- glob: "cmp-web/src/jsMain/resources/**"
owner: fork
- glob: "cmp-web/src/wasmJsMain/resources/**"
owner: fork
- glob: "cmp-desktop/icons/**"
owner: fork
# Desktop build: template ships the packaging build logic; a fork overrides packaging identity
# (dock name, dmg). 3-way merge (symmetry with cmp-android's build.gradle) so template build
# improvements reach forks while fork packaging survives — not a blind fork-owned file. (B5/T11)
- glob: "cmp-desktop/build.gradle.kts"
owner: merge
strategy: kotlin-3way
# project_config.rb + the legacy extract_config.rb some forks still carry — fork config, never synced.
- glob: "fastlane-config/*_config.rb"
owner: fork
# Store-listing text + media are DERIVED from app-profile/ by syncForkConfig — the SoT is
# app-profile/app.yaml + platforms/<p>/*.yaml (text) and app-profile/platforms/<p>/media (media).
# deployment/**/metadata is a generated materialization fastlane's metadata_path reads; NEVER
# hand-edit it. owner:generated → /kmp-project-template-sync ignores it (regenerated, not preserved).
- glob: "deployment/**/metadata/**" # store listings — DERIVED from app-profile
owner: generated
- glob: "deployment/**/screenshots/**" # DERIVED from app-profile/platforms/<p>/media
owner: generated
- glob: "deployment/**/og-images/**" # DERIVED from app-profile/platforms/web/media
owner: generated
- glob: "deployment/**/app-content/**" # DERIVED from app-profile/platforms/<p>/app-content (data-safety)
owner: generated
# deployment/ is a TEMPLATE-OWNED module, full-copied exactly like core-base/ with ZERO deployment
# carve-outs (E1/D-1..D-3 — RULE-TEMPLATE-MODULE-FIX-UPSTREAM-001 routes any deployment/ fix upstream).
# The ONLY non-template artifacts UNDER deployment/ are the DERIVED store listings above
# (owner:generated — regenerated from app-profile by syncForkConfig, never hand-edited). All fork DATA
# was relocated OUT of deployment/: per-target enabled/tier → app-profile/deploy-targets.yaml (owner:
# fork, below). The append-only deploy history is FRAMEWORK-level (project deployment-layer/deploy-state/,
# E1/D-4) — /idea-deploy owns it; community GitHub Actions deploys keep their audit in the Actions run
# history, so NOTHING lands in this public source repo. DEPLOYMENT_MANIFEST.yaml is a pure template CATALOG.
- glob: "secrets/live/**" # real secrets (gitignored)
owner: fork
- glob: "secrets/**/.sync-meta.json" # per-fork vault sync state (SV33)
owner: fork
- glob: ".github/workflows/sync-dirs.yaml" # fork's own sync workflow
owner: fork
# The org's CLA contributor check — pushed into every repo by the org's automation
# (`chore: update CLA contributor check workflow (enforce mode) [skip ci]`), never authored by the
# template. A repository community file like CODE_OF_CONDUCT.md (see `strategy: repo-files` below):
# a sync never writes it; who may edit it is declared per file in app.yaml / _org/company.yaml.
# Must sit ABOVE the `.github/**` template rule — the first matching rule wins.
- glob: ".github/workflows/cla-check.yml"
owner: fork
strategy: repo-files
# The repository's own issue and pull-request forms (e.g. a mentoring programme's issue form). The
# template ships none, so as template-owned paths a sync deleted them from every fork that had them.
- glob: ".github/ISSUE_TEMPLATE/**"
owner: fork
- glob: ".github/ISSUE_TEMPLATE.md"
owner: fork
- glob: ".github/PULL_REQUEST_TEMPLATE.md"
owner: fork
- glob: ".github/pull_request_template.md"
owner: fork
- glob: "gradle/fork.properties" # derived build-bridge from app-profile/app.yaml (do not hand-edit); gitignored
owner: fork
- glob: "local.properties"
owner: fork
- glob: "README.md" # rebranded per fork from the idea-plan
owner: fork
- glob: "CLAUDE.md" # fork project instructions
owner: fork
# ── fork brand / build-deps / legal-content surface ───────────────────────────
# Declared BEFORE the broad template module globs (first-match-wins) so a fork's brand + build +
# legal customizations survive a sync full-copy. Without these carve-outs each falls through to
# `owner: template` and a blind copy clobbers it (the exact loss class this contract exists to close).
#
# The theme WIRING — KptTheme() applying the brand schemes, screen-state defaults and token locals —
# is template code: forks receive its updates. The brand values it applies live in ForkTheme.kt.
- glob: "core/designsystem/**/theme/KptTheme.kt"
owner: template
# Brand theme — a fork fully replaces the reference palette + type ramp; owner:fork (blind preserve).
# The SHARED design primitives live in core-base/designsystem (stays template-owned).
- glob: "**/core/designsystem/**/theme/**"
owner: fork
# Brand icons — a fork adds glyphs to the shared AppIcons object; 3-way so template icon additions
# AND fork icons both survive. The rest of icon/ is a template package (module-packages.yaml), so a
# fork's own icon files there take the `Fork*` name (ForkIcons.kt) — the name says who owns them.
- glob: "**/core/designsystem/**/icon/AppIcons.kt"
owner: merge
strategy: kotlin-3way
- glob: "**/core/designsystem/**/icon/Fork*"
owner: fork
- glob: "core/designsystem/**/kpt/core/designsystem/icon/**"
owner: template
# App scaffold — the template ships KptScaffold (in KptForkScaffold.kt); a fork overrides its
# top-bar/FAB/branding. 3-way so a template scaffold update never drops the fork's overrides. The rest
# of scaffold/ (KptPullToRefreshState) is plain template code — no fork ever edited it.
- glob: "**/core/ui/**/scaffold/KptFork*"
owner: merge
strategy: kotlin-3way
# Root scaffold + nav controller — a fork tweaks root theming (dark-mode-aware colors) + analytics
# wiring; 3-way-merged against template updates.
- glob: "cmp-navigation/**/ui/*.kt"
owner: merge
strategy: kotlin-3way
# Core-module dependency seam — the fork-owned half of `core/<mod>/build.gradle.kts`. Mirrors
# `feature-deps.gradle.kts`: the template build file `apply(from = ...)`s this, so a fork's deps
# live in a file the sync NEVER touches. Declared BEFORE the build.gradle.kts rule below so it
# wins (first match).
- glob: "**/core/*/module-deps.gradle.kts"
owner: fork
# The same seam for the Android app shell: deps, manifest placeholders and BuildConfig fields of the
# fork (cmp-android/build.gradle.kts applies it), plus its Application/Activity hooks. Before these a
# fork with Android-only startup work (ads SDK init, app-open ads, consent) had to edit template files.
- glob: "cmp-android/module-deps.gradle.kts"
owner: fork
- glob: "cmp-android/src/main/kotlin/cmp/android/app/fork/**"
owner: fork
# Core-module build files — `template` FULL-COPY (was `merge`/kotlin-3way).
# The 3-way existed for ONE reason: "a fork adds module dependencies its own code compiles
# against". Those now live in the fork-owned `core/<mod>/module-deps.gradle.kts` seam above, which
# every core build file applies, so nothing fork-specific is hand-written here any more and the
# template can evolve plugins/KSP/version wiring freely with no merge surface. `core/network`'s
# BuildKonfig fields are likewise DERIVED into its `syncForkConfig:buildkonfig` region from
# app-profile (NAP-8), not hand-added.
# MIGRATION: a fork that adopted BEFORE the seam may still have hand-added deps in these files —
# full-copy would drop them. STEP 3.5's project-clobber guard surfaces that diff before apply;
# move those lines into module-deps.gradle.kts as part of adoption.
# Single-segment `core` only — does NOT match core-base/**.
- glob: "**/core/**/build.gradle.kts"
owner: template
# Legal content — the privacy-policy/terms CONTENT templates are the fork's real legal documents;
# the generator (legal/generate.sh) + rendered legal/output/** stay template/generated below.
- glob: "legal/*/template.md"
owner: fork
# ── template-owned (the broad sync surface — lowest precedence, declared LAST) ──
#
# THE APPLICATION SHELLS (cmp-*) ARE `template` — replaced in full — EXCEPT the files that carry a
# fork's PLATFORM WIRING, which have nowhere else to live (no module-deps-style seam exists for an
# Xcode target or a plist key). Those are named one by one, above and below, as `merge` (3-way: the
# template's evolution lands, the fork's additions survive, overlaps surface as conflicts) or `fork`:
# merge Info.plist + *.entitlements (plist-union) · project.pbxproj (pbxproj-3way) · iOSApp.swift ·
# MainActivity.kt · every cmp-*/build.gradle.kts · the cmp-navigation seams (*Navigation*,
# RootNav*, di/, *TabItem*, ui/, *NavbarNavigationViewModel)
# fork res/**, Assets.xcassets/**, icons/**, web resources, google-services.json,
# kotlin-sources.xcfilelist, registry/**, ForkWorkerDeclarations.kt
# Measured on mbs/cappy 2026-09-10, all lost to a full-copy before they had rows: the Google Sign-In
# CFBundleURLTypes (Info.plist), the WidgetKit app group (entitlements), a whole `CappyWidgets` target
# (pbxproj) and scene-phase hooks (iOSApp.swift). A 3-way needs a merge base: the engine resolves it
# via .template-version#template_sha (resolve_merge_base() in sync-dirs.sh).
- glob: "cmp-ios/iosApp/iOSApp.swift"
owner: merge
# ContentView.swift is where Swift hands platform bridges (a StoreKit 2 shim, …) to
# `viewController(platformBridges:)`, so a fork's argument there must survive a sync.
- glob: "cmp-ios/iosApp/ContentView.swift"
owner: merge
# The fork's Firebase iOS client config — fork-owned like cmp-android's google-services.json. The
# template ships none; copy-compose-resources.sh bundles it when present.
- glob: "cmp-ios/iosApp/firebase/**"
owner: fork
# The Kotlin half of that seam: the fork picks its bridges out of the list and loads its own Koin
# modules. Seeded once, never touched by a sync.
- glob: "cmp-shared/src/nativeMain/kotlin/kpt/shared/fork/**"
owner: fork
- glob: "cmp-*/build.gradle.kts"
owner: merge
# build-logic IS template code, unlike the platform shells: every fork-specific build hook has a seam —
# `kotlin/local/**` (fork, declared earlier, e.g. LocalFlavors.kt) and the app-profile values
# syncForkConfig projects. So a sync REPLACES every build-logic file in full, like every `template`
# path: a fork edit here is drift with no seam, and is overwritten by design.
- glob: "build-logic/**"
owner: template
- glob: "cmp-android/**"
owner: template
- glob: "cmp-desktop/**"
owner: template
# The Xcode build-phase input list — one line per Kotlin source in THIS fork, regenerated by
# cmp-ios/scripts/gen-kotlin-filelist.sh. Line-merging two different source trees produced 24 conflict
# hunks on a real fork (2026-11-01 dry run); it is derived, so the fork's own copy stands.
- glob: "cmp-ios/kotlin-sources.xcfilelist"
owner: fork
- glob: "cmp-ios/**"
owner: template
- glob: "cmp-web/**"
owner: template
- glob: "cmp-shared/**"
owner: template
- glob: "cmp-navigation/**"
owner: template
- glob: "sync/**"
owner: template
- glob: "core-base/**"
owner: template
# ── module catch-alls for the remaining declared modules ──────────────────────────────────────
# Each module's template packages are enumerated in its module-packages.yaml and (where they are
# showcase) given a demo-showcase rule; everything else under the module is the FORK's own and must
# not be claimed by the `core/**` blanket. More-specific rules above still win.
- glob: "core/network/**/kpt/core/network/lwmswhoxvvoagzkqxiyd/**"
owner: template
- glob: "core/network/**/kpt/core/network/config/**"
owner: template
- glob: "core/network/**/kpt/core/network/di/**"
owner: template
- glob: "core/network/**"
owner: fork
# Framework packages — template-authored, must keep syncing. Above the catch-all.
- glob: "core/datastore/**/kpt/core/datastore/di/**"
owner: template
- glob: "core/datastore/**/kpt/core/datastore/prefs/**"
owner: template
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/datastore/**/kpt/core/datastore/config/**"
owner: template
- glob: "core/datastore/**"
owner: fork
# core/firebase — `config/` is the whole template-owned surface, matching what `config/` means in
# core/store and core/network: the code a fork extends rather than edits. It holds the two
# CROSS-CUTTING halves, `config/analytics/` and `config/crashlytics/` — session, navigation,
# network, sync, crash breadcrumbs — neither of which knows about any feature.
# A FEATURE's tracking is its own top-level package (`loans/`), a sibling of `config/` rather than
# anything inside it, so `remove-demo.sh` strips a feature as one plain directory and `config/`
# never contains demo code. A fork's own feature package is undeclared and falls to the module
# catch-all below (`fork`), so adding `payments/` needs no rule and no row. `loans/` is the
# template's showcase of that layout, hence demo-showcase: shipped, synced, deleted by `--clean`.
- glob: "core/firebase/**/kpt/core/firebase/config/**"
owner: template
- glob: "core/firebase/**/kpt/core/firebase/di/**"
owner: template
- glob: "core/firebase/**"
owner: fork
# core/designsystem — template PRIMITIVES, fork BRAND. `theme` is the fork's: its palette comes from
# the idea-layer design pipeline, so a sync must never copy the template's Mifos colours over it.
# Everything else is framework code a fork should keep receiving fixes for — which is why these are
# declared explicitly instead of falling to the module catch-all below. (They briefly did fall
# through, which silently stopped chart/component/utils syncing; caught by comparing each package's
# registry row against its resolved owner.)
- glob: "core/designsystem/**/kpt/core/designsystem/chart/**"
owner: template
- glob: "core/designsystem/**/kpt/core/designsystem/component/**"
owner: template
- glob: "core/designsystem/**/kpt/core/designsystem/utils/**"
owner: template
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/designsystem/**/kpt/core/designsystem/config/**"
owner: template
- glob: "core/designsystem/**"
owner: fork
# core/ui — Compose primitives every feature composes. Template-authored; a fork's own primitives
# fall to the catch-all.
- glob: "core/ui/**/kpt/core/ui/bottombar/**"
owner: template
- glob: "core/ui/**/kpt/core/ui/input/**"
owner: template
- glob: "core/ui/**/kpt/core/ui/navigation/**"
owner: template
- glob: "core/ui/**/kpt/core/ui/utils/**"
owner: template
- glob: "core/ui/**/kpt/core/ui/scaffold/**" # KptPullToRefreshState; KptForkScaffold is merge (above)
owner: template
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/ui/**/kpt/core/ui/config/**"
owner: template
- glob: "core/ui/**"
owner: fork
# ── core/database — declared packages (module-packages.yaml) ──────────────────────────────────
# These had NO rows at all and fell to the `core/**` blanket as `template`, which is the wrong
# class for showcase code: a fork keeping the demo would stop receiving updates to it. Caught by
# G-CORE-PKG (MP-1) the moment core/database was folded into the audit.
# FRAMEWORK packages — template-authored, full-copied. `config` holds the generated DatabaseConfig
# + the fork-owned ForkDatabaseConfig (which has its own more-specific rule above).
- glob: "core/database/**/kpt/core/database/config/**"
owner: template
- glob: "core/database/**/kpt/core/database/infra/**"
owner: template
- glob: "core/database/**/kpt/core/database/di/**"
owner: template
# A fork's own database packages.
- glob: "core/database/**"
owner: fork
# ── core/store — the per-package demo rows are above; this is the module catch-all ─────────────
# Framework packages first, then everything else is the fork's own.
- glob: "core/store/**/kpt/core/store/config/**"
owner: template
- glob: "core/store/**/kpt/core/store/prefs/**"
owner: template
- glob: "core/store/**/kpt/core/store/di/**"
owner: template
- glob: "core/store/**"
owner: fork
# ── core/domain — declared packages; both are showcase, so a cleaned fork gets an empty module ──
# A fork's own calculators. Everything the template owns is enumerated above.
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/domain/**/kpt/core/domain/config/**"
owner: template
- glob: "core/domain/**"
owner: fork
# ── core/common — one framework package, everything else the fork's ────────────────────────────
# `format` is template-authored and full-copied; a fork's own utility must NOT be claimed by the
# `core/**` blanket, which is what the catch-all below prevents.
- glob: "core/common/**/kpt/core/common/format/**"
owner: template
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/common/**/kpt/core/common/config/**"
owner: template
- glob: "core/common/**"
owner: fork
# ── core/data — same declared-package contract as core/model ──────────────────────────────────
# The showcase repositories moved out of `demo/**` into per-domain packages declared in
# app-profile#data.packages[]. Each needs a rule here or it falls to the `core/**` blanket and
# resolves `template`, which is the wrong class: a fork keeping the demo would stop receiving
# updates to it. G-DATA-PKG (DP-1) fails if a declared template package has no rule.
# FRAMEWORK packages — template-authored, full-copied by the sync. `infra` is test-only support.
- glob: "core/data/**/kpt/core/data/user/**"
owner: template
- glob: "core/data/**/kpt/core/data/util/**"
owner: template
- glob: "core/data/**/kpt/core/data/infra/**"
owner: template
- glob: "core/data/**/kpt/core/data/di/**"
owner: template
# A FORK's own repository packages. Declared as the module catch-all for the same reason as
# core/model: the template's packages are enumerated above, so everything else IS the fork's.
# `demo/**` is matched earlier by the generic demo-showcase rule, so DemoRepositoryModule keeps
# its own lifecycle and is not swept into this bucket.
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/data/**/kpt/core/data/config/**"
owner: template
- glob: "core/data/**"
owner: fork
# ── core/model — the model layer's ownership, declared rather than inherited from `core/**` ──
# `core/model` was the only core module with NO fork-owned surface, so a fork's own
# `core/model/invoice/Invoice.kt` fell through to the `core/**` blanket below and resolved
# `owner: template` — the contract telling a sync it may overwrite a file the fork owns. That is
# the same loss white-label-di-seams WLS-5 exists to prevent, on the sync trigger instead of the
# strip trigger.
#
# Fixed by declaring ONE fork-owned package rather than inverting the blanket: `core/model/** ->
# fork` would have been worse, because every NEW template model would then resolve `fork` and
# silently stop reaching forks on sync. The template's own packages stay enumerable (`user`,
# `demo`) and anything the template adds later still resolves `template` by default.
# FRAMEWORK models — read by framework code, so a fork extends behaviour via
# ForkPreferencesRepository (core/datastore) rather than editing these.
- glob: "core/model/**/kpt/core/model/user/**"
owner: template
# The showcase's models — the DISTINCT `demo-showcase` class: template-SHIPPED, updated on sync,
# and deleted by `remove-demo.sh` per their `owner: template` row in app-profile#model.packages[].
# Listed per package because they no longer live under `demo/`: the module moved onto the same
# declared-package model as core/store and core/database, so a directory name is no longer what
# decides the lifecycle. Without these rows they would fall to the `core/**` blanket and resolve
# `template`, which is the wrong class — a fork that keeps the demo would stop receiving updates
# to it, and `--verify`'s coverage audit would not notice because the blanket matches.
# A FORK's own model packages. Declared as the module's catch-all rather than a named seam: the
# TEMPLATE's packages are enumerated above and in app-profile#model.packages[], so "everything else
# under core/model" IS the fork's, by definition. Without this the blanket `core/** -> template`
# below would claim a fork's own model and tell a sync it may overwrite it.
#
# The direction is safe BECAUSE the template's list is declared: a new template package must be
# added to app-profile for the strip to reach it anyway, and G-MODEL-PKG (MP-1) fails if that row
# has no matching ownership rule here — so a template package cannot silently land in this bucket.
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/model/**/kpt/core/model/config/**"
owner: template
- glob: "core/model/**"
owner: fork
# core/platform had NO module catch-all, so a fork's own platform package resolved `template`
# off the blanket below and a sync would have overwritten it. It is unaudited by MP-4 today
# (not in core-package-ownership.sh CORE_MODULES), which is why it went unnoticed.
# The fork-extension seam — template-owned so a sync keeps delivering upstream fixes.
# MUST stay above the module catch-all below, which resolves `fork`.
- glob: "core/platform/**/kpt/core/platform/config/**"
owner: template
- glob: "core/platform/**"
owner: fork
- glob: "core/**"
owner: template
- glob: "deployment/**"
owner: template
- glob: "fastlane/**"
owner: template
- glob: "fastlane-config/**"
owner: template
# The license header every source file carries — ONE fork-owned source (LicenseHeader.kt renders it
# for Spotless, syncForkConfig and the KSP processors; the holder is app.yaml#org.name). Must precede
# spotless/** (first match wins) so a sync never resets a fork's header.
- glob: "spotless/license-header.txt"
owner: fork
- glob: "spotless/**"
owner: template
- glob: "gradle/wrapper/**"
owner: template
# NOTE: idea-layer/** is framework tooling (the claude-product-cycle project layer), NOT shipped
# white-label app code, and the template tracks zero idea-layer paths — so it carries no ownership
# rule here. A fork's idea-layer lives in its framework tree, never in the template source repo.
# In-template feature-authoring guide (E5 consumption contract) — template-authored, synced like
# the per-module CONSUMPTION.md docs. (closes a pre-existing E5 classification gap)
- glob: "FEATURE_AUTHORING.md"
owner: template
- glob: "scripts/**"
owner: template
# Lint and analysis config is the template's, whole: a fork meets the rules in its own code, it does
# not carry a baseline that exempts it from them.
- glob: "config/**"
owner: template
- glob: "secrets/sample/**"
owner: template
# The fork's own secret rows (its client keys) — read by build_secrets.rb on top of LAYOUT.yaml, which is
# template-owned and replaced every sync. Add-only: a key LAYOUT.yaml declares is ignored.
- glob: "secrets/fork-layout.yaml"
owner: fork
- glob: "secrets/**" # LAYOUT.yaml + scaffold (live/ is fork above)
owner: template
- glob: "docs/**"
owner: template
- glob: ".github/**"
owner: template
- glob: ".run/**"
owner: template
# root-level template files (mirror scripts/white-label/sync-dirs.sh SYNC_FILES)
- { glob: "Gemfile", owner: template }
- { glob: "Gemfile.lock", owner: template }
- { glob: "ci-prepush.sh", owner: template }
- { glob: "ci-prepush.bat", owner: template }
- { glob: "gradlew", owner: template }
- { glob: "gradlew.bat", owner: template }
- { glob: "compose_compiler_config.conf", owner: template }
- { glob: "scripts/white-label/sync-dirs.sh", owner: template }
- { glob: "scripts/white-label/fork-init.sh", owner: template }
- { glob: "setup-project.sh", owner: template }
- { glob: "scripts/white-label/keystore.sh", owner: template }
- { glob: "scripts/white-label/firebase.sh", owner: template }
- { glob: "generateModuleGraphs.sh", owner: template }
- { glob: "gradle/fork.properties.template", owner: template }
- { glob: "gradle/gradle-daemon-jvm.properties", owner: template }
- { glob: ".editorconfig", owner: template }
- { glob: ".gitattributes", owner: template }
- { glob: ".gitignore", owner: template }
- { glob: ".actrc", owner: template }
- { glob: ".ruby-version", owner: template }
- { glob: ".kover-floor.yml", owner: template }
- { glob: ".claudeignore", owner: template }
- { glob: "customization-surface.yaml", owner: template } # this contract self-syncs (reached via SYNC_FILES — WS4/T6)
- { glob: "version.txt", owner: template }
# /lib-integrate writes per-fork `<lib>.local=true` links here; the template adds library rows. A full
# copy reset every fork's links, so it is 3-way merged like gradle.properties (fork keys win).
- { glob: "lib-integrate.properties", owner: merge, strategy: properties-3way }
- { glob: "secrets-manifest.yaml", owner: generated } # GENERATED by syncForkConfig from deployment/**/secrets-needs.yaml — never synced, never hand-edited
# MIXED file: fork values (fork.project.name) + template infra (JVM args, gradle/kotlin flags, memory,
# toggles). owner:fork froze the template infra out; 3-way merge brings template infra in while
# preserving the fork's changed keys (BASE = template@last-synced sha, per FT-5b). E0/T1.
- { glob: "gradle.properties", owner: merge, strategy: properties-3way }
- { glob: "build.gradle.kts", owner: template }
# Per-fork derived files the template also ships — each fork's copy is computed from ITS OWN inputs,
# so the template's copy is wrong for every fork. `fork` (not `generated`): the engine's exclusion
# check preserves only fork-owned paths, so a `generated` file under a sync root would still be
# overwritten. (2026-10-31 ownership audit + a field-officer dry-run sync, where yarn.lock and the
# rendered legal output were being replaced with the template's.)
- { glob: "kotlin-js-store/yarn.lock", owner: fork } # the fork's own npm dependency graph (kotlinUpgradeYarnLock)
- { glob: "legal/output/**", owner: fork } # rendered from the fork's legal/*/template.md by legal/generate.sh
- { glob: "kotlin-js-store/**", owner: template }
- { glob: "legal/**", owner: template }
# .swiftpm-locks — per-fork SwiftPM resolution state (Package.resolved + generated module maps,
# most of it already gitignored). It is BUILD OUTPUT keyed to the fork's own dependency graph,
# not template code, so syncing it would push one fork's resolution onto another. It had no rule
# and, once the catch-all flipped template-first, began resolving `template` — the one place that
# flip needed an explicit answer rather than the default.
- { glob: ".swiftpm-locks/**", owner: fork }
- { glob: "tests/**", owner: template } # test harness — E0/T1 (closes the classification gap)
# tools/*-ksp — the template's OWN codegen engine (store / database / network / data processors
# that generate AppStoreRegistry, AppDatabase and the Generated*Bindings from the @StoreProvider /
# @DbEntity / @ApiBinding / @RepositoryBinding annotations). A fork does not author these.
# They had NO rule at all and fell to the `fork` DEFAULT, so they never synced — leaving every
# fork frozen on the processor version it forked with while the annotations kept evolving. A
# fork cannot be told "your registrations are generated for you" and then never receive the
# generators. Added to SYNC_DIRS at the same time: ownership alone would not deliver them.
- { glob: "tools/**", owner: template }
# .bundle/config — BUNDLE_PATH for the vendored Ruby toolchain, template build infra. Same
# story: no rule, so it defaulted to fork and never reached a consumer.
- { glob: ".bundle/**", owner: template }
- { glob: "META-INF/**", owner: template }
# Repository community files — the code of conduct, contributing guide, licence and security
# policy. They belong to the REPOSITORY (often its org: the CLA bot and org-wide SECURITY.md
# commits land straight in each repo), never to the template, so a sync never writes them. They
# were `owner: template`, and the field-officer sync replaced the app's own Contributing.md and
# LICENCE (MPL-2.0 + "Copyright 2024 Mifos Initiative") with the template's (2026-11-03).
# The org's devops/security teams set them up per repository. Who may EDIT each one is declared per
# file — app-profile/app.yaml#repo_files.files.<file> (access: read|write, writers: [logins]),
# overridden by the framework workspace's _org/company.yaml#repo_files.<file>. Absent → read (locked).
# The globs match both spellings a repo may already use (Contributing.md, LICENCE, LICENSE.md).
- glob: "CODE_OF_CONDUCT.md"
owner: fork
strategy: repo-files
- glob: "C[Oo][Nn][Tt][Rr][Ii][Bb][Uu][Tt][Ii][Nn][Gg].md"
owner: fork
strategy: repo-files
- glob: "LICEN[CS]E*"
owner: fork
strategy: repo-files
- glob: "SECURITY.md"
owner: fork
strategy: repo-files
# The structural-migration record forks consult. Declared owner: template in its own header but
# was in no SYNC list, so no fork ever received it (2026-10-31 ownership audit).
- { glob: "template-migrations.yaml", owner: template }
# The template's OWN backend (its Supabase project). A fork has its own server, so this is
# fork-owned territory everywhere — and is not a sync root.
- { glob: "supabase/**", owner: fork }
# ── default: any path not matched above — TEMPLATE-FIRST ──
# This repo IS the template, so the default answer to "who owns this?" is the template. FORK
# territory is declared EXPLICITLY above (`core/**`, `feature/**`, `app-profile/**`, the per-platform
# branding carve-outs), never inferred from silence.
#
# This was `fork` — "never clobber an unknown fork file". That is the right default for a CONSUMER
# and the wrong one for a template: a directory the template ADDS that nobody writes a rule for
# silently becomes fork-owned and never syncs to anyone. `tools/**` (the KSP processors every