inplan 0.1.31 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inplan",
3
- "version": "0.1.31",
3
+ "version": "0.2.0",
4
4
  "description": "inplan — a Markdown editor for human ⇄ coding-agent planning. CLI + desktop editor.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "postinstall": "node bin/cli.js install-skill --quiet || true"
26
26
  },
27
27
  "dependencies": {
28
- "electron": "^43.3.0",
28
+ "electron": "^43.4.1",
29
29
  "@hocuspocus/provider": "^2.15.3",
30
30
  "@supabase/supabase-js": "^2.45.0",
31
31
  "ws": "^8.18.0",
package/skill/SKILL.md CHANGED
@@ -63,10 +63,74 @@ exits with a timeout message while the session is still valid — that is not a
63
63
  re-run the same command and it resumes the same sign-in. If the link itself expires
64
64
  (`expiresInSec`, ~10 minutes), the re-run prints a fresh URL — repeat from 1.
65
65
 
66
+ ## Cloud documents (wait --remote)
67
+
68
+ For a cloud document, `inplan wait --remote <docId>` materializes a **working copy** at
69
+ `~/.inplan/sidecars/remote/<docId>.plan.md` and tells you so on stderr. That working copy is
70
+ **your editing surface** — the one file under the sidecars you may edit (the CLI puts it there
71
+ *for* you). Edit it, then re-run the same `wait` command: the run pushes your edit and waits
72
+ for the human. The `.proposed.*` records described below are **read-only audit state** — read
73
+ them to answer "did my edit land?", but never rewrite or delete them (they are the durable
74
+ history the CLI maintains).
75
+
76
+ **Review mode parks your edit — that is success, not failure.** Most cloud docs are in review
77
+ mode: your body edit is NOT applied to the canonical; it is pushed to the cloud as a
78
+ **proposal** for the human to accept or reject in their editor. Every proposal is a
79
+ first-class object with its own **id** — the same id names it in the wait output, in the local
80
+ record, and in the cloud. When a park happens the wait output carries
81
+ `proposal: { state: "pending_review", id, bytes, hash }`, an `agent_revision_proposed` entry
82
+ (payload `proposal_id`) appears in `entries`, and stderr says the edit was parked.
83
+
84
+ How to audit "did my edit land?" — the answer is a **lookup by that id**, never an inference:
85
+ 1. **This turn:** the `proposal` field in the wait JSON (`pending_review` = safely parked, and
86
+ `id` is the proposal's identity), or a `document_edited` entry (= applied directly to
87
+ canonical). The `proposal` field rides **every** turn-ending output when a park happened
88
+ this turn — `your_turn`/`activity`, `closed`, `navigated`, `wait_failed`, `superseded`, and
89
+ `moved_local` — losing or handing off the wait afterwards does not un-park your edit, so
90
+ check the field (and the record below) before classifying it.
91
+ 2. **Any later turn:** read `<workingCopy>.proposed.json` — the durable record, keyed by the
92
+ same id. Its `state` mirrors the cloud proposal's own state verbatim once the next
93
+ `wait --remote` run reconciles: `accepted`, `partially_accepted`, or `rejected` when the
94
+ human decides, `superseded` when a newer proposal of yours replaced it, `withdrawn` when
95
+ the agent retracted it — the newest record is the authoritative one. (`decided` appears
96
+ only when the proposal itself is gone from the cloud — a legacy park with no row — and
97
+ means the human acted but which way is unknowable.) The exact text you pushed is embedded
98
+ in the record itself (its `text` field — audit from there); `<workingCopy>.proposed.md` is
99
+ only a derived, read-convenience copy that can be missing or stale until the next run
100
+ reconciles it. Every finalized record is appended to `<workingCopy>.proposals.jsonl`.
101
+ 3. A later wait's `entries` may also carry the decision event, whose payload names the decided
102
+ proposal: `revision_accepted_all`, `revision_hunk_accepted`, or `revision_rejected_all`.
103
+
104
+ If the park itself fails, the wait JSON carries `proposal: { state: "park_failed", bytes,
105
+ hash }` (and stderr says the push FAILED) — `park_failed` means exactly that the **cloud push
106
+ was not confirmed**. It does NOT prove the push didn't land: a lost response can leave the
107
+ proposal live in the cloud while the local event and record are missing. (When an EARLIER
108
+ proposal of yours is still pending — the failed push was a re-push — the field carries that
109
+ proposal's `id`.) Either way the retry is safe and automatic — the next `wait` run first
110
+ reconciles from your own pending proposal in the cloud (a landed push is adopted as the
111
+ pending record under its cloud id, not re-sent), and re-pushing identical content is
112
+ idempotent (same proposal identity, no duplicate). Your edit stays in the working copy; do
113
+ not re-create it — just re-run.
114
+
115
+ The converse also holds: a CONFIRMED push stays parked even when a piece of local bookkeeping
116
+ failed around it. The event append or the local record write can fail after the push landed —
117
+ stderr says so when it happens — and the next `wait --remote` run rebuilds the missing record
118
+ from the cloud proposal itself. A temporarily missing event or record therefore never means
119
+ the park failed; only `park_failed` (or the absence of any park signal plus a still-diverged
120
+ working copy) means that.
121
+
122
+ Two things are **normal and must never be read as data loss**: after a healthy turn the
123
+ working copy is re-synced to the current canonical (so your parked edit is no longer in it —
124
+ it lives in `.proposed.md` and in the cloud), and `.synced` tracks only canonical syncs (it
125
+ says nothing about proposals). **Never delete or rewrite your local work because the working
126
+ copy or `.synced` looks stale** — check the proposal record first.
127
+
66
128
  ## File convention
67
129
 
68
130
  Save plans as `<name>.plan.md`. The `inplan` CLI keeps its own working files under
69
- `~/.inplan/sidecars/<key>/` — it owns these; never read or edit them by hand.
131
+ `~/.inplan/sidecars/<key>/` — it owns these; never read or edit them by hand. (Exceptions,
132
+ described above: the `wait --remote` working copy is yours to **edit**, and its `.proposed.*`
133
+ records are yours to **read** for audit — never to modify.)
70
134
 
71
135
  ## Auto-approval (review happens in the app)
72
136