keelyard 1.0.0__py3-none-any.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.
Files changed (51) hide show
  1. keelyard/__init__.py +3 -0
  2. keelyard/__main__.py +3 -0
  3. keelyard/adapters/__init__.py +1 -0
  4. keelyard/adapters/guides/SKILL.md +41 -0
  5. keelyard/adapters/guides/agents_block.md +8 -0
  6. keelyard/adapters/guides/agents_block_lean.md +4 -0
  7. keelyard/adapters/guides/cmd_prove.md +9 -0
  8. keelyard/adapters/guides/cmd_status.md +5 -0
  9. keelyard/adapters/guides/cmd_undo.md +7 -0
  10. keelyard/adapters/guides/terse.md +1 -0
  11. keelyard/adapters/guides/workflows/debug.md +9 -0
  12. keelyard/adapters/guides/workflows/plan.md +11 -0
  13. keelyard/adapters/guides/workflows/review.md +9 -0
  14. keelyard/adapters/install.py +777 -0
  15. keelyard/adapters/opencode_plugin.js +148 -0
  16. keelyard/arena.py +253 -0
  17. keelyard/assets/OFL-Geist.txt +93 -0
  18. keelyard/assets/__init__.py +0 -0
  19. keelyard/assets/geist-mono.woff2 +0 -0
  20. keelyard/assets/geist.woff2 +0 -0
  21. keelyard/bench.py +139 -0
  22. keelyard/brain.py +362 -0
  23. keelyard/cli.py +1085 -0
  24. keelyard/codemap.py +287 -0
  25. keelyard/config.py +246 -0
  26. keelyard/coop.py +279 -0
  27. keelyard/filters.py +358 -0
  28. keelyard/hooks.py +366 -0
  29. keelyard/locking.py +41 -0
  30. keelyard/mcp_server.py +527 -0
  31. keelyard/memory.py +306 -0
  32. keelyard/proc.py +23 -0
  33. keelyard/proof.py +430 -0
  34. keelyard/redact.py +35 -0
  35. keelyard/report.py +107 -0
  36. keelyard/saver.py +187 -0
  37. keelyard/selftest.py +200 -0
  38. keelyard/session.py +25 -0
  39. keelyard/snapshot.py +348 -0
  40. keelyard/swarm.py +572 -0
  41. keelyard/theme.py +83 -0
  42. keelyard/trust.py +153 -0
  43. keelyard/tui.py +190 -0
  44. keelyard/ui.py +63 -0
  45. keelyard/usage.py +137 -0
  46. keelyard/workstate.py +146 -0
  47. keelyard-1.0.0.dist-info/METADATA +164 -0
  48. keelyard-1.0.0.dist-info/RECORD +51 -0
  49. keelyard-1.0.0.dist-info/WHEEL +4 -0
  50. keelyard-1.0.0.dist-info/entry_points.txt +2 -0
  51. keelyard-1.0.0.dist-info/licenses/LICENSE +202 -0
