plied 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,414 @@
1
+ Metadata-Version: 2.4
2
+ Name: plied
3
+ Version: 0.1.0
4
+ Classifier: Environment :: Console
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Intended Audience :: Science/Research
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Programming Language :: Rust
9
+ Classifier: Topic :: Software Development :: Version Control :: Git
10
+ License-File: LICENSE
11
+ Summary: A git-tracked work record for teams of agents and people: a work tree, commitments, open questions, messages to whoever is on a node, and checked citations of cleared literature.
12
+ Keywords: agents,multi-agent,provenance,git,literature
13
+ Home-Page: https://github.com/jupsh/plied
14
+ Author: jupsh
15
+ License: MIT
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
18
+ Project-URL: Changelog, https://github.com/jupsh/plied/blob/main/CHANGELOG.md
19
+ Project-URL: Homepage, https://github.com/jupsh/plied
20
+ Project-URL: Repository, https://github.com/jupsh/plied
21
+
22
+ # plied
23
+
24
+ A work record that lives in git, for teams of AI agents and people working on
25
+ the same project at once.
26
+
27
+ Plying is the step that twists single threads into one yarn. plied does the
28
+ same for work: each agent's line of work stays a separate, readable record,
29
+ and together they form one record that can be checked.
30
+
31
+ - **A work tree.** Nodes (threads) with a status, what they wait on, their
32
+ schedule and approval, and, once closed, a quoted outcome and the problems
33
+ they leave unresolved.
34
+ - **Commitments.** Promises made along the way ("if X, then Y"; "before Z, do
35
+ W"), quoted word for word from the record that made them. They come up for
36
+ review before any consequential action.
37
+ - **Questions.** Decisions that wait on someone with the authority to make
38
+ them, answered only by a record that has that authority.
39
+ - **Messages.** Notes addressed to a node and delivered to whoever is on it now,
40
+ with delivery, read and acknowledgement kept separate.
41
+ - **Literature.** Checked citations of cleared papers by PDF page, page search,
42
+ page images and backlinks.
43
+ - **Checks.** Broken references, invalid states, dependency cycles and
44
+ paraphrased "quotations" are errors. Stale nodes and unrecorded commitments
45
+ are warnings.
46
+
47
+ Everything is plain Markdown with YAML frontmatter, or JSON lines, tracked in
48
+ git. Generated views make it easy to browse. There is no database, no server and
49
+ no daemon: it is one binary with no runtime dependencies.
50
+
51
+ ```
52
+ $ plied tree
53
+ T001 M1: the reference species reproduces food sharing open
54
+ ├── T002 In-nest motion closed, outcome D088, carries F068, F075
55
+ ├── T003 Transfer to the 1999 experiments closed, outcome D107, carries F081, F093
56
+ │ ├── T004 Contact split, during vs after the main bout open, next 1, lead
57
+ │ └── T005 Step-5 closure wording waiting ⟵ Q01
58
+ └── T006 Cause of colony synchrony open
59
+ └── T007 S2 audit waiting ⟵ Q02, approval: not approved
60
+ ```
61
+
62
+ ## Install
63
+
64
+ ```
65
+ pipx install plied # or `uv tool install plied`; prebuilt binary, no Rust needed
66
+ cargo install plied # from crates.io
67
+ cargo install plied --features pdf # adds PDF page text and page images (pdfium)
68
+ ```
69
+
70
+ You need git. The PyPI wheels are built without the `pdf` feature; for
71
+ `plied lit extract`, install with cargo. Building from source needs a Rust
72
+ toolchain (1.89 or newer).
73
+ To run it once without installing: `cargo run -- …` in a checkout.
74
+
75
+ ## Quick start
76
+
77
+ ```
78
+ cd your-repo
79
+ plied init # writes plied.toml
80
+ export PLIED_AGENT=alice # who is acting (or pass --as on each command)
81
+
82
+ plied new thread --title "Calibrate the walking model" next=1 actor=alice
83
+ plied new thread --title "Held-out test" status=held waiting_on=[T001]
84
+ plied show T001 # prints the record and its revision (rev)
85
+ plied set T001 actor=bob --expect <rev> --why "bob takes it over"
86
+ plied tree
87
+ plied check
88
+ ```
89
+
90
+ Records are written to `plied/threads/`, `plied/commitments/` and
91
+ `plied/questions/`. The view is generated in `plied/README.md`. Commit them
92
+ like any other file.
93
+
94
+ ## How it works
95
+
96
+ ### One canonical checkout
97
+
98
+ Every worktree of a repository shares one git common directory. plied treats
99
+ the **main worktree** as the canonical record. Every `plied` command reads and
100
+ writes the canonical copy, whichever worktree it runs in, so record files in
101
+ other worktrees are read-only snapshots. Runtime state that is never tracked
102
+ (the lock, presence claims, the revision cache, the search index) lives in
103
+ `.git/plied/` and is shared by all worktrees.
104
+
105
+ ### Checked writes
106
+
107
+ Every change names the revision it was made against: `--expect <rev>`, where
108
+ the rev comes from `plied show`. Under a file lock, plied:
109
+
110
+ 1. refuses the write if the canonical checkout is on the wrong branch
111
+ (`canonical_branch`), has a detached HEAD, or is mid-merge, mid-rebase,
112
+ mid-cherry-pick or mid-bisect;
113
+ 2. refuses it if the record moved on since that revision. You get back the
114
+ current record and a diff from the revision you read, then reconcile and
115
+ retry. There are no silent overwrites;
116
+ 3. refuses it if it would add a validation error. Errors that already exist
117
+ elsewhere don't block unrelated work;
118
+ 4. adds a dated history line naming the agent and session, then replaces the
119
+ record and the regenerated view as one recoverable write. An intent journal
120
+ in `.git/plied/` means a crash leaves a state plied can repair:
121
+ `plied recover` (or the next write) finishes or undoes it, and refuses to
122
+ guess if a file was edited in between. Until then, `check` fails and the
123
+ commit guard refuses. The files still change one at a time, so a read
124
+ during a write can see a mix of old and new.
125
+
126
+ If two agents read revision 7 and both write, the first write is accepted and
127
+ the second gets a conflict.
128
+
129
+ ### Status, scheduling, approval and dependencies are separate
130
+
131
+ | field | meaning |
132
+ |---|---|
133
+ | `status` | `open` (nothing named stops it) · `waiting` (on `waiting_on`) · `held` (by a decision) · `parked` (set aside, with `revisit`) · `closed` (concluded, outcome recorded, whatever it was) · `group` (organisational) |
134
+ | `next`, `actor` | position in an actor's queue (open nodes only) |
135
+ | `approval` | `state: approved` or `not approved`, plus `by`: the record that decided it, checked for authority and scope |
136
+ | `waiting_on` | blocks. `uses` does not block (the node uses the other's results as they come). `parent` is organisational only |
137
+ | `outcome` | closed nodes only: `quote` and `ref`. The quote must appear word for word in `ref` |
138
+ | `carries` | problems still unresolved after closing |
139
+ | `due`, `revisit_on` | dates (`YYYY-MM-DD`): `check` warns once they pass and `frontier` lists them; they never block anything |
140
+
141
+ Closing a node records what happened. It doesn't mean success and it doesn't
142
+ approve anything that depends on it. A closed parent can have open children.
143
+
144
+ ### Quotations are checked
145
+
146
+ `outcome.quote`, a commitment's `wording` and a citation's `quote` must appear
147
+ in the cited source after normalising whitespace, curly quotes, Markdown
148
+ emphasis and hyphenated line breaks. `…` marks omitted text, and the remaining
149
+ parts must appear in order. A paraphrase fails, so either quote the record
150
+ exactly or write the record first. A match only means the words are there. It
151
+ doesn't mean they support the claim.
152
+
153
+ ### Authority
154
+
155
+ Pointing `approval.by` (or a question's `answered_by`, or a waiver's
156
+ `resolved_by`) at a decision only counts if that decision says it had the
157
+ authority. Declare which fields hold this in the decision source:
158
+
159
+ ```toml
160
+ [[sources]]
161
+ name = "decisions"
162
+ glob = "docs/decisions/*.md"
163
+ id = "^D\\d{3}$"
164
+ authority = "authority" # user | delegated by D012
165
+ scope = "scope" # the ids it approves: [T004, Q02]
166
+ ```
167
+
168
+ A decision whose scope doesn't include the node is an error. A decision with no
169
+ authority field gives a warning that it can't be verified, never a pass. A
170
+ validator can check this evidence. It can't establish authorisation from a
171
+ label.
172
+
173
+ ### Commitment review before consequential actions
174
+
175
+ ```
176
+ plied review T004 --action run:fit-20261024 --gate
177
+ plied dispose P02 --action run:fit-20261024 --disposition not-triggered \
178
+ --because "rule 1 not read yet" --expect <rev>
179
+ ```
180
+
181
+ A commitment applies to a node in four ways:
182
+
183
+ - it's attached to the node directly (`nodes`, or the node's `links`);
184
+ - it's attached to anything the node reaches through `waiting_on` or `uses`;
185
+ - it's attached to an ancestor and says `applies: subtree`;
186
+ - it says `applies: project`.
187
+
188
+ `parent` alone never carries an obligation. Each commitment is shown with the
189
+ chain of links through which it applies. `--gate` needs `--action` and exits
190
+ with code 6 until every applicable commitment has a disposition for that action
191
+ and none of them is `blocks`. Dispositions for other actions don't count. Use the gate in your run scripts. Structure can't tell whether a
192
+ scientific trigger has fired: that's the reviewer's judgement, recorded with
193
+ its reason.
194
+
195
+ ### Messages and presence
196
+
197
+ ```
198
+ plied claim T004 # "I'm on T004": an expiring lease, renewed by the hook
199
+ plied send T004 "Hold the rerun until D140 is read." # to whoever is on T004, plus subscribers
200
+ plied send T004 "…" --to bob --id 01HX… # explicit recipients; your own id makes retries safe
201
+ plied inbox # marks messages read (--peek doesn't)
202
+ plied ack <id> # receipt only, never approval
203
+ plied messages T004 # the node's conversation
204
+ ```
205
+
206
+ Messages are tracked: one append-only JSON-lines log per node in
207
+ `plied/messages/`. Each message records who was present when it was sent. Every
208
+ event has a unique id, so a retry with the same id is recorded once; reusing
209
+ an id for a different message is refused. Writes are
210
+ locked. A torn last line from an interrupted write is cut before the next
211
+ append.
212
+
213
+ Presence is a lease. It estimates that an agent is on a node; it doesn't prove
214
+ the agent is running.
215
+
216
+ **Claude Code** delivers messages at the agent's next prompt, or after a tool
217
+ call. Add this to `.claude/settings.json`:
218
+
219
+ ```json
220
+ {
221
+ "hooks": {
222
+ "SessionStart": [{ "hooks": [{ "type": "command", "command": "plied hook claude" }] }],
223
+ "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "plied hook claude" }] }],
224
+ "PostToolUse": [{ "hooks": [{ "type": "command", "command": "plied hook claude" }] }]
225
+ }
226
+ }
227
+ ```
228
+
229
+ `plied claim` picks up the session from `$CLAUDE_CODE_SESSION_ID`. The hook
230
+ is a small native binary and costs a few milliseconds per call. Leave out PostToolUse if
231
+ delivery at each prompt is soon enough. Other agents poll `plied inbox` and
232
+ claim by hand, so their presence is only as good as their claims.
233
+
234
+ ### Literature
235
+
236
+ ```toml
237
+ [literature]
238
+ manifest = "literature.json" # {"papers": [{"id": "Smith2020", "file": "Smith2020.pdf", "sha256": "…"}]}
239
+ pdf_dir = "papers"
240
+ # text_dir = "cache/pages/{id}" # your own page text (pNN.txt = PDF page NN); default: `plied lit extract`
241
+ # ocr_marker = "[OCR" # pages whose text is OCR
242
+ ```
243
+
244
+ Only papers in the manifest are cleared. A record cites them like this:
245
+
246
+ ```yaml
247
+ cites:
248
+ - paper: Smith2020
249
+ page: 4
250
+ quote: "The mean bout lasted 12.5 s"
251
+ kind: table # values from tables or figures must be read from the page image…
252
+ image_checked: true # …and say so
253
+ ```
254
+
255
+ `plied lit check` reports four results for every citation, separately:
256
+ clearance, source hash, page existence and quotation. A citation without a
257
+ quote is fine for a table or figure value (its quotation result is
258
+ `unchecked`); anywhere else it gets a warning, since nothing ties it to the
259
+ page. Matches on OCR'd pages
260
+ are warnings to verify against the image. Other commands: `plied lit search`,
261
+ `plied lit page Smith2020 4 [--image]`, and `plied lit cites Smith2020`, which
262
+ finds citations and author–year mentions such as "Smith et al. (2020)".
263
+
264
+ ### Search, with access rules
265
+
266
+ `plied index` builds a keyword (BM25) index of the records and cleared paper
267
+ pages that `[search]` allows. `plied search "donor volume"` queries it.
268
+
269
+ - **Sealed paths** (`[access] sealed`, plus `sealed_file` with one substring
270
+ per line) are never read, indexed or shown, by any command, including when
271
+ reached through a symlink. `show`, `find`, `check` and the views leave sealed
272
+ records out. plied can't verify a link to a record it may not read, so
273
+ `check` reports one as a broken reference. If a sealed file is configured but
274
+ missing, plied refuses to read anything.
275
+ - The index stores a digest of the access policy: the sealing rules, the
276
+ literature manifest and the allowlist. When any of them changes, the index is
277
+ refused, never served, until it's rebuilt.
278
+ - Every hit is checked against the current policy before it's shown. A file
279
+ that changed since indexing is marked.
280
+ - `.git/` is always excluded. Put anything else that must never be searched
281
+ (e.g. pending results) in `exclude`.
282
+
283
+ Structured queries cover all records, plied's and linked ones:
284
+
285
+ ```
286
+ plied find '{"kind": "thread", "status": "waiting", "waiting_on": "Q02"}'
287
+ plied find '{"kind": "decisions", "date": {"$gte": "2026-10-01"}, "body": {"$regex": "S2"}}'
288
+ plied backlinks D134
289
+ plied frontier
290
+ ```
291
+
292
+ ### Keeping record files out of code branches
293
+
294
+ ```
295
+ plied guard install # pre-commit and pre-merge-commit hooks (leaves existing hooks alone)
296
+ plied guard range main HEAD # for CI or review: fails if HEAD brings record changes
297
+ ```
298
+
299
+ The guards refuse a commit of record files from any worktree except the
300
+ canonical one. They also refuse staged record content that plied didn't write
301
+ (a hand edit), deleting a record, and a merge that brings in record content
302
+ plied didn't write. They protect the defined workflow, but someone who bypasses
303
+ the tool or the hooks (`--no-verify`) isn't stopped. A passing guard never
304
+ authorises a commit: your project's own commit rules still apply.
305
+
306
+ ## Linking other record systems
307
+
308
+ plied doesn't take over your existing decision logs, findings or backlog. It
309
+ links to them. Each `[[sources]]` entry names a glob, the frontmatter field
310
+ holding the id, and an id pattern. It can also name fields for the date, time,
311
+ status, authority and scope, and set `scan_commitments` (warn about
312
+ conditionals and deferrals that no commitment records) and `require_linked`
313
+ (warn when no plied record links to an item). Linked records stay
314
+ authoritative: plied cites them and never restates them.
315
+
316
+ ## Configuration reference
317
+
318
+ ```toml
319
+ [plied]
320
+ format = 1 # the on-disk format; a plied that doesn't know it refuses writes
321
+ requires = ">=0.1.0" # plied versions that may write: "X.Y.Z" exactly, or ">=X.Y.Z"
322
+ root = "plied" # where plied's records live
323
+ canonical_branch = "main" # optional
324
+
325
+ [ids] # optional
326
+ thread = { prefix = "T", width = 3 }
327
+ commitment = { prefix = "P", width = 2 }
328
+ question = { prefix = "Q", width = 2 }
329
+
330
+ [[sources]] # any number; see above
331
+
332
+ [access]
333
+ sealed_file = ".sealed-paths"
334
+ sealed = ["held/"]
335
+
336
+ [search]
337
+ include = ["plied/**/*.md", "docs/**/*.md"]
338
+ exclude = ["logs/**"]
339
+
340
+ [literature] # see above
341
+ manifest = "literature.json"
342
+ id_field = "id" # or id_from_file = "^([^_]+)_"
343
+ pdf_dir = "papers"
344
+ text_dir = "cache/papers/{id}"
345
+ page_file = "p{page:02d}.txt"
346
+ ocr_marker = "[OCR"
347
+ image_command = ["tool", "{id}", "{page}"] # optional renderer, instead of the built-in PDF renderer (runs this program)
348
+ image_path = "cache/img/{id}-p{page}.png"
349
+
350
+ [checks]
351
+ approve_authorities = ["user", "delegated"]
352
+ actors = ["lead", "user"] # optional
353
+ commitment_phrases = ["\\bdeferred\\b", "\\bif\\b[^.]{0,80}\\bthen\\b"]
354
+ commitments_since = "2026-10-01"
355
+ action_kinds = ["run", "publish"] # optional: actions must be kind or kind:instance
356
+
357
+ [messages]
358
+ lease_minutes = 30
359
+
360
+ [runtime]
361
+ revision_days = 14 # how long cached revisions (for conflict diffs) are kept
362
+ ```
363
+
364
+ Every field is type-checked when the file is loaded: `sealed = "secret"` is an
365
+ error, not a list of six one-letter seals, and a misspelt key (`seald`) is an
366
+ error rather than a setting silently left at its default. Bad regular expressions and
367
+ templates are errors too. Treat `plied.toml` as part of your trust boundary:
368
+ `image_command` runs whatever program it names.
369
+
370
+ Environment: `PLIED_AGENT`, `PLIED_SESSION` (or `CLAUDE_CODE_SESSION_ID`),
371
+ `PLIED_RUNTIME` (move the runtime directory), `PLIED_CANONICAL` (for bare
372
+ repositories).
373
+
374
+ Exit codes: 0 ok · 1 error or failed check · 2 usage · 3 conflict · 4 the
375
+ change would add validation errors · 5 blocked (branch, merge state, format or
376
+ version; guard refusal) · 6 review gate.
377
+
378
+ Add `--json` to any command for one versioned result envelope on stdout,
379
+ failures included (see [FORMAT.md §11.1](https://github.com/jupsh/plied/blob/main/docs/FORMAT.md#111-json-results)).
380
+
381
+ The runtime directory caches the revisions plied reads and writes, so that a
382
+ conflict can show what changed. That cache holds content that may never have
383
+ been committed. It is pruned after `revision_days`; `plied gc --all` empties
384
+ it.
385
+
386
+ ## What it does not do
387
+
388
+ - **Guarantee anything for writes that bypass it.** Edit files by hand, or
389
+ commit with `--no-verify`, and only `plied check` and `plied guard range` can
390
+ still notice.
391
+ - **Coordinate across machines live.** Writes are local to one checkout.
392
+ Agents elsewhere work in their own clones and send proposals, for example as
393
+ messages.
394
+ - **Decide anything.** Approval, waivers and answers come from records with
395
+ authority. Warnings never change a status.
396
+ - **Semantic (embedding) search.** Not yet: keyword search comes first.
397
+ - **Keep secrets.** Sealing controls what plied reads and shows. Sealed files
398
+ are still plaintext in the clone and in git history. There is no
399
+ encryption, and no secure deletion.
400
+ - **Notify anyone, or run a server.** Building those on top of plied is the
401
+ intended route; see [docs/SCOPE.md](https://github.com/jupsh/plied/blob/main/docs/SCOPE.md).
402
+
403
+ ## Further reading
404
+
405
+ - [Format specification](https://github.com/jupsh/plied/blob/main/docs/FORMAT.md) — the contract for files and
406
+ command-line behaviour.
407
+ - [Scope](https://github.com/jupsh/plied/blob/main/docs/SCOPE.md) — what plied does itself, what it only makes
408
+ possible, and what it leaves to other tools.
409
+ - [RFC 0001: portable operations](https://github.com/jupsh/plied/blob/main/docs/rfc/0001-operations.md) — draft.
410
+
411
+ ## Licence
412
+
413
+ MIT.
414
+
@@ -0,0 +1,6 @@
1
+ plied-0.1.0.data/scripts/plied.exe,sha256=04ITygoiWKkz5F5dxoy7rIxPF8_JGquaDfo0CjxE_qA,5569024
2
+ plied-0.1.0.dist-info/METADATA,sha256=tSPESF-hl9L1nwApdAhve_fDvTVdQJT5bnWxbCqQwWs,19019
3
+ plied-0.1.0.dist-info/WHEEL,sha256=8Aej0W0a6Cz6apA3IzJrTnxLRVLAt-w0Oh8SA3Con_c,94
4
+ plied-0.1.0.dist-info/licenses/LICENSE,sha256=R8T4i_GHqSvJnr4p-I9dFsKo-GfTkh0WXusaJoz3NNM,1083
5
+ plied-0.1.0.dist-info/sboms/plied.cyclonedx.json,sha256=oeMS-evFDAns_9Elfa6Y2HO8BPcij_-PompL41Lj_K8,69201
6
+ plied-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.15.0)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jupsh
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.