decisis 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 (50) hide show
  1. decisis-0.1.0/LICENSE +202 -0
  2. decisis-0.1.0/PKG-INFO +12 -0
  3. decisis-0.1.0/README.md +203 -0
  4. decisis-0.1.0/bench/tasks.json +341 -0
  5. decisis-0.1.0/fixtures/audit/demo-lockfile.json +13 -0
  6. decisis-0.1.0/fixtures/audit/osv-cache.json +1501 -0
  7. decisis-0.1.0/fixtures/audit/vinc.json +12 -0
  8. decisis-0.1.0/fixtures/compare/impact-extra.json +46 -0
  9. decisis-0.1.0/fixtures/compare/lockfile.json +60 -0
  10. decisis-0.1.0/fixtures/compare/osv-cache.json +146 -0
  11. decisis-0.1.0/fixtures/demo/vinc_space.json +25 -0
  12. decisis-0.1.0/fixtures/impact/vinc.json +25 -0
  13. decisis-0.1.0/fixtures/vinc_subgraph.json +14 -0
  14. decisis-0.1.0/pyproject.toml +45 -0
  15. decisis-0.1.0/setup.cfg +4 -0
  16. decisis-0.1.0/src/decisis/__init__.py +0 -0
  17. decisis-0.1.0/src/decisis/audit.py +100 -0
  18. decisis-0.1.0/src/decisis/checkout.py +94 -0
  19. decisis-0.1.0/src/decisis/cli.py +151 -0
  20. decisis-0.1.0/src/decisis/commit.py +137 -0
  21. decisis-0.1.0/src/decisis/compare.py +309 -0
  22. decisis-0.1.0/src/decisis/demo.py +222 -0
  23. decisis-0.1.0/src/decisis/external.py +168 -0
  24. decisis-0.1.0/src/decisis/fake_vinc.py +63 -0
  25. decisis-0.1.0/src/decisis/impact.py +211 -0
  26. decisis-0.1.0/src/decisis/queries/__init__.py +12 -0
  27. decisis-0.1.0/src/decisis/queries/decision_to_advisory.cypher +4 -0
  28. decisis-0.1.0/src/decisis/queries/dependency_paths.cypher +3 -0
  29. decisis-0.1.0/src/decisis/queries/governing_decisions.cypher +2 -0
  30. decisis-0.1.0/src/decisis/queries/governing_nodes.cypher +7 -0
  31. decisis-0.1.0/src/decisis/queries/paths_between.cypher +4 -0
  32. decisis-0.1.0/src/decisis/sandbox.py +110 -0
  33. decisis-0.1.0/src/decisis/semver.py +51 -0
  34. decisis-0.1.0/src/decisis.egg-info/PKG-INFO +12 -0
  35. decisis-0.1.0/src/decisis.egg-info/SOURCES.txt +48 -0
  36. decisis-0.1.0/src/decisis.egg-info/dependency_links.txt +1 -0
  37. decisis-0.1.0/src/decisis.egg-info/entry_points.txt +3 -0
  38. decisis-0.1.0/src/decisis.egg-info/requires.txt +4 -0
  39. decisis-0.1.0/src/decisis.egg-info/top_level.txt +2 -0
  40. decisis-0.1.0/src/vinc_relate/__init__.py +13 -0
  41. decisis-0.1.0/tests/test_audit.py +157 -0
  42. decisis-0.1.0/tests/test_checkout.py +91 -0
  43. decisis-0.1.0/tests/test_commit.py +127 -0
  44. decisis-0.1.0/tests/test_compare.py +99 -0
  45. decisis-0.1.0/tests/test_demo.py +107 -0
  46. decisis-0.1.0/tests/test_docs.py +48 -0
  47. decisis-0.1.0/tests/test_fixtures.py +29 -0
  48. decisis-0.1.0/tests/test_impact.py +197 -0
  49. decisis-0.1.0/tests/test_old_name.py +26 -0
  50. decisis-0.1.0/tests/test_sandbox.py +112 -0
