Repository navigation
Commit 4bbd6cc
authored
feat(python): eject owns the emitters its generators write through (#436)
* feat(python): eject hands over the emitters a generator writes through; api-docs is ejectable
An ejected Python generator used to be one file over packaged emitters, so a defect in
the shared-enum, M:N, prompt-tier or api-reference writers still waited for a release.
Eject now copies those emitters with the generator into codegen/runtime/, through each
registry entry's existing runtime list, and the copy reads them from there. The emitters
moved into metaobjects.codegen.runtime; their old import paths stay as deprecated aliases
so a copy ejected earlier keeps running. Naming and type-mapping tables, the model walks
and the generator base stay in the package as the engine.
api-docs is registered for Python and ejectable. The api reference is a generator
(docs_surface = "api") that `metaobjects docs` runs; an owned copy is listed under the new
docs.generators config block. `gen` and `verify --codegen` skip a docs generator and say
so. The page builder reads the router gates from shared_predicates (new
emits_writable_router, moved is_read_only_routed), the module an owned routes and
filter-allowlist read, so the reference describes an owned copy.
test_eject_alone derives its list from the registry: each ejectable generator is ejected
alone into an empty project, checked against a written engine surface, run with every
packaged emit module unimportable, and compared byte for byte with the packaged
generator. Packaged output is unchanged.
* feat(python): eject hands over the emitters a generator writes through; api-docs is ejectable
An ejected Python generator used to be one file over packaged emitters, so a defect in
the shared-enum, M:N, prompt-tier or api-reference writers still waited for a release.
Eject now copies those emitters with the generator into codegen/runtime/, through each
registry entry's existing runtime list, and the copy reads them from there. The emitters
moved into metaobjects.codegen.runtime; their old import paths stay as deprecated aliases
so a copy ejected earlier keeps running. Naming and type-mapping tables, the model walks
and the generator base stay in the package as the engine.
api-docs is registered for Python and ejectable. The api reference is a generator
(docs_surface = "api") that `metaobjects docs` runs; an owned copy is listed under the new
docs.generators config block. `gen` and `verify --codegen` skip a docs generator and say
so. The page builder reads the router gates from shared_predicates (new
emits_writable_router, moved is_read_only_routed), the module an owned routes and
filter-allowlist read, so the reference describes an owned copy.
test_eject_alone derives its list from the registry: each ejectable generator is ejected
alone into an empty project, checked against a written engine surface, run with every
packaged emit module unimportable, and compared byte for byte with the packaged
generator. Packaged output is unchanged.
* no-mistakes(review): test(python): defer engine surface to shared eject manifest
* no-mistakes(review): fix(python): eject reports stale kept runtime copies
* no-mistakes(review): fix(python): eject refresh hint prints diff first, cwd-valid paths
* no-mistakes(review): fix(python): gen skip warning distinguishes packaged and owned docs generators
* no-mistakes(review): docs(adr-0034): record Python eject gaps 4-6 as closed
* no-mistakes(document): Drop Python from ADR-0034 Amendment 8 pending wording1 parent ce9b01c commit 4bbd6cc
73 files changed
Lines changed: 3400 additions & 2295 deletions
File tree
- docs
- features
- ports
- fixtures/generator-registry-conformance
- server/python
- src/metaobjects
- apidocs
- codegen
- generators
- runtime
- tests
- codegen
- conformance
- integration
- spec/decisions
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 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 | + | |
220 | 283 | | |
221 | 284 | | |
222 | 285 | | |
| |||
871 | 934 | | |
872 | 935 | | |
873 | 936 | | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
874 | 947 | | |
875 | 948 | | |
876 | 949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
379 | 382 | | |
380 | 383 | | |
381 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
699 | | - | |
700 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
701 | 714 | | |
702 | 715 | | |
703 | 716 | | |
| |||
742 | 755 | | |
743 | 756 | | |
744 | 757 | | |
745 | | - | |
746 | | - | |
747 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
748 | 764 | | |
749 | 765 | | |
750 | 766 | | |
| |||
764 | 780 | | |
765 | 781 | | |
766 | 782 | | |
767 | | - | |
| 783 | + | |
768 | 784 | | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
774 | 804 | | |
775 | 805 | | |
776 | 806 | | |
777 | | - | |
778 | | - | |
779 | | - | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
780 | 811 | | |
781 | 812 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
789 | 825 | | |
790 | | - | |
| 826 | + | |
791 | 827 | | |
792 | 828 | | |
793 | 829 | | |
794 | 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 | + | |
795 | 886 | | |
796 | 887 | | |
797 | 888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
663 | 673 | | |
664 | 674 | | |
665 | 675 | | |
| |||
0 commit comments