chompyy 0.1.0 → 0.4.0
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.
- package/README.md +82 -8
- package/THIRD_PARTY_NOTICES.md +29 -1
- package/dist/appstate.js +121 -4
- package/dist/away.js +191 -25
- package/dist/blueprint.js +102 -7
- package/dist/board.js +143 -15
- package/dist/catalog.js +81 -0
- package/dist/claudesettings.js +23 -0
- package/dist/cli.js +804 -55
- package/dist/coldstart.js +208 -0
- package/dist/config.js +43 -8
- package/dist/costs.js +162 -0
- package/dist/deps.js +124 -0
- package/dist/dream.js +422 -0
- package/dist/duration.js +3 -3
- package/dist/gate.js +40 -5
- package/dist/history.js +308 -0
- package/dist/live.js +255 -0
- package/dist/livequota.js +42 -5
- package/dist/macapp.js +25 -2
- package/dist/pacing.js +189 -0
- package/dist/permissions.js +106 -0
- package/dist/picture.js +124 -0
- package/dist/picturetype.js +208 -0
- package/dist/preflight.js +168 -0
- package/dist/projects.js +5 -4
- package/dist/quota.js +31 -5
- package/dist/refresh.js +290 -0
- package/dist/report.js +41 -21
- package/dist/review.js +111 -11
- package/dist/runner.js +318 -10
- package/dist/taste.js +528 -0
- package/dist/tokens.js +75 -0
- package/dist/tokenstore.js +61 -0
- package/dist/trace.js +284 -0
- package/dist/triggers.js +193 -0
- package/dist/usage.js +467 -0
- package/dist/vendor/codeburn/prices.js +45 -0
- package/dist/verify.js +150 -0
- package/dist/verifycard.js +146 -0
- package/dist/workspace.js +132 -18
- package/package.json +4 -2
- package/skills/taste/SKILL.md +4 -1
- package/vendor/diagram-design/LICENSE +21 -0
- package/vendor/diagram-design/SKILL.md +399 -0
- package/vendor/diagram-design/UPSTREAM.md +18 -0
- package/vendor/diagram-design/assets/example-arc-diagram.html +111 -0
- package/vendor/diagram-design/assets/example-architecture-containment.html +205 -0
- package/vendor/diagram-design/assets/example-architecture-delta.html +193 -0
- package/vendor/diagram-design/assets/example-architecture.html +183 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-campus.html +108 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-coffee-shop.html +121 -0
- package/vendor/diagram-design/assets/example-axonometric-plan-warehouse.html +127 -0
- package/vendor/diagram-design/assets/example-axonometric-plan.html +114 -0
- package/vendor/diagram-design/assets/example-bar.html +129 -0
- package/vendor/diagram-design/assets/example-beeswarm.html +384 -0
- package/vendor/diagram-design/assets/example-box-plot.html +127 -0
- package/vendor/diagram-design/assets/example-bubble.html +147 -0
- package/vendor/diagram-design/assets/example-bump.html +142 -0
- package/vendor/diagram-design/assets/example-data-flow.html +143 -0
- package/vendor/diagram-design/assets/example-datalake.html +269 -0
- package/vendor/diagram-design/assets/example-db-schema.html +302 -0
- package/vendor/diagram-design/assets/example-dependency.html +224 -0
- package/vendor/diagram-design/assets/example-deployment.html +190 -0
- package/vendor/diagram-design/assets/example-dp-integration.html +81 -0
- package/vendor/diagram-design/assets/example-dp-security-matrix.html +88 -0
- package/vendor/diagram-design/assets/example-er.html +202 -0
- package/vendor/diagram-design/assets/example-event-modeling.html +64 -0
- package/vendor/diagram-design/assets/example-exploded-ai-stack.html +85 -0
- package/vendor/diagram-design/assets/example-exploded-keyboard.html +84 -0
- package/vendor/diagram-design/assets/example-exploded-phone.html +83 -0
- package/vendor/diagram-design/assets/example-exploded-unboxing.html +84 -0
- package/vendor/diagram-design/assets/example-exploded.html +83 -0
- package/vendor/diagram-design/assets/example-fishbone.html +152 -0
- package/vendor/diagram-design/assets/example-flowchart.html +163 -0
- package/vendor/diagram-design/assets/example-gantt.html +137 -0
- package/vendor/diagram-design/assets/example-heatmap.html +224 -0
- package/vendor/diagram-design/assets/example-high-level-vertical.html +325 -0
- package/vendor/diagram-design/assets/example-high-level.html +301 -0
- package/vendor/diagram-design/assets/example-import-drawio.html +185 -0
- package/vendor/diagram-design/assets/example-import-excalidraw.html +70 -0
- package/vendor/diagram-design/assets/example-import-mermaid.html +70 -0
- package/vendor/diagram-design/assets/example-import-plantuml.html +107 -0
- package/vendor/diagram-design/assets/example-it-state.html +128 -0
- package/vendor/diagram-design/assets/example-journey.html +148 -0
- package/vendor/diagram-design/assets/example-kanban.html +174 -0
- package/vendor/diagram-design/assets/example-layers.html +123 -0
- package/vendor/diagram-design/assets/example-line.html +111 -0
- package/vendor/diagram-design/assets/example-loop.html +100 -0
- package/vendor/diagram-design/assets/example-marimekko.html +148 -0
- package/vendor/diagram-design/assets/example-medallion.html +159 -0
- package/vendor/diagram-design/assets/example-nested.html +136 -0
- package/vendor/diagram-design/assets/example-org-chart.html +45 -0
- package/vendor/diagram-design/assets/example-polar.html +116 -0
- package/vendor/diagram-design/assets/example-process.html +64 -0
- package/vendor/diagram-design/assets/example-pyramid.html +119 -0
- package/vendor/diagram-design/assets/example-quadrant-consultant.html +166 -0
- package/vendor/diagram-design/assets/example-quadrant.html +135 -0
- package/vendor/diagram-design/assets/example-radar.html +139 -0
- package/vendor/diagram-design/assets/example-requirement-traceability.html +122 -0
- package/vendor/diagram-design/assets/example-ridgeline.html +104 -0
- package/vendor/diagram-design/assets/example-sankey.html +150 -0
- package/vendor/diagram-design/assets/example-sbgn.html +213 -0
- package/vendor/diagram-design/assets/example-scatter.html +141 -0
- package/vendor/diagram-design/assets/example-sequence-oauth.html +227 -0
- package/vendor/diagram-design/assets/example-sequence.html +222 -0
- package/vendor/diagram-design/assets/example-service-blueprint.html +185 -0
- package/vendor/diagram-design/assets/example-slopegraph.html +119 -0
- package/vendor/diagram-design/assets/example-state-lifecycle.html +92 -0
- package/vendor/diagram-design/assets/example-state.html +147 -0
- package/vendor/diagram-design/assets/example-steps.html +78 -0
- package/vendor/diagram-design/assets/example-story-map.html +184 -0
- package/vendor/diagram-design/assets/example-streamgraph.html +99 -0
- package/vendor/diagram-design/assets/example-swimlane.html +172 -0
- package/vendor/diagram-design/assets/example-timeline.html +135 -0
- package/vendor/diagram-design/assets/example-tree-block-decomposition.html +151 -0
- package/vendor/diagram-design/assets/example-tree.html +173 -0
- package/vendor/diagram-design/assets/example-treemap.html +107 -0
- package/vendor/diagram-design/assets/example-uml-class.html +188 -0
- package/vendor/diagram-design/assets/example-unit-grid.html +141 -0
- package/vendor/diagram-design/assets/example-venn.html +110 -0
- package/vendor/diagram-design/assets/example-wardley.html +153 -0
- package/vendor/diagram-design/assets/example-waterfall.html +129 -0
- package/vendor/diagram-design/assets/template-dark.html +99 -0
- package/vendor/diagram-design/assets/template.html +100 -0
- package/vendor/diagram-design/references/layout-budget.md +103 -0
- package/vendor/diagram-design/references/output-spec.md +277 -0
- package/vendor/diagram-design/references/primitive-annotation.md +36 -0
- package/vendor/diagram-design/references/primitive-sketchy.md +43 -0
- package/vendor/diagram-design/references/primitives-core.md +146 -0
- package/vendor/diagram-design/references/semantic-patterns.md +154 -0
- package/vendor/diagram-design/references/style-guide.md +234 -0
- package/vendor/diagram-design/references/type-architecture-delta.md +143 -0
- package/vendor/diagram-design/references/type-architecture.md +117 -0
- package/vendor/diagram-design/references/type-axonometric-plan.md +83 -0
- package/vendor/diagram-design/references/type-bar.md +108 -0
- package/vendor/diagram-design/references/type-data-flow.md +371 -0
- package/vendor/diagram-design/references/type-db-schema.md +48 -0
- package/vendor/diagram-design/references/type-dependency.md +113 -0
- package/vendor/diagram-design/references/type-deployment.md +45 -0
- package/vendor/diagram-design/references/type-dp-integration.md +407 -0
- package/vendor/diagram-design/references/type-dp-security-matrix.md +379 -0
- package/vendor/diagram-design/references/type-er.md +25 -0
- package/vendor/diagram-design/references/type-event-modeling.md +36 -0
- package/vendor/diagram-design/references/type-exploded.md +115 -0
- package/vendor/diagram-design/references/type-fishbone.md +75 -0
- package/vendor/diagram-design/references/type-flowchart.md +23 -0
- package/vendor/diagram-design/references/type-gantt.md +45 -0
- package/vendor/diagram-design/references/type-heatmap.md +80 -0
- package/vendor/diagram-design/references/type-high-level.md +470 -0
- package/vendor/diagram-design/references/type-it-state.md +468 -0
- package/vendor/diagram-design/references/type-journey.md +55 -0
- package/vendor/diagram-design/references/type-kanban.md +49 -0
- package/vendor/diagram-design/references/type-layers.md +26 -0
- package/vendor/diagram-design/references/type-line.md +337 -0
- package/vendor/diagram-design/references/type-loop.md +223 -0
- package/vendor/diagram-design/references/type-medallion.md +356 -0
- package/vendor/diagram-design/references/type-nested.md +22 -0
- package/vendor/diagram-design/references/type-org-chart.md +44 -0
- package/vendor/diagram-design/references/type-polar.md +136 -0
- package/vendor/diagram-design/references/type-process.md +490 -0
- package/vendor/diagram-design/references/type-pyramid.md +33 -0
- package/vendor/diagram-design/references/type-quadrant.md +81 -0
- package/vendor/diagram-design/references/type-radar.md +82 -0
- package/vendor/diagram-design/references/type-requirement-traceability.md +45 -0
- package/vendor/diagram-design/references/type-sankey.md +75 -0
- package/vendor/diagram-design/references/type-sbgn.md +80 -0
- package/vendor/diagram-design/references/type-scatter.md +276 -0
- package/vendor/diagram-design/references/type-sequence.md +130 -0
- package/vendor/diagram-design/references/type-service-blueprint.md +103 -0
- package/vendor/diagram-design/references/type-state.md +30 -0
- package/vendor/diagram-design/references/type-steps.md +180 -0
- package/vendor/diagram-design/references/type-story-map.md +46 -0
- package/vendor/diagram-design/references/type-swimlane.md +22 -0
- package/vendor/diagram-design/references/type-timeline.md +20 -0
- package/vendor/diagram-design/references/type-tree.md +24 -0
- package/vendor/diagram-design/references/type-treemap.md +137 -0
- package/vendor/diagram-design/references/type-uml-class.md +65 -0
- package/vendor/diagram-design/references/type-unit-grid.md +63 -0
- package/vendor/diagram-design/references/type-venn.md +26 -0
- package/vendor/diagram-design/references/type-wardley.md +39 -0
- package/vendor/diagram-design/references/type-waterfall.md +75 -0
- package/vendor/diagram-design/scripts/self_check.py +1177 -0
- package/vendor/diagram-design/scripts/verify_geometry.py +696 -0
package/README.md
CHANGED
|
@@ -29,6 +29,19 @@ You also need [Claude Code](https://code.claude.com) (`claude` on your PATH) for
|
|
|
29
29
|
|
|
30
30
|
By default Chompyy reads live quota with Claude Code's saved login (macOS Keychain or `~/.claude/.credentials.json`), from the same usage endpoint Claude Code's `/usage` shows. It sends no message, so it never starts a window, and it checks at most every 5 minutes. Nothing to set up. To use only the status line instead, set `"quotaSource": "statusline"` in `~/.chompyy/config.json`.
|
|
31
31
|
|
|
32
|
+
### Pacing
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
🍪 5h 22% left ⇡41% · 3h07m · limit ~20:24 | 7d 24% used ⇣7%
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- **Pace delta**: used % minus the % of the window that has passed. `⇣` (green) is headroom, `⇡` (red) is burning faster than an even pace.
|
|
39
|
+
- **Forecast**: from your pace over the last hour (or your average this window), how much of the 5-hour window will reset unused (`~40% unused at 18:20`, the moment to give Chompyy a card), or when you'll hit the limit first. Once a limit is hit it stops projecting and shows when it resets.
|
|
40
|
+
- **Today** (`chompyy status`): what's left of the week ÷ the days left, where your day ends at your `bedtime` (midnight if unset), with on pace / ahead / behind / over. It needs a reading from before today to judge; until then it shows the allowance only.
|
|
41
|
+
- **Per-model weekly limits** (e.g. Opus) appear in `chompyy status` when your plan has them, and the gate respects them: a run on a model whose weekly window is over the hard stop doesn't start.
|
|
42
|
+
|
|
43
|
+
The rate comes from a small history of quota readings (`quota-history.json`, 8 days), saved whenever the numbers change; no extra calls.
|
|
44
|
+
|
|
32
45
|
## Set up the quota snapshot (fallback)
|
|
33
46
|
|
|
34
47
|
Chompyy can also read quota from Claude Code's status line, never by sending a message (if no window is active, the first message would start a new 5-hour window). Add this to `~/.claude/settings.json`:
|
|
@@ -52,6 +65,18 @@ That reads: 62% of the 5h window left, it resets in 1h40m, so about 37% per hour
|
|
|
52
65
|
|
|
53
66
|
If you already have a status line command, keep it and call Chompyy from a small wrapper: save stdin to a variable, pipe it to `chompyy statusline`, and print both.
|
|
54
67
|
|
|
68
|
+
## Get to know you (cold start)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
chompyy history # what it would read: sessions, projects, dates (local, sends nothing)
|
|
72
|
+
chompyy history --digest # the exact text it would send
|
|
73
|
+
chompyy coldstart # one model call: proposes taste lines and suggested cards
|
|
74
|
+
chompyy coldstart accept --taste t1,t2 --cards c1 # the rest are declined
|
|
75
|
+
chompyy keep-history 365 # Claude Code deletes transcripts after 30 days by default
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Only interactive sessions are read (headless runs are skipped). Each proposal must cite your sessions: a taste line needs 3 separate sessions, and a card's quote must really appear in what you said. Anything that doesn't check out is thrown away.
|
|
79
|
+
|
|
55
80
|
## Two-minute walkthrough
|
|
56
81
|
|
|
57
82
|
```bash
|
|
@@ -82,20 +107,51 @@ Each card in a git repo runs in its own worktree at `~/.chompyy/worktrees/<id>`
|
|
|
82
107
|
| Command | What it does |
|
|
83
108
|
|---|---|
|
|
84
109
|
| `chompyy statusline` | Status line hook: reads Claude Code's JSON on stdin, saves the snapshot, prints one line |
|
|
85
|
-
| `chompyy status` | % left in the 5h window, time to reset,
|
|
110
|
+
| `chompyy status` | % left in the 5h window, time to reset, weekly used, pace delta, forecast, today's allowance, per-model weekly windows |
|
|
86
111
|
| `chompyy eat-tokens` | Read-only view of remaining 5h quota and approved/later cards; starts nothing |
|
|
87
|
-
| `chompyy later "<idea>"` | New card in *later*, remembering the current directory. Drafts the blueprint in the background when `claude` is available (`--wait` to wait for it, `--no-blueprint` to skip) |
|
|
112
|
+
| `chompyy later "<idea>"` | New card in *later*, remembering the current directory. Drafts the blueprint in the background when `claude` is available (`--wait` to wait for it, `--no-blueprint` to skip). The card starts titled with the idea's first 60 characters; with the blueprint the same model writes a title of 10 words or fewer (one extra short call, no tools). If that call fails, the first title stays |
|
|
88
113
|
| `chompyy board [--column approved]` | Cards by column: suggested, later, approved, running, review, done |
|
|
89
114
|
| `chompyy show <id>` | One card with its blueprint, last run and rating |
|
|
90
115
|
| `chompyy blueprint <id> [--model m]` | Draft (or redraft) the blueprint with a cheap model |
|
|
116
|
+
| `chompyy picture <id> [--model m]` | Draw (or redraw) the card's picture: a diagram of what it will do, made with the diagram-design skill. Happens on its own after each blueprint while a window is active (`"pictures": false` in config.json turns it off) |
|
|
117
|
+
| `chompyy edit-idea <id>` | Replace a *later* card's idea (and its title) with text from stdin, e.g. `echo "new idea" \| chompyy edit-idea 3`. The blueprint stays; redraft it with `blueprint <id>` |
|
|
91
118
|
| `chompyy approve <id>` / `drop <id>` | Queue a card for away runs / remove it (kept in `archive.jsonl`) |
|
|
92
119
|
| `chompyy away <1h\|30m\|1h30m> [--dry-run] [--force]` | Run approved cards until the time is up or the gate closes |
|
|
93
120
|
| `chompyy report [--all]` | Cards that ran since the last report: one action each, cards needing you first. No paths or raw agent text; ask for those with `show` |
|
|
94
121
|
| `chompyy diff <id>` | The change the card made on its branch |
|
|
95
|
-
| `chompyy keep <id>` | Merge the card's branch into your current branch and remove its worktree. Refuses
|
|
122
|
+
| `chompyy keep <id>` | Merge the card's branch into your current branch and remove its worktree. Refuses when you have unsaved changes in a file the card also changed, or anything staged; other unsaved work is left alone |
|
|
96
123
|
| `chompyy undo <id>` | Throw the run away: remove its worktree and branch (or draft folder). Your own branches are never touched |
|
|
97
124
|
| `chompyy rate <id> <1-5> ["why"]` | Rate a result against its blueprint; moves it to *done* and logs a signal |
|
|
98
|
-
| `chompyy taste` | Show `taste.md`
|
|
125
|
+
| `chompyy taste` | Show `taste.md` |
|
|
126
|
+
| `chompyy taste list` / `why <id>` | Every learned preference and its status / the cards, edits and quotes behind one |
|
|
127
|
+
| `chompyy taste yes\|not-now\|never <id>` | Answer the report's question. Only *yes* writes it to `taste.md`; *never* stops Chompyy proposing it again |
|
|
128
|
+
| `chompyy taste retire <id>` | Stop using a preference; it stays in `taste list` with the reason |
|
|
129
|
+
| `chompyy distill [--force]` | Read new signals and update preferences now (also runs after every away run) |
|
|
130
|
+
| `chompyy trends` | Last 7 days vs the 7 before: cost per card, keep rate, rating, blueprint edits |
|
|
131
|
+
| `chompyy triggers on\|off` | Install or remove the macOS LaunchAgent that runs `chompyy tick` every 5 minutes |
|
|
132
|
+
| `chompyy bedtime <23:30\|off>` / `last-hour <on\|off>` / `missed-reset <on\|off>` | Turn the bedtime, last-hour-before-reset and missed-reset (first tick after an unused reset, default off) triggers on or off |
|
|
133
|
+
|
|
134
|
+
## Taste
|
|
135
|
+
|
|
136
|
+
Chompyy learns how you like work done from what you do with results, not from what you tell it:
|
|
137
|
+
|
|
138
|
+
1. **Signals** collect in `signals.jsonl`: ratings and their reasons, "what would have made it a 5?" picks, blueprint edits, keep and undo, answers. Only cards you approved, ran or rated count; drafts you dropped don't.
|
|
139
|
+
2. **The distiller** (`distillModel`, default sonnet; one model call, only inside an active window) reads new signals and proposes preferences. Each one must cite signals, and the citations are checked, so it can't invent evidence.
|
|
140
|
+
3. **Asked, not assumed.** A preference becomes a question after 3 separate cards, or after one if you said it yourself in a rating. The report asks at most one question, strongest evidence first.
|
|
141
|
+
4. **Yes** writes it to `taste.md` with a valid-from date, and away runs get `taste.md` in their prompt. Contradicted or removed preferences are retired with the reason, never silently deleted. Delete a learned line from `taste.md` and that preference is retired: your edits win.
|
|
142
|
+
|
|
143
|
+
## Triggers
|
|
144
|
+
|
|
145
|
+
`chompyy triggers on` installs a LaunchAgent (`~/Library/LaunchAgents/dev.chompyy.tick.plist`) that runs `chompyy tick` every 5 minutes. Nothing fires until you turn it on. A tick starts an away run when:
|
|
146
|
+
|
|
147
|
+
- **last hour**: the 5-hour window resets within the hour with at least `lastHourMinLeftPct` left (default 25%); once per window;
|
|
148
|
+
- **bedtime**: it's within `bedtimeWindowMin` (default 60) of your `bedtime`; once a night. At bedtime it also distils taste when there's something new.
|
|
149
|
+
|
|
150
|
+
Either way the run lasts until 2 minutes before the reset, the budget gate still decides every card, and only one away runs at a time (`away.lock`). Ticks are logged to `tick.log`.
|
|
151
|
+
|
|
152
|
+
## Cost ranges
|
|
153
|
+
|
|
154
|
+
Each run records what it used of your windows: 5-hour and weekly quota after the card minus before (it also counts anything else you did at the same time, so it's an upper bound). A card that hasn't run shows a range from similar past runs (`show`, `eat-tokens`): min–max at first, P10–P90 once there are 5 or more.
|
|
99
155
|
|
|
100
156
|
## The budget gate
|
|
101
157
|
|
|
@@ -129,6 +185,18 @@ An unknown weekly window doesn't close the gate (some plans don't report it); `a
|
|
|
129
185
|
| `sandbox` | `true` | Run away cards in Claude Code's OS sandbox (macOS, Linux, WSL2) |
|
|
130
186
|
| `sandboxAllowedDomains` | `[]` | Domains sandboxed commands may reach, e.g. `["registry.npmjs.org"]` |
|
|
131
187
|
| `extraArgs` | `[]` | Appended to every away-run `claude -p` call, e.g. `["--max-budget-usd", "2"]` for API-key users |
|
|
188
|
+
| `denyReadPaths` | `~/.ssh`, `~/.aws`, `~/.gnupg`, … | Never readable by away runs (sandbox `denyRead` + `Read(...)` deny rules) |
|
|
189
|
+
| `loopRepeat` | `5` | Circuit breaker: stop a card that repeats the same tool call this often; `0` = off |
|
|
190
|
+
| `independentCheck` | `true` | Run the repo's tests after each card, sandboxed (macOS) |
|
|
191
|
+
| `checkTimeoutMin` | `10` | Time limit for that check |
|
|
192
|
+
| `checkCommands` | `{}` | Test command per repo when the detected one is wrong, e.g. `{"/Users/me/app": "npm run test:unit"}` |
|
|
193
|
+
| `suggestedExpiryDays` | `14` | Archive suggested cards untouched this long; `0` = never |
|
|
194
|
+
| `distillModel` | `"sonnet"` | Model that distils taste from your signals |
|
|
195
|
+
| `distillAfterAway` | `true` | Distil after each away run when there are new signals |
|
|
196
|
+
| `lastHourTrigger` | `true` | Last-hour trigger (only fires once `chompyy triggers on`) |
|
|
197
|
+
| `lastHourMinLeftPct` | `25` | Last-hour trigger needs at least this much of the window left |
|
|
198
|
+
| `bedtime` | `null` | Bedtime trigger as `"23:30"`; `null` = off |
|
|
199
|
+
| `bedtimeWindowMin` | `60` | How long after bedtime it may still start |
|
|
132
200
|
|
|
133
201
|
Set `CHOMPYY_HOME` to keep state somewhere other than `~/.chompyy` (the tests do this).
|
|
134
202
|
|
|
@@ -138,9 +206,12 @@ A card runs unattended only inside a box (spec §5.5):
|
|
|
138
206
|
|
|
139
207
|
- **Its own place**: a fresh git worktree on `chompyy/<id>`, or a draft folder under `~/.chompyy/runs/<id>/`. Your checkout is never touched; nothing is merged.
|
|
140
208
|
- **Rules in the prompt**, before the blueprint: work only inside this directory; no git push, merge, rebase or PR; no sending, posting, publishing or purchases; if a decision is needed, stop and write `QUESTIONS.md` (the report flags those cards as ❓).
|
|
141
|
-
- **Enforced by the OS** (default, `sandbox: true`): cards run in Claude Code's sandbox. Shell commands can write only inside the card's folder (plus its repo's `.git`, so commits work) and have **no network** unless you list domains in `sandboxAllowedDomains`. So a `git push` fails even if a test script tries it. If the sandbox can't start, the card refuses to run rather than run unprotected. Checked on macOS with a real headless run: network and outside writes were blocked, the commit worked.
|
|
209
|
+
- **Enforced by the OS** (default, `sandbox: true`): cards run in Claude Code's sandbox. Shell commands can write only inside the card's folder (plus its repo's `.git`, so commits work) and have **no network** unless you list domains in `sandboxAllowedDomains`. So a `git push` fails even if a test script tries it. If the sandbox can't start, the card refuses to run rather than run unprotected. Checked on macOS with a real headless run: network and outside writes were blocked, the commit worked. Credential folders (`denyReadPaths`: `~/.ssh`, `~/.aws`, `~/.gnupg`, cloud CLI configs, `.netrc`, `.npmrc`, Keychains, …) can't be read, by shell commands or by the file tools; other reads are allowed.
|
|
142
210
|
- **Rules in the tools**: `acceptEdits` plus an allow list, a deny list for push/merge/`gh`/publish, and `--permission-prompts none` so anything outside the lists is refused instead of waiting for you.
|
|
143
|
-
- **Caps**: a wall-clock timeout per card, a turn cap, the away duration, and the budget gate above.
|
|
211
|
+
- **Caps**: a wall-clock timeout per card, a turn cap, the away duration, and the budget gate above. The gate never lets a card start past 100% of a window, so a plan with extra usage turned on is never billed by Chompyy.
|
|
212
|
+
- **Circuit breaker**: away runs are watched as they happen. The same tool call 5 times in the last 20, or the same shell command failing 4 times in a row, stops the card (⛔ *stuck* in the report). `loopRepeat` sets the number; `0` turns it off.
|
|
213
|
+
- **Independent check**: after a run, Chompyy runs the repo's own tests itself (`npm test`, `go test`, `cargo test --offline`, `pytest`, `make test`; set your own per repo in `checkCommands`). They run in a macOS sandbox: writes only in the card's folder, no network, no credential reads. A fresh worktree has no `node_modules`, so your checkout's is linked in for the check. The report trusts this result over what the agent says. If a failure looks like the sandbox blocked something (a write outside the folder, the network), the report says so instead of calling the change broken. Skipped on other systems; `independentCheck: false` turns it off.
|
|
214
|
+
- **Overlaps**: approving a card warns when a queued or unreviewed card looks like it touches the same files.
|
|
144
215
|
- **Blueprint first**: a card can't be approved without one.
|
|
145
216
|
|
|
146
217
|
These lower the risk; they don't make it zero. Read the result (and its branch) before you merge anything.
|
|
@@ -166,8 +237,11 @@ Everything is plain JSON or Markdown in `~/.chompyy/`:
|
|
|
166
237
|
| `board.json` | Cards, with blueprints, run info and ratings |
|
|
167
238
|
| `runs/<id>/<time>.log` | Prompt, output and errors of each run |
|
|
168
239
|
| `worktrees/<id>/` | Git worktrees of cards that ran in a repo |
|
|
169
|
-
| `signals.jsonl` |
|
|
170
|
-
| `
|
|
240
|
+
| `signals.jsonl` | Everything you did that teaches taste: ratings, blueprint edits, keep/undo, answers, taste answers |
|
|
241
|
+
| `preferences.json` | Learned preferences with evidence, status, valid-from and retired-because |
|
|
242
|
+
| `taste.md` | What's been learned and confirmed, plus your own lines; edit freely |
|
|
243
|
+
| `runs.jsonl` | One line per run: duration and what it used of the 5-hour and weekly windows |
|
|
244
|
+
| `triggers.json` / `tick.log` | What fired, and what each tick decided |
|
|
171
245
|
| `archive.jsonl` | Dropped cards |
|
|
172
246
|
| `state.json` | When the last report was shown |
|
|
173
247
|
| `config.json` | Your settings |
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Third-party code
|
|
4
4
|
|
|
5
|
-
`cli/src/vendor/codeburn/`: from [codeburn](https://github.com/getagentseal/codeburn) (MIT, Copyright (c) 2026 AgentSeal). See its `UPSTREAM.md` and `LICENSE`.
|
|
5
|
+
`cli/src/vendor/codeburn/`: from [codeburn](https://github.com/getagentseal/codeburn) (MIT, Copyright (c) 2026 AgentSeal). See its `UPSTREAM.md` and `LICENSE`. Its `prices.ts` holds the Claude rows of codeburn's snapshot of [LiteLLM](https://github.com/BerriAI/litellm)'s `model_prices_and_context_window.json` (MIT, Copyright (c) 2023 Berri AI).
|
|
6
6
|
|
|
7
7
|
Its licence, in full (MIT requires it in every copy, including the npm package):
|
|
8
8
|
|
|
@@ -29,3 +29,31 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
29
29
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
30
|
SOFTWARE.
|
|
31
31
|
```
|
|
32
|
+
|
|
33
|
+
`cli/vendor/diagram-design/`: from [diagram-design](https://github.com/cathrynlavery/diagram-design) (MIT, Copyright (c) 2025 Cathryn Lavery), the skill that draws every card's picture. See its `UPSTREAM.md` for what was kept and changed.
|
|
34
|
+
|
|
35
|
+
Its licence, in full:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
MIT License
|
|
39
|
+
|
|
40
|
+
Copyright (c) 2025 Cathryn Lavery
|
|
41
|
+
|
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
43
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
44
|
+
in the Software without restriction, including without limitation the rights
|
|
45
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
46
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
47
|
+
furnished to do so, subject to the following conditions:
|
|
48
|
+
|
|
49
|
+
The above copyright notice and this permission notice shall be included in all
|
|
50
|
+
copies or substantial portions of the Software.
|
|
51
|
+
|
|
52
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
54
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
55
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
56
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
57
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
58
|
+
SOFTWARE.
|
|
59
|
+
```
|
package/dist/appstate.js
CHANGED
|
@@ -1,23 +1,62 @@
|
|
|
1
1
|
// What the Mac app reads (`chompyy state --json`) and the card actions it needs beyond the CLI's.
|
|
2
2
|
// The app holds no logic of its own: it shows this JSON and calls chompyy commands.
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
3
4
|
import { readFileSync, existsSync } from 'node:fs';
|
|
5
|
+
import { clashOf } from './refresh.js';
|
|
4
6
|
import { join } from 'node:path';
|
|
5
|
-
import { getCard } from './board.js';
|
|
7
|
+
import { getCard, titleFrom } from './board.js';
|
|
6
8
|
import { budgetGate } from './gate.js';
|
|
7
9
|
import { appendJsonl, homePath, readJson, writeJson } from './home.js';
|
|
8
|
-
import { loadLiveState } from './livequota.js';
|
|
10
|
+
import { keychainAsk, loadLiveState } from './livequota.js';
|
|
9
11
|
import { windowView } from './quota.js';
|
|
12
|
+
import { loadSamples, pacing } from './pacing.js';
|
|
10
13
|
import { changedFiles } from './review.js';
|
|
11
|
-
|
|
14
|
+
import { loadColdStart } from './coldstart.js';
|
|
15
|
+
import { blueprintHash } from './picture.js';
|
|
16
|
+
import { costRange, readRuns } from './costs.js';
|
|
17
|
+
import { cachedWorkspaces, loadDream } from './dream.js';
|
|
18
|
+
import { describeSignal, loadStore, nextQuestion, readSignals, receipts } from './taste.js';
|
|
19
|
+
import { agentInstalled, loadTriggerState } from './triggers.js';
|
|
20
|
+
import { planFor } from './permissions.js';
|
|
21
|
+
import { loadProfile, preflightHosts } from './preflight.js';
|
|
22
|
+
import { gitRoot } from './workspace.js';
|
|
23
|
+
import { writeBlueprintFile } from './blueprint.js';
|
|
24
|
+
export function cardView(card, runs = readRuns()) {
|
|
12
25
|
const qPath = card.run ? join(card.run.workdir, 'QUESTIONS.md') : '';
|
|
13
26
|
return {
|
|
14
27
|
...card,
|
|
15
28
|
files: card.run ? changedFiles(card) : [],
|
|
16
29
|
questionsText: qPath && existsSync(qPath) ? readFileSync(qPath, 'utf8') : null,
|
|
30
|
+
pictureStale: Boolean(card.picture && card.picture.blueprintHash !== blueprintHash(card.blueprint)),
|
|
31
|
+
costRange: card.run ? null : costRange(card, runs),
|
|
32
|
+
folderBranch: card.column === 'review' && card.run?.branch ? (card.run.base?.branch || currentBranch(card.cwd)) : null,
|
|
33
|
+
clashFiles: card.column === 'review' ? clashOf(card)?.files ?? [] : [],
|
|
34
|
+
permissionPlan: ['later', 'suggested', 'approved'].includes(card.column) ? permissionPlanFor(card) : [],
|
|
17
35
|
};
|
|
18
36
|
}
|
|
37
|
+
/** The card's permission plan: earlier runs' blocks in its repo, preflight's network needs, the blueprint's Needs. */
|
|
38
|
+
function permissionPlanFor(card) {
|
|
39
|
+
try {
|
|
40
|
+
const root = gitRoot(card.cwd);
|
|
41
|
+
const profile = root ? loadProfile(root) : null;
|
|
42
|
+
return planFor(card.blueprint ?? undefined, profile?.needs ?? [], preflightHosts(profile));
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return planFor(card.blueprint ?? undefined, []);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** The branch a folder is on (what Keep merges into), or null. */
|
|
49
|
+
export function currentBranch(cwd) {
|
|
50
|
+
try {
|
|
51
|
+
return execFileSync('git', ['-C', cwd, 'rev-parse', '--abbrev-ref', 'HEAD'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || null;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
19
57
|
export function appState(board, snap, config, now) {
|
|
20
58
|
const live = loadLiveState();
|
|
59
|
+
const runs = readRuns();
|
|
21
60
|
return {
|
|
22
61
|
generatedAt: now.toISOString(),
|
|
23
62
|
quota: {
|
|
@@ -25,13 +64,70 @@ export function appState(board, snap, config, now) {
|
|
|
25
64
|
capturedAt: snap?.capturedAt ?? null,
|
|
26
65
|
plan: live.plan ?? null,
|
|
27
66
|
note: live.note ?? null,
|
|
67
|
+
askKeychain: keychainAsk(config),
|
|
28
68
|
fiveHour: windowView(snap?.fiveHour, now),
|
|
29
69
|
sevenDay: windowView(snap?.sevenDay, now),
|
|
70
|
+
pacing: pacing(snap, loadSamples(), now, config.bedtime),
|
|
30
71
|
},
|
|
31
72
|
gate: budgetGate(snap, config, now),
|
|
32
|
-
cards: board.cards.map(cardView),
|
|
73
|
+
cards: board.cards.map((c) => cardView(c, runs)),
|
|
74
|
+
coldStart: coldStartState(),
|
|
75
|
+
tasteQuestion: tasteQuestion(),
|
|
76
|
+
taste: tasteState(),
|
|
77
|
+
dream: dreamState(config, now),
|
|
78
|
+
triggers: { installed: agentInstalled(), lastHour: config.lastHourTrigger, bedtime: config.bedtime, ...loadTriggerState() },
|
|
33
79
|
};
|
|
34
80
|
}
|
|
81
|
+
/** The nightly read for the app: on or off, the workspaces with their ticks, and how last night went. */
|
|
82
|
+
function dreamState(config, now) {
|
|
83
|
+
let workspaces = [];
|
|
84
|
+
try {
|
|
85
|
+
workspaces = cachedWorkspaces(now);
|
|
86
|
+
}
|
|
87
|
+
catch { }
|
|
88
|
+
const s = loadDream();
|
|
89
|
+
return { on: config.dream, model: config.dreamModel, workspaces, last: s.last ?? null };
|
|
90
|
+
}
|
|
91
|
+
/** The one taste question waiting, with its receipts, for the app to show as a one-tap card. */
|
|
92
|
+
export function tasteQuestion() {
|
|
93
|
+
const signals = readSignals();
|
|
94
|
+
const p = nextQuestion(loadStore(), signals);
|
|
95
|
+
if (!p)
|
|
96
|
+
return null;
|
|
97
|
+
const byId = new Map(signals.map((s) => [s.id, s]));
|
|
98
|
+
return { id: p.id, text: p.text, noticed: p.noticed, scope: p.scope, evidence: receipts(p.evidence.map((e) => byId.get(e)).filter(Boolean)) };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* For "What Chompyy heard from you": the rules waiting for your yes (strongest evidence first) and the ones in
|
|
102
|
+
* force. The app shows the waiting count as a badge on the button.
|
|
103
|
+
*/
|
|
104
|
+
export function tasteState() {
|
|
105
|
+
const signals = readSignals();
|
|
106
|
+
const byId = new Map(signals.map((s) => [s.id, s]));
|
|
107
|
+
const store = loadStore();
|
|
108
|
+
const item = (p) => {
|
|
109
|
+
const ev = p.evidence.map((e) => byId.get(e)).filter((s) => Boolean(s));
|
|
110
|
+
return {
|
|
111
|
+
id: p.id, text: p.text, noticed: p.noticed, scope: p.scope, evidence: receipts(ev),
|
|
112
|
+
receipts: ev.map((s) => ({ at: s.at, card: s.card ?? null, title: s.title ?? null, said: describeSignal(s, 600) })),
|
|
113
|
+
...(p.validFrom ? { since: p.validFrom } : {}),
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
const waiting = [];
|
|
117
|
+
for (let q = nextQuestion(store, signals), rest = { ...store, prefs: [...store.prefs] }; q; q = nextQuestion(rest, signals)) {
|
|
118
|
+
waiting.push(q);
|
|
119
|
+
rest.prefs = rest.prefs.filter((p) => p.id !== q.id);
|
|
120
|
+
}
|
|
121
|
+
return { waiting: waiting.map(item), learned: store.prefs.filter((p) => p.status === 'active').map(item) };
|
|
122
|
+
}
|
|
123
|
+
/** Whether the app should offer the cold start: never run, proposals waiting, or done. */
|
|
124
|
+
export function coldStartState() {
|
|
125
|
+
const cs = loadColdStart();
|
|
126
|
+
if (!cs)
|
|
127
|
+
return { status: 'never', waiting: 0 };
|
|
128
|
+
const waiting = [...cs.taste, ...cs.cards].filter((p) => p.status === 'proposed').length;
|
|
129
|
+
return { status: waiting ? 'proposed' : 'done', waiting };
|
|
130
|
+
}
|
|
35
131
|
/** Replace a card's blueprint with your edit. Edits are the strongest taste signal, so the change is logged. */
|
|
36
132
|
export function editBlueprint(board, id, text, now) {
|
|
37
133
|
const card = getCard(board, id);
|
|
@@ -45,10 +141,28 @@ export function editBlueprint(board, id, text, now) {
|
|
|
45
141
|
return card;
|
|
46
142
|
card.blueprint = next;
|
|
47
143
|
delete card.blueprintError;
|
|
144
|
+
delete card.blueprintWaiting;
|
|
145
|
+
delete card.blueprintWaitUntil;
|
|
146
|
+
writeBlueprintFile(card, next);
|
|
48
147
|
card.updatedAt = now.toISOString();
|
|
49
148
|
appendJsonl(homePath('signals.jsonl'), { at: card.updatedAt, card: card.id, title: card.title, kind: 'blueprint-edit', before, after: next });
|
|
50
149
|
return card;
|
|
51
150
|
}
|
|
151
|
+
/** Replace a parked card's idea (and the title made from it). Only cards still in `later`: once approved, the blueprint is the contract. */
|
|
152
|
+
export function editIdea(board, id, text, now) {
|
|
153
|
+
const card = getCard(board, id);
|
|
154
|
+
if (card.column !== 'later')
|
|
155
|
+
throw new Error(`Card #${card.id} is in ${card.column}; only cards in later can have their idea edited.`);
|
|
156
|
+
const next = text.trim();
|
|
157
|
+
if (!next)
|
|
158
|
+
throw new Error('The idea is empty.');
|
|
159
|
+
if (card.idea === next)
|
|
160
|
+
return card;
|
|
161
|
+
card.idea = next;
|
|
162
|
+
card.title = titleFrom(next);
|
|
163
|
+
card.updatedAt = now.toISOString();
|
|
164
|
+
return card;
|
|
165
|
+
}
|
|
52
166
|
/** Answer the run's questions: the card goes back to approved and the next run gets your answers. */
|
|
53
167
|
export function answerCard(board, id, text, now) {
|
|
54
168
|
const card = getCard(board, id);
|
|
@@ -70,6 +184,9 @@ export function recordCliLocation() {
|
|
|
70
184
|
const path = homePath('cli.json');
|
|
71
185
|
const want = { node: process.execPath, script: process.argv[1] };
|
|
72
186
|
const have = readJson(path, {});
|
|
187
|
+
// The live copy (live.ts) owns cli.json once set: running a CLI from a work folder must not take the app over.
|
|
188
|
+
if (have.live && have.script && existsSync(have.script))
|
|
189
|
+
return;
|
|
73
190
|
if (have.node !== want.node || have.script !== want.script)
|
|
74
191
|
writeJson(path, want);
|
|
75
192
|
}
|