aperture-mcp 0.1.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.
Files changed (79) hide show
  1. aperture_mcp-0.1.0/CHANGELOG.md +26 -0
  2. aperture_mcp-0.1.0/CODE_OF_CONDUCT.md +29 -0
  3. aperture_mcp-0.1.0/CONTRIBUTING.md +48 -0
  4. aperture_mcp-0.1.0/CONTRIBUTING.zh-CN.md +44 -0
  5. aperture_mcp-0.1.0/LICENSE +201 -0
  6. aperture_mcp-0.1.0/MANIFEST.in +4 -0
  7. aperture_mcp-0.1.0/PKG-INFO +231 -0
  8. aperture_mcp-0.1.0/README.md +207 -0
  9. aperture_mcp-0.1.0/README.zh-CN.md +188 -0
  10. aperture_mcp-0.1.0/SECURITY.md +27 -0
  11. aperture_mcp-0.1.0/VERSIONING.md +50 -0
  12. aperture_mcp-0.1.0/conformance/__init__.py +1 -0
  13. aperture_mcp-0.1.0/conformance/fixtures/access_layer_bad_anchor_kind_rejected.json +19 -0
  14. aperture_mcp-0.1.0/conformance/fixtures/access_layer_passthrough.json +25 -0
  15. aperture_mcp-0.1.0/conformance/fixtures/access_layer_tool_set_and_schema.json +48 -0
  16. aperture_mcp-0.1.0/conformance/fixtures/access_layer_valid_anchor_kind_admitted.json +19 -0
  17. aperture_mcp-0.1.0/conformance/fixtures/anchor_violation_aggregation_surface_bind.json +31 -0
  18. aperture_mcp-0.1.0/conformance/fixtures/anchor_violation_anchor_kind_all_valid.json +27 -0
  19. aperture_mcp-0.1.0/conformance/fixtures/anchor_violation_anchor_reject_extra_top_level.json +48 -0
  20. aperture_mcp-0.1.0/conformance/fixtures/anchor_violation_goal_baseline_degraded.json +29 -0
  21. aperture_mcp-0.1.0/conformance/fixtures/anchor_violation_reject_rich_payload.json +32 -0
  22. aperture_mcp-0.1.0/conformance/fixtures/anchor_violation_shape_required.json +27 -0
  23. aperture_mcp-0.1.0/conformance/fixtures/delta_history_compare_not_implicit_write.json +57 -0
  24. aperture_mcp-0.1.0/conformance/fixtures/delta_history_similar_context_exact_structural.json +118 -0
  25. aperture_mcp-0.1.0/conformance/fixtures/delta_history_tombstone_reason_filter.json +76 -0
  26. aperture_mcp-0.1.0/conformance/fixtures/instrumentation_event_echo_compare.json +21 -0
  27. aperture_mcp-0.1.0/conformance/fixtures/reason_presence_degraded.json +17 -0
  28. aperture_mcp-0.1.0/conformance/fixtures/reason_presence_provider_unavailable.json +28 -0
  29. aperture_mcp-0.1.0/conformance/fixtures/self_consistency_commitment_implicit_drop.json +29 -0
  30. aperture_mcp-0.1.0/conformance/fixtures/self_consistency_family_profile_non_ok.json +23 -0
  31. aperture_mcp-0.1.0/conformance/fixtures/self_consistency_family_profile_ok.json +23 -0
  32. aperture_mcp-0.1.0/conformance/fixtures/self_consistency_proposal_drift.json +23 -0
  33. aperture_mcp-0.1.0/conformance/fixtures/self_consistency_provider_family_not_profile.json +19 -0
  34. aperture_mcp-0.1.0/conformance/fixtures/self_consistency_stance_reversal.json +23 -0
  35. aperture_mcp-0.1.0/conformance/fixtures/status_enum_all_eight_valid.json +31 -0
  36. aperture_mcp-0.1.0/conformance/fixtures/status_enum_boundary_ok.json +11 -0
  37. aperture_mcp-0.1.0/conformance/fixtures/status_enum_reject_case_drift.json +21 -0
  38. aperture_mcp-0.1.0/conformance/fixtures/status_enum_reject_tagged_payload.json +19 -0
  39. aperture_mcp-0.1.0/conformance/fixtures/three_new_values_blocked_constraint_anchor.json +30 -0
  40. aperture_mcp-0.1.0/conformance/fixtures/three_new_values_dropped_commitment_anchor.json +31 -0
  41. aperture_mcp-0.1.0/conformance/fixtures/three_new_values_paused_reserved_not_originated.json +33 -0
  42. aperture_mcp-0.1.0/conformance/fixtures/three_new_values_paused_wire_receivable.json +26 -0
  43. aperture_mcp-0.1.0/conformance/fixtures/topology_degenerate_ok_empty.json +25 -0
  44. aperture_mcp-0.1.0/conformance/fixtures/topology_g1a_no_rich_fields.json +43 -0
  45. aperture_mcp-0.1.0/conformance/fixtures/topology_projection_structural_subset.json +49 -0
  46. aperture_mcp-0.1.0/conformance/fixtures/topology_supported_metric_only_cut_vertices.json +34 -0
  47. aperture_mcp-0.1.0/conformance/fixtures/topology_unsupported_metric_provider_unavailable.json +30 -0
  48. aperture_mcp-0.1.0/conformance/fixtures/wire_shape_c4_adapter_required_valid.json +16 -0
  49. aperture_mcp-0.1.0/conformance/fixtures/wire_shape_compare_signature_two_arg_anchors.json +29 -0
  50. aperture_mcp-0.1.0/conformance/fixtures/wire_shape_native_minimal_keys.json +31 -0
  51. aperture_mcp-0.1.0/conformance/runner.py +803 -0
  52. aperture_mcp-0.1.0/docs/measured-limits.md +77 -0
  53. aperture_mcp-0.1.0/examples/git_decision_drift/README.md +60 -0
  54. aperture_mcp-0.1.0/examples/git_decision_drift/fixtures/decision_after.md +11 -0
  55. aperture_mcp-0.1.0/examples/git_decision_drift/fixtures/decision_before.md +12 -0
  56. aperture_mcp-0.1.0/examples/git_decision_drift/git_decision_drift.py +107 -0
  57. aperture_mcp-0.1.0/llms.txt +55 -0
  58. aperture_mcp-0.1.0/pyproject.toml +61 -0
  59. aperture_mcp-0.1.0/server.json +24 -0
  60. aperture_mcp-0.1.0/setup.cfg +4 -0
  61. aperture_mcp-0.1.0/src/aperture/__init__.py +146 -0
  62. aperture_mcp-0.1.0/src/aperture/c4_wire.py +42 -0
  63. aperture_mcp-0.1.0/src/aperture/calibration.py +233 -0
  64. aperture_mcp-0.1.0/src/aperture/core.py +1278 -0
  65. aperture_mcp-0.1.0/src/aperture/delta_history.py +375 -0
  66. aperture_mcp-0.1.0/src/aperture/errors.py +53 -0
  67. aperture_mcp-0.1.0/src/aperture/mcp_server.py +333 -0
  68. aperture_mcp-0.1.0/src/aperture/metrics.py +111 -0
  69. aperture_mcp-0.1.0/src/aperture/openai_schema.py +90 -0
  70. aperture_mcp-0.1.0/src/aperture/py.typed +1 -0
  71. aperture_mcp-0.1.0/src/aperture/registry.py +342 -0
  72. aperture_mcp-0.1.0/src/aperture/topology.py +202 -0
  73. aperture_mcp-0.1.0/src/aperture_mcp.egg-info/PKG-INFO +231 -0
  74. aperture_mcp-0.1.0/src/aperture_mcp.egg-info/SOURCES.txt +77 -0
  75. aperture_mcp-0.1.0/src/aperture_mcp.egg-info/dependency_links.txt +1 -0
  76. aperture_mcp-0.1.0/src/aperture_mcp.egg-info/entry_points.txt +2 -0
  77. aperture_mcp-0.1.0/src/aperture_mcp.egg-info/requires.txt +1 -0
  78. aperture_mcp-0.1.0/src/aperture_mcp.egg-info/top_level.txt +1 -0
  79. aperture_mcp-0.1.0/tests/test_smoke.py +32 -0
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/), and the package follows
5
+ [Semantic Versioning](https://semver.org) (see [VERSIONING.md](./VERSIONING.md)).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-07-02
10
+
11
+ Initial public preview.
12
+
13
+ ### Added
14
+ - `aperture` Python library: `compare`, `compare_commitment`, `compare_proposal`, `compare_stance`,
15
+ over the frozen **v0.2** `DeltaResult` contract (8-value status, anchors, anchor violations).
16
+ - `aperture-mcp` MCP server (stdio) exposing the compare tools + a `health` check.
17
+ - `examples/git_decision_drift/`: a commitment tripwire over the version history of a decision
18
+ document, runnable against checked-in fixtures.
19
+ - Honest, measured per-family limits (recall/precision) published alongside the tool rather than a
20
+ single aggregate score.
21
+
22
+ ### Known limits
23
+ - Matches commitments as case-insensitive contiguous substrings: **misses** reworded / softened /
24
+ paraphrased / numerically-changed commitments; **declines/abstains** on **translated** ones (returns
25
+ `degraded`, false-positive rate 0); still **false-flags** **reformatted** ones (same script).
26
+ See the limits table in the [README](./README.md).
@@ -0,0 +1,29 @@
1
+ # Code of Conduct
2
+
3
+ This project adopts the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
4
+ 中文版本见官方翻译:<https://www.contributor-covenant.org/zh-cn/version/2/1/code_of_conduct/>。
5
+
6
+ ## Our pledge
7
+
8
+ We as members, contributors, and leaders pledge to make participation in our community a
9
+ harassment-free experience for everyone, regardless of age, body size, visible or invisible
10
+ disability, ethnicity, sex characteristics, gender identity and expression, level of experience,
11
+ education, socio-economic status, nationality, personal appearance, race, religion, or sexual
12
+ identity and orientation.
13
+
14
+ ## Our standards
15
+
16
+ Examples of behavior that contributes to a positive environment: empathy and kindness, respect for
17
+ differing opinions, graceful acceptance of constructive feedback, and focusing on what is best for
18
+ the community.
19
+
20
+ Unacceptable behavior includes harassment, trolling, insulting or derogatory comments, public or
21
+ private harassment, publishing others’ private information without permission, and other conduct
22
+ which could reasonably be considered inappropriate in a professional setting.
23
+
24
+ ## Enforcement
25
+
26
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project
27
+ maintainer via the contact on the repository profile. All complaints will be reviewed and
28
+ investigated promptly and fairly. The full text and enforcement guidelines are available at
29
+ <https://www.contributor-covenant.org/version/2/1/code_of_conduct/>.
@@ -0,0 +1,48 @@
1
+ # Contributing to Aperture MCP
2
+
3
+ **English** · [简体中文](./CONTRIBUTING.zh-CN.md)
4
+
5
+ Thanks for looking. Aperture MCP is small on purpose, and its most valuable contributions are **honest
6
+ reports of where it works and where it doesn’t** — not just code.
7
+
8
+ ## The single most useful thing you can do
9
+
10
+ Point Aperture MCP at **your own** versioned decision docs (specs, plans, ADRs, charters) and tell us:
11
+
12
+ - a real **drop it caught** that mattered, or
13
+ - a real **drift it missed** (a reworded / softened / paraphrased commitment it stayed silent on), or
14
+ - a **false alarm** (a reformat — same-script rearrangement — it flagged as dropped; or a
15
+ *natural-language*-anchored *translation* it flagged, which should instead decline/abstain). Note: a
16
+ **code-identifier** anchor (e.g. `ci-gates-green`) flagged across a translation is *correct*, not a
17
+ false alarm — it's translation-stable, so its exact token vanishing is a real drop.
18
+
19
+ These reports are how the limits table in the README stays honest and how the gold corpus grows.
20
+ Open an issue using the **“drift case report”** template.
21
+
22
+ ## Two feedback channels — and the honest boundary between them
23
+
24
+ 1. **Usage log (`APERTURE_USAGE_LOG`)** — *off by default*, fully local, and records **only
25
+ metadata** (timestamp, tool, status, counts). It **never** contains your decision text or your
26
+ commitment wording. It is a plain local file you can read or delete; nothing is sent anywhere.
27
+
28
+ 2. **Contributing a real case** — a **separate, explicit** choice, made through the **“drift case
29
+ report”** issue template (above). Be clear-eyed about what it involves: a useful benchmark case
30
+ needs the **actual before/after wording**, because the wording *is* the test — so sharing a case
31
+ **crosses** the metadata boundary and sends real text. Only include wording you’re comfortable
32
+ making public; we don’t pretend it can be anonymized. The curated benchmark accepts only cases
33
+ shared this way, under a license grant and an isolated review.
34
+
35
+ We will never blur these two. Metadata logging stays metadata-only; contributing a case is an
36
+ explicit choice to share text.
37
+
38
+ ## Code contributions
39
+
40
+ - Keep the **compare contract** (`v0.2`, frozen) intact — see [VERSIONING.md](./VERSIONING.md).
41
+ Contract-touching changes are a deliberate, reviewed protocol event, not a PR drive-by.
42
+ - Match the existing honesty discipline: if a change alters what the tool can or can’t see, update
43
+ the README limits table in the same PR.
44
+ - Run the tests and linters before opening a PR.
45
+
46
+ ## Conduct
47
+
48
+ By participating you agree to the [Code of Conduct](./CODE_OF_CONDUCT.md).
@@ -0,0 +1,44 @@
1
+ # 参与贡献 Aperture MCP
2
+
3
+ [English](./CONTRIBUTING.md) · **简体中文**
4
+
5
+ 谢谢你来看。Aperture MCP 刻意做得小,它最有价值的贡献是**关于"它在哪儿管用、在哪儿不管用"的诚实
6
+ 报告**——而不只是代码。
7
+
8
+ ## 你能做的最有用的一件事
9
+
10
+ 把 Aperture MCP 跑在**你自己**有版本史的决策文档(spec、计划、ADR、charter)上,然后告诉我们:
11
+
12
+ - 一次真正**抓到的、且很要紧的删除**,或
13
+ - 一次真正**漏掉的漂移**(一条被改写 / 软化 / 转述的承诺,它没吭声),或
14
+ - 一次**误报**(一条只是被重排版——同语言内重排——的承诺,被它当成删除标了出来;或一条*自然语言*锚点的
15
+ *翻译*被它标出——那本应弃权(abstain))。注意:**代码标识符**锚点(如 `ci-gates-green`)跨翻译被标出是
16
+ *正确*行为、不算误报——它跨语言稳定,那个 token 消失就是真删。
17
+
18
+ 这些报告,正是 README 里那张"局限表"保持诚实、以及金标语料得以成长的方式。
19
+ 请用 **“drift case report”** issue 模板提交。
20
+
21
+ ## 两条反馈通道——以及它们之间那条诚实的界线
22
+
23
+ 1. **使用日志(`APERTURE_USAGE_LOG`)** —— *默认关闭*、完全本地,只记录**元数据**(时间戳、
24
+ 工具、状态、计数)。它**绝不**包含你的决策文本或承诺措辞。它就是一个本地纯文件,你能读、能删;
25
+ 什么都不会被发往任何地方。
26
+
27
+ 2. **贡献一个真实案例** —— 一个**单独、明确**的选择,通过 **“drift case report”** issue 模板
28
+ (见上)进行。请想清楚它意味着什么:一个有用的 benchmark 案例需要**真实的前后措辞**,因为措辞
29
+ *本身*就是测试——所以分享一个案例会**跨过**元数据界线、发送真实文本。只放你愿意公开的措辞;
30
+ 我们不假装它能被匿名化。精选 benchmark 只接收以这种方式、在授权许可与隔离评审下提交的案例。
31
+
32
+ 我们绝不混淆这两者。元数据日志始终只是元数据;贡献一个案例,是一个明确的、要分享文本的选择。
33
+
34
+ ## 代码贡献
35
+
36
+ - 保持 **compare 契约**(`v0.2`,已冻结)不变——见 [VERSIONING.md](./VERSIONING.md)。
37
+ 触碰契约的改动是一次审慎、经评审的协议事件,不是顺手的 PR。
38
+ - 与既有的诚实纪律对齐:若某个改动改变了"工具能看见 / 看不见什么",请在**同一个 PR**里更新
39
+ README 的局限表。
40
+ - 提 PR 前先跑测试与 linter(`pytest`、`ruff check .`)。
41
+
42
+ ## 行为准则
43
+
44
+ 参与即表示你同意本项目的[行为准则](./CODE_OF_CONDUCT.md)。
@@ -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 describing the origin of the Work and
141
+ 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 Support. 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 support.
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 2026 The Aperture Authors
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,4 @@
1
+ include LICENSE README.md README.zh-CN.md CHANGELOG.md CONTRIBUTING.md CONTRIBUTING.zh-CN.md VERSIONING.md SECURITY.md CODE_OF_CONDUCT.md llms.txt server.json
2
+ recursive-include conformance *.py *.json
3
+ recursive-include examples *.py *.md
4
+ recursive-include docs *.md
@@ -0,0 +1,231 @@
1
+ Metadata-Version: 2.4
2
+ Name: aperture-mcp
3
+ Version: 0.1.0
4
+ Summary: A commitment tripwire for AI-edited decision docs: flags when a tracked commitment disappears, word-for-word, between two versions. MCP server + Python library. A signal, not a judge.
5
+ Author: jaysinailabs
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/jaysinailabs/aperture-mcp
8
+ Project-URL: Repository, https://github.com/jaysinailabs/aperture-mcp
9
+ Project-URL: Changelog, https://github.com/jaysinailabs/aperture-mcp/blob/main/CHANGELOG.md
10
+ Keywords: mcp,model-context-protocol,ai-agent,agents,decision-drift,commitment,self-consistency,adr,spec
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: mcp<2,>=1.27.2
23
+ Dynamic: license-file
24
+
25
+ <!-- mcp-name: io.github.jaysinailabs/aperture-mcp -->
26
+
27
+ <div align="center">
28
+
29
+ # Aperture MCP
30
+
31
+ ### Did an agent quietly drop a commitment from your spec — and no one noticed?
32
+
33
+ [![PyPI](https://img.shields.io/badge/pypi-aperture--mcp-blue)](https://pypi.org/project/aperture-mcp/) [![MCP](https://img.shields.io/badge/MCP-server-purple)](https://modelcontextprotocol.io) [![License](https://img.shields.io/badge/license-Apache--2.0-green)](./LICENSE) [![status](https://img.shields.io/badge/status-early%2Fpre--1.0-orange)](./VERSIONING.md)
34
+
35
+ **English** · [简体中文](./README.zh-CN.md)
36
+
37
+ </div>
38
+
39
+ AI agents now rewrite the documents that govern your work — specs, plans, ADRs, charters,
40
+ `AGENTS.md` files. Somewhere in the edit, a constraint you set earlier can quietly disappear.
41
+
42
+ **Aperture MCP is a *commitment tripwire*.** You name the commitments you care about; it flags —
43
+ **word for word** — when one of them vanishes between two versions of a decision document.
44
+
45
+ > **A signal, not a judge.** It trips; *you* investigate.
46
+ > Opt-in · runs locally · never trains on your data.
47
+
48
+ ---
49
+
50
+ ## What it is (and what it is not)
51
+
52
+ Aperture MCP is a small tool (and plain Python library) that
53
+ compares **two text states of the same decision** — an earlier version and a later one — and
54
+ surfaces a narrow, specific kind of **decision drift**: when a **tracked commitment’s exact text
55
+ disappeared**.
56
+
57
+ - ✅ **It does:** flag when a commitment you listed *verbatim* is present in version A and gone
58
+ from version B — across commits, sessions, or authors. It returns a structured, comparable
59
+ result with **its own blind spots written on the label**.
60
+ - ❌ **It does *not*:** understand meaning. It matches text as a case-insensitive substring, so it
61
+ **misses** a commitment that was *reworded / softened / paraphrased* (it looks dropped-free even
62
+ though the promise weakened); it **declines/abstains** on a commitment that was merely *translated*
63
+ (it can’t compare verbatim across scripts, so it returns `degraded` rather than false-flag); and it
64
+ can still **false-flag** a commitment that was merely *reformatted* (the words moved, the meaning
65
+ didn’t). It does not rank options, score quality, or
66
+ tell you a change was *wrong*. **That judgment stays with you.**
67
+
68
+ If you want one sentence: **Aperture MCP is `grep` for vanished commitments, wrapped so an agent can
69
+ call it mid-task and get a structured answer that admits what it can’t see.**
70
+
71
+ ---
72
+
73
+ ## Quickstart (≈2 minutes)
74
+
75
+ ```sh
76
+ pip install aperture-mcp
77
+ ```
78
+
79
+ Run the bundled example (clone the repo first) — it trips on a dropped commitment against
80
+ checked-in fixtures, with no setup, no API keys, fully offline:
81
+
82
+ ```sh
83
+ python3 examples/git_decision_drift/git_decision_drift.py
84
+ ```
85
+
86
+ ```text
87
+ Aperture MCP · commitment tripwire — a fixture/sample decision-doc edit
88
+
89
+ [TRIPPED ] 'ci-gates-green' (in_before=True, in_after=False)
90
+ [ held ] 'data-never-leaves-device' (in_before=True, in_after=True)
91
+
92
+ One watched commitment vanished between the two versions; one held.
93
+ Aperture MCP makes the disappearance visible — you decide whether it was intended.
94
+ ```
95
+
96
+ Use it from your own code:
97
+
98
+ ```python
99
+ from aperture import compare, Anchor, AnchorKind
100
+
101
+ result = compare(
102
+ state_a="We commit to: ci-gates-green before release; data-never-leaves-device.",
103
+ state_b="We commit to: data-never-leaves-device.",
104
+ anchors=[Anchor(kind=AnchorKind.COMMITMENT, id="ci-gates-green")],
105
+ )
106
+ print(result.status) # DROPPED_SILENTLY
107
+ print(result.anchor_violations) # the commitment that vanished
108
+ ```
109
+
110
+ Wire it into an MCP client (Cursor, Cline, Goose, or any stdio-capable host):
111
+
112
+ ```jsonc
113
+ {
114
+ "mcpServers": {
115
+ "aperture-mcp": { "command": "aperture-mcp" }
116
+ }
117
+ }
118
+ ```
119
+
120
+ > Prefer zero-install? Point the client at `uvx` instead:
121
+ > `{ "command": "uvx", "args": ["aperture-mcp"] }`.
122
+
123
+ ---
124
+
125
+ ## What trips it — and what slips past
126
+
127
+ Aperture MCP is a **heuristic**. We measured it on our own gold corpus and we publish the numbers
128
+ instead of a single flattering score, because *knowing where it’s blind is the product* —
129
+ **recall 0.375, precision 0.75** on a 41-case corpus (it catches 9 of 24 real drifts; ~1 flag in 4 is
130
+ noise), full breakdown in [docs/measured-limits.md](docs/measured-limits.md):
131
+
132
+ | Kind of change | Does Aperture MCP flag it? |
133
+ | --- | --- |
134
+ | A watched commitment **deleted verbatim** | ✅ Reliably — this is the one thing it’s good at |
135
+ | A commitment **reworded / softened** (“must” → “should”) | ❌ **Missed** — the text still “matches” |
136
+ | A commitment **paraphrased / restructured** | ❌ **Missed** |
137
+ | A number / scope / negation quietly changed | ❌ **Missed** |
138
+ | A commitment **translated** to another language | ⚠️ **Declines (abstains)** for a *natural-language* anchor — it can’t compare verbatim across scripts, so it returns `degraded` rather than false-flag (a commitment dropped **and** translated is missed) |
139
+
140
+ > **Anchor style matters for that last row:** the abstain applies to a **natural-language** anchor. A
141
+ > **code-identifier** anchor (the `ci-gates-green` style the quickstart teaches) is treated as
142
+ > *translation-stable* — Aperture keeps checking it across languages, so if that exact token disappears
143
+ > it still flags `DROPPED_SILENTLY` (usually what you want for a stable identifier).
144
+
145
+ **Takeaway:** treat every flag as *“look here,”* never as *“this is wrong”* — and never assume
146
+ silence means nothing drifted. Aperture MCP catches the **verbatim disappearance** case well and is
147
+ honest that it catches little else. That narrow, reliable signal is useful precisely *because*
148
+ it doesn’t pretend to be more.
149
+
150
+ > **Hit one of those misses on your own docs?** That's the single most useful thing you can send us —
151
+ > [report it in ~30s](#hit-a-miss-help-it-improve) (your wording is optional). Real misses guide what
152
+ > we fix next.
153
+
154
+ > Why not just `git diff`? You can reproduce the core check with `grep`. What Aperture MCP adds is that
155
+ > an **agent can call it mid-task** (over MCP), it returns a **structured, directional result**
156
+ > (`ok` / `degraded` / `DROPPED_SILENTLY` / …), and it **reports its own blind spots** in the
157
+ > result so a human can audit the gaps. It’s ergonomics + honesty around a simple, legible check —
158
+ > not a smarter detector.
159
+
160
+ ---
161
+
162
+ ## Why this exists
163
+
164
+ Long-running and multi-agent workflows drift. A constraint set in turn 3 / session 1 / by agent A
165
+ gets quietly edited away forty turns later, in another session, by agent B — and nobody notices
166
+ until it ships. Aperture MCP is a **preflight you can put on the documents agents maintain**: name the
167
+ commitments that must not silently vanish, and get a tripwire when one does.
168
+
169
+ It is deliberately **small and legible**. It is not an AI that decides for you; it is a signal that
170
+ helps *you* stay consistent with yourself.
171
+
172
+ ---
173
+
174
+ ## Who it’s for
175
+
176
+ Teams and builders who **(a)** let AI agents edit repo-resident decision documents — specs, plans,
177
+ ADRs, charters, and `AGENTS.md` files — and **(b)** keep those documents under version control.
178
+ If your agents touch text that encodes promises, Aperture MCP gives you a cheap, honest tripwire on the
179
+ ones you can’t afford to lose silently.
180
+
181
+ ---
182
+
183
+ ## Privacy
184
+
185
+ - **Opt-in and local.** Aperture MCP runs on your machine. It makes no network calls.
186
+ - **Never trains on your data.** Your decision text is yours; it never leaves your process.
187
+ - **Usage logging is off by default** and, when enabled, records only **metadata** (timestamp,
188
+ tool, status, counts) — never your decision text or commitment wording.
189
+
190
+ ---
191
+
192
+ ## Honesty about the demo
193
+
194
+ The repository ships a small **hand-authored fixture ADR** (a before/after pair under
195
+ [`examples/git_decision_drift/fixtures/`](./examples/git_decision_drift/fixtures)), where Aperture MCP
196
+ correctly flags a commitment we deliberately retired and stays quiet on one we kept. It is a faithful
197
+ illustration of the mechanism — but it is a **sample of one that we author and judge ourselves**. It
198
+ demonstrates *how the tripwire works*, **not** *that the signal is strong*. For the latter, see the
199
+ measured per-family numbers above and in
200
+ [`docs/measured-limits.md`](./docs/measured-limits.md).
201
+ We have **zero external adopters yet** — if you run Aperture MCP on your own decision docs, we’d love to
202
+ hear what it caught and what it missed.
203
+
204
+ ---
205
+
206
+ ## Project status
207
+
208
+ Early, **pre-1.0**, not yet a production gate. The compare contract (`v0.2`) is frozen and covered
209
+ by a conformance suite; the package API may still move. See [VERSIONING.md](./VERSIONING.md) for the
210
+ compatibility policy and [CHANGELOG.md](./CHANGELOG.md) for changes.
211
+
212
+ ## Hit a miss? Help it improve
213
+
214
+ Aperture MCP **will** miss things — that's by design (it's blind to reworded, softened, and translated
215
+ commitments). When it misses a drift you cared about, or false-flags a rewrite, telling us is the
216
+ single most valuable contribution:
217
+
218
+ - **~30 seconds, no account/usage data, your wording is optional** →
219
+ [open a drift-case report](../../issues/new?template=drift-case-report.md).
220
+ - Real misses tell us **which blind spot to fix next**, and — only if you choose to share the wording —
221
+ can become cases in the gold corpus that keeps the numbers in
222
+ [`docs/measured-limits.md`](./docs/measured-limits.md) honest.
223
+
224
+ We never auto-collect anything (see [Privacy](#privacy)); this happens only when *you* choose to share.
225
+ Questions, or "is this the right tool for my case?" → **[GitHub Discussions](../../discussions)**.
226
+
227
+ More ways to help: [CONTRIBUTING.md](./CONTRIBUTING.md).
228
+
229
+ ## License
230
+
231
+ [Apache-2.0](./LICENSE).