keelyard/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """keelyard: a local trust-and-thrift layer for AI coding agents."""
2
+
3
+ __version__ = "1.0.0"
keelyard/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())
@@ -0,0 +1 @@
1
+ """Per-agent installers. Each writes project-local config only; nothing global unless asked."""
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: keelyard
3
+ description: Prove work before finishing, undo bad edits, keep context small. Use when changing code in this repo, when a test or edit went wrong and you need to go back, or before telling the user a task is done.
4
+ ---
5
+
6
+ # keelyard
7
+
8
+ keelyard runs as an MCP server (`keelyard`) plus hooks. Every edit is snapshotted; the Stop
9
+ hook blocks "done" until there is evidence.
10
+
11
+ ## The loop
12
+
13
+ 1. `proof_requirements(items=[...])`: one checkable item per user ask.
14
+ 2. `project_map`, `find_symbol(name)`, `outline(path)`, then `read_file(path)`.
15
+ 3. Edit. Use `run_compact(command)` for tests and builds.
16
+ 4. `proof_run_tests(phase="after")`.
17
+ 5. `proof_check(requirement_id, evidence)` for every item. Evidence is a command and its result,
18
+ or a `path:line`.
19
+ 6. `proof_status()` must return `{"proven": true}`.
20
+
21
+ ## When something goes wrong
22
+
23
+ - `rewind_list()` shows each step with the files it touched.
24
+ - `rewind_diff(step)` shows what a step changed.
25
+ - `rewind_to(step)` restores files. It returns `safety_step`; `rewind_to(safety_step)` undoes it.
26
+
27
+ ## Saving context
28
+
29
+ - Repeat `read_file` calls on an unchanged file return a one-line notice.
30
+ - `run_compact` keeps failures and `file:line`, drops passing noise; `recall(output_id)` returns the rest.
31
+ - `memory_search(query)` finds how something was solved in an earlier session.
32
+ - `swarm_plan(goal)` splits wide work into per-file tasks with focused context; `swarm(tasks)` runs them on a cheap
33
+ model and checks every answer (citations exist, patches pass the tests in a copy). With no helper model it
34
+ returns `subagent_tasks`: send each `subagent_prompt` to your own subagents (Task tool), then `swarm_verify`.
35
+ - keelyard adds short notes to your context (a brief, past-session snippets, hints before destructive commands).
36
+ They are advisory and rate-limited; act on them when they apply.
37
+
38
+ ## Without MCP
39
+
40
+ Every action is also a CLI command with `--json`, e.g. `keelyard proof status --json`.
41
+ Exit codes: 0 ok, 1 error, 2 usage error, 3 check not passed.
@@ -0,0 +1,8 @@
1
+ ## keelyard
2
+
3
+ This project uses keelyard (proof, rewind, smaller context). Rules:
4
+ - Before saying done: proof_requirements, proof_run_tests(phase="after"), proof_check each item. The Stop hook checks.
5
+ - Find code with find_symbol and read_file line ranges; repeat reads of unchanged files are skipped.
6
+ - Noisy commands: run_compact; recall(id) for the full output.
7
+ - Mistake? rewind_list, rewind_to. Every edit is a step.
8
+ - Workflows on demand: workflow("plan" | "debug" | "review").
@@ -0,0 +1,4 @@
1
+ ## keelyard
2
+
3
+ Every edit is snapshotted (undo: `keelyard rewind list`, `keelyard rewind to N`). Your shell test runs are the proof:
4
+ run the project's tests after your last edit before you finish.
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Prove the current task is done (tests + evidence per requirement)
3
+ argument-hint: [extra requirement]
4
+ ---
5
+ Finish the current task with evidence.
6
+ 1. If `proof_status` shows no requirements, call `proof_requirements` with the user's asks (plus: $ARGUMENTS).
7
+ 2. Call `proof_run_tests` with phase "after". If it fails, fix the cause first.
8
+ 3. Call `proof_check` for each open requirement with concrete evidence (command + result, or path:line).
9
+ 4. Call `proof_status` and report the result. Do not claim done unless it says proven.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Show keelyard status (snapshots, proof checklist, what is missing)
3
+ ---
4
+ Call the keelyard `status` and `proof_status` MCP tools and summarise in three short lines:
5
+ how many snapshots exist, which requirements are proven, and what is still missing.
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Undo recent edits with keelyard rewind
3
+ argument-hint: [step]
4
+ ---
5
+ Call `rewind_list`. If a step was given ($ARGUMENTS), call `rewind_diff` on it, then `rewind_to` it.
6
+ Otherwise show the last 10 steps with their files and ask which one to go back to.
7
+ After rewinding, tell the user the `safety_step` they can use to undo the rewind.
@@ -0,0 +1 @@
1
+ Be terse: no preamble or recap. Keep code exact.
@@ -0,0 +1,9 @@
1
+ Debug loop. Use when something fails and the cause is not obvious.
2
+
3
+ 1. Reproduce: get one command that shows the failure (run_compact). No reproduction, no fix.
4
+ 2. Read the actual error and the stack's top frame in your code. Search memory_search for the error text.
5
+ 3. Form one hypothesis that explains all of the evidence. Write it down in one sentence.
6
+ 4. Test the hypothesis cheaply: a print, an assertion, or a smaller input. Change one thing at a time.
7
+ 5. Wrong hypothesis twice? rewind_to before your experiments, re-read the evidence, widen the search.
8
+ 6. Fix the cause, not the symptom. Add a test that failed before the fix and passes after.
9
+ 7. Run the full suite once at the end (proof_run_tests phase="after").
@@ -0,0 +1,11 @@
1
+ Plan, implement, verify. Use for any change that touches more than one function.
2
+
3
+ 1. Restate the goal in one line. Write each thing the user asked for as a checkable item: proof_requirements.
4
+ If something is ambiguous and expensive to get wrong, ask one question now, not later.
5
+ 2. Locate before reading: find_symbol, then read_file with a line range. Do not read whole directories.
6
+ 3. Plan the smallest change that satisfies every item. List the files you will touch. Name the test that will
7
+ prove each item; if none exists, write it first and watch it fail (proof_run_tests phase="before").
8
+ 4. Implement in small steps. After each step run the narrowest test (run_compact). If a step goes wrong,
9
+ rewind_to the last good step instead of patching on top of the mess.
10
+ 5. Verify: proof_run_tests phase="after", then proof_check each item with the command or path:line that
11
+ proves it. Report what changed, what was proven, and anything you did not do.
@@ -0,0 +1,9 @@
1
+ Review. Use before saying done, or when asked to review a change.
2
+
3
+ Check the diff (rewind_list, then git diff or the step diffs) against each item, in this order:
4
+ 1. Correct: does it do what each requirement says? Edge cases: empty input, None, unicode, large input.
5
+ 2. Safe: secrets, injection, unchecked input, destructive operations, error paths that swallow failures.
6
+ 3. Tested: is every behaviour change covered by a test that would fail without it?
7
+ 4. Small: remove dead code, debug prints, unrelated edits, and new dependencies you did not need.
8
+ 5. Clear: names say what things are; comments say why, not what.
9
+ Report findings as path:line with a one-line reason, most serious first. Say "no findings" if there are none.