lantern-grammar 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lantern_grammar-0.3.0/LICENSE +201 -0
- lantern_grammar-0.3.0/MANIFEST.in +1 -0
- lantern_grammar-0.3.0/PKG-INFO +243 -0
- lantern_grammar-0.3.0/README.md +216 -0
- lantern_grammar-0.3.0/model/index.json +695 -0
- lantern_grammar-0.3.0/model/manifest.json +20 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__arch.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__ch.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__ci.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__db.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__dc.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__dip.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__initiative.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__issue.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__question.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__spec.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__artifacts__td.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__gates__gt_030.json +13 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__gates__gt_050.json +15 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__gates__gt_060.json +15 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__gates__gt_110.json +17 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__gates__gt_115.json +19 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__gates__gt_120.json +18 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__gates__gt_130.json +18 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__records__dec.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__records__ev.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__reltypes__decomposes_to.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__reltypes__requires_evidence.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__reltypes__requires_input.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__reltypes__requires_status.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__addressed.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__approved.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__candidate.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__concluded_initiative.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__draft.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__draft_initiative.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__in_progress_initiative.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__proposed.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__proposed_initiative.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__ready.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__ready_initiative.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__rejected.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__selected.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__superseded.json +7 -0
- lantern_grammar-0.3.0/model/objects/Entity/lg__statuses__verified.json +7 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_030.requires_evidence.dec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_030.requires_evidence.ev.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_030.requires_input.dip.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_030.requires_status.draft.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_050.requires_evidence.dec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_050.requires_evidence.ev.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_050.requires_input.arch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_050.requires_input.dip.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_050.requires_status.approved.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_050.requires_status.draft.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_060.requires_evidence.dec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_060.requires_evidence.ev.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_060.requires_input.dip.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_060.requires_input.spec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_060.requires_status.approved.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_060.requires_status.draft.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_evidence.dec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_evidence.ev.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_input.arch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_input.ch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_input.spec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_input.td.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_status.approved.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_110.requires_status.proposed.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_evidence.dec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_evidence.ev.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_input.arch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_input.ch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_input.dc.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_input.spec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_input.td.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_status.approved.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_status.candidate.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_115.requires_status.ready.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_evidence.dec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_evidence.ev.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_input.ch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_input.ci.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_input.db.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_input.td.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_status.approved.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_status.candidate.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_120.requires_status.ready.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_evidence.dec.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_evidence.ev.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_input.ch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_input.ci.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_input.db.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_input.td.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_status.approved.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_status.ready.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__gt_130.requires_status.selected.json +10 -0
- lantern_grammar-0.3.0/model/objects/Relation/lg__rel__initiative.decomposes_to.ch.json +10 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_arch.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_ch.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_ci.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_db.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_dc.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_dec.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_dip.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_ev.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_gate.json +18 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_initiative.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_issue.json +11 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_question.json +11 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_spec.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_addressed.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_approved.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_draft.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_proposed.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_ready.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_rejected.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_selected.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_superseded.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_status_verified.json +12 -0
- lantern_grammar-0.3.0/model/objects/Term/lg__vocab__term_td.json +12 -0
- lantern_grammar-0.3.0/pyproject.toml +70 -0
- lantern_grammar-0.3.0/setup.cfg +4 -0
- lantern_grammar-0.3.0/setup.py +51 -0
- lantern_grammar-0.3.0/src/lantern_grammar/__init__.py +33 -0
- lantern_grammar-0.3.0/src/lantern_grammar/_exceptions.py +40 -0
- lantern_grammar-0.3.0/src/lantern_grammar/_grammar.py +483 -0
- lantern_grammar-0.3.0/src/lantern_grammar/py.typed +0 -0
- lantern_grammar-0.3.0/src/lantern_grammar.egg-info/PKG-INFO +243 -0
- lantern_grammar-0.3.0/src/lantern_grammar.egg-info/SOURCES.txt +132 -0
- lantern_grammar-0.3.0/src/lantern_grammar.egg-info/dependency_links.txt +1 -0
- lantern_grammar-0.3.0/src/lantern_grammar.egg-info/requires.txt +14 -0
- lantern_grammar-0.3.0/src/lantern_grammar.egg-info/top_level.txt +1 -0
- lantern_grammar-0.3.0/tests/test_grammar.py +592 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
graft model
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lantern-grammar
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Authoritative semantic model for Lantern governed workflow
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: black==24.1.1; extra == "dev"
|
|
16
|
+
Requires-Dist: coverage==7.6.10; extra == "dev"
|
|
17
|
+
Requires-Dist: mypy==1.14.1; extra == "dev"
|
|
18
|
+
Requires-Dist: pylint==3.3.4; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest==8.3.4; extra == "dev"
|
|
20
|
+
Requires-Dist: ruff==0.1.13; extra == "dev"
|
|
21
|
+
Requires-Dist: tomli==2.0.1; extra == "dev"
|
|
22
|
+
Provides-Extra: release
|
|
23
|
+
Requires-Dist: build==1.2.2.post1; extra == "release"
|
|
24
|
+
Requires-Dist: cyclonedx-bom==4.1.1; extra == "release"
|
|
25
|
+
Requires-Dist: twine==6.0.1; extra == "release"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# Lantern Grammar
|
|
29
|
+
|
|
30
|
+
**The authoritative language of governed development.**
|
|
31
|
+
|
|
32
|
+
Lantern Grammar defines the authoritative semantics of artifacts, gates, statuses, and relations used across the Lantern governed-workflow surface. It is expressed as an ECT-conforming model artifact set and evolves through structured change control.
|
|
33
|
+
|
|
34
|
+
## What it defines
|
|
35
|
+
|
|
36
|
+
- **Artifact classes** — the recognized artifact kinds in the workflow (CH, CI, DB, DC, DIP, SPEC, ARCH, TD, Initiative, Issue, Question, EV, DEC)
|
|
37
|
+
- **Gate entities** — the named semantic checkpoints (GT-030 through GT-130) and their input dependencies
|
|
38
|
+
- **Status values** — the lifecycle states artifacts may occupy
|
|
39
|
+
- **Relation types** — `requires_input`, `requires_evidence`, `requires_status`, `decomposes_to`
|
|
40
|
+
- **Vocabulary terms** — canonical definitions for each artifact and status class
|
|
41
|
+
|
|
42
|
+
## Repository layout
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
model/
|
|
46
|
+
manifest.json model identity and namespace declaration
|
|
47
|
+
index.json flat index of all objects with locators
|
|
48
|
+
objects/
|
|
49
|
+
Entity/ entity objects (artifacts, gates, statuses, relation types)
|
|
50
|
+
Relation/ relation instances encoding the semantic dependency graph
|
|
51
|
+
Term/ vocabulary term definitions
|
|
52
|
+
docs/
|
|
53
|
+
gates/GATES.md non-authoritative semantic summary of gate definitions
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Authoritative semantics
|
|
57
|
+
|
|
58
|
+
The ECT-conforming JSON objects under `model/` are the model truth. `docs/` content is documentation only and is not model truth.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Python package
|
|
63
|
+
|
|
64
|
+
The `lantern-grammar` Python package exposes the model above through a
|
|
65
|
+
stable, read-only `Grammar` API. Consumers should use this API rather than
|
|
66
|
+
parsing the `model/` JSON files directly.
|
|
67
|
+
|
|
68
|
+
### Requirements
|
|
69
|
+
|
|
70
|
+
- Python ≥ 3.11
|
|
71
|
+
|
|
72
|
+
### Installation
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Install from the repository (editable, for development)
|
|
76
|
+
pip install -e .
|
|
77
|
+
|
|
78
|
+
# Install a released distribution
|
|
79
|
+
pip install lantern-grammar
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Basic usage
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from lantern_grammar import Grammar, LanternGrammarLoadError
|
|
86
|
+
|
|
87
|
+
# Load the model bundled with the installed distribution
|
|
88
|
+
grammar = Grammar.load()
|
|
89
|
+
|
|
90
|
+
# Inspect manifest / version
|
|
91
|
+
manifest = grammar.manifest()
|
|
92
|
+
print(manifest["model_id"]) # "lantern-grammar.model"
|
|
93
|
+
print(manifest["model_version"]) # "0.3.0"
|
|
94
|
+
print(grammar.package_version()) # "0.3.0" on the first published package release
|
|
95
|
+
|
|
96
|
+
# Validate before using in CI / tooling
|
|
97
|
+
report = grammar.validate_integrity()
|
|
98
|
+
if not report["ok"]:
|
|
99
|
+
raise RuntimeError(f"Lantern Grammar invalid: {report['errors']}")
|
|
100
|
+
|
|
101
|
+
# Resolve a model entity
|
|
102
|
+
ch = grammar.get_entity("lg:artifacts/ch")
|
|
103
|
+
print(ch["definition"])
|
|
104
|
+
|
|
105
|
+
# Iterate all gates
|
|
106
|
+
for gate in grammar.iter_entities(prefix="lg:gates/", status="Released"):
|
|
107
|
+
print(gate["id"], "-", gate["definition"][:60])
|
|
108
|
+
|
|
109
|
+
# Query what GT-115 requires as inputs
|
|
110
|
+
deps = grammar.gate_dependencies("lg:gates/gt_115")
|
|
111
|
+
print("GT-115 requires inputs:", deps["requires_input"])
|
|
112
|
+
print("GT-115 requires statuses:", deps["requires_status"])
|
|
113
|
+
|
|
114
|
+
# Find all relations from GT-120
|
|
115
|
+
rels = list(grammar.find_relations(source_entity_id="lg:gates/gt_120"))
|
|
116
|
+
for r in rels:
|
|
117
|
+
print(r["relation_type_id"], "->", r["target_entity_id"])
|
|
118
|
+
|
|
119
|
+
# Term lookup
|
|
120
|
+
term = grammar.get_term("lg:vocab/term_ch")
|
|
121
|
+
if term:
|
|
122
|
+
print(term["definition"]) # "Canonical term for Change Intent (CH)."
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Loading from an explicit directory
|
|
126
|
+
|
|
127
|
+
For local validation, development fixtures, or consumer smoke tests:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from pathlib import Path
|
|
131
|
+
from lantern_grammar import Grammar, LanternGrammarLoadError
|
|
132
|
+
|
|
133
|
+
try:
|
|
134
|
+
grammar = Grammar.from_directory(Path("path/to/lantern-grammar/model"))
|
|
135
|
+
except FileNotFoundError:
|
|
136
|
+
print("directory not found")
|
|
137
|
+
except LanternGrammarLoadError as exc:
|
|
138
|
+
print(f"model invalid: {exc}")
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Authority boundary
|
|
142
|
+
|
|
143
|
+
The `Grammar` API is a **read-only projection** over the authoritative
|
|
144
|
+
`model/` artifacts. It does not invent or reinterpret model meaning.
|
|
145
|
+
|
|
146
|
+
What it provides:
|
|
147
|
+
- model entities (artifacts, gates, statuses, relation types, record classes)
|
|
148
|
+
- model relations
|
|
149
|
+
- vocabulary terms
|
|
150
|
+
- manifest / version metadata
|
|
151
|
+
- integrity validation
|
|
152
|
+
- gate-dependency queries
|
|
153
|
+
|
|
154
|
+
What stays outside this package:
|
|
155
|
+
- workbench IDs and entry/exit policy
|
|
156
|
+
- intent classification
|
|
157
|
+
- runtime posture and stage resolution
|
|
158
|
+
- workflow resource grouping
|
|
159
|
+
- guided execution logic
|
|
160
|
+
|
|
161
|
+
### Running the tests
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
pip install -e ".[dev]"
|
|
165
|
+
pytest
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Release readiness
|
|
169
|
+
|
|
170
|
+
The authoritative Python package version source is `[project].version` in `pyproject.toml`.
|
|
171
|
+
The authoritative semantic model version source remains `model/manifest.json` via `model_version`.
|
|
172
|
+
|
|
173
|
+
For the first published `lantern-grammar` package release, keep those two values equal.
|
|
174
|
+
The current release baseline is package `0.3.0` and model `0.3.0`.
|
|
175
|
+
After the first package release, any divergence between package and model versions must follow the governance rules in `DN-LGR-PROP-003`.
|
|
176
|
+
|
|
177
|
+
Run the same checks locally that the main CI release lane enforces:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
pip install -e ".[dev,release]"
|
|
181
|
+
python scripts/check_version_alignment.py --require-package-model-equality
|
|
182
|
+
pylint --fail-under=7.5 src/lantern_grammar/
|
|
183
|
+
ruff check src/lantern_grammar/ tests/ scripts/ setup.py
|
|
184
|
+
mypy src/lantern_grammar/
|
|
185
|
+
black --check src/lantern_grammar/ tests/ scripts/ setup.py
|
|
186
|
+
python scripts/check_license_headers.py
|
|
187
|
+
coverage run -m pytest --maxfail=1 -q
|
|
188
|
+
coverage report
|
|
189
|
+
python -m build
|
|
190
|
+
python -m twine check dist/*
|
|
191
|
+
|
|
192
|
+
python -m venv .venv-smoke
|
|
193
|
+
. .venv-smoke/bin/activate
|
|
194
|
+
python -m pip install --upgrade pip
|
|
195
|
+
python -m pip install dist/*.whl
|
|
196
|
+
python scripts/smoke_test_installed_package.py \
|
|
197
|
+
--expected-package-version "$(python scripts/check_version_alignment.py --print-package-version)" \
|
|
198
|
+
--expected-model-version "$(python scripts/check_version_alignment.py --print-model-version)"
|
|
199
|
+
python scripts/generate_license_report.py --output artifacts/license-report.json
|
|
200
|
+
deactivate
|
|
201
|
+
python scripts/generate_sbom.py --python .venv-smoke/bin/python --output artifacts/sbom.cyclonedx.json
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
This release boundary is intentionally stronger than `python -m build` alone:
|
|
205
|
+
the package must build, the installed wheel must be able to load the bundled model, the pinned toolchain must agree locally and in CI, and the release lane must emit SBOM and license-report artifacts.
|
|
206
|
+
|
|
207
|
+
### Publishing
|
|
208
|
+
|
|
209
|
+
The publish job consumes the exact `dist/` artifacts already built and verified earlier in CI; it does not rebuild on the publish step.
|
|
210
|
+
|
|
211
|
+
To release:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
PACKAGE_VERSION="$(python scripts/check_version_alignment.py --print-package-version)"
|
|
215
|
+
git tag -a "v${PACKAGE_VERSION}" -m "lantern-grammar ${PACKAGE_VERSION}"
|
|
216
|
+
git push origin "v${PACKAGE_VERSION}"
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The tagged GitHub Actions run will:
|
|
220
|
+
- re-run lint, typing, tests, build, `twine check`, and clean-environment smoke validation,
|
|
221
|
+
- upload `dist/*.whl`, `dist/*.tar.gz`, `artifacts/sbom.cyclonedx.json`, and `artifacts/license-report.json`, and
|
|
222
|
+
- publish the verified distributions to PyPI via GitHub OIDC trusted publishing.
|
|
223
|
+
|
|
224
|
+
Downstream consumers, including Lantern Runtime package closeout, should validate against the published `lantern-grammar` package boundary and the smoke path above rather than a sibling source checkout.
|
|
225
|
+
|
|
226
|
+
### Compatibility posture
|
|
227
|
+
|
|
228
|
+
The `Grammar` class and the methods documented above constitute the
|
|
229
|
+
**stability-governed public core** (`lantern_grammar` namespace). Breaking
|
|
230
|
+
changes to this core require a major version increment. Additive stable-core
|
|
231
|
+
changes may land in minor versions.
|
|
232
|
+
|
|
233
|
+
Experimental helpers, if any, live under `lantern_grammar.experimental` and
|
|
234
|
+
carry no compatibility guarantee until explicitly promoted into this
|
|
235
|
+
documentation.
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
Lantern Grammar is released under the **Apache License 2.0**.
|
|
240
|
+
|
|
241
|
+
See [LICENSE](LICENSE) for the full license text.
|
|
242
|
+
|
|
243
|
+
**Copyright 2025 Lantern Authors**
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Lantern Grammar
|
|
2
|
+
|
|
3
|
+
**The authoritative language of governed development.**
|
|
4
|
+
|
|
5
|
+
Lantern Grammar defines the authoritative semantics of artifacts, gates, statuses, and relations used across the Lantern governed-workflow surface. It is expressed as an ECT-conforming model artifact set and evolves through structured change control.
|
|
6
|
+
|
|
7
|
+
## What it defines
|
|
8
|
+
|
|
9
|
+
- **Artifact classes** — the recognized artifact kinds in the workflow (CH, CI, DB, DC, DIP, SPEC, ARCH, TD, Initiative, Issue, Question, EV, DEC)
|
|
10
|
+
- **Gate entities** — the named semantic checkpoints (GT-030 through GT-130) and their input dependencies
|
|
11
|
+
- **Status values** — the lifecycle states artifacts may occupy
|
|
12
|
+
- **Relation types** — `requires_input`, `requires_evidence`, `requires_status`, `decomposes_to`
|
|
13
|
+
- **Vocabulary terms** — canonical definitions for each artifact and status class
|
|
14
|
+
|
|
15
|
+
## Repository layout
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
model/
|
|
19
|
+
manifest.json model identity and namespace declaration
|
|
20
|
+
index.json flat index of all objects with locators
|
|
21
|
+
objects/
|
|
22
|
+
Entity/ entity objects (artifacts, gates, statuses, relation types)
|
|
23
|
+
Relation/ relation instances encoding the semantic dependency graph
|
|
24
|
+
Term/ vocabulary term definitions
|
|
25
|
+
docs/
|
|
26
|
+
gates/GATES.md non-authoritative semantic summary of gate definitions
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Authoritative semantics
|
|
30
|
+
|
|
31
|
+
The ECT-conforming JSON objects under `model/` are the model truth. `docs/` content is documentation only and is not model truth.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Python package
|
|
36
|
+
|
|
37
|
+
The `lantern-grammar` Python package exposes the model above through a
|
|
38
|
+
stable, read-only `Grammar` API. Consumers should use this API rather than
|
|
39
|
+
parsing the `model/` JSON files directly.
|
|
40
|
+
|
|
41
|
+
### Requirements
|
|
42
|
+
|
|
43
|
+
- Python ≥ 3.11
|
|
44
|
+
|
|
45
|
+
### Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Install from the repository (editable, for development)
|
|
49
|
+
pip install -e .
|
|
50
|
+
|
|
51
|
+
# Install a released distribution
|
|
52
|
+
pip install lantern-grammar
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Basic usage
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from lantern_grammar import Grammar, LanternGrammarLoadError
|
|
59
|
+
|
|
60
|
+
# Load the model bundled with the installed distribution
|
|
61
|
+
grammar = Grammar.load()
|
|
62
|
+
|
|
63
|
+
# Inspect manifest / version
|
|
64
|
+
manifest = grammar.manifest()
|
|
65
|
+
print(manifest["model_id"]) # "lantern-grammar.model"
|
|
66
|
+
print(manifest["model_version"]) # "0.3.0"
|
|
67
|
+
print(grammar.package_version()) # "0.3.0" on the first published package release
|
|
68
|
+
|
|
69
|
+
# Validate before using in CI / tooling
|
|
70
|
+
report = grammar.validate_integrity()
|
|
71
|
+
if not report["ok"]:
|
|
72
|
+
raise RuntimeError(f"Lantern Grammar invalid: {report['errors']}")
|
|
73
|
+
|
|
74
|
+
# Resolve a model entity
|
|
75
|
+
ch = grammar.get_entity("lg:artifacts/ch")
|
|
76
|
+
print(ch["definition"])
|
|
77
|
+
|
|
78
|
+
# Iterate all gates
|
|
79
|
+
for gate in grammar.iter_entities(prefix="lg:gates/", status="Released"):
|
|
80
|
+
print(gate["id"], "-", gate["definition"][:60])
|
|
81
|
+
|
|
82
|
+
# Query what GT-115 requires as inputs
|
|
83
|
+
deps = grammar.gate_dependencies("lg:gates/gt_115")
|
|
84
|
+
print("GT-115 requires inputs:", deps["requires_input"])
|
|
85
|
+
print("GT-115 requires statuses:", deps["requires_status"])
|
|
86
|
+
|
|
87
|
+
# Find all relations from GT-120
|
|
88
|
+
rels = list(grammar.find_relations(source_entity_id="lg:gates/gt_120"))
|
|
89
|
+
for r in rels:
|
|
90
|
+
print(r["relation_type_id"], "->", r["target_entity_id"])
|
|
91
|
+
|
|
92
|
+
# Term lookup
|
|
93
|
+
term = grammar.get_term("lg:vocab/term_ch")
|
|
94
|
+
if term:
|
|
95
|
+
print(term["definition"]) # "Canonical term for Change Intent (CH)."
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Loading from an explicit directory
|
|
99
|
+
|
|
100
|
+
For local validation, development fixtures, or consumer smoke tests:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
from pathlib import Path
|
|
104
|
+
from lantern_grammar import Grammar, LanternGrammarLoadError
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
grammar = Grammar.from_directory(Path("path/to/lantern-grammar/model"))
|
|
108
|
+
except FileNotFoundError:
|
|
109
|
+
print("directory not found")
|
|
110
|
+
except LanternGrammarLoadError as exc:
|
|
111
|
+
print(f"model invalid: {exc}")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Authority boundary
|
|
115
|
+
|
|
116
|
+
The `Grammar` API is a **read-only projection** over the authoritative
|
|
117
|
+
`model/` artifacts. It does not invent or reinterpret model meaning.
|
|
118
|
+
|
|
119
|
+
What it provides:
|
|
120
|
+
- model entities (artifacts, gates, statuses, relation types, record classes)
|
|
121
|
+
- model relations
|
|
122
|
+
- vocabulary terms
|
|
123
|
+
- manifest / version metadata
|
|
124
|
+
- integrity validation
|
|
125
|
+
- gate-dependency queries
|
|
126
|
+
|
|
127
|
+
What stays outside this package:
|
|
128
|
+
- workbench IDs and entry/exit policy
|
|
129
|
+
- intent classification
|
|
130
|
+
- runtime posture and stage resolution
|
|
131
|
+
- workflow resource grouping
|
|
132
|
+
- guided execution logic
|
|
133
|
+
|
|
134
|
+
### Running the tests
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
pip install -e ".[dev]"
|
|
138
|
+
pytest
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Release readiness
|
|
142
|
+
|
|
143
|
+
The authoritative Python package version source is `[project].version` in `pyproject.toml`.
|
|
144
|
+
The authoritative semantic model version source remains `model/manifest.json` via `model_version`.
|
|
145
|
+
|
|
146
|
+
For the first published `lantern-grammar` package release, keep those two values equal.
|
|
147
|
+
The current release baseline is package `0.3.0` and model `0.3.0`.
|
|
148
|
+
After the first package release, any divergence between package and model versions must follow the governance rules in `DN-LGR-PROP-003`.
|
|
149
|
+
|
|
150
|
+
Run the same checks locally that the main CI release lane enforces:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
pip install -e ".[dev,release]"
|
|
154
|
+
python scripts/check_version_alignment.py --require-package-model-equality
|
|
155
|
+
pylint --fail-under=7.5 src/lantern_grammar/
|
|
156
|
+
ruff check src/lantern_grammar/ tests/ scripts/ setup.py
|
|
157
|
+
mypy src/lantern_grammar/
|
|
158
|
+
black --check src/lantern_grammar/ tests/ scripts/ setup.py
|
|
159
|
+
python scripts/check_license_headers.py
|
|
160
|
+
coverage run -m pytest --maxfail=1 -q
|
|
161
|
+
coverage report
|
|
162
|
+
python -m build
|
|
163
|
+
python -m twine check dist/*
|
|
164
|
+
|
|
165
|
+
python -m venv .venv-smoke
|
|
166
|
+
. .venv-smoke/bin/activate
|
|
167
|
+
python -m pip install --upgrade pip
|
|
168
|
+
python -m pip install dist/*.whl
|
|
169
|
+
python scripts/smoke_test_installed_package.py \
|
|
170
|
+
--expected-package-version "$(python scripts/check_version_alignment.py --print-package-version)" \
|
|
171
|
+
--expected-model-version "$(python scripts/check_version_alignment.py --print-model-version)"
|
|
172
|
+
python scripts/generate_license_report.py --output artifacts/license-report.json
|
|
173
|
+
deactivate
|
|
174
|
+
python scripts/generate_sbom.py --python .venv-smoke/bin/python --output artifacts/sbom.cyclonedx.json
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
This release boundary is intentionally stronger than `python -m build` alone:
|
|
178
|
+
the package must build, the installed wheel must be able to load the bundled model, the pinned toolchain must agree locally and in CI, and the release lane must emit SBOM and license-report artifacts.
|
|
179
|
+
|
|
180
|
+
### Publishing
|
|
181
|
+
|
|
182
|
+
The publish job consumes the exact `dist/` artifacts already built and verified earlier in CI; it does not rebuild on the publish step.
|
|
183
|
+
|
|
184
|
+
To release:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
PACKAGE_VERSION="$(python scripts/check_version_alignment.py --print-package-version)"
|
|
188
|
+
git tag -a "v${PACKAGE_VERSION}" -m "lantern-grammar ${PACKAGE_VERSION}"
|
|
189
|
+
git push origin "v${PACKAGE_VERSION}"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The tagged GitHub Actions run will:
|
|
193
|
+
- re-run lint, typing, tests, build, `twine check`, and clean-environment smoke validation,
|
|
194
|
+
- upload `dist/*.whl`, `dist/*.tar.gz`, `artifacts/sbom.cyclonedx.json`, and `artifacts/license-report.json`, and
|
|
195
|
+
- publish the verified distributions to PyPI via GitHub OIDC trusted publishing.
|
|
196
|
+
|
|
197
|
+
Downstream consumers, including Lantern Runtime package closeout, should validate against the published `lantern-grammar` package boundary and the smoke path above rather than a sibling source checkout.
|
|
198
|
+
|
|
199
|
+
### Compatibility posture
|
|
200
|
+
|
|
201
|
+
The `Grammar` class and the methods documented above constitute the
|
|
202
|
+
**stability-governed public core** (`lantern_grammar` namespace). Breaking
|
|
203
|
+
changes to this core require a major version increment. Additive stable-core
|
|
204
|
+
changes may land in minor versions.
|
|
205
|
+
|
|
206
|
+
Experimental helpers, if any, live under `lantern_grammar.experimental` and
|
|
207
|
+
carry no compatibility guarantee until explicitly promoted into this
|
|
208
|
+
documentation.
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
Lantern Grammar is released under the **Apache License 2.0**.
|
|
213
|
+
|
|
214
|
+
See [LICENSE](LICENSE) for the full license text.
|
|
215
|
+
|
|
216
|
+
**Copyright 2025 Lantern Authors**
|