decisis-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
decisis-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: decisis
3
+ Version: 0.1.0
4
+ Summary: Stand by what was decided: join a team's decisions with code and outside facts in a throwaway Relate graph, and keep only verified findings. Works offline; connects to Vinc when you configure it.
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Repository, https://github.com/Vinculums/decisis
7
+ Requires-Python: >=3.11
8
+ License-File: LICENSE
9
+ Requires-Dist: relate-db==1.0.2
10
+ Provides-Extra: dev
11
+ Requires-Dist: pytest>=8; extra == "dev"
12
+ Dynamic: license-file
@@ -0,0 +1,203 @@
1
+ # decisis
2
+
3
+ [![test](https://github.com/Vinculums/decisis/actions/workflows/test.yml/badge.svg)](https://github.com/Vinculums/decisis/actions/workflows/test.yml)
4
+
5
+ **Stand by what was decided.** decisis (from *stare decisis*) checks work against the decisions a team
6
+ has already made. It takes the slice of decisions a task needs, joins it with outside facts (an npm
7
+ lockfile and OSV advisories) in a throwaway [Relate](https://github.com/relatedb/relate) graph, finds
8
+ multi-hop paths from a decision to the thing that breaks it, and deletes the graph when the task ends.
9
+
10
+ It runs offline with no account: decisions come from a plain JSON snapshot (`docs/data-model.md`).
11
+ Connecting a [Vinc](https://vincs.io) space is optional and yours to configure (`VINC_API_KEY`, see
12
+ [What needs an account](#what-needs-an-account)): then `checkout` reads the snapshot from Vinc, and
13
+ `commit` writes findings back only after a person approves the exact write set by its digest, reading
14
+ every write back before the run counts as done.
15
+
16
+ The project was called vinc-relate until 2026-11-24. The `vinc-relate` command and `import vinc_relate`
17
+ still work for one more release.
18
+
19
+ ```mermaid
20
+ flowchart LR
21
+ V[("Vinc graph<br/>persistent")] -- "checkout: seeds, depth" --> S["snapshot.json"]
22
+ L["npm lockfile"] --> R
23
+ O["OSV advisories<br/>live or --osv-cache"] --> R
24
+ S --> R[("Relate file<br/>private 0700 tmpfs dir<br/>read only while reasoning")]
25
+ R -- "bounded Cypher paths" --> F["findings with<br/>paths and sources"]
26
+ F --> P["write set +<br/>approval digest"]
27
+ P -- "a person approves<br/>the digest" --> W["commit: create_only,<br/>then read back"]
28
+ W --> V
29
+ R -. "deleted after the run" .-> D["nothing left"]
30
+ ```
31
+
32
+ Entry for the Relate by Neo4j hackathon, "Context, Connected". Licensed under Apache-2.0 (`LICENSE`).
33
+
34
+ ## Five-minute setup
35
+
36
+ You need Python 3.11 or newer, git and [uv](https://docs.astral.sh/uv/). No Vinc account and no API key.
37
+ The install fetches `relate-db` from PyPI once; every command after it runs offline.
38
+
39
+ ```
40
+ git clone https://github.com/Vinculums/decisis.git
41
+ cd decisis
42
+ uv venv .venv && uv pip install --python .venv/bin/python -e ".[dev]"
43
+ .venv/bin/python -m pytest -q
44
+ .venv/bin/decisis demo
45
+ ```
46
+
47
+ Without uv: `python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"`. On Windows the scripts are
48
+ under `.venv\Scripts\` instead of `.venv/bin/`.
49
+
50
+ `decisis demo` runs the whole procedure on synthetic data in under a second: a synthetic Vinc
51
+ space served by an in-process fake Vinc, a checkout of only the app's knowledge (3 of 9 nodes), a
52
+ Relate graph that joins it with the demo lockfile and cached OSV advisories (14 nodes, 15 edges), a
53
+ five-hop path from a decision to an advisory, a Checker that re-derives each proposed record from the
54
+ sandbox (31 checks over 7 records), and the write set with its approval digest. It stops there and
55
+ writes nothing. The path it finds:
56
+
57
+ ```
58
+ decision:no-high-advisories-in-shipped-dependencies -ABOUT-> concept:demo-app <-DESCRIBED_BY- repo:Demo
59
+ -DEPENDS_ON-> pkg:npm/report-kit@2.1.0 -DEPENDS_ON-> pkg:npm/lodash@4.17.15 -AFFECTED_BY-> adv:GHSA-r5fr-rjxr-66jc
60
+ ```
61
+
62
+ The rule lives in the knowledge graph, the dependency chain in the lockfile and the advisory in OSV;
63
+ no single source holds the connection. Then approve, as the person would:
64
+
65
+ ```
66
+ .venv/bin/decisis demo --approve d761d1c8a44d62e2
67
+ git diff demo/transcript.json
68
+ ```
69
+
70
+ The records go to the fake Vinc with `create_only`, every node and edge is read back, and a new
71
+ checkout finds the committed edges with their type and direction. The digest is the same on every
72
+ run because the records are dated by the OSV cache. Both runs write `demo/transcript.json`,
73
+ `demo/expected_findings.json` and `demo/sample.rl` (a copy of the sandbox graph for inspection, synthetic
74
+ data only). The committed copies come from the approved run, so `git diff demo/transcript.json` shows
75
+ only its `timestamps` block changed; `sample.rl` is rebuilt, so its bytes differ. The sandbox itself is
76
+ deleted.
77
+
78
+ ## Does the graph help? The measured comparison
79
+
80
+ ```
81
+ .venv/bin/decisis compare
82
+ ```
83
+
84
+ `compare` runs nine tasks from `bench/tasks.json` three ways, offline and without a model:
85
+ **A** answers from the Vinc snapshot alone (nodes whose `code_ref` matches the subject, then one hop);
86
+ **B** adds the lockfile and the advisories as flat records joined by package name, with the same version
87
+ range check and policy rule as C; **C** loads all three into a Relate graph and queries it. The tasks and
88
+ their expected findings were committed before the first run. A path or a policy link counts when it
89
+ equals an expected one; any other claim is unsupported; a claim is covered when its evidence is a
90
+ connected chain of edges that exist in the inputs.
91
+
92
+ | Method | Path discovery | Policy links | Findings | Unsupported claims | Evidence coverage | Latency (ms, all tasks) |
93
+ |---|---|---|---|---|---|---|
94
+ | A | 5/13 | 5/17 | 0/5 | 0/10 | 10/10 | 0.2 |
95
+ | B | 9/13 | 15/17 | 5/5 | 1/30 | 27/30 | 0.6 |
96
+ | C | 13/13 | 17/17 | 5/5 | 0/35 | 35/35 | 85.0 |
97
+
98
+ Against B, C is better on 2 tasks, the same on 7 and worse on none. It helped where a connection spans
99
+ sources: a vulnerable package reached only through a shared transitive dependency, and a decision two
100
+ hops from the code it governs. Per-task numbers are in `bench/results.md`, every claim with its
101
+ coverage in `bench/results.json`. Latency is the only number that changes between runs; C's includes
102
+ building and loading a graph for each task.
103
+
104
+ Read the numbers with these caveats:
105
+
106
+ - **B's policy-link score is generous.** On the shared transitive dependency B claims a wrong chain
107
+ (through test-kit, which has its own nested copy), yet both of its policy links on that task still
108
+ count as correct because they name the right decision and advisory. Their evidence chain is the wrong
109
+ one; the coverage column (27/30) is where that shows.
110
+ - **"C against B" compares paths, policy links and unsupported claims only.** Findings, coverage and
111
+ latency are not part of that label.
112
+ - **The impact rule was fitted after seeing the decoy.** `impact` follows a `RELATED_TO` edge only from a
113
+ concept that names no code of its own. That condition was chosen after the overreach decoy task had
114
+ been run, because edge type and direction alone cannot tell the expected path from the decoy. The
115
+ expected findings were not changed, but the rule is fitted on this benchmark; a held-out set is
116
+ needed to show it generalises.
117
+ - **The benchmark is small and synthetic.** Nine hand-built tasks show which kinds of connection need a
118
+ graph, not how often they occur in real repositories.
119
+
120
+ ## What needs an account
121
+
122
+ | Command | Needs | What it does |
123
+ |---|---|---|
124
+ | `demo` | nothing | the whole procedure on synthetic data, against an in-process fake Vinc |
125
+ | `compare` | nothing | the A/B/C benchmark above |
126
+ | `paths <snapshot> <from> <to>` | nothing | bounded paths between two ids in any snapshot file |
127
+ | `impact <snapshot> <code path>...` | nothing | the decisions and records that govern a code path |
128
+ | `audit <snapshot> <lockfile> --repo <name>` | nothing; the network for api.osv.dev unless `--osv-cache` | advisories the repository reaches and the decisions they break |
129
+ | `propose <report> --repo <name> --space <space>` | nothing; it only writes a file | the exact write set and its approval digest |
130
+ | `checkout <seed>... --out <file>` | a read-only Vinc key | exports a bounded subgraph from Vinc |
131
+ | `commit <plan> --approve <digest>` | a full Vinc key | writes an approved write set and reads it back |
132
+
133
+ A snapshot is a plain JSON file. `docs/data-model.md` gives the format with a small hand-written
134
+ example, so you can run `paths`, `impact` and `audit` on your own knowledge without Vinc.
135
+
136
+ Try them on the synthetic fixtures:
137
+
138
+ ```
139
+ .venv/bin/decisis paths fixtures/vinc_subgraph.json record:tls-advisory-example concept:service-api
140
+ .venv/bin/decisis impact fixtures/impact/vinc.json reports/export.py storage/ --format text
141
+ .venv/bin/decisis audit fixtures/audit/vinc.json fixtures/audit/demo-lockfile.json --repo Demo --osv-cache fixtures/audit/osv-cache.json --out report.json
142
+ .venv/bin/decisis propose report.json --repo Demo --space demo-space --out plan.json
143
+ ```
144
+
145
+ `report.json`, `plan.json` and `snapshot.json` at the repository root are ignored by git. Without
146
+ `--osv-cache`, `audit` asks api.osv.dev; if the network fails it prints one line that says so and
147
+ points at `--osv-cache`.
148
+
149
+ With a Vinc account (needs a key):
150
+
151
+ ```
152
+ VINC_API_KEY=<read-only key> VINC_SPACE=<space id> .venv/bin/decisis checkout <seed id> ... --out snapshot.json
153
+ VINC_API_KEY=<full key> .venv/bin/decisis commit plan.json --approve <digest>
154
+ ```
155
+
156
+ Without `VINC_SPACE`, `checkout` reads the key's default space, and the snapshot's `meta.space` says
157
+ `personal`. Write to a real space only after its owner approves the printed write set.
158
+
159
+ ## How an agent uses it
160
+
161
+ `skills/decisis/SKILL.md` is a skill for a coding agent such as Claude Code: when to reach for
162
+ `audit`, `impact` or `paths`, how to check out only what the task names, how to read a finding, and the
163
+ rule that the agent shows the write set and digest to the person and stops. The agent never approves
164
+ its own write. To use it, put the directory where your agent loads skills (for Claude Code,
165
+ `.claude/skills/decisis/`) with `decisis` on the agent's `PATH`.
166
+
167
+ decisis itself calls no language model. The agent is the reasoner that chooses seeds, runs the
168
+ bounded queries and explains the paths; the tool gives it a graph it cannot write to, findings that
169
+ carry their evidence, and a write path that needs a person's digest.
170
+
171
+ ## What is proven, and what is future work
172
+
173
+ Proven by the tests in `tests/` (run offline in CI on Python 3.11 and 3.12) and by the runs above:
174
+
175
+ - A Vinc subgraph is exported over the Vinc MCP with stable ids, edge direction and evidence, and a
176
+ snapshot whose counts disagree with its lists is refused.
177
+ - The snapshot loads into a Relate file; the loader compares what landed with the snapshot and names a
178
+ repeated id or an edge with a missing endpoint. A bounded multi-hop query returns the expected path.
179
+ - Reasoning opens the file read only and a write is refused; an open writer locks out a second writer
180
+ and any reader.
181
+ - The task directory is private (0700), under `/dev/shm` when it is writable, and removed after the run.
182
+ - The audit joins the snapshot, the lockfile (nested copies resolved) and OSV, checks the installed
183
+ version against the advisory ranges, and keeps each advisory's source URL, fetch time and content hash.
184
+ - `commit` refuses a digest that does not match the plan as it stands, writes with `create_only`, and
185
+ fails when a node, a property or an edge's type or direction does not come back.
186
+ - A live run against a real Vinc space wrote and read back seven records with `create_only`, and a second
187
+ run with the same approval wrote nothing. That space is not public; `decisis demo --approve` is the
188
+ reproducible version.
189
+
190
+ Future work, not built:
191
+
192
+ - A Relate MCP server as the agent's read-only query surface; today the agent drives the CLI.
193
+ - Ecosystems other than npm, and repository metadata beyond the lockfile.
194
+ - The demo's Checker (re-deriving each record) also in the `propose` path for real data.
195
+ - Query time limits, a cap on imported graph size and on `audit --depth`; today `paths` and `impact` bound hops and results.
196
+ - Encrypted scratch storage with key destruction for sensitive data (see `docs/threat-model.md`).
197
+ - A held-out benchmark set, and real repositories, to test whether the comparison holds.
198
+
199
+ ## More
200
+
201
+ - `docs/architecture.md`: modules, the sandbox lifecycle, the queries, and the write path.
202
+ - `docs/data-model.md`: the snapshot format with a hand-written example, the Relate graph, the report and the plan.
203
+ - `docs/threat-model.md`: what the sandbox protects and what it does not.