marklark 0.1.0__py3-none-win_amd64.whl

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.
Binary file
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: marklark
3
+ Version: 0.1.0
4
+ Classifier: Environment :: Console
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Programming Language :: Rust
7
+ Classifier: Topic :: Documentation
8
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
9
+ License-File: LICENSE
10
+ License-File: LICENSE-APACHE
11
+ License-File: LICENSE-MIT
12
+ Summary: Maintain Markdown documents: humans write intents, agents write hermetic Starlark, marklark runs it deterministically
13
+ Keywords: markdown,starlark,documentation,mcp
14
+ License: MIT OR Apache-2.0
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
17
+
18
+ # marklark
19
+
20
+ **Status: working pre-release.** The library, the CLI and the MCP server implement the specification;
21
+ no version has been released yet.
22
+
23
+ marklark keeps Markdown documents up to date from their environment — source files, data files, other
24
+ parts of the same document — using instructions hidden in HTML comments, so the rendered document is
25
+ unaffected.
26
+
27
+ It splits document maintenance into two levels:
28
+
29
+ 1. **Intent** — a human writes, in plain prose, what a part of the document should contain and where it
30
+ comes from.
31
+ 2. **Code** — an agent turns the intent into a small, hermetic [Starlark](https://github.com/bazelbuild/starlark)
32
+ program. marklark runs those programs deterministically, with no AI involved, every time the document
33
+ is updated.
34
+
35
+ ```markdown
36
+ <!--INTENT
37
+ Show the test proving that shift-headings refuses to demote a heading below h6.
38
+ -->
39
+ <!--CODE
40
+ emit(fence(slice("tests/test_markdown.py",
41
+ start=r"def test_shift_rejects_below_h6", end=r"^ def "), "python"))
42
+ #@ intent: blake3:3f2a…
43
+ #@ params: ast1:blake3:9c41…
44
+ #@ generated: 412:blake3:77e0…
45
+ -->
46
+ …generated content…
47
+ <!--/CODE-->
48
+ ```
49
+
50
+ The `#@` stamps record that the code was checked against the intent (`intent`, `params`) and what it
51
+ generated (`generated`). When a human edits the intent, the code, or the generated text, marklark notices
52
+ and says so — it never silently overwrites a human edit.
53
+
54
+ A region can also be **generative**: when the INTENT asks for prose, the agent answers it with an
55
+ `<!--AI-->` block, written from dependencies marklark extracts and hashes, and flagged for regeneration
56
+ when those inputs change.
57
+
58
+ ## Install
59
+
60
+ From a clone of this repository:
61
+
62
+ ```sh
63
+ cargo install --path .
64
+ ```
65
+
66
+ ## Use
67
+
68
+ ```sh
69
+ marklark update FILE... # run all CODE blocks, splice their output into the files
70
+ marklark check FILE... # structure, stamps, declarations, task graph, guards; runs nothing
71
+ marklark check --determinism FILE... # run every update twice and compare
72
+ marklark intent-check FILE... # report intent states (unresolved, intent_changed, params_edited, …)
73
+ marklark intent-accept FILE --line N # a human confirms the code (or AI text) still fits its INTENT
74
+ marklark mcp # MCP server on stdin/stdout, for agents
75
+ marklark skill [--user] # install the guide for agents as a Claude Code skill
76
+ ```
77
+
78
+ `--strict` turns every intent state other than verified into an error; `--json` prints machine-readable
79
+ reports. Exit codes: `0` success, `1` a document has a problem, `2` a file could not be read or written.
80
+ A `.bak` copy is written before a file changes, unless git already holds the file's content.
81
+
82
+ To give an agent the MCP tools in Claude Code:
83
+
84
+ ```sh
85
+ claude mcp add marklark -- marklark mcp
86
+ ```
87
+
88
+ The tools: `intent_list`, `intent_context`, `intent_apply`, `intent_check`, `update`, `ai_resolve`,
89
+ `ai_context`, `ai_update`, `guide`, `list_headings`, `get_section`, `get_lines`. The guide for agents
90
+ ([docs/agent-guide.md](docs/agent-guide.md)) is served by the `guide` tool and as the resource
91
+ `marklark://guide`, and `marklark skill` installs it as a Claude Code skill. See
92
+ [examples/](examples/README.md) for a walkthrough.
93
+
94
+ ## What CODE can do
95
+
96
+ CODE is Starlark with no ambient I/O. Everything goes through host functions: reading files (`read`,
97
+ `slice`, `glob`, `json`, `yaml`, `toml`, `xml`), text (`re_search`, `re_findall`, `re_sub`, `reindent`,
98
+ `fence`), the document (`headings`, `anchor`, `front_matter`, `here`, `document`), variables shared
99
+ between blocks (`define`, `var`), and output (`emit`). Blocks can order themselves with
100
+ `tasks(depends_on=[...], completes=[...])`. Files are read only inside the project root; gitignored files
101
+ and secrets such as `.env` are refused. See [docs/host-functions.md](docs/host-functions.md).
102
+
103
+ Values can also appear inline in running text: `<!--$version-->1.2.3` or
104
+ `<!--= app.name-->My App<!--/=-->`.
105
+
106
+ ## As a library
107
+
108
+ The `marklark` crate works on documents held in memory: `Document` is text plus an optional path, and
109
+ file access goes through the `FileSystem` trait (`MemoryFs` for in-memory files, `DiskFs` for a
110
+ directory tree). `eval::update`, `state::analyze`, `apply::intent_apply` and the `ai` module are what the
111
+ CLI and the MCP server use.
112
+
113
+ ## Relationship to mdship
114
+
115
+ marklark is the successor in spirit to [mdship](https://github.com/verhas/mdship), which has one
116
+ dedicated placeholder type per task (INCLUDE, IMPORT, SIP, SLURP, …) and is written in Python. marklark
117
+ replaces that family with one programmable construct, is written in Rust, and ships as a single binary.
118
+ mdship remains maintained for environments where only `pip` installs are allowed.
119
+
120
+ ## Documentation
121
+
122
+ | File | Contents |
123
+ |---|---|
124
+ | [docs/spec.md](docs/spec.md) | The specification: constructs, stamps, states, evaluation model, security |
125
+ | [docs/host-functions.md](docs/host-functions.md) | The host-function library, sized against every mdship feature |
126
+ | [docs/agent-guide.md](docs/agent-guide.md) | The guide for agents: rules, workflow, Starlark subset, host functions, patterns |
127
+ | [docs/decisions.md](docs/decisions.md) | Decision log with the reasoning behind each decision |
128
+ | [docs/open-questions.md](docs/open-questions.md) | What is still undecided |
129
+ | [docs/mdship-lessons.md](docs/mdship-lessons.md) | What to carry over from mdship (lessons, not code) |
130
+ | [CLAUDE.md](CLAUDE.md) | Orientation for agent sessions working on this repository |
131
+
@@ -0,0 +1,8 @@
1
+ marklark-0.1.0.data/scripts/marklark.exe,sha256=gGtnkri4HKSvBW83PUzgVGmZqkGJoEzSQvH8e3AYxAI,13188608
2
+ marklark-0.1.0.dist-info/METADATA,sha256=chCerIk29-iszhGF5yqeNdZtyL963DgAJsZpr5xnjYI,6275
3
+ marklark-0.1.0.dist-info/WHEEL,sha256=Uvw7WSmy7Kj2FBk8Va4L_dq4MDW8X5Ynby-pOX3ZNS0,94
4
+ marklark-0.1.0.dist-info/licenses/LICENSE,sha256=2iFWGrrC9RKjRoAPzwDsqgHdMfaVhKd49f7kVOlZlmc,200
5
+ marklark-0.1.0.dist-info/licenses/LICENSE-APACHE,sha256=lIF-qXeSNJYhso0t4b1Qidr55XGg2OtC-Qk4VEKn-XU,10286
6
+ marklark-0.1.0.dist-info/licenses/LICENSE-MIT,sha256=Ig9gTjAc5-MqZRG7cSxFuLBm1J3lTj6kWAFvcUWuzDA,1090
7
+ marklark-0.1.0.dist-info/sboms/marklark.cyclonedx.json,sha256=HKPPY1OFDY-ujxczr5lHsKZcP6kKBcRA6IMAyKnFCBk,286643
8
+ marklark-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,6 @@
1
+ marklark is dual-licensed under MIT or Apache 2.0.
2
+
3
+ You may choose to use marklark under either of these licenses:
4
+
5
+ - MIT License (see LICENSE-MIT)
6
+ - Apache License 2.0 (see LICENSE-APACHE)
@@ -0,0 +1,176 @@
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 in 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 exercising
24
+ 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 Object
36
+ form, made available under the License, as indicated by a copyright
37
+ notice that is included in or attached to the work (an example is
38
+ 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 Work and any modifications thereof or Derivative Works
50
+ thereof, that intentionally submits to, or agrees to be subject to,
51
+ Licensor for inclusion in the Work by the copyright owner or by an
52
+ individual or Legal Entity authorized to submit on behalf of the
53
+ 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
56
+ to communication on electronic mailing lists, source code control
57
+ systems, and issue tracking systems that are managed by, or on behalf
58
+ of, the Licensor for the purpose of discussing and improving the Work,
59
+ but 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 Legal Entity on behalf of
63
+ which a Contribution has been received by Licensor and subsequently
64
+ 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, then any
107
+ Derivative Works that You distribute must include a readable
108
+ 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 from the Work, provided that
120
+ 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 of 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 Contribution.
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
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Peter Verhas